Commit f8982991e5b87209d3afe7ac37555b9cf5b4eada

Authored by 后端开发-许程
2 parents 6731136a f9e20cc2

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

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>
pages/giftpack/buygiftpack/giftpackbuy.js
@@ -37,7 +37,7 @@ Page({ @@ -37,7 +37,7 @@ Page({
37 th.getList(); 37 th.getList();
38 }, 38 },
39 onShow: function() { 39 onShow: function() {
40 - 40 +
41 }, 41 },
42 42
43 GetBuyPrice: function(e) { 43 GetBuyPrice: function(e) {
@@ -57,6 +57,9 @@ Page({ @@ -57,6 +57,9 @@ Page({
57 }, 57 },
58 function() { 58 function() {
59 my_confirm.open_cancel(0); 59 my_confirm.open_cancel(0);
  60 + wx.showLoading({
  61 + title: '加载中',
  62 + })
60 var json = { 63 var json = {
61 "actId": '', //活动Id 64 "actId": '', //活动Id
62 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 65 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
@@ -76,6 +79,7 @@ Page({ @@ -76,6 +79,7 @@ Page({
76 'content-type': 'application/json' 79 'content-type': 'application/json'
77 }, // 设置请求的 header 80 }, // 设置请求的 header
78 success: function(res) { 81 success: function(res) {
  82 + wx.hideLoading();
79 if (res.data.code == 0) { 83 if (res.data.code == 0) {
80 var order_sn = res.data.data.orderSn; 84 var order_sn = res.data.data.orderSn;
81 res = res.data.data.result; 85 res = res.data.data.result;
@@ -89,7 +93,9 @@ Page({ @@ -89,7 +93,9 @@ Page({
89 success: function(res) { 93 success: function(res) {
90 getApp().goto(url); 94 getApp().goto(url);
91 }, 95 },
92 - fail: function(res) {} 96 + fail: function(res) {
  97 + getApp().my_confirm("取消支付", 0, th);
  98 + }
93 }); 99 });
94 } else { 100 } else {
95 getApp().my_warnning(res.data.msg, 0, th); 101 getApp().my_warnning(res.data.msg, 0, th);
@@ -99,7 +105,6 @@ Page({ @@ -99,7 +105,6 @@ Page({
99 105
100 } 106 }
101 107
102 -  
103 ) 108 )
104 109
105 110
@@ -118,6 +123,9 @@ Page({ @@ -118,6 +123,9 @@ Page({
118 }, 123 },
119 function() { 124 function() {
120 my_confirm.open_cancel(0); 125 my_confirm.open_cancel(0);
  126 + wx.showLoading({
  127 + title: '加载中',
  128 + })
121 var json = { 129 var json = {
122 "actId": '', //活动Id 130 "actId": '', //活动Id
123 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 131 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
@@ -136,6 +144,7 @@ Page({ @@ -136,6 +144,7 @@ Page({
136 'content-type': 'application/json' 144 'content-type': 'application/json'
137 }, // 设置请求的 header 145 }, // 设置请求的 header
138 success: function(res) { 146 success: function(res) {
  147 + wx.hideLoading();
139 if (res.data.code == 0) { 148 if (res.data.code == 0) {
140 getApp().my_warnning("兑换成功!", 1, th); 149 getApp().my_warnning("兑换成功!", 1, th);
141 } else { 150 } else {
@@ -197,7 +206,7 @@ Page({ @@ -197,7 +206,7 @@ Page({
197 var th = this; 206 var th = this;
198 var url = e.currentTarget.dataset.url; 207 var url = e.currentTarget.dataset.url;
199 getApp().goto(url); 208 getApp().goto(url);
200 - 209 +
201 }, 210 },
202 //下拉事件 211 //下拉事件
203 onReachBottom: function() { 212 onReachBottom: function() {
pages/giftpack/giftpacklist/giftpacklist.js
@@ -61,6 +61,9 @@ Page({ @@ -61,6 +61,9 @@ Page({
61 }, 61 },
62 function() { 62 function() {
63 my_confirm.open_cancel(0); 63 my_confirm.open_cancel(0);
  64 + wx.showLoading({
  65 + title: '加载中',
  66 + })
64 var json = { 67 var json = {
65 "actId": '', //活动Id 68 "actId": '', //活动Id
66 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 69 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
@@ -80,6 +83,7 @@ Page({ @@ -80,6 +83,7 @@ Page({
80 'content-type': 'application/json' 83 'content-type': 'application/json'
81 }, // 设置请求的 header 84 }, // 设置请求的 header
82 success: function(res) { 85 success: function(res) {
  86 + wx.hideLoading();
83 if (res.data.code == 0) { 87 if (res.data.code == 0) {
84 var res = res.data.data; 88 var res = res.data.data;
85 var order_sn = res.orderSn; 89 var order_sn = res.orderSn;
@@ -124,6 +128,9 @@ Page({ @@ -124,6 +128,9 @@ Page({
124 }, 128 },
125 function() { 129 function() {
126 my_confirm.open_cancel(0); 130 my_confirm.open_cancel(0);
  131 + wx.showLoading({
  132 + title: '加载中',
  133 + })
127 var json = { 134 var json = {
128 "actId": '', //活动Id 135 "actId": '', //活动Id
129 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 136 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
@@ -142,6 +149,7 @@ Page({ @@ -142,6 +149,7 @@ Page({
142 'content-type': 'application/json' 149 'content-type': 'application/json'
143 }, // 设置请求的 header 150 }, // 设置请求的 header
144 success: function(res) { 151 success: function(res) {
  152 + wx.hideLoading();
145 if (res.data.code == 0) { 153 if (res.data.code == 0) {
146 getApp().my_warnning("兑换成功!", 1, th); 154 getApp().my_warnning("兑换成功!", 1, th);
147 } else { 155 } else {
@@ -157,6 +165,9 @@ Page({ @@ -157,6 +165,9 @@ Page({
157 GetMyGiftList: function() { 165 GetMyGiftList: function() {
158 var _this = this; 166 var _this = this;
159 var th = this; 167 var th = this;
  168 + wx.showLoading({
  169 + title: '加载中',
  170 + })
160 getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { 171 getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', {
161 data: { 172 data: {
162 "storeId": a.stoid, //商家ID 173 "storeId": a.stoid, //商家ID
@@ -164,6 +175,7 @@ Page({ @@ -164,6 +175,7 @@ Page({
164 "orderSn": th.data.orderSn 175 "orderSn": th.data.orderSn
165 }, 176 },
166 success: function success(res) { 177 success: function success(res) {
  178 + wx.hideLoading();
167 if (res.data.code == 0) { 179 if (res.data.code == 0) {
168 th.setData({ 180 th.setData({
169 giftImage: th.data.iurl + res.data.data.lbUrl, 181 giftImage: th.data.iurl + res.data.data.lbUrl,
@@ -279,6 +291,9 @@ Page({ @@ -279,6 +291,9 @@ Page({
279 //获取核销码 291 //获取核销码
280 getcode: function() { 292 getcode: function() {
281 var th = this; 293 var th = this;
  294 + wx.showLoading({
  295 + title: '加载中',
  296 + })
282 var orderSn = th.data.orderSn; //订单号 297 var orderSn = th.data.orderSn; //订单号
283 var json = { 298 var json = {
284 "storeId": a.stoid, 299 "storeId": a.stoid,
@@ -294,6 +309,7 @@ Page({ @@ -294,6 +309,7 @@ Page({
294 'content-type': 'application/json' 309 'content-type': 'application/json'
295 }, // 设置请求的 header 310 }, // 设置请求的 header
296 success: function(res) { 311 success: function(res) {
  312 + wx.hideLoading();
297 if (res.data.code == 0) { 313 if (res.data.code == 0) {
298 th.setData({ 314 th.setData({
299 code: res.data.data 315 code: res.data.data
pages/giftpack/mygiftpack/mygiftpack.js
@@ -28,8 +28,6 @@ Page({ @@ -28,8 +28,6 @@ Page({
28 }, 28 },
29 29
30 onLoad: function(options) { 30 onLoad: function(options) {
31 - // this.getStorageID = options.stoid;  
32 - // this.getUserID = options.userid;  
33 var th = this; 31 var th = this;
34 th.setData({ 32 th.setData({
35 getStorageID: a.stoid, 33 getStorageID: a.stoid,
@@ -40,49 +38,15 @@ Page({ @@ -40,49 +38,15 @@ Page({
40 th.getList(); 38 th.getList();
41 }, 39 },
42 onShow: function() { 40 onShow: function() {
43 - // this.pages = 1;  
44 - // this.pageSize = 10;  
45 - // this.loadingType = 0;  
46 - // this.getList();  
47 - // var th = this;  
48 - // th.setData({  
49 - // pages: 1,  
50 - // pageSize: 10,  
51 - // loadingType: 0  
52 - // })  
53 - // th.getList();  
54 - },  
55 - // methods: {  
56 - // BuyGift: function BuyGift() {  
57 - // /*销毁跳转*/  
58 - // uni.reLaunch({  
59 - // url: 'pages/giftpack/buygiftpack/giftpackbuy?stoid=' + this.getStorageID + '&userid=' + this.getUserID  
60 - // });  
61 -  
62 - // },  
63 - // GetGiftPackList: function(getId, ojb) {  
64 - // //不销毁调整  
65 - // uni.navigateTo({  
66 - // url: 'pages/giftpack/giftpacklist/giftpacklist?isBuy=0&stoid=' + this.getStorageID + '&userid=' + this.getUserID + '&id=' +  
67 - // getId  
68 - // });  
69 41
70 - // }, 42 + },
71 getList: function() { 43 getList: function() {
72 var th = this; 44 var th = this;
73 - // if (th.data.loadingType) {  
74 - // return false;  
75 - // }  
76 - // // that.loadingType = 1;  
77 - // th.setData({  
78 - // loadingType: 1  
79 - // }) 45 + wx.showLoading({
  46 + title: '加载中',
  47 + })
80 getApp().request.get('/api/weshop/marketing/my/giftbag/page', { 48 getApp().request.get('/api/weshop/marketing/my/giftbag/page', {
81 data: { 49 data: {
82 - // "storeId": this.getStorageID, //商家ID  
83 - // "userId": this.getUserID, //用户ID  
84 - // "page": this.pages,  
85 - // "pageSize": this.pageSize  
86 storeId: th.data.getStorageID, //商家ID 50 storeId: th.data.getStorageID, //商家ID
87 userId: th.data.getUserID, //用户ID 51 userId: th.data.getUserID, //用户ID
88 page: th.data.curpage, 52 page: th.data.curpage,
@@ -108,47 +72,7 @@ Page({ @@ -108,47 +72,7 @@ Page({
108 is_read: 1 72 is_read: 1
109 }) 73 })
110 } 74 }
111 - // if (res.data.code == 0) {  
112 - // if (res.data.data.total > 0) {  
113 - // // _this.isEmpty = false;  
114 - // _this.setData({  
115 - // isEmpty: false  
116 - // })  
117 - // } else {  
118 - // // _this.isEmpty = true;  
119 - // _this.setData({  
120 - // isEmpty: true  
121 - // })  
122 - // }  
123 - // if (res.data.data.pageData.length == 0) {  
124 - // // _this.loadingType = 2;  
125 - // _this.setData({  
126 - // loadingType: 2  
127 - // })  
128 - // } else {  
129 - // var wareCard = that.wareCard;  
130 - // var is_resad = 0;  
131 - // // if (_this.wareCard.length < res.data.data.pageData.length) {  
132 - // if (wareCard.length < res.data.data.total) {  
133 - // for (var i = 0; i < res.data.data.pageData.length; i++) {  
134 - // wareCard.push(res.data.data.pageData[i]);  
135 - // }  
136 - // }else{  
137 - // is_resad=1  
138 - // }  
139 - // _this.setData({  
140 - // wareCard: wareCard,  
141 - // is_resad: is_resad  
142 - // })  
143 -  
144 - // // _this.loadingType = 0;  
145 - // _this.setData({  
146 - // loadingType: 0  
147 - // })  
148 - // }  
149 - // } else {  
150 -  
151 - // } 75 +
152 } 76 }
153 77
154 }); 78 });
pages/giftpack/newvipgift/newvipgift.js
@@ -28,7 +28,7 @@ Page({ @@ -28,7 +28,7 @@ Page({
28 integralTitle: "", 28 integralTitle: "",
29 growUpTitle: "", 29 growUpTitle: "",
30 is_sub: 0, //是否重复领取 30 is_sub: 0, //是否重复领取
31 - 31 +
32 }, 32 },
33 GetList: function() { 33 GetList: function() {
34 var th = this; 34 var th = this;
@@ -39,7 +39,7 @@ Page({ @@ -39,7 +39,7 @@ Page({
39 getApp().request.promiseGet(url, { 39 getApp().request.promiseGet(url, {
40 data: { 40 data: {
41 "actId": th.data.getActId, //活动id 41 "actId": th.data.getActId, //活动id
42 - "actType":1, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销 42 + "actType": 1, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销
43 "giftBagId": th.data.giftID, //礼包ID 43 "giftBagId": th.data.giftID, //礼包ID
44 "storeId": a.stoid, //商家ID 44 "storeId": a.stoid, //商家ID
45 "userId": d.user_id //用户ID 45 "userId": d.user_id //用户ID
@@ -47,14 +47,14 @@ Page({ @@ -47,14 +47,14 @@ Page({
47 }).then(res => { 47 }).then(res => {
48 wx.hideLoading(); 48 wx.hideLoading();
49 if (res.data.code == 0) { 49 if (res.data.code == 0) {
50 - if (res.data.data.lbCoupons != null && res.data.data.lbCoupons.length>0) { 50 + if (res.data.data.lbCoupons != null && res.data.data.lbCoupons.length > 0) {
51 //礼包内容--礼券 51 //礼包内容--礼券
52 th.setData({ 52 th.setData({
53 cardShow: true, 53 cardShow: true,
54 cards: res.data.data.lbCoupons 54 cards: res.data.data.lbCoupons
55 }) 55 })
56 } 56 }
57 - if (res.data.data.lbSM != null && res.data.data.lbSM.length>0) { 57 + if (res.data.data.lbSM != null && res.data.data.lbSM.length > 0) {
58 //礼包内容--服务项目 58 //礼包内容--服务项目
59 th.setData({ 59 th.setData({
60 itemShow: true, 60 itemShow: true,
@@ -125,7 +125,7 @@ Page({ @@ -125,7 +125,7 @@ Page({
125 th.GetList(); 125 th.GetList();
126 }, 126 },
127 onShow: function() { 127 onShow: function() {
128 - 128 +
129 }, 129 },
130 GetReceive: function() { 130 GetReceive: function() {
131 var th = this; 131 var th = this;
@@ -137,7 +137,9 @@ Page({ @@ -137,7 +137,9 @@ Page({
137 th.setData({ 137 th.setData({
138 is_sub: 1 138 is_sub: 1
139 }) 139 })
140 - 140 + wx.showLoading({
  141 + title: '加载中',
  142 + })
141 var json = { 143 var json = {
142 "actId": th.data.getActId, //活动Id 144 "actId": th.data.getActId, //活动Id
143 "actType": 1, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 145 "actType": 1, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
@@ -155,6 +157,7 @@ Page({ @@ -155,6 +157,7 @@ Page({
155 'content-type': 'application/json' 157 'content-type': 'application/json'
156 }, // 设置请求的 header 158 }, // 设置请求的 header
157 success: function(res) { 159 success: function(res) {
  160 + wx.hideLoading();
158 th.setData({ 161 th.setData({
159 is_sub: 0 162 is_sub: 0
160 }) 163 })
@@ -164,19 +167,19 @@ Page({ @@ -164,19 +167,19 @@ Page({
164 }) 167 })
165 getApp().my_warnning("领取成功", 1, th); 168 getApp().my_warnning("领取成功", 1, th);
166 } else { 169 } else {
167 - getApp().my_warnning("系统繁忙,请稍后再试", 0, th); 170 + getApp().my_warnning(res.data.msg, 0, th);
168 } 171 }
169 } 172 }
170 }) 173 })
171 } 174 }
172 }, 175 },
173 //界面跳转 176 //界面跳转
174 - goto:function(e){ 177 + goto: function(e) {
175 var url = e.currentTarget.dataset.url; 178 var url = e.currentTarget.dataset.url;
176 getApp().goto(url); 179 getApp().goto(url);
177 }, 180 },
178 //图片失败,默认图片 181 //图片失败,默认图片
179 - bind_bnerr1: function (e) { 182 + bind_bnerr1: function(e) {
180 var th = this; 183 var th = this;
181 var _errImg = e.target.dataset.errorimg; 184 var _errImg = e.target.dataset.errorimg;
182 var _Img = e.target.dataset.img; 185 var _Img = e.target.dataset.img;