Commit 6a3588fba705cf94083249dff0b0e28a9c678d4a
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
5 changed files
with
33 additions
and
39 deletions
pages/giftpack/birthdaygift/birthdaygift.wxml
@@ -173,7 +173,7 @@ | @@ -173,7 +173,7 @@ | ||
173 | </block> | 173 | </block> |
174 | <block wx:else> | 174 | <block wx:else> |
175 | <view class="foot_button_buy'}}" bindtap="GetReceive"> | 175 | <view class="foot_button_buy'}}" bindtap="GetReceive"> |
176 | - <text>一键领取</text> | 176 | + <text>一键全部领取</text> |
177 | </view> | 177 | </view> |
178 | </block> | 178 | </block> |
179 | </view> | 179 | </view> |
pages/giftpack/evaluategift/evaluategift.js
@@ -110,7 +110,7 @@ Page({ | @@ -110,7 +110,7 @@ Page({ | ||
110 | if (res.data.data.actIntro != '') { | 110 | if (res.data.data.actIntro != '') { |
111 | th.setData({ | 111 | th.setData({ |
112 | textShow: true, | 112 | textShow: true, |
113 | - textTitle: res.data.data.actIntro | 113 | + textTitle: res.data.data.actIntro.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"') |
114 | }) | 114 | }) |
115 | } | 115 | } |
116 | } else { | 116 | } else { |
@@ -136,11 +136,7 @@ Page({ | @@ -136,11 +136,7 @@ Page({ | ||
136 | th.GetList(); | 136 | th.GetList(); |
137 | }, | 137 | }, |
138 | onShow: function() { | 138 | onShow: function() { |
139 | - var th = this; | ||
140 | - var textTitle = th.data.textTitle.replace(/<p><img/gi, "<p class='img'><img"); | ||
141 | - th.setData({ | ||
142 | - textTitle: textTitle | ||
143 | - }) | 139 | + |
144 | }, | 140 | }, |
145 | GetReceive: function() { | 141 | GetReceive: function() { |
146 | var th = this; | 142 | var th = this; |
pages/giftpack/evaluategift/evaluategift.wxml
@@ -152,7 +152,7 @@ | @@ -152,7 +152,7 @@ | ||
152 | <text>活动规则:</text> | 152 | <text>活动规则:</text> |
153 | </view> | 153 | </view> |
154 | <view class="foot_box_text"> | 154 | <view class="foot_box_text"> |
155 | - <rich-text nodes="{{textTitle}}"></rich-text> | 155 | + <rich-text nodes="{{textTitle}}" style="word-break:break-all;word-wrap:break-word"></rich-text> |
156 | </view> | 156 | </view> |
157 | </view> | 157 | </view> |
158 | </block> | 158 | </block> |
@@ -173,7 +173,7 @@ | @@ -173,7 +173,7 @@ | ||
173 | </block> | 173 | </block> |
174 | <block wx:else> | 174 | <block wx:else> |
175 | <view class="foot_button_buy'}}" bindtap="GetReceive"> | 175 | <view class="foot_button_buy'}}" bindtap="GetReceive"> |
176 | - <text>一键领取</text> | 176 | + <text>一键全部领取</text> |
177 | </view> | 177 | </view> |
178 | </block> | 178 | </block> |
179 | </view> | 179 | </view> |
pages/giftpack/festival/festival.js
@@ -19,7 +19,7 @@ Page({ | @@ -19,7 +19,7 @@ Page({ | ||
19 | getActId: '', | 19 | getActId: '', |
20 | getActType: '', | 20 | getActType: '', |
21 | giftID: '', | 21 | giftID: '', |
22 | - receiveState: '一键全部领取', | 22 | + receiveState: 0, |
23 | textTitle: '', | 23 | textTitle: '', |
24 | getUrl: '', | 24 | getUrl: '', |
25 | noShow: false, | 25 | noShow: false, |
@@ -39,6 +39,7 @@ Page({ | @@ -39,6 +39,7 @@ Page({ | ||
39 | }) | 39 | }) |
40 | var url = "/api/weshop/marketing/giftbag/bound/get"; | 40 | var url = "/api/weshop/marketing/giftbag/bound/get"; |
41 | getApp().request.promiseGet(url, { | 41 | getApp().request.promiseGet(url, { |
42 | + isShowLoading: true, | ||
42 | data: { | 43 | data: { |
43 | "actId": th.data.getActId, //活动id | 44 | "actId": th.data.getActId, //活动id |
44 | "actType": 3, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销 | 45 | "actType": 3, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销 |
@@ -47,7 +48,6 @@ Page({ | @@ -47,7 +48,6 @@ Page({ | ||
47 | "userId": d.user_id //用户ID | 48 | "userId": d.user_id //用户ID |
48 | } | 49 | } |
49 | }).then(res => { | 50 | }).then(res => { |
50 | - wx.hideLoading(); | ||
51 | if (res.data.code == 0) { | 51 | if (res.data.code == 0) { |
52 | if (res.data.data.lbCoupons != null && res.data.data.lbCoupons.length > 0) { | 52 | if (res.data.data.lbCoupons != null && res.data.data.lbCoupons.length > 0) { |
53 | //礼包内容--礼券 | 53 | //礼包内容--礼券 |
@@ -96,18 +96,18 @@ Page({ | @@ -96,18 +96,18 @@ Page({ | ||
96 | }) | 96 | }) |
97 | if (res.data.data.receiveState == 0) { | 97 | if (res.data.data.receiveState == 0) { |
98 | th.setData({ | 98 | th.setData({ |
99 | - receiveState: '一键全部领取' | 99 | + receiveState: 0 |
100 | }) | 100 | }) |
101 | } else { | 101 | } else { |
102 | th.setData({ | 102 | th.setData({ |
103 | - receiveState: '已领取' | 103 | + receiveState: 1 |
104 | }) | 104 | }) |
105 | } | 105 | } |
106 | 106 | ||
107 | if (res.data.data.actIntro != '') { | 107 | if (res.data.data.actIntro != '') { |
108 | th.setData({ | 108 | th.setData({ |
109 | textShow: true, | 109 | textShow: true, |
110 | - textTitle: res.data.data.actIntro | 110 | + textTitle: res.data.data.actIntro.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"') |
111 | }) | 111 | }) |
112 | } | 112 | } |
113 | } else { | 113 | } else { |
@@ -127,18 +127,11 @@ Page({ | @@ -127,18 +127,11 @@ Page({ | ||
127 | th.GetList(); | 127 | th.GetList(); |
128 | }, | 128 | }, |
129 | onShow: function() { | 129 | onShow: function() { |
130 | - var th = this; | ||
131 | - var textTitle = th.data.textTitle.replace(/<img/gi, '<img style="max-width:100%;height:auto;float:left;display:block" '); | ||
132 | - th.setData({ | ||
133 | - textTitle: textTitle | ||
134 | - }) | 130 | + |
135 | }, | 131 | }, |
136 | GetReceive: function() { | 132 | GetReceive: function() { |
137 | var th = this; | 133 | var th = this; |
138 | - wx.showLoading({ | ||
139 | - title: '加载中', | ||
140 | - }) | ||
141 | - if (th.data.receiveState == '已领取') { | 134 | + if (th.data.receiveState) { |
142 | return false; | 135 | return false; |
143 | } | 136 | } |
144 | var is_sub = th.data.is_sub; //判断是否重复提交 | 137 | var is_sub = th.data.is_sub; //判断是否重复提交 |
@@ -155,28 +148,26 @@ Page({ | @@ -155,28 +148,26 @@ Page({ | ||
155 | } | 148 | } |
156 | var data = JSON.stringify(json); | 149 | var data = JSON.stringify(json); |
157 | var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; | 150 | var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; |
158 | - wx.request({ | ||
159 | - url: url, | ||
160 | - data: data, | ||
161 | - method: 'post', | ||
162 | - header: { | ||
163 | - 'content-type': 'application/json' | ||
164 | - }, // 设置请求的 header | ||
165 | - success: function(res) { | ||
166 | - wx.hideLoading(); | 151 | + getApp().request.json_post(url, json, |
152 | + function (res) { | ||
167 | th.setData({ | 153 | th.setData({ |
168 | is_sub: 0 | 154 | is_sub: 0 |
169 | }) | 155 | }) |
170 | if (res.data.code == 0) { | 156 | if (res.data.code == 0) { |
171 | th.setData({ | 157 | th.setData({ |
172 | - receiveState: '已领取' | 158 | + receiveState: 1 |
173 | }) | 159 | }) |
174 | getApp().my_warnning("领取成功", 1, th); | 160 | getApp().my_warnning("领取成功", 1, th); |
175 | } else { | 161 | } else { |
176 | - getApp().my_warnning("系统繁忙,请稍后再试", 0, th); | 162 | + getApp().my_warnning(res.data.msg, 0, th); |
177 | } | 163 | } |
164 | + }, | ||
165 | + function (res) { | ||
166 | + | ||
178 | } | 167 | } |
179 | - }) | 168 | + |
169 | + ) | ||
170 | + | ||
180 | } | 171 | } |
181 | }, | 172 | }, |
182 | //获取节日有礼信息 | 173 | //获取节日有礼信息 |
pages/giftpack/festival/festival.wxml
@@ -147,7 +147,7 @@ | @@ -147,7 +147,7 @@ | ||
147 | <text>活动规则:</text> | 147 | <text>活动规则:</text> |
148 | </view> | 148 | </view> |
149 | <view class="foot_box_text"> | 149 | <view class="foot_box_text"> |
150 | - <rich-text nodes="{{textTitle}}"></rich-text> | 150 | + <rich-text nodes="{{textTitle}}" style="word-break:break-all;word-wrap:break-word"></rich-text> |
151 | </view> | 151 | </view> |
152 | </view> | 152 | </view> |
153 | </block> | 153 | </block> |
@@ -161,9 +161,16 @@ | @@ -161,9 +161,16 @@ | ||
161 | </view> | 161 | </view> |
162 | <view class="foot_empty "></view> | 162 | <view class="foot_empty "></view> |
163 | <view class="foot_button"> | 163 | <view class="foot_button"> |
164 | - <view class="{{receiveState=='已领取'?'foot_button_notbuy':'foot_button_buy'}}" bindtap="GetReceive" style="background-color:{{actFontColor!='' && actFontColor!=undefined?actFontColor:''}}"> | ||
165 | - <text>{{receiveState}}</text> | ||
166 | - </view> | 164 | + <block wx:if="{{receiveState}}"> |
165 | + <view class="foot_button_notbuy"> | ||
166 | + <text>已领取</text> | ||
167 | + </view> | ||
168 | + </block> | ||
169 | + <block wx:else> | ||
170 | + <view class="foot_button_buy'}}" bindtap="GetReceive"> | ||
171 | + <text>一键全部领取</text> | ||
172 | + </view> | ||
173 | + </block> | ||
167 | </view> | 174 | </view> |
168 | </view> | 175 | </view> |
169 | <!-- 引入提示组件 --> | 176 | <!-- 引入提示组件 --> |