From 020e2d8093a43e32d0bbf2e09737f0a25c2705c8 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Tue, 3 Aug 2021 09:53:16 +0800 Subject: [PATCH] no message --- api/saas.js | 6 +++++- app.js | 13 ++++++++++++- pages/home/customer-code/index.js | 2 +- pages/home/customer-list/index.js | 22 +++++++++++----------- pages/home/index/index.json | 1 + pages/home/index/index.wxml | 8 ++++++-- pages/ztbvip/member/index.js | 29 ++++++++++++++++++++++------- pages/ztbvip/member/index.wxml | 6 +++--- pages/ztbvip/payment/index.js | 7 +------ utils/weapp-qrcode.js | 2 -- 10 files changed, 62 insertions(+), 34 deletions(-) diff --git a/api/saas.js b/api/saas.js index 3110af3..e3571a9 100644 --- a/api/saas.js +++ b/api/saas.js @@ -89,6 +89,8 @@ const getReceiptReport = (params) => mGet(`/ztb-factory/get/receipt-daily-report const getSalesReport = (params) => mGet(`/ztb-factory/get/sales-daily-report`, params, sconfig) const getGrossReport = (params) => mGet(`/ztb-factory/get/gross-profit-daily-report`, params, sconfig) const getAgentReport = (params) => mGet(`/ztb-factory/get/agency-sales-daily-report`, params, sconfig) +const getMemberList = () => mGet(`/ztb-factory/get/agency-sales-daily-report`, null, sconfig) +const buyMemberInfo = (params) => mPost(`/ztb-factory/buy/member`, params, sconfig) export { sconfig, @@ -168,5 +170,7 @@ export { getOrderLog, getPlateList, savePlateNumber, - deleteEmploye + deleteEmploye, + getMemberList, + buyMemberInfo } \ No newline at end of file diff --git a/app.js b/app.js index 45d0728..09d9347 100644 --- a/app.js +++ b/app.js @@ -2,7 +2,7 @@ App({ evn: 1, // 0: 开发版本;1:测试版本;2:生产版本 tmplIds: ['AFoM5TOfsgERsfcetNSB0UlmEixnLF1ySXr54Bqno2M', 'lOQ8Gvyy_dTk68bYGpRVnVA0M7DsYYrV81Gd39GUPBA'], - version: '2.2.5', + version: '2.3.1', xAppId: '503258978847953926', userInfo: null, //----------------------------------------------globalData-------------------------------------- @@ -11,5 +11,16 @@ App({ agenting: 1, keyboardHeight: 0, isIos: false + }, + onShow: function(){ + const updateManager = wx.getUpdateManager() + updateManager.onCheckForUpdate(function (res) { + // 请求完新版本信息的回调 + // console.log('updateManager>>>' + res.hasUpdate) + }) + updateManager.onUpdateReady(function () { + // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 + updateManager.applyUpdate() + }) } }) \ No newline at end of file diff --git a/pages/home/customer-code/index.js b/pages/home/customer-code/index.js index a6f1a67..75a6d06 100644 --- a/pages/home/customer-code/index.js +++ b/pages/home/customer-code/index.js @@ -1,7 +1,7 @@ // pages/home/customer-info/index.js import Scene from '../../index/scene' const util = require('../../../utils/util') -const qrCode = require('../../../utils/weapp-qrcode.js') +const qrCode = require('../../../utils/weapp-qrcode') const app = getApp() Scene({ diff --git a/pages/home/customer-list/index.js b/pages/home/customer-list/index.js index 5ca4b4a..a2daf7e 100644 --- a/pages/home/customer-list/index.js +++ b/pages/home/customer-list/index.js @@ -161,26 +161,26 @@ Scene({ return value1 - value2 } }, - onChange: function(e) { - if(util.isEmpty(e.detail) || (e.detail !== e.detail + '')){ + onChange: function({detail}) { + if(util.isEmpty(detail) || (detail !== detail + '')){ this.setData({ ['form.name']: '', searchList: [], loading: false }) } else { - this.setData({ ['form.name']: e.detail, loading: true }) + this.setData({ ['form.name']: detail, loading: true }) let result = [] - this.data.orderList.forEach(item => { - item.data.forEach(element => { - var keyword = e.detail.toLocaleUpperCase() - if (element.name.indexOf(keyword) !== -1 || element.mobile.indexOf(keyword) !== -1) { - result.push(element) + this.data.orderList.forEach(element => { + element.data.forEach(item => { + var keyword = detail.toLocaleUpperCase() + if (item.name.indexOf(keyword) !== -1 || item.mobile.indexOf(keyword) !== -1) { + result.push(item) } }) }) this.setData({ searchList: result, loading: false }) } }, - onSearch: function(){ - this.onRefreshList() - }, + // onSearch: function(){ + // this.onRefreshList() + // }, customerInfo: function(e){ var item = null if(util.isEmpty(this.data.form.name)){ diff --git a/pages/home/index/index.json b/pages/home/index/index.json index 0a12914..2f7bb8b 100644 --- a/pages/home/index/index.json +++ b/pages/home/index/index.json @@ -2,6 +2,7 @@ "component": true, "usingComponents": { "van-image": "/components/image/index", + "van-tag": "/components/tag/index", "van-grid": "/components/grid/index", "van-grid-item": "/components/grid-item/index", "van-cell": "/components/cell/index", diff --git a/pages/home/index/index.wxml b/pages/home/index/index.wxml index 5fff3a1..36c465f 100644 --- a/pages/home/index/index.wxml +++ b/pages/home/index/index.wxml @@ -10,7 +10,8 @@ - {{factoryName || ''}} + {{factoryName || ''}} + 授权已逾期 {{userName || ''}}({{ isAdmin ? '管理员' : '员工' }}) @@ -25,7 +26,10 @@ 授权截止日期:2021-07-31 - 去续费 + + 去续费 + + diff --git a/pages/ztbvip/member/index.js b/pages/ztbvip/member/index.js index ad65fd9..0efdbe7 100644 --- a/pages/ztbvip/member/index.js +++ b/pages/ztbvip/member/index.js @@ -1,6 +1,6 @@ // xtends//vip/index.js import Scene from '../../index/scene' -import { getAgentReport } from "../../../api/saas" +import { getMemberList, buyMemberInfo } from "../../../api/saas" import util from '../../../utils/util' const app = getApp() @@ -10,20 +10,35 @@ Scene({ */ data: { factoryName: '', - iconList: [{"id":"49606500024333519","days":30,"bidPrice":1.00,"realPrice":1.00,"icon":null,"title":"天","sellStrategy":"common","iosId":"yitianhuiyuanqntest","iosBidPrice":1.00,"iosRealPrice":1.00},{"id":"481107395657994240","days":5,"bidPrice":1.00,"realPrice":0.01,"icon":null,"title":"天","sellStrategy":"twoForOneAtFirstTime","iosId":null,"iosBidPrice":0.00,"iosRealPrice":0.00},{"id":"483353095548571648","days":30,"bidPrice":2000.00,"realPrice":1000.00,"icon":null,"title":"天","sellStrategy":"twoForOneAtFirstTime","iosId":"ztb_vip_30_01","iosBidPrice":1998.00,"iosRealPrice":998.00},{"id":"483353355918381056","days":90,"bidPrice":4000.00,"realPrice":2000.00,"icon":null,"title":"天","sellStrategy":"common","iosId":"ztb_vip_90","iosBidPrice":3998.00,"iosRealPrice":1998.00},{"id":"483353702984454144","days":180,"bidPrice":6000.00,"realPrice":3000.00,"icon":null,"title":"天","sellStrategy":"common","iosId":"ztb_vip_180","iosBidPrice":5898.00,"iosRealPrice":2998.00},{"id":"483354024398163968","days":365,"bidPrice":10000.00,"realPrice":5000.00,"icon":null,"title":"天","sellStrategy":"common","iosId":"ztb_vip_365","iosBidPrice":9998.00,"iosRealPrice":4998.00},{"id":"496065000243335168","days":30,"bidPrice":1000.00,"realPrice":500.00,"icon":null,"title":"天(限时)","sellStrategy":"common","iosId":"ztb_vip_30_02","iosBidPrice":998.00,"iosRealPrice":488.00}], - divIndex: '49606500024333519', + memberList: [{"id":"49606500024333519","days":30,"bidPrice":1.00,"realPrice":1.00,"icon":null,"title":"天","sellStrategy":"common","iosId":"yitianhuiyuanqntest","iosBidPrice":1.00,"iosRealPrice":1.00},{"id":"481107395657994240","days":5,"bidPrice":1.00,"realPrice":0.01,"icon":null,"title":"天","sellStrategy":"twoForOneAtFirstTime","iosId":null,"iosBidPrice":0.00,"iosRealPrice":0.00},{"id":"483353095548571648","days":30,"bidPrice":2000.00,"realPrice":1000.00,"icon":null,"title":"天","sellStrategy":"twoForOneAtFirstTime","iosId":"ztb_vip_30_01","iosBidPrice":1998.00,"iosRealPrice":998.00},{"id":"483353355918381056","days":90,"bidPrice":4000.00,"realPrice":2000.00,"icon":null,"title":"天","sellStrategy":"common","iosId":"ztb_vip_90","iosBidPrice":3998.00,"iosRealPrice":1998.00},{"id":"483353702984454144","days":180,"bidPrice":6000.00,"realPrice":3000.00,"icon":null,"title":"天","sellStrategy":"common","iosId":"ztb_vip_180","iosBidPrice":5898.00,"iosRealPrice":2998.00},{"id":"483354024398163968","days":365,"bidPrice":10000.00,"realPrice":5000.00,"icon":null,"title":"天","sellStrategy":"common","iosId":"ztb_vip_365","iosBidPrice":9998.00,"iosRealPrice":4998.00},{"id":"496065000243335168","days":30,"bidPrice":1000.00,"realPrice":500.00,"icon":null,"title":"天(限时)","sellStrategy":"common","iosId":"ztb_vip_30_02","iosBidPrice":998.00,"iosRealPrice":488.00}], + divIndexId: '49606500024333519', }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { - this.setData({factoryName: app.userInfo.factoryName}) + wx.showLoading({ title: '加载中', mask: true }) + getMemberList().then(res => { + wx.hideLoading() + this.setData({ factoryName: app.userInfo.factoryName, memberList: res.data, divIndexId:res.data[0].id }) + }).catch(err => { + wx.hideLoading() + this.setData({factoryName: app.userInfo.factoryName}) + util.showToast(err) + }) }, onGridTap:function(e){ - var divIndexId = e.currentTarget.dataset.index - this.setData({ divIndex:this.data.iconList[divIndexId].id }) + var index = e.currentTarget.dataset.index + this.setData({ divIndexId: this.data.memberList[index].id }) }, vipForm: function(){ - + wx.showLoading({ title: '处理中', mask: true }) + buyMemberInfo({ memberExpenseId: this.data.divIndexId }).then(res => { + wx.hideLoading() + wx.navigateTo({ url: '/pages/ztbvip/payment/index?type=2&orderId=' + res.data.orderId }) + }).catch(err => { + wx.hideLoading() + util.showToast(err) + }) } }) \ No newline at end of file diff --git a/pages/ztbvip/member/index.wxml b/pages/ztbvip/member/index.wxml index ce05f50..26ddef4 100644 --- a/pages/ztbvip/member/index.wxml +++ b/pages/ztbvip/member/index.wxml @@ -41,13 +41,13 @@ - + 选择购买的会员产品 - + 首月买一赠一 - + {{item.days}}{{item.title}} {{item.realPrice}} diff --git a/pages/ztbvip/payment/index.js b/pages/ztbvip/payment/index.js index 799b45c..b4eeb96 100644 --- a/pages/ztbvip/payment/index.js +++ b/pages/ztbvip/payment/index.js @@ -1,5 +1,6 @@ // pages/ztbvip/payment/index.js import Scene from '../../index/scene' +import { getTradeOrder, paymentFor } from "../../../api/saas" const util = require('../../../utils/util.js') const event = require('../../../utils/event.js') const app = getApp() @@ -60,12 +61,6 @@ Scene({ data.success = function (res) { util.showBackToast('支付成功') event.emit('EventMessage', { what: 200, desc: 'Vip' }) - // wx.requestSubscribeMessage({ - // tmplIds: app.tmplIds, - // complete(res) { - // that.handlePayment() - // } - // }) } data.fail = function (res) { util.showToast('支付失败') diff --git a/utils/weapp-qrcode.js b/utils/weapp-qrcode.js index 3c747cf..a76e7ba 100644 --- a/utils/weapp-qrcode.js +++ b/utils/weapp-qrcode.js @@ -352,7 +352,6 @@ var QRCode; _oContext.fillRect(nLeft, nTop, nWidth, nHeight); // } - // 안티 앨리어싱 방지 처리 // if (bIsDark) { _oContext.strokeRect( Math.floor(nLeft) + 0.5, @@ -412,7 +411,6 @@ var QRCode; destHeight: this._htOption.height, canvasId: this.canvasId, success: function (res) { - console.log(res.tempFilePath) callback(res.tempFilePath) } })