WeChat ???? ?? ???? ??????? ???? ??? ?????? ? ????? ?? ???? ?????? ?? ?? ???? ??? ?????. ??? ?? ????!
WeChat ?? ?????? ? ???, ?? ???, ?? ?? ???, ?? ??? ?? ????. ??? ???? ??? ??? ? ????. ?? ???? ?? ???? ? ? ? ???? ???? ????? ??? ??? ??????
?? ???? ??? ???? ???? ???? ?? ????. ??? ??? ???? ?? ??? ??? ???? ??? ????. ? ????? ??? ??? ????. ? ????? ??? ?? ??? ????? ?? ??? ??? ? ??? ?????. ? ?? ??? ??? ?????.
??? ? ?? ??? ? ? ?????. ?? ?? ?? ??? ???? ?? ???? ???? ??? ??? ???(?? ?? ??? ??, ?? ?? ?? ???? ??? ???? ?????). . ? ???? ??????? ?? ?? ??? ???? ???? ????? ?? ??? ?? ????? ?? ?? ??????.
Solution
??, ???? ?? ????? ??? ??? ??????? ?? ??????. ????? ??? ??? ?? ??? ??? ?????? ?? ???. ? ??? ?? ?? ???? ?? ???? ?? ????. ??? ??? ?? ???? ??? ??? ? ????. ??? ??? ?????:
const app = getApp() Page({ data: { logs: [] }, onLoad() { app.commonLogin(()=>{ // 處理頁頁面請求 }) } })
??? ?? ??? ???? ? ???, ? ???? ?? onShareAppMessage? ?? ??? ?? ? ?? ??? ???? ??? ?? ?? ??? ?? ??? ???. ??? ? ???? ?? watch? ?? ???? ????.
?? ???
WeChat ???? ? ? ????. ? ???? Page()???. ?? ?? ? ??? ??? ?? ???? MyPage? ???? ? ???? ??? ? ????. ? ??? ??? ??? ????.
tool.js ?? ??
/** * 處理合并參數(shù) */ handlePageParamMerge(arg) { let numargs = arg.length; // 獲取被傳遞參數(shù)的數(shù)值。 let data = {} let page = {} for (let ix in arg) { let item = arg[ix] if (item.data && typeof (item.data) === 'object') { data = Object.assign(data, item.data) } if (item.methods && typeof (item.methods) === 'object') { page = Object.assign(page, item.methods) } else { page = Object.assign(page, item) } } page.data = data return page } /*** * 合并頁面方法以及數(shù)據(jù), 兼容 {data:{}, methods: {}} 或 {data:{}, a:{}, b:{}} */ mergePage() { return this.handlePageParamMerge(arguments) } /** * 處理組件參數(shù)合并 */ handleCompParamMerge(arg) { let numargs = arg.length; // 獲取被傳遞參數(shù)的數(shù)值。 let data = {} let options = {} let properties = {} let methods = {} let comp = {} for (let ix in arg) { let item = arg[ix] // 合并組件的初始數(shù)據(jù) if (item.data && typeof (item.data) === 'object') { data = Object.assign(data, item.data) } // 合并組件的屬性列表 if (item.properties && typeof (item.properties) === 'object') { properties = Object.assign(properties, item.properties) } // 合組件的方法列表 if (item.methods && typeof (item.methods) === 'object') { methods = Object.assign(methods, item.methods) } if (item.options && typeof (item.options) === 'object') { options = Object.assign(options, item.options) } comp = Object.assign(comp, item) } comp.data = data comp.options = options comp.properties = properties comp.methods = methods return comp } /** * 組件混合 {properties: {}, options: {}, data:{}, methods: {}} */ mergeComponent() { return this.handleCompParamMerge(arguments) } /*** * 合成帶watch的頁面 */ newPage() { let options = this.handlePageParamMerge(arguments) let that = this let app = getApp() //增加全局點擊登錄判斷 if (!options.publicCheckLogin){ options.publicCheckLogin = function (e) { let pages = getCurrentPages() let page = pages[pages.length - 1] let dataset = e.currentTarget.dataset let callback = null //獲取回調(diào)方法 if (dataset.callback && typeof (page[dataset.callback]) === "function"){ callback = page[dataset.callback] } // console.log('callback>>', callback, app.isRegister()) //判斷是否登錄 if (callback && app.isRegister()){ callback(e) } else{ wx.navigateTo({ url: '/pages/login/login' }) } } } const { onLoad } = options options.onLoad = function (arg) { options.watch && that.setWatcher(this) onLoad && onLoad.call(this, arg) } const { onShow } = options options.onShow = function (arg) { if (options.data.noAutoLogin || app.isRegister()) { onShow && onShow.call(this, arg) //頁面埋點 app.ga({}) } else { wx.navigateTo({ url: '/pages/login/login' }) } } return Page(options) } /** * 合成帶watch等的組件 */ newComponent() { let options = this.handleCompParamMerge(arguments) let that = this const { ready } = options options.ready = function (arg) { options.watch && that.setWatcher(this) ready && ready.call(this, arg) } return Component(options) } /** * 設(shè)置監(jiān)聽器 */ setWatcher(page) { let data = page.data; let watch = page.watch; Object.keys(watch).forEach(v => { let key = v.split('.'); // 將watch中的屬性以'.'切分成數(shù)組 let nowData = data; // 將data賦值給nowData for (let i = 0; i < key.length - 1; i++) { // 遍歷key數(shù)組的元素,除了最后一個! nowData = nowData[key[i]]; // 將nowData指向它的key屬性對象 } let lastKey = key[key.length - 1]; // 假設(shè)key==='my.name',此時nowData===data['my']===data.my,lastKey==='name' let watchFun = watch[v].handler || watch[v]; // 兼容帶handler和不帶handler的兩種寫法 let deep = watch[v].deep; // 若未設(shè)置deep,則為undefine this.observe(nowData, lastKey, watchFun, deep, page); // 監(jiān)聽nowData對象的lastKey }) } /** * 監(jiān)聽屬性 并執(zhí)行監(jiān)聽函數(shù) */ observe(obj, key, watchFun, deep, page) { var val = obj[key]; // 判斷deep是true 且 val不能為空 且 typeof val==='object'(數(shù)組內(nèi)數(shù)值變化也需要深度監(jiān)聽) if (deep && val != null && typeof val === 'object') { Object.keys(val).forEach(childKey => { // 遍歷val對象下的每一個key this.observe(val, childKey, watchFun, deep, page); // 遞歸調(diào)用監(jiān)聽函數(shù) }) } var that = this; Object.defineProperty(obj, key, { configurable: true, enumerable: true, set: function (value) { if (val === value) { return } // 用page對象調(diào)用,改變函數(shù)內(nèi)this指向,以便this.data訪問data內(nèi)的屬性值 watchFun.call(page, value, val); // value是新值,val是舊值 val = value; if (deep) { // 若是深度監(jiān)聽,重新監(jiān)聽該對象,以便監(jiān)聽其屬性。 that.observe(obj, key, watchFun, deep, page); } }, get: function () { return val; } }) }
??? ??:
app.tool.newPage({ data: { // noAutoLogin: false }, onShow: function () { // 在這里寫頁面請求邏輯 } }
???
??? ???? ????? ???????. ???? newPage ???? ??? ? ????. . ??? ?? ??? ??????. ??? ???, ? ?? ????? ??? ??? ??? ????.
【?? ?? ??: ?? ???? ?? ????】
? ??? ?? ????? ? ???? ??????? ???? ??? ?? ??? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











??? ??? ??? ????? ???? ?? WeChat? ???? ?? ???? ?? ??????? ?????. WeChat ?? ????? ???? ???? ??????? ?????? ???? ??? ?? ????? ?? ???? ? ?? ??? ?? ??? ??? ? ????. ? ????? Python? ???? WeChat ???? ???? ??? ?????. 1. ?? Python? ???? WeChat ???? ???? ?? ?? Python ?????? ???? ???. ???? wxpy? itchat ? ?????? ???? ?? ????. wxpy? ?? ?????

WeChat ?? ?????? ?? ??? ?? ?? WeChat ?? ?????? ?? ??? ??? ???? ?? ??? ??? ????? ?? ??? ??? ???? ? ?? ???? ????? ?????. ??? WeChat ????? ?? ??? ??? ???? ??? ??? ???? ?? ?? ??? ?????. ??, ?? ????? ??? ???? ??? ? ?? ?? ??? ???? ???. ??? ?? ??? ???? ?? ??? ?? ??? ?? ??? ???? ?? ????. <--index.wxml- ->&l

10? 31? ? ???? ??? ??? ?? 5? 27? Ant Group? '?? ?? ????'? ????? ????? ?? ??? ??? ?????. Alipay? '?? ?? - ??? ?? ??' ?? ????? ??????. ?? ???? ?? ??? ?????? ???? ?? ???? ?? ??? ?? ??? ???? Alipay? ?? ??? ?? ??? ???? ? ??? ???. ?? ???? "????", "????" ?? ???? ???? "????" ???? ??? ? ????. ?? ?????? ???? ????? ?? ? ???? ?? ?? ??? ??? ??? ? ??? ?? ? Alipay ????? ?? ?????? ?? ??? ?????. ? ??????? ?? ??????? ?? ?? ?? ?? ??? ??? ? ??? ?????. ? ?? ??? ??? ???? ?? ??? ?? ???????. ??? ??

?? ????? ??? ??? ? ????. ?? ??: 1. "react-reconciler"? ???? ???? ???? DSL? ?????. 2. DSL? ?? ???? ????? ?? ?? ???? ?? ??? ????. 3. npm? ???? ???? ?????. ???? npm? ?????. 4. ??? ???? ???? ??? ?? API? ???? ??? ?????.

???? ?? ????? H5 ??? ??? ????? ???? ?? ??? ?????. ?? ??? ???? ??? ????? ???? ?? ?? ????? H5? ?? ?????? ??? ?????. ??? ??? ?? ?????? uniapp? ?? ??? ???? ?? ????? H5 ?? ??? ???? ???? ?? ???? ?? ???? ? ????. ? ????? uniapp? ?? ????? H5 ?? ??? ??? ???? ??? ???? ???? ?? ??? ?????. 1. ??? ??? ??

?? ?? ?? ?? ????? ??? ? ?? ??? ?? ????, ?? ?????? ?? ?? ??? ???? ???? ??? ?? ???????.

?? ???? x01 ?? ?? ??, ?? ???? ??? ???? ???? ?????. ?? ??? ??? ??? ? ???? ?? ??? ?? ? ??? ?????. ?? ???? ???? ???? ??? ?? ??? ?????. x02 ?????? ??? ???? ?? ?????. ?????? ??? ???? ??? ?? ???? ?? ??? ???? ?????. ??? ??? ??? ????? ????? ??? ? ?? ???? ???? ???. ??? ??? ?? ???? ?? ??? ??? ?? ?????. ????, ??

PHP ? ?? ????? ??? ?? ?? ? ?? ?? ??? ?? ?? ? ?? ??? ?? ???? ??? ?? ? ??? ?????. ??? ??? ??? ?? ?? ?? ? ?? ??? ?? ???? ??? ???? ????. ?? ???? PHP? ???? ? ?? ???? ?? ?????. ? ????? PHP ? ?? ?????? ??? ?? ?? ? ?? ?? ?? ??? ???? ?? ?? ??? ?????. 1. PHP? ???? PHP??? ?? ????? ??? ? ????.
