Commit 2d2e3e4ab6eabe014cd8141e10246ae4ad703864

Authored by 后端研发-苏泰源
2 parents 203eefa9 12ee8fb1

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

@@ -51,7 +51,7 @@ App({ @@ -51,7 +51,7 @@ App({
51 config: null, //门店参数 51 config: null, //门店参数
52 config2: null, //门店配置 52 config2: null, //门店配置
53 code: null, 53 code: null,
54 - user_id: null,//5682094,6520044,6520119 qa 4687 6519901 zs 10153869 54 + user_id:null,//5682094,6520044,6520119 qa 4687 6519901 zs 10153869
55 buy_now: null, 55 buy_now: null,
56 picklist: null, //门店列表 56 picklist: null, //门店列表
57 wuliuprice: null, //物流价格表 57 wuliuprice: null, //物流价格表
@@ -73,15 +73,17 @@ App({ @@ -73,15 +73,17 @@ App({
73 }, 73 },
74 auth: o, 74 auth: o,
75 request: a, 75 request: a,
76 - onLaunch: function () { 76 + onLaunch: function (option) {
77 //初始化美图测肤插件 77 //初始化美图测肤插件
78 // var plugin = requirePlugin('mtSkinSdk'); 78 // var plugin = requirePlugin('mtSkinSdk');
79 // params.login_id = wx.getStorageSync('login_id') || '' // 可将登录id缓存下来,方便下次进入小程序直接获取 79 // params.login_id = wx.getStorageSync('login_id') || '' // 可将登录id缓存下来,方便下次进入小程序直接获取
80 // plugin.setConfig(pluginGD) 80 // plugin.setConfig(pluginGD)
81 - 81 + if(option) this.globalData.scene=option.scene;
82 wx.hideTabBar(); 82 wx.hideTabBar();
83 this.initExt(); 83 this.initExt();
84 84
  85 +
  86 +
85 //检查更新 87 //检查更新
86 this.checkUpdateVersion(); 88 this.checkUpdateVersion();
87 89
@@ -690,6 +692,7 @@ App({ @@ -690,6 +692,7 @@ App({
690 th.globalData.dis_buy_obj = null; //等级卡的购买记录 692 th.globalData.dis_buy_obj = null; //等级卡的购买记录
691 th.globalData.storeFooter = null; //底部的导航 693 th.globalData.storeFooter = null; //底部的导航
692 th.globalData.full_screen = null; //全屏 694 th.globalData.full_screen = null; //全屏
  695 + th.globalData.scene=null
693 } else { 696 } else {
694 th.globalData.no_clear = 0; 697 th.globalData.no_clear = 0;
695 } 698 }
@@ -851,21 +854,23 @@ App({ @@ -851,21 +854,23 @@ App({
851 }); 854 });
852 }, 855 },
853 856
854 - con_wx(th) {  
855 - var url = th.data.sys_switch.weapp_customertype_url;  
856 - var id = th.data.sys_switch.weapp_customertype_appid;  
857 - this.globalData.no_clear = 1; 857 +
  858 +
  859 + //联系客服的3个函数
  860 + con_wx(th){
  861 + var url=th.data.sys_switch.weapp_customertype_url;
  862 + var id=th.data.sys_switch.weapp_customertype_appid;
  863 + this.globalData.no_clear=1;
858 wx.openCustomerServiceChat({ 864 wx.openCustomerServiceChat({
859 extInfo: { url: url }, 865 extInfo: { url: url },
860 corpId: id, 866 corpId: id,
861 success(res) { } 867 success(res) { }
862 }) 868 })
863 }, 869 },
864 -  
865 - con_Service() {  
866 - var th = this;  
867 - var oss = this.globalData.setting;  
868 - this.getConfig(function (t) { 870 + con_Service(){
  871 + var th=this;
  872 + var oss= this.globalData.setting;
  873 + this.getConfig(function(t) {
869 if (t.store_tel == undefined) { 874 if (t.store_tel == undefined) {
870 th.request.get("/api/weshop/store/get/" + oss.stoid, { 875 th.request.get("/api/weshop/store/get/" + oss.stoid, {
871 isShowLoading: 1, 876 isShowLoading: 1,
@@ -935,8 +940,28 @@ App({ @@ -935,8 +940,28 @@ App({
935 check_can_share() { 940 check_can_share() {
936 if (!this.globalData.user_id) wx.hideShareMenu(); 941 if (!this.globalData.user_id) wx.hideShareMenu();
937 else wx.showShareMenu(); 942 else wx.showShareMenu();
938 - } 943 + },
939 944
  945 + //--- 判断是不是皮肤的商品的公共函数 ---
  946 + check_skin_face(options,type,goods_id){
  947 + if(options.skinface_id){
  948 + this.globalData.skinface_id=options.skinface_id;
  949 + var stoid=this.globalData.setting.stoid;
  950 + var user_id=this.globalData.user_id;
  951 + if(!user_id) return false;
  952 + //点击量的
  953 + this.request.promisePost("/api/weshop/face/skinGoodsBrowse/save",{
  954 + data:{
  955 + store_id:stoid,
  956 + goods_id:goods_id,
  957 + user_id:user_id,
  958 + addtime:ut.gettimestamp(),
  959 + skinface_id:options.skinface_id,
  960 + goods_type:type
  961 + }
  962 + }).then(res=>{})
  963 + }
  964 + }
940 965
941 966
942 967
pages/giftpack/buygiftpack/giftpackbuy.js
@@ -140,6 +140,8 @@ Page({ @@ -140,6 +140,8 @@ Page({
140 var th = this; 140 var th = this;
141 var index = e.currentTarget.dataset.index; //活动id 141 var index = e.currentTarget.dataset.index; //活动id
142 var sele_g=th.data.wareCard[index]; 142 var sele_g=th.data.wareCard[index];
  143 + this.data.payMoney=sele_g.payMoney;
  144 +
143 th.setData({sele_g:sele_g,buyType:2,}) 145 th.setData({sele_g:sele_g,buyType:2,})
144 if(sele_g.is_pickup){ 146 if(sele_g.is_pickup){
145 if(sele_g.pickup_list && th.data.def_pick_store){ 147 if(sele_g.pickup_list && th.data.def_pick_store){
pages/giftpack/giftpacklist/giftpacklist.js
@@ -138,6 +138,7 @@ Page({ @@ -138,6 +138,7 @@ Page({
138 return false; 138 return false;
139 } 139 }
140 140
  141 + this.data.payMoney=th.data.sele_g.payMoney;
141 th.setData({ buyType:2 }) 142 th.setData({ buyType:2 })
142 if(th.data.sele_g.is_pickup){ 143 if(th.data.sele_g.is_pickup){
143 th.setData({ 144 th.setData({
@@ -260,6 +261,19 @@ Page({ @@ -260,6 +261,19 @@ Page({
260 break; 261 break;
261 } 262 }
262 } 263 }
  264 +
  265 + if(res.data.data.pickup_id){
  266 + getApp().request.get("/api/weshop/pickup/get/"+os.stoid+"/"+res.data.data.pickup_id,{
  267 + success: function (res) {
  268 + if(res.data.code==0){
  269 + th.setData({pick_up:res.data.data});
  270 + }
  271 + }
  272 + });
  273 +
  274 + }
  275 +
  276 +
263 } else { 277 } else {
264 getApp().my_warnning(res.data.msg, 0, th); 278 getApp().my_warnning(res.data.msg, 0, th);
265 return false; 279 return false;
pages/giftpack/giftpacklist/giftpacklist.wxml
@@ -3,6 +3,11 @@ @@ -3,6 +3,11 @@
3 <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr" data-errorimg="giftImage"></image> 3 <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr" data-errorimg="giftImage"></image>
4 </view> 4 </view>
5 <view class="box_title data-v-3a5b7e36" > 5 <view class="box_title data-v-3a5b7e36" >
  6 +
  7 + <view class="flex ai_c fs28" style="margin-bottom: 20rpx" wx:if="{{isBuy==0 && pick_up}}">
  8 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>{{pick_up.pickup_name}}
  9 + </view>
  10 +
6 <view class="top_title data-v-3a5b7e36"> 11 <view class="top_title data-v-3a5b7e36">
7 <text class="data-v-3a5b7e36 ellipsis-2">{{giftTitle}}</text> 12 <text class="data-v-3a5b7e36 ellipsis-2">{{giftTitle}}</text>
8 </view> 13 </view>
@@ -95,19 +100,14 @@ @@ -95,19 +100,14 @@
95 </text> 100 </text>
96 </block> 101 </block>
97 </view> 102 </view>
  103 +
98 <view class="box_ware_code data-v-3a5b7e36" wx:if="{{!flag}}"> 104 <view class="box_ware_code data-v-3a5b7e36" wx:if="{{!flag}}">
99 <!-- <block wx:if="{{c_state==0}}"> --> 105 <!-- <block wx:if="{{c_state==0}}"> -->
  106 +
100 <block wx:if="{{isBuy==0&item.lbType==1}}"> 107 <block wx:if="{{isBuy==0&item.lbType==1}}">
101 <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" data-codeId="{{item.Id}}" class="data-v-3a5b7e36"></image> 108 <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" data-codeId="{{item.Id}}" class="data-v-3a5b7e36"></image>
102 </block> 109 </block>
103 - <!-- </block> -->  
104 - <!--  
105 - <block wx:else>  
106 - <block wx:if="{{isBuy==0&item.lbType==1}}">  
107 - <image src="{{iurl+'/miniapp/images/giftbag/gift08.png'}}" lazy-load="true" class="data-v-3a5b7e36"></image>  
108 - </block>  
109 - </block>-->  
110 - 110 +
111 <block wx:if="{{isBuy==0&item.lbType==2}}"> 111 <block wx:if="{{isBuy==0&item.lbType==2}}">
112 <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/packageD/pages/user/coupons/coupons" bindtap="goto"></image> 112 <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/packageD/pages/user/coupons/coupons" bindtap="goto"></image>
113 </block> 113 </block>
pages/giftpack/public/buy_com.js
@@ -484,6 +484,7 @@ module.exports = { @@ -484,6 +484,7 @@ module.exports = {
484 }, 484 },
485 485
486 check_def_pk:function (th) { 486 check_def_pk:function (th) {
  487 + th.data.def_pick_store.is_no_dis=0;
487 var def_pick_store=th.data.def_pick_store 488 var def_pick_store=th.data.def_pick_store
488 var sele_g=th.data.sele_g; 489 var sele_g=th.data.sele_g;
489 var arr=sele_g.pickup_list.split(','); 490 var arr=sele_g.pickup_list.split(',');
@@ -494,9 +495,8 @@ module.exports = { @@ -494,9 +495,8 @@ module.exports = {
494 495
495 if(idx==-1){ 496 if(idx==-1){
496 def_pick_store.is_no_dis=1; 497 def_pick_store.is_no_dis=1;
497 - th.setData({def_pick_store})  
498 } 498 }
499 - 499 + th.setData({def_pick_store})
500 500
501 } 501 }
502 502
utils/pay.js
@@ -32,6 +32,9 @@ module.exports = { @@ -32,6 +32,9 @@ module.exports = {
32 }; 32 };
33 if (type == 1) dd.type = 1; 33 if (type == 1) dd.type = 1;
34 34
  35 + if(getApp().globalData.scene)
  36 + dd.scene=getApp().globalData.scene;
  37 +
35 wx.showLoading(); 38 wx.showLoading();
36 n.post(this.url, { 39 n.post(this.url, {
37 data: dd, 40 data: dd,
utils/pay2.js
@@ -7,6 +7,9 @@ module.exports = { @@ -7,6 +7,9 @@ module.exports = {
7 if(wx_paying) return false; 7 if(wx_paying) return false;
8 wx_paying=1; 8 wx_paying=1;
9 9
  10 + if(getApp().globalData.scene)
  11 + dd.scene=getApp().globalData.scene;
  12 +
10 wx.showLoading(); 13 wx.showLoading();
11 var i = this; 14 var i = this;
12 n.post(this.url, { 15 n.post(this.url, {
utils/request.js
@@ -244,13 +244,19 @@ module.exports = { @@ -244,13 +244,19 @@ module.exports = {
244 promisePut:function(url,data){ 244 promisePut:function(url,data){
245 var th=this; 245 var th=this;
246 if(url.indexOf("http")==-1) url=getApp().globalData.setting.url +url; 246 if(url.indexOf("http")==-1) url=getApp().globalData.setting.url +url;
  247 + var post_data=data.data;
  248 + var header={"content-type": "application/x-www-form-urlencoded" };
  249 + if(data.is_json){
  250 + header={ 'content-type': 'application/json'};
  251 + post_data=JSON.stringify(post_data);
  252 + };
247 return new Promise((resolve, reject) => { 253 return new Promise((resolve, reject) => {
248 data.isShowLoading && th.showLoading(); 254 data.isShowLoading && th.showLoading();
249 wx.request({ 255 wx.request({
250 url, 256 url,
251 method: 'PUT', 257 method: 'PUT',
252 - header: {"content-type": "application/x-www-form-urlencoded" },  
253 - data:data.data, 258 + header: header,
  259 + data:post_data,
254 success(res) { 260 success(res) {
255 data.isShowLoading && th.hideLoading(); 261 data.isShowLoading && th.hideLoading();
256 resolve(res); 262 resolve(res);