From 428d4496f98392ff9cd9981d3ff9d5feedc56bfc Mon Sep 17 00:00:00 2001 From: gooking Date: Fri, 4 Jun 2021 09:23:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 2 +- config.js | 2 +- demos/pages/ab/index.wxml | 6 +++--- pages/goods/list.js | 20 ++++++++++++++++++-- pages/my/index.js | 29 +++++++++++++++-------------- pages/my/index.wxml | 6 +++--- project.config.json | 1 - 7 files changed, 41 insertions(+), 25 deletions(-) diff --git a/app.js b/app.js index 23dfa7e0..e35b6f24 100644 --- a/app.js +++ b/app.js @@ -65,7 +65,7 @@ App({ wx.hideToast() } }) - WXAPI.queryConfigBatch('mallName,WITHDRAW_MIN,ALLOW_SELF_COLLECTION,order_hx_uids,subscribe_ids,share_profile,adminUserIds,goodsDetailSkuShowType,shopMod,needIdCheck,balance_pay_pwd,shipping_address_gps,shipping_address_region_level,shopping_cart_vop_open,show_wx_quanzi,cps_open,recycle_open,categoryMod,hide_reputation,show_seller_number,show_goods_echarts,show_buy_dynamic').then(res => { + WXAPI.queryConfigBatch('mallName,WITHDRAW_MIN,ALLOW_SELF_COLLECTION,order_hx_uids,subscribe_ids,share_profile,adminUserIds,goodsDetailSkuShowType,shopMod,needIdCheck,balance_pay_pwd,shipping_address_gps,shipping_address_region_level,shopping_cart_vop_open,show_wx_quanzi,cps_open,recycle_open,categoryMod,hide_reputation,show_seller_number,show_goods_echarts,show_buy_dynamic,goods_search_show_type,show_3_seller,show_quan_exchange_score,show_score_exchange_growth').then(res => { if (res.code == 0) { res.data.forEach(config => { wx.setStorageSync(config.key, config.value); diff --git a/config.js b/config.js index 95c1a984..bcb83aa3 100644 --- a/config.js +++ b/config.js @@ -1,5 +1,5 @@ module.exports = { - version: '11.13.0', + version: '11.14.0', note: '细节优化', // 这个为版本描述,无需修改 subDomain: 'tz', // liu123 此处改成你自己的专属域名。什么是专属域名?请看教程 https://www.it120.cc/help/qr6l4m.html merchantId: 951, // 商户ID,可在后台工厂设置-->商户信息查看 diff --git a/demos/pages/ab/index.wxml b/demos/pages/ab/index.wxml index c4272cda..5bf35281 100644 --- a/demos/pages/ab/index.wxml +++ b/demos/pages/ab/index.wxml @@ -28,7 +28,7 @@ - + @@ -36,8 +36,8 @@ - - + + diff --git a/pages/goods/list.js b/pages/goods/list.js index 4cb4c9be..726995d7 100644 --- a/pages/goods/list.js +++ b/pages/goods/list.js @@ -18,13 +18,29 @@ Page({ onLoad: function (options) { this.setData({ name: options.name, - categoryId: options.categoryId, - show_seller_number: wx.getStorageSync('show_seller_number') + categoryId: options.categoryId }) this.search() + this.readConfigVal() + // 补偿写法 + getApp().configLoadOK = () => { + this.readConfigVal() + } }, onShow: function () { + }, + readConfigVal() { + const show_seller_number = wx.getStorageSync('show_seller_number') + const goods_search_show_type = wx.getStorageSync('goods_search_show_type') + let listType = 1 + if (goods_search_show_type == 2) { + listType = 2 + } + this.setData({ + show_seller_number, + listType + }) }, async search(){ wx.showLoading({ diff --git a/pages/my/index.js b/pages/my/index.js index 3804a8bd..f28cd4d2 100644 --- a/pages/my/index.js +++ b/pages/my/index.js @@ -1,14 +1,7 @@ -const CONFIG = require('../../config.js') const WXAPI = require('apifm-wxapi') const AUTH = require('../../utils/auth') const TOOLS = require('../../utils/tools.js') -const APP = getApp() -// fixed首次打开不显示标题的bug -APP.configLoadOK = () => { - -} - Page({ data: { balance:0.00, @@ -28,16 +21,14 @@ Page({ userInfoStatus: 0 // 0 未读取 1 没有详细信息 2 有详细信息 }, onLoad() { + this.readConfigVal() + // 补偿写法 + getApp().configLoadOK = () => { + this.readConfigVal() + } }, onShow() { const _this = this - const order_hx_uids = wx.getStorageSync('order_hx_uids') - this.setData({ - version: CONFIG.version, - order_hx_uids, - cps_open: wx.getStorageSync('cps_open'), - recycle_open: wx.getStorageSync('recycle_open'), - }) AUTH.checkHasLogined().then(isLogined => { if (isLogined) { _this.getUserApiInfo(); @@ -58,6 +49,16 @@ Page({ this.data.code = code }) }, + readConfigVal() { + this.setData({ + order_hx_uids: wx.getStorageSync('order_hx_uids'), + cps_open: wx.getStorageSync('cps_open'), + recycle_open: wx.getStorageSync('recycle_open'), + show_3_seller: wx.getStorageSync('show_3_seller'), + show_quan_exchange_score: wx.getStorageSync('show_quan_exchange_score'), + show_score_exchange_growth: wx.getStorageSync('show_score_exchange_growth'), + }) + }, async getUserApiInfo() { const res = await WXAPI.userDetail(wx.getStorageSync('token')) if (res.code == 0) { diff --git a/pages/my/index.wxml b/pages/my/index.wxml index 48d7668b..aa12b2f5 100644 --- a/pages/my/index.wxml +++ b/pages/my/index.wxml @@ -84,15 +84,15 @@ - + - - + + diff --git a/project.config.json b/project.config.json index 6f8c8439..fec96605 100644 --- a/project.config.json +++ b/project.config.json @@ -26,7 +26,6 @@ "disablePlugins": [], "outputPath": "" }, - "bundle": false, "useIsolateContext": true, "useCompilerModule": true, "userConfirmedUseCompilerModuleSwitch": false,