Commit 7838790c0188c56a29efc23e6152b7c3ed98d6e1
1 parent
c7673a38
OA单的优化
Showing
18 changed files
with
250 additions
and
137 deletions
components/com_servicer/com_servicer.wxml
@@ -21,6 +21,13 @@ | @@ -21,6 +21,13 @@ | ||
21 | <text class="iconfont icon-kefu1"></text>在线客服 | 21 | <text class="iconfont icon-kefu1"></text>在线客服 |
22 | </view> | 22 | </view> |
23 | </block> | 23 | </block> |
24 | + <!-- 商城客服 --> | ||
25 | + <block wx:elif="{{sys_switch.weapp_customertype == 3}}"> | ||
26 | + <view class="pd20 bdt fs30 btn2" bindtap="customer_chat"> | ||
27 | + <text class="iconfont icon-kefu1"></text>在线客服 | ||
28 | + </view> | ||
29 | + </block> | ||
30 | + | ||
24 | </view> | 31 | </view> |
25 | 32 | ||
26 | <view class="mask2" bindtap="closeCS"></view> | 33 | <view class="mask2" bindtap="closeCS"></view> |
27 | \ No newline at end of file | 34 | \ No newline at end of file |
packageA/pages/goodsInfo/goodsInfo.js
@@ -227,7 +227,7 @@ Page({ | @@ -227,7 +227,7 @@ Page({ | ||
227 | }, | 227 | }, |
228 | 228 | ||
229 | //------初始化加载---------- | 229 | //------初始化加载---------- |
230 | - onLoad:function(t) { | 230 | + onLoad:async function(t) { |
231 | self = this; | 231 | self = this; |
232 | 232 | ||
233 | this.setData({ | 233 | this.setData({ |
@@ -317,7 +317,16 @@ Page({ | @@ -317,7 +317,16 @@ Page({ | ||
317 | 317 | ||
318 | getApp().getConfig(function(e) { | 318 | getApp().getConfig(function(e) { |
319 | ee.setData({sto_sele_name_1:e.store_name}) | 319 | ee.setData({sto_sele_name_1:e.store_name}) |
320 | - }) | 320 | + }) |
321 | + | ||
322 | + var is_chat=0; | ||
323 | + await getApp().request.promiseGet("/api/weshop/recharge/storageRechargeDetail/get/1", { | ||
324 | + | ||
325 | + }).then(res => { | ||
326 | + if(res && res.data.code==0 && res.data.data){ | ||
327 | + is_chat=1; | ||
328 | + } | ||
329 | + }) | ||
321 | 330 | ||
322 | //----获取系统参数----- | 331 | //----获取系统参数----- |
323 | getApp().getConfig2(function (e) { | 332 | getApp().getConfig2(function (e) { |
@@ -343,6 +352,12 @@ Page({ | @@ -343,6 +352,12 @@ Page({ | ||
343 | } | 352 | } |
344 | // console.log(e); | 353 | // console.log(e); |
345 | var json_d = JSON.parse(e.switch_list); | 354 | var json_d = JSON.parse(e.switch_list); |
355 | + | ||
356 | + //如果商家未开通在线客服的话 | ||
357 | + if(json_d && json_d.weapp_customertype==3 && !is_chat){ | ||
358 | + json_d.weapp_customertype=0 | ||
359 | + } | ||
360 | + | ||
346 | ee.setData({ | 361 | ee.setData({ |
347 | store_config: e, | 362 | store_config: e, |
348 | sys_switch: json_d, | 363 | sys_switch: json_d, |
@@ -2838,16 +2853,13 @@ Page({ | @@ -2838,16 +2853,13 @@ Page({ | ||
2838 | }) | 2853 | }) |
2839 | }, | 2854 | }, |
2840 | 2855 | ||
2841 | - //---------联系微信客服------------ | ||
2842 | - con_weixin:function () { | ||
2843 | - var url=this.data.sys_switch.weapp_customertype_url; | ||
2844 | - var id=this.data.sys_switch.weapp_customertype_appid; | ||
2845 | - wx.openCustomerServiceChat({ | ||
2846 | - extInfo: {url: url}, | ||
2847 | - corpId: id, | ||
2848 | - success(res) {} | ||
2849 | - }) | ||
2850 | - }, | 2856 | + con_weixin: function () { |
2857 | + getApp().con_wx(this); | ||
2858 | + }, | ||
2859 | + | ||
2860 | + customer_chat:function(){ | ||
2861 | + getApp().customer_chat(this.data.data.id,1); | ||
2862 | + }, | ||
2851 | 2863 | ||
2852 | //评论的调用 | 2864 | //评论的调用 |
2853 | requestComments_new: async function () { | 2865 | requestComments_new: async function () { |
packageA/pages/goodsInfo/goodsInfo.wxml
@@ -1017,30 +1017,7 @@ | @@ -1017,30 +1017,7 @@ | ||
1017 | 1017 | ||
1018 | 1018 | ||
1019 | <!-- 联系客服操作菜单 --> | 1019 | <!-- 联系客服操作菜单 --> |
1020 | -<view class="action {{!hiddenCS ? 'active':''}}" hidden="{{hiddenCS}}"> | ||
1021 | - <view class="pd20 t-c pr"> | ||
1022 | - <text class="bold">联系客服</text> | ||
1023 | - <text class="iconfont icon-guan" bindtap="closeCS"></text> | ||
1024 | - </view> | ||
1025 | - <!-- 客服热线 --> | ||
1026 | - <view class="pd20 bdt fs30 btn2" bindtap="contactService" wx:if="{{store_tel}}"> | ||
1027 | - <text class="iconfont icon-dianhua"></text>客服热线: | ||
1028 | - <text class="c-red">{{store_tel}}</text> | ||
1029 | - </view> | ||
1030 | - <!-- 小程序客服 --> | ||
1031 | - <block wx:if="{{sys_switch.weapp_customertype == 1}}"> | ||
1032 | - <button class="pd20 bdt fs30 btn2" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> | ||
1033 | - <text class="iconfont icon-kefu1"></text>在线客服 | ||
1034 | - </button> | ||
1035 | - </block> | ||
1036 | - <!-- 微信客服 --> | ||
1037 | - <block wx:elif="{{sys_switch.weapp_customertype == 2}}"> | ||
1038 | - <view class="pd20 bdt fs30 btn2" bindtap="con_weixin"> | ||
1039 | - <text class="iconfont icon-kefu1"></text>在线客服 | ||
1040 | - </view> | ||
1041 | - </block> | ||
1042 | -</view> | 1020 | +<include src="../../../components/com_servicer/com_servicer.wxml"></include> |
1043 | 1021 | ||
1044 | -<view class="mask2" bindtap="closeCS"></view> | ||
1045 | <!-- 分享控件,底部弹出 --> | 1022 | <!-- 分享控件,底部弹出 --> |
1046 | <share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageFn" wx:if="{{share_hidden}}"></share> | 1023 | <share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageFn" wx:if="{{share_hidden}}"></share> |
packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js
@@ -310,6 +310,15 @@ Page({ | @@ -310,6 +310,15 @@ Page({ | ||
310 | ee.setData({sto_sele_name_1: e.store_name}) | 310 | ee.setData({sto_sele_name_1: e.store_name}) |
311 | }) | 311 | }) |
312 | 312 | ||
313 | + var is_chat=0; | ||
314 | + await getApp().request.promiseGet("/api/weshop/recharge/storageRechargeDetail/get/1", { | ||
315 | + | ||
316 | + }).then(res => { | ||
317 | + if(res && res.data.code==0 && res.data.data){ | ||
318 | + is_chat=1; | ||
319 | + } | ||
320 | + }) | ||
321 | + | ||
313 | //----获取系统参数----- | 322 | //----获取系统参数----- |
314 | getApp().getConfig2(function (e) { | 323 | getApp().getConfig2(function (e) { |
315 | ee.setData({ | 324 | ee.setData({ |
@@ -334,6 +343,11 @@ Page({ | @@ -334,6 +343,11 @@ Page({ | ||
334 | } | 343 | } |
335 | 344 | ||
336 | var json_d = JSON.parse(e.switch_list); | 345 | var json_d = JSON.parse(e.switch_list); |
346 | + | ||
347 | + //如果商家未开通在线客服的话 | ||
348 | + if(json_d && json_d.weapp_customertype==3 && !is_chat){ | ||
349 | + json_d.weapp_customertype=0 | ||
350 | + } | ||
337 | ee.setData({ | 351 | ee.setData({ |
338 | store_config: e, | 352 | store_config: e, |
339 | sys_switch: json_d, | 353 | sys_switch: json_d, |
@@ -2620,16 +2634,12 @@ Page({ | @@ -2620,16 +2634,12 @@ Page({ | ||
2620 | }) | 2634 | }) |
2621 | }, | 2635 | }, |
2622 | 2636 | ||
2623 | - //---------联系微信客服------------ | ||
2624 | con_weixin: function () { | 2637 | con_weixin: function () { |
2625 | - var url = this.data.sys_switch.weapp_customertype_url; | ||
2626 | - var id = this.data.sys_switch.weapp_customertype_appid; | ||
2627 | - wx.openCustomerServiceChat({ | ||
2628 | - extInfo: {url: url}, | ||
2629 | - corpId: id, | ||
2630 | - success(res) { | ||
2631 | - } | ||
2632 | - }) | 2638 | + getApp().con_wx(this); |
2639 | + }, | ||
2640 | + | ||
2641 | + customer_chat:function(){ | ||
2642 | + getApp().customer_chat(this.data.data.id,1); | ||
2633 | }, | 2643 | }, |
2634 | 2644 | ||
2635 | //评论的调用 | 2645 | //评论的调用 |
packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml
@@ -826,32 +826,8 @@ | @@ -826,32 +826,8 @@ | ||
826 | </view> | 826 | </view> |
827 | </view> | 827 | </view> |
828 | 828 | ||
829 | -<!-- 联系客服操作菜单 --> | ||
830 | -<view class="action {{!hiddenCS ? 'active':''}}" hidden="{{hiddenCS}}"> | ||
831 | - <view class="pd20 t-c pr"> | ||
832 | - <text class="bold">联系客服</text> | ||
833 | - <text class="iconfont icon-guan" bindtap="closeCS"></text> | ||
834 | - </view> | ||
835 | - <!-- 客服热线 --> | ||
836 | - <view class="pd20 bdt fs30 btn2" bindtap="contactService" wx:if="{{store_tel}}"> | ||
837 | - <text class="iconfont icon-dianhua"></text>客服热线: | ||
838 | - <text class="c-red">{{store_tel}}</text> | ||
839 | - </view> | ||
840 | - <!-- 小程序客服 --> | ||
841 | - <block wx:if="{{sys_switch.weapp_customertype == 1}}"> | ||
842 | - <button class="pd20 bdt fs30 btn2" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> | ||
843 | - <text class="iconfont icon-kefu1"></text>在线客服 | ||
844 | - </button> | ||
845 | - </block> | ||
846 | - <!-- 微信客服 --> | ||
847 | - <block wx:elif="{{sys_switch.weapp_customertype == 2}}"> | ||
848 | - <view class="pd20 bdt fs30 btn2" bindtap="con_weixin"> | ||
849 | - <text class="iconfont icon-kefu1"></text>在线客服 | ||
850 | - </view> | ||
851 | - </block> | ||
852 | -</view> | ||
853 | - | ||
854 | -<view class="mask2" bindtap="closeCS"></view> | 829 | + <!-- 联系客服操作菜单 --> |
830 | +<include src="../../../../components/com_servicer/com_servicer.wxml"></include> | ||
855 | 831 | ||
856 | <!-- --弹起来,选择规格数量,拼单商品购买---- --> | 832 | <!-- --弹起来,选择规格数量,拼单商品购买---- --> |
857 | <view hidden="{{!openSpecModal_pt}}"> | 833 | <view hidden="{{!openSpecModal_pt}}"> |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
@@ -306,7 +306,7 @@ Page({ | @@ -306,7 +306,7 @@ Page({ | ||
306 | }, | 306 | }, |
307 | 307 | ||
308 | //------初始化加载---------- | 308 | //------初始化加载---------- |
309 | - onLoad: function (t) { | 309 | + onLoad: async function (t) { |
310 | self = this; | 310 | self = this; |
311 | // console.log('onload'); | 311 | // console.log('onload'); |
312 | if (t && t.group_id) { | 312 | if (t && t.group_id) { |
@@ -459,6 +459,15 @@ Page({ | @@ -459,6 +459,15 @@ Page({ | ||
459 | ee.setData({ sto_sele_name_1: e.store_name }) | 459 | ee.setData({ sto_sele_name_1: e.store_name }) |
460 | }) | 460 | }) |
461 | 461 | ||
462 | + var is_chat=0; | ||
463 | + await getApp().request.promiseGet("/api/weshop/recharge/storageRechargeDetail/get/1", { | ||
464 | + | ||
465 | + }).then(res => { | ||
466 | + if(res && res.data.code==0 && res.data.data){ | ||
467 | + is_chat=1; | ||
468 | + } | ||
469 | + }) | ||
470 | + | ||
462 | //----获取系统参数----- | 471 | //----获取系统参数----- |
463 | getApp().getConfig2(function (e) { | 472 | getApp().getConfig2(function (e) { |
464 | ee.setData({ | 473 | ee.setData({ |
@@ -483,6 +492,12 @@ Page({ | @@ -483,6 +492,12 @@ Page({ | ||
483 | } | 492 | } |
484 | // console.log(e); | 493 | // console.log(e); |
485 | var json_d = JSON.parse(e.switch_list); | 494 | var json_d = JSON.parse(e.switch_list); |
495 | + | ||
496 | + //如果商家未开通在线客服的话 | ||
497 | + if(json_d && json_d.weapp_customertype==3 && !is_chat){ | ||
498 | + json_d.weapp_customertype=0 | ||
499 | + } | ||
500 | + | ||
486 | ee.setData({ | 501 | ee.setData({ |
487 | store_config: e, | 502 | store_config: e, |
488 | sys_switch: json_d, | 503 | sys_switch: json_d, |
@@ -2141,11 +2156,11 @@ Page({ | @@ -2141,11 +2156,11 @@ Page({ | ||
2141 | // }); | 2156 | // }); |
2142 | getApp().my_warnning('超出商品限购', 0, th); | 2157 | getApp().my_warnning('超出商品限购', 0, th); |
2143 | l_num = th.data.sele_g.viplimited - gd_buy_num; | 2158 | l_num = th.data.sele_g.viplimited - gd_buy_num; |
2144 | - if (l_num < 0) l_num = 0; | ||
2145 | - //th.setData({ goodsInputNum: num }) | ||
2146 | - //return false; | ||
2147 | - is_show_bs=1; | 2159 | + if (l_num <= 0) l_num = 1; |
2160 | + th.setData({ goodsInputNum: l_num }) | ||
2161 | + return false; | ||
2148 | } | 2162 | } |
2163 | + is_show_bs=1; | ||
2149 | } | 2164 | } |
2150 | 2165 | ||
2151 | //--判断商品是否超出活动限购-- | 2166 | //--判断商品是否超出活动限购-- |
@@ -4446,7 +4461,8 @@ Page({ | @@ -4446,7 +4461,8 @@ Page({ | ||
4446 | store_id: os.stoid, | 4461 | store_id: os.stoid, |
4447 | user_id: user_id, | 4462 | user_id: user_id, |
4448 | goods_id: gd.goods_id, | 4463 | goods_id: gd.goods_id, |
4449 | - isnew:1 | 4464 | + isnew:1, |
4465 | + timetype:gd.viplimited_timetype | ||
4450 | }, | 4466 | }, |
4451 | success: function (t) { | 4467 | success: function (t) { |
4452 | if (t.data.code == 0) { | 4468 | if (t.data.code == 0) { |
@@ -4725,7 +4741,7 @@ Page({ | @@ -4725,7 +4741,7 @@ Page({ | ||
4725 | }); | 4741 | }); |
4726 | 4742 | ||
4727 | var num = th.data.prom_buy_limit - th.data.prom_buy_num; | 4743 | var num = th.data.prom_buy_limit - th.data.prom_buy_num; |
4728 | - if (num < 0) num = 0; | 4744 | + if (num <= 0) num = 1; |
4729 | th.setData({goodsInputNum: num}) | 4745 | th.setData({goodsInputNum: num}) |
4730 | return false; | 4746 | return false; |
4731 | } | 4747 | } |
@@ -7146,6 +7162,10 @@ Page({ | @@ -7146,6 +7162,10 @@ Page({ | ||
7146 | getApp().con_wx(this); | 7162 | getApp().con_wx(this); |
7147 | }, | 7163 | }, |
7148 | 7164 | ||
7165 | + customer_chat:function(){ | ||
7166 | + var gid=this.data.front_g.goods_id; | ||
7167 | + getApp().customer_chat(gid); | ||
7168 | + }, | ||
7149 | 7169 | ||
7150 | // 显示幸运购规则 | 7170 | // 显示幸运购规则 |
7151 | showRules: function () { | 7171 | showRules: function () { |
packageC/pages/presell/cardInfo/goodsInfo.js
@@ -229,7 +229,7 @@ Page({ | @@ -229,7 +229,7 @@ Page({ | ||
229 | }, | 229 | }, |
230 | 230 | ||
231 | //------初始化加载---------- | 231 | //------初始化加载---------- |
232 | - onLoad:function(t) { | 232 | + onLoad:async function(t) { |
233 | self = this; | 233 | self = this; |
234 | 234 | ||
235 | this.setData({ | 235 | this.setData({ |
@@ -338,6 +338,15 @@ Page({ | @@ -338,6 +338,15 @@ Page({ | ||
338 | ee.setData({sto_sele_name_1:e.store_name}) | 338 | ee.setData({sto_sele_name_1:e.store_name}) |
339 | }) | 339 | }) |
340 | 340 | ||
341 | + var is_chat=0; | ||
342 | + await getApp().request.promiseGet("/api/weshop/recharge/storageRechargeDetail/get/1", { | ||
343 | + | ||
344 | + }).then(res => { | ||
345 | + if(res && res.data.code==0 && res.data.data){ | ||
346 | + is_chat=1; | ||
347 | + } | ||
348 | + }) | ||
349 | + | ||
341 | //----获取系统参数----- | 350 | //----获取系统参数----- |
342 | getApp().getConfig2(function (e) { | 351 | getApp().getConfig2(function (e) { |
343 | ee.setData({ | 352 | ee.setData({ |
@@ -362,6 +371,12 @@ Page({ | @@ -362,6 +371,12 @@ Page({ | ||
362 | } | 371 | } |
363 | // console.log(e); | 372 | // console.log(e); |
364 | var json_d = JSON.parse(e.switch_list); | 373 | var json_d = JSON.parse(e.switch_list); |
374 | + | ||
375 | + //如果商家未开通在线客服的话 | ||
376 | + if(json_d && json_d.weapp_customertype==3 && !is_chat){ | ||
377 | + json_d.weapp_customertype=0 | ||
378 | + } | ||
379 | + | ||
365 | ee.setData({ | 380 | ee.setData({ |
366 | store_config: e, | 381 | store_config: e, |
367 | sys_switch: json_d, | 382 | sys_switch: json_d, |
@@ -2596,15 +2611,12 @@ Page({ | @@ -2596,15 +2611,12 @@ Page({ | ||
2596 | }) | 2611 | }) |
2597 | }, | 2612 | }, |
2598 | 2613 | ||
2599 | - //---------联系微信客服------------ | ||
2600 | - con_weixin:function () { | ||
2601 | - var url=this.data.sys_switch.weapp_customertype_url; | ||
2602 | - var id=this.data.sys_switch.weapp_customertype_appid; | ||
2603 | - wx.openCustomerServiceChat({ | ||
2604 | - extInfo: {url: url}, | ||
2605 | - corpId: id, | ||
2606 | - success(res) {} | ||
2607 | - }) | 2614 | + con_weixin: function () { |
2615 | + getApp().con_wx(this); | ||
2616 | + }, | ||
2617 | + | ||
2618 | + customer_chat:function(){ | ||
2619 | + getApp().customer_chat(this.data.data.id,1); | ||
2608 | }, | 2620 | }, |
2609 | 2621 | ||
2610 | //评论的调用 | 2622 | //评论的调用 |
packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -274,7 +274,7 @@ Page({ | @@ -274,7 +274,7 @@ Page({ | ||
274 | }, | 274 | }, |
275 | 275 | ||
276 | //------初始化加载---------- | 276 | //------初始化加载---------- |
277 | - onLoad: function (t) { | 277 | + onLoad: async function (t) { |
278 | self = this; | 278 | self = this; |
279 | var ee = this, that = ee, th = ee, | 279 | var ee = this, that = ee, th = ee, |
280 | pre_id = t.pre_id, | 280 | pre_id = t.pre_id, |
@@ -389,6 +389,17 @@ Page({ | @@ -389,6 +389,17 @@ Page({ | ||
389 | ee.setData({ sto_sele_name_1: e.store_name }) | 389 | ee.setData({ sto_sele_name_1: e.store_name }) |
390 | }) | 390 | }) |
391 | 391 | ||
392 | + | ||
393 | + var is_chat=0; | ||
394 | + await getApp().request.promiseGet("/api/weshop/recharge/storageRechargeDetail/get/1", { | ||
395 | + | ||
396 | + }).then(res => { | ||
397 | + if(res && res.data.code==0 && res.data.data){ | ||
398 | + is_chat=1; | ||
399 | + } | ||
400 | + }) | ||
401 | + | ||
402 | + | ||
392 | //----获取系统参数----- | 403 | //----获取系统参数----- |
393 | getApp().getConfig2(function (e) { | 404 | getApp().getConfig2(function (e) { |
394 | ee.setData({ | 405 | ee.setData({ |
@@ -413,6 +424,12 @@ Page({ | @@ -413,6 +424,12 @@ Page({ | ||
413 | } | 424 | } |
414 | 425 | ||
415 | var json_d = JSON.parse(e.switch_list); | 426 | var json_d = JSON.parse(e.switch_list); |
427 | + | ||
428 | + //如果商家未开通在线客服的话 | ||
429 | + if(json_d && json_d.weapp_customertype==3 && !is_chat){ | ||
430 | + json_d.weapp_customertype=0 | ||
431 | + } | ||
432 | + | ||
416 | ee.setData({ | 433 | ee.setData({ |
417 | store_config: e, | 434 | store_config: e, |
418 | sys_switch: json_d, | 435 | sys_switch: json_d, |
@@ -1383,7 +1400,7 @@ Page({ | @@ -1383,7 +1400,7 @@ Page({ | ||
1383 | }); | 1400 | }); |
1384 | 1401 | ||
1385 | var num = th.data.sele_g.viplimited - gd_buy_num; | 1402 | var num = th.data.sele_g.viplimited - gd_buy_num; |
1386 | - if (num < 0) num = 0; | 1403 | + if (num <=0) num = 1; |
1387 | th.setData({ goodsInputNum: num }) | 1404 | th.setData({ goodsInputNum: num }) |
1388 | return false; | 1405 | return false; |
1389 | } | 1406 | } |
@@ -2931,7 +2948,8 @@ Page({ | @@ -2931,7 +2948,8 @@ Page({ | ||
2931 | store_id: os.stoid, | 2948 | store_id: os.stoid, |
2932 | user_id: user_id, | 2949 | user_id: user_id, |
2933 | goods_id: gd.goods_id, | 2950 | goods_id: gd.goods_id, |
2934 | - isnew:1 | 2951 | + isnew:1, |
2952 | + timetype:gd.viplimited_timetype | ||
2935 | }, | 2953 | }, |
2936 | success: function (t) { | 2954 | success: function (t) { |
2937 | if (t.data.code == 0) { | 2955 | if (t.data.code == 0) { |
@@ -4884,6 +4902,11 @@ Page({ | @@ -4884,6 +4902,11 @@ Page({ | ||
4884 | getApp().con_wx(this); | 4902 | getApp().con_wx(this); |
4885 | }, | 4903 | }, |
4886 | 4904 | ||
4905 | + customer_chat:function(){ | ||
4906 | + var gid=this.data.sele_g.goods_id; | ||
4907 | + getApp().customer_chat(gid); | ||
4908 | +}, | ||
4909 | + | ||
4887 | // 预览海报 | 4910 | // 预览海报 |
4888 | previewPoster() { | 4911 | previewPoster() { |
4889 | getApp().globalData.no_clear = 1; | 4912 | getApp().globalData.no_clear = 1; |
packageG/pages/customer_chat/customer_chat.js
0 → 100644
1 | +// packageG/pages/customer_chat/customer_chat.js | ||
2 | +var os = getApp().globalData.setting; | ||
3 | +var ut = require("../../../utils/util.js"); | ||
4 | + | ||
5 | +Page({ | ||
6 | + | ||
7 | + /** | ||
8 | + * 页面的初始数据 | ||
9 | + */ | ||
10 | + data: { | ||
11 | + chatUrl:'', // 聊天页面地址 | ||
12 | + }, | ||
13 | + /** | ||
14 | + * 生命周期函数--监听页面加载 | ||
15 | + */ | ||
16 | + onLoad(options) { | ||
17 | + let goods_id=options.goods_id; | ||
18 | + let type=options.type; | ||
19 | + let user_id=getApp().globalData.user_id; | ||
20 | + if(!user_id){ | ||
21 | + ut.m_toast("请先登录") | ||
22 | + setTimeout(()=> { | ||
23 | + getApp().goto("/packageE/pages/togoin/togoin") | ||
24 | + },2000) | ||
25 | + return false; | ||
26 | + } | ||
27 | + | ||
28 | + let url= os.h5_host+"/mchat/mbchat/index?goods_id="+goods_id+"&stoid="+os.stoid+"&user_id="+user_id; | ||
29 | + if(type) | ||
30 | + url= os.h5_host+"/mchat/mbchat/index?card_id="+goods_id+"&stoid="+os.stoid+"&user_id="+user_id; | ||
31 | + | ||
32 | + console.log("chat"+url); | ||
33 | + this.setData({ | ||
34 | + chatUrl:url | ||
35 | + }) | ||
36 | + | ||
37 | + }, | ||
38 | + | ||
39 | + | ||
40 | + /** | ||
41 | + * 生命周期函数--监听页面显示 | ||
42 | + */ | ||
43 | + onShow() { | ||
44 | + | ||
45 | + }, | ||
46 | + | ||
47 | + /** | ||
48 | + * 生命周期函数--监听页面隐藏 | ||
49 | + */ | ||
50 | + onHide() { | ||
51 | + | ||
52 | + } | ||
53 | + | ||
54 | +}) | ||
0 | \ No newline at end of file | 55 | \ No newline at end of file |
packageG/pages/customer_chat/customer_chat.json
0 → 100644
packageG/pages/customer_chat/customer_chat.wxml
0 → 100644
1 | +<web-view src="{{chatUrl}}"></web-view> |
packageG/pages/customer_chat/customer_chat.wxss
0 → 100644
packageG/pages/group_buy/goodsInfo/goodsInfo.js
@@ -226,7 +226,7 @@ Page({ | @@ -226,7 +226,7 @@ Page({ | ||
226 | }, | 226 | }, |
227 | 227 | ||
228 | //------初始化加载---------- | 228 | //------初始化加载---------- |
229 | - onLoad: function (t) { | 229 | + onLoad:async function (t) { |
230 | self = this; | 230 | self = this; |
231 | 231 | ||
232 | 232 | ||
@@ -308,6 +308,15 @@ Page({ | @@ -308,6 +308,15 @@ Page({ | ||
308 | ee.setData({sto_sele_name_1: e.store_name}) | 308 | ee.setData({sto_sele_name_1: e.store_name}) |
309 | }) | 309 | }) |
310 | 310 | ||
311 | + var is_chat=0; | ||
312 | + await getApp().request.promiseGet("/api/weshop/recharge/storageRechargeDetail/get/1", { | ||
313 | + | ||
314 | + }).then(res => { | ||
315 | + if(res && res.data.code==0 && res.data.data){ | ||
316 | + is_chat=1; | ||
317 | + } | ||
318 | + }) | ||
319 | + | ||
311 | //----获取系统参数----- | 320 | //----获取系统参数----- |
312 | getApp().getConfig2(function (e) { | 321 | getApp().getConfig2(function (e) { |
313 | ee.setData({ | 322 | ee.setData({ |
@@ -332,6 +341,10 @@ Page({ | @@ -332,6 +341,10 @@ Page({ | ||
332 | } | 341 | } |
333 | // console.log(e); | 342 | // console.log(e); |
334 | var json_d = JSON.parse(e.switch_list); | 343 | var json_d = JSON.parse(e.switch_list); |
344 | + //如果商家未开通在线客服的话 | ||
345 | + if(json_d && json_d.weapp_customertype==3 && !is_chat){ | ||
346 | + json_d.weapp_customertype=0 | ||
347 | + } | ||
335 | ee.setData({ | 348 | ee.setData({ |
336 | store_config: e, | 349 | store_config: e, |
337 | sys_switch: json_d, | 350 | sys_switch: json_d, |
@@ -2568,18 +2581,14 @@ Page({ | @@ -2568,18 +2581,14 @@ Page({ | ||
2568 | }) | 2581 | }) |
2569 | }, | 2582 | }, |
2570 | 2583 | ||
2571 | - //---------联系微信客服------------ | ||
2572 | con_weixin: function () { | 2584 | con_weixin: function () { |
2573 | - var url = this.data.sys_switch.weapp_customertype_url; | ||
2574 | - var id = this.data.sys_switch.weapp_customertype_appid; | ||
2575 | - wx.openCustomerServiceChat({ | ||
2576 | - extInfo: {url: url}, | ||
2577 | - corpId: id, | ||
2578 | - success(res) { | ||
2579 | - } | ||
2580 | - }) | 2585 | + getApp().con_wx(this); |
2581 | }, | 2586 | }, |
2582 | 2587 | ||
2588 | + customer_chat:function(){ | ||
2589 | + getApp().customer_chat(this.data.data.id,1); | ||
2590 | + }, | ||
2591 | + | ||
2583 | //评论的调用 | 2592 | //评论的调用 |
2584 | requestComments_new: async function () { | 2593 | requestComments_new: async function () { |
2585 | var e = this, th = e, ee = e; | 2594 | var e = this, th = e, ee = e; |
packageG/pages/group_buy/goodsInfo/goodsInfo.wxml
@@ -897,30 +897,7 @@ | @@ -897,30 +897,7 @@ | ||
897 | 897 | ||
898 | 898 | ||
899 | <!-- 联系客服操作菜单 --> | 899 | <!-- 联系客服操作菜单 --> |
900 | -<view class="action {{!hiddenCS ? 'active':''}}" hidden="{{hiddenCS}}"> | ||
901 | - <view class="pd20 t-c pr"> | ||
902 | - <text class="bold">联系客服</text> | ||
903 | - <text class="iconfont icon-guan" bindtap="closeCS"></text> | ||
904 | - </view> | ||
905 | - <!-- 客服热线 --> | ||
906 | - <view class="pd20 bdt fs30 btn2" bindtap="contactService" wx:if="{{store_tel}}"> | ||
907 | - <text class="iconfont icon-dianhua"></text>客服热线: | ||
908 | - <text class="c-red">{{store_tel}}</text> | ||
909 | - </view> | ||
910 | - <!-- 小程序客服 --> | ||
911 | - <block wx:if="{{sys_switch.weapp_customertype == 1}}"> | ||
912 | - <button class="pd20 bdt fs30 btn2" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> | ||
913 | - <text class="iconfont icon-kefu1"></text>在线客服 | ||
914 | - </button> | ||
915 | - </block> | ||
916 | - <!-- 微信客服 --> | ||
917 | - <block wx:elif="{{sys_switch.weapp_customertype == 2}}"> | ||
918 | - <view class="pd20 bdt fs30 btn2" bindtap="con_weixin"> | ||
919 | - <text class="iconfont icon-kefu1"></text>在线客服 | ||
920 | - </view> | ||
921 | - </block> | ||
922 | -</view> | 900 | +<include src="../../../../components/com_servicer/com_servicer.wxml"></include> |
923 | 901 | ||
924 | -<view class="mask2" bindtap="closeCS"></view> | ||
925 | <!-- 分享控件,底部弹出 --> | 902 | <!-- 分享控件,底部弹出 --> |
926 | <share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageFn" wx:if="{{share_hidden}}"></share> | 903 | <share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageFn" wx:if="{{share_hidden}}"></share> |
packageG/pages/user/order_detail/order_detail.js
@@ -495,7 +495,8 @@ Page({ | @@ -495,7 +495,8 @@ Page({ | ||
495 | user_id: user_id, | 495 | user_id: user_id, |
496 | goods_id: good.goods_id, | 496 | goods_id: good.goods_id, |
497 | prom_type: good.prom_type, | 497 | prom_type: good.prom_type, |
498 | - prom_id: good.prom_id | 498 | + prom_id: good.prom_id, |
499 | + timetype:gg.viplimited_timetype | ||
499 | }, | 500 | }, |
500 | }).then(res => { | 501 | }).then(res => { |
501 | var buy_num_data = res.data.data; | 502 | var buy_num_data = res.data.data; |
@@ -1978,6 +1979,7 @@ Page({ | @@ -1978,6 +1979,7 @@ Page({ | ||
1978 | store_id: os.stoid, | 1979 | store_id: os.stoid, |
1979 | user_id: getApp().globalData.user_id, | 1980 | user_id: getApp().globalData.user_id, |
1980 | goods_id: good.goods_id, | 1981 | goods_id: good.goods_id, |
1982 | + timetype:good.viplimited_timetype | ||
1981 | }; | 1983 | }; |
1982 | if(b_item.prom_type==7){ | 1984 | if(b_item.prom_type==7){ |
1983 | req_data.prom_type=7; | 1985 | req_data.prom_type=7; |
@@ -2001,7 +2003,7 @@ Page({ | @@ -2001,7 +2003,7 @@ Page({ | ||
2001 | 2003 | ||
2002 | //---- 要计算商品的限购 ----- | 2004 | //---- 要计算商品的限购 ----- |
2003 | if(good['viplimited']>0){ | 2005 | if(good['viplimited']>0){ |
2004 | - if(cart_num+buynum>good['viplimited']){ | 2006 | + if(cart_num+buynum>=good['viplimited']){ |
2005 | err_text+= good['goods_name']+"超出限购\n"; | 2007 | err_text+= good['goods_name']+"超出限购\n"; |
2006 | continue; | 2008 | continue; |
2007 | } | 2009 | } |
@@ -2049,6 +2051,7 @@ Page({ | @@ -2049,6 +2051,7 @@ Page({ | ||
2049 | store_id: os.stoid, | 2051 | store_id: os.stoid, |
2050 | user_id: getApp().globalData.user_id, | 2052 | user_id: getApp().globalData.user_id, |
2051 | goods_id: good.goods_id, | 2053 | goods_id: good.goods_id, |
2054 | + timetype:good.viplimited_timetype | ||
2052 | }; | 2055 | }; |
2053 | 2056 | ||
2054 | if(prom){ | 2057 | if(prom){ |
pages/cart/cart/cart.js
@@ -2829,7 +2829,8 @@ Page({ | @@ -2829,7 +2829,8 @@ Page({ | ||
2829 | goods_id: goodsinfo.goods_id, | 2829 | goods_id: goodsinfo.goods_id, |
2830 | prom_type: goodsinfo.prom_type, | 2830 | prom_type: goodsinfo.prom_type, |
2831 | prom_id: goodsinfo.prom_id, | 2831 | prom_id: goodsinfo.prom_id, |
2832 | - isnew:1 | 2832 | + isnew:1, |
2833 | + timetype:goodsinfo.viplimited_timetype | ||
2833 | }, | 2834 | }, |
2834 | }).then(res => { | 2835 | }).then(res => { |
2835 | var buy_num_data = res.data.data; | 2836 | var buy_num_data = res.data.data; |
pages/goods/goodsInfo/goodsInfo.js
@@ -438,6 +438,18 @@ Page({ | @@ -438,6 +438,18 @@ Page({ | ||
438 | 438 | ||
439 | } | 439 | } |
440 | 440 | ||
441 | + | ||
442 | + var is_chat=0; | ||
443 | + await getApp().request.promiseGet("/api/weshop/recharge/storageRechargeDetail/get/1", { | ||
444 | + | ||
445 | + }).then(res => { | ||
446 | + if(res && res.data.code==0 && res.data.data){ | ||
447 | + is_chat=1; | ||
448 | + } | ||
449 | + }) | ||
450 | + | ||
451 | + | ||
452 | + | ||
441 | //先查看一下是不是系统会员 | 453 | //先查看一下是不是系统会员 |
442 | getApp().waitfor_login(()=>{ | 454 | getApp().waitfor_login(()=>{ |
443 | if (!getApp().globalData.user_id) { | 455 | if (!getApp().globalData.user_id) { |
@@ -469,6 +481,12 @@ Page({ | @@ -469,6 +481,12 @@ Page({ | ||
469 | console.log('获取系统参数'); | 481 | console.log('获取系统参数'); |
470 | console.log(e); | 482 | console.log(e); |
471 | var json_d = JSON.parse(e.switch_list); | 483 | var json_d = JSON.parse(e.switch_list); |
484 | + | ||
485 | + //如果商家未开通在线客服的话 | ||
486 | + if(json_d && json_d.weapp_customertype==3 && !is_chat){ | ||
487 | + json_d.weapp_customertype=0 | ||
488 | + } | ||
489 | + | ||
472 | ee.setData({ | 490 | ee.setData({ |
473 | store_config: e, | 491 | store_config: e, |
474 | sys_switch: json_d, | 492 | sys_switch: json_d, |
@@ -2477,7 +2495,7 @@ Page({ | @@ -2477,7 +2495,7 @@ Page({ | ||
2477 | 2495 | ||
2478 | // s.my_warnning('超出商品限购', 0, th); | 2496 | // s.my_warnning('超出商品限购', 0, th); |
2479 | l_num = th.data.sele_g.viplimited - gd_buy_num; | 2497 | l_num = th.data.sele_g.viplimited - gd_buy_num; |
2480 | - if (l_num < 0) l_num = 0; | 2498 | + if (l_num <= 0) l_num = 1; |
2481 | th.setData({ | 2499 | th.setData({ |
2482 | goodsInputNum: l_num | 2500 | goodsInputNum: l_num |
2483 | }) | 2501 | }) |
@@ -2628,7 +2646,6 @@ Page({ | @@ -2628,7 +2646,6 @@ Page({ | ||
2628 | checkCartNum_inte: function (t) { | 2646 | checkCartNum_inte: function (t) { |
2629 | var th = this; | 2647 | var th = this; |
2630 | this.get_buy_num(this.data.data, async function () { | 2648 | this.get_buy_num(this.data.data, async function () { |
2631 | - ; | ||
2632 | //--判断商品是否超出限购-- | 2649 | //--判断商品是否超出限购-- |
2633 | if (th.data.g_buy_num != null && th.data.data.viplimited > 0) { | 2650 | if (th.data.g_buy_num != null && th.data.data.viplimited > 0) { |
2634 | 2651 | ||
@@ -2641,7 +2658,7 @@ Page({ | @@ -2641,7 +2658,7 @@ Page({ | ||
2641 | }); | 2658 | }); |
2642 | // s.my_warnning('超出商品限购', 0, th); | 2659 | // s.my_warnning('超出商品限购', 0, th); |
2643 | var num = th.data.sele_g.viplimited - gd_buy_num; | 2660 | var num = th.data.sele_g.viplimited - gd_buy_num; |
2644 | - if (num < 0) num = 0; | 2661 | + if (num <= 0) num = 1; |
2645 | th.setData({ | 2662 | th.setData({ |
2646 | goodsInputNum: num | 2663 | goodsInputNum: num |
2647 | }) | 2664 | }) |
@@ -3482,7 +3499,7 @@ Page({ | @@ -3482,7 +3499,7 @@ Page({ | ||
3482 | jieti_prom: null, | 3499 | jieti_prom: null, |
3483 | order_prom: null, | 3500 | order_prom: null, |
3484 | zh_act: null, | 3501 | zh_act: null, |
3485 | - more_flash: null, | 3502 | + more_flash: null |
3486 | }) | 3503 | }) |
3487 | } | 3504 | } |
3488 | 3505 | ||
@@ -3527,7 +3544,7 @@ Page({ | @@ -3527,7 +3544,7 @@ Page({ | ||
3527 | sele_g: item, | 3544 | sele_g: item, |
3528 | data: item, | 3545 | data: item, |
3529 | //gid: gid, //只去掉gid的更新 | 3546 | //gid: gid, //只去掉gid的更新 |
3530 | - | 3547 | + goodsInputNum:1 |
3531 | }); | 3548 | }); |
3532 | 3549 | ||
3533 | 3550 | ||
@@ -5751,7 +5768,7 @@ Page({ | @@ -5751,7 +5768,7 @@ Page({ | ||
5751 | 5768 | ||
5752 | // s.my_warnning('超出商品限购', 0, th); | 5769 | // s.my_warnning('超出商品限购', 0, th); |
5753 | var num = 0;//th.data.prom_buy_limit - th.data.prom_buy_num; | 5770 | var num = 0;//th.data.prom_buy_limit - th.data.prom_buy_num; |
5754 | - if (num < 0) num = 0; | 5771 | + if (num <= 0) num = 1; |
5755 | th.setData({ | 5772 | th.setData({ |
5756 | goodsInputNum: num | 5773 | goodsInputNum: num |
5757 | }) | 5774 | }) |
@@ -9027,6 +9044,11 @@ Page({ | @@ -9027,6 +9044,11 @@ Page({ | ||
9027 | getApp().con_wx(this); | 9044 | getApp().con_wx(this); |
9028 | }, | 9045 | }, |
9029 | 9046 | ||
9047 | + customer_chat:function(){ | ||
9048 | + var gid=this.data.front_g.goods_id; | ||
9049 | + getApp().customer_chat(gid); | ||
9050 | + }, | ||
9051 | + | ||
9030 | get_normal(gid) { | 9052 | get_normal(gid) { |
9031 | 9053 | ||
9032 | var set_ob={}; | 9054 | var set_ob={}; |
pages/user/order_list/order_list.js
@@ -806,7 +806,8 @@ Page({ | @@ -806,7 +806,8 @@ Page({ | ||
806 | user_id: user_id, | 806 | user_id: user_id, |
807 | goods_id: good.goods_id, | 807 | goods_id: good.goods_id, |
808 | prom_type: good.prom_type, | 808 | prom_type: good.prom_type, |
809 | - prom_id: good.prom_id | 809 | + prom_id: good.prom_id, |
810 | + timetype:gg.viplimited_timetype | ||
810 | }, | 811 | }, |
811 | }).then(res => { | 812 | }).then(res => { |
812 | var buy_num_data = res.data.data; | 813 | var buy_num_data = res.data.data; |
@@ -2130,7 +2131,7 @@ Page({ | @@ -2130,7 +2131,7 @@ Page({ | ||
2130 | 2131 | ||
2131 | case 2: | 2132 | case 2: |
2132 | var group = null; | 2133 | var group = null; |
2133 | - await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + good.goods_id + "/" + good.prom_id, {}).then(res => { | 2134 | + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getNewActInfo/" + os.stoid + "/" + good.goods_id + "/" + good.prom_id+"/"+ getApp().globalData.user_id, {}).then(res => { |
2134 | if (res.data.code == 0) { | 2135 | if (res.data.code == 0) { |
2135 | group = res.data.data; | 2136 | group = res.data.data; |
2136 | } | 2137 | } |
@@ -2293,6 +2294,8 @@ Page({ | @@ -2293,6 +2294,8 @@ Page({ | ||
2293 | store_id: os.stoid, | 2294 | store_id: os.stoid, |
2294 | user_id: getApp().globalData.user_id, | 2295 | user_id: getApp().globalData.user_id, |
2295 | goods_id: good.goods_id, | 2296 | goods_id: good.goods_id, |
2297 | + timetype:good.viplimited_timetype | ||
2298 | + | ||
2296 | }; | 2299 | }; |
2297 | if (b_item.prom_type == 7) { | 2300 | if (b_item.prom_type == 7) { |
2298 | req_data.prom_type = 7; | 2301 | req_data.prom_type = 7; |
@@ -2366,6 +2369,7 @@ Page({ | @@ -2366,6 +2369,7 @@ Page({ | ||
2366 | store_id: os.stoid, | 2369 | store_id: os.stoid, |
2367 | user_id: getApp().globalData.user_id, | 2370 | user_id: getApp().globalData.user_id, |
2368 | goods_id: good.goods_id, | 2371 | goods_id: good.goods_id, |
2372 | + timetype:good.viplimited_timetype | ||
2369 | }; | 2373 | }; |
2370 | 2374 | ||
2371 | if (prom) { | 2375 | if (prom) { |
@@ -2404,7 +2408,7 @@ Page({ | @@ -2404,7 +2408,7 @@ Page({ | ||
2404 | 2408 | ||
2405 | //---- 要计算商品的限购 ----- | 2409 | //---- 要计算商品的限购 ----- |
2406 | if (good['viplimited'] > 0) { | 2410 | if (good['viplimited'] > 0) { |
2407 | - if (cart_num + buynum > good['viplimited']) { | 2411 | + if (cart_num + buynum >= good['viplimited']) { |
2408 | err_text += good['goods_name'] + "超出限购\n"; | 2412 | err_text += good['goods_name'] + "超出限购\n"; |
2409 | continue; | 2413 | continue; |
2410 | } | 2414 | } |