diff --git a/apis/interfaces/order.js b/apis/interfaces/order.js index ab5ca7b..c49d8d7 100644 --- a/apis/interfaces/order.js +++ b/apis/interfaces/order.js @@ -5,12 +5,22 @@ import {req} from "../request" -const index = () => req({url: "orders"}) //登录 +const index = () => req({url: "orders"}) //全部订单 +const unpaid = () => req({url: "orders/unpaid"}) //待付款 +const paid = () => req({url: "orders/paid"}) //待发货 +const delive = () => req({url: "orders/delivered"}) //待收货 +const refund = () => req({url: "orders/refunds"}) //退款 const cancel = (orderId) => req({url: "orders/cancel/" + orderId}) //取消订单 const orders = (orderId) => req({url: "orders/" + orderId}) //订单-详情 +const paymen = (orderId) => req({url: "payments/order/" + orderId}) //订单支付-详情 export default({ index, + unpaid, + paid, + delive, + refund, cancel, - orders + orders, + paymen }) \ No newline at end of file diff --git a/apis/request.js b/apis/request.js index fbc8d79..c57eff1 100644 --- a/apis/request.js +++ b/apis/request.js @@ -3,10 +3,10 @@ import {errInfo} from './err' import {updToken} from './updateToken' // 请求方式配置 -const api = "https://new-web-test.cnskl.com/api/" -// const api = "https://mi-org.cnskl.com/api/" +// const api = "https://new-web-test.cnskl.com/api/" +const api = "https://mi-org.cnskl.com/api/" const header = { - "Accept": "application/json" + "Accept" : "application/json" } /** diff --git a/components/mallIndex_coupon/mallIndex_coupon.js b/components/mallIndex_coupon/mallIndex_coupon.js index 9d6b8c9..5adb091 100644 --- a/components/mallIndex_coupon/mallIndex_coupon.js +++ b/components/mallIndex_coupon/mallIndex_coupon.js @@ -24,7 +24,7 @@ Component({ jumpUrl(e) { let id = e.currentTarget.dataset.id wx.navigateTo({ - url : '/pages/mall_details/mall_details?id=' + id, + url : '/pages/mall/mall_details/mall_details?id=' + id, }) } }, diff --git a/components/mallIndex_coupon/mallIndex_coupon.wxml b/components/mallIndex_coupon/mallIndex_coupon.wxml index b0998e6..da6b00e 100644 --- a/components/mallIndex_coupon/mallIndex_coupon.wxml +++ b/components/mallIndex_coupon/mallIndex_coupon.wxml @@ -4,7 +4,7 @@ 免费券专区 - + 更多 diff --git a/components/mallIndex_hot/mallIndex_hot.js b/components/mallIndex_hot/mallIndex_hot.js index 16ebfd5..fe8be1d 100644 --- a/components/mallIndex_hot/mallIndex_hot.js +++ b/components/mallIndex_hot/mallIndex_hot.js @@ -22,7 +22,7 @@ Component({ hotTap(e) { let id = e.currentTarget.dataset.id wx.navigateTo({ - url : '/pages/mall_details/mall_details?id=' + id, + url : '/pages/mall/mall_details/mall_details?id=' + id, }) } } diff --git a/components/mallIndex_hot/mallIndex_hot.wxml b/components/mallIndex_hot/mallIndex_hot.wxml index eac459f..bea1b2a 100644 --- a/components/mallIndex_hot/mallIndex_hot.wxml +++ b/components/mallIndex_hot/mallIndex_hot.wxml @@ -4,7 +4,7 @@ 优惠热卖 - + 更多 diff --git a/components/mallIndex_list/mallIndex_list.js b/components/mallIndex_list/mallIndex_list.js index b8e9f5c..63cb3b1 100644 --- a/components/mallIndex_list/mallIndex_list.js +++ b/components/mallIndex_list/mallIndex_list.js @@ -31,7 +31,7 @@ Component({ push(e) { let id = e.currentTarget.dataset.id wx.navigateTo({ - url : '/pages/mall_details/mall_details?id=' + id, + url : '/pages/mall/mall_details/mall_details?id=' + id, }) } } diff --git a/components/mallIndex_list/mallIndex_list.wxss b/components/mallIndex_list/mallIndex_list.wxss index af478e8..3a1f669 100644 --- a/components/mallIndex_list/mallIndex_list.wxss +++ b/components/mallIndex_list/mallIndex_list.wxss @@ -93,4 +93,21 @@ font-size: 24rpx; line-height: 38rpx; color: #aaabab; +} + + +/* 上拉加载 */ +.pagesLoding{ + text-align: center; + line-height: 90rpx; + color: gray; + clear: both; +} + +.pagesLoding-icon{ + width: 28rpx; + height: 28rpx; + vertical-align: middle; + margin-right: 10rpx; + margin-bottom: 3rpx; } \ No newline at end of file diff --git a/components/mallIndex_nav/mallIndex_nav.js b/components/mallIndex_nav/mallIndex_nav.js index f42275b..bee7dc9 100644 --- a/components/mallIndex_nav/mallIndex_nav.js +++ b/components/mallIndex_nav/mallIndex_nav.js @@ -22,14 +22,14 @@ Component({ handeItemTap(e) { let id = e.currentTarget.dataset.id wx.navigateTo({ - url: '/pages/mall_goods/mall_goods?sort=' + id, + url: '/pages/mall/mall_goods/mall_goods?sort=' + id, }) }, // 查看更所分类 homeTap() { wx.navigateTo({ - url: '/pages/mall_classify/mall_classify', + url: '/pages/mall/mall_classify/mall_classify', }) } } diff --git a/components/mallIndex_video/mallIndex_video.wxml b/components/mallIndex_video/mallIndex_video.wxml index 1b5abd2..31eb937 100644 --- a/components/mallIndex_video/mallIndex_video.wxml +++ b/components/mallIndex_video/mallIndex_video.wxml @@ -14,7 +14,7 @@ - + 正在直播 @@ -29,7 +29,7 @@ - + 风光雪月跨年季 diff --git a/pages/mall/index.js b/pages/mall/index.js index ee82216..515a489 100644 --- a/pages/mall/index.js +++ b/pages/mall/index.js @@ -3,8 +3,6 @@ * 5g获客星光网 - 商城 */ -const data = require("../../data/demo") - Page({ /** * 页面的初始数据 diff --git a/pages/mall/index.wxml b/pages/mall/index.wxml index 50f298e..41b791b 100644 --- a/pages/mall/index.wxml +++ b/pages/mall/index.wxml @@ -2,7 +2,7 @@ - + 搜索商品 diff --git a/pages/mall/index.wxss b/pages/mall/index.wxss index 3ef2d27..3afc832 100644 --- a/pages/mall/index.wxss +++ b/pages/mall/index.wxss @@ -72,4 +72,4 @@ page { width: 100%; height: 100%; vertical-align: top; -} \ No newline at end of file +} diff --git a/pages/mall/mall_address/mall_address.wxml b/pages/mall/mall_address/mall_address.wxml index b2cae66..f97bd25 100644 --- a/pages/mall/mall_address/mall_address.wxml +++ b/pages/mall/mall_address/mall_address.wxml @@ -26,7 +26,7 @@ 选择地址 - + @@ -37,10 +37,10 @@ - + 还未添加收货地址 - 添加地址 + 添加地址 \ No newline at end of file diff --git a/pages/mall/mall_assess/mall_assess.wxml b/pages/mall/mall_assess/mall_assess.wxml index 8a01f13..224829e 100644 --- a/pages/mall/mall_assess/mall_assess.wxml +++ b/pages/mall/mall_assess/mall_assess.wxml @@ -24,7 +24,7 @@ - diff --git a/pages/mall/mall_assess_form/mall_assess_form.wxml b/pages/mall/mall_assess_form/mall_assess_form.wxml index 0793f1c..f2cab07 100644 --- a/pages/mall/mall_assess_form/mall_assess_form.wxml +++ b/pages/mall/mall_assess_form/mall_assess_form.wxml @@ -1,6 +1,6 @@ - + 商品名称哦 diff --git a/pages/mall/mall_cart/mall_cart.js b/pages/mall/mall_cart/mall_cart.js index 77b994c..0a06cf4 100644 --- a/pages/mall/mall_cart/mall_cart.js +++ b/pages/mall/mall_cart/mall_cart.js @@ -212,7 +212,9 @@ Page({ params = new Array for (var i of arrCart){ - params.push(i.id) + if(i.is_check == true) { + params.push(i.id) + } } let listData = params.join(",") @@ -224,7 +226,7 @@ Page({ return } wx.navigateTo({ - url: '/pages/mall_order_submit/mall_order_submit?cart_ids=' + listData + '&type=arrCart' + url: '/pages/mall/mall_order_submit/mall_order_submit?cart_ids=' + listData + '&type=arrCart' }) }, }) \ No newline at end of file diff --git a/pages/mall/mall_cart/mall_cart.wxml b/pages/mall/mall_cart/mall_cart.wxml index 6060df7..2506bf4 100644 --- a/pages/mall/mall_cart/mall_cart.wxml +++ b/pages/mall/mall_cart/mall_cart.wxml @@ -30,9 +30,9 @@ - + 购物车空空如也,快去首页购物吧~ - + 去购物 diff --git a/pages/mall/mall_details/mall_details.js b/pages/mall/mall_details/mall_details.js index 1287d08..64d9690 100644 --- a/pages/mall/mall_details/mall_details.js +++ b/pages/mall/mall_details/mall_details.js @@ -246,7 +246,7 @@ Page({ }) } else { wx.navigateTo({ - url: '/pages/mall_order_submit/mall_order_submit?skuId=' + this.data.changeSku.sku_id + '&qty=' + this.data.goodsNumber + url: '/pages/mall/mall_order_submit/mall_order_submit?skuId=' + this.data.changeSku.sku_id + '&qty=' + this.data.goodsNumber }) this.setData({ diff --git a/pages/mall/mall_details/mall_details.wxml b/pages/mall/mall_details/mall_details.wxml index 5861886..4b12036 100644 --- a/pages/mall/mall_details/mall_details.wxml +++ b/pages/mall/mall_details/mall_details.wxml @@ -70,8 +70,8 @@ - - + + @@ -207,7 +207,7 @@ - + ¥{{changeSku.prices.price}} diff --git a/pages/mall/mall_order/mall_order.js b/pages/mall/mall_order/mall_order.js index e8e3cb6..c5230ab 100644 --- a/pages/mall/mall_order/mall_order.js +++ b/pages/mall/mall_order/mall_order.js @@ -10,7 +10,7 @@ Page({ * 页面的初始数据 */ data: { - stateType : 'ALL', //订单类型 + stateType : 'all', //订单类型 orderArr : [], //订单列表 }, @@ -34,16 +34,54 @@ Page({ this.orderInfo() }, + /** + * 订单tab + */ + orderTab(e){ + this.setData({ + stateType: e.currentTarget.dataset.state + }) + this.orderInfo() + }, + /** * 订单列表 */ orderInfo(){ - wx.$api.orders.index().then(res=>{ - console.log(res.data) - this.setData({ - orderArr : res.data - }) - }) + let stateType = this.data.stateType + + if(stateType == 'all') { + wx.$api.order.index().then(res=>{ + this.setData({ + orderArr : res.data + }) + }) + } else if(stateType == 'unpaid') { + wx.$api.order.unpaid().then(res=>{ + this.setData({ + orderArr : res.data + }) + }) + } else if(stateType == 'paid') { + wx.$api.order.paid().then(res=>{ + this.setData({ + orderArr : res.data + }) + }) + } else if(stateType == 'delive') { + wx.$api.order.delive().then(res=>{ + this.setData({ + orderArr : res.data + }) + }) + } else if(stateType == 'refunds') { + wx.$api.order.refund().then(res=>{ + this.setData({ + orderArr : res.data + }) + }) + } + }, /** @@ -52,7 +90,7 @@ Page({ orderPay(e){ let orderId = e.currentTarget.dataset.orderid wx.navigateTo({ - url: '/pages/many_pay/many_pay?orderid=' + orderId + "&type=orderPay", + url: '/pages/mall/mall_pay/mall_pay?orderid=' + orderId, }) }, diff --git a/pages/mall/mall_order/mall_order.wxml b/pages/mall/mall_order/mall_order.wxml index 91d23ea..cc0b101 100644 --- a/pages/mall/mall_order/mall_order.wxml +++ b/pages/mall/mall_order/mall_order.wxml @@ -1,23 +1,22 @@ - + 全部 - + 待支付 - + 待发货 - + 待收货 - - 已完成 + + 已完成 - - + @@ -44,7 +43,12 @@ bindtap="orderPay">立即支付 取消订单 - 订单详情 + 订单详情 + + + + + 暂无订单 \ No newline at end of file diff --git a/pages/mall/mall_order_data/mall_order_data.js b/pages/mall/mall_order_data/mall_order_data.js index b5eac06..235eb12 100644 --- a/pages/mall/mall_order_data/mall_order_data.js +++ b/pages/mall/mall_order_data/mall_order_data.js @@ -26,7 +26,7 @@ Page({ * 订单详情 */ orderData(orderId){ - wx.$api.orders.orders(orderId).then(res=>{ + wx.$api.order.orders(orderId).then(res=>{ console.log(res) this.setData({ orderData: res @@ -64,8 +64,9 @@ Page({ orderPay(e){ let orderId = e.currentTarget.dataset.orderid wx.navigateTo({ - url: '/pages/many_pay/many_pay?orderid=' + orderId + "&type=orderPay", + url: '/pages/mall/mall_pay/mall_pay?orderid=' + orderId, }) + }, /** @@ -73,9 +74,9 @@ Page({ */ orderDelete(e) { let orderId = e.currentTarget.dataset.orderid - wx.$api.orders.cancel(orderId).then(res=>{ + wx.$api.order.cancel(orderId).then(res=>{ wx.redirectTo({ - url: '/pages/mall_order/mall_order?stateType=ALL', + url: '/pages/mall/mall_order/mall_order', }) }) }, diff --git a/pages/mall/mall_order_submit/mall_order_submit.js b/pages/mall/mall_order_submit/mall_order_submit.js index eaaaab8..e40f72a 100644 --- a/pages/mall/mall_order_submit/mall_order_submit.js +++ b/pages/mall/mall_order_submit/mall_order_submit.js @@ -117,37 +117,35 @@ Page({ remark : this.data.remark, address_id : this.data.addressDel.address_id }).then(res=>{ - console.log(res.trade_no) wx.$api.mall.wechat({ trade_no : res.trade_no }).then(res=>{ - console.log(res) - // let payInfo = JSON.parse(res.data) - // wx.requestPayment({ - // timeStamp: payInfo.timeStamp, - // nonceStr : payInfo.nonceStr, - // package : payInfo.package, - // paySign : payInfo.paySign, - // signType : payInfo.signType, - // success : res=>{ - // if(res.errMsg == "requestPayment:ok"){ - // wx.showToast({ - // title: '支付成功', - // icon : 'success' - // }) - // setTimeout(()=>{ - // wx.reLaunch({ - // url: '/pages/coupon/coupon?type=couponPublic' - // }) - // },2000) - // } - // }, - // fail : res=>{ - // wx.reLaunch({ - // url: '/pages/order/order?stateType=unpay' - // }) - // } - // }) + let payInfo = JSON.parse(res) + wx.requestPayment({ + timeStamp: payInfo.timeStamp, + nonceStr : payInfo.nonceStr, + package : payInfo.package, + paySign : payInfo.paySign, + signType : payInfo.signType, + success : res=>{ + if(res.errMsg == "requestPayment:ok"){ + wx.showToast({ + title: '支付成功', + icon : 'success' + }) + setTimeout(()=>{ + wx.reLaunch({ + url: '/pages/mall/mall_order/mall_order' + }) + },2000) + } + }, + fail : res=>{ + wx.reLaunch({ + url: '/pages/mall/mall_order/mall_order?stateType=unpaid' + }) + } + }) }) }) } diff --git a/pages/mall/mall_order_submit/mall_order_submit.wxml b/pages/mall/mall_order_submit/mall_order_submit.wxml index cb548a1..c5a91fc 100644 --- a/pages/mall/mall_order_submit/mall_order_submit.wxml +++ b/pages/mall/mall_order_submit/mall_order_submit.wxml @@ -2,7 +2,7 @@ - + {{addressDel.name}}{{addressDel.mobile}} @@ -10,7 +10,7 @@ {{addressDel.full_address}} - + 添加收货地址 diff --git a/pages/mall/mall_order_submit/mall_order_submit.wxss b/pages/mall/mall_order_submit/mall_order_submit.wxss index c52cafe..9411ada 100644 --- a/pages/mall/mall_order_submit/mall_order_submit.wxss +++ b/pages/mall/mall_order_submit/mall_order_submit.wxss @@ -261,12 +261,14 @@ page { .couponEject { position: fixed; width: 100%; - bottom: -100%; + bottom: -10000%; left: 0; border-radius: 30rpx 30rpx 0 0; background-color: white; z-index: 101; transition: .2s; + max-height: 50%; + overflow-y: scroll; } .couponEject.active { diff --git a/pages/mall/mall_pay/mall_pay.js b/pages/mall/mall_pay/mall_pay.js index 825ff46..68a1420 100644 --- a/pages/mall/mall_pay/mall_pay.js +++ b/pages/mall/mall_pay/mall_pay.js @@ -10,21 +10,63 @@ Page({ * 页面的初始数据 */ data: { + orderData : '', //订单详情 }, /** * 生命周期函数--监听页面加载 */ onLoad (options) { - + console.log(options.orderid) + this.orderInfo(options.orderid) }, /** * 订单支付 */ - payment() { - wx.redirectTo({ - url: '/pages/mall_order_data/mall_order_data', + orderInfo(orderId) { + wx.$api.order.paymen(orderId).then(res=>{ + console.log(res) + this.setData({ + orderData : res + }) }) - } + }, + + /** + * 订单支付 + */ + payment() { + wx.$api.mall.wechat({ + trade_no : this.orderData.trade_no + }).then(res=>{ + console.log(res) + let payInfo = JSON.parse(res) + wx.requestPayment({ + timeStamp: payInfo.timeStamp, + nonceStr : payInfo.nonceStr, + package : payInfo.package, + paySign : payInfo.paySign, + signType : payInfo.signType, + success : res=>{ + if(res.errMsg == "requestPayment:ok"){ + wx.showToast({ + title: '支付成功', + icon : 'success' + }) + setTimeout(()=>{ + wx.reLaunch({ + url: '/pages/mall/mall_order/mall_order?stateType=all' + }) + },2000) + } + }, + fail : res=>{ + wx.reLaunch({ + url: '/pages/mall/mall_order/mall_order?stateType=unpaid' + }) + } + }) + }) + } }) \ No newline at end of file diff --git a/pages/mall/mall_pay/mall_pay.wxml b/pages/mall/mall_pay/mall_pay.wxml index 5ee0586..40ee927 100644 --- a/pages/mall/mall_pay/mall_pay.wxml +++ b/pages/mall/mall_pay/mall_pay.wxml @@ -4,20 +4,20 @@ 订单编号 - 454fdsf54f5d4f54sdf4d + {{orderData.trade_no}} 商品总价 - ¥999.00 + ¥{{orderData.amount}} 运费 - -¥999.00 + ¥{{orderData.freight}} 应付总价 - ¥999.00 + ¥{{orderData.total}} @@ -30,7 +30,7 @@ 微信支付 - + diff --git a/pages/mall/mall_search/mall_search.js b/pages/mall/mall_search/mall_search.js index 1672961..539a1da 100644 --- a/pages/mall/mall_search/mall_search.js +++ b/pages/mall/mall_search/mall_search.js @@ -32,7 +32,6 @@ Page({ */ hotkeyInfo () { wx.$api.mall.hotkey({}).then(res=>{ - console.log(res) this.setData({ hotkey : res }) @@ -43,10 +42,9 @@ Page({ * 搜索 */ searchForm(e) { - console.log(e.detail.value.search) let searchValue = e.detail.value.search wx.redirectTo({ - url: '/pages/mall_goods/mall_goods?title=' + searchValue + url: '/pages/mall/mall_goods/mall_goods?title=' + searchValue }) }, diff --git a/pages/mall/mall_video/mall_video.wxml b/pages/mall/mall_video/mall_video.wxml index c972959..9df4365 100644 --- a/pages/mall/mall_video/mall_video.wxml +++ b/pages/mall/mall_video/mall_video.wxml @@ -2,7 +2,7 @@ - + 正在直播 @@ -24,7 +24,7 @@ - + 已结束 diff --git a/pages/user/index.wxml b/pages/user/index.wxml index 57b9b78..9d67915 100644 --- a/pages/user/index.wxml +++ b/pages/user/index.wxml @@ -5,7 +5,7 @@ 艾米家的傻钢^ 游客 - + @@ -34,13 +34,13 @@ - + 我的卡券 - + @@ -71,7 +71,7 @@ 项目预购 - + 2 @@ -84,7 +84,7 @@ 客服服务 - + diff --git a/pages/user/user_coupon/user_coupon.js b/pages/user/user_coupon/user_coupon.js index 1387123..a22b39b 100644 --- a/pages/user/user_coupon/user_coupon.js +++ b/pages/user/user_coupon/user_coupon.js @@ -133,11 +133,11 @@ Page({ } if(verification==2){ wx.navigateTo({ - url: '/pages/user_coupon_data/user_coupon_data?user_coupon_id='+couponid+'&type='+type + url: '/pages/user/user_coupon_data/user_coupon_data?user_coupon_id='+couponid+'&type='+type }) }else if(verification==1){ wx.navigateTo({ - url: '/pages/coupon_goods/coupon_goods?user_coupon_id='+couponid + url: '/pages/ticket/goods/goods?user_coupon_id='+couponid }) } diff --git a/project.config.json b/project.config.json index 248dad6..857df89 100644 --- a/project.config.json +++ b/project.config.json @@ -70,6 +70,18 @@ { "name": "搜索", "pathName": "pages/company/search/search", + "query": "", + "scene": null + }, + { + "name": "pages/mall/index", + "pathName": "pages/mall/index", + "query": "", + "scene": null + }, + { + "name": "pages/user/index", + "pathName": "pages/user/index", "scene": null } ] diff --git a/static/mall_icon/car_icon.png b/static/mall_icon/car_icon.png new file mode 100644 index 0000000..1b1994d Binary files /dev/null and b/static/mall_icon/car_icon.png differ