Commit 6a3588fba705cf94083249dff0b0e28a9c678d4a

Authored by 后端开发-许程
2 parents 3a63cfb4 28750010

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

pages/giftpack/birthdaygift/birthdaygift.wxml
... ... @@ -173,7 +173,7 @@
173 173 </block>
174 174 <block wx:else>
175 175 <view class="foot_button_buy'}}" bindtap="GetReceive">
176   - <text>一键领取</text>
  176 + <text>一键全部领取</text>
177 177 </view>
178 178 </block>
179 179 </view>
... ...
pages/giftpack/evaluategift/evaluategift.js
... ... @@ -110,7 +110,7 @@ Page({
110 110 if (res.data.data.actIntro != '') {
111 111 th.setData({
112 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 116 } else {
... ... @@ -136,11 +136,7 @@ Page({
136 136 th.GetList();
137 137 },
138 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 141 GetReceive: function() {
146 142 var th = this;
... ...
pages/giftpack/evaluategift/evaluategift.wxml
... ... @@ -152,7 +152,7 @@
152 152 <text>活动规则:</text>
153 153 </view>
154 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 156 </view>
157 157 </view>
158 158 </block>
... ... @@ -173,7 +173,7 @@
173 173 </block>
174 174 <block wx:else>
175 175 <view class="foot_button_buy'}}" bindtap="GetReceive">
176   - <text>一键领取</text>
  176 + <text>一键全部领取</text>
177 177 </view>
178 178 </block>
179 179 </view>
... ...
pages/giftpack/festival/festival.js
... ... @@ -19,7 +19,7 @@ Page({
19 19 getActId: '',
20 20 getActType: '',
21 21 giftID: '',
22   - receiveState: '一键全部领取',
  22 + receiveState: 0,
23 23 textTitle: '',
24 24 getUrl: '',
25 25 noShow: false,
... ... @@ -39,6 +39,7 @@ Page({
39 39 })
40 40 var url = "/api/weshop/marketing/giftbag/bound/get";
41 41 getApp().request.promiseGet(url, {
  42 + isShowLoading: true,
42 43 data: {
43 44 "actId": th.data.getActId, //活动id
44 45 "actType": 3, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销
... ... @@ -47,7 +48,6 @@ Page({
47 48 "userId": d.user_id //用户ID
48 49 }
49 50 }).then(res => {
50   - wx.hideLoading();
51 51 if (res.data.code == 0) {
52 52 if (res.data.data.lbCoupons != null && res.data.data.lbCoupons.length > 0) {
53 53 //礼包内容--礼券
... ... @@ -96,18 +96,18 @@ Page({
96 96 })
97 97 if (res.data.data.receiveState == 0) {
98 98 th.setData({
99   - receiveState: '一键全部领取'
  99 + receiveState: 0
100 100 })
101 101 } else {
102 102 th.setData({
103   - receiveState: '已领取'
  103 + receiveState: 1
104 104 })
105 105 }
106 106  
107 107 if (res.data.data.actIntro != '') {
108 108 th.setData({
109 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 113 } else {
... ... @@ -127,18 +127,11 @@ Page({
127 127 th.GetList();
128 128 },
129 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 132 GetReceive: function() {
137 133 var th = this;
138   - wx.showLoading({
139   - title: '加载中',
140   - })
141   - if (th.data.receiveState == '已领取') {
  134 + if (th.data.receiveState) {
142 135 return false;
143 136 }
144 137 var is_sub = th.data.is_sub; //判断是否重复提交
... ... @@ -155,28 +148,26 @@ Page({
155 148 }
156 149 var data = JSON.stringify(json);
157 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 153 th.setData({
168 154 is_sub: 0
169 155 })
170 156 if (res.data.code == 0) {
171 157 th.setData({
172   - receiveState: '已领取'
  158 + receiveState: 1
173 159 })
174 160 getApp().my_warnning("领取成功", 1, th);
175 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 147 <text>活动规则:</text>
148 148 </view>
149 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 151 </view>
152 152 </view>
153 153 </block>
... ... @@ -161,9 +161,16 @@
161 161 </view>
162 162 <view class="foot_empty "></view>
163 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 174 </view>
168 175 </view>
169 176 <!-- 引入提示组件 -->
... ...