From 22cdc7fe05a26ba0f58bd06078540a0d07aa0706 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Thu, 22 Apr 2021 09:58:13 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E9=A6=96=E9=A1=B5=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=EF=BC=8C=E6=94=AF=E6=8C=81=E8=B7=B3=E8=BD=AC=E5=88=B0=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E5=88=97=E8=A1=A8=EF=BC=9B=202=E3=80=81=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E6=8C=87=E6=95=B0=E9=BB=98=E8=AE=A4=E9=80=89=E6=8B=A9?= =?UTF-8?q?5=E4=B8=AA=E7=BA=B8=E5=93=81=EF=BC=9B=203=E3=80=81=E7=BA=B8?= =?UTF-8?q?=E5=8E=82=E5=88=97=E8=A1=A8=E3=80=81=E6=B4=BB=E5=8A=A8=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E3=80=81=E7=BA=B8=E5=8E=82=E8=AF=A6=E6=83=85=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=81=9C=E6=AD=A2=E6=94=B6=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 2 +- components/dialog/index.wxml | 4 +- pages/agent/ability-item/index.js | 9 +++ pages/agent/ability-item/index.json | 1 + pages/agent/ability-item/index.wxml | 6 +- pages/agent/agent-item/index.js | 9 +++ pages/agent/agent-item/index.json | 1 + pages/agent/agent-item/index.wxml | 4 +- pages/agent/factory/index.js | 9 +++ pages/agent/factory/index.json | 1 + pages/agent/factory/index.wxml | 4 +- pages/mall/price-index/index.js | 102 ++++++++-------------------- pages/moment/paper/index.js | 5 +- utils/util.js | 15 ++-- 14 files changed, 79 insertions(+), 93 deletions(-) diff --git a/app.js b/app.js index 1b33a91..6e6b87a 100644 --- a/app.js +++ b/app.js @@ -1,7 +1,7 @@ //app.js App({ //----------------------------------------------globalData-------------------------------------- - evn: 1,//0:开发环境,1:测试环境,2:生产环境 + evn: 2,//0:开发环境,1:测试环境,2:生产环境 tmplIds: ['SUjEgwDopCv9xkkSZ4KbS0L7XbAiVQor6GmPg14K760'], agentMsgIds: ['kG8DErWDpyzBHCFaLlSKYMF7xVy8UpgogCwV_WSNt10', 'oLbv-IyJOia2tenh64_Lc8xeAzwgzu3gh1vFJ1Se-ME'], version: 152, diff --git a/components/dialog/index.wxml b/components/dialog/index.wxml index 5bfef6d..680e870 100644 --- a/components/dialog/index.wxml +++ b/components/dialog/index.wxml @@ -1,6 +1,6 @@ {{ title }} - + {{ content }} - + diff --git a/pages/agent/ability-item/index.js b/pages/agent/ability-item/index.js index 69570e3..3435054 100644 --- a/pages/agent/ability-item/index.js +++ b/pages/agent/ability-item/index.js @@ -42,6 +42,15 @@ Component({ wx.navigateTo({ url: '/pages/login/index' }) return } + if(!this.data.item.isOperations){ + this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog') + this.wuxDialog.alert({ + resetOnClose: true, + title: '温馨提示', + content: '该纸厂已暂停接单,请联系相关负责人!' + }) + return + } if(util.isEmpty(this.data.item.cateIndex)){ util.showToast('请选择一个纸品') return diff --git a/pages/agent/ability-item/index.json b/pages/agent/ability-item/index.json index b452c48..bb8f424 100644 --- a/pages/agent/ability-item/index.json +++ b/pages/agent/ability-item/index.json @@ -3,6 +3,7 @@ "usingComponents": { "wux-button": "/components/button/index", "wux-image": "/components/image/index", + "wux-dialog": "/components/dialog/index", "wux-tag": "/components/tag/index" } } \ No newline at end of file diff --git a/pages/agent/ability-item/index.wxml b/pages/agent/ability-item/index.wxml index 327fd88..ca4f43c 100644 --- a/pages/agent/ability-item/index.wxml +++ b/pages/agent/ability-item/index.wxml @@ -30,7 +30,7 @@ - 我要卖货 + 我要卖货 @@ -41,4 +41,6 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/pages/agent/agent-item/index.js b/pages/agent/agent-item/index.js index 0343bcb..5552453 100644 --- a/pages/agent/agent-item/index.js +++ b/pages/agent/agent-item/index.js @@ -53,6 +53,15 @@ Component({ wx.navigateTo({ url: '/pages/login/index' }) return } + if(!this.data.item.isOperations){ + this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog') + this.wuxDialog.alert({ + resetOnClose: true, + title: '温馨提示', + content: '该纸厂已暂停接单,请联系相关负责人!' + }) + return + } if(util.isEmpty(this.data.cateIndex)){ util.showToast('请选择一个纸品') return diff --git a/pages/agent/agent-item/index.json b/pages/agent/agent-item/index.json index 4a8859e..57c9787 100644 --- a/pages/agent/agent-item/index.json +++ b/pages/agent/agent-item/index.json @@ -2,6 +2,7 @@ "component": true, "usingComponents": { "wux-button": "/components/button/index", + "wux-dialog": "/components/dialog/index", "wux-image": "/components/image/index" } } \ No newline at end of file diff --git a/pages/agent/agent-item/index.wxml b/pages/agent/agent-item/index.wxml index a6bcc93..2e5ae19 100644 --- a/pages/agent/agent-item/index.wxml +++ b/pages/agent/agent-item/index.wxml @@ -62,7 +62,7 @@ - 我要卖货 + 我要卖货 @@ -75,6 +75,8 @@ + + function priceItem(item, kg) { if(kg){ diff --git a/pages/agent/factory/index.js b/pages/agent/factory/index.js index 89f302a..f6e5ada 100644 --- a/pages/agent/factory/index.js +++ b/pages/agent/factory/index.js @@ -135,6 +135,15 @@ Page({ }) return } + if(!this.data.factoryDetail.isOperations){ + this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog') + this.wuxDialog.alert({ + resetOnClose: true, + title: '温馨提示', + content: '该纸厂已暂停接单,请联系相关负责人!' + }) + return + } var item = this.data.factoryDetail.paperCategoryList[this.data.cateIndex] if (util.isEmpty(item.unitPrice)) { util.showToast('该纸品暂无报价,无法卖货') diff --git a/pages/agent/factory/index.json b/pages/agent/factory/index.json index 82796ef..2af1bd8 100644 --- a/pages/agent/factory/index.json +++ b/pages/agent/factory/index.json @@ -8,6 +8,7 @@ "wux-sticky": "/components/sticky/index", "fold-text": "/components/fold-text/index", "wux-divider": "/components/divider/index", + "wux-dialog": "/components/dialog/index", "article-item": "/pages/article/article-item/index" } } \ No newline at end of file diff --git a/pages/agent/factory/index.wxml b/pages/agent/factory/index.wxml index d5ac5e9..68caa86 100644 --- a/pages/agent/factory/index.wxml +++ b/pages/agent/factory/index.wxml @@ -168,7 +168,7 @@ - 我要卖货 + 我要卖货 @@ -178,6 +178,8 @@ + + function priceItem(item, kg) { if(kg){ diff --git a/pages/mall/price-index/index.js b/pages/mall/price-index/index.js index f1bec4e..f3430bf 100644 --- a/pages/mall/price-index/index.js +++ b/pages/mall/price-index/index.js @@ -1,5 +1,5 @@ // pages/moment/price/index.js -import { getCategoryPrice } from "../../api/moment" +import { getCategoryList, getCategoryPrice } from "../../api/moment" const util = require('../../../utils/util') const math = require('../../../utils/math') const storage = require('../../../utils/storage') @@ -28,85 +28,41 @@ Page({ */ onLoad: function (options) { event.on('EventMessage', this, this.onEvent) - this.fetchChartList() + var cateIds = storage.get('cateIdList' + app.globalData.userInfo.userId) + if(!util.isEmpty(cateIds)){ + this.data.idList = cateIds + this.fetchChartList() + } else { + wx.showLoading({ title: '加载中', mask: true }) + getCategoryList().then(result => { + this.data.idList = '' + var size = result.data.records.length >= 5 ? 5 : result.data.records.length + for (let index = 0; index < size; index++) { + if(util.isEmpty(this.data.idList)){ + this.data.idList = result.data.records[index].id + } else { + this.data.idList += ',' + result.data.records[index].id + } + } + this.fetchChartList() + wx.hideLoading() + }).catch(err => { + //异常回调 + wx.hideLoading() + }) + } }, onEvent: function (message) { if (message.what == 502) { + var cateIds = storage.get('cateIdList' + app.globalData.userInfo.userId) + if(!util.isEmpty(cateIds)){ + this.data.idList = cateIds + } this.fetchChartList() } }, - // 下拉刷新... - onRefreshList: function () { - if (this.data.requesting) { - return - } - this.setData({ - orderList: [], - ['form.pageNum']: 1, - loading: true, - height: app.globalData.fragmentHeight, - finished: false - }) - this.fetchPapersList() - }, - // 获取特价列表 - fetchPapersList: function () { - if (this.data.requesting || this.data.finished) { - return - } - if (this.data.loading) { - this.data.requesting = true - } else { - this.setData({ requesting: true }) - } - getCategoryPrice().then(result => { - if (result.data.records.length) { - var respList = result.data.records - let nowList = `orderList[${this.data.orderList.length}]` - var num = result.data.current - var finished = result.data.current >= result.data.pages - if(this.data.form.pageNum == 1){ - this.setData({ - [nowList]: respList, - total: result.data.total, - ['form.pageNum']: (num + 1), - top: 0, - finished, - requesting: false, - loading: false - }) - } else { - this.setData({ - [nowList]: respList, - total: result.data.total, - ['form.pageNum']: (num + 1), - finished, - requesting: false, - loading: false - }) - } - } else { - this.setData({ - finished: true, - requesting: false, - loading: false - }) - } - }).catch(err => { - //异常回调 - this.setData({ - requesting: false, - finished: true, - loading: false - }) - }) - }, //***********************************fetchChartList*****************************************// fetchChartList: function(){ - var cateIds = storage.get('cateIdList' + app.globalData.userInfo.userId) - if(!util.isEmpty(cateIds)){ - this.data.idList = cateIds - } getCategoryPrice({idList: this.data.idList}).then(result => { if(result.data.length <= 0){ return @@ -199,7 +155,7 @@ Page({ height: 200, dataLabel: false, dataPointShape: 'circle', - enableScroll: true, + enableScroll: false, extra: { lineStyle: 'curve' } }, this) }, diff --git a/pages/moment/paper/index.js b/pages/moment/paper/index.js index cbcc76b..f69770b 100644 --- a/pages/moment/paper/index.js +++ b/pages/moment/paper/index.js @@ -18,10 +18,7 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - wx.showLoading({ - title: '加载中', - mask: true - }) + wx.showLoading({ title: '加载中', mask: true }) this.data.cateIds = storage.get('cateIdList' + app.globalData.userInfo.userId) if(!util.isEmpty(this.data.cateIds)){ this.data.cateIdList = this.data.cateIds.toString().split(',') diff --git a/utils/util.js b/utils/util.js index da97d01..a53c21e 100644 --- a/utils/util.js +++ b/utils/util.js @@ -159,15 +159,9 @@ function checkId(id) { sum += parseInt(id_array[k]) * parseInt(c[k]); } if (id_array[17].toUpperCase() != b[sum % 11].toUpperCase()) { - return { - 'status': 0, - 'msg': '身份证校验码不合规' - } - } - return { - 'status': 1, - 'msg': '校验通过' + return { status: 0, msg: '身份证校验码不合规' } } + return { status: 1, msg: '校验通过' } } const tokenList = [ @@ -189,7 +183,8 @@ const tokenList = [ '/pages/article/publish/index', '/pages/home/attentionPaperList/index', '/pages/article/feedback/index', - 'pages/agent/edit/index' + 'pages/agent/edit/index', + '/pages/agent/ability/index' ] function navigateTo(url){ @@ -256,6 +251,8 @@ function navigateTarget(redirectInfo){ navigateTo('/pages/morder/index/index') } else if(redirectInfo.targetView == 'createArticle'){ navigateTo('/pages/article/publish/index') + } else if(redirectInfo.targetView == 'proxySellActivity'){ + navigateTo('/pages/agent/ability/index') } }