Commit a34e19d26c51345bd4fda3187f7b638fb39a26e3

Authored by season
2 parents 27bc0d29 0b44571d

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

... ... @@ -5,29 +5,87 @@ var api = require("./api/api.js")
5 5  
6 6 //公共方法和变量
7 7 App({
8   - globalData: {
9   - setting: t,
10   - wechatUser: null,
11   - userInfo: null,
12   - config: null, //门店参数
13   - config2: null, //门店配置
14   - code: null,
15   - heigth:0,
16   - user_id:null,// 3674923,// 4379287,// null,// 5682068,
17   - buy_now:null,
18   - picklist:null, //门店列表
19   - wuliuprice: null, //物流价格表
20   - wuliu: null, //物流公司
21   - baddr:null,
22   - mobile: null, //记录手机
23   - getu:null, //记录会员信息
24   - sessionKey: null,//记录会员信息
25   - openid: null, //记录会员信息
  8 + editTabBar: function () {
  9 + //使用getCurrentPages可以获取当前加载中所有的页面对象的一个数组,数组最后一个就是当前页面。
26 10  
27   - to_group:null, //参团传递的数据
28   - wxapp_buy_obj:null, //微信小程序购买的Object
29   - pk_store:null, //选择的门店
  11 + var curPageArr = getCurrentPages(); //获取加载的页面
  12 + var curPage = curPageArr[curPageArr.length - 1]; //获取当前页面的对象
  13 + var pagePath = curPage.route; //当前页面url
  14 + if (pagePath.indexOf('/') != 0) {
  15 + pagePath = '/' + pagePath;
  16 + }
  17 + console.log("获取加载的页面:="+curPageArr)
  18 + console.log("获取当前页面的对象:="+curPage)
  19 + console.log("当前页面url:="+pagePath)
  20 + var tabBar = this.globalData.tabBar;
  21 + for (var i = 0; i < tabBar.list.length; i++) {
  22 + tabBar.list[i].active = false;
  23 + if (tabBar.list[i].weappurl == pagePath) {
  24 + tabBar.list[i].active = true; //根据页面地址设置当前页面状态
  25 + }
  26 + }
  27 + curPage.setData({
  28 + tabBar: tabBar
  29 + });
  30 + },
  31 +
  32 + globalData: {
  33 + tabBar: {
  34 + "color": "#6e6d6b",//文字未选择color
  35 + "selectedColor": "#f23030",//文字被选择后color
  36 + "borderStyle": "white",//
  37 + "backgroundColor": "#ffffff",//背景color
  38 + "iscustom":'',
  39 + "list": [
  40 + {
  41 + "weappurl": "/pages/index/index/index",
  42 + "nav_name": "首页",
  43 + "src": "/images/bar/index.png",
  44 + "src_sele": "/images/bar/index_on.png"
  45 + },
  46 + {
  47 + "weappurl": "/pages/goods/categoryList/categoryList",
  48 + "nav_name": "分类",
  49 + "src": "/images/bar/fl.png",
  50 + "src_sele": "/images/bar/fl_on.png"
  51 + },
  52 + {
  53 + "weappurl": "/pages/cart/cart/cart",
  54 + "nav_name": "购物车",
  55 + "src": "/images/bar/car.png",
  56 + "src_sele": "/images/bar/car_on.png"
  57 + },
  58 + {
  59 + "weappurl": "/pages/user/index/index",
  60 + "nav_name": "我的",
  61 + "src": "/images/bar/user.png",
  62 + "src_sele": "/images/bar/user_on.png"
  63 + }
  64 + ]
30 65 },
  66 + isTabBar:false,
  67 + setting: t,
  68 + wechatUser: null,
  69 + userInfo: null,
  70 + config: null, //门店参数
  71 + config2: null, //门店配置
  72 + code: null,
  73 + heigth:0,
  74 + user_id:null,// 3674923,// 4379287,// null,// 5682068,
  75 + buy_now:null,
  76 + picklist:null, //门店列表
  77 + wuliuprice: null, //物流价格表
  78 + wuliu: null, //物流公司
  79 + baddr:null,
  80 + mobile: null, //记录手机
  81 + getu:null, //记录会员信息
  82 + sessionKey: null,//记录会员信息
  83 + openid: null, //记录会员信息
  84 +
  85 + to_group:null, //参团传递的数据
  86 + wxapp_buy_obj:null, //微信小程序购买的Object
  87 + pk_store:null, //选择的门店
  88 + },
31 89 auth: o,
32 90 request: a,
33 91 onLaunch: function() {
... ...
app.json
... ... @@ -111,38 +111,7 @@
111 111 "backgroundColor": "#ffffff",
112 112 "enablePullDownRefresh": true
113 113 },
114   - "tabBar": {
115   - "color": "#6e6d6b",
116   - "selectedColor": "#f23030",
117   - "borderStyle": "white",
118   - "backgroundColor": "#ffffff",
119   - "list": [
120   - {
121   - "pagePath": "pages/index/index/index",
122   - "text": "首页",
123   - "iconPath": "packageA/images/bar/index.png",
124   - "selectedIconPath": "packageA/images/bar/index_on.png"
125   - },
126   - {
127   - "pagePath": "pages/goods/categoryList/categoryList",
128   - "text": "分类",
129   - "iconPath": "packageA/images/bar/fl.png",
130   - "selectedIconPath": "packageA/images/bar/fl_on.png"
131   - },
132   - {
133   - "pagePath": "pages/cart/cart/cart",
134   - "text": "购物车",
135   - "iconPath": "packageA/images/bar/car.png",
136   - "selectedIconPath": "packageA/images/bar/car_on.png"
137   - },
138   - {
139   - "pagePath": "pages/user/index/index",
140   - "text": "我的",
141   - "iconPath": "packageA/images/bar/user.png",
142   - "selectedIconPath": "packageA/images/bar/user_on.png"
143   - }
144   - ]
145   - },
  114 +
146 115 "debug": false,
147 116 "sitemapLocation": "sitemap.json"
148 117 }
149 118 \ No newline at end of file
... ...
pages/cart/cart/cart.js
... ... @@ -55,6 +55,11 @@ Page({
55 55 },
56 56 onShow: function() {
57 57 var th = this;
  58 + th.setData({
  59 + isTabBar: getApp().globalData.isTabBar,
  60 + });
  61 +
  62 + t.editTabBar(); //显示自定义的底部导航
58 63 this.getCardList();
59 64 if(getApp().globalData.user_id) getApp().requestCardNum();
60 65 //--获取是否又秒杀活动--
... ... @@ -73,6 +78,7 @@ Page({
73 78 })
74 79 }
75 80 });
  81 + isTabBar
76 82  
77 83 },
78 84  
... ...
pages/cart/cart/cart.wxml
... ... @@ -147,7 +147,7 @@
147 147 </view>
148 148  
149 149 <!-- 好物推荐 -->
150   -<view class="title" style="margin-top: 60rpx" wx:if="{{(!requestData|| requestData.length==0) && is_load}}">
  150 +<view class="title" style="margin-top: 60rpx; margin-bottom:{{isTabBar == true ? '50px' : '0'}}" wx:if="{{(!requestData|| requestData.length==0) && is_load}}">
151 151 <!-- 标题 -->
152 152 <view>
153 153 <!-- 中文名标题 -->
... ... @@ -182,4 +182,8 @@
182 182  
183 183  
184 184  
185   -<warn id="warn"></warn>
186 185 \ No newline at end of file
  186 +<warn id="warn"></warn>
  187 +<view wx:if="{{isTabBar == true}}">
  188 + <import src="../../tabbar/tabbar.wxml" />
  189 + <template is="tabBar" data="{{tabBar}}" />
  190 +</view>
187 191 \ No newline at end of file
... ...
pages/goods/categoryList/categoryList.js
... ... @@ -68,6 +68,8 @@ Page({
68 68 },
69 69 onLoad: function(tt) {
70 70 var that = this;
  71 + that.get_brand();
  72 +
71 73 clearInterval(that.data.timer);
72 74 that.setData({ countDownNum: 3, stylePage: 1 });
73 75  
... ... @@ -151,6 +153,10 @@ Page({
151 153  
152 154 onShow:function(){
153 155 var that=this;
  156 + that.setData({
  157 + isTabBar: getApp().globalData.isTabBar,
  158 + });
  159 + t.editTabBar(); //显示自定义的底部导航
154 160 //this.requestFirstCategoris();
155 161 if(getApp().globalData.user_id) getApp().requestCardNum();
156 162 getApp().getConfig2(function (e) {
... ...
pages/goods/categoryList/categoryList.wxml
... ... @@ -288,7 +288,7 @@
288 288 <view class="flex project_height" style="margin-left:-10rpx;">
289 289 <!-- 分类项目的类型 -->
290 290 <view class="project_type" style="height:88%;overflow-y:auto;position:fixed;left:0;z-index:999999;top:120rpx;">
291   - <view class="project_type-frame">
  291 + <view class="project_type-frame" style="margin-bottom:50px;">
292 292 <view wx:if="{{is_show_gb}}">
293 293 <view bindtap="click_classify" class="share_type fs30 flex-space-between xc-letter-spacing {{select_classify_on==223?'select_classify':''}}"data-index="223"data-name="国家" wx:if="{{is_country}}">
294 294 <text>国</text><text>家</text>
... ... @@ -316,7 +316,7 @@
316 316 </view>
317 317 </view>
318 318 <!-- 分类项目的内容 -->
319   - <view class="classify_content" style="margin-left:26%;margin-top:51px">
  319 + <view class="classify_content" style="margin-left:26%;margin-top:60px">
320 320 <!-- 国家的样式 -->
321 321 <block wx:if="{{select_classify_on==223&&is_show_gb}}">
322 322 <view class="classify_name fs28 flex-space-between">
... ... @@ -365,7 +365,7 @@
365 365 <block wx:if="{{is_show_pl}}">
366 366 <block wx:if="{{select_classify_on!=220&&select_classify_on!=223&&is_level_three!=1}}">
367 367 <view style="width:100%;height:100%;">
368   - <view class="classify_name fs28 flex-space-between" id="header" data-pid="0" data-cid="{{cat_id}}" bindtap='select_more' style="position:fixed;z-index:999999;top:120rpx;width:70%;background-color:#ffffff;left:26%;padding:0 10rpx;">
  368 + <view class="classify_name fs28 flex-space-between" id="header" data-pid="0" data-cid="{{cat_id}}" bindtap='select_more' style="position:fixed;z-index:999999;top:65px;width:70%;background-color:#ffffff;left:26%;padding:0 10rpx;">
369 369 <view class="classify_title ellipsis-1">{{classify_name}}</view>
370 370 <view class="flex select_more" >
371 371 <view class="red-co fs24" >更多</view>
... ... @@ -376,13 +376,13 @@
376 376 <!-- <view class="classify_content-frame flex-wrap" style="width:100%;overflow:hidden;heigth:100%;"> -->
377 377  
378 378 <!-- <view class="null" style="width:100%;margin-top:70rpx;"></view> -->
379   - <scroll-view scroll-y scroll-top="{{scrollTop}}" bindscrolltolower='scrollLower' style="height:{{windowHeight}};position:absolute;margin-top:70rpx;top:120rpx;bottom:0;rigth:0;left:26%;width:73%;">
  379 + <scroll-view scroll-y scroll-top="{{scrollTop}}" bindscrolltolower='scrollLower' style="height:{{windowHeight}};position:absolute;margin-top:70rpx;top:120rpx;bottom:0;rigth:0;left:26%;width:73%;margin-bottom:50px;">
380 380 <view class="null" style="width:100%;height:1px;"></view>
381 381 <!-- goodslist -->
382 382 <view class="choice_list" style="height:{{msgStatus != true?'100%':''}}">
383 383 <navigator class="choice_item" style="margin-bottom:{{dataLength -1 == index?'100px':'0'}}" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" data-id="{{index}}" wx:key="{{index}}">
384 384 <view class="img-wrap">
385   - <image src="{{item.original_img}}" binderror="bind_bnerr2" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image>
  385 + <image src="{{url+item.original_img}}" binderror="bind_bnerr2" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image>
386 386 </view>
387 387 <view class="item-cont">
388 388 <view class="title">{{item.goods_name}}</view>
... ... @@ -486,4 +486,8 @@
486 486 </view>
487 487 </block>
488 488  
489   -</block>
490 489 \ No newline at end of file
  490 +</block>
  491 +<view wx:if="{{isTabBar == true}}">
  492 + <import src="../../tabbar/tabbar.wxml" />
  493 + <template is="tabBar" data="{{tabBar}}" />
  494 +</view>
491 495 \ No newline at end of file
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -929,11 +929,6 @@ Page({
929 929 sku: o.sku,
930 930 };
931 931  
932   - //如果是积分够,is_integral_normal就要有积分购普通购买字段
933   - if(o.prom_type==4){
934   - newd.is_integral_normal=1;
935   - }
936   -
937 932 //-----如果是秒杀,团购,积分购,拼团-----
938 933 if (th.data.prom_type == 1) {
939 934 newd.goods_price = th.data.prom_price;
... ...
pages/index/index/index.js
... ... @@ -77,7 +77,7 @@ Page({
77 77  
78 78 onLoad: function() {
79 79 var th = this;
80   -
  80 +
81 81 //看一下商家是否开通了权益
82 82 //--初始化是否有打勾--
83 83 getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", {
... ... @@ -102,9 +102,42 @@ Page({
102 102 is_disgraceful: 0
103 103 })
104 104 },
  105 +
105 106 async onShow() {
106 107 var th = this;
107   -
  108 + //获取底部导航
  109 + await getApp().request.promiseGet("/api/weshop/storeFooter/get/"+o.stoid, {
  110 +
  111 + }).then(res => {
  112 + var e = res;
  113 + console.log(e)
  114 + if(e.data.code != -1){
  115 + getApp().globalData.isTabBar = true
  116 + //console.log(JSON.parse(e))
  117 + var itemList = e.data.data.data;
  118 +
  119 + itemList = JSON.parse(itemList)
  120 + for(var i=0; i<itemList.length; i++){
  121 + itemList[i]['active'] = false
  122 + }
  123 + console.log(itemList)
  124 + getApp().globalData.tabBar.backgroundColor = e.data.data.bkcolor
  125 + getApp().globalData.tabBar.selectedColor = e.data.data.fontcolor_sele
  126 + getApp().globalData.tabBar.color = e.data.data.fontcolor
  127 + getApp().globalData.tabBar.list = itemList
  128 + getApp().globalData.tabBar.iscustom = '1'
  129 + wx.hideTabBar({})
  130 + }else{
  131 + getApp().globalData.isTabBar = true
  132 + getApp().globalData.tabBar.iscustom = '2'
  133 + }
  134 + th.setData({
  135 + isTabBar: getApp().globalData.isTabBar,
  136 + });
  137 + })
  138 + console.log("isTabBar:="+getApp().globalData.isTabBar)
  139 + t.editTabBar(); //显示自定义的底部导航
  140 +
108 141 if (getApp().globalData.user_id) getApp().requestCardNum();
109 142 await this.init_load();
110 143 //显示的时候要开启计时器
... ...
pages/index/index/index.wxml
... ... @@ -246,7 +246,7 @@
246 246 </view>
247 247  
248 248 <!-- 好物推荐 -->
249   - <view class="title">
  249 + <view class="title" style="margin-bottom:{{isTabBar == true ? '50px' : '0'}}">
250 250 <!-- 标题 -->
251 251 <view>
252 252 <!-- 中文名标题 -->
... ... @@ -359,7 +359,9 @@
359 359 </view>
360 360 </view>
361 361 </block>
362   -
363   -
  362 +<!-- <view wx:if="{{isTabBar == true}}"> -->
  363 + <import src="../../tabbar/tabbar.wxml" />
  364 + <template is="tabBar" data="{{tabBar}}" />
  365 +<!-- </view> -->
364 366  
365 367  
... ...
pages/tabbar/tabbar.js 0 → 100644
  1 +// pages/tabbar.js
  2 +var d = getApp().globalData;
  3 +Page({
  4 +
  5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + isTabBar:d.isTabBar
  10 + },
  11 +
  12 + /**
  13 + * 生命周期函数--监听页面加载
  14 + */
  15 + onLoad: function (options) {
  16 +
  17 + },
  18 +
  19 + /**
  20 + * 生命周期函数--监听页面初次渲染完成
  21 + */
  22 + onReady: function () {
  23 +
  24 + },
  25 +
  26 + /**
  27 + * 生命周期函数--监听页面显示
  28 + */
  29 + onShow: function () {
  30 +
  31 + },
  32 +
  33 + /**
  34 + * 生命周期函数--监听页面隐藏
  35 + */
  36 + onHide: function () {
  37 +
  38 + },
  39 +
  40 + /**
  41 + * 生命周期函数--监听页面卸载
  42 + */
  43 + onUnload: function () {
  44 +
  45 + },
  46 +
  47 + /**
  48 + * 页面相关事件处理函数--监听用户下拉动作
  49 + */
  50 + onPullDownRefresh: function () {
  51 +
  52 + },
  53 +
  54 + /**
  55 + * 页面上拉触底事件的处理函数
  56 + */
  57 + onReachBottom: function () {
  58 +
  59 + },
  60 +
  61 + /**
  62 + * 用户点击右上角分享
  63 + */
  64 + onShareAppMessage: function () {
  65 +
  66 + }
  67 +})
0 68 \ No newline at end of file
... ...
pages/tabbar/tabbar.json 0 → 100644
  1 +{
  2 + "usingComponents": {}
  3 +}
0 4 \ No newline at end of file
... ...
pages/tabbar/tabbar.wxml 0 → 100644
  1 +<!--pages/tabbar.wxml-->
  2 +
  3 + <template name="tabBar">
  4 + <view class="tab-bar" style="position:fixed;color: {{tabBar.color}}; background: {{tabBar.backgroundColor}}; {{tabBar.position=='top'? 'top: 0' : 'bottom: 0'}};width:100%;height:50px;z-index:9999999">
  5 + <block wx:for="{{tabBar.list}}" wx:key="weappurl">
  6 + <navigator url="{{item.weappurl}}" bindtap="goto({{item.weappurl}})" class="tabbar_item {{item.clas}}" style="{{item.active? 'color: '+(item.selectedColor? item.selectedColor : tabBar.selectedColor) : ''}};position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
  7 + <view style="width:50%;height:50%;margin-left:25%;"><image src="{{item.src_sele}}" wx:if="{{item.active&&item.src_sele}}" class="img" style="width:100%;height:100%"></image>
  8 + <image src="{{item.src}}" wx:if="{{!item.active&&item.src}}" class="img" style="width:100%;height:100%"></image></view>
  9 + <view style="width:100%;height:100%;"><text class="tabbar_text" wx:if="{{item.nav_name}}" style="font-size:0.8rem">{{item.nav_name}}</text></view>
  10 + </navigator>
  11 + </block>
  12 + </view>
  13 + </template>
... ...
pages/tabbar/tabbar.wxss 0 → 100644
  1 +/* pages/tabbar.wxss */
0 2 \ No newline at end of file
... ...
pages/user/index/index.js
... ... @@ -78,12 +78,18 @@ Page({
78 78 onShow: function() {
79 79  
80 80 this.is_assistance();
  81 +
81 82  
82 83 var stoid = app_d.setting.stoid;
83 84 var s = this,
84 85 th = s,
85 86 need_money = 0,
86 87 cur_g_num = 0;
  88 + th.setData({
  89 + isTabBar: getApp().globalData.isTabBar,
  90 + });
  91 +
  92 + app.editTabBar(); //显示自定义的底部导航
87 93 getApp().get_isbuy(th.setappdata);
88 94 if (getApp().globalData.user_id) getApp().requestCardNum();
89 95 /*------会员登录------*/
... ...
pages/user/index/index.wxml
1   -<view class="xc-page">
  1 +<view class="xc-page" style="margin-bottom:{{isTabBar == true ? '50px' : '0'}}">
2 2 <view class="xc-user">
3 3 <view class="xc-head rel">
4 4 <image class="xc-background" src="{{iurl}}{{ad_img?ad_img:'/miniapp/images/user_index_powder.jpg'}}">
... ... @@ -297,3 +297,7 @@
297 297 </view>
298 298  
299 299 <pop_txt id="pop_txt"></pop_txt>
  300 +<view wx:if="{{isTabBar == true}}">
  301 + <import src="../../tabbar/tabbar.wxml" />
  302 + <template is="tabBar" data="{{tabBar}}" />
  303 +</view>
300 304 \ No newline at end of file
... ...
pages/user/order_detail/order_detail.js
... ... @@ -289,7 +289,7 @@ Page({
289 289 for(var i in order_goods){
290 290 var good=order_goods[i];
291 291 //如果不是小程序有的功能,直接提示要去3.0处理
292   - if(good.prom_type==2 || good.prom_type==4){
  292 + if(good.prom_type==2 || good.prom_type==3 || good.prom_type==4 || good.prom_type==5){
293 293 wx.showModal({
294 294 title: '提示',
295 295 content: '小程序还未有该活动,请到3.0公众号支付'
... ... @@ -330,8 +330,8 @@ Page({
330 330 });
331 331 return false;
332 332 }
333   -
334   - if((good.prom_type==1 || good.prom_type==6 || good.prom_type==5 ) && !good.is_gift && !good.is_collocation){
  333 +
  334 + if(good.prom_type==1 || good.prom_type==6){
335 335 if(gg.prom_type!=good.prom_type) {
336 336 wx.showModal({
337 337 title: '提示',
... ... @@ -339,32 +339,6 @@ Page({
339 339 });
340 340 return false;
341 341 }
342   - if(good.prom_type==3 || good.prom_type==5){
343   - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0", {}).then(res => {
344   - }).then(res=>{
345   - if(res.data.code==0){
346   - var r_data=res.data.data;
347   - if(!r_data.collocationPromList && good.prom_type==5){
348   - wx.showModal({
349   - title: '提示',
350   - content: good.goods_name+'未找到活动'
351   - });
352   - }
353   - if(!r_data.promGoodsLists && good.prom_type==3){
354   - wx.showModal({
355   - title: '提示',
356   - content: good.goods_name+'未找到活动'
357   - });
358   - }
359   - }else{
360   - wx.showModal({
361   - title: '提示',
362   - content: good.goods_name+'未找到活动'
363   - });
364   - return false;
365   - }
366   - })
367   - }
368 342  
369 343 }else{
370 344  
... ... @@ -400,25 +374,24 @@ Page({
400 374 }
401 375 }
402 376 }
403   -
404   - if(!good.is_gift && !good.is_collocation) {
405   - var isok = 1;
406   - var card_field = th.data.card_field;
407   - //如果会员是等级会员,商品有等级价,且不是活动商品
408   - if (card_field && gg[card_field] > 0) {
409   - if (good.goods_price != gg[card_field]) isok = 0;
410   - } else {
411   - if (good.goods_price != gg.shop_price) isok = 0;
412   -
413   - }
414   - if (!isok) {
415   - wx.showModal({
416   - title: '提示',
417   - content: gg.goods_name + '商品的价格发生了变化'
418   - });
419   - return false;
420   - }
421   - }
  377 +
  378 +
  379 + var isok=1;
  380 + var card_field=th.data.card_field;
  381 + //如果会员是等级会员,商品有等级价,且不是活动商品
  382 + if(card_field && gg[card_field]>0){
  383 + if (good.goods_price != gg[card_field]) isok = 0;
  384 + }else{
  385 + if (good.goods_price != gg.shop_price) isok = 0;
  386 +
  387 + }
  388 + if(!isok){
  389 + wx.showModal({
  390 + title: '提示',
  391 + content: gg.goods_name+'商品的价格发生了变化'
  392 + });
  393 + return false;
  394 + }
422 395  
423 396 //--如果是线下库存的时候--
424 397 if(th.data.conf.sales_rules==2){
... ...
pages/user/order_list/order_list.js
... ... @@ -380,7 +380,7 @@ Page({
380 380 for(var i in order_goods){
381 381 var good=order_goods[i];
382 382 //如果不是小程序有的功能,直接提示要去3.0处理
383   - if(good.prom_type==2 || good.prom_type==4 ){
  383 + if(good.prom_type==2 || good.prom_type==3 || good.prom_type==4 || good.prom_type==5){
384 384 wx.showModal({
385 385 title: '提示',
386 386 content: '小程序还未有该活动,请到3.0公众号支付'
... ... @@ -422,7 +422,10 @@ Page({
422 422 return false;
423 423 }
424 424  
425   - if((good.prom_type==1 || good.prom_type==6 || good.prom_type==5 ) && !good.is_gift && !good.is_collocation){
  425 +
  426 + console.log("-----------------111-------------------");
  427 +
  428 + if(good.prom_type==1 || good.prom_type==6){
426 429 if(gg.prom_type!=good.prom_type) {
427 430 wx.showModal({
428 431 title: '提示',
... ... @@ -430,34 +433,9 @@ Page({
430 433 });
431 434 return false;
432 435 }
433   - if(good.prom_type==3 || good.prom_type==5){
434   - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0", {}).then(res => {
435   - }).then(res=>{
436   - if(res.data.code==0){
437   - var r_data=res.data.data;
438   - if(!r_data.collocationPromList && good.prom_type==5){
439   - wx.showModal({
440   - title: '提示',
441   - content: good.goods_name+'未找到活动'
442   - });
443   - }
444   - if(!r_data.promGoodsLists && good.prom_type==3){
445   - wx.showModal({
446   - title: '提示',
447   - content: good.goods_name+'未找到活动'
448   - });
449   - }
450   - }else{
451   - wx.showModal({
452   - title: '提示',
453   - content: good.goods_name+'未找到活动'
454   - });
455   - return false;
456   - }
457   - })
458   - }
459   -
  436 +
460 437 }else{
  438 +
461 439 if(gg.prom_type==1 || gg.prom_type==6){
462 440 var prom=null;
463 441 //---如果是活动的时候---
... ... @@ -490,25 +468,24 @@ Page({
490 468 }
491 469 }
492 470 }
493   - //赠品和搭配购不判断商品金额
  471 +
  472 +
494 473 var isok=1;
495 474 var card_field=th.data.card_field;
496 475 //如果会员是等级会员,商品有等级价,且不是活动商品
497   - if(!good.is_gift && !good.is_collocation) {
498   - if (card_field && gg[card_field] > 0) {
499   - if (good.goods_price != gg[card_field]) isok = 0;
500   - } else {
501   - if (good.goods_price != gg.shop_price) isok = 0;
502   -
503   - }
504   - if (!isok) {
505   - wx.showModal({
506   - title: '提示',
507   - content: gg.goods_name + '商品的价格发生了变化'
508   - });
509   - return false;
510   - }
511   - }
  476 + if(card_field && gg[card_field]>0){
  477 + if (good.goods_price != gg[card_field]) isok = 0;
  478 + }else{
  479 + if (good.goods_price != gg.shop_price) isok = 0;
  480 +
  481 + }
  482 + if(!isok){
  483 + wx.showModal({
  484 + title: '提示',
  485 + content: gg.goods_name+'商品的价格发生了变化'
  486 + });
  487 + return false;
  488 + }
512 489  
513 490 //--如果是线下库存的时候--
514 491 if(th.data.conf.sales_rules==2){
... ...
utils/filter.wxs
1 1 var filters = {
2 2 toFix:function(val,count){
3   - val=parseFloat(val);
4 3 return val.toFixed(count)
5 4 },
6 5 replace_time:function(val){
... ...