diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 59d78d5..1d4d6d6 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -14,6 +14,10 @@ { "launchtype" : "local" }, + "mp-weixin" : + { + "launchtype" : "local" + }, "type" : "uniCloud" } ] diff --git a/App.vue b/App.vue index d5604b0..2377d3e 100644 --- a/App.vue +++ b/App.vue @@ -5,6 +5,7 @@ }, onShow () { console.log('App Show') + uni.hideLoading() }, onHide () { console.log('App Hide') diff --git a/apis/interfaces/scan.js b/apis/interfaces/scan.js new file mode 100644 index 0000000..65467ed --- /dev/null +++ b/apis/interfaces/scan.js @@ -0,0 +1,22 @@ +/** + * Web-zdx + * moduleName:核销相关操作 + */ + +import request from '../request.js' + + +// 扫码前置条件 +const scanInfo = (apiUrl,data,method) => { + return request({ + url: apiUrl, + method:method, + data:data + }) +} + + + +export { + scanInfo +} diff --git a/components/coupon-template/coupon-template-1.vue b/components/coupon-template/coupon-template-1.vue index 7c50784..ff0355e 100644 --- a/components/coupon-template/coupon-template-1.vue +++ b/components/coupon-template/coupon-template-1.vue @@ -30,7 +30,7 @@ - + diff --git a/pages.json b/pages.json index 20e3586..fae2171 100644 --- a/pages.json +++ b/pages.json @@ -112,6 +112,15 @@ "navigationBarBackgroundColor": "#e93340" } }, + { + "path": "pages/property/coupon/canUseList", + "name": "CanUseList", + "style": { + "navigationBarTitleText": "可兑换商品列表", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#039bfe" + } + }, { "path": "pages/property/coupon/coupon", "name": "CouponList", @@ -453,7 +462,7 @@ "style": { "navigationBarTitleText": "扫码验证", "navigationBarTextStyle": "white", - "navigationBarBackgroundColor": "#f40c50" + "navigationBarBackgroundColor": "#039bfe" } }, { "path": "pages/verification/details", diff --git a/pages/property/coupon/canUseList.vue b/pages/property/coupon/canUseList.vue new file mode 100644 index 0000000..4bc340e --- /dev/null +++ b/pages/property/coupon/canUseList.vue @@ -0,0 +1,217 @@ + + + + + diff --git a/pages/property/coupon/detail.vue b/pages/property/coupon/detail.vue index cb2d3e2..a30761f 100644 --- a/pages/property/coupon/detail.vue +++ b/pages/property/coupon/detail.vue @@ -38,7 +38,7 @@ - 商品兑换码 + 优惠券兑换码 @@ -70,6 +70,14 @@ this.coupon_grant_id = e.id this.getList() }, + // 监听弹窗页面为false时候,重新请求当前页面 + watch: { + showCode(newVal, oldVal) { + if(!newVal && oldVal){ + uni.setStorageSync('refresh',true) + } + } + }, methods: { // 获取列表 getList() { diff --git a/pages/property/order/numberWeightInfo.vue b/pages/property/order/numberWeightInfo.vue index 447efe0..fa67947 100644 --- a/pages/property/order/numberWeightInfo.vue +++ b/pages/property/order/numberWeightInfo.vue @@ -155,6 +155,15 @@ this.getInfo(e.symbol) // this.getInfo('G22S20') }, + // 监听弹窗页面为false时候,重新请求当前页面 + watch: { + showCode(newVal, oldVal) { + if(!newVal && oldVal){ + this.getInfo(this.symbol) + uni.setStorageSync('refresh',true) + } + } + }, methods: { getInfo(symbol) { mallWarrantsList(symbol).then(res => { @@ -174,6 +183,7 @@ duration: 3000 }) setTimeout(res => { + uni.setStorageSync('refresh',true) uni.navigateBack({}) }, 2000) }) diff --git a/pages/property/setting/setting.vue b/pages/property/setting/setting.vue index bc0bf57..9fc88b9 100644 --- a/pages/property/setting/setting.vue +++ b/pages/property/setting/setting.vue @@ -59,11 +59,6 @@ } }, onShow() { - wx.login({ - success: res => { - this.loginCode = res.code - } - }) this.getUserInfo() }, onPullDownRefresh() { @@ -85,86 +80,6 @@ }) }) }, - // 点击绑定用户得授权信息,且绑定带修改 - getUser() { - uni.getUserProfile({ - desc: "获取你的昵称、头像、地区及性别", - success: e => { - console.log(e) - if (e.errMsg == "getUserProfile:ok") { - this.userInfo = e.userInfo - // // 检查用户登录Code是否过期 - wx.checkSession({ - success: res => { - this.userLogin(e) - }, - fail: err => { - // 登录过期重新获取code - uni.login({ - success: res => { - this.loginCode = res.code - // 登录 - this.userLogin() - } - }) - } - }) - } else { - uni.showToast({ - duration: 1500, - title: "绑定手机号失败了", - icon: 'none' - }) - } - }, - fail() { - uni.showToast({ - duration: 1500, - title: "您拒绝了请求", - icon: 'none' - }) - } - }) - }, - // 登陆接口 - userLogin(info) { - let that = this - uni.login({ - success: res => { - let data = { - iv: info.iv, - encryptedData: info.encryptedData, - code: res.code - } - uni.showLoading({ - title: '绑定中' - }) - wechatbind(data).then(res => { - setTimeout(res => { - uni.hideLoading() - }, 1000) - this.$refs.uToast.show({ - title: '绑定成功', - type: 'primary', - duration: 3000 - }) - setTimeout(res => { - this.getUserInfo() - }, 3000) - }).catch(err => { - this.$refs.uToast.show({ - title: err.message, - type: 'primary', - duration: 3000 - }) - uni.hideLoading() - }) - }, - fail: () => {}, - complete: () => {} - }); - - }, loginOut() { uni.removeStorageSync('token') uni.reLaunch({ diff --git a/pages/verification/index.vue b/pages/verification/index.vue index 8b7056e..458df22 100644 --- a/pages/verification/index.vue +++ b/pages/verification/index.vue @@ -1,34 +1,402 @@