Commit 53aab7fd3d7f6fb5d908b0961d0345cca9fd9816

Authored by 前端研发-钱巧玲
1 parent 2540a307

生日营销优化及bug修复

pages/giftpack/birthdaygift/birthdaygift.js
@@ -32,24 +32,28 @@ Page({ @@ -32,24 +32,28 @@ Page({
32 GetList: function () { 32 GetList: function () {
33 var th = this; 33 var th = this;
34 var url = "/api/weshop/marketing/giftbag/bound/get"; 34 var url = "/api/weshop/marketing/giftbag/bound/get";
  35 + wx.showLoading({
  36 + title: '加载中',
  37 + })
35 getApp().request.promiseGet(url, { 38 getApp().request.promiseGet(url, {
36 data: { 39 data: {
37 "actId": th.data.getActId, //活动id 40 "actId": th.data.getActId, //活动id
38 - "actType":4, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销 41 + "actType": 4, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销
39 "giftBagId": th.data.giftID, //礼包ID 42 "giftBagId": th.data.giftID, //礼包ID
40 "storeId": a.stoid, //商家ID 43 "storeId": a.stoid, //商家ID
41 "userId": d.user_id //用户ID 44 "userId": d.user_id //用户ID
42 } 45 }
43 }).then(res => { 46 }).then(res => {
  47 + wx.hideLoading();
44 if (res.data.code == 0) { 48 if (res.data.code == 0) {
45 - if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons!=null) { 49 + if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons != null) {
46 //礼包内容--礼券 50 //礼包内容--礼券
47 th.setData({ 51 th.setData({
48 cardShow: true, 52 cardShow: true,
49 cards: res.data.data.lbCoupons 53 cards: res.data.data.lbCoupons
50 }) 54 })
51 } 55 }
52 - if (res.data.data.lbSM.length > 0 && res.data.data.lbSM!=nll) { 56 + if (res.data.data.lbSM.length > 0 && res.data.data.lbSM != nll) {
53 //礼包内容--服务项目 57 //礼包内容--服务项目
54 th.setData({ 58 th.setData({
55 itemShow: true, 59 itemShow: true,
@@ -100,7 +104,8 @@ Page({ @@ -100,7 +104,8 @@ Page({
100 if (res.data.data.actIntro != '') { 104 if (res.data.data.actIntro != '') {
101 th.setData({ 105 th.setData({
102 textShow: true, 106 textShow: true,
103 - textTitle: res.data.data.actIntro 107 + textTitle: res.data.data.actIntro.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"').replace(/<section/g, '<div')
  108 + .replace(/\/section>/g, '\div>')
104 }) 109 })
105 } 110 }
106 } else { 111 } else {
@@ -119,11 +124,7 @@ Page({ @@ -119,11 +124,7 @@ Page({
119 th.GetList(); 124 th.GetList();
120 }, 125 },
121 onShow: function onShow() { 126 onShow: function onShow() {
122 - var th = this;  
123 - var textTitle = th.data.textTitle.replace(/<p><img/gi, "<p class='img'><img");  
124 - th.setData({  
125 - textTitle: textTitle  
126 - }) 127 +
127 }, 128 },
128 GetReceive: function () { 129 GetReceive: function () {
129 var th = this; 130 var th = this;
@@ -135,7 +136,9 @@ Page({ @@ -135,7 +136,9 @@ Page({
135 th.setData({ 136 th.setData({
136 is_sub: 1 137 is_sub: 1
137 }) 138 })
138 - 139 + wx.showLoading({
  140 + title: '加载中',
  141 + })
139 var json = { 142 var json = {
140 "actId": th.data.getActId, //活动Id 143 "actId": th.data.getActId, //活动Id
141 "actType": 4, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 144 "actType": 4, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
@@ -153,6 +156,7 @@ Page({ @@ -153,6 +156,7 @@ Page({
153 'content-type': 'application/json' 156 'content-type': 'application/json'
154 }, // 设置请求的 header 157 }, // 设置请求的 header
155 success: function (res) { 158 success: function (res) {
  159 + wx.hideLoading();
156 th.setData({ 160 th.setData({
157 is_sub: 0 161 is_sub: 0
158 }) 162 })
pages/giftpack/birthdaygift/birthdaygift.wxml
1 <view> 1 <view>
2 - <view class="image_box">  
3 - <image src="{{iurl+'/miniapp/images/giftbag/birth00.png'}}" lazy-load="true"></image>  
4 - </view>  
5 - <block wx:if="{{itemShow}}">  
6 - <view class="top">  
7 - <view class="top_box">  
8 - <view class="top_box_text">  
9 - <text>______</text>  
10 - </view>  
11 - <view class="top_box_text">  
12 - <text>新人专享\n你的美丽我来缔造</text>  
13 - </view>  
14 - <view class="top_box_text">  
15 - <text >______</text>  
16 - </view>  
17 - </view>  
18 - <block wx:for="{{itemWare}}" wx:for-item="item" wx:for-index="index" wx:key="index">  
19 - <view class="top_item ">  
20 - <block wx:if="{{item.lbType==3}}">  
21 - <view class="top_item_img">  
22 - <image src="{{item.fromImage=='' || item.fromImage==null?iurl+'/miniapp/images/giftbag/gift02.png':iurl+item.fromImage}}" lazy-load="true" data-errorimg="itemWare[{{index}}].fromImage" binderror="bind_bnerr1" data-img="{{item.fromImage}}"></image>  
23 - </view>  
24 - </block>  
25 - <block wx:if="{{item.lbType==1}}">  
26 - <view class="top_item_img ">  
27 - <image src="{{item.fromImage==''?iurl+'/miniapp/images/giftbag/empty.jpg':iurl+item.fromImage}}" lazy-load="true"></image>  
28 - </view>  
29 - </block>  
30 - <view class="top_item_center ">  
31 - <view class="top_item_center_title">  
32 - <block wx:if="{{item.lbType==1}}">  
33 - <text>免费领取</text>  
34 - </block>  
35 - <block wx:if="{{item.lbType==3}}">  
36 - <text>{{item.fromName}}</text>  
37 - </block>  
38 - </view>  
39 - <view class="top_item_center_ramke ">  
40 - <block wx:if="{{item.lbType==1}}">  
41 - <text>{{item.fromName}}</text>  
42 - </block>  
43 - <block wx:if="{{item.lbType==3}}">  
44 - <text >{{"新人可免费享受专业"+item.fromName+",可以享受"+item.num+"次。"}}</text>  
45 - </block>  
46 - </view>  
47 - </view>  
48 - </view>  
49 - </block> 2 + <view class="image_box">
  3 + <image src="{{iurl+'/miniapp/images/giftbag/birth00.png'}}" lazy-load="true"></image>
  4 + </view>
  5 + <block wx:if="{{itemShow}}">
  6 + <view class="top rel">
  7 + <view class="top_box">
  8 + <view class="top_box_text">
  9 + <text>______</text>
50 </view> 10 </view>
51 - </block>  
52 - <block wx:if="{{itemShow}}">  
53 - <view >  
54 - <image style="width:10px;height:47px;float:left;top:-38px;left:55px;" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image>  
55 - <image style="width:10px;height:47px;float:right;top:-38px;right:55px;" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image> 11 + <view class="top_box_text">
  12 + <text>新人专享\n你的美丽我来缔造</text>
56 </view> 13 </view>
57 - </block>  
58 - <block wx:if="{{cardShow}}">  
59 - <view >  
60 - <view class="top ">  
61 - <view class="top_box ">  
62 - <view class="top_box_text ">  
63 - <text >———</text>  
64 - </view>  
65 - <view class="top_box_text ">  
66 - <text >新人专享优惠券</text>  
67 - </view>  
68 - <view class="top_box_text ">  
69 - <text >———</text>  
70 - </view>  
71 - </view>  
72 - <block wx:for="{{cards}}" wx:for-item="item" wx:for-index="index" wx:key="index">  
73 - <view class="top_card ">  
74 - <view class="{{item.useObjectType==1?'top_card_box img1':item.useObjectType==2?'top_card_box img2':'top_card_box img3'}}">  
75 - <!-- class="{{['',item.useObjectType==1?'top_card_box img1':item.useObjectType==2?'top_card_box img2':'top_card_box img3']}}" -->  
76 - <view class="top_card_tite_box ">  
77 - <block wx:if="{{item.useObjectType==0}}">  
78 - <view class="top_card_tite_a">全场通用</view>  
79 - </block>  
80 - <block wx:if="{{item.useObjectType==1}}">  
81 - <view class="top_card_tite_b">品牌限定</view>  
82 - </block>  
83 - <block wx:if="{{item.useObjectType==2}}">  
84 - <view class="top_card_tite_c">品类限定</view>  
85 - </block>  
86 - <block wx:if="{{item.useObjectType==11}}">  
87 - <view class="top_card_tite_a">用途限定</view>  
88 - </block>  
89 - <block wx:if="{{item.useObjectType==12}}">  
90 - <view class="top_card_tite_a">分类限定</view>  
91 - </block>  
92 - </view>  
93 - <view class="top_card_counte ">{{item.sum+"元券"}}</view>  
94 - <view class="top_card_remak ">{{"满"+item.buySum+"元可以用"}}</view>  
95 - </view>  
96 - </view>  
97 - </block>  
98 - </view> 14 + <view class="top_box_text">
  15 + <text>______</text>
99 </view> 16 </view>
100 - </block>  
101 - <block wx:if="{{cardShow}}">  
102 - <view>  
103 - <view>  
104 - <image style="width:10px;height:47px;float:left;top:-38px;left:55px;" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image>  
105 - <image style="width:10px;height:47px;float:right;top:-38px;right:55px;" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image> 17 + </view>
  18 + <block wx:for="{{itemWare}}" wx:for-item="item" wx:for-index="index" wx:key="index">
  19 + <view class="top_item ">
  20 + <block wx:if="{{item.lbType==3}}">
  21 + <view class="top_item_img">
  22 + <image src="{{item.fromImage=='' || item.fromImage==null?iurl+'/miniapp/images/giftbag/gift02.png':iurl+item.fromImage}}" lazy-load="true" data-errorimg="itemWare[{{index}}].fromImage" binderror="bind_bnerr1" data-img="{{item.fromImage}}"></image>
106 </view> 23 </view>
107 - </view>  
108 - </block>  
109 - <block wx:if="{{packShow}}">  
110 - <view >  
111 - <view class="top ">  
112 - <view class="top_box ">  
113 - <view class="top_box_text ">  
114 - <text >———</text>  
115 - </view>  
116 - <view class="top_box_text ">  
117 - <text >新人专享福利</text>  
118 - </view>  
119 - <view class="top_box_text ">  
120 - <text >———</text>  
121 - </view>  
122 - </view>  
123 - <block wx:if="{{integralShow}}">  
124 - <view>  
125 - <view class="top_box_image ">  
126 - <image src="{{iurl+'/miniapp/images/giftbag/vip06.jpg'}}" lazy-load="true"></image>  
127 - <button>{{integralTitle}}</button>  
128 - </view>  
129 - </view>  
130 - </block>  
131 - <block wx:if="{{growUpShow}}">  
132 - <view >  
133 - <view class="top_box_image fs36">  
134 - <image src="{{iurl+'/miniapp/images/giftbag/vip07.jpg'}}" lazy-load="true"></image>  
135 - <button>{{growUpTitle}}</button>  
136 - </view>  
137 - </view>  
138 - </block> 24 + </block>
  25 + <block wx:if="{{item.lbType==1}}">
  26 + <view class="top_item_img ">
  27 + <image src="{{item.fromImage==''?iurl+'/miniapp/images/giftbag/empty.jpg':iurl+item.fromImage}}" lazy-load="true"></image>
139 </view> 28 </view>
140 - </view>  
141 - </block>  
142 - <block wx:if="{{textShow}}">  
143 - <view class="foot_box">  
144 - <view class="foot_box_title fs36">  
145 - <text>活动规则:</text> 29 + </block>
  30 + <view class="top_item_center ">
  31 + <view class="top_item_center_title">
  32 + <block wx:if="{{item.lbType==1}}">
  33 + <text>免费领取</text>
  34 + </block>
  35 + <block wx:if="{{item.lbType==3}}">
  36 + <text>{{item.fromName}}</text>
  37 + </block>
146 </view> 38 </view>
147 - <view class="foot_box_text">  
148 - <rich-text nodes="{{textTitle}}"></rich-text> 39 + <view class="top_item_center_ramke ">
  40 + <block wx:if="{{item.lbType==1}}">
  41 + <text>{{item.fromName}}</text>
  42 + </block>
  43 + <block wx:if="{{item.lbType==3}}">
  44 + <text>{{"新人可免费享受专业"+item.fromName+",可以享受"+item.num+"次。"}}</text>
  45 + </block>
  46 + <view class="num flex-level-right fs26">
  47 + <view>数量:</view>
  48 + <view>{{item.num}}</view>
  49 + </view>
149 </view> 50 </view>
  51 + </view>
150 </view> 52 </view>
151 - </block>  
152 - <view class="button_box">  
153 - <view >  
154 - <button class="button" bindtap="goto" data-url="/pages/index/index/index">进入商城购物</button> 53 + </block>
  54 + <block wx:if="{{itemShow}}">
  55 + <view class="vips">
  56 + <image class="lvip abs" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image>
  57 + <image class="rvip abs" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image>
155 </view> 58 </view>
156 - <view class="button_text ">  
157 - <text >本活动最终解释权归公司所有,如果有问题请联系客服</text> 59 + </block>
  60 + </view>
  61 + </block>
  62 + <block wx:if="{{cardShow}}">
  63 + <view>
  64 + <view class="top rel">
  65 + <view class="top_box ">
  66 + <view class="top_box_text ">
  67 + <text>———</text>
  68 + </view>
  69 + <view class="top_box_text ">
  70 + <text>新人专享优惠券</text>
  71 + </view>
  72 + <view class="top_box_text ">
  73 + <text>———</text>
  74 + </view>
158 </view> 75 </view>
  76 + <block wx:for="{{cards}}" wx:for-item="item" wx:for-index="index" wx:key="index">
  77 + <view class="top_card ">
  78 + <view class="{{item.useObjectType==1?'top_card_box img1':item.useObjectType==2?'top_card_box img2':'top_card_box img3'}}">
  79 + <!-- class="{{['',item.useObjectType==1?'top_card_box img1':item.useObjectType==2?'top_card_box img2':'top_card_box img3']}}" -->
  80 + <view class="top_card_tite_box ">
  81 + <block wx:if="{{item.useObjectType==0}}">
  82 + <view class="top_card_tite_a">全场通用</view>
  83 + </block>
  84 + <block wx:if="{{item.useObjectType==1}}">
  85 + <view class="top_card_tite_b">品牌限定</view>
  86 + </block>
  87 + <block wx:if="{{item.useObjectType==2}}">
  88 + <view class="top_card_tite_c">品类限定</view>
  89 + </block>
  90 + <block wx:if="{{item.useObjectType==11}}">
  91 + <view class="top_card_tite_a">用途限定</view>
  92 + </block>
  93 + <block wx:if="{{item.useObjectType==12}}">
  94 + <view class="top_card_tite_a">分类限定</view>
  95 + </block>
  96 + </view>
  97 + <block wx:if="{{item.isPack!=null}}">
  98 + <view class="top_card_counte">包邮券</view>
  99 + </block>
  100 + <block wx:else>
  101 + <view class="top_card_counte ">{{item.sum+"元券"}}</view>
  102 + <view class="top_card_remak ">{{"满"+item.buySum+"元可以用"}}</view>
  103 + </block>
  104 + </view>
  105 + </view>
  106 + </block>
  107 + <block wx:if="{{packShow}}">
  108 + <view class="vips">
  109 + <image class="lvip abs" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image>
  110 + <image class="rvip abs" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image>
  111 + </view>
  112 + </block>
  113 + </view>
159 </view> 114 </view>
160 - <view class="foot_empty "></view>  
161 - <view class="foot_button">  
162 - <view class="{{receiveState=='已领取'?'foot_button_notbuy':'foot_button_buy'}}" bindtap="GetReceive">  
163 - <text>{{receiveState}}</text> 115 + </block>
  116 + <block wx:if="{{packShow}}">
  117 + <view>
  118 + <view class="top ">
  119 + <view class="top_box ">
  120 + <view class="top_box_text ">
  121 + <text>———</text>
  122 + </view>
  123 + <view class="top_box_text ">
  124 + <text>新人专享福利</text>
  125 + </view>
  126 + <view class="top_box_text ">
  127 + <text>———</text>
  128 + </view>
164 </view> 129 </view>
  130 + <block wx:if="{{integralShow}}">
  131 + <view>
  132 + <view class="top_box_image ">
  133 + <image src="{{iurl+'/miniapp/images/giftbag/vip06.jpg'}}" lazy-load="true"></image>
  134 + <button>{{integralTitle}}</button>
  135 + </view>
  136 + </view>
  137 + </block>
  138 + <block wx:if="{{growUpShow}}">
  139 + <view>
  140 + <view class="top_box_image fs36">
  141 + <image src="{{iurl+'/miniapp/images/giftbag/vip07.jpg'}}" lazy-load="true"></image>
  142 + <button>{{growUpTitle}}</button>
  143 + </view>
  144 + </view>
  145 + </block>
  146 + </view>
  147 + </view>
  148 + </block>
  149 + <block wx:if="{{textShow}}">
  150 + <view class="foot_box">
  151 + <view class="foot_box_title fs36">
  152 + <text>活动规则:</text>
  153 + </view>
  154 + <view class="foot_box_text">
  155 + <rich-text nodes="{{textTitle}}" style="word-break:break-all;word-wrap:break-word"></rich-text>
  156 + </view>
  157 + </view>
  158 + </block>
  159 + <view class="button_box">
  160 + <view>
  161 + <button class="button" bindtap="goto" data-url="/pages/index/index/index">进入商城购物</button>
  162 + </view>
  163 + <view class="button_text ">
  164 + <text>本活动最终解释权归公司所有,如果有问题请联系客服</text>
  165 + </view>
  166 + </view>
  167 + <view class="foot_empty "></view>
  168 + <view class="foot_button">
  169 + <view class="{{receiveState=='已领取'?'foot_button_notbuy':'foot_button_buy'}}" bindtap="GetReceive">
  170 + <text>{{receiveState}}</text>
165 </view> 171 </view>
  172 + </view>
166 </view> 173 </view>
167 <!-- 引入提示组件 --> 174 <!-- 引入提示组件 -->
168 <warn id="warn"></warn> 175 <warn id="warn"></warn>