Commit 7e08339ad7865d89fd0e84eaf2dda49cac627e78
1 parent
120c72ad
首页自定义卡项模版、我的礼包一键领取
Showing
6 changed files
with
735 additions
and
21 deletions
components/serviceCard_list/g_filter.wxs
0 → 100644
1 | +var g_filters = { | ||
2 | + //-- 判断是不是有等级价 -- | ||
3 | + is_has_rank:function(rank_switch,item){ | ||
4 | + if(!rank_switch) return false; | ||
5 | + if(item.cardprice1 || item.cardprice2 || item.cardprice3) {return true} | ||
6 | + return false; | ||
7 | + }, | ||
8 | + | ||
9 | + //-- 判断,不是等级会员时候,要显示的最低等级价和名称 -- | ||
10 | + get_card_price:function(goods,all_card,type){ | ||
11 | + var price1=parseFloat(goods['cardprice1']); | ||
12 | + var price2 = parseFloat(goods['cardprice2']); | ||
13 | + var price3 = parseFloat(goods['cardprice3']); | ||
14 | + if(!all_card){ | ||
15 | + if(type==0) return 0; | ||
16 | + return ""; | ||
17 | + } | ||
18 | + | ||
19 | + var min_price=null; | ||
20 | + var min_name=null; | ||
21 | + //---设置对应的价格名字---- | ||
22 | + for(var i=0;i<3;i++) { | ||
23 | + var vl=all_card[i]; | ||
24 | + if(!vl) continue; | ||
25 | + | ||
26 | + if(vl['CorrPrice']=="Price1" && price1>0) | ||
27 | + { | ||
28 | + if(min_price==null) { | ||
29 | + min_price=price1;min_name=vl['CardName']; | ||
30 | + } | ||
31 | + else if(price1<min_price) { | ||
32 | + min_price=price1;min_name=vl['CardName']; | ||
33 | + } | ||
34 | + } | ||
35 | + if(vl['CorrPrice']=="Price2" && price2>0) | ||
36 | + { | ||
37 | + if(min_price==null) { | ||
38 | + min_price=price2;min_name=vl['CardName']; | ||
39 | + } | ||
40 | + else if(price2<min_price) { | ||
41 | + min_price=price2;min_name=vl['CardName']; | ||
42 | + } | ||
43 | + } | ||
44 | + | ||
45 | + if(vl['CorrPrice']=="Price3" && price3>0) | ||
46 | + { | ||
47 | + if(min_price==null) { | ||
48 | + min_price=price3;min_name=vl['CardName']; | ||
49 | + } | ||
50 | + else if(price3<min_price) { | ||
51 | + min_price=price3;min_name=vl['CardName']; | ||
52 | + } | ||
53 | + } | ||
54 | + | ||
55 | + } | ||
56 | + if(min_price==null){ | ||
57 | + if(type==0) return 0; | ||
58 | + return ""; | ||
59 | + } | ||
60 | + | ||
61 | + if(type==0) return min_price; | ||
62 | + if(min_name.length>4 ) min_name=min_name.substring(0, 8); | ||
63 | + return min_name; | ||
64 | + }, | ||
65 | + | ||
66 | + get_url_by_type: function(item) { | ||
67 | + var url = ''; | ||
68 | + if(item.prom_type == 9) { | ||
69 | + url = '/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=' + item.goods_id + '&group_id=' + item.prom_id; | ||
70 | + } | ||
71 | + else if(item.prom_type==8){ | ||
72 | + url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id | ||
73 | + } | ||
74 | + else { | ||
75 | + url = '/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_id=' + item.prom_id + '&prom_type=' + item.prom_type; | ||
76 | + }; | ||
77 | + return url; | ||
78 | + }, | ||
79 | + | ||
80 | +} | ||
81 | +module.exports = { | ||
82 | + is_has_rank:g_filters.is_has_rank, | ||
83 | + get_card_price:g_filters.get_card_price, | ||
84 | + get_url_by_type:g_filters.get_url_by_type, | ||
85 | +} | ||
0 | \ No newline at end of file | 86 | \ No newline at end of file |
components/serviceCard_list/serviceCard_list.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 | +Component({ | ||
9 | + data: { | ||
10 | + url: o.imghost, | ||
11 | + object: null, | ||
12 | + curPage: 1, | ||
13 | + is_no_more: 1, //加载完所有数据的控制器 | ||
14 | + load_complete: 0, //加载完成, | ||
15 | + rank_switch: false, | ||
16 | + card_field: "", | ||
17 | + card_name: "", | ||
18 | + max_card_field: "", | ||
19 | + card_list: null | ||
20 | + }, | ||
21 | + properties: { | ||
22 | + // 这⾥定义了innerText属性,属性值可以在组件使⽤时指定 | ||
23 | + }, | ||
24 | + ready: function () {}, | ||
25 | + pageLifetimes: { | ||
26 | + //要处理一下,游客登录后的界面的变化,主要还该是改变会员 | ||
27 | + show: function () { | ||
28 | + console.log('page-show'); | ||
29 | + this.init(); | ||
30 | + if(getApp().globalData.login_back==1){ | ||
31 | + getApp().globalData.login_back==0; | ||
32 | + this.data.curPage=1; | ||
33 | + this.setData({ recommend: [] }); | ||
34 | + this.get_list(); | ||
35 | + } | ||
36 | + } | ||
37 | + }, | ||
38 | + | ||
39 | + methods: { | ||
40 | + init: function () { | ||
41 | + var th = this; | ||
42 | + if (!getApp().globalData.user_id) return false; | ||
43 | + getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, { | ||
44 | + isShowLoading: false, | ||
45 | + success: function (e) { | ||
46 | + if (e.data.code == 0 && e.data && e.data.data) { | ||
47 | + getApp().globalData.userInfo = e.data.data; | ||
48 | + getApp().getConfig2(function (e) { | ||
49 | + var swithc_list = e.switch_list; | ||
50 | + var sw_arr = JSON.parse(swithc_list); | ||
51 | + //---如果后台有开等级卡的开关--- | ||
52 | + if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { | ||
53 | + th.setData({ | ||
54 | + rank_switch: true | ||
55 | + }); | ||
56 | + //---回调卡的列表--- | ||
57 | + th.getPlusCardType(function (ob) { | ||
58 | + th.setData({ | ||
59 | + card_list: ob.card_list | ||
60 | + }); | ||
61 | + var ti = setInterval(function () { | ||
62 | + var user = getApp().globalData.userInfo; | ||
63 | + if (!user) return false; | ||
64 | + clearInterval(ti); | ||
65 | + if (user.card_field && user['card_expiredate']) { | ||
66 | + var str = user['card_expiredate'].replace(/-/g, '/'); | ||
67 | + var end = new Date(str); | ||
68 | + end = Date.parse(end) / 1000; | ||
69 | + var now = ut.gettimestamp(); | ||
70 | + //--- 判断是等级会员,且在有效期范围内 --- | ||
71 | + if (user.card_field && now < end) { | ||
72 | + var card_name = ob.name_map.get(user.card_field); | ||
73 | + if (card_name.length > 4) card_name = card_name.substring(0, 8); | ||
74 | + th.setData({ | ||
75 | + card_field: user.card_field, | ||
76 | + card_name: card_name, | ||
77 | + card_list: ob.card_list | ||
78 | + }); | ||
79 | + } | ||
80 | + } | ||
81 | + }, 500) | ||
82 | + }) | ||
83 | + } | ||
84 | + }) | ||
85 | + | ||
86 | + } | ||
87 | + | ||
88 | + | ||
89 | + | ||
90 | + } | ||
91 | + }) | ||
92 | + }, | ||
93 | + // get_list: function () { | ||
94 | + // var th = this; | ||
95 | + // var url = "http://172.20.0.233:8022/api/weshop/display"; | ||
96 | + // wx.request({ | ||
97 | + // url: url, | ||
98 | + // success: function (res) { | ||
99 | + // th.setData({ | ||
100 | + // recommend: res.data.data.pageData | ||
101 | + // }) | ||
102 | + // } | ||
103 | + // }) | ||
104 | + // }, | ||
105 | + get_list: function () { | ||
106 | + var that = this; | ||
107 | + if (that.data.is_no_more == 0) return false; | ||
108 | + var user_id=getApp().globalData.user_id; | ||
109 | + if(!user_id) user_id=0; | ||
110 | + | ||
111 | + var curPage = that.data.curPage; | ||
112 | + | ||
113 | + // page: curPage, | ||
114 | + // pageSize: 6, | ||
115 | + // orderField: "sort", | ||
116 | + // orderType: 'asc', | ||
117 | + // // user_id: user_id, | ||
118 | + // // is_mainshow: 1, | ||
119 | + // // isonsale: 1, | ||
120 | + // // is_on_sale: 1, | ||
121 | + // is_recommend: 1, | ||
122 | + // store_id: o.stoid, | ||
123 | + | ||
124 | + getApp().request.get('/api/weshop/serviceCard/page', { | ||
125 | + isShowLoading: false, | ||
126 | + data: { | ||
127 | + is_recommend: 1, | ||
128 | + store_id: o.stoid, | ||
129 | + }, | ||
130 | + success: function (res) { | ||
131 | + console.log('获取卡项推荐', res.data.data); | ||
132 | + var data = res.data; | ||
133 | + var total = data.data.total; | ||
134 | + if (total <= curPage * 6) { | ||
135 | + that.setData({ | ||
136 | + is_no_more: 0 | ||
137 | + }); | ||
138 | + } else { | ||
139 | + that.data.curPage++; | ||
140 | + } | ||
141 | + //加载完成 | ||
142 | + if (data.data.pageData) { | ||
143 | + | ||
144 | + for(let i in data.data.pageData){ | ||
145 | + let item=data.data.pageData[i]; | ||
146 | + if(item.user_price) | ||
147 | + item.prom_price=item.user_price; | ||
148 | + } | ||
149 | + | ||
150 | + that.setData({ | ||
151 | + load_complete: 1 | ||
152 | + }); | ||
153 | + } | ||
154 | + if (that.data.recommend != null) { | ||
155 | + var ra = that.data.recommend.concat(data.data.pageData); | ||
156 | + that.setData({ | ||
157 | + recommend: ra | ||
158 | + }); | ||
159 | + } else { | ||
160 | + that.setData({ | ||
161 | + recommend: data.data.pageData | ||
162 | + }); | ||
163 | + } | ||
164 | + | ||
165 | + console.log('卡项推荐按~~~~~~', that.data.recommend) | ||
166 | + } | ||
167 | + }) | ||
168 | + }, | ||
169 | + bind_bnerr_xc: function (e) { | ||
170 | + var _errImg = e.target.dataset.errorimg; | ||
171 | + var _errurl = e.target.dataset.url; | ||
172 | + var _errObj = {}; | ||
173 | + _errObj[_errImg] = "/miniapp/images/default_g_img.gif"; | ||
174 | + this.setData(_errObj) //注意这⾥的赋值⽅式,只是将数据列表中的此项图⽚路径值替换掉 ; | ||
175 | + }, | ||
176 | + reset: function () { | ||
177 | + curPage = 1; | ||
178 | + }, | ||
179 | + //--- 获取卡类列表 --- | ||
180 | + getPlusCardType: function (func) { | ||
181 | + var storid = o.stoid; | ||
182 | + var th = this; | ||
183 | + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => { | ||
184 | + | ||
185 | + if (res.data.code != 0 || !res.data.data) { | ||
186 | + var ob = { | ||
187 | + "card_list": [], | ||
188 | + "name_map": "" | ||
189 | + }; | ||
190 | + func(ob); | ||
191 | + return false; | ||
192 | + } | ||
193 | + | ||
194 | + var plusCard = res.data.data; | ||
195 | + var arr = [1219, 2089, 3031]; | ||
196 | + var new_arr = new Array(); | ||
197 | + var card_name_map = new Map(); | ||
198 | + | ||
199 | + var user = getApp().globalData.userInfo; | ||
200 | + if (plusCard) { | ||
201 | + for (var i = 0; i < plusCard.length; i++) { | ||
202 | + if ((!user || user.card_field == null || user.card_field == "") && (plusCard[i].IsStopBuy == true)) { | ||
203 | + continue; | ||
204 | + } | ||
205 | + var name = "card" + plusCard[i].CorrPrice.toLowerCase(); | ||
206 | + card_name_map.set(name, plusCard[i].CardName); | ||
207 | + new_arr.push(plusCard[i]); | ||
208 | + | ||
209 | + } | ||
210 | + } | ||
211 | + var ob = { | ||
212 | + "card_list": new_arr, | ||
213 | + "name_map": card_name_map | ||
214 | + }; | ||
215 | + func(ob); | ||
216 | + }) | ||
217 | + }, | ||
218 | + | ||
219 | + go_url:function (e) { | ||
220 | + var url=e.currentTarget.dataset.url; | ||
221 | + console.log('url===>>>>', url); | ||
222 | + getApp().goto(url); | ||
223 | + } | ||
224 | + | ||
225 | + }, | ||
226 | +}) | ||
0 | \ No newline at end of file | 227 | \ No newline at end of file |
components/serviceCard_list/serviceCard_list.json
0 → 100644
components/serviceCard_list/serviceCard_list.wxml
0 → 100644
1 | +<!-- 商品列表 --> | ||
2 | +<wxs module="filter" src="../../utils/filter.wxs"></wxs> | ||
3 | +<wxs module="g_filter" src="g_filter.wxs"></wxs> | ||
4 | +<view class="collects"> | ||
5 | + <view class="hang "> | ||
6 | + <!-- 商品详情 --> | ||
7 | + | ||
8 | + <view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="/packageA/pages/goodsInfo/goodsInfo?goods_id={{item.id}}"> | ||
9 | + <!--<view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="{{item.prom_type == 9 ? ('/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=' + item.goods_id + '&group_id=' + item.prom_id):('/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id+'&title='+item.goods_name+'&prom_type='+item.prom_type+'&prom_id='+item.prom_id)}}">--> | ||
10 | + <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}" hover-class="none"> --> | ||
11 | + <navigator hover-class="none"> | ||
12 | + <!-- 商品图⽚ --> | ||
13 | + <image class="sp" src="{{url+item.imgUrl}}" mode="aspectFill" binderror="bind_bnerr_xc" data-url="{{url+item.original_img}}" data-errorimg="recommend[{{index}}].imgUrl"></image> | ||
14 | + <view class="bottom"> | ||
15 | + <!-- 商品名称 --> | ||
16 | + <view class="goods_name ellipsis-2 fs28">{{item.serviceName}}</view> | ||
17 | + <!-- 判断是否有活动价 --> | ||
18 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 && item.prom_type!=7 && item.prom_type!=10}}"> | ||
19 | + <view class="pdt10"> | ||
20 | + <view class="money flex xc-wc" > | ||
21 | + <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text> | ||
22 | + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | ||
23 | + <!-- 活动价 --> | ||
24 | + <view class="flex xc-wc" wx:if="{{item.prom_price}}"> | ||
25 | + <view class="fs24">¥</view> | ||
26 | + <view class="fs35">{{item.prom_price}}</view> | ||
27 | + </view> | ||
28 | + </view> | ||
29 | + <view class="flex"> | ||
30 | + <!-- 原价 --> | ||
31 | + <view class="price flex xc-ash line_th"> | ||
32 | + <view class="fs22">¥</view> | ||
33 | + <view class="fs22">{{item.market_price}}</view> | ||
34 | + </view> | ||
35 | + </view> | ||
36 | + </view> | ||
37 | + | ||
38 | + </block> | ||
39 | + <block wx:else> | ||
40 | + <!-- 商品价格,先判断下是后⼜等级价--> | ||
41 | + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}"> | ||
42 | + <!-- 当会员是等级卡的时候 --> | ||
43 | + <block wx:if="{{card_field}}"> | ||
44 | + <!-- 等级价>0 --> | ||
45 | + <block wx:if="{{item[card_field]>0}}"> | ||
46 | + <view class="money flex"> | ||
47 | + <!-- 办卡价 --> | ||
48 | + <view class="flex xc-wc ai_and"> | ||
49 | + <view class="fs24">¥</view> | ||
50 | + <view class="fs35">{{filter.toFix(item[card_field],2)}}</view> | ||
51 | + <view class="card_bg ellipsis-1"> | ||
52 | + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image> | ||
53 | + <text class="card_name">{{card_name}}</text> | ||
54 | + </view> | ||
55 | + </view> | ||
56 | + </view> | ||
57 | + <view class="flex"> | ||
58 | + <!-- 原价 --> | ||
59 | + <view class="price flex xc-ash line_th"> | ||
60 | + <view class="fs22">¥</view> | ||
61 | + <view class="fs22">{{item.market_price}}</view> | ||
62 | + </view> | ||
63 | + </view> | ||
64 | + </block> | ||
65 | + <blocK wx:else> | ||
66 | + <view class="money flex"> | ||
67 | + <!-- 办卡价 --> | ||
68 | + <view class="flex xc-wc"> | ||
69 | + <view class="fs24">¥</view> | ||
70 | + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view> | ||
71 | + </view> | ||
72 | + </view> | ||
73 | + <view class="flex"> | ||
74 | + <!-- 原价 --> | ||
75 | + <view class="price flex xc-ash line_th"> | ||
76 | + <view class="fs22">¥</view> | ||
77 | + <view class="fs22">{{item.market_price}}</view> | ||
78 | + </view> | ||
79 | + </view> | ||
80 | + </blocK> | ||
81 | + </block> | ||
82 | + <block wx:else> | ||
83 | + <!-- 如果商品有设置等级价⼤于0的 --> | ||
84 | + <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}"> | ||
85 | + <view class="money flex"> | ||
86 | + <!-- 办卡价 --> | ||
87 | + <view class="flex xc-wc"> | ||
88 | + <view class="fs24">¥</view> | ||
89 | + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view> | ||
90 | + </view> | ||
91 | + <!-- 原价 --> | ||
92 | + <view class="price flex xc-ash line_th"> | ||
93 | + <view class="fs22">¥</view> | ||
94 | + <view class="fs22">{{item.market_price}}</view> | ||
95 | + </view> | ||
96 | + </view> | ||
97 | + <view class="flexr" style=""> | ||
98 | + <!-- 等级价 --> | ||
99 | + <view class="price flex ai-center"> | ||
100 | + <view class="fs22">¥</view> | ||
101 | + <view class="fs28">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view> | ||
102 | + <view class="card_bg ellipsis-1"> | ||
103 | + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></ image> | ||
104 | + <text class="card_name">{{g_filter.get_card_price(item,card_list,1)}}</text> | ||
105 | + </view> | ||
106 | + </view> | ||
107 | + </view> | ||
108 | + </block> | ||
109 | + <block wx:else> | ||
110 | + <view class="money flex"> | ||
111 | + <!-- 办卡价 --> | ||
112 | + <view class="flex xc-wc"> | ||
113 | + <view class="fs24">¥</view> | ||
114 | + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view> | ||
115 | + </view> | ||
116 | + </view> | ||
117 | + <view class="flex"> | ||
118 | + <!-- 原价 --> | ||
119 | + <view class="price flex xc-ash line_th"> | ||
120 | + <view class="fs22">¥</view> | ||
121 | + <view class="fs22">{{item.market_price}}</view> | ||
122 | + </view> | ||
123 | + </view> | ||
124 | + </block> | ||
125 | + </block> | ||
126 | + </block> | ||
127 | + <!-- 商品压根就没有等级价 --> | ||
128 | + <view class="pdt10" wx:else> | ||
129 | + <view class="money flex"> | ||
130 | + <!-- 办卡价 --> | ||
131 | + <view class="flex xc-wc"> | ||
132 | + <view class="fs24">¥</view> | ||
133 | + <view class="fs35">{{filter.toFix(item.money,2)}}</view> | ||
134 | + </view> | ||
135 | + </view> | ||
136 | + <view class="flex" style=""> | ||
137 | + <!-- 原价 --> | ||
138 | + <view class="price flex xc-ash line_th"> | ||
139 | + <view class="fs22">¥</view> | ||
140 | + <view class="fs22">{{item.show_price}}</view> | ||
141 | + </view> | ||
142 | + </view> | ||
143 | + </view> | ||
144 | + </block> | ||
145 | + </view> | ||
146 | + </navigator> | ||
147 | + </view> | ||
148 | + </view> | ||
149 | + <view class="nothing flex-center" wx:if="{{is_no_more==0}}"> | ||
150 | + <view class="Foil"></view> | ||
151 | + <view class="no_content fs24">没有更多内容了</view> | ||
152 | + <view class="Foil"></view> | ||
153 | + </view> | ||
154 | +</view> | ||
0 | \ No newline at end of file | 155 | \ No newline at end of file |
components/serviceCard_list/serviceCard_list.wxss
0 → 100644
1 | +.collects { | ||
2 | + /* margin-top: 40rpx; */ | ||
3 | + /* margin-bottom: 40rpx; */ | ||
4 | +} | ||
5 | + | ||
6 | +.pdt10 { | ||
7 | + padding-top: 10rpx; | ||
8 | +} | ||
9 | + | ||
10 | +.ai-center{ | ||
11 | + align-items: center; | ||
12 | +} | ||
13 | + | ||
14 | +.ib { | ||
15 | + display: inline-block; | ||
16 | +} | ||
17 | + | ||
18 | +.fs20 { | ||
19 | + font-size: 20rpx; | ||
20 | +} | ||
21 | + | ||
22 | +.fs22 { | ||
23 | + font-size: 22rpx; | ||
24 | +} | ||
25 | + | ||
26 | +.fs24 { | ||
27 | + font-size: 24rpx; | ||
28 | +} | ||
29 | + | ||
30 | +.fs26 { | ||
31 | + font-size: 26rpx; | ||
32 | +} | ||
33 | + | ||
34 | +.fs28 { | ||
35 | + font-size: 28rpx; | ||
36 | +} | ||
37 | + | ||
38 | +.fs35 { | ||
39 | + font-size: 35rpx; | ||
40 | +} | ||
41 | + | ||
42 | +.flex-center { | ||
43 | + display: flex; | ||
44 | + justify-content: center; | ||
45 | + align-items: center; | ||
46 | +} | ||
47 | + | ||
48 | +.ellipsis-1 { | ||
49 | + overflow: hidden; | ||
50 | + white-space: nowrap; | ||
51 | + text-overflow: ellipsis; | ||
52 | +} | ||
53 | + | ||
54 | +/* .ellipsis-1x { | ||
55 | + overflow: hidden; | ||
56 | + text-overflow: ellipsis; | ||
57 | + display: -webkit-box; | ||
58 | + -webkit-box-orient: vertical; | ||
59 | + -webkit-line-clamp: 1; | ||
60 | +} */ | ||
61 | + | ||
62 | +.xc-wc { | ||
63 | + color: #d60021; | ||
64 | +} | ||
65 | + | ||
66 | +.xc-ash { | ||
67 | + color: #b9b9b9; | ||
68 | +} | ||
69 | + | ||
70 | +.choice_box .choice_list .choice_footer .price { | ||
71 | + color: #f23030; | ||
72 | + height: 10px; | ||
73 | +} | ||
74 | + | ||
75 | +.flex { | ||
76 | + display: flex; | ||
77 | +} | ||
78 | + | ||
79 | +.ellipsis-2 { | ||
80 | + overflow: hidden; | ||
81 | + text-overflow: ellipsis; | ||
82 | + display: -webkit-box; | ||
83 | + -webkit-box-orient: vertical; | ||
84 | + -webkit-line-clamp: 2; | ||
85 | +} | ||
86 | + | ||
87 | +.goods_name { | ||
88 | + height: 62rpx; | ||
89 | + /* margin-top: 6rpx; */ | ||
90 | + line-height: 1.2; | ||
91 | + margin-bottom: 10rpx; | ||
92 | +} | ||
93 | + | ||
94 | +.hang { | ||
95 | + /* width: 100%; */ | ||
96 | + /* margin: auto; | ||
97 | + padding-left: 21rpx; */ | ||
98 | + display: flex; | ||
99 | + flex-wrap: wrap; | ||
100 | + /* margin: 0 auto; */ | ||
101 | + padding: 0 20rpx; | ||
102 | + box-sizing: border-box; | ||
103 | + /* justify-content: space-evenly; */ | ||
104 | +} | ||
105 | + | ||
106 | +.hang .collect { | ||
107 | + width: calc((100% - 20rpx) / 2); | ||
108 | + /* height: 520rpx; */ | ||
109 | + border-radius: 25rpx; | ||
110 | + border: 2rpx solid #ebedf0; | ||
111 | + overflow: hidden; | ||
112 | + box-sizing: border-box; | ||
113 | + margin-top: 20rpx; | ||
114 | + /* margin-right: 14rpx; | ||
115 | + margin-bottom: 5rpx; */ | ||
116 | +} | ||
117 | + | ||
118 | +.hang .collect:nth-child(2n+1) { | ||
119 | + margin-right: 20rpx; | ||
120 | +} | ||
121 | + | ||
122 | +.collect .bottom { | ||
123 | + padding: 20rpx; | ||
124 | +} | ||
125 | + | ||
126 | +.collect .sp { | ||
127 | + width: 100%; | ||
128 | + height: 340rpx; | ||
129 | + display: block; | ||
130 | +} | ||
131 | + | ||
132 | +.collect .money { | ||
133 | + /* margin-top: 28rpx; | ||
134 | + margin-bottom: 8rpx; | ||
135 | + line-height: 28rpx; | ||
136 | + align-items: baseline; */ | ||
137 | +} | ||
138 | + | ||
139 | +.collect .money view { | ||
140 | + line-height: 28rpx; | ||
141 | +} | ||
142 | + | ||
143 | +.collect .money .flex { | ||
144 | + font-weight: bold; | ||
145 | +} | ||
146 | + | ||
147 | +.collect .money .flex .fs24 { | ||
148 | + padding-top: 5rpx; | ||
149 | +} | ||
150 | + | ||
151 | +.collect .Discount { | ||
152 | + width: 156rpx; | ||
153 | + height: 28rpx; | ||
154 | + border-radius: 20rpx; | ||
155 | + background-color: rgb(56, 56, 56); | ||
156 | + font-size: 18rpx; | ||
157 | + color: rgb(255, 255, 255); | ||
158 | +} | ||
159 | + | ||
160 | +.collect .Discount image { | ||
161 | + height: 18rpx; | ||
162 | + width: 18rpx; | ||
163 | + line-height: 28rpx; | ||
164 | + margin-right: 3rpx; | ||
165 | +} | ||
166 | + | ||
167 | +.collect.ml20 { | ||
168 | + margin-left: 13rpx; | ||
169 | +} | ||
170 | + | ||
171 | +.fs24.dollar { | ||
172 | + padding: 0rpx; | ||
173 | +} | ||
174 | + | ||
175 | +.money .price { | ||
176 | + margin-left: 12rpx; | ||
177 | + text-decoration: line-through; | ||
178 | + line-height: 23rpx; | ||
179 | +} | ||
180 | + | ||
181 | +.province { | ||
182 | + line-height: 26rpx; | ||
183 | +} | ||
184 | + | ||
185 | +.nothing { | ||
186 | + height: 75rpx; | ||
187 | + width: 100%; | ||
188 | +} | ||
189 | + | ||
190 | +.nothing .no_content { | ||
191 | + margin: 0rpx 11rpx; | ||
192 | + color: rgb(138, 138, 138); | ||
193 | +} | ||
194 | + | ||
195 | +.nothing .Foil { | ||
196 | + width: 80rpx; | ||
197 | + height: 2rpx; | ||
198 | + background-color: #ebedf0; | ||
199 | +} | ||
200 | + | ||
201 | +.line_th { | ||
202 | + text-decoration: line-through; | ||
203 | +} | ||
204 | + | ||
205 | +.card_bg { | ||
206 | + box-sizing: border-box; | ||
207 | + padding: 2rpx 10rpx; | ||
208 | + height: 28rpx; | ||
209 | + border-radius: 26rpx; | ||
210 | + font-size: 18rpx; | ||
211 | + line-height: 28rpx; | ||
212 | + max-width: 210rpx; | ||
213 | + background: #333; | ||
214 | + color: #fff; | ||
215 | + margin-left: 8rpx; | ||
216 | +} | ||
217 | + | ||
218 | +.card_bg image { | ||
219 | + width: 19rpx; | ||
220 | + height: 19rpx; | ||
221 | + margin-right: 8rpx; | ||
222 | +} | ||
223 | + | ||
224 | +/* .card_bg .card_name { | ||
225 | + max-width: 76rpx; | ||
226 | + width: auto; | ||
227 | + overflow: hidden; | ||
228 | + white-space: nowrap; | ||
229 | +} */ | ||
230 | + | ||
231 | +.card_name { | ||
232 | + position: relative; | ||
233 | + top: -4rpx; | ||
234 | +} | ||
235 | + | ||
236 | + |
packageA/pages/myGiftDetails/myGiftDetails.js
@@ -15,6 +15,7 @@ Page({ | @@ -15,6 +15,7 @@ Page({ | ||
15 | content: "当前核销码仅限当面使用!" | 15 | content: "当前核销码仅限当面使用!" |
16 | }, | 16 | }, |
17 | showBtn: true, | 17 | showBtn: true, |
18 | + isClick: false, | ||
18 | }, | 19 | }, |
19 | 20 | ||
20 | /** | 21 | /** |
@@ -332,27 +333,35 @@ Page({ | @@ -332,27 +333,35 @@ Page({ | ||
332 | 333 | ||
333 | //一键领取券 | 334 | //一键领取券 |
334 | show_get_quan:function (e) { | 335 | show_get_quan:function (e) { |
335 | - var th=this; | ||
336 | - var json = { | ||
337 | - store_id:os.stoid, | ||
338 | - user_id:getApp().globalData.user_id, | ||
339 | - id:this.data.id | ||
340 | - }; | ||
341 | - var url = "/api/weshop/libao/libaoFormvip/saveLibaoQuan"; | ||
342 | - getApp().request.post(url,{ | ||
343 | - data:json, | ||
344 | - success:function(res) { | ||
345 | - if (res.data.code == 0) { | ||
346 | - th.setData({'details.isget':1}); | ||
347 | - } else { | ||
348 | - wx.showToast({ | ||
349 | - title: res.data.msg, | ||
350 | - icon: 'none', | ||
351 | - duration: 2000 | ||
352 | - }) | ||
353 | - } | ||
354 | - }, | ||
355 | - }) | 336 | + if(this.data.isClick) return false; |
337 | + if(!this.data.isClick) { | ||
338 | + this.data.isClick = true; | ||
339 | + let th=this; | ||
340 | + let json = { | ||
341 | + store_id:os.stoid, | ||
342 | + user_id:getApp().globalData.user_id, | ||
343 | + id:this.data.id | ||
344 | + }; | ||
345 | + let url = "/api/weshop/libao/libaoFormvip/saveLibaoQuan"; | ||
346 | + getApp().request.post(url,{ | ||
347 | + data:json, | ||
348 | + success:function(res) { | ||
349 | + if (res.data.code == 0) { | ||
350 | + th.setData({'details.isget':1}); | ||
351 | + } else { | ||
352 | + wx.showToast({ | ||
353 | + title: res.data.msg, | ||
354 | + icon: 'none', | ||
355 | + duration: 2000 | ||
356 | + }) | ||
357 | + th.data.isClick = false; | ||
358 | + } | ||
359 | + | ||
360 | + }, | ||
361 | + }); | ||
362 | + | ||
363 | + } | ||
364 | + | ||
356 | 365 | ||
357 | } | 366 | } |
358 | 367 |