UNPKG

h5-cli

Version:

hello

68 lines (57 loc) 1.56 kB
"use strict"; //define(function (require, exports, module) { define(function (require, exports, module) { var PageModule = require("component/PageModule"); var page = PageModule.render({ init: function init() { this.orderUrl = this.config.orderUrl; this.extension = "uid=" + this.util.getUID(); this.uid = this.util.getTID(); //this.util.getUID(); this._id = this.query._id; var self = this; try { var text = this.query.text; if (text) { $('#J_Textarea').text(text); } } catch (e) {} this.regEvent(); }, regEvent: function regEvent() { var self = this; var icons = $('#J_Level .icon'); icons.click(function () { var index = $(this).data("index"); icons.removeClass("on"); $(icons.slice(0, index)).addClass("on"); $('#J_LevelInput').val(index); }); $('#J_Submit').click(function () { var text = $.trim($('#J_Textarea').val()); if (!text) { self.util.alert("\u8bf7\u586b\u5199\u53cd\u9988\u5efa\u8bae"); return; } self.util.alert("\u53cd\u9988\u63d0\u4ea4\u6210\u529f\uff0c\u611f\u8c22\u60a8\u5bf9\u6211\u4eec\u7684\u652f\u6301"); $('#J_Textarea').val(''); self.submit(text); }); }, submit: function submit(text) { var self = this; var url = self.orderUrl + "/reply"; this.get(url, { uid: self.uid, content: text, _id: self._id, extension: self.extension }); }, onComplate: function onComplate() { var self = this; self.util.goBack(true); } }); page.init(); module.exports = page; });