Commit f5bb8dd52d1b8a8c56e5e207877f594acc4f3b05
1 parent
b3162824
礼包详情购买和兑换的bug修改以及图片显示问题
Showing
2 changed files
with
26 additions
and
29 deletions
pages/giftpack/giftpacklist/giftpacklist.js
... | ... | @@ -33,8 +33,6 @@ Page({ |
33 | 33 | var th = this; |
34 | 34 | th.setData({ |
35 | 35 | isBuy: options.isBuy, |
36 | - getStorageID: a.stoid, | |
37 | - getUserID: d.user_id, | |
38 | 36 | getGiftID: options.lbId, |
39 | 37 | orderSn: options.orderSn |
40 | 38 | }) |
... | ... | @@ -43,9 +41,6 @@ Page({ |
43 | 41 | } else { |
44 | 42 | th.GetBuyGiftList(); |
45 | 43 | } |
46 | - th.setData({ | |
47 | - giftRemark: th.data.giftRemark.replace(/<p><img/gi, "<p class='img'><img") | |
48 | - }) | |
49 | 44 | th.close(); |
50 | 45 | }, |
51 | 46 | onShow: function() { |
... | ... | @@ -55,6 +50,7 @@ Page({ |
55 | 50 | var that = this.data; |
56 | 51 | var th = this; |
57 | 52 | // var id = e.currentTarget.dataset.id;//活动id |
53 | + var money = e.currentTarget.dataset.money; | |
58 | 54 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
59 | 55 | my_confirm.open( |
60 | 56 | "是否确定购买该礼包", |
... | ... | @@ -69,9 +65,9 @@ Page({ |
69 | 65 | "actId": '', //活动Id |
70 | 66 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
71 | 67 | "buyType": '2', //1=积分兑换 2=余额购买 |
72 | - "lbId": that.getGiftID, //礼包Id | |
73 | - "storeId": that.getStorageID, //商家Id | |
74 | - "userId": that.getUserID, //用户ID | |
68 | + "giftBagId": that.getGiftID, //礼包Id | |
69 | + "storeId": a.stoid, //商家Id | |
70 | + "userId": d.user_id, //用户ID | |
75 | 71 | "buyFrom": 2 |
76 | 72 | }; |
77 | 73 | var data = JSON.stringify(json); |
... | ... | @@ -85,18 +81,20 @@ Page({ |
85 | 81 | }, // 设置请求的 header |
86 | 82 | success: function(res) { |
87 | 83 | if (res.data.code == 0) { |
88 | - res = res.data.data; | |
84 | + var res = res.data.data; | |
85 | + var order_sn = res.orderSn; | |
86 | + var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; | |
89 | 87 | wx.requestPayment({ |
90 | - timeStamp: String(res.timeStamp), | |
91 | - nonceStr: res.nonceStr, | |
92 | - package: res.packageValue, | |
93 | - signType: res.signType, | |
94 | - paySign: res.paySign, | |
88 | + timeStamp: String(res.result.timeStamp), | |
89 | + nonceStr: res.result.nonceStr, | |
90 | + package: res.result.packageValue, | |
91 | + signType: res.result.signType, | |
92 | + paySign: res.result.paySign, | |
95 | 93 | success: function(n) { |
96 | - | |
94 | + getApp().goto(url); | |
97 | 95 | }, |
98 | 96 | fail: function(n) { |
99 | - | |
97 | + getApp().my_confirm("取消支付", 0, th); | |
100 | 98 | } |
101 | 99 | }); |
102 | 100 | } else { |
... | ... | @@ -130,9 +128,9 @@ Page({ |
130 | 128 | "actId": '', //活动Id |
131 | 129 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
132 | 130 | "buyType": '1', //1=积分兑换 2=余额购买 |
133 | - "lbId": that.getGiftID, //礼包Id | |
134 | - "storeId": that.getStorageID, //商家Id | |
135 | - "userId": that.getUserID //用户ID | |
131 | + "giftBagId": that.getGiftID, //礼包Id | |
132 | + "storeId": a.stoid, //商家ID | |
133 | + "userId": d.user_id, //用户ID | |
136 | 134 | }; |
137 | 135 | var data = JSON.stringify(json); |
138 | 136 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; |
... | ... | @@ -161,8 +159,8 @@ Page({ |
161 | 159 | var th = this; |
162 | 160 | getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { |
163 | 161 | data: { |
164 | - "storeId": th.data.getStorageID, //商家ID | |
165 | - "userId": th.data.getUserID, //用户ID | |
162 | + "storeId": a.stoid, //商家ID | |
163 | + "userId": d.user_id, //用户ID | |
166 | 164 | "orderSn": th.data.orderSn |
167 | 165 | }, |
168 | 166 | success: function success(res) { |
... | ... | @@ -177,7 +175,7 @@ Page({ |
177 | 175 | }) |
178 | 176 | } else { |
179 | 177 | th.setData({ |
180 | - giftRemark: res.data.data.giftRemark | |
178 | + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"') | |
181 | 179 | }) |
182 | 180 | } |
183 | 181 | |
... | ... | @@ -228,8 +226,8 @@ Page({ |
228 | 226 | var th = this.data; |
229 | 227 | getApp().request.get('/api/weshop/marketing/giftbag/detail/get', { |
230 | 228 | data: { |
231 | - "storeId": th.getStorageID, //商家ID | |
232 | - "userId": th.getUserID, //用户ID | |
229 | + "storeId": a.stoid, //商家ID | |
230 | + "userId": d.user_id, //用户ID | |
233 | 231 | "giftBagId": th.getGiftID |
234 | 232 | }, |
235 | 233 | success: function success(res) { |
... | ... | @@ -239,13 +237,12 @@ Page({ |
239 | 237 | giftTitle: res.data.data.giftTitle |
240 | 238 | }) |
241 | 239 | if (res.data.data.giftRemark == '') { |
242 | - | |
243 | 240 | _this2.setData({ |
244 | 241 | giftRemark: '暂无详情......' |
245 | 242 | }) |
246 | 243 | } else { |
247 | 244 | _this2.setData({ |
248 | - giftRemark: res.data.data.giftRemark | |
245 | + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"') | |
249 | 246 | }) |
250 | 247 | } |
251 | 248 | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.wxml
... | ... | @@ -95,14 +95,14 @@ |
95 | 95 | <text class="data-v-3a5b7e36">活动说明</text> |
96 | 96 | </view> |
97 | 97 | <view class="foot_box_remark data-v-3a5b7e36"> |
98 | - <rich-text nodes="{{giftRemark}}"></rich-text> | |
98 | + <rich-text nodes="{{giftRemark}}" style="word-break:break-all;word-wrap:break-word"></rich-text> | |
99 | 99 | </view> |
100 | 100 | </view> |
101 | 101 | <view class="foot_empty data-v-3a5b7e36"></view> |
102 | 102 | <block wx:if="{{isBuy==1}}"> |
103 | 103 | <view class="foot_button data-v-3a5b7e36"> |
104 | 104 | <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> |
105 | - <view class="foot_button_left data-v-3a5b7e36" data-id="{{lbId}}" bindtap="GetBuyPrice"> | |
105 | + <view class="foot_button_left data-v-3a5b7e36" data-money="{{giftPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice"> | |
106 | 106 | <text class="data-v-3a5b7e36">立即购买</text> |
107 | 107 | </view> |
108 | 108 | </block> |
... | ... | @@ -112,7 +112,7 @@ |
112 | 112 | </view> |
113 | 113 | </block> |
114 | 114 | <block wx:if="{{giftPrice>0 && giftIntegral<=0}}"> |
115 | - <view class="foot_button_buy data-v-3a5b7e36" bindtap="GetBuyPrice" data-id="{{lbId}}"> | |
115 | + <view class="foot_button_buy data-v-3a5b7e36" data-money="{{giftPrice}}" bindtap="GetBuyPrice" data-id="{{lbId}}"> | |
116 | 116 | <text class="data-v-3a5b7e36">立即购买</text> |
117 | 117 | </view> |
118 | 118 | </block> | ... | ... |