Commit 2540a30748136a7dd2ad309f6ba2646e62af8583
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
6 changed files
with
55 additions
and
53 deletions
pages/giftpack/giftpacklist/giftpacklist.js
| @@ -33,8 +33,6 @@ Page({ | @@ -33,8 +33,6 @@ Page({ | ||
| 33 | var th = this; | 33 | var th = this; |
| 34 | th.setData({ | 34 | th.setData({ |
| 35 | isBuy: options.isBuy, | 35 | isBuy: options.isBuy, |
| 36 | - getStorageID: a.stoid, | ||
| 37 | - getUserID: d.user_id, | ||
| 38 | getGiftID: options.lbId, | 36 | getGiftID: options.lbId, |
| 39 | orderSn: options.orderSn | 37 | orderSn: options.orderSn |
| 40 | }) | 38 | }) |
| @@ -43,9 +41,6 @@ Page({ | @@ -43,9 +41,6 @@ Page({ | ||
| 43 | } else { | 41 | } else { |
| 44 | th.GetBuyGiftList(); | 42 | th.GetBuyGiftList(); |
| 45 | } | 43 | } |
| 46 | - th.setData({ | ||
| 47 | - giftRemark: th.data.giftRemark.replace(/<p><img/gi, "<p class='img'><img") | ||
| 48 | - }) | ||
| 49 | th.close(); | 44 | th.close(); |
| 50 | }, | 45 | }, |
| 51 | onShow: function() { | 46 | onShow: function() { |
| @@ -55,6 +50,7 @@ Page({ | @@ -55,6 +50,7 @@ Page({ | ||
| 55 | var that = this.data; | 50 | var that = this.data; |
| 56 | var th = this; | 51 | var th = this; |
| 57 | // var id = e.currentTarget.dataset.id;//活动id | 52 | // var id = e.currentTarget.dataset.id;//活动id |
| 53 | + var money = e.currentTarget.dataset.money; | ||
| 58 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id | 54 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
| 59 | my_confirm.open( | 55 | my_confirm.open( |
| 60 | "是否确定购买该礼包", | 56 | "是否确定购买该礼包", |
| @@ -69,9 +65,9 @@ Page({ | @@ -69,9 +65,9 @@ Page({ | ||
| 69 | "actId": '', //活动Id | 65 | "actId": '', //活动Id |
| 70 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 66 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
| 71 | "buyType": '2', //1=积分兑换 2=余额购买 | 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 | "buyFrom": 2 | 71 | "buyFrom": 2 |
| 76 | }; | 72 | }; |
| 77 | var data = JSON.stringify(json); | 73 | var data = JSON.stringify(json); |
| @@ -85,18 +81,20 @@ Page({ | @@ -85,18 +81,20 @@ Page({ | ||
| 85 | }, // 设置请求的 header | 81 | }, // 设置请求的 header |
| 86 | success: function(res) { | 82 | success: function(res) { |
| 87 | if (res.data.code == 0) { | 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 | wx.requestPayment({ | 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 | success: function(n) { | 93 | success: function(n) { |
| 96 | - | 94 | + getApp().goto(url); |
| 97 | }, | 95 | }, |
| 98 | fail: function(n) { | 96 | fail: function(n) { |
| 99 | - | 97 | + getApp().my_confirm("取消支付", 0, th); |
| 100 | } | 98 | } |
| 101 | }); | 99 | }); |
| 102 | } else { | 100 | } else { |
| @@ -130,9 +128,9 @@ Page({ | @@ -130,9 +128,9 @@ Page({ | ||
| 130 | "actId": '', //活动Id | 128 | "actId": '', //活动Id |
| 131 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 129 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
| 132 | "buyType": '1', //1=积分兑换 2=余额购买 | 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 | var data = JSON.stringify(json); | 135 | var data = JSON.stringify(json); |
| 138 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | 136 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; |
| @@ -161,8 +159,8 @@ Page({ | @@ -161,8 +159,8 @@ Page({ | ||
| 161 | var th = this; | 159 | var th = this; |
| 162 | getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { | 160 | getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { |
| 163 | data: { | 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 | "orderSn": th.data.orderSn | 164 | "orderSn": th.data.orderSn |
| 167 | }, | 165 | }, |
| 168 | success: function success(res) { | 166 | success: function success(res) { |
| @@ -177,7 +175,7 @@ Page({ | @@ -177,7 +175,7 @@ Page({ | ||
| 177 | }) | 175 | }) |
| 178 | } else { | 176 | } else { |
| 179 | th.setData({ | 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,8 +226,8 @@ Page({ | ||
| 228 | var th = this.data; | 226 | var th = this.data; |
| 229 | getApp().request.get('/api/weshop/marketing/giftbag/detail/get', { | 227 | getApp().request.get('/api/weshop/marketing/giftbag/detail/get', { |
| 230 | data: { | 228 | data: { |
| 231 | - "storeId": th.getStorageID, //商家ID | ||
| 232 | - "userId": th.getUserID, //用户ID | 229 | + "storeId": a.stoid, //商家ID |
| 230 | + "userId": d.user_id, //用户ID | ||
| 233 | "giftBagId": th.getGiftID | 231 | "giftBagId": th.getGiftID |
| 234 | }, | 232 | }, |
| 235 | success: function success(res) { | 233 | success: function success(res) { |
| @@ -239,13 +237,12 @@ Page({ | @@ -239,13 +237,12 @@ Page({ | ||
| 239 | giftTitle: res.data.data.giftTitle | 237 | giftTitle: res.data.data.giftTitle |
| 240 | }) | 238 | }) |
| 241 | if (res.data.data.giftRemark == '') { | 239 | if (res.data.data.giftRemark == '') { |
| 242 | - | ||
| 243 | _this2.setData({ | 240 | _this2.setData({ |
| 244 | giftRemark: '暂无详情......' | 241 | giftRemark: '暂无详情......' |
| 245 | }) | 242 | }) |
| 246 | } else { | 243 | } else { |
| 247 | _this2.setData({ | 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,14 +95,14 @@ | ||
| 95 | <text class="data-v-3a5b7e36">活动说明</text> | 95 | <text class="data-v-3a5b7e36">活动说明</text> |
| 96 | </view> | 96 | </view> |
| 97 | <view class="foot_box_remark data-v-3a5b7e36"> | 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 | </view> | 99 | </view> |
| 100 | </view> | 100 | </view> |
| 101 | <view class="foot_empty data-v-3a5b7e36"></view> | 101 | <view class="foot_empty data-v-3a5b7e36"></view> |
| 102 | <block wx:if="{{isBuy==1}}"> | 102 | <block wx:if="{{isBuy==1}}"> |
| 103 | <view class="foot_button data-v-3a5b7e36"> | 103 | <view class="foot_button data-v-3a5b7e36"> |
| 104 | <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> | 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 | <text class="data-v-3a5b7e36">立即购买</text> | 106 | <text class="data-v-3a5b7e36">立即购买</text> |
| 107 | </view> | 107 | </view> |
| 108 | </block> | 108 | </block> |
| @@ -112,7 +112,7 @@ | @@ -112,7 +112,7 @@ | ||
| 112 | </view> | 112 | </view> |
| 113 | </block> | 113 | </block> |
| 114 | <block wx:if="{{giftPrice>0 && giftIntegral<=0}}"> | 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 | <text class="data-v-3a5b7e36">立即购买</text> | 116 | <text class="data-v-3a5b7e36">立即购买</text> |
| 117 | </view> | 117 | </view> |
| 118 | </block> | 118 | </block> |
pages/user/assistance/assistance_success.js
| @@ -18,14 +18,15 @@ Page({ | @@ -18,14 +18,15 @@ Page({ | ||
| 18 | * 生命周期函数--监听页面加载 | 18 | * 生命周期函数--监听页面加载 |
| 19 | */ | 19 | */ |
| 20 | onLoad: function (options) { | 20 | onLoad: function (options) { |
| 21 | - | 21 | + //var helpid=options.helpid; |
| 22 | + var helpid=23; | ||
| 23 | + this.init(helpid); | ||
| 22 | }, | 24 | }, |
| 23 | /** | 25 | /** |
| 24 | * 生命周期函数--监听页面显示 | 26 | * 生命周期函数--监听页面显示 |
| 25 | */ | 27 | */ |
| 26 | onShow: function (e) { | 28 | onShow: function (e) { |
| 27 | - var helpid=e.helpid; | ||
| 28 | - this.init(helpid); | 29 | + |
| 29 | }, | 30 | }, |
| 30 | 31 | ||
| 31 | // ----初始化---- | 32 | // ----初始化---- |
| @@ -35,10 +36,9 @@ Page({ | @@ -35,10 +36,9 @@ Page({ | ||
| 35 | var th=this; | 36 | var th=this; |
| 36 | 37 | ||
| 37 | //链式调用接口,先获取活动,在获取参与活动的人数 | 38 | //链式调用接口,先获取活动,在获取参与活动的人数 |
| 38 | - getApp().request.promiseGet("/api/weshop/marketing/help/help/user/page", { | 39 | + getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { |
| 39 | data: { | 40 | data: { |
| 40 | - userId: app_d.user_id, | ||
| 41 | - storeId: os.store_id, | 41 | + storeId: store_id, |
| 42 | helpId: helpid | 42 | helpId: helpid |
| 43 | } | 43 | } |
| 44 | }).then(res => { | 44 | }).then(res => { |
| @@ -46,7 +46,7 @@ Page({ | @@ -46,7 +46,7 @@ Page({ | ||
| 46 | th.setData({zl_act:res.data.data}); | 46 | th.setData({zl_act:res.data.data}); |
| 47 | return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { | 47 | return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { |
| 48 | data: { | 48 | data: { |
| 49 | - storeId: os.store_id, | 49 | + storeId: store_id, |
| 50 | helpId: helpid | 50 | helpId: helpid |
| 51 | } | 51 | } |
| 52 | }) | 52 | }) |
| @@ -69,4 +69,7 @@ Page({ | @@ -69,4 +69,7 @@ Page({ | ||
| 69 | 69 | ||
| 70 | }, | 70 | }, |
| 71 | 71 | ||
| 72 | + cklie_button:function(){ | ||
| 73 | + getApp().goto("/pages/user/assistance/assistance") | ||
| 74 | + } | ||
| 72 | }) | 75 | }) |
| 73 | \ No newline at end of file | 76 | \ No newline at end of file |
pages/user/assistance/assistance_success.wxml
| 1 | - | 1 | +<wxs module="filter" src="c_filter.wxs"></wxs> |
| 2 | <view class="top-back" style="background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)"> | 2 | <view class="top-back" style="background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)"> |
| 3 | <view class="flex-vertical user_assis"> | 3 | <view class="flex-vertical user_assis"> |
| 4 | <image class="circle user_img" src="{{user.head_pic}}"></image> | 4 | <image class="circle user_img" src="{{user.head_pic}}"></image> |
pages/user/assistance/friend_assistance.js
| @@ -17,9 +17,10 @@ Page({ | @@ -17,9 +17,10 @@ Page({ | ||
| 17 | is_show: 0, //显示弹框 | 17 | is_show: 0, //显示弹框 |
| 18 | user: app_d.userInfo, | 18 | user: app_d.userInfo, |
| 19 | zl_act: null, //助力活动 | 19 | zl_act: null, //助力活动 |
| 20 | - task_id: 0, //助力任务ID | 20 | + tasking: 0, //助力任务ID |
| 21 | userId: 0, //任务用户的ID | 21 | userId: 0, //任务用户的ID |
| 22 | s_num: 0, //分享的人数 | 22 | s_num: 0, //分享的人数 |
| 23 | + taskId:0, //活动从表ID | ||
| 23 | }, | 24 | }, |
| 24 | 25 | ||
| 25 | /** | 26 | /** |
| @@ -27,25 +28,27 @@ Page({ | @@ -27,25 +28,27 @@ Page({ | ||
| 27 | */ | 28 | */ |
| 28 | onLoad: function(options) { | 29 | onLoad: function(options) { |
| 29 | var th = this; | 30 | var th = this; |
| 30 | - if (options.task_id) this.data.task_id = options.task_id; | 31 | + if (options.tasking) this.data.tasking = options.tasking; |
| 31 | if (options.userId) this.data.userId = options.userId; | 32 | if (options.userId) this.data.userId = options.userId; |
| 32 | //任务是不是为空 | 33 | //任务是不是为空 |
| 33 | - if (this.data.task_id == 0 || this.data.task_id == undefined) { | ||
| 34 | - this.data.task_id = decodeURIComponent(options.scene); | ||
| 35 | - if (this.data.task_id != null && this.data.task_id != 'undefined' && this.data.task_id != "" && this.data.task_id != | 34 | + if (this.data.tasking == 0 || this.data.tasking == undefined) { |
| 35 | + //this.data.task_id = decodeURIComponent(options.scene); | ||
| 36 | + this.data.tasking =1; | ||
| 37 | + if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking != | ||
| 36 | 0) { | 38 | 0) { |
| 37 | getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", { | 39 | getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", { |
| 38 | data: { | 40 | data: { |
| 39 | - id: th.data.task_id, | 41 | + id: th.data.tasking, |
| 40 | storeId: os.stoid | 42 | storeId: os.stoid |
| 41 | } | 43 | } |
| 42 | }).then(res => { | 44 | }).then(res => { |
| 43 | if (res.data.code == 0) { | 45 | if (res.data.code == 0) { |
| 44 | - th.data.userId = res.data.data.user_id; | 46 | + th.data.userId = res.data.data.userId; |
| 47 | + th.data.taskId = res.data.data.taskId; | ||
| 45 | //获取活动的时间 | 48 | //获取活动的时间 |
| 46 | return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { | 49 | return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { |
| 47 | data: { | 50 | data: { |
| 48 | - id: th.data.task_id, | 51 | + helpId: res.data.data.helpFormId, |
| 49 | storeId: os.stoid | 52 | storeId: os.stoid |
| 50 | } | 53 | } |
| 51 | }) | 54 | }) |
| @@ -96,9 +99,9 @@ Page({ | @@ -96,9 +99,9 @@ Page({ | ||
| 96 | var th = this; | 99 | var th = this; |
| 97 | var t_user_id = app_d.user_id; | 100 | var t_user_id = app_d.user_id; |
| 98 | var data = { | 101 | var data = { |
| 99 | - id: this.data.task_id, | 102 | + id: this.data.tasking, |
| 100 | storeId: os.stoid, | 103 | storeId: os.stoid, |
| 101 | - userId: this.data.user_id, | 104 | + userId: this.data.userId, |
| 102 | zlUserId: t_user_id | 105 | zlUserId: t_user_id |
| 103 | }; | 106 | }; |
| 104 | console.log(data); | 107 | console.log(data); |
| @@ -106,7 +109,7 @@ Page({ | @@ -106,7 +109,7 @@ Page({ | ||
| 106 | data, //入参 | 109 | data, //入参 |
| 107 | function(res) { //成功 | 110 | function(res) { //成功 |
| 108 | if (res.data.code == 0) | 111 | if (res.data.code == 0) |
| 109 | - this.setData({ | 112 | + th.setData({ |
| 110 | is_show: 1 | 113 | is_show: 1 |
| 111 | }); | 114 | }); |
| 112 | else { | 115 | else { |
| @@ -121,9 +124,8 @@ Page({ | @@ -121,9 +124,8 @@ Page({ | ||
| 121 | }, | 124 | }, |
| 122 | //点击关闭礼盒 | 125 | //点击关闭礼盒 |
| 123 | clike_none: function() { | 126 | clike_none: function() { |
| 124 | - this.setData({ | ||
| 125 | - is_show: 0 | ||
| 126 | - }); | 127 | + this.setData({is_show: 0}); |
| 128 | + getApp().goto("/pages/user/assistance/assistance_success"); | ||
| 127 | }, | 129 | }, |
| 128 | //导航球 | 130 | //导航球 |
| 129 | close: function() { | 131 | close: function() { |
pages/user/assistance/friend_assistance.wxml
| @@ -14,12 +14,12 @@ | @@ -14,12 +14,12 @@ | ||
| 14 | </view> | 14 | </view> |
| 15 | <view class="flex jc-center"> | 15 | <view class="flex jc-center"> |
| 16 | <view class="activity_time fs24 white"> | 16 | <view class="activity_time fs24 white"> |
| 17 | - 活动时间:{{filter.fm_time(zl_act.begindate)}}-{{filter.fm_time(zl_act.begindate)}} | 17 | + 活动时间:{{filter.fm_time(zl_act.beginDate)}}-{{filter.fm_time(zl_act.beginDate)}} |
| 18 | </view> | 18 | </view> |
| 19 | </view> | 19 | </view> |
| 20 | </view> | 20 | </view> |
| 21 | <view class="cklie_button t-c flex-center" bindtap="cklie_button">帮他拆礼盒</view> | 21 | <view class="cklie_button t-c flex-center" bindtap="cklie_button">帮他拆礼盒</view> |
| 22 | -<view class="fs26 white t-c">已有{{zl_act.qiang_num}}人领取礼盒</view> | 22 | +<view class="fs26 white t-c" wx:if="{{s_num}}">已有{{s_num}}人领取礼盒</view> |
| 23 | <!-- 礼盒弹框 --> | 23 | <!-- 礼盒弹框 --> |
| 24 | <view class="cover-layer" wx:if='{{is_show!=0}}' bindtap="clike_none"></view> | 24 | <view class="cover-layer" wx:if='{{is_show!=0}}' bindtap="clike_none"></view> |
| 25 | <view class="libao_frame t-c" wx:if='{{is_show!=0}}'> | 25 | <view class="libao_frame t-c" wx:if='{{is_show!=0}}'> |