h5-cli
Version:
hello
49 lines (39 loc) • 1.21 kB
JavaScript
;
//\u663e\u793aPageTips
define('mods/page-top-tip/index', function (require, exports, module) {
var VModule = require("component/VModule");
var page = VModule.render({
init: function init(element, tipKey) {
this.element = element;
this.tipKey = tipKey;
this.state = {
loading: true,
text: ""
};
this.initModule(this.state, element);
this.get('/user-web/restapi/common/corp/getGuideCopy', { corpId: this.query.corpId });
},
onSuccess: function onSuccess(result) {
this.setState({
loading: false,
success: true,
text: result.data[this.tipKey]
});
},
renderLoading: function renderLoading() {
return "";
},
render: function render(state) {
var text = state.text;
if (text) {
return "\n <div class=\"sections-tips\">\n <i class=\"ui-icon-bugle\"></i>\n <div class=\"text\">\n " + text + "\n </div>\n </div>\n ";
} else {
return "";
}
},
renderError: function renderError() {
return "";
}
});
module.exports = page;
});