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/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/cart2/cart2.js b/pages/cart/cart2/cart2.js index 6ff839f..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,11 +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; @@ -112,10 +168,15 @@ 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); } @@ -260,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({ @@ -314,14 +391,29 @@ 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; @@ -347,13 +439,28 @@ Page({ th.data.check_quan_price_list=t.data.data.shop_price*gg.goods_num+""; th.data.check_quan_ware_list=t.data.data.erpwareid+""; - 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); + } + } } th.setData({ bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et, @@ -371,36 +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){ - - console.log("getuser_addr") - console.log(ie) - - th.setData({user_addr: ie }); - if (th.data.is_b_now == 1) { - th.calculatePrice2(); - } else { - th.calculatePrice(); - } - }); - } - }, //---------------检查是否有收货地址------------------- checkAddressList: function() { var t = this; @@ -725,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, @@ -909,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 () { + } }); } @@ -960,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" }); }, @@ -1083,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; @@ -1098,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}); }, //---判断券时候在已经选择的列表中--- @@ -1216,6 +1294,26 @@ Page({ 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 用户备注(50字) - + {{maxWord}}/50 @@ -183,19 +183,9 @@ - 用户备注(50字) - + {{maxWord}}/50 diff --git a/pages/cart/cart2/cart2.wxss b/pages/cart/cart2/cart2.wxss index 2342af3..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{ @@ -345,7 +345,6 @@ .xc-close-frame{ margin-top:10rpx; width:1%; - display:flex; } .xc-close{ @@ -354,8 +353,9 @@ height: 46rpx; border-radius: 50%; border: 5rpx solid #a5a5a7; text-align: center; -line-height: 33rpx; -font-size: 64rpx; +line-height: 46rpx; +font-size: 34rpx; +font-weight: bolder; color: #a5a5a7; margin-top: 5rpx; diff --git a/pages/cart/cart2_pt/cart2_pt.js b/pages/cart/cart2_pt/cart2_pt.js index a38357e..2e733c3 100644 --- a/pages/cart/cart2_pt/cart2_pt.js +++ b/pages/cart/cart2_pt/cart2_pt.js @@ -107,9 +107,12 @@ 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); diff --git a/pages/cart/cart_wk/cart_wk.js b/pages/cart/cart_wk/cart_wk.js index 8235649..355498f 100644 --- a/pages/cart/cart_wk/cart_wk.js +++ b/pages/cart/cart_wk/cart_wk.js @@ -43,6 +43,14 @@ Page({ * 生命周期函数--监听页面加载 */ 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; //--初始化-- @@ -110,12 +118,13 @@ 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); @@ -218,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; //--判断物流-- @@ -253,7 +264,7 @@ Page({ 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 }) } @@ -284,6 +295,9 @@ Page({ this.setData({ exp_type: type }); + + + //--计算物流的值-- if (type == 0) { th.calculate_wuliu(); @@ -364,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); @@ -402,7 +416,7 @@ 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; @@ -497,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.wxml b/pages/cart/cart_wk/cart_wk.wxml index 1fb7997..a4aa7a6 100644 --- a/pages/cart/cart_wk/cart_wk.wxml +++ b/pages/cart/cart_wk/cart_wk.wxml @@ -78,7 +78,7 @@ {{teamgroup.jt_ct_num}} - 成团单价 + 成团金额 {{filters.toFix(order.order_amount+order.user_money+order.tail_money,2)}} diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 801184f..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:[], //商品的购买次数 @@ -201,12 +200,16 @@ 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是空的话,分享回来 @@ -218,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, @@ -344,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; + }) + } //--------获取视频图片--------- @@ -1426,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; @@ -1465,13 +1472,31 @@ 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) { @@ -1895,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; } @@ -2048,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}, @@ -2055,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"; @@ -2067,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"; @@ -2076,6 +2105,11 @@ Page({ _errObj[text1]=0; th.setData(_errObj); } + + setTimeout(function(){ + th.data.iszaning = 0; + },500) + } }) }, @@ -2248,7 +2282,6 @@ Page({ //-------大图后面就不一样了----------- 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 @@ Page({ //---二维吗图--- 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) @@ -2569,6 +2622,26 @@ Page({ 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 b1bbff4..457321e 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -300,7 +300,7 @@ - + 领券 @@ -821,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/team/team_ping/team_ping.wxml b/pages/team/team_ping/team_ping.wxml index 15b31b4..d250119 100644 --- a/pages/team/team_ping/team_ping.wxml +++ b/pages/team/team_ping/team_ping.wxml @@ -64,7 +64,7 @@ 共{{item.order_goods[0].goods_num}}件, - + 金额: {{filters.toFix(item.user_money+item.order_amount+item.pt_tail_money,2)}} diff --git a/pages/team/team_ping/team_ping.wxss b/pages/team/team_ping/team_ping.wxss index c346b6a..4068cb0 100644 --- a/pages/team/team_ping/team_ping.wxss +++ b/pages/team/team_ping/team_ping.wxss @@ -374,5 +374,5 @@ margin-left:5rpx; color: #e4374d; font-weight: normal; margin-top:-40rpx; - margin-left:98rpx + margin-left:78rpx } \ No newline at end of file diff --git a/pages/user/add_address/add_address.js b/pages/user/add_address/add_address.js index 05e9080..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,92 +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; - - 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; - } - - - //判断是不是空对象 - //--------如果是修改地址---------- - 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; - - - 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(); - }); - } - }); - } - - - - } - }, + } + }); + } + }); + + } 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() { @@ -146,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.wxml b/pages/user/add_address/add_address.wxml index 970d4c1..757adf3 100644 --- a/pages/user/add_address/add_address.wxml +++ b/pages/user/add_address/add_address.wxml @@ -1,35 +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 40710c3..8e2a2dd 100644 --- a/pages/user/address_list/address_list.js +++ b/pages/user/address_list/address_list.js @@ -1,89 +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: [], - operate: null, - curpage:1, - total:0, - ismore:0, - - }, - onLoad: function(e) { - this.data.operate = e.operate; - }, - onShow: function() { - this.data.curpage=1; - this.data.addresses=[]; - this.requestAddressList(); - }, - + 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(); + 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 - }), 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); + 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 47eacf9..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 846283f..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; @@ -62,20 +95,14 @@ page { } .address-create { - background-color: #fff; - width: 100%; + width: 50%; text-align: center; position: fixed; - bottom: 0rpx; - height: 200rpx; - border-top:1rpx solid #eee - + bottom: 80rpx; + left: 25%; } .create-btn { - width: 50%; - margin: 0 auto; - margin-top: 60rpx; font-size: 28rpx; color: white; background-color: #f23030; @@ -83,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/index/index.wxml b/pages/user/index/index.wxml index ad2a469..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}} 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 d840150..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); } }); - } + }--*/ } }); }, diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js index 88f202a..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); - } - }); - } + }) } } }); @@ -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/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 }));