Showing
10 changed files
components/diy_groupbuy/diy_groupbuy.js
1 | +var regeneratorRuntime = require('../../utils/runtime.js'); | |
2 | +var ut = require("../../utils/util.js"); | |
3 | +var os= getApp().globalData.setting; | |
1 | 4 | Component({ |
2 | - properties: { | |
3 | - // 这里定义了innerText属性,属性值可以在组件使用时指定 | |
4 | - | |
5 | - style_b: { | |
6 | - type: Number, | |
7 | - value: 3, | |
8 | - }, | |
9 | - | |
10 | - | |
11 | - | |
12 | - | |
13 | - | |
14 | - }, | |
15 | - data: { | |
16 | - // 这里是一些组件内部数据 | |
17 | - bulk:false, | |
18 | - someData: {} | |
19 | - }, | |
20 | - methods: { | |
21 | - // 这里是一个自定义方法 | |
22 | - | |
23 | - customMethod: function () { } | |
24 | - } | |
5 | + properties: { | |
6 | + // 这里定义了innerText属性,属性值可以在组件使用时指定 | |
7 | + object: { | |
8 | + type: Object, | |
9 | + value: null, | |
10 | + }, | |
11 | + goods_array: { | |
12 | + type: Array, | |
13 | + value: [] | |
14 | + }, | |
15 | + newTime: { | |
16 | + type: Number, | |
17 | + value: 0 | |
18 | + }, | |
19 | + }, | |
20 | + data: { | |
21 | + // 这里是一些组件内部数据 | |
22 | + yc: false, | |
23 | + someData: null, | |
24 | + ylp_img: "https://mshopimg.yolipai.net/", | |
25 | + imghost: os.imghost, | |
26 | + timer: null, | |
27 | + }, | |
28 | + | |
29 | + pageLifetimes: { | |
30 | + //要处理一下,游客登录后的界面的变化,主要还该是改变会员 | |
31 | + show: function () { | |
32 | + //会员身份变化 | |
33 | + var th = this; | |
34 | + var g_id = this.data.object; | |
35 | + this.init(g_id); | |
36 | + setTimeout(function () { | |
37 | + if (th.data.goods_array && th.data.goods_array.length > 0) { | |
38 | + th.data.timer = setInterval(function () { | |
39 | + th.countDown2(th); | |
40 | + }, 1000); | |
41 | + } | |
42 | + },600) | |
43 | + } | |
44 | + }, | |
45 | + | |
46 | + ready: function () { | |
47 | + var g_id = this.data.object; | |
48 | + this.init(g_id); | |
49 | + }, | |
50 | + detached() { | |
51 | + // 页面被被销毁的时候,清除定时器 | |
52 | + clearInterval(this.data.timer); | |
53 | + }, | |
54 | + | |
55 | + | |
56 | + methods: { | |
57 | + // 这里是一个自定义方法 | |
58 | + customMethod: function () { }, | |
59 | + | |
60 | + | |
61 | + init: function (g_id) { | |
62 | + var th = this, app = getApp(), goodsidlist = ""; | |
63 | + if (g_id.data && g_id.data.length > 0) { | |
64 | + //--先把商品ID串起来-- | |
65 | + g_id.data.forEach(function (val, ind) { | |
66 | + var item = {}; | |
67 | + goodsidlist += val.goodsid + ","; | |
68 | + }) | |
69 | + goodsidlist = ut.sub_last(goodsidlist); | |
70 | + | |
71 | + var user_id=getApp().globalData.user_id; | |
72 | + if(!user_id){ user_id=0;} | |
73 | + | |
74 | + //--调用接口,读取秒杀-- | |
75 | + app.request.promiseGet("/api/weshop/goods/groupBuy/getGoodsList?store_id=" | |
76 | + + os.stoid + "&aidlist=" + goodsidlist+"&user_id="+user_id, {}).then(res => { | |
77 | + console.log(res); | |
78 | + //如果秒杀的数组为空的时候 | |
79 | + var goodslist = res.data.data; | |
80 | + //就算是添加的活动已经过期,就要用最新的进行中活动 | |
81 | + if (goodslist && goodslist.length > 0) { | |
82 | + th.set_goods_list(g_id.data, goodslist); | |
83 | + } | |
84 | + }); | |
85 | + } | |
86 | + else { | |
87 | + th.no_gid_set(); | |
88 | + } | |
89 | + }, | |
90 | + | |
91 | + //-- 当是默认的情况 -- | |
92 | + no_gid_set() { | |
93 | + var user_id=getApp().globalData.user_id; | |
94 | + if(!user_id){ user_id=0;} | |
95 | + var req={ store_id: os.stoid, is_end: 0, is_show: 1, timetype: 2,user_id:user_id}; | |
96 | + | |
97 | + getApp().request.promiseGet("/api/weshop/goods/groupBuy/page?page=1&pageSize=9", | |
98 | + { isShowLoading: 1, data:req } | |
99 | + ).then(res => { | |
100 | + if (res.data.code == 0 && res.data.data.pageData && res.data.data.pageData.length > 0) { | |
101 | + var goodsidlist = res.data.data.pageData; | |
102 | + this.set_goods_list(null, goodsidlist); | |
103 | + } | |
104 | + }); | |
105 | + }, | |
106 | + | |
107 | + //就算是添加的活动已经过期,就要用最新的活动 | |
108 | + set_goods_list(g_id, goodslist) { | |
109 | + // 判断火热,预热 | |
110 | + var newTime = ut.gettimestamp(), all_array = [], th = this; | |
111 | + th.setData({ newTime: newTime }); | |
112 | + if (g_id) { | |
113 | + /*--商品队列按照添加的顺序排列--*/ | |
114 | + g_id.forEach(function (val, ind) { | |
115 | + goodslist.forEach(function (vy, indy) { | |
116 | + if (val.goodsid == vy.goods_id) { | |
117 | + if(!vy.id) vy.id=vy.prom_id; | |
118 | + all_array.push(vy); | |
119 | + } | |
120 | + }) | |
121 | + }) | |
122 | + } else { | |
123 | + all_array = goodslist; | |
124 | + } | |
125 | + | |
126 | + | |
127 | + if (all_array.length == 0) { | |
128 | + all_array = goodslist; | |
129 | + } | |
130 | + | |
131 | + for(let i in all_array){ | |
132 | + let item=all_array[i]; | |
133 | + if(item.user_price) item.price=item.user_price; | |
134 | + } | |
135 | + | |
136 | + var arr = new Array(); | |
137 | + //--三个三个一组--- | |
138 | + for (var i = 0; i < all_array.length; i += 3) { | |
139 | + arr.push(all_array.slice(i, i + 3)); | |
140 | + } | |
141 | + /*--熏染到前台--*/ | |
142 | + | |
143 | + th.setData({ goods_array: arr }); | |
144 | + | |
145 | + th.data.timer = setInterval(function () { | |
146 | + th.countDown2(th); | |
147 | + }, 1000); | |
148 | + }, | |
149 | + | |
150 | + //---小于10的格式化函数---- | |
151 | + timeFormat: function (param) { | |
152 | + return param < 10 ? '0' + param : param; | |
153 | + }, | |
154 | + //----秒杀倒计时函数----- | |
155 | + countDown2: function (ob) { | |
156 | + if (ob == undefined) return false; | |
157 | + var ee = ob; | |
158 | + // 获取当前时间,同时得到活动结束时间数组 | |
159 | + var newTime = ut.gettimestamp(); | |
160 | + this.setData({ newTime: newTime }); | |
161 | + | |
162 | + var List = ee.data.goods_array; | |
163 | + if (List.length == 0) return false; | |
164 | + for (var j = 0; j < List.length; j++) { | |
165 | + // 对结束时间进行处理渲染到页面 | |
166 | + var endTimeList = List[j]; | |
167 | + for (var i = 0; i < endTimeList.length; i++) { | |
168 | + var o = endTimeList[i]; | |
169 | + var endTime = o.end_time; | |
170 | + if (newTime < o.start_time) endTime = o.start_time; | |
171 | + let obj = null; | |
172 | + // 如果活动未结束,对时间进行处理 | |
173 | + if (endTime - newTime > 0) { | |
174 | + let time = (endTime - newTime); | |
175 | + // 获取天、时、分、秒 | |
176 | + let day = parseInt(time / (60 * 60 * 24)); | |
177 | + let hou = parseInt(time % (60 * 60 * 24) / 3600); | |
178 | + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60); | |
179 | + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); | |
180 | + obj = { | |
181 | + day: this.timeFormat(day), | |
182 | + hou: this.timeFormat(hou), | |
183 | + min: this.timeFormat(min), | |
184 | + sec: this.timeFormat(sec) | |
185 | + } | |
186 | + } else { | |
187 | + //活动已结束,全部设置为'00' | |
188 | + obj = { | |
189 | + day: '00', | |
190 | + hou: '00', | |
191 | + min: '00', | |
192 | + sec: '00' | |
193 | + } | |
194 | + } | |
195 | + var txt = "goods_array[" + j + "][" + i + "].djs"; | |
196 | + ee.setData({ | |
197 | + [txt]: obj | |
198 | + }); | |
199 | + } | |
200 | + } | |
201 | + }, | |
202 | + //图片失败,默认图片 | |
203 | + bind_bnerr3: function (e) { | |
204 | + var _errImg = e.target.dataset.errorimg; | |
205 | + var _errObj = {}; | |
206 | + _errObj[_errImg] = "/public/images/default_goods_image_240.gif"; | |
207 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
208 | + }, | |
209 | + | |
210 | + //跳转到秒杀列表 | |
211 | + go_to_group: function () { | |
212 | + | |
213 | + var url="/packageC/pages/group_list/group_list"; | |
214 | + getApp().goto(url); | |
215 | + | |
216 | + } | |
217 | + | |
218 | + | |
219 | + | |
220 | + } | |
25 | 221 | }) |
26 | 222 | \ No newline at end of file | ... | ... |
components/diy_groupbuy/diy_groupbuy.wxml
1 | -<!--pages/wp/wp.wxml--> | |
2 | - | |
3 | - | |
4 | - | |
5 | - | |
6 | -<view class='top_b'> | |
7 | -<view class='t_left_b'></view> | |
8 | -<view class='t_ms_b'>团购</view> | |
9 | -<view class='.right_b'></view> | |
10 | -</view> | |
11 | - | |
12 | - | |
13 | -<!--商品展示--> | |
14 | - | |
15 | -<view class='sp_b' wx:if="{{style_b==1}}"> | |
16 | - | |
17 | -<view class='one_b'> | |
18 | -<view class='sp_top_b'> | |
19 | -<view class='s_img_b'><image></image></view> | |
20 | -<view class='s_foot_bulk'>11天22小时33分44秒</view> | |
21 | -</view> | |
22 | - | |
23 | -<view class='sp_wz_b'> | |
24 | -<view class='sp_wzi_b'>ddddd</view> | |
25 | -<view class='sp_jg_b'>¥1111111111111</view> | |
26 | -<view class='sp_jgx_b'>¥1111111111111111</view> | |
27 | -</view> | |
28 | - | |
29 | - <view class='guo_b'> | |
30 | - <view class='g_one_b'><text>已抢50件</text></view> | |
31 | - <view class='g_two_b'><text>50%</text></view> | |
32 | - </view> | |
33 | -</view> | |
34 | - | |
35 | -<view class='one_b'> | |
36 | -<view class='sp_top_b'> | |
37 | - | |
38 | -<view class='s_img_b'><image></image></view> | |
39 | -<view class='s_foot1_bulk'>11天22小时33分44秒</view> | |
40 | -</view> | |
41 | - | |
42 | -<view class='sp_wz_b'> | |
43 | -<view class='sp_wzi_b'>ddddd</view> | |
44 | -<view class='sp_jg_b'>1111</view> | |
45 | -<view class='sp_jgx_b'>1111</view> | |
46 | -</view> | |
47 | - | |
48 | - <view class='guo_b'> | |
49 | - <view class='g_one_b'><text>已抢50件</text></view> | |
50 | - <view class='g_two_b'><text>50%</text></view> | |
51 | - </view> | |
52 | -</view> | |
53 | - | |
54 | -<view class='one_b'> | |
55 | -<view class='sp_top_b'> | |
56 | - | |
57 | -<view class='s_img_b'><image></image></view> | |
58 | -<view class='s_foot2_bulk'>11天22小时33分44秒</view> | |
59 | -</view> | |
60 | - | |
61 | -<view class='sp_wz_b'> | |
62 | -<view class='sp_wzi_b'>ddddd</view> | |
63 | -<view class='sp_jg_b'>1111</view> | |
64 | -<view class='sp_jgx_b'>1111</view> | |
65 | -</view> | |
66 | - <view class='guo_b'> | |
67 | - <view class='g_one_b'><text>已抢50件</text></view> | |
68 | - <view class='g_two_b'><text>50%</text></view> | |
69 | - </view> | |
70 | -</view> | |
71 | - | |
72 | -</view> | |
73 | - | |
74 | - | |
75 | -<view class="sp2_b" wx:if="{{style_b==2}}"> | |
76 | -<view class="sp2_one_b"> | |
77 | - | |
78 | - <view class="g_g_b"> | |
79 | - <view class="g_top_b"> | |
80 | - <text>距结束时间</text> | |
81 | - <view class="o1_sj1_bulk"><text>11</text>天<text>22</text>:<text>22</text>:<text>22</text></view> | |
82 | - </view> | |
83 | - </view> | |
84 | - | |
85 | - | |
86 | - <view class='one1_b'> | |
87 | - | |
88 | - | |
89 | - <view class="o1_img_b"><image></image></view> | |
90 | - <view class="o1_right_b"> | |
91 | - | |
92 | - <view class="sp_wzi_b">ddddd</view> | |
93 | - | |
94 | - <view class='sp2_guo_b'> | |
95 | - <view class='g_one2_b'><text>已抢50件</text></view> | |
96 | - <view class='g_two2_b'><text>50%</text></view> | |
97 | - </view> | |
98 | - | |
99 | - <view class='sp_jg_b'>1111</view> | |
100 | - <view class='sp_jgx_b'>1111</view> | |
101 | - | |
102 | - | |
103 | - | |
104 | - </view> | |
105 | - </view> | |
106 | -</view> | |
107 | - | |
108 | - | |
109 | - <view class="sp2_one_b"> | |
110 | - <view class="g_top_b"> | |
111 | - <text>距结束时间</text> | |
112 | - <view class="o1_sj1_bulk"><text>11</text>天<text>22</text>:<text>22</text>:<text>22</text></view> | |
113 | - </view> | |
114 | - <view class='one1_b'> | |
115 | - | |
116 | - | |
117 | - <view class="o1_img_b"><image></image></view> | |
118 | - <view class="o1_right_b"> | |
119 | - | |
120 | - <view class="sp_wzi_b">ddddd</view> | |
121 | - | |
122 | - <view class='sp2_guo_b'> | |
123 | - <view class='g_one2_b'><text>已抢50件</text></view> | |
124 | - <view class='g_two2_b'><text>50%</text></view> | |
125 | - </view> | |
126 | - | |
127 | - <view class='sp_jg_b'>1111</view> | |
128 | - <view class='sp_jgx_b'>1111</view> | |
129 | - | |
130 | - | |
131 | - | |
132 | - </view> | |
133 | - </view> | |
134 | - </view> | |
135 | - | |
136 | - | |
137 | - <view class="sp2_one_b"> | |
138 | - <view class="g_top_b"> | |
139 | - <text>距结束时间</text> | |
140 | - <view class="o1_sj1_bulk"><text>11</text>天<text>22</text>:<text>22</text>:<text>22</text></view> | |
141 | - </view> | |
142 | - <view class='one1_b'> | |
143 | - | |
144 | - | |
145 | - <view class="o1_img_b"><image></image></view> | |
146 | - <view class="o1_right_b"> | |
147 | - | |
148 | - <view class="sp_wzi_b">ddddd</view> | |
149 | - | |
150 | - <view class='sp2_guo_b'> | |
151 | - <view class='g_one2_b'><text>已抢50件</text></view> | |
152 | - <view class='g_two2_b'><text>50%</text></view> | |
153 | - </view> | |
154 | - | |
155 | - <view class='sp_jg_b'>1111</view> | |
156 | - <view class='sp_jgx_b'>1111</view> | |
157 | - | |
158 | - | |
159 | - | |
160 | - </view> | |
161 | - </view> | |
162 | - </view> | |
163 | - | |
164 | - | |
165 | - | |
166 | -</view> | |
167 | - | |
168 | - | |
169 | - | |
170 | - | |
171 | - | |
172 | - | |
173 | - | |
174 | - | |
175 | - | |
176 | - | |
177 | - | |
178 | - | |
179 | - | |
180 | - | |
181 | - | |
182 | - | |
183 | - | |
184 | - | |
185 | - | |
1 | +<block wx:if="{{goods_array.length>0}}"> | |
2 | + <!--秒杀--> | |
3 | + <view class='top' bindtap="go_to_group"> | |
4 | + <view class="flex"> | |
5 | + <view class='t_left'></view> | |
6 | + <view class='t_ms'>团购</view> | |
7 | + </view> | |
8 | + <view class='right_k'> | |
9 | + <image src="{{imghost}}/miniapp/images/icon-arrowdown.png" lazy-load="true"></image> | |
10 | + </view> | |
11 | + </view> | |
12 | + | |
13 | + <!--商品展示--> | |
14 | + <swiper class="s_prom" indicator-active-color='red' indicator-dots="false" wx:if="{{object.style==1}}"> | |
15 | + <view class='sp' wx:if="{{object.style==1}}"> | |
16 | + <swiper-item class="s_it" wx:for="{{goods_array}}"> | |
17 | + <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> | |
18 | + <navigator | |
19 | + url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=2&prom_id={{aitem.prom_id}}" | |
20 | + class="s1_gk_a1"> | |
21 | + <view class='one'> | |
22 | + <view class='sp_top'> | |
23 | + | |
24 | + <view class='s_img'> | |
25 | + <image src="{{imghost+aitem.original_img}}" | |
26 | + data-errorimg="goods_array[{{index}}][{{aind}}].original_img" | |
27 | + binderror="bind_bnerr3"></image> | |
28 | + </view> | |
29 | + | |
30 | + <view class='s_foot_kill'> | |
31 | + <text>{{aitem.djs.day}}天</text> | |
32 | + <text>{{aitem.djs.hou}}时</text> | |
33 | + <text>{{aitem.djs.min}}分</text> | |
34 | + <text>{{aitem.djs.sec}}秒</text> | |
35 | + </view> | |
36 | + <view class='clear' style="clear: both;"></view> | |
37 | + | |
38 | + </view> | |
39 | + | |
40 | + <view class='sp_wz'> | |
41 | + <view class='sp_wzi'>{{aitem.goods_name}}</view> | |
42 | + <view class='sp_jg'>¥{{aitem.price}}</view> | |
43 | + <view class='sp_jgx'>¥{{aitem.market_price}}</view> | |
44 | + </view> | |
45 | + <view class="gorup_count"> | |
46 | + <text class="leftred">已抢0件</text> | |
47 | + <text class="rightwhite">0%</text> | |
48 | + </view> | |
49 | + | |
50 | + </view> | |
51 | + </navigator> | |
52 | + </block> | |
53 | + </swiper-item> | |
54 | + </view> | |
55 | + </swiper> | |
56 | + | |
57 | + <view class="sp2" wx:if="{{object.style==2}}"> | |
58 | + <block wx:for="{{goods_array}}"> | |
59 | + <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> | |
60 | + <navigator | |
61 | + url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=2&prom_id={{aitem.prom_id}}" | |
62 | + class="s1_gk_a1"> | |
63 | + | |
64 | + | |
65 | + <view class="flex jc_sb" style="padding: 0 20rpx; margin-top: 10rpx;"> | |
66 | + <view> | |
67 | + 距结束时间 | |
68 | + </view> | |
69 | + <view class="o1_sj_kill"> | |
70 | + <text>{{aitem.djs.day}}</text> 天 | |
71 | + <text>{{aitem.djs.hou}}</text> : | |
72 | + <text>{{aitem.djs.min}}</text> : | |
73 | + <text>{{aitem.djs.sec}}</text> | |
74 | + </view> | |
75 | + </view> | |
76 | + | |
77 | + <view class='one1'> | |
78 | + | |
79 | + <view class="o1_img"> | |
80 | + <image src="{{imghost+aitem.original_img}}" | |
81 | + data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"> | |
82 | + </image> | |
83 | + </view> | |
84 | + | |
85 | + <view class="o1_right"> | |
86 | + <view class="sp_wzi">{{aitem.title}}</view> | |
87 | + <!-- 进度条 --> | |
88 | + <view> | |
89 | + | |
90 | + </view> | |
91 | + <view> | |
92 | + <view class='sp_jg'>¥{{aitem.price}}</view> | |
93 | + <view class='sp_jgx'>¥{{aitem.market_price}}</view> | |
94 | + </view> | |
95 | + | |
96 | + | |
97 | + </view> | |
98 | + </view> | |
99 | + </navigator> | |
100 | + </block> | |
101 | + </block> | |
102 | + | |
103 | + </view> | |
104 | + <view class='clear'></view> | |
105 | + | |
106 | +</block> | ... | ... |
components/diy_groupbuy/diy_groupbuy.wxss
1 | -/* pages/team_guo/team_guo.wxss */ | |
2 | - | |
3 | -/* pages/wp/wp.wxss */ | |
4 | -.kbstyle{ | |
5 | - background-color: red; | |
6 | - width: 100%; | |
7 | - height: 60rpx; | |
1 | +.flex{ | |
2 | + display: flex; | |
3 | + align-items: center; | |
4 | +} | |
5 | +.top { | |
6 | + background-color: white; | |
7 | + height: 70rpx; | |
8 | + line-height: 70rpx; | |
9 | + color: #000; | |
10 | + border-bottom: 2rpx solid #eee; | |
11 | + padding:0rpx 20rpx; | |
12 | + display: flex; | |
13 | + justify-content: space-between; | |
14 | + font-size: 32rpx; | |
8 | 15 | } |
9 | 16 | |
10 | -.right_b{ | |
11 | - width: 30rpx; | |
12 | - height: 100%; | |
13 | - background: url(https://mshopimg.yolipai.net/miniapp/images/user/leftTip.png) no-repeat center center; | |
14 | - background-size: 22rpx 40rpx; | |
15 | - margin-left: 600rpx; | |
17 | +.s_it { | |
18 | + width: 100%; | |
19 | + display: flex; | |
20 | + background-color: white; | |
16 | 21 | } |
17 | 22 | |
18 | -.top_b{ | |
23 | +.s_prom { | |
19 | 24 | width: 100%; |
20 | 25 | background-color: white; |
21 | - height: 70rpx; | |
22 | - line-height: 70rpx; | |
23 | - color: #000; | |
24 | - text-align: left; | |
25 | - border-bottom: 2rpx solid #eee; | |
26 | - display: flex; | |
26 | + min-height: 200rpx; | |
27 | 27 | } |
28 | 28 | |
29 | -.top_b .t_left_b{ | |
30 | - width: 6rpx; | |
31 | - height: 38rpx; | |
32 | - background: #C4182E; | |
33 | - margin-top:18rpx; | |
34 | -margin-right:12rpx; | |
29 | +swiper { | |
30 | + display: block; | |
31 | + height: 460rpx; | |
32 | +} | |
35 | 33 | |
34 | +.right_k { | |
35 | + width: 30rpx; | |
36 | +} | |
37 | +.right_k image{ | |
38 | + width: 30rpx; | |
39 | + height: 30rpx; | |
40 | +} | |
41 | + .t_left { | |
42 | + width: 10rpx; | |
43 | + height: 38rpx; | |
44 | + background: #c4182e; | |
45 | + margin-right: 10rpx; | |
36 | 46 | } |
37 | 47 | |
38 | 48 | |
39 | -.sp_b{ | |
49 | +.sp { | |
40 | 50 | min-height: 300rpx; |
41 | 51 | width: 100%; |
42 | 52 | background-color: white; |
43 | - padding:18rpx; | |
44 | -display: flex; | |
53 | + padding: 18rpx; | |
54 | + display: flex; | |
45 | 55 | } |
46 | 56 | |
47 | -.sp_b .sp_top_b{ | |
48 | - height: 220rpx; | |
57 | +.sp .sp_top { | |
58 | + height: 190rpx; | |
49 | 59 | min-width: 30%; |
50 | - background-color: bisque; | |
51 | - | |
52 | 60 | } |
53 | 61 | |
54 | -.sp_b .sp_top_b .s_img_b{ | |
62 | +.sp .sp_top .s_img { | |
55 | 63 | width: 210rpx; |
56 | 64 | height: 100%; |
57 | 65 | } |
58 | 66 | |
59 | -.sp_b .sp_top_b .s_img_b image{ | |
67 | +.sp .sp_top .s_img image { | |
60 | 68 | width: 210rpx; |
61 | 69 | height: 100%; |
62 | - background-color: blueviolet; | |
63 | - position:relative; | |
64 | -top:-24rpx; | |
65 | -left:-64rpx; | |
70 | +} | |
66 | 71 | |
72 | +.sp .sp_top .s_top_kill { | |
73 | + background-color: #c4182e; | |
74 | + font-size: 24rpx; | |
75 | + height: 38rpx; | |
76 | + line-height: 38rpx; | |
77 | + padding: 4rpx 10rpx; | |
78 | + border-radius: 10rpx; | |
79 | + z-index: 999; | |
80 | + position: relative; | |
81 | + top: 1rpx; | |
82 | + width: 110rpx; | |
83 | + color: #fff; | |
84 | + text-align: center; | |
67 | 85 | } |
68 | 86 | |
69 | -.sp_b .sp_top_b .s_top_b{ | |
87 | +.po { | |
70 | 88 | position: absolute; |
71 | -background-color:#C4182E; | |
72 | -font-size:24rpx; | |
73 | -height:38rpx; | |
74 | -line-height:38rpx; | |
75 | -left:40rpx; | |
76 | -top:160rpx; | |
77 | -padding:0 10rpx; | |
78 | -color:white; | |
79 | -border-radius:10rpx; | |
80 | - | |
81 | 89 | } |
82 | 90 | |
83 | -.sp_b .sp_top_b .s_foot_bulk{ | |
91 | +.sp .sp_top .s_foot_kill { | |
84 | 92 | font-size: 20rpx; |
85 | - position: relative; | |
86 | - top:-40rpx; | |
87 | - width: 210rpx; | |
88 | - height: 38rpx; | |
89 | - line-height: 38rpx; | |
90 | - color: #fff; | |
91 | - text-align: center; | |
92 | - background-color: rgba(0, 0, 0, 0.5); | |
93 | + position: absolute; | |
94 | + width: 210rpx; | |
95 | + height: 38rpx; | |
96 | + line-height: 38rpx; | |
97 | + color: #fff; | |
98 | + text-align: center; | |
99 | + background-color: rgba(0, 0, 0, 0.5); | |
93 | 100 | } |
94 | 101 | |
102 | +.sp_wz { | |
103 | + width: 210rpx; | |
104 | + min-height: 100rpx; | |
105 | + margin-top: 50rpx; | |
106 | +} | |
95 | 107 | |
108 | +.sp_wz .sp_wzi { | |
109 | + font-size: 30rpx; | |
110 | + border-bottom: 2rpx solid #dcdcdc; | |
111 | + width: 100%; | |
112 | + text-align: left; | |
113 | + padding: 4rpx 0; | |
114 | + overflow: hidden; | |
115 | + height: 48rpx; | |
116 | + text-overflow: ellipsis; | |
117 | + white-space: nowrap; | |
118 | + line-height: 48rpx; | |
119 | +} | |
96 | 120 | |
97 | -.sp_wz_b{ | |
98 | -width: 210rpx; | |
99 | - min-height:100rpx; | |
100 | - | |
121 | +.sp_wz .sp_jg { | |
122 | + color: #c4182e; | |
123 | + font-size: 30rpx; | |
124 | + overflow: hidden; | |
125 | + display: inline-block; | |
126 | + text-overflow: ellipsis; | |
127 | + white-space: nowrap; | |
128 | + margin-right: 10rpx; | |
101 | 129 | } |
102 | 130 | |
103 | -.sp_wz_b .sp_wzi_b{ | |
104 | - font-size: 28rpx; | |
105 | - border-bottom: 2rpx solid #dcdcdc; | |
106 | - width: 100%; | |
107 | - text-align: left; | |
108 | - padding: 4rpx 0; | |
109 | - overflow: hidden; | |
110 | - height: 48rpx; | |
111 | - text-overflow: ellipsis; | |
112 | - display: inline-block; | |
113 | - white-space: nowrap; | |
114 | -} | |
115 | - | |
116 | -.sp_wz_b .sp_jg_b{ | |
117 | - color: #C4182E; | |
118 | - font-size: 20rpx; | |
119 | - width: 50%; | |
120 | - overflow: hidden; | |
121 | - display: inline-block; | |
122 | - | |
123 | - text-overflow: ellipsis; | |
124 | - white-space: nowrap; | |
125 | -} | |
126 | - | |
127 | -.sp_wz_b .sp_jgx_b{ | |
128 | - color: #dcdcdc; | |
129 | - text-decoration: line-through; | |
130 | - font-size: 20rpx; | |
131 | - width: 50%; | |
132 | - overflow: hidden; | |
133 | - display: inline-block; | |
134 | - | |
135 | - text-overflow: ellipsis; | |
136 | - white-space: nowrap; | |
131 | +.sp_wz .sp_jgx { | |
132 | + color: #adadad; | |
133 | + text-decoration: line-through; | |
134 | + font-size: 24rpx; | |
135 | + overflow: hidden; | |
136 | + display: inline-block; | |
137 | + text-overflow: ellipsis; | |
138 | + white-space: nowrap; | |
137 | 139 | } |
138 | 140 | |
139 | -.one_b{ | |
141 | +.one { | |
140 | 142 | margin-left: 14rpx; |
141 | - | |
142 | 143 | } |
143 | 144 | |
144 | - | |
145 | -.sp_b .sp_top_b .s_top1_b{ | |
145 | +.sp .sp_top .s_top1_kill { | |
146 | 146 | position: absolute; |
147 | -background-color:#C4182E; | |
148 | -font-size:24rpx; | |
149 | -height:38rpx; | |
150 | -line-height:38rpx; | |
151 | -left:265rpx; | |
152 | -top:160rpx; | |
153 | -padding:0 10rpx; | |
154 | -color:white; | |
155 | -border-radius:10rpx; | |
156 | - | |
147 | + background-color: #c4182e; | |
148 | + font-size: 24rpx; | |
149 | + height: 38rpx; | |
150 | + line-height: 38rpx; | |
151 | + left: 265rpx; | |
152 | + top: 100rpx; | |
153 | + padding: 0 10rpx; | |
154 | + color: white; | |
155 | + border-radius: 10rpx; | |
157 | 156 | } |
158 | 157 | |
159 | -.sp_b .sp_top_b .s_top2_b{ | |
158 | +.sp .sp_top .s_top2_kill { | |
160 | 159 | position: absolute; |
161 | -background-color:#C4182E; | |
162 | -font-size:24rpx; | |
163 | -height:38rpx; | |
164 | -line-height:38rpx; | |
165 | -right:146rpx; | |
166 | -top:160rpx; | |
167 | -padding:0 10rpx; | |
168 | -color:white; | |
169 | -border-radius:10rpx; | |
170 | - | |
160 | + background-color: #c4182e; | |
161 | + font-size: 24rpx; | |
162 | + height: 38rpx; | |
163 | + line-height: 38rpx; | |
164 | + right: 146rpx; | |
165 | + top: 100rpx; | |
166 | + padding: 0 10rpx; | |
167 | + color: white; | |
168 | + border-radius: 10rpx; | |
171 | 169 | } |
172 | 170 | |
173 | - | |
174 | - | |
175 | -.sp_b .sp_top_b .s_foot1_bulk{ | |
171 | +.sp .sp_top .s_foot1_kill { | |
176 | 172 | font-size: 20rpx; |
177 | - position: relative; | |
178 | - top:-40rpx; | |
179 | - width: 210rpx; | |
180 | - height: 38rpx; | |
181 | - line-height: 38rpx; | |
182 | - color: #fff; | |
183 | - text-align: center; | |
184 | - background-color: rgba(0, 0, 0, 0.5); | |
173 | + position: absolute; | |
174 | + top: 270rpx; | |
175 | + width: 210rpx; | |
176 | + height: 38rpx; | |
177 | + line-height: 38rpx; | |
178 | + color: #fff; | |
179 | + text-align: center; | |
180 | + background-color: rgba(0, 0, 0, 0.5); | |
185 | 181 | } |
186 | 182 | |
183 | +.po1 { | |
184 | + position: absolute; | |
185 | +} | |
187 | 186 | |
188 | - | |
189 | -.sp_b .sp_top_b .s_foot2_bulk{ | |
187 | +.sp .sp_top .s_foot2_kill { | |
190 | 188 | font-size: 20rpx; |
191 | - position: relative; | |
192 | - top:-40rpx; | |
193 | - width: 210rpx; | |
194 | - height: 38rpx; | |
195 | - line-height: 38rpx; | |
196 | - color: #fff; | |
197 | - text-align: center; | |
198 | - background-color: rgba(0, 0, 0, 0.5); | |
189 | + position: absolute; | |
190 | + top: 270rpx; | |
191 | + width: 210rpx; | |
192 | + height: 38rpx; | |
193 | + line-height: 38rpx; | |
194 | + color: #fff; | |
195 | + text-align: center; | |
196 | + background-color: rgba(0, 0, 0, 0.5); | |
199 | 197 | } |
200 | 198 | |
201 | - | |
202 | - | |
203 | - | |
204 | - | |
205 | - | |
206 | - | |
207 | -.sp2_b{ | |
199 | +.sp2 { | |
208 | 200 | width: 100%; |
209 | 201 | min-height: 240rpx; |
210 | - | |
211 | 202 | } |
212 | 203 | |
213 | -.sp2_b .one1_b{ | |
214 | - width: 100%; | |
204 | +.sp2 .one1 { | |
215 | 205 | background-color: white; |
216 | - height: 252rpx; | |
206 | + height: 285rpx; | |
217 | 207 | display: flex; |
218 | - padding: 20rpx; | |
219 | - border-bottom:2rpx#eee solid; | |
220 | - | |
208 | + padding:0rpx 20rpx; | |
209 | + border-bottom: 6rpx#eee solid; | |
210 | + align-items: center; | |
221 | 211 | } |
222 | 212 | |
223 | -.sp2_b .one1_b .o1_img_b{ | |
224 | - width: 200rpx; | |
225 | - height: 240rpx; | |
226 | - background-color: bisque; | |
227 | - margin-right: 24rpx; | |
213 | +.sp2 .one1 .o1_img { | |
214 | + width: 220rpx; | |
215 | + height: 220rpx; | |
216 | + margin-right: 25rpx; | |
228 | 217 | } |
229 | 218 | |
230 | -.o1_right_b .sp_wzi_b{ | |
231 | - font-size: 36rpx; | |
232 | - margin-bottom:6rpx; | |
233 | - | |
234 | - width: 100%; | |
219 | +.o1_right .sp_wzi { | |
220 | + font-size: 30rpx; | |
221 | + margin-bottom: 6rpx; | |
235 | 222 | text-align: left; |
236 | 223 | padding: 4rpx 0; |
237 | - overflow: hidden; | |
238 | 224 | height: 48rpx; |
225 | + overflow: hidden; | |
226 | + white-space: nowrap; | |
239 | 227 | text-overflow: ellipsis; |
240 | 228 | } |
241 | 229 | |
242 | -.o1_right_b .o1_sj_b{ | |
230 | +.o1_right .o1_sj_kill { | |
243 | 231 | height: 60rpx; |
244 | - | |
245 | 232 | margin-bottom: 10rpx; |
233 | + font-size: 28rpx; | |
246 | 234 | } |
247 | 235 | |
248 | -.o1_right_b .o1_sj_b text{ | |
236 | +.o1_sj_kill text { | |
249 | 237 | background-color: #fdcb08; |
250 | 238 | text-align: center; |
251 | 239 | border-radius: 10rpx; |
252 | - padding:4rpx; | |
253 | -margin-left:6rpx; | |
254 | - | |
240 | + padding: 4rpx; | |
241 | + margin-left: 6rpx; | |
242 | + color: #777; | |
243 | + font-size: 28rpx; | |
255 | 244 | } |
256 | 245 | |
257 | - | |
258 | - | |
259 | -.o1_right_b .sp_jg_b{ | |
260 | - color: #C4182E; | |
261 | - font-size: 36rpx; | |
262 | - width: 28%; | |
246 | +.o1_right .sp_jg { | |
247 | + color: #c4182e; | |
248 | + font-size: 30rpx; | |
263 | 249 | overflow: hidden; |
264 | - margin-top: 10rpx; | |
250 | + margin-right: 10rpx; | |
265 | 251 | } |
266 | 252 | |
267 | -.o1_right_b .sp_jgx_b{ | |
253 | +.o1_right .sp_jgx { | |
268 | 254 | color: #dcdcdc; |
269 | 255 | text-decoration: line-through; |
270 | 256 | font-size: 26rpx; |
271 | - width: 50%; | |
272 | 257 | overflow: hidden; |
273 | - display: inline-block; | |
274 | - margin-top: 10rpx; | |
275 | -} | |
276 | - | |
277 | - | |
278 | -.o1_img_b image{ | |
279 | - width: 100%; | |
280 | - height: 100%; | |
281 | - background-color: blueviolet; | |
282 | - position: relative; | |
283 | - top:-24rpx; | |
284 | -left:-64rpx; | |
285 | - | |
286 | 258 | } |
287 | 259 | |
288 | -.o1_right_b .wo_b{ | |
289 | - background-color: #C4182E; | |
290 | - width: 160rpx; | |
291 | - height: 60rpx; | |
292 | - line-height: 60rpx; | |
293 | - color: white; | |
294 | - text-align: center; | |
295 | - font-size: 38rpx; | |
296 | - margin-left:298rpx; | |
297 | -border-radius:14rpx; | |
298 | - | |
299 | -} | |
300 | - | |
301 | -.guo_b{ | |
302 | - width: 100%; | |
303 | - border: 1px solid #C4182E; | |
304 | - text-align: left; | |
305 | - background-color: #fff; | |
306 | - border-radius:24rpx; | |
307 | -height:44rpx; | |
308 | -font-size:26rpx; | |
309 | -display: flex; | |
310 | -} | |
311 | - | |
312 | -.g_one_b{ | |
313 | - width: 50%; | |
314 | - height: 44rpx; | |
315 | - line-height: 44rpx; | |
316 | - text-align: left; | |
317 | - background-color: #C4182E; | |
318 | -color: white; | |
319 | -border-radius:24rpx; | |
320 | -padding-right: 2rpx; | |
321 | - text-overflow: ellipsis; | |
322 | - white-space: nowrap; | |
323 | - overflow: hidden; | |
324 | -} | |
325 | - | |
326 | -.g_one_b text{ | |
327 | - margin-left: 10rpx; | |
328 | - text-overflow: ellipsis; | |
329 | -} | |
330 | - | |
331 | -.g_two_b{ | |
332 | - height: 44rpx; | |
333 | - line-height: 44rpx; | |
334 | - text-align: right; | |
335 | - width: 50%; | |
336 | - color: #C4182E; | |
337 | -} | |
338 | - | |
339 | -.g_two_b text{ | |
340 | - margin-right: 10rpx; | |
341 | -} | |
342 | - | |
343 | -.g_top_b{ | |
344 | - display: flex; | |
345 | - background-color: #fbfaff; | |
346 | - color: #333; | |
347 | - font-size: 28rpx; | |
348 | - height: 60rpx; | |
349 | - line-height: 60rpx; | |
350 | - width: 94%; | |
351 | -} | |
352 | - | |
353 | -.g_top_b text{ | |
354 | - margin-left: 20rpx; | |
355 | -} | |
356 | - | |
357 | -.o1_sj_b text{ | |
358 | - background-color: #fdcb08; | |
359 | - text-align: center; | |
360 | - border-radius: 10rpx; | |
361 | - padding:4rpx; | |
362 | - margin-left:6rpx; | |
363 | - | |
364 | -} | |
365 | - | |
366 | -.o1_sj_b{ | |
367 | - margin-left: 370rpx; | |
260 | +.o1_img image { | |
261 | + width: 220rpx; | |
262 | + height: 220rpx; | |
368 | 263 | } |
369 | - | |
370 | -.sp2_guo_b{ | |
371 | - width: 100%; | |
372 | - border: 1px solid #C4182E; | |
373 | - text-align: left; | |
374 | - background-color: #fff; | |
375 | - border-radius:24rpx; | |
376 | - height:44rpx; | |
377 | - font-size:26rpx; | |
378 | - display: flex; | |
264 | +.o1_right{ | |
265 | + width: 465rpx; | |
379 | 266 | } |
380 | - | |
381 | -.g_one2_b{ | |
382 | - width: 50%; | |
383 | - height: 44rpx; | |
384 | - line-height: 44rpx; | |
385 | - text-align: left; | |
386 | - background-color: #C4182E; | |
267 | +.o1_right .wo { | |
268 | + background-color: #c4182e; | |
269 | + width: 150rpx; | |
270 | + height: 50rpx; | |
271 | + line-height: 50rpx; | |
387 | 272 | color: white; |
388 | - border-radius:24rpx; | |
389 | - padding-right: 2rpx; | |
390 | -} | |
391 | - | |
392 | -.g_one2_b text{ | |
393 | - margin-left: 10rpx; | |
394 | -} | |
395 | - | |
396 | -.g_two2_b{ | |
397 | - height: 44rpx; | |
398 | - line-height: 44rpx; | |
399 | - text-align: right; | |
400 | - width: 50%; | |
401 | - color: #C4182E; | |
402 | -} | |
403 | - | |
404 | -.g_two2_b text{ | |
405 | - margin-right: 10rpx; | |
406 | -} | |
407 | - | |
408 | -.o1_sj1_bulk text{ | |
409 | - background-color: #fdcb08; | |
410 | 273 | text-align: center; |
411 | - border-radius: 10rpx; | |
412 | - padding:4rpx; | |
413 | - margin-left:6rpx; | |
274 | + font-size: 30rpx; | |
275 | + border-radius: 14rpx; | |
414 | 276 | } |
415 | - | |
416 | - | |
417 | - | |
418 | - | |
419 | -.o1_sj1_bulk { | |
420 | - margin-left:306rpx; | |
277 | +.rob{ | |
278 | + display: flex; | |
279 | + justify-content: flex-end; | |
280 | + font-size: 30rpx; | |
421 | 281 | } |
422 | - | |
423 | -.o1_right_b{ | |
424 | - width: 456rpx; | |
282 | +.money{ | |
283 | + display: flex; | |
284 | + align-items: center; | |
425 | 285 | } |
426 | 286 | |
287 | +.sp .sp_top .s_top_kill.gray{background-color:#bdbdc1;color: #fff;font-weight: normal} | |
427 | 288 | |
428 | -.down-arrow { | |
429 | - display :inline-block; | |
430 | - position: relative; | |
431 | - width: 40rpx; | |
432 | - height: 30rpx; | |
433 | - margin-right: 20rpx; | |
434 | -} | |
289 | +.gorup_count { | |
290 | + position: relative; | |
291 | + font-size: 0; | |
292 | + border: 1px solid #C4182E; | |
293 | + width: 100%; | |
294 | + text-align: left; | |
295 | + background-color: #fff; | |
296 | + border-radius: 32rpx; | |
435 | 297 | |
436 | -.down-arrow::after { | |
437 | - display: inline-block; | |
438 | - content: " "; | |
439 | - height: 18rpx; | |
440 | - width: 18rpx; | |
441 | - border-width: 0 2rpx 2rpx 0; | |
442 | - border-color: #999999; | |
443 | - border-style: solid; | |
444 | - transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0); | |
445 | - transform-origin: center; | |
446 | - transition: transform .3s; | |
447 | - position: absolute; | |
448 | - top: 50%; | |
449 | - right: 10rpx; | |
450 | - margin-top: -10rpx; | |
451 | 298 | } |
452 | 299 | |
300 | +.gorup_count .leftred,.gorup_count .rightwhite { | |
301 | + font-size: 20rpx; | |
302 | + vertical-align: middle; | |
303 | + display: inline-block; | |
453 | 304 | |
454 | - | |
455 | -.pt_center{ | |
456 | - background: #fff; | |
457 | - position: fixed; | |
458 | - padding: 15px; | |
459 | 305 | } |
460 | 306 | |
461 | -.pt_center .pt_zi span{ | |
462 | - color: #333; | |
463 | -} | |
307 | +.gorup_count .leftred { | |
308 | + width: 50%; | |
309 | + background-color: #C4182E; | |
310 | + color: #FFF; | |
311 | + border: 1px solid #C4182E; | |
312 | + text-align: center; | |
313 | + overflow: hidden; | |
314 | + text-overflow: ellipsis; | |
315 | + white-space: nowrap; | |
316 | + border-radius: 32rpx; | |
464 | 317 | |
465 | -.pt_c_img image{ | |
466 | - background-color: red; | |
467 | - width: 48rpx; | |
468 | - height: 48rpx; | |
469 | - position: relative; | |
470 | - top: 0rpx; | |
471 | - right: 0rpx; | |
472 | - display: inline-block; | |
473 | 318 | } |
474 | 319 | |
475 | -.pt_c_img{ | |
476 | - display: inline-block; | |
320 | +.gorup_count .rightwhite { | |
321 | + color: #C4182E; | |
322 | + position: absolute; | |
323 | + right: 10rpx; | |
324 | + top: 2rpx; | |
477 | 325 | } |
478 | - | |
479 | -.pt_zi{ | |
480 | - width: 100%; | |
481 | - font-size: 36rpx; | |
482 | -} | |
483 | - | |
484 | -.g_g{ | |
485 | - background-color: #fff; | |
486 | - width: 100%; | |
487 | -} | |
488 | 326 | \ No newline at end of file |
327 | +.jc_sb{ justify-content: space-between;} | |
489 | 328 | \ No newline at end of file | ... | ... |
pages/cart/cart2/cart2.js
... | ... | @@ -779,13 +779,12 @@ Page({ |
779 | 779 | } |
780 | 780 | } |
781 | 781 | |
782 | - | |
782 | + | |
783 | 783 | gd.prom_type=gg.prom_type; |
784 | 784 | gd.prom_id=gg.prom_id; |
785 | - | |
785 | + | |
786 | 786 | switch (gd.prom_type) { |
787 | 787 | case 0: |
788 | - case 2: | |
789 | 788 | case 3: |
790 | 789 | case 4: |
791 | 790 | case 5: |
... | ... | @@ -984,6 +983,41 @@ Page({ |
984 | 983 | }); |
985 | 984 | |
986 | 985 | break; |
986 | + | |
987 | + case 2: //--- 团购 --- | |
988 | + var quanlist = null; | |
989 | + getApp().request.get("/api/weshop/goods/groupBuy/getActInfo/" +os.stoid + "/" +gd.goods_id+"/"+ gd.prom_id, { | |
990 | + success: async function (tt) { | |
991 | + if (tt.data.code == 0) { | |
992 | + //t.data.data.shop_price = tt.data.data.prom_price; | |
993 | + t.data.data.shop_price = tt.data.data.price; | |
994 | + } else { | |
995 | + t.data.data.prom_id = 0; | |
996 | + t.data.data.prom_type = 0; | |
997 | + } | |
998 | + | |
999 | + th.data.ckeck_quan_price = t.data.data.shop_price * gg.goods_num; | |
1000 | + th.data.check_quan_price_list = t.data.data.shop_price * gg.goods_num + ""; | |
1001 | + th.data.check_quan_ware_list = t.data.data.erpwareid + ""; | |
1002 | + | |
1003 | + th.setData({ | |
1004 | + bn_goods: gd, | |
1005 | + bn_pickname: gg.pick_name, | |
1006 | + bn_exp_type: et, | |
1007 | + index: m_wind, | |
1008 | + bn_pick: gg.pick_id, | |
1009 | + bn_t_exp_t: distr_t, | |
1010 | + bn_exp_type: et | |
1011 | + }); | |
1012 | + | |
1013 | + //-- 计算价格 -- | |
1014 | + th.calculatePrice2(); | |
1015 | + //获取优惠券,如果有券的钱,就调用 | |
1016 | + if(th.data.ckeck_quan_price>0) th.get_buy_now_quan(); | |
1017 | + } | |
1018 | + }); | |
1019 | + | |
1020 | + break; | |
987 | 1021 | } |
988 | 1022 | }, |
989 | 1023 | }); |
... | ... | @@ -2394,6 +2428,7 @@ Page({ |
2394 | 2428 | //--判断活动的类型-- |
2395 | 2429 | switch (g_item.prom_type) { |
2396 | 2430 | case 1: |
2431 | + case 2: | |
2397 | 2432 | goods.prom_type = g_item.prom_type; |
2398 | 2433 | goods.prom_id = g_item.prom_id; |
2399 | 2434 | break; |
... | ... | @@ -3769,7 +3804,6 @@ Page({ |
3769 | 3804 | } |
3770 | 3805 | }, |
3771 | 3806 | |
3772 | - | |
3773 | 3807 | //取消使用线下取价 |
3774 | 3808 | cancle_offline: function () { |
3775 | 3809 | //判断是不是立即购买 | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -840,7 +840,7 @@ Page({ |
840 | 840 | |
841 | 841 | |
842 | 842 | //获取统一条形码,普通商品和优惠促销的商品 |
843 | - if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 2 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 5 || ee.data.data.prom_type == 7) { | |
843 | + if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 5 || ee.data.data.prom_type == 7) { | |
844 | 844 | //默认门店要拿下门店库存 |
845 | 845 | if (that.data.sales_rules == 2 && that.data.is_newsales_rules) { |
846 | 846 | //获取门店 |
... | ... | @@ -1053,7 +1053,7 @@ Page({ |
1053 | 1053 | open_ind_store: ind |
1054 | 1054 | }); |
1055 | 1055 | //如果是秒杀的话,要看redis够不够 |
1056 | - if (this.data.prom_type == 1) { | |
1056 | + if (this.data.prom_type == 1 || this.data.prom_type == 2) { | |
1057 | 1057 | this.getactLen(function (num) { |
1058 | 1058 | if (num < th.data.goodsInputNum) { |
1059 | 1059 | getApp().my_warnning("秒杀库存不足!", 0, th); |
... | ... | @@ -1268,10 +1268,10 @@ Page({ |
1268 | 1268 | } |
1269 | 1269 | |
1270 | 1270 | //-----如果是秒杀,团购,积分购,拼团----- |
1271 | - if (th.data.prom_type == 1) { | |
1271 | + if (th.data.prom_type == 1 || th.data.prom_type == 2) { | |
1272 | 1272 | newd.goods_price = th.data.prom_price; |
1273 | 1273 | newd.member_goods_price = th.data.prom_price, |
1274 | - newd.prom_type = th.data.prom_type; | |
1274 | + newd.prom_type = th.data.prom_type; | |
1275 | 1275 | newd.prom_id = th.data.prom_id; |
1276 | 1276 | |
1277 | 1277 | if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); |
... | ... | @@ -1342,7 +1342,7 @@ Page({ |
1342 | 1342 | }) |
1343 | 1343 | |
1344 | 1344 | } |
1345 | - else if (th.data.prom_type == 0 || th.data.prom_type == 3 || th.data.prom_type == 2 || th.data.prom_type == 4 || th.data.prom_type == 5) { | |
1345 | + else if (th.data.prom_type == 0 || th.data.prom_type == 3 || th.data.prom_type == 4 || th.data.prom_type == 5) { | |
1346 | 1346 | newd.prom_type = 0; |
1347 | 1347 | newd.prom_id = 0; |
1348 | 1348 | |
... | ... | @@ -1399,7 +1399,7 @@ Page({ |
1399 | 1399 | add_cart_next(e, t, a, o, newd, CanOutQty) { |
1400 | 1400 | var th = this, i = getApp().request; |
1401 | 1401 | //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ |
1402 | - if ((o.prom_type != 1 || o.prom_id<=0) && ((o.prom_type != 6 && o.prom_type != 4) || th.data.is_normal)) { | |
1402 | + if ((o.prom_type != 1 || o.prom_id<=0) && ((o.prom_type != 6 && o.prom_type != 4 && o.prom_type !=2 ) || th.data.is_normal)) { | |
1403 | 1403 | var conf = th.data.bconfig; |
1404 | 1404 | if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) { |
1405 | 1405 | var s_list = JSON.parse(conf.switch_list); |
... | ... | @@ -2969,13 +2969,108 @@ Page({ |
2969 | 2969 | var user_id=getApp().globalData.user_id; |
2970 | 2970 | if(!user_id) user_id=0; |
2971 | 2971 | |
2972 | - if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 5 || prom_type == 7) { | |
2972 | + if (prom_type == 3 || prom_type == 0 || prom_type == 5 || prom_type == 7) { | |
2973 | 2973 | this.setData({ |
2974 | 2974 | prom_type: 0,isshow: 1, |
2975 | 2975 | }); |
2976 | 2976 | return false; |
2977 | 2977 | } |
2978 | 2978 | |
2979 | + if(prom_type==2){ | |
2980 | + //-------判断团购活动是否抢光--------- | |
2981 | + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, { | |
2982 | + 1: 1 | |
2983 | + }).then(res => { | |
2984 | + var em = res; | |
2985 | + if (em.data.code == 0) { | |
2986 | + if (em.data.data <= 0) ee.setData({ | |
2987 | + prom_r_null: 1 | |
2988 | + }); | |
2989 | + //拿取价格并且判断时间-- | |
2990 | + getApp().request.get("/api/weshop/goods/groupBuy/getActInfo/" +os.stoid + "/" +gid+"/"+ prom_id, { | |
2991 | + success: function (t) { | |
2992 | + if (t.data.code != 0) { | |
2993 | + ee.setData({ | |
2994 | + prom_type: 0, | |
2995 | + isshow: 1, | |
2996 | + }); | |
2997 | + ee.get_sku(os.stoid, ee.data.data, gid); | |
2998 | + return false; | |
2999 | + } | |
3000 | + //----已经结束----- | |
3001 | + if (t.data.data.is_end == 1) { | |
3002 | + ee.setData({ | |
3003 | + prom_type: 0, | |
3004 | + isshow: 1, | |
3005 | + }); | |
3006 | + ee.get_sku(os.stoid, ee.data.data, gid); | |
3007 | + ee.get_sto(); | |
3008 | + return false; | |
3009 | + } | |
3010 | + //----已经过期----- | |
3011 | + var now = ut.gettimestamp(); | |
3012 | + if (t.data.data.end_time < now) { | |
3013 | + ee.setData({ | |
3014 | + prom_type: 0, | |
3015 | + isshow: 1, | |
3016 | + }); | |
3017 | + ee.get_sku(os.stoid, ee.data.data, gid); | |
3018 | + return false; | |
3019 | + } | |
3020 | + | |
3021 | + /*-- 还没有开始预热的也不显示 --*/ | |
3022 | + if (t.data.data.show_time > now) { | |
3023 | + ee.setData({ | |
3024 | + prom_type: 0, | |
3025 | + isshow: 1, | |
3026 | + }); | |
3027 | + ee.get_sku(os.stoid, ee.data.data, gid); | |
3028 | + ee.get_sto(); | |
3029 | + return false; | |
3030 | + } | |
3031 | + | |
3032 | + var t_gd = ee.data.data; | |
3033 | + var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss"); | |
3034 | + var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss"); | |
3035 | + | |
3036 | + ee.setData({ | |
3037 | + prom_price: t.data.data.price, | |
3038 | + prom_type: 2, | |
3039 | + prom_id: prom_id, | |
3040 | + prom_buy_limit: t.data.data.buy_limit, | |
3041 | + prom_act: t.data.data, | |
3042 | + prom_end_time: prom_end_time, | |
3043 | + prom_start_time: prom_start_time, | |
3044 | + isshow: 1, | |
3045 | + prom_act:t.data.data | |
3046 | + }); | |
3047 | + | |
3048 | + ee.get_sto(); | |
3049 | + var newTime = ut.gettimestamp(); | |
3050 | + var endTime2 = t.data.data.end_time; | |
3051 | + var endTime1 = t.data.data.start_time; | |
3052 | + if (endTime1 > newTime) { | |
3053 | + ee.setData({ | |
3054 | + prom_time_text: '距团购开始还有' | |
3055 | + }) | |
3056 | + ee.countDown(endTime1, 0); | |
3057 | + } else { | |
3058 | + if (endTime2 > newTime) { | |
3059 | + ee.setData({ | |
3060 | + prom_time_text: '距团购结束还有', | |
3061 | + prom_st: 1 | |
3062 | + }) | |
3063 | + ee.countDown(endTime2); | |
3064 | + } | |
3065 | + } | |
3066 | + | |
3067 | + } | |
3068 | + }); | |
3069 | + } | |
3070 | + }) | |
3071 | + | |
3072 | + | |
3073 | + } | |
2979 | 3074 | if (prom_type == 1 && prom_id==0){ |
2980 | 3075 | this.setData({ |
2981 | 3076 | prom_type: 0,isshow: 1, |
... | ... | @@ -3529,6 +3624,7 @@ Page({ |
3529 | 3624 | success: function (t) { |
3530 | 3625 | if (t.data.code == 0) { |
3531 | 3626 | var g_buy_num = t.data.data.goodsbuynum; |
3627 | + | |
3532 | 3628 | if (gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6) { |
3533 | 3629 | //----获取活动购买数---- |
3534 | 3630 | getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", { |
... | ... | @@ -4294,7 +4390,11 @@ Page({ |
4294 | 4390 | |
4295 | 4391 | //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团 |
4296 | 4392 | var type = this.data.prom_type; |
4393 | + if (type==2) type=-1; | |
4297 | 4394 | if (type == 6) type = 2; |
4395 | + | |
4396 | + | |
4397 | + | |
4298 | 4398 | if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3; |
4299 | 4399 | |
4300 | 4400 | wx.showLoading({ title: '生成中...',}) |
... | ... | @@ -4338,15 +4438,7 @@ Page({ |
4338 | 4438 | // 先画背景 |
4339 | 4439 | var pg_path = "../../../images/share/share_bg.png"; |
4340 | 4440 | |
4341 | - // context.fillStyle="#FFFFFF"; | |
4342 | - // context.fillRect(0,0,554 * unit, 899 * unit); | |
4343 | - | |
4344 | - // if(type == 0) { | |
4345 | - // this.drawPoster(context); | |
4346 | - // return false; | |
4347 | - // }; | |
4348 | - | |
4349 | - | |
4441 | + | |
4350 | 4442 | //-- 如果有自定义海报的时候,判断背景的图片 -- |
4351 | 4443 | if (th.data.share_b_img) { |
4352 | 4444 | pg_path = th.data.share_b_img; |
... | ... | @@ -4354,7 +4446,7 @@ Page({ |
4354 | 4446 | // context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); |
4355 | 4447 | |
4356 | 4448 | |
4357 | - if(type == 0) { // 如果是普通商品,绘制新海报 | |
4449 | + if(type == 0 ) { // 如果是普通商品,绘制新海报 | |
4358 | 4450 | th.drawPoster(context, unit, th.data.share_goods_img, vpath); |
4359 | 4451 | } else { |
4360 | 4452 | context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); |
... | ... | @@ -4411,7 +4503,7 @@ Page({ |
4411 | 4503 | |
4412 | 4504 | |
4413 | 4505 | var share_title = th.data.data.goods_name; |
4414 | - if (th.data.prom_type == 1 || th.data.prom_type == 6 || th.data.prom_type == 4) { | |
4506 | + if (th.data.prom_type == 1 || th.data.prom_type == 2 || th.data.prom_type == 6 || th.data.prom_type == 4) { | |
4415 | 4507 | share_title = th.data.prom_act.share_title; |
4416 | 4508 | if (!share_title) share_title = th.data.prom_act.title; |
4417 | 4509 | if (th.data.prom_type == 4) share_title = th.data.prom_act.name; |
... | ... | @@ -4531,7 +4623,7 @@ Page({ |
4531 | 4623 | context.setFillStyle("black") |
4532 | 4624 | context.setFontSize(22 * unit) |
4533 | 4625 | |
4534 | - if (type == 0) { | |
4626 | + if (type == 0 || type == -1) { | |
4535 | 4627 | // 原来start ---> |
4536 | 4628 | context.setFontSize(24 * unit) |
4537 | 4629 | context.fillText(th.data.sto_sele_name_1, 40 * unit, 766 * unit); |
... | ... | @@ -4690,6 +4782,37 @@ Page({ |
4690 | 4782 | context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit); |
4691 | 4783 | } |
4692 | 4784 | break |
4785 | + | |
4786 | + | |
4787 | + case -1: //秒杀商品的展示 | |
4788 | + //---画线--- | |
4789 | + context.setLineWidth(1 * unit) | |
4790 | + context.moveTo(32 * unit, 670 * unit) | |
4791 | + context.lineTo(520 * unit, 670 * unit) | |
4792 | + context.stroke(); | |
4793 | + | |
4794 | + | |
4795 | + context.setFillStyle("black") | |
4796 | + context.setFontSize(24 * unit) | |
4797 | + context.fillText(th.data.sto_sele_name_1, 40 * unit, 744 * unit); | |
4798 | + //---文字--- | |
4799 | + context.setFontSize(22 * unit) | |
4800 | + context.setFillStyle("black") | |
4801 | + context.fillText("长按识别二维码", 40 * unit, 800 * unit); | |
4802 | + context.fillText("立即开始抢购", 40 * unit, 846 * unit); | |
4803 | + | |
4804 | + | |
4805 | + //---二维吗图--- | |
4806 | + //-- 自定义海报 -- | |
4807 | + if (th.data.poster) { | |
4808 | + var erm_x = parseFloat(th.data.poster.ewm_x) * 2; | |
4809 | + var erm_y = parseFloat(th.data.poster.ewm_y) * 2; | |
4810 | + context.drawImage(vpath, erm_x * unit, erm_y * unit, 135 * unit, 135 * unit); | |
4811 | + } else { | |
4812 | + //---二维吗图--- | |
4813 | + context.drawImage(vpath, 390 * unit, 726 * unit, 135 * unit, 135 * unit); | |
4814 | + } | |
4815 | + break; | |
4693 | 4816 | |
4694 | 4817 | |
4695 | 4818 | } | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
... | ... | @@ -46,7 +46,8 @@ |
46 | 46 | </block> |
47 | 47 | </view> |
48 | 48 | </view> |
49 | - <!-- --显示秒杀价,团购,积分购-- --> | |
49 | + | |
50 | + <!-- --显示秒杀价 --> | |
50 | 51 | <view class="prom_show rel" wx:if="{{prom_type==1}}"> |
51 | 52 | <image class="secondkill-img" src='{{prom_st==1? iurl+"/miniapp/images/red_jx.png":iurl+"/miniapp/images/blue_ks.png"}}'></image> |
52 | 53 | <image class="abs spike-img" src="{{iurl}}/miniapp/images/xsmiaosha.png"></image> |
... | ... | @@ -73,6 +74,21 @@ |
73 | 74 | <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view> |
74 | 75 | </view> |
75 | 76 | </view> |
77 | + <!-- --显示团购价 --> | |
78 | + <view class="prom_show rel" wx:if="{{prom_type==2}}"> | |
79 | + | |
80 | + <view class="abs flex" style="align-items:flex-end;color: #fff; margin-top: 34rpx; margin-left: 10rpx; height: 60rpx">¥{{prom_price}} | |
81 | + <view class="word-line fs24" style="position: relative;top: -6rpx">零售价¥{{filters.toFix(data.market_price,2)}}</view></view> | |
82 | + | |
83 | + <image class="abs" style="width: 120rpx;top: 32rpx; right: 220rpx;" mode="widthFix" src='{{iurl+"/miniapp/images/activity-time.png"}}'></image> | |
84 | + | |
85 | + <image class="secondkill-img" src='{{iurl+"/miniapp/images/group_img.png"}}'></image> | |
86 | + <view class="stop fs26 abs" style="color: #fff;" style="color: #fff;top: 22rpx" >结束时间</view> | |
87 | + <view class="secview flex abs fs24 xc-miaosha-time" style="color: #fff;top: 68rpx"> | |
88 | + <block wx:if="djs.day">{{djs.day}}天</block>{{djs.hou}}小时{{djs.min}}分{{djs.sec}}秒 | |
89 | + </view> | |
90 | + </view> | |
91 | + | |
76 | 92 | <!-- --拼单-- --> |
77 | 93 | <view class="pt_show " wx:if="{{prom_type==6}}"> |
78 | 94 | <view class="pt_view rel"> |
... | ... | @@ -247,8 +263,10 @@ |
247 | 263 | <!-- 不是拼团,不是积分购 --> |
248 | 264 | <block wx:if="{{prom_type!=6 && prom_type!=4}}"> |
249 | 265 | <view class="goods-price"> |
266 | + | |
250 | 267 | <view class="flex jc_sb"> |
251 | 268 | <view class="co-red" style="" wx:if="{{prom_type==0 || prom_type==3}}"> |
269 | + | |
252 | 270 | <view class="market-price flex" style="align-items: baseline;"> |
253 | 271 | <block wx:if="{{card_field && data[card_field]>0}}"> |
254 | 272 | <view class="flex ai-center grade-card-frame"> |
... | ... | @@ -261,7 +279,9 @@ |
261 | 279 | <text>零售价:¥{{filters.toFix(data.market_price,2)}}</text> |
262 | 280 | </view> |
263 | 281 | </block> |
264 | - <block wx:else> | |
282 | + <block wx:elif="{{prom_type!=2}}"> | |
283 | + | |
284 | + | |
265 | 285 | <text class="yuan">¥</text> |
266 | 286 | {{filters.toFix(data.shop_price,2)}} |
267 | 287 | <view class='yj'> |
... | ... | @@ -271,17 +291,15 @@ |
271 | 291 | </view> |
272 | 292 | </view> |
273 | 293 | <!-- 这个是分享按钮 --> |
274 | - <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> --> | |
275 | - <view class="xc-share-frame t-c" bindtap="clickShare" wx:if="{{prom_type != 1}}"> | |
294 | + <view class="xc-share-frame t-c" bindtap="clickShare" wx:if="{{prom_type != 1 && prom_type != 2}}"> | |
276 | 295 | <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> --> |
277 | 296 | <view class="iconfont icon-share fs60"></view> |
278 | - <!-- <view class="share-font">1分享</view> --> | |
279 | 297 | <view class="fs22 c-7b">分享</view> |
280 | 298 | </view> |
281 | 299 | </view> |
282 | 300 | <!-- 不是秒杀 --> |
283 | 301 | <!-- 等级卡的价格,不是等级卡会员,且商品又有设置等级级价,商家后台有开通升级卡同能 --> |
284 | - <view class="flex ai_and" wx:if="{{!card_field && g_filters.is_has_rank(rank_switch,data) && prom_type!=1 && card_list && card_list.length>0}}"> | |
302 | + <view class="flex ai_and" wx:if="{{!card_field && g_filters.is_has_rank(rank_switch,data) && prom_type!=1 && prom_type!=2 && prom_type!=4 && card_list && card_list.length>0 && g_filters.get_card_price(data,card_list,1)!=''}}"> | |
285 | 303 | <view class="flex ai-center grade-card-frame card-frame"> |
286 | 304 | <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image> |
287 | 305 | <view class="fs24 white view card-name ellipsis-1"> |
... | ... | @@ -295,7 +313,7 @@ |
295 | 313 | <!-- 等级卡的显示,购买, 等级卡近30天要显示续费 --> |
296 | 314 | <block wx:if="{{g_filters.is_has_rank(rank_switch,data)}}"> |
297 | 315 | <!-- 不是秒杀,且会员不是等级会员 --> |
298 | - <view wx:if="{{!card_field && prom_type!=1 && card_list && card_list.length>0}}"> | |
316 | + <view wx:if="{{!card_field && prom_type!=1 && prom_type!=2 && card_list && card_list.length>0 && g_filters.get_card_price(data,card_list,1)!=''}}"> | |
299 | 317 | <view class="beauty-makeup-frame flex ai-center"> |
300 | 318 | <view class="left flex ai-center jc_sa"> |
301 | 319 | <view class="flex ai-center grade-card-frame card-frame advert-card"> |
... | ... | @@ -319,7 +337,7 @@ |
319 | 337 | </view> |
320 | 338 | </view> |
321 | 339 | <!-- 立即续费的显示 --> |
322 | - <view wx:elif="{{is_near_date && data[card_field]>0 && prom_type!=1}}"> | |
340 | + <view wx:elif="{{is_near_date && data[card_field]>0 && prom_type!=1 && prom_type!=2 && card_name!=''}}"> | |
323 | 341 | <view class="beauty-makeup-frame flex ai-center"> |
324 | 342 | <view class="left flex ai-center jc_sa"> |
325 | 343 | <view class="flex ai-center grade-card-frame card-frame advert-card"> |
... | ... | @@ -345,16 +363,19 @@ |
345 | 363 | </view> |
346 | 364 | </block> |
347 | 365 | <!-- 许程商品名字 --> |
348 | - <view wx:if="{{prom_type!=1}}"> | |
366 | + <view wx:if="{{prom_type!=1 && prom_type!=2 }}"> | |
349 | 367 | <view class="goods-title"> |
350 | 368 | <view class="goods-name elli">{{data.goods_name}}</view> |
351 | 369 | </view> |
352 | 370 | </view> |
353 | - <view class="goods-num" wx:if="{{prom_type!=1}}"> | |
371 | + | |
372 | + | |
373 | + <view class="goods-num" wx:if="{{prom_type!=1 && prom_type!=2}}"> | |
354 | 374 | <view class="sales">销量:{{data.sales_sum}}件</view> |
355 | 375 | <view class="stock">折扣:{{data.disc}}折</view> |
356 | 376 | <view class="stock">{{categories3[0].num}}人评价</view> |
357 | 377 | </view> |
378 | + | |
358 | 379 | <view wx:if="{{prom_type==1}}"> |
359 | 380 | <view class="flex jc_sb"> |
360 | 381 | <view class="flex" style="align-items: baseline;"> |
... | ... | @@ -379,13 +400,24 @@ |
379 | 400 | </view> --> |
380 | 401 | </view> |
381 | 402 | </view> |
382 | - <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4}}"> | |
403 | + | |
404 | + <!-- 秒杀的活动名称 --> | |
405 | + <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4 && prom_type!=2}}"> | |
383 | 406 | {{sele_g.goods_name}} |
384 | 407 | </view> |
385 | - <!-- <view wx:if="{{prom_type==1}}" style='height:58rpx'></view> --> | |
408 | + | |
409 | + <view class="xc-explain flex jc_sb" wx:if="{{prom_type==2}}"> | |
410 | + <view class="fs32 ellipsis-2" style="max-width:80%; max-height: 90rpx;">{{sele_g.goods_name}}</view> | |
411 | + <!-- 这个是分享按钮 --> | |
412 | + <view class="xc-share-frame t-c" bindtap="clickShare" style="flex-shrink:0;position: relative;top: -22rpx;"> | |
413 | + <view class="iconfont icon-share fs60"></view> | |
414 | + <view class="fs22 c-7b">分享</view> | |
415 | + </view> | |
416 | + </view> | |
417 | + | |
386 | 418 | <!-- 许程 7.24 暂时注释 --> |
387 | 419 | <view wx:if="{{prom_type==1}}"> |
388 | - <view class="goods-num" wx:if="{{prom_type==1}}"> | |
420 | + <view class="goods-num"> | |
389 | 421 | <block wx:if="prom_st>0"> |
390 | 422 | <view class="stock">总数量:{{prom_act.goods_num+prom_act.virtual}}件</view> |
391 | 423 | <view class="stock" wx:if="{{prom_act.buy_limit>0}}">限购:{{prom_act.buy_limit}}件</view> |
... | ... | @@ -406,6 +438,29 @@ |
406 | 438 | </block> |
407 | 439 | </view> |
408 | 440 | </view> |
441 | + <view wx:if="{{prom_type==2}}"> | |
442 | + | |
443 | + <view class="goods-num"> | |
444 | + <block wx:if="prom_st>0"> | |
445 | + <view class="stock">总数量:{{prom_act.goods_num+prom_act.virtualNum}}件</view> | |
446 | + <view class="stock" wx:if="{{prom_act.buy_limit>0}}">限购:{{prom_act.buy_limit}}件</view> | |
447 | + <view class="stock" wx:else>限购:不限</view> | |
448 | + | |
449 | + <block wx:if="{{prom_st==0}}"> | |
450 | + <view class="sales">已购:0件</view> | |
451 | + </block> | |
452 | + <block wx:else> | |
453 | + <view class="sales">已购:{{prom_act.buy_num+prom_act.virtualNum}}件</view> | |
454 | + </block> | |
455 | + </block> | |
456 | + <block wx:else> | |
457 | + <view class="stock">总数量:{{prom_act.goods_num}}件</view> | |
458 | + <view class="stock" wx:if="{{prom_act.buy_limit>0}}">限购:{{prom_act.buy_limit}}件</view> | |
459 | + <view class="stock" wx:else>限购:不限</view> | |
460 | + <view class="sales">已购:{{prom_act.buy_num}}件</view> | |
461 | + </block> | |
462 | + </view> | |
463 | + </view> | |
409 | 464 | </view> |
410 | 465 | </block> |
411 | 466 | <!-- 门店收货地址 --> |
... | ... | @@ -446,7 +501,7 @@ |
446 | 501 | </view> |
447 | 502 | </view> |
448 | 503 | <!-- 许程 7.24暂时注释 --> |
449 | - <view class="bdt16" wx:if="{{prom_type!=1&&prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1}}"> | |
504 | + <view class="bdt16" wx:if="{{prom_type!=1&& prom_type!=1 && prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1}}"> | |
450 | 505 | <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}"> |
451 | 506 | <view class="cx-sizs fs30">领券</view> |
452 | 507 | <view class="flex ai_c f1 pdh20"> |
... | ... | @@ -1059,15 +1114,13 @@ |
1059 | 1114 | <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}}</block> |
1060 | 1115 | <block wx:else>{{sele_g.shop_price}}</block> |
1061 | 1116 | </view> |
1062 | - <view class="spec-goods-price" wx:else> | |
1063 | - <text class="fs20">¥</text> | |
1064 | - {{prom_price}} | |
1065 | - </view> | |
1117 | + <view class="spec-goods-price" wx:elif="{{prom_type!=2}}"><text class="fs20">¥</text>{{prom_price}}</view> | |
1066 | 1118 | <!-- 显示线下价格 --> |
1067 | 1119 | <view wx:if="{{sele_g.offline_price}}" class="quan_price flex ai-center jc-center"> |
1068 | 1120 | 券后¥ |
1069 | 1121 | <text class="fs32">{{sele_g.offline_price}}</text> |
1070 | 1122 | </view> |
1123 | + | |
1071 | 1124 | </view> |
1072 | 1125 | <block wx:if="{{prom_type==0}}"> |
1073 | 1126 | <view class="flex"> | ... | ... |
pages/index/index/index.wxml
... | ... | @@ -83,6 +83,15 @@ |
83 | 83 | <!---导航--> |
84 | 84 | <view class="venues_box"> |
85 | 85 | <view class="venues_list"> |
86 | + | |
87 | + <!-- 团购列表 --> | |
88 | + <view class="venues_item"> | |
89 | + <navigator url="/packageC/pages/group_list/group_list" hover-class="none"> | |
90 | + <image src="{{url}}/miniapp/images/index/tuangou.png"></image> | |
91 | + <view>团购</view> | |
92 | + </navigator> | |
93 | + </view> | |
94 | + | |
86 | 95 | <view class="venues_item"> |
87 | 96 | <navigator url="/packageA/pages/jfbuy/jfbuy" hover-class="none"> |
88 | 97 | <image src="{{url}}/miniapp/images/index/jifen.png"></image> |
... | ... | @@ -485,10 +494,14 @@ |
485 | 494 | <store_select object="{{item.content}}"></store_select> |
486 | 495 | </block> |
487 | 496 | |
488 | - <!-- 预售 --> | |
489 | - <block wx:if="{{item.ename=='presale'}}"> | |
490 | - <presell object="{{item.content}}"></presell> | |
491 | - </block> | |
497 | + <!-- 预售 --> | |
498 | + <block wx:if="{{item.ename=='presale'}}"> | |
499 | + <presell object="{{item.content}}"></presell> | |
500 | + </block> | |
501 | + <!-- 团购 --> | |
502 | + <block wx:if="{{item.ename=='groupbuy'}}"> | |
503 | + <groupbuy object="{{item.content}}"></groupbuy> | |
504 | + </block> | |
492 | 505 | |
493 | 506 | </view> |
494 | 507 | ... | ... |
pages/template/index.wxml
... | ... | @@ -66,8 +66,10 @@ |
66 | 66 | <block wx:if="{{item.ename=='presale'}}"> |
67 | 67 | <presell object="{{item.content}}"></presell> |
68 | 68 | </block> |
69 | - | |
70 | - | |
69 | + <!-- 团购 --> | |
70 | + <block wx:if="{{item.ename=='groupbuy'}}"> | |
71 | + <groupbuy object="{{item.content}}"></groupbuy> | |
72 | + </block> | |
71 | 73 | |
72 | 74 | </view> |
73 | 75 | </block> | ... | ... |
pages/user/order_detail/order_detail.js
... | ... | @@ -336,15 +336,7 @@ Page({ |
336 | 336 | }); |
337 | 337 | return false; |
338 | 338 | } |
339 | - //如果不是小程序有的功能,直接提示要去3.0处理 | |
340 | - if(good.prom_type==2 ){ | |
341 | - wx.showModal({ | |
342 | - title: '提示', | |
343 | - content: '小程序还未有该活动,请到3.0公众号支付' | |
344 | - }); | |
345 | - return false; | |
346 | - } | |
347 | - | |
339 | + | |
348 | 340 | //要每件每件的商品进行检查,看有么有超出库存,超出限购 |
349 | 341 | var good= order_goods[i],goodsbuynum=0,promgoodsbuynum=0,gg=null; |
350 | 342 | //获取单品的现在的活动状态 |
... | ... | @@ -474,7 +466,7 @@ Page({ |
474 | 466 | } |
475 | 467 | |
476 | 468 | //商品的普通购买 ,不要进行判断 |
477 | - if((good.prom_type==1 || good.prom_type==6 || good.prom_type==4) && !good.is_gift && !good.is_collocation && !good.is_integral_normal && !good.is_pd_normal){ | |
469 | + if((good.prom_type==1 || good.prom_type==2 || good.prom_type==6 || good.prom_type==4) && !good.is_gift && !good.is_collocation && !good.is_integral_normal && !good.is_pd_normal){ | |
478 | 470 | if(gg.prom_type!=good.prom_type && gg.prom_type>0) { |
479 | 471 | var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买'; |
480 | 472 | th.toast(content); |
... | ... | @@ -495,6 +487,17 @@ Page({ |
495 | 487 | } |
496 | 488 | }) |
497 | 489 | } |
490 | + | |
491 | + if (gg.prom_type == 2) { | |
492 | + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/"+ gg.goods_id + "/" + gg.prom_id, {}).then(res => { | |
493 | + if (res.data.code == 0) { | |
494 | + prom = res.data.data; | |
495 | + prom.price=prom.price; | |
496 | + } | |
497 | + }) | |
498 | + } | |
499 | + | |
500 | + | |
498 | 501 | if(gg.prom_type==6){ |
499 | 502 | await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+gg.prom_id,{ |
500 | 503 | }).then(res=>{ |
... | ... | @@ -603,7 +606,18 @@ Page({ |
603 | 606 | prom.price=prom.user_price; |
604 | 607 | } |
605 | 608 | }) |
606 | - } | |
609 | + } | |
610 | + | |
611 | + if (goodsinfo.prom_type == 2) { | |
612 | + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/"+ good.goods_id + "/" + goodsinfo.prom_id, {}).then(res => { | |
613 | + if (res.data.code == 0) { | |
614 | + prom = res.data.data; | |
615 | + prom.price=prom.price; | |
616 | + } | |
617 | + }) | |
618 | + } | |
619 | + | |
620 | + | |
607 | 621 | if(goodsinfo.prom_type==6 && !good.is_pd_normal){ |
608 | 622 | await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{ |
609 | 623 | }).then(res=>{ |
... | ... | @@ -646,6 +660,13 @@ Page({ |
646 | 660 | th.toast(content); |
647 | 661 | return false; |
648 | 662 | } |
663 | + | |
664 | + //看一下会员的团购价格是不是发生了变化 | |
665 | + if(goodsinfo.prom_type==2 && goodsinfo.goods_price!=prom.price){ | |
666 | + var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化'; | |
667 | + th.toast(content); | |
668 | + return false; | |
669 | + } | |
649 | 670 | |
650 | 671 | if(goodsinfo.prom_type==4){ |
651 | 672 | if (good.goods_num > prom.limitqty-prom.buy_num) { |
... | ... | @@ -654,23 +675,14 @@ Page({ |
654 | 675 | th.toast(content); |
655 | 676 | return false; |
656 | 677 | } |
657 | - }else{ | |
658 | - var redis_num = 0; | |
659 | - //------判断活动是否抢光----- | |
660 | - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + | |
661 | - os.stoid + "/" + goodsinfo.prom_type + "/" + goodsinfo.prom_id, { | |
662 | - }).then(res => { | |
663 | - redis_num = res.data.data; | |
664 | - }); | |
665 | - | |
666 | - if (good.goods_num > redis_num) { | |
667 | - | |
668 | - var content=gg.goods_name+'超出商品活动库存,请取消订单'; | |
669 | - th.toast(content); | |
670 | - return false; | |
671 | - } | |
672 | - } | |
673 | - | |
678 | + }else if(goodsinfo.prom_type == 1 || goodsinfo.prom_type == 2 || goodsinfo.prom_type == 6 ) { | |
679 | + if(order.add_time+5*60<ut.gettimestamp()) { | |
680 | + var content = gg.goods_name + '该订单已经超时无法支付,请取消订单'; | |
681 | + th.toast(content); | |
682 | + return false; | |
683 | + } | |
684 | + } | |
685 | + | |
674 | 686 | } |
675 | 687 | |
676 | 688 | } |
... | ... | @@ -1023,6 +1035,20 @@ Page({ |
1023 | 1035 | good.prom_id = prom.id; |
1024 | 1036 | } |
1025 | 1037 | break; |
1038 | + case 2: | |
1039 | + var group = null; | |
1040 | + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + good.goods_id + "/" + good.prom_id, {}).then(res => { | |
1041 | + if (res.data.code == 0) { | |
1042 | + group = res.data.data; | |
1043 | + } | |
1044 | + }) | |
1045 | + //----已经结束----- | |
1046 | + if (group && group.is_end == 0 && group.end_time > timestamp && group.start_time < timestamp) { | |
1047 | + prom = group; | |
1048 | + prom.price = prom.price; | |
1049 | + b_item.price = prom.price; | |
1050 | + } | |
1051 | + break; | |
1026 | 1052 | case 6: |
1027 | 1053 | b_item.is_pd_normal = 1; |
1028 | 1054 | break; | ... | ... |
pages/user/order_list/order_list.js
... | ... | @@ -481,14 +481,7 @@ Page({ |
481 | 481 | }); |
482 | 482 | return false; |
483 | 483 | } |
484 | - //如果不是小程序有的功能,直接提示要去3.0处理 | |
485 | - if (good.prom_type == 2) { | |
486 | - wx.showModal({ | |
487 | - title: '提示', | |
488 | - content: '小程序还未有该活动,请到3.0公众号支付' | |
489 | - }); | |
490 | - return false; | |
491 | - } | |
484 | + | |
492 | 485 | //要每件每件的商品进行检查,看有么有超出库存,超出限购 |
493 | 486 | var good = order_goods[i], goodsbuynum = 0, promgoodsbuynum = 0, gg = null,presellList=null; |
494 | 487 | |
... | ... | @@ -660,7 +653,7 @@ Page({ |
660 | 653 | } |
661 | 654 | |
662 | 655 | //商品的普通购买 ,不要进行判断 |
663 | - if ((good.prom_type == 1 || good.prom_type == 6 || good.prom_type == 4 || good.prom_type == 8) | |
656 | + if ((good.prom_type == 1 || good.prom_type == 2 || good.prom_type == 6 || good.prom_type == 4 || good.prom_type == 8) | |
664 | 657 | && !good.is_gift && !good.is_collocation && !good.is_integral_normal && !good.is_pd_normal) { |
665 | 658 | if (gg.prom_type != good.prom_type && gg.prom_type>0) { |
666 | 659 | var content = gg.goods_name + '商品的活动发生了变化,请取消订单重新购买'; |
... | ... | @@ -669,7 +662,7 @@ Page({ |
669 | 662 | } |
670 | 663 | |
671 | 664 | } else { |
672 | - if ((gg.prom_type == 1 || gg.prom_type == 3 || gg.prom_type == 5 || gg.prom_type == 6 || gg.prom_type == 4) | |
665 | + if ((gg.prom_type == 1 || good.prom_type == 2 || gg.prom_type == 3 || gg.prom_type == 5 || gg.prom_type == 6 || gg.prom_type == 4) | |
673 | 666 | && !good.is_collocation && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) { |
674 | 667 | var prom = null; |
675 | 668 | //---如果是活动的时候--- |
... | ... | @@ -682,6 +675,17 @@ Page({ |
682 | 675 | } |
683 | 676 | }) |
684 | 677 | } |
678 | + | |
679 | + if (gg.prom_type == 2) { | |
680 | + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/"+ gg.goods_id + "/" + gg.prom_id, {}).then(res => { | |
681 | + if (res.data.code == 0) { | |
682 | + prom = res.data.data; | |
683 | + prom.price=prom.price; | |
684 | + } | |
685 | + }) | |
686 | + } | |
687 | + | |
688 | + | |
685 | 689 | if (gg.prom_type == 6) { |
686 | 690 | await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + gg.prom_id, {}).then(res => { |
687 | 691 | if (res.data.code == 0) { |
... | ... | @@ -786,6 +790,17 @@ Page({ |
786 | 790 | } |
787 | 791 | }) |
788 | 792 | } |
793 | + | |
794 | + if (goodsinfo.prom_type == 2) { | |
795 | + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/"+ good.goods_id + "/" + goodsinfo.prom_id, {}).then(res => { | |
796 | + if (res.data.code == 0) { | |
797 | + prom = res.data.data; | |
798 | + prom.price=prom.price; | |
799 | + } | |
800 | + }) | |
801 | + } | |
802 | + | |
803 | + | |
789 | 804 | if (goodsinfo.prom_type == 6 && !good.is_pd_normal) { |
790 | 805 | await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + goodsinfo.prom_id, {}).then(res => { |
791 | 806 | if (res.data.code == 0) { |
... | ... | @@ -827,6 +842,13 @@ Page({ |
827 | 842 | th.toast(content); |
828 | 843 | return false; |
829 | 844 | } |
845 | + | |
846 | + // --看一下会员的团购价格是不是发生了变化 | |
847 | + if(goodsinfo.prom_type==2 && goodsinfo.goods_price!=prom.price){ | |
848 | + var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化'; | |
849 | + th.toast(content); | |
850 | + return false; | |
851 | + } | |
830 | 852 | |
831 | 853 | if (goodsinfo.prom_type == 4) { |
832 | 854 | if (good.goods_num > prom.limitqty - prom.buy_num) { |
... | ... | @@ -835,20 +857,12 @@ Page({ |
835 | 857 | th.toast(content); |
836 | 858 | return false; |
837 | 859 | } |
838 | - } else { | |
839 | - var redis_num = 0; | |
840 | - //------判断活动是否抢光----- | |
841 | - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + | |
842 | - os.stoid + "/" + goodsinfo.prom_type + "/" + goodsinfo.prom_id, {}).then(res => { | |
843 | - redis_num = res.data.data; | |
844 | - }); | |
845 | - | |
846 | - if (good.goods_num > redis_num) { | |
847 | - | |
848 | - var content = gg.goods_name + '超出商品活动库存,请取消订单'; | |
860 | + } else if(goodsinfo.prom_type == 1 || goodsinfo.prom_type == 2 || goodsinfo.prom_type == 6 ) { | |
861 | + if(order.add_time+5*60<ut.gettimestamp()) { | |
862 | + var content = gg.goods_name + '该订单已经超时无法支付,请取消订单'; | |
849 | 863 | th.toast(content); |
850 | 864 | return false; |
851 | - } | |
865 | + } | |
852 | 866 | } |
853 | 867 | |
854 | 868 | } |
... | ... | @@ -1172,7 +1186,6 @@ Page({ |
1172 | 1186 | } |
1173 | 1187 | }) |
1174 | 1188 | |
1175 | - | |
1176 | 1189 | if(!prom) { |
1177 | 1190 | //--判断商品当前的活动情况-- |
1178 | 1191 | switch (good.prom_type) { |
... | ... | @@ -1190,6 +1203,22 @@ Page({ |
1190 | 1203 | b_item.price = prom.user_price; |
1191 | 1204 | } |
1192 | 1205 | break; |
1206 | + | |
1207 | + case 2: | |
1208 | + var group = null; | |
1209 | + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + good.goods_id + "/" + good.prom_id, {}).then(res => { | |
1210 | + if (res.data.code == 0) { | |
1211 | + group = res.data.data; | |
1212 | + } | |
1213 | + }) | |
1214 | + //----已经结束----- | |
1215 | + if (group && group.is_end == 0 && group.end_time > timestamp && group.start_time < timestamp) { | |
1216 | + prom = group; | |
1217 | + prom.price = prom.price; | |
1218 | + b_item.price = prom.price; | |
1219 | + } | |
1220 | + break; | |
1221 | + | |
1193 | 1222 | case 6: |
1194 | 1223 | b_item.is_pd_normal = 1; |
1195 | 1224 | break; | ... | ... |