Commit 90e6c0dd1d535d44de3e4c8306244a992b9647ff
1 parent
dc197526
秒杀测试的俩个问题
Showing
19 changed files
with
179 additions
and
38 deletions
components/diy_seckill/diy_seckill.js
... | ... | @@ -45,12 +45,12 @@ Component({ |
45 | 45 | var g_id = this.data.object; |
46 | 46 | this.init(g_id); |
47 | 47 | setTimeout(function () { |
48 | - if (this.data.goods_array.length > 0) { | |
48 | + if (th.data.goods_array && th.data.goods_array.length > 0) { | |
49 | 49 | th.data.timer = setInterval(function () { |
50 | 50 | th.countDown2(th); |
51 | 51 | }, 1000); |
52 | 52 | } |
53 | - },500) | |
53 | + },600) | |
54 | 54 | } |
55 | 55 | }, |
56 | 56 | ... | ... |
components/diy_seckill/diy_seckill.wxml
... | ... | @@ -20,24 +20,24 @@ |
20 | 20 | <view class='sp_top'> |
21 | 21 | <view class='po'></view> |
22 | 22 | <block wx:if="{{aitem.start_time>newTime}}"> |
23 | - <view class="rob"> | |
23 | + <view class="rob" style="justify-content: flex-start"> | |
24 | 24 | <span class='s_top_kill' style="background-color: #ffe718;color: #3c3b31;font-weight: bold">即将开始</span> |
25 | 25 | </view> |
26 | 26 | </block> |
27 | 27 | |
28 | 28 | <block wx:if="{{aitem.end_time<=newTime}}"> |
29 | - <view class="rob"> | |
29 | + <view class="rob" style="justify-content: flex-start"> | |
30 | 30 | <span class='s_top_kill gray'>活动已结束</span> |
31 | 31 | </view> |
32 | 32 | </block> |
33 | 33 | <block wx:else> |
34 | 34 | <block wx:if="{{aitem.start_time<newTime && aitem.goods_num>aitem.buy_num}}"> |
35 | - <view class="rob"> | |
35 | + <view class="rob" style="justify-content: flex-start"> | |
36 | 36 | <span class='s_top_kill'>火热进行</span> |
37 | 37 | </view> |
38 | 38 | </block> |
39 | 39 | <block wx:if="{{aitem.goods_num<=aitem.buy_num}}"> |
40 | - <view class="rob"> | |
40 | + <view class="rob" style="justify-content: flex-start"> | |
41 | 41 | <span class='s_top_kill gray'>已抢光</span> |
42 | 42 | </view> |
43 | 43 | </block> | ... | ... |
components/diy_seckill/diy_seckill.wxss
... | ... | @@ -77,13 +77,12 @@ swiper { |
77 | 77 | font-size: 24rpx; |
78 | 78 | height: 38rpx; |
79 | 79 | line-height: 38rpx; |
80 | - left: 6rpx; | |
81 | 80 | padding: 4rpx 10rpx; |
82 | 81 | border-radius: 10rpx; |
83 | 82 | z-index: 999; |
84 | 83 | position: relative; |
85 | - top: -6rpx; | |
86 | - width: 210rpx; | |
84 | + top: 1rpx; | |
85 | + width: 110rpx; | |
87 | 86 | color: #fff; |
88 | 87 | text-align: center; |
89 | 88 | } | ... | ... |
components/diy_service/diy_service.js
... | ... | @@ -36,8 +36,8 @@ Component({ |
36 | 36 | return false; |
37 | 37 | }, |
38 | 38 | |
39 | - //---------联系客服------------ | |
40 | - contactService: function() { | |
39 | + //---------联系客服------------ | |
40 | + contactService: function() { | |
41 | 41 | getApp().getConfig(function(t) { |
42 | 42 | if (t.store_tel == undefined) { |
43 | 43 | getApp().request.get("/api/weshop/store/get/" + os.stoid, { |
... | ... | @@ -57,5 +57,16 @@ Component({ |
57 | 57 | } |
58 | 58 | }); |
59 | 59 | }, |
60 | + | |
61 | + //---------联系微信客服------------ | |
62 | + con_weixin:function () { | |
63 | + var url=this.data.sys_switch.weapp_customertype_url; | |
64 | + var id=this.data.sys_switch.weapp_customertype_appid; | |
65 | + wx.openCustomerServiceChat({ | |
66 | + extInfo: {url: url}, | |
67 | + corpId: id, | |
68 | + success(res) {} | |
69 | + }) | |
70 | + } | |
60 | 71 | } |
61 | 72 | }) | ... | ... |
components/diy_service/diy_service.wxml
1 | 1 | <!--有在线客户 和 打电话--> |
2 | -<block wx:if="{{sys_switch.weapp_customertype}}"> | |
2 | +<block wx:if="{{sys_switch.weapp_customertype==1}}"> | |
3 | 3 | <!-- 判断是不是有登录 --> |
4 | 4 | <view wx:if="{{userInfo}}" class="custom-service" bindtap="go_user" > |
5 | 5 | <view style="text-align: center;"> |
... | ... | @@ -14,7 +14,16 @@ |
14 | 14 | <view class="s_title" wx:if="{{object.title!=''}}">{{object.title}}</view> |
15 | 15 | </view> |
16 | 16 | </button> |
17 | -</block> | |
17 | +</block> | |
18 | + | |
19 | +<block wx:elif="{{sys_switch.weapp_customertype==2}}"> | |
20 | + <view class="custom-service cart-ico new_split" bindtap="con_weixin"> | |
21 | + <view style="text-align: center;"> | |
22 | + <image class="cs-img" src="{{object.img}}"></image> | |
23 | + <view class="s_title" wx:if="{{object.title!=''}}">{{object.title}}</view> | |
24 | + </view> | |
25 | + </view> | |
26 | +</block> | |
18 | 27 | |
19 | 28 | <block wx:else> |
20 | 29 | <view class="custom-service cart-ico new_split" bindtap="contactService"> | ... | ... |
packageA/pages/goodsInfo/goodsInfo.js
... | ... | @@ -2209,6 +2209,17 @@ Page({ |
2209 | 2209 | flag: !this.data.flag, |
2210 | 2210 | }) |
2211 | 2211 | }, |
2212 | + | |
2213 | + //---------联系微信客服------------ | |
2214 | + con_weixin:function () { | |
2215 | + var url=this.data.sys_switch.weapp_customertype_url; | |
2216 | + var id=this.data.sys_switch.weapp_customertype_appid; | |
2217 | + wx.openCustomerServiceChat({ | |
2218 | + extInfo: {url: url}, | |
2219 | + corpId: id, | |
2220 | + success(res) {} | |
2221 | + }) | |
2222 | + } | |
2212 | 2223 | |
2213 | 2224 | |
2214 | 2225 | ... | ... |
packageA/pages/goodsInfo/goodsInfo.wxml
... | ... | @@ -160,10 +160,16 @@ |
160 | 160 | <view class="join-cart jc_sb"> |
161 | 161 | |
162 | 162 | <view class="flex"> |
163 | - <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split f1" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}" style="text-align: center"> | |
163 | + <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split f1" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}" style="text-align: center"> | |
164 | 164 | <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> |
165 | 165 | <view>客服</view> |
166 | - </button> | |
166 | + </button> | |
167 | + | |
168 | + <view wx:elif="{{sys_switch.weapp_customertype==2}}" class="custom-service cart-ico new_split f1" bindtap="con_weixin" style="text-align: center"> | |
169 | + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> | |
170 | + <view>客服</view> | |
171 | + </view> | |
172 | + | |
167 | 173 | <view wx:else class="custom-service cart-ico new_split f1" bindtap="contactService" style="text-align: center"> |
168 | 174 | <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> |
169 | 175 | <view>客服</view> | ... | ... |
packageC/pages/presell/cart/cart.js
... | ... | @@ -2529,6 +2529,40 @@ Page({ |
2529 | 2529 | }, |
2530 | 2530 | |
2531 | 2531 | |
2532 | + //---------联系客服------------ | |
2533 | + contactService: function() { | |
2534 | + getApp().getConfig(function(t) { | |
2535 | + if (t.store_tel == undefined) { | |
2536 | + getApp().request.get("/api/weshop/store/get/" + os.stoid, { | |
2537 | + isShowLoading: 1, | |
2538 | + data: {}, | |
2539 | + success: function(rs) { | |
2540 | + getApp().globalData.config = rs.data.data; | |
2541 | + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { | |
2542 | + getApp().my_warnning("商家未设置电话", 0, th); | |
2543 | + return false; | |
2544 | + } | |
2545 | + wx.makePhoneCall({ phoneNumber: rs.data.data.store_tel, }) | |
2546 | + } | |
2547 | + }) | |
2548 | + } else { | |
2549 | + wx.makePhoneCall({ phoneNumber: t.store_tel, }) | |
2550 | + } | |
2551 | + }); | |
2552 | + }, | |
2553 | + | |
2554 | + //---------联系微信客服------------ | |
2555 | + con_weixin:function () { | |
2556 | + var url=this.data.sys_switch.weapp_customertype_url; | |
2557 | + var id=this.data.sys_switch.weapp_customertype_appid; | |
2558 | + wx.openCustomerServiceChat({ | |
2559 | + extInfo: {url: url}, | |
2560 | + corpId: id, | |
2561 | + success(res) {} | |
2562 | + }) | |
2563 | + } | |
2564 | + | |
2565 | + | |
2532 | 2566 | |
2533 | 2567 | |
2534 | 2568 | ... | ... |
packageC/pages/presell/cart/cart.wxml
... | ... | @@ -647,15 +647,20 @@ |
647 | 647 | |
648 | 648 | <!-- 客服 --> |
649 | 649 | <view class="kefu-container shadow-1"> |
650 | - <block wx:if="{{sys_switch.weapp_customertype}}"> | |
651 | - <button wx:if="{{sys_switch.weapp_customertype}}" class="kefu-btn" | |
650 | + <block wx:if="{{sys_switch.weapp_customertype==1}}"> | |
651 | + <button class="kefu-btn" | |
652 | 652 | open-type="contact" |
653 | 653 | session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> |
654 | 654 | <text class="iconfont icon-kefu fs60 co-red"></text> |
655 | 655 | </button> |
656 | 656 | </block> |
657 | + | |
658 | + <block wx:elif="{{sys_switch.weapp_customertype==2}}"> | |
659 | + <text bindtap="con_weixin" class="iconfont icon-kefu fs60 co-red"></text> | |
660 | + </block> | |
661 | + | |
657 | 662 | <block wx:else> |
658 | - <text class="iconfont icon-kefu fs60 co-red"></text> | |
663 | + <text bindtap="contactService" class="iconfont icon-kefu fs60 co-red"></text> | |
659 | 664 | </block> |
660 | 665 | </view> |
661 | 666 | ... | ... |
packageC/pages/presell/goodsInfo/goodsInfo.js
... | ... | @@ -3965,6 +3965,16 @@ Page({ |
3965 | 3965 | if (func) { |
3966 | 3966 | func(); |
3967 | 3967 | } |
3968 | + }, | |
3969 | + | |
3970 | + con_weixin:function () { | |
3971 | + var url=this.data.sys_switch.weapp_customertype_url; | |
3972 | + var id=this.data.sys_switch.weapp_customertype_appid; | |
3973 | + wx.openCustomerServiceChat({ | |
3974 | + extInfo: {url: url}, | |
3975 | + corpId: id, | |
3976 | + success(res) {} | |
3977 | + }) | |
3968 | 3978 | } |
3969 | 3979 | |
3970 | 3980 | }); | ... | ... |
packageC/pages/presell/goodsInfo/goodsInfo.wxml
... | ... | @@ -482,10 +482,16 @@ |
482 | 482 | <!-- -----------------底部按钮------------------ --> |
483 | 483 | <view class="join-cart"> |
484 | 484 | <!-- bindtap="contactService" --> |
485 | - <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> | |
485 | + <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> | |
486 | 486 | <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> |
487 | 487 | <view>客服</view> |
488 | 488 | </button> |
489 | + | |
490 | + <view wx:elif="{{sys_switch.weapp_customertype==2}}" class="custom-service cart-ico new_split" bindtap="con_weixin"> | |
491 | + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> | |
492 | + <view>客服</view> | |
493 | + </view> | |
494 | + | |
489 | 495 | <view wx:else class="custom-service cart-ico new_split" bindtap="contactService"> |
490 | 496 | <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> |
491 | 497 | <view>客服</view> | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -2976,9 +2976,21 @@ Page({ |
2976 | 2976 | return false; |
2977 | 2977 | } |
2978 | 2978 | |
2979 | + if (prom_type == 1 && prom_id==0){ | |
2980 | + this.setData({ | |
2981 | + prom_type: 0,isshow: 1, | |
2982 | + }); | |
2983 | + | |
2984 | + //获取门店 | |
2985 | + this.get_sto(); | |
2986 | + this.get_sku(o.stoid, this.data.data, gid); | |
2987 | + this.check_has_flash(); | |
2988 | + return false; | |
2989 | + } | |
2990 | + | |
2979 | 2991 | //if (prom_type != 3 && prom_type!=0){ |
2980 | 2992 | //---判断秒杀---- |
2981 | - if (prom_type == 1) { | |
2993 | + if (prom_type == 1 && prom_id>0) { | |
2982 | 2994 | //-------判断活动是否抢光--------- |
2983 | 2995 | await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, { |
2984 | 2996 | 1: 1 |
... | ... | @@ -5754,6 +5766,16 @@ Page({ |
5754 | 5766 | |
5755 | 5767 | close_pop_more:function () { |
5756 | 5768 | this.setData({is_pop_more:0}) |
5769 | + }, | |
5770 | + | |
5771 | + con_weixin:function () { | |
5772 | + var url=this.data.sys_switch.weapp_customertype_url; | |
5773 | + var id=this.data.sys_switch.weapp_customertype_appid; | |
5774 | + wx.openCustomerServiceChat({ | |
5775 | + extInfo: {url: url}, | |
5776 | + corpId: id, | |
5777 | + success(res) {} | |
5778 | + }) | |
5757 | 5779 | } |
5758 | 5780 | |
5759 | 5781 | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
... | ... | @@ -905,10 +905,16 @@ |
905 | 905 | <!-- -----------------底部按钮------------------ --> |
906 | 906 | <view class="join-cart"> |
907 | 907 | <!-- bindtap="contactService" --> |
908 | - <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> | |
908 | + <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> | |
909 | 909 | <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> |
910 | 910 | <view>客服</view> |
911 | 911 | </button> |
912 | + | |
913 | + <view wx:elif="{{sys_switch.weapp_customertype==2}}" class="custom-service cart-ico new_split" bindtap="con_weixin"> | |
914 | + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> | |
915 | + <view>客服</view> | |
916 | + </view> | |
917 | + | |
912 | 918 | <view wx:else class="custom-service cart-ico new_split" bindtap="contactService"> |
913 | 919 | <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> |
914 | 920 | <view>客服</view> | ... | ... |
pages/goods/goodsList/g_filter.wxs
... | ... | @@ -85,7 +85,7 @@ var g_filters = { |
85 | 85 | if(item.prom_type==8){ |
86 | 86 | url1="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id |
87 | 87 | } |
88 | - if(item.prom_type==1){ | |
88 | + if(item.prom_type==1 && item.prom_id>0 ){ | |
89 | 89 | url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id+"&prom_type=1"; |
90 | 90 | } |
91 | 91 | return url1; | ... | ... |
pages/goods/search/g_filter.wxs
... | ... | @@ -88,7 +88,7 @@ var g_filters = { |
88 | 88 | if(item.prom_type==8){ |
89 | 89 | url1="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id |
90 | 90 | } |
91 | - if(item.prom_type==1){ | |
91 | + if(item.prom_type==1 && item.prom_id>0){ | |
92 | 92 | url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id+"&prom_type=1"; |
93 | 93 | } |
94 | 94 | return url1; | ... | ... |
pages/user/index/index.js
... | ... | @@ -840,8 +840,19 @@ Page({ |
840 | 840 | } |
841 | 841 | }) |
842 | 842 | }, |
843 | - | |
844 | - | |
845 | - | |
843 | + | |
844 | + con_weixin:function () { | |
845 | + var url=this.data.sys_switch.weapp_customertype_url; | |
846 | + var id=this.data.sys_switch.weapp_customertype_appid; | |
847 | + wx.openCustomerServiceChat({ | |
848 | + extInfo: {url: url}, | |
849 | + corpId: id, | |
850 | + success(res) {} | |
851 | + }) | |
852 | + } | |
853 | + | |
854 | + | |
855 | + | |
856 | + | |
846 | 857 | |
847 | 858 | }) | ... | ... |
pages/user/index/index.wxml
... | ... | @@ -252,10 +252,16 @@ |
252 | 252 | <!-- 没有链接地址的时候 --> |
253 | 253 | <block wx:else> |
254 | 254 | <block wx:if="{{item.name=='联系客服'}}"> |
255 | - <button class="item t-c" wx:if="{{sys_switch.weapp_customertype}}" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> | |
255 | + <button class="item t-c" wx:if="{{sys_switch.weapp_customertype==1}}" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> | |
256 | 256 | <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image> |
257 | 257 | <view class="fs26">联系客服</view> |
258 | - </button> | |
258 | + </button> | |
259 | + | |
260 | + <view class="item t-c" bindtap="con_weixin" wx:elif="{{sys_switch.weapp_customertype==2}}"> | |
261 | + <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image> | |
262 | + <view class="fs26">联系客服</view> | |
263 | + </view> | |
264 | + | |
259 | 265 | <view class="item t-c" bindtap="contactService" wx:else> |
260 | 266 | <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image> |
261 | 267 | <view class="fs26">联系客服</view> | ... | ... |
pages/user/order_detail/order_detail.js
... | ... | @@ -1431,7 +1431,17 @@ Page({ |
1431 | 1431 | icon: 'none', |
1432 | 1432 | duration: 3000 |
1433 | 1433 | }) |
1434 | - } | |
1434 | + }, | |
1435 | + | |
1436 | + con_weixin:function () { | |
1437 | + var url=this.data.sys_switch.weapp_customertype_url; | |
1438 | + var id=this.data.sys_switch.weapp_customertype_appid; | |
1439 | + wx.openCustomerServiceChat({ | |
1440 | + extInfo: {url: url}, | |
1441 | + corpId: id, | |
1442 | + success(res) {} | |
1443 | + }) | |
1444 | + } | |
1435 | 1445 | |
1436 | 1446 | |
1437 | 1447 | ... | ... |
pages/user/order_detail/order_detail.wxml
... | ... | @@ -53,15 +53,10 @@ |
53 | 53 | <view class="order-operate"> |
54 | 54 | <view bindtap="checkTeam" class="contact-us check-btn" wx:if="{{optionIsGoup}}">查看拼团详情</view> |
55 | 55 | <view> |
56 | - <!-- <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> --> | |
57 | - <!-- <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> | |
58 | - <view></view> --> | |
59 | - <!-- </button> --> | |
60 | - <button wx:if="{{sys_switch.weapp_customertype}}" class="contact-us goods-btn" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">联系客服</button> | |
61 | - <!-- <view wx:else class="custom-service cart-ico new_split" bindtap="contactService"> | |
62 | - <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> | |
63 | - <view>联系客服</view> | |
64 | - </view> --> | |
56 | + | |
57 | + <button wx:if="{{sys_switch.weapp_customertype==1}}" class="contact-us goods-btn" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">联系客服</button> | |
58 | + | |
59 | + <view wx:elif="{{sys_switch.weapp_customertype==2}}" bindtap="con_weixin" class="contact-us goods-btn">联系客服</view> | |
65 | 60 | <view wx:else bindtap="contactService" class="contact-us goods-btn">联系客服</view> |
66 | 61 | </view> |
67 | 62 | <!-- <view bindtap="contactService" class="contact-us goods-btn">联系客服</view> --> | ... | ... |