diff --git a/components/share_box/share_box.js b/components/share_box/share_box.js new file mode 100644 index 0000000..789813d --- /dev/null +++ b/components/share_box/share_box.js @@ -0,0 +1,18 @@ +var t = getApp(),os =t.globalData.setting; +Component({ + properties: { + }, + data: { + iurl:os.imghost, + }, + ready: function() { + }, + methods: { + //--- 分享 --- + go_share:function () { + this.triggerEvent('go_share') + } + + } + +}) \ No newline at end of file diff --git a/components/share_box/share_box.json b/components/share_box/share_box.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/share_box/share_box.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/share_box/share_box.wxml b/components/share_box/share_box.wxml new file mode 100644 index 0000000..449574a --- /dev/null +++ b/components/share_box/share_box.wxml @@ -0,0 +1,3 @@ + + diff --git a/components/share_box/share_box.wxss b/components/share_box/share_box.wxss new file mode 100644 index 0000000..3c25d2a --- /dev/null +++ b/components/share_box/share_box.wxss @@ -0,0 +1,7 @@ +.box_main{ + width: 80rpx;height: 80rpx; background-color: #fff; border-radius: 50%; border: 1rpx solid #adadad; position: fixed;right: 0; top:50%; + background-repeat: no-repeat;background-position: center center; background-size: cover; +} +button.control[plain] { + border: 0; +} \ No newline at end of file diff --git a/packageA/pages/prom_list/prom_list.js b/packageA/pages/prom_list/prom_list.js index 2ff76e1..f563d5a 100644 --- a/packageA/pages/prom_list/prom_list.js +++ b/packageA/pages/prom_list/prom_list.js @@ -370,6 +370,20 @@ Page({ prom_id:o.prom_id }; + //---是不是从收藏夹出来的--- + if(th.data.c_guide_id){ + newd['guide_id'] = th.data.c_guide_id; + newd['guide_type']=2; + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=3; + }else{ + if(getApp().globalData.guide_id){ + newd['guide_id'] = getApp().globalData.guide_id; + newd['guide_type']=0; + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=1; + } + } + + //-----如果是秒杀,团购,积分购,拼团----- if (th.data.data.prom_type != 5) { return s.my_warnning("商品不是搭配活动!", 0, th); diff --git a/pages/cart/cart/cart.js b/pages/cart/cart/cart.js index 05f1aae..c8fef47 100644 --- a/pages/cart/cart/cart.js +++ b/pages/cart/cart/cart.js @@ -57,9 +57,12 @@ Page({ var th = this; //调用底部导航 t.editTabBar(th,getApp().globalData.setting.stoid,getApp().globalData.url); - this.getCardList(); - if(getApp().globalData.user_id) getApp().requestCardNum(); + //--强行等待,让购物车的数量能够正确的线上 + setTimeout(function () { + if(getApp().globalData.user_id) getApp().requestCardNum(th); + },500) + //--获取是否又秒杀活动-- getApp().request.promiseGet("/api/ms/flash_sale/spikepage", { data: { @@ -657,10 +660,11 @@ Page({ e.doCheckAll(); t.goods_num=false_data.false_data.buy_limit; - e.update_cart(t, pitem, item); - + e.update_cart(t, pitem, item); return false; } + e.update_cart(t, pitem, item); + }else{ //--- 看一下是不是线下库存 --- if(th.data.sales_rules==2){ @@ -789,6 +793,7 @@ Page({ e.check_prom_activity(i) } e.doCheckAll(); + getApp().requestCardNum(e); } }); }, diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 51abda5..1ba655c 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -152,6 +152,7 @@ Page({ console.log("getuser_addr") console.log(ie) + //地址切换要把包邮券清空 if( !th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){ var using_quan=th.data.using_quan; @@ -167,6 +168,7 @@ Page({ //更换地址回来要重新调用计算价钱的接口 if(!th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){ + th.setData({user_addr: ie }); if (th.data.is_b_now == 1) { if(th.data.bn_goods) { th.calculatePrice2(); @@ -176,9 +178,9 @@ Page({ th.calculatePrice(); } } + }else{ + th.setData({user_addr: ie }); } - - th.setData({user_addr: ie }); var going=0; @@ -280,7 +282,7 @@ Page({ success: function (su) { if (su.data.code == 0) { var yuer = parseFloat(th.data.userinfo.user_money - - th.data.userinfo.frozen_money - su.data.data.summoney).toFixed(2); + (th.data.userinfo.frozen_money>0?th.data.userinfo.frozen_money:0) - su.data.data.summoney).toFixed(2); th.setData({ txmon: su.data.data.summoney, yuer: yuer }); } } @@ -596,7 +598,7 @@ Page({ var all_cutprice=0; //所有的优惠减件 var all_order_prom=0; //所有的订单优惠 - var umoney = th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money; + var umoney = th.data.userinfo.user_money - th.data.txmon - (th.data.userinfo.frozen_money?th.data.userinfo.frozen_money:0); var freight_free = ee.freight_free; //全场满多少包邮 var no_ex_id=ee.no_ex_id; var no_ex_good=null; @@ -1423,7 +1425,20 @@ Page({ 'prom_type':th.data.bn_goods.prom_type, //促销活动类型 'prom_id': th.data.bn_goods.prom_id, //促销活动id }; - + + //-- 把导购的信息填入-- + if(gg.guide_id){ + goods.guide_id=gg.guide_id; + goods.guide_type=gg.guide_type; + //调用接口判断是不是会员 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{ + if(res.data.code==0){ + goods.guide_name=res.data.data.salesman; + goods.guide_sn=res.data.data.salesman_no; + } + }) + } + //如果不立即购买或者秒杀,如果是线下库存购买的时候 if(goods.prom_type!=1 && goods.prom_type!=6 && th.data.sales_rules==2){ var isok=1; @@ -1610,6 +1625,19 @@ Page({ return false; } } + + //导购ID + if(g_item.guide_id){ + goods.guide_id=g_item.guide_id; + goods.guide_type=g_item.guide_type; + //调用接口判断是不是会员 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+g_item.guide_id,{}).then(res=>{ + if(res.data.code==0){ + goods.guide_name=res.data.data.salesman; + goods.guide_sn=res.data.data.salesman_no; + } + }) + } item.order_goods.push(goods); } @@ -1620,6 +1648,7 @@ Page({ if (pdata.length==0) return; var str = JSON.stringify(pdata); + wx.showLoading({title: "加载中"}); wx.request({ diff --git a/pages/cart/cart2_pt/cart2_pt.js b/pages/cart/cart2_pt/cart2_pt.js index 7d85168..357e537 100644 --- a/pages/cart/cart2_pt/cart2_pt.js +++ b/pages/cart/cart2_pt/cart2_pt.js @@ -56,7 +56,8 @@ Page({ qh:'', //期号 pt_listno:'',//期号 is_normal:0, - is_express:0,//选择物流的控制器 + is_express:0,//选择物流的控制器 + yuer:0, }, onLoad: function(t) { console.log("onLoad_pt_cart"); @@ -128,6 +129,18 @@ Page({ th.setData({ userinfo: to.globalData.userInfo}); //获取立即购买的商品信息 th.get_buy_goods(); + + //获取提现金额 + getApp().request.get("/api/weshop/withdrawals/summoney", { + data: { user_id: to.globalData.user_id, store_id: oo.stoid, status: 0 }, + success: function (su) { + if (su.data.code == 0) { + var yuer = parseFloat(th.data.userinfo.user_money - + (th.data.userinfo.frozen_money>0?th.data.userinfo.frozen_money:0) - su.data.data.summoney).toFixed(2); + th.setData({ txmon: su.data.data.summoney, yuer: yuer }); + } + } + }); }, //-----获取立即购买的商品信息---- @@ -325,12 +338,12 @@ Page({ var txt2 = "formData.order_amount"; //--------------如果使用余额--------------------- if (th.data.bn_use_money == 1) { - if (th.data.userinfo.user_money > total_m) { + if ( parseFloat(th.data.yuer) > total_m) { th.setData({ [txt]: total_m, [txt2]:0 }) }else{ - order_m = order_m - th.data.userinfo.user_money; + order_m = order_m - parseFloat(th.data.yuer); order_m = order_m.toFixed(2); - th.setData({ [txt]: th.data.userinfo.user_money, [txt2]: order_m }) + th.setData({ [txt]: th.data.userinfo.yuer, [txt2]: order_m }) } }else{ th.setData({ [txt]: 0, [txt2]: order_m }) @@ -422,6 +435,13 @@ Page({ 'prom_type':th.data.bn_goods.prom_type, //促销活动类型 'prom_id': th.data.bn_goods.prom_id, //促销活动id }; + + //--导购分享过来的id-- + if(gg.guide_id){ + goods.guide_id=gg.guide_id; + goods.guide_type=gg.guide_type; + } + item.order_goods.push(goods); pdata.push(item); diff --git a/pages/cart/cart2_pt/cart2_pt.wxml b/pages/cart/cart2_pt/cart2_pt.wxml index 4de1c84..58566d5 100644 --- a/pages/cart/cart2_pt/cart2_pt.wxml +++ b/pages/cart/cart2_pt/cart2_pt.wxml @@ -105,7 +105,7 @@ - 使用余额 :¥{{userinfo.user_money}} + 使用余额 :¥{{yuer}} diff --git a/pages/cart/cart_wk/cart_wk.js b/pages/cart/cart_wk/cart_wk.js index 0bd9bda..b224433 100644 --- a/pages/cart/cart_wk/cart_wk.js +++ b/pages/cart/cart_wk/cart_wk.js @@ -389,7 +389,7 @@ Page({ getApp().my_warnning("支付成功",1,th); setTimeout(function () { th.setData({ isclose: 0 }); - wx.navigateTo({ + wx.redirectTo({ url: "/pages/user/order_list/order_list" }) }, 1000) diff --git a/pages/giftpack/birthdaygift/birthdaygift.js b/pages/giftpack/birthdaygift/birthdaygift.js index bc5144e..6889911 100644 --- a/pages/giftpack/birthdaygift/birthdaygift.js +++ b/pages/giftpack/birthdaygift/birthdaygift.js @@ -123,6 +123,14 @@ Page({ th.GetList(); }, onShow: function onShow() { + //--先判断会员状态-- + var user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + wx.navigateTo({ + url: '/pages/getphone/getphone', + }) + return false; + } }, GetReceive: function() { diff --git a/pages/giftpack/buygiftpack/giftpackbuy.js b/pages/giftpack/buygiftpack/giftpackbuy.js index 59bc087..6532ee7 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.js +++ b/pages/giftpack/buygiftpack/giftpackbuy.js @@ -37,6 +37,14 @@ Page({ th.getList(); }, onShow: function() { + //--先判断会员状态-- + var user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + wx.navigateTo({ + url: '/pages/getphone/getphone', + }) + return false; + } }, diff --git a/pages/giftpack/evaluategift/evaluategift.js b/pages/giftpack/evaluategift/evaluategift.js index 189fda9..347f0e0 100644 --- a/pages/giftpack/evaluategift/evaluategift.js +++ b/pages/giftpack/evaluategift/evaluategift.js @@ -136,6 +136,14 @@ Page({ th.GetList(); }, onShow: function() { + //--先判断会员状态-- + var user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + wx.navigateTo({ + url: '/pages/getphone/getphone', + }) + return false; + } }, GetReceive: function() { diff --git a/pages/giftpack/festival/festival.js b/pages/giftpack/festival/festival.js index 473f42f..0d8515c 100644 --- a/pages/giftpack/festival/festival.js +++ b/pages/giftpack/festival/festival.js @@ -130,6 +130,14 @@ Page({ }); }, onShow: function() { + //--先判断会员状态-- + var user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + wx.navigateTo({ + url: '/pages/getphone/getphone', + }) + return false; + } }, GetReceive: function() { diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js index 8455595..54724ac 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.js +++ b/pages/giftpack/giftpacklist/giftpacklist.js @@ -44,6 +44,14 @@ Page({ th.close(); }, onShow: function() { + //--先判断会员状态-- + var user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + wx.navigateTo({ + url: '/pages/getphone/getphone', + }) + return false; + } }, GetBuyPrice: function(e) { diff --git a/pages/giftpack/mygiftpack/mygiftpack.js b/pages/giftpack/mygiftpack/mygiftpack.js index 4944146..c6700b1 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.js +++ b/pages/giftpack/mygiftpack/mygiftpack.js @@ -38,6 +38,14 @@ Page({ th.getList(); }, onShow: function() { + //--先判断会员状态-- + var user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + wx.navigateTo({ + url: '/pages/getphone/getphone', + }) + return false; + } }, getList: function() { diff --git a/pages/giftpack/newvipgift/newvipgift.js b/pages/giftpack/newvipgift/newvipgift.js index 30f0261..b2d88ef 100644 --- a/pages/giftpack/newvipgift/newvipgift.js +++ b/pages/giftpack/newvipgift/newvipgift.js @@ -122,6 +122,14 @@ Page({ th.GetList(); }, onShow: function() { + //--先判断会员状态-- + var user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + wx.navigateTo({ + url: '/pages/getphone/getphone', + }) + return false; + } }, GetReceive: function() { diff --git a/pages/goods/categoryList/categoryList.js b/pages/goods/categoryList/categoryList.js index fcd1c55..28cce2e 100644 --- a/pages/goods/categoryList/categoryList.js +++ b/pages/goods/categoryList/categoryList.js @@ -1,5 +1,4 @@ var t = getApp(), e = t.request, oo = t.globalData.setting; - var i = function (i) { return i && i.__esModule ? i : { default: i @@ -7,65 +6,87 @@ var i = function (i) { }(require("../../../utils/LoadMore.js")), a = new i.default(), ut = require("../../../utils/util.js"); //t = i,e = t Page({ - data: { - is_date:true, - scrollHeight: 0, - currentTab:-1, - abc:0, - windowHeight:0, - windowWidth: 0, - eachLetterHeight:0, - lettersPosition:0, - catelist:null, //分类读取 - nationlist: null,//国家读取 - groups: null, //品牌读取 - iurl: oo.imghost,//图片地址 - - // 当前选择的导航字母 - selected: 0, - // 选择字母视图滚动的位置id - scrollIntoView: 'A', - // 导航字母 - letters: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', - 'U', 'V', 'W', 'X', 'Y', 'Z'], - //控制新旧分类版本 - is_used_share:0, - //国家的控制属性 - is_country:1, - //品牌的控制属性 - is_brand:1, - //选择分类的控制属性 - select_classify_on:223, - index:223, - classify_name:"国家",//项目类型 - brand_list:null,//品牌列表 - - one_level_classify:[],// 新的版本左边的边分类1级 - is_level_three:0,//判断有没有3级 - cat_id:0, - pl_timer: null,//只有品类的定时器 - is_pl_time:0, - requestData:null, //风格三的商品数据列表 分页 - stylePage:1, //商品列表分页标识 - - //风格三使用 - url: t.globalData.setting.imghost, - currentPage: 1, - requestData: null, - allData: null, - openFilterModal: !1, - baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=goods_id&orderType=desc&page=1&is_mainshow=1&isonsale=1&store_id="+oo.stoid+"&is_recommend=1", - requestUrl: "", - tabname: "goods_id", //排序的字段 - adname: "desc", //升降的字段 - is_new: 0, - is_hot: 0, - msgStatus:false, //页面显示暂无数据状态 - countDownNum: 3, - timer: '', //定时器 - lastMsg:false, - toView:"", - }, + data: { + is_date:true, + scrollHeight: 0, + currentTab:-1, + abc:0, + windowHeight:0, + windowWidth: 0, + eachLetterHeight:0, + lettersPosition:0, + catelist:null, //分类读取 + nationlist: null,//国家读取 + groups: null, //品牌读取 + iurl: oo.imghost,//图片地址 + + // 当前选择的导航字母 + selected: 0, + // 选择字母视图滚动的位置id + scrollIntoView: 'A', + // 导航字母 + letters: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', + 'U', 'V', 'W', 'X', 'Y', 'Z'], + //控制新旧分类版本 + is_used_share:0, + //国家的控制属性 + is_country:1, + //品牌的控制属性 + is_brand:1, + //选择分类的控制属性 + select_classify_on:223, + index:223, + classify_name:"国家",//项目类型 + brand_list:null,//品牌列表 + + one_level_classify:[],// 新的版本左边的边分类1级 + is_level_three:0,//判断有没有3级 + cat_id:0, + pl_timer: null,//只有品类的定时器 + is_pl_time:0, + requestData:null, //风格三的商品数据列表 分页 + stylePage:1, //商品列表分页标识 + + //风格三使用 + url: t.globalData.setting.imghost, + currentPage: 1, + allData: null, + openFilterModal: !1, + baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=goods_id&orderType=desc&page=1&is_mainshow=1&isonsale=1&store_id="+oo.stoid+"&is_recommend=1", + requestUrl: "", + tabname: "goods_id", //排序的字段 + adname: "desc", //升降的字段 + is_new: 0, + is_hot: 0, + msgStatus:false, //页面显示暂无数据状态 + countDownNum: 3, + timer: '', //定时器 + lastMsg:false, + toView:"", + is_show_class:false,//是否添加新样式 + status_show:0, + currentTab: 0, //预设当前项的值 + }, + + + //判断当前滚动超过一屏时,设置tab标题滚动条。 + checkCor: function() { + let that = this; + //这里计算按照实际情况进行修改,动态数据要进行动态分析 + //思路:窗体高度/单个分类高度 200rpx 转px计算 =>得到一屏幕所显示的个数,结合后台传回分类总数进行计算 + //数据很多可以多次if判断然后进行滚动距离计算即可 + if (that.data.currentTab > 7) { + that.setData({ + scrollTop: 500 + }) + } else { + that.setData({ + scrollTop: 0 + }) + } + }, + + onLoad: function(tt) { var that = this; that.get_brand(); @@ -156,8 +177,11 @@ Page({ //调用底部导航 t.editTabBar(that,getApp().globalData.setting.stoid,getApp().globalData.url); //this.requestFirstCategoris(); - if(getApp().globalData.user_id) getApp().requestCardNum(); - getApp().getConfig2(function (e) { + setTimeout(function () { + if (getApp().globalData.user_id) getApp().requestCardNum(that); + },500) + + getApp().getConfig2(function (e) { var data=e; var switch_list_data = data.switch_list; @@ -189,10 +213,14 @@ Page({ } that.setData({ is_level_three: is_lev_thr }); if (is_lev_thr!=1) { - that.setData({ select_classify_on: 0, index: 0, classify_name: item.items.name, goodslist: item.array }); - } else { - that.setData({ select_classify_on: 0, index: 0, goodslist: arr }); - } + that.setData({ select_classify_on: 0, index: 0, classify_name: item.items.name,cat_id: item.items.id,goodslist: item.array }); + console.log("id:="+item.items.id) + that.style(that.data.stylePage,that.data.cat_id); + } else { + that.setData({ select_classify_on: 0, index: 0, classify_name: item.items.name,cat_id: item.items.id,goodslist: arr }); + console.log("id:="+item.items.id) + that.style(that.data.stylePage,that.data.cat_id); + } } else{ that.setData({ select_classify_on: 0, index: 0, goodslist: null,classify_name:item.items.name,is_level_three: 0}); @@ -222,6 +250,12 @@ Page({ } else if (that.data.is_show_pl) { that.setData({ currentTab: 0 }); } + // 获取默认选中的第一个 + if(that.data.is_show_gb && that.data.select_classify_on == 223){ + that.setData({ status_show: 1 }); + }else if(that.data.is_show_pp && that.data.select_classify_on == 220){ + that.setData({ status_show: 2 }); + } }) }, @@ -291,8 +325,18 @@ Page({ } } } - } + for(var i=0;i 4){ + arr[i]['items']['name'] = mobile_name.substring(0, 4) + } + } + if(t.data.is_show_pl==1 && t.data.is_show_pp != 1 && t.data.is_show_gb != 1){ + arr[0]['items']['is_show_class'] = true; + } + //console.log(arr) t.setData({one_level_classify:arr}); } @@ -557,6 +601,37 @@ Page({ }, // 新的版本分类点击一级分类 click_classify:function(e){ + let cur = e.currentTarget.dataset.current; + if (this.data.currentTab == cur) { + return false; + } else { + wx.pageScrollTo({ + scrollTop: 0 + }) + this.setData({ + currentTab: cur, + select_classify_on:cur + }) + this.checkCor(); + } + // if(e.currentTarget.dataset.index == 223){ + // this.setData({ status_show: 1}); + // }else if(e.currentTarget.dataset.index == 220){ + // this.setData({ status_show: 2}); + // }else{ + // this.setData({ status_show: 0}); + // } + var arr2 = this.data.one_level_classify + for(var i=0;i + @@ -98,7 +98,7 @@ - + - - + + + - - - -