diff --git a/images/orderDetailsBg.png b/images/orderDetailsBg.png new file mode 100644 index 0000000..35a7b57 Binary files /dev/null and b/images/orderDetailsBg.png differ diff --git a/pages/address/upaddress.js b/pages/address/upaddress.js index dddc4d3..5ba506a 100644 --- a/pages/address/upaddress.js +++ b/pages/address/upaddress.js @@ -26,8 +26,6 @@ Page({ // 下拉刷新 onPullDownRefresh: function () { wx.showNavigationBarLoading() //在标题栏中显示加载 - - this.AddressManagement(); wx.hideNavigationBarLoading() //完成停止加载 wx.stopPullDownRefresh() //停止下拉刷新 }, diff --git a/pages/cart/cart.js b/pages/cart/cart.js index c951ba2..ec9ce29 100644 --- a/pages/cart/cart.js +++ b/pages/cart/cart.js @@ -10,6 +10,8 @@ Page({ cont: 1, upstatus: false, remind: '加载中', + productData: '', + shop: '', }, //页面加载完成函数 remind: '加载中', onReady: function () { @@ -33,7 +35,6 @@ Page({ if (num > 1) { num--; } - if (num < 1) { wx.showToast({ title: '数量不能小于1!', @@ -41,10 +42,14 @@ Page({ duration: 2000 }); } else { - WXAPI.productUpcart({ - user_id: that.data.user_id, - num: num, - cart_id: cart_id + //编辑商品信息 + var productArr = [{num: num,cart_id: cart_id}] + let jsonstr = JSON.stringify(productArr) + WXAPI.productUpNum({ + accessId: app.globalData.accessId, + storeId: 239, + storeType: 1, + goods: jsonstr }).then(res => { if (res.code == 200) { // util.getUesrBgplus(that, app, false) @@ -80,6 +85,9 @@ Page({ success: function (res) { if (res.confirm) { WXAPI.productDelAllCart({ + accessId: app.globalData.accessId, + storeId: 239, + storeType: 1, user_id: that.data.user_id, }).then(res => { if (res.code == 200) { @@ -126,48 +134,47 @@ Page({ //删除 delarr: function () { var that = this; - - // 初始化toastStr字符串 - var toastStr = ''; + var selectArr = [] // 遍历取出已勾选的cid for (var i = 0; i < this.data.carts.length; i++) { if (this.data.carts[i].selected) { - toastStr += this.data.carts[i].id; - toastStr += ','; + selectArr.push(this.data.carts[i].id) } } - if (toastStr == '') { + if (selectArr.length == 0) { wx.showToast({ title: '请选择要删除的商品!', duration: 2000 }); return false; } - that.removeShopCard(toastStr); + var selectStr = selectArr.join(','); //将数组转换成string串 + that.removeShopCard(selectStr); }, //移至收藏 shouc: function () { var that = this; - // 初始化toastStr字符串 - var toastStr = ''; + var selectArr = [] // 遍历取出已勾选的cid for (var i = 0; i < this.data.carts.length; i++) { if (this.data.carts[i].selected) { - toastStr += this.data.carts[i].id; - toastStr += ','; + selectArr.push(this.data.carts[i].id) } } - if (toastStr == '') { + if (selectArr.length == 0) { wx.showToast({ title: '请选择要收藏的商品!', duration: 2000 }); return false; } + var selectStr = selectArr.join(','); //将数组转换成string串 WXAPI.productToCollection({ - user_id: that.data.user_id, - carts: toastStr, + accessId: app.globalData.accessId, + storeId: 239, + storeType: 1, + carts: selectStr, }).then(res => { // util.getUesrBgplus(that, app, false) if (res.code == 200) { @@ -191,14 +198,18 @@ Page({ var num = that.data.carts[index].num; // 自增 num++; - var pnum = that.data.carts[index].pnum; + var stock = that.data.carts[index].stock; var cart_id = e.currentTarget.dataset.cartid; - console.log(pnum) - if (pnum > num) { - WXAPI.productUpcart({ - user_id: that.data.user_id, - num: num, - cart_id: cart_id + + //编辑商品信息 + var productArr = [{num: num,cart_id: cart_id}] + let jsonstr = JSON.stringify(productArr) + if (stock > num) { + WXAPI.productUpNum({ + accessId: app.globalData.accessId, + storeId: 239, + storeType: 1, + goods: jsonstr }).then(res => { if (res.code == 200) { // util.getUesrBgplus(that, app, false) @@ -224,7 +235,6 @@ Page({ duration: 2000 }); } - }, bindCheckbox: function (e) { @@ -262,25 +272,24 @@ Page({ }, bindCheckout: function () { - // 初始化toastStr字符串 - var toastStr = ''; + var selectArr = [] // 遍历取出已勾选的cid for (var i = 0; i < this.data.carts.length; i++) { if (this.data.carts[i].selected) { - toastStr += this.data.carts[i].id; - toastStr += ','; + selectArr.push(this.data.carts[i].id) } } - if (toastStr == '') { + if (selectArr.length == 0) { wx.showToast({ title: '请选择要结算的商品!', duration: 2000 }); return false; } + var selectStr = selectArr.join(','); //将数组转换成string串 //存回data wx.navigateTo({ - url: '../order/pay?cartId=' + toastStr, + url: '../order/pay?cartId=' + selectStr + '&product=', }) }, @@ -321,35 +330,36 @@ Page({ }, onLoad: function (options) { - this.setData({ - bgcolor: app.d.bgcolor, - user_id: app.globalData.userInfo.openid - }); - this.loadProductData(); - this.sum(); + // this.loadProductData(); + // this.sum(); }, onShow: function () { - var cont = this.data.cont; - var carts = this.data.carts; - var purchase = app.d.purchase; - var that = this; - if (cont > 1 && purchase == 1) { - that.loadProductData(); - } else { - that.setData({ - carts: carts, - cont: cont + 1 - }); - } + this.loadProductData(); + this.sum(); + // var cont = this.data.cont; + // var carts = this.data.carts; + // var purchase = app.d.purchase; + // var that = this; + // if (cont > 1 && purchase == 1) { + // that.loadProductData(); + // } else { + // that.setData({ + // carts: carts, + // cont: cont + 1 + // }); + // } }, removeShopCard: function (carts) { var that = this; wx.showModal({ title: '提示', - content: '你确认移除吗', + content: '你确认要删除选中的商品吗', success: function (res) { res.confirm && WXAPI.productDelcart({ - carts: carts, + accessId: app.globalData.accessId, + storeId: 239, + storeType: 1, + cart_id: carts, }).then(res => { // util.getUesrBgplus(that, app, false) if (res.code == 200) { @@ -387,7 +397,8 @@ Page({ carts: data.data, selectedAllStatus: false, total: '¥0.00', - remind: '' + remind: '', + shop: data.mch_list[0] }); } else { wx.showToast({ @@ -405,14 +416,18 @@ Page({ var index = parseInt(e.currentTarget.dataset.index); var cat_num = that.data.carts[index].num; var cart_id = e.currentTarget.dataset.cartid; - var pnum = that.data.carts[index].pnum; - console.log(num, cat_num, pnum) + var stock = that.data.carts[index].stock; + // console.log(num, cat_num, stock) if (Number(num) > 0) { - if (Number(num) <= Number(pnum)) { - WXAPI.productUpcart({ - user_id: that.data.user_id, - num: num, - cart_id: carid + if (Number(num) <= Number(stock)) { + //编辑商品信息 + var productArr = [{num: num,cart_id: cart_id}] + let jsonstr = JSON.stringify(productArr) + WXAPI.productUpNum({ + accessId: app.globalData.accessId, + storeId: 239, + storeType: 1, + goods: jsonstr }).then(res => { if (res.code == 200) { // 只有大于一件的时候,才能normal状态,否则disable状态 diff --git a/pages/cart/cart.wxml b/pages/cart/cart.wxml index 8188616..aad1aad 100644 --- a/pages/cart/cart.wxml +++ b/pages/cart/cart.wxml @@ -1,105 +1,111 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - 编辑商品 - 完成 - 快速清理 + + + 编辑商品 + 完成 + 快速清理 + + + + + + + + {{item.ProductName}} + + 数量:×{{item.BuyCount}} + ¥:{{item.Price}} + + 下单 + - - - - - - {{item.ProductName}} - - 数量:×{{item.BuyCount}} - ¥:{{item.Price}} - - 下单 - - - - - - - - 购物车空空如也 - 去逛逛 - + + + + + + 购物车空空如也 + 去逛逛 - + + + + {{shop.name}} + + + - - - - - - - - - - - + + + + + + + + + + + + {{item.pro_name}} - [{{item.size}}] - - - - ¥ {{item.price}} - - - - - - - - + - + [{{item.skuBeanList[0].name}}] + + + + ¥ {{item.price}} + + + - + + + + + + - + + + + + + + + 全选 + {{total}} - - - - - - 全选 - {{total}} - - - 移至收藏 - 删除 - - 立即结算 - + + 删除 - - + 立即结算 + + + + \ No newline at end of file diff --git a/pages/cart/cart.wxss b/pages/cart/cart.wxss index 8b603be..5a808f5 100644 --- a/pages/cart/cart.wxss +++ b/pages/cart/cart.wxss @@ -165,7 +165,7 @@ page{ .carts-title { margin-top: 1px; margin-bottom: 10rpx; - font-size: 28rpx; + font-size: 30rpx; line-height:34rpx; overflow: hidden; text-overflow: ellipsis; @@ -362,4 +362,24 @@ padding-right:16px; margin-left: 5px; color:#fff; padding:0 18px; +} +.shopView { + display:flex; + align-items: center; + height: 85rpx; +} +.shopView image { + width: 40rpx; + height: 40rpx; + margin-left: 25rpx; +} +.shopView text{ + margin-left: 12rpx; + font-size: 32rpx; + color: #333333; +} +.shopView .jiantou-img { + width: 25rpx; + height: 25rpx; + margin-left: 20rpx; } \ No newline at end of file diff --git a/pages/login/register.wxml b/pages/login/register.wxml index 2ab0815..1cd6fc3 100644 --- a/pages/login/register.wxml +++ b/pages/login/register.wxml @@ -1,5 +1,8 @@ - 请添加上方二维码联系客服注册账号 - + 请添加上方二维码或下方按钮联系客服注册账号 + + 联系客服 + + \ No newline at end of file diff --git a/pages/login/register.wxss b/pages/login/register.wxss index 6c92690..7235c61 100644 --- a/pages/login/register.wxss +++ b/pages/login/register.wxss @@ -16,4 +16,25 @@ page{ margin-top: 30rpx; height: 60rpx; line-height: 60rpx; +} +.serviceView{ + padding-top: 25rpx; + height: 100rpx; + width: 100%; + background-color: #F6F6FB; +} +.serviceView .serviceBtn{ + margin-top: 25rpx; + margin-left: 60rpx; + display: flex; + align-items: center; + justify-content: center; + height: 70rpx; + width: 630rpx; + text-align: center; + line-height: 70rpx; + font-size: 28rpx; + color: white; + background-color: #F53C45; + border-radius: 35rpx; } \ No newline at end of file diff --git a/pages/logistics/logistics.js b/pages/logistics/logistics.js index 99e5f18..d8601e3 100644 --- a/pages/logistics/logistics.js +++ b/pages/logistics/logistics.js @@ -101,6 +101,11 @@ Page({ onReachBottom: function () { }, + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + } }) \ No newline at end of file diff --git a/pages/logistics/logistics.wxml b/pages/logistics/logistics.wxml index 2e0a3b6..983ee84 100644 --- a/pages/logistics/logistics.wxml +++ b/pages/logistics/logistics.wxml @@ -43,7 +43,6 @@ - {{item.context}} {{item.time}} diff --git a/pages/order/detail.js b/pages/order/detail.js index 30c0b55..89fcccb 100644 --- a/pages/order/detail.js +++ b/pages/order/detail.js @@ -295,8 +295,7 @@ Page({ }, onLoad: function (options) { - console.log(options) - this.get_plug(); + // this.get_plug(); this.loadProductDetail(options); }, onReady: function () { @@ -349,9 +348,9 @@ Page({ }) }, // 订单详情 - loadProductDetail: function () { + loadProductDetail: function (options) { var that = this; - var orderId = options.orderId; + var orderId = options.id; WXAPI.orderDetails({ accessId: app.globalData.accessId, storeId: 239, @@ -360,16 +359,40 @@ Page({ }).then(res => { if (res.code == 200) { var data = res.data; - // var address = data.adds; - // that.numbers = data.adds; - // if (address == '') { - // var address = [] - // } + var list = data.list; + var z_price = Number(data.z_price).toFixed(2); + var pro_price = 0; + var freight = data.z_freight ? data.z_freight : 0; + var red_packet = data.red_packet; + for (var i = 0; i < list.length; i++) { + pro_price = (Number(pro_price) + Number(list[i].p_price) * Number(list[i].num)).toFixed(2); + } that.setData({ - wuliu: data.res_1.data, - // address: address, - // selectedAllStatus: false - }) + orderData: data, + pro_price: pro_price, + freight: freight, + id: data.id, + sNo: data.sNo, + z_price: Number(z_price).toFixed(2), + add_time: data.add_time, + rstatus: data.status, + list: data.list, + address: data.address, + mobile: data.mobile, + name: data.name, + dr: data.dr, + title: data.title, + p_id: data.p_id, + coupon_money: data.coupon_price, + consumer_money: data.consumer_money, + user_money: data.user_money, + status_pid: data.pid, + ptcode: data.ptcode, + man_num: data.man_num, + groupid: data.pid, + payment: z_price, + order_failure: data.order_failure, + }); } }); // var type1 = that.data.type1; @@ -458,95 +481,106 @@ Page({ // promise.then(() => countdown(this)); }, // 取消订单 - removeOrder: function (e) { + removeOrder: function(e) { var that = this; - var orderId = e.currentTarget.dataset.orderId; + var info = e.currentTarget.dataset.info wx.showModal({ title: '提示', content: '你确定要取消订单吗?', success: function (res) { - res.confirm && wx.request({ - url: app.d.ceshiUrl + '&action=order&m=removeOrder', - method: 'post', - data: { - openid: app.globalData.userInfo.openid, - id: orderId, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - success: function (res) { - var status = res.data.status; - if (status == 1) { - wx.showToast({ - title: res.data.err, - success: 2000 - }); - wx.navigateBack({ - delta: 2 - }) - } else { - wx.showToast({ - title: res.data.err, - duration: 2000 - }); - } - }, - fail: function () { - wx.showToast({ - title: '网络异常!', - duration: 2000 - }); + WXAPI.removeOrder({ + accessId: app.globalData.accessId, + storeId: 239, + storeType: 1, + order_id: info.id, + }).then(res => { + if (res.code == 200) { + that.reloadData(); } - }); + }) } }); }, + //立即支付 + payNow: function(e) { + var data = e.currentTarget.dataset.info + wx.navigateTo({ + url: "/pages/order/payment?orderId="+data.sNo+"&price="+data.z_price, + }) + }, + //提醒发货 + orderRemind: function(e) { + var that = this; + var info = e.currentTarget.dataset.info + WXAPI.orderRemind({ + accessId: app.globalData.accessId, + storeId: 239, + storeType: 1, + order_id: info.id, + }).then(res => { + if (res.code == 200) { + that.reloadData(); + } + }) + }, // 确认收货 - recOrder: function (e) { + confirmOrder: function(e) { var that = this; - var orderId = e.currentTarget.dataset.orderId; + var info = e.currentTarget.dataset.info wx.showModal({ title: '提示', - content: '你确定已收到宝贝吗?', + content: '请确认你已收到货物', success: function (res) { - res.confirm && wx.request({ - url: app.d.ceshiUrl + '&action=order&m=recOrder', - method: 'post', - data: { - id: orderId, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - success: function (res) { - //--init data - var status = res.data.status; - if (status == 1) { - wx.showToast({ - title: '操作成功!', - duration: 2000 - }); - that.loadProductDetail(); - } else { - wx.showToast({ - title: res.data.err, - duration: 2000 - }); - } - }, - fail: function () { - // fail - wx.showToast({ - title: '网络异常!', - duration: 2000 - }); + WXAPI.confirmOrder({ + accessId: app.globalData.accessId, + storeId: 239, + storeType: 1, + order_id: info.id, + }).then(res => { + if (res.code == 200) { + that.reloadData(); } - }); + }) } }); }, - + //删除订单 + deleteOrder: function(e) { + var that = this; + var info = e.currentTarget.dataset.info + wx.showModal({ + title: '提示', + content: '确定要删除订单吗', + success: function (res) { + WXAPI.deleteOrder({ + accessId: app.globalData.accessId, + storeId: 239, + storeType: 1, + order_id: info.id, + }).then(res => { + if (res.code == 200) { + that.reloadData(); + } + }) + } + }); + }, + //查看物流 + orderLogistics: function(e) { + var info = e.currentTarget.dataset.info + wx.navigateTo({ + url:"/pages/logistics/logistics?orderId="+info.sNo + }) + }, + //去评价 + evaluateOrder: function(e) { + var that = this; + var info = e.currentTarget.dataset.info + wx.navigateTo({ + url:"/pages/order/detail?id="+info.id + }) + }, + //触发支付 payOrder: function (e) { @@ -897,24 +931,7 @@ Page({ } }) }, - add_fromid: function (e) { - var that = this; - var formId = e.detail.formId; - if (formId != 'the formId is a mock one') { - var page = 'pages/product/detail' - app.request.wxRequest({ - url: '&action=product&m=save_formid', - data: { from_id: formId, userid: app.globalData.userInfo.openid }, - method: 'post', - success: function (res) { - console.log(res) - } - }) - } - wx.switchTab({ - url: '../index/index' - }) - }, + //跳转index t_index: function () { wx.switchTab({ diff --git a/pages/order/detail.wxml b/pages/order/detail.wxml index 6e7d785..7418052 100644 --- a/pages/order/detail.wxml +++ b/pages/order/detail.wxml @@ -1,6 +1,6 @@ - + @@ -24,14 +24,33 @@ - - - 支付关闭: {{clock}} - {{micro_second}} - - - - + + + + + 待付款 + + + + 已付款 + 等待发货 + + + 已发货 + 商家已发货,请及时关注物流信息 + + + 交易成功 + 您的商品已发送给你了,下次再来哦~ + + + + + + {{name}} {{mobile}} 地址:{{address}} @@ -39,143 +58,123 @@ - - + + + {{list[0].shop_name}} + + + + - - - - - {{item.p_name}} - [{{item.size}}] - - - - - ¥ {{item.p_price}} + + + + {{item.p_name}} + [{{item.size}}] + ¥ {{item.p_price}} + x{{item.num}} - - - - 查看物流 - 申请售后 - - - - - - - - - - - - - 订单号: - {{sNo}} - + + + + + 订单号: + {{sNo}} + - - 时间: - {{add_time}} - + + 下单时间: + {{add_time}} + - - 商品总价: - ¥{{pro_price}} - + + 商品总价: + ¥{{pro_price}} + - - 优惠券: - -¥{{coupon_money}} - + + 优惠券: + -¥{{coupon_money}} + - - 运费: - ¥{{freight}} - + + 运费: + ¥{{freight}} + - - 订单总价: - ¥{{z_price}} + + 订单总价: + ¥{{z_price}} + - - - - - 实付款¥{{z_price}} + + + 实付款¥{{z_price}} + - - - 选择支付方式 - - - - - - - - - - - -
- -
- - - - - 取消订单 - - -
-
- - - -
- -
- - -
+ + + + 取消订单 + 立即付款 + + + 提醒发货 + 提醒发货 + + + 查看物流 + 确认收货 + + + 删除订单 + 查看物流 + 立即评价 + - - -
- + - - - - 拼单详情 - - - 分享好友 - - - + - \ No newline at end of file diff --git a/pages/order/detail.wxss b/pages/order/detail.wxss index 7aa24da..8fa8211 100644 --- a/pages/order/detail.wxss +++ b/pages/order/detail.wxss @@ -6,20 +6,50 @@ page{ width:95%; margin:0 auto; } +.status-view{ + width: 100%; + position: relative; +} +.status-view image{ + width: 100%; + height: 200rpx; +} +.statusLabel{ + position: absolute; + margin-top: 50rpx; + margin-left: 40rpx; + color: white; + font-size: 40rpx; + font-weight: bold; +} +.statusDesc{ + position: absolute; + margin-top: 120rpx; + margin-left: 40rpx; + color: white; + font-size: 28rpx; +} .pay_foot{ margin:12px; background:#fff; border-radius:30px; } .pay_bottom{ - height:60px; + position: fixed; + display: flex; + align-items: center; + bottom: 0; + height:70rpx; width:100%; background:#fff; + padding-bottom: env(safe-area-inset-bottom); } .sqsh{ color: #333; } -.pay_bottom .pay_foot{margin:15px 12px 0 0;} +/* .pay_bottom .pay_foot{ + margin:15px 12px 0 0; +} */ .swiper-tab{ width: 100%; @@ -60,35 +90,42 @@ page{ .shop{ background: #fff; padding:4% 4% 4% 10px; - border-bottom: 1px solid #eee; + border-bottom: 2rpx solid #F4F5F6; } .shop checkbox{ margin-top: 27px; } .sh_slt{ - width: 65px; - height: 65px; + width: 150rpx; + height: 150rpx; overflow: hidden; margin-right: 4%; float: left; } .sp_text{ display:flex; - line-height: 20px; + align-items: center; width: 100%; text-align: left; flex-wrap: wrap; } .sp_tit{ width: 100%; + height: 60rpx; overflow: hidden; - font-size: 12px; + font-size: 15px; -webkit-line-clamp:2; } +.price{ + font-size:16px; + color:#fc0628; +} .guige{ - font-size:12px; - color:#808080; - text-align:right; + position:absolute; + right: 35rpx; + font-size:12px; + color:#999; + text-align:right; } .sp_neb{ width: 100%; @@ -96,12 +133,6 @@ page{ font-size: 12px; color: #999; } -.sp_jg{ - width: 30%; - font-size: 13px; - color: #fc0628; - height:120rpx; -} .dle{ color: #999; font-size: 12px; @@ -184,11 +215,13 @@ page{ /* border-top: 1px solid #eee; */ } .top{ - padding: 15px 4% 15px 10px; + /* margin-top:20rpx; */ + padding: 15px 10px 5px 10px; font-size:12px; display: flex; justify-content:space-between; border-bottom: 1px solid #eee; + height: 60rpx; } .btn { width: 50%; @@ -511,9 +544,11 @@ width:100%; color: #808080; } .ddlb_v{ + font-size: 28rpx; color: #000; display: flex; justify-content: space-between; + height: 60rpx; } .anniu{ @@ -556,6 +591,58 @@ button{ font-size: 10px; } .ddlb_v-lift { - width: 130rpx; - text-align: end; -} \ No newline at end of file + width: 160rpx; +} +.shopView { + display:flex; + align-items: center; + height: 85rpx; +} +.shopView image { + width: 40rpx; + height: 40rpx; + margin-left: 25rpx; +} +.shopView text{ + margin-left: 12rpx; + font-size: 32rpx; + color: #333333; +} +.shopView .jiantou-img { + width: 25rpx; + height: 25rpx; + margin-left: 20rpx; +} +.normalBtn{ + position: absolute; + right: 225rpx; + padding: 5rpx 22rpx; + font-size: 28rpx; + color: #999999; + border: 1px solid #FA5151; + height: 50rpx; + line-height: 50rpx; + border-radius: 50rpx; +} +.confirmBtn{ + position: absolute; + right: 45rpx; + padding: 5rpx 22rpx; + font-size: 28rpx; + color: #FA5151; + border: 1px solid #FA5151; + height: 50rpx; + line-height: 50rpx; + border-radius: 50rpx; +} +.deleteBtn{ + position: absolute; + right: 410rpx; + padding: 5rpx 22rpx; + font-size: 28rpx; + color: #999999; + border: 1px solid #FA5151; + height: 50rpx; + line-height: 50rpx; + border-radius: 50rpx; +} diff --git a/pages/order/pay.js b/pages/order/pay.js index d6dbde4..9a02826 100644 --- a/pages/order/pay.js +++ b/pages/order/pay.js @@ -73,10 +73,9 @@ Page({ }, onLoad: function (options) { - console.log(app.globalData) console.log(options) var that = this; - that.get_plug(); + // that.get_plug(); var uid = app.globalData.userInfo.openid; // 微信id var plug_ins = app.globalData.userInfo.plug_ins; // 插件 @@ -104,38 +103,38 @@ Page({ // util.getUesrBgplus(that, app, false) //刷新显示购物车数量 var cartid = that.data.cartId var type = that.data.type - if (type == 1) { //直接结算离开页面清除购物车数量 - wx.request({ - url: app.d.ceshiUrl + '&action=product&m=delcart', - method: 'post', - data: { - carts: that.data.cartId, // 购物车id - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded' - }, - success: function (res) { - var status = res.data.status; - if (status == 1) { - that.setData({ - remind: false - }); - } else { - that.setData({ - remind: true - }); + // if (type == 1) { //直接结算离开页面清除购物车数量 + // wx.request({ + // url: app.d.ceshiUrl + '&action=product&m=delcart', + // method: 'post', + // data: { + // carts: that.data.cartId, // 购物车id + // }, + // header: { + // 'Content-Type': 'application/x-www-form-urlencoded' + // }, + // success: function (res) { + // var status = res.data.status; + // if (status == 1) { + // that.setData({ + // remind: false + // }); + // } else { + // that.setData({ + // remind: true + // }); - } - }, - error: function (e) { - wx.showToast({ - title: '网络异常!', - duration: 2000 - }); - } - }); - } + // } + // }, + // error: function (e) { + // wx.showToast({ + // title: '网络异常!', + // duration: 2000 + // }); + // } + // }); + // } }, onShow: function () { @@ -164,7 +163,7 @@ Page({ WXAPI.settlement({ accessId: app.globalData.accessId, storeId: 239, - cart_id: '', + cart_id: that.data.cartId, coupon_id: 0, vipSource: 0, canshu: true, @@ -526,7 +525,7 @@ Page({ accessId: app.globalData.accessId, storeId: 239, storeType: 1, - cart_id: '', + cart_id: that.data.cartId, address_id: that.data.addrId, coupon_id: 0, remarks: '', diff --git a/pages/order/payment.wxml b/pages/order/payment.wxml index 32656b9..e87d0ca 100644 --- a/pages/order/payment.wxml +++ b/pages/order/payment.wxml @@ -1,5 +1,5 @@ - + 订单编号: {{orderId}} @@ -35,5 +35,9 @@ 如有其他问题,请联系客服 - - + + + 联系客服 + + + \ No newline at end of file diff --git a/pages/order/payment.wxss b/pages/order/payment.wxss index d8eda3b..b97c167 100644 --- a/pages/order/payment.wxss +++ b/pages/order/payment.wxss @@ -113,4 +113,35 @@ page { margin-top: 30rpx; width: 320rpx; height: 320rpx; +} +.serviceView{ + padding-top: 25rpx; + height: 100rpx; + width: 100%; + background-color: #F6F6FB; + position:relative; +} +.service{ + opacity:0; + margin-top: 25rpx; + margin-left: 60rpx; + position:absolute; + height: 70rpx; + width: 630rpx; +} +.serviceView .serviceBtn{ + position:absolute; + margin-top: 25rpx; + margin-left: 60rpx; + display: flex; + align-items: center; + justify-content: center; + height: 70rpx; + width: 630rpx; + text-align: center; + line-height: 70rpx; + font-size: 28rpx; + color: white; + background-color: #F53C45; + border-radius: 35rpx; } \ No newline at end of file diff --git a/pages/product/detail.js b/pages/product/detail.js index 8ab2eaf..ef82d01 100644 --- a/pages/product/detail.js +++ b/pages/product/detail.js @@ -152,10 +152,6 @@ Page({ var that = this; var choujiangid = that.data.choujiangid; var openid = app.globalData.userInfo.openid; - // console.log(app.globalData.userInfo, 'openid') - // if (openid) { - var bgcolor = app.d.bgcolor; - WXAPI.productIndex({ accessId: app.globalData.accessId, storeId: 239, @@ -168,7 +164,6 @@ Page({ var content = pro.content; WxParse.wxParse('content', 'html', content, that, 5); that.setData({ - bgcolor: bgcolor, itemData: pro, kucun: pro.num, bannerItem: pro.img_arr, @@ -578,7 +573,7 @@ Page({ // productArr.push({}) let jsonstr = JSON.stringify(productArr) wx.navigateTo({ - url: '../order/pay?product=' + jsonstr + '&cart_id=' + that.data.cart_id, + url: '../order/pay?product=' + jsonstr + '&cartId=', }); }, bindChange: function (e) {//滑动切换tab diff --git a/pages/user/user.wxss b/pages/user/user.wxss index 936c75d..775f5e0 100644 --- a/pages/user/user.wxss +++ b/pages/user/user.wxss @@ -130,13 +130,13 @@ border-radius:5px; color:#fff; background:red; border-radius:50%; - right:6px; - top:6px; + right:15px; + top:8px; font-size:12px; - width:40rpx; - height:40rpx; + width:38rpx; + height:38rpx; text-align:center; - line-height:40rpx; + line-height:38rpx; opacity:0.8; } .function_left{ diff --git a/utils/server.js b/utils/server.js index 255599b..fbcf7ab 100644 --- a/utils/server.js +++ b/utils/server.js @@ -82,6 +82,18 @@ module.exports = { cartIndex: (data) => { //购物车 return requestServer('&action=cart&app=index', 'post', data) }, + productAddCart: (data) => { //加入购物车 + return requestServer('&action=product&app=add_cart', 'post', data) + }, + productUpNum: (data) => { //购物车商品添加数量 + return requestServer('&action=cart&app=up_cart', 'post', data) + }, + productDelcart: (data) => { //删除购物车 + return requestServer('&action=cart&app=delcart', 'post', data) + }, + productDelAllCart: (data) => { //清空购物车 + return requestServer('&action=cart&app=delAll_cart', 'post', data) + }, /* 我的 */ userIndex: (data) => { //个人中心 return requestServer('&action=user&app=index', 'post', data) @@ -99,11 +111,7 @@ module.exports = { settlement: (data) => { //确认订单信息 return requestServer('&action=order&app=Settlement', 'post', data) }, - productAddCart: (data) => { //加入购物车 - return requestServer('&action=product&app=add_cart', 'post', data) - }, - //确认订单 payment - orderPayment: (data) => { + orderPayment: (data) => { //确认订单 payment return requestServer('&action=order&app=payment', 'post', data) }, leaveSettlement: (data) => { @@ -124,8 +132,7 @@ module.exports = { getLocation: (data) => { //获取地址信息 return requestServer('&action=index&app=get_location', 'post', data) }, - //确认订单 payment - orderList: (data) => { + orderList: (data) => { //订单列表 return requestServer('&action=order&app=index', 'post', data) }, orderDetails: (data) => { //订单详情 @@ -162,21 +169,12 @@ module.exports = { return requestServer('&action=product&m=to_Collection', 'post', data) }, - productUpcart: (data) => { - return requestServer('&action=product&m=up_cart', 'post', data) - }, - productDelAllCart: (data) => { //清空 - return requestServer('&action=product&m=delAll_cart', 'post', data) - }, + + // productShopping: (data) => { // return requestServer('&action=product&m=Shopping', 'post', data) // }, - productDelcart: (data) => { //删除 - return requestServer('&action=product&m=delcart', 'post', data) - }, - addressManagement: (data) => { //添加地址 - return requestServer('&action=user&app=AddressManagement', 'post', data) - }, + preservation: (data) => { return requestServer('&action=user&m=Preservation', 'post', data) },