Commit 8b03301bea3983ce5a5206f1e3b0933da899ded3
Merge branch 'qa' into 'master'
Qa See merge request !246
Showing
76 changed files
with
7177 additions
and
740 deletions
app.js
@@ -327,12 +327,35 @@ App({ | @@ -327,12 +327,35 @@ App({ | ||
327 | } | 327 | } |
328 | //---如果会员没有设置默认门店,同时也没有再注册的时候选择门店-- | 328 | //---如果会员没有设置默认门店,同时也没有再注册的时候选择门店-- |
329 | if(pick_id==0) return func(null); | 329 | if(pick_id==0) return func(null); |
330 | - //获取用户注册时候的门店 | 330 | + //获取用户注册时候的门店,这个门店不能关闭,同时这个门店的分类不能关闭 |
331 | th.request.get("/api/weshop/pickup/get/"+os.stoid+"/"+pick_id,{ | 331 | th.request.get("/api/weshop/pickup/get/"+os.stoid+"/"+pick_id,{ |
332 | data:{}, | 332 | data:{}, |
333 | success:function (res) { | 333 | success:function (res) { |
334 | - th.globalData.pk_store=res.data.data; | ||
335 | - func(th.globalData.pk_store); | 334 | + th.globalData.pk_store=null; |
335 | + if(res.data.code==0 && res.data.data && res.data.data.isstop==0){ | ||
336 | + if(res.data.data.category_id){ | ||
337 | + th.request.get( "/api/weshop/storagecategory/get/"+os.stoid+"/"+res.data.data.category_id, { | ||
338 | + data: {}, | ||
339 | + success: function (ee) { | ||
340 | + if(ee.data.code==0 && ee.data.data ){ | ||
341 | + if(ee.data.data.is_show==1){ | ||
342 | + th.globalData.pk_store = res.data.data; | ||
343 | + func(th.globalData.pk_store); | ||
344 | + }else{ | ||
345 | + func(null); | ||
346 | + } | ||
347 | + }else{ | ||
348 | + func(null); | ||
349 | + } | ||
350 | + } | ||
351 | + }) | ||
352 | + }else{ | ||
353 | + th.globalData.pk_store = res.data.data; | ||
354 | + func(th.globalData.pk_store); | ||
355 | + } | ||
356 | + }else{ | ||
357 | + func(null); | ||
358 | + } | ||
336 | } | 359 | } |
337 | }) | 360 | }) |
338 | }else{ | 361 | }else{ |
@@ -340,7 +363,6 @@ App({ | @@ -340,7 +363,6 @@ App({ | ||
340 | } | 363 | } |
341 | }) | 364 | }) |
342 | 365 | ||
343 | - | ||
344 | }, | 366 | }, |
345 | 367 | ||
346 | //-------获取购物车数量---------- | 368 | //-------获取购物车数量---------- |
app.json
1 | { | 1 | { |
2 | - "pages": [ | ||
3 | - "pages/index/index/index", | 2 | + "pages": [ |
3 | + "pages/index/index/index", | ||
4 | "pages/goods/categoryList/categoryList", | 4 | "pages/goods/categoryList/categoryList", |
5 | "pages/cart/cart/cart", | 5 | "pages/cart/cart/cart", |
6 | "pages/cart/cart2/cart2", | 6 | "pages/cart/cart2/cart2", |
@@ -17,7 +17,6 @@ | @@ -17,7 +17,6 @@ | ||
17 | "pages/user/address_list/address_list", | 17 | "pages/user/address_list/address_list", |
18 | "pages/user/userinfo/userinfo", | 18 | "pages/user/userinfo/userinfo", |
19 | "pages/user/account/account", | 19 | "pages/user/account/account", |
20 | - "pages/user/comment/comment", | ||
21 | "pages/user/return_goods_list/return_goods_list", | 20 | "pages/user/return_goods_list/return_goods_list", |
22 | "pages/user/userinfo_edit/userinfo_edit", | 21 | "pages/user/userinfo_edit/userinfo_edit", |
23 | "pages/user/collect_list/collect_list", | 22 | "pages/user/collect_list/collect_list", |
@@ -77,8 +76,22 @@ | @@ -77,8 +76,22 @@ | ||
77 | "pages/user/my_service/tment_eval", | 76 | "pages/user/my_service/tment_eval", |
78 | "pages/user/my_service/tment_order_list", | 77 | "pages/user/my_service/tment_order_list", |
79 | "pages/user/my_service/beauty_deta", | 78 | "pages/user/my_service/beauty_deta", |
79 | + "pages/user/labels/labels", | ||
80 | + | ||
81 | + "pages/user/view_comment/view_comment", | ||
82 | + "pages/giftpack/birthdaygift/birthdaygift", | ||
83 | + "pages/user/comment/comment", | ||
84 | + "pages/giftpack/evaluategift/evaluategift", | ||
85 | + "pages/giftpack/newvipgift/newvipgift", | ||
86 | + "pages/giftpack/payment/payment", | ||
87 | + "pages/giftpack/buygiftpack/giftpackbuy", | ||
88 | + "pages/giftpack/giftpacklist/giftpacklist", | ||
89 | + "pages/giftpack/mygiftpack/mygiftpack", | ||
90 | + | ||
91 | + "pages/user/assistance/giftpacklist", | ||
92 | + "pages/user/assistance/task_assistance" | ||
93 | + | ||
80 | 94 | ||
81 | - "pages/user/labels/labels" | ||
82 | ], | 95 | ], |
83 | "permission": { | 96 | "permission": { |
84 | "scope.userLocation": { | 97 | "scope.userLocation": { |
components/nav_b/nav_b.js
1 | -var t = getApp(), os = t.globalData.setting; | 1 | +var t = getApp(), |
2 | + os = t.globalData.setting; | ||
2 | Component({ | 3 | Component({ |
3 | - properties: { | ||
4 | - }, | 4 | + properties: {}, |
5 | data: { | 5 | data: { |
6 | isopen: 0, | 6 | isopen: 0, |
7 | iurl: os.imghost, | 7 | iurl: os.imghost, |
8 | - nav_left:"首页",//导航左边 | ||
9 | - nav_center:"预约",//导航中间 | ||
10 | - nav_right: "我的",//导航右边 | ||
11 | - nav_left_url: "/pages/index/index/index",//导航左边地址 | ||
12 | - nav_center_url:"/pages/user/my_service/tment_order_list",//导航中间地址 | ||
13 | - nav_right_url:"/pages/user/index/index",//导航右边地址 | 8 | + nav_left: "首页", //导航左边 |
9 | + nav_center: "预约", //导航中间 | ||
10 | + nav_right: "我的", //导航右边 | ||
11 | + nav_left_url: "/pages/index/index/index", //导航左边地址 | ||
12 | + nav_center_url: "/pages/user/my_service/tment_order_list", //导航中间地址 | ||
13 | + nav_right_url: "/pages/user/index/index", //导航右边地址 | ||
14 | }, | 14 | }, |
15 | 15 | ||
16 | - ready: function () { | ||
17 | - }, | 16 | + ready: function() {}, |
18 | methods: { | 17 | methods: { |
19 | //--点击打开事件-- | 18 | //--点击打开事件-- |
20 | - open_box: function () { | ||
21 | - this.setData({ isopen: 1 }); | 19 | + open_box: function() { |
20 | + this.setData({ | ||
21 | + isopen: 1 | ||
22 | + }); | ||
23 | + }, | ||
24 | + set_name: function(name,url) { | ||
25 | + var th = this; | ||
26 | + th.setData({ | ||
27 | + nav_center:name, | ||
28 | + nav_center_url:url | ||
29 | + }) | ||
22 | }, | 30 | }, |
23 | //--关闭事件-- | 31 | //--关闭事件-- |
24 | - close_box: function () { | ||
25 | - this.setData({ isopen: 0 }); | 32 | + close_box: function() { |
33 | + this.setData({ | ||
34 | + isopen: 0 | ||
35 | + }); | ||
26 | }, | 36 | }, |
27 | //--跳转-- | 37 | //--跳转-- |
28 | - goto: function (e) { | 38 | + goto: function(e) { |
29 | var url = e.currentTarget.dataset.url; | 39 | var url = e.currentTarget.dataset.url; |
30 | getApp().goto(url); | 40 | getApp().goto(url); |
31 | this.close_box(); | 41 | this.close_box(); |
pages/giftpack/birthdaygift/birthdaygift.js
0 → 100644
1 | +var i = require("../../../utils/util.js") | ||
2 | +var e = getApp(), | ||
3 | + a = e.globalData.setting, | ||
4 | + os = a, | ||
5 | + t = e.request, | ||
6 | + d = e.globalData; | ||
7 | +Page({ | ||
8 | + data: { | ||
9 | + url: a.url, //接口网址 | ||
10 | + iurl: a.imghost, //图片前缀网址 | ||
11 | + itemShow: false, //项目栏目是否显示 | ||
12 | + cardShow: false, //代金券栏目是否显示 | ||
13 | + packShow: false, //福利栏目是否显示 | ||
14 | + textShow: false, //规则是否显示 | ||
15 | + integralShow: true, //积分领取是否显示 | ||
16 | + growUpShow: true, //成长值领取是否显示 | ||
17 | + itemButton: '', | ||
18 | + cardButton: '', | ||
19 | + getActId: '', | ||
20 | + getActType: '', | ||
21 | + giftID: '', | ||
22 | + receiveState: '一键全部领取', | ||
23 | + textTitle: '', | ||
24 | + getUrl: '', | ||
25 | + noShow: false, | ||
26 | + cards: [], //礼包内容--礼券 | ||
27 | + itemWare: [], //礼包内容--服务项目 | ||
28 | + integralTitle: "", | ||
29 | + growUpTitle: "", | ||
30 | + is_sub: 0, //是否重复领取 | ||
31 | + }, | ||
32 | + GetList: function () { | ||
33 | + var th = this; | ||
34 | + var url = "/api/weshop/marketing/giftbag/bound/get"; | ||
35 | + wx.showLoading({ | ||
36 | + title: '加载中', | ||
37 | + }) | ||
38 | + getApp().request.promiseGet(url, { | ||
39 | + data: { | ||
40 | + "actId": th.data.getActId, //活动id | ||
41 | + "actType": 4, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销 | ||
42 | + "giftBagId": th.data.giftID, //礼包ID | ||
43 | + "storeId": a.stoid, //商家ID | ||
44 | + "userId": d.user_id //用户ID | ||
45 | + } | ||
46 | + }).then(res => { | ||
47 | + wx.hideLoading(); | ||
48 | + if (res.data.code == 0) { | ||
49 | + if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons != null) { | ||
50 | + //礼包内容--礼券 | ||
51 | + th.setData({ | ||
52 | + cardShow: true, | ||
53 | + cards: res.data.data.lbCoupons | ||
54 | + }) | ||
55 | + } | ||
56 | + if (res.data.data.lbSM.length > 0 && res.data.data.lbSM != nll) { | ||
57 | + //礼包内容--服务项目 | ||
58 | + th.setData({ | ||
59 | + itemShow: true, | ||
60 | + itemWare: res.data.data.lbSM | ||
61 | + }) | ||
62 | + } | ||
63 | + //礼包积分 | ||
64 | + if (res.data.data.lbIntegral <= 0) { | ||
65 | + if (res.data.data.lbGrowthValue <= 0) { | ||
66 | + th.setData({ | ||
67 | + packShow: false | ||
68 | + }) | ||
69 | + } else { | ||
70 | + th.setData({ | ||
71 | + packShow: false, | ||
72 | + integralShow: false, | ||
73 | + growUpShow: true | ||
74 | + }) | ||
75 | + } | ||
76 | + | ||
77 | + } else { | ||
78 | + if (res.data.data.lbGrowthValue > 0) { | ||
79 | + th.setData({ | ||
80 | + packShow: true | ||
81 | + }) | ||
82 | + } else { | ||
83 | + th.setData({ | ||
84 | + packShow: true, | ||
85 | + integralShow: true, | ||
86 | + growUpShow: false | ||
87 | + }) | ||
88 | + } | ||
89 | + } | ||
90 | + th.setData({ | ||
91 | + integralTitle: '价值' + res.data.data.lbIntegral + '积分', | ||
92 | + growUpTitle: '价值' + res.data.data.lbGrowthValue + '成长值' | ||
93 | + }) | ||
94 | + if (res.data.data.receiveState == 0) { | ||
95 | + th.setData({ | ||
96 | + receiveState: '一键全部领取' | ||
97 | + }) | ||
98 | + } else { | ||
99 | + th.setData({ | ||
100 | + receiveState: '已领取' | ||
101 | + }) | ||
102 | + } | ||
103 | + | ||
104 | + if (res.data.data.actIntro != '') { | ||
105 | + th.setData({ | ||
106 | + textShow: true, | ||
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>') | ||
109 | + }) | ||
110 | + } | ||
111 | + } else { | ||
112 | + getApp().my_warnning(res.data.msg, 0, th); | ||
113 | + return false; | ||
114 | + } | ||
115 | + }) | ||
116 | + }, | ||
117 | + | ||
118 | + onLoad: function onLoad(options) { | ||
119 | + var th = this; | ||
120 | + th.setData({ | ||
121 | + getActId: options.actId, | ||
122 | + giftID: options.giftBagId | ||
123 | + }) | ||
124 | + th.GetList(); | ||
125 | + }, | ||
126 | + onShow: function onShow() { | ||
127 | + | ||
128 | + }, | ||
129 | + GetReceive: function () { | ||
130 | + var th = this; | ||
131 | + if (th.data.receiveState == '已领取') { | ||
132 | + return false; | ||
133 | + } | ||
134 | + var is_sub = th.data.is_sub; //判断是否重复提交 | ||
135 | + if (is_sub == 0) { | ||
136 | + th.setData({ | ||
137 | + is_sub: 1 | ||
138 | + }) | ||
139 | + wx.showLoading({ | ||
140 | + title: '加载中', | ||
141 | + }) | ||
142 | + var json = { | ||
143 | + "actId": th.data.getActId, //活动Id | ||
144 | + "actType": 4, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | ||
145 | + "giftBagId": th.data.giftID, //礼包Id | ||
146 | + "storeId": a.stoid, //商家Id | ||
147 | + "userId": d.user_id //用户ID | ||
148 | + }; | ||
149 | + var data = JSON.stringify(json); | ||
150 | + var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; | ||
151 | + wx.request({ | ||
152 | + url: url, | ||
153 | + data: data, | ||
154 | + method: 'post', | ||
155 | + header: { | ||
156 | + 'content-type': 'application/json' | ||
157 | + }, // 设置请求的 header | ||
158 | + success: function (res) { | ||
159 | + wx.hideLoading(); | ||
160 | + th.setData({ | ||
161 | + is_sub: 0 | ||
162 | + }) | ||
163 | + if (res.data.code == 0) { | ||
164 | + th.setData({ | ||
165 | + receiveState: '已领取' | ||
166 | + }) | ||
167 | + getApp().my_warnning("领取成功", 1, th); | ||
168 | + } else { | ||
169 | + getApp().my_warnning("系统繁忙,请稍后再试", 0, th); | ||
170 | + } | ||
171 | + } | ||
172 | + }) | ||
173 | + } | ||
174 | + }, | ||
175 | + //界面跳转 | ||
176 | + goto: function (e) { | ||
177 | + var url = e.currentTarget.dataset.url; | ||
178 | + getApp().goto(url); | ||
179 | + }, | ||
180 | + //图片失败,默认图片 | ||
181 | + bind_bnerr1: function (e) { | ||
182 | + var th = this; | ||
183 | + var _errImg = e.target.dataset.errorimg; | ||
184 | + var _Img = e.target.dataset.img; | ||
185 | + if (_Img != undefined) { | ||
186 | + var _errObj = {}; | ||
187 | + _errObj[_errImg] = "/miniapp/images/giftbag/gift02.png"; | ||
188 | + th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
189 | + } | ||
190 | + }, | ||
191 | +}); | ||
0 | \ No newline at end of file | 192 | \ No newline at end of file |
pages/giftpack/birthdaygift/birthdaygift.json
0 → 100644
pages/giftpack/birthdaygift/birthdaygift.wxml
0 → 100644
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 rel"> | ||
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 class="num flex-level-right fs26"> | ||
47 | + <view>数量:</view> | ||
48 | + <view>{{item.num}}</view> | ||
49 | + </view> | ||
50 | + </view> | ||
51 | + </view> | ||
52 | + </view> | ||
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> | ||
58 | + </view> | ||
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> | ||
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> | ||
114 | + </view> | ||
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> | ||
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> | ||
171 | + </view> | ||
172 | + </view> | ||
173 | +</view> | ||
174 | +<!-- 引入提示组件 --> | ||
175 | +<warn id="warn"></warn> | ||
176 | +<my_confirm id="my_confirm"></my_confirm> | ||
0 | \ No newline at end of file | 177 | \ No newline at end of file |
pages/giftpack/birthdaygift/birthdaygift.wxss
0 → 100644
1 | +@charset "UTF-8"; | ||
2 | +/* Author XGQ | ||
3 | + * 2019-10-27 | ||
4 | + */ | ||
5 | +.image_box { | ||
6 | + -webkit-box-pack: center; | ||
7 | + -webkit-justify-content: center; | ||
8 | + justify-content: center; | ||
9 | +} | ||
10 | +.image_box image { | ||
11 | + width: 100%; | ||
12 | + height: 690rpx; | ||
13 | +} | ||
14 | +.top { | ||
15 | + margin: -20rpx 28rpx 45rpx 28rpx; | ||
16 | + padding: 10rpx 10rpx 70rpx 10rpx; | ||
17 | + background-color: #FFFFFF; | ||
18 | + border-radius: 0rpx 0rpx 15rpx 15rpx; | ||
19 | +} | ||
20 | +.top_box { | ||
21 | + display: -webkit-box; | ||
22 | + display: -webkit-flex; | ||
23 | + display: flex; | ||
24 | + text-align: center; | ||
25 | + -webkit-box-pack: center; | ||
26 | + -webkit-justify-content: center; | ||
27 | + justify-content: center; | ||
28 | +} | ||
29 | +.top_box_text { | ||
30 | + -webkit-box-pack: center; | ||
31 | + -webkit-justify-content: center; | ||
32 | + justify-content: center; | ||
33 | + margin: 50rpx 15rpx 20rpx 15rpx; | ||
34 | +} | ||
35 | +.top_box_text text { | ||
36 | + color: #FB6451; | ||
37 | + font-size: 40rpx; | ||
38 | +} | ||
39 | +.top_item { | ||
40 | + display: -webkit-box; | ||
41 | + display: -webkit-flex; | ||
42 | + display: flex; | ||
43 | + width: 100%; | ||
44 | + margin: 60rpx 0 0 0; | ||
45 | +} | ||
46 | +.top_item_img { | ||
47 | + float: left; | ||
48 | + width: 28%; | ||
49 | + margin: 0rpx 10rpx 0rpx 20rpx; | ||
50 | +} | ||
51 | +.top_item_img image { | ||
52 | + width: 150rpx; | ||
53 | + height: 150rpx; | ||
54 | + border-radius: 50%; | ||
55 | + border: #F96865 solid 3rpx; | ||
56 | +} | ||
57 | +.top_item_center { | ||
58 | + float: left; | ||
59 | + width: 50%; | ||
60 | +} | ||
61 | +.top_item_center_title { | ||
62 | + font-size: 35rpx; | ||
63 | + color: #FB6451; | ||
64 | + -webkit-box-pack: start; | ||
65 | + -webkit-justify-content: flex-start; | ||
66 | + justify-content: flex-start; | ||
67 | + padding: 0 10rpx 15rpx 0rpx; | ||
68 | + word-break: break-all; | ||
69 | + /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/ | ||
70 | + text-overflow: ellipsis; | ||
71 | + display: -webkit-box; | ||
72 | + /** 对象作为伸缩盒子模型显示 **/ | ||
73 | + -webkit-box-orient: vertical; | ||
74 | + /** 设置或检索伸缩盒对象的子元素的排列方式 **/ | ||
75 | + -webkit-line-clamp: 2; | ||
76 | + /** 显示的行数 **/ | ||
77 | + overflow: hidden; | ||
78 | + /** 隐藏超出的内容 **/ | ||
79 | +} | ||
80 | +.top_item_center_ramke { | ||
81 | + font-size: 25rpx; | ||
82 | + -webkit-box-pack: start; | ||
83 | + -webkit-justify-content: flex-start; | ||
84 | + justify-content: flex-start; | ||
85 | + line-height: 35rpx; | ||
86 | + letter-spacing: 0.5rpx; | ||
87 | + word-break: break-all; | ||
88 | + /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/ | ||
89 | + text-overflow: ellipsis; | ||
90 | + display: -webkit-box; | ||
91 | + /** 对象作为伸缩盒子模型显示 **/ | ||
92 | + -webkit-box-orient: vertical; | ||
93 | + /** 设置或检索伸缩盒对象的子元素的排列方式 **/ | ||
94 | + -webkit-line-clamp: 2; | ||
95 | + /** 显示的行数 **/ | ||
96 | + overflow: hidden; | ||
97 | + /** 隐藏超出的内容 **/ | ||
98 | +} | ||
99 | +.top_item_button { | ||
100 | + float: right; | ||
101 | + width: 22%; | ||
102 | + padding: 65rpx 20rpx 0 1rpx; | ||
103 | +} | ||
104 | +.top_item_button button { | ||
105 | + font-size: 25rpx; | ||
106 | + background: #fd6969; | ||
107 | + color: #FFFFFF; | ||
108 | + border-radius: 50rpx; | ||
109 | + height: 45rpx; | ||
110 | + line-height: 45rpx; | ||
111 | +} | ||
112 | +.top_card { | ||
113 | + width: calc(50% - 30rpx); | ||
114 | + display: inline-block; | ||
115 | + margin: 15rpx; | ||
116 | +} | ||
117 | +.top_card_box { | ||
118 | + background-size: cover; | ||
119 | + background-position: center; | ||
120 | + background-repeat: no-repeat; | ||
121 | + border-radius: 20rpx; | ||
122 | + height: 250rpx; | ||
123 | + margin: 5rpx; | ||
124 | +} | ||
125 | +.img1 { | ||
126 | + background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip01.png); | ||
127 | +} | ||
128 | +.img2 { | ||
129 | + background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip02.png); | ||
130 | +} | ||
131 | +.img3 { | ||
132 | + background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip03.png); | ||
133 | +} | ||
134 | +.top_card_tite_box { | ||
135 | + width: 100%; | ||
136 | + display: -webkit-box; | ||
137 | + display: -webkit-flex; | ||
138 | + display: flex; | ||
139 | + -webkit-box-pack: end; | ||
140 | + -webkit-justify-content: flex-end; | ||
141 | + justify-content: flex-end; | ||
142 | +} | ||
143 | +.top_card_tite_a { | ||
144 | + padding: 5rpx 25rpx 5rpx 25rpx; | ||
145 | + line-height: 29rpx; | ||
146 | + font-size: 25rpx; | ||
147 | + color: #FFFFFF; | ||
148 | + background: #ffa7c0; | ||
149 | + border-radius: 0rpx 20rpx 0rpx 6rpx; | ||
150 | +} | ||
151 | +.top_card_tite_b { | ||
152 | + padding: 5rpx 25rpx 5rpx 25rpx; | ||
153 | + line-height: 29rpx; | ||
154 | + font-size: 25rpx; | ||
155 | + color: #FFFFFF; | ||
156 | + background: #50dfdb; | ||
157 | + border-radius: 0rpx 20rpx 0rpx 6rpx; | ||
158 | +} | ||
159 | +.top_card_tite_c { | ||
160 | + padding: 5rpx 25rpx 5rpx 25rpx; | ||
161 | + line-height: 29rpx; | ||
162 | + font-size: 25rpx; | ||
163 | + color: #FFFFFF; | ||
164 | + background: #92cbff; | ||
165 | + border-radius: 0rpx 20rpx 0rpx 6rpx; | ||
166 | +} | ||
167 | +.top_card_tite_d { | ||
168 | + padding: 5rpx 25rpx 5rpx 25rpx; | ||
169 | + line-height: 29rpx; | ||
170 | + font-size: 25rpx; | ||
171 | + color: #FFFFFF; | ||
172 | + border-radius: 0rpx 20rpx 0rpx 6rpx; | ||
173 | +} | ||
174 | +.top_card_counte { | ||
175 | + padding: 40rpx 20rpx 0 0; | ||
176 | + text-align: center; | ||
177 | + display: -webkit-box; | ||
178 | + display: -webkit-flex; | ||
179 | + display: flex; | ||
180 | + -webkit-box-pack: center; | ||
181 | + -webkit-justify-content: center; | ||
182 | + justify-content: center; | ||
183 | + -webkit-box-align: center; | ||
184 | + -webkit-align-items: center; | ||
185 | + align-items: center; | ||
186 | + color: #FFFFFF; | ||
187 | + font-size: 40rpx; | ||
188 | +} | ||
189 | +.top_card_remak { | ||
190 | + padding: 20rpx 0 40rpx 0; | ||
191 | + text-align: center; | ||
192 | + display: -webkit-box; | ||
193 | + display: -webkit-flex; | ||
194 | + display: flex; | ||
195 | + -webkit-box-pack: center; | ||
196 | + -webkit-justify-content: center; | ||
197 | + justify-content: center; | ||
198 | + -webkit-box-align: center; | ||
199 | + -webkit-align-items: center; | ||
200 | + align-items: center; | ||
201 | + font-size: 20rpx; | ||
202 | + color: #FFFFFF; | ||
203 | +} | ||
204 | +.top_card_button_a button { | ||
205 | + margin: 0 85rpx; | ||
206 | + background: #ffa6bc; | ||
207 | + border-radius: 50rpx; | ||
208 | + line-height: 40rpx; | ||
209 | + height: 40rpx; | ||
210 | + color: white; | ||
211 | + font-size: 25rpx; | ||
212 | +} | ||
213 | +.top_card_button_b button { | ||
214 | + margin: 0 85rpx; | ||
215 | + background: #50dfdb; | ||
216 | + border-radius: 50rpx; | ||
217 | + line-height: 40rpx; | ||
218 | + height: 40rpx; | ||
219 | + color: white; | ||
220 | + font-size: 25rpx; | ||
221 | +} | ||
222 | +.top_card_button_c button { | ||
223 | + margin: 0 85rpx; | ||
224 | + background: #75bcfc; | ||
225 | + border-radius: 50rpx; | ||
226 | + line-height: 40rpx; | ||
227 | + height: 40rpx; | ||
228 | + color: white; | ||
229 | + font-size: 25rpx; | ||
230 | +} | ||
231 | +.top_card_button_d button { | ||
232 | + margin: 0 85rpx; | ||
233 | + border-radius: 50rpx; | ||
234 | + line-height: 40rpx; | ||
235 | + height: 40rpx; | ||
236 | + color: white; | ||
237 | + font-size: 25rpx; | ||
238 | +} | ||
239 | +.top_box_image { | ||
240 | + padding: 20rpx 20rpx 20rpx 20rpx; | ||
241 | +} | ||
242 | +.top_box_image image { | ||
243 | + height: 216rpx; | ||
244 | + width: 100%; | ||
245 | +} | ||
246 | +.top_box_image button { | ||
247 | + margin: 15rpx 95rpx 0rpx 95rpx; | ||
248 | + background: #fe6a6a; | ||
249 | + border-radius: 50rpx; | ||
250 | + line-height: 60rpx; | ||
251 | + height: 60rpx; | ||
252 | + color: white; | ||
253 | + font-size: 30rpx; | ||
254 | +} | ||
255 | +.foot_box { | ||
256 | + margin: 0 30rpx 40rpx 30rpx; | ||
257 | + background: #FFFFFF; | ||
258 | + border-radius: 20rpx; | ||
259 | +} | ||
260 | +.foot_box_title { | ||
261 | + font-size: 43rpx; | ||
262 | + color: #000000; | ||
263 | + padding: 20rpx 30rpx 20rpx 30rpx; | ||
264 | +} | ||
265 | +.foot_box_text { | ||
266 | + font-size: 30rpx; | ||
267 | + color: #000000; | ||
268 | + line-height: 48rpx; | ||
269 | + padding: 20rpx 35rpx 50rpx 30rpx; | ||
270 | +} | ||
271 | +.button_box { | ||
272 | + margin: 50rpx 50rpx 50rpx 50rpx; | ||
273 | + text-align: center; | ||
274 | +} | ||
275 | +.button { | ||
276 | + margin: 0 30rpx; | ||
277 | + background: #61d3dd; | ||
278 | + border-radius: 50rpx; | ||
279 | + line-height: 80rpx; | ||
280 | + height: 80rpx; | ||
281 | + color: white; | ||
282 | + font-size: 35rpx; | ||
283 | +} | ||
284 | +.button_text { | ||
285 | + padding-top: 20rpx; | ||
286 | + font-size: 20rpx; | ||
287 | + color: white; | ||
288 | + height: 100rpx; | ||
289 | +} | ||
290 | +.foot_empty { | ||
291 | + height: 90rpx; | ||
292 | +} | ||
293 | +.foot_button { | ||
294 | + display: -webkit-box; | ||
295 | + display: -webkit-flex; | ||
296 | + display: flex; | ||
297 | + margin: 20rpx 0rpx 0rpx 0rpx; | ||
298 | + padding: 25rpx 0rpx; | ||
299 | + background: #FFFFFF; | ||
300 | + text-align: center; | ||
301 | + -webkit-box-pack: center; | ||
302 | + -webkit-justify-content: center; | ||
303 | + justify-content: center; | ||
304 | + position: fixed; | ||
305 | + bottom: 0; | ||
306 | + left: 0; | ||
307 | + width: 100%; | ||
308 | +} | ||
309 | +.foot_button_buy { | ||
310 | + background: #e4010c; | ||
311 | + color: #FFFFFF; | ||
312 | + width: 400rpx; | ||
313 | + height: 70rpx; | ||
314 | + font-size: 28rpx; | ||
315 | + line-height: 70rpx; | ||
316 | + border-radius: 40rpx; | ||
317 | +} | ||
318 | +.foot_button_notbuy{ | ||
319 | + background: #999999; | ||
320 | + color: #FFFFFF; | ||
321 | + width: 400rpx; | ||
322 | + height: 70rpx; | ||
323 | + font-size: 28rpx; | ||
324 | + line-height: 70rpx; | ||
325 | + border-radius: 30rpx 30rpx 30rpx 30rpx; | ||
326 | +} | ||
327 | +page { | ||
328 | + background-color: #9be0e5; | ||
329 | +} | ||
330 | +button::after { | ||
331 | + border: none; | ||
332 | +} | ||
333 | +.foot_box_text ._img { | ||
334 | + width: 100%; | ||
335 | +} | ||
336 | +.foot_box_text .img { | ||
337 | + line-height: 0; | ||
338 | +} | ||
339 | + |
pages/giftpack/buygiftpack/giftpackbuy.js
@@ -11,8 +11,8 @@ Page({ | @@ -11,8 +11,8 @@ Page({ | ||
11 | getStorageID: '', | 11 | getStorageID: '', |
12 | getUserID: '', | 12 | getUserID: '', |
13 | wareCard: [], | 13 | wareCard: [], |
14 | - page: 0, | ||
15 | - pageSize: 10, | 14 | + // page: 0, |
15 | + // pageSize: 10, | ||
16 | isEmpty: false, | 16 | isEmpty: false, |
17 | loadingType: 0, //定义加载方式 0---contentdown 1---contentrefresh 2---contentnomore | 17 | loadingType: 0, //定义加载方式 0---contentdown 1---contentrefresh 2---contentnomore |
18 | contentText: { | 18 | contentText: { |
@@ -23,7 +23,7 @@ Page({ | @@ -23,7 +23,7 @@ Page({ | ||
23 | ismore: 0, //数据是否全部加载完成 | 23 | ismore: 0, //数据是否全部加载完成 |
24 | is_read: 0, //是否查询过我的礼包接口 | 24 | is_read: 0, //是否查询过我的礼包接口 |
25 | curpage: 1, //当前分页数 | 25 | curpage: 1, //当前分页数 |
26 | - pageSize: 3, //页大小 | 26 | + pageSize: 10, //页大小 |
27 | total: 0, //总数量 | 27 | total: 0, //总数量 |
28 | }, | 28 | }, |
29 | onLoad: function(options) { | 29 | onLoad: function(options) { |
@@ -37,13 +37,7 @@ Page({ | @@ -37,13 +37,7 @@ Page({ | ||
37 | th.getList(); | 37 | th.getList(); |
38 | }, | 38 | }, |
39 | onShow: function() { | 39 | onShow: function() { |
40 | - // var th = this; | ||
41 | - // th.setData({ | ||
42 | - // pages: 1, | ||
43 | - // pageSize: 10, | ||
44 | - // loadingType: 0 | ||
45 | - // }) | ||
46 | - // th.getList(); | 40 | + |
47 | }, | 41 | }, |
48 | 42 | ||
49 | GetBuyPrice: function(e) { | 43 | GetBuyPrice: function(e) { |
@@ -51,6 +45,9 @@ Page({ | @@ -51,6 +45,9 @@ Page({ | ||
51 | var th = this; | 45 | var th = this; |
52 | var id = e.currentTarget.dataset.id; //活动id | 46 | var id = e.currentTarget.dataset.id; //活动id |
53 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id | 47 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
48 | + var order_sn = e.currentTarget.dataset.order_sn; //订单号 | ||
49 | + var money = e.currentTarget.dataset.money; //支付金额 | ||
50 | + | ||
54 | my_confirm.open( | 51 | my_confirm.open( |
55 | "是否确定购买该礼包", | 52 | "是否确定购买该礼包", |
56 | "取消", | 53 | "取消", |
@@ -60,17 +57,48 @@ Page({ | @@ -60,17 +57,48 @@ Page({ | ||
60 | }, | 57 | }, |
61 | function() { | 58 | function() { |
62 | my_confirm.open_cancel(0); | 59 | my_confirm.open_cancel(0); |
60 | + wx.showLoading({ | ||
61 | + title: '加载中', | ||
62 | + }) | ||
63 | var json = { | 63 | var json = { |
64 | "actId": '', //活动Id | 64 | "actId": '', //活动Id |
65 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 65 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
66 | "buyType": '2', //1=积分兑换 2=余额购买 | 66 | "buyType": '2', //1=积分兑换 2=余额购买 |
67 | - "lbId": id, //礼包Id | 67 | + "giftBagId": id, //礼包Id |
68 | "storeId": that.getStorageID, //商家Id | 68 | "storeId": that.getStorageID, //商家Id |
69 | "userId": that.getUserID, //用户ID | 69 | "userId": that.getUserID, //用户ID |
70 | "buyFrom": 2 | 70 | "buyFrom": 2 |
71 | }; | 71 | }; |
72 | var data = JSON.stringify(json); | 72 | var data = JSON.stringify(json); |
73 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | 73 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; |
74 | + getApp().request.json_post(url, json, | ||
75 | + function(res) { | ||
76 | + if (res.data.code == 0) { | ||
77 | + var order_sn = res.data.data.orderSn; | ||
78 | + res = res.data.data.result; | ||
79 | + var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; | ||
80 | + wx.requestPayment({ | ||
81 | + timeStamp: String(res.timeStamp), | ||
82 | + nonceStr: res.nonceStr, | ||
83 | + package: res.packageValue, | ||
84 | + signType: res.signType, | ||
85 | + paySign: res.paySign, | ||
86 | + success: function(res) { | ||
87 | + getApp().goto(url); | ||
88 | + }, | ||
89 | + fail: function(res) { | ||
90 | + getApp().my_confirm("取消支付", 0, th); | ||
91 | + } | ||
92 | + }); | ||
93 | + } else { | ||
94 | + getApp().my_warnning(res.data.msg, 0, th); | ||
95 | + } | ||
96 | + }, | ||
97 | + function(res) { | ||
98 | + | ||
99 | + } | ||
100 | + | ||
101 | + ) | ||
74 | wx.request({ | 102 | wx.request({ |
75 | url: url, | 103 | url: url, |
76 | data: data, | 104 | data: data, |
@@ -79,19 +107,22 @@ Page({ | @@ -79,19 +107,22 @@ Page({ | ||
79 | 'content-type': 'application/json' | 107 | 'content-type': 'application/json' |
80 | }, // 设置请求的 header | 108 | }, // 设置请求的 header |
81 | success: function(res) { | 109 | success: function(res) { |
110 | + wx.hideLoading(); | ||
82 | if (res.data.code == 0) { | 111 | if (res.data.code == 0) { |
83 | - res = res.data.data; | 112 | + var order_sn = res.data.data.orderSn; |
113 | + res = res.data.data.result; | ||
114 | + var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; | ||
84 | wx.requestPayment({ | 115 | wx.requestPayment({ |
85 | timeStamp: String(res.timeStamp), | 116 | timeStamp: String(res.timeStamp), |
86 | nonceStr: res.nonceStr, | 117 | nonceStr: res.nonceStr, |
87 | package: res.packageValue, | 118 | package: res.packageValue, |
88 | signType: res.signType, | 119 | signType: res.signType, |
89 | paySign: res.paySign, | 120 | paySign: res.paySign, |
90 | - success: function(n) { | ||
91 | - | 121 | + success: function(res) { |
122 | + getApp().goto(url); | ||
92 | }, | 123 | }, |
93 | - fail: function(n) { | ||
94 | - | 124 | + fail: function(res) { |
125 | + getApp().my_confirm("取消支付", 0, th); | ||
95 | } | 126 | } |
96 | }); | 127 | }); |
97 | } else { | 128 | } else { |
@@ -102,7 +133,6 @@ Page({ | @@ -102,7 +133,6 @@ Page({ | ||
102 | 133 | ||
103 | } | 134 | } |
104 | 135 | ||
105 | - | ||
106 | ) | 136 | ) |
107 | 137 | ||
108 | 138 | ||
@@ -121,31 +151,32 @@ Page({ | @@ -121,31 +151,32 @@ Page({ | ||
121 | }, | 151 | }, |
122 | function() { | 152 | function() { |
123 | my_confirm.open_cancel(0); | 153 | my_confirm.open_cancel(0); |
154 | + wx.showLoading({ | ||
155 | + title: '加载中', | ||
156 | + }) | ||
124 | var json = { | 157 | var json = { |
125 | "actId": '', //活动Id | 158 | "actId": '', //活动Id |
126 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 159 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
127 | "buyType": '1', //1=积分兑换 2=余额购买 | 160 | "buyType": '1', //1=积分兑换 2=余额购买 |
128 | - "lbId": id, //礼包Id | 161 | + "giftBagId": id, //礼包Id |
129 | "storeId": that.getStorageID, //商家Id | 162 | "storeId": that.getStorageID, //商家Id |
130 | "userId": that.getUserID //用户ID | 163 | "userId": that.getUserID //用户ID |
131 | }; | 164 | }; |
132 | var data = JSON.stringify(json); | 165 | var data = JSON.stringify(json); |
133 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | 166 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; |
134 | - wx.request({ | ||
135 | - url: url, | ||
136 | - data: data, | ||
137 | - method: 'post', | ||
138 | - header: { | ||
139 | - 'content-type': 'application/json' | ||
140 | - }, // 设置请求的 header | ||
141 | - success: function(res) { | 167 | + getApp().request.json_post(url, json, |
168 | + function(res) { | ||
142 | if (res.data.code == 0) { | 169 | if (res.data.code == 0) { |
143 | getApp().my_warnning("兑换成功!", 1, th); | 170 | getApp().my_warnning("兑换成功!", 1, th); |
144 | } else { | 171 | } else { |
145 | getApp().my_warnning(res.data.msg, 0, th); | 172 | getApp().my_warnning(res.data.msg, 0, th); |
146 | } | 173 | } |
174 | + }, | ||
175 | + function(res) { | ||
176 | + | ||
147 | } | 177 | } |
148 | - }) | 178 | + |
179 | + ) | ||
149 | 180 | ||
150 | }) | 181 | }) |
151 | 182 | ||
@@ -153,6 +184,7 @@ Page({ | @@ -153,6 +184,7 @@ Page({ | ||
153 | getList: function(e) { | 184 | getList: function(e) { |
154 | var th = this; | 185 | var th = this; |
155 | getApp().request.get('/api/weshop/marketing/giftbag/page', { | 186 | getApp().request.get('/api/weshop/marketing/giftbag/page', { |
187 | + isShowLoading: true, | ||
156 | data: { | 188 | data: { |
157 | storeId: th.data.getStorageID, //商家ID | 189 | storeId: th.data.getStorageID, //商家ID |
158 | userId: th.data.getUserID, //用户ID | 190 | userId: th.data.getUserID, //用户ID |
@@ -196,9 +228,8 @@ Page({ | @@ -196,9 +228,8 @@ Page({ | ||
196 | navigateTo: function(e) { | 228 | navigateTo: function(e) { |
197 | var th = this; | 229 | var th = this; |
198 | var url = e.currentTarget.dataset.url; | 230 | var url = e.currentTarget.dataset.url; |
199 | - wx.navigateTo({ | ||
200 | - url: url, | ||
201 | - }) | 231 | + getApp().goto(url); |
232 | + | ||
202 | }, | 233 | }, |
203 | //下拉事件 | 234 | //下拉事件 |
204 | onReachBottom: function() { | 235 | onReachBottom: function() { |
@@ -210,5 +241,16 @@ Page({ | @@ -210,5 +241,16 @@ Page({ | ||
210 | }) | 241 | }) |
211 | th.getList(); | 242 | th.getList(); |
212 | }, | 243 | }, |
213 | - | 244 | + //图片失败,默认图片 |
245 | + bind_bnerr2: function(e) { | ||
246 | + var _errImg = e.target.dataset.errorimg; | ||
247 | + var _errObj = {}; | ||
248 | + _errObj[_errImg] = "/public/images/empty.jpg"; | ||
249 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
250 | + }, | ||
251 | + goto: function(e) { | ||
252 | + var th = this; | ||
253 | + var url = e.currentTarget.dataset.url; | ||
254 | + getApp().goto(url); | ||
255 | + } | ||
214 | }) | 256 | }) |
215 | \ No newline at end of file | 257 | \ No newline at end of file |
pages/giftpack/buygiftpack/giftpackbuy.json
1 | { | 1 | { |
2 | "navigationBarTitleText": "礼包列表", | 2 | "navigationBarTitleText": "礼包列表", |
3 | - "navigationStyle": "custom", | ||
4 | - "enablePullDownRefresh": false, | ||
5 | "usingComponents": { | 3 | "usingComponents": { |
6 | "warn": "/components/long_warn/long_warn", | 4 | "warn": "/components/long_warn/long_warn", |
7 | "my_confirm": "/components/my_confirm/my_confirm" | 5 | "my_confirm": "/components/my_confirm/my_confirm" |
pages/giftpack/buygiftpack/giftpackbuy.wxml
1 | <view class="top_img"> | 1 | <view class="top_img"> |
2 | <view class="top_img"> | 2 | <view class="top_img"> |
3 | - <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg'}}" lazy-load="true"></image> | 3 | + <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg?v=2019'}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> |
4 | </view> | 4 | </view> |
5 | <view class="top_title"> | 5 | <view class="top_title"> |
6 | <view class="top_title_box"> | 6 | <view class="top_title_box"> |
@@ -13,13 +13,13 @@ | @@ -13,13 +13,13 @@ | ||
13 | </view> | 13 | </view> |
14 | <block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index"> | 14 | <block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index"> |
15 | <view class="content_box"> | 15 | <view class="content_box"> |
16 | - <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{items.lbId}}&orderSn={{items.orderSn}}"> | 16 | + <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{items.lbId}}&orderSn=''"> |
17 | <view class="content_box_img"> | 17 | <view class="content_box_img"> |
18 | - <image src="{{iurl+items.lbUrl}}" lazy-load="true"></image> | 18 | + <image src="{{iurl+items.lbUrl}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> |
19 | </view> | 19 | </view> |
20 | <view class="content_box_title"> | 20 | <view class="content_box_title"> |
21 | <view class="content_ware_title"> | 21 | <view class="content_ware_title"> |
22 | - <text bindtap="__e">{{items.giftTitle}}</text> | 22 | + <text>{{items.giftTitle}}</text> |
23 | </view> | 23 | </view> |
24 | <view class="content_ware_type flex"> | 24 | <view class="content_ware_type flex"> |
25 | <block wx:if="{{items.payMoney>0}}"> | 25 | <block wx:if="{{items.payMoney>0}}"> |
@@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
39 | <text class="ellipsis-1">{{"原价:¥"+items.giftPosPrice}}</text> | 39 | <text class="ellipsis-1">{{"原价:¥"+items.giftPosPrice}}</text> |
40 | </view> | 40 | </view> |
41 | <view class="content_ware_time"> | 41 | <view class="content_ware_time"> |
42 | - <text class="ellipsis-1">{{"活动时间:"+items.endTime}}</text> | 42 | + <text class="ellipsis-1">{{"活动结束时间:"+items.endTime}}</text> |
43 | </view> | 43 | </view> |
44 | </view> | 44 | </view> |
45 | </view> | 45 | </view> |
@@ -48,15 +48,29 @@ | @@ -48,15 +48,29 @@ | ||
48 | <text>{{"已售:"+items.giftQty+"件"}}</text> | 48 | <text>{{"已售:"+items.giftQty+"件"}}</text> |
49 | </view> | 49 | </view> |
50 | <view class="flex-vertical"> | 50 | <view class="flex-vertical"> |
51 | - <block wx:if="{{items.payMoney>0}}"> | ||
52 | - <view class="box_button_buy" bindtap="GetBuyPrice" data-id="{{items.lbId}}"> | ||
53 | - <button>立即购买</button> | ||
54 | - </view> | 51 | + <block wx:if="{{items.payMoney>0 && items.payIntegral>0}}"> |
52 | + <block wx:if="{{items.payMoney>0}}"> | ||
53 | + <view class="flex" bindtap="GetBuyPrice" data-id="{{items.lbId}}" data-money="{{items.payMoney}}"> | ||
54 | + <button class="box_button_dui">立即购买</button> | ||
55 | + </view> | ||
56 | + </block> | ||
57 | + <block wx:if="{{items.payIntegral>0}}"> | ||
58 | + <view class="flex" bindtap="GetBuyIntegral" data-id="{{items.lbId}}"> | ||
59 | + <button class="box_button_dui box_button_buy">立即兑换</button> | ||
60 | + </view> | ||
61 | + </block> | ||
55 | </block> | 62 | </block> |
56 | - <block wx:if="{{items.payIntegral>0}}"> | ||
57 | - <view class="box_button_dui" bindtap="GetBuyIntegral" data-id="{{items.lbId}}"> | ||
58 | - <button>立即兑换</button> | ||
59 | - </view> | 63 | + <block wx:else> |
64 | + <block wx:if="{{items.payMoney>0}}"> | ||
65 | + <view class="flex" bindtap="GetBuyPrice" data-id="{{items.lbId}}" data-money="{{items.payMoney}}"> | ||
66 | + <button class="box_button_dui box_button_buy">立即购买</button> | ||
67 | + </view> | ||
68 | + </block> | ||
69 | + <block wx:if="{{items.payIntegral>0}}"> | ||
70 | + <view class="flex" bindtap="GetBuyIntegral" data-id="{{items.lbId}}"> | ||
71 | + <button class="box_button_dui box_button_buy">立即兑换</button> | ||
72 | + </view> | ||
73 | + </block> | ||
60 | </block> | 74 | </block> |
61 | </view> | 75 | </view> |
62 | </view> | 76 | </view> |
@@ -71,7 +85,7 @@ | @@ -71,7 +85,7 @@ | ||
71 | <text>当前暂无礼包</text> | 85 | <text>当前暂无礼包</text> |
72 | </view> | 86 | </view> |
73 | <view class="foot_empty_button"> | 87 | <view class="foot_empty_button"> |
74 | - <text bindtap="__e">去获取</text> | 88 | + <text bindtap="goto" data-url="/pages/index/index/index">回到首页</text> |
75 | </view> | 89 | </view> |
76 | </view> | 90 | </view> |
77 | </block> | 91 | </block> |
pages/giftpack/buygiftpack/giftpackbuy.wxss
@@ -16,7 +16,7 @@ page { | @@ -16,7 +16,7 @@ page { | ||
16 | 16 | ||
17 | .top_img image { | 17 | .top_img image { |
18 | width: 100%; | 18 | width: 100%; |
19 | - height: 660rpx; | 19 | + |
20 | } | 20 | } |
21 | 21 | ||
22 | .top_title { | 22 | .top_title { |
@@ -150,16 +150,12 @@ page { | @@ -150,16 +150,12 @@ page { | ||
150 | line-height: 110rpx; | 150 | line-height: 110rpx; |
151 | } | 151 | } |
152 | 152 | ||
153 | -.box_button_remark { | ||
154 | - | ||
155 | -} | ||
156 | - | ||
157 | .box_button_remark text { | 153 | .box_button_remark text { |
158 | font-size: 28rpx; | 154 | font-size: 28rpx; |
159 | color: #b9b5b5; | 155 | color: #b9b5b5; |
160 | } | 156 | } |
161 | 157 | ||
162 | -.box_button_buy button { | 158 | +.box_button_dui { |
163 | display: inline-block; | 159 | display: inline-block; |
164 | width: 160rpx; | 160 | width: 160rpx; |
165 | height: 50rpx; | 161 | height: 50rpx; |
@@ -167,17 +163,14 @@ page { | @@ -167,17 +163,14 @@ page { | ||
167 | background: #fff; | 163 | background: #fff; |
168 | color: #000; | 164 | color: #000; |
169 | line-height: 50rpx; | 165 | line-height: 50rpx; |
166 | + margin-left: 20rpx; | ||
167 | + border-radius: 10rpx; | ||
170 | } | 168 | } |
171 | 169 | ||
172 | -.box_button_dui button { | ||
173 | - display: inline-block; | ||
174 | - width: 160rpx; | ||
175 | - height: 50rpx; | ||
176 | - font-size: 20rpx; | 170 | +.box_button_buy { |
177 | background: #d41c34; | 171 | background: #d41c34; |
178 | color: #fff; | 172 | color: #fff; |
179 | - line-height: 50rpx; | ||
180 | - margin-left: 20rpx; | 173 | + border-radius: 10rpx; |
181 | } | 174 | } |
182 | 175 | ||
183 | .foot_box { | 176 | .foot_box { |
pages/giftpack/evaluategift/evaluategift.js
0 → 100644
1 | +var i = require("../../../utils/util.js") | ||
2 | +var e = getApp(), | ||
3 | + a = e.globalData.setting, | ||
4 | + os = a, | ||
5 | + t = e.request, | ||
6 | + d = e.globalData; | ||
7 | +Page({ | ||
8 | + data: { | ||
9 | + url: a.url, //接口网址 | ||
10 | + iurl: a.imghost, //图片前缀网址 | ||
11 | + itemShow: false, //项目栏目是否显示 | ||
12 | + cardShow: false, //代金券栏目是否显示 | ||
13 | + packShow: false, //福利栏目是否显示 | ||
14 | + textShow: false, //规则是否显示 | ||
15 | + integralShow: true, //积分领取是否显示 | ||
16 | + growUpShow: true, //成长值领取是否显示 | ||
17 | + itemButton: '', | ||
18 | + cardButton: '', | ||
19 | + getActId: '', | ||
20 | + getActType: '', | ||
21 | + giftBagId: '', | ||
22 | + receiveState: '一键全部领取', | ||
23 | + textTitle: '', | ||
24 | + getUrl: '', | ||
25 | + noShow: false, | ||
26 | + cards: [], //礼包内容--礼券 | ||
27 | + itemWare: [], //礼包内容--服务项目 | ||
28 | + integralTitle: "", | ||
29 | + growUpTitle: "", | ||
30 | + is_sub: 0, //是否重复领取 | ||
31 | + orderNumber: "", //订单号 | ||
32 | + orderGoodsId: "", //商品id | ||
33 | + orderType:1, | ||
34 | + }, | ||
35 | + GetList: function() { | ||
36 | + var th = this; | ||
37 | + wx.showLoading({ | ||
38 | + title: '加载中', | ||
39 | + }) | ||
40 | + var url = "/api/weshop/marketing/giftbag/bound/get"; | ||
41 | + getApp().request.promiseGet(url, { | ||
42 | + data: { | ||
43 | + "actId": th.data.getActId, //活动Id | ||
44 | + "actType": 2, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | ||
45 | + "storeId": a.stoid, //商家Id | ||
46 | + "userId": d.user_id, //用户ID | ||
47 | + "orderNumber": th.data.orderNumber, | ||
48 | + "orderType": th.data.orderType, | ||
49 | + "orderGoodsId": th.data.orderGoodsId, | ||
50 | + "gifbagid": th.data.giftBagId | ||
51 | + } | ||
52 | + }).then(res => { | ||
53 | + wx.hideLoading(); | ||
54 | + if (res.data.code == 0) { | ||
55 | + if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons != null) { | ||
56 | + //礼包内容--礼券 | ||
57 | + th.setData({ | ||
58 | + cardShow: true, | ||
59 | + cards: res.data.data.lbCoupons | ||
60 | + }) | ||
61 | + } | ||
62 | + if (res.data.data.lbSM.length > 0 && res.data.data.lbSM != null) { | ||
63 | + //礼包内容--服务项目 | ||
64 | + th.setData({ | ||
65 | + itemShow: true, | ||
66 | + itemWare: res.data.data.lbSM | ||
67 | + }) | ||
68 | + } | ||
69 | + //礼包积分 | ||
70 | + if (res.data.data.lbIntegral <= 0) { | ||
71 | + if (res.data.data.lbGrowthValue <= 0) { | ||
72 | + th.setData({ | ||
73 | + packShow: false | ||
74 | + }) | ||
75 | + } else { | ||
76 | + th.setData({ | ||
77 | + packShow: false, | ||
78 | + integralShow: false, | ||
79 | + growUpShow: true | ||
80 | + }) | ||
81 | + } | ||
82 | + | ||
83 | + } else { | ||
84 | + if (res.data.data.lbGrowthValue > 0) { | ||
85 | + th.setData({ | ||
86 | + packShow: true | ||
87 | + }) | ||
88 | + } else { | ||
89 | + th.setData({ | ||
90 | + packShow: true, | ||
91 | + integralShow: true, | ||
92 | + growUpShow: false | ||
93 | + }) | ||
94 | + } | ||
95 | + } | ||
96 | + th.setData({ | ||
97 | + integralTitle: '价值' + res.data.data.lbIntegral + '积分', | ||
98 | + growUpTitle: '价值' + res.data.data.lbGrowthValue + '成长值' | ||
99 | + }) | ||
100 | + if (res.data.data.receiveState == 0) { | ||
101 | + th.setData({ | ||
102 | + receiveState: '一键全部领取' | ||
103 | + }) | ||
104 | + } else { | ||
105 | + th.setData({ | ||
106 | + receiveState: '已领取' | ||
107 | + }) | ||
108 | + } | ||
109 | + | ||
110 | + if (res.data.data.actIntro != '') { | ||
111 | + th.setData({ | ||
112 | + textShow: true, | ||
113 | + textTitle: res.data.data.actIntro | ||
114 | + }) | ||
115 | + } | ||
116 | + } else { | ||
117 | + getApp().my_warnning(res.data.msg, 0, th); | ||
118 | + return false; | ||
119 | + } | ||
120 | + }) | ||
121 | + }, | ||
122 | + onLoad: function(options) { | ||
123 | + var th = this; | ||
124 | + th.setData({ | ||
125 | + getActId: options.actId, | ||
126 | + orderNumber: options.orderNumber, | ||
127 | + orderGoodsId: options.orderGoodsId, | ||
128 | + giftBagId: options.giftBagId | ||
129 | + }) | ||
130 | + | ||
131 | + var orderType = options.orderType; | ||
132 | + if (orderType) { | ||
133 | + th.setData({ orderType: orderType}) | ||
134 | + } | ||
135 | + | ||
136 | + | ||
137 | + th.GetList(); | ||
138 | + }, | ||
139 | + onShow: function() { | ||
140 | + var th = this; | ||
141 | + var textTitle = th.data.textTitle.replace(/<p><img/gi, "<p class='img'><img"); | ||
142 | + th.setData({ | ||
143 | + textTitle: textTitle | ||
144 | + }) | ||
145 | + }, | ||
146 | + GetReceive: function() { | ||
147 | + var th = this; | ||
148 | + if (th.data.receiveState == '已领取') { | ||
149 | + return false; | ||
150 | + } | ||
151 | + var is_sub = th.data.is_sub; //判断是否重复提交 | ||
152 | + if (is_sub == 0) { | ||
153 | + th.setData({ | ||
154 | + is_sub: 1 | ||
155 | + }) | ||
156 | + | ||
157 | + var json = { | ||
158 | + "actId": th.data.getActId, //活动Id | ||
159 | + "actType": 2, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | ||
160 | + "storeId": a.stoid, //商家Id | ||
161 | + "userId": d.user_id, //用户ID | ||
162 | + "orderNumber": th.data.orderNumber, | ||
163 | + "orderType": th.data.orderType, | ||
164 | + "orderGoodsId": th.data.orderGoodsId, | ||
165 | + "giftBagId": th.data.giftBagId | ||
166 | + }; | ||
167 | + var data = JSON.stringify(json); | ||
168 | + var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; | ||
169 | + wx.request({ | ||
170 | + url: url, | ||
171 | + data: data, | ||
172 | + method: 'post', | ||
173 | + header: { | ||
174 | + 'content-type': 'application/json' | ||
175 | + }, // 设置请求的 header | ||
176 | + success: function(res) { | ||
177 | + th.setData({ | ||
178 | + is_sub: 0 | ||
179 | + }) | ||
180 | + if (res.data.code == 0) { | ||
181 | + th.setData({ | ||
182 | + receiveState: '已领取' | ||
183 | + }) | ||
184 | + getApp().my_warnning("领取成功", 1, th); | ||
185 | + } else { | ||
186 | + getApp().my_warnning(res.data.msg, 0, th); | ||
187 | + } | ||
188 | + } | ||
189 | + }) | ||
190 | + } | ||
191 | + }, | ||
192 | + //界面跳转 | ||
193 | + goto: function(e) { | ||
194 | + var url = e.currentTarget.dataset.url; | ||
195 | + getApp().goto(url); | ||
196 | + }, | ||
197 | + //图片失败,默认图片 | ||
198 | + bind_bnerr1: function(e) { | ||
199 | + var th = this; | ||
200 | + var _errImg = e.target.dataset.errorimg; | ||
201 | + var _Img = e.target.dataset.img; | ||
202 | + if (_Img != undefined) { | ||
203 | + var _errObj = {}; | ||
204 | + _errObj[_errImg] = "/miniapp/images/giftbag/gift02.png"; | ||
205 | + th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
206 | + } | ||
207 | + }, | ||
208 | +}); | ||
0 | \ No newline at end of file | 209 | \ No newline at end of file |
pages/giftpack/evaluategift/evaluategift.json
0 → 100644
pages/giftpack/evaluategift/evaluategift.wxml
0 → 100644
1 | +<view> | ||
2 | + <view class="image_box"> | ||
3 | + <image src="{{iurl+'miniapp/images/giftbag/eval00.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> | ||
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 class="num flex-level-right fs26"> | ||
47 | + <view>数量:</view> | ||
48 | + <view>{{item.num}}</view> | ||
49 | + </view> | ||
50 | + </view> | ||
51 | + </view> | ||
52 | + </view> | ||
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> | ||
58 | + </view> | ||
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> | ||
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 | + <view class="top_card_counte ">{{item.sum+"元券"}}</view> | ||
98 | + <view class="top_card_remak ">{{"满"+item.buySum+"元可以用"}}</view> | ||
99 | + </view> | ||
100 | + </view> | ||
101 | + </block> | ||
102 | + <block wx:if="{{packShow}}"> | ||
103 | + <view class="vips"> | ||
104 | + <image class="lvip abs" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image> | ||
105 | + <image class="rvip abs" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image> | ||
106 | + </view> | ||
107 | + </block> | ||
108 | + </view> | ||
109 | + </view> | ||
110 | + </block> | ||
111 | + <block wx:if="{{packShow}}"> | ||
112 | + <view> | ||
113 | + <view class="top "> | ||
114 | + <view class="top_box "> | ||
115 | + <view class="top_box_text "> | ||
116 | + <text>———</text> | ||
117 | + </view> | ||
118 | + <view class="top_box_text "> | ||
119 | + <text>新人专享福利</text> | ||
120 | + </view> | ||
121 | + <view class="top_box_text "> | ||
122 | + <text>———</text> | ||
123 | + </view> | ||
124 | + </view> | ||
125 | + <block wx:if="{{integralShow}}"> | ||
126 | + <view> | ||
127 | + <view class="top_box_image "> | ||
128 | + <image src="{{iurl+'/miniapp/images/giftbag/vip06.jpg'}}" lazy-load="true"></image> | ||
129 | + <button>{{integralTitle}}</button> | ||
130 | + </view> | ||
131 | + </view> | ||
132 | + </block> | ||
133 | + <block wx:if="{{growUpShow}}"> | ||
134 | + <view> | ||
135 | + <view class="top_box_image fs36"> | ||
136 | + <image src="{{iurl+'/miniapp/images/giftbag/vip07.jpg'}}" lazy-load="true"></image> | ||
137 | + <button>{{growUpTitle}}</button> | ||
138 | + </view> | ||
139 | + </view> | ||
140 | + </block> | ||
141 | + </view> | ||
142 | + </view> | ||
143 | + </block> | ||
144 | + <block wx:if="{{textShow}}"> | ||
145 | + <view class="foot_box"> | ||
146 | + <view class="foot_box_title fs36"> | ||
147 | + <text>活动规则:</text> | ||
148 | + </view> | ||
149 | + <view class="foot_box_text"> | ||
150 | + <rich-text nodes="{{textTitle}}"></rich-text> | ||
151 | + </view> | ||
152 | + </view> | ||
153 | + </block> | ||
154 | + <view class="button_box"> | ||
155 | + <view> | ||
156 | + <button class="button" bindtap="goto" data-url="/pages/index/index/index">进入商城购物</button> | ||
157 | + </view> | ||
158 | + <view class="button_text "> | ||
159 | + <text>本活动最终解释权归公司所有,如果有问题请联系客服</text> | ||
160 | + </view> | ||
161 | + </view> | ||
162 | + <view class="foot_empty "></view> | ||
163 | + <view class="foot_button"> | ||
164 | + <view class="{{receiveState=='已领取'?'foot_button_notbuy':'foot_button_buy'}}" bindtap="GetReceive"> | ||
165 | + <text>{{receiveState}}</text> | ||
166 | + </view> | ||
167 | + </view> | ||
168 | +</view> | ||
169 | +<!-- 引入提示组件 --> | ||
170 | +<warn id="warn"></warn> | ||
171 | +<my_confirm id="my_confirm"></my_confirm> | ||
0 | \ No newline at end of file | 172 | \ No newline at end of file |
pages/giftpack/evaluategift/evaluategift.wxss
0 → 100644
1 | +@charset "UTF-8"; | ||
2 | + | ||
3 | +/* Author XGQ | ||
4 | + * 2019-10-27 | ||
5 | + */ | ||
6 | + | ||
7 | +.image_box { | ||
8 | + -webkit-box-pack: center; | ||
9 | + -webkit-justify-content: center; | ||
10 | + justify-content: center; | ||
11 | +} | ||
12 | + | ||
13 | +.image_box image { | ||
14 | + width: 100%; | ||
15 | + height: 690rpx; | ||
16 | +} | ||
17 | + | ||
18 | +.top { | ||
19 | + margin: -20rpx 28rpx 45rpx 28rpx; | ||
20 | + padding: 10rpx 10rpx 70rpx 10rpx; | ||
21 | + background-color: #fff; | ||
22 | + border-radius: 0rpx 0rpx 15rpx 15rpx; | ||
23 | +} | ||
24 | + | ||
25 | +.top_box { | ||
26 | + display: -webkit-box; | ||
27 | + display: -webkit-flex; | ||
28 | + display: flex; | ||
29 | + text-align: center; | ||
30 | + -webkit-box-pack: center; | ||
31 | + -webkit-justify-content: center; | ||
32 | + justify-content: center; | ||
33 | +} | ||
34 | + | ||
35 | +.top_box_text { | ||
36 | + -webkit-box-pack: center; | ||
37 | + -webkit-justify-content: center; | ||
38 | + justify-content: center; | ||
39 | + margin: 50rpx 15rpx 20rpx 15rpx; | ||
40 | +} | ||
41 | + | ||
42 | +.top_box_text text { | ||
43 | + color: rgb(71, 132, 239); | ||
44 | + font-size: 40rpx; | ||
45 | +} | ||
46 | + | ||
47 | +.top_item { | ||
48 | + display: -webkit-box; | ||
49 | + display: -webkit-flex; | ||
50 | + display: flex; | ||
51 | + width: 100%; | ||
52 | + margin: 60rpx 0 0 0; | ||
53 | +} | ||
54 | + | ||
55 | +.top_item_img { | ||
56 | + float: left; | ||
57 | + width: 28%; | ||
58 | + margin: 0rpx 10rpx 0rpx 20rpx; | ||
59 | +} | ||
60 | + | ||
61 | +.top_item_img image { | ||
62 | + width: 150rpx; | ||
63 | + height: 150rpx; | ||
64 | + border-radius: 50%; | ||
65 | + border: #f96865 solid 3rpx; | ||
66 | +} | ||
67 | + | ||
68 | +.top_item_center { | ||
69 | + float: left; | ||
70 | + width: 50%; | ||
71 | +} | ||
72 | + | ||
73 | +.top_item_center_title { | ||
74 | + font-size: 35rpx; | ||
75 | + color: rgb(71, 132, 239); | ||
76 | + -webkit-box-pack: start; | ||
77 | + -webkit-justify-content: flex-start; | ||
78 | + justify-content: flex-start; | ||
79 | + padding: 0 10rpx 15rpx 0rpx; | ||
80 | + word-break: break-all; | ||
81 | + text-overflow: ellipsis; | ||
82 | + display: -webkit-box; | ||
83 | + -webkit-box-orient: vertical; | ||
84 | + -webkit-line-clamp: 2; | ||
85 | + overflow: hidden; | ||
86 | +} | ||
87 | + | ||
88 | +.top_item_center_ramke { | ||
89 | + font-size: 25rpx; | ||
90 | + -webkit-box-pack: start; | ||
91 | + -webkit-justify-content: flex-start; | ||
92 | + justify-content: flex-start; | ||
93 | + line-height: 35rpx; | ||
94 | + letter-spacing: 0.5rpx; | ||
95 | + word-break: break-all; | ||
96 | + /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/ | ||
97 | + text-overflow: ellipsis; | ||
98 | + display: -webkit-box; | ||
99 | + /** 对象作为伸缩盒子模型显示 **/ | ||
100 | + -webkit-box-orient: vertical; | ||
101 | + /** 设置或检索伸缩盒对象的子元素的排列方式 **/ | ||
102 | + -webkit-line-clamp: 2; | ||
103 | + /** 显示的行数 **/ | ||
104 | + overflow: hidden; | ||
105 | + /** 隐藏超出的内容 **/ | ||
106 | +} | ||
107 | + | ||
108 | +.top_item_button { | ||
109 | + float: right; | ||
110 | + width: 22%; | ||
111 | + padding: 65rpx 20rpx 0 1rpx; | ||
112 | +} | ||
113 | + | ||
114 | +.top_item_button button { | ||
115 | + font-size: 25rpx; | ||
116 | + background: #fd6969; | ||
117 | + color: #fff; | ||
118 | + border-radius: 50rpx; | ||
119 | + height: 45rpx; | ||
120 | + line-height: 45rpx; | ||
121 | +} | ||
122 | + | ||
123 | +.top_card { | ||
124 | + width: calc(50% - 30rpx); | ||
125 | + display: inline-block; | ||
126 | + margin: 15rpx; | ||
127 | +} | ||
128 | + | ||
129 | +.top_card_box { | ||
130 | + background-size: cover; | ||
131 | + background-position: center; | ||
132 | + background-repeat: no-repeat; | ||
133 | + border-radius: 20rpx; | ||
134 | + height: 250rpx; | ||
135 | + margin: 5rpx; | ||
136 | +} | ||
137 | + | ||
138 | +.img1 { | ||
139 | + background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip01.png); | ||
140 | +} | ||
141 | + | ||
142 | +.img2 { | ||
143 | + background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip02.png); | ||
144 | +} | ||
145 | + | ||
146 | +.img3 { | ||
147 | + background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip03.png); | ||
148 | +} | ||
149 | + | ||
150 | +.top_card_tite_box { | ||
151 | + width: 100%; | ||
152 | + display: -webkit-box; | ||
153 | + display: -webkit-flex; | ||
154 | + display: flex; | ||
155 | + -webkit-box-pack: end; | ||
156 | + -webkit-justify-content: flex-end; | ||
157 | + justify-content: flex-end; | ||
158 | +} | ||
159 | + | ||
160 | +.top_card_tite_a { | ||
161 | + padding: 5rpx 25rpx 5rpx 25rpx; | ||
162 | + line-height: 29rpx; | ||
163 | + font-size: 25rpx; | ||
164 | + color: #fff; | ||
165 | + background: #ffa7c0; | ||
166 | + border-radius: 0rpx 20rpx 0rpx 6rpx; | ||
167 | +} | ||
168 | + | ||
169 | +.top_card_tite_b { | ||
170 | + padding: 5rpx 25rpx 5rpx 25rpx; | ||
171 | + line-height: 29rpx; | ||
172 | + font-size: 25rpx; | ||
173 | + color: #fff; | ||
174 | + background: #50dfdb; | ||
175 | + border-radius: 0rpx 20rpx 0rpx 6rpx; | ||
176 | +} | ||
177 | + | ||
178 | +.top_card_tite_c { | ||
179 | + padding: 5rpx 25rpx 5rpx 25rpx; | ||
180 | + line-height: 29rpx; | ||
181 | + font-size: 25rpx; | ||
182 | + color: #fff; | ||
183 | + background: #92cbff; | ||
184 | + border-radius: 0rpx 20rpx 0rpx 6rpx; | ||
185 | +} | ||
186 | + | ||
187 | +.top_card_tite_d { | ||
188 | + padding: 5rpx 25rpx 5rpx 25rpx; | ||
189 | + line-height: 29rpx; | ||
190 | + font-size: 25rpx; | ||
191 | + color: #fff; | ||
192 | + border-radius: 0rpx 20rpx 0rpx 6rpx; | ||
193 | +} | ||
194 | + | ||
195 | +.top_card_counte { | ||
196 | + padding: 40rpx 20rpx 0 0; | ||
197 | + text-align: center; | ||
198 | + display: -webkit-box; | ||
199 | + display: -webkit-flex; | ||
200 | + display: flex; | ||
201 | + -webkit-box-pack: center; | ||
202 | + -webkit-justify-content: center; | ||
203 | + justify-content: center; | ||
204 | + -webkit-box-align: center; | ||
205 | + -webkit-align-items: center; | ||
206 | + align-items: center; | ||
207 | + color: #fff; | ||
208 | + font-size: 40rpx; | ||
209 | +} | ||
210 | + | ||
211 | +.top_card_remak { | ||
212 | + padding: 20rpx 0 40rpx 0; | ||
213 | + text-align: center; | ||
214 | + display: -webkit-box; | ||
215 | + display: -webkit-flex; | ||
216 | + display: flex; | ||
217 | + -webkit-box-pack: center; | ||
218 | + -webkit-justify-content: center; | ||
219 | + justify-content: center; | ||
220 | + -webkit-box-align: center; | ||
221 | + -webkit-align-items: center; | ||
222 | + align-items: center; | ||
223 | + font-size: 20rpx; | ||
224 | + color: #fff; | ||
225 | +} | ||
226 | + | ||
227 | +.top_card_button_a button { | ||
228 | + margin: 0 85rpx; | ||
229 | + background: #ffa6bc; | ||
230 | + border-radius: 50rpx; | ||
231 | + line-height: 40rpx; | ||
232 | + height: 40rpx; | ||
233 | + color: white; | ||
234 | + font-size: 25rpx; | ||
235 | +} | ||
236 | + | ||
237 | +.top_card_button_b button { | ||
238 | + margin: 0 85rpx; | ||
239 | + background: #50dfdb; | ||
240 | + border-radius: 50rpx; | ||
241 | + line-height: 40rpx; | ||
242 | + height: 40rpx; | ||
243 | + color: white; | ||
244 | + font-size: 25rpx; | ||
245 | +} | ||
246 | + | ||
247 | +.top_card_button_c button { | ||
248 | + margin: 0 85rpx; | ||
249 | + background: #75bcfc; | ||
250 | + border-radius: 50rpx; | ||
251 | + line-height: 40rpx; | ||
252 | + height: 40rpx; | ||
253 | + color: white; | ||
254 | + font-size: 25rpx; | ||
255 | +} | ||
256 | + | ||
257 | +.top_card_button_d button { | ||
258 | + margin: 0 85rpx; | ||
259 | + border-radius: 50rpx; | ||
260 | + line-height: 40rpx; | ||
261 | + height: 40rpx; | ||
262 | + color: white; | ||
263 | + font-size: 25rpx; | ||
264 | +} | ||
265 | + | ||
266 | +.top_box_image { | ||
267 | + padding: 20rpx 20rpx 20rpx 20rpx; | ||
268 | +} | ||
269 | + | ||
270 | +.top_box_image image { | ||
271 | + height: 216rpx; | ||
272 | + width: 100%; | ||
273 | +} | ||
274 | + | ||
275 | +.top_box_image button { | ||
276 | + margin: 15rpx 95rpx 0rpx 95rpx; | ||
277 | + background: #fe6a6a; | ||
278 | + border-radius: 50rpx; | ||
279 | + line-height: 60rpx; | ||
280 | + height: 60rpx; | ||
281 | + color: white; | ||
282 | + font-size: 30rpx; | ||
283 | +} | ||
284 | + | ||
285 | +.foot_box { | ||
286 | + margin: 0 30rpx 40rpx 30rpx; | ||
287 | + /* background: #FFFFFF; */ | ||
288 | + border-radius: 20rpx; | ||
289 | + background-color: rgb(255, 255, 255); | ||
290 | +} | ||
291 | + | ||
292 | +.foot_box_title { | ||
293 | + /* color: #000000; */ | ||
294 | + padding: 20rpx 30rpx 20rpx 30rpx; | ||
295 | +} | ||
296 | + | ||
297 | +.foot_box_text { | ||
298 | + font-size: 30rpx; | ||
299 | + /* color: #000000; */ | ||
300 | + line-height: 48rpx; | ||
301 | + padding: 20rpx 35rpx 50rpx 30rpx; | ||
302 | +} | ||
303 | + | ||
304 | +.button_box { | ||
305 | + margin: 50rpx 50rpx 50rpx 50rpx; | ||
306 | + text-align: center; | ||
307 | +} | ||
308 | + | ||
309 | +.button { | ||
310 | + margin: 0 30rpx; | ||
311 | + background: rgb(93, 147, 245); | ||
312 | + border-radius: 50rpx; | ||
313 | + line-height: 80rpx; | ||
314 | + height: 80rpx; | ||
315 | + color: rgb(255, 255, 255); | ||
316 | + font-size: 35rpx; | ||
317 | +} | ||
318 | + | ||
319 | +.button_text { | ||
320 | + padding-top: 20rpx; | ||
321 | + font-size: 22rpx; | ||
322 | + color: white; | ||
323 | + height: 100rpx; | ||
324 | +} | ||
325 | + | ||
326 | +.foot_empty { | ||
327 | + height: 90rpx; | ||
328 | +} | ||
329 | + | ||
330 | +.foot_button { | ||
331 | + display: -webkit-box; | ||
332 | + display: -webkit-flex; | ||
333 | + display: flex; | ||
334 | + margin: 20rpx 0rpx 0rpx 0rpx; | ||
335 | + padding: 25rpx 0rpx; | ||
336 | + background: #fff; | ||
337 | + text-align: center; | ||
338 | + -webkit-box-pack: center; | ||
339 | + -webkit-justify-content: center; | ||
340 | + justify-content: center; | ||
341 | + position: fixed; | ||
342 | + bottom: 0; | ||
343 | + left: 0; | ||
344 | + width: 100%; | ||
345 | +} | ||
346 | + | ||
347 | +.foot_button_buy { | ||
348 | + background: rgb(71, 132, 239); | ||
349 | + color: #fff; | ||
350 | + width: 400rpx; | ||
351 | + height: 70rpx; | ||
352 | + font-size: 28rpx; | ||
353 | + line-height: 70rpx; | ||
354 | + border-radius: 40rpx; | ||
355 | +} | ||
356 | + | ||
357 | +.foot_button_notbuy { | ||
358 | + background: #999; | ||
359 | + color: #fff; | ||
360 | + width: 400rpx; | ||
361 | + height: 70rpx; | ||
362 | + font-size: 28rpx; | ||
363 | + line-height: 70rpx; | ||
364 | + border-radius: 40rpx; | ||
365 | +} | ||
366 | + | ||
367 | +page { | ||
368 | + background-color: rgb(71, 132, 239); | ||
369 | +} | ||
370 | + | ||
371 | +button::after { | ||
372 | + border: none; | ||
373 | +} | ||
374 | + | ||
375 | +.foot_box_text ._img { | ||
376 | + width: 100%; | ||
377 | +} | ||
378 | + | ||
379 | +.foot_box_text .img { | ||
380 | + line-height: 0; | ||
381 | +} | ||
382 | +.num { | ||
383 | + color: rgb(71, 132, 239); | ||
384 | +} | ||
385 | + | ||
386 | +.lvip { | ||
387 | + left: 30rpx; | ||
388 | + bottom: -58rpx; | ||
389 | + width: 20rpx; | ||
390 | + height: 90rpx; | ||
391 | + z-index: 5; | ||
392 | +} | ||
393 | + | ||
394 | +.rvip { | ||
395 | + right: 30rpx; | ||
396 | + bottom: -58rpx; | ||
397 | + width: 20rpx; | ||
398 | + height: 90rpx; | ||
399 | + z-index: 5; | ||
400 | +} |
pages/giftpack/giftpacklist/giftpacklist.js
@@ -3,6 +3,8 @@ var e = getApp(), | @@ -3,6 +3,8 @@ var e = getApp(), | ||
3 | os = a, | 3 | os = a, |
4 | t = e.request, | 4 | t = e.request, |
5 | d = e.globalData; | 5 | d = e.globalData; |
6 | +var ut = require("../../../utils/util.js"); | ||
7 | + | ||
6 | Page({ | 8 | Page({ |
7 | data: { | 9 | data: { |
8 | url: a.url, //接口网址 | 10 | url: a.url, //接口网址 |
@@ -22,14 +24,15 @@ Page({ | @@ -22,14 +24,15 @@ Page({ | ||
22 | getUrl: '', | 24 | getUrl: '', |
23 | wareCard: [], | 25 | wareCard: [], |
24 | orderSn: "", //订单编号 | 26 | orderSn: "", //订单编号 |
25 | - lbId:"" | 27 | + lbId: "", |
28 | + code: "", //核销码 | ||
29 | + c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期 | ||
30 | + is_lb: 0, //是否有礼包 | ||
26 | }, | 31 | }, |
27 | onLoad: function(options) { | 32 | onLoad: function(options) { |
28 | var th = this; | 33 | var th = this; |
29 | th.setData({ | 34 | th.setData({ |
30 | isBuy: options.isBuy, | 35 | isBuy: options.isBuy, |
31 | - getStorageID: a.stoid, | ||
32 | - getUserID: d.user_id, | ||
33 | getGiftID: options.lbId, | 36 | getGiftID: options.lbId, |
34 | orderSn: options.orderSn | 37 | orderSn: options.orderSn |
35 | }) | 38 | }) |
@@ -38,75 +41,69 @@ Page({ | @@ -38,75 +41,69 @@ Page({ | ||
38 | } else { | 41 | } else { |
39 | th.GetBuyGiftList(); | 42 | th.GetBuyGiftList(); |
40 | } | 43 | } |
41 | - th.setData({ | ||
42 | - giftRemark: th.data.giftRemark.replace(/<p><img/gi, "<p class='img'><img") | ||
43 | - }) | 44 | + th.close(); |
44 | }, | 45 | }, |
45 | onShow: function() { | 46 | onShow: function() { |
46 | - // var th = this; | ||
47 | - // if (th.data.isBuy == 0) { | ||
48 | - // th.GetMyGiftList(); | ||
49 | - // } else { | ||
50 | - // th.GetBuyGiftList(); | ||
51 | - // } | ||
52 | - // th.setData({ | ||
53 | - // giftRemark: th.data.giftRemark.replace(/<p><img/gi, "<p class='img'><img") | ||
54 | - // }) | 47 | + |
55 | }, | 48 | }, |
56 | - GetBuyPrice: function (e) { | 49 | + GetBuyPrice: function(e) { |
57 | var that = this.data; | 50 | var that = this.data; |
58 | var th = this; | 51 | var th = this; |
59 | // var id = e.currentTarget.dataset.id;//活动id | 52 | // var id = e.currentTarget.dataset.id;//活动id |
53 | + var money = e.currentTarget.dataset.money; | ||
60 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id | 54 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
61 | my_confirm.open( | 55 | my_confirm.open( |
62 | "是否确定购买该礼包", | 56 | "是否确定购买该礼包", |
63 | "取消", | 57 | "取消", |
64 | "确定", | 58 | "确定", |
65 | - function () { | 59 | + function() { |
66 | my_confirm.open_cancel(0); | 60 | my_confirm.open_cancel(0); |
67 | }, | 61 | }, |
68 | - function () { | 62 | + function() { |
69 | my_confirm.open_cancel(0); | 63 | my_confirm.open_cancel(0); |
64 | + | ||
70 | var json = { | 65 | var json = { |
71 | "actId": '', //活动Id | 66 | "actId": '', //活动Id |
72 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 67 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
73 | "buyType": '2', //1=积分兑换 2=余额购买 | 68 | "buyType": '2', //1=积分兑换 2=余额购买 |
74 | - "lbId": that.getGiftID, //礼包Id | ||
75 | - "storeId": that.getStorageID, //商家Id | ||
76 | - "userId": that.getUserID, //用户ID | 69 | + "giftBagId": that.getGiftID, //礼包Id |
70 | + "storeId": a.stoid, //商家Id | ||
71 | + "userId": d.user_id, //用户ID | ||
77 | "buyFrom": 2 | 72 | "buyFrom": 2 |
78 | }; | 73 | }; |
79 | var data = JSON.stringify(json); | 74 | var data = JSON.stringify(json); |
80 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | 75 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; |
81 | - wx.request({ | ||
82 | - url: url, | ||
83 | - data: data, | ||
84 | - method: 'post', | ||
85 | - header: { | ||
86 | - 'content-type': 'application/json' | ||
87 | - }, // 设置请求的 header | ||
88 | - success: function (res) { | ||
89 | - if (res.data.code == 0) { | ||
90 | - res = res.data.data; | ||
91 | - wx.requestPayment({ | ||
92 | - timeStamp: String(res.timeStamp), | ||
93 | - nonceStr: res.nonceStr, | ||
94 | - package: res.packageValue, | ||
95 | - signType: res.signType, | ||
96 | - paySign: res.paySign, | ||
97 | - success: function (n) { | ||
98 | - | ||
99 | - }, | ||
100 | - fail: function (n) { | ||
101 | 76 | ||
102 | - } | ||
103 | - }); | ||
104 | - } else { | ||
105 | - getApp().my_warnning(res.data.msg, 0, th); | ||
106 | - } | 77 | + getApp().request.json_post(url,json, |
78 | + function(res){ | ||
79 | + if (res.data.code == 0) { | ||
80 | + var res = res.data.data; | ||
81 | + var order_sn = res.orderSn; | ||
82 | + var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn; | ||
83 | + wx.requestPayment({ | ||
84 | + timeStamp: String(res.result.timeStamp), | ||
85 | + nonceStr: res.result.nonceStr, | ||
86 | + package: res.result.packageValue, | ||
87 | + signType: res.result.signType, | ||
88 | + paySign: res.result.paySign, | ||
89 | + success: function (n) { | ||
90 | + getApp().goto(url); | ||
91 | + }, | ||
92 | + fail: function (n) { | ||
93 | + getApp().my_confirm("取消支付", 0, th); | ||
94 | + } | ||
95 | + }); | ||
96 | + } else { | ||
97 | + getApp().my_warnning(res.data.msg, 0, th); | ||
107 | } | 98 | } |
108 | - }) | 99 | + }, |
100 | + function(res){ | ||
101 | + | ||
102 | + } | ||
109 | 103 | ||
104 | + ) | ||
105 | + | ||
106 | + | ||
110 | } | 107 | } |
111 | 108 | ||
112 | 109 | ||
@@ -114,7 +111,7 @@ Page({ | @@ -114,7 +111,7 @@ Page({ | ||
114 | 111 | ||
115 | 112 | ||
116 | }, | 113 | }, |
117 | - GetBuyIntegral: function (e) { | 114 | + GetBuyIntegral: function(e) { |
118 | var that = this.data; | 115 | var that = this.data; |
119 | var th = this; | 116 | var th = this; |
120 | // var id = e.currentTarget.dataset.id;//活动id | 117 | // var id = e.currentTarget.dataset.id;//活动id |
@@ -123,37 +120,34 @@ Page({ | @@ -123,37 +120,34 @@ Page({ | ||
123 | "是否确定兑换该礼包", | 120 | "是否确定兑换该礼包", |
124 | "取消", | 121 | "取消", |
125 | "确定", | 122 | "确定", |
126 | - function () { | 123 | + function() { |
127 | my_confirm.open_cancel(0); | 124 | my_confirm.open_cancel(0); |
128 | }, | 125 | }, |
129 | - function () { | 126 | + function() { |
130 | my_confirm.open_cancel(0); | 127 | my_confirm.open_cancel(0); |
131 | var json = { | 128 | var json = { |
132 | "actId": '', //活动Id | 129 | "actId": '', //活动Id |
133 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 130 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
134 | "buyType": '1', //1=积分兑换 2=余额购买 | 131 | "buyType": '1', //1=积分兑换 2=余额购买 |
135 | - "lbId": that.getGiftID, //礼包Id | ||
136 | - "storeId": that.getStorageID, //商家Id | ||
137 | - "userId": that.getUserID //用户ID | 132 | + "giftBagId": that.getGiftID, //礼包Id |
133 | + "storeId": a.stoid, //商家ID | ||
134 | + "userId": d.user_id, //用户ID | ||
138 | }; | 135 | }; |
139 | var data = JSON.stringify(json); | 136 | var data = JSON.stringify(json); |
140 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | 137 | var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; |
141 | - wx.request({ | ||
142 | - url: url, | ||
143 | - data: data, | ||
144 | - method: 'post', | ||
145 | - header: { | ||
146 | - 'content-type': 'application/json' | ||
147 | - }, // 设置请求的 header | ||
148 | - success: function (res) { | ||
149 | - if (res.data.code == 0) { | ||
150 | - getApp().my_warnning("兑换成功!", 1, th); | ||
151 | - } else { | ||
152 | - getApp().my_warnning(res.data.msg, 0, th); | ||
153 | - } | 138 | + getApp().request.json_post(url, json, |
139 | + function (res) { | ||
140 | + if (res.data.code == 0) { | ||
141 | + getApp().my_warnning("兑换成功!", 1, th); | ||
142 | + } else { | ||
143 | + getApp().my_warnning(res.data.msg, 0, th); | ||
144 | + } | ||
145 | + }, | ||
146 | + function (res) { | ||
147 | + | ||
154 | } | 148 | } |
155 | - }) | ||
156 | 149 | ||
150 | + ) | ||
157 | }) | 151 | }) |
158 | 152 | ||
159 | 153 | ||
@@ -163,11 +157,12 @@ Page({ | @@ -163,11 +157,12 @@ Page({ | ||
163 | var th = this; | 157 | var th = this; |
164 | getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { | 158 | getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { |
165 | data: { | 159 | data: { |
166 | - "storeId": th.data.getStorageID, //商家ID | ||
167 | - "userId": th.data.getUserID, //用户ID | 160 | + "storeId": a.stoid, //商家ID |
161 | + "userId": d.user_id, //用户ID | ||
168 | "orderSn": th.data.orderSn | 162 | "orderSn": th.data.orderSn |
169 | }, | 163 | }, |
170 | success: function success(res) { | 164 | success: function success(res) { |
165 | + wx.hideLoading(); | ||
171 | if (res.data.code == 0) { | 166 | if (res.data.code == 0) { |
172 | th.setData({ | 167 | th.setData({ |
173 | giftImage: th.data.iurl + res.data.data.lbUrl, | 168 | giftImage: th.data.iurl + res.data.data.lbUrl, |
@@ -179,10 +174,24 @@ Page({ | @@ -179,10 +174,24 @@ Page({ | ||
179 | }) | 174 | }) |
180 | } else { | 175 | } else { |
181 | th.setData({ | 176 | th.setData({ |
182 | - giftRemark: res.data.data.giftRemark | 177 | + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"') |
183 | }) | 178 | }) |
184 | } | 179 | } |
185 | 180 | ||
181 | + //---获取日期的时间戳--- | ||
182 | + var t_endtime = res.data.data.endTime; | ||
183 | + t_endtime = t_endtime.replace(/-/g, '/'); | ||
184 | + var t_date = new Date(t_endtime) / 1000; | ||
185 | + var t_now = ut.gettimestamp(); | ||
186 | + | ||
187 | + if (res.data.data.goodsUseState) th.setData({ | ||
188 | + c_state: 1 | ||
189 | + }) | ||
190 | + else if (t_date <= t_now) | ||
191 | + th.setData({ | ||
192 | + c_state: 2 | ||
193 | + }) | ||
194 | + | ||
186 | th.setData({ | 195 | th.setData({ |
187 | giftDate: res.data.data.endTime, | 196 | giftDate: res.data.data.endTime, |
188 | giftPosPrice: res.data.data.giftPosPrice, | 197 | giftPosPrice: res.data.data.giftPosPrice, |
@@ -194,6 +203,15 @@ Page({ | @@ -194,6 +203,15 @@ Page({ | ||
194 | wareCard: res.data.data.wareCard, | 203 | wareCard: res.data.data.wareCard, |
195 | lbId: res.data.data.lbId | 204 | lbId: res.data.data.lbId |
196 | }) | 205 | }) |
206 | + //判断是否有礼包 | ||
207 | + for (var i = 0; i < res.data.data.wareCard.length; i++) { | ||
208 | + if (res.data.data.wareCard[i].lbType == 1) { | ||
209 | + th.setData({ | ||
210 | + is_lb: 1 | ||
211 | + }) | ||
212 | + break; | ||
213 | + } | ||
214 | + } | ||
197 | } else { | 215 | } else { |
198 | getApp().my_warnning("系统繁忙,请稍后再试", 0, th); | 216 | getApp().my_warnning("系统繁忙,请稍后再试", 0, th); |
199 | return false; | 217 | return false; |
@@ -207,8 +225,8 @@ Page({ | @@ -207,8 +225,8 @@ Page({ | ||
207 | var th = this.data; | 225 | var th = this.data; |
208 | getApp().request.get('/api/weshop/marketing/giftbag/detail/get', { | 226 | getApp().request.get('/api/weshop/marketing/giftbag/detail/get', { |
209 | data: { | 227 | data: { |
210 | - "storeId": th.getStorageID, //商家ID | ||
211 | - "userId": th.getUserID, //用户ID | 228 | + "storeId": a.stoid, //商家ID |
229 | + "userId": d.user_id, //用户ID | ||
212 | "giftBagId": th.getGiftID | 230 | "giftBagId": th.getGiftID |
213 | }, | 231 | }, |
214 | success: function success(res) { | 232 | success: function success(res) { |
@@ -218,13 +236,12 @@ Page({ | @@ -218,13 +236,12 @@ Page({ | ||
218 | giftTitle: res.data.data.giftTitle | 236 | giftTitle: res.data.data.giftTitle |
219 | }) | 237 | }) |
220 | if (res.data.data.giftRemark == '') { | 238 | if (res.data.data.giftRemark == '') { |
221 | - | ||
222 | _this2.setData({ | 239 | _this2.setData({ |
223 | giftRemark: '暂无详情......' | 240 | giftRemark: '暂无详情......' |
224 | }) | 241 | }) |
225 | } else { | 242 | } else { |
226 | _this2.setData({ | 243 | _this2.setData({ |
227 | - giftRemark: res.data.data.giftRemark | 244 | + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"') |
228 | }) | 245 | }) |
229 | } | 246 | } |
230 | 247 | ||
@@ -236,7 +253,7 @@ Page({ | @@ -236,7 +253,7 @@ Page({ | ||
236 | giftPrice: res.data.data.payMoney, | 253 | giftPrice: res.data.data.payMoney, |
237 | giftType: res.data.data.actType, | 254 | giftType: res.data.data.actType, |
238 | actTitle: res.data.data.actTitle, | 255 | actTitle: res.data.data.actTitle, |
239 | - wareCard: res.data.data.wareCard, | 256 | + wareCard: res.data.data.wareCard |
240 | }) | 257 | }) |
241 | } else { | 258 | } else { |
242 | getApp().my_warnning("系统繁忙,请稍后再试", 0, _this2); | 259 | getApp().my_warnning("系统繁忙,请稍后再试", 0, _this2); |
@@ -246,22 +263,70 @@ Page({ | @@ -246,22 +263,70 @@ Page({ | ||
246 | }); | 263 | }); |
247 | 264 | ||
248 | }, | 265 | }, |
249 | - GetQrCode: function() { | ||
250 | - //不销毁调整 | ||
251 | - uni.navigateTo({ | ||
252 | - url: '/pages/mygiftpack/QrCode?number=' + this.getGiftID | ||
253 | - }); | ||
254 | - | 266 | + //显示核销码 |
267 | + code_show: function(e) { | ||
268 | + var th = this; | ||
269 | + //--获取成功的时候-- | ||
270 | + var no = th.data.code; | ||
271 | + var qc_com = th.selectComponent("#qc_com"); //组件的id | ||
272 | + var obj = { | ||
273 | + val: no, | ||
274 | + content: "请将二维码展示给核销员,收货更快捷" | ||
275 | + }; | ||
276 | + qc_com.open(obj) | ||
277 | + }, | ||
278 | + //获取核销码 | ||
279 | + getcode: function() { | ||
280 | + var th = this; | ||
281 | + wx.showLoading({ | ||
282 | + title: '加载中', | ||
283 | + }) | ||
284 | + var orderSn = th.data.orderSn; //订单号 | ||
285 | + var json = { | ||
286 | + "storeId": a.stoid, | ||
287 | + "orderSn": orderSn | ||
288 | + }; | ||
289 | + var data = JSON.stringify(json); | ||
290 | + var url = th.data.url + "/api/weshop/marketing/gift/goods/verify/code/get"; //预约接口地址 | ||
291 | + wx.request({ | ||
292 | + url: url, | ||
293 | + data: data, | ||
294 | + method: 'put', | ||
295 | + header: { | ||
296 | + 'content-type': 'application/json' | ||
297 | + }, // 设置请求的 header | ||
298 | + success: function(res) { | ||
299 | + wx.hideLoading(); | ||
300 | + if (res.data.code == 0) { | ||
301 | + th.setData({ | ||
302 | + code: res.data.data | ||
303 | + }) | ||
304 | + th.code_show(); | ||
305 | + } else { | ||
306 | + getApp().my_warnning(res.data.msg, 0, th); | ||
307 | + } | ||
308 | + } | ||
309 | + }) | ||
310 | + }, | ||
311 | + //界面跳转 | ||
312 | + goto: function(e) { | ||
313 | + var th = this; | ||
314 | + var url = e.currentTarget.dataset.url; | ||
315 | + getApp().goto(url); | ||
255 | }, | 316 | }, |
256 | - GetWebHttp: function(type) { | 317 | + //图片失败,默认图片 |
318 | + bind_bnerr2: function(e) { | ||
319 | + var _errImg = e.target.dataset.errorimg; | ||
320 | + var _errObj = {}; | ||
321 | + _errObj[_errImg] = "/public/images/empty.jpg"; | ||
322 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
257 | 323 | ||
258 | - if (type == 0) { | ||
259 | - this.getUrl = this.$GetInfo.HtmlHttp + '/index.php/Mobile/User/coupon/stoid/' + this.getStorageID + '/user_id/' + this.getUserID + '.html'; | ||
260 | - } | ||
261 | - if (type == 1) { | ||
262 | - this.getUrl = this.$GetInfo.HtmlHttp + '/index.php/Mobile/Yyservice/service_items_list/stoid/' + this.getStorageID + '/user_id/' + this.getUserID + '.html'; | ||
263 | - } | ||
264 | - window.location.href = this.getUrl; | 324 | + }, |
325 | + //关闭导航 | ||
326 | + close: function() { | ||
327 | + var th = this; | ||
328 | + var nav_b = th.selectComponent("#nav_b"); //组件的id | ||
329 | + nav_b.close_box(); | ||
330 | + nav_b.set_name("礼包", "/pages/giftpack/buygiftpack/giftpackbuy"); | ||
265 | } | 331 | } |
266 | - | ||
267 | }); | 332 | }); |
268 | \ No newline at end of file | 333 | \ No newline at end of file |
pages/giftpack/giftpacklist/giftpacklist.json
1 | { | 1 | { |
2 | "navigationBarTitleText": "礼包详情", | 2 | "navigationBarTitleText": "礼包详情", |
3 | - "navigationStyle": "custom", | ||
4 | "usingComponents": { | 3 | "usingComponents": { |
5 | "warn": "/components/long_warn/long_warn", | 4 | "warn": "/components/long_warn/long_warn", |
6 | - "my_confirm": "/components/my_confirm/my_confirm" | 5 | + "my_confirm": "/components/my_confirm/my_confirm", |
6 | + "qr_code": "/components/qr_code/qr_code", | ||
7 | + "nav_b": "/components/nav_b/nav_b" | ||
7 | } | 8 | } |
8 | } | 9 | } |
9 | \ No newline at end of file | 10 | \ No newline at end of file |
pages/giftpack/giftpacklist/giftpacklist.wxml
1 | <view class="box data-v-3a5b7e36"> | 1 | <view class="box data-v-3a5b7e36"> |
2 | <view class="box_top data-v-3a5b7e36"> | 2 | <view class="box_top data-v-3a5b7e36"> |
3 | - <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true"></image> | 3 | + <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="giftImage"></image> |
4 | </view> | 4 | </view> |
5 | <view class="box_title data-v-3a5b7e36"> | 5 | <view class="box_title data-v-3a5b7e36"> |
6 | <view class="top_title data-v-3a5b7e36"> | 6 | <view class="top_title data-v-3a5b7e36"> |
@@ -40,19 +40,19 @@ | @@ -40,19 +40,19 @@ | ||
40 | <view class="box_ware_box data-v-3a5b7e36"> | 40 | <view class="box_ware_box data-v-3a5b7e36"> |
41 | <view class="box_ware_img data-v-3a5b7e36"> | 41 | <view class="box_ware_img data-v-3a5b7e36"> |
42 | <block wx:if="{{item.lbType==1}}"> | 42 | <block wx:if="{{item.lbType==1}}"> |
43 | - <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true"></image> | 43 | + <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> |
44 | </block> | 44 | </block> |
45 | <block wx:if="{{item.lbType==2}}"> | 45 | <block wx:if="{{item.lbType==2}}"> |
46 | - <image src="{{iurl+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image> | 46 | + <image src="{{iurl+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> |
47 | </block> | 47 | </block> |
48 | <block wx:if="{{item.lbType==3}}"> | 48 | <block wx:if="{{item.lbType==3}}"> |
49 | - <image src="{{iurl+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image> | 49 | + <image src="{{iurl+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> |
50 | </block> | 50 | </block> |
51 | <block wx:if="{{item.lbType==4}}"> | 51 | <block wx:if="{{item.lbType==4}}"> |
52 | - <image src="{{iurl+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image> | 52 | + <image src="{{iurl+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> |
53 | </block> | 53 | </block> |
54 | <block wx:if="{{item.lbType==5}}"> | 54 | <block wx:if="{{item.lbType==5}}"> |
55 | - <image src="{{iurl+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image> | 55 | + <image src="{{iurl+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> |
56 | </block> | 56 | </block> |
57 | </view> | 57 | </view> |
58 | <view class="box_ware_item data-v-3a5b7e36"> | 58 | <view class="box_ware_item data-v-3a5b7e36"> |
@@ -66,17 +66,24 @@ | @@ -66,17 +66,24 @@ | ||
66 | <text class="data-v-3a5b7e36 ellipsis-1">{{"数量:"+item.num}}</text> | 66 | <text class="data-v-3a5b7e36 ellipsis-1">{{"数量:"+item.num}}</text> |
67 | </view> | 67 | </view> |
68 | <view class="box_ware_code data-v-3a5b7e36"> | 68 | <view class="box_ware_code data-v-3a5b7e36"> |
69 | - <block wx:if="{{isBuy==0&item.lbType==1}}"> | ||
70 | - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="__e" class="data-v-3a5b7e36"></image> | 69 | + <block wx:if="{{c_state==0}}"> |
70 | + <block wx:if="{{isBuy==0&item.lbType==1}}"> | ||
71 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" class="data-v-3a5b7e36"></image> | ||
72 | + </block> | ||
73 | + </block> | ||
74 | + <block wx:else> | ||
75 | + <block wx:if="{{isBuy==0&item.lbType==1}}"> | ||
76 | + <image src="{{iurl+'/miniapp/images/giftbag/gift08.png'}}" lazy-load="true" class="data-v-3a5b7e36"></image> | ||
77 | + </block> | ||
71 | </block> | 78 | </block> |
72 | <block wx:if="{{isBuy==0&item.lbType==2}}"> | 79 | <block wx:if="{{isBuy==0&item.lbType==2}}"> |
73 | - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" bindtap="__e" class="data-v-3a5b7e36" lazy-load="true"></image> | ||
74 | - </block> | 80 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/coupons/coupons" bindtap="goto"></image> |
81 | + </block> | ||
75 | <block wx:if="{{isBuy==0&item.lbType==3}}"> | 82 | <block wx:if="{{isBuy==0&item.lbType==3}}"> |
76 | - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" bindtap="__e" class="data-v-3a5b7e36" lazy-load="true"></image> | 83 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/my_service/i_service" bindtap="goto"></image> |
77 | </block> | 84 | </block> |
78 | <block wx:if="{{isBuy==0&item.lbType>3}}"> | 85 | <block wx:if="{{isBuy==0&item.lbType>3}}"> |
79 | - <text class="data-v-3a5b7e36">已自动到账</text> | 86 | + <text class="data-v-3a5b7e36">奖励已发放</text> |
80 | </block> | 87 | </block> |
81 | </view> | 88 | </view> |
82 | </view> | 89 | </view> |
@@ -88,42 +95,60 @@ | @@ -88,42 +95,60 @@ | ||
88 | <text class="data-v-3a5b7e36">活动说明</text> | 95 | <text class="data-v-3a5b7e36">活动说明</text> |
89 | </view> | 96 | </view> |
90 | <view class="foot_box_remark data-v-3a5b7e36"> | 97 | <view class="foot_box_remark data-v-3a5b7e36"> |
91 | - <rich-text nodes="{{giftRemark}}"></rich-text> | 98 | + <rich-text nodes="{{giftRemark}}" style="word-break:break-all;word-wrap:break-word"></rich-text> |
92 | </view> | 99 | </view> |
93 | </view> | 100 | </view> |
94 | <view class="foot_empty data-v-3a5b7e36"></view> | 101 | <view class="foot_empty data-v-3a5b7e36"></view> |
95 | <block wx:if="{{isBuy==1}}"> | 102 | <block wx:if="{{isBuy==1}}"> |
96 | <view class="foot_button data-v-3a5b7e36"> | 103 | <view class="foot_button data-v-3a5b7e36"> |
97 | <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> | 104 | <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> |
98 | - <view class="foot_button_left data-v-3a5b7e36"> | ||
99 | - <text bindtap="GetBuyPrice" class="data-v-3a5b7e36" data-id="{{lbId}}">立即购买</text> | 105 | + <view class="foot_button_left data-v-3a5b7e36" data-money="{{giftPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice"> |
106 | + <text class="data-v-3a5b7e36">立即购买</text> | ||
100 | </view> | 107 | </view> |
101 | </block> | 108 | </block> |
102 | <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> | 109 | <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> |
103 | - <view class="foot_button_right data-v-3a5b7e36"> | ||
104 | - <text bindtap="GetBuyIntegral" class="data-v-3a5b7e36" data-id="{{lbId}}">立即兑换</text> | 110 | + <view class="foot_button_right data-v-3a5b7e36" bindtap="GetBuyIntegral" data-id="{{lbId}}"> |
111 | + <text class="data-v-3a5b7e36">立即兑换</text> | ||
105 | </view> | 112 | </view> |
106 | </block> | 113 | </block> |
107 | <block wx:if="{{giftPrice>0 && giftIntegral<=0}}"> | 114 | <block wx:if="{{giftPrice>0 && giftIntegral<=0}}"> |
108 | - <view class="foot_button_buy data-v-3a5b7e36"> | ||
109 | - <text bindtap="GetBuyPrice" class="data-v-3a5b7e36" data-id="{{lbId}}">立即购买</text> | 115 | + <view class="foot_button_buy data-v-3a5b7e36" data-money="{{giftPrice}}" bindtap="GetBuyPrice" data-id="{{lbId}}"> |
116 | + <text class="data-v-3a5b7e36">立即购买</text> | ||
110 | </view> | 117 | </view> |
111 | </block> | 118 | </block> |
112 | <block wx:if="{{giftPrice<=0 && giftIntegral>0}}"> | 119 | <block wx:if="{{giftPrice<=0 && giftIntegral>0}}"> |
113 | - <view class="foot_button_intalge data-v-3a5b7e36"> | ||
114 | - <text bindtap="GetBuyIntegral" class="data-v-3a5b7e36" data-id="{{lbId}}">立即兑换</text> | 120 | + <view class="foot_button_intalge data-v-3a5b7e36" bindtap="GetBuyIntegral" data-id="{{lbId}}"> |
121 | + <text class="data-v-3a5b7e36">立即兑换</text> | ||
115 | </view> | 122 | </view> |
116 | </block> | 123 | </block> |
117 | </view> | 124 | </view> |
118 | </block> | 125 | </block> |
119 | <block wx:if="{{isBuy==0}}"> | 126 | <block wx:if="{{isBuy==0}}"> |
120 | <view class="foot_button data-v-3a5b7e36"> | 127 | <view class="foot_button data-v-3a5b7e36"> |
121 | - <view class="foot_button_buy data-v-3a5b7e36"> | ||
122 | - <text bindtap="__e" class="data-v-3a5b7e36">立即使用</text> | ||
123 | - </view> | 128 | + <block wx:if="{{is_lb!=1}}"> |
129 | + <view class="foot_button_buy data-v-3a5b7e36 overdue"> | ||
130 | + <text class="data-v-3a5b7e36">无核销商品</text> | ||
131 | + </view> | ||
132 | + </block> | ||
133 | + <block wx:else> | ||
134 | + <view wx:if="{{c_state==0}}" class="foot_button_buy data-v-3a5b7e36" bindtap="getcode"> | ||
135 | + <text class="data-v-3a5b7e36">立即使用</text> | ||
136 | + </view> | ||
137 | + <view wx:if="{{c_state==1}}" class="foot_button_buy data-v-3a5b7e36 overdue"> | ||
138 | + <text class="data-v-3a5b7e36">商品已核销</text> | ||
139 | + </view> | ||
140 | + <view wx:if="{{c_state==2}}" class="foot_button_buy data-v-3a5b7e36 overdue"> | ||
141 | + <text class="data-v-3a5b7e36">商品兑换时间已过</text> | ||
142 | + </view> | ||
143 | + | ||
144 | + </block> | ||
124 | </view> | 145 | </view> |
125 | </block> | 146 | </block> |
126 | </view> | 147 | </view> |
127 | <!-- 引入提示组件 --> | 148 | <!-- 引入提示组件 --> |
128 | <warn id="warn"></warn> | 149 | <warn id="warn"></warn> |
129 | -<my_confirm id="my_confirm"></my_confirm> | ||
130 | \ No newline at end of file | 150 | \ No newline at end of file |
151 | +<my_confirm id="my_confirm"></my_confirm> | ||
152 | +<!-- 弹出框扫描 --> | ||
153 | +<qr_code id="qc_com"></qr_code> | ||
154 | +<!-- 制作一个圆球导航 --> | ||
155 | +<nav_b id="nav_b"></nav_b> | ||
131 | \ No newline at end of file | 156 | \ No newline at end of file |
pages/giftpack/giftpacklist/giftpacklist.wxss
1 | - | ||
2 | @charset "UTF-8"; | 1 | @charset "UTF-8"; |
2 | + | ||
3 | /* Author XGQ | 3 | /* Author XGQ |
4 | * 2019-12-12 | 4 | * 2019-12-12 |
5 | */ | 5 | */ |
6 | + | ||
6 | .box.data-v-3a5b7e36 { | 7 | .box.data-v-3a5b7e36 { |
7 | - -webkit-align-content: center; | ||
8 | - align-content: center; | 8 | + -webkit-align-content: center; |
9 | + align-content: center; | ||
10 | + background-color: #e85f93; | ||
9 | } | 11 | } |
12 | + | ||
10 | .box_top.data-v-3a5b7e36 { | 13 | .box_top.data-v-3a5b7e36 { |
11 | - width: 100%; | 14 | + width: 100%; |
12 | } | 15 | } |
16 | + | ||
13 | .box_top image.data-v-3a5b7e36 { | 17 | .box_top image.data-v-3a5b7e36 { |
14 | - width: 100%; | ||
15 | - height: 540rpx; | 18 | + width: 100%; |
19 | + max-height: 540rpx; | ||
16 | } | 20 | } |
21 | + | ||
17 | .box_title.data-v-3a5b7e36 { | 22 | .box_title.data-v-3a5b7e36 { |
18 | - margin: 10rpx 20rpx 20rpx 20rpx; | ||
19 | - padding: 35rpx; | ||
20 | - background-color: #FFFFFF; | ||
21 | - border-radius: 20rpx; | 23 | + margin: 10rpx 20rpx 20rpx 20rpx; |
24 | + padding: 35rpx; | ||
25 | + background-color: #fff; | ||
26 | + border-radius: 40rpx; | ||
22 | } | 27 | } |
28 | + | ||
23 | .top_title.data-v-3a5b7e36 { | 29 | .top_title.data-v-3a5b7e36 { |
24 | - font-size: 30rpx; | ||
25 | - margin-bottom: 10rpx; | 30 | + font-size: 30rpx; |
31 | + margin-bottom: 10rpx; | ||
26 | } | 32 | } |
33 | + | ||
27 | .top_time.data-v-3a5b7e36 { | 34 | .top_time.data-v-3a5b7e36 { |
28 | - font-size: 27rpx; | ||
29 | - color: #B9B5B5; | 35 | + font-size: 27rpx; |
36 | + color: #b9b5b5; | ||
30 | } | 37 | } |
38 | + | ||
31 | .top_price.data-v-3a5b7e36 { | 39 | .top_price.data-v-3a5b7e36 { |
32 | - font-size: 35rpx; | ||
33 | - color: #D61B30; | ||
34 | - margin-top: 30rpx; | ||
35 | - margin-bottom: 5rpx; | 40 | + font-size: 35rpx; |
41 | + color: #d61b30; | ||
42 | + margin-top: 30rpx; | ||
43 | + margin-bottom: 5rpx; | ||
36 | } | 44 | } |
45 | + | ||
37 | .top_foot.data-v-3a5b7e36 { | 46 | .top_foot.data-v-3a5b7e36 { |
38 | - display: -webkit-box; | ||
39 | - display: -webkit-flex; | ||
40 | - display: flex; | 47 | + display: -webkit-box; |
48 | + display: -webkit-flex; | ||
49 | + display: flex; | ||
41 | } | 50 | } |
51 | + | ||
42 | .top_foot_price.data-v-3a5b7e36 { | 52 | .top_foot_price.data-v-3a5b7e36 { |
43 | - font-size: 22rpx; | ||
44 | - color: #B9B5B5; | ||
45 | - width: 50%; | ||
46 | - text-decoration: line-through; | 53 | + font-size: 22rpx; |
54 | + color: #b9b5b5; | ||
55 | + width: 50%; | ||
56 | + text-decoration: line-through; | ||
47 | } | 57 | } |
58 | + | ||
48 | .top_foot_qty.data-v-3a5b7e36 { | 59 | .top_foot_qty.data-v-3a5b7e36 { |
49 | - font-size: 22rpx; | ||
50 | - color: #B9B5B5; | ||
51 | - width: 50%; | ||
52 | - -webkit-align-content: flex-end; | ||
53 | - align-content: flex-end; | ||
54 | - text-align: right; | 60 | + font-size: 22rpx; |
61 | + color: #b9b5b5; | ||
62 | + width: 50%; | ||
63 | + -webkit-align-content: flex-end; | ||
64 | + align-content: flex-end; | ||
65 | + text-align: right; | ||
55 | } | 66 | } |
67 | + | ||
56 | .box_ware.data-v-3a5b7e36 { | 68 | .box_ware.data-v-3a5b7e36 { |
57 | - margin: 10rpx 20rpx 20rpx 20rpx; | ||
58 | - padding: 35rpx; | ||
59 | - background-color: #FFFFFF; | ||
60 | - border-radius: 20rpx; | 69 | + margin: 10rpx 20rpx 20rpx 20rpx; |
70 | + padding: 35rpx; | ||
71 | + background-color: #fff; | ||
72 | + border-radius: 40rpx; | ||
61 | } | 73 | } |
74 | + | ||
62 | .box_ware_title.data-v-3a5b7e36 { | 75 | .box_ware_title.data-v-3a5b7e36 { |
63 | - font-size: 35rpx; | ||
64 | - margin: 5rpx 0rpx 30rpx 0rpx; | 76 | + font-size: 35rpx; |
77 | + margin: 5rpx 0rpx 30rpx 0rpx; | ||
65 | } | 78 | } |
79 | + | ||
66 | .box_ware_box.data-v-3a5b7e36 { | 80 | .box_ware_box.data-v-3a5b7e36 { |
67 | - display: -webkit-box; | ||
68 | - display: -webkit-flex; | ||
69 | - display: flex; | ||
70 | - margin: 10rpx 0rpx 25rpx 0rpx; | 81 | + display: -webkit-box; |
82 | + display: -webkit-flex; | ||
83 | + display: flex; | ||
84 | + margin: 10rpx 0rpx 25rpx 0rpx; | ||
71 | } | 85 | } |
72 | -.box_ware_img.data-v-3a5b7e36 { | 86 | + |
87 | +/* .box_ware_img.data-v-3a5b7e36 { | ||
73 | width: 30%; | 88 | width: 30%; |
74 | height: 180rpx; | 89 | height: 180rpx; |
75 | border: #999999 solid 1rpx; | 90 | border: #999999 solid 1rpx; |
76 | -} | 91 | +} */ |
92 | + | ||
77 | .box_ware_img image.data-v-3a5b7e36 { | 93 | .box_ware_img image.data-v-3a5b7e36 { |
78 | - width: 100%; | ||
79 | - height: 100%; | 94 | + /* width: 185rpx; |
95 | + height: 190rpx; *//* background-color: rgba(138, 138, 138, 0.63); */ | ||
96 | + border: 2rpx solid #999; | ||
97 | + width: 120rpx; | ||
98 | + height: 120rpx; | ||
80 | } | 99 | } |
100 | + | ||
81 | .box_ware_item.data-v-3a5b7e36 { | 101 | .box_ware_item.data-v-3a5b7e36 { |
82 | - width: 70%; | ||
83 | - margin-left: 25rpx; | ||
84 | - position: relative; | 102 | + width: 70%; |
103 | + margin-left: 25rpx; | ||
104 | + position: relative; | ||
85 | } | 105 | } |
106 | + | ||
86 | .box_ware_item_title.data-v-3a5b7e36 { | 107 | .box_ware_item_title.data-v-3a5b7e36 { |
87 | - font-size: 30rpx; | ||
88 | - word-break: break-all; | ||
89 | - text-overflow: ellipsis; | ||
90 | - display: -webkit-box; | ||
91 | - -webkit-box-orient: vertical; | ||
92 | - -webkit-line-clamp: 2; | ||
93 | - overflow: hidden; | 108 | + font-size: 24rpx; |
109 | + word-break: break-all; | ||
110 | + text-overflow: ellipsis; | ||
111 | + display: -webkit-box; | ||
112 | + -webkit-box-orient: vertical; | ||
113 | + -webkit-line-clamp: 2; | ||
114 | + overflow: hidden; | ||
94 | } | 115 | } |
116 | + | ||
95 | .box_ware_count.data-v-3a5b7e36 { | 117 | .box_ware_count.data-v-3a5b7e36 { |
96 | - display: -webkit-box; | ||
97 | - display: -webkit-flex; | ||
98 | - display: flex; | 118 | + display: -webkit-box; |
119 | + display: -webkit-flex; | ||
120 | + display: flex; | ||
99 | } | 121 | } |
122 | + | ||
100 | .box_ware_item_price.data-v-3a5b7e36 { | 123 | .box_ware_item_price.data-v-3a5b7e36 { |
101 | - font-size: 25rpx; | ||
102 | - color: #B9B5B5; | ||
103 | - position: absolute; | ||
104 | - bottom: 60rpx; | ||
105 | - left: 0; | 124 | + font-size: 25rpx; |
125 | + color: #b9b5b5; | ||
126 | + position: absolute; | ||
127 | + bottom: 60rpx; | ||
128 | + left: 0; | ||
106 | } | 129 | } |
130 | + | ||
107 | .box_ware_item_qty.data-v-3a5b7e36 { | 131 | .box_ware_item_qty.data-v-3a5b7e36 { |
108 | - font-size: 25rpx; | ||
109 | - position: absolute; | ||
110 | - bottom: 15rpx; | ||
111 | - left: 0; | 132 | + font-size: 22rpx; |
133 | + position: absolute; | ||
134 | + bottom: 15rpx; | ||
135 | + left: 0; | ||
112 | } | 136 | } |
137 | + | ||
113 | .box_ware_code.data-v-3a5b7e36 { | 138 | .box_ware_code.data-v-3a5b7e36 { |
114 | - position: absolute; | ||
115 | - bottom: 10rpx; | ||
116 | - right: 10rpx; | 139 | + position: absolute; |
140 | + right: 10rpx; | ||
141 | + bottom: 10rpx; | ||
117 | } | 142 | } |
143 | + | ||
118 | .box_ware_code image.data-v-3a5b7e36 { | 144 | .box_ware_code image.data-v-3a5b7e36 { |
119 | - width: 60rpx; | ||
120 | - height: 60rpx; | 145 | + width: 50rpx; |
146 | + height: 50rpx; | ||
121 | } | 147 | } |
148 | + | ||
122 | .box_ware_code text.data-v-3a5b7e36 { | 149 | .box_ware_code text.data-v-3a5b7e36 { |
123 | - font-size: 20rpx; | 150 | + font-size: 20rpx; |
124 | } | 151 | } |
152 | + | ||
125 | .foot_box.data-v-3a5b7e36 { | 153 | .foot_box.data-v-3a5b7e36 { |
126 | - margin: 10rpx 20rpx 50rpx 20rpx; | ||
127 | - padding: 35rpx; | ||
128 | - background-color: #FFFFFF; | ||
129 | - border-radius: 20rpx; | 154 | + margin: 10rpx 20rpx 50rpx 20rpx; |
155 | + padding: 35rpx; | ||
156 | + background-color: #fff; | ||
157 | + border-radius: 40rpx; | ||
130 | } | 158 | } |
159 | + | ||
131 | .foot_box_title.data-v-3a5b7e36 { | 160 | .foot_box_title.data-v-3a5b7e36 { |
132 | - font-size: 35rpx; | ||
133 | - margin-bottom: 30rpx; | 161 | + font-size: 35rpx; |
162 | + margin-bottom: 30rpx; | ||
134 | } | 163 | } |
164 | + | ||
135 | .foot_box_remark.data-v-3a5b7e36 { | 165 | .foot_box_remark.data-v-3a5b7e36 { |
136 | - font-size: 27rpx; | ||
137 | - line-height: 40rpx; | 166 | + font-size: 27rpx; |
167 | + line-height: 40rpx; | ||
138 | } | 168 | } |
169 | + | ||
139 | .foot_empty.data-v-3a5b7e36 { | 170 | .foot_empty.data-v-3a5b7e36 { |
140 | - height: 90rpx; | 171 | + height: 90rpx; |
141 | } | 172 | } |
173 | + | ||
142 | .foot_button.data-v-3a5b7e36 { | 174 | .foot_button.data-v-3a5b7e36 { |
143 | - display: -webkit-box; | ||
144 | - display: -webkit-flex; | ||
145 | - display: flex; | ||
146 | - margin: 20rpx 0rpx 0rpx 0rpx; | ||
147 | - padding: 25rpx 0rpx; | ||
148 | - background: #FFFFFF; | ||
149 | - text-align: center; | ||
150 | - -webkit-box-pack: center; | ||
151 | - -webkit-justify-content: center; | ||
152 | - justify-content: center; | ||
153 | - position: fixed; | ||
154 | - bottom: 0; | ||
155 | - left: 0; | ||
156 | - width: 100%; | 175 | + display: -webkit-box; |
176 | + display: -webkit-flex; | ||
177 | + display: flex; | ||
178 | + margin: 20rpx 0rpx 0rpx 0rpx; | ||
179 | + padding: 25rpx 0rpx; | ||
180 | + background: #fff; | ||
181 | + text-align: center; | ||
182 | + -webkit-box-pack: center; | ||
183 | + -webkit-justify-content: center; | ||
184 | + justify-content: center; | ||
185 | + position: fixed; | ||
186 | + bottom: 0; | ||
187 | + left: 0; | ||
188 | + width: 100%; | ||
157 | } | 189 | } |
190 | + | ||
158 | .foot_button_left.data-v-3a5b7e36 { | 191 | .foot_button_left.data-v-3a5b7e36 { |
159 | - background: #e4010c; | ||
160 | - color: #FFFFFF; | ||
161 | - width: 250rpx; | ||
162 | - height: 70rpx; | ||
163 | - font-size: 28rpx; | ||
164 | - line-height: 70rpx; | ||
165 | - border-radius: 30rpx 0rpx 0rpx 30rpx; | 192 | + background: #e4010c; |
193 | + color: #fff; | ||
194 | + width: 250rpx; | ||
195 | + height: 70rpx; | ||
196 | + font-size: 28rpx; | ||
197 | + line-height: 70rpx; | ||
198 | + border-radius: 40rpx; | ||
166 | } | 199 | } |
200 | + | ||
167 | .foot_button_right.data-v-3a5b7e36 { | 201 | .foot_button_right.data-v-3a5b7e36 { |
168 | - background: #ffbb42; | ||
169 | - color: #FFFFFF; | ||
170 | - width: 250rpx; | ||
171 | - height: 70rpx; | ||
172 | - font-size: 28rpx; | ||
173 | - line-height: 70rpx; | ||
174 | - border-radius: 0rpx 30rpx 30rpx 0rpx; | 202 | + background: #ffbb42; |
203 | + color: #fff; | ||
204 | + width: 250rpx; | ||
205 | + height: 70rpx; | ||
206 | + font-size: 28rpx; | ||
207 | + line-height: 70rpx; | ||
208 | + border-radius: 40rpx; | ||
175 | } | 209 | } |
210 | + | ||
176 | .foot_button_buy.data-v-3a5b7e36 { | 211 | .foot_button_buy.data-v-3a5b7e36 { |
177 | - background: #e4010c; | ||
178 | - color: #FFFFFF; | ||
179 | - width: 400rpx; | ||
180 | - height: 70rpx; | ||
181 | - font-size: 28rpx; | ||
182 | - line-height: 70rpx; | ||
183 | - border-radius: 30rpx 30rpx 30rpx 30rpx; | 212 | + background: #e4010c; |
213 | + color: #fff; | ||
214 | + width: 400rpx; | ||
215 | + height: 70rpx; | ||
216 | + font-size: 28rpx; | ||
217 | + line-height: 70rpx; | ||
218 | + border-radius: 40rpx; | ||
184 | } | 219 | } |
220 | + | ||
185 | .foot_button_intalge.data-v-3a5b7e36 { | 221 | .foot_button_intalge.data-v-3a5b7e36 { |
186 | - background: #ffbb42; | ||
187 | - color: #FFFFFF; | ||
188 | - width: 400rpx; | ||
189 | - height: 70rpx; | ||
190 | - font-size: 28rpx; | ||
191 | - line-height: 70rpx; | ||
192 | - border-radius: 30rpx 30rpx 30rpx 30rpx; | 222 | + background: #ffbb42; |
223 | + color: #fff; | ||
224 | + width: 400rpx; | ||
225 | + height: 70rpx; | ||
226 | + font-size: 28rpx; | ||
227 | + line-height: 70rpx; | ||
228 | + border-radius: 40rpx; | ||
193 | } | 229 | } |
230 | + | ||
194 | page.data-v-3a5b7e36 { | 231 | page.data-v-3a5b7e36 { |
195 | background-color: #e85f93; | 232 | background-color: #e85f93; |
196 | } | 233 | } |
234 | + | ||
197 | .foot_box_remark.data-v-3a5b7e36 ._img { | 235 | .foot_box_remark.data-v-3a5b7e36 ._img { |
198 | width: 100%; | 236 | width: 100%; |
199 | } | 237 | } |
238 | + | ||
200 | .foot_box_remark.data-v-3a5b7e36 .img { | 239 | .foot_box_remark.data-v-3a5b7e36 .img { |
201 | line-height: 0; | 240 | line-height: 0; |
202 | } | 241 | } |
203 | - | 242 | +.overdue.data-v-3a5b7e36{ |
243 | + background-color: rgb(153,153,153); | ||
244 | +} | ||
204 | \ No newline at end of file | 245 | \ No newline at end of file |
pages/giftpack/mygiftpack/mygiftpack.js
@@ -11,8 +11,8 @@ Page({ | @@ -11,8 +11,8 @@ Page({ | ||
11 | getStorageID: '', | 11 | getStorageID: '', |
12 | getUserID: '', | 12 | getUserID: '', |
13 | wareCard: [], | 13 | wareCard: [], |
14 | - pages: 0, | ||
15 | - pageSize: 10, | 14 | + // pages: 0, |
15 | + // pageSize: 10, | ||
16 | isEmpty: false, | 16 | isEmpty: false, |
17 | loadingType: 0, //定义加载方式 0---contentdown 1---contentrefresh 2---contentnomore | 17 | loadingType: 0, //定义加载方式 0---contentdown 1---contentrefresh 2---contentnomore |
18 | contentText: { | 18 | contentText: { |
@@ -23,68 +23,29 @@ Page({ | @@ -23,68 +23,29 @@ Page({ | ||
23 | ismore:0,//数据是否全部加载完成 | 23 | ismore:0,//数据是否全部加载完成 |
24 | is_read:0,//是否查询过我的礼包接口 | 24 | is_read:0,//是否查询过我的礼包接口 |
25 | curpage: 1, //当前分页数 | 25 | curpage: 1, //当前分页数 |
26 | - pageSize: 3, //页大小 | 26 | + pageSize: 10, //页大小 |
27 | total: 0, //总数量 | 27 | total: 0, //总数量 |
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, |
36 | getUserID: d.user_id, | 34 | getUserID: d.user_id, |
37 | - pages: 1, | ||
38 | - pageSize: 3, | ||
39 | loadingType: 0, | 35 | loadingType: 0, |
40 | getDate: i.formatTime(new Date().getTime()) | 36 | getDate: i.formatTime(new Date().getTime()) |
41 | }) | 37 | }) |
42 | th.getList(); | 38 | th.getList(); |
43 | }, | 39 | }, |
44 | onShow: function() { | 40 | onShow: function() { |
45 | - // this.pages = 1; | ||
46 | - // this.pageSize = 10; | ||
47 | - // this.loadingType = 0; | ||
48 | - // this.getList(); | ||
49 | - // var th = this; | ||
50 | - // th.setData({ | ||
51 | - // pages: 1, | ||
52 | - // pageSize: 10, | ||
53 | - // loadingType: 0 | ||
54 | - // }) | ||
55 | - // th.getList(); | ||
56 | - }, | ||
57 | - // methods: { | ||
58 | - // BuyGift: function BuyGift() { | ||
59 | - // /*销毁跳转*/ | ||
60 | - // uni.reLaunch({ | ||
61 | - // url: 'pages/giftpack/buygiftpack/giftpackbuy?stoid=' + this.getStorageID + '&userid=' + this.getUserID | ||
62 | - // }); | ||
63 | - | ||
64 | - // }, | ||
65 | - // GetGiftPackList: function(getId, ojb) { | ||
66 | - // //不销毁调整 | ||
67 | - // uni.navigateTo({ | ||
68 | - // url: 'pages/giftpack/giftpacklist/giftpacklist?isBuy=0&stoid=' + this.getStorageID + '&userid=' + this.getUserID + '&id=' + | ||
69 | - // getId | ||
70 | - // }); | ||
71 | 41 | ||
72 | - // }, | 42 | + }, |
73 | getList: function() { | 43 | getList: function() { |
74 | var th = this; | 44 | var th = this; |
75 | - // if (th.data.loadingType) { | ||
76 | - // return false; | ||
77 | - // } | ||
78 | - // // that.loadingType = 1; | ||
79 | - // th.setData({ | ||
80 | - // loadingType: 1 | ||
81 | - // }) | 45 | + |
82 | getApp().request.get('/api/weshop/marketing/my/giftbag/page', { | 46 | getApp().request.get('/api/weshop/marketing/my/giftbag/page', { |
47 | + isShowLoading:true, | ||
83 | data: { | 48 | data: { |
84 | - // "storeId": this.getStorageID, //商家ID | ||
85 | - // "userId": this.getUserID, //用户ID | ||
86 | - // "page": this.pages, | ||
87 | - // "pageSize": this.pageSize | ||
88 | storeId: th.data.getStorageID, //商家ID | 49 | storeId: th.data.getStorageID, //商家ID |
89 | userId: th.data.getUserID, //用户ID | 50 | userId: th.data.getUserID, //用户ID |
90 | page: th.data.curpage, | 51 | page: th.data.curpage, |
@@ -110,47 +71,7 @@ Page({ | @@ -110,47 +71,7 @@ Page({ | ||
110 | is_read: 1 | 71 | is_read: 1 |
111 | }) | 72 | }) |
112 | } | 73 | } |
113 | - // if (res.data.code == 0) { | ||
114 | - // if (res.data.data.total > 0) { | ||
115 | - // // _this.isEmpty = false; | ||
116 | - // _this.setData({ | ||
117 | - // isEmpty: false | ||
118 | - // }) | ||
119 | - // } else { | ||
120 | - // // _this.isEmpty = true; | ||
121 | - // _this.setData({ | ||
122 | - // isEmpty: true | ||
123 | - // }) | ||
124 | - // } | ||
125 | - // if (res.data.data.pageData.length == 0) { | ||
126 | - // // _this.loadingType = 2; | ||
127 | - // _this.setData({ | ||
128 | - // loadingType: 2 | ||
129 | - // }) | ||
130 | - // } else { | ||
131 | - // var wareCard = that.wareCard; | ||
132 | - // var is_resad = 0; | ||
133 | - // // if (_this.wareCard.length < res.data.data.pageData.length) { | ||
134 | - // if (wareCard.length < res.data.data.total) { | ||
135 | - // for (var i = 0; i < res.data.data.pageData.length; i++) { | ||
136 | - // wareCard.push(res.data.data.pageData[i]); | ||
137 | - // } | ||
138 | - // }else{ | ||
139 | - // is_resad=1 | ||
140 | - // } | ||
141 | - // _this.setData({ | ||
142 | - // wareCard: wareCard, | ||
143 | - // is_resad: is_resad | ||
144 | - // }) | ||
145 | - | ||
146 | - // // _this.loadingType = 0; | ||
147 | - // _this.setData({ | ||
148 | - // loadingType: 0 | ||
149 | - // }) | ||
150 | - // } | ||
151 | - // } else { | ||
152 | - | ||
153 | - // } | 74 | + |
154 | } | 75 | } |
155 | 76 | ||
156 | }); | 77 | }); |
@@ -169,9 +90,7 @@ Page({ | @@ -169,9 +90,7 @@ Page({ | ||
169 | navigateTo: function (e) { | 90 | navigateTo: function (e) { |
170 | var th = this; | 91 | var th = this; |
171 | var url = e.currentTarget.dataset.url; | 92 | var url = e.currentTarget.dataset.url; |
172 | - wx.navigateTo({ | ||
173 | - url: url, | ||
174 | - }) | 93 | + getApp().goto(url); |
175 | }, | 94 | }, |
176 | //下拉事件 | 95 | //下拉事件 |
177 | onReachBottom: function () { | 96 | onReachBottom: function () { |
@@ -183,5 +102,13 @@ Page({ | @@ -183,5 +102,13 @@ Page({ | ||
183 | }) | 102 | }) |
184 | th.getList(); | 103 | th.getList(); |
185 | }, | 104 | }, |
105 | + //图片失败,默认图片 | ||
106 | + bind_bnerr2: function (e) { | ||
107 | + var _errImg = e.target.dataset.errorimg; | ||
108 | + var _errObj = {}; | ||
109 | + _errObj[_errImg] = "/public/images/empty.jpg"; | ||
110 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
111 | + | ||
112 | + }, | ||
186 | 113 | ||
187 | }); | 114 | }); |
188 | \ No newline at end of file | 115 | \ No newline at end of file |
pages/giftpack/mygiftpack/mygiftpack.wxml
1 | <view class="top_img"> | 1 | <view class="top_img"> |
2 | <view class="top_img"> | 2 | <view class="top_img"> |
3 | <!-- <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift00.jpg'}}"></image> --> | 3 | <!-- <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift00.jpg'}}"></image> --> |
4 | - <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg'}}" lazy-load="true"></image> | 4 | + <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg?v=2019'}}" lazy-load="true"></image> |
5 | </view> | 5 | </view> |
6 | <view class="top_title"> | 6 | <view class="top_title"> |
7 | <view class="top_title_box"> | 7 | <view class="top_title_box"> |
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&orderSn={{item.orderSn}}"> | 17 | <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&orderSn={{item.orderSn}}"> |
18 | <view class="content_box_img"> | 18 | <view class="content_box_img"> |
19 | <!-- <image src="{{$GetInfo.imgHttp+item.$orig.lbUrl}}"></image> --> | 19 | <!-- <image src="{{$GetInfo.imgHttp+item.$orig.lbUrl}}"></image> --> |
20 | - <image src="{{iurl+item.lbUrl}}" lazy-load="true"></image> | 20 | + <image src="{{iurl+item.lbUrl}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image> |
21 | <block wx:if="{{item.actType!=0}}"> | 21 | <block wx:if="{{item.actType!=0}}"> |
22 | <view class="{{[item.actType==1?'content_box_img_title content_box_img_ground1':item.actType==2?'content_box_img_title content_box_img_ground2':item.actType==4?'content_box_img_title content_box_img_ground3':'content_box_img_title content_box_img_ground4']}}"> | 22 | <view class="{{[item.actType==1?'content_box_img_title content_box_img_ground1':item.actType==2?'content_box_img_title content_box_img_ground2':item.actType==4?'content_box_img_title content_box_img_ground3':'content_box_img_title content_box_img_ground4']}}"> |
23 | <image src="{{iurl+'/miniapp/images/giftbag/gift01.png'}}" lazy-load="true"></image> | 23 | <image src="{{iurl+'/miniapp/images/giftbag/gift01.png'}}" lazy-load="true"></image> |
@@ -42,7 +42,7 @@ | @@ -42,7 +42,7 @@ | ||
42 | </view> | 42 | </view> |
43 | <view class="content_box_title"> | 43 | <view class="content_box_title"> |
44 | <view class="content_ware_title"> | 44 | <view class="content_ware_title"> |
45 | - <text bindtap="__e">{{item.giftTitle}}</text> | 45 | + <text>{{item.giftTitle}}</text> |
46 | </view> | 46 | </view> |
47 | <view class="content_ware_type"> | 47 | <view class="content_ware_type"> |
48 | <block wx:if="{{item.actType==0&item.payMoney>0}}"> | 48 | <block wx:if="{{item.actType==0&item.payMoney>0}}"> |
@@ -94,14 +94,11 @@ | @@ -94,14 +94,11 @@ | ||
94 | <text>当前暂无礼包</text> | 94 | <text>当前暂无礼包</text> |
95 | </view> | 95 | </view> |
96 | <view class="foot_empty_button"> | 96 | <view class="foot_empty_button"> |
97 | - <text bindtap="__e">去获取</text> | 97 | + <text bindtap="navigateTo" data-url="/pages/giftpack/buygiftpack/giftpackbuy">去获取</text> |
98 | </view> | 98 | </view> |
99 | </view> | 99 | </view> |
100 | </block> | 100 | </block> |
101 | <block wx:if="{{ismore}}"> | 101 | <block wx:if="{{ismore}}"> |
102 | - <!-- <view class="foot_box"> | ||
103 | - <text>———— 到底了 ————</text> | ||
104 | - </view> --> | ||
105 | <!-- 加载完毕并且数据大于=页大小 --> | 102 | <!-- 加载完毕并且数据大于=页大小 --> |
106 | <view class="After_all flex-center" wx:if="{{ismore && wareCard.length>=3}}"> | 103 | <view class="After_all flex-center" wx:if="{{ismore && wareCard.length>=3}}"> |
107 | <view class="Line"></view> | 104 | <view class="Line"></view> |
pages/giftpack/mygiftpack/mygiftpack.wxss
@@ -12,7 +12,6 @@ | @@ -12,7 +12,6 @@ | ||
12 | 12 | ||
13 | .top_img image { | 13 | .top_img image { |
14 | width: 100%; | 14 | width: 100%; |
15 | - height: 660rpx; | ||
16 | } | 15 | } |
17 | 16 | ||
18 | .top_title { | 17 | .top_title { |
@@ -236,7 +235,7 @@ | @@ -236,7 +235,7 @@ | ||
236 | } | 235 | } |
237 | 236 | ||
238 | page { | 237 | page { |
239 | - background-color: #fb7454; | 238 | + background-color: rgb(250, 120, 88); |
240 | } | 239 | } |
241 | .After_all { | 240 | .After_all { |
242 | height: 80rpx; | 241 | height: 80rpx; |
pages/giftpack/newvipgift/newvipgift.js
0 → 100644
1 | +var i = require("../../../utils/util.js") | ||
2 | +var e = getApp(), | ||
3 | + a = e.globalData.setting, | ||
4 | + os = a, | ||
5 | + t = e.request, | ||
6 | + d = e.globalData; | ||
7 | +Page({ | ||
8 | + data: { | ||
9 | + url: a.url, //接口网址 | ||
10 | + iurl: a.imghost, //图片前缀网址 | ||
11 | + itemShow: false, //项目栏目是否显示 | ||
12 | + cardShow: false, //代金券栏目是否显示 | ||
13 | + packShow: false, //福利栏目是否显示 | ||
14 | + textShow: false, //规则是否显示 | ||
15 | + integralShow: true, //积分领取是否显示 | ||
16 | + growUpShow: true, //成长值领取是否显示 | ||
17 | + itemButton: '', | ||
18 | + cardButton: '', | ||
19 | + getActId: '', | ||
20 | + getActType: '', | ||
21 | + giftID: '', | ||
22 | + receiveState: '一键全部领取', | ||
23 | + textTitle: '', | ||
24 | + getUrl: '', | ||
25 | + noShow: false, | ||
26 | + cards: [], //礼包内容--礼券 | ||
27 | + itemWare: [], //礼包内容--服务项目 | ||
28 | + integralTitle: "", | ||
29 | + growUpTitle: "", | ||
30 | + is_sub: 0, //是否重复领取 | ||
31 | + | ||
32 | + }, | ||
33 | + GetList: function() { | ||
34 | + var th = this; | ||
35 | + var url = "/api/weshop/marketing/giftbag/bound/get"; | ||
36 | + wx.showLoading({ | ||
37 | + title: '加载中', | ||
38 | + }) | ||
39 | + getApp().request.promiseGet(url, { | ||
40 | + data: { | ||
41 | + "actId": th.data.getActId, //活动id | ||
42 | + "actType": 1, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销 | ||
43 | + "giftBagId": th.data.giftID, //礼包ID | ||
44 | + "storeId": a.stoid, //商家ID | ||
45 | + "userId": d.user_id //用户ID | ||
46 | + } | ||
47 | + }).then(res => { | ||
48 | + wx.hideLoading(); | ||
49 | + if (res.data.code == 0) { | ||
50 | + if (res.data.data.lbCoupons != null && res.data.data.lbCoupons.length > 0) { | ||
51 | + //礼包内容--礼券 | ||
52 | + th.setData({ | ||
53 | + cardShow: true, | ||
54 | + cards: res.data.data.lbCoupons | ||
55 | + }) | ||
56 | + } | ||
57 | + if (res.data.data.lbSM != null && res.data.data.lbSM.length > 0) { | ||
58 | + //礼包内容--服务项目 | ||
59 | + th.setData({ | ||
60 | + itemShow: true, | ||
61 | + itemWare: res.data.data.lbSM | ||
62 | + }) | ||
63 | + } | ||
64 | + //礼包积分 | ||
65 | + if (res.data.data.lbIntegral <= 0) { | ||
66 | + if (res.data.data.lbGrowthValue <= 0) { | ||
67 | + th.setData({ | ||
68 | + packShow: false | ||
69 | + }) | ||
70 | + } else { | ||
71 | + th.setData({ | ||
72 | + packShow: false, | ||
73 | + integralShow: false, | ||
74 | + growUpShow: true | ||
75 | + }) | ||
76 | + } | ||
77 | + | ||
78 | + } else { | ||
79 | + if (res.data.data.lbGrowthValue > 0) { | ||
80 | + th.setData({ | ||
81 | + packShow: true | ||
82 | + }) | ||
83 | + } else { | ||
84 | + th.setData({ | ||
85 | + packShow: true, | ||
86 | + integralShow: true, | ||
87 | + growUpShow: false | ||
88 | + }) | ||
89 | + } | ||
90 | + } | ||
91 | + th.setData({ | ||
92 | + integralTitle: '价值' + res.data.data.lbIntegral + '积分', | ||
93 | + growUpTitle: '价值' + res.data.data.lbGrowthValue + '成长值' | ||
94 | + }) | ||
95 | + if (res.data.data.receiveState == 0) { | ||
96 | + th.setData({ | ||
97 | + receiveState: '一键全部领取' | ||
98 | + }) | ||
99 | + } else { | ||
100 | + th.setData({ | ||
101 | + receiveState: '已领取' | ||
102 | + }) | ||
103 | + } | ||
104 | + | ||
105 | + if (res.data.data.actIntro != '') { | ||
106 | + th.setData({ | ||
107 | + textShow: true, | ||
108 | + textTitle: res.data.data.actIntro.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"').replace(/<section/g, '<div') | ||
109 | + .replace(/\/section>/g, '\div>') | ||
110 | + }) | ||
111 | + } | ||
112 | + } else { | ||
113 | + getApp().my_warnning(res.data.msg, 0, th); | ||
114 | + return false; | ||
115 | + } | ||
116 | + }) | ||
117 | + }, | ||
118 | + | ||
119 | + onLoad: function(options) { | ||
120 | + var th = this; | ||
121 | + th.setData({ | ||
122 | + getActId: options.actId, | ||
123 | + giftID: options.giftBagId | ||
124 | + }) | ||
125 | + th.GetList(); | ||
126 | + }, | ||
127 | + onShow: function() { | ||
128 | + | ||
129 | + }, | ||
130 | + GetReceive: function() { | ||
131 | + var th = this; | ||
132 | + if (th.data.receiveState == '已领取') { | ||
133 | + return false; | ||
134 | + } | ||
135 | + var is_sub = th.data.is_sub; //判断是否重复提交 | ||
136 | + if (is_sub == 0) { | ||
137 | + th.setData({ | ||
138 | + is_sub: 1 | ||
139 | + }) | ||
140 | + wx.showLoading({ | ||
141 | + title: '加载中', | ||
142 | + }) | ||
143 | + var json = { | ||
144 | + "actId": th.data.getActId, //活动Id | ||
145 | + "actType": 1, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | ||
146 | + "giftBagId": th.data.giftID, //礼包Id | ||
147 | + "storeId": a.stoid, //商家Id | ||
148 | + "userId": d.user_id //用户ID | ||
149 | + }; | ||
150 | + var data = JSON.stringify(json); | ||
151 | + var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; | ||
152 | + wx.request({ | ||
153 | + url: url, | ||
154 | + data: data, | ||
155 | + method: 'post', | ||
156 | + header: { | ||
157 | + 'content-type': 'application/json' | ||
158 | + }, // 设置请求的 header | ||
159 | + success: function(res) { | ||
160 | + wx.hideLoading(); | ||
161 | + th.setData({ | ||
162 | + is_sub: 0 | ||
163 | + }) | ||
164 | + if (res.data.code == 0) { | ||
165 | + th.setData({ | ||
166 | + receiveState: '已领取' | ||
167 | + }) | ||
168 | + getApp().my_warnning("领取成功", 1, th); | ||
169 | + } else { | ||
170 | + getApp().my_warnning(res.data.msg, 0, th); | ||
171 | + } | ||
172 | + } | ||
173 | + }) | ||
174 | + } | ||
175 | + }, | ||
176 | + //界面跳转 | ||
177 | + goto: function(e) { | ||
178 | + var url = e.currentTarget.dataset.url; | ||
179 | + getApp().goto(url); | ||
180 | + }, | ||
181 | + //图片失败,默认图片 | ||
182 | + bind_bnerr1: function(e) { | ||
183 | + var th = this; | ||
184 | + var _errImg = e.target.dataset.errorimg; | ||
185 | + var _Img = e.target.dataset.img; | ||
186 | + if (_Img != undefined) { | ||
187 | + var _errObj = {}; | ||
188 | + _errObj[_errImg] = "/miniapp/images/giftbag/gift02.png"; | ||
189 | + th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
190 | + } | ||
191 | + }, | ||
192 | +}); | ||
0 | \ No newline at end of file | 193 | \ No newline at end of file |
pages/giftpack/newvipgift/newvipgift.json
0 → 100644
pages/giftpack/newvipgift/newvipgift.wxml
0 → 100644
1 | +<view> | ||
2 | + <view class="image_box"> | ||
3 | + <image src="{{iurl+'/miniapp/images/giftbag/vip00.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> | ||
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 class="num flex-level-right fs26"> | ||
47 | + <view>数量:</view> | ||
48 | + <view>{{item.num}}</view> | ||
49 | + </view> | ||
50 | + </view> | ||
51 | + </view> | ||
52 | + </view> | ||
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> | ||
58 | + </view> | ||
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> | ||
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 | + </block> | ||
103 | + <view class="top_card_remak ">{{"满"+item.buySum+"元可以用"}}</view> | ||
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> | ||
114 | + </view> | ||
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> | ||
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}}" name="div" 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> | ||
171 | + </view> | ||
172 | + </view> | ||
173 | +</view> | ||
174 | +<!-- 引入提示组件 --> | ||
175 | +<warn id="warn"></warn> | ||
176 | +<my_confirm id="my_confirm"></my_confirm> | ||
0 | \ No newline at end of file | 177 | \ No newline at end of file |
pages/giftpack/newvipgift/newvipgift.wxss
0 → 100644
1 | +@charset "UTF-8"; | ||
2 | + | ||
3 | +/* Author XGQ | ||
4 | + * 2019-10-27 | ||
5 | + */ | ||
6 | + | ||
7 | +.image_box { | ||
8 | + -webkit-box-pack: center; | ||
9 | + -webkit-justify-content: center; | ||
10 | + justify-content: center; | ||
11 | +} | ||
12 | + | ||
13 | +.image_box image { | ||
14 | + width: 100%; | ||
15 | + height: 690rpx; | ||
16 | +} | ||
17 | + | ||
18 | +.top { | ||
19 | + margin: -20rpx 28rpx 45rpx 28rpx; | ||
20 | + padding: 10rpx 10rpx 70rpx 10rpx; | ||
21 | + background-color: #fff; | ||
22 | + border-radius: 0rpx 0rpx 15rpx 15rpx; | ||
23 | +} | ||
24 | + | ||
25 | +.top_box { | ||
26 | + display: -webkit-box; | ||
27 | + display: -webkit-flex; | ||
28 | + display: flex; | ||
29 | + text-align: center; | ||
30 | + -webkit-box-pack: center; | ||
31 | + -webkit-justify-content: center; | ||
32 | + justify-content: center; | ||
33 | +} | ||
34 | + | ||
35 | +.top_box_text { | ||
36 | + -webkit-box-pack: center; | ||
37 | + -webkit-justify-content: center; | ||
38 | + justify-content: center; | ||
39 | + margin: 50rpx 15rpx 20rpx 15rpx; | ||
40 | +} | ||
41 | + | ||
42 | +.top_box_text text { | ||
43 | + color: #fb6451; | ||
44 | + font-size: 40rpx; | ||
45 | +} | ||
46 | + | ||
47 | +.top_item { | ||
48 | + display: -webkit-box; | ||
49 | + display: -webkit-flex; | ||
50 | + display: flex; | ||
51 | + width: 100%; | ||
52 | + margin: 60rpx 0 0 0; | ||
53 | +} | ||
54 | + | ||
55 | +.top_item_img { | ||
56 | + float: left; | ||
57 | + width: 28%; | ||
58 | + margin: 0rpx 10rpx 0rpx 20rpx; | ||
59 | +} | ||
60 | + | ||
61 | +.top_item_img image { | ||
62 | + width: 150rpx; | ||
63 | + height: 150rpx; | ||
64 | + border-radius: 50%; | ||
65 | + border: #f96865 solid 3rpx; | ||
66 | +} | ||
67 | + | ||
68 | +.top_item_center { | ||
69 | + float: left; | ||
70 | + width: 50%; | ||
71 | +} | ||
72 | + | ||
73 | +.top_item_center_title { | ||
74 | + font-size: 35rpx; | ||
75 | + color: #fb6451; | ||
76 | + -webkit-box-pack: start; | ||
77 | + -webkit-justify-content: flex-start; | ||
78 | + justify-content: flex-start; | ||
79 | + padding: 0 10rpx 15rpx 0rpx; | ||
80 | + word-break: break-all; | ||
81 | + /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/ | ||
82 | + text-overflow: ellipsis; | ||
83 | + display: -webkit-box; | ||
84 | + /** 对象作为伸缩盒子模型显示 **/ | ||
85 | + -webkit-box-orient: vertical; | ||
86 | + /** 设置或检索伸缩盒对象的子元素的排列方式 **/ | ||
87 | + -webkit-line-clamp: 2; | ||
88 | + /** 显示的行数 **/ | ||
89 | + overflow: hidden; | ||
90 | + /** 隐藏超出的内容 **/ | ||
91 | +} | ||
92 | + | ||
93 | +.top_item_center_ramke { | ||
94 | + font-size: 25rpx; | ||
95 | + -webkit-box-pack: start; | ||
96 | + -webkit-justify-content: flex-start; | ||
97 | + justify-content: flex-start; | ||
98 | + line-height: 35rpx; | ||
99 | + letter-spacing: 0.5rpx; | ||
100 | + word-break: break-all; | ||
101 | + /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/ | ||
102 | + text-overflow: ellipsis; | ||
103 | + display: -webkit-box; | ||
104 | + /** 对象作为伸缩盒子模型显示 **/ | ||
105 | + -webkit-box-orient: vertical; | ||
106 | + /** 设置或检索伸缩盒对象的子元素的排列方式 **/ | ||
107 | + -webkit-line-clamp: 2; | ||
108 | + /** 显示的行数 **/ | ||
109 | + overflow: hidden; | ||
110 | + /** 隐藏超出的内容 **/ | ||
111 | +} | ||
112 | + | ||
113 | +.top_item_button { | ||
114 | + float: right; | ||
115 | + width: 22%; | ||
116 | + padding: 65rpx 20rpx 0 1rpx; | ||
117 | +} | ||
118 | + | ||
119 | +.top_item_button button { | ||
120 | + font-size: 25rpx; | ||
121 | + background: #fd6969; | ||
122 | + color: #fff; | ||
123 | + border-radius: 50rpx; | ||
124 | + height: 45rpx; | ||
125 | + line-height: 45rpx; | ||
126 | +} | ||
127 | + | ||
128 | +.top_card { | ||
129 | + width: calc(50% - 30rpx); | ||
130 | + display: inline-block; | ||
131 | + margin: 15rpx; | ||
132 | +} | ||
133 | + | ||
134 | +.top_card_box { | ||
135 | + background-size: cover; | ||
136 | + background-position: center; | ||
137 | + background-repeat: no-repeat; | ||
138 | + border-radius: 20rpx; | ||
139 | + height: 250rpx; | ||
140 | + margin: 5rpx; | ||
141 | +} | ||
142 | + | ||
143 | +.img1 { | ||
144 | + background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip01.png); | ||
145 | +} | ||
146 | + | ||
147 | +.img2 { | ||
148 | + background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip02.png); | ||
149 | +} | ||
150 | + | ||
151 | +.img3 { | ||
152 | + background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip03.png); | ||
153 | +} | ||
154 | + | ||
155 | +.top_card_tite_box { | ||
156 | + width: 100%; | ||
157 | + display: -webkit-box; | ||
158 | + display: -webkit-flex; | ||
159 | + display: flex; | ||
160 | + -webkit-box-pack: end; | ||
161 | + -webkit-justify-content: flex-end; | ||
162 | + justify-content: flex-end; | ||
163 | +} | ||
164 | + | ||
165 | +.top_card_tite_a { | ||
166 | + padding: 5rpx 25rpx 5rpx 25rpx; | ||
167 | + line-height: 29rpx; | ||
168 | + font-size: 25rpx; | ||
169 | + color: #fff; | ||
170 | + background: #ffa7c0; | ||
171 | + border-radius: 0rpx 20rpx 0rpx 6rpx; | ||
172 | +} | ||
173 | + | ||
174 | +.top_card_tite_b { | ||
175 | + padding: 5rpx 25rpx 5rpx 25rpx; | ||
176 | + line-height: 29rpx; | ||
177 | + font-size: 25rpx; | ||
178 | + color: #fff; | ||
179 | + background: #50dfdb; | ||
180 | + border-radius: 0rpx 20rpx 0rpx 6rpx; | ||
181 | +} | ||
182 | + | ||
183 | +.top_card_tite_c { | ||
184 | + padding: 5rpx 25rpx 5rpx 25rpx; | ||
185 | + line-height: 29rpx; | ||
186 | + font-size: 25rpx; | ||
187 | + color: #fff; | ||
188 | + background: #92cbff; | ||
189 | + border-radius: 0rpx 20rpx 0rpx 6rpx; | ||
190 | +} | ||
191 | + | ||
192 | +.top_card_tite_d { | ||
193 | + padding: 5rpx 25rpx 5rpx 25rpx; | ||
194 | + line-height: 29rpx; | ||
195 | + font-size: 25rpx; | ||
196 | + color: #fff; | ||
197 | + border-radius: 0rpx 20rpx 0rpx 6rpx; | ||
198 | +} | ||
199 | + | ||
200 | +.top_card_counte { | ||
201 | + padding: 40rpx 20rpx 0 0; | ||
202 | + text-align: center; | ||
203 | + display: -webkit-box; | ||
204 | + display: -webkit-flex; | ||
205 | + display: flex; | ||
206 | + -webkit-box-pack: center; | ||
207 | + -webkit-justify-content: center; | ||
208 | + justify-content: center; | ||
209 | + -webkit-box-align: center; | ||
210 | + -webkit-align-items: center; | ||
211 | + align-items: center; | ||
212 | + color: #fff; | ||
213 | + font-size: 40rpx; | ||
214 | +} | ||
215 | + | ||
216 | +.top_card_remak { | ||
217 | + padding: 20rpx 0 40rpx 0; | ||
218 | + text-align: center; | ||
219 | + display: -webkit-box; | ||
220 | + display: -webkit-flex; | ||
221 | + display: flex; | ||
222 | + -webkit-box-pack: center; | ||
223 | + -webkit-justify-content: center; | ||
224 | + justify-content: center; | ||
225 | + -webkit-box-align: center; | ||
226 | + -webkit-align-items: center; | ||
227 | + align-items: center; | ||
228 | + font-size: 20rpx; | ||
229 | + color: #fff; | ||
230 | +} | ||
231 | + | ||
232 | +.top_card_button_a button { | ||
233 | + margin: 0 85rpx; | ||
234 | + background: #ffa6bc; | ||
235 | + border-radius: 50rpx; | ||
236 | + line-height: 40rpx; | ||
237 | + height: 40rpx; | ||
238 | + color: white; | ||
239 | + font-size: 25rpx; | ||
240 | +} | ||
241 | + | ||
242 | +.top_card_button_b button { | ||
243 | + margin: 0 85rpx; | ||
244 | + background: #50dfdb; | ||
245 | + border-radius: 50rpx; | ||
246 | + line-height: 40rpx; | ||
247 | + height: 40rpx; | ||
248 | + color: white; | ||
249 | + font-size: 25rpx; | ||
250 | +} | ||
251 | + | ||
252 | +.top_card_button_c button { | ||
253 | + margin: 0 85rpx; | ||
254 | + background: #75bcfc; | ||
255 | + border-radius: 50rpx; | ||
256 | + line-height: 40rpx; | ||
257 | + height: 40rpx; | ||
258 | + color: white; | ||
259 | + font-size: 25rpx; | ||
260 | +} | ||
261 | + | ||
262 | +.top_card_button_d button { | ||
263 | + margin: 0 85rpx; | ||
264 | + border-radius: 50rpx; | ||
265 | + line-height: 40rpx; | ||
266 | + height: 40rpx; | ||
267 | + color: white; | ||
268 | + font-size: 25rpx; | ||
269 | +} | ||
270 | + | ||
271 | +.top_box_image { | ||
272 | + padding: 20rpx 20rpx 20rpx 20rpx; | ||
273 | +} | ||
274 | + | ||
275 | +.top_box_image image { | ||
276 | + height: 216rpx; | ||
277 | + width: 100%; | ||
278 | +} | ||
279 | + | ||
280 | +.top_box_image button { | ||
281 | + margin: 15rpx 95rpx 0rpx 95rpx; | ||
282 | + background: #fe6a6a; | ||
283 | + border-radius: 50rpx; | ||
284 | + line-height: 60rpx; | ||
285 | + height: 60rpx; | ||
286 | + color: white; | ||
287 | + font-size: 30rpx; | ||
288 | +} | ||
289 | + | ||
290 | +.foot_box { | ||
291 | + margin: 0 30rpx 40rpx 30rpx; | ||
292 | + background: #fff; | ||
293 | + border-radius: 20rpx; | ||
294 | +} | ||
295 | + | ||
296 | +.foot_box_title { | ||
297 | + color: #000; | ||
298 | + padding: 20rpx 30rpx 20rpx 30rpx; | ||
299 | +} | ||
300 | + | ||
301 | +.foot_box_text { | ||
302 | + font-size: 30rpx; | ||
303 | + color: #000; | ||
304 | + line-height: 48rpx; | ||
305 | + padding: 20rpx 35rpx 50rpx 30rpx; | ||
306 | +} | ||
307 | + | ||
308 | +.button_box { | ||
309 | + margin: 50rpx 50rpx 50rpx 50rpx; | ||
310 | + text-align: center; | ||
311 | +} | ||
312 | + | ||
313 | +.button { | ||
314 | + margin: 0 30rpx; | ||
315 | + background: #ff9a8c; | ||
316 | + border-radius: 50rpx; | ||
317 | + line-height: 80rpx; | ||
318 | + height: 80rpx; | ||
319 | + color: white; | ||
320 | + font-size: 35rpx; | ||
321 | +} | ||
322 | + | ||
323 | +.button_text { | ||
324 | + padding-top: 20rpx; | ||
325 | + font-size: 20rpx; | ||
326 | + color: white; | ||
327 | + height: 100rpx; | ||
328 | +} | ||
329 | + | ||
330 | +.foot_empty { | ||
331 | + height: 90rpx; | ||
332 | +} | ||
333 | + | ||
334 | +.foot_button { | ||
335 | + display: -webkit-box; | ||
336 | + display: -webkit-flex; | ||
337 | + display: flex; | ||
338 | + margin: 20rpx 0rpx 0rpx 0rpx; | ||
339 | + padding: 25rpx 0rpx; | ||
340 | + background: #fff; | ||
341 | + text-align: center; | ||
342 | + -webkit-box-pack: center; | ||
343 | + -webkit-justify-content: center; | ||
344 | + justify-content: center; | ||
345 | + position: fixed; | ||
346 | + bottom: 0; | ||
347 | + left: 0; | ||
348 | + width: 100%; | ||
349 | + z-index: 10; | ||
350 | +} | ||
351 | + | ||
352 | +.foot_button_buy { | ||
353 | + background: #e4010c; | ||
354 | + color: #fff; | ||
355 | + width: 400rpx; | ||
356 | + height: 70rpx; | ||
357 | + font-size: 28rpx; | ||
358 | + line-height: 70rpx; | ||
359 | + border-radius: 40rpx; | ||
360 | +} | ||
361 | + | ||
362 | +.foot_button_notbuy { | ||
363 | + background: #999; | ||
364 | + color: #fff; | ||
365 | + width: 400rpx; | ||
366 | + height: 70rpx; | ||
367 | + font-size: 28rpx; | ||
368 | + line-height: 70rpx; | ||
369 | + border-radius: 40rpx; | ||
370 | +} | ||
371 | + | ||
372 | +page { | ||
373 | + background-color: #fb6451; | ||
374 | +} | ||
375 | + | ||
376 | +button::after { | ||
377 | + border: none; | ||
378 | +} | ||
379 | + | ||
380 | +.foot_box_text ._img { | ||
381 | + width: 100%; | ||
382 | +} | ||
383 | +.foot_box_text .p{ | ||
384 | + width: 100%; | ||
385 | +} | ||
386 | + | ||
387 | +.foot_box_text .img { | ||
388 | + line-height: 0; | ||
389 | +} | ||
390 | +.image { | ||
391 | + width: 400rpx; | ||
392 | + height: 200rpx; | ||
393 | +} | ||
394 | +.div_class{ | ||
395 | + width: 600rpx; | ||
396 | +} | ||
397 | + | ||
398 | +.num { | ||
399 | + color: #fb6451; | ||
400 | +} | ||
401 | + | ||
402 | +.lvip { | ||
403 | + left: 30rpx; | ||
404 | + bottom: -58rpx; | ||
405 | + width: 20rpx; | ||
406 | + height: 90rpx; | ||
407 | + z-index: 5; | ||
408 | +} | ||
409 | + | ||
410 | +.rvip { | ||
411 | + right: 30rpx; | ||
412 | + bottom: -58rpx; | ||
413 | + width: 20rpx; | ||
414 | + height: 90rpx; | ||
415 | + z-index: 5; | ||
416 | +} | ||
0 | \ No newline at end of file | 417 | \ No newline at end of file |
pages/giftpack/payment/payment.js
0 → 100644
1 | +var e = getApp(); | ||
2 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | ||
3 | +Page({ | ||
4 | + /** | ||
5 | + * 页面的初始数据 | ||
6 | + */ | ||
7 | + data: { | ||
8 | + url: e.globalData.setting.imghost, | ||
9 | + resourceUrl: e.globalData.setting.resourceUrl, | ||
10 | + iurl: e.globalData.setting.imghost, | ||
11 | + allmoney: 0, | ||
12 | + order_sn: "", | ||
13 | + }, | ||
14 | + | ||
15 | + /** | ||
16 | + * 生命周期函数--监听页面加载 | ||
17 | + */ | ||
18 | + onLoad: function (options) { | ||
19 | + wx.setNavigationBarTitle({ | ||
20 | + title: '支付成功', | ||
21 | + }); | ||
22 | + var money = parseFloat(options.money), order_sn = options.order_sn; | ||
23 | + this.setData({allmoney:money,order_sn:order_sn}) | ||
24 | + }, | ||
25 | + | ||
26 | + goto: function () { | ||
27 | + var url = '/pages/index/index/index'; | ||
28 | + getApp().goto(url) | ||
29 | + }, | ||
30 | +}) | ||
0 | \ No newline at end of file | 31 | \ No newline at end of file |
pages/giftpack/payment/payment.json
0 → 100644
pages/giftpack/payment/payment.wxml
0 → 100644
1 | +<wxs module="filters" src="../../../utils/filter.wxs"></wxs> | ||
2 | +<view> | ||
3 | + <!-- 支付成功提示 --> | ||
4 | + <view class="payradio"> | ||
5 | + <!-- 提示框 --> | ||
6 | + <view class="Success_box flex-center"> | ||
7 | + <view> | ||
8 | + <view class="flex-center"> | ||
9 | + <image src="{{url}}miniapp/images/pay/paysuccess.png"></image> | ||
10 | + </view> | ||
11 | + <view class="Success_box_title fs32">订单支付成功!</view> | ||
12 | + </view> | ||
13 | + </view> | ||
14 | + | ||
15 | + <!-- 支付信息 --> | ||
16 | + <view class="payitem_max fs28"> | ||
17 | + <!-- 订单编号 --> | ||
18 | + <view class="payitem flex"> | ||
19 | + <view>订单编号 :</view> | ||
20 | + <text selectable="true">{{order_sn}}</text> | ||
21 | + </view> | ||
22 | + | ||
23 | + <!-- 实付金额 --> | ||
24 | + <view class="payitem flex"> | ||
25 | + <view>实付金额 :</view> | ||
26 | + <!-- {{filters.toFix()}} --> | ||
27 | + <view class="pay_money">{{filters.toFix(allmoney,2)}}元</view> | ||
28 | + </view> | ||
29 | + | ||
30 | + <!-- 支付方式 --> | ||
31 | + <view class="payitem flex" wx:if="type==1"> | ||
32 | + <view>支付方式 :</view> | ||
33 | + <view>微信支付</view> | ||
34 | + </view> | ||
35 | + </view> | ||
36 | + </view> | ||
37 | + <view class="flex-level"> | ||
38 | + <view class="line"></view> | ||
39 | + </view> | ||
40 | + | ||
41 | + <!-- 跳转链接 --> | ||
42 | + <view> | ||
43 | + <!-- 链接 --> | ||
44 | + <view class="fs32"> | ||
45 | + <view class="flex-center"> | ||
46 | + <navigator class="pay_order flex-center" url="/pages/giftpack/mygiftpack/mygiftpack"> | ||
47 | + <view>我的礼包</view> | ||
48 | + </navigator> | ||
49 | + </view> | ||
50 | + <view class="flex-center"> | ||
51 | + <navigator class="pay_home flex-center" bindtap="goto"> | ||
52 | + <view>回到首页</view> | ||
53 | + </navigator> | ||
54 | + </view> | ||
55 | + </view> | ||
56 | + </view> | ||
57 | +</view> | ||
0 | \ No newline at end of file | 58 | \ No newline at end of file |
pages/giftpack/payment/payment.wxss
0 → 100644
1 | +page { | ||
2 | + border-top: 2rpx solid rgb(245, 245, 245); | ||
3 | +} | ||
4 | +.line { | ||
5 | + border-top: 2rpx solid rgb(245, 245, 245); | ||
6 | + width: 700rpx; | ||
7 | +} | ||
8 | + | ||
9 | +.payradio .Success_box { | ||
10 | + padding-top: 45rpx; | ||
11 | + padding-bottom: 45rpx; | ||
12 | +} | ||
13 | + | ||
14 | +.payradio .Success_box .Success_box_title { | ||
15 | + margin-top: 45rpx; | ||
16 | + color: rgb(8, 8, 8); | ||
17 | +} | ||
18 | + | ||
19 | +.payradio image { | ||
20 | + width: 140rpx; | ||
21 | + height: 140rpx; | ||
22 | + display: flex; | ||
23 | +} | ||
24 | + | ||
25 | +.payitem_max { | ||
26 | + padding: 0rpx 55rpx; | ||
27 | + color: rgb(104, 104, 104); | ||
28 | + padding-bottom: 30rpx; | ||
29 | +} | ||
30 | + | ||
31 | +.payitem_max .payitem { | ||
32 | + margin-top: 30rpx; | ||
33 | +} | ||
34 | + | ||
35 | +.payitem_max .payitem .pay_nam { | ||
36 | + width: 200rpx; | ||
37 | +} | ||
38 | + | ||
39 | +.payitem_max .payitem view { | ||
40 | + margin-right: 50rpx; | ||
41 | +} | ||
42 | +.pay_money{ | ||
43 | + color: rgb(219, 27, 52); | ||
44 | +} | ||
45 | + | ||
46 | +.pay_User { | ||
47 | + padding-left: 55rpx; | ||
48 | + color: rgb(104, 104, 104); | ||
49 | +} | ||
50 | + | ||
51 | +.pay_User .payitem { | ||
52 | + margin-top: 30rpx; | ||
53 | +} | ||
54 | + | ||
55 | +.pay_User .payitem .pay_Receiving { | ||
56 | + width: 128rpx; | ||
57 | + margin-right: 50rpx; | ||
58 | +} | ||
59 | + | ||
60 | +.pay_User .payitem .pay_name { | ||
61 | + margin-right: 38rpx; | ||
62 | + max-width: 250rpx; | ||
63 | +} | ||
64 | + | ||
65 | +.pay_order { | ||
66 | + margin-top: 115rpx; | ||
67 | + color: rgb(104, 104, 104); | ||
68 | + width: 560rpx; | ||
69 | + height: 62rpx; | ||
70 | + border-radius: 30rpx; | ||
71 | + border: 3rpx solid rgb(209, 209, 209); | ||
72 | +} | ||
73 | + | ||
74 | +.pay_home { | ||
75 | + margin-top: 35rpx; | ||
76 | + color: rgb(255, 255, 255); | ||
77 | + width: 566rpx; | ||
78 | + height: 68rpx; | ||
79 | + border-radius: 30rpx; | ||
80 | + background-color: rgb(219, 27, 52); | ||
81 | +} | ||
82 | +.address{ | ||
83 | + width: 470rpx; | ||
84 | +} | ||
0 | \ No newline at end of file | 85 | \ No newline at end of file |
pages/goods/categoryList/categoryList.wxss
@@ -81,14 +81,22 @@ swiper{ | @@ -81,14 +81,22 @@ swiper{ | ||
81 | .f_item .pic_view{position: relative; height: 240rpx;} | 81 | .f_item .pic_view{position: relative; height: 240rpx;} |
82 | 82 | ||
83 | .fl_img{width: 100%; height: 100%;} | 83 | .fl_img{width: 100%; height: 100%;} |
84 | -.fenlei_text_v{text-align: left; margin-bottom: 15rpx; margin-top: 5rpx} | 84 | +.fenlei_text_v{text-align: left; margin-bottom: 10rpx; margin-top: 15rpx} |
85 | .over_view{width: 100%; height: 100%; position: absolute;top: 0; left: 0; background-color: rgba(0,0,0,0.1);} | 85 | .over_view{width: 100%; height: 100%; position: absolute;top: 0; left: 0; background-color: rgba(0,0,0,0.1);} |
86 | .f_item_over_t{margin: 0 auto; position: absolute; top:80rpx;left: 50%; color: #fff; font-weight: bold; | 86 | .f_item_over_t{margin: 0 auto; position: absolute; top:80rpx;left: 50%; color: #fff; font-weight: bold; |
87 | 87 | ||
88 | 88 | ||
89 | margin-left: -100rpx; z-index: 8; width: 200rpx; text-align: center; font-size: 50rpx } | 89 | margin-left: -100rpx; z-index: 8; width: 200rpx; text-align: center; font-size: 50rpx } |
90 | -.f_text{width: 25%; text-align: center; display: inline-block; font-size: 30rpx; margin-bottom: 15rpx;color: #9f9f9f; | ||
91 | -overflow: hidden; text-overflow: ellipsis; white-space: nowrap; | 90 | +.f_text{width: 25%; |
91 | +text-align: center; | ||
92 | +display: inline-block; | ||
93 | +font-size: 30rpx; | ||
94 | +color: #9f9f9f; | ||
95 | +overflow: hidden; | ||
96 | +text-overflow: ellipsis; | ||
97 | +white-space: nowrap; | ||
98 | +line-height: 50rpx; | ||
99 | + | ||
92 | } | 100 | } |
93 | 101 | ||
94 | /*--国家--*/ | 102 | /*--国家--*/ |
pages/goods/goodsInfo/goodsInfo.js
@@ -1335,6 +1335,12 @@ Page({ | @@ -1335,6 +1335,12 @@ Page({ | ||
1335 | }).then(res => { | 1335 | }).then(res => { |
1336 | var e = res; | 1336 | var e = res; |
1337 | if (e.data.code == 0) { | 1337 | if (e.data.code == 0) { |
1338 | + | ||
1339 | + //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店 | ||
1340 | + if(dd.lat && !th.data.def_pick_store){ | ||
1341 | + th.setData({def_pick_store:e.data.data.pageData[0]}); | ||
1342 | + } | ||
1343 | + | ||
1338 | //-- 如果有默认选择门店的时候,要把默认门店放在第一位 -- | 1344 | //-- 如果有默认选择门店的时候,要把默认门店放在第一位 -- |
1339 | if (th.data.def_pick_store) { | 1345 | if (th.data.def_pick_store) { |
1340 | for (var k = 0; k < e.data.data.pageData.length; k++) { | 1346 | for (var k = 0; k < e.data.data.pageData.length; k++) { |
@@ -1348,7 +1354,7 @@ Page({ | @@ -1348,7 +1354,7 @@ Page({ | ||
1348 | 1354 | ||
1349 | //单总量超出5个的时候 | 1355 | //单总量超出5个的时候 |
1350 | if (e.data.data.total > 5) { | 1356 | if (e.data.data.total > 5) { |
1351 | - i.get("/api/weshop/storagecategory/page", { | 1357 | + i.get("/api/weshop/storagecategory/page", { |
1352 | data: { | 1358 | data: { |
1353 | store_id: o.stoid, | 1359 | store_id: o.stoid, |
1354 | is_show: 1, | 1360 | is_show: 1, |
@@ -1356,7 +1362,7 @@ Page({ | @@ -1356,7 +1362,7 @@ Page({ | ||
1356 | }, | 1362 | }, |
1357 | success: function(ee) { | 1363 | success: function(ee) { |
1358 | if (ee.data.code == 0) { | 1364 | if (ee.data.code == 0) { |
1359 | - if (ee.data.data.pageData.length > 0) { | 1365 | + if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0) { |
1360 | var def_arr = new Array(); | 1366 | var def_arr = new Array(); |
1361 | var ishas = 0; | 1367 | var ishas = 0; |
1362 | //-- 开始就看5个门店 -- | 1368 | //-- 开始就看5个门店 -- |
@@ -1443,16 +1449,25 @@ Page({ | @@ -1443,16 +1449,25 @@ Page({ | ||
1443 | }); | 1449 | }); |
1444 | 1450 | ||
1445 | } else { | 1451 | } else { |
1446 | - th.setData({ | ||
1447 | - is_show_sto_cat: -1, | ||
1448 | - only_pk: e.data.data.pageData | ||
1449 | - }); | 1452 | + th.setData({ |
1453 | + is_show_sto_cat: -1, | ||
1454 | + only_pk: e.data.data.pageData | ||
1455 | + }); | ||
1456 | + //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------ | ||
1457 | + if (!th.data.def_pick_store) { | ||
1458 | + th.setData({def_pick_store:e.data.data.pageData[0]}) | ||
1459 | + } | ||
1450 | } | 1460 | } |
1451 | } else { | 1461 | } else { |
1452 | th.setData({ | 1462 | th.setData({ |
1453 | is_show_sto_cat: -1, | 1463 | is_show_sto_cat: -1, |
1454 | only_pk: e.data.data.pageData | 1464 | only_pk: e.data.data.pageData |
1455 | }); | 1465 | }); |
1466 | + //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------ | ||
1467 | + if (!th.data.def_pick_store) { | ||
1468 | + th.setData({def_pick_store:e.data.data.pageData[0]}) | ||
1469 | + } | ||
1470 | + | ||
1456 | } | 1471 | } |
1457 | } | 1472 | } |
1458 | }); | 1473 | }); |
@@ -1461,6 +1476,10 @@ Page({ | @@ -1461,6 +1476,10 @@ Page({ | ||
1461 | is_show_sto_cat: 0, | 1476 | is_show_sto_cat: 0, |
1462 | only_pk: e.data.data.pageData | 1477 | only_pk: e.data.data.pageData |
1463 | }); | 1478 | }); |
1479 | + //-----如果没有默认门店,要取第一个门店作为默认店------ | ||
1480 | + if (!th.data.def_pick_store) { | ||
1481 | + th.setData({def_pick_store:e.data.data.pageData[0]}) | ||
1482 | + } | ||
1464 | } | 1483 | } |
1465 | } | 1484 | } |
1466 | }) | 1485 | }) |
pages/index/index/index.js
1 | -var e = function (e) { | 1 | +var e = function(e) { |
2 | return e && e.__esModule ? e : { | 2 | return e && e.__esModule ? e : { |
3 | - default: e | 3 | + default: e |
4 | }; | 4 | }; |
5 | - }(require("../../../utils/LoadMore.js")), t = getApp(), a = t.request, o = t.globalData.setting, os = o, | ||
6 | - i = require("../../../utils/util.js"), ut = i, s = require("../../../utils/common.js"), n = new e.default(); | 5 | + }(require("../../../utils/LoadMore.js")), |
6 | + t = getApp(), | ||
7 | + a = t.request, | ||
8 | + o = t.globalData.setting, | ||
9 | + os = o, | ||
10 | + i = require("../../../utils/util.js"), | ||
11 | + ut = i, | ||
12 | + s = require("../../../utils/common.js"), | ||
13 | + n = new e.default(); | ||
7 | var regeneratorRuntime = require('../../../utils/runtime.js'); | 14 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
8 | var api = require('../../../api/api.js'); | 15 | var api = require('../../../api/api.js'); |
9 | var d = getApp().globalData; | 16 | var d = getApp().globalData; |
10 | - | 17 | + |
11 | Page({ | 18 | Page({ |
12 | data: { | 19 | data: { |
13 | url: o.imghost, | 20 | url: o.imghost, |
14 | - swiperimage: ["/miniapp/images/title.png"],//,"/miniapp/images/newpeople/newpeople.png" | 21 | + swiperimage: [{ |
22 | + image: "/miniapp/images/title.png", | ||
23 | + nav_url: 0 | ||
24 | + }], | ||
15 | resourceUrl: o.resourceUrl, | 25 | resourceUrl: o.resourceUrl, |
16 | logo: o.appLogo, | 26 | logo: o.appLogo, |
17 | homeData: null, | 27 | homeData: null, |
@@ -32,69 +42,78 @@ Page({ | @@ -32,69 +42,78 @@ Page({ | ||
32 | banner: null, | 42 | banner: null, |
33 | 43 | ||
34 | appdata: null, | 44 | appdata: null, |
35 | - saleGoods: null,//秒杀数据 | ||
36 | - pindGoods: null,//拼单数据 | ||
37 | - newGoods:null,//新商品 | ||
38 | - hotGoods:null,//hot商品 | 45 | + saleGoods: null, //秒杀数据 |
46 | + pindGoods: null, //拼单数据 | ||
47 | + newGoods: null, //新商品 | ||
48 | + hotGoods: null, //hot商品 | ||
39 | //----控制是是否显示计时器--- | 49 | //----控制是是否显示计时器--- |
40 | - is_timer:1, | ||
41 | - ishow:0, | 50 | + is_timer: 1, |
51 | + ishow: 0, | ||
42 | //是不是显示自定义模板 | 52 | //是不是显示自定义模板 |
43 | - isTemplate:0, | ||
44 | - template_arr:null, | ||
45 | - bgcolor_t:'', | ||
46 | - | ||
47 | - banner_index:0, | ||
48 | - flash_index:0, | ||
49 | - pt_index:0, | ||
50 | - | ||
51 | - pt_timer_item:null, | ||
52 | - pt_timer_arr:null, | ||
53 | - pt_timer:null, | ||
54 | - pt_timer_active:0, | 53 | + isTemplate: 0, |
54 | + template_arr: null, | ||
55 | + bgcolor_t: '', | ||
56 | + | ||
57 | + banner_index: 0, | ||
58 | + flash_index: 0, | ||
59 | + pt_index: 0, | ||
60 | + | ||
61 | + pt_timer_item: null, | ||
62 | + pt_timer_arr: null, | ||
63 | + pt_timer: null, | ||
64 | + pt_timer_active: 0, | ||
55 | //看下商家是否开通会员权益 | 65 | //看下商家是否开通会员权益 |
56 | - is_boot:0, | ||
57 | - gd_category:null, | ||
58 | - is_no_more:0, | ||
59 | - max_sw_height:0, //banner的最大高度 | ||
60 | - is_disgraceful:0,//是否显示新人广告 | 66 | + is_boot: 0, |
67 | + gd_category: null, | ||
68 | + is_no_more: 0, | ||
69 | + max_sw_height: 0, //banner的最大高度 | ||
70 | + is_disgraceful: 0, //是否显示新人广告 | ||
71 | + new_image: "", //新人有礼弹窗图片 | ||
72 | + new_nav: "", //新人页面跳转地址 | ||
73 | + | ||
61 | }, | 74 | }, |
62 | 75 | ||
63 | - onLoad: function () { | 76 | + onLoad: function() { |
64 | var th = this; | 77 | var th = this; |
65 | - // n.init(th, "", "recommend"); | ||
66 | 78 | ||
67 | //看一下商家是否开通了权益 | 79 | //看一下商家是否开通了权益 |
68 | //--初始化是否有打勾-- | 80 | //--初始化是否有打勾-- |
69 | getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", { | 81 | getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", { |
70 | - data: { storeId: os.stoid } | 82 | + data: { |
83 | + storeId: os.stoid | ||
84 | + } | ||
71 | }).then(res => { | 85 | }).then(res => { |
72 | if (res.data.data) { | 86 | if (res.data.data) { |
73 | var is_init = res.data.data.isBool; | 87 | var is_init = res.data.data.isBool; |
74 | - th.setData({ is_boot: is_init }); | 88 | + th.setData({ |
89 | + is_boot: is_init | ||
90 | + }); | ||
75 | } | 91 | } |
76 | }) | 92 | }) |
77 | - th.is_new(); | 93 | + // th.is_festival(); |
78 | 94 | ||
79 | }, | 95 | }, |
80 | //关闭新用户领取广告 | 96 | //关闭新用户领取广告 |
81 | - close_disgraceful:function(){ | 97 | + close_disgraceful: function() { |
82 | var th = this; | 98 | var th = this; |
83 | - th.setData({ | ||
84 | - is_disgraceful:0 | ||
85 | - }) | 99 | + th.setData({ |
100 | + is_disgraceful: 0 | ||
101 | + }) | ||
86 | }, | 102 | }, |
87 | async onShow() { | 103 | async onShow() { |
88 | var th = this; | 104 | var th = this; |
89 | - if(getApp().globalData.user_id) getApp().requestCardNum(); | 105 | + var new_nav = th.data.new_nav; |
106 | + if (new_nav == "") { | ||
107 | + th.is_new(); | ||
108 | + } | ||
109 | + if (getApp().globalData.user_id) getApp().requestCardNum(); | ||
90 | await this.init_load(); | 110 | await this.init_load(); |
91 | //显示的时候要开启计时器 | 111 | //显示的时候要开启计时器 |
92 | this.data.is_timer = 1; | 112 | this.data.is_timer = 1; |
93 | //如果是自定义模板 | 113 | //如果是自定义模板 |
94 | if (this.data.isTemplate) { | 114 | if (this.data.isTemplate) { |
95 | //---先获取会员--- | 115 | //---先获取会员--- |
96 | - t.getUserFir(function () { | ||
97 | - }); | 116 | + t.getUserFir(function() {}); |
98 | } else { | 117 | } else { |
99 | await this.init_fir(); | 118 | await this.init_fir(); |
100 | } | 119 | } |
@@ -109,7 +128,9 @@ Page({ | @@ -109,7 +128,9 @@ Page({ | ||
109 | if (th.data.pt_timer_arr && th.data.pt_timer_arr.length > 0) { | 128 | if (th.data.pt_timer_arr && th.data.pt_timer_arr.length > 0) { |
110 | for (var i in th.data.pt_timer_arr) { | 129 | for (var i in th.data.pt_timer_arr) { |
111 | var p_item = th.data.pt_timer_arr[i]; | 130 | var p_item = th.data.pt_timer_arr[i]; |
112 | - await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + p_item.user_id, {1: 1}).then(res => { | 131 | + await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + p_item.user_id, { |
132 | + 1: 1 | ||
133 | + }).then(res => { | ||
113 | th.data.pt_timer_arr[i].head_pic = res.data.data.head_pic; | 134 | th.data.pt_timer_arr[i].head_pic = res.data.data.head_pic; |
114 | th.data.pt_timer_arr[i].nickname = res.data.data.nickname; | 135 | th.data.pt_timer_arr[i].nickname = res.data.data.nickname; |
115 | }) | 136 | }) |
@@ -119,51 +140,61 @@ Page({ | @@ -119,51 +140,61 @@ Page({ | ||
119 | 140 | ||
120 | //---处理正在6个分类---- | 141 | //---处理正在6个分类---- |
121 | await getApp().request.promiseGet("/api/weshop/goodscategory/page", { | 142 | await getApp().request.promiseGet("/api/weshop/goodscategory/page", { |
122 | - data: {store_id: os.stoid, pageSize: 5,is_show:1} | 143 | + data: { |
144 | + store_id: os.stoid, | ||
145 | + pageSize: 5, | ||
146 | + is_show: 1 | ||
147 | + } | ||
123 | }).then(res => { | 148 | }).then(res => { |
124 | - if(res.data.data) { | ||
125 | - var gd_category = res.data.data.pageData; | ||
126 | - | ||
127 | - th.setData({gd_category: gd_category}); | 149 | + if (res.data.data) { |
150 | + var gd_category = res.data.data.pageData; | ||
151 | + | ||
152 | + th.setData({ | ||
153 | + gd_category: gd_category | ||
154 | + }); | ||
128 | } | 155 | } |
129 | }) | 156 | }) |
130 | }, | 157 | }, |
131 | - | 158 | + |
132 | //当隐藏的时候就关闭计时器 | 159 | //当隐藏的时候就关闭计时器 |
133 | - onHide:function(){ | ||
134 | - this.data.is_timer=0; | 160 | + onHide: function() { |
161 | + this.data.is_timer = 0; | ||
135 | clearInterval(this.data.pt_timer) | 162 | clearInterval(this.data.pt_timer) |
136 | }, | 163 | }, |
137 | 164 | ||
138 | //同步初始加载 | 165 | //同步初始加载 |
139 | - async init_load(){ | ||
140 | - var th=this; | ||
141 | - await getApp().get_isbuy(); | ||
142 | - this.setappdata(getApp().globalData.wxapp_buy_obj); | ||
143 | - await getApp().getConfig_ays(); | ||
144 | - | ||
145 | - //因为营销版本的功能包含了自定义模板的功能,是同时的 | ||
146 | - //读取全局是否有弄自定义模板 | ||
147 | - await api.get_template_fir(o.stoid).then(res=>{ | ||
148 | - var data=res.data.data; | ||
149 | - if(data.length>0){ | ||
150 | - var temp_data=data[0]; | ||
151 | - var t_arr=JSON.parse(temp_data.json_str); | ||
152 | - th.setData({ template_arr: t_arr, isTemplate: 1, bgcolor_t: temp_data.bkcolor}); | ||
153 | - } | ||
154 | - }) | ||
155 | - | ||
156 | - | ||
157 | - //--首页的问题-- | ||
158 | - if(getApp().globalData.config && getApp().globalData.config.store_name!=undefined && getApp().globalData.config.store_name!=null ){ | ||
159 | - wx.setNavigationBarTitle({ | ||
160 | - title: getApp().globalData.config.store_name, | ||
161 | - }); | ||
162 | - }else{ | ||
163 | - wx.setNavigationBarTitle({ | ||
164 | - title: getApp().globalData.setting.appName, | ||
165 | - }); | 166 | + async init_load() { |
167 | + var th = this; | ||
168 | + await getApp().get_isbuy(); | ||
169 | + this.setappdata(getApp().globalData.wxapp_buy_obj); | ||
170 | + await getApp().getConfig_ays(); | ||
171 | + | ||
172 | + //因为营销版本的功能包含了自定义模板的功能,是同时的 | ||
173 | + //读取全局是否有弄自定义模板 | ||
174 | + await api.get_template_fir(o.stoid).then(res => { | ||
175 | + var data = res.data.data; | ||
176 | + if (data.length > 0) { | ||
177 | + var temp_data = data[0]; | ||
178 | + var t_arr = JSON.parse(temp_data.json_str); | ||
179 | + th.setData({ | ||
180 | + template_arr: t_arr, | ||
181 | + isTemplate: 1, | ||
182 | + bgcolor_t: temp_data.bkcolor | ||
183 | + }); | ||
166 | } | 184 | } |
185 | + }) | ||
186 | + | ||
187 | + | ||
188 | + //--首页的问题-- | ||
189 | + if (getApp().globalData.config && getApp().globalData.config.store_name != undefined && getApp().globalData.config.store_name != null) { | ||
190 | + wx.setNavigationBarTitle({ | ||
191 | + title: getApp().globalData.config.store_name, | ||
192 | + }); | ||
193 | + } else { | ||
194 | + wx.setNavigationBarTitle({ | ||
195 | + title: getApp().globalData.setting.appName, | ||
196 | + }); | ||
197 | + } | ||
167 | }, | 198 | }, |
168 | 199 | ||
169 | //---读取数据内容--- | 200 | //---读取数据内容--- |
@@ -172,16 +203,23 @@ Page({ | @@ -172,16 +203,23 @@ Page({ | ||
172 | //----广告---- | 203 | //----广告---- |
173 | var e = this; | 204 | var e = this; |
174 | await getApp().request.promiseGet("/api/weshop/ad/list?pid=2&store_id=" + o.stoid, { | 205 | await getApp().request.promiseGet("/api/weshop/ad/list?pid=2&store_id=" + o.stoid, { |
175 | - data:{enabled:1} | ||
176 | - }).then(res=>{ | 206 | + data: { |
207 | + enabled: 1 | ||
208 | + } | ||
209 | + }).then(res => { | ||
177 | var a = res.data.data; | 210 | var a = res.data.data; |
178 | var arr = new Array(); | 211 | var arr = new Array(); |
179 | for (var i = 0; i < a.length; i++) { | 212 | for (var i = 0; i < a.length; i++) { |
180 | - var tt = { 'ad_code': o.imghost + a[i].ad_code, 'media_link': '' }; | 213 | + var tt = { |
214 | + 'ad_code': o.imghost + a[i].ad_code, | ||
215 | + 'media_link': '' | ||
216 | + }; | ||
181 | arr.push(tt); | 217 | arr.push(tt); |
182 | } | 218 | } |
183 | - if (arr.length>0) e.setData({ banner: arr, }); | ||
184 | - | 219 | + if (arr.length > 0) e.setData({ |
220 | + banner: arr, | ||
221 | + }); | ||
222 | + | ||
185 | wx.stopPullDownRefresh(); | 223 | wx.stopPullDownRefresh(); |
186 | }) | 224 | }) |
187 | 225 | ||
@@ -202,20 +240,20 @@ Page({ | @@ -202,20 +240,20 @@ Page({ | ||
202 | flash_data = e.data.data.pageData; | 240 | flash_data = e.data.data.pageData; |
203 | if (flash_data == null || flash_data.length <= 0) return false; | 241 | if (flash_data == null || flash_data.length <= 0) return false; |
204 | 242 | ||
205 | - | 243 | + |
206 | //当前时间戳 | 244 | //当前时间戳 |
207 | var nt = ut.gettimestamp(); | 245 | var nt = ut.gettimestamp(); |
208 | 246 | ||
209 | - flash_data.forEach(function (val,ind) { | ||
210 | - if(val.start_time>nt) flash_data[ind].status=0; | ||
211 | - else if(val.end_time>nt) flash_data[ind].status=1; | ||
212 | - if(val.buy_num>=val.goods_num) flash_data[ind].status=2; | 247 | + flash_data.forEach(function(val, ind) { |
248 | + if (val.start_time > nt) flash_data[ind].status = 0; | ||
249 | + else if (val.end_time > nt) flash_data[ind].status = 1; | ||
250 | + if (val.buy_num >= val.goods_num) flash_data[ind].status = 2; | ||
213 | }); | 251 | }); |
214 | 252 | ||
215 | var arr = new Array(); | 253 | var arr = new Array(); |
216 | //--三个三个一组--- | 254 | //--三个三个一组--- |
217 | - for(var i=0;i< flash_data.length;i+=3){ | ||
218 | - arr.push(flash_data.slice(i,i+3)); | 255 | + for (var i = 0; i < flash_data.length; i += 3) { |
256 | + arr.push(flash_data.slice(i, i + 3)); | ||
219 | } | 257 | } |
220 | th.setData({ | 258 | th.setData({ |
221 | saleGoods: arr | 259 | saleGoods: arr |
@@ -236,35 +274,35 @@ Page({ | @@ -236,35 +274,35 @@ Page({ | ||
236 | var e = res; | 274 | var e = res; |
237 | if (e.data.code == 0) { | 275 | if (e.data.code == 0) { |
238 | var pd_data = e.data.data.pageData; | 276 | var pd_data = e.data.data.pageData; |
239 | - | 277 | + |
240 | if (pd_data.length == 0) return; | 278 | if (pd_data.length == 0) return; |
241 | - | 279 | + |
242 | //获取当前 | 280 | //获取当前 |
243 | var nt = ut.gettimestamp(); | 281 | var nt = ut.gettimestamp(); |
244 | - pd_data.forEach(function (val,ind) { | ||
245 | - if(val.start_time>nt) pd_data[ind].status=0; | ||
246 | - else if(val.end_time>nt) pd_data[ind].status=1; | ||
247 | - if(val.buy_num>=val.goods_num) pd_data[ind].status=2; | 282 | + pd_data.forEach(function(val, ind) { |
283 | + if (val.start_time > nt) pd_data[ind].status = 0; | ||
284 | + else if (val.end_time > nt) pd_data[ind].status = 1; | ||
285 | + if (val.buy_num >= val.goods_num) pd_data[ind].status = 2; | ||
248 | }); | 286 | }); |
249 | - | ||
250 | - //获取当前时间,比较拼团中还在未开始 | 287 | + |
288 | + //获取当前时间,比较拼团中还在未开始 | ||
251 | var timestamp = new Date().getTime(); | 289 | var timestamp = new Date().getTime(); |
252 | var is_team_tepy; | 290 | var is_team_tepy; |
253 | - for (var j = 0; j < pd_data.length;j++ ){ | 291 | + for (var j = 0; j < pd_data.length; j++) { |
254 | pd_data[j].is_team_tepy = 1; | 292 | pd_data[j].is_team_tepy = 1; |
255 | - if (timestamp<pd_data[j].start_time*1000){ | 293 | + if (timestamp < pd_data[j].start_time * 1000) { |
256 | var is_team_tepy; | 294 | var is_team_tepy; |
257 | pd_data[j].is_team_tepy = 0; | 295 | pd_data[j].is_team_tepy = 0; |
258 | - } | 296 | + } |
259 | } | 297 | } |
260 | - | 298 | + |
261 | var arr = new Array(); | 299 | var arr = new Array(); |
262 | //--2个2个一组--- | 300 | //--2个2个一组--- |
263 | - for(var i=0;i< pd_data.length;i+=2){ | ||
264 | - | ||
265 | - arr.push(pd_data.slice(i,i+2)); | 301 | + for (var i = 0; i < pd_data.length; i += 2) { |
302 | + | ||
303 | + arr.push(pd_data.slice(i, i + 2)); | ||
266 | } | 304 | } |
267 | - | 305 | + |
268 | th.setData({ | 306 | th.setData({ |
269 | pindGoods: arr | 307 | pindGoods: arr |
270 | }); | 308 | }); |
@@ -275,7 +313,13 @@ Page({ | @@ -275,7 +313,13 @@ Page({ | ||
275 | //------新品------- | 313 | //------新品------- |
276 | await getApp().request.promiseGet("/api/weshop/goods/page?page=1", { | 314 | await getApp().request.promiseGet("/api/weshop/goods/page?page=1", { |
277 | data: { | 315 | data: { |
278 | - is_mainshow: 1, isonsale: 1, is_on_sale: 1, store_id: o.stoid, pageSize: 9,is_new:1,orderField:"sort" | 316 | + is_mainshow: 1, |
317 | + isonsale: 1, | ||
318 | + is_on_sale: 1, | ||
319 | + store_id: o.stoid, | ||
320 | + pageSize: 9, | ||
321 | + is_new: 1, | ||
322 | + orderField: "sort" | ||
279 | } | 323 | } |
280 | }).then(res => { | 324 | }).then(res => { |
281 | var e = res; | 325 | var e = res; |
@@ -283,8 +327,8 @@ Page({ | @@ -283,8 +327,8 @@ Page({ | ||
283 | var new_data = e.data.data.pageData; | 327 | var new_data = e.data.data.pageData; |
284 | var arr = new Array(); | 328 | var arr = new Array(); |
285 | //--三个三个一组--- | 329 | //--三个三个一组--- |
286 | - for(var i=0;i< new_data.length;i+=3){ | ||
287 | - arr.push(new_data.slice(i,i+3)); | 330 | + for (var i = 0; i < new_data.length; i += 3) { |
331 | + arr.push(new_data.slice(i, i + 3)); | ||
288 | } | 332 | } |
289 | th.setData({ | 333 | th.setData({ |
290 | newGoods: arr, | 334 | newGoods: arr, |
@@ -295,7 +339,13 @@ Page({ | @@ -295,7 +339,13 @@ Page({ | ||
295 | //------热卖------- | 339 | //------热卖------- |
296 | await getApp().request.promiseGet("/api/weshop/goods/page?page=1", { | 340 | await getApp().request.promiseGet("/api/weshop/goods/page?page=1", { |
297 | data: { | 341 | data: { |
298 | - is_mainshow: 1, isonsale: 1, is_on_sale: 1, store_id: o.stoid, pageSize: 9,is_hot:1,orderField:"sort" | 342 | + is_mainshow: 1, |
343 | + isonsale: 1, | ||
344 | + is_on_sale: 1, | ||
345 | + store_id: o.stoid, | ||
346 | + pageSize: 9, | ||
347 | + is_hot: 1, | ||
348 | + orderField: "sort" | ||
299 | } | 349 | } |
300 | }).then(res => { | 350 | }).then(res => { |
301 | var e = res; | 351 | var e = res; |
@@ -303,8 +353,8 @@ Page({ | @@ -303,8 +353,8 @@ Page({ | ||
303 | var new_data = e.data.data.pageData; | 353 | var new_data = e.data.data.pageData; |
304 | var arr = new Array(); | 354 | var arr = new Array(); |
305 | //--三个三个一组--- | 355 | //--三个三个一组--- |
306 | - for(var i=0;i< new_data.length;i+=3){ | ||
307 | - arr.push(new_data.slice(i,i+3)); | 356 | + for (var i = 0; i < new_data.length; i += 3) { |
357 | + arr.push(new_data.slice(i, i + 3)); | ||
308 | } | 358 | } |
309 | th.setData({ | 359 | th.setData({ |
310 | hotGoods: arr, | 360 | hotGoods: arr, |
@@ -313,18 +363,22 @@ Page({ | @@ -313,18 +363,22 @@ Page({ | ||
313 | }) | 363 | }) |
314 | //---调用信息--- | 364 | //---调用信息--- |
315 | // this.requestRecommend(); | 365 | // this.requestRecommend(); |
316 | - this.setData({ishow:1}); | 366 | + this.setData({ |
367 | + ishow: 1 | ||
368 | + }); | ||
317 | //---先获取会员--- | 369 | //---先获取会员--- |
318 | - t.getUserFir(function () { | 370 | + t.getUserFir(function() { |
319 | 371 | ||
320 | }); | 372 | }); |
321 | var goods_list = this.selectComponent("#goods_list"); //组件的id | 373 | var goods_list = this.selectComponent("#goods_list"); //组件的id |
322 | goods_list.init(); | 374 | goods_list.init(); |
323 | - setTimeout(function () { goods_list.get_list();},300) | 375 | + setTimeout(function() { |
376 | + goods_list.get_list(); | ||
377 | + }, 300) | ||
324 | }, | 378 | }, |
325 | 379 | ||
326 | //--判断小程序是否过期-- | 380 | //--判断小程序是否过期-- |
327 | - setappdata: function (t) { | 381 | + setappdata: function(t) { |
328 | if (t.isout == 1) | 382 | if (t.isout == 1) |
329 | wx.navigateTo({ | 383 | wx.navigateTo({ |
330 | url: "/pages/error/error?msg=小程序已经过期", | 384 | url: "/pages/error/error?msg=小程序已经过期", |
@@ -335,40 +389,42 @@ Page({ | @@ -335,40 +389,42 @@ Page({ | ||
335 | }); | 389 | }); |
336 | }, | 390 | }, |
337 | //---加载更多是靠这个函数---- | 391 | //---加载更多是靠这个函数---- |
338 | - onReachBottom: function () { | 392 | + onReachBottom: function() { |
339 | var goods_list = this.selectComponent("#goods_list"); //组件的id | 393 | var goods_list = this.selectComponent("#goods_list"); //组件的id |
340 | - if(goods_list) goods_list.get_list(); | 394 | + if (goods_list) goods_list.get_list(); |
341 | }, | 395 | }, |
342 | 396 | ||
343 | 397 | ||
344 | 398 | ||
345 | - onPullDownRefresh: function (e) { | 399 | + onPullDownRefresh: function(e) { |
346 | this.data.recommend = null, this.data.currentPage = 1, n.resetConfig(), this.requestHomePage(), | 400 | this.data.recommend = null, this.data.currentPage = 1, n.resetConfig(), this.requestHomePage(), |
347 | this.requestRecommend(); | 401 | this.requestRecommend(); |
348 | }, | 402 | }, |
349 | - onUnload: function () { | 403 | + onUnload: function() { |
350 | this.destroyActivityTimer(); | 404 | this.destroyActivityTimer(); |
351 | }, | 405 | }, |
352 | - setCountTime: function (e) { | 406 | + setCountTime: function(e) { |
353 | e.diffTime || (e.diffTime = new Date().getTime() - 1e3 * e.server_time), this.setData({ | 407 | e.diffTime || (e.diffTime = new Date().getTime() - 1e3 * e.server_time), this.setData({ |
354 | "sale.diffTime": e.diffTime | 408 | "sale.diffTime": e.diffTime |
355 | }), this.setData({ | 409 | }), this.setData({ |
356 | "sale.good": e.flash_sale_goods[0] | 410 | "sale.good": e.flash_sale_goods[0] |
357 | }), this.destroyActivityTimer(), this.createActivityTimer(); | 411 | }), this.destroyActivityTimer(), this.createActivityTimer(); |
358 | }, | 412 | }, |
359 | - createActivityTimer: function () { | ||
360 | - var e = this.data.sale, t = this; | ||
361 | - this.data.timer = setInterval(function () { | ||
362 | - var a = 1e3 * e.good.end_time - new Date().getTime() + e.diffTime, o = i.transTime(a); | 413 | + createActivityTimer: function() { |
414 | + var e = this.data.sale, | ||
415 | + t = this; | ||
416 | + this.data.timer = setInterval(function() { | ||
417 | + var a = 1e3 * e.good.end_time - new Date().getTime() + e.diffTime, | ||
418 | + o = i.transTime(a); | ||
363 | a <= 0 ? t.requestHomePage() : t.setData({ | 419 | a <= 0 ? t.requestHomePage() : t.setData({ |
364 | "sale.countTime": o | 420 | "sale.countTime": o |
365 | }); | 421 | }); |
366 | }, 1e3); | 422 | }, 1e3); |
367 | }, | 423 | }, |
368 | - destroyActivityTimer: function () { | 424 | + destroyActivityTimer: function() { |
369 | this.data.timer && (clearInterval(this.data.timer), this.data.timer = null); | 425 | this.data.timer && (clearInterval(this.data.timer), this.data.timer = null); |
370 | }, | 426 | }, |
371 | - onPageScroll: function (e) { | 427 | + onPageScroll: function(e) { |
372 | this.setData({ | 428 | this.setData({ |
373 | scrollTop: e.scrollTop | 429 | scrollTop: e.scrollTop |
374 | }); | 430 | }); |
@@ -384,34 +440,34 @@ Page({ | @@ -384,34 +440,34 @@ Page({ | ||
384 | }));--*/ | 440 | }));--*/ |
385 | 441 | ||
386 | }, | 442 | }, |
387 | - jumpSearch: function () { | 443 | + jumpSearch: function() { |
388 | wx.navigateTo({ | 444 | wx.navigateTo({ |
389 | url: "/pages/goods/search/search" | 445 | url: "/pages/goods/search/search" |
390 | }); | 446 | }); |
391 | }, | 447 | }, |
392 | - onShareAppMessage: function (e) { | 448 | + onShareAppMessage: function(e) { |
393 | return o.share; | 449 | return o.share; |
394 | }, | 450 | }, |
395 | 451 | ||
396 | //图片失败,默认图片 | 452 | //图片失败,默认图片 |
397 | - bind_bnerr: function (e) { | 453 | + bind_bnerr: function(e) { |
398 | var _errImg = e.target.dataset.errorimg; | 454 | var _errImg = e.target.dataset.errorimg; |
399 | var _errObj = {}; | 455 | var _errObj = {}; |
400 | - _errObj[_errImg] = this.data.url+ "/miniapp/images/del/logo.jpg"; | 456 | + _errObj[_errImg] = this.data.url + "/miniapp/images/del/logo.jpg"; |
401 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | 457 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
402 | }, | 458 | }, |
403 | 459 | ||
404 | //图片失败,默认图片 | 460 | //图片失败,默认图片 |
405 | - bind_bnerr2: function (e) { | 461 | + bind_bnerr2: function(e) { |
406 | var _errImg = e.target.dataset.errorimg; | 462 | var _errImg = e.target.dataset.errorimg; |
407 | var _errurl = e.target.dataset.url; | 463 | var _errurl = e.target.dataset.url; |
408 | - var _errObj = {}; | ||
409 | - _errObj[_errImg] = "/miniapp/images/default_g_img.gif"; | ||
410 | - this.setData(_errObj); //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
411 | - | 464 | + var _errObj = {}; |
465 | + _errObj[_errImg] = "/miniapp/images/default_g_img.gif"; | ||
466 | + this.setData(_errObj); //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
467 | + | ||
412 | }, | 468 | }, |
413 | -//图片失败,默认图片 | ||
414 | - bind_bnerr3: function (e) { | 469 | + //图片失败,默认图片 |
470 | + bind_bnerr3: function(e) { | ||
415 | var _errImg = e.target.dataset.errorimg; | 471 | var _errImg = e.target.dataset.errorimg; |
416 | var _Img = e.target.dataset.img; | 472 | var _Img = e.target.dataset.img; |
417 | if (_Img != undefined) { | 473 | if (_Img != undefined) { |
@@ -430,7 +486,7 @@ Page({ | @@ -430,7 +486,7 @@ Page({ | ||
430 | 486 | ||
431 | //----秒杀倒计时函数----- | 487 | //----秒杀倒计时函数----- |
432 | countDown() { | 488 | countDown() { |
433 | - if(!this.data.is_timer) return false; | 489 | + if (!this.data.is_timer) return false; |
434 | var th = this; | 490 | var th = this; |
435 | // 获取当前时间,同时得到活动结束时间数组 | 491 | // 获取当前时间,同时得到活动结束时间数组 |
436 | var newTime = ut.gettimestamp(); | 492 | var newTime = ut.gettimestamp(); |
@@ -479,7 +535,7 @@ Page({ | @@ -479,7 +535,7 @@ Page({ | ||
479 | 535 | ||
480 | //----拼单倒计时函数----- | 536 | //----拼单倒计时函数----- |
481 | countDown2() { | 537 | countDown2() { |
482 | - if(!this.data.is_timer) return false; | 538 | + if (!this.data.is_timer) return false; |
483 | 539 | ||
484 | var th = this; | 540 | var th = this; |
485 | // 获取当前时间,同时得到活动结束时间数组 | 541 | // 获取当前时间,同时得到活动结束时间数组 |
@@ -529,123 +585,179 @@ Page({ | @@ -529,123 +585,179 @@ Page({ | ||
529 | setTimeout(th.countDown2, 1000); | 585 | setTimeout(th.countDown2, 1000); |
530 | }, | 586 | }, |
531 | 587 | ||
532 | - bannerSwiperChange:function (e) { | ||
533 | - var index=e.detail.current; | ||
534 | - this.setData({banner_index:index}); | 588 | + bannerSwiperChange: function(e) { |
589 | + var index = e.detail.current; | ||
590 | + this.setData({ | ||
591 | + banner_index: index | ||
592 | + }); | ||
535 | }, | 593 | }, |
536 | - flashSwiperChange:function (e) { | ||
537 | - var index=e.detail.current; | ||
538 | - this.setData({flash_index:index}); | 594 | + flashSwiperChange: function(e) { |
595 | + var index = e.detail.current; | ||
596 | + this.setData({ | ||
597 | + flash_index: index | ||
598 | + }); | ||
539 | }, | 599 | }, |
540 | - ptSwiperChange:function (e) { | ||
541 | - var index=e.detail.current; | ||
542 | - this.setData({pt_index:index}); | 600 | + ptSwiperChange: function(e) { |
601 | + var index = e.detail.current; | ||
602 | + this.setData({ | ||
603 | + pt_index: index | ||
604 | + }); | ||
543 | }, | 605 | }, |
544 | 606 | ||
545 | Interval_pt() { | 607 | Interval_pt() { |
546 | - var th=this; | ||
547 | - this.data.pt_timer=setInterval(function () { | ||
548 | - var item=ut.get_rand_item(th.data.pt_timer_arr); | ||
549 | - th.setData({pt_timer_active:1,pt_timer_item:item}); | ||
550 | - setTimeout(function () { | ||
551 | - th.setData({pt_timer_active:0}); | ||
552 | - },1500) | ||
553 | - },4000); | 608 | + var th = this; |
609 | + this.data.pt_timer = setInterval(function() { | ||
610 | + var item = ut.get_rand_item(th.data.pt_timer_arr); | ||
611 | + th.setData({ | ||
612 | + pt_timer_active: 1, | ||
613 | + pt_timer_item: item | ||
614 | + }); | ||
615 | + setTimeout(function() { | ||
616 | + th.setData({ | ||
617 | + pt_timer_active: 0 | ||
618 | + }); | ||
619 | + }, 1500) | ||
620 | + }, 4000); | ||
554 | }, | 621 | }, |
555 | 622 | ||
556 | 623 | ||
557 | //---扫一扫的函数--- | 624 | //---扫一扫的函数--- |
558 | - getScancode: function () { | 625 | + getScancode: function() { |
559 | var _this = this; | 626 | var _this = this; |
560 | // 允许从相机和相册扫码 | 627 | // 允许从相机和相册扫码 |
561 | wx.scanCode({ | 628 | wx.scanCode({ |
562 | success: (res) => { | 629 | success: (res) => { |
563 | - var result = res.result; | ||
564 | - wx.navigateTo({ | ||
565 | - url: "/pages/goods/search/search?s_key="+result, | ||
566 | - }); | 630 | + var result = res.result; |
631 | + wx.navigateTo({ | ||
632 | + url: "/pages/goods/search/search?s_key=" + result, | ||
633 | + }); | ||
567 | } | 634 | } |
568 | }) | 635 | }) |
569 | }, | 636 | }, |
570 | 637 | ||
571 | //跳转到分类 | 638 | //跳转到分类 |
572 | - go_cate:function(){ | 639 | + go_cate: function() { |
573 | getApp().goto("/pages/goods/categoryList/categoryList"); | 640 | getApp().goto("/pages/goods/categoryList/categoryList"); |
574 | }, | 641 | }, |
575 | 642 | ||
576 | - go_url:function(e){ | ||
577 | - var url=e.currentTarget.dataset.url; | ||
578 | - getApp().goto(url); | 643 | + go_url: function(e) { |
644 | + var url = e.currentTarget.dataset.url; | ||
645 | + getApp().goto(url); | ||
579 | }, | 646 | }, |
580 | 647 | ||
581 | - bind_bnerr_icon:function (e) { | 648 | + bind_bnerr_icon: function(e) { |
582 | var def = "/miniapp/images/no_cate_def.png"; | 649 | var def = "/miniapp/images/no_cate_def.png"; |
583 | var _err = e.currentTarget.dataset.err; | 650 | var _err = e.currentTarget.dataset.err; |
584 | - var ob={}; | ||
585 | - ob[_err]=def; | 651 | + var ob = {}; |
652 | + ob[_err] = def; | ||
586 | this.setData(ob); | 653 | this.setData(ob); |
587 | }, | 654 | }, |
588 | 655 | ||
589 | //跳转到分类的商品列表 | 656 | //跳转到分类的商品列表 |
590 | - go_cate2: function (t) { | 657 | + go_cate2: function(t) { |
591 | var cid = t.currentTarget.dataset.cid; | 658 | var cid = t.currentTarget.dataset.cid; |
592 | var pid = t.currentTarget.dataset.pid; | 659 | var pid = t.currentTarget.dataset.pid; |
593 | var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid + "&pid=" + pid; | 660 | var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid + "&pid=" + pid; |
594 | - wx.navigateTo({ url: lurl }); | ||
595 | - }, | ||
596 | - | ||
597 | - //跳转到权益 | ||
598 | - go_quanyi:function(t){ | ||
599 | - var user_info = getApp().globalData.userInfo; | ||
600 | - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
601 | - wx.navigateTo({ url: '/pages/getphone/getphone', }) | ||
602 | - return false; | ||
603 | - } | ||
604 | - getApp().goto("/pages/user/userqy/userqy"); | ||
605 | - }, | ||
606 | - | ||
607 | - imageLoad:function (e) { | ||
608 | - var imgwidth = e.detail.width; | ||
609 | - var imgheight = e.detail.height; | ||
610 | - //宽高比 | ||
611 | - var ratio = imgwidth / imgheight; | ||
612 | - //计算的高度值 | ||
613 | - var viewHeight = 715 / ratio; | ||
614 | - if(this.data.max_sw_height<viewHeight) this.setData({ max_sw_height:viewHeight }); | ||
615 | - }, | 661 | + wx.navigateTo({ |
662 | + url: lurl | ||
663 | + }); | ||
664 | + }, | ||
665 | + new_nav: function(e) { | ||
666 | + var th = this; | ||
667 | + var new_nav = th.data.new_nav; | ||
668 | + getApp().goto(new_nav); | ||
669 | + }, | ||
670 | + //跳转到权益 | ||
671 | + go_quanyi: function(t) { | ||
672 | + var user_info = getApp().globalData.userInfo; | ||
673 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
674 | + wx.navigateTo({ | ||
675 | + url: '/pages/getphone/getphone', | ||
676 | + }) | ||
677 | + return false; | ||
678 | + } | ||
679 | + getApp().goto("/pages/user/userqy/userqy"); | ||
680 | + }, | ||
681 | + | ||
682 | + imageLoad: function(e) { | ||
683 | + var imgwidth = e.detail.width; | ||
684 | + var imgheight = e.detail.height; | ||
685 | + //宽高比 | ||
686 | + var ratio = imgwidth / imgheight; | ||
687 | + //计算的高度值 | ||
688 | + var viewHeight = 715 / ratio; | ||
689 | + if (this.data.max_sw_height < viewHeight) this.setData({ | ||
690 | + max_sw_height: viewHeight | ||
691 | + }); | ||
692 | + }, | ||
616 | //判断该用户是否是新会员 | 693 | //判断该用户是否是新会员 |
617 | - is_new: function () { | ||
618 | - // var th = this; | ||
619 | - // getApp().request.promiseGet("/api/weshop/marketing/newpeople/act/judge", { | ||
620 | - // data: { | ||
621 | - // storeId: o.stoid, | ||
622 | - // userId: d.user_id | ||
623 | - // } | ||
624 | - // }).then(res => { | ||
625 | - // var swiperimage = th.data.swiperimage; | ||
626 | - // swiperimage.push("/api/weshop/marketing/newpeople/act/bound/judge"); | ||
627 | - // if (res.data.code == 0) { | ||
628 | - // th.setData({ | ||
629 | - // is_disgraceful:1 | ||
630 | - // }) | ||
631 | - // } | ||
632 | - // }) | ||
633 | - | ||
634 | - // getApp().request.promiseGet("/api/weshop/marketing/newpeople/act/judge", { | ||
635 | - // data: { | ||
636 | - // storeId: o.stoid, | ||
637 | - // userId: d.user_id | ||
638 | - // } | ||
639 | - // }).then(res => { | ||
640 | - // var swiperimage = th.data.swiperimage; | ||
641 | - // swiperimage.push("/miniapp/images/newpeople/newpeople.png"); | ||
642 | - // if (res.data.code == 0) { | ||
643 | - // th.setData({ | ||
644 | - // swiperimage: swiperimage | ||
645 | - // }) | ||
646 | - // } | ||
647 | - // }) | 694 | + is_new: function() { |
695 | + var th = this; | ||
696 | + wx.hideLoading(); | ||
697 | + getApp().request.promiseGet("/api/weshop/marketing/newpeople/act/judge", { | ||
698 | + data: { | ||
699 | + storeId: os.stoid, | ||
700 | + userId: d.user_id | ||
701 | + } | ||
702 | + }).then(res => { | ||
703 | + if (res.data.code == 0) { | ||
704 | + var actid = res.data.data.id; //活动id | ||
705 | + var giftBagId = res.data.data.giftBagId; //礼包id | ||
706 | + var new_nav = "/pages/giftpack/newvipgift/newvipgift?actId=" + actid + '&' + 'actType=' + 1 + '&' + 'giftBagId=' + giftBagId; | ||
707 | + var new_image = res.data.data.imageurl; | ||
708 | + var swiperimage = th.data.swiperimage; | ||
709 | + var img = { | ||
710 | + image: "/miniapp/images/newpeople/newpeople.png", | ||
711 | + nav_url: new_nav | ||
712 | + } | ||
713 | + swiperimage.unshift(img); | ||
714 | + th.setData({ | ||
715 | + swiperimage: swiperimage, | ||
716 | + new_image: new_image, | ||
717 | + new_nav: new_nav | ||
718 | + }) | ||
648 | 719 | ||
649 | - } | 720 | + getApp().request.promiseGet("/api/weshop/marketing/newpeople/act/bound/judge", { |
721 | + data: { | ||
722 | + storeId: o.stoid, | ||
723 | + userId: d.user_id | ||
724 | + } | ||
725 | + }).then(res => { | ||
726 | + if (res.data.code == 0) { | ||
727 | + th.setData({ | ||
728 | + is_disgraceful: 1 | ||
729 | + }) | ||
730 | + } | ||
731 | + }) | ||
732 | + } | ||
733 | + }) | ||
650 | 734 | ||
735 | + }, | ||
736 | + is_festival: function(e) { | ||
737 | + var th = this; | ||
738 | + var url = "/api/weshop/marketing/holiday/act/judge"; | ||
739 | + getApp().request.promiseGet(url, { | ||
740 | + data: { | ||
741 | + storeId: os.stoid, | ||
742 | + userId: d.user_id | ||
743 | + } | ||
744 | + }).then(res => { | ||
745 | + if (res.data.code == 0) { | ||
746 | + var actid = res.data.data.id; //活动id | ||
747 | + var giftBagId = res.data.data.gifBagId; //礼包id | ||
748 | + var nav_url = "/pages/giftpack/festival/festival?actId=" + actid + '&' + 'actType=' + 3 + '&' + 'giftBagId=' + giftBagId; | ||
749 | + var swiperimage = th.data.swiperimage; | ||
750 | + var actImg = res.data.data.actImg; | ||
751 | + var img = { | ||
752 | + image: actImg, | ||
753 | + nav_url: nav_url | ||
754 | + } | ||
755 | + swiperimage.unshift(img); | ||
756 | + th.setData({ | ||
757 | + swiperimage: swiperimage, | ||
758 | + new_nav: nav_url | ||
759 | + }) | ||
760 | + } | ||
761 | + }) | ||
762 | + } | ||
651 | }); | 763 | }); |
652 | \ No newline at end of file | 764 | \ No newline at end of file |
pages/index/index/index.wxml
@@ -108,14 +108,13 @@ | @@ -108,14 +108,13 @@ | ||
108 | </view> | 108 | </view> |
109 | </view> | 109 | </view> |
110 | </view> | 110 | </view> |
111 | - | ||
112 | <!-- 轮播 --> | 111 | <!-- 轮播 --> |
113 | <swiper class="swiper" autoplay="true" interval="5000" circular="{{true}}" indicator-dots="{{true}}" indicator-active-color="rgb(255,255,255)"> | 112 | <swiper class="swiper" autoplay="true" interval="5000" circular="{{true}}" indicator-dots="{{true}}" indicator-active-color="rgb(255,255,255)"> |
114 | - <!-- 跳转我的权益 --> | 113 | + <!-- 活动轮播 --> |
115 | <block wx:for="{{swiperimage}}" wx:for-item="adver" wx:for-index="key"> | 114 | <block wx:for="{{swiperimage}}" wx:for-item="adver" wx:for-index="key"> |
116 | <swiper-item> | 115 | <swiper-item> |
117 | <view class="title-img-frame"> | 116 | <view class="title-img-frame"> |
118 | - <image class="xc-title-img" src="{{url+adver}}" bindtap="{{key==0?'go_quanyi':''}}"></image> | 117 | + <image class="xc-title-img" src="{{url+adver.image}}" bindtap="{{adver.nav_url==0?'go_quanyi':'new_nav'}}" data-url="{{adver.nav_url}}"></image> |
119 | </view> | 118 | </view> |
120 | </swiper-item> | 119 | </swiper-item> |
121 | </block> | 120 | </block> |
@@ -347,9 +346,9 @@ | @@ -347,9 +346,9 @@ | ||
347 | <!-- 新人礼领取图片 --> | 346 | <!-- 新人礼领取图片 --> |
348 | <view class="newreceive flex-center"> | 347 | <view class="newreceive flex-center"> |
349 | <view> | 348 | <view> |
350 | - <navigator url=""> | 349 | + <navigator bindtap="new_nav"> |
351 | <view class="flex-level"> | 350 | <view class="flex-level"> |
352 | - <image class="receive" src="{{url}}/miniapp/images/newpeople/newreceive.png"></image> | 351 | + <image class="receive" src="{{url}}{{new_image==''?'/miniapp/images/newpeople/newreceive.png':new_image}}"></image> |
353 | </view> | 352 | </view> |
354 | </navigator> | 353 | </navigator> |
355 | <view class="flex-level"> | 354 | <view class="flex-level"> |
pages/index/index/index.wxss
@@ -451,6 +451,7 @@ | @@ -451,6 +451,7 @@ | ||
451 | .xc-title-img { | 451 | .xc-title-img { |
452 | height: 220rpx; | 452 | height: 220rpx; |
453 | width: 100%; | 453 | width: 100%; |
454 | + border-radius: 15rpx; | ||
454 | } | 455 | } |
455 | 456 | ||
456 | .title-img-frame { | 457 | .title-img-frame { |
@@ -906,5 +907,5 @@ | @@ -906,5 +907,5 @@ | ||
906 | } | 907 | } |
907 | .swiper{ | 908 | .swiper{ |
908 | height: 250rpx; | 909 | height: 250rpx; |
909 | - padding-bottom:10rpx; | 910 | + padding-bottom:30rpx; |
910 | } | 911 | } |
911 | \ No newline at end of file | 912 | \ No newline at end of file |
pages/user/add_comment/add_comment.js
@@ -8,7 +8,6 @@ Page({ | @@ -8,7 +8,6 @@ Page({ | ||
8 | resourceUrl: a.resourceUrl, | 8 | resourceUrl: a.resourceUrl, |
9 | iurl: a.imghost, | 9 | iurl: a.imghost, |
10 | defaultPhoto: a.resourceUrl + "/static/images/camera.png", | 10 | defaultPhoto: a.resourceUrl + "/static/images/camera.png", |
11 | - | ||
12 | uploadPath: [], //上传后文件路径 | 11 | uploadPath: [], //上传后文件路径 |
13 | maxWord: 0, | 12 | maxWord: 0, |
14 | is_anonymous: !1, | 13 | is_anonymous: !1, |
@@ -20,7 +19,9 @@ Page({ | @@ -20,7 +19,9 @@ Page({ | ||
20 | isLongPress: !1, | 19 | isLongPress: !1, |
21 | userinfo: null, | 20 | userinfo: null, |
22 | imgs: [], //本地文件再上传时的路径 | 21 | imgs: [], //本地文件再上传时的路径 |
23 | - lenMore:0 | 22 | + lenMore:0, |
23 | + goods_id: "", //商品id | ||
24 | + order_id: "", //订单id | ||
24 | }, | 25 | }, |
25 | onLoad: async function (a) { | 26 | onLoad: async function (a) { |
26 | var th = this; | 27 | var th = this; |
@@ -35,6 +36,10 @@ Page({ | @@ -35,6 +36,10 @@ Page({ | ||
35 | console.log(e); | 36 | console.log(e); |
36 | th.setData({userinfo: e}) | 37 | th.setData({userinfo: e}) |
37 | }) | 38 | }) |
39 | + th.setData({ | ||
40 | + goods_id: a.goods_id, | ||
41 | + order_id: a.order_id | ||
42 | + }) | ||
38 | }, | 43 | }, |
39 | keyUpChangeNum: function (t) { | 44 | keyUpChangeNum: function (t) { |
40 | this.setData({ | 45 | this.setData({ |
@@ -79,7 +84,7 @@ Page({ | @@ -79,7 +84,7 @@ Page({ | ||
79 | }); | 84 | }); |
80 | }); | 85 | }); |
81 | }, | 86 | }, |
82 | - submitComment: function () { | 87 | + submitComment: function (i) { |
83 | var a = this; | 88 | var a = this; |
84 | if (!a.data.service_rank || !a.data.goods_rank || !a.data.deliver_rank) | 89 | if (!a.data.service_rank || !a.data.goods_rank || !a.data.deliver_rank) |
85 | return getApp().my_warnning("请先打分",0,a); | 90 | return getApp().my_warnning("请先打分",0,a); |
@@ -111,9 +116,15 @@ Page({ | @@ -111,9 +116,15 @@ Page({ | ||
111 | e.post("/api/weshop/comment/savecomment", { | 116 | e.post("/api/weshop/comment/savecomment", { |
112 | data:p_data, | 117 | data:p_data, |
113 | success: function (a) { | 118 | success: function (a) { |
119 | + if(a.data.code==0){ | ||
114 | wx.setStorageSync("user:comment:update", !0), t.showSuccess("评论成功", function () { | 120 | wx.setStorageSync("user:comment:update", !0), t.showSuccess("评论成功", function () { |
115 | - wx.navigateBack(); | 121 | + // wx.navigateBack(); |
122 | + var url = i.currentTarget.dataset.url; | ||
123 | + getApp().goto(url); | ||
116 | }); | 124 | }); |
125 | + }else{ | ||
126 | + getApp().my_warnning(a.data.msg,0,a); | ||
127 | + } | ||
117 | } | 128 | } |
118 | }); | 129 | }); |
119 | //}); | 130 | //}); |
pages/user/add_comment/add_comment.wxml
@@ -106,7 +106,7 @@ | @@ -106,7 +106,7 @@ | ||
106 | </view> | 106 | </view> |
107 | 107 | ||
108 | <view class="Submission flex-level "> | 108 | <view class="Submission flex-level "> |
109 | - <view class="fs30 flex-level white " bindtap="submitComment">提交评价</view> | 109 | + <view class="fs30 flex-level white " bindtap="submitComment" data-url="/pages/user/view_comment/view_comment?goods_id={{goods_id}}&order_id={{order_id}}">提交评价</view> |
110 | </view> | 110 | </view> |
111 | </view> | 111 | </view> |
112 | 112 |
pages/user/assistance/assistance.js
0 → 100644
1 | +var t = getApp(), | ||
2 | + a = t.request, | ||
3 | + o = t.globalData.setting, | ||
4 | + os = o, | ||
5 | + i = require("../../../utils/util.js"), | ||
6 | + ut = i, | ||
7 | + s = require("../../../utils/common.js"); | ||
8 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | ||
9 | +var oo = t.globalData.setting,os=oo, ut= require("../../../utils/util.js"); | ||
10 | +Page({ | ||
11 | + | ||
12 | + /** | ||
13 | + * 页面的初始数据 | ||
14 | + */ | ||
15 | + data: { | ||
16 | + url: os.url, //接口网址 | ||
17 | + iurl: os.imghost, //图片前缀网址 | ||
18 | + switch_head: 0, //0:我的任务,1:活动说明 | ||
19 | + zl_act: null, //助力活动 | ||
20 | + zl_user_list: [], //任务列表 | ||
21 | + is_load: 0, //是否已经加载 | ||
22 | + cur_page: 1, //页码 | ||
23 | + page_num: 5, //每页多少个 | ||
24 | + is_show_more: 0, //是否加载更多 | ||
25 | + help_id:"",//助力活动的id | ||
26 | + timer:"",//任务列表的定时器 | ||
27 | + s_num:"",//多少人已经领取任务 | ||
28 | + | ||
29 | + }, | ||
30 | + | ||
31 | + /** | ||
32 | + * 生命周期函数--监听页面加载 | ||
33 | + */ | ||
34 | + onLoad: function(options) { | ||
35 | + var th = this; | ||
36 | + var nav_b = th.selectComponent("#nav_b"); //组件的id | ||
37 | + nav_b.set_name("助力", ""); | ||
38 | + // 助力活动 | ||
39 | + this.assistance(); | ||
40 | + }, | ||
41 | + | ||
42 | + /** | ||
43 | + * 生命周期函数--监听页面显示 | ||
44 | + */ | ||
45 | + onShow: function() { | ||
46 | + var th=this; | ||
47 | + this.data.timer= setInterval(function () { | ||
48 | + th.get_list(); | ||
49 | + | ||
50 | + },2000) | ||
51 | + | ||
52 | + }, | ||
53 | + // 助力活动 | ||
54 | + assistance() { | ||
55 | + var th=this; | ||
56 | + var user_id = getApp().globalData.user_id; | ||
57 | + var store_id = os.stoid; | ||
58 | + | ||
59 | + getApp().request.promiseGet("/api/weshop/marketing/help/act/judge", { | ||
60 | + data: { | ||
61 | + storeId: store_id, | ||
62 | + userId: user_id | ||
63 | + } | ||
64 | + }).then(res => { | ||
65 | + if (res.data.code == 0) { | ||
66 | + | ||
67 | + var help_data=res.data.data; | ||
68 | + console.log(help_data.id,'数据', res.data.data); | ||
69 | + th.setData({ zl_act:help_data, help_id:help_data.id }); | ||
70 | + return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { | ||
71 | + data: { | ||
72 | + helpId: help_data.id, storeId: store_id | ||
73 | + } | ||
74 | + }) | ||
75 | + | ||
76 | + } | ||
77 | + return ut.null_promise(); | ||
78 | + }).then(res=>{ | ||
79 | + if(res.data.code==0) | ||
80 | + th.setData({s_num:res.data.data.countAll}) | ||
81 | + }) | ||
82 | + | ||
83 | + | ||
84 | + }, | ||
85 | + | ||
86 | + //--点击获取用户任务列表--会员的任务列表 | ||
87 | + get_list:function() { | ||
88 | + var th = this; | ||
89 | + var help_id=this.data.help_id; | ||
90 | + t.request.get("/api/weshop/marketing/help/help/user/page", { | ||
91 | + data: { | ||
92 | + userId:getApp().globalData.user_id, | ||
93 | + storeId: os.stoid, | ||
94 | + helpId: help_id | ||
95 | + }, | ||
96 | + success: function(res) { | ||
97 | + clearTimeout(th.data.timer); | ||
98 | + | ||
99 | + if (!th.data.is_load) th.setData({ | ||
100 | + is_load: 1 | ||
101 | + }) | ||
102 | + if (res.data.code == 0) { | ||
103 | + | ||
104 | + var list = th.data.zl_user_list; | ||
105 | + list = list.concat(res.data.data.pageData) //连接数组 | ||
106 | + th.setData({ | ||
107 | + zl_user_list: list | ||
108 | + }); | ||
109 | + var n_all_num = th.data.cur_page * th.data.page_num; | ||
110 | + if (res.data.data.total > n_all_num) th.setData({ | ||
111 | + is_show_more: 1 | ||
112 | + }) | ||
113 | + else th.setData({ | ||
114 | + is_show_more: 0 | ||
115 | + }) | ||
116 | + //页吗要更新一下 | ||
117 | + th.data.cur_page++; | ||
118 | + } else { | ||
119 | + th.setData({ | ||
120 | + is_show_more: 0 | ||
121 | + }) | ||
122 | + } | ||
123 | + | ||
124 | + } | ||
125 | + }) | ||
126 | + }, | ||
127 | + | ||
128 | + //-----跳转到领取礼包的页面------ | ||
129 | + go_task: function() { | ||
130 | + var help_id=this.data.help_id; | ||
131 | + | ||
132 | + getApp().goto("/pages/user/assistance/task_assistance?help_id="+help_id); | ||
133 | + }, | ||
134 | + switch_head: function (e) { | ||
135 | + var th = this; | ||
136 | + var index = e.currentTarget.dataset.index; //获取当前选择的是任务还是活动说明 | ||
137 | + var switch_head = th.data.switch_head; //0任务,1活动说明 | ||
138 | + if (index != switch_head) { | ||
139 | + th.setData({ | ||
140 | + switch_head: index | ||
141 | + }) | ||
142 | + } | ||
143 | + }, | ||
144 | + | ||
145 | + //关闭导航 | ||
146 | + close: function () { | ||
147 | + var th = this; | ||
148 | + var nav_b = th.selectComponent("#nav_b"); //组件的id | ||
149 | + nav_b.close_box(); | ||
150 | + }, | ||
151 | + | ||
152 | +}) | ||
0 | \ No newline at end of file | 153 | \ No newline at end of file |
pages/user/assistance/assistance.json
0 → 100644
1 | +{ | ||
2 | + "navigationBarTitleText": "好友助力", | ||
3 | + "navigationStyle": "custom", | ||
4 | + "usingComponents": { | ||
5 | + "warn": "/components/long_warn/long_warn", | ||
6 | + "my_confirm": "/components/my_confirm/my_confirm", | ||
7 | + "nav_b": "/components/nav_b/nav_b" | ||
8 | + } | ||
9 | +} | ||
0 | \ No newline at end of file | 10 | \ No newline at end of file |
pages/user/assistance/assistance.wxml
0 → 100644
1 | +<wxs module="filter" src="c_filter.wxs"></wxs> | ||
2 | +<view class="page" bindtap="close"> | ||
3 | + <!-- 背景图片 --> | ||
4 | + <image class="lumi" src="{{iurl+'miniapp/images/friendhelp/lumi.png'}}" lazy-load="true"></image> | ||
5 | + <view class="zindex"> | ||
6 | + <view class="top"> | ||
7 | + <view class="flex-center"> | ||
8 | + <image class="getgift" src="{{iurl+'miniapp/images/friendhelp/getgift.png'}}" lazy-load="true"></image> | ||
9 | + </view> | ||
10 | + <view class="flex-center fs32"> | ||
11 | + <view class="excitation">机会总是留给最有行动力的人</view> | ||
12 | + </view> | ||
13 | + <view class="flex-center"> | ||
14 | + <image class="gift" src="{{zl_act.imageUrl==''?iurl+'miniapp/images/friendhelp/gift.png':iurl+zl_act.imageUrl}}" lazy-load="true"></image> | ||
15 | + </view> | ||
16 | + <view class="flex-center fs26 time"> | ||
17 | + <view>活动时间:</view> | ||
18 | + <view>{{filter.fm_time(zl_act.beginDate)}}-{{filter.fm_time(zl_act.endDate)}} | ||
19 | + </view> | ||
20 | + </view> | ||
21 | + <view class="flex-center" bindtap="go_task"> | ||
22 | + <view class="flex-center take"> | ||
23 | + <view>立即领取</view> | ||
24 | + </view> | ||
25 | + </view> | ||
26 | + </view> | ||
27 | + | ||
28 | + <!-- 任务及说明栏 --> | ||
29 | + <view> | ||
30 | + <!-- 标题 --> | ||
31 | + <view class="flex-vertical-between fs28 padding head"> | ||
32 | + <!-- task --> | ||
33 | + <view class="flex-center lhead {{switch_head==0?'rhead':''}}" bindtap="switch_head" data-index="{{0}}"> | ||
34 | + <image class="explain" src="{{iurl+'miniapp/images/friendhelp/task.png'}}" lazy-load="true"></image> | ||
35 | + <view>我的任务</view> | ||
36 | + </view> | ||
37 | + <view class="flex-center lhead {{switch_head==1?'rhead':''}}" bindtap="switch_head" data-index="{{1}}"> | ||
38 | + <image class="explain" src="{{iurl+'miniapp/images/friendhelp/explain.png'}}" lazy-load="true"></image> | ||
39 | + <view>活动说明</view> | ||
40 | + </view> | ||
41 | + </view> | ||
42 | + | ||
43 | + <!-- 我的任务 --> | ||
44 | + <view wx:if="{{switch_head==0}}" class="white"> | ||
45 | + <view class="items"> | ||
46 | + <view class="item fs26 flex-vertical-between padding" wx:for="{{zl_user_list}}"> | ||
47 | + <view class="flex-center width"> | ||
48 | + <view class="ellipsis-1">{{item.help_taskname}}</view> | ||
49 | + </view> | ||
50 | + | ||
51 | + <!-- 已完成的颜色nostate --> | ||
52 | + <view class="flex-center width state" wx:if="{{item.is_acting==0}}"> | ||
53 | + <view class="ellipsis-1">领取礼包</view> | ||
54 | + </view> | ||
55 | + <view class="flex-center width state" wx:if="{{item.is_acting==1}}"> | ||
56 | + <view class="ellipsis-1">{{item.helped}}/{{item.help_num}}</view> | ||
57 | + </view> | ||
58 | + <view class="flex-center width state" wx:if="{{item.is_acting==2}}"> | ||
59 | + <view class="ellipsis-1">查看礼包</view> | ||
60 | + </view> | ||
61 | + | ||
62 | + | ||
63 | + </view> | ||
64 | + <!-- 加载更多 --> | ||
65 | + <block wx:if="{{is_load && zl_user_list.length!=0}}"> | ||
66 | + <view class="fs28 flex-center"> | ||
67 | + <view class="line"></view> | ||
68 | + <view class="load" bindtap="get_list">点击加载更多</view> | ||
69 | + <view class="line"></view> | ||
70 | + </view> | ||
71 | + </block> | ||
72 | + </view> | ||
73 | + | ||
74 | + | ||
75 | + <view class="fs30" style="margin-top: 30rpx;"> | ||
76 | + <view class="flex-center nothing" wx:if="{{is_load && zl_user_list.length==0}}"> | ||
77 | + <view>暂无任务记录</view> | ||
78 | + </view> | ||
79 | + <view class="flex-center receive" wx:if="{{is_load && s_num}}"> | ||
80 | + <view class="flex-center"> | ||
81 | + <view>已有</view> | ||
82 | + <view>{{s_num}}</view> | ||
83 | + <view>人领取了任务</view> | ||
84 | + </view> | ||
85 | + | ||
86 | + </view> | ||
87 | + </view> | ||
88 | + | ||
89 | + </view> | ||
90 | + <!-- 活动说明 --> | ||
91 | + <view wx:if="{{switch_head}}" class="white"> | ||
92 | + <view class="items"> | ||
93 | + <view class="content fs28 padding"> | ||
94 | + <!-- <view>{{zl_act.remark}}</view> --> | ||
95 | + <rich-text nodes="{{zl_act.remark}}"></rich-text> | ||
96 | + </view> | ||
97 | + </view> | ||
98 | + | ||
99 | + </view> | ||
100 | + | ||
101 | + </view> | ||
102 | + | ||
103 | + </view> | ||
104 | +</view> | ||
105 | +<!-- 制作一个圆球导航 --> | ||
106 | +<nav_b id="nav_b"></nav_b> | ||
0 | \ No newline at end of file | 107 | \ No newline at end of file |
pages/user/assistance/assistance.wxss
0 → 100644
1 | +page { | ||
2 | + background-color: rgb(208, 17, 25); | ||
3 | + width: 100%; | ||
4 | + height: 100%; | ||
5 | +} | ||
6 | + | ||
7 | +.lumi { | ||
8 | + position: absolute; | ||
9 | + z-index: 0; | ||
10 | + width: 100%; | ||
11 | + height: 1100rpx; | ||
12 | +} | ||
13 | + | ||
14 | +.zindex { | ||
15 | + position: absolute; | ||
16 | + z-index: 1; | ||
17 | + width: 100%; | ||
18 | +} | ||
19 | + | ||
20 | +.top { | ||
21 | + padding-bottom: 75rpx; | ||
22 | +} | ||
23 | + | ||
24 | +.getgift { | ||
25 | + width: 610rpx; | ||
26 | + height: 130rpx; | ||
27 | + padding-top: 70rpx; | ||
28 | +} | ||
29 | + | ||
30 | +.excitation { | ||
31 | + padding-top: 30rpx; | ||
32 | + color: rgb(255, 255, 255); | ||
33 | + padding-bottom: 50rpx; | ||
34 | +} | ||
35 | + | ||
36 | +.gift { | ||
37 | + width: 550rpx; | ||
38 | + height: 500rpx; | ||
39 | +} | ||
40 | + | ||
41 | +.time { | ||
42 | + color: rgb(255, 255, 255); | ||
43 | + margin-bottom: 55rpx; | ||
44 | + text-decoration: underline; | ||
45 | + margin-top: 10rpx; | ||
46 | +} | ||
47 | + | ||
48 | +.take { | ||
49 | + width: 440rpx; | ||
50 | + height: 77rpx; | ||
51 | + color: rgb(221, 45, 8); | ||
52 | + background-color: rgb(252, 210, 10); | ||
53 | + border-radius: 45rpx; | ||
54 | + font-weight: 900; | ||
55 | + line-height: 77rpx; | ||
56 | + box-shadow: 0rpx 7rpx 0rpx 0rpx rgb(245, 119, 6); | ||
57 | + font-size: 38rpx; | ||
58 | +} | ||
59 | + | ||
60 | +.head { | ||
61 | + border-bottom: 4rpx solid rgb(253, 193, 7); | ||
62 | + color: rgb(255, 255, 255); | ||
63 | + height: 50rpx; | ||
64 | + line-height: 50rpx; | ||
65 | +} | ||
66 | + | ||
67 | +.lhead { | ||
68 | + border-top: 4rpx solid rgb(253, 193, 7); | ||
69 | + border-left: 4rpx solid rgb(253, 193, 7); | ||
70 | + border-right: 4rpx solid rgb(253, 193, 7); | ||
71 | + width: 290rpx; | ||
72 | + height: 50rpx; | ||
73 | + line-height: 50rpx; | ||
74 | +} | ||
75 | + | ||
76 | +.rhead { | ||
77 | + background-color: rgb(253, 193, 7); | ||
78 | + border-bottom: 4rpx solid rgb(253, 193, 7); | ||
79 | +} | ||
80 | + | ||
81 | +.items { | ||
82 | + padding-top: 50rpx; | ||
83 | +} | ||
84 | + | ||
85 | +.explain { | ||
86 | + width: 30rpx; | ||
87 | + height: 30rpx; | ||
88 | + margin-right: 10rpx; | ||
89 | +} | ||
90 | + | ||
91 | +.padding { | ||
92 | + padding: 0rpx 50rpx; | ||
93 | +} | ||
94 | + | ||
95 | +.content { | ||
96 | + padding-bottom: 35rpx; | ||
97 | +} | ||
98 | + | ||
99 | +.width { | ||
100 | + width: 290rpx; | ||
101 | +} | ||
102 | + | ||
103 | +.line { | ||
104 | + width: 110rpx; | ||
105 | + border-top: 2rpx solid rgb(255, 255, 255); | ||
106 | +} | ||
107 | + | ||
108 | +.loads { | ||
109 | + margin-bottom: 35rpx; | ||
110 | +} | ||
111 | + | ||
112 | +.load { | ||
113 | + margin: 0rpx 26rpx; | ||
114 | +} | ||
115 | + | ||
116 | +.item { | ||
117 | + margin-bottom: 35rpx; | ||
118 | +} | ||
119 | + | ||
120 | +.state { | ||
121 | + text-decoration: underline; | ||
122 | +} | ||
123 | +.nostate{ | ||
124 | + color: rgb(195,155,156); | ||
125 | +} | ||
126 | +.nothing { | ||
127 | + padding: 50rpx 0rpx; | ||
128 | +} | ||
129 | + | ||
130 | +.receive { | ||
131 | + padding-bottom: 50rpx; | ||
132 | +} |
pages/user/assistance/assistance_success.js
0 → 100644
1 | +var auth = require("../../../utils/auth.js"), rq = require("../../../utils/request.js"); | ||
2 | +var e = getApp(), app = e, s = e.globalData.setting, os = s, app_d = e.globalData; | ||
3 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | ||
4 | +var ut = require("../../../utils/util.js"); | ||
5 | +Page({ | ||
6 | + | ||
7 | + /** | ||
8 | + * 页面的初始数据 | ||
9 | + */ | ||
10 | + data: { | ||
11 | + iurl: s.imghost, | ||
12 | + user:app_d.userInfo, | ||
13 | + zl_act:null, //助力活动 | ||
14 | + s_num:0, //分享的人数 | ||
15 | + }, | ||
16 | + | ||
17 | + /** | ||
18 | + * 生命周期函数--监听页面加载 | ||
19 | + */ | ||
20 | + onLoad: function (options) { | ||
21 | + //var helpid=options.helpid; | ||
22 | + var helpid=23; | ||
23 | + this.init(helpid); | ||
24 | + }, | ||
25 | + /** | ||
26 | + * 生命周期函数--监听页面显示 | ||
27 | + */ | ||
28 | + onShow: function (e) { | ||
29 | + | ||
30 | + }, | ||
31 | + | ||
32 | + // ----初始化---- | ||
33 | + init:function(helpid) { | ||
34 | + var user_id = getApp().globalData.user_id; | ||
35 | + var store_id = os.stoid; | ||
36 | + var th=this; | ||
37 | + | ||
38 | + //链式调用接口,先获取活动,在获取参与活动的人数 | ||
39 | + getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { | ||
40 | + data: { | ||
41 | + storeId: store_id, | ||
42 | + helpId: helpid | ||
43 | + } | ||
44 | + }).then(res => { | ||
45 | + if(res.data.code==0){ | ||
46 | + th.setData({zl_act:res.data.data}); | ||
47 | + return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { | ||
48 | + data: { | ||
49 | + storeId: store_id, | ||
50 | + helpId: helpid | ||
51 | + } | ||
52 | + }) | ||
53 | + } | ||
54 | + return ut.null_promise(); | ||
55 | + | ||
56 | + }).then(res=>{ | ||
57 | + if(res.data.code==0){ | ||
58 | + th.setData({s_num:res.data.data.countAll}); | ||
59 | + } | ||
60 | + }) | ||
61 | + | ||
62 | + }, | ||
63 | + | ||
64 | + | ||
65 | + /** | ||
66 | + * 页面上拉触底事件的处理函数 | ||
67 | + */ | ||
68 | + onReachBottom: function () { | ||
69 | + | ||
70 | + }, | ||
71 | + | ||
72 | + cklie_button:function(){ | ||
73 | + getApp().goto("/pages/user/assistance/assistance") | ||
74 | + } | ||
75 | +}) | ||
0 | \ No newline at end of file | 76 | \ No newline at end of file |
pages/user/assistance/assistance_success.json
0 → 100644
pages/user/assistance/assistance_success.wxml
0 → 100644
1 | +<wxs module="filter" src="c_filter.wxs"></wxs> | ||
2 | +<view class="top-back" style="background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)"> | ||
3 | + <view class="flex-vertical user_assis"> | ||
4 | + <image class="circle user_img" src="{{user.head_pic}}"></image> | ||
5 | + <view class="user_name white fs28 ellipsis-1">{{user.nickname}}</view> | ||
6 | + </view> | ||
7 | + <view class="caption_title white fs32 t-c">助力成功,自己也差拆一个吧~</view> | ||
8 | + <!-- 礼包图片 --> | ||
9 | +<view class="t-c"> | ||
10 | +<image class="assis_liba" src="{{iurl}}/miniapp/images/friendhelp/libao_asiss.png"> | ||
11 | +</image> | ||
12 | +</view> | ||
13 | + <view class="flex jc-center"> | ||
14 | + <view class="activity_time fs24 white"> | ||
15 | + 活动时间:{{filter.fm_time(zl_act.beginDate)}}-{{filter.fm_time(zl_act.endDate)}} | ||
16 | + </view> | ||
17 | + </view> | ||
18 | +</view> | ||
19 | +<view class="cklie_button t-c flex-center" bindtap="cklie_button">我也要参加</view> | ||
20 | +<view class="fs26 white t-c" wx:if="{{s_num}}">已有{{s_num}}人领取礼盒</view> | ||
21 | + | ||
22 | +<!-- 引入提示组件 --> | ||
23 | +<warn id="warn"></warn> | ||
24 | +<!-- 制作一个圆球导航 --> | ||
25 | +<nav_b id="nav_b"></nav_b> | ||
0 | \ No newline at end of file | 26 | \ No newline at end of file |
pages/user/assistance/assistance_success.wxss
0 → 100644
1 | +page{ | ||
2 | + background: #d01119; | ||
3 | + width: 100%; | ||
4 | + height: 100% | ||
5 | + | ||
6 | +} | ||
7 | +.top-back{ | ||
8 | + width: 100%; | ||
9 | + height: 60%; | ||
10 | + background-repead:no-repead; | ||
11 | + background-size:100% 100%; | ||
12 | + | ||
13 | +} | ||
14 | +.user_img{ | ||
15 | + width: 70rpx; | ||
16 | + height: 70rpx; | ||
17 | + margin-right: 15rpx; | ||
18 | + | ||
19 | +} | ||
20 | +.user_assis{ | ||
21 | + width: 85%; | ||
22 | + margin: auto; | ||
23 | + padding-top: 50rpx; | ||
24 | +} | ||
25 | +.caption_title{ | ||
26 | + margin-top: 60rpx; | ||
27 | + margin-bottom: 30rpx; | ||
28 | +} | ||
29 | +.assis_liba{ | ||
30 | + width: 50%; | ||
31 | + margin: auto; | ||
32 | + height: 340rpx; | ||
33 | + | ||
34 | +} | ||
35 | +.activity_time{ | ||
36 | + border-bottom: 1rpx solid #fff; | ||
37 | + margin: auto; | ||
38 | + display: inline; | ||
39 | +} | ||
40 | +.cklie_button{ | ||
41 | + margin: auto; | ||
42 | + width: 60%; | ||
43 | + height: 80rpx; | ||
44 | + border-radius: 50rpx; | ||
45 | + margin-top: 20rpx; | ||
46 | + background: #fbda0e; | ||
47 | + color:#d01119; | ||
48 | + line-height: 80rpx; | ||
49 | + letter-spacing: 5rpx; | ||
50 | + box-shadow: 0rpx 7rpx 0rpx 0rpx rgb(245, 119, 6); | ||
51 | + font-size: 44rpx; | ||
52 | + margin-bottom: 40rpx; | ||
53 | +} | ||
54 | +.con_div{ | ||
55 | +z-index: 15; | ||
56 | +position: fixed; | ||
57 | +top: 0; | ||
58 | +left: 0; | ||
59 | +height: 100%; | ||
60 | +width: 100%; | ||
61 | +} | ||
0 | \ No newline at end of file | 62 | \ No newline at end of file |
pages/user/assistance/c_filter.wxs
0 → 100644
1 | +var filters = { | ||
2 | + toFix:function(val,count){ | ||
3 | + return val.toFixed(count) | ||
4 | + }, | ||
5 | + fm_time:function(ts) { | ||
6 | + var d = getDate(ts*1000) | ||
7 | + var fm=(d.getMonth()+1)+"月"+ d.getDate()+"日"; | ||
8 | + return fm; | ||
9 | + }, | ||
10 | + | ||
11 | +} | ||
12 | + | ||
13 | +module.exports = { | ||
14 | + toFix: filters.toFix, | ||
15 | + fm_time:filters.fm_time, | ||
16 | +} | ||
0 | \ No newline at end of file | 17 | \ No newline at end of file |
pages/user/assistance/friend_assistance.js
0 → 100644
1 | +var auth = require("../../../utils/auth.js"), | ||
2 | + rq = require("../../../utils/request.js"); | ||
3 | +var e = getApp(), | ||
4 | + app = e, | ||
5 | + s = e.globalData.setting, | ||
6 | + os = s, | ||
7 | + app_d = e.globalData; | ||
8 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | ||
9 | +var ut = require("../../../utils/util.js"); | ||
10 | + | ||
11 | +Page({ | ||
12 | + /** | ||
13 | + * 页面的初始数据 | ||
14 | + */ | ||
15 | + data: { | ||
16 | + iurl: s.imghost, | ||
17 | + is_show: 0, //显示弹框 | ||
18 | + user: app_d.userInfo, | ||
19 | + zl_act: null, //助力活动 | ||
20 | + tasking: 0, //助力任务ID | ||
21 | + userId: 0, //任务用户的ID | ||
22 | + s_num: 0, //分享的人数 | ||
23 | + taskId:0, //活动从表ID | ||
24 | + }, | ||
25 | + | ||
26 | + /** | ||
27 | + * 生命周期函数--监听页面加载 | ||
28 | + */ | ||
29 | + onLoad: function(options) { | ||
30 | + var th = this; | ||
31 | + if (options.tasking) this.data.tasking = options.tasking; | ||
32 | + if (options.userId) this.data.userId = options.userId; | ||
33 | + //任务是不是为空 | ||
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 != | ||
38 | + 0) { | ||
39 | + getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", { | ||
40 | + data: { | ||
41 | + id: th.data.tasking, | ||
42 | + storeId: os.stoid | ||
43 | + } | ||
44 | + }).then(res => { | ||
45 | + if (res.data.code == 0) { | ||
46 | + th.data.userId = res.data.data.userId; | ||
47 | + th.data.taskId = res.data.data.taskId; | ||
48 | + //获取活动的时间 | ||
49 | + return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", { | ||
50 | + data: { | ||
51 | + helpId: res.data.data.helpFormId, | ||
52 | + storeId: os.stoid | ||
53 | + } | ||
54 | + }) | ||
55 | + } | ||
56 | + return ut.null_promise(); | ||
57 | + }).then(res => { | ||
58 | + if (res.data.code == 0) { | ||
59 | + th.setData({ | ||
60 | + zl_act: res.data.data | ||
61 | + }) | ||
62 | + //获取活动的参与的人数 | ||
63 | + return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", { | ||
64 | + data: { | ||
65 | + helpId: res.data.data.id, | ||
66 | + storeId: os.stoid | ||
67 | + } | ||
68 | + }) | ||
69 | + } | ||
70 | + return ut.null_promise(); | ||
71 | + }).then(res => { | ||
72 | + if (res.data.code == 0) { | ||
73 | + th.setData({ | ||
74 | + s_num: res.data.data.countAll | ||
75 | + }); | ||
76 | + } | ||
77 | + }) | ||
78 | + | ||
79 | + } | ||
80 | + } | ||
81 | + }, | ||
82 | + | ||
83 | + | ||
84 | + // 跳转到助力成功页 | ||
85 | + participate_activity: function() { | ||
86 | + wx.navigateTo({ | ||
87 | + url: '/pages/user/assistance/assistance_success', | ||
88 | + }) | ||
89 | + }, | ||
90 | + | ||
91 | + /** | ||
92 | + * 生命周期函数--监听页面显示 | ||
93 | + */ | ||
94 | + onShow: function() { | ||
95 | + | ||
96 | + }, | ||
97 | + //点击开启礼盒 | ||
98 | + cklie_button: function() { | ||
99 | + var th = this; | ||
100 | + var t_user_id = app_d.user_id; | ||
101 | + var data = { | ||
102 | + id: this.data.tasking, | ||
103 | + storeId: os.stoid, | ||
104 | + userId: this.data.userId, | ||
105 | + zlUserId: t_user_id | ||
106 | + }; | ||
107 | + console.log(data); | ||
108 | + getApp().request.json_post("/api/weshop/marketing/help/help/task/involve/insert", | ||
109 | + data, //入参 | ||
110 | + function(res) { //成功 | ||
111 | + if (res.data.code == 0) | ||
112 | + th.setData({ | ||
113 | + is_show: 1 | ||
114 | + }); | ||
115 | + else { | ||
116 | + getApp().my_warnning(res.data.msg, 0, th) | ||
117 | + } | ||
118 | + }, | ||
119 | + function() { //失败 | ||
120 | + | ||
121 | + } | ||
122 | + ) | ||
123 | + | ||
124 | + }, | ||
125 | + //点击关闭礼盒 | ||
126 | + clike_none: function() { | ||
127 | + this.setData({is_show: 0}); | ||
128 | + getApp().goto("/pages/user/assistance/assistance_success"); | ||
129 | + }, | ||
130 | + //导航球 | ||
131 | + close: function() { | ||
132 | + var th = this; | ||
133 | + var nav_b = th.selectComponent("#nav_b"); //组件的id | ||
134 | + nav_b.close_box(); | ||
135 | + nav_b.set_name("助力", ""); | ||
136 | + }, | ||
137 | + | ||
138 | + /** | ||
139 | + * 页面上拉触底事件的处理函数 | ||
140 | + */ | ||
141 | + onReachBottom: function() { | ||
142 | + | ||
143 | + }, | ||
144 | + | ||
145 | + /** | ||
146 | + * 用户点击右上角分享 | ||
147 | + */ | ||
148 | + onShareAppMessage: function() { | ||
149 | + | ||
150 | + }, | ||
151 | + | ||
152 | +}) |
pages/user/assistance/friend_assistance.json
0 → 100644
pages/user/assistance/friend_assistance.wxml
0 → 100644
1 | +<wxs module="filter" src="c_filter.wxs"></wxs> | ||
2 | +<view class="top-back" style="background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)"> | ||
3 | + <view class="flex-vertical user_assis"> | ||
4 | + <image class="circle user_img" src="{{user.head_pic}}"></image> | ||
5 | + <view class="user_name white fs28 ellipsis-1">{{user.nickname}}</view> | ||
6 | + </view> | ||
7 | + <view class="caption_title white fs32 t-c"> | ||
8 | + 拜托拜托,帮我拆礼盒得好礼~ | ||
9 | + </view> | ||
10 | + <!-- 礼包图片 --> | ||
11 | +<view class="t-c"> | ||
12 | +<image class="assis_liba" src="{{iurl}}/miniapp/images/friendhelp/libao_asiss.png"> | ||
13 | +</image> | ||
14 | +</view> | ||
15 | + <view class="flex jc-center"> | ||
16 | + <view class="activity_time fs24 white"> | ||
17 | + 活动时间:{{filter.fm_time(zl_act.beginDate)}}-{{filter.fm_time(zl_act.beginDate)}} | ||
18 | + </view> | ||
19 | + </view> | ||
20 | +</view> | ||
21 | +<view class="cklie_button t-c flex-center" bindtap="cklie_button">帮他拆礼盒</view> | ||
22 | +<view class="fs26 white t-c" wx:if="{{s_num}}">已有{{s_num}}人领取礼盒</view> | ||
23 | +<!-- 礼盒弹框 --> | ||
24 | +<view class="cover-layer" wx:if='{{is_show!=0}}' bindtap="clike_none"></view> | ||
25 | +<view class="libao_frame t-c" wx:if='{{is_show!=0}}'> | ||
26 | + <view class="layer-img" style="background-image: url({{iurl}}/miniapp/images/friendhelp/success.png)"> | ||
27 | + <view class="button-img t-c fs28 flex-center" style="background-image: url({{iurl}}/miniapp/images/friendhelp/participate.png)"bindtap="participate_activity" > | ||
28 | + 我也要参加 | ||
29 | + </view> | ||
30 | + <view class=" fs24 success white t-c">已成功帮你的小伙伴助力!</view> | ||
31 | + </view> | ||
32 | + <view class="link_div"> | ||
33 | +</view> | ||
34 | +<image class="close-none"bindtap="clike_none" src="{{iurl}}/miniapp/images/plus/Close.png"></image> | ||
35 | +</view> | ||
36 | +<!-- 引入提示组件 --> | ||
37 | +<warn id="warn"></warn> | ||
38 | +<!-- 制作一个圆球导航 --> | ||
39 | +<nav_b id="nav_b"></nav_b> | ||
0 | \ No newline at end of file | 40 | \ No newline at end of file |
pages/user/assistance/friend_assistance.wxss
0 → 100644
1 | +page{ | ||
2 | + background: #d01119; | ||
3 | + width: 100%; | ||
4 | + height: 100% | ||
5 | + | ||
6 | +} | ||
7 | +.top-back{ | ||
8 | + width: 100%; | ||
9 | + height: 60%; | ||
10 | + background-repead:no-repead; | ||
11 | + background-size:100% 100%; | ||
12 | + | ||
13 | +} | ||
14 | +.user_img{ | ||
15 | + width: 70rpx; | ||
16 | + height: 70rpx; | ||
17 | + margin-right: 15rpx; | ||
18 | + | ||
19 | +} | ||
20 | +.user_assis{ | ||
21 | + width: 85%; | ||
22 | + margin: auto; | ||
23 | + padding-top: 50rpx; | ||
24 | +} | ||
25 | +.caption_title{ | ||
26 | + margin-top: 60rpx; | ||
27 | + margin-bottom: 30rpx; | ||
28 | +} | ||
29 | +.assis_liba{ | ||
30 | + width: 50%; | ||
31 | + margin: auto; | ||
32 | + height: 340rpx; | ||
33 | + | ||
34 | +} | ||
35 | +.activity_time{ | ||
36 | + border-bottom: 1rpx solid #fff; | ||
37 | + margin: auto; | ||
38 | + display: inline; | ||
39 | +} | ||
40 | +.cklie_button{ | ||
41 | + margin: auto; | ||
42 | + width: 60%; | ||
43 | + height: 80rpx; | ||
44 | + border-radius: 50rpx; | ||
45 | + margin-top: 20rpx; | ||
46 | + background: #fbda0e; | ||
47 | + color:#d01119; | ||
48 | + line-height: 80rpx; | ||
49 | + letter-spacing: 5rpx; | ||
50 | + box-shadow: 0rpx 7rpx 0rpx 0rpx rgb(245, 119, 6); | ||
51 | + font-size: 44rpx; | ||
52 | + margin-bottom: 40rpx; | ||
53 | +} | ||
54 | +.con_div{ | ||
55 | +z-index: 15; | ||
56 | +position: fixed; | ||
57 | +top: 0; | ||
58 | +left: 0; | ||
59 | +height: 100%; | ||
60 | +width: 100%; | ||
61 | +} | ||
62 | +.layer-img{ | ||
63 | + width: 100%; | ||
64 | + height: 515rpx; | ||
65 | + background-repead:no-repead; | ||
66 | + background-size:100% 100%; | ||
67 | +} | ||
68 | +.libao_frame{ | ||
69 | +z-index: 15; | ||
70 | +position: fixed; | ||
71 | +width: 70%; | ||
72 | +top: 37.5%; | ||
73 | +left: 50%; | ||
74 | +transform: translate(-50%, -50%); | ||
75 | +height: auto; | ||
76 | + | ||
77 | +} | ||
78 | +.button-img{ | ||
79 | + width: 60%; | ||
80 | + margin: auto; | ||
81 | + color: #d01119; | ||
82 | + height: 75rpx; | ||
83 | + line-height: 72rpx; | ||
84 | + background-repead:no-repead; | ||
85 | + background-size:100% 100%; | ||
86 | + position: absolute; | ||
87 | + left: 19%; | ||
88 | + bottom: 43%; | ||
89 | +} | ||
90 | +.success{ | ||
91 | + position: absolute; | ||
92 | + left: 23%; | ||
93 | + bottom: 36%; | ||
94 | +} | ||
95 | +.link_div{ | ||
96 | + width: 3rpx; | ||
97 | + height: 125rpx; | ||
98 | + background: #fff; | ||
99 | + margin: auto; | ||
100 | + | ||
101 | +} | ||
102 | +.close-none{ | ||
103 | +width: 70rpx; | ||
104 | +height: 70rpx; | ||
105 | + | ||
106 | +} | ||
107 | + |
pages/user/assistance/giftpacklist.js
0 → 100644
1 | +var e = getApp(), | ||
2 | + a = e.globalData.setting, | ||
3 | + os = a, | ||
4 | + t = e.request, | ||
5 | + d = e.globalData; | ||
6 | +var ut = require("../../../utils/util.js"); | ||
7 | + | ||
8 | +Page({ | ||
9 | + data: { | ||
10 | + url: a.url, //接口网址 | ||
11 | + iurl: a.imghost, //图片前缀网址 | ||
12 | + isBuy: 0, | ||
13 | + getGiftID: '', //礼包id | ||
14 | + giftImage: '', | ||
15 | + giftTitle: '', | ||
16 | + giftDate: '', | ||
17 | + giftPrice: '', | ||
18 | + giftIntegral: '', | ||
19 | + giftPosPrice: '', | ||
20 | + giftQty: '', | ||
21 | + giftRemark: '', | ||
22 | + giftType: '', | ||
23 | + actTitle: '', | ||
24 | + getUrl: '', | ||
25 | + wareCard: [], | ||
26 | + orderSn: "", //订单编号 | ||
27 | + lbId: "", | ||
28 | + code: "", //核销码 | ||
29 | + c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期 | ||
30 | + is_lb: 0, //是否有礼包 | ||
31 | + }, | ||
32 | + onLoad: function (options) { | ||
33 | + var th = this; | ||
34 | + th.setData({ | ||
35 | + isBuy: options.isBuy, | ||
36 | + getStorageID: a.stoid, | ||
37 | + getUserID: d.user_id, | ||
38 | + getGiftID: options.lbId, | ||
39 | + orderSn: options.orderSn | ||
40 | + }) | ||
41 | + if (options.isBuy == 0) { | ||
42 | + th.GetMyGiftList(); | ||
43 | + } else { | ||
44 | + th.GetBuyGiftList(); | ||
45 | + } | ||
46 | + th.setData({ | ||
47 | + giftRemark: th.data.giftRemark.replace(/<p><img/gi, "<p class='img'><img") | ||
48 | + }) | ||
49 | + th.close(); | ||
50 | + }, | ||
51 | + onShow: function () { | ||
52 | + | ||
53 | + }, | ||
54 | + GetBuyPrice: function (e) { | ||
55 | + var that = this.data; | ||
56 | + var th = this; | ||
57 | + // var id = e.currentTarget.dataset.id;//活动id | ||
58 | + var my_confirm = th.selectComponent("#my_confirm"); //组件的id | ||
59 | + my_confirm.open( | ||
60 | + "是否确定购买该礼包", | ||
61 | + "取消", | ||
62 | + "确定", | ||
63 | + function () { | ||
64 | + my_confirm.open_cancel(0); | ||
65 | + }, | ||
66 | + function () { | ||
67 | + my_confirm.open_cancel(0); | ||
68 | + var json = { | ||
69 | + "actId": '', //活动Id | ||
70 | + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | ||
71 | + "buyType": '2', //1=积分兑换 2=余额购买 | ||
72 | + "lbId": that.getGiftID, //礼包Id | ||
73 | + "storeId": that.getStorageID, //商家Id | ||
74 | + "userId": that.getUserID, //用户ID | ||
75 | + "buyFrom": 2 | ||
76 | + }; | ||
77 | + var data = JSON.stringify(json); | ||
78 | + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | ||
79 | + wx.request({ | ||
80 | + url: url, | ||
81 | + data: data, | ||
82 | + method: 'post', | ||
83 | + header: { | ||
84 | + 'content-type': 'application/json' | ||
85 | + }, // 设置请求的 header | ||
86 | + success: function (res) { | ||
87 | + if (res.data.code == 0) { | ||
88 | + res = res.data.data; | ||
89 | + wx.requestPayment({ | ||
90 | + timeStamp: String(res.timeStamp), | ||
91 | + nonceStr: res.nonceStr, | ||
92 | + package: res.packageValue, | ||
93 | + signType: res.signType, | ||
94 | + paySign: res.paySign, | ||
95 | + success: function (n) { | ||
96 | + | ||
97 | + }, | ||
98 | + fail: function (n) { | ||
99 | + | ||
100 | + } | ||
101 | + }); | ||
102 | + } else { | ||
103 | + getApp().my_warnning(res.data.msg, 0, th); | ||
104 | + } | ||
105 | + } | ||
106 | + }) | ||
107 | + | ||
108 | + } | ||
109 | + | ||
110 | + | ||
111 | + ) | ||
112 | + | ||
113 | + | ||
114 | + }, | ||
115 | + GetBuyIntegral: function (e) { | ||
116 | + var that = this.data; | ||
117 | + var th = this; | ||
118 | + // var id = e.currentTarget.dataset.id;//活动id | ||
119 | + var my_confirm = th.selectComponent("#my_confirm"); //组件的id | ||
120 | + my_confirm.open( | ||
121 | + "是否确定兑换该礼包", | ||
122 | + "取消", | ||
123 | + "确定", | ||
124 | + function () { | ||
125 | + my_confirm.open_cancel(0); | ||
126 | + }, | ||
127 | + function () { | ||
128 | + my_confirm.open_cancel(0); | ||
129 | + var json = { | ||
130 | + "actId": '', //活动Id | ||
131 | + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | ||
132 | + "buyType": '1', //1=积分兑换 2=余额购买 | ||
133 | + "lbId": that.getGiftID, //礼包Id | ||
134 | + "storeId": that.getStorageID, //商家Id | ||
135 | + "userId": that.getUserID //用户ID | ||
136 | + }; | ||
137 | + var data = JSON.stringify(json); | ||
138 | + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | ||
139 | + wx.request({ | ||
140 | + url: url, | ||
141 | + data: data, | ||
142 | + method: 'post', | ||
143 | + header: { | ||
144 | + 'content-type': 'application/json' | ||
145 | + }, // 设置请求的 header | ||
146 | + success: function (res) { | ||
147 | + if (res.data.code == 0) { | ||
148 | + getApp().my_warnning("兑换成功!", 1, th); | ||
149 | + } else { | ||
150 | + getApp().my_warnning(res.data.msg, 0, th); | ||
151 | + } | ||
152 | + } | ||
153 | + }) | ||
154 | + | ||
155 | + }) | ||
156 | + | ||
157 | + | ||
158 | + }, | ||
159 | + GetMyGiftList: function () { | ||
160 | + var _this = this; | ||
161 | + var th = this; | ||
162 | + getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { | ||
163 | + data: { | ||
164 | + "storeId": th.data.getStorageID, //商家ID | ||
165 | + "userId": th.data.getUserID, //用户ID | ||
166 | + "orderSn": th.data.orderSn | ||
167 | + }, | ||
168 | + success: function success(res) { | ||
169 | + if (res.data.code == 0) { | ||
170 | + th.setData({ | ||
171 | + giftImage: th.data.iurl + res.data.data.lbUrl, | ||
172 | + giftTitle: res.data.data.giftTitle | ||
173 | + }) | ||
174 | + if (res.data.data.giftRemark == '') { | ||
175 | + th.setData({ | ||
176 | + giftRemark: '暂无详情......' | ||
177 | + }) | ||
178 | + } else { | ||
179 | + th.setData({ | ||
180 | + giftRemark: res.data.data.giftRemark | ||
181 | + }) | ||
182 | + } | ||
183 | + | ||
184 | + //---获取日期的时间戳--- | ||
185 | + var t_endtime = res.data.data.endTime; | ||
186 | + t_endtime = t_endtime.replace(/-/g, '/'); | ||
187 | + var t_date = new Date(t_endtime) / 1000; | ||
188 | + var t_now = ut.gettimestamp(); | ||
189 | + | ||
190 | + if (res.data.data.goodsUseState) th.setData({ | ||
191 | + c_state: 1 | ||
192 | + }) | ||
193 | + else if (t_date <= t_now) | ||
194 | + th.setData({ | ||
195 | + c_state: 2 | ||
196 | + }) | ||
197 | + | ||
198 | + th.setData({ | ||
199 | + giftDate: res.data.data.endTime, | ||
200 | + giftPosPrice: res.data.data.giftPosPrice, | ||
201 | + giftQty: res.data.data.giftQty, | ||
202 | + giftIntegral: res.data.data.payIntegral, | ||
203 | + giftPrice: res.data.data.payMoney, | ||
204 | + giftType: res.data.data.actType, | ||
205 | + actTitle: res.data.data.actTitle, | ||
206 | + wareCard: res.data.data.wareCard, | ||
207 | + lbId: res.data.data.lbId | ||
208 | + }) | ||
209 | + //判断是否有礼包 | ||
210 | + for (var i = 0; i < res.data.data.wareCard.length; i++) { | ||
211 | + if (res.data.data.wareCard[i].lbType == 1) { | ||
212 | + th.setData({ | ||
213 | + is_lb: 1 | ||
214 | + }) | ||
215 | + break; | ||
216 | + } | ||
217 | + } | ||
218 | + } else { | ||
219 | + getApp().my_warnning("系统繁忙,请稍后再试", 0, th); | ||
220 | + return false; | ||
221 | + } | ||
222 | + } | ||
223 | + }); | ||
224 | + | ||
225 | + }, | ||
226 | + GetBuyGiftList: function () { | ||
227 | + var _this2 = this; | ||
228 | + var th = this.data; | ||
229 | + getApp().request.get('/api/weshop/marketing/giftbag/detail/get', { | ||
230 | + data: { | ||
231 | + "storeId": th.getStorageID, //商家ID | ||
232 | + "userId": th.getUserID, //用户ID | ||
233 | + "giftBagId": th.getGiftID | ||
234 | + }, | ||
235 | + success: function success(res) { | ||
236 | + if (res.data.code == 0) { | ||
237 | + _this2.setData({ | ||
238 | + giftImage: th.iurl + res.data.data.lbUrl, | ||
239 | + giftTitle: res.data.data.giftTitle | ||
240 | + }) | ||
241 | + if (res.data.data.giftRemark == '') { | ||
242 | + | ||
243 | + _this2.setData({ | ||
244 | + giftRemark: '暂无详情......' | ||
245 | + }) | ||
246 | + } else { | ||
247 | + _this2.setData({ | ||
248 | + giftRemark: res.data.data.giftRemark | ||
249 | + }) | ||
250 | + } | ||
251 | + | ||
252 | + _this2.setData({ | ||
253 | + giftDate: res.data.data.endTime, | ||
254 | + giftPosPrice: res.data.data.giftPosPrice, | ||
255 | + giftQty: res.data.data.giftQty, | ||
256 | + giftIntegral: res.data.data.payIntegral, | ||
257 | + giftPrice: res.data.data.payMoney, | ||
258 | + giftType: res.data.data.actType, | ||
259 | + actTitle: res.data.data.actTitle, | ||
260 | + wareCard: res.data.data.wareCard | ||
261 | + }) | ||
262 | + } else { | ||
263 | + getApp().my_warnning("系统繁忙,请稍后再试", 0, _this2); | ||
264 | + return false; | ||
265 | + } | ||
266 | + } | ||
267 | + }); | ||
268 | + | ||
269 | + }, | ||
270 | + //显示核销码 | ||
271 | + code_show: function (e) { | ||
272 | + var th = this; | ||
273 | + //--获取成功的时候-- | ||
274 | + var no = th.data.code; | ||
275 | + var qc_com = th.selectComponent("#qc_com"); //组件的id | ||
276 | + var obj = { | ||
277 | + val: no, | ||
278 | + content: "请将二维码展示给核销员,收货更快捷" | ||
279 | + }; | ||
280 | + qc_com.open(obj) | ||
281 | + }, | ||
282 | + //获取核销码 | ||
283 | + getcode: function () { | ||
284 | + var th = this; | ||
285 | + var orderSn = th.data.orderSn; //订单号 | ||
286 | + var json = { | ||
287 | + "storeId": a.stoid, | ||
288 | + "orderSn": orderSn | ||
289 | + }; | ||
290 | + var data = JSON.stringify(json); | ||
291 | + var url = th.data.url + "/api/weshop/marketing/gift/goods/verify/code/get"; //预约接口地址 | ||
292 | + wx.request({ | ||
293 | + url: url, | ||
294 | + data: data, | ||
295 | + method: 'put', | ||
296 | + header: { | ||
297 | + 'content-type': 'application/json' | ||
298 | + }, // 设置请求的 header | ||
299 | + success: function (res) { | ||
300 | + if (res.data.code == 0) { | ||
301 | + th.setData({ | ||
302 | + code: res.data.data | ||
303 | + }) | ||
304 | + th.code_show(); | ||
305 | + } else { | ||
306 | + getApp().my_warnning(res.data.msg, 0, th); | ||
307 | + } | ||
308 | + } | ||
309 | + }) | ||
310 | + }, | ||
311 | + //界面跳转 | ||
312 | + goto: function (e) { | ||
313 | + var th = this; | ||
314 | + var url = e.currentTarget.dataset.url; | ||
315 | + getApp().goto(url); | ||
316 | + }, | ||
317 | + //图片失败,默认图片 | ||
318 | + bind_bnerr2: function (e) { | ||
319 | + var _errImg = e.target.dataset.errorimg; | ||
320 | + var _errObj = {}; | ||
321 | + _errObj[_errImg] = "/public/images/empty.jpg"; | ||
322 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
323 | + | ||
324 | + }, | ||
325 | + //关闭导航 | ||
326 | + close: function () { | ||
327 | + var th = this; | ||
328 | + var nav_b = th.selectComponent("#nav_b"); //组件的id | ||
329 | + nav_b.close_box(); | ||
330 | + nav_b.set_name("礼包", "/pages/giftpack/buygiftpack/giftpackbuy"); | ||
331 | + } | ||
332 | +}); | ||
0 | \ No newline at end of file | 333 | \ No newline at end of file |
pages/user/assistance/giftpacklist.json
0 → 100644
1 | +{ | ||
2 | + "navigationBarTitleText": "助力详情", | ||
3 | + "usingComponents": { | ||
4 | + "warn": "/components/long_warn/long_warn", | ||
5 | + "my_confirm": "/components/my_confirm/my_confirm", | ||
6 | + "qr_code": "/components/qr_code/qr_code", | ||
7 | + "nav_b": "/components/nav_b/nav_b" | ||
8 | + } | ||
9 | +} | ||
0 | \ No newline at end of file | 10 | \ No newline at end of file |
pages/user/assistance/giftpacklist.wxml
0 → 100644
1 | +<view class="box data-v-3a5b7e36"> | ||
2 | + <view class="box_top data-v-3a5b7e36"> | ||
3 | + <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="giftImage"></image> | ||
4 | + </view> | ||
5 | + <view class="box_title data-v-3a5b7e36"> | ||
6 | + <view class="top_title data-v-3a5b7e36"> | ||
7 | + <text class="data-v-3a5b7e36 ellipsis-2">{{giftTitle}}</text> | ||
8 | + </view> | ||
9 | + <view class="top_time data-v-3a5b7e36"> | ||
10 | + <text class="data-v-3a5b7e36">{{"兑换截至时间:"+giftDate}}</text> | ||
11 | + </view> | ||
12 | + <view class="top_price data-v-3a5b7e36"> | ||
13 | + <block wx:if="{{giftPrice>0}}"> | ||
14 | + <text class="data-v-3a5b7e36">{{"¥"+giftPrice}}</text> | ||
15 | + </block> | ||
16 | + <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> | ||
17 | + <text class="data-v-3a5b7e36">/</text> | ||
18 | + </block> | ||
19 | + <block wx:if="{{giftIntegral>0}}"> | ||
20 | + <text class="data-v-3a5b7e36">{{giftIntegral+"积分"}}</text> | ||
21 | + </block> | ||
22 | + <block wx:if="{{giftType>0}}"> | ||
23 | + <text class="data-v-3a5b7e36">{{actTitle}}</text> | ||
24 | + </block> | ||
25 | + </view> | ||
26 | + <view class="top_foot data-v-3a5b7e36"> | ||
27 | + <view class="top_foot_price data-v-3a5b7e36"> | ||
28 | + <text class="data-v-3a5b7e36">{{"原价:"+giftPosPrice+"元"}}</text> | ||
29 | + </view> | ||
30 | + <view class="top_foot_qty data-v-3a5b7e36"> | ||
31 | + <text class="data-v-3a5b7e36">{{"已售:"+giftQty+"件"}}</text> | ||
32 | + </view> | ||
33 | + </view> | ||
34 | + </view> | ||
35 | + <view class="box_ware data-v-3a5b7e36"> | ||
36 | + <view class="box_ware_title data-v-3a5b7e36"> | ||
37 | + <text class="data-v-3a5b7e36">礼包内容</text> | ||
38 | + </view> | ||
39 | + <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> | ||
40 | + <view class="box_ware_box data-v-3a5b7e36"> | ||
41 | + <view class="box_ware_img data-v-3a5b7e36"> | ||
42 | + <block wx:if="{{item.lbType==1}}"> | ||
43 | + <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> | ||
44 | + </block> | ||
45 | + <block wx:if="{{item.lbType==2}}"> | ||
46 | + <image src="{{iurl+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> | ||
47 | + </block> | ||
48 | + <block wx:if="{{item.lbType==3}}"> | ||
49 | + <image src="{{iurl+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> | ||
50 | + </block> | ||
51 | + <block wx:if="{{item.lbType==4}}"> | ||
52 | + <image src="{{iurl+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> | ||
53 | + </block> | ||
54 | + <block wx:if="{{item.lbType==5}}"> | ||
55 | + <image src="{{iurl+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image> | ||
56 | + </block> | ||
57 | + </view> | ||
58 | + <view class="box_ware_item data-v-3a5b7e36"> | ||
59 | + <view class="box_ware_item_title data-v-3a5b7e36"> | ||
60 | + <text class="data-v-3a5b7e36">{{item.couponName}}</text> | ||
61 | + </view> | ||
62 | + <view class="box_ware_item_price data-v-3a5b7e36"> | ||
63 | + <text class="data-v-3a5b7e36"></text> | ||
64 | + </view> | ||
65 | + <view class="box_ware_item_qty data-v-3a5b7e36"> | ||
66 | + <text class="data-v-3a5b7e36 ellipsis-1">{{"数量:"+item.num}}</text> | ||
67 | + </view> | ||
68 | + <view class="box_ware_code data-v-3a5b7e36"> | ||
69 | + <block wx:if="{{c_state==0}}"> | ||
70 | + <block wx:if="{{isBuy==0&item.lbType==1}}"> | ||
71 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" class="data-v-3a5b7e36"></image> | ||
72 | + </block> | ||
73 | + </block> | ||
74 | + <block wx:else> | ||
75 | + <block wx:if="{{isBuy==0&item.lbType==1}}"> | ||
76 | + <image src="{{iurl+'/miniapp/images/giftbag/gift08.png'}}" lazy-load="true" class="data-v-3a5b7e36"></image> | ||
77 | + </block> | ||
78 | + </block> | ||
79 | + <block wx:if="{{isBuy==0&item.lbType==2}}"> | ||
80 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/coupons/coupons" bindtap="goto"></image> | ||
81 | + </block> | ||
82 | + <block wx:if="{{isBuy==0&item.lbType==3}}"> | ||
83 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/my_service/i_service" bindtap="goto"></image> | ||
84 | + </block> | ||
85 | + <block wx:if="{{isBuy==0&item.lbType>3}}"> | ||
86 | + <text class="data-v-3a5b7e36">奖励已发放</text> | ||
87 | + </block> | ||
88 | + </view> | ||
89 | + </view> | ||
90 | + </view> | ||
91 | + </block> | ||
92 | + </view> | ||
93 | + <view class="foot_box data-v-3a5b7e36"> | ||
94 | + <view class="foot_box_title data-v-3a5b7e36"> | ||
95 | + <text class="data-v-3a5b7e36">活动说明</text> | ||
96 | + </view> | ||
97 | + <view class="foot_box_remark data-v-3a5b7e36"> | ||
98 | + <rich-text nodes="{{giftRemark}}"></rich-text> | ||
99 | + </view> | ||
100 | + </view> | ||
101 | + <view class="foot_empty data-v-3a5b7e36"></view> | ||
102 | + <block wx:if="{{isBuy==1}}"> | ||
103 | + <view class="foot_button data-v-3a5b7e36"> | ||
104 | + <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> | ||
105 | + <view class="foot_button_left data-v-3a5b7e36" data-id="{{lbId}}" bindtap="GetBuyPrice"> | ||
106 | + <text class="data-v-3a5b7e36">立即购买</text> | ||
107 | + </view> | ||
108 | + </block> | ||
109 | + <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> | ||
110 | + <view class="foot_button_right data-v-3a5b7e36" bindtap="GetBuyIntegral" data-id="{{lbId}}"> | ||
111 | + <text class="data-v-3a5b7e36">立即兑换</text> | ||
112 | + </view> | ||
113 | + </block> | ||
114 | + <block wx:if="{{giftPrice>0 && giftIntegral<=0}}"> | ||
115 | + <view class="foot_button_buy data-v-3a5b7e36" bindtap="GetBuyPrice" data-id="{{lbId}}"> | ||
116 | + <text class="data-v-3a5b7e36">立即购买</text> | ||
117 | + </view> | ||
118 | + </block> | ||
119 | + <block wx:if="{{giftPrice<=0 && giftIntegral>0}}"> | ||
120 | + <view class="foot_button_intalge data-v-3a5b7e36" bindtap="GetBuyIntegral" data-id="{{lbId}}"> | ||
121 | + <text class="data-v-3a5b7e36">立即兑换</text> | ||
122 | + </view> | ||
123 | + </block> | ||
124 | + </view> | ||
125 | + </block> | ||
126 | + <block wx:if="{{isBuy==0}}"> | ||
127 | + <view class="foot_button data-v-3a5b7e36"> | ||
128 | + <block wx:if="{{is_lb!=1}}"> | ||
129 | + <view class="foot_button_buy data-v-3a5b7e36 overdue"> | ||
130 | + <text class="data-v-3a5b7e36">无核销商品</text> | ||
131 | + </view> | ||
132 | + </block> | ||
133 | + <block wx:else> | ||
134 | + <view wx:if="{{c_state==0}}" class="foot_button_buy data-v-3a5b7e36" bindtap="getcode"> | ||
135 | + <text class="data-v-3a5b7e36">立即使用</text> | ||
136 | + </view> | ||
137 | + <view wx:if="{{c_state==1}}" class="foot_button_buy data-v-3a5b7e36 overdue"> | ||
138 | + <text class="data-v-3a5b7e36">商品已核销</text> | ||
139 | + </view> | ||
140 | + <view wx:if="{{c_state==2}}" class="foot_button_buy data-v-3a5b7e36 overdue"> | ||
141 | + <text class="data-v-3a5b7e36">商品兑换时间已过</text> | ||
142 | + </view> | ||
143 | + | ||
144 | + </block> | ||
145 | + </view> | ||
146 | + </block> | ||
147 | +</view> | ||
148 | +<!-- 引入提示组件 --> | ||
149 | +<warn id="warn"></warn> | ||
150 | +<my_confirm id="my_confirm"></my_confirm> | ||
151 | +<!-- 弹出框扫描 --> | ||
152 | +<qr_code id="qc_com"></qr_code> | ||
153 | +<!-- 制作一个圆球导航 --> | ||
154 | +<nav_b id="nav_b"></nav_b> | ||
0 | \ No newline at end of file | 155 | \ No newline at end of file |
pages/user/assistance/giftpacklist.wxss
0 → 100644
1 | +@charset "UTF-8"; | ||
2 | + | ||
3 | +/* Author XGQ | ||
4 | + * 2019-12-12 | ||
5 | + */ | ||
6 | + | ||
7 | +.box.data-v-3a5b7e36 { | ||
8 | + -webkit-align-content: center; | ||
9 | + align-content: center; | ||
10 | + background-color: #e85f93; | ||
11 | +} | ||
12 | + | ||
13 | +.box_top.data-v-3a5b7e36 { | ||
14 | + width: 100%; | ||
15 | +} | ||
16 | + | ||
17 | +.box_top image.data-v-3a5b7e36 { | ||
18 | + width: 100%; | ||
19 | + max-height: 540rpx; | ||
20 | +} | ||
21 | + | ||
22 | +.box_title.data-v-3a5b7e36 { | ||
23 | + margin: 10rpx 20rpx 20rpx 20rpx; | ||
24 | + padding: 35rpx; | ||
25 | + background-color: #fff; | ||
26 | + border-radius: 40rpx; | ||
27 | +} | ||
28 | + | ||
29 | +.top_title.data-v-3a5b7e36 { | ||
30 | + font-size: 30rpx; | ||
31 | + margin-bottom: 10rpx; | ||
32 | +} | ||
33 | + | ||
34 | +.top_time.data-v-3a5b7e36 { | ||
35 | + font-size: 27rpx; | ||
36 | + color: #b9b5b5; | ||
37 | +} | ||
38 | + | ||
39 | +.top_price.data-v-3a5b7e36 { | ||
40 | + font-size: 35rpx; | ||
41 | + color: #d61b30; | ||
42 | + margin-top: 30rpx; | ||
43 | + margin-bottom: 5rpx; | ||
44 | +} | ||
45 | + | ||
46 | +.top_foot.data-v-3a5b7e36 { | ||
47 | + display: -webkit-box; | ||
48 | + display: -webkit-flex; | ||
49 | + display: flex; | ||
50 | +} | ||
51 | + | ||
52 | +.top_foot_price.data-v-3a5b7e36 { | ||
53 | + font-size: 22rpx; | ||
54 | + color: #b9b5b5; | ||
55 | + width: 50%; | ||
56 | + text-decoration: line-through; | ||
57 | +} | ||
58 | + | ||
59 | +.top_foot_qty.data-v-3a5b7e36 { | ||
60 | + font-size: 22rpx; | ||
61 | + color: #b9b5b5; | ||
62 | + width: 50%; | ||
63 | + -webkit-align-content: flex-end; | ||
64 | + align-content: flex-end; | ||
65 | + text-align: right; | ||
66 | +} | ||
67 | + | ||
68 | +.box_ware.data-v-3a5b7e36 { | ||
69 | + margin: 10rpx 20rpx 20rpx 20rpx; | ||
70 | + padding: 35rpx; | ||
71 | + background-color: #fff; | ||
72 | + border-radius: 40rpx; | ||
73 | +} | ||
74 | + | ||
75 | +.box_ware_title.data-v-3a5b7e36 { | ||
76 | + font-size: 35rpx; | ||
77 | + margin: 5rpx 0rpx 30rpx 0rpx; | ||
78 | +} | ||
79 | + | ||
80 | +.box_ware_box.data-v-3a5b7e36 { | ||
81 | + display: -webkit-box; | ||
82 | + display: -webkit-flex; | ||
83 | + display: flex; | ||
84 | + margin: 10rpx 0rpx 25rpx 0rpx; | ||
85 | +} | ||
86 | + | ||
87 | +/* .box_ware_img.data-v-3a5b7e36 { | ||
88 | + width: 30%; | ||
89 | + height: 180rpx; | ||
90 | + border: #999999 solid 1rpx; | ||
91 | +} */ | ||
92 | + | ||
93 | +.box_ware_img image.data-v-3a5b7e36 { | ||
94 | + /* width: 185rpx; | ||
95 | + height: 190rpx; *//* background-color: rgba(138, 138, 138, 0.63); */ | ||
96 | + border: 2rpx solid #999; | ||
97 | + width: 120rpx; | ||
98 | + height: 120rpx; | ||
99 | +} | ||
100 | + | ||
101 | +.box_ware_item.data-v-3a5b7e36 { | ||
102 | + width: 70%; | ||
103 | + margin-left: 25rpx; | ||
104 | + position: relative; | ||
105 | +} | ||
106 | + | ||
107 | +.box_ware_item_title.data-v-3a5b7e36 { | ||
108 | + font-size: 24rpx; | ||
109 | + word-break: break-all; | ||
110 | + text-overflow: ellipsis; | ||
111 | + display: -webkit-box; | ||
112 | + -webkit-box-orient: vertical; | ||
113 | + -webkit-line-clamp: 2; | ||
114 | + overflow: hidden; | ||
115 | +} | ||
116 | + | ||
117 | +.box_ware_count.data-v-3a5b7e36 { | ||
118 | + display: -webkit-box; | ||
119 | + display: -webkit-flex; | ||
120 | + display: flex; | ||
121 | +} | ||
122 | + | ||
123 | +.box_ware_item_price.data-v-3a5b7e36 { | ||
124 | + font-size: 25rpx; | ||
125 | + color: #b9b5b5; | ||
126 | + position: absolute; | ||
127 | + bottom: 60rpx; | ||
128 | + left: 0; | ||
129 | +} | ||
130 | + | ||
131 | +.box_ware_item_qty.data-v-3a5b7e36 { | ||
132 | + font-size: 22rpx; | ||
133 | + position: absolute; | ||
134 | + bottom: 15rpx; | ||
135 | + left: 0; | ||
136 | +} | ||
137 | + | ||
138 | +.box_ware_code.data-v-3a5b7e36 { | ||
139 | + position: absolute; | ||
140 | + right: 10rpx; | ||
141 | + bottom: 10rpx; | ||
142 | +} | ||
143 | + | ||
144 | +.box_ware_code image.data-v-3a5b7e36 { | ||
145 | + width: 50rpx; | ||
146 | + height: 50rpx; | ||
147 | +} | ||
148 | + | ||
149 | +.box_ware_code text.data-v-3a5b7e36 { | ||
150 | + font-size: 20rpx; | ||
151 | +} | ||
152 | + | ||
153 | +.foot_box.data-v-3a5b7e36 { | ||
154 | + margin: 10rpx 20rpx 50rpx 20rpx; | ||
155 | + padding: 35rpx; | ||
156 | + background-color: #fff; | ||
157 | + border-radius: 40rpx; | ||
158 | +} | ||
159 | + | ||
160 | +.foot_box_title.data-v-3a5b7e36 { | ||
161 | + font-size: 35rpx; | ||
162 | + margin-bottom: 30rpx; | ||
163 | +} | ||
164 | + | ||
165 | +.foot_box_remark.data-v-3a5b7e36 { | ||
166 | + font-size: 27rpx; | ||
167 | + line-height: 40rpx; | ||
168 | +} | ||
169 | + | ||
170 | +.foot_empty.data-v-3a5b7e36 { | ||
171 | + height: 90rpx; | ||
172 | +} | ||
173 | + | ||
174 | +.foot_button.data-v-3a5b7e36 { | ||
175 | + display: -webkit-box; | ||
176 | + display: -webkit-flex; | ||
177 | + display: flex; | ||
178 | + margin: 20rpx 0rpx 0rpx 0rpx; | ||
179 | + padding: 25rpx 0rpx; | ||
180 | + background: #fff; | ||
181 | + text-align: center; | ||
182 | + -webkit-box-pack: center; | ||
183 | + -webkit-justify-content: center; | ||
184 | + justify-content: center; | ||
185 | + position: fixed; | ||
186 | + bottom: 0; | ||
187 | + left: 0; | ||
188 | + width: 100%; | ||
189 | +} | ||
190 | + | ||
191 | +.foot_button_left.data-v-3a5b7e36 { | ||
192 | + background: #e4010c; | ||
193 | + color: #fff; | ||
194 | + width: 250rpx; | ||
195 | + height: 70rpx; | ||
196 | + font-size: 28rpx; | ||
197 | + line-height: 70rpx; | ||
198 | + border-radius: 40rpx; | ||
199 | +} | ||
200 | + | ||
201 | +.foot_button_right.data-v-3a5b7e36 { | ||
202 | + background: #ffbb42; | ||
203 | + color: #fff; | ||
204 | + width: 250rpx; | ||
205 | + height: 70rpx; | ||
206 | + font-size: 28rpx; | ||
207 | + line-height: 70rpx; | ||
208 | + border-radius: 40rpx; | ||
209 | +} | ||
210 | + | ||
211 | +.foot_button_buy.data-v-3a5b7e36 { | ||
212 | + background: #e4010c; | ||
213 | + color: #fff; | ||
214 | + width: 400rpx; | ||
215 | + height: 70rpx; | ||
216 | + font-size: 28rpx; | ||
217 | + line-height: 70rpx; | ||
218 | + border-radius: 40rpx; | ||
219 | +} | ||
220 | + | ||
221 | +.foot_button_intalge.data-v-3a5b7e36 { | ||
222 | + background: #ffbb42; | ||
223 | + color: #fff; | ||
224 | + width: 400rpx; | ||
225 | + height: 70rpx; | ||
226 | + font-size: 28rpx; | ||
227 | + line-height: 70rpx; | ||
228 | + border-radius: 40rpx; | ||
229 | +} | ||
230 | + | ||
231 | +page.data-v-3a5b7e36 { | ||
232 | + background-color: #e85f93; | ||
233 | +} | ||
234 | + | ||
235 | +.foot_box_remark.data-v-3a5b7e36 ._img { | ||
236 | + width: 100%; | ||
237 | +} | ||
238 | + | ||
239 | +.foot_box_remark.data-v-3a5b7e36 .img { | ||
240 | + line-height: 0; | ||
241 | +} | ||
242 | +.overdue.data-v-3a5b7e36{ | ||
243 | + background-color: rgb(153,153,153); | ||
244 | +} | ||
0 | \ No newline at end of file | 245 | \ No newline at end of file |
pages/user/assistance/surplus_time.wxs
0 → 100644
pages/user/assistance/task_assistance.js
0 → 100644
1 | +var auth = require("../../../utils/auth.js"), | ||
2 | + rq = require("../../../utils/request.js"); | ||
3 | +var e = getApp(), | ||
4 | + app = e, | ||
5 | + i = require("../../../utils/util.js"), | ||
6 | + ut = i, | ||
7 | + s = e.globalData.setting, | ||
8 | + os = s, | ||
9 | + app_d = e.globalData; | ||
10 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | ||
11 | +Page({ | ||
12 | + | ||
13 | + /** | ||
14 | + * 页面的初始数据 | ||
15 | + */ | ||
16 | + data: { | ||
17 | + sw_index: 0, //轮播的下标控制 | ||
18 | + url: s.url, //接口网址 | ||
19 | + iurl: s.imghost, | ||
20 | + endDate: "", //活动结束时间 | ||
21 | + activity_data: "25:20:59", //活动剩余时间 | ||
22 | + task_number: 0, //任务数 | ||
23 | + is_task: 0, //历史记录与任务 | ||
24 | + aitem: "", //活动的轮播图数据 | ||
25 | + switch_head: 0, //0:我的任务,1:记录 | ||
26 | + help_id: "", //活动的id canvasHidden: 0, //分享图片是否已经生成 | ||
27 | + is_share: 1, //是否显示画布 | ||
28 | + shareImgPath: [], //生成的图片 | ||
29 | + screenWidth: "", //用户的屏幕宽度 | ||
30 | + gid: "", | ||
31 | + timer: null, //全局的定时器 | ||
32 | + user_task_list: null, //会员列表 | ||
33 | + taskid: "", //任务id | ||
34 | + usercount: 0, //参与的人数 | ||
35 | + dismantle: null, //帮拆记录数据集 | ||
36 | + is_shares:111111,//判断是不是要分享的 | ||
37 | + | ||
38 | + //*********************************************start钱 | ||
39 | + canvasHidden: 0, //分享图片是否已经生成 | ||
40 | + is_share: 0, //是否显示画布 | ||
41 | + shareImgPath: [], //生成的图片 | ||
42 | + screenWidth: "", //用户的屏幕宽度 | ||
43 | + gid: "", | ||
44 | + images: ["miniapp/images/friendhelp/help.png", "miniapp/images/friendhelp/background.png", "miniapp/images/friendhelp/no_check.png", | ||
45 | + "miniapp/images/friendhelp/check.png", "miniapp/images/friendhelp/unfinished.png", | ||
46 | + "/public/upload/libao/temp/2019/12-20/51f251f44ea0f67b8efdc5bfa3a434b0.jpg" | ||
47 | + ], //固的分享图片 | ||
48 | + dynamic: [], //已助力的微信头像数组 | ||
49 | + is_generate: 0, //是否重复点击拆一拆 | ||
50 | + already: 0, //已有几人助力 | ||
51 | + lack: 0, //还差几人助力 | ||
52 | + zltime: "", //助力时间 | ||
53 | + //*********************************************end | ||
54 | + }, | ||
55 | + | ||
56 | + /** | ||
57 | + * 生命周期函数--监听页面加载 | ||
58 | + */ | ||
59 | + onLoad: function(options) { | ||
60 | + var help_id = options.help_id; | ||
61 | + var th = this; | ||
62 | + th.setData({ | ||
63 | + help_id: help_id | ||
64 | + }); | ||
65 | + //start 钱 | ||
66 | + if (options.gid != undefined) { | ||
67 | + th.setData({ | ||
68 | + gid: options.gid | ||
69 | + }) | ||
70 | + } | ||
71 | + th.close(); | ||
72 | + th.syinfo(); | ||
73 | + // th.imageinfo(); | ||
74 | + //end | ||
75 | + }, | ||
76 | + | ||
77 | + | ||
78 | + //选中任务保存 | ||
79 | + add_onlicke: function(e) { | ||
80 | + var th = this; | ||
81 | + var taskid = e.target.dataset.taskid; | ||
82 | + var help_id = th.data.help_id; | ||
83 | + var user_id = getApp().globalData.user_id; | ||
84 | + var stoid = os.stoid | ||
85 | + getApp().request.json_post("/api/weshop/marketing/help/help/task/insert", { | ||
86 | + helpId: help_id, | ||
87 | + userId: user_id, | ||
88 | + storeId: stoid, | ||
89 | + taskId: taskid | ||
90 | + }, | ||
91 | + function(res) { | ||
92 | + | ||
93 | + if (res.data.code == 0) { | ||
94 | + console.log(res.data.data); | ||
95 | + getApp().my_warnning(res.data.data, 1, th); | ||
96 | + } else { | ||
97 | + getApp().my_warnning(res.data.msg, 0, th); | ||
98 | + } | ||
99 | + } | ||
100 | + | ||
101 | + ) | ||
102 | + | ||
103 | + }, | ||
104 | + | ||
105 | + | ||
106 | + | ||
107 | + /** | ||
108 | + * 生命周期函数--监听页面初次渲染完成 | ||
109 | + */ | ||
110 | + onReady: function() { | ||
111 | + | ||
112 | + }, | ||
113 | + | ||
114 | + /** | ||
115 | + * 生命周期函数--监听页面显示 | ||
116 | + */ | ||
117 | + onShow: function() { | ||
118 | + this.data.is_timer = 1; | ||
119 | + var th = this; | ||
120 | + var help_id = th.data.help_id; | ||
121 | + var user_id = getApp().globalData.user_id; | ||
122 | + | ||
123 | + /*-----助力活动(判断)-----*/ | ||
124 | + rq.get("/api/weshop/marketing/help/act/judge", { | ||
125 | + data: { | ||
126 | + userId: user_id, | ||
127 | + storeId: os.stoid | ||
128 | + }, | ||
129 | + success: function(res) { | ||
130 | + if (res.data.code == 0) { | ||
131 | + | ||
132 | + var help_data = res.data.data; | ||
133 | + console.log('助力活动(判断)', res.data.data); | ||
134 | + th.setData({ | ||
135 | + endDate: help_data.endDate, | ||
136 | + }); | ||
137 | + | ||
138 | + } | ||
139 | + } | ||
140 | + | ||
141 | + | ||
142 | + }); | ||
143 | + | ||
144 | + | ||
145 | + /*-----获取助力活动的任务-----*/ | ||
146 | + rq.get("/api/weshop/marketing/help/help/task/page", { | ||
147 | + data: { | ||
148 | + helpId: help_id, | ||
149 | + storeId: os.stoid | ||
150 | + }, | ||
151 | + success: function(su) { | ||
152 | + var data = su.data; | ||
153 | + if (data.code != 0) { | ||
154 | + getApp().my_warnning(data.msg, 0, th); | ||
155 | + return false; | ||
156 | + } | ||
157 | + if (data.code == 0) { | ||
158 | + //轮播图的数据 | ||
159 | + var data_aissa = data.data.pageData; | ||
160 | + //当前时间戳 | ||
161 | + var nt = ut.gettimestamp(); | ||
162 | + | ||
163 | + data_aissa.forEach(function(val, ind) { | ||
164 | + | ||
165 | + //已开始 | ||
166 | + if (val.start_time < nt && val.end_time > nt) data_aissa[ind].status = 0; | ||
167 | + //未开始 | ||
168 | + else if (val.start_time > nt && val.end_time > nt) data_aissa[ind].status = 1; | ||
169 | + //已结束 | ||
170 | + else if (val.start_time < nt && val.end_time < nt) data_aissa[ind].status = 2; | ||
171 | + }); | ||
172 | + var task_number = data_aissa[0].giftQty - data_aissa[0].useGiftQty; | ||
173 | + var taskid = data_aissa[0].id; | ||
174 | + | ||
175 | + th.setData({ | ||
176 | + aitem: data_aissa, | ||
177 | + task_number: task_number, | ||
178 | + taskid: taskid | ||
179 | + }); | ||
180 | + | ||
181 | + | ||
182 | + } | ||
183 | + | ||
184 | + } | ||
185 | + }) | ||
186 | + // 分享的 | ||
187 | + // setTimeout(function() { | ||
188 | + // th.shareFrends(); | ||
189 | + // }, 1000) | ||
190 | + //任务时间 设置全局定时器 | ||
191 | + th.data.timer = setInterval(function() { | ||
192 | + th.countDown(); | ||
193 | + }, 1000); | ||
194 | + //会员任务列表 | ||
195 | + this.user_task_list(); | ||
196 | + // 获取会员的参与的任务列表 我的任务 | ||
197 | + this.get_user_task_num(); | ||
198 | + | ||
199 | + }, | ||
200 | + | ||
201 | + | ||
202 | + | ||
203 | + | ||
204 | + | ||
205 | + | ||
206 | + //帮拆记录的 | ||
207 | + dismantle_record: function(e) { | ||
208 | + var aitem = this.data.aitem; //任务的数据集 | ||
209 | + var sw_index = this.data.sw_index; //轮播的下标 | ||
210 | + //任务id | ||
211 | + var taskid = aitem[sw_index].id; | ||
212 | + console.log("任务id", taskid); | ||
213 | + var th = this; | ||
214 | + var index = 1; //获取当前选择的是任务还是活动说明 | ||
215 | + var is_task = th.data.is_task; //0任务,1帮拆 | ||
216 | + console.log("0任务,1帮拆", is_task, ); | ||
217 | + th.setData({ | ||
218 | + is_task: 1, | ||
219 | + switch_head: 1 | ||
220 | + }); | ||
221 | + rq.get("/api/weshop/marketing/help/help/task/involve/page", { | ||
222 | + data: { | ||
223 | + taskId: taskid, | ||
224 | + userId: getApp().globalData.user_id, | ||
225 | + storeId: os.stoid | ||
226 | + }, | ||
227 | + success: function(res) { | ||
228 | + | ||
229 | + if (res.data.code == 0) { | ||
230 | + var dismantle = res.data.data.pageData; | ||
231 | + th.setData({ | ||
232 | + dismantle: dismantle | ||
233 | + }); | ||
234 | + } | ||
235 | + } | ||
236 | + | ||
237 | + }) | ||
238 | + | ||
239 | + | ||
240 | + }, | ||
241 | + | ||
242 | + | ||
243 | + //划动的时候监听 | ||
244 | + onSli: function(e) { | ||
245 | + var th = this; | ||
246 | + var ind = e.detail.current; | ||
247 | + var aitem = this.data.aitem; | ||
248 | + var task_number = aitem[ind].giftQty - aitem[ind].useGiftQty; | ||
249 | + console.log("划动的任务总数", task_number, "任务所有的参数", aitem); | ||
250 | + th.setData({ | ||
251 | + sw_index: ind, | ||
252 | + task_number: task_number | ||
253 | + }); | ||
254 | + console.log("可以领取的的任务数", aitem[ind].giftQty, '已领取的任务数据', aitem[ind].useGiftQty); | ||
255 | + }, | ||
256 | + //导航球 | ||
257 | + close: function() { | ||
258 | + var th = this; | ||
259 | + var nav_b = th.selectComponent("#nav_b"); //组件的id | ||
260 | + nav_b.close_box(); | ||
261 | + nav_b.set_name("助力", ""); | ||
262 | + }, | ||
263 | + // 获取会员的参与的任务列表 我的任务 | ||
264 | + user_task_list: function(e) { | ||
265 | + var th = this; | ||
266 | + | ||
267 | + var index = 0; | ||
268 | + var is_task = th.data.is_task; //0任务,1活动说明 | ||
269 | + var help_id = th.data.help_id; | ||
270 | + var user_id = getApp().globalData.user_id; | ||
271 | + rq.get("/api/weshop/marketing/help/help/user/page", { | ||
272 | + data: { | ||
273 | + helpId: help_id, | ||
274 | + storeId: os.stoid, | ||
275 | + userId: user_id | ||
276 | + }, | ||
277 | + success: function(su) { | ||
278 | + th.setData({ | ||
279 | + is_task: index, | ||
280 | + switch_head: index | ||
281 | + }); | ||
282 | + if (su.data.code == 0) { | ||
283 | + var user_list = su.data.data.pageData; | ||
284 | + console.log("会员列表", user_list); | ||
285 | + th.setData({ | ||
286 | + user_task_list: user_list | ||
287 | + }); | ||
288 | + } else { | ||
289 | + th.setData({ | ||
290 | + user_task_list: null | ||
291 | + }); | ||
292 | + } | ||
293 | + } | ||
294 | + }) | ||
295 | + }, | ||
296 | + //获取助力活动参与的人数 | ||
297 | + get_user_task_num() { | ||
298 | + var th = this; | ||
299 | + var help_id = th.data.help_id; | ||
300 | + rq.get("/api/weshop/marketing/help/involve/help/act/people/count", { | ||
301 | + data: { | ||
302 | + helpId: help_id, | ||
303 | + storeId: os.stoid, | ||
304 | + }, | ||
305 | + success: function(su) { | ||
306 | + console.log(su.data.code, "获取助力活动参与的人数", su.data) | ||
307 | + if (su.data.code == 0) { | ||
308 | + var usercount = su.data.data.countAll; | ||
309 | + | ||
310 | + th.setData({ | ||
311 | + usercount: usercount | ||
312 | + }); | ||
313 | + } else { | ||
314 | + | ||
315 | + } | ||
316 | + } | ||
317 | + }) | ||
318 | + | ||
319 | + }, | ||
320 | + //轮播卡死的重置 | ||
321 | + changeGoodsSwip: function(detail) { | ||
322 | + if (detail.detail.source == "touch") { | ||
323 | + //当页面卡死的时候,current的值会变成0 | ||
324 | + if (detail.detail.current == 0) { | ||
325 | + //有时候这算是正常情况,所以暂定连续出现3次就是卡了 | ||
326 | + let swiperError = this.data.swiperError | ||
327 | + swiperError += 1 | ||
328 | + this.setData({ | ||
329 | + swiperError: swiperError | ||
330 | + }) | ||
331 | + if (swiperError >= 3) { //在开关被触发3次以上 | ||
332 | + console.error(this.data.swiperError) | ||
333 | + this.setData({ | ||
334 | + goodsIndex: this.data.preIndex | ||
335 | + }); //,重置current为正确索引 | ||
336 | + this.setData({ | ||
337 | + swiperError: 0 | ||
338 | + }) | ||
339 | + } | ||
340 | + } else { //正常轮播时,记录正确页码索引 | ||
341 | + this.setData({ | ||
342 | + preIndex: detail.detail.current | ||
343 | + }); | ||
344 | + //将开关重置为0 | ||
345 | + this.setData({ | ||
346 | + swiperError: 0 | ||
347 | + }) | ||
348 | + } | ||
349 | + } | ||
350 | + }, | ||
351 | + | ||
352 | + // 轮播图点击左边 | ||
353 | + click_pre: function() { | ||
354 | + console.log("轮播图点击左边"); | ||
355 | + var index = this.data.sw_index; | ||
356 | + index--; | ||
357 | + if (index < 0) return; | ||
358 | + var aitem = this.data.aitem; | ||
359 | + var task_number = aitem[index].giftQty - aitem[index].useGiftQty; | ||
360 | + this.setData({ | ||
361 | + sw_index: index, | ||
362 | + task_number: task_number | ||
363 | + }) | ||
364 | + | ||
365 | + }, | ||
366 | + //轮播图点击右边 | ||
367 | + click_next: function() { | ||
368 | + | ||
369 | + var index = this.data.sw_index; | ||
370 | + index++; | ||
371 | + console.log("轮播图点击右边"); | ||
372 | + if (index >= this.data.aitem.length) return; | ||
373 | + var aitem = this.data.aitem; | ||
374 | + var task_number = aitem[index].giftQty - aitem[index].useGiftQty; | ||
375 | + this.setData({ | ||
376 | + sw_index: index, | ||
377 | + task_number: task_number | ||
378 | + }) | ||
379 | + | ||
380 | + }, | ||
381 | + | ||
382 | + /** | ||
383 | + * 生命周期函数--监听页面隐藏 | ||
384 | + */ | ||
385 | + onHide: function() { | ||
386 | + //--清理定时器-- | ||
387 | + console.log("清理定时器"); | ||
388 | + clearInterval(this.timer); | ||
389 | + }, | ||
390 | + | ||
391 | + /** | ||
392 | + * 生命周期函数--监听页面卸载 | ||
393 | + */ | ||
394 | + onUnload: function() { | ||
395 | + | ||
396 | + }, | ||
397 | + | ||
398 | + /** | ||
399 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
400 | + */ | ||
401 | + onPullDownRefresh: function() { | ||
402 | + | ||
403 | + }, | ||
404 | + //----助力任务的时间----- | ||
405 | + countDown() { | ||
406 | + if (!this.data.is_timer) return false; | ||
407 | + var th = this; | ||
408 | + // 获取当前时间,同时得到活动结束时间数组 | ||
409 | + var newTime = ut.gettimestamp(); | ||
410 | + var List = this.data.aitem; | ||
411 | + for (var j = 0; j < List.length; j++) { | ||
412 | + var o = List[j]; | ||
413 | + | ||
414 | + // 对结束时间进行处理渲染到页面 | ||
415 | + | ||
416 | + // var o = endTimeList[i]; | ||
417 | + var endTime = o.endDate | ||
418 | + | ||
419 | + // if (o.status == 0) endTime = o.start_time | ||
420 | + | ||
421 | + var obj = null; | ||
422 | + // 如果活动未结束,对时间进行处理 | ||
423 | + if (endTime - newTime > 0) { | ||
424 | + | ||
425 | + var time = (endTime - newTime); | ||
426 | + // 获取天、时、分、秒 | ||
427 | + var day = parseInt(time / (60 * 60 * 24)); | ||
428 | + var hou = parseInt(time % (60 * 60 * 24) / 3600); | ||
429 | + var min = parseInt(time % (60 * 60 * 24) % 3600 / 60); | ||
430 | + var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); | ||
431 | + obj = { | ||
432 | + day: this.timeFormat(day), | ||
433 | + hou: this.timeFormat(hou), | ||
434 | + min: this.timeFormat(min), | ||
435 | + sec: this.timeFormat(sec) | ||
436 | + } | ||
437 | + } else { | ||
438 | + | ||
439 | + //活动已结束,全部设置为'00' | ||
440 | + obj = { | ||
441 | + day: '00', | ||
442 | + hou: '00', | ||
443 | + min: '00', | ||
444 | + sec: '00' | ||
445 | + } | ||
446 | + } | ||
447 | + var txt = "aitem[" + j + "]djs"; | ||
448 | + th.setData({ | ||
449 | + [txt]: obj | ||
450 | + }); | ||
451 | + | ||
452 | + | ||
453 | + } | ||
454 | + setTimeout(th.countDown, 1000); | ||
455 | + | ||
456 | + }, | ||
457 | + //---小于10的格式化函数---- | ||
458 | + timeFormat(param) { | ||
459 | + return param < 10 ? '0' + param : param; | ||
460 | + }, | ||
461 | + | ||
462 | + /** | ||
463 | + * 页面上拉触底事件的处理函数 | ||
464 | + */ | ||
465 | + onReachBottom: function() { | ||
466 | + | ||
467 | + }, | ||
468 | + | ||
469 | + /** | ||
470 | + * 用户点击右上角分享 | ||
471 | + */ | ||
472 | + onShareAppMessage: function() { | ||
473 | + | ||
474 | + }, | ||
475 | + shareFrends: function(e) { | ||
476 | + var th = this; | ||
477 | + var scene = th.data.gid; | ||
478 | + ///二微码 | ||
479 | + // var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | ||
480 | + // a.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; | ||
481 | + var iurl = th.data.iurl; //图片地址前缀 | ||
482 | + const ctx = wx.createCanvasContext('share_id'); //绘图上下文 | ||
483 | + var unit = th.data.screenWidth / 750 * 1.35; | ||
484 | + var numsize = 20 * unit; //几人助力字体大小 | ||
485 | + var size = 15 * unit; | ||
486 | + var num = 10; | ||
487 | + var q_num = 6; | ||
488 | + var already = num.toString().length + 1; //已有几位好友助力 | ||
489 | + var lack = q_num.toString().length + 1; //还差几位好友助力 | ||
490 | + var imagesize = 40 * unit; //助力人的图片大小 | ||
491 | + var left = 74 * unit; //助力人头像跟左边的距离 | ||
492 | + var spacing = 12 * unit; //助力人图片间距 | ||
493 | + var images = th.data.images; | ||
494 | + ctx.drawImage(images[0], 0, 0, 445 * unit, 700 * unit); //分享的背景图片 | ||
495 | + ctx.drawImage(images[1], 37 * unit, 185 * unit, 370 * unit, 377 * unit); //分享的背景图片 | ||
496 | + ctx.drawImage(images[2], 90 * unit, 231 * unit, 266 * unit, 160 * unit); //分享的背景图片 | ||
497 | + ctx.setFillStyle("rgb(221,153,116)"); | ||
498 | + ctx.setFontSize(size) | ||
499 | + ctx.fillText("已有", 77 * unit, 430 * unit); | ||
500 | + ctx.setFillStyle("#FF4746"); | ||
501 | + ctx.setFontSize(numsize) | ||
502 | + ctx.fillText(num + "位", 108 * unit, 430 * unit); | ||
503 | + ctx.setFillStyle("rgb(221,153,116)"); | ||
504 | + ctx.setFontSize(size) | ||
505 | + ctx.fillText("好友助力,还差", 114 * unit + already * numsize * unit, 430 * unit); | ||
506 | + ctx.setFillStyle("#FF4746"); | ||
507 | + ctx.setFontSize(numsize); | ||
508 | + ctx.fillText(q_num + "位", 220 * unit + already * numsize * unit, 430 * unit); | ||
509 | + ctx.setFillStyle("rgb(221,153,116)"); | ||
510 | + ctx.setFontSize(size); | ||
511 | + ctx.fillText("达成助力", 248 * unit + lack * numsize * unit + already * numsize - numsize * 2, 430 * unit); | ||
512 | + var c = q_num / num; | ||
513 | + ctx.drawImage(images[3], 65 * unit, 445 * unit, 320 * unit, 12 * unit); | ||
514 | + ctx.drawImage(images[4], 65 * unit, 445 * unit, 320 * unit * c, 12 * unit); | ||
515 | + for (var i = 0; i < 6; i++) { | ||
516 | + if (i == 0) { | ||
517 | + ctx.save(); | ||
518 | + ctx.beginPath(); //开始绘制 | ||
519 | + ctx.arc(left + imagesize / 2, 505 * unit, imagesize / 2, 0, 2 * Math.PI); | ||
520 | + ctx.setLineWidth(4 * unit); | ||
521 | + ctx.setStrokeStyle('red'); | ||
522 | + ctx.setFillStyle("white"); | ||
523 | + ctx.fill(); | ||
524 | + ctx.clip(); | ||
525 | + ctx.drawImage(images[6], left, 505 * unit - imagesize / 2, imagesize, imagesize); | ||
526 | + ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 还可以继续绘制 | ||
527 | + } else { | ||
528 | + // 助力人的头像 | ||
529 | + ctx.drawImage(images[6], left, 505 * unit - imagesize / 2, imagesize, imagesize); //分享的背景图片 | ||
530 | + } | ||
531 | + left += imagesize + spacing; | ||
532 | + } | ||
533 | + ctx.setFillStyle("rgb(255,255,255)"); | ||
534 | + ctx.setFontSize(size); | ||
535 | + ctx.fillText("优惠乐翻天,精彩就在你身边!", 37 * unit, 595 * unit); | ||
536 | + ctx.setFillStyle("rgb(255,255,255)"); | ||
537 | + ctx.setFontSize(size); | ||
538 | + ctx.fillText("2019.06.26 - 2019.07.02!", 37 * unit, 620 * unit); | ||
539 | + ctx.setFillStyle("rgb(255,255,255)"); | ||
540 | + ctx.setFontSize(size); | ||
541 | + ctx.fillText("长按识别二维码,可帮我助力!", 37 * unit, 660 * unit); | ||
542 | + ctx.drawImage(images[7], 325 * unit, 595 * unit, 77 * unit, 77 * unit); //分享的背景图片 | ||
543 | + ctx.save(); | ||
544 | + //读取文件成功则OK-- | ||
545 | + // wx.getImageInfo({ | ||
546 | + // src: path3, | ||
547 | + // success: function (res) { | ||
548 | + //把画板内容绘制成图片,并回调 画板图片路径 | ||
549 | + ctx.draw(false, function() { | ||
550 | + setTimeout(function() { | ||
551 | + wx.canvasToTempFilePath({ | ||
552 | + x: 0, | ||
553 | + y: 0, | ||
554 | + width: 300, | ||
555 | + height: 500, | ||
556 | + destWidth: 400 * 2, | ||
557 | + destHeight: 720 * 2, | ||
558 | + canvasId: 'share_id', | ||
559 | + success: function(res) { | ||
560 | + wx.hideLoading(); | ||
561 | + var shareImgPath = th.data.shareImgPath; | ||
562 | + shareImgPath[0] = res.tempFilePath; | ||
563 | + | ||
564 | + th.setData({ | ||
565 | + shareImgPath: shareImgPath, | ||
566 | + canvasHidden: 1, | ||
567 | + is_share: 1 | ||
568 | + }) | ||
569 | + if (!res.tempFilePath) { | ||
570 | + wx.showModal({ | ||
571 | + title: '提示', | ||
572 | + content: '图片绘制中,请稍后重试', | ||
573 | + showCancel: false | ||
574 | + }) | ||
575 | + return false; | ||
576 | + } | ||
577 | + | ||
578 | + }, | ||
579 | + fail(r) { | ||
580 | + | ||
581 | + } | ||
582 | + }, 500) | ||
583 | + }) | ||
584 | + }) | ||
585 | + // } | ||
586 | + // }) | ||
587 | + }, | ||
588 | + preview: function() { | ||
589 | + var th = this; | ||
590 | + var shareImgPath = th.data.shareImgPath; | ||
591 | + wx.previewImage({ | ||
592 | + url: shareImgPath[0], | ||
593 | + urls: shareImgPath | ||
594 | + }) | ||
595 | + }, | ||
596 | + | ||
597 | + //关闭分享显示 | ||
598 | + close_share: function() { | ||
599 | + var th = this; | ||
600 | + th.setData({ | ||
601 | + is_share: 0 | ||
602 | + }) | ||
603 | + }, | ||
604 | + syinfo: function() { | ||
605 | + var th = this; | ||
606 | + //获取用户设备信息,屏幕宽度 | ||
607 | + wx.getSystemInfo({ | ||
608 | + success: res => { | ||
609 | + th.setData({ | ||
610 | + screenWidth: res.screenWidth | ||
611 | + }) | ||
612 | + } | ||
613 | + }) | ||
614 | + }, | ||
615 | + //钱 分享图 | ||
616 | + imageinfo: function() { | ||
617 | + var th = this; | ||
618 | + var images = th.data.images; | ||
619 | + var iurl = th.data.iurl; | ||
620 | + wx.getImageInfo({ | ||
621 | + src: iurl + images[0], | ||
622 | + success: function(res) { | ||
623 | + console.log(res + i); | ||
624 | + //res.path是网络图片的本地地址 | ||
625 | + images[0] = res.path; | ||
626 | + }, | ||
627 | + fail: function(res) { | ||
628 | + console.log(res.toString() + "" + i); | ||
629 | + } | ||
630 | + }); | ||
631 | + wx.getImageInfo({ | ||
632 | + src: iurl + images[1], | ||
633 | + success: function(res) { | ||
634 | + console.log(res + i); | ||
635 | + //res.path是网络图片的本地地址 | ||
636 | + images[1] = res.path; | ||
637 | + }, | ||
638 | + fail: function(res) { | ||
639 | + console.log(res.toString() + "" + i); | ||
640 | + } | ||
641 | + }); | ||
642 | + wx.getImageInfo({ | ||
643 | + src: iurl + images[2], | ||
644 | + success: function(res) { | ||
645 | + console.log(res + i); | ||
646 | + //res.path是网络图片的本地地址 | ||
647 | + images[2] = res.path; | ||
648 | + }, | ||
649 | + fail: function(res) { | ||
650 | + console.log(res.toString() + "" + i); | ||
651 | + } | ||
652 | + }); | ||
653 | + wx.getImageInfo({ | ||
654 | + src: iurl + images[3], | ||
655 | + success: function(res) { | ||
656 | + console.log(res + i); | ||
657 | + //res.path是网络图片的本地地址 | ||
658 | + images[3] = res.path; | ||
659 | + }, | ||
660 | + fail: function(res) { | ||
661 | + console.log(res.toString() + "" + i); | ||
662 | + } | ||
663 | + }); | ||
664 | + wx.getImageInfo({ | ||
665 | + src: iurl + images[4], | ||
666 | + success: function(res) { | ||
667 | + console.log(res + i); | ||
668 | + //res.path是网络图片的本地地址 | ||
669 | + images[4] = res.path; | ||
670 | + }, | ||
671 | + fail: function(res) { | ||
672 | + console.log(res.toString() + "" + i); | ||
673 | + } | ||
674 | + }); | ||
675 | + wx.getImageInfo({ | ||
676 | + src: iurl + images[5], | ||
677 | + success: function(res) { | ||
678 | + console.log(res + i); | ||
679 | + //res.path是网络图片的本地地址 | ||
680 | + images[5] = res.path; | ||
681 | + }, | ||
682 | + fail: function(res) { | ||
683 | + console.log(res.toString() + "" + i); | ||
684 | + } | ||
685 | + }); | ||
686 | + wx.getImageInfo({ | ||
687 | + src: iurl + images[6], | ||
688 | + success: function(res) { | ||
689 | + console.log(res + i); | ||
690 | + //res.path是网络图片的本地地址 | ||
691 | + images[6] = res.path; | ||
692 | + }, | ||
693 | + fail: function(res) { | ||
694 | + console.log(res.toString() + "" + i); | ||
695 | + } | ||
696 | + }); | ||
697 | + | ||
698 | + wx.getImageInfo({ | ||
699 | + src: iurl + images[7], | ||
700 | + success: function(res) { | ||
701 | + console.log(res + i); | ||
702 | + //res.path是网络图片的本地地址 | ||
703 | + images[7] = res.path; | ||
704 | + }, | ||
705 | + fail: function(res) { | ||
706 | + console.log(res.toString() + "" + i); | ||
707 | + } | ||
708 | + }) | ||
709 | + th.setData({ | ||
710 | + images: images | ||
711 | + }) | ||
712 | + | ||
713 | + }, | ||
714 | + //生成分享图,用于分享给好友帮拆 | ||
715 | + demolition: function() { | ||
716 | + var th = this; | ||
717 | + | ||
718 | + | ||
719 | + }, | ||
720 | + //************************ */ | ||
721 | + shareFrends: function(e) { | ||
722 | + var th = this; | ||
723 | + var is_generate = th.data.is_generate; //是否重复提交拆一拆 | ||
724 | + if (is_generate == 0) { | ||
725 | + th.setData({ | ||
726 | + is_generate: 1 | ||
727 | + }) | ||
728 | + var scene = th.data.gid; | ||
729 | + ///二微码 | ||
730 | + // var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | ||
731 | + // a.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; | ||
732 | + var iurl = th.data.iurl; //图片地址前缀 | ||
733 | + const ctx = wx.createCanvasContext('share_id'); //绘图上下文 | ||
734 | + var unit = th.data.screenWidth / 750 * 1.35; | ||
735 | + var numsize = 20 * unit; //几人助力字体大小 | ||
736 | + var size = 15 * unit; | ||
737 | + var num = th.data.already; //已有几位好友助力 | ||
738 | + var q_num = th.data.lack; //还差几位好友助力 | ||
739 | + var already = num.toString().length + 1; //已有几位好友助力 | ||
740 | + var lack = q_num.toString().length + 1; //还差几位好友助力 | ||
741 | + var imagesize = 40 * unit; //助力人的图片大小 | ||
742 | + var left = 74 * unit; //助力人头像跟左边的距离 | ||
743 | + var spacing = 12 * unit; //助力人图片间距 | ||
744 | + var images = th.data.images; | ||
745 | + ctx.drawImage(images[0], 0, 0, 445 * unit, 700 * unit); //分享的背景图片 | ||
746 | + ctx.drawImage(images[1], 37 * unit, 185 * unit, 370 * unit, 377 * unit); //分享的背景图片 | ||
747 | + ctx.drawImage(images[5], 90 * unit, 231 * unit, 266 * unit, 160 * unit); //分享的背景图片 | ||
748 | + ctx.setFillStyle("rgb(221,153,116)"); | ||
749 | + ctx.setFontSize(size) | ||
750 | + ctx.fillText("已有", 77 * unit, 430 * unit); | ||
751 | + ctx.setFillStyle("#FF4746"); | ||
752 | + ctx.setFontSize(numsize) | ||
753 | + ctx.fillText(num + "位", 108 * unit, 430 * unit); | ||
754 | + ctx.setFillStyle("rgb(221,153,116)"); | ||
755 | + ctx.setFontSize(size) | ||
756 | + ctx.fillText("好友助力,还差", 116 * unit + already * numsize * unit, 430 * unit); | ||
757 | + ctx.setFillStyle("#FF4746"); | ||
758 | + ctx.setFontSize(numsize); | ||
759 | + ctx.fillText(q_num + "位", 223 * unit + already * numsize * unit, 430 * unit); | ||
760 | + ctx.setFillStyle("rgb(221,153,116)"); | ||
761 | + ctx.setFontSize(size); | ||
762 | + ctx.fillText("达成助力", 230 * unit + lack * numsize * unit + already * numsize * unit, 430 * unit); | ||
763 | + var c = q_num / num; | ||
764 | + ctx.drawImage(images[2], 65 * unit, 445 * unit, 320 * unit, 12 * unit); | ||
765 | + ctx.drawImage(images[3], 65 * unit, 445 * unit, 320 * unit * c, 12 * unit); | ||
766 | + // var dynamic = th.data.dynamic; //助力的微信头像 | ||
767 | + // console.log(dynamic[0].headPic + "动态图片显示"); | ||
768 | + for (var i = 0; i < 6; i++) { | ||
769 | + if (i < 0) { | ||
770 | + // ctx.beginPath(); | ||
771 | + // ctx.arc(left + imagesize / 2, 505 * unit, imagesize / 2, 0, 2 * Math.PI); | ||
772 | + // ctx.setLineWidth(1); | ||
773 | + // ctx.setStrokeStyle('red'); | ||
774 | + ctx.save(); | ||
775 | + ctx.beginPath(); //开始绘制 | ||
776 | + ctx.arc(left + imagesize / 2, 505 * unit, imagesize / 2, 0, 2 * Math.PI); | ||
777 | + ctx.setLineWidth(4 * unit); | ||
778 | + ctx.setStrokeStyle('red'); | ||
779 | + ctx.setFillStyle("white"); | ||
780 | + ctx.fill(); | ||
781 | + ctx.clip(); | ||
782 | + ctx.drawImage(dynamic[i].headPic, left, 505 * unit - imagesize / 2, imagesize, imagesize); | ||
783 | + ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 还可以继续绘制 | ||
784 | + } else { | ||
785 | + // 助力人的头像 | ||
786 | + ctx.drawImage(images[4], left, 505 * unit - imagesize / 2, imagesize, imagesize); //分享的背景图片 | ||
787 | + | ||
788 | + } | ||
789 | + left += imagesize + spacing; | ||
790 | + } | ||
791 | + ctx.setFillStyle("rgb(255,255,255)"); | ||
792 | + ctx.setFontSize(size); | ||
793 | + ctx.fillText("优惠乐翻天,精彩就在你身边!", 37 * unit, 595 * unit); | ||
794 | + ctx.setFillStyle("rgb(255,255,255)"); | ||
795 | + ctx.setFontSize(size); | ||
796 | + ctx.fillText("2019.06.26 - 2019.07.02!", 37 * unit, 620 * unit); | ||
797 | + ctx.setFillStyle("rgb(255,255,255)"); | ||
798 | + ctx.setFontSize(size); | ||
799 | + ctx.fillText("长按识别二维码,可帮我助力!", 37 * unit, 660 * unit); | ||
800 | + ctx.drawImage(images[5], 325 * unit, 585 * unit, 77 * unit, 77 * unit); //分享的背景图片 | ||
801 | + ctx.save(); | ||
802 | + //读取文件成功则OK-- | ||
803 | + // wx.getImageInfo({ | ||
804 | + // src: path3, | ||
805 | + // success: function (res) { | ||
806 | + //把画板内容绘制成图片,并回调 画板图片路径 | ||
807 | + ctx.draw(false, function() { | ||
808 | + setTimeout(function() { | ||
809 | + wx.canvasToTempFilePath({ | ||
810 | + x: 0, | ||
811 | + y: 0, | ||
812 | + width: 300, | ||
813 | + height: 500, | ||
814 | + destWidth: 400 * 2, | ||
815 | + destHeight: 720 * 2, | ||
816 | + canvasId: 'share_id', | ||
817 | + success: function(res) { | ||
818 | + wx.hideLoading(); | ||
819 | + var shareImgPath = th.data.shareImgPath; | ||
820 | + shareImgPath[0] = res.tempFilePath; | ||
821 | + | ||
822 | + th.setData({ | ||
823 | + shareImgPath: shareImgPath, | ||
824 | + canvasHidden: 1, | ||
825 | + is_share: 1, | ||
826 | + is_generate: 0, | ||
827 | + canvasHidden: 1 | ||
828 | + }) | ||
829 | + if (!res.tempFilePath) { | ||
830 | + wx.showModal({ | ||
831 | + title: '提示', | ||
832 | + content: '图片绘制中,请稍后重试', | ||
833 | + showCancel: false | ||
834 | + }) | ||
835 | + return false; | ||
836 | + } | ||
837 | + | ||
838 | + }, | ||
839 | + fail(r) { | ||
840 | + | ||
841 | + } | ||
842 | + }, 500) | ||
843 | + }) | ||
844 | + }) | ||
845 | + } | ||
846 | + }, | ||
847 | + preview: function() { | ||
848 | + var th = this; | ||
849 | + var shareImgPath = th.data.shareImgPath; | ||
850 | + wx.previewImage({ | ||
851 | + url: shareImgPath[0], | ||
852 | + urls: shareImgPath | ||
853 | + }) | ||
854 | + th.setData({ | ||
855 | + is_share: 0 | ||
856 | + }) | ||
857 | + }, | ||
858 | + | ||
859 | + //关闭分享显示 | ||
860 | + close_share: function() { | ||
861 | + var th = this; | ||
862 | + wx.hideLoading(); | ||
863 | + th.setData({ | ||
864 | + is_share: 0 | ||
865 | + }) | ||
866 | + }, | ||
867 | + syinfo: function() { | ||
868 | + var th = this; | ||
869 | + //获取用户设备信息,屏幕宽度 | ||
870 | + wx.getSystemInfo({ | ||
871 | + success: res => { | ||
872 | + th.setData({ | ||
873 | + screenWidth: res.screenWidth | ||
874 | + }) | ||
875 | + } | ||
876 | + }) | ||
877 | + }, | ||
878 | + //把固定的图片加载到本地 | ||
879 | + imageinfo: function() { | ||
880 | + var th = this; | ||
881 | + var images = th.data.images; | ||
882 | + var iurl = th.data.iurl; | ||
883 | + wx.getImageInfo({ | ||
884 | + src: iurl + images[0], | ||
885 | + success: function(res) { | ||
886 | + //res.path是网络图片的本地地址 | ||
887 | + images[0] = res.path; | ||
888 | + }, | ||
889 | + fail: function(res) { | ||
890 | + | ||
891 | + } | ||
892 | + }); | ||
893 | + wx.getImageInfo({ | ||
894 | + src: iurl + images[1], | ||
895 | + success: function(res) { | ||
896 | + //res.path是网络图片的本地地址 | ||
897 | + images[1] = res.path; | ||
898 | + }, | ||
899 | + fail: function(res) { | ||
900 | + | ||
901 | + } | ||
902 | + }); | ||
903 | + wx.getImageInfo({ | ||
904 | + src: iurl + images[2], | ||
905 | + success: function(res) { | ||
906 | + //res.path是网络图片的本地地址 | ||
907 | + images[2] = res.path; | ||
908 | + }, | ||
909 | + fail: function(res) { | ||
910 | + | ||
911 | + } | ||
912 | + }); | ||
913 | + wx.getImageInfo({ | ||
914 | + src: iurl + images[3], | ||
915 | + success: function(res) { | ||
916 | + | ||
917 | + //res.path是网络图片的本地地址 | ||
918 | + images[3] = res.path; | ||
919 | + }, | ||
920 | + fail: function(res) { | ||
921 | + | ||
922 | + } | ||
923 | + }); | ||
924 | + wx.getImageInfo({ | ||
925 | + src: iurl + images[4], | ||
926 | + success: function(res) { | ||
927 | + | ||
928 | + //res.path是网络图片的本地地址 | ||
929 | + images[4] = res.path; | ||
930 | + }, | ||
931 | + fail: function(res) { | ||
932 | + | ||
933 | + } | ||
934 | + }); | ||
935 | + wx.getImageInfo({ | ||
936 | + src: iurl + images[5], | ||
937 | + success: function(res) { | ||
938 | + | ||
939 | + //res.path是网络图片的本地地址 | ||
940 | + images[5] = res.path; | ||
941 | + }, | ||
942 | + fail: function(res) { | ||
943 | + | ||
944 | + } | ||
945 | + }); | ||
946 | + th.setData({ | ||
947 | + images: images | ||
948 | + }) | ||
949 | + | ||
950 | + }, | ||
951 | +//好友猜一猜 | ||
952 | + save_share: function (e) { | ||
953 | + var aitem = this.data.aitem; //任务的数据集 | ||
954 | + var sw_index = this.data.sw_index; //轮播的下标 | ||
955 | + //任务id | ||
956 | + var taskid = aitem[sw_index].id; | ||
957 | + console.log("好友猜一猜的任务id", taskid); | ||
958 | + var th = this; | ||
959 | + | ||
960 | + var url = "/api/weshop/marketing/help/help/task/involve/page"; | ||
961 | + getApp().request.promiseGet(url, { | ||
962 | + data: { | ||
963 | + storeId: 1, | ||
964 | + taskId: taskid, | ||
965 | + userId: 1433390 | ||
966 | + } | ||
967 | + }).then(res => { | ||
968 | + if (res.data.code == 0) { | ||
969 | + var data = res.data.data.pageData; //帮拆数组 | ||
970 | + if (data.length > 0) { | ||
971 | + // th.setData({ | ||
972 | + // dynamic: data | ||
973 | + // }) | ||
974 | + // th.info_head(); | ||
975 | + th.imageinfo(); | ||
976 | + setTimeout(function () { | ||
977 | + th.shareFrends(); | ||
978 | + }, 500) | ||
979 | + } | ||
980 | + } else { | ||
981 | + wx.hideLoading(); | ||
982 | + getApp().my_warnning(res.data.msg, 0, th); | ||
983 | + } | ||
984 | + }) | ||
985 | + }, | ||
986 | + //把已助力好友头像下载到本地 | ||
987 | + info_head: function (e) { | ||
988 | + var th = this; | ||
989 | + var images = th.data.dynamic; | ||
990 | + if (images[0] != null && images[0] != "" && images[0] != undefined) { | ||
991 | + console.log(images[0].headPic + "就将计就计"); | ||
992 | + wx.getImageInfo({ | ||
993 | + src: images[0].headPic, | ||
994 | + success: function (res) { | ||
995 | + //res.path是网络图片的本地地址 | ||
996 | + images[0].headPic = res.path; | ||
997 | + }, | ||
998 | + fail: function (res) { | ||
999 | + | ||
1000 | + } | ||
1001 | + }); | ||
1002 | + } | ||
1003 | + if (images[1] != null && images[1] != "" && images[1] != undefined) { | ||
1004 | + wx.getImageInfo({ | ||
1005 | + src: images[1].headPic, | ||
1006 | + success: function (res) { | ||
1007 | + //res.path是网络图片的本地地址 | ||
1008 | + images[1].headPic = res.path; | ||
1009 | + }, | ||
1010 | + fail: function (res) { | ||
1011 | + | ||
1012 | + } | ||
1013 | + }); | ||
1014 | + } | ||
1015 | + if (images[2] != null && images[2] != "" && images[2] != undefined) { | ||
1016 | + wx.getImageInfo({ | ||
1017 | + src: images[2].headPic, | ||
1018 | + success: function (res) { | ||
1019 | + //res.path是网络图片的本地地址 | ||
1020 | + images[2].headPic = res.path; | ||
1021 | + }, | ||
1022 | + fail: function (res) { | ||
1023 | + | ||
1024 | + } | ||
1025 | + }); | ||
1026 | + } | ||
1027 | + if (images[3] != null && images[3] != "" && images[3] != undefined) { | ||
1028 | + wx.getImageInfo({ | ||
1029 | + src: images[3].headPic, | ||
1030 | + success: function (res) { | ||
1031 | + //res.path是网络图片的本地地址 | ||
1032 | + images[3].headPic = res.path; | ||
1033 | + }, | ||
1034 | + fail: function (res) { | ||
1035 | + | ||
1036 | + } | ||
1037 | + }); | ||
1038 | + } | ||
1039 | + // if (images[4] != null && images[4] != "" && images[4] != undefined) { | ||
1040 | + // wx.getImageInfo({ | ||
1041 | + // src: images[4].headPic, | ||
1042 | + // success: function(res) { | ||
1043 | + // //res.path是网络图片的本地地址 | ||
1044 | + // images[4].headPic = res.path; | ||
1045 | + // }, | ||
1046 | + // fail: function(res) { | ||
1047 | + | ||
1048 | + // } | ||
1049 | + // }); | ||
1050 | + // } | ||
1051 | + // if (images[5] != null && images[5] != "" && images[5] != undefined) { | ||
1052 | + // wx.getImageInfo({ | ||
1053 | + // src: images[5].headPic, | ||
1054 | + // success: function (res) { | ||
1055 | + // //res.path是网络图片的本地地址 | ||
1056 | + // images[5].headPic = res.path; | ||
1057 | + // }, | ||
1058 | + // fail: function (res) { | ||
1059 | + | ||
1060 | + // } | ||
1061 | + // }); | ||
1062 | + //} | ||
1063 | + th.setData({ | ||
1064 | + dynamic: images | ||
1065 | + }) | ||
1066 | + }, | ||
1067 | + | ||
1068 | +}) | ||
0 | \ No newline at end of file | 1069 | \ No newline at end of file |
pages/user/assistance/task_assistance.json
0 → 100644
1 | +{ | ||
2 | + "navigationBarTitleText": "好友助力", | ||
3 | + "navigationStyle": "custom", | ||
4 | + "usingComponents": { | ||
5 | + "warn": "/components/long_warn/long_warn", | ||
6 | + "my_confirm": "/components/my_confirm/my_confirm", | ||
7 | + "nav_b": "/components/nav_b/nav_b" | ||
8 | + } | ||
9 | +} | ||
0 | \ No newline at end of file | 10 | \ No newline at end of file |
pages/user/assistance/task_assistance.wxml
0 → 100644
1 | +<wxs module="filter" src="../../../utils/filter.wxs"></wxs> | ||
2 | +<view class="top-back" style="background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)"> | ||
3 | + <!-- 助力活动头部 --> | ||
4 | + <view class="top-frame"> | ||
5 | + <view class="top-title white fs36 t-c"> | ||
6 | + | ||
7 | + {{aitem[sw_index].helpTaskName}} | ||
8 | + </view> | ||
9 | + <view class="activity-data t-c fs28 white"> | ||
10 | + 活动剩余时间:<text class='tui-conutdown-box'> {{aitem[0].djs.day}}</text>:<text class='tui-conutdown-box'>{{aitem[0].djs.hou}}</text>:<text class='tui-conutdown-box'>{{aitem[0].djs.min}}</text>:<text class='tui-conutdown-box tui-countdown-bg'>{{aitem[0].djs.sec}}</text> | ||
11 | + </view> | ||
12 | + </view> | ||
13 | + <!-- 图片的轮播图 --> | ||
14 | + <view class="xc-specific-more-frame flex-center"> | ||
15 | + <view bindtap="click_pre"> | ||
16 | + <view class="bg_left xc-left bcolor"></view> | ||
17 | + </view> | ||
18 | + <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" style='width:82.7%; height:100%' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}"> | ||
19 | + <swiper-item wx:for="{{aitem}}" wx:for-item="aitem" wx:for-index="pidx"> | ||
20 | + <image class="xc-center-img " src="{{iurl+aitem.giftBagUrl}}"></image> | ||
21 | + </swiper-item> | ||
22 | + </swiper> | ||
23 | + | ||
24 | + <view bindtap="click_next"> | ||
25 | + <view class="bg_right xc-right bcolor mt"></view> | ||
26 | + </view> | ||
27 | + </view> | ||
28 | + <view class="plan-frame flex ai-center"> | ||
29 | + <view class="plan_num rel"> | ||
30 | + <view class="is_plam abs"></view> | ||
31 | + </view> | ||
32 | + <text class="white fs24">/</text> | ||
33 | + | ||
34 | + </view> | ||
35 | + <view class="task-number fs28 white t-c "> | ||
36 | + 今天剩余可领{{task_number}}个任务 | ||
37 | + </view> | ||
38 | + | ||
39 | + <view wx:if="{{is_shares==null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{taskid}}" bindtap="add_onlicke"> | ||
40 | + 就选它了 | ||
41 | + </view> | ||
42 | + <view wx:if="{{is_shares!=null}}" class="task_clike fs40 t-c flex-center"data-taskid="{{taskid}}" bindtap="save_share"> | ||
43 | + 好友拆一拆 | ||
44 | + </view> | ||
45 | + | ||
46 | +</view> | ||
47 | +<!-- 底部列表 --> | ||
48 | +<view style="margin-top:50rpx"> | ||
49 | + <!-- 标题 --> | ||
50 | + | ||
51 | + <view class="flex-vertical-between fs28 padding head"> | ||
52 | + <view class="flex-center lhead {{switch_head==0?'rhead':''}}" bindtap="user_task_list" data-index="0"> | ||
53 | + <image class="unfinished" src="{{iurl}}miniapp/images/friendhelp/task.png" lazy-load="true"></image> | ||
54 | + <view>我的任务</view> | ||
55 | + </view> | ||
56 | + <view class="flex-center lhead {{switch_head==1?'rhead':''}}" bindtap="dismantle_record" data-index='1'> | ||
57 | + <image class="unfinished" style="margin-top: 5rpx;" src="{{iurl}}miniapp/images/friendhelp/edit.png" lazy-load="true"></image> | ||
58 | + <view>帮拆记录</view> | ||
59 | + </view> | ||
60 | + </view> | ||
61 | + | ||
62 | + <view class="white"> | ||
63 | + | ||
64 | + <view class="items" wx:if="{{is_task==0}}"> | ||
65 | + | ||
66 | + <view class="item fs26 flex-vertical-between padding" wx:for="{{user_task_list}}" > | ||
67 | + <view class="flex-center width"> | ||
68 | + <view class="ellipsis-1">{{item.helpTaskName}} | ||
69 | + </view> | ||
70 | + </view> | ||
71 | + <view class="flex-center width state"> | ||
72 | + <view class="ellipsis-1"> | ||
73 | + <text wx:if="{{item.status==0&&item.zlHelpNum<item.helpNum}}">{{item.zlHelpNum}}/{{item.helpNum}}</text> | ||
74 | + <text wx:if="{{item.status==2&&item.zlHelpNum==item.helpNum}}">查看详情</text> | ||
75 | + <text wx:if="{{item.status==1&&time.zlHelpNum==item.helpNum}}">领取礼包 </text> | ||
76 | + </view> | ||
77 | + </view> | ||
78 | + | ||
79 | + </view> | ||
80 | + </view> | ||
81 | + </view> | ||
82 | + | ||
83 | + | ||
84 | + <view class="items" wx:if="{{is_task==1}}"> | ||
85 | + <view class="item fs26 flex flex-vertical-between padding" wx:for="{{dismantle}}"> | ||
86 | + <view class="flex white" style="justify-content: space-around; width: 90%;margin:auto"> | ||
87 | + <image class="circle user_img" src="{{iurl+itme.headPic}}"></image> | ||
88 | + <view class="ellipsis-1">{{itme.nickName}} | ||
89 | + </view> | ||
90 | + <view class="ellipsis-1">{{filter.format_time(itme.beginDate)}} | ||
91 | + </view> | ||
92 | + </view> | ||
93 | + | ||
94 | + </view> | ||
95 | + | ||
96 | + </view> | ||
97 | + <view class="fs30" wx:if="{{user_task_list==null || user_task_list==''}}"> | ||
98 | + <view class="flex-center nothing white"> | ||
99 | + <view>暂无任务记录</view> | ||
100 | + </view> | ||
101 | + </view> | ||
102 | + | ||
103 | +</view> | ||
104 | +<!-- 加载更多 --> | ||
105 | +<view class="fs32"> | ||
106 | + <view class="flex-center" wx:if="{{user_task_list}}"> | ||
107 | + <view class="line"></view> | ||
108 | + <view class="load white" bindtap="">点击加载更多</view> | ||
109 | + <view class="line"></view> | ||
110 | + </view> | ||
111 | + <view class="flex-center white" style="margin-top: 20rpx;"> | ||
112 | + <view>已有</view> | ||
113 | + <view>{{usercount}}</view> | ||
114 | + <view>人领取了任务</view> | ||
115 | + </view> | ||
116 | +</view> | ||
117 | +<view wx:if="{{is_share}}"> | ||
118 | + <!-- 蒙尘 --> | ||
119 | + <view class="dust"> | ||
120 | + </view> | ||
121 | + <!-- 画布 --> | ||
122 | + <view class="canvas" style="width:100%;"> | ||
123 | + <view class="flex-center"> | ||
124 | + <canvas canvas-id="share_id" style="width:600rpx;height:1000rpx;" bindtap="preview"></canvas> | ||
125 | + </view> | ||
126 | + <view class="closes flex-center"> | ||
127 | + <image class="close" src="{{iurl}}/miniapp/images/plus/Close.png" bindtap="close_share"></image> | ||
128 | + </view> | ||
129 | + </view> | ||
130 | +</view> | ||
131 | + | ||
132 | +<!--********** 钱巧玲 --> | ||
133 | +<view> | ||
134 | + <!-- 蒙尘 --> | ||
135 | + <view class="dust"> | ||
136 | + </view> | ||
137 | + <!-- 画布 --> | ||
138 | + <view class="canvas" style="width:100%;"> | ||
139 | + <view class="flex-center"> | ||
140 | + <canvas wx:if="{{is_share}}" canvas-id="share_id" style="width:600rpx;height:1000rpx;" bindtap="preview"></canvas> | ||
141 | + </view> | ||
142 | + <view wx:if="{{is_share}}" class="closes flex-center"> | ||
143 | + <image class="close" src="{{iurl}}/miniapp/images/plus/Close.png" bindtap="close_share"></image> | ||
144 | + </view> | ||
145 | + </view> | ||
146 | +</view> | ||
147 | +<!-- 引入提示组件 --> | ||
148 | +<warn id="warn"></warn> | ||
149 | +<!-- 制作一个圆球导航 --> | ||
150 | +<nav_b id="nav_b"></nav_b> | ||
0 | \ No newline at end of file | 151 | \ No newline at end of file |
pages/user/assistance/task_assistance.wxss
0 → 100644
1 | +page{ | ||
2 | + background: #d01119; | ||
3 | + width: 100%; | ||
4 | + height: 100% | ||
5 | + | ||
6 | +} | ||
7 | +.top-back{ | ||
8 | + width: 100%; | ||
9 | + height: 60%; | ||
10 | + background-repead:no-repead; | ||
11 | + background-size:100% 100%; | ||
12 | + | ||
13 | +} | ||
14 | +.top-frame{ | ||
15 | + width: 100%; | ||
16 | + height: auto; | ||
17 | + padding-top: 50rpx | ||
18 | +} | ||
19 | +.top-title{ | ||
20 | + letter-spacing:10rpx | ||
21 | +} | ||
22 | +.activity-data{ | ||
23 | + padding-top: 10rpx; | ||
24 | + letter-spacing: 10rpx; | ||
25 | + | ||
26 | +} | ||
27 | +.xc-specific-more-frame{ | ||
28 | + width: 100%; | ||
29 | + height: 40%; | ||
30 | + | ||
31 | + margin-top: 20rpx; | ||
32 | +} | ||
33 | +.task-number{ | ||
34 | + margin-top: 50rpx | ||
35 | +} | ||
36 | +.task_clike{ | ||
37 | + margin: auto; | ||
38 | + width: 60%; | ||
39 | + height: 65rpx; | ||
40 | + border-radius: 50rpx; | ||
41 | + margin-top: 20rpx; | ||
42 | + background: #fbda0e; | ||
43 | + color:#d01119; | ||
44 | + line-height: 65rpx; | ||
45 | + letter-spacing: 5rpx; | ||
46 | + box-shadow: 0rpx 7rpx 0rpx 0rpx rgb(245, 119, 6); | ||
47 | +} | ||
48 | +/* 底部列表样式 */ | ||
49 | + | ||
50 | + | ||
51 | +.head { | ||
52 | + border-bottom: 4rpx solid rgb(253, 193, 7); | ||
53 | + color: rgb(255, 255, 255); | ||
54 | + height: 48rpx; | ||
55 | + line-height: 48rpx; | ||
56 | +} | ||
57 | + | ||
58 | +.lhead { | ||
59 | + border-top: 4rpx solid rgb(253, 193, 7); | ||
60 | + border-left: 4rpx solid rgb(253, 193, 7); | ||
61 | + border-right: 4rpx solid rgb(253, 193, 7); | ||
62 | + width: 290rpx; | ||
63 | + height: 48rpx; | ||
64 | + line-height: 48rpx; | ||
65 | +} | ||
66 | + | ||
67 | +.items { | ||
68 | + padding-top: 50rpx; | ||
69 | +} | ||
70 | + | ||
71 | +.rhead { | ||
72 | + background-color: rgb(253, 193, 7); | ||
73 | +} | ||
74 | + | ||
75 | +.unfinished { | ||
76 | + width:35rpx; | ||
77 | + height: 35rpx; | ||
78 | + margin-right: 10rpx; | ||
79 | +} | ||
80 | + | ||
81 | +.padding { | ||
82 | + padding: 0rpx 50rpx; | ||
83 | +} | ||
84 | + | ||
85 | +.width { | ||
86 | + width: 290rpx; | ||
87 | +} | ||
88 | + | ||
89 | +.line { | ||
90 | + width: 110rpx; | ||
91 | + border: 1rpx solid rgb(255, 255, 255); | ||
92 | +} | ||
93 | + | ||
94 | +.load { | ||
95 | + margin: 0rpx 26rpx; | ||
96 | +} | ||
97 | + | ||
98 | +.item { | ||
99 | + margin-bottom: 35rpx; | ||
100 | +} | ||
101 | + | ||
102 | +.state { | ||
103 | + text-decoration: underline; | ||
104 | +} | ||
105 | + | ||
106 | +.nothing { | ||
107 | + padding: 50rpx 0rpx; | ||
108 | +} | ||
109 | + | ||
110 | +.receive { | ||
111 | + padding-bottom: 50rpx; | ||
112 | +} | ||
113 | +.xc-center-img{ | ||
114 | + width: 100%; | ||
115 | + height: 100% | ||
116 | +} | ||
117 | + | ||
118 | +.xc-left{ | ||
119 | + width: 40rpx; | ||
120 | + height: 40rpx; | ||
121 | +} | ||
122 | +.bcolor { | ||
123 | +border-color: #fff; | ||
124 | + | ||
125 | +} | ||
126 | +.xc-right{ | ||
127 | + width: 40rpx; | ||
128 | + height: 40rpx; | ||
129 | +} | ||
130 | +.user_img{ | ||
131 | + width: 50rpx; | ||
132 | + height: 50rpx; | ||
133 | +} | ||
134 | +.dust { | ||
135 | + position: fixed; | ||
136 | + width: 100%; | ||
137 | + height: 100%; | ||
138 | + background-color: rgba(206, 184, 188, 0.158); | ||
139 | + z-index: 10; | ||
140 | +} | ||
141 | + | ||
142 | +.closes { | ||
143 | + margin-top: 20rpx; | ||
144 | +} | ||
145 | + | ||
146 | +.canvas { | ||
147 | + position: fixed; | ||
148 | + z-index: 11; | ||
149 | + width: 100%; | ||
150 | + top:20rpx; | ||
151 | +} | ||
152 | + | ||
153 | +.close { | ||
154 | + width: 70rpx; | ||
155 | + height: 70rpx; | ||
156 | +} | ||
157 | +.plan-frame{ | ||
158 | + width: 86%; | ||
159 | + margin: auto; | ||
160 | + margin-top: 50rpx; | ||
161 | + | ||
162 | +} | ||
163 | +.plan-frame .plan_num{ | ||
164 | + width: 90%; | ||
165 | + background: #ffe7ab; | ||
166 | + border-radius: 20rpx; | ||
167 | + height: 22rpx; | ||
168 | +} | ||
169 | +.is_plam{ | ||
170 | + height: 100%; | ||
171 | + top: 0rpx; | ||
172 | + left: 0rpx; | ||
173 | +} | ||
174 | +.dust { | ||
175 | + position: fixed; | ||
176 | + width: 100%; | ||
177 | + height: 100%; | ||
178 | + background-color: red; | ||
179 | + z-index: 10; | ||
180 | +} | ||
181 | + | ||
182 | +.closes { | ||
183 | + margin-top: 20rpx; | ||
184 | +} | ||
185 | + | ||
186 | +.canvas { | ||
187 | + position: fixed; | ||
188 | + z-index: 11; | ||
189 | + width: 100%; | ||
190 | + top:20rpx; | ||
191 | +} | ||
192 | + | ||
193 | +.close { | ||
194 | + width: 70rpx; | ||
195 | + height: 70rpx; | ||
196 | +} | ||
0 | \ No newline at end of file | 197 | \ No newline at end of file |
pages/user/comment/comment.js
@@ -124,10 +124,11 @@ Page({ | @@ -124,10 +124,11 @@ Page({ | ||
124 | 124 | ||
125 | //图片失败,默认图片 | 125 | //图片失败,默认图片 |
126 | bind_bnerr2: function(e) { | 126 | bind_bnerr2: function(e) { |
127 | + var th = this; | ||
127 | var _errImg = e.currentTarget.dataset.errorimg; | 128 | var _errImg = e.currentTarget.dataset.errorimg; |
128 | var _errObj = {}; | 129 | var _errObj = {}; |
129 | _errObj[_errImg] = os.imghost + "/public/images/default_goods_image_240.gif"; | 130 | _errObj[_errImg] = os.imghost + "/public/images/default_goods_image_240.gif"; |
130 | - //this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | 131 | + th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
131 | }, | 132 | }, |
132 | //预览图片 | 133 | //预览图片 |
133 | previewImg: function(e) { | 134 | previewImg: function(e) { |
pages/user/comment/comment.wxml
@@ -7,21 +7,21 @@ | @@ -7,21 +7,21 @@ | ||
7 | 7 | ||
8 | </view> | 8 | </view> |
9 | 9 | ||
10 | -<!-- 无评价 --> | ||
11 | -<view class="noCollection" wx:if="{{(!comments||comments.length==0) && isloaded}}"> | ||
12 | - <view class="flex-level"> | ||
13 | - <image src="{{iurl}}/miniapp/images/comment.png"></image> | ||
14 | - </view> | ||
15 | - <view class="flex-level fs30 xc-ash">当前暂无评价</view> | ||
16 | - <view class="flex-level"> | ||
17 | - <navigator url="/pages/index/index/index" bindtap="goto"> | ||
18 | - <view class="flex-center fs28 white">去首页逛逛</view> | ||
19 | - </navigator> | 10 | + <!-- 无评价 --> |
11 | + <view class="noCollection" wx:if="{{(!comments||comments.length==0) && isloaded}}"> | ||
12 | + <view class="flex-level"> | ||
13 | + <image src="{{iurl}}/miniapp/images/comment.png"></image> | ||
14 | + </view> | ||
15 | + <view class="flex-level fs30 xc-ash">当前暂无评价</view> | ||
16 | + <view class="flex-level"> | ||
17 | + <navigator url="/pages/index/index/index" bindtap="goto"> | ||
18 | + <view class="flex-center fs28 white">去首页逛逛</view> | ||
19 | + </navigator> | ||
20 | + </view> | ||
20 | </view> | 21 | </view> |
21 | -</view> | ||
22 | 22 | ||
23 | - <!-- 待评价栏 --> | ||
24 | - <view class="stay_evaluate" wx:if="{{comments.length>0}}" wx:for="{{comments}}"> | 23 | + <!-- 待评价栏 --> |
24 | + <view class="stay_evaluate" wx:if="{{comments.length>0}}" wx:for="{{comments}}"> | ||
25 | 25 | ||
26 | <!-- 商品编号和状态 --> | 26 | <!-- 商品编号和状态 --> |
27 | <view class="Commodity_number flex-vertical-between fs26 padding border_bottom"> | 27 | <view class="Commodity_number flex-vertical-between fs26 padding border_bottom"> |
@@ -66,16 +66,15 @@ | @@ -66,16 +66,15 @@ | ||
66 | <view class="starss flex fs26"> | 66 | <view class="starss flex fs26"> |
67 | <view class="commen">评价:</view> | 67 | <view class="commen">评价:</view> |
68 | <view class="stars"> | 68 | <view class="stars"> |
69 | - <image | ||
70 | - src="{{imaitem>=item.deliver_rank?iurl+'/miniapp/images/StarswhiteUnCk.png':iurl+'/miniapp/images/StarsredCk.png'}}" data-ind="{{imaitem}}" data-oo="{{item.deliver_rank}}" wx:for="{{5}}" wx:for-index="imaitem" wx:for-item="{{item_start}}"></image> | 69 | + <image src="{{imaitem>=item.deliver_rank?iurl+'/miniapp/images/StarswhiteUnCk.png':iurl+'/miniapp/images/StarsredCk.png'}}" data-ind="{{imaitem}}" data-oo="{{item.deliver_rank}}" wx:for="{{5}}" wx:for-index="imaitem" wx:for-item="{{item_start}}"></image> |
71 | </view> | 70 | </view> |
72 | </view> | 71 | </view> |
73 | <!-- 评价内容 --> | 72 | <!-- 评价内容 --> |
74 | <view class="Comment_content ellipsis-2 fs24">{{item.content.length>0?item.content:'此用户没有填写评论'}}</view> | 73 | <view class="Comment_content ellipsis-2 fs24">{{item.content.length>0?item.content:'此用户没有填写评论'}}</view> |
75 | <view class="Comment_images flex"> | 74 | <view class="Comment_images flex"> |
76 | - <image bindtap="previewImg" wx:if="{{item.source_type==0 && aitem.length>10}}" data-index="{{index}}" src="{{aitem}}" wx:for="{{item.img}}" wx:for-item="aitem" wx:for-index="i" data-sindex="{{i}}" data-name="img"></image> | ||
77 | - <image bindtap="previewImg" wx:if="{{item.source_type==1 && aitem.length>10}}" src="{{aitem}}" wx:for-index="i" data-index="{{index}}" wx:for="{{item.weapp_img}}" wx:for-item="aitem" data-sindex="{{i}}" data-name="weapp_img"></image> | ||
78 | - | 75 | + <image wx:if="{{item.source_type==0 && aitem.length>10}}" data-index="{{index}}" src="{{iurl+aitem}}" wx:for="{{item.img}}" wx:for-item="aitem" wx:for-index="i" data-sindex="{{i}}" data-name="img"></image> |
76 | + <image wx:if="{{item.source_type==1 && aitem.length>10}}" src="{{iurl+aitem}}" wx:for-index="i" data-index="{{index}}" wx:for="{{item.weapp_img}}" wx:for-item="aitem" data-sindex="{{i}}" data-name="weapp_img"></image> | ||
77 | + | ||
79 | </view> | 78 | </view> |
80 | 79 | ||
81 | <!-- 商家回复 --> | 80 | <!-- 商家回复 --> |
@@ -106,12 +105,19 @@ | @@ -106,12 +105,19 @@ | ||
106 | </view> | 105 | </view> |
107 | </view> | 106 | </view> |
108 | </view> | 107 | </view> |
109 | - <navigator wx:if="{{item.comment_id}}" class="commodity_To_evaluate flex-level View_evaluation fs24" url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}"> | ||
110 | - <view>查看订单</view> | ||
111 | - </navigator> | ||
112 | - <navigator wx:if="{{!item.comment_id}}" bindtap="comment" data-recid="{{item.rec_id}}" class="commodity_To_evaluate flex-level comment_go" url="item.comment_id>0?'/pages/user/add_comment/add_comment':'' "> | ||
113 | - <view class="fs24">去评价</view> | ||
114 | - </navigator> | 108 | + <view class="flex"> |
109 | + <navigator wx:if="{{item.comment_id}}" class="commodity_To_evaluate flex-level View_evaluation fs24" url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}"> | ||
110 | + <view>查看订单</view> | ||
111 | + </navigator> | ||
112 | + | ||
113 | + <navigator wx:if="{{item.comment_id}}" class="commodity_To_evaluate flex-level comment_go" url="/pages/user/view_comment/view_comment?goods_id={{item.goods_id}}&order_id={{item.order_id}}"> | ||
114 | + <view>查看评价</view> | ||
115 | + </navigator> | ||
116 | + | ||
117 | + <navigator wx:if="{{!item.comment_id}}" bindtap="comment" data-recid="{{item.rec_id}}" class="commodity_To_evaluate flex-level comment_go" url="{{item.comment_id>0?'/pages/user/add_comment/add_comment?goods_id={{item.goods_id}}&order_id={{item.order_id}}':''}}"> | ||
118 | + <view class="fs24">去评价</view> | ||
119 | + </navigator> | ||
120 | + </view> | ||
115 | </view> | 121 | </view> |
116 | </view> | 122 | </view> |
117 | </view> | 123 | </view> |
pages/user/comment/comment.wxss
@@ -36,6 +36,7 @@ | @@ -36,6 +36,7 @@ | ||
36 | .border_bottom { | 36 | .border_bottom { |
37 | border-bottom: 3rpx solid rgb(245, 245, 245); | 37 | border-bottom: 3rpx solid rgb(245, 245, 245); |
38 | } | 38 | } |
39 | + | ||
39 | /* 无评价 */ | 40 | /* 无评价 */ |
40 | 41 | ||
41 | .noCollection image { | 42 | .noCollection image { |
@@ -122,14 +123,17 @@ | @@ -122,14 +123,17 @@ | ||
122 | height: 39rpx; | 123 | height: 39rpx; |
123 | border-radius: 9rpx; | 124 | border-radius: 9rpx; |
124 | } | 125 | } |
125 | -.commodity_evaluate .commodity_To_evaluate view{ | 126 | + |
127 | +.commodity_evaluate .commodity_To_evaluate view { | ||
126 | height: 39rpx; | 128 | height: 39rpx; |
127 | line-height: 39rpx; | 129 | line-height: 39rpx; |
128 | } | 130 | } |
129 | -.commodity_evaluate .comment_go{ | ||
130 | - margin-top: 10rpx; | ||
131 | - background-color: rgb(211, 28, 52); | 131 | + |
132 | +.commodity_evaluate .comment_go { | ||
133 | + margin-left: 20rpx; | ||
134 | + background-color: rgb(211, 28, 52); | ||
132 | color: rgb(255, 255, 255); | 135 | color: rgb(255, 255, 255); |
136 | + border: 2rpx solid rgb(211, 28, 52); | ||
133 | } | 137 | } |
134 | 138 | ||
135 | .Commodity_spec { | 139 | .Commodity_spec { |
@@ -141,26 +145,30 @@ | @@ -141,26 +145,30 @@ | ||
141 | } | 145 | } |
142 | 146 | ||
143 | .Commodity_spec view { | 147 | .Commodity_spec view { |
144 | - height: 28rpx; | ||
145 | - align-items: center; | 148 | + height: 28rpx; |
149 | + align-items: center; | ||
146 | } | 150 | } |
147 | 151 | ||
148 | .Commodity_evaluation .Comment_content { | 152 | .Commodity_evaluation .Comment_content { |
149 | color: rgb(153, 153, 153); | 153 | color: rgb(153, 153, 153); |
150 | letter-spacing: 1rpx; | 154 | letter-spacing: 1rpx; |
151 | } | 155 | } |
152 | -.Commodity_evaluation .starss{ | ||
153 | - height: 58rpx; | ||
154 | - /* // line-height: 58rpx; */ | ||
155 | - align-items: center; | 156 | + |
157 | +.Commodity_evaluation .starss { | ||
158 | + height: 58rpx; | ||
159 | + /* // line-height: 58rpx; */ | ||
160 | + align-items: center; | ||
156 | } | 161 | } |
157 | -.Commodity_evaluation .commen{ | 162 | + |
163 | +.Commodity_evaluation .commen { | ||
158 | height: 58rpx; | 164 | height: 58rpx; |
159 | line-height: 58rpx; | 165 | line-height: 58rpx; |
160 | } | 166 | } |
161 | -.Commodity_evaluation .starss .stars{ | 167 | + |
168 | +.Commodity_evaluation .starss .stars { | ||
162 | line-height: 58rpx; | 169 | line-height: 58rpx; |
163 | } | 170 | } |
171 | + | ||
164 | .Commodity_evaluation .starss .stars image { | 172 | .Commodity_evaluation .starss .stars image { |
165 | width: 29rpx; | 173 | width: 29rpx; |
166 | height: 26rpx; | 174 | height: 26rpx; |
@@ -173,17 +181,35 @@ | @@ -173,17 +181,35 @@ | ||
173 | margin-right: 8rpx; | 181 | margin-right: 8rpx; |
174 | margin-top: 18rpx; | 182 | margin-top: 18rpx; |
175 | border-radius: 6rpx; | 183 | border-radius: 6rpx; |
176 | - border: 3rpx solid rgb(245, 245, 245); | 184 | + border: 2rpx solid rgb(245, 245, 245); |
185 | + margin-left: 15rpx; | ||
177 | } | 186 | } |
178 | -.commodity_evaluate .View_evaluation{ | ||
179 | - border:2rpx solid rgb(179, 179, 179); | ||
180 | - color:rgb(0, 0, 0); | 187 | + |
188 | +.commodity_evaluate .View_evaluation { | ||
189 | + border: 2rpx solid rgb(179, 179, 179); | ||
190 | + color: rgb(0, 0, 0); | ||
181 | background-color: rgb(255, 255, 255); | 191 | background-color: rgb(255, 255, 255); |
182 | } | 192 | } |
183 | -.comment_addtime{ | 193 | + |
194 | +.comment_addtime { | ||
184 | height: 50rpx; | 195 | height: 50rpx; |
185 | } | 196 | } |
186 | -.title_width{ width: 146rpx; text-align:center } | ||
187 | -.shop-font{ color: rgb(153, 153, 153);} | ||
188 | -.reply{ margin-top: 10rpx} | ||
189 | -.get_bottom{ text-align: center; color: #999; margin-bottom: 20rpx} | ||
190 | \ No newline at end of file | 197 | \ No newline at end of file |
198 | + | ||
199 | +.title_width { | ||
200 | + width: 146rpx; | ||
201 | + text-align: center; | ||
202 | +} | ||
203 | + | ||
204 | +.shop-font { | ||
205 | + color: rgb(153, 153, 153); | ||
206 | +} | ||
207 | + | ||
208 | +.reply { | ||
209 | + margin-top: 10rpx; | ||
210 | +} | ||
211 | + | ||
212 | +.get_bottom { | ||
213 | + text-align: center; | ||
214 | + color: #999; | ||
215 | + margin-bottom: 20rpx; | ||
216 | +} |
pages/user/coupons/coupons.wxml
@@ -34,15 +34,15 @@ | @@ -34,15 +34,15 @@ | ||
34 | </view> | 34 | </view> |
35 | <view class="moneys">{{filter.getNum(detail.Sum)}}元微券</view> | 35 | <view class="moneys">{{filter.getNum(detail.Sum)}}元微券</view> |
36 | <view class="car-rim"> | 36 | <view class="car-rim"> |
37 | - <view class="coupon_from">微券来源: {{detail.Operator==null?'微信商城':detail.Operator}}</view> | 37 | + <view class="coupon_from">微券来源: {{detail.Operator==null?'微信商城':detail.Operator==''?"微信商城":detail.Operator}}</view> |
38 | <view wx:if="{{detail.ValidDate!=null&&detail.BeginDate!=null}}"> | 38 | <view wx:if="{{detail.ValidDate!=null&&detail.BeginDate!=null}}"> |
39 | <!-- 不指定格式则默认输出:yyyy-MM-dd hh:mm:ss 格式 --> | 39 | <!-- 不指定格式则默认输出:yyyy-MM-dd hh:mm:ss 格式 --> |
40 | - <view class="text">有效期: {{detail.BeginDate==null?"":time.replace_time2(detail.BeginDate)}}至{{time.replace_time2(detail.ValidDate)}}</view> | 40 | + <view class="text">有效期: {{(detail.BeginDate==null || detail.BeginDate=='')?"":time.replace_time2(detail.BeginDate)}}至{{time.replace_time2(detail.ValidDate)}}</view> |
41 | </view> | 41 | </view> |
42 | <view wx:else> | 42 | <view wx:else> |
43 | <view class="text">有效期:不限</view> | 43 | <view class="text">有效期:不限</view> |
44 | </view> | 44 | </view> |
45 | - <view class="textss">使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{detail.UseObjectID==null?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用{{detail.region_list_name==null?"":",不包邮地区:"+region_list_name}} | 45 | + <view class="textss">使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用{{detail.region_list_name==null?"":",不包邮地区:"+region_list_name}} |
46 | </view> | 46 | </view> |
47 | 47 | ||
48 | </view> | 48 | </view> |
pages/user/index/index.js
@@ -30,31 +30,36 @@ Page({ | @@ -30,31 +30,36 @@ Page({ | ||
30 | cz_val:0, | 30 | cz_val:0, |
31 | full_cz_val:0, | 31 | full_cz_val:0, |
32 | is_dengji:0, //是不是等级 | 32 | is_dengji:0, //是不是等级 |
33 | + is_banner:0,//是不是有生日活动 | ||
34 | + giftbagid:"",//生日活动的类型 | ||
35 | + actId:"",//生日活动的id | ||
36 | + actImg:"", | ||
37 | + is_assistance:0,//助力活动 | ||
33 | }, | 38 | }, |
34 | - goto_service: function () { | 39 | + goto_nav: function (e) { |
35 | var th = this; | 40 | var th = this; |
41 | + var url = e.currentTarget.dataset.url; | ||
36 | if (th.data.userInfo != null) { | 42 | if (th.data.userInfo != null) { |
37 | - var url = "/pages/user/my_service/i_service"; | ||
38 | getApp().goto(url); | 43 | getApp().goto(url); |
39 | } else { | 44 | } else { |
40 | - if(th.data.is_nav){ | ||
41 | wx.navigateTo({ | 45 | wx.navigateTo({ |
42 | url: '/pages/getphone/getphone', | 46 | url: '/pages/getphone/getphone', |
43 | }) | 47 | }) |
44 | - } | ||
45 | } | 48 | } |
46 | }, | 49 | }, |
47 | /** | 50 | /** |
48 | * 生命周期函数--监听页面加载 | 51 | * 生命周期函数--监听页面加载 |
49 | */ | 52 | */ |
50 | onLoad: function (options) { | 53 | onLoad: function (options) { |
51 | - | 54 | + this.birthday(); |
52 | }, | 55 | }, |
53 | 56 | ||
54 | /** | 57 | /** |
55 | * 生命周期函数--监听页面显示 | 58 | * 生命周期函数--监听页面显示 |
56 | */ | 59 | */ |
57 | onShow: function () { | 60 | onShow: function () { |
61 | + | ||
62 | + this.is_assistance(); | ||
58 | 63 | ||
59 | var stoid = app_d.setting.stoid; | 64 | var stoid = app_d.setting.stoid; |
60 | var s = this,th=s,need_money=0,cur_g_num=0; | 65 | var s = this,th=s,need_money=0,cur_g_num=0; |
@@ -124,10 +129,12 @@ Page({ | @@ -124,10 +129,12 @@ Page({ | ||
124 | await getApp().request.promiseGet("/api/weshop/users/grade/aftervipinfo/get",{ | 129 | await getApp().request.promiseGet("/api/weshop/users/grade/aftervipinfo/get",{ |
125 | data:{ storeId:os.stoid,userId:app_d.user_id } | 130 | data:{ storeId:os.stoid,userId:app_d.user_id } |
126 | }).then(res=>{ | 131 | }).then(res=>{ |
127 | - gid=res.data.data.GradeId; | ||
128 | - var cz_val = res.data.data.GradeSum; | ||
129 | - cz_vals=parseInt(cz_val); | ||
130 | - GradeName=res.data.data.GradeName; | 132 | + if (res.data.code == 0 && res.data.data){ |
133 | + gid=res.data.data.GradeId; | ||
134 | + var cz_val = res.data.data.GradeSum; | ||
135 | + cz_vals=parseInt(cz_val); | ||
136 | + GradeName=res.data.data.GradeName; | ||
137 | + } | ||
131 | //th.setData({ cz_val: cz_vals, GradeName: res.data.data.GradeName, is_init: is_init, gradeId: gid}); | 138 | //th.setData({ cz_val: cz_vals, GradeName: res.data.data.GradeName, is_init: is_init, gradeId: gid}); |
132 | }) | 139 | }) |
133 | var obj = { cz_val: cz_vals, GradeName:GradeName, is_init: is_init, gradeId: gid }; | 140 | var obj = { cz_val: cz_vals, GradeName:GradeName, is_init: is_init, gradeId: gid }; |
@@ -253,7 +260,7 @@ Page({ | @@ -253,7 +260,7 @@ Page({ | ||
253 | //!this.nomore && this.requestRecommend(); | 260 | //!this.nomore && this.requestRecommend(); |
254 | var goods_list = this.selectComponent("#goods_recommend"); //组件的id | 261 | var goods_list = this.selectComponent("#goods_recommend"); //组件的id |
255 | goods_list.init(); | 262 | goods_list.init(); |
256 | - setTimeOut(function () { goods_list.get_list(); }, 300) | 263 | + setTimeout(function () { goods_list.get_list(); }, 300) |
257 | }, | 264 | }, |
258 | 265 | ||
259 | /** | 266 | /** |
@@ -450,7 +457,58 @@ Page({ | @@ -450,7 +457,58 @@ Page({ | ||
450 | 457 | ||
451 | jump: function () { | 458 | jump: function () { |
452 | getApp().goto("/pages/user/grow_value/grow_value") | 459 | getApp().goto("/pages/user/grow_value/grow_value") |
460 | + }, | ||
461 | + // 判断生日营销的页面是不是存在 | ||
462 | + birthday:function(){ | ||
463 | + var th = this; | ||
464 | + // rq.get("/api/weshop/marketing/birthday/act/judge", { | ||
465 | + // data: { storeId: os.stoid, userId: app_d.user_id }, | ||
466 | + // success: function (res) { | ||
467 | + // var code = res.data.code; | ||
468 | + // if (code == 0) { | ||
469 | + // var giftbagid = res.data.data.giftBagId; | ||
470 | + // var actId = res.data.data.id; | ||
471 | + // var actImg = res.data.data.actImg; | ||
472 | + // t.setData({ giftbagid: giftbagid, actId: actId, actImg: actImg }); | ||
473 | + // t.setData({ is_banner: 1 }); | ||
474 | + // } | ||
475 | + | ||
476 | + // } | ||
477 | + // }) | ||
478 | + | ||
479 | + | ||
480 | + }, | ||
481 | + clike_banne:function(){ | ||
482 | + var th = this; | ||
483 | + var actId=th.data.actId; | ||
484 | + var giftbagid=th.data.giftbagid; | ||
485 | + if (actId != "" && giftbagid!=""){ | ||
486 | + | ||
487 | + wx.redirectTo({ | ||
488 | + url: "/pages/giftpack/birthdaygift/birthdaygift?actId=" + actId + "&gifbagid=" + giftbagid + "&orderType=" + 3 | ||
489 | + }); | ||
490 | + }else{ | ||
491 | + | ||
492 | + getApp().showWarning("请稍后重试"); | ||
493 | + } | ||
494 | + }, | ||
495 | + // 判断助力活动是不是存在 | ||
496 | + is_assistance:function(){ | ||
497 | + // var th = this; | ||
498 | + // rq.get("/api/weshop/marketing/help/act/judge", { | ||
499 | + // data: { storeId: os.stoid, userId: app_d.user_id }, | ||
500 | + // success: function (res) { | ||
501 | + // var code = res.data.code; | ||
502 | + // if (code == 0) { | ||
503 | + // th.setData({ is_assistance:1}); | ||
504 | + // } | ||
505 | + | ||
506 | + // } | ||
507 | + // }) | ||
508 | + | ||
453 | } | 509 | } |
454 | 510 | ||
455 | 511 | ||
512 | + | ||
513 | + | ||
456 | }) | 514 | }) |
457 | \ No newline at end of file | 515 | \ No newline at end of file |
pages/user/index/index.wxml
@@ -166,10 +166,18 @@ | @@ -166,10 +166,18 @@ | ||
166 | </view> | 166 | </view> |
167 | </view> | 167 | </view> |
168 | </view> | 168 | </view> |
169 | + <!-- 生日营销 is_banner--> | ||
170 | + <block wx:if="{{is_banner}}"> | ||
171 | + <view class="t-c banner-frame" bindtap="clike_banne"> | ||
172 | + <image class="banner-img" src="{{actImg==''?iurl+'/miniapp/images/user/banner-img.jpg':iurl+actImg}}"> | ||
173 | + </image> | ||
174 | + </view> | ||
175 | + </block> | ||
176 | + | ||
169 | <!-- 工具与服务 --> | 177 | <!-- 工具与服务 --> |
170 | <view class="xc-tool-service"> | 178 | <view class="xc-tool-service"> |
171 | <view class="xc-tool-service-title flex-vertical"> | 179 | <view class="xc-tool-service-title flex-vertical"> |
172 | - <image class="xc-tool-service-img" src="{{iurl}}/miniapp/images/gj.png"></image> | 180 | + <image class="xc-tool-service-img" src="{{iurl}}/miniapp/images/gj.png"></image> |
173 | <view class="three-level-word xc-tool-service-word">工具与服务</view> | 181 | <view class="three-level-word xc-tool-service-word">工具与服务</view> |
174 | </view> | 182 | </view> |
175 | <view class="xc-project-frame"> | 183 | <view class="xc-project-frame"> |
@@ -212,14 +220,21 @@ | @@ -212,14 +220,21 @@ | ||
212 | <image class="xc-center-img " src="{{iurl}}/miniapp/images/add2.png"></image> | 220 | <image class="xc-center-img " src="{{iurl}}/miniapp/images/add2.png"></image> |
213 | <view class="four-level-word">我的地址</view> | 221 | <view class="four-level-word">我的地址</view> |
214 | </view> | 222 | </view> |
215 | - <view class="item t-c" data-url="/pages/user/my_service/i_service" bindtap="goto_service" > | 223 | + <view class="item t-c" data-url="/pages/user/my_service/i_service" bindtap="goto_nav" > |
216 | <image class="xc-center-img " src="{{iurl}}/miniapp/images/yyservice/myservice.png"></image> | 224 | <image class="xc-center-img " src="{{iurl}}/miniapp/images/yyservice/myservice.png"></image> |
217 | <view class="four-level-word">我的服务</view> | 225 | <view class="four-level-word">我的服务</view> |
218 | </view> | 226 | </view> |
219 | - <view class="item t-c" data-url="/pages/giftpack/mygiftpack/mygiftpack" bindtap="goto"> | ||
220 | - <image class="xc-center-img " src="{{iurl}}/miniapp/images/yyservice/myservice.png"></image> | ||
221 | - <view class="four-level-word">我的礼包</view> | 227 | + <view class="item t-c" data-url="/pages/giftpack/mygiftpack/mygiftpack" bindtap="goto_nav"> |
228 | + <image class="xc-center-img " src="{{iurl}}/miniapp/images//user/wdlb.png"></image> | ||
229 | + <view class="four-level-word">专享礼包</view> | ||
222 | </view> | 230 | </view> |
231 | + <block wx:if="{{is_assistance==1}}"> | ||
232 | + <view class="item t-c" data-url="/pages/user/assistance/assistance" bindtap="goto_nav"> | ||
233 | + <image class="xc-center-img " src="{{iurl}}/miniapp/images/friendhelp/icon-zl.png"></image> | ||
234 | + <view class="four-level-word">助力活动</view> | ||
235 | + </view> | ||
236 | + </block> | ||
237 | + | ||
223 | </view> | 238 | </view> |
224 | 239 | ||
225 | </view> | 240 | </view> |
pages/user/index/index.wxss
@@ -344,7 +344,7 @@ | @@ -344,7 +344,7 @@ | ||
344 | .xc-tool-service .xc-tool-service-title { | 344 | .xc-tool-service .xc-tool-service-title { |
345 | width: 100%; | 345 | width: 100%; |
346 | height: 90rpx; | 346 | height: 90rpx; |
347 | - border: 2rpx solid #f2f2f2; | 347 | + |
348 | } | 348 | } |
349 | 349 | ||
350 | .xc-tool-service-img { | 350 | .xc-tool-service-img { |
@@ -361,9 +361,6 @@ | @@ -361,9 +361,6 @@ | ||
361 | width: 100%; | 361 | width: 100%; |
362 | } | 362 | } |
363 | 363 | ||
364 | -.xc-project-frame .center_v { | ||
365 | -} | ||
366 | - | ||
367 | .xc-project-frame .item { | 364 | .xc-project-frame .item { |
368 | width: 25%; | 365 | width: 25%; |
369 | margin-top: 30rpx; | 366 | margin-top: 30rpx; |
@@ -699,3 +696,14 @@ | @@ -699,3 +696,14 @@ | ||
699 | margin-top: 8rpx; | 696 | margin-top: 8rpx; |
700 | margin-right: 5rpx; | 697 | margin-right: 5rpx; |
701 | } | 698 | } |
699 | +.banner-img{ | ||
700 | + width: 95%; | ||
701 | + height: 140rpx; | ||
702 | + border-radius: 10px 10px 0px 0px; | ||
703 | + margin-bottom: -5rpx; | ||
704 | + | ||
705 | +} | ||
706 | +.banner-frame{ | ||
707 | + width: 100%; | ||
708 | + background: #f2f2f2; | ||
709 | +} | ||
702 | \ No newline at end of file | 710 | \ No newline at end of file |
pages/user/my_service/tment_eval.js
@@ -23,6 +23,10 @@ Page({ | @@ -23,6 +23,10 @@ Page({ | ||
23 | arrangeTime: "", //服务日期 | 23 | arrangeTime: "", //服务日期 |
24 | is_evaluate: 0, //是否评价 | 24 | is_evaluate: 0, //是否评价 |
25 | EvaluateDatetime: "", //评价时间 | 25 | EvaluateDatetime: "", //评价时间 |
26 | + is_act:0, //是否能购获取图片 | ||
27 | + actId:0, //活动ID | ||
28 | + giftBagId:0, //礼包ID | ||
29 | + | ||
26 | }, | 30 | }, |
27 | //点击星级 | 31 | //点击星级 |
28 | check_stars: function(e) { | 32 | check_stars: function(e) { |
@@ -219,6 +223,7 @@ Page({ | @@ -219,6 +223,7 @@ Page({ | ||
219 | is_evaluate: options.evaluate | 223 | is_evaluate: options.evaluate |
220 | }) | 224 | }) |
221 | th.query_bea(); | 225 | th.query_bea(); |
226 | + th.judge_act(); | ||
222 | }, | 227 | }, |
223 | 228 | ||
224 | /** | 229 | /** |
@@ -231,4 +236,46 @@ Page({ | @@ -231,4 +236,46 @@ Page({ | ||
231 | th.evaluate_get(); | 236 | th.evaluate_get(); |
232 | } | 237 | } |
233 | }, | 238 | }, |
239 | + //评价其他跳转 | ||
240 | + evaluate_qt:function(){ | ||
241 | + | ||
242 | + wx.redirectTo({ | ||
243 | + url: "/pages/user/my_service/tment_order_list?state="+2 | ||
244 | + }); | ||
245 | + }, | ||
246 | + //点击领取礼包 | ||
247 | + clike_lb:function(){ | ||
248 | + | ||
249 | + var id=this.data.actId; | ||
250 | + var gifbagid = this.data.gifbagid; | ||
251 | + wx.redirectTo({ | ||
252 | + url: "/pages/giftpack/evaluategift/evaluategift?actId=" + id + "&gifbagid=&orderType=2&orderNumber="+this.data.number | ||
253 | + }); | ||
254 | + | ||
255 | + }, | ||
256 | + | ||
257 | + //--评价有礼判断--- | ||
258 | + judge_act: function () { | ||
259 | + var th = this; | ||
260 | + var url = "/api/weshop/marketing/comment/act/judge"; | ||
261 | + getApp().request.promiseGet(url, { | ||
262 | + data: { | ||
263 | + orderNumber: th.data.number, | ||
264 | + orderType: 2, | ||
265 | + storeId: a.stoid, | ||
266 | + userId: d.user_id | ||
267 | + } | ||
268 | + }).then(res => { | ||
269 | + if (res.data.code == 0) { | ||
270 | + var id = res.data.data.id; | ||
271 | + var giftbagid = res.data.data.giftbagid; | ||
272 | + th.setData({ | ||
273 | + is_act: 1, | ||
274 | + actId: id, | ||
275 | + giftBagId: giftbagid | ||
276 | + }) | ||
277 | + } | ||
278 | + }) | ||
279 | + }, | ||
280 | + | ||
234 | }) | 281 | }) |
235 | \ No newline at end of file | 282 | \ No newline at end of file |
pages/user/my_service/tment_eval.wxml
@@ -91,4 +91,15 @@ | @@ -91,4 +91,15 @@ | ||
91 | <view>确认提交</view> | 91 | <view>确认提交</view> |
92 | </view> | 92 | </view> |
93 | </navigator> | 93 | </navigator> |
94 | +<view wx:else> | ||
95 | + | ||
96 | + | ||
97 | +<view style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center" bindtap="evaluate_qt"> | ||
98 | + <view>评价其他</view> | ||
99 | + </view> | ||
100 | + | ||
101 | + <view wx:if="{{is_act}}" style="margin: auto;margin-bottom: 30rpx;" class="Submission flex-center yellow-b" bindtap="clike_lb"> | ||
102 | + <view>点击领取礼品</view> | ||
103 | + </view> | ||
104 | + </view> | ||
94 | <warn id="warn"></warn> | 105 | <warn id="warn"></warn> |
95 | \ No newline at end of file | 106 | \ No newline at end of file |
pages/user/my_service/tment_eval.wxss
@@ -115,6 +115,10 @@ | @@ -115,6 +115,10 @@ | ||
115 | background-color: rgb(214, 1, 33); | 115 | background-color: rgb(214, 1, 33); |
116 | color: rgb(255, 255, 255); | 116 | color: rgb(255, 255, 255); |
117 | } | 117 | } |
118 | +.Submission.yellow-b{ | ||
119 | + background-color: #ffb03f; | ||
120 | + | ||
121 | +} | ||
118 | 122 | ||
119 | .clonri { | 123 | .clonri { |
120 | margin: 0rpx; | 124 | margin: 0rpx; |
pages/user/my_service/tment_order_list.js
@@ -39,7 +39,11 @@ Page({ | @@ -39,7 +39,11 @@ Page({ | ||
39 | * 生命周期函数--监听页面加载 | 39 | * 生命周期函数--监听页面加载 |
40 | */ | 40 | */ |
41 | onLoad: function(options) { | 41 | onLoad: function(options) { |
42 | - | 42 | + var state=options.state; |
43 | + if (state != null && state != undefined && state!=""){ | ||
44 | + this.setData({ activeCategoryId: state }); | ||
45 | + } | ||
46 | + | ||
43 | }, | 47 | }, |
44 | changeTab: function(e) { | 48 | changeTab: function(e) { |
45 | var th = this; | 49 | var th = this; |
pages/user/view_comment/view_comment.js
0 → 100644
1 | +var i = require("../../../utils/util.js"), | ||
2 | + ut = i; | ||
3 | +var e = getApp(), | ||
4 | + a = e.globalData.setting, | ||
5 | + os = a, | ||
6 | + t = e.request, | ||
7 | + d = e.globalData; | ||
8 | +Page({ | ||
9 | + | ||
10 | + /** | ||
11 | + * 页面的初始数据 | ||
12 | + */ | ||
13 | + data: { | ||
14 | + url: a.url, | ||
15 | + iurl: a.imghost, | ||
16 | + comment: [], //用户单个评价的内容 | ||
17 | + goods_id: "", //商品id | ||
18 | + order_id: "", //订单id | ||
19 | + is_act: 0, //是否开启活动 | ||
20 | + actId: "", //活动id | ||
21 | + giftBagId: "", //礼包id | ||
22 | + }, | ||
23 | + | ||
24 | + /** | ||
25 | + * 生命周期函数--监听页面加载 | ||
26 | + */ | ||
27 | + onLoad: function(options) { | ||
28 | + var th = this; | ||
29 | + th.setData({ | ||
30 | + goods_id: options.goods_id, | ||
31 | + order_id: options.order_id | ||
32 | + }) | ||
33 | + th.query_comment(); | ||
34 | + }, | ||
35 | + | ||
36 | + /** | ||
37 | + * 生命周期函数--监听页面显示 | ||
38 | + */ | ||
39 | + onShow: function() { | ||
40 | + | ||
41 | + }, | ||
42 | + query_comment: function() { | ||
43 | + var th = this; | ||
44 | + wx.showLoading({ | ||
45 | + title: '加载中' | ||
46 | + }) | ||
47 | + var url = "/api/weshop/comment/list"; | ||
48 | + getApp().request.promiseGet(url, { | ||
49 | + data: { | ||
50 | + store_id: a.stoid, | ||
51 | + userId: d.user_id, | ||
52 | + goods_id: th.data.goods_id, | ||
53 | + order_id: th.data.order_id | ||
54 | + } | ||
55 | + }).then(res => { | ||
56 | + wx.hideLoading(); | ||
57 | + if (res.data.code == 0) { | ||
58 | + var data = res.data.data.pageData; | ||
59 | + if (data[0].img) data[0].img = ut.unserialize(data[0].img); | ||
60 | + if (data[0].weapp_img) data[0].weapp_img = JSON.parse(data[0].weapp_img); | ||
61 | + th.setData({ | ||
62 | + comment: data | ||
63 | + }) | ||
64 | + th.judge_act(); //判断是否开启评价有礼 | ||
65 | + } else { | ||
66 | + getApp().my_warnning("系统繁忙,请稍后再试", 0, th); | ||
67 | + } | ||
68 | + }) | ||
69 | + }, | ||
70 | + //评价有礼判断 | ||
71 | + judge_act: function() { | ||
72 | + var th = this; | ||
73 | + var url = "/api/weshop/marketing/comment/act/judge"; | ||
74 | + getApp().request.promiseGet(url, { | ||
75 | + data: { | ||
76 | + orderGoodsId: th.data.goods_id, | ||
77 | + orderNumber: th.data.order_id, | ||
78 | + orderType: 1, | ||
79 | + storeId: a.stoid, | ||
80 | + userId: d.user_id | ||
81 | + } | ||
82 | + }).then(res => { | ||
83 | + if (res.data.code == 0) { | ||
84 | + var id = res.data.data.id; | ||
85 | + var giftbagid = res.data.data.giftbagid; | ||
86 | + th.setData({ | ||
87 | + is_act: 1, | ||
88 | + actId: id, | ||
89 | + giftBagId: giftbagid | ||
90 | + }) | ||
91 | + } else { | ||
92 | + | ||
93 | + } | ||
94 | + }) | ||
95 | + }, | ||
96 | + //预览图片 | ||
97 | + previewImg: function(e) { | ||
98 | + var th = this; | ||
99 | + var index = e.currentTarget.dataset.index; | ||
100 | + var sindex = e.currentTarget.dataset.sindex; | ||
101 | + var imgArr = th.data.comment; | ||
102 | + var image = imgArr[0].weapp_img; | ||
103 | + var imagename = ""; | ||
104 | + var iurl = th.data.iurl; | ||
105 | + if (image != "") { | ||
106 | + image = imgArr[0].weapp_img[index]; | ||
107 | + wx.previewImage({ | ||
108 | + current: iurl + image, | ||
109 | + //当前图片地址 | ||
110 | + urls: imgArr[0].weapp_img, //所有要预览的图片的地址集合 数组形式 | ||
111 | + }) | ||
112 | + } else { | ||
113 | + image = imgArr[0].img[index]; | ||
114 | + wx.previewImage({ | ||
115 | + current: iurl + image, | ||
116 | + //当前图片地址 | ||
117 | + urls: imgArr[0].img, //所有要预览的图片的地址集合 数组形式 | ||
118 | + }) | ||
119 | + } | ||
120 | + }, | ||
121 | + goto: function(e) { | ||
122 | + var th = this; | ||
123 | + var url = e.currentTarget.dataset.url; | ||
124 | + getApp().goto(url); | ||
125 | + } | ||
126 | + | ||
127 | +}) | ||
0 | \ No newline at end of file | 128 | \ No newline at end of file |
pages/user/view_comment/view_comment.json
0 → 100644
pages/user/view_comment/view_comment.wxml
0 → 100644
1 | +<view class="commoditymax" wx:for="{{comment}}" wx:if="{{index==0}}" wx:for-item="item"> | ||
2 | + <!-- 商品评价 --> | ||
3 | + <view class='commodity'> | ||
4 | + <!-- 商品信息 --> | ||
5 | + <navigator class='information flex-vertical' url="{{'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id}}"> | ||
6 | + <image src="{{iurl+item.original_img}}" binderror="bind_bnerr2" data-errorimg="item.original_img"></image> | ||
7 | + <view class="goods_name xc-black"> | ||
8 | + <!-- 商品名称 --> | ||
9 | + <view class='ellipsis-2 fs32'>{{item.goods_name}}</view> | ||
10 | + <!-- 商品价格,数量 --> | ||
11 | + <view class='flex jc_sb balin'> | ||
12 | + <!-- 价格 --> | ||
13 | + <view class='flex-vertical balin'> | ||
14 | + <view class="fs24">¥</view> | ||
15 | + <view class="fs35">{{item.goods_price}}</view> | ||
16 | + </view> | ||
17 | + | ||
18 | + <!-- 商品数量 --> | ||
19 | + <view class='sum flex-vertical balin xc-black'> | ||
20 | + <view class="fs24">x</view> | ||
21 | + <view class="fs28">{{item.goods_num}}</view> | ||
22 | + </view> | ||
23 | + | ||
24 | + </view> | ||
25 | + | ||
26 | + </view> | ||
27 | + | ||
28 | + </navigator> | ||
29 | + | ||
30 | + | ||
31 | + <!-- 商品评价信息 --> | ||
32 | + <view class="addComment"> | ||
33 | + <view class="fs26 comment">{{item.content}}</view> | ||
34 | + <view class="flex addimages" wx:if="{{item.weapp_img.length>0 || item.img.length>0}}"> | ||
35 | + <!-- 评论图片集合 --> | ||
36 | + <view class="images"> | ||
37 | + <block wx:if="{{item.weapp_img!=''}}"> | ||
38 | + <image class="rel" catchtap="previewImg" data-index="{{index}}" src="{{iurl+item}}" wx:for="{{item.weapp_img}}" lazy-load="true"> | ||
39 | + </image> | ||
40 | + </block> | ||
41 | + <block wx:else> | ||
42 | + <image wx:if="{{item.img!=''}}" class="rel" catchtap="previewImg" data-index="{{index}}" src="{{iurl+item}}" wx:for="{{item.img}}" lazy-load="true"> | ||
43 | + </image> | ||
44 | + </block> | ||
45 | + </view> | ||
46 | + | ||
47 | + </view> | ||
48 | + | ||
49 | + </view> | ||
50 | + </view> | ||
51 | + | ||
52 | + <!-- 评价等级 --> | ||
53 | + <view class="Grade"> | ||
54 | + <!-- 宝贝评分 --> | ||
55 | + <view class="title flex-vertical"> | ||
56 | + <view class="column"></view> | ||
57 | + <view class="fs28">宝贝评分</view> | ||
58 | + </view> | ||
59 | + | ||
60 | + <!-- 服务评级 --> | ||
61 | + <view class="score-items"> | ||
62 | + <view class="score-item flex-vertical"> | ||
63 | + <view class="fs24">描述相符</view> | ||
64 | + <view class="stars flex-vertical"> | ||
65 | + <view class="flex-vertical" wx:for="{{5}}" wx:for-item="goods" wx:for-index="goods"> | ||
66 | + <image src="{{goods<item.goods_rank?iurl+'/miniapp/images/StarsredCk.png':iurl+'/miniapp/images/StarswhiteUnCk.png'}}" lazy-load="true"></image> | ||
67 | + </view> | ||
68 | + </view> | ||
69 | + </view> | ||
70 | + | ||
71 | + <view class="score-item flex-vertical"> | ||
72 | + <view class="fs24">物流服务</view> | ||
73 | + <view class="stars flex-vertical"> | ||
74 | + <view class="flex-vertical" wx:for="{{5}}" wx:for-item="deliver" wx:for-index="deliver"> | ||
75 | + <image src="{{deliver<item.deliver_rank?iurl+'/miniapp/images/StarsredCk.png':iurl+'/miniapp/images/StarswhiteUnCk.png'}}" lazy-load="true"></image> | ||
76 | + </view> | ||
77 | + </view> | ||
78 | + </view> | ||
79 | + <view class="score-item flex-vertical"> | ||
80 | + <view class="fs24">服务态度</view> | ||
81 | + <view class="stars flex-vertical"> | ||
82 | + <view class="flex-vertical" wx:for="{{5}}" wx:for-item="service" wx:for-index="service"> | ||
83 | + <image src="{{service<item.service_rank?iurl+'/miniapp/images/StarsredCk.png':iurl+'/miniapp/images/StarswhiteUnCk.png'}}" lazy-load="true"></image> | ||
84 | + </view> | ||
85 | + </view> | ||
86 | + | ||
87 | + </view> | ||
88 | + | ||
89 | + </view> | ||
90 | + | ||
91 | + </view> | ||
92 | +</view> | ||
93 | +<!-- 是否匿名评价 --> | ||
94 | +<view class="Whether" wx:if="{{comment.length>0}}"> | ||
95 | + <view class="Submission flex-level "> | ||
96 | + <view class="fs30 flex-level white " bindtap="goto" data-url="/pages/user/comment/comment">评价其他</view> | ||
97 | + </view> | ||
98 | + <view class="flex-level" wx:if="{{is_act}}"> | ||
99 | + <view class="fs30 flex-level white receive" data-url="/pages/giftpack/evaluategift/evaluategift?actId={{actId}}&orderNumber={{order_id}}&orderGoodsId={{goods_id}}&giftBagId={{giftBagId}}" bindtap="goto">点击领取礼品</view> | ||
100 | + </view> | ||
101 | +</view> | ||
102 | + | ||
103 | +<!-- 引入提示组件 --> | ||
104 | +<warn id="warn"></warn> | ||
105 | +<my_confirm id="my_confirm"></my_confirm> | ||
0 | \ No newline at end of file | 106 | \ No newline at end of file |
pages/user/view_comment/view_comment.wxss
0 → 100644
1 | +page{ | ||
2 | + overflow-x: hidden; | ||
3 | +} | ||
4 | +/* 商品详情和评价 */ | ||
5 | +.commoditymax{ | ||
6 | + overflow-x: hidden; | ||
7 | +} | ||
8 | +.commodity { | ||
9 | + border-top: 6rpx solid rgb(245, 245, 245); | ||
10 | + border-bottom: 6rpx solid rgb(245, 245, 245); | ||
11 | + padding: 0rpx 30rpx; | ||
12 | + padding-bottom:10rpx; | ||
13 | +} | ||
14 | + | ||
15 | +.commodity .information { | ||
16 | + height: 286rpx; | ||
17 | +} | ||
18 | + | ||
19 | +.commodity .information image { | ||
20 | + width: 186rpx; | ||
21 | + height: 186rpx; | ||
22 | +} | ||
23 | + | ||
24 | +.information .goods_name { | ||
25 | + width: 480rpx; | ||
26 | + margin-left: 25rpx; | ||
27 | + height: 186rpx; | ||
28 | +} | ||
29 | + | ||
30 | +.information .goods_name .ellipsis-2 { | ||
31 | + line-height: 40rpx; | ||
32 | + height: 80rpx; | ||
33 | +} | ||
34 | + | ||
35 | +.information .goods_name .jc_sb { | ||
36 | + margin-top: 60rpx; | ||
37 | + color: rgb(212, 28, 52); | ||
38 | + margin-right: 7rpx; | ||
39 | +} | ||
40 | + | ||
41 | +.information .goods_name .jc_sb .fs32 { | ||
42 | + line-height: 40rpx; | ||
43 | +} | ||
44 | + | ||
45 | +.information .goods_name .jc_sb .sum { | ||
46 | + margin-right: 5rpx; | ||
47 | +} | ||
48 | + | ||
49 | +.balin { | ||
50 | + align-items: baseline; | ||
51 | +} | ||
52 | + | ||
53 | +.addComment { | ||
54 | + width: 690rpx; | ||
55 | + padding: 32rpx 0rpx 21rpx 0rpx; | ||
56 | +} | ||
57 | + | ||
58 | +.addComment textarea { | ||
59 | + padding: 0rpx 18rpx; | ||
60 | + max-height: 100rpx; | ||
61 | + width: 654rpx; | ||
62 | +} | ||
63 | + | ||
64 | +.addComment .addimages { | ||
65 | + padding: 0rpx 18rpx; | ||
66 | + margin-top: 20rpx; | ||
67 | + align-items: flex-end; | ||
68 | + width: 652rpx; | ||
69 | + margin-bottom: 15rpx; | ||
70 | +} | ||
71 | +.comment{ | ||
72 | + overflow: hidden; | ||
73 | + text-overflow: ellipsis; | ||
74 | + display: -webkit-box; | ||
75 | + -webkit-box-orient: vertical; | ||
76 | + -webkit-line-clamp: 3; | ||
77 | +} | ||
78 | +.addComment .addimages .images { | ||
79 | + height: 140rpx; | ||
80 | +} | ||
81 | + | ||
82 | +.addComment .addimages .images .rel { | ||
83 | + width: 140rpx; | ||
84 | + height: 100%; | ||
85 | + overflow: visible; | ||
86 | + margin-right: 15rpx; | ||
87 | +} | ||
88 | + | ||
89 | +.addComment .addimages .images image .abs { | ||
90 | + width: 30rpx; | ||
91 | + height: 30rpx; | ||
92 | + top: -7rpx; | ||
93 | + right: -7rpx; | ||
94 | +} | ||
95 | + | ||
96 | +.addComment .addimage { | ||
97 | + width: 139rpx; | ||
98 | + height: 139rpx; | ||
99 | + border: 2rpx dashed rgb(196, 196, 196); | ||
100 | + font-size: 16rpx; | ||
101 | + margin-left: 6rpx; | ||
102 | +} | ||
103 | + | ||
104 | +.addComment .addimage image { | ||
105 | + width: 60rpx; | ||
106 | + height: 58rpx; | ||
107 | +} | ||
108 | + | ||
109 | +.Grade { | ||
110 | + width: 100%; | ||
111 | + height: 310rpx; | ||
112 | + border-bottom: 6rpx solid rgb(245, 245, 245); | ||
113 | + padding-left: 45rpx; | ||
114 | +} | ||
115 | + | ||
116 | +.Grade .title { | ||
117 | + width: 100%; | ||
118 | + height: 105rpx; | ||
119 | +} | ||
120 | + | ||
121 | +.Grade .title .column { | ||
122 | + height: 30rpx; | ||
123 | + border-left: 6rpx solid rgb(211, 27, 58); | ||
124 | + margin-right: 12rpx; | ||
125 | +} | ||
126 | + | ||
127 | +.Grade .score-item { | ||
128 | + height: 55rpx; | ||
129 | + line-height: 55rpx; | ||
130 | +} | ||
131 | + | ||
132 | +.Grade .score-item .stars { | ||
133 | + margin-left: 83rpx; | ||
134 | +} | ||
135 | +.Grade .score-item .stars view{ | ||
136 | + width: 60rpx; | ||
137 | + height: 55rpx; | ||
138 | +} | ||
139 | + | ||
140 | +.Grade .score-item .stars image { | ||
141 | + width: 35rpx; | ||
142 | + height: 35rpx; | ||
143 | +} | ||
144 | +.Whether { | ||
145 | + padding:0rpx 31rpx; | ||
146 | +} | ||
147 | +.Whether .flex-right-vertical { | ||
148 | + height: 67rpx; | ||
149 | +} | ||
150 | + | ||
151 | +.Whether .flex-right-vertical .radio { | ||
152 | + margin-right: 15rpx; | ||
153 | +} | ||
154 | + | ||
155 | +.Whether .Submission { | ||
156 | + margin: 40rpx 0 40rpx 0; | ||
157 | +} | ||
158 | + | ||
159 | +.Whether .white { | ||
160 | + width: 364rpx; | ||
161 | + height: 58rpx; | ||
162 | + background-color: rgb(212, 28, 52); | ||
163 | + border-radius: 40rpx; | ||
164 | + line-height: 58rpx; | ||
165 | +} | ||
166 | +.Whether .receive{ | ||
167 | + background-color: rgb(255, 176, 63); | ||
168 | +} | ||
169 | + | ||
170 | + |
utils/request.js
@@ -116,7 +116,8 @@ module.exports = { | @@ -116,7 +116,8 @@ module.exports = { | ||
116 | }, | 116 | }, |
117 | showLoading: function() { | 117 | showLoading: function() { |
118 | wx.showLoading({ | 118 | wx.showLoading({ |
119 | - title: "加载中" | 119 | + title: "加载中", |
120 | + mask:true, | ||
120 | }); | 121 | }); |
121 | }, | 122 | }, |
122 | hideLoading: function() { | 123 | hideLoading: function() { |
@@ -211,6 +212,29 @@ module.exports = { | @@ -211,6 +212,29 @@ module.exports = { | ||
211 | setTimeout(function () { | 212 | setTimeout(function () { |
212 | if(req) req.abort(); | 213 | if(req) req.abort(); |
213 | },time*1000) | 214 | },time*1000) |
214 | - } | 215 | + }, |
216 | + | ||
217 | + /** | ||
218 | + * @param {Object} url //url地址 | ||
219 | + * @param {Object} data //data入参 | ||
220 | + * @param {Object} succ //成功的回调 | ||
221 | + * @param {Object} fail //失败的回调 | ||
222 | + */ | ||
223 | + json_post:function(url,data,succ,fail){ | ||
224 | + var th=this; | ||
225 | + this.showLoading(); | ||
226 | + if(url.indexOf("http")==-1) url=getApp().globalData.setting.url +url; | ||
227 | + var str = JSON.stringify(data); | ||
228 | + wx.request({ | ||
229 | + url: url, | ||
230 | + data: str, | ||
231 | + method: 'POST', | ||
232 | + header: { | ||
233 | + 'content-type': 'application/json' | ||
234 | + },// 设置请求的 header | ||
235 | + success: function (res) { succ(res);th.hideLoading(); }, | ||
236 | + fail:function(res){fail(res);} | ||
237 | + }) | ||
238 | + } | ||
215 | 239 | ||
216 | }; | 240 | }; |
217 | \ No newline at end of file | 241 | \ No newline at end of file |
utils/util.js
1 | - | ||
2 | function isString(str) { | 1 | function isString(str) { |
3 | return (typeof str == 'string') && str.constructor == String; | 2 | return (typeof str == 'string') && str.constructor == String; |
4 | } | 3 | } |
@@ -309,6 +308,11 @@ function draw_randon_rect(ctx,x,y,r,w,h){ | @@ -309,6 +308,11 @@ function draw_randon_rect(ctx,x,y,r,w,h){ | ||
309 | 308 | ||
310 | } | 309 | } |
311 | 310 | ||
311 | + | ||
312 | +function null_promise(){ | ||
313 | + var promise=new Promise(function(resolve, reject){ var ob={code:-1,data:null}; resolve(ob); }); return promise; | ||
314 | +} | ||
315 | + | ||
312 | module.exports = { | 316 | module.exports = { |
313 | formatTime: function(e, r) { | 317 | formatTime: function(e, r) { |
314 | var t = e ? new Date(1e3 * e) : new Date(), n = t.getFullYear(), o = t.getMonth() + 1, a = t.getDate(), u = t.getHours(), i = t.getMinutes(), f = t.getSeconds(), s = function(e) { | 318 | var t = e ? new Date(1e3 * e) : new Date(), n = t.getFullYear(), o = t.getMonth() + 1, a = t.getDate(), u = t.getHours(), i = t.getMinutes(), f = t.getSeconds(), s = function(e) { |
@@ -400,5 +404,6 @@ module.exports = { | @@ -400,5 +404,6 @@ module.exports = { | ||
400 | check_mobile: check_mobile,//验证手机 | 404 | check_mobile: check_mobile,//验证手机 |
401 | get_rand_item:get_rand_item, //随机获取元素 | 405 | get_rand_item:get_rand_item, //随机获取元素 |
402 | getDistance:getDistance, //获取俩个经纬网度之间的距离 | 406 | getDistance:getDistance, //获取俩个经纬网度之间的距离 |
403 | - draw_randon_rect:draw_randon_rect //画图画圆角矩形 | 407 | + draw_randon_rect:draw_randon_rect ,//画图画圆角矩形 |
408 | + null_promise:null_promise,//返回空的promise | ||
404 | }; | 409 | }; |