diff --git a/app.wxss b/app.wxss index 4a90e28..6a43593 100644 --- a/app.wxss +++ b/app.wxss @@ -12,13 +12,17 @@ box-sizing: border-box; } page { - /*background-color: #f2f2f2;*/ + overflow-x: hidden; } button { border-radius: 0; padding-left: 0; padding-right: 0; background-color: transparent; font-size: 28rpx; } +.xc-wc{ + color: #d60021; + +} .wh100 { width: 100%; height: 100%; @@ -42,14 +46,13 @@ button { -webkit-box-orient: vertical; -webkit-line-clamp: 3; } + .pd-bg-fff { padding: 0 30rpx; background-color: #fff; font-size: 32rpx; } -.co-red { - color: #f23030; -} + .hide { display: none; } @@ -129,6 +132,7 @@ justify-content:center; .flex-vertical{ display:flex; align-items:center; + } /* 水平左垂直对齐 */ .flex-left-center{ @@ -136,6 +140,7 @@ align-items:center; justify-content:flex-start; align-items:center; } +.flex{display: flex} /* 水平左对齐 */ .flex-level-left{ display:flex; @@ -158,6 +163,8 @@ align-items:center; display:flex; justify-content:space-around; } +.jc_sb{ justify-content: space-between} + /* 相对定位 */ .rel{ position: relative; @@ -185,6 +192,10 @@ position:fixed; display: flex; justify-content:space-between; } +/* 使文字处于水平线上 */ +.ai-bas{ +align-items: baseline; +} /* 垂直居中 中间等距两边贴边 7.13*/ @@ -249,28 +260,19 @@ justify-content:space-around; font-style: normal; } -.fs20{ - font-size: 20rpx; -} .fs22{ font-size: 22rpx; } -.fs24{ - font-size: 24rpx; -} + .fs26{ font-size: 26rpx; } -.fs28{ - font-size: 28rpx; -} + .fs30{ font-size:30rpx; } -.fs32{ - font-size:32rpx; -} + .fs35{ font-size:35rpx; } @@ -280,11 +282,19 @@ justify-content:space-around; .fs50{ font-size: 50rpx; } -.fs60{ font-size:60rpx;} + /* 7.26 */ -.xc-wc{ - color: #e4374d; + +.red-b{ + background: #d60021; +} +.red-co{ + color: #d60021; + +} +.co-red { + color: #f23030; } .oh{ overflow: hidden; @@ -298,4 +308,42 @@ color: #b9b9b9; } +.xc-fixed{ +position: fixed; +} +.yellow{ + background-color: #ffb03f; +} +.green{ + background-color: #16ba63; +} +.blue_b{ + background-color:#059de5; +} +.blue_c{ + color: #059de5; +} +.powder{ +background: #ffe3e2; + +} +.fs32{ + font-size:32rpx; +} +.fs60{ font-size:60rpx;} +.fs28{ + font-size: 28rpx; +} +.fs20{ + font-size: 20rpx; +} +.fs24{ + font-size: 24rpx; +} +.fs36 { + font-size: 36rpx; +} +.fs40 { + font-size: 40rpx; +} \ No newline at end of file diff --git a/components/nav_box/nav_box.wxss b/components/nav_box/nav_box.wxss index 3885ad2..6356b8e 100644 --- a/components/nav_box/nav_box.wxss +++ b/components/nav_box/nav_box.wxss @@ -1,6 +1,6 @@ .box_main{ - width:100rpx; - height:100rpx; + width:80rpx; + height:80rpx; background:#272636; transition:width 0.8s; -moz-transition:width 0.8s; /* Firefox 4 */ @@ -18,16 +18,19 @@ } .box_main .dian{ - text-align: center; - width:100rpx; - height:100rpx; - color: #ffff; - font-size: 70rpx; - background: none; + text-align: center; +width: 50rpx; +height: 50rpx; +color: #ffff; +font-size: 50rpx; +background: none; + } .box_main .dian image{ - width:75rpx; height:30rpx;margin-top:36rpx; + width: 60rpx; +height: 20rpx; +margin: 30rpx 0 0 10rpx; } .box_main.box_isopen .dian{ @@ -46,14 +49,18 @@ .box_main .cl_list .item{ display: inline-block; width:100rpx; - height:100rpx; + height:80rpx; text-align: center; - line-height: 100rpx; + line-height: 80rpx; color: #fff; vertical-align: top; + font-size: 32rpx; + } .box_main .cl_list .item.big{ - font-size: 70rpx;line-height: 90rpx; + font-size: 70rpx; +line-height: 70rpx; + } diff --git a/images/dpr.png b/images/dpr.png new file mode 100644 index 0000000..2752849 --- /dev/null +++ b/images/dpr.png diff --git a/images/medal.png b/images/medal.png new file mode 100644 index 0000000..1ba68ee --- /dev/null +++ b/images/medal.png diff --git a/images/nothingaddress.png b/images/nothingaddress.png new file mode 100644 index 0000000..39b0e99 --- /dev/null +++ b/images/nothingaddress.png diff --git a/images/share/miao_share.png b/images/share/miao_share.png new file mode 100644 index 0000000..f788197 --- /dev/null +++ b/images/share/miao_share.png diff --git a/pages/cart/cart/cart.js b/pages/cart/cart/cart.js index f27f9ee..9b8e343 100644 --- a/pages/cart/cart/cart.js +++ b/pages/cart/cart/cart.js @@ -527,6 +527,9 @@ Page({ }) } catch (e) { err=e;} if (isok==0){ + if (gname.length > 10) { + gname = gname.substr(0, 10); gname+="..."; + } t.confirmBox(gname+":"+ err); return false; } wx.navigateTo({ diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 6e5dfe2..f5c9ba7 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -72,6 +72,8 @@ Page({ selected_quan_list:null, //选择的券的门店 selected_quan_pick:null, + is_close_quan:0, + disabled:0, }, onLoad: function(t) { @@ -79,10 +81,65 @@ Page({ wx.setNavigationBarTitle({ title: "填写订单",}) var th = this; this.setData({ is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow,}); th.data.param=t; - //-----先获取物流,再获取用户信息,再展示页面----- - th.get_wuliu(th.get_info(th.show_page)); + + //清空is_pick_up + getApp().request.put("/api/weshop/useraddress/updatePickUp", { + data: {user_id: getApp().globalData.user_id, is_pickup: 0}, + success: function (s) { + } + }); + + //先获取是否有关闭使用优惠券 + getApp().getConfig2(function (ee) { + var json_d = JSON.parse(ee.switch_list); + th.setData({ is_close_quan: json_d.is_close_quan }); + //-----先获取物流,再获取用户信息,再展示页面----- + th.get_wuliu(th.get_info(th.show_page)); + }) }, onUnload: function () { this.setData({ isclose: 1 })}, + + //----------子页返回父页触发---------- + onShow: function() { + console.log('onshow'); + var th=this; + console.log(th.data.isclose); + if (th.data.isclose==0){ + /*--- + wx.navigateTo({ + url: "/pages/user/index/index" + //url: "/pages/index/index/index" + })---*/ + wx.switchTab({ + url: "/pages/index/index/index" + }) + + }else{ + this.getuser_addr(function(ie){ + + console.log("getuser_addr") + console.log(ie) + + th.setData({user_addr: ie }); + var going=0; + + //使用计算器,避免空现象 + var jishi= setInterval(function () { + if (th.data.is_b_now == 1 && going==0) { + if(th.data.bn_goods) { + th.calculatePrice2();going=1;clearInterval(jishi); + } + }else if(going==0) { + if (th.data.cartlist){ + th.calculatePrice();going = 1; clearInterval(jishi); + } + } + },500) + + }); + } + }, + //-------------------获取物流--------------- get_wuliu(func) { var th = this; @@ -100,13 +157,7 @@ Page({ }, //------获取会员收货地址----- - getuser_addr:function(func){ - console.log(to.globalData.baddr); - if (to.globalData.baddr!=null){ - var user_addr = to.globalData.baddr; - to.globalData.baddr=null; - func(user_addr); - }else{ + getuser_addr:function(func){ a.get("/api/weshop/useraddress/page", { data: { user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600 }, success: function (su) { @@ -117,15 +168,21 @@ Page({ ];---*/ var user_addr = su.data.data.pageData; var item = null; + var def_item=null; for (var i = 0; i < user_addr.length; i++) { - if (user_addr[i]['is_default'] == 1) { item = user_addr[i]; break; } + if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i];} + if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; } } + + if (item == null) item = def_item; if (item == null) item = user_addr[0]; + + if(item==undefined) item=null; func(item); } }); - } }, + //----------------展示页面,是再获取用户信息之后-------------- show_page:function(){ var th=this,ta = this.data.param; @@ -264,14 +321,30 @@ Page({ arr[ind].check_quan_ware_list=check_quan_ware_list; arr[ind].check_quan_price_list=check_quan_price_list; - //调用接口,获取优惠券的列表 - var url="/api/weshop/couponList/getUseCouponList"; - await app.request.promiseGet(url,{ - data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:ckeck_quan_price,WareIds:check_quan_ware_list,pageSize:100} - }).then(res=>{ - if(res.data.code==0) - arr[ind].quan_list=res.data.data.pageData; - }) + //是否关闭使用优惠券 + if (th.data.is_close_quan != 1) { + //调用接口,获取优惠券的列表 + var url="/api/weshop/couponList/getUseCouponList"; + await app.request.promiseGet(url,{ + data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:ckeck_quan_price,WareIds:check_quan_ware_list,pageSize:100} + }).then(res=>{ + if(res.data.code==0) + arr[ind].quan_list=res.data.data.pageData; + }) + + var frozenQuan=null; + var url0="/api/weshop/users/frozenQuan/listFrozenQuan/"+app.globalData.user_id; + await app.request.promiseGet(url0,{1:1}).then(res=>{ + if(res.data.code==0){ + frozenQuan=res.data.data; + } + }) + + if(frozenQuan){ + arr[ind].quan_list=th.check_is_frozenQuan(arr[ind].quan_list,frozenQuan); + } + + } } th.setData({ @@ -309,6 +382,7 @@ Page({ switch (gd.prom_type){ case 0: + case 6: //--此时开始计算商品的使用券相关,如果有等级价还要计算和等级价相关的, // 如果有优惠促销,还要把促销的部分计算在内,因为促销还有不能使用优惠券-- @@ -317,14 +391,32 @@ Page({ th.data.check_quan_ware_list=t.data.data.erpwareid+""; var quanlist=null; - var url="/api/weshop/couponList/getUseCouponList"; - await app.request.promiseGet(url,{ - data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:th.data.ckeck_quan_price,WareIds:th.data.check_quan_ware_list,pageSize:100} - }).then(res=>{ - if(res.data.code==0) - quanlist=res.data.data.pageData; + + if (th.data.is_close_quan != 1) { + var url="/api/weshop/couponList/getUseCouponList"; + await app.request.promiseGet(url,{ + data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:th.data.ckeck_quan_price,WareIds:th.data.check_quan_ware_list,pageSize:100} + }).then(res=>{ + if(res.data.code==0) + quanlist=res.data.data.pageData; + }) + } + + var frozenQuan=null; + var url0="/api/weshop/users/frozenQuan/listFrozenQuan/"+app.globalData.user_id; + await app.request.promiseGet(url0,{1:1}).then(res=>{ + if(res.data.code==0){ + frozenQuan=res.data.data; + } }) + if(frozenQuan){ + quanlist=th.check_is_frozenQuan(quanlist,frozenQuan); + } + + t.data.data.prom_id = 0; + t.data.data.prom_type = 0; + th.setData({ bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et, bn_pick: gg.pick_id, bn_t_exp_t: distr_t,selected_quan_list:quanlist @@ -334,17 +426,45 @@ Page({ break; case 1: //---秒杀----- - getApp().request.get("/api/weshop/activitylist/getGoodsPrice/"+gd.store_id + var quanlist=null; + getApp().request.get("/api/weshop/activitylist/getSJGoodsPrice/"+gd.store_id + "/" + gd.goods_id + "/1/" + gd.prom_id,{ - success: function (tt) { - if(t.data.code==0){ - t.data.data.shop_price=tt.data.data.prom_price; + success: async function (tt) { + if(tt.data.code==0){ + t.data.data.shop_price=tt.data.data.prom_price; }else{ - t.data.data.prom_id = 0; t.data.data.prom_type = 0; + t.data.data.prom_id = 0; t.data.data.prom_type = 0; + + th.data.ckeck_quan_price=t.data.data.shop_price*gg.goods_num; + th.data.check_quan_price_list=t.data.data.shop_price*gg.goods_num+""; + th.data.check_quan_ware_list=t.data.data.erpwareid+""; + + if (th.data.is_close_quan != 1) { + + var url="/api/weshop/couponList/getUseCouponList"; + await app.request.promiseGet(url,{ + data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:th.data.ckeck_quan_price,WareIds:th.data.check_quan_ware_list,pageSize:100} + }).then(res=>{ + if(res.data.code==0) + quanlist=res.data.data.pageData; + }) + + var frozenQuan=null; + var url0="/api/weshop/users/frozenQuan/listFrozenQuan/"+app.globalData.user_id; + await app.request.promiseGet(url0,{1:1}).then(res=>{ + if(res.data.code==0){ + frozenQuan=res.data.data; + } + }) + + if(frozenQuan){ + quanlist=th.check_is_frozenQuan(quanlist,frozenQuan); + } + } } th.setData({ bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et, - bn_pick: gg.pick_id, bn_t_exp_t: distr_t + bn_pick: gg.pick_id, bn_t_exp_t: distr_t,selected_quan_list:quanlist }); //计算价格 th.calculatePrice2(); @@ -358,28 +478,6 @@ Page({ } }, - //----------子页返回父页触发---------- - onShow: function() { - console.log('onshow'); - var th=this; - console.log(th.data.isclose); - if (th.data.isclose==0){ - /*--- - wx.navigateTo({ - url: "/pages/user/index/index" - //url: "/pages/index/index/index" - })---*/ - wx.switchTab({ - url: "/pages/index/index/index" - }) - - }else{ - this.getuser_addr(function(ie){ - th.setData({user_addr: ie }); - }); - - } - }, //---------------检查是否有收货地址------------------- checkAddressList: function() { var t = this; @@ -676,7 +774,10 @@ Page({ if (th.data.is_b_now==1){ console.log("buy_new"); - if(th.data.bn_exp_type == 0 && th.data.user_addr==null ){ ff = false; confirmBox("请新建收货地址"); } + if(th.data.bn_exp_type == 0 && th.data.user_addr==null ){ + ff = false; getApp().my_warnning("请选择收货地址",0,th); + this.data.is_summit_ing = 0; + } if (!ff) return false; var addr = th.data.user_addr; if (th.data.bn_exp_type == 1) addr=null; @@ -687,7 +788,7 @@ Page({ if(th.data.bn_exp_type==0) if(th.data.wu_arr==null || th.data.wu_arr.length<=0){ - confirmBox("读取物流失败"); + getApp().my_warnning("读取物流失败",0,th); return false; } @@ -701,7 +802,8 @@ Page({ 'twon': addr == null ? 0 : addr.twon, 'address': addr == null ? "": addr.address, 'more_address': addr == null ? "" : addr.more_address, - 'mobile': th.data.userinfo.mobile, + //'mobile': th.data.userinfo.mobile, + 'mobile': addr == null ? th.data.userinfo.mobile : addr.mobile, 'email':'', 'shipping_code': th.data.bn_exp_type == 1 ? 0 : th.data.wu_arr[th.data.index].code, 'shipping_name': th.data.bn_exp_type == 1 ? '' : th.data.wu_arr[th.data.index].name, @@ -752,7 +854,7 @@ Page({ console.log(pdata); }else{ //---------购物车的结算--------- - if (th.data.is_all_zt == 0 && th.data.user_addr == null) { ff = false;confirmBox("请新建收货地址");} + if (th.data.is_all_zt == 0 && th.data.user_addr == null) { ff = false; getApp().confirmBox("请新建收货地址");} if (!ff) return false; var addr = th.data.user_addr; @@ -763,7 +865,7 @@ Page({ if(th.data.is_all_zt !=1) if(th.data.wu_arr==null || th.data.wu_arr.length<=0 ){ - confirmBox("读取物流失败"); + getApp().confirmBox("读取物流失败"); return false; } @@ -885,15 +987,19 @@ Page({ a.post("/api/weshop/order/pay/createOrder", { data: dd, success: function (t) { - console.log(t); - //app.showWarning("支付成功"); - app.my_warnning("支付成功",1,th); - setTimeout(function () { - th.setData({ isclose: 0 }); - wx.navigateTo({ - url: "/pages/user/order_list/order_list" - }) - }, 1000) + //console.log(t); + if(t.data.code==0){ + app.my_warnning("支付成功",1,th); + setTimeout(function () { + th.setData({ isclose: 0 }); + wx.navigateTo({ + url: "/pages/user/order_list/order_list" + }) + }, 1000) + } + }, + fail:function () { + } }); } @@ -936,7 +1042,7 @@ Page({ }, enterAddressPage: function() { this.data.enterAddressPage = !0, wx.navigateTo({ - url: "/pages/user/address_list/address_list?operate=select" + url: "/pages/user/address_list/address_list?is_back=1" }); }, @@ -1059,13 +1165,9 @@ Page({ var bn=e.currentTarget.dataset.bn; var cindx=e.currentTarget.dataset.cind; - console.log("open_coupon_list--quan"); - console.log("门店:"+pickid); - console.log(bn); - if(bn==1){ - th.setData({open_quan:1,selected_quan_pick:pickid}); + th.setData({open_quan:1,selected_quan_pick:pickid, disabled:1}); }else{ //---多单打开券的时候,就要判断券在其他门店是否有使用--- var quanlist=th.data.cartlist[cindx].quan_list; @@ -1074,12 +1176,12 @@ Page({ var is_using= th.check_in_sele(quanlist[i].CashRepNo,pickid); if(is_using) quanlist[i].is_using=1; } - th.setData({open_quan:1,selected_quan_pick:pickid,selected_quan_list:quanlist}); + th.setData({open_quan:1,selected_quan_pick:pickid,selected_quan_list:quanlist,disabled:1}); } }, close_coupon:function (e) { var th=this; - th.setData({open_quan:0}); + th.setData({open_quan:0,disabled:0}); }, //---判断券时候在已经选择的列表中--- @@ -1185,6 +1287,33 @@ Page({ th.calculatePrice(); } th.setData({open_quan:0}); + }, + + cart_set_err:function(e){ + var txt = e.currentTarget.dataset.err; + var ob={}; + ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif"; + this.setData(ob); + }, + + //--验证是否已经冻结-- + check_is_frozenQuan:function(quanlist,frozenQuan){ + var arr=[]; + for(var i=0;i - + @@ -53,7 +54,7 @@ + wx:if="{{item.quan_list && item.quan_list.length>0 }}" data-cind="{{pidx}}" data-pickid="{{item.pickup_id}}"> 使用优惠券 @@ -88,7 +89,7 @@ 用户备注(50字) - + {{maxWord}}/50 @@ -108,7 +109,7 @@ 门店:{{bn_pickname}} - + {{bn_goods.goods_name}} @@ -126,7 +127,7 @@ + wx:if="{{selected_quan_list && selected_quan_list.length>0}}"> 使用优惠券 @@ -182,19 +183,9 @@ - 用户备注(50字) - + {{maxWord}}/50 @@ -257,29 +248,30 @@ - + - 不使用优惠券 - + 不使用优惠券 + - - + + - + {{item.Sum}}元 + 订单满{{item.BuySum}}元使用 使用期限 {{filters.replace_time(item.BeginDate)}}至{{filters.replace_time(item.ValidDate)}} - - + + diff --git a/pages/cart/cart2/cart2.wxss b/pages/cart/cart2/cart2.wxss index 4f03880..f1710ad 100644 --- a/pages/cart/cart2/cart2.wxss +++ b/pages/cart/cart2/cart2.wxss @@ -279,7 +279,7 @@ border-bottom:1px solid #ddd; } .xc-coupon-frame .work-frame{ - width: 92%; + width: 94%; height: 100%; } @@ -294,7 +294,7 @@ } .xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; color: #d81e06;} -.xc-right-frame{font-size: 30rpx;line-height: 92rpx; } +.xc-right-frame{font-size: 30rpx;line-height: 92rpx; margin-right: 10rpx } /* 自定义弹出窗口 */ .cx-popup{ @@ -310,7 +310,7 @@ .cx-popup .top{ width:100%; - height:133rpx; + height:100rpx; border-bottom:3rpx solid #ddd; @@ -318,7 +318,7 @@ .xc-top-content{ width: 88%; height:85rpx; - padding-top: 50rpx; + padding-top: 20rpx; font-size: 36rpx; } @@ -341,26 +341,25 @@ height: 100%; overflow-y:scroll; - margin-top:20rpx; - } .xc-close-frame{ - margin-top:30rpx; - width:15%; - display:flex; + margin-top:10rpx; + width:1%; } .xc-close{ - width:70rpx; - height:70rpx; - border-radius:50%; - border:5rpx solid #a5a5a7; - text-align:center; - line-height: 55rpx; - font-size:80rpx; - color:#a5a5a7; - font-family:"微软正黑体"; - margin-top:8rpx; + width: 46rpx; +height: 46rpx; +border-radius: 50%; +border: 5rpx solid #a5a5a7; +text-align: center; +line-height: 46rpx; +font-size: 34rpx; +font-weight: bolder; +color: #a5a5a7; +margin-top: 5rpx; + + } .xc-money{ @@ -374,7 +373,7 @@ } .xc-coupon-effect{ width: 99%; - height: 128rpx; + min-height: 100rpx; border-bottom:3rpx solid #ddd; @@ -389,10 +388,24 @@ margin-left:222rpx; } +.xc-coupon-money0{ + color: #c91e31; + font-size: 35rpx; + line-height: 40rpx; + +} .xc-coupon-money{ color: #c91e31; font-size: 35rpx; - margin-top:20rpx; + line-height: 40rpx; + padding-top: 10px; + +} +.xc-coupon-money1{ + color: #444; + font-size: 28rpx; + line-height: 60rpx; + } .xc-coupon-time{ @@ -427,8 +440,8 @@ @keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } } .xc-not-Selection{ - width: 60rpx; - height: 60rpx; + width: 40rpx; +height: 40rpx; background: #eeeeee; } diff --git a/pages/cart/cart2_pt/cart2_pt.js b/pages/cart/cart2_pt/cart2_pt.js index 015109d..2e733c3 100644 --- a/pages/cart/cart2_pt/cart2_pt.js +++ b/pages/cart/cart2_pt/cart2_pt.js @@ -54,6 +54,7 @@ Page({ is_pt_tz:0,//是否开团团长 qh:'', //期号 pt_listno:'',//期号 + is_normal:0 }, onLoad: function(t) { console.log("onLoad_pt_cart"); @@ -106,10 +107,14 @@ Page({ var user_addr = su.data.data.pageData; var item = null; + var def_item=null; for (var i = 0; i < user_addr.length; i++) { - if (user_addr[i]['is_default'] == 1) { item = user_addr[i]; break; } + if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i]; } + if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; } } + if (item == null) item = def_item; if (item == null) item = user_addr[0]; + if (item == undefined) item = null; func(item); } }); @@ -159,7 +164,7 @@ Page({ t.data.data.is_normal=1; th.setData({ bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et, - bn_pick: gg.pick_id, bn_t_exp_t: distr_t + bn_pick: gg.pick_id, bn_t_exp_t: distr_t, is_normal:1 }); th.calculatePrice2(); }else{ @@ -340,7 +345,11 @@ Page({ //------------立即购买------------- console.log("buy_new"); - if(th.data.bn_exp_type == 0 && th.data.user_addr==null ){ ff = false; confirmBox("请新建收货地址"); } + if(th.data.bn_exp_type == 0 && th.data.user_addr==null ){ + ff = false; + getApp().my_warnning("请选择收货地址",0,this); + this.data.is_summit_ing = 0; + } if (!ff) return false; var addr = th.data.user_addr; if (th.data.bn_exp_type == 1) addr=null; @@ -351,7 +360,8 @@ Page({ if(th.data.bn_exp_type==0) { if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) { - confirmBox("读取物流失败"); + getApp().my_warnning("读取物流失败",0,this); + this.data.is_summit_ing = 0; return false; } } @@ -380,11 +390,15 @@ Page({ 'pickup_id': th.data.bn_pick, //门店 'exp_type': th.data.bn_exp_type, //配送方式 'is_normal':th.data.bn_goods.is_normal, //是否是普通购买 - 'pt_prom_id':th.data.bn_goods.prom_id, //拼单ID - 'is_zsorder':th.data.kt_type+1, //开团类型 - 'is_pt_tz':th.data.is_pt_tz, //开团类型 - 'order_goods':new Array(), + 'pt_prom_id':th.data.bn_goods.prom_id, //拼单ID + 'is_pt_tz':th.data.is_pt_tz, //开团类型 + 'order_goods':new Array(), }; + + if(!th.data.bn_goods.is_normal){ + item.is_zsorder=th.data.kt_type+1; //开团类型 + } + if(th.data.qh!='') { item.team_qh=th.data.qh; @@ -462,9 +476,18 @@ Page({ app.my_warnning("支付成功",1,th); setTimeout(function () { th.setData({ isclose: 0 }); - wx.navigateTo({ - url: "/pages/team/team_success/team_success?ordersn=" + data.data, - }) + + if(th.data.is_normal==1){ + wx.navigateTo({ + url: "/pages/user/order_list/order_list", + }) + }else{ + wx.navigateTo({ + url: "/pages/team/team_success/team_success?ordersn=" + data.data, + }) + } + + }, 1000) } }); @@ -616,5 +639,13 @@ Page({ var ind=e.detail.value, txt = e.currentTarget.dataset.txt; this.setData({ [txt]: ind }); this.calculatePrice(); - } + }, + + cart_set_err: function (e) { + var txt = e.currentTarget.dataset.err; + var ob = {}; + ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif"; + this.setData(ob); + } + }); diff --git a/pages/cart/cart2_pt/cart2_pt.wxml b/pages/cart/cart2_pt/cart2_pt.wxml index 04b2851..ed4506d 100644 --- a/pages/cart/cart2_pt/cart2_pt.wxml +++ b/pages/cart/cart2_pt/cart2_pt.wxml @@ -31,7 +31,8 @@ 门店:{{bn_pickname}} - + {{bn_goods.goods_name}} @@ -49,7 +50,7 @@ - + 自提 @@ -61,7 +62,7 @@ - + - + 商品金额 ¥ {{formData.all_price}}元 + + + 定金金额 + ¥ {{formData.all_price}}元 + + 配送费用 ¥ {{formData.shipping_price}}元 - 使用余额 - ¥ {{formData.user_money}}元 diff --git a/pages/cart/cart_wk/cart_wk.js b/pages/cart/cart_wk/cart_wk.js index c53abc7..355498f 100644 --- a/pages/cart/cart_wk/cart_wk.js +++ b/pages/cart/cart_wk/cart_wk.js @@ -34,13 +34,23 @@ Page({ enterAddressPage: 0, //进入地址页面 allpice:0, - show_pay_type:0, + show_pay_type:0, + + teamgroup: null, }, /** * 生命周期函数--监听页面加载 */ onLoad: function(options) { + + //清空is_pick_up + getApp().request.put("/api/weshop/useraddress/updatePickUp", { + data: {user_id: getApp().globalData.user_id, is_pickup: 0}, + success: function (s) { + } + }); + var th = this; this.data.order_id = options.order_id; //--初始化-- @@ -59,12 +69,16 @@ Page({ th.getuser_addr(function(addr) { if(addr==null || addr==undefined || addr.length==0) { - th.setData({ enterAddressPage: 1,}); + th.setData({ user_addr: null, enterAddressPage: 1,}); }else { th.setData({ user_addr: addr, enterAddressPage: 0, }); } + + if (th.data.exp_type == 0){ + th.calculate_wuliu(); + } }) }, @@ -92,13 +106,9 @@ Page({ //------获取会员收货地址----- getuser_addr: function(func) { - var to = getApp(), + var to = getApp(), a = to.request; - if (to.globalData.baddr != null) { - var user_addr = to.globalData.baddr; - to.globalData.baddr = null; - func(user_addr); - } else { + a.get("/api/weshop/useraddress/page", { data: { user_id: to.globalData.user_id, @@ -108,17 +118,19 @@ Page({ success: function(su) { var user_addr = su.data.data.pageData; var item = null; + var def_item = null; for (var i = 0; i < user_addr.length; i++) { - if (user_addr[i]['is_default'] == 1) { - item = user_addr[i]; - break; - } + if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i]; } + if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; } } + + if (item == null) item = def_item; if (item == null) item = user_addr[0]; + if (item == undefined) item = null; func(item); } }); - } + }, //----------------展示页面,是再获取用户信息之后-------------- @@ -215,7 +227,9 @@ Page({ jsarr.forEach(function(value,index){ if(count>=value['rynum']) price=value['price']; }) - var tail_money=price*order_goods.goods_num-order['order_amount']-order['user_money']; + var tail_money =(price*order_goods.goods_num-order['order_amount']-order['user_money']).toFixed(2); + + tail_money = parseFloat(tail_money); order.tail_money=tail_money; //--判断物流-- @@ -242,14 +256,15 @@ Page({ distr_type: distr_type, pickup: pickup, exp_type: exp_type, - goods:goods + goods:goods, + teamgroup:teamgroup }); //--计算物流-- if(exp_type==0){ th.calculate_wuliu(); }else{ - var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money; + var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money; allpice = allpice.toFixed(2); th.setData({ exp_price: 0, allpice: allpice }) } @@ -280,16 +295,19 @@ Page({ this.setData({ exp_type: type }); + + + //--计算物流的值-- if (type == 0) { th.calculate_wuliu(); }else{ var allpice= parseFloat(th.data.order.order_amount) + parseFloat(th.data.order.user_money) - +parseFloat(th.data.order.pt_tail_money); + +parseFloat(th.data.order.tail_money); allpice=allpice.toFixed(2); this.setData({ - allpice: allpice + allpice: allpice, exp_price: 0, }); } }, @@ -300,6 +318,11 @@ Page({ }, //--弹起支付框-- to_pay(){ + //--物流支付时要有地址-- + if (this.data.exp_type == 0 && this.data.user_addr == null) { + return getApp().my_warnning("请选择收货地址", 0, this); + } + this.setData({show_pay_type:1}); }, @@ -312,6 +335,12 @@ Page({ //--立即支付-- to_pay_type: function(ind) { var th=this; + + //--物流支付时要有地址-- + if (th.data.exp_type == 0 && th.data.user_addr==null){ + return getApp().my_warnning("请选择收货地址",0,th); + } + //---支付参数-- var dd = { order_sn: th.data.order.order_sn, @@ -323,6 +352,7 @@ Page({ prom_id:th.data.order.pt_prom_id, tail_pay_type:ind,//0微信支付 1余额支付 }; + if(th.data.exp_type==0){ var index=th.data.index; dd.shipping_code=th.data.wu_arr[index].code; @@ -348,7 +378,7 @@ Page({ var n=t.data.data; th.weixinPay(n, function () { - var allmoney=th.data.order.user_money+th.data.order.order_amount+th.data.order.pt_tail_money; + var allmoney=th.data.allpice; th.jumpPaymentPage(th.data.order.order_sn,allmoney); },function () { getApp().my_warnning("支付失败",0,th); @@ -386,12 +416,12 @@ Page({ case 2: if (goods_weight < 0) goods_weight = 0; //累积商品重量 每种商品的重量 * 数量 - goods_weight += good['weight'] * good['buynum']; + goods_weight += good['weight'] * th.data.order.order_goods['goods_num']; break; case 3: if (goods_piece < 0) goods_piece = 0; //累积商品数量 - goods_piece += good['buynum']; + goods_piece += th.data.order.order_goods['goods_num']; break; } var code = th.data.wu_arr[th.data.index].code; @@ -404,9 +434,11 @@ Page({ var exp_price = parseFloat(shipping_price).toFixed(2); allpice=parseFloat(exp_price)+parseFloat(allpice); allpice=allpice.toFixed(2); + + exp_price = parseFloat(exp_price); th.setData({ exp_price: exp_price,allpice:allpice }) }else { - var allpice=th.data.order.order_amount+th.data.order.user_money+th.data.order.pt_tail_money; + var allpice=th.data.order.order_amount+th.data.order.user_money+th.data.order.tail_money; allpice=allpice.toFixed(2); th.setData({ exp_price: 0,allpice:allpice }) } @@ -479,7 +511,7 @@ Page({ //--进入收货地址的编辑页面-- enterAddressPage: function() { this.data.enterAddressPage =1, wx.navigateTo({ - url: "/pages/user/address_list/address_list?operate=select" + url: "/pages/user/address_list/address_list?is_back=1" }); }, diff --git a/pages/cart/cart_wk/cart_wk.json b/pages/cart/cart_wk/cart_wk.json index 4fca492..a3afde3 100644 --- a/pages/cart/cart_wk/cart_wk.json +++ b/pages/cart/cart_wk/cart_wk.json @@ -1,4 +1,5 @@ { + "navigationBarTitleText": "支付尾款", "usingComponents": { "warn": "/components/long_warn/long_warn" } diff --git a/pages/cart/cart_wk/cart_wk.wxml b/pages/cart/cart_wk/cart_wk.wxml index 35a361b..a4aa7a6 100644 --- a/pages/cart/cart_wk/cart_wk.wxml +++ b/pages/cart/cart_wk/cart_wk.wxml @@ -1,5 +1,4 @@ - - + - \ No newline at end of file diff --git a/pages/cart/cart_wk/cart_wk.wxss b/pages/cart/cart_wk/cart_wk.wxss index dff9c12..e8f3bf6 100644 --- a/pages/cart/cart_wk/cart_wk.wxss +++ b/pages/cart/cart_wk/cart_wk.wxss @@ -3,7 +3,7 @@ .user-mes { position: relative; background-color: #fff; - font-size: 32rpx; + font-size: 30rpx; color: #444; } .user-contact { @@ -60,13 +60,14 @@ } .top { - widows: 100%; - background-color: white; - min-height: 70rpx; - display: flex; - padding: 10rpx; - border-bottom: 2rpx solid rgb(238, 238, 238); - margin-top: 20rpx; + + background-color: white; +height: 40px; +display: flex; +padding: 10rpx 0 0 0; +border-bottom: 2rpx solid rgb(238, 238, 238); +margin-top: 10rpx; + } .t_img image { @@ -75,7 +76,7 @@ } .t_wz { - font-size: 36rpx; + font-size: 30rpx; font-weight: bold; color: rgb(0, 0, 0); line-height: 65rpx; @@ -104,7 +105,7 @@ .center .cen_name { height: 120rpx; width: 370rpx; - font-size: 36rpx; + font-size: 30rpx; padding-left: 10rpx; overflow:hidden; text-overflow:ellipsis; @@ -113,7 +114,7 @@ .center .cen_jg { color: #c4182e; - font-size: 40rpx; + font-size: 32rpx; width: 200rpx; height: 40rpx; text-align: right; @@ -121,8 +122,7 @@ .center .cen_jg .cen_sl { color: black; - font-size: 32rpx; - font-weight: bold; + font-size: 26rpx; width: 200rpx; height: 38rpx; } @@ -137,20 +137,20 @@ } .quhou .qu_fs { - font-size: 38rpx; + font-size: 30rpx; display: flex; - height: 80rpx; + height: 60rpx; margin-left: 25rpx; line-height: 62rpx; } .quhou .qu_fs image { - width: 46rpx; - height: 46rpx; + width: 34rpx; + height: 34rpx; margin-right: 18rpx; vertical-align: center; position: relative; - top:8rpx + top:14rpx } .quhou .qu_fs .qu_wz {} @@ -161,14 +161,14 @@ background-color: white; padding: 20rpx 10rpx; margin-top: 20rpx; - font-size: 36rpx; + font-size: 28rpx; } .chentuan .ct_one { height: 40rpx; margin-bottom: 10rpx; display: flex; - width: 100%; + width: 708rpx; } .chentuan .ct_one .ct_one_left { @@ -177,7 +177,6 @@ .chentuan .ct_one .ct_one_right { text-align: right; - margin-left: 358rpx; width: 200rpx; } @@ -190,7 +189,7 @@ width: 100%; min-height: 80rpx; line-height: 80rpx; - font-size: 38rpx; + font-size: 30rpx; position: fixed; bottom: 0; text-align: right; @@ -208,7 +207,7 @@ .zf .zf_btn { color: white; background-color: #c4182e; - font-size: 30rpx; + font-size: 28rpx; width: 170rpx; text-align: center; line-height: 80rpx; diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 16ee9ee..2c273f7 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -50,8 +50,7 @@ Page({ activeCategoryId: 0, supportPageScroll: !1, address: { - address: "", - district: 0 + address: "", district: 0 }, shipping: "", shippingCost: 0, @@ -145,7 +144,7 @@ Page({ pd_xx: 0, is_normal: 0, //是否普通购买 teamgroup:null, //有多少人开团 - grounp_tatal:0, //有几个人开团 + grounp_tatal:0, //有几个人开团 timer:[], //商品的购买次数 @@ -174,12 +173,10 @@ Page({ quan_list:null, //券列表 coupon:0, - //会员分享的头像 share_head:"", share_goods_img:"", - //----------视频图片data参数--------- current: 0,//图片计数 swiperCurrent:0,//轮播的下标 @@ -203,15 +200,18 @@ Page({ is_show_pl:0, //是否品类 is_show_pp:0, //是否品牌 is_show_gb:0, //是否国别 + is_closecoupon:0, + + //是否点赞中 + iszaning: 0, }, //------初始化加载---------- onLoad: function(t) { wx.setNavigationBarTitle({ title: "商品详情",}) - var ee = this, that=ee, + var ee = this, that=ee,th=ee, gid = t.goods_id; - //如果tg_id是空的话,分享回来 if (gid == undefined || gid == null || gid == "") { gid = decodeURIComponent(postdata.scene); @@ -221,33 +221,35 @@ Page({ gid: gid }); + + getApp().getConfig2(function (e) { + if (e.categoryset.indexOf("," + 1 + ",") != -1) { ee.setData({ is_show_pl: 1 }); } + if (e.categoryset.indexOf("," + 3 + ",") != -1) { ee.setData({ is_show_pp: 1 }); } + if (e.categoryset.indexOf("," + 2 + ",") != -1) { ee.setData({ is_show_gb: 1 }); } + + var json_d = JSON.parse(e.switch_list); + ee.setData({ store_config: e, is_closecoupon: json_d.is_closecoupon }); + ee.init(gid); + //------几人评价------- + n.init(th, "", "comments"); + th.requestCardNum(), wx.pageScrollTo && th.setData({ + supportPageScroll: !0 + }); + + }) + + //获取用户设备信息,屏幕宽度 wx.getSystemInfo({ success: res => { that.setData({ screenWidth: res.screenWidth }) } }) - - ee.init(gid); - //------几人评价------- - n.init(this, "", "comments"); - this.requestCardNum(), wx.pageScrollTo && this.setData({ - supportPageScroll: !0 - }); - - getApp().getConfig2(function (e) { - - if(e.categoryset.indexOf(","+1+",")!=-1){ ee.setData({is_show_pl:1}); } - if(e.categoryset.indexOf(","+3+",")!=-1){ ee.setData({is_show_pp:1}); } - if(e.categoryset.indexOf(","+2+",")!=-1){ ee.setData({is_show_gb:1}); } - ee.setData({store_config:e}); - }) - }, //------------程序初始化入口------------- async init(gid) { - var ee = this, + var ee = this,th=ee, gallery = null, is_collect = 0, collect_id = 0, @@ -347,17 +349,19 @@ Page({ } } - //----获取详情页的券的数量---- - await getApp().request.promiseGet("/api/weshop/prom/coupon/page", { - data: { - store_id: os.stoid, - type:1, - pageSize: 3, - page:1, - }, - }).then(res1 => { - fir_quan=res1.data.data.pageData; - }) + if (th.data.is_closecoupon!=1){ + //----获取详情页的券的数量---- + await getApp().request.promiseGet("/api/weshop/prom/coupon/page", { + data: { + store_id: os.stoid, + type:1, + pageSize: 3, + page:1, + }, + }).then(res1 => { + fir_quan=res1.data.data.pageData; + }) + } //--------获取视频图片--------- @@ -395,8 +399,6 @@ Page({ //---展示--- onShow: function() { - - this.data.is_timer=1; var ee = this,gid = this.data.gid,i=getApp().request; i.get("/api/weshop/goods/get/" + o.stoid + "/" + ee.data.gid, { @@ -690,6 +692,7 @@ Page({ user_id: oo.user_id, store_id: th.data.stoid, goods_price: o.shop_price, + member_goods_price: o.shop_price, goods_name: o.goods_name, goods_sn: o.goods_sn, sku: o.sku, @@ -698,6 +701,7 @@ Page({ //-----如果是秒杀,团购,积分购,拼团----- if (th.data.prom_type == 1) { newd.goods_price = th.data.prom_price; + newd.member_goods_price= th.data.prom_price, newd.prom_type = th.data.prom_type; newd.prom_id = th.data.prom_id; } else if (th.data.prom_type == 3) { @@ -1341,7 +1345,7 @@ Page({ } //----已经过期----- var now = ut.gettimestamp(); - if (t.data.data.end_time < now) { + if (t.data.data.end_time < now ) { ee.setData({ prom_type: 0,isshow:1, }); @@ -1429,7 +1433,7 @@ Page({ //----已经结束----- if (t.data.data.is_end == 1) { ee.setData({ - prom_type: 0,isshow:1, + prom_type: 0,isshow:1, }); ee.get_sku(os.stoid, ee.data.data.sku, gid); return false; @@ -1468,15 +1472,39 @@ Page({ th.data.buy_order = odr; if (odr.pt_status == 0 && odr.order_status == 1) { th.setData({ - user_order_pt_state: 1 + user_order_pt_state: 1 }); } if (odr.pt_status == 1 && odr.order_status == 1) { - th.setData({ - user_order_pt_state: 2 - }); + if (odr.is_zsorder == 4){ + getApp().request.promiseGet("/api/weshop/teamgroup/page/", { + data: { store_id: os.stoid, team_id: odr.pt_prom_id, listno: odr.pt_listno } + }).then(res => { + var now=ut.gettimestamp(); + var tgr = res.data.data.pageData[0]; + //如果团的时间已经到了 + if (now >= tgr.kt_end_time){ + th.update_jiti(tgr.id); + }else{ + th.setData({ + user_order_pt_state: 2 + }); + } + }) + + }else{ + th.setData({ + user_order_pt_state: 2 + }); + } + } + + if (odr.pt_status == 2 && odr.is_zsorder == 4) { + th.setData({ + user_order_pt_state: 3, + }); + th.data.wk_order_id=odr.order_id; } - } }, }); @@ -1892,7 +1920,7 @@ Page({ if (newd.kt_type > 1) { newd.is_pt_tz = 1; //开团类型 } - if (newd.kt_type == 3){ + if (newd.kt_type == 3 && th.data.is_normal!=1){ th.data.sto_sele_distr=1; } @@ -2045,6 +2073,9 @@ Page({ } var iszan=th.data.comments[item_id].userZanNum; + if(this.data.iszaning) return false; + this.data.iszaning=1; + app.request.post("/api/weshop/commentZan/save",{ data:{store_id:o.stoid,user_id:app.globalData.user_id,goods_id:th.data.gid,comment_id:com_id}, @@ -2052,11 +2083,11 @@ Page({ if (ee.data.code == "-1") { app.my_warnning("不能给自己点赞", 0, th); + th.data.iszaning=0; return; } if(ee.data.code==0 && iszan!=1){ - var num=th.data.comments[item_id].zan_num; num++; var text="comments["+item_id+"].zan_num"; var text1="comments["+item_id+"].userZanNum"; @@ -2064,6 +2095,7 @@ Page({ _errObj[text]=num; _errObj[text1]=1; th.setData(_errObj); + }else{ var num=th.data.comments[item_id].zan_num; num--; var text="comments["+item_id+"].zan_num"; @@ -2073,6 +2105,11 @@ Page({ _errObj[text1]=0; th.setData(_errObj); } + + setTimeout(function(){ + th.data.iszaning = 0; + },500) + } }) }, @@ -2215,10 +2252,7 @@ Page({ //---产品名称--- //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 console.log("ssssssss", th.data.data.goods_name); - -f //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 - console.log("ssssssss", th.data.data.goods_name); - + context.setFillStyle("black"); context.setFontSize(21.3 * unit) th.draw_Text(context, th.data.data.goods_name, @@ -2248,7 +2282,6 @@ f //文本换行 参数:1、canvas对象,2、文本 3、距离左 //-------大图后面就不一样了----------- switch (type) { case 0: //普通商品的展示 - case 1: //秒杀商品的展示 //中间的几个字 var g_path = "../../../images/share/s_gou.png"; context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit); @@ -2278,6 +2311,26 @@ f //文本换行 参数:1、canvas对象,2、文本 3、距离左 //---二维吗图--- context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit); break; + case 1: //秒杀商品的展示 + //---画线--- + context.setLineWidth(1 * unit) + context.moveTo(32 * unit, 670 * unit) + context.lineTo(520 * unit, 670 * unit) + context.stroke(); + + //画秒杀的图片 + var miaos_path='../../../images/share/miao_share.png'; + context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit); + + //---文字--- + context.setFontSize(22 * unit) + context.setFillStyle("black") + context.fillText("特惠好物,限时秒杀", 40 * unit, 806 * unit); + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit); + //---二维吗图--- + context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit); + break; + case 2://会员团和商家团的展示 //---画线--- context.setLineWidth(1 * unit) @@ -2558,6 +2611,37 @@ f //文本换行 参数:1、canvas对象,2、文本 3、距离左 getApp().goto(url); }, + //--跳转到支付尾款界面-- + go_pay_wk:function () { + var url = "/pages/cart/cart_wk/cart_wk?order_id="+ this.data.wk_order_id; + getApp().goto(url); + }, + + pop_err_img:function(e){ + var txt = e.currentTarget.dataset.errorimg; + var ob={}; + ob[txt] = this.data.iurl + "/miniapp/images/default_g_img.gif"; + this.setData(ob); + }, + //--调用更新阶梯团的接口-- + update_jiti:function(id){ + var th=this; + //--更新阶梯团-- + getApp().request.put("/api/weshop/teamgroup/updateTeamOrder/"+os.stoid+"/"+id, { + success: function (ee) { + //--等于0是要去支付尾款,接口调用失败,就要去查看参团详情-- + if (ee.data.code==0) { + th.setData({ + user_order_pt_state: 3, + }); + }else if(ee.data.code==-1){ + th.setData({ + user_order_pt_state: 2, + }); + } + } + }) + } }); \ No newline at end of file diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml index 2da3d7f..457321e 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -2,9 +2,7 @@ - - @@ -126,9 +124,10 @@ - + {{data.goods_name}} + - + 销量:{{data.sales_sum}}件 折扣:{{data.disc}}折 {{categories3[0].num}}人评价 @@ -268,29 +267,40 @@ 零售价¥{{data.market_price}} - 已抢:{{prom_act.buy_num}}件 + 已抢:{{prom_act.buy_num+prom_act.virtual}}件 秒杀立省¥{{filters.toFix(data.market_price-prom_price,2)}} - + {{data.goods_name}} - - - 总数量:{{prom_act.goods_num}}件 - 限购:{{prom_act.buy_limit}}件 - 已购:{{prom_act.buy_num}}件 + + + + + 总数量:{{prom_act.goods_num+prom_act.virtual}}件 + 限购:{{prom_act.buy_limit}}件 + 已购:{{prom_act.buy_num+prom_act.virtual}}件 + + + + 总数量:{{prom_act.goods_num}}件 + 限购:{{prom_act.buy_limit}}件 + 已购:{{prom_act.buy_num}}件 + + + - + 领券 @@ -682,11 +692,11 @@ - + ¥{{filters.toFix(prom_act.yf_price,2)}} 支付定金 - + 即将开始 已抢光 活动已经结束 @@ -694,6 +704,7 @@ 您还未支付 查看支付详情 + 支付尾款 @@ -711,9 +722,9 @@ - + - {{data.goods_name}} + ¥ {{sele_g.shop_price}} ¥ {{prom_price}} @@ -722,7 +733,8 @@ 已选:{{sku_g[0].gg}} - 已售:{{prom_act.buy_num+prom_act.virtual}} + 已售:{{prom_act.buy_num+prom_act.virtual}} + 已售:{{prom_act.buy_num}} 可售:{{prom_act.goods_num-prom_act.buy_num}} 已选:{{sku_g[0].gg}} @@ -796,11 +808,10 @@ - + - {{data.goods_name}} - ¥ {{sele_g.shop_price}} - + + ¥ {{sele_g.shop_price}} ¥ {{prom_price}} @@ -810,7 +821,7 @@ 已售:{{sele_g.sales_sum}} - 可售:{{sele_g.store_count-sele_g.sales_sum}} + 可售:{{sele_g.store_count}} 已选:{{sku_g_pt[0].gg}} diff --git a/pages/goods/goodsInfo/goodsInfo.wxss b/pages/goods/goodsInfo/goodsInfo.wxss index 0bc968b..fe8c3ef 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxss +++ b/pages/goods/goodsInfo/goodsInfo.wxss @@ -505,13 +505,13 @@ view.cart-btn-lg { /* padding: 0 30rpx; */ font-size: 32rpx; box-sizing: border-box; - overflow-x: hidden; + } .spec-model .pding{padding: 0 30rpx;} .spec-goods { - padding: 15rpx 0 30rpx; + padding: 15rpx 0 10rpx; float: left; width: 100%; border-bottom: 1px solid #f8f8f8; @@ -519,15 +519,17 @@ view.cart-btn-lg { .spec-img { float: left; - height: 150rpx; - width: 150rpx; - margin-top: 16rpx; + height: 186rpx; + width: 186rpx; + position: relative; + top:-40rpx; + border: 4rpx solid #eee } .spec-goods-info { float: left; padding: 0 25rpx; - width: 490rpx; + width: 400rpx; } .spec-goods-name { @@ -541,13 +543,13 @@ view.cart-btn-lg { .spec-goods-price { color: #ec5151; - font-size: 30rpx; + font-size: 33rpx; font-weight: bold; } .spec-goods-stock { - margin-top: 10rpx; - font-size: 26rpx; + margin-top: 3rpx; + font-size: 24rpx; color: #999999; } @@ -926,7 +928,7 @@ left:31rpx;} .bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 0 34rpx; color: #333; font-size: 32rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:31rpx } -.red_bb{ color: #d70026; width:158rpx} +.red_bb{ color: #d70026; min-width:158rpx;width: auto;} .bg_jj{ width: 18rpx; height:18rpx; border-top: 2rpx solid #d70026; border-right: 2rpx solid #d70026; @@ -2207,8 +2209,10 @@ padding:0 20rpx; height:56rpx; } .xc-person-number{ - width:122rpx; + width:120rpx; color: #999999; + padding-left:8rpx; + text-align: left } .xc-miaosha-time{ diff --git a/pages/index/index/index.js b/pages/index/index/index.js index 194ba83..948c5b6 100644 --- a/pages/index/index/index.js +++ b/pages/index/index/index.js @@ -194,7 +194,7 @@ Page({ //------新品------- await getApp().request.promiseGet("/api/weshop/goods/page?page=1", { data: { - is_mainshow: 1, isonsale: 1, is_on_sale: 1, store_id: o.stoid, pageSize: 9,is_new:1 + is_mainshow: 1, isonsale: 1, is_on_sale: 1, store_id: o.stoid, pageSize: 9,is_new:1,orderField:"sort" } }).then(res => { var e = res; @@ -214,7 +214,7 @@ Page({ //------热卖------- await getApp().request.promiseGet("/api/weshop/goods/page?page=1", { data: { - is_mainshow: 1, isonsale: 1, is_on_sale: 1, store_id: o.stoid, pageSize: 9,is_hot:1 + is_mainshow: 1, isonsale: 1, is_on_sale: 1, store_id: o.stoid, pageSize: 9,is_hot:1,orderField:"sort" } }).then(res => { var e = res; diff --git a/pages/team/team_ping/team_ping.js b/pages/team/team_ping/team_ping.js index b4bb2b2..0ccecc4 100644 --- a/pages/team/team_ping/team_ping.js +++ b/pages/team/team_ping/team_ping.js @@ -90,34 +90,34 @@ Page({ order_goods=null;//订单商品表 //获取订单表的信息根据活动user_id,pt_prom_id>0 AND pay_time>0 + /*--- await getApp().request.promiseGet("/api/weshop/order/page?"+where, { data: { is_pt:1,store_id: os.stoid, user_id: user_id, pageSize: 6, page: this.data.currentPage,} }).then(res => { order = res.data.data.pageData; this.data.currentPage++; + })--*/ + + await getApp().request.promiseGet("/api/weshop/order/pageTuan?"+where, { + data: { is_pt:1,store_id: os.stoid, user_id: user_id, pageSize: 6, page: this.data.currentPage,} + }).then(res => { + order = res.data.data.pageData; + this.data.currentPage++; }) + wx.showLoading({ title: "加载中"}); for (i = 0; i < order.length; i++) { //获取订单从表信息 - await getApp().request.promiseGet("/api/weshop/ordergoods/page", { + await getApp().request.promiseGet("/api/weshop/ordergoods/pageGoods", { data: { store_id: os.stoid, order_id: order[i].order_id } }).then(res => { order_goods = res.data.data.pageData; order[i].order_goods = order_goods; + order[i].gimage = ee.data.imageurl + order_goods[0].original_img; }) - for (var j = 0; j < order_goods.length;j++){ - //获取商品表信息 - await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + order_goods[j].goods_id, { - data: {} - }).then(res => { - goods = res.data.data; - order[i].goods = goods; - order[i].original_img = this.data.imageurl + goods.original_img; - }) - } - + //获取订单表信息根据上面查询的订单号order[i].pt_listno await getApp().request.promiseGet("/api/weshop/order/pagePtList", { data: { store_id: os.stoid, pt_listno: order[i].pt_listno,pageSize:60,page:1} @@ -128,43 +128,19 @@ Page({ order[i].tx=ordertx; }) - var teamlist=null; - //获取团的信息 - await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + order[i].pt_prom_id,{ - 1:1 - }).then(res=>{ - teamlist=res.data.data; - order[i].ct_num=teamlist.ct_num; - }) + - if (teamlist.kttype == 3) { + if (order[i].is_zsorder== 4) { var num = 0; - var jt_data = JSON.parse(teamlist.ct_rylist); + var jt_data = JSON.parse(order[i].ct_rylist); for (var m in jt_data) { if (jt_data[m].rynum > num) num = jt_data[m].rynum; } order[i].max_ct_num = num; } - - var teamgroup=null; - //获取活动从表信息team_id:305暂时 - await getApp().request.promiseGet("/api/weshop/teamgroup/page" , { - data: { store_id: os.stoid, listno: order[i].pt_listno, team_id: order[i].pt_prom_id } - }).then(res => { - teamgroup = res.data.data.pageData[0]; - }) - - //--正在进行中的团,才有时间倒计时-- - if(teamgroup && teamgroup.state==2) { - order[i].kt_end_time = teamgroup.kt_end_time; - //---如果参团的人数没有3个人,则要体现沙发--- - order[i].tg_state = teamgroup.state; - - } - - var sf_num=teamlist.ct_num; - if(teamlist.ct_num>=3){ sf_num=3;} + var sf_num = order[i].ct_num; + if (order[i].ct_num>=3){ sf_num=3;} sf_num=sf_num-ordertx.length; if(sf_num>0) { var arr = []; @@ -181,7 +157,7 @@ Page({ } wx.hideLoading(); - ee.setData({ order: this.data.requestData, ordertx:ordertx}); + ee.setData({ order: this.data.requestData, ordertx: ordertx, isgo:1}); }, //---滚动到底部加载更多--- @@ -245,6 +221,13 @@ Page({ return param < 10 ? '0' + param : param; }, + images_err:function(e){ + var txt = e.currentTarget.dataset.err; + var ob={}; + ob[txt] = this.data.imageurl + "/miniapp/images/default_g_img.gif"; + this.setData(ob); + } + }) diff --git a/pages/team/team_ping/team_ping.wxml b/pages/team/team_ping/team_ping.wxml index 3924083..d250119 100644 --- a/pages/team/team_ping/team_ping.wxml +++ b/pages/team/team_ping/team_ping.wxml @@ -1,4 +1,4 @@ - + @@ -15,26 +15,25 @@ - 订单编号:{{item.order_sn}} + 订单编号:{{item.order_sn}} - + - {{item.goods.goods_name}} + {{item.order_goods[0].goods_name}} - {{item.order_goods[0].goods_price}} - 零售价:{{item.order_goods[0].market_price}} + 零售价:{{item.order_goods[0].market_price}} @@ -63,9 +62,24 @@ - 共{{item.order_goods[0].goods_num}}件, 金额: - - {{item.user_money+item.order_amount}} + 共{{item.order_goods[0].goods_num}}件, + + + 金额: + {{filters.toFix(item.user_money+item.order_amount+item.pt_tail_money,2)}} + + + + 定金:¥{{filters.toFix(item.order_amount+item.user_money,2)}} + 金额:¥{{filters.toFix(item.order_amount+item.user_money,2)}} + 尾款:¥{{item.pt_tail_money}} + + + + + 金额: + {{filters.toFix(item.user_money+item.order_amount,2)}} + @@ -92,7 +106,7 @@ - 剩余: + 剩余: {{item.djs.day}}{{item.djs.hou}}{{item.djs.min}}分 @@ -104,6 +118,6 @@ - -暂无更多 + + 暂无更多 \ No newline at end of file diff --git a/pages/team/team_ping/team_ping.wxss b/pages/team/team_ping/team_ping.wxss index 306a2c3..4068cb0 100644 --- a/pages/team/team_ping/team_ping.wxss +++ b/pages/team/team_ping/team_ping.wxss @@ -91,7 +91,7 @@ .pd-wz{ display: inline-block; - font-size: 25rpx; + font-size: 28rpx; line-height: 76rpx; color: #000; font-weight: normal; @@ -123,10 +123,7 @@ height:222rpx; .pd-list-image .xc-list .frame image{ width: 182rpx; height: 182rpx; - - background-color: red; margin-right:20rpx; - } .pd-img-wz1{ @@ -175,34 +172,28 @@ height:222rpx; .pd-list-foot{ - - width: 100%; + width: 100%; margin: auto; - overflow: hidden; - height: 105rpx; - font-size: 28rpx; + font-size: 28rpx; line-height: 105rpx; color: #000; display: flex; justify-content:space-between; - - + } - + .foot-l-wz{ - padding-right: 10rpx; + padding-right: 10rpx; display: inline-block; - font-size: 34rpx; - line-height: 100rpx; - color: #e4374d; + font-size: 30rpx; + color: #e4374d; font-weight: normal; } .foot-left{ - margin-left:19rpx; -min-width: 360rpx; - height: 100rpx; + margin-left:19rpx; + min-width: 360rpx; line-height: 100rpx; font-size:26rpx; } @@ -293,7 +284,7 @@ margin-right: 20rpx; display: inline-block; width: 33.33%; color: #777777; - font-size: 36rpx; + font-size: 32rpx; } .on{ color:#e4374d; border-bottom: 5rpx solid #e4374d;} @@ -331,6 +322,7 @@ margin-right: 20rpx; justify-content:flex-end; width:97%; margin-bottom:40rpx; + line-height: 36rpx; } @@ -338,11 +330,8 @@ margin-bottom:40rpx; color: #e4374d; border-radius: 7rpx; font-size: 25rpx; - - letter-spacing:4; -margin-right:8rpx; - - + margin-right:8rpx; + line-height: 36rpx } .xc-price-sn{ height:73rpx; @@ -378,4 +367,12 @@ line-height:100rpx; line-height:121rpx; margin-left:5rpx; +} + +.foot-l-wz2{ + font-size: 30rpx; + color: #e4374d; + font-weight: normal; + margin-top:-40rpx; + margin-left:78rpx } \ No newline at end of file diff --git a/pages/team/team_show/team_show.js b/pages/team/team_show/team_show.js index f154eaf..8432fdc 100644 --- a/pages/team/team_show/team_show.js +++ b/pages/team/team_show/team_show.js @@ -293,6 +293,8 @@ Page({ teamlist = null, //活动表 goods = null, //商品 teamgroup = null, //活動从表 + max_num = 0, + min_price = 0, th=this; //获取活动从表信息team_id,listno团编号(券号) @@ -365,6 +367,21 @@ Page({ if (res.data.code == 0) { teamlist = res.data.data; goods_id = res.data.data.goods_id; + + //----------查看阶梯团------------ + if (teamlist.ct_rylist != "" && teamlist.ct_rylist != null && teamlist.ct_rylist != undefined) { + var ct_rylist = JSON.parse(teamlist.ct_rylist); + var max = 0; var pri = 0; + ct_rylist.forEach(function (val, ind) { + if (val.rynum > max) { + max = val.rynum; + pri = val.price; + } + }) + max_num = max; + min_price = pri; + } + } }) @@ -403,6 +420,26 @@ Page({ goods = res.data.data }) + //只装5个 + var ordertx2 = [], sf_num = 0, ct_nun = teamlist.ct_num; + if (max_num) { + ct_nun = parseInt(max_num); + if (ct_nun < ordertx.length) ct_nun = ordertx.length; + } + + if (ct_nun > 5) ct_nun = 5; + for (var i = 0; i < ct_nun; i++) { + if (i >= ordertx.length) sf_num++ + else + ordertx2.push(ordertx[i]); + } + + var sf_arr = []; + for (var i = 0; i < sf_num; i++) { + sf_arr.push(i); + } + + if(th.data.is_group_end==1 || th.data.is_group_end==2 ){ getApp().confirmBox(th.data.end_text); @@ -446,6 +483,7 @@ Page({ //获取下redis长度,如果团已经弄完,或者拼单已经卖完 //设置值 ee.setData({ + ordertx2: ordertx2, ordertx: ordertx, teamlist: teamlist, teamgroup: teamgroup, @@ -453,6 +491,7 @@ Page({ pageteam: pageteam, image: original_img, is_show:1, + sf_arr: sf_arr }); ee.countDown2(); //---设置门店--- @@ -684,6 +723,8 @@ Page({ pick_id: th.data.pick_id, user_id: oo.user_id, store_id: th.data.stoid, + goods_name: th.data.goods.goods_name, + goods_sn: th.data.goods.goods_sn, }; //-----拼团----- newd.goods_price = th.data.teamlist.price; diff --git a/pages/team/team_show/team_show.wxml b/pages/team/team_show/team_show.wxml index cb36f3f..0b737c9 100644 --- a/pages/team/team_show/team_show.wxml +++ b/pages/team/team_show/team_show.wxml @@ -55,22 +55,20 @@ - + - - 团长 + + 团长 + - - + + + + + - - - - - - @@ -186,11 +184,19 @@ - + - ¥ - {{teamlist.price}} + + + ¥{{teamlist.price}} + + + {{goods.goods_name}} + + + + diff --git a/pages/team/team_show/team_show.wxss b/pages/team/team_show/team_show.wxss index 5a609a0..22a214a 100644 --- a/pages/team/team_show/team_show.wxss +++ b/pages/team/team_show/team_show.wxss @@ -102,7 +102,7 @@ page { /* display: flex; justify-content: center; align-items: center; */ - width:590rpx; + } @@ -589,7 +589,6 @@ flex-grow:1.7; } .buy-image text { - float: left; margin-left: 10rpx; color: red; } @@ -709,7 +708,7 @@ flex-grow:1.7; .buy-image { margin-right: 20rpx; - width: 320rpx; + width: 630rpx; height: 200rpx; float: left; } @@ -722,8 +721,8 @@ flex-grow:1.7; margin-right: 16rpx; } + .buy-image text { - float: left; margin-left: 10rpx; color: red; } @@ -742,7 +741,6 @@ flex-grow:1.7; } .t1 { - float: left; font-size: 28rpx; padding-left: 4rpx; color: red; diff --git a/pages/team/team_success/team_success.js b/pages/team/team_success/team_success.js index a1ed7ac..6686cd0 100644 --- a/pages/team/team_success/team_success.js +++ b/pages/team/team_success/team_success.js @@ -185,7 +185,11 @@ Page({ //只装5个 - var ordertx2=[],sf_num=0,ct_nun=teamlist.ct_num;; + var ordertx2=[],sf_num=0,ct_nun=teamlist.ct_num; + if(max_num){ + ct_nun=parseInt(max_num); + if (ct_nun < ordertx.length) ct_nun = ordertx.length; + } if(ct_nun>5) ct_nun=5; for(var i=0;i - + @@ -45,9 +45,15 @@ 当前价格 - ¥{{ct_price}}, 还差 - {{max_num-ordertx.length}}人享受最低价格 - ¥{{min_price}} + ¥{{ct_price}}, + + 还差{{max_num-ordertx.length}}人享受最低价格¥{{min_price}} + + + 该团已经拼购到最低价了哦~ + + + @@ -152,16 +158,14 @@ - + - - - - + diff --git a/pages/team/team_success/team_success.wxss b/pages/team/team_success/team_success.wxss index 2c25548..4bf2d73 100644 --- a/pages/team/team_success/team_success.wxss +++ b/pages/team/team_success/team_success.wxss @@ -234,15 +234,12 @@ width:101rpx; } .bodybutton{ - min-height: 60rpx; width: 90%; margin: 0 auto; text-align: center; line-height: 60rpx; border-radius:15rpx; - height: auto; - - + height: auto; } .bodybutton button{ diff --git a/pages/user/add_address/add_address.js b/pages/user/add_address/add_address.js index adec7ca..80841e9 100644 --- a/pages/user/add_address/add_address.js +++ b/pages/user/add_address/add_address.js @@ -12,6 +12,8 @@ Page({ iurl: a.imghost, address: null, isnew:0, + is_op_co:false,//switch开关 + disabled:0 }, onLoad: function(s) { var a = this,th=a; @@ -25,6 +27,32 @@ Page({ th.initRegions(); }) }, + + onReachBottom: function () { + if (this.data.total <= 6) return; + if (this.data.ismore) return; + this.requestAddressList(); + }, + + requestAddressList: function () { + var e = this; + t.get(e.data.url + "/api/weshop/useraddress/page", { + data: { store_id: os.stoid, user_id: oo.user_id, page: e.data.curpage, pageSize: 6 }, + success: function (t) { + e.data.curpage++; + var arr1 = e.data.addresses; + var arr2 = t.data.data.pageData; + var arr3 = [...arr1, ...arr2]; + + var ismore = 0; + if (arr3.length == t.data.data.total) ismore = 1 + + e.setData({ + addresses: arr3, total: t.data.data.total, ismore: ismore + }), wx.stopPullDownRefresh(); + } + }); + }, initRegions: function() { var e = this; new s.default(this, "regions", { @@ -32,6 +60,7 @@ Page({ console.log("initRegions"); console.log(t); Object.assign(e.data.address, t), e.setData({ + "disabled": 0, "address.province_name": e.data.address.province_name, "address.city_name": e.data.address.city_name, "address.district_name": e.data.address.district_name, @@ -44,58 +73,101 @@ Page({ } }); }, + //-----------添加或者编辑----------- + submitAddress: function (s) { + var a = this.data.address, b = a, th = this; + Object.assign(a, s.detail.value), a.is_default = Number(a.is_default); + a.store_id = os.stoid; - //-----------添加或者编辑----------- - submitAddress: function(s) { - var a= this.data.address, b=a,th=this; - Object.assign(a, s.detail.value), a.is_default = Number(a.is_default); - a.store_id = os.stoid; - if (a.more_address == null || a.more_address == undefined || a.more_address=="" ){ - wx.showModal({title: "请选择地区"}); return false; - } - //判断是不是空对象 - //--------如果是修改地址---------- - if (!th.data.isnew){ - if (a.is_default==1){ - t.put("/api/weshop/useraddress/update", { - data: { user_id: oo.user_id, is_default:0}, - success: function (s) { - t.put("/api/weshop/useraddress/updateById", { - data: a, - success: function (s) { - e.showSuccess(s.data.msg, function () { - wx.navigateBack(); - }); - } - }); - } - }); - - }else{ - t.put("/api/weshop/useraddress/updateById", { - data: a, - success: function (s) { - e.showSuccess(s.data.msg, function () { - wx.navigateBack(); - }); - } + //判断用户名是否为空 + var cs = th.check(a.consignee); + if (cs != 1) { + return getApp().my_warnning("收货姓名不能为空", 0, th); + } + + var ob = ut.check_mobile(a.mobile); + if (ob.code != 1) { + return getApp().my_warnning(ob.title, 0, th); + } + + if (a.more_address == null || a.more_address == undefined || a.more_address == "") { + getApp().my_warnning("请选择地区", 0, th); + return false; + } + //判断地址是否为空 + var add = th.check(a.address); + if (add != 1) { + return getApp().my_warnning("详细地址不能为空", 0, th); + } + + //判断是不是空对象 + //--------如果是修改地址---------- + if (!th.data.isnew) { + if (a.is_default == 1) { + t.put("/api/weshop/useraddress/update", { + data: { user_id: oo.user_id, is_default: 0 }, + success: function (s) { + t.put("/api/weshop/useraddress/updateById", { + data: a, + success: function (s) { + e.showSuccess(s.data.msg, function () { + wx.navigateBack(); }); - } - - }else{ - a['user_id'] = oo.user_id; - a['store_id'] = os.stoid; - //-----新增地址------- - t.post("/api/weshop/useraddress/save", { - data: a, - success: function (s) { - e.showSuccess(s.data.msg, function () { - wx.navigateBack(); - }); - } - }); - } - }, + } + }); + } + }); + + } else { + t.put("/api/weshop/useraddress/updateById", { + data: a, + success: function (s) { + e.showSuccess(s.data.msg, function () { + wx.navigateBack(); + }); + } + }); + } + + } else { + a['user_id'] = oo.user_id; + a['store_id'] = os.stoid; + + + if (a.is_default == 1) { + t.put("/api/weshop/useraddress/update", { + data: { user_id: oo.user_id, is_default: 0 }, + success: function (s) { + + //-----新增地址------- + t.post("/api/weshop/useraddress/save", { + data: a, + success: function (s) { + e.showSuccess(s.data.msg, function () { + wx.navigateBack(); + }); + } + }); + + } + }) + } else { + + //-----新增地址------- + t.post("/api/weshop/useraddress/save", { + data: a, + success: function (s) { + e.showSuccess(s.data.msg, function () { + wx.navigateBack(); + }); + } + }); + } + + + + } + }, //---------删除收货地址------------ deleteAddress: function() { @@ -112,5 +184,20 @@ Page({ }); } }); - } + }, + //是否是默认地址 + bind_is_op_co:function(e){ + var i = e.detail; + this.setData({ + is_op_co:i + }) + console.log(i) + }, + check:function(as){ + var code = 1; + if(as===''){ + code = -1; + } + return code; +} }); \ No newline at end of file diff --git a/pages/user/add_address/add_address.json b/pages/user/add_address/add_address.json index 2d80317..5394760 100644 --- a/pages/user/add_address/add_address.json +++ b/pages/user/add_address/add_address.json @@ -1,4 +1,7 @@ { "navigationBarTitleText": "收货地址", - "enablePullDownRefresh": false + "enablePullDownRefresh": false, + "usingComponents": { + "warn": "/components/long_warn/long_warn" + } } \ No newline at end of file diff --git a/pages/user/add_address/add_address.wxml b/pages/user/add_address/add_address.wxml index 76bf6e9..757adf3 100644 --- a/pages/user/add_address/add_address.wxml +++ b/pages/user/add_address/add_address.wxml @@ -1,33 +1,41 @@ + + +
+ - 收货人: - + 收货人 + - 手机号码: - + 手机号码 + - 所在地区: - {{address.more_address}} + 所在地区 + {{address.more_address==null?'省市区县,乡镇等':address.more_address}} + + + 详细地址 + - - 详细地址: - - - + 设为默认地址 - + - +
+ + diff --git a/pages/user/add_address/add_address.wxss b/pages/user/add_address/add_address.wxss index c3b58cc..6510625 100644 --- a/pages/user/add_address/add_address.wxss +++ b/pages/user/add_address/add_address.wxss @@ -1,69 +1,135 @@ page { - background: white; + background: rgb(255, 255, 255); +} + +.topbcolor { + width: 100%; + height: 7rpx; + background-color: rgb(245, 245, 245); } .item { - float: left; - padding: 0 30rpx; - width: 100%; - box-sizing: border-box; - font-size: 30rpx; - border-bottom: 1rpx #f5f5f5 solid; - line-height: 100rpx; - height: 100rpx; - position: relative; + display: flex; + align-items: center; + padding: 0 31rpx; + width: 100%; + box-sizing: border-box; + border-bottom: 1rpx #f5f5f5 solid; + height: 98rpx; + position: relative; + font-size: 26rpx; + padding-top: 16rpx; } .item-name { - float: left; + display: flex; + align-items: center; + height: 100%; + width: 104rpx; +} + +.item-img { + height: 100%; + align-items: center; +} + +.item_default { + display: flex; + justify-content: space-between; +} + +.item_default .item-name { + width: 200rpx; } .item-input { - float: left; - height: 100rpx; - width: 450rpx; - margin-left: 20rpx; - word-break: keep-all; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; + display: flex; + height: 100%; + margin-left: 40rpx; + /* word-break: keep-all; + white-space: nowrap; + overflow: hidden; */ + text-overflow: ellipsis; + color: rgb(0, 0, 0); + align-items: center; + width: 74%; +} + +.item-inputaddress { + color: rgb(199, 199, 199); + margin-left: 40rpx; +} + +.detailed { + height: 193rpx; + padding-bottom: 95rpx; + display: flex; + padding: 0 31rpx; + padding-top: 41rpx; + font-size: 26rpx; + border-bottom: 1rpx #f5f5f5 solid; +} + +.detailed .detailed_item-name { + width: 137rpx; +} + +.detailed_item-input { + margin-left: 40rpx; + height: auto; + width: 100%; + min-height: 40rpx; + padding-bottom: 28rpx; } .item-switch { - float: right; + zoom: 0.7; +} + +.item-switch::before { + width: 80rpx !important; + height: 35rpx !important; + zoom: 1; } .arrow { - position: absolute; - right: 30rpx; - width: 32rpx; - height: 32rpx; - padding-top: 30rpx; + position: absolute; + right: 26rpx; + width: 26rpx; + height: 26rpx; + padding-top: 28rpx; } .address-btns { - position: absolute; - bottom: 80rpx; - float: left; - width: 100%; - padding: 10rpx 0; + position: absolute; + display: flex; + justify-content: center; + align-items: center; + bottom: 80rpx; + width: 100%; } .delete-btn { - float: left; - width: 40%; - margin: 0 10% 0 5%; - border-radius: 10rpx; - color: #999; - border: 1px solid #f2f2f2; + display: flex; + justify-content: center; + align-items: center; + width: 285rpx; + height: 60rpx; + border-radius: 40rpx; + font-size: 27rpx; + color: rgb(0, 0, 0); + border: 1rpx solid rgb(210, 210, 210); } .submit-btn { - float: left; - width: 40%; - background-color: #e30000; - color: white; - border-radius: 10rpx; + display: flex; + justify-content: center; + align-items: center; + width: 285rpx; + height: 59rpx; + background-color: #e30000; + font-size: 27rpx; + color: rgb(255, 255, 255); + border-radius: 40rpx; } - -@import "../../../utils/regions/regions.wxss"; \ No newline at end of file +@import "../../../utils/regions/regions.wxss"; diff --git a/pages/user/address_list/address_list.js b/pages/user/address_list/address_list.js index 7c1c7ff..8e2a2dd 100644 --- a/pages/user/address_list/address_list.js +++ b/pages/user/address_list/address_list.js @@ -1,62 +1,152 @@ -var e = getApp(), t = require("../../../utils/request.js"),os=e.globalData.setting,oo=e.globalData; - +var e = getApp(), t = require("../../../utils/request.js"), os = e.globalData.setting, oo = e.globalData, t = e.request; Page({ - data: { - url: e.globalData.setting.url, - resourceUrl: e.globalData.setting.resourceUrl, - iurl: e.globalData.setting.imghost, - addresses: null, - operate: null - }, - onLoad: function(e) { - this.data.operate = e.operate; - }, - onShow: function() { - this.requestAddressList(); - }, - onPullDownRefresh: function() { - this.requestAddressList(); - }, - requestAddressList: function() { - var e = this; - t.get(e.data.url + "/api/weshop/useraddress/page", { - data: { store_id: os.stoid, user_id: oo.user_id}, - success: function(t) { - e.setData({ - addresses: t.data.data.pageData, - }), wx.stopPullDownRefresh(); - } - }); - }, - - /*----------编辑地址----------*/ - editAddress: function(e) { - var t = this.getAddressData(e.currentTarget.dataset.id), s = ""; - for (var a in t) s += (0 != s.length ? "&" : "?") + a + "=" + t[a]; - s && wx.navigateTo({ - url: "/pages/user/add_address/add_address" + s - }); - }, - - /*-----选择地址返回确认------*/ - selectAddress: function(e) { - if (null != this.data.operate) { - /*---- - if ("select" == this.data.operate) wx.setStorageSync("cart:cart2:address_id", e.currentTarget.dataset.item.address_id); else if ("teamSelect" == this.data.operate) wx.setStorageSync("team:confirm:address_id", e.currentTarget.dataset.item.address_id); else if ("selectAddress" == this.data.operate) { - var t = { - address: e.currentTarget.dataset.item.province_name + e.currentTarget.dataset.item.city_name + e.currentTarget.dataset.item.district_name, - district: e.currentTarget.dataset.item.district - }; - wx.setStorageSync("goodsInfo:goodsInfo:address", t); - }---*/ - oo.baddr = e.currentTarget.dataset.item; - wx.navigateBack(); - } - }, - getAddressData: function(e) { - var t = this.data.addresses; - for (var s in t) if (t[s].address_id == e) break; - return s ? t[s] : {}; + data: { + url: e.globalData.setting.url, + resourceUrl: e.globalData.setting.resourceUrl, + iurl: e.globalData.setting.imghost, + addresses: [], + operate: null, + curpage: 1, + total: 0, + ismore: 0, + is_back:0, //有没有跳转 + isloading:0, + is_address_read:0 + }, + onLoad: function (e) { + + //清空is_pick_up + getApp().request.put("/api/weshop/useraddress/updatePickUp", { + data: {user_id: getApp().globalData.user_id, is_pickup: 0}, + success: function (s) { + } + }); + + this.data.operate = e.operate; + var is_back=e.is_back; + if (is_back) this.setData({ is_back: is_back}) + }, + onShow: function () { + this.data.curpage = 1; + this.data.addresses = []; + this.requestAddressList(); + console.log(this.data.addresses) + }, + + onReachBottom: function () { + if (this.data.total <= 6) return; + if (this.data.ismore) return; + this.requestAddressList(); + }, + + requestAddressList: function () { + var tt = Math.random() * 100 + var e = this; + t.get(e.data.url + "/api/weshop/useraddress/page", { + data: { store_id: os.stoid, user_id: oo.user_id, page: e.data.curpage, pageSize: 6, t: tt }, + success: function (t) { + e.data.curpage++; + var arr1 = e.data.addresses; + var arr2 = t.data.data.pageData; + var arr3 = [...arr1, ...arr2]; + + var ismore = 0; + if (arr3.length == t.data.data.total) ismore = 1 + + e.setData({ + addresses: arr3, total: t.data.data.total, ismore: ismore, + is_address_read:1 + }), wx.stopPullDownRefresh(); + } + }); + }, + + /*----------编辑地址----------*/ + editAddress: function (e) { + var t = this.getAddressData(e.currentTarget.dataset.id), s = ""; + for (var a in t) s += (0 != s.length ? "&" : "?") + a + "=" + t[a]; + s && wx.navigateTo({ + url: "/pages/user/add_address/add_address" + s + }); + }, + + /*-----选择地址返回确认------*/ + selectAddress: function (e) { + if (null != this.data.operate) { + /*---- + if ("select" == this.data.operate) wx.setStorageSync("cart:cart2:address_id", e.currentTarget.dataset.item.address_id); else if ("teamSelect" == this.data.operate) wx.setStorageSync("team:confirm:address_id", e.currentTarget.dataset.item.address_id); else if ("selectAddress" == this.data.operate) { + var t = { + address: e.currentTarget.dataset.item.province_name + e.currentTarget.dataset.item.city_name + e.currentTarget.dataset.item.district_name, + district: e.currentTarget.dataset.item.district + }; + wx.setStorageSync("goodsInfo:goodsInfo:address", t); + }---*/ + + oo.baddr = e.currentTarget.dataset.item; + wx.navigateBack(); } + }, + + getAddressData: function (e) { + var t = this.data.addresses; + for (var s in t) if (t[s].address_id == e) break; + return s ? t[s] : {}; + }, + + go_url: function (e) { + var url = e.currentTarget.dataset.url; + getApp().goto(url); + + }, + //判断是否选择 + add_is_pickup:function(e){ + + if(this.data.is_back==0) return false; + + var th = this; + var index = e.currentTarget.dataset.ind; + var a = this.data.addresses[index]; + + if (th.data.isloading) return; + th.data.isloading=1; + + t.put("/api/weshop/useraddress/updatePickUp", { + data: { user_id: oo.user_id, is_pickup: 0 }, + isShowLoading:0, + success: function (s) { + // var add_arr = th.data.addresses; + // for (var i in add_arr){ + // add_arr[i].is_pickup=0; + // } + // th.setData({addresses:add_arr}); + + a.is_pickup = 1; + t.put("/api/weshop/useraddress/updateById", { + data: a, + isShowLoading: 0, + success: function (s) { + // var obj={}; + // var txt = "addresses[" + index +"].is_pickup"; + // obj[txt]=1; + // th.setData(obj); + + th.data.isloading=0 + if (th.data.is_back) { + wx.navigateBack({}); + } + + },fail: function (t) { + th.data.isloading = 0; + } + }); + }, + fail: function (t) { + th.data.isloading = 0; + } + }); + + + + } }); \ No newline at end of file diff --git a/pages/user/address_list/address_list.wxml b/pages/user/address_list/address_list.wxml index 72ca32c..cff6f63 100644 --- a/pages/user/address_list/address_list.wxml +++ b/pages/user/address_list/address_list.wxml @@ -1,4 +1,4 @@ - + + + + + + + + + + + 暂无收货地址 + + + + 添加收货地址 + + + + + + + + + + + + + + + + + {{item.consignee}} + + {{item.mobile}} + 默认地址 + + + + {{item.more_address}} {{item.address}} + + + + + + + + + + + + + + + + 新建收货地址 + + + + \ No newline at end of file diff --git a/pages/user/address_list/address_list.wxss b/pages/user/address_list/address_list.wxss index de45c87..d6a4958 100644 --- a/pages/user/address_list/address_list.wxss +++ b/pages/user/address_list/address_list.wxss @@ -1,4 +1,37 @@ -page { +/* 没有收货地址时的样式 */ + +.nothing { + width: 100%; + font-size: 31rpx; +} + +.nothing image { + width: 299rpx; + height: 283rpx; + margin-top: 161rpx; +} + +.nothing .nothingaddress { + color: rgb(251, 65, 66); + margin-top: 35rpx; +} + +.nothing .address { + margin-top: 61rpx; +} + +.nothing .address navigator { + color: rgb(255, 255, 255); + background-color: rgb(251, 65, 66); + width: 256rpx; + height: 55rpx; + border-radius: 30rpx; + display: flex; + align-items: center; + justify-content: center; +} + +/* page { margin-bottom: 200rpx; } @@ -15,7 +48,7 @@ page { width: 150rpx; } -.user-name { +.N-name { font-size: 30rpx; padding-bottom: 20rpx; word-break: keep-all; @@ -77,4 +110,131 @@ page { text-align: center; line-height: 80rpx; display: block; -} \ No newline at end of file +} */ + +page { + margin-bottom: 200rpx; +} + +.topbcolor { + width: 100%; + height: 7rpx; + background-color: rgb(245, 245, 245); +} + +.container { + margin-top: 7rpx; +} + +.container .address-box { + width: 100%; +} + +.container .address-box .address-user { + display: flex; + justify-content: center; + width: 100%; + border-bottom: 2rpx solid rgb(245, 245, 245); + height: 180rpx; + align-items: center; +} + +.container .address-box .address-user .icon { + padding-right: 20rpx; + display: flex; + align-items: center; + height: 100%; +} + +.container .address-box .address-user .no_xuanze { + width: 31rpx; + height: 31rpx; + border-radius: 50%; + border: 1rpx solid; +} + +.container .address-box .address-user .address { + width: 530rpx; +} + +.container .address-box .address-user .address .user { + display: flex; + align-items: center; + width: 500rpx; + font-weight: bold; + font-size: 31rpx; + color: rgb(40, 36, 33); +} + +.container .address-box .address-user .address .user .userName { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; + max-width: 149rpx; +} + +.container .address-box .address-user .address .user .userPhone { + margin-left: 41rpx; +} + +.container .address-box .address-user .address .user .default { + display: flex; + width: 105rpx; + height: 31rpx; + background-color: rgb(239, 22, 51); + justify-content: center; + font-size: 20rpx; + color: rgb(255, 255, 253); + border-radius: 8rpx; + margin-left: 21rpx; + line-height: 31rpx; +} + +.container .address-box .address-user .address .ShippingAddress { + font-size: 24rpx; + color: rgb(41, 38, 33); + height: 66rpx; +} + +.container .address-box .address-user .edit { + display: flex; + justify-content: center; + margin-left: 60rpx; + height: 100%; + align-items: center; +} + +.container .address-box .address-user .edit image { + width: 41rpx; + height: 38rpx; + align-items: center; +} + +.container .new { + width: 100%; + display: flex; + justify-content: center; + position: fixed; + bottom: 0rpx; + height: 204rpx; + align-items: center; + background-color: rgb(255, 255, 255); +} + +.container .new .add { + margin-right: 10rpx; +} + +.container navigator { + display: flex; + width: 430rpx; + height: 62rpx; + background-color: rgb(239, 22, 51); + border-radius: 40rpx; + justify-content: center; + align-items: center; + color: rgb(255, 255, 255); + font-size: 27rpx; +} diff --git a/pages/user/coupons/coupons.js b/pages/user/coupons/coupons.js index f573065..cc3b4f7 100644 --- a/pages/user/coupons/coupons.js +++ b/pages/user/coupons/coupons.js @@ -48,6 +48,7 @@ Page({ show: true, udata: null, iurl:os.imghost, + is_show_dhwz:0, }, // 点击选中二维码 click: function(e) { @@ -130,7 +131,11 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function(options) { - + var th = this; + getApp().getConfig2(function (ee) { + var json_d = JSON.parse(ee.switch_list); + th.setData({ is_show_dhwz: json_d.dhwz_switch }); + }) }, @@ -165,6 +170,7 @@ Page({ console.log("参数", user_id, store_id); rq.get("/api/weshop/users/getinfo/" + os.stoid + "/" + user_id, { + isShowLoading: 0, success: function (su) { var data = su.data.data; @@ -186,9 +192,9 @@ Page({ page: e.data.current_page }; var big_arr = this.data.details; + wx.showLoading(); await getApp().request.promiseGet("/api/weshop/users/listQuan", { - data: get_data, - isShowLoading: 1, + data: get_data, }).then(res => { var a = res.data; val = a.data.total; @@ -211,12 +217,13 @@ Page({ details: big_arr, }); setTimeout(function () { - for (var i = 0; i < details.length; i++) { - var no = i + len; - qrcode('qrcode' + no, details[i].CashRepNo, 460, 460); - - } - }, 100) + + for (var i = 0; i < details.length; i++) { + var no = i + len; + qrcode('qrcode' + no, details[i].CashRepNo, 460, 460); + } + wx.hideLoading(); + }, 1000) }) this.setData({ @@ -235,7 +242,6 @@ Page({ await getApp().request.promiseGet("/api/weshop/users/listQuan" , { data: get_data, - isShowLoading: 1 }).then(res => { var a = res.data; number= a.data.total; @@ -267,10 +273,10 @@ Page({ page: e.data.current_page }; var big_arr= this.data.details; + wx.showLoading(); await getApp().request.promiseGet("/api/weshop/users/listQuan" , { data: get_data, - isShowLoading: 1 }).then(res => { var a = res.data; number = a.data.total; @@ -299,7 +305,9 @@ Page({ qrcode('qrcode' + no, details[i].CashRepNo, 460, 460); } - }, 100) + wx.hideLoading(); + + }, 800) }) }, //---加载更多是靠这个函数---- diff --git a/pages/user/coupons/coupons.wxml b/pages/user/coupons/coupons.wxml index 4fb6230..938ead2 100644 --- a/pages/user/coupons/coupons.wxml +++ b/pages/user/coupons/coupons.wxml @@ -9,7 +9,7 @@ 微券查询 - 微券兑换 + 微券兑换 diff --git a/pages/user/deposit/deposit.js b/pages/user/deposit/deposit.js index c1c9c04..a3a29a1 100644 --- a/pages/user/deposit/deposit.js +++ b/pages/user/deposit/deposit.js @@ -11,6 +11,7 @@ Page({ yucun_money:0, parameter:true, iurl: o.imghost, + is_show_yckcz:0, }, /** * 生命周期函数--监听页面显示 @@ -25,6 +26,12 @@ Page({ wx.setNavigationBarTitle({ title: "预存款", }) + + var th = this; + getApp().getConfig2(function (ee) { + var json_d = JSON.parse(ee.switch_list); + th.setData({ is_show_yckcz: json_d.yckcz_switch }); + }) }, /** diff --git a/pages/user/deposit/deposit.wxml b/pages/user/deposit/deposit.wxml index 2c39478..2fdc92f 100644 --- a/pages/user/deposit/deposit.wxml +++ b/pages/user/deposit/deposit.wxml @@ -7,7 +7,7 @@ - + 预存款充值 diff --git a/pages/user/express/express.js b/pages/user/express/express.js index b3aed38..8a04054 100644 --- a/pages/user/express/express.js +++ b/pages/user/express/express.js @@ -6,6 +6,7 @@ Page({ resourceUrl: e.globalData.setting.imghost, delivery: null, express: null, + re_arr:null,//反转后的数组 error: "快递信息异常" }, onLoad: function(e) { @@ -27,9 +28,9 @@ Page({ wx.request({ url: this.data.url + "/api/weshop/order/wuliu/" + this.data.delivery.shipping_code + "/" + this.data.delivery.invoice_no, success: function(e) { - console.log("success", e.data.data.data); + var re_arr = e.data.data.Traces.reverse(); s.setData({ - express: e.data.data, + express: e.data.data, re_arr: re_arr, }); }, fail: function(s) { diff --git a/pages/user/express/express.wxml b/pages/user/express/express.wxml index a77365a..ec4e481 100644 --- a/pages/user/express/express.wxml +++ b/pages/user/express/express.wxml @@ -4,19 +4,36 @@ {{delivery.invoice_no}} - 国内承运人 : + 承运公司 : {{delivery.shipping_name}} + + + 物流状态 : + 无轨迹 + 已揽收 + 在途中 + 签收 + 问题件 + + - - {{express.message}} + + + + {{item.AcceptStation}} + {{item.AcceptTime}} + + + {{express.Reason}} + diff --git a/pages/user/express/express.wxss b/pages/user/express/express.wxss index 80720f1..112d0a9 100644 --- a/pages/user/express/express.wxss +++ b/pages/user/express/express.wxss @@ -27,7 +27,7 @@ .state-item { border-left: 1px solid #ccc; - padding-left: 40rpx; + padding:0 40rpx; } .item-wrap { @@ -57,4 +57,8 @@ font-weight: bold; color: #666; padding-bottom: 20rpx; + line-height: 40rpx +} +.no_msg{ + text-align: center;color: #999; font-size: 32rpx } \ No newline at end of file diff --git a/pages/user/index/index.js b/pages/user/index/index.js index b6b4536..5d6c12a 100644 --- a/pages/user/index/index.js +++ b/pages/user/index/index.js @@ -75,7 +75,7 @@ Page({ 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.setData({ txmon: su.data.data.summoney, yuer }); + th.setData({ txmon: su.data.data.summoney, yuer: yuer }); } } }) diff --git a/pages/user/index/index.wxml b/pages/user/index/index.wxml index f2b6b50..88f83b7 100644 --- a/pages/user/index/index.wxml +++ b/pages/user/index/index.wxml @@ -8,7 +8,7 @@ bindtap="go_info" src="{{userInfo.head_pic?userInfo.head_pic:defaultAvatar}}"> - {{userInfo.nickname}} {{GradeName}} + {{userInfo.nickname}} {{GradeName}} {{" "}}成长值 {{cz_val}} / {{need_money}} @@ -105,8 +105,8 @@ - - + + 我的权益 diff --git a/pages/user/index/index.wxss b/pages/user/index/index.wxss index 36ef8b2..f1e49eb 100644 --- a/pages/user/index/index.wxss +++ b/pages/user/index/index.wxss @@ -42,9 +42,9 @@ } .xc-uesr-name{ color: #fff; - font-size: 35rpx; + font-size: 32rpx; margin-top:17rpx; - margin-left:20rpx; + margin-left:20rpx; } .xc-user-grade{ @@ -525,6 +525,8 @@ border-radius:20rpx; background:#ffbdce; padding-left: 16rpx; padding-right: 16rpx;padding-bottom: 3rpx; +margin-right: 5rpx; + } .hvip{display: inline-block; font-size: 20rpx; height: 40rpx;line-height: 40rpx; color:#e7bf77; background: #383838; padding: 0 15rpx; border-radius:20rpx; vertical-align: middle } diff --git a/pages/user/integral/integral.js b/pages/user/integral/integral.js index 3b68f08..98611ca 100644 --- a/pages/user/integral/integral.js +++ b/pages/user/integral/integral.js @@ -30,6 +30,8 @@ Page({ money:1.00, integral:50, iurl: o.imghost, + + is_show_jfcz:0, }, /** * 刷出积分劵 @@ -47,9 +49,7 @@ Page({ data:get_data }).then(res => { var msg = res.data; - console.log("是什么",msg); - result = msg.data.pageData; - console.log("是什sssssss么", result); + result = msg.data.pageData; }) e.setData({ result: result @@ -192,7 +192,11 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - + var th=this; + getApp().getConfig2(function(ee){ + var json_d = JSON.parse(ee.switch_list); + th.setData({ is_show_jfcz: json_d.jfcz_switch }); + }) }, /** diff --git a/pages/user/integral/integral.wxml b/pages/user/integral/integral.wxml index cf0ad36..57a0cd2 100644 --- a/pages/user/integral/integral.wxml +++ b/pages/user/integral/integral.wxml @@ -16,7 +16,7 @@ 积分明细 - 积分充值 + 积分充值 @@ -41,7 +41,8 @@ {{(details.OutIntegral==0)?"+":""}}{{(details.InIntegral==0)?filter.getNum(details.OutIntegral):filter.getNum(details.InIntegral)}}积分 - + +
diff --git a/pages/user/integral/integral.wxss b/pages/user/integral/integral.wxss index f4afa89..9fec40e 100644 --- a/pages/user/integral/integral.wxss +++ b/pages/user/integral/integral.wxss @@ -431,7 +431,7 @@ line-height:85rpx; } /*左边的数据 */ .left{ - width:80%; + width:70%; height: 120rpx; } @@ -459,7 +459,7 @@ line-height:85rpx; font-size: 27rpx; font-family: 'SimHei',Arial; text-align:right; - + float: right } /* .更多 */ diff --git a/pages/user/order_detail/order_detail.js b/pages/user/order_detail/order_detail.js index 6c99e8f..fc4e3c8 100644 --- a/pages/user/order_detail/order_detail.js +++ b/pages/user/order_detail/order_detail.js @@ -112,14 +112,17 @@ Page({ success: function(e) { if(!e.confirm) return false; //如果是秒杀和拼单的商品,取消订单要返回redis,并取消订单 - if(is_skill==1 || is_zsorder>=2){ - getApp().request.delete("/api/weshop/order/cancelTeamOrder/"+os.stoid+"/"+o,{ - data:{}, - success: function(t) { - if(t.data.code==0) - th.requestOrderDetail(o), wx.setStorageSync("order:order_list:update", !0); - }, - }) + //if(is_skill==1 || is_zsorder>=2){ + + getApp().request.delete("/api/weshop/order/cancelTeamOrder/"+os.stoid+"/"+o,{ + data:{}, + success: function(t) { + if(t.data.code==0) + th.requestOrderDetail(o), wx.setStorageSync("order:order_list:update", !0); + }, + }) + + /*---- }else{ getApp().request.put("/api/weshop/order/updatebyId", { data: {order_id: o, order_status: 3}, @@ -127,7 +130,7 @@ Page({ th.requestOrderDetail(o), wx.setStorageSync("order:order_list:update", !0); } }); - } + }--*/ } }); }, @@ -137,7 +140,7 @@ Page({ var t = this, o = this.data.order.order_id,order=this.data.order; var is_zsorder=order.is_zsorder; wx.showModal({ - title: "是否确定收货", + title: "是否确认收货?", success: function(e) { e.confirm && r.put("/api/weshop/order/updatebyId", { data: { @@ -178,4 +181,9 @@ Page({ _errObj[_errImg] = "public/images/default_goods_image_240.gif"; this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; }, + + zfwk:function(){ + var url = "/pages/cart/cart_wk/cart_wk?order_id=" + this.data.order.order_id; + getApp().goto(url); + } }); \ No newline at end of file diff --git a/pages/user/order_detail/order_detail.wxml b/pages/user/order_detail/order_detail.wxml index e9acc17..b5cb8fd 100644 --- a/pages/user/order_detail/order_detail.wxml +++ b/pages/user/order_detail/order_detail.wxml @@ -1,3 +1,4 @@ + @@ -60,45 +61,59 @@ - 价格信息 - - 商品总价 - ¥ {{order.goods_price}}元 - - - 运费 - ¥ {{order.shipping_price}}元 - - - 优惠券 - - ¥ {{order.coupon_price}}元 - - - 积分 - - ¥ {{order.integral_money}}元 - - - 余额 - - ¥ {{order.user_money}}元 - - - 订单优惠 - - ¥ {{order.order_prom_amount}}元 - - - 尾款金额 - - ¥ {{order.pt_tail_money}}元 - + 价格信息 + + 商品总价 + ¥ {{filters.toFix(order.order_goods[0].member_goods_price*order.order_goods[0].goods_num,2)}}元 + + + 商品总价 + ¥ {{order.goods_price}}元 + + + 定金金额 + ¥ {{filters.toFix(order.order_amount+order.user_money,2)}}元 + + + 尾款金额 + ¥ {{filters.toFix(order.pt_tail_money-order.shipping_price,2)}}元 + - - 实付金额 - ¥ {{order.order_amount}}元 - + + 配送费用 + ¥ {{order.shipping_price}}元 + + + 优惠券 + ¥ {{order.coupon_price}}元 + + + + 积分 + ¥ {{order.integral_money}}元 + + + + 订单优惠 + ¥ {{order.order_prom_amount}}元 + + + + 订单总价 + ¥ {{filters.toFix(order.order_amount+order.user_money+order.pt_tail_money,2)}}元 + + + + + 使用余额 + ¥ {{order.user_money+order.pt_tail_money}}元 + ¥ {{order.user_money}}元 + - 支付尾款 + 支付尾款 diff --git a/pages/user/order_detail/order_detail.wxss b/pages/user/order_detail/order_detail.wxss index c18cc63..e82786b 100644 --- a/pages/user/order_detail/order_detail.wxss +++ b/pages/user/order_detail/order_detail.wxss @@ -119,7 +119,7 @@ .information .title { height: 70rpx; line-height: 70rpx; - border-bottom: 1px solid #ddd; + border-bottom: 1rpx solid #ddd; font-size: 34rpx; color: #333; } @@ -130,8 +130,15 @@ height: 60rpx; line-height: 60rpx; font-size: 30rpx; - color: #666; + color: #333; +} + +.information .item.pnew{ + height: 50rpx; + line-height: 50rpx; + color: #999; } +.item-line{ margin: 5rpx 0; height: 1rpx; border-bottom:1rpx solid #ddd } .delivery-address,.leave-word { width: 500rpx; diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js index e2763f6..efbc818 100644 --- a/pages/user/order_list/order_list.js +++ b/pages/user/order_list/order_list.js @@ -194,7 +194,7 @@ Page({ success: function(t) { //如果是秒杀和拼单的商品,取消订单要返回redis,并取消订单 if(t.confirm){ - if(is_skill==1 || is_zsorder>=2){ + //if(is_skill==1 || is_zsorder>=2){ getApp().request.delete("/api/weshop/order/cancelTeamOrder/"+os.stoid+"/"+a,{ data:{}, success: function(t) { @@ -208,18 +208,7 @@ Page({ getApp().confirmBox(e.data.msg); } }, - }) - }else{ - rq.put("/api/weshop/order/updatebyId", { - data: { - order_id: a, order_status: 3 - }, - success: function (t) { - 0 == e.data.activeCategoryId ? - (e.resetData(), e.requestOrderList(e.data.activeCategoryId)) : e.deleteOrderData(a); - } - }); - } + }) } } }); @@ -234,7 +223,7 @@ Page({ console.log(is_zsorder); wx.showModal({ - title: "是否确定收货", + title: "是否确认收货?", success: function(t) { t.confirm && rq.put("/api/weshop/order/updatebyId", { data: { @@ -289,7 +278,32 @@ Page({ /*----------跳转支付-----------*/ jumpToCart4: function(t) { + var o_index=t.currentTarget.dataset.idx; var e = this.data.orderList[t.currentTarget.dataset.idx]; + var th=this; + + console.log("jumpToCart4"); + console.log(e); + + if(e.order_amount==0){ + var dd = { + parent_sn: e.order_sn, + store_id: e.store_id, + type: 1, + }; + getApp().request.post("/api/weshop/order/pay/createOrder", { + data: dd, + success: function (t) { + if(t.data.code==0){ + th.onload(); + }else{ + getApp().confirmBox(t.data.msg+"请您取消该订单"); + } + } + }) + return false; + } + a.jumpToCart4({ order_sn: e.order_sn, order_amount: e.order_amount, diff --git a/pages/user/order_list/order_list.wxml b/pages/user/order_list/order_list.wxml index c0cd004..14d1e92 100644 --- a/pages/user/order_list/order_list.wxml +++ b/pages/user/order_list/order_list.wxml @@ -1,3 +1,4 @@ + @@ -23,8 +24,8 @@ data-errorimg="orderList[{{index}}].order_goods[{{pinx}}].original_img">
- {{goods.goods_name}} - {{goods.goods_color}} {{goods.goods_spec}} + {{goods.goods_name}} + {{goods.goods_color}} {{goods.goods_spec}} ¥ {{goods.member_goods_price}} 数量 {{goods.goods_num}} @@ -48,8 +49,15 @@ 共{{item.g_num}}件, - 金额:¥{{item.order_amount+item.user_money}} - 尾款:¥{{item.pt_tail_money}} + + 金额:¥{{filters.toFix(item.order_amount+item.user_money+item.pt_tail_money,2)}} + + + 定金:¥{{filters.toFix(item.order_amount+item.user_money,2)}} + 金额:¥{{filters.toFix(item.order_amount+item.user_money,2)}} + 尾款:¥{{filters.toFix(item.pt_tail_money-item.shipping_price,2)}} + + diff --git a/pages/user/order_list/order_list.wxss b/pages/user/order_list/order_list.wxss index 8d6baa8..769be7b 100644 --- a/pages/user/order_list/order_list.wxss +++ b/pages/user/order_list/order_list.wxss @@ -36,7 +36,7 @@ .goods-box { width: 100%; background-color: #fff; - padding: 0 30rpx; + padding: 0 25rpx; margin-bottom: 20rpx; font-size: 28rpx; border-bottom: 1rpx solid #eee; @@ -117,7 +117,7 @@ .order-total { display: flex; justify-content: flex-start; - font-size: 32rpx; + font-size: 31rpx; color: #333; } @@ -127,12 +127,12 @@ } .order-btn { - width: 150rpx; + width: 125rpx; height: 60rpx; line-height: 60rpx; text-align: center; border: 1px solid #eee; - margin-left: 20rpx; + margin-left: 10rpx; float: right; border-radius: 5rpx; } diff --git a/pages/user/userqy/userqy.wxml b/pages/user/userqy/userqy.wxml index 8419f4e..78ca589 100644 --- a/pages/user/userqy/userqy.wxml +++ b/pages/user/userqy/userqy.wxml @@ -40,7 +40,7 @@ [{{item.GradeName}}]365天累计成长值≥{{item.BuyGradeSum }}可保级 - 会员将在{{filter.replace_time(gradeEndDate)}}到期,365天累计成长值≥{{need_money}}可升级[{{ backClass[index+1].GradeName}}][{{item.GradeName}}]365天累计成长值≥{{item.BuyGradeSum}}可保级 + 会员将在{{filter.replace_time2(gradeEndDate)}}到期,365天累计成长值≥{{need_money}}可升级[{{ backClass[index+1].GradeName}}][{{item.GradeName}}]365天累计成长值≥{{item.BuyGradeSum}}可保级 [{{item.GradeName}}]365天累计成长值≥{{backClass[index+1].BuyGradeSum }}可升级[{{ backClass[index+1].GradeName}}] diff --git a/pages/user/userqy/userqy.wxss b/pages/user/userqy/userqy.wxss index 22763a1..ac250b8 100644 --- a/pages/user/userqy/userqy.wxss +++ b/pages/user/userqy/userqy.wxss @@ -177,7 +177,7 @@ margin-top:60rpx; .li .discounts{ top:115rpx; left: 36rpx; - width: 435rpx; + width: 440rpx; } .li .money{ left: 41rpx; diff --git a/utils/regions/Regions.js b/utils/regions/Regions.js index d0f824d..568c458 100644 --- a/utils/regions/Regions.js +++ b/utils/regions/Regions.js @@ -38,6 +38,9 @@ var s = function() { return s(a, [ { key: "openRegionsModal", value: function(t) { + this.page.setData({ + disabled:1 + }); var s = this, a = t.currentTarget.dataset.id, i = t.currentTarget.dataset.name; isNaN(parseInt(a)) || !parseInt(a) ? (a = 0, this.currentArea = 0) : (0 == this.currentArea ? (this.address.province_name = i, this.address.province = a, this.address.city_name = "", this.address.city = 0, this.address.district_name = "", @@ -55,13 +58,14 @@ var s = function() { t.data.data.pageData && t.data.data.pageData.length > 0 ? s.page.setData(e({}, s.dataName, { regions: t.data.data.pageData, showRegionsModal: !0 - })) : s.endCall(a, i); + })) : s.endCall(a, i); } }) : this.endCall(a, i); } }, { key: "closeRegionsModal", value: function() { + this.page.setData({disabled:0}); this.page.setData(e({}, this.dataName, { showCategoryModal: !1 })); diff --git a/utils/util.js b/utils/util.js index 1d4929b..9d1d4a5 100644 --- a/utils/util.js +++ b/utils/util.js @@ -6,6 +6,7 @@ function isArray(obj) { return (typeof obj == 'object') && obj.constructor == Array; } + function sub_last(str){ return str.substring(0, str.length - 1) } @@ -230,6 +231,22 @@ function measureText(text, fontSize = 10) { return width * fontSize / 10; } +//验证手机号 +function check_mobile(phoneMobile){ + var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\d{8})$/; + var ob={code:1}; + if (phoneMobile.length === 0) { + ob.title='输入的手机号为空'; + ob.code=-1; + } else if (phoneMobile.length < 11) { + ob.title ='手机号长度有误!'; + ob.code = -1; + } else if (!myreg.test(phoneMobile)) { + ob.title = '手机号格式有误!'; + ob.code = -1; + } + return ob; +} module.exports = { formatTime: function(e, r) { @@ -319,4 +336,6 @@ module.exports = { isArray: isArray, sub_last: sub_last,//去掉末尾一个字符 measureText: measureText,//画布需要的函数 + check_mobile: check_mobile,//验证手机 + };