Commit 9a7c2030692fdf8404989130bb2f6c0e298f37c3

Authored by taiyuan
2 parents 066b43fd 8f28f385

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

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 Component({ 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 \ No newline at end of file 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 width: 100%; 24 width: 100%;
20 background-color: white; 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 min-height: 300rpx; 50 min-height: 300rpx;
41 width: 100%; 51 width: 100%;
42 background-color: white; 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 min-width: 30%; 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 width: 210rpx; 63 width: 210rpx;
56 height: 100%; 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 width: 210rpx; 68 width: 210rpx;
61 height: 100%; 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 position: absolute; 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 font-size: 20rpx; 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 margin-left: 14rpx; 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 position: absolute; 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 position: absolute; 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 font-size: 20rpx; 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 font-size: 20rpx; 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 width: 100%; 200 width: 100%;
209 min-height: 240rpx; 201 min-height: 240rpx;
210 -  
211 } 202 }
212 203
213 -.sp2_b .one1_b{  
214 - width: 100%; 204 +.sp2 .one1 {
215 background-color: white; 205 background-color: white;
216 - height: 252rpx; 206 + height: 285rpx;
217 display: flex; 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 text-align: left; 222 text-align: left;
236 padding: 4rpx 0; 223 padding: 4rpx 0;
237 - overflow: hidden;  
238 height: 48rpx; 224 height: 48rpx;
  225 + overflow: hidden;
  226 + white-space: nowrap;
239 text-overflow: ellipsis; 227 text-overflow: ellipsis;
240 } 228 }
241 229
242 -.o1_right_b .o1_sj_b{ 230 +.o1_right .o1_sj_kill {
243 height: 60rpx; 231 height: 60rpx;
244 -  
245 margin-bottom: 10rpx; 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 background-color: #fdcb08; 237 background-color: #fdcb08;
250 text-align: center; 238 text-align: center;
251 border-radius: 10rpx; 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 overflow: hidden; 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 color: #dcdcdc; 254 color: #dcdcdc;
269 text-decoration: line-through; 255 text-decoration: line-through;
270 font-size: 26rpx; 256 font-size: 26rpx;
271 - width: 50%;  
272 overflow: hidden; 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 color: white; 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 text-align: center; 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 \ No newline at end of file 326 \ No newline at end of file
  327 +.jc_sb{ justify-content: space-between;}
489 \ No newline at end of file 328 \ No newline at end of file
pages/cart/cart2/cart2.js
@@ -805,13 +805,12 @@ Page({ @@ -805,13 +805,12 @@ Page({
805 } 805 }
806 } 806 }
807 807
808 - 808 +
809 gd.prom_type=gg.prom_type; 809 gd.prom_type=gg.prom_type;
810 gd.prom_id=gg.prom_id; 810 gd.prom_id=gg.prom_id;
811 - 811 +
812 switch (gd.prom_type) { 812 switch (gd.prom_type) {
813 case 0: 813 case 0:
814 - case 2:  
815 case 3: 814 case 3:
816 case 4: 815 case 4:
817 case 5: 816 case 5:
@@ -1010,6 +1009,41 @@ Page({ @@ -1010,6 +1009,41 @@ Page({
1010 }); 1009 });
1011 1010
1012 break; 1011 break;
  1012 +
  1013 + case 2: //--- 团购 ---
  1014 + var quanlist = null;
  1015 + getApp().request.get("/api/weshop/goods/groupBuy/getActInfo/" +os.stoid + "/" +gd.goods_id+"/"+ gd.prom_id, {
  1016 + success: async function (tt) {
  1017 + if (tt.data.code == 0) {
  1018 + //t.data.data.shop_price = tt.data.data.prom_price;
  1019 + t.data.data.shop_price = tt.data.data.price;
  1020 + } else {
  1021 + t.data.data.prom_id = 0;
  1022 + t.data.data.prom_type = 0;
  1023 + }
  1024 +
  1025 + th.data.ckeck_quan_price = t.data.data.shop_price * gg.goods_num;
  1026 + th.data.check_quan_price_list = t.data.data.shop_price * gg.goods_num + "";
  1027 + th.data.check_quan_ware_list = t.data.data.erpwareid + "";
  1028 +
  1029 + th.setData({
  1030 + bn_goods: gd,
  1031 + bn_pickname: gg.pick_name,
  1032 + bn_exp_type: et,
  1033 + index: m_wind,
  1034 + bn_pick: gg.pick_id,
  1035 + bn_t_exp_t: distr_t,
  1036 + bn_exp_type: et
  1037 + });
  1038 +
  1039 + //-- 计算价格 --
  1040 + th.calculatePrice2();
  1041 + //获取优惠券,如果有券的钱,就调用
  1042 + if(th.data.ckeck_quan_price>0) th.get_buy_now_quan();
  1043 + }
  1044 + });
  1045 +
  1046 + break;
1013 } 1047 }
1014 }, 1048 },
1015 }); 1049 });
@@ -2420,6 +2454,7 @@ Page({ @@ -2420,6 +2454,7 @@ Page({
2420 //--判断活动的类型-- 2454 //--判断活动的类型--
2421 switch (g_item.prom_type) { 2455 switch (g_item.prom_type) {
2422 case 1: 2456 case 1:
  2457 + case 2:
2423 goods.prom_type = g_item.prom_type; 2458 goods.prom_type = g_item.prom_type;
2424 goods.prom_id = g_item.prom_id; 2459 goods.prom_id = g_item.prom_id;
2425 break; 2460 break;
@@ -3795,7 +3830,6 @@ Page({ @@ -3795,7 +3830,6 @@ Page({
3795 } 3830 }
3796 }, 3831 },
3797 3832
3798 -  
3799 //取消使用线下取价 3833 //取消使用线下取价
3800 cancle_offline: function () { 3834 cancle_offline: function () {
3801 //判断是不是立即购买 3835 //判断是不是立即购买
pages/goods/goodsInfo/goodsInfo.js
@@ -840,7 +840,7 @@ Page({ @@ -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 if (that.data.sales_rules == 2 && that.data.is_newsales_rules) { 845 if (that.data.sales_rules == 2 && that.data.is_newsales_rules) {
846 //获取门店 846 //获取门店
@@ -1053,7 +1053,7 @@ Page({ @@ -1053,7 +1053,7 @@ Page({
1053 open_ind_store: ind 1053 open_ind_store: ind
1054 }); 1054 });
1055 //如果是秒杀的话,要看redis够不够 1055 //如果是秒杀的话,要看redis够不够
1056 - if (this.data.prom_type == 1) { 1056 + if (this.data.prom_type == 1 || this.data.prom_type == 2) {
1057 this.getactLen(function (num) { 1057 this.getactLen(function (num) {
1058 if (num < th.data.goodsInputNum) { 1058 if (num < th.data.goodsInputNum) {
1059 getApp().my_warnning("秒杀库存不足!", 0, th); 1059 getApp().my_warnning("秒杀库存不足!", 0, th);
@@ -1268,10 +1268,10 @@ Page({ @@ -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 newd.goods_price = th.data.prom_price; 1272 newd.goods_price = th.data.prom_price;
1273 newd.member_goods_price = th.data.prom_price, 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 newd.prom_id = th.data.prom_id; 1275 newd.prom_id = th.data.prom_id;
1276 1276
1277 if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); 1277 if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
@@ -1342,7 +1342,7 @@ Page({ @@ -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 newd.prom_type = 0; 1346 newd.prom_type = 0;
1347 newd.prom_id = 0; 1347 newd.prom_id = 0;
1348 1348
@@ -1399,7 +1399,7 @@ Page({ @@ -1399,7 +1399,7 @@ Page({
1399 add_cart_next(e, t, a, o, newd, CanOutQty) { 1399 add_cart_next(e, t, a, o, newd, CanOutQty) {
1400 var th = this, i = getApp().request; 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 var conf = th.data.bconfig; 1403 var conf = th.data.bconfig;
1404 if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) { 1404 if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) {
1405 var s_list = JSON.parse(conf.switch_list); 1405 var s_list = JSON.parse(conf.switch_list);
@@ -3002,13 +3002,108 @@ Page({ @@ -3002,13 +3002,108 @@ Page({
3002 var user_id=getApp().globalData.user_id; 3002 var user_id=getApp().globalData.user_id;
3003 if(!user_id) user_id=0; 3003 if(!user_id) user_id=0;
3004 3004
3005 - if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 5 || prom_type == 7) { 3005 + if (prom_type == 3 || prom_type == 0 || prom_type == 5 || prom_type == 7) {
3006 this.setData({ 3006 this.setData({
3007 prom_type: 0,isshow: 1, 3007 prom_type: 0,isshow: 1,
3008 }); 3008 });
3009 return false; 3009 return false;
3010 } 3010 }
3011 3011
  3012 + if(prom_type==2){
  3013 + //-------判断团购活动是否抢光---------
  3014 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
  3015 + 1: 1
  3016 + }).then(res => {
  3017 + var em = res;
  3018 + if (em.data.code == 0) {
  3019 + if (em.data.data <= 0) ee.setData({
  3020 + prom_r_null: 1
  3021 + });
  3022 + //拿取价格并且判断时间--
  3023 + getApp().request.get("/api/weshop/goods/groupBuy/getActInfo/" +os.stoid + "/" +gid+"/"+ prom_id, {
  3024 + success: function (t) {
  3025 + if (t.data.code != 0) {
  3026 + ee.setData({
  3027 + prom_type: 0,
  3028 + isshow: 1,
  3029 + });
  3030 + ee.get_sku(os.stoid, ee.data.data, gid);
  3031 + return false;
  3032 + }
  3033 + //----已经结束-----
  3034 + if (t.data.data.is_end == 1) {
  3035 + ee.setData({
  3036 + prom_type: 0,
  3037 + isshow: 1,
  3038 + });
  3039 + ee.get_sku(os.stoid, ee.data.data, gid);
  3040 + ee.get_sto();
  3041 + return false;
  3042 + }
  3043 + //----已经过期-----
  3044 + var now = ut.gettimestamp();
  3045 + if (t.data.data.end_time < now) {
  3046 + ee.setData({
  3047 + prom_type: 0,
  3048 + isshow: 1,
  3049 + });
  3050 + ee.get_sku(os.stoid, ee.data.data, gid);
  3051 + return false;
  3052 + }
  3053 +
  3054 + /*-- 还没有开始预热的也不显示 --*/
  3055 + if (t.data.data.show_time > now) {
  3056 + ee.setData({
  3057 + prom_type: 0,
  3058 + isshow: 1,
  3059 + });
  3060 + ee.get_sku(os.stoid, ee.data.data, gid);
  3061 + ee.get_sto();
  3062 + return false;
  3063 + }
  3064 +
  3065 + var t_gd = ee.data.data;
  3066 + var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss");
  3067 + var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss");
  3068 +
  3069 + ee.setData({
  3070 + prom_price: t.data.data.price,
  3071 + prom_type: 2,
  3072 + prom_id: prom_id,
  3073 + prom_buy_limit: t.data.data.buy_limit,
  3074 + prom_act: t.data.data,
  3075 + prom_end_time: prom_end_time,
  3076 + prom_start_time: prom_start_time,
  3077 + isshow: 1,
  3078 + prom_act:t.data.data
  3079 + });
  3080 +
  3081 + ee.get_sto();
  3082 + var newTime = ut.gettimestamp();
  3083 + var endTime2 = t.data.data.end_time;
  3084 + var endTime1 = t.data.data.start_time;
  3085 + if (endTime1 > newTime) {
  3086 + ee.setData({
  3087 + prom_time_text: '距团购开始还有'
  3088 + })
  3089 + ee.countDown(endTime1, 0);
  3090 + } else {
  3091 + if (endTime2 > newTime) {
  3092 + ee.setData({
  3093 + prom_time_text: '距团购结束还有',
  3094 + prom_st: 1
  3095 + })
  3096 + ee.countDown(endTime2);
  3097 + }
  3098 + }
  3099 +
  3100 + }
  3101 + });
  3102 + }
  3103 + })
  3104 +
  3105 +
  3106 + }
3012 if (prom_type == 1 && prom_id==0){ 3107 if (prom_type == 1 && prom_id==0){
3013 this.setData({ 3108 this.setData({
3014 prom_type: 0,isshow: 1, 3109 prom_type: 0,isshow: 1,
@@ -3567,7 +3662,7 @@ Page({ @@ -3567,7 +3662,7 @@ Page({
3567 if(th.data.prom_type==0 && gd.prom_type == 1 ){ 3662 if(th.data.prom_type==0 && gd.prom_type == 1 ){
3568 gd.prom_type= 0; 3663 gd.prom_type= 0;
3569 } 3664 }
3570 - 3665 +
3571 if (gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6) { 3666 if (gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6) {
3572 //----获取活动购买数---- 3667 //----获取活动购买数----
3573 getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", { 3668 getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", {
@@ -4336,7 +4431,11 @@ Page({ @@ -4336,7 +4431,11 @@ Page({
4336 4431
4337 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团 4432 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团
4338 var type = this.data.prom_type; 4433 var type = this.data.prom_type;
  4434 + if (type==2) type=-1;
4339 if (type == 6) type = 2; 4435 if (type == 6) type = 2;
  4436 +
  4437 +
  4438 +
4340 if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3; 4439 if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3;
4341 4440
4342 wx.showLoading({ title: '生成中...',}) 4441 wx.showLoading({ title: '生成中...',})
@@ -4380,15 +4479,7 @@ Page({ @@ -4380,15 +4479,7 @@ Page({
4380 // 先画背景 4479 // 先画背景
4381 var pg_path = "../../../images/share/share_bg.png"; 4480 var pg_path = "../../../images/share/share_bg.png";
4382 4481
4383 - // context.fillStyle="#FFFFFF";  
4384 - // context.fillRect(0,0,554 * unit, 899 * unit);  
4385 -  
4386 - // if(type == 0) {  
4387 - // this.drawPoster(context);  
4388 - // return false;  
4389 - // };  
4390 -  
4391 - 4482 +
4392 //-- 如果有自定义海报的时候,判断背景的图片 -- 4483 //-- 如果有自定义海报的时候,判断背景的图片 --
4393 if (th.data.share_b_img) { 4484 if (th.data.share_b_img) {
4394 pg_path = th.data.share_b_img; 4485 pg_path = th.data.share_b_img;
@@ -4396,7 +4487,7 @@ Page({ @@ -4396,7 +4487,7 @@ Page({
4396 // context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); 4487 // context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
4397 4488
4398 4489
4399 - if(type == 0) { // 如果是普通商品,绘制新海报 4490 + if(type == 0 ) { // 如果是普通商品,绘制新海报
4400 th.drawPoster(context, unit, th.data.share_goods_img, vpath); 4491 th.drawPoster(context, unit, th.data.share_goods_img, vpath);
4401 } else { 4492 } else {
4402 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); 4493 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
@@ -4453,7 +4544,7 @@ Page({ @@ -4453,7 +4544,7 @@ Page({
4453 4544
4454 4545
4455 var share_title = th.data.data.goods_name; 4546 var share_title = th.data.data.goods_name;
4456 - if (th.data.prom_type == 1 || th.data.prom_type == 6 || th.data.prom_type == 4) { 4547 + if (th.data.prom_type == 1 || th.data.prom_type == 2 || th.data.prom_type == 6 || th.data.prom_type == 4) {
4457 share_title = th.data.prom_act.share_title; 4548 share_title = th.data.prom_act.share_title;
4458 if (!share_title) share_title = th.data.prom_act.title; 4549 if (!share_title) share_title = th.data.prom_act.title;
4459 if (th.data.prom_type == 4) share_title = th.data.prom_act.name; 4550 if (th.data.prom_type == 4) share_title = th.data.prom_act.name;
@@ -4573,7 +4664,7 @@ Page({ @@ -4573,7 +4664,7 @@ Page({
4573 context.setFillStyle("black") 4664 context.setFillStyle("black")
4574 context.setFontSize(22 * unit) 4665 context.setFontSize(22 * unit)
4575 4666
4576 - if (type == 0) { 4667 + if (type == 0 || type == -1) {
4577 // 原来start ---> 4668 // 原来start --->
4578 context.setFontSize(24 * unit) 4669 context.setFontSize(24 * unit)
4579 context.fillText(th.data.sto_sele_name_1, 40 * unit, 766 * unit); 4670 context.fillText(th.data.sto_sele_name_1, 40 * unit, 766 * unit);
@@ -4732,6 +4823,37 @@ Page({ @@ -4732,6 +4823,37 @@ Page({
4732 context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit); 4823 context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
4733 } 4824 }
4734 break 4825 break
  4826 +
  4827 +
  4828 + case -1: //秒杀商品的展示
  4829 + //---画线---
  4830 + context.setLineWidth(1 * unit)
  4831 + context.moveTo(32 * unit, 670 * unit)
  4832 + context.lineTo(520 * unit, 670 * unit)
  4833 + context.stroke();
  4834 +
  4835 +
  4836 + context.setFillStyle("black")
  4837 + context.setFontSize(24 * unit)
  4838 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 744 * unit);
  4839 + //---文字---
  4840 + context.setFontSize(22 * unit)
  4841 + context.setFillStyle("black")
  4842 + context.fillText("长按识别二维码", 40 * unit, 800 * unit);
  4843 + context.fillText("立即开始抢购", 40 * unit, 846 * unit);
  4844 +
  4845 +
  4846 + //---二维吗图---
  4847 + //-- 自定义海报 --
  4848 + if (th.data.poster) {
  4849 + var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
  4850 + var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
  4851 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 135 * unit, 135 * unit);
  4852 + } else {
  4853 + //---二维吗图---
  4854 + context.drawImage(vpath, 390 * unit, 726 * unit, 135 * unit, 135 * unit);
  4855 + }
  4856 + break;
4735 4857
4736 4858
4737 } 4859 }
pages/goods/goodsInfo/goodsInfo.wxml
@@ -46,7 +46,8 @@ @@ -46,7 +46,8 @@
46 </block> 46 </block>
47 </view> 47 </view>
48 </view> 48 </view>
49 - <!-- --显示秒杀价,团购,积分购-- --> 49 +
  50 + <!-- --显示秒杀价 -->
50 <view class="prom_show rel" wx:if="{{prom_type==1}}"> 51 <view class="prom_show rel" wx:if="{{prom_type==1}}">
51 <image class="secondkill-img" src='{{prom_st==1? iurl+"/miniapp/images/red_jx.png":iurl+"/miniapp/images/blue_ks.png"}}'></image> 52 <image class="secondkill-img" src='{{prom_st==1? iurl+"/miniapp/images/red_jx.png":iurl+"/miniapp/images/blue_ks.png"}}'></image>
52 <image class="abs spike-img" src="{{iurl}}/miniapp/images/xsmiaosha.png"></image> 53 <image class="abs spike-img" src="{{iurl}}/miniapp/images/xsmiaosha.png"></image>
@@ -73,6 +74,21 @@ @@ -73,6 +74,21 @@
73 <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view> 74 <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view>
74 </view> 75 </view>
75 </view> 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 <view class="pt_show " wx:if="{{prom_type==6}}"> 93 <view class="pt_show " wx:if="{{prom_type==6}}">
78 <view class="pt_view rel"> 94 <view class="pt_view rel">
@@ -314,8 +330,10 @@ @@ -314,8 +330,10 @@
314 330
315 331
316 <view class="goods-price"> 332 <view class="goods-price">
  333 +
317 <view class="flex jc_sb"> 334 <view class="flex jc_sb">
318 <view class="co-red" style="" wx:if="{{prom_type==0 || prom_type==3}}"> 335 <view class="co-red" style="" wx:if="{{prom_type==0 || prom_type==3}}">
  336 +
319 <view class="market-price flex" style="align-items: baseline;"> 337 <view class="market-price flex" style="align-items: baseline;">
320 <block wx:if="{{card_field && data[card_field]>0}}"> 338 <block wx:if="{{card_field && data[card_field]>0}}">
321 <view class="flex ai-center grade-card-frame"> 339 <view class="flex ai-center grade-card-frame">
@@ -328,7 +346,9 @@ @@ -328,7 +346,9 @@
328 <text>零售价:¥{{filters.toFix(data.market_price,2)}}</text> 346 <text>零售价:¥{{filters.toFix(data.market_price,2)}}</text>
329 </view> 347 </view>
330 </block> 348 </block>
331 - <block wx:else> 349 + <block wx:elif="{{prom_type!=2}}">
  350 +
  351 +
332 <text class="yuan">¥</text> 352 <text class="yuan">¥</text>
333 {{filters.toFix(data.shop_price,2)}} 353 {{filters.toFix(data.shop_price,2)}}
334 <view class='yj'> 354 <view class='yj'>
@@ -338,18 +358,15 @@ @@ -338,18 +358,15 @@
338 </view> 358 </view>
339 </view> 359 </view>
340 <!-- 这个是分享按钮 --> 360 <!-- 这个是分享按钮 -->
341 - <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> -->  
342 - <view class="xc-share-frame t-c" bindtap="clickShare" wx:if="{{prom_type != 1}}"> 361 + <view class="xc-share-frame t-c" bindtap="clickShare" wx:if="{{prom_type != 1 && prom_type != 2}}">
343 <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> --> 362 <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> -->
344 <view class="iconfont icon-share fs60"></view> 363 <view class="iconfont icon-share fs60"></view>
345 - <!-- <view class="share-font">1分享</view> -->  
346 <view class="fs22 c-7b">分享</view> 364 <view class="fs22 c-7b">分享</view>
347 </view> 365 </view>
348 </view> 366 </view>
349 <!-- 不是秒杀 --> 367 <!-- 不是秒杀 -->
350 <!-- 等级卡的价格,不是等级卡会员,且商品又有设置等级级价,商家后台有开通升级卡同能 --> 368 <!-- 等级卡的价格,不是等级卡会员,且商品又有设置等级级价,商家后台有开通升级卡同能 -->
351 - <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 && g_filters.get_card_price(data,card_list,1)!=''}}">  
352 - 369 + <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)!=''}}">
353 <view class="flex ai-center grade-card-frame card-frame"> 370 <view class="flex ai-center grade-card-frame card-frame">
354 <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image> 371 <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>
355 <view class="fs24 white view card-name ellipsis-1"> 372 <view class="fs24 white view card-name ellipsis-1">
@@ -363,7 +380,7 @@ @@ -363,7 +380,7 @@
363 <!-- 等级卡的显示,购买, 等级卡近30天要显示续费 --> 380 <!-- 等级卡的显示,购买, 等级卡近30天要显示续费 -->
364 <block wx:if="{{g_filters.is_has_rank(rank_switch,data)}}"> 381 <block wx:if="{{g_filters.is_has_rank(rank_switch,data)}}">
365 <!-- 不是秒杀,且会员不是等级会员 --> 382 <!-- 不是秒杀,且会员不是等级会员 -->
366 - <view wx:if="{{!card_field && prom_type!=1 && card_list && card_list.length>0 && g_filters.get_card_price(data,card_list,1)!=''}}"> 383 + <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)!=''}}">
367 <view class="beauty-makeup-frame flex ai-center"> 384 <view class="beauty-makeup-frame flex ai-center">
368 <view class="left flex ai-center jc_sa"> 385 <view class="left flex ai-center jc_sa">
369 <view class="flex ai-center grade-card-frame card-frame advert-card"> 386 <view class="flex ai-center grade-card-frame card-frame advert-card">
@@ -387,7 +404,7 @@ @@ -387,7 +404,7 @@
387 </view> 404 </view>
388 </view> 405 </view>
389 <!-- 立即续费的显示 --> 406 <!-- 立即续费的显示 -->
390 - <view wx:elif="{{is_near_date && data[card_field]>0 && prom_type!=1}}"> 407 + <view wx:elif="{{is_near_date && data[card_field]>0 && prom_type!=1 && prom_type!=2 && card_name!=''}}">
391 <view class="beauty-makeup-frame flex ai-center"> 408 <view class="beauty-makeup-frame flex ai-center">
392 <view class="left flex ai-center jc_sa"> 409 <view class="left flex ai-center jc_sa">
393 <view class="flex ai-center grade-card-frame card-frame advert-card"> 410 <view class="flex ai-center grade-card-frame card-frame advert-card">
@@ -413,16 +430,19 @@ @@ -413,16 +430,19 @@
413 </view> 430 </view>
414 </block> 431 </block>
415 <!-- 许程商品名字 --> 432 <!-- 许程商品名字 -->
416 - <view wx:if="{{prom_type!=1}}"> 433 + <view wx:if="{{prom_type!=1 && prom_type!=2 }}">
417 <view class="goods-title"> 434 <view class="goods-title">
418 <view class="goods-name elli">{{data.goods_name}}</view> 435 <view class="goods-name elli">{{data.goods_name}}</view>
419 </view> 436 </view>
420 </view> 437 </view>
421 - <view class="goods-num" wx:if="{{prom_type!=1}}"> 438 +
  439 +
  440 + <view class="goods-num" wx:if="{{prom_type!=1 && prom_type!=2}}">
422 <view class="sales">销量:{{data.sales_sum}}件</view> 441 <view class="sales">销量:{{data.sales_sum}}件</view>
423 <view class="stock">折扣:{{data.disc}}折</view> 442 <view class="stock">折扣:{{data.disc}}折</view>
424 <view class="stock">{{categories3[0].num}}人评价</view> 443 <view class="stock">{{categories3[0].num}}人评价</view>
425 </view> 444 </view>
  445 +
426 <view wx:if="{{prom_type==1}}"> 446 <view wx:if="{{prom_type==1}}">
427 <view class="flex jc_sb"> 447 <view class="flex jc_sb">
428 <view class="flex" style="align-items: baseline;"> 448 <view class="flex" style="align-items: baseline;">
@@ -447,13 +467,24 @@ @@ -447,13 +467,24 @@
447 </view> --> 467 </view> -->
448 </view> 468 </view>
449 </view> 469 </view>
450 - <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4}}"> 470 +
  471 + <!-- 秒杀的活动名称 -->
  472 + <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4 && prom_type!=2}}">
451 {{sele_g.goods_name}} 473 {{sele_g.goods_name}}
452 </view> 474 </view>
453 - <!-- <view wx:if="{{prom_type==1}}" style='height:58rpx'></view> --> 475 +
  476 + <view class="xc-explain flex jc_sb" wx:if="{{prom_type==2}}">
  477 + <view class="fs32 ellipsis-2" style="max-width:80%; max-height: 90rpx;">{{sele_g.goods_name}}</view>
  478 + <!-- 这个是分享按钮 -->
  479 + <view class="xc-share-frame t-c" bindtap="clickShare" style="flex-shrink:0;position: relative;top: -22rpx;">
  480 + <view class="iconfont icon-share fs60"></view>
  481 + <view class="fs22 c-7b">分享</view>
  482 + </view>
  483 + </view>
  484 +
454 <!-- 许程 7.24 暂时注释 --> 485 <!-- 许程 7.24 暂时注释 -->
455 <view wx:if="{{prom_type==1}}"> 486 <view wx:if="{{prom_type==1}}">
456 - <view class="goods-num" wx:if="{{prom_type==1}}"> 487 + <view class="goods-num">
457 <block wx:if="prom_st>0"> 488 <block wx:if="prom_st>0">
458 <view class="stock">总数量:{{prom_act.goods_num+prom_act.virtual}}件</view> 489 <view class="stock">总数量:{{prom_act.goods_num+prom_act.virtual}}件</view>
459 <view class="stock" wx:if="{{prom_act.buy_limit>0}}">限购:{{prom_act.buy_limit}}件</view> 490 <view class="stock" wx:if="{{prom_act.buy_limit>0}}">限购:{{prom_act.buy_limit}}件</view>
@@ -474,6 +505,29 @@ @@ -474,6 +505,29 @@
474 </block> 505 </block>
475 </view> 506 </view>
476 </view> 507 </view>
  508 + <view wx:if="{{prom_type==2}}">
  509 +
  510 + <view class="goods-num">
  511 + <block wx:if="prom_st>0">
  512 + <view class="stock">总数量:{{prom_act.goods_num+prom_act.virtualNum}}件</view>
  513 + <view class="stock" wx:if="{{prom_act.buy_limit>0}}">限购:{{prom_act.buy_limit}}件</view>
  514 + <view class="stock" wx:else>限购:不限</view>
  515 +
  516 + <block wx:if="{{prom_st==0}}">
  517 + <view class="sales">已购:0件</view>
  518 + </block>
  519 + <block wx:else>
  520 + <view class="sales">已购:{{prom_act.buy_num+prom_act.virtualNum}}件</view>
  521 + </block>
  522 + </block>
  523 + <block wx:else>
  524 + <view class="stock">总数量:{{prom_act.goods_num}}件</view>
  525 + <view class="stock" wx:if="{{prom_act.buy_limit>0}}">限购:{{prom_act.buy_limit}}件</view>
  526 + <view class="stock" wx:else>限购:不限</view>
  527 + <view class="sales">已购:{{prom_act.buy_num}}件</view>
  528 + </block>
  529 + </view>
  530 + </view>
477 </view> 531 </view>
478 </block> 532 </block>
479 <!-- 门店收货地址 --> 533 <!-- 门店收货地址 -->
@@ -514,7 +568,7 @@ @@ -514,7 +568,7 @@
514 </view> 568 </view>
515 </view> 569 </view>
516 <!-- 许程 7.24暂时注释 --> 570 <!-- 许程 7.24暂时注释 -->
517 - <view class="bdt16" wx:if="{{prom_type!=1&&prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1}}"> 571 + <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}}">
518 <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}"> 572 <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}">
519 <view class="cx-sizs fs30">领券</view> 573 <view class="cx-sizs fs30">领券</view>
520 <view class="flex ai_c f1 pdh20"> 574 <view class="flex ai_c f1 pdh20">
@@ -1128,15 +1182,13 @@ @@ -1128,15 +1182,13 @@
1128 <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}}</block> 1182 <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}}</block>
1129 <block wx:else>{{sele_g.shop_price}}</block> 1183 <block wx:else>{{sele_g.shop_price}}</block>
1130 </view> 1184 </view>
1131 - <view class="spec-goods-price" wx:else>  
1132 - <text class="fs20">¥</text>  
1133 - {{prom_price}}  
1134 - </view> 1185 + <view class="spec-goods-price" wx:elif="{{prom_type!=2}}"><text class="fs20">¥</text>{{prom_price}}</view>
1135 <!-- 显示线下价格 --> 1186 <!-- 显示线下价格 -->
1136 <view wx:if="{{sele_g.offline_price}}" class="quan_price flex ai-center jc-center"> 1187 <view wx:if="{{sele_g.offline_price}}" class="quan_price flex ai-center jc-center">
1137 券后¥ 1188 券后¥
1138 <text class="fs32">{{sele_g.offline_price}}</text> 1189 <text class="fs32">{{sele_g.offline_price}}</text>
1139 </view> 1190 </view>
  1191 +
1140 </view> 1192 </view>
1141 <block wx:if="{{prom_type==0}}"> 1193 <block wx:if="{{prom_type==0}}">
1142 <view class="flex"> 1194 <view class="flex">
pages/index/index/index.wxml
@@ -83,6 +83,15 @@ @@ -83,6 +83,15 @@
83 <!---导航--> 83 <!---导航-->
84 <view class="venues_box"> 84 <view class="venues_box">
85 <view class="venues_list"> 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 <view class="venues_item"> 95 <view class="venues_item">
87 <navigator url="/packageA/pages/jfbuy/jfbuy" hover-class="none"> 96 <navigator url="/packageA/pages/jfbuy/jfbuy" hover-class="none">
88 <image src="{{url}}/miniapp/images/index/jifen.png"></image> 97 <image src="{{url}}/miniapp/images/index/jifen.png"></image>
@@ -485,10 +494,14 @@ @@ -485,10 +494,14 @@
485 <store_select object="{{item.content}}"></store_select> 494 <store_select object="{{item.content}}"></store_select>
486 </block> 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 </view> 506 </view>
494 507
pages/template/index.wxml
@@ -66,8 +66,10 @@ @@ -66,8 +66,10 @@
66 <block wx:if="{{item.ename=='presale'}}"> 66 <block wx:if="{{item.ename=='presale'}}">
67 <presell object="{{item.content}}"></presell> 67 <presell object="{{item.content}}"></presell>
68 </block> 68 </block>
69 -  
70 - 69 + <!-- 团购 -->
  70 + <block wx:if="{{item.ename=='groupbuy'}}">
  71 + <groupbuy object="{{item.content}}"></groupbuy>
  72 + </block>
71 73
72 </view> 74 </view>
73 </block> 75 </block>
pages/user/member/bring/bring.wxss
@@ -62,7 +62,7 @@ font-family: &#39;SimHei&#39;,Arial; @@ -62,7 +62,7 @@ font-family: &#39;SimHei&#39;,Arial;
62 62
63 /*银行名字*/ 63 /*银行名字*/
64 .yhmz{ 64 .yhmz{
65 - width: 129rpx; 65 + width:500rpx;
66 height: 50rpx; 66 height: 50rpx;
67 margin-left:50rpx; 67 margin-left:50rpx;
68 color: #999; 68 color: #999;
pages/user/order_detail/order_detail.js
@@ -336,15 +336,7 @@ Page({ @@ -336,15 +336,7 @@ Page({
336 }); 336 });
337 return false; 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 var good= order_goods[i],goodsbuynum=0,promgoodsbuynum=0,gg=null; 341 var good= order_goods[i],goodsbuynum=0,promgoodsbuynum=0,gg=null;
350 //获取单品的现在的活动状态 342 //获取单品的现在的活动状态
@@ -474,7 +466,7 @@ Page({ @@ -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 if(gg.prom_type!=good.prom_type && gg.prom_type>0) { 470 if(gg.prom_type!=good.prom_type && gg.prom_type>0) {
479 var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买'; 471 var content=gg.goods_name+'商品的活动发生了变化,请取消订单重新购买';
480 th.toast(content); 472 th.toast(content);
@@ -495,6 +487,17 @@ Page({ @@ -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 if(gg.prom_type==6){ 501 if(gg.prom_type==6){
499 await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+gg.prom_id,{ 502 await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+gg.prom_id,{
500 }).then(res=>{ 503 }).then(res=>{
@@ -603,7 +606,18 @@ Page({ @@ -603,7 +606,18 @@ Page({
603 prom.price=prom.user_price; 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 if(goodsinfo.prom_type==6 && !good.is_pd_normal){ 621 if(goodsinfo.prom_type==6 && !good.is_pd_normal){
608 await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{ 622 await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{
609 }).then(res=>{ 623 }).then(res=>{
@@ -646,6 +660,13 @@ Page({ @@ -646,6 +660,13 @@ Page({
646 th.toast(content); 660 th.toast(content);
647 return false; 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 if(goodsinfo.prom_type==4){ 671 if(goodsinfo.prom_type==4){
651 if (good.goods_num > prom.limitqty-prom.buy_num) { 672 if (good.goods_num > prom.limitqty-prom.buy_num) {
@@ -655,12 +676,13 @@ Page({ @@ -655,12 +676,13 @@ Page({
655 return false; 676 return false;
656 } 677 }
657 }else if(goodsinfo.prom_type == 1 || goodsinfo.prom_type == 2 || goodsinfo.prom_type == 6 ) { 678 }else if(goodsinfo.prom_type == 1 || goodsinfo.prom_type == 2 || goodsinfo.prom_type == 6 ) {
658 - if(order.add_time+5*60<ut.gettimestamp()) {  
659 - var content = gg.goods_name + '该订单已经超时无法支付,请取消订单';  
660 - th.toast(content);  
661 - return false;  
662 - }  
663 - } 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 +
664 } 686 }
665 687
666 } 688 }
@@ -1013,6 +1035,20 @@ Page({ @@ -1013,6 +1035,20 @@ Page({
1013 good.prom_id = prom.id; 1035 good.prom_id = prom.id;
1014 } 1036 }
1015 break; 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;
1016 case 6: 1052 case 6:
1017 b_item.is_pd_normal = 1; 1053 b_item.is_pd_normal = 1;
1018 break; 1054 break;
pages/user/order_list/order_list.js
@@ -480,14 +480,7 @@ Page({ @@ -480,14 +480,7 @@ Page({
480 }); 480 });
481 return false; 481 return false;
482 } 482 }
483 - //如果不是小程序有的功能,直接提示要去3.0处理  
484 - if (good.prom_type == 2) {  
485 - wx.showModal({  
486 - title: '提示',  
487 - content: '小程序还未有该活动,请到3.0公众号支付'  
488 - });  
489 - return false;  
490 - } 483 +
491 //要每件每件的商品进行检查,看有么有超出库存,超出限购 484 //要每件每件的商品进行检查,看有么有超出库存,超出限购
492 var good = order_goods[i], goodsbuynum = 0, promgoodsbuynum = 0, gg = null,presellList=null; 485 var good = order_goods[i], goodsbuynum = 0, promgoodsbuynum = 0, gg = null,presellList=null;
493 486
@@ -659,7 +652,7 @@ Page({ @@ -659,7 +652,7 @@ Page({
659 } 652 }
660 653
661 //商品的普通购买 ,不要进行判断 654 //商品的普通购买 ,不要进行判断
662 - if ((good.prom_type == 1 || good.prom_type == 6 || good.prom_type == 4 || good.prom_type == 8) 655 + if ((good.prom_type == 1 || good.prom_type == 2 || good.prom_type == 6 || good.prom_type == 4 || good.prom_type == 8)
663 && !good.is_gift && !good.is_collocation && !good.is_integral_normal && !good.is_pd_normal) { 656 && !good.is_gift && !good.is_collocation && !good.is_integral_normal && !good.is_pd_normal) {
664 if (gg.prom_type != good.prom_type && gg.prom_type>0) { 657 if (gg.prom_type != good.prom_type && gg.prom_type>0) {
665 var content = gg.goods_name + '商品的活动发生了变化,请取消订单重新购买'; 658 var content = gg.goods_name + '商品的活动发生了变化,请取消订单重新购买';
@@ -668,7 +661,7 @@ Page({ @@ -668,7 +661,7 @@ Page({
668 } 661 }
669 662
670 } else { 663 } else {
671 - if ((gg.prom_type == 1 || gg.prom_type == 3 || gg.prom_type == 5 || gg.prom_type == 6 || gg.prom_type == 4) 664 + 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)
672 && !good.is_collocation && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) { 665 && !good.is_collocation && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) {
673 var prom = null; 666 var prom = null;
674 //---如果是活动的时候--- 667 //---如果是活动的时候---
@@ -681,6 +674,17 @@ Page({ @@ -681,6 +674,17 @@ Page({
681 } 674 }
682 }) 675 })
683 } 676 }
  677 +
  678 + if (gg.prom_type == 2) {
  679 + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/"+ gg.goods_id + "/" + gg.prom_id, {}).then(res => {
  680 + if (res.data.code == 0) {
  681 + prom = res.data.data;
  682 + prom.price=prom.price;
  683 + }
  684 + })
  685 + }
  686 +
  687 +
684 if (gg.prom_type == 6) { 688 if (gg.prom_type == 6) {
685 await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + gg.prom_id, {}).then(res => { 689 await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + gg.prom_id, {}).then(res => {
686 if (res.data.code == 0) { 690 if (res.data.code == 0) {
@@ -785,6 +789,17 @@ Page({ @@ -785,6 +789,17 @@ Page({
785 } 789 }
786 }) 790 })
787 } 791 }
  792 +
  793 + if (goodsinfo.prom_type == 2) {
  794 + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/"+ good.goods_id + "/" + goodsinfo.prom_id, {}).then(res => {
  795 + if (res.data.code == 0) {
  796 + prom = res.data.data;
  797 + prom.price=prom.price;
  798 + }
  799 + })
  800 + }
  801 +
  802 +
788 if (goodsinfo.prom_type == 6 && !good.is_pd_normal) { 803 if (goodsinfo.prom_type == 6 && !good.is_pd_normal) {
789 await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + goodsinfo.prom_id, {}).then(res => { 804 await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + goodsinfo.prom_id, {}).then(res => {
790 if (res.data.code == 0) { 805 if (res.data.code == 0) {
@@ -826,6 +841,13 @@ Page({ @@ -826,6 +841,13 @@ Page({
826 th.toast(content); 841 th.toast(content);
827 return false; 842 return false;
828 } 843 }
  844 +
  845 + // --看一下会员的团购价格是不是发生了变化
  846 + if(goodsinfo.prom_type==2 && goodsinfo.goods_price!=prom.price){
  847 + var content=goodsinfo.goods_name+'秒杀活动的价格发生了变化';
  848 + th.toast(content);
  849 + return false;
  850 + }
829 851
830 if (goodsinfo.prom_type == 4) { 852 if (goodsinfo.prom_type == 4) {
831 if (good.goods_num > prom.limitqty - prom.buy_num) { 853 if (good.goods_num > prom.limitqty - prom.buy_num) {
@@ -834,12 +856,12 @@ Page({ @@ -834,12 +856,12 @@ Page({
834 th.toast(content); 856 th.toast(content);
835 return false; 857 return false;
836 } 858 }
837 - } else if(goodsinfo.prom_type == 1 || goodsinfo.prom_type == 2 || goodsinfo.prom_type == 6 ) { 859 + } else if(goodsinfo.prom_type == 1 || goodsinfo.prom_type == 2 || goodsinfo.prom_type == 6 ) {
838 if(order.add_time+5*60<ut.gettimestamp()) { 860 if(order.add_time+5*60<ut.gettimestamp()) {
839 var content = gg.goods_name + '该订单已经超时无法支付,请取消订单'; 861 var content = gg.goods_name + '该订单已经超时无法支付,请取消订单';
840 th.toast(content); 862 th.toast(content);
841 return false; 863 return false;
842 - } 864 + }
843 } 865 }
844 866
845 } 867 }
@@ -1163,7 +1185,6 @@ Page({ @@ -1163,7 +1185,6 @@ Page({
1163 } 1185 }
1164 }) 1186 })
1165 1187
1166 -  
1167 if(!prom) { 1188 if(!prom) {
1168 //--判断商品当前的活动情况-- 1189 //--判断商品当前的活动情况--
1169 switch (good.prom_type) { 1190 switch (good.prom_type) {
@@ -1181,6 +1202,22 @@ Page({ @@ -1181,6 +1202,22 @@ Page({
1181 b_item.price = prom.user_price; 1202 b_item.price = prom.user_price;
1182 } 1203 }
1183 break; 1204 break;
  1205 +
  1206 + case 2:
  1207 + var group = null;
  1208 + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + good.goods_id + "/" + good.prom_id, {}).then(res => {
  1209 + if (res.data.code == 0) {
  1210 + group = res.data.data;
  1211 + }
  1212 + })
  1213 + //----已经结束-----
  1214 + if (group && group.is_end == 0 && group.end_time > timestamp && group.start_time < timestamp) {
  1215 + prom = group;
  1216 + prom.price = prom.price;
  1217 + b_item.price = prom.price;
  1218 + }
  1219 + break;
  1220 +
1184 case 6: 1221 case 6:
1185 b_item.is_pd_normal = 1; 1222 b_item.is_pd_normal = 1;
1186 break; 1223 break;