Commit ae684249825932020d4ea7ce02fc072be003f113
1 parent
3d4ebe6d
新人有礼所有提示框修改
Showing
5 changed files
with
62 additions
and
117 deletions
pages/giftpack/buygiftpack/giftpackbuy.js
| @@ -47,7 +47,6 @@ Page({ | @@ -47,7 +47,6 @@ Page({ | ||
| 47 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id | 47 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
| 48 | var order_sn = e.currentTarget.dataset.order_sn; //订单号 | 48 | var order_sn = e.currentTarget.dataset.order_sn; //订单号 |
| 49 | var money = e.currentTarget.dataset.money; //支付金额 | 49 | var money = e.currentTarget.dataset.money; //支付金额 |
| 50 | - | ||
| 51 | my_confirm.open( | 50 | my_confirm.open( |
| 52 | "是否确定购买该礼包", | 51 | "是否确定购买该礼包", |
| 53 | "取消", | 52 | "取消", |
| @@ -57,9 +56,6 @@ Page({ | @@ -57,9 +56,6 @@ Page({ | ||
| 57 | }, | 56 | }, |
| 58 | function() { | 57 | function() { |
| 59 | my_confirm.open_cancel(0); | 58 | my_confirm.open_cancel(0); |
| 60 | - wx.showLoading({ | ||
| 61 | - title: '加载中', | ||
| 62 | - }) | ||
| 63 | var json = { | 59 | var json = { |
| 64 | "actId": '', //活动Id | 60 | "actId": '', //活动Id |
| 65 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 61 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
| @@ -99,37 +95,7 @@ Page({ | @@ -99,37 +95,7 @@ Page({ | ||
| 99 | } | 95 | } |
| 100 | 96 | ||
| 101 | ) | 97 | ) |
| 102 | - wx.request({ | ||
| 103 | - url: url, | ||
| 104 | - data: data, | ||
| 105 | - method: 'post', | ||
| 106 | - header: { | ||
| 107 | - 'content-type': 'application/json' | ||
| 108 | - }, // 设置请求的 header | ||
| 109 | - success: function(res) { | ||
| 110 | - wx.hideLoading(); | ||
| 111 | - if (res.data.code == 0) { | ||
| 112 | - var order_sn = res.data.data.orderSn; | ||
| 113 | - res = res.data.data.result; | ||
| 114 | - var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; | ||
| 115 | - wx.requestPayment({ | ||
| 116 | - timeStamp: String(res.timeStamp), | ||
| 117 | - nonceStr: res.nonceStr, | ||
| 118 | - package: res.packageValue, | ||
| 119 | - signType: res.signType, | ||
| 120 | - paySign: res.paySign, | ||
| 121 | - success: function(res) { | ||
| 122 | - getApp().goto(url); | ||
| 123 | - }, | ||
| 124 | - fail: function(res) { | ||
| 125 | - getApp().my_confirm("取消支付", 0, th); | ||
| 126 | - } | ||
| 127 | - }); | ||
| 128 | - } else { | ||
| 129 | - getApp().my_warnning(res.data.msg, 0, th); | ||
| 130 | - } | ||
| 131 | - } | ||
| 132 | - }) | 98 | + |
| 133 | 99 | ||
| 134 | } | 100 | } |
| 135 | 101 | ||
| @@ -151,9 +117,6 @@ Page({ | @@ -151,9 +117,6 @@ Page({ | ||
| 151 | }, | 117 | }, |
| 152 | function() { | 118 | function() { |
| 153 | my_confirm.open_cancel(0); | 119 | my_confirm.open_cancel(0); |
| 154 | - wx.showLoading({ | ||
| 155 | - title: '加载中', | ||
| 156 | - }) | ||
| 157 | var json = { | 120 | var json = { |
| 158 | "actId": '', //活动Id | 121 | "actId": '', //活动Id |
| 159 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 122 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
| @@ -191,8 +154,7 @@ Page({ | @@ -191,8 +154,7 @@ Page({ | ||
| 191 | page: th.data.pages, | 154 | page: th.data.pages, |
| 192 | pageSize: th.data.pageSize | 155 | pageSize: th.data.pageSize |
| 193 | }, | 156 | }, |
| 194 | - success: function success(res) { | ||
| 195 | - wx.hideLoading(); | 157 | + success: function(res) { |
| 196 | if (res.data.code == 0) { | 158 | if (res.data.code == 0) { |
| 197 | th.data.curpage++; | 159 | th.data.curpage++; |
| 198 | var arr1 = th.data.wareCard; | 160 | var arr1 = th.data.wareCard; |
| @@ -236,9 +198,7 @@ Page({ | @@ -236,9 +198,7 @@ Page({ | ||
| 236 | var th = this; | 198 | var th = this; |
| 237 | if (th.data.total <= th.data.pageSize) return; | 199 | if (th.data.total <= th.data.pageSize) return; |
| 238 | if (th.data.ismore) return; | 200 | if (th.data.ismore) return; |
| 239 | - wx.showLoading({ | ||
| 240 | - title: '加载中...', | ||
| 241 | - }) | 201 | + |
| 242 | th.getList(); | 202 | th.getList(); |
| 243 | }, | 203 | }, |
| 244 | //图片失败,默认图片 | 204 | //图片失败,默认图片 |
pages/giftpack/giftpacklist/giftpacklist.js
| @@ -61,7 +61,7 @@ Page({ | @@ -61,7 +61,7 @@ Page({ | ||
| 61 | }, | 61 | }, |
| 62 | function() { | 62 | function() { |
| 63 | my_confirm.open_cancel(0); | 63 | my_confirm.open_cancel(0); |
| 64 | - | 64 | + |
| 65 | var json = { | 65 | var json = { |
| 66 | "actId": '', //活动Id | 66 | "actId": '', //活动Id |
| 67 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 67 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
| @@ -74,36 +74,36 @@ Page({ | @@ -74,36 +74,36 @@ Page({ | ||
| 74 | var data = JSON.stringify(json); | 74 | var data = JSON.stringify(json); |
| 75 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | 75 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; |
| 76 | 76 | ||
| 77 | - getApp().request.json_post(url,json, | ||
| 78 | - function(res){ | ||
| 79 | - if (res.data.code == 0) { | ||
| 80 | - var res = res.data.data; | ||
| 81 | - var order_sn = res.orderSn; | ||
| 82 | - var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; | ||
| 83 | - wx.requestPayment({ | ||
| 84 | - timeStamp: String(res.result.timeStamp), | ||
| 85 | - nonceStr: res.result.nonceStr, | ||
| 86 | - package: res.result.packageValue, | ||
| 87 | - signType: res.result.signType, | ||
| 88 | - paySign: res.result.paySign, | ||
| 89 | - success: function (n) { | ||
| 90 | - getApp().goto(url); | ||
| 91 | - }, | ||
| 92 | - fail: function (n) { | ||
| 93 | - getApp().my_confirm("取消支付", 0, th); | ||
| 94 | - } | ||
| 95 | - }); | ||
| 96 | - } else { | ||
| 97 | - getApp().my_warnning(res.data.msg, 0, th); | 77 | + getApp().request.json_post(url, json, |
| 78 | + function(res) { | ||
| 79 | + if (res.data.code == 0) { | ||
| 80 | + var res = res.data.data; | ||
| 81 | + var order_sn = res.orderSn; | ||
| 82 | + var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; | ||
| 83 | + wx.requestPayment({ | ||
| 84 | + timeStamp: String(res.result.timeStamp), | ||
| 85 | + nonceStr: res.result.nonceStr, | ||
| 86 | + package: res.result.packageValue, | ||
| 87 | + signType: res.result.signType, | ||
| 88 | + paySign: res.result.paySign, | ||
| 89 | + success: function(n) { | ||
| 90 | + getApp().goto(url); | ||
| 91 | + }, | ||
| 92 | + fail: function(n) { | ||
| 93 | + getApp().my_confirm("取消支付", 0, th); | ||
| 94 | + } | ||
| 95 | + }); | ||
| 96 | + } else { | ||
| 97 | + getApp().my_warnning(res.data.msg, 0, th); | ||
| 98 | + } | ||
| 99 | + }, | ||
| 100 | + function(res) { | ||
| 101 | + | ||
| 98 | } | 102 | } |
| 99 | - }, | ||
| 100 | - function(res){ | ||
| 101 | 103 | ||
| 102 | - } | 104 | + ) |
| 103 | 105 | ||
| 104 | - ) | ||
| 105 | 106 | ||
| 106 | - | ||
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | 109 | ||
| @@ -136,18 +136,18 @@ Page({ | @@ -136,18 +136,18 @@ Page({ | ||
| 136 | var data = JSON.stringify(json); | 136 | var data = JSON.stringify(json); |
| 137 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | 137 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; |
| 138 | getApp().request.json_post(url, json, | 138 | getApp().request.json_post(url, json, |
| 139 | - function (res) { | ||
| 140 | - if (res.data.code == 0) { | ||
| 141 | - getApp().my_warnning("兑换成功!", 1, th); | ||
| 142 | - } else { | ||
| 143 | - getApp().my_warnning(res.data.msg, 0, th); | ||
| 144 | - } | 139 | + function(res) { |
| 140 | + if (res.data.code == 0) { | ||
| 141 | + getApp().my_warnning("兑换成功!", 1, th); | ||
| 142 | + } else { | ||
| 143 | + getApp().my_warnning(res.data.msg, 0, th); | ||
| 144 | + } | ||
| 145 | }, | 145 | }, |
| 146 | - function (res) { | 146 | + function(res) { |
| 147 | 147 | ||
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | - ) | 150 | + ) |
| 151 | }) | 151 | }) |
| 152 | 152 | ||
| 153 | 153 | ||
| @@ -156,13 +156,13 @@ Page({ | @@ -156,13 +156,13 @@ Page({ | ||
| 156 | var _this = this; | 156 | var _this = this; |
| 157 | var th = this; | 157 | var th = this; |
| 158 | getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { | 158 | getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { |
| 159 | + isShowLoading: true, | ||
| 159 | data: { | 160 | data: { |
| 160 | "storeId": a.stoid, //商家ID | 161 | "storeId": a.stoid, //商家ID |
| 161 | "userId": d.user_id, //用户ID | 162 | "userId": d.user_id, //用户ID |
| 162 | "orderSn": th.data.orderSn | 163 | "orderSn": th.data.orderSn |
| 163 | }, | 164 | }, |
| 164 | - success: function success(res) { | ||
| 165 | - wx.hideLoading(); | 165 | + success: function(res) { |
| 166 | if (res.data.code == 0) { | 166 | if (res.data.code == 0) { |
| 167 | th.setData({ | 167 | th.setData({ |
| 168 | giftImage: th.data.iurl + res.data.data.lbUrl, | 168 | giftImage: th.data.iurl + res.data.data.lbUrl, |
| @@ -224,6 +224,7 @@ Page({ | @@ -224,6 +224,7 @@ Page({ | ||
| 224 | var _this2 = this; | 224 | var _this2 = this; |
| 225 | var th = this.data; | 225 | var th = this.data; |
| 226 | getApp().request.get('/api/weshop/marketing/giftbag/detail/get', { | 226 | getApp().request.get('/api/weshop/marketing/giftbag/detail/get', { |
| 227 | + isShowLoading: true, | ||
| 227 | data: { | 228 | data: { |
| 228 | "storeId": a.stoid, //商家ID | 229 | "storeId": a.stoid, //商家ID |
| 229 | "userId": d.user_id, //用户ID | 230 | "userId": d.user_id, //用户ID |
| @@ -278,9 +279,6 @@ Page({ | @@ -278,9 +279,6 @@ Page({ | ||
| 278 | //获取核销码 | 279 | //获取核销码 |
| 279 | getcode: function() { | 280 | getcode: function() { |
| 280 | var th = this; | 281 | var th = this; |
| 281 | - wx.showLoading({ | ||
| 282 | - title: '加载中', | ||
| 283 | - }) | ||
| 284 | var orderSn = th.data.orderSn; //订单号 | 282 | var orderSn = th.data.orderSn; //订单号 |
| 285 | var json = { | 283 | var json = { |
| 286 | "storeId": a.stoid, | 284 | "storeId": a.stoid, |
| @@ -288,15 +286,8 @@ Page({ | @@ -288,15 +286,8 @@ Page({ | ||
| 288 | }; | 286 | }; |
| 289 | var data = JSON.stringify(json); | 287 | var data = JSON.stringify(json); |
| 290 | var url = th.data.url + "/api/weshop/marketing/gift/goods/verify/code/get"; //预约接口地址 | 288 | var url = th.data.url + "/api/weshop/marketing/gift/goods/verify/code/get"; //预约接口地址 |
| 291 | - wx.request({ | ||
| 292 | - url: url, | ||
| 293 | - data: data, | ||
| 294 | - method: 'put', | ||
| 295 | - header: { | ||
| 296 | - 'content-type': 'application/json' | ||
| 297 | - }, // 设置请求的 header | ||
| 298 | - success: function(res) { | ||
| 299 | - wx.hideLoading(); | 289 | + getApp().request.json_post(url, json, |
| 290 | + function(res) { | ||
| 300 | if (res.data.code == 0) { | 291 | if (res.data.code == 0) { |
| 301 | th.setData({ | 292 | th.setData({ |
| 302 | code: res.data.data | 293 | code: res.data.data |
| @@ -305,8 +296,14 @@ Page({ | @@ -305,8 +296,14 @@ Page({ | ||
| 305 | } else { | 296 | } else { |
| 306 | getApp().my_warnning(res.data.msg, 0, th); | 297 | getApp().my_warnning(res.data.msg, 0, th); |
| 307 | } | 298 | } |
| 308 | - } | ||
| 309 | - }) | 299 | + }, |
| 300 | + function(res) { | ||
| 301 | + | ||
| 302 | + }, | ||
| 303 | + "put" | ||
| 304 | + | ||
| 305 | + ) | ||
| 306 | + | ||
| 310 | }, | 307 | }, |
| 311 | //界面跳转 | 308 | //界面跳转 |
| 312 | goto: function(e) { | 309 | goto: function(e) { |
pages/giftpack/giftpacklist/giftpacklist.wxml
| @@ -37,7 +37,7 @@ | @@ -37,7 +37,7 @@ | ||
| 37 | <text class="data-v-3a5b7e36">礼包内容</text> | 37 | <text class="data-v-3a5b7e36">礼包内容</text> |
| 38 | </view> | 38 | </view> |
| 39 | <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> | 39 | <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
| 40 | - <view class="box_ware_box data-v-3a5b7e36"> | 40 | + <view wx:if="{{item.couponName!=undefined}}" class="box_ware_box data-v-3a5b7e36"> |
| 41 | <view class="box_ware_img data-v-3a5b7e36"> | 41 | <view class="box_ware_img data-v-3a5b7e36"> |
| 42 | <block wx:if="{{item.lbType==1}}"> | 42 | <block wx:if="{{item.lbType==1}}"> |
| 43 | <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> | 43 | <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> |
pages/giftpack/mygiftpack/mygiftpack.js
| @@ -52,7 +52,6 @@ Page({ | @@ -52,7 +52,6 @@ Page({ | ||
| 52 | pageSize: th.data.pageSize | 52 | pageSize: th.data.pageSize |
| 53 | }, | 53 | }, |
| 54 | success: function success(res) { | 54 | success: function success(res) { |
| 55 | - wx.hideLoading(); | ||
| 56 | if (res.data.code == 0) { | 55 | if (res.data.code == 0) { |
| 57 | th.data.curpage++; | 56 | th.data.curpage++; |
| 58 | var arr1 = th.data.wareCard; | 57 | var arr1 = th.data.wareCard; |
| @@ -97,9 +96,6 @@ Page({ | @@ -97,9 +96,6 @@ Page({ | ||
| 97 | var th = this; | 96 | var th = this; |
| 98 | if (th.data.total <= th.data.pageSize) return; | 97 | if (th.data.total <= th.data.pageSize) return; |
| 99 | if (th.data.ismore) return; | 98 | if (th.data.ismore) return; |
| 100 | - wx.showLoading({ | ||
| 101 | - title: '加载中...', | ||
| 102 | - }) | ||
| 103 | th.getList(); | 99 | th.getList(); |
| 104 | }, | 100 | }, |
| 105 | //图片失败,默认图片 | 101 | //图片失败,默认图片 |
pages/giftpack/newvipgift/newvipgift.js
| @@ -33,10 +33,8 @@ Page({ | @@ -33,10 +33,8 @@ Page({ | ||
| 33 | GetList: function() { | 33 | GetList: function() { |
| 34 | var th = this; | 34 | var th = this; |
| 35 | var url = "/api/weshop/marketing/giftbag/bound/get"; | 35 | var url = "/api/weshop/marketing/giftbag/bound/get"; |
| 36 | - wx.showLoading({ | ||
| 37 | - title: '加载中', | ||
| 38 | - }) | ||
| 39 | getApp().request.promiseGet(url, { | 36 | getApp().request.promiseGet(url, { |
| 37 | + isShowLoading: true, | ||
| 40 | data: { | 38 | data: { |
| 41 | "actId": th.data.getActId, //活动id | 39 | "actId": th.data.getActId, //活动id |
| 42 | "actType": 1, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销 | 40 | "actType": 1, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销 |
| @@ -45,7 +43,6 @@ Page({ | @@ -45,7 +43,6 @@ Page({ | ||
| 45 | "userId": d.user_id //用户ID | 43 | "userId": d.user_id //用户ID |
| 46 | } | 44 | } |
| 47 | }).then(res => { | 45 | }).then(res => { |
| 48 | - wx.hideLoading(); | ||
| 49 | if (res.data.code == 0) { | 46 | if (res.data.code == 0) { |
| 50 | if (res.data.data.lbCoupons != null && res.data.data.lbCoupons.length > 0) { | 47 | if (res.data.data.lbCoupons != null && res.data.data.lbCoupons.length > 0) { |
| 51 | //礼包内容--礼券 | 48 | //礼包内容--礼券 |
| @@ -137,9 +134,6 @@ Page({ | @@ -137,9 +134,6 @@ Page({ | ||
| 137 | th.setData({ | 134 | th.setData({ |
| 138 | is_sub: 1 | 135 | is_sub: 1 |
| 139 | }) | 136 | }) |
| 140 | - wx.showLoading({ | ||
| 141 | - title: '加载中', | ||
| 142 | - }) | ||
| 143 | var json = { | 137 | var json = { |
| 144 | "actId": th.data.getActId, //活动Id | 138 | "actId": th.data.getActId, //活动Id |
| 145 | "actType": 1, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 139 | "actType": 1, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
| @@ -149,15 +143,8 @@ Page({ | @@ -149,15 +143,8 @@ Page({ | ||
| 149 | }; | 143 | }; |
| 150 | var data = JSON.stringify(json); | 144 | var data = JSON.stringify(json); |
| 151 | var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; | 145 | var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; |
| 152 | - wx.request({ | ||
| 153 | - url: url, | ||
| 154 | - data: data, | ||
| 155 | - method: 'post', | ||
| 156 | - header: { | ||
| 157 | - 'content-type': 'application/json' | ||
| 158 | - }, // 设置请求的 header | ||
| 159 | - success: function(res) { | ||
| 160 | - wx.hideLoading(); | 146 | + getApp().request.json_post(url, json, |
| 147 | + function(res) { | ||
| 161 | th.setData({ | 148 | th.setData({ |
| 162 | is_sub: 0 | 149 | is_sub: 0 |
| 163 | }) | 150 | }) |
| @@ -169,8 +156,13 @@ Page({ | @@ -169,8 +156,13 @@ Page({ | ||
| 169 | } else { | 156 | } else { |
| 170 | getApp().my_warnning(res.data.msg, 0, th); | 157 | getApp().my_warnning(res.data.msg, 0, th); |
| 171 | } | 158 | } |
| 172 | - } | ||
| 173 | - }) | 159 | + }, |
| 160 | + function(res) { | ||
| 161 | + | ||
| 162 | + }, "post" | ||
| 163 | + | ||
| 164 | + ) | ||
| 165 | + | ||
| 174 | } | 166 | } |
| 175 | }, | 167 | }, |
| 176 | //界面跳转 | 168 | //界面跳转 |