Commit 49e4f792c9993119d1bebbe9e9f6fbd8880d10b9
1 parent
97a429c6
会员权益免费领取 延迟器操作
Showing
1 changed file
with
32 additions
and
25 deletions
pages/user/user_spsy/user_spsy.js
@@ -15,7 +15,7 @@ Page({ | @@ -15,7 +15,7 @@ Page({ | ||
15 | page: 1, | 15 | page: 1, |
16 | isLoading: 0, | 16 | isLoading: 0, |
17 | no_more: 0, | 17 | no_more: 0, |
18 | - is_use:0 //领取状态 | 18 | + is_use: 0 //领取状态 |
19 | }, | 19 | }, |
20 | /** | 20 | /** |
21 | * 生命周期函数--监听页面加载 | 21 | * 生命周期函数--监听页面加载 |
@@ -44,7 +44,7 @@ Page({ | @@ -44,7 +44,7 @@ Page({ | ||
44 | 44 | ||
45 | 45 | ||
46 | }, | 46 | }, |
47 | - async getQrCode(id) { | 47 | + async getQrCode(id) { |
48 | const res = await getApp().request.promiseGet("/api/weshop/users/grade/wares/code/get", { | 48 | const res = await getApp().request.promiseGet("/api/weshop/users/grade/wares/code/get", { |
49 | data: { | 49 | data: { |
50 | privilegeId: id, | 50 | privilegeId: id, |
@@ -53,11 +53,11 @@ Page({ | @@ -53,11 +53,11 @@ Page({ | ||
53 | }, | 53 | }, |
54 | }); | 54 | }); |
55 | if (res.data.code == 0 && res.data.data) { | 55 | if (res.data.code == 0 && res.data.data) { |
56 | - if(res.data.data.VerifyDate || res.data.data.VerifyNo){ | 56 | + if (res.data.data.VerifyDate || res.data.data.VerifyNo) { |
57 | this.setData({ | 57 | this.setData({ |
58 | - is_use:1 | 58 | + is_use: 1 |
59 | }) | 59 | }) |
60 | - }else{ | 60 | + } else { |
61 | this.setData({ | 61 | this.setData({ |
62 | qr_code_object: res.data.data, | 62 | qr_code_object: res.data.data, |
63 | }) | 63 | }) |
@@ -128,28 +128,35 @@ Page({ | @@ -128,28 +128,35 @@ Page({ | ||
128 | 128 | ||
129 | //--领取商品-- | 129 | //--领取商品-- |
130 | async show_hxm(e) { | 130 | async show_hxm(e) { |
131 | - let qr_code_object = this.data.qr_code_object; | ||
132 | - if (qr_code_object !== {}) { | ||
133 | - let { WriteOffCode: val, BeginDate, EndDate} = qr_code_object; | ||
134 | - let qr_code = this.selectComponent("#qc_com"); | ||
135 | - let obj = { | ||
136 | - val, | ||
137 | - content: "当前核销码仅限当面使用", | ||
138 | - now: BeginDate, | ||
139 | - validay: EndDate, | ||
140 | - is_quan: 0, | ||
141 | - }; | ||
142 | - qr_code.open(obj) | ||
143 | - }else{ | ||
144 | - wx.showToast({ | ||
145 | - title: "获取失败", | ||
146 | - icon: 'none', | ||
147 | - duration: 1000 | ||
148 | - }) | ||
149 | - } | 131 | + setTimeout(() => { |
132 | + let qr_code_object = this.data.qr_code_object; | ||
133 | + if (qr_code_object !== {}) { | ||
134 | + let { | ||
135 | + WriteOffCode: val, | ||
136 | + BeginDate, | ||
137 | + EndDate | ||
138 | + } = qr_code_object; | ||
139 | + let qr_code = this.selectComponent("#qc_com"); | ||
140 | + let obj = { | ||
141 | + val, | ||
142 | + content: "当前核销码仅限当面使用", | ||
143 | + now: BeginDate, | ||
144 | + validay: EndDate, | ||
145 | + is_quan: 0, | ||
146 | + is_fw:0, | ||
147 | + }; | ||
148 | + qr_code.open(obj) | ||
149 | + } else { | ||
150 | + wx.showToast({ | ||
151 | + title: "获取失败", | ||
152 | + icon: 'none', | ||
153 | + duration: 1000 | ||
154 | + }) | ||
155 | + } | ||
156 | + }, 500); | ||
150 | }, | 157 | }, |
151 | 158 | ||
152 | - close:function (){ | 159 | + close: function () { |
153 | this.getQrCode(this.data.FormId) | 160 | this.getQrCode(this.data.FormId) |
154 | } | 161 | } |
155 | }) | 162 | }) |
156 | \ No newline at end of file | 163 | \ No newline at end of file |