Commit 2540a30748136a7dd2ad309f6ba2646e62af8583

Authored by 后端开发-许程
2 parents ee052b69 f5bb8dd5

Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev

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>
... ...
pages/user/assistance/assistance_success.js
... ... @@ -18,14 +18,15 @@ Page({
18 18 * 生命周期函数--监听页面加载
19 19 */
20 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 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 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 40 data: {
40   - userId: app_d.user_id,
41   - storeId: os.store_id,
  41 + storeId: store_id,
42 42 helpId: helpid
43 43 }
44 44 }).then(res => {
... ... @@ -46,7 +46,7 @@ Page({
46 46 th.setData({zl_act:res.data.data});
47 47 return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", {
48 48 data: {
49   - storeId: os.store_id,
  49 + storeId: store_id,
50 50 helpId: helpid
51 51 }
52 52 })
... ... @@ -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 76 \ No newline at end of file
... ...
pages/user/assistance/assistance_success.wxml
1   -
  1 +<wxs module="filter" src="c_filter.wxs"></wxs>
2 2 <view class="top-back" style="background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)">
3 3 <view class="flex-vertical user_assis">
4 4 <image class="circle user_img" src="{{user.head_pic}}"></image>
... ...
pages/user/assistance/friend_assistance.js
... ... @@ -17,9 +17,10 @@ Page({
17 17 is_show: 0, //显示弹框
18 18 user: app_d.userInfo,
19 19 zl_act: null, //助力活动
20   - task_id: 0, //助力任务ID
  20 + tasking: 0, //助力任务ID
21 21 userId: 0, //任务用户的ID
22 22 s_num: 0, //分享的人数
  23 + taskId:0, //活动从表ID
23 24 },
24 25  
25 26 /**
... ... @@ -27,25 +28,27 @@ Page({
27 28 */
28 29 onLoad: function(options) {
29 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 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 38 0) {
37 39 getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", {
38 40 data: {
39   - id: th.data.task_id,
  41 + id: th.data.tasking,
40 42 storeId: os.stoid
41 43 }
42 44 }).then(res => {
43 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 49 return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", {
47 50 data: {
48   - id: th.data.task_id,
  51 + helpId: res.data.data.helpFormId,
49 52 storeId: os.stoid
50 53 }
51 54 })
... ... @@ -96,9 +99,9 @@ Page({
96 99 var th = this;
97 100 var t_user_id = app_d.user_id;
98 101 var data = {
99   - id: this.data.task_id,
  102 + id: this.data.tasking,
100 103 storeId: os.stoid,
101   - userId: this.data.user_id,
  104 + userId: this.data.userId,
102 105 zlUserId: t_user_id
103 106 };
104 107 console.log(data);
... ... @@ -106,7 +109,7 @@ Page({
106 109 data, //入参
107 110 function(res) { //成功
108 111 if (res.data.code == 0)
109   - this.setData({
  112 + th.setData({
110 113 is_show: 1
111 114 });
112 115 else {
... ... @@ -121,9 +124,8 @@ Page({
121 124 },
122 125 //点击关闭礼盒
123 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 131 close: function() {
... ...
pages/user/assistance/friend_assistance.wxml
... ... @@ -14,12 +14,12 @@
14 14 </view>
15 15 <view class="flex jc-center">
16 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 18 </view>
19 19 </view>
20 20 </view>
21 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 24 <view class="cover-layer" wx:if='{{is_show!=0}}' bindtap="clike_none"></view>
25 25 <view class="libao_frame t-c" wx:if='{{is_show!=0}}'>
... ...