UNPKG

vesh-cli

Version:

码农村nodejs版本VESH框架脚手架搭建器

215 lines (209 loc) 12 kB
// (function (V, M, $) { // new function () { // var _ = this, __ = {}; // { // V.watch(); // V.isDebug = true; // var config = V.merge(window.config, { // Middler: { // 'VESH.view': { // titlepart: { path: '../../style/module/part/title.css;../../Scripts/module/part/title.js' }, // transaction: { type: '.Box' }, // calender: { path: '../../style/module/part/calender2.css;../../Scripts/module/part/calender2.js' }, // list: { path: '../../style/module/part/list.css;../../Scripts/module/part/list.js' }, // today: { path: '../../style/module/home/my.css;../../Scripts/module/home/today.js', params: ['../../Module/home/Today.part'] }, // my: { type: '.Box' }, // create: { type: '.Box' }, // detail: { type: '.Box' }, // login: { type: '.Box' }, // regist: { type: '.Box' }, // appobject: { type: 'SHI.view.AppObject', path: '../../Scripts/module/part/app.js' }, // textbox: { params: ['', { onFocus: function (D, I) { if ((D.isError && D.error == D.value) || D.value == D.title) { I.update({ value: false }); } }, onError: function (D, I) { I.update({ value: D.error }); } }] } // } // } // }); // var vm = { // title: { // data: { value: 1, values: [{ index: 0, name: '事' }, { index: 1, name: '今日事' }, { index: 2, name: '我' }] }, // onLoad: function (data, self) { // }, // onChange: function (data, self) { // this.pages.update({ value: data.value }); // V.callEvent('Index.change', [data.value]); // return data; // } // }, // pages: { // data: { value: 1, lock: true }, // onLoad: function (data, self) { // }, // onChange: function (data, self) { // this.title.update({ value: data.value }); // V.callEvent('Index.change', [data.value]); // } // }, // aimspage: { // data: { value: 0 }, // onLoad: function (data, self) { // V.registEvent('Index.change', function (index) { // if ((index + '') == '0') { // self.call('active', { userId: _.page.data.userId, firstShow: true }); // } else { // self.call('noactive'); // } // }); // } // }, // todaypage: { // data: { value: 0 }, // onLoad: function (data, self) { // V.registEvent('Index.change', function (index) { // if ((index + '') == '1') { // self.call('active', { userId: _.page.data.userId }); // } // }); // } // }, // mypage: { // data: { value: 0 }, // onLoad: function (data, self) { // V.registEvent('Index.change', function (index) { // if ((index + '') == '2') { // self.call('active', { userId: _.page.data.userId }); // } // }); // } // }, // create: { // data: { value: 0, visible: false }, // onLoad: function (data, self) { // } // }, // detail: { // data: { value: 0 }, // onLoad: function (data, self) { // } // }, // login: { // data: { user: User ? User : true }, // onLoad: function (D, I) { alert(22); console.log('onload'); I.update({ active: true }) }, // onRegist: function (D, I) { this.regist.update({ active: true }); }, // onSuccess: function (D, I) { V.callEvent('index.login', [D.value]); } // }, // regist: { // data: {}, // onSuccess: function (D, I) { V.callEvent('index.login', [D.value]); }, // onCancel: function (D, I) { this.login.update({ active: true }); } // }, // alert: { data: { title: '事儿--做时间的主人', autobind: true } }, // his: { // data: { value: 0 }, // onLoad: function (data, self) { // V.registEvent('Index.change', function (index) { // self.update({ add: 'title:' + index }); // }); // self.update({ add: 'index:' }); //把首页也加进来 // }, // onChange: function (data, self) { // console.log(data); // var _ = this; // var order = data.hash.split(':'); // if (order.length == 0) return; // switch (order[0]) { // case 'title': // _.title.update({ value: order[1] }); // _.pages.update({ value: order[1] }); // V.callEvent("Index.change", order[1]); // break; // } // var action = data.lastAction ? data.lastAction.split(':') : ""; // switch (action[0]) { // case 'orderDetaiHide': // if (this.orderDetail.data.visible) { // this.orderDetail.update({ hide: 'fadeOutRight' }); // } // break; // } // } // }, // appobject: { // data: { userId: { test: "22" } }, // onLoad1: function (data, self) { // V.registEvent("Index.change", function (value) { // switch (value + "") { // case "0": // self.update({ settitle: '我的电子小票' }); // break; // case "1": // self.update({ settitle: '未支付订单' }); // break; // case "2": // self.update({ settitle: '已支付订单' }); // break; // } // }); // } // }, // page: { // data: { // title: '事儿' // }, // onResize: function (data, self) { // self.resizeheight(data, self); // }, // resizeheight: function (data, self) { // var heights = { // pageHeight: (function () { // //if (window.innerHeight) // // return window.innerHeight; // //else if ((document.body) && (document.body.clientHeight)) // // return document.body.clientHeight; // ////通过深入Document内部对body进行检测,获取窗口大小 // //if (document.documentElement && document.documentElement.clientHeight) // if (document.body && document.body.clientHeight > 0) // return document.body.clientHeight; // else // return document.documentElement.clientHeight; // })() // }; // //三栏下的高度 // heights.pagesHeight = heights.pageHeight - this.title.v.node.height(); // $('.g_pages').height(heights.pagesHeight); // $('.p_list3').height(heights.pagesHeight); // return; // heights.listHeight = heights.pagesHeight - this.receipts.controls.bunNext.v.node.height(); // $('.p_receipt_list').height(heights.listHeight); // $('.p_receiptdetail').height(heights.pageHeight); // heights.list2Height = heights.pageHeight - this.receipt.controls.notice.v.node.parent().height() - this.receipt.controls.bunNext.v.node.parent().height(); // console.log(heights.pageHeight, this.receipt.controls.notice.v.node.parent().height(), this.receipt.controls.bunNext.v.node.parent().height(), (heights.pageHeight - this.receipt.controls.notice.v.node.parent().height() - this.receipt.controls.bunNext.v.node.parent().height())); // this.receipt.controls.rp.v.node.height(heights.list2Height); // $('.p_orderdetail,.p_orderdetail>div').height(heights.pageHeight); // heights.payHeight = heights.pageHeight - 55; // $('#panPayDetail,#payp').height(heights.payHeight); // //$('#sp').height(heights.payHeight - $('.pay-codeinfo').height() - $('.pay-head').height() - 10 - 10 - $('.pay-info-gopay').height()); // //现在根据页面信息计算.g_window的高度,.g_background的高度 // //计算p_list的高度 // heights.backgroundHeight = heights.pageHeight; // data.heights = heights; // console.log(heights); // }, // onStart: function (data, self) { // V.watch(); // V.registEvent("receipt.submit", function (id) { // data.submitids = id; // console.log('receipt.submit' + id); // self.submit(data, self); // }); // V.registEvent('Index.submitReceipt', function (id) { // data.submitids = id; // self.submit(data, self); // }); // /*特殊代码段 重新计算屏幕高度*/ // self.resizeheight.apply(this, [data, self]); // } // } // }; // V.inherit.apply(_, [M.Page, [config, vm]]); // } // }; // })(VJ, VJ.viewmodel, jQuery);