Commit 9b42d2fd7616de5f336811cef6638c3a8014553f

Authored by season
2 parents d4334649 d7e6aac0

解决冲突

Showing 36 changed files with 379 additions and 181 deletions
@@ -312,8 +312,8 @@ App({ @@ -312,8 +312,8 @@ App({
312 312
313 }, 313 },
314 314
315 - //获取订阅消息模板id  
316 - async get_template_id(id){ 315 + //获取订阅消息模板id
  316 + async get_template_id(id){
317 if (!id) { return ''} 317 if (!id) { return ''}
318 let os = this.globalData.setting; 318 let os = this.globalData.setting;
319 let res = await this.promiseGet("/api/wx/weappSendlist/page", { 319 let res = await this.promiseGet("/api/wx/weappSendlist/page", {
@@ -1769,6 +1769,13 @@ App({ @@ -1769,6 +1769,13 @@ App({
1769 } 1769 }
1770 }, 1770 },
1771 1771
  1772 + customer_chat(goods_id,type){
  1773 + var url = "/packageG/pages/customer_chat/customer_chat?goods_id="+goods_id;
  1774 + if(type)
  1775 + url += "&type=1";
  1776 + this.goto(url);
  1777 + }
  1778 +
1772 1779
1773 1780
1774 1781
app.json
@@ -241,7 +241,8 @@ @@ -241,7 +241,8 @@
241 "pages/team/team_show/team_show", 241 "pages/team/team_show/team_show",
242 "pages/user/order_detail/order_detail", 242 "pages/user/order_detail/order_detail",
243 "pages/group_buy/goodsInfo/goodsInfo", 243 "pages/group_buy/goodsInfo/goodsInfo",
244 - "pages/user/my_beauty_consultant/my_beauty_consultant" 244 + "pages/user/my_beauty_consultant/my_beauty_consultant",
  245 + "pages/customer_chat/customer_chat"
245 ] 246 ]
246 } 247 }
247 ], 248 ],
components/add_purchase/add_purchase.js
@@ -3131,7 +3131,8 @@ Component({ @@ -3131,7 +3131,8 @@ Component({
3131 data: { 3131 data: {
3132 store_id: os.stoid, 3132 store_id: os.stoid,
3133 user_id: user_id, 3133 user_id: user_id,
3134 - goods_id: gd.goods_id, isnew: 1 3134 + goods_id: gd.goods_id, isnew: 1,
  3135 + timetype:gd.viplimited_timetype
3135 }, 3136 },
3136 success: function (t) { 3137 success: function (t) {
3137 if (t.data.code == 0) { 3138 if (t.data.code == 0) {
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/"+os.stoid, {
  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/prom_list/prom_list.js
@@ -783,7 +783,7 @@ Page({ @@ -783,7 +783,7 @@ Page({
783 }); 783 });
784 784
785 var num= th.data.data.viplimited-gd_buy_num; 785 var num= th.data.data.viplimited-gd_buy_num;
786 - if(num<0) num=0; 786 + if(num<=0) num=1
787 th.setData({goodsInputNum:num}) 787 th.setData({goodsInputNum:num})
788 return false; 788 return false;
789 } 789 }
@@ -797,7 +797,7 @@ Page({ @@ -797,7 +797,7 @@ Page({
797 }); 797 });
798 798
799 var num=th.data.prom_buy_limit- th.data.prom_buy_num ; 799 var num=th.data.prom_buy_limit- th.data.prom_buy_num ;
800 - if(num<0) num=0; 800 + if(num<=0) num=1;
801 th.setData({goodsInputNum:num}) 801 th.setData({goodsInputNum:num})
802 return false; 802 return false;
803 } 803 }
@@ -1472,7 +1472,8 @@ Page({ @@ -1472,7 +1472,8 @@ Page({
1472 store_id: os.stoid, 1472 store_id: os.stoid,
1473 user_id: user_id, 1473 user_id: user_id,
1474 goods_id: gd.goods_id, 1474 goods_id: gd.goods_id,
1475 - isnew:1 1475 + isnew:1,
  1476 + timetype:gd.viplimited_timetype
1476 }, 1477 },
1477 success: function(t) { 1478 success: function(t) {
1478 if (t.data.code == 0) { 1479 if (t.data.code == 0) {
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/"+os.stoid, {
  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}}">
packageB/pages/zuhegou/index/index.js
@@ -869,7 +869,7 @@ Page({ @@ -869,7 +869,7 @@ Page({
869 //开始调用接口 869 //开始调用接口
870 getApp().request.get(url, { 870 getApp().request.get(url, {
871 data: req_data, 871 data: req_data,
872 - success: function (res) { 872 + success: async function (res) {
873 th.data.loading = 0; 873 th.data.loading = 0;
874 th.setData({ 874 th.setData({
875 is_get: 1 875 is_get: 1
@@ -879,6 +879,16 @@ Page({ @@ -879,6 +879,16 @@ Page({
879 var list = th.data.list; 879 var list = th.data.list;
880 if (!list) list = []; 880 if (!list) list = [];
881 881
  882 + for (let it = 0; it < res.data.data.pageData.length; it++) {
  883 + var g_ite=res.data.data.pageData[it];
  884 + //获取单品的现在的活动状态
  885 + var rs_gd=await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + g_ite.goods_id, {});
  886 + if(rs_gd && rs_gd.data.code==0 && rs_gd.data.data){
  887 + g_ite.viplimited_timetype= rs_gd.data.data.viplimited_timetype;
  888 + }
  889 +
  890 + }
  891 +
882 //当是下拉刷新的时候 892 //当是下拉刷新的时候
883 if (th.data.page > 1 && th.data.cart_list) { 893 if (th.data.page > 1 && th.data.cart_list) {
884 //下拉之后也要重新计算一下金额 894 //下拉之后也要重新计算一下金额
@@ -2392,7 +2402,8 @@ Page({ @@ -2392,7 +2402,8 @@ Page({
2392 goods_id: gd.goods_id, 2402 goods_id: gd.goods_id,
2393 prom_type: 7, 2403 prom_type: 7,
2394 prom_id: th.data.act.id, 2404 prom_id: th.data.act.id,
2395 - isnew:1 2405 + isnew:1,
  2406 + timetype:gd.viplimited_timetype
2396 }, 2407 },
2397 }).then(res2 => { 2408 }).then(res2 => {
2398 var g_buy_num = 0; 2409 var g_buy_num = 0;
@@ -2887,7 +2898,8 @@ Page({ @@ -2887,7 +2898,8 @@ Page({
2887 goods_id: item_j.goods_id, 2898 goods_id: item_j.goods_id,
2888 prom_type: 7, 2899 prom_type: 7,
2889 prom_id: th.data.act.id, 2900 prom_id: th.data.act.id,
2890 - isnew:1 2901 + isnew:1,
  2902 + timetype:item_j.viplimited_timetype
2891 }, 2903 },
2892 }).then(res2 => { 2904 }).then(res2 => {
2893 if (res2.data.code == 0) { 2905 if (res2.data.code == 0) {
@@ -2964,7 +2976,8 @@ Page({ @@ -2964,7 +2976,8 @@ Page({
2964 goods_id: item_j.goods_id, 2976 goods_id: item_j.goods_id,
2965 prom_type: 7, 2977 prom_type: 7,
2966 prom_id: th.data.act.id, 2978 prom_id: th.data.act.id,
2967 - isnew:1 2979 + isnew:1,
  2980 + timetype:item_j.viplimited_timetype
2968 }, 2981 },
2969 }).then(res2 => { 2982 }).then(res2 => {
2970 if (res2.data.code == 0) { 2983 if (res2.data.code == 0) {
packageB/pages/zuhegou/preindex/index.js
@@ -1745,7 +1745,8 @@ Page({ @@ -1745,7 +1745,8 @@ Page({
1745 goods_id: gd.goods_id, 1745 goods_id: gd.goods_id,
1746 prom_type: 7, 1746 prom_type: 7,
1747 prom_id: th.data.act.id, 1747 prom_id: th.data.act.id,
1748 - isnew:1 1748 + isnew:1,
  1749 + timetype:gd.viplimited_timetype
1749 }, 1750 },
1750 }).then(res2 => { 1751 }).then(res2 => {
1751 var g_buy_num = 0; 1752 var g_buy_num = 0;
@@ -2122,7 +2123,8 @@ Page({ @@ -2122,7 +2123,8 @@ Page({
2122 goods_id: item_j.goods_id, 2123 goods_id: item_j.goods_id,
2123 prom_type: 7, 2124 prom_type: 7,
2124 prom_id: th.data.act.id, 2125 prom_id: th.data.act.id,
2125 - isnew:1 2126 + isnew:1,
  2127 + timetype:item_j.viplimited_timetype
2126 }, 2128 },
2127 }).then(res2 => { 2129 }).then(res2 => {
2128 if (res2.data.code == 0) { 2130 if (res2.data.code == 0) {
@@ -2199,7 +2201,8 @@ Page({ @@ -2199,7 +2201,8 @@ Page({
2199 goods_id: item_j.goods_id, 2201 goods_id: item_j.goods_id,
2200 prom_type: 7, 2202 prom_type: 7,
2201 prom_id: th.data.act.id, 2203 prom_id: th.data.act.id,
2202 - isnew:1 2204 + isnew:1,
  2205 + timetype:item_j.viplimited_timetype
2203 }, 2206 },
2204 }).then(res2 => { 2207 }).then(res2 => {
2205 if (res2.data.code == 0) { 2208 if (res2.data.code == 0) {
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
@@ -479,7 +479,8 @@ Page({ @@ -479,7 +479,8 @@ Page({
479 goods_id: item1.goods_id, 479 goods_id: item1.goods_id,
480 prom_type: item1.prom_type, 480 prom_type: item1.prom_type,
481 prom_id: item1.prom_id, 481 prom_id: item1.prom_id,
482 - isnew:1 482 + isnew:1,
  483 + timetype:item1.viplimited_timetype
483 }, 484 },
484 }).then(res => { 485 }).then(res => {
485 var buy_num_data = res.data.data; 486 var buy_num_data = res.data.data;
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/"+os.stoid, {
  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/luckyGo/luckyGo_order/luckyGo_order.js
@@ -768,6 +768,8 @@ Page({ @@ -768,6 +768,8 @@ Page({
768 store_id: os.stoid, 768 store_id: os.stoid,
769 user_id: getApp().globalData.user_id, 769 user_id: getApp().globalData.user_id,
770 goods_id: good.goods_id, 770 goods_id: good.goods_id,
  771 + timetype:good.viplimited_timetype
  772 +
771 }; 773 };
772 if(b_item.prom_type==7){ 774 if(b_item.prom_type==7){
773 req_data.prom_type=7; 775 req_data.prom_type=7;
@@ -839,6 +841,7 @@ Page({ @@ -839,6 +841,7 @@ Page({
839 store_id: os.stoid, 841 store_id: os.stoid,
840 user_id: getApp().globalData.user_id, 842 user_id: getApp().globalData.user_id,
841 goods_id: good.goods_id, 843 goods_id: good.goods_id,
  844 + timetype:good.viplimited_timetype
842 }; 845 };
843 846
844 if(prom){ 847 if(prom){
packageC/pages/payForAnother/payForAnother.js
@@ -447,7 +447,8 @@ Page({ @@ -447,7 +447,8 @@ Page({
447 goods_id: item1.goods_id, 447 goods_id: item1.goods_id,
448 prom_type: item1.prom_type, 448 prom_type: item1.prom_type,
449 prom_id: item1.prom_id, 449 prom_id: item1.prom_id,
450 - isnew:1 450 + isnew:1,
  451 + timetype:item1.viplimited_timetype
451 }, 452 },
452 }).then(res => { 453 }).then(res => {
453 var buy_num_data = res.data.data; 454 var buy_num_data = res.data.data;
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/"+os.stoid, {
  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/cart/cart.js
@@ -3333,7 +3333,8 @@ Page({ @@ -3333,7 +3333,8 @@ Page({
3333 goods_id: good.goods_id, 3333 goods_id: good.goods_id,
3334 prom_type: good.prom_type, 3334 prom_type: good.prom_type,
3335 prom_id: good.prom_id, 3335 prom_id: good.prom_id,
3336 - isnew: 1 3336 + isnew: 1,
  3337 + timetype:good.viplimited_timetype
3337 }, 3338 },
3338 }).then(res => { 3339 }).then(res => {
3339 var buy_num_data = res.data.data; 3340 var buy_num_data = res.data.data;
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/"+os.stoid, {
  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;
packageC/pages/presell/pregoodsInfo/goodsInfo.js
@@ -2570,7 +2570,8 @@ Page({ @@ -2570,7 +2570,8 @@ Page({
2570 store_id: os.stoid, 2570 store_id: os.stoid,
2571 user_id: user_id, 2571 user_id: user_id,
2572 goods_id: gd.goods_id, 2572 goods_id: gd.goods_id,
2573 - isnew:1 2573 + isnew:1,
  2574 + timetype:gd.viplimited_timetype
2574 }, 2575 },
2575 success: function (t) { 2576 success: function (t) {
2576 if (t.data.code == 0) { 2577 if (t.data.code == 0) {
packageD/pages/shop/order_detail/order_detail.js
@@ -341,7 +341,8 @@ Page({ @@ -341,7 +341,8 @@ Page({
341 user_id: getApp().globalData.user_id, 341 user_id: getApp().globalData.user_id,
342 goods_id: good.goods_id, 342 goods_id: good.goods_id,
343 prom_type: good.prom_type, 343 prom_type: good.prom_type,
344 - prom_id: good.prom_id 344 + prom_id: good.prom_id,
  345 + timetype:good.viplimited_timetype
345 }, 346 },
346 }).then(res => { 347 }).then(res => {
347 var buy_num_data = res.data.data; 348 var buy_num_data = res.data.data;
@@ -1283,6 +1284,7 @@ Page({ @@ -1283,6 +1284,7 @@ Page({
1283 store_id: os.stoid, 1284 store_id: os.stoid,
1284 user_id: getApp().globalData.user_id, 1285 user_id: getApp().globalData.user_id,
1285 goods_id: good.goods_id, 1286 goods_id: good.goods_id,
  1287 + timetype:good.viplimited_timetype
1286 }; 1288 };
1287 if(b_item.prom_type==7){ 1289 if(b_item.prom_type==7){
1288 req_data.prom_type=7; 1290 req_data.prom_type=7;
@@ -1354,6 +1356,7 @@ Page({ @@ -1354,6 +1356,7 @@ Page({
1354 store_id: os.stoid, 1356 store_id: os.stoid,
1355 user_id: getApp().globalData.user_id, 1357 user_id: getApp().globalData.user_id,
1356 goods_id: good.goods_id, 1358 goods_id: good.goods_id,
  1359 + timetype:good.viplimited_timetype
1357 }; 1360 };
1358 1361
1359 if(prom){ 1362 if(prom){
packageE/pages/cart/cart2/cart2.js
@@ -2526,16 +2526,20 @@ Page({ @@ -2526,16 +2526,20 @@ Page({
2526 }, 2526 },
2527 2527
2528 //寻找活动在列表中的最后一个 2528 //寻找活动在列表中的最后一个
2529 - is_has_gift(ord_goods, prom_id) { 2529 + is_has_gift(ord_goods, prom_id,get_data) {
2530 if (!ord_goods || ord_goods.length == 0) return false; 2530 if (!ord_goods || ord_goods.length == 0) return false;
2531 var len = ord_goods.length; 2531 var len = ord_goods.length;
  2532 + var is_ck=false;
2532 for (var i = 0; i < len; i++) { 2533 for (var i = 0; i < len; i++) {
2533 var e = ord_goods[i]; 2534 var e = ord_goods[i];
2534 if (e.prom_type == 3 && e.prom_id == prom_id && e.is_gift == 1) { 2535 if (e.prom_type == 3 && e.prom_id == prom_id && e.is_gift == 1) {
2535 - return true; 2536 + if(get_data.zp_by>0){
  2537 + ord_goods[i].is_past=1;
  2538 + }
  2539 + is_ck=true;
2536 } 2540 }
2537 } 2541 }
2538 - return false; 2542 + return is_ck;
2539 }, 2543 },
2540 2544
2541 2545
@@ -2550,7 +2554,7 @@ Page({ @@ -2550,7 +2554,7 @@ Page({
2550 cart_add_gift(item_map, pickid, i, ord_goods, get_data) { 2554 cart_add_gift(item_map, pickid, i, ord_goods, get_data) {
2551 2555
2552 var th = this; 2556 var th = this;
2553 - var is_has_gift = this.is_has_gift(ord_goods, item_map.prom_id) 2557 + var is_has_gift = this.is_has_gift(ord_goods, item_map.prom_id,get_data)
2554 2558
2555 //-- 没有赠品的时候才添加,避免购物车重复出现 -- 2559 //-- 没有赠品的时候才添加,避免购物车重复出现 --
2556 if (!is_has_gift) { 2560 if (!is_has_gift) {
packageE/pages/cart/cart2_pt/cart2_pt.js
@@ -813,6 +813,7 @@ Page({ @@ -813,6 +813,7 @@ Page({
813 //to.getwuliuprice(async function (rs) { 813 //to.getwuliuprice(async function (rs) {
814 console.log('calculatePrice2222'); 814 console.log('calculatePrice2222');
815 //console.log(rs); 815 //console.log(rs);
  816 + let all_gd_price=allpice;
816 817
817 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1; 818 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
818 var out_of_weight = null; //超出多少重量 819 var out_of_weight = null; //超出多少重量
@@ -1201,9 +1202,12 @@ Page({ @@ -1201,9 +1202,12 @@ Page({
1201 var total_m = parseFloat(allpice) + parseFloat(th.data.formData.shipping_price); 1202 var total_m = parseFloat(allpice) + parseFloat(th.data.formData.shipping_price);
1202 total_m = parseFloat(total_m).toFixed(2); 1203 total_m = parseFloat(total_m).toFixed(2);
1203 1204
  1205 + all_gd_price = parseFloat(all_gd_price) + parseFloat(th.data.formData.shipping_price);
  1206 + all_gd_price = parseFloat(all_gd_price).toFixed(2);
1204 1207
1205 var atxt = "formData.total_amount"; 1208 var atxt = "formData.total_amount";
1206 - th.setData({ [atxt]: total_m, }) 1209 + th.setData({ [atxt]: all_gd_price,}) ; //因为allprice有减了券的钱,不能在用allprice了
  1210 +
1207 var order_m = total_m; 1211 var order_m = total_m;
1208 1212
1209 1213
@@ -1516,7 +1520,6 @@ Page({ @@ -1516,7 +1520,6 @@ Page({
1516 } 1520 }
1517 1521
1518 1522
1519 -  
1520 var gg = to.get_b_now(); 1523 var gg = to.get_b_now();
1521 var goods = { 1524 var goods = {
1522 'goods_id': gg.goods_id, 1525 'goods_id': gg.goods_id,
@@ -1589,6 +1592,12 @@ Page({ @@ -1589,6 +1592,12 @@ Page({
1589 goods.is_whsle_goods = 1; 1592 goods.is_whsle_goods = 1;
1590 } 1593 }
1591 1594
  1595 + //组装优惠券的钱
  1596 + if (parseFloat(th.data.formData.coupon_price) > 0) {
  1597 + goods.quan_num = th.data.formData.coupon_price;
  1598 + goods.quan_no = item.coupon_no;
  1599 + }
  1600 +
1592 //--导购分享过来的id-- 1601 //--导购分享过来的id--
1593 if (gg.guide_id) { 1602 if (gg.guide_id) {
1594 goods.guide_id = gg.guide_id; 1603 goods.guide_id = gg.guide_id;
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
@@ -422,6 +422,9 @@ Page({ @@ -422,6 +422,9 @@ Page({
422 422
423 //res = res.data.data.result; 423 //res = res.data.data.result;
424 //if (!res) return false; 424 //if (!res) return false;
  425 + this.setData({
  426 + getUserID: d.user_id || 0,
  427 + });
425 428
426 getApp().check_can_share(this); 429 getApp().check_can_share(this);
427 getApp().is_Single_page(this, function () { 430 getApp().is_Single_page(this, function () {
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
  1 +{
  2 + "navigationBarTitleText": "在线客服",
  3 + "usingComponents": {}
  4 +}
0 \ No newline at end of file 5 \ No newline at end of file
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
  1 +/* packageG/pages/customer_chat/customer_chat.wxss */
0 \ No newline at end of file 2 \ No newline at end of file
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/"+os.stoid, {
  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/team/team_show/team_show.js
@@ -331,13 +331,14 @@ Page({ @@ -331,13 +331,14 @@ Page({
331 var user_id=getApp().globalData.user_id; 331 var user_id=getApp().globalData.user_id;
332 var promgoodsbuynum=0; 332 var promgoodsbuynum=0;
333 var goodsbuynum=0; 333 var goodsbuynum=0;
334 - getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", { 334 + await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {
335 data: { 335 data: {
336 store_id: os.stoid, 336 store_id: os.stoid,
337 user_id: user_id, 337 user_id: user_id,
338 goods_id: gd.goods_id, 338 goods_id: gd.goods_id,
339 - prom_type: gd.prom_type,  
340 - prom_id: gd.prom_id, isnew:1 339 + prom_type: 6,
  340 + prom_id: th.data.teamlist.id, isnew:1,
  341 + timetype:gd.viplimited_timetype
341 342
342 }, 343 },
343 }).then(res=>{ 344 }).then(res=>{
@@ -349,15 +350,18 @@ Page({ @@ -349,15 +350,18 @@ Page({
349 //先判断限购 350 //先判断限购
350 if (num+goodsbuynum>gd.viplimited && gd.viplimited>0) { 351 if (num+goodsbuynum>gd.viplimited && gd.viplimited>0) {
351 getApp().confirmBox("超出商品限购"); 352 getApp().confirmBox("超出商品限购");
  353 + th.inp_val(gd.viplimited-goodsbuynum);
352 return false; 354 return false;
353 } 355 }
354 if (num+promgoodsbuynum>th.data.teamlist.buy_limit && th.data.teamlist.buy_limit>0) { 356 if (num+promgoodsbuynum>th.data.teamlist.buy_limit && th.data.teamlist.buy_limit>0) {
355 getApp().confirmBox("超出活动限购"); 357 getApp().confirmBox("超出活动限购");
  358 + th.inp_val(th.data.teamlist.buy_limit-promgoodsbuynum);
356 return false; 359 return false;
357 } 360 }
358 //判断库存 361 //判断库存
359 if ( num>gd.store_count) { 362 if ( num>gd.store_count) {
360 getApp().confirmBox("超出商品库存"); 363 getApp().confirmBox("超出商品库存");
  364 + th.inp_val(gd.store_count);
361 return false; 365 return false;
362 } 366 }
363 var r_num=0; 367 var r_num=0;
@@ -372,6 +376,7 @@ Page({ @@ -372,6 +376,7 @@ Page({
372 //--判断库存--- 376 //--判断库存---
373 if ( num>r_num) { 377 if ( num>r_num) {
374 getApp().confirmBox("超出商品库存"); 378 getApp().confirmBox("超出商品库存");
  379 + th.inp_val(r_num);
375 return false; 380 return false;
376 } 381 }
377 382
@@ -380,11 +385,12 @@ Page({ @@ -380,11 +385,12 @@ Page({
380 minusStatus: minusStatus, 385 minusStatus: minusStatus,
381 }) 386 })
382 387
  388 + return true;
  389 +
383 }, 390 },
384 391
385 - /*输入框事件*/  
386 - bindManual: function(e) {  
387 - var num = e.detail.value; 392 + inp_val(num){
  393 + if(!num || num<1) num=1;
388 var minusStatus = num > 1 ? 'normal' : 'disable'; 394 var minusStatus = num > 1 ? 'normal' : 'disable';
389 this.setData({ 395 this.setData({
390 num: num, 396 num: num,
@@ -392,6 +398,17 @@ Page({ @@ -392,6 +398,17 @@ Page({
392 }) 398 })
393 }, 399 },
394 400
  401 + /*输入框事件*/
  402 + bindManual: async function(e) {
  403 + var num = e.detail.value;
  404 + var minusStatus = num > 1 ? 'normal' : 'disable';
  405 + // this.setData({
  406 + // num: num,
  407 + // minusStatus: minusStatus
  408 + // })
  409 + this.check_num(num,minusStatus);
  410 + },
  411 +
395 //---------------初始化代码---------------- 412 //---------------初始化代码----------------
396 async init(tg_id) { 413 async init(tg_id) {
397 var goods_id = 0, //商品ID, 414 var goods_id = 0, //商品ID,
@@ -898,6 +915,10 @@ Page({ @@ -898,6 +915,10 @@ Page({
898 915
899 //购买前的判断redis 916 //购买前的判断redis
900 async buy_check_redis(func){ 917 async buy_check_redis(func){
  918 +
  919 + var ck= await this.check_num(this.data.num,1);
  920 + if(!ck) return false;
  921 +
901 //获取redis中的数量 922 //获取redis中的数量
902 var r_num=0,prom_type=6,prom_id=this.data.teamlist.id; 923 var r_num=0,prom_type=6,prom_id=this.data.teamlist.id;
903 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, { 924 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
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;
@@ -1768,11 +1769,8 @@ Page({ @@ -1768,11 +1769,8 @@ Page({
1768 }) 1769 })
1769 1770
1770 if (arr2.length == 1) { 1771 if (arr2.length == 1) {
1771 - good.prom_type = 1;  
1772 - good.prom_id = item.act_id;  
1773 -  
1774 -  
1775 - 1772 + good.prom_type = arr2[0].prom_type;
  1773 + good.prom_id = arr2[0].act_id;
1776 } 1774 }
1777 else if (arr2.length > 1) { 1775 else if (arr2.length > 1) {
1778 good.prom_type = g_item.prom_type; good.prom_id = g_item.prom_id; 1776 good.prom_type = g_item.prom_type; good.prom_id = g_item.prom_id;
@@ -1978,6 +1976,7 @@ Page({ @@ -1978,6 +1976,7 @@ Page({
1978 store_id: os.stoid, 1976 store_id: os.stoid,
1979 user_id: getApp().globalData.user_id, 1977 user_id: getApp().globalData.user_id,
1980 goods_id: good.goods_id, 1978 goods_id: good.goods_id,
  1979 + timetype:good.viplimited_timetype
1981 }; 1980 };
1982 if(b_item.prom_type==7){ 1981 if(b_item.prom_type==7){
1983 req_data.prom_type=7; 1982 req_data.prom_type=7;
@@ -2001,7 +2000,7 @@ Page({ @@ -2001,7 +2000,7 @@ Page({
2001 2000
2002 //---- 要计算商品的限购 ----- 2001 //---- 要计算商品的限购 -----
2003 if(good['viplimited']>0){ 2002 if(good['viplimited']>0){
2004 - if(cart_num+buynum>good['viplimited']){ 2003 + if(cart_num+buynum>=good['viplimited']){
2005 err_text+= good['goods_name']+"超出限购\n"; 2004 err_text+= good['goods_name']+"超出限购\n";
2006 continue; 2005 continue;
2007 } 2006 }
@@ -2049,6 +2048,7 @@ Page({ @@ -2049,6 +2048,7 @@ Page({
2049 store_id: os.stoid, 2048 store_id: os.stoid,
2050 user_id: getApp().globalData.user_id, 2049 user_id: getApp().globalData.user_id,
2051 goods_id: good.goods_id, 2050 goods_id: good.goods_id,
  2051 + timetype:good.viplimited_timetype
2052 }; 2052 };
2053 2053
2054 if(prom){ 2054 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/"+os.stoid, {
  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,
@@ -2480,11 +2498,11 @@ Page({ @@ -2480,11 +2498,11 @@ Page({
2480 2498
2481 // s.my_warnning('超出商品限购', 0, th); 2499 // s.my_warnning('超出商品限购', 0, th);
2482 l_num = th.data.sele_g.viplimited - gd_buy_num; 2500 l_num = th.data.sele_g.viplimited - gd_buy_num;
2483 - if (l_num < 0) l_num = 0;  
2484 - // th.setData({  
2485 - // goodsInputNum: num  
2486 - // })  
2487 - // return false; 2501 + if (l_num <= 0) l_num = 1;
  2502 + th.setData({
  2503 + goodsInputNum: l_num
  2504 + })
  2505 + return false;
2488 } 2506 }
2489 } 2507 }
2490 2508
@@ -2631,7 +2649,6 @@ Page({ @@ -2631,7 +2649,6 @@ Page({
2631 checkCartNum_inte: function (t) { 2649 checkCartNum_inte: function (t) {
2632 var th = this; 2650 var th = this;
2633 this.get_buy_num(this.data.data, async function () { 2651 this.get_buy_num(this.data.data, async function () {
2634 - ;  
2635 //--判断商品是否超出限购-- 2652 //--判断商品是否超出限购--
2636 if (th.data.g_buy_num != null && th.data.data.viplimited > 0) { 2653 if (th.data.g_buy_num != null && th.data.data.viplimited > 0) {
2637 2654
@@ -2644,7 +2661,7 @@ Page({ @@ -2644,7 +2661,7 @@ Page({
2644 }); 2661 });
2645 // s.my_warnning('超出商品限购', 0, th); 2662 // s.my_warnning('超出商品限购', 0, th);
2646 var num = th.data.sele_g.viplimited - gd_buy_num; 2663 var num = th.data.sele_g.viplimited - gd_buy_num;
2647 - if (num < 0) num = 0; 2664 + if (num <= 0) num = 1;
2648 th.setData({ 2665 th.setData({
2649 goodsInputNum: num 2666 goodsInputNum: num
2650 }) 2667 })
@@ -3485,7 +3502,7 @@ Page({ @@ -3485,7 +3502,7 @@ Page({
3485 jieti_prom: null, 3502 jieti_prom: null,
3486 order_prom: null, 3503 order_prom: null,
3487 zh_act: null, 3504 zh_act: null,
3488 - more_flash: null, 3505 + more_flash: null
3489 }) 3506 })
3490 } 3507 }
3491 3508
@@ -3530,7 +3547,7 @@ Page({ @@ -3530,7 +3547,7 @@ Page({
3530 sele_g: item, 3547 sele_g: item,
3531 data: item, 3548 data: item,
3532 //gid: gid, //只去掉gid的更新 3549 //gid: gid, //只去掉gid的更新
3533 - 3550 + goodsInputNum:1
3534 }); 3551 });
3535 3552
3536 3553
@@ -5436,7 +5453,8 @@ Page({ @@ -5436,7 +5453,8 @@ Page({
5436 data: { 5453 data: {
5437 store_id: os.stoid, 5454 store_id: os.stoid,
5438 user_id: user_id, 5455 user_id: user_id,
5439 - goods_id: gd.goods_id, isnew:1 5456 + goods_id: gd.goods_id, isnew:1,
  5457 + timetype:gd.viplimited_timetype
5440 }, 5458 },
5441 success: function (t) { 5459 success: function (t) {
5442 if (t.data.code == 0) { 5460 if (t.data.code == 0) {
@@ -5753,7 +5771,7 @@ Page({ @@ -5753,7 +5771,7 @@ Page({
5753 5771
5754 // s.my_warnning('超出商品限购', 0, th); 5772 // s.my_warnning('超出商品限购', 0, th);
5755 var num = 0;//th.data.prom_buy_limit - th.data.prom_buy_num; 5773 var num = 0;//th.data.prom_buy_limit - th.data.prom_buy_num;
5756 - if (num < 0) num = 0; 5774 + if (num <= 0) num = 1;
5757 th.setData({ 5775 th.setData({
5758 goodsInputNum: num 5776 goodsInputNum: num
5759 }) 5777 })
pages/user/index/index.js
@@ -206,7 +206,7 @@ Page({ @@ -206,7 +206,7 @@ Page({
206 206
207 207
208 //先查看一下是不是系统会员 208 //先查看一下是不是系统会员
209 - getApp().waitfor_login(()=> { 209 + getApp().waitfor_login(async ()=> {
210 if (!getApp().globalData.user_id) { 210 if (!getApp().globalData.user_id) {
211 if(!this.data.is_show_yq){ 211 if(!this.data.is_show_yq){
212 ut.new_user_go(os.stoid, getApp().globalData.first_leader); 212 ut.new_user_go(os.stoid, getApp().globalData.first_leader);
@@ -505,11 +505,25 @@ Page({ @@ -505,11 +505,25 @@ Page({
505 /*-- 获取 --*/ 505 /*-- 获取 --*/
506 th.requestRecommend(); 506 th.requestRecommend();
507 507
  508 + var is_chat=0;
  509 + await getApp().request.promiseGet("/api/weshop/recharge/storageRechargeDetail/get/"+os.stoid, {
  510 + }).then(res => {
  511 + if(res && res.data.code==0 && res.data.data){
  512 + is_chat=1;
  513 + }
  514 + })
  515 +
508 /*-------系统是否开通等级卡,会员是等级卡-----*/ 516 /*-------系统是否开通等级卡,会员是等级卡-----*/
509 getApp().getConfig2(function (e) { 517 getApp().getConfig2(function (e) {
510 var t_swi = e.switch_list; 518 var t_swi = e.switch_list;
511 if (t_swi) t_swi = JSON.parse(t_swi) 519 if (t_swi) t_swi = JSON.parse(t_swi)
512 if (t_swi) { 520 if (t_swi) {
  521 +
  522 + //如果商家未开通在线客服的话
  523 + if(t_swi.weapp_customertype==3 && !is_chat){
  524 + json_dt_swi.weapp_customertype=0
  525 + }
  526 +
513 th.setData({ sys_switch: t_swi }); 527 th.setData({ sys_switch: t_swi });
514 var user_tool = []; 528 var user_tool = [];
515 if (t_swi.usertool) user_tool = JSON.parse(t_swi.usertool); 529 if (t_swi.usertool) user_tool = JSON.parse(t_swi.usertool);
@@ -1106,6 +1120,10 @@ Page({ @@ -1106,6 +1120,10 @@ Page({
1106 getApp().con_wx(this); 1120 getApp().con_wx(this);
1107 }, 1121 },
1108 1122
  1123 + customer_chat: function () {
  1124 + getApp().customer_chat(0);
  1125 + },
  1126 +
1109 //初始话按钮图标 1127 //初始话按钮图标
1110 init_user_tool: async function () { 1128 init_user_tool: async function () {
1111 var d_list = null; 1129 var d_list = null;
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;
@@ -2092,8 +2093,8 @@ Page({ @@ -2092,8 +2093,8 @@ Page({
2092 }) 2093 })
2093 2094
2094 if (arr2.length == 1) { 2095 if (arr2.length == 1) {
2095 - good.prom_type = item.prom_type;  
2096 - good.prom_id = item.act_id; 2096 + good.prom_type = arr2[0].prom_type;
  2097 + good.prom_id = arr2[0].act_id;
2097 } 2098 }
2098 else if (arr2.length > 1) { 2099 else if (arr2.length > 1) {
2099 good.prom_type = g_item.prom_type; good.prom_id = g_item.prom_id; 2100 good.prom_type = g_item.prom_type; good.prom_id = g_item.prom_id;
@@ -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 }
setting.js
@@ -9,6 +9,7 @@ module.exports = { @@ -9,6 +9,7 @@ module.exports = {
9 //url:"http://172.20.3.102:8085", //自己的网址 9 //url:"http://172.20.3.102:8085", //自己的网址
10 banner_err:"../../../images/del/logo.png", 10 banner_err:"../../../images/del/logo.png",
11 imghost: "https://mshopimg.yolipai.net/", 11 imghost: "https://mshopimg.yolipai.net/",
  12 + h5_host: "https://mshop.yolipai.net/", //客服聊天使用
12 share: {}, 13 share: {},
13 stoid:197, 14 stoid:197,
14 15