diff --git a/app.wxss b/app.wxss index c223783..c695ccb 100644 --- a/app.wxss +++ b/app.wxss @@ -129,7 +129,8 @@ swiper-item { border-radius: 5px; text-align: center; } -.bottom-btn-green.active{ + +.bottom-btn-green.active { background-color: var(--gray-bg-color); color: var(--text-brown-color); } @@ -165,10 +166,12 @@ swiper-item { .mb-40 { margin-bottom: 40rpx; } -.mb-60{ + +.mb-60 { margin-bottom: 60rpx; } -.mb-80{ + +.mb-80 { margin-bottom: 80rpx; } @@ -319,16 +322,15 @@ swiper-item { .no-more::after { content: ""; flex: 1; - height: 1px; + height: 1rpx; background-color: var(--divider-color); } .no-more-dot { - width: 8rpx; - height: 8rpx; - border-radius: 50%; - background-color: var(--divider-color); - margin: 0 20rpx; + color: var(--text-gray-hint-color); + font-size: 24rpx; + padding: 0 15rpx; + white-space: nowrap; } .weui-half-screen-dialog__ft { @@ -336,6 +338,6 @@ swiper-item { padding: 0rpx 0rpx 50rpx; } -.tip-margin{ +.tip-margin { margin-top: 80px; } \ No newline at end of file diff --git a/net/api/shop.js b/net/api/shop.js index 2f011b2..4dc242f 100644 --- a/net/api/shop.js +++ b/net/api/shop.js @@ -18,6 +18,8 @@ const apiPath = { areaList: "/api/area/listbyparentid/{pId}", //省市区树结构 saveOrder: '/api/order/save/{goodsId}', //新增订单 confirmOrder: '/api/order/confirm-pay/{orderId}', //确定付款 + cancelOrder: '/api/order/save-cancel/{orderId}', //取消订单 + mineBuyOrder: '/api/order/listpage-buy', //我的订单 ? } class Shop { // 通用路径参数替换方法 @@ -113,6 +115,16 @@ class Shop { orderId: oId }) } + //取消订单 + static doCancelOrder(oId) { + return this.requestHandler(apiPath.cancelOrder, "PUT", null, { + orderId: oId + }) + } + //我购买的 + static doGetMineOrders(data) { + return this.requestHandler(apiPath.mineBuyOrder, "GET", data) + } } export default Shop; \ No newline at end of file diff --git a/pages/copyright/applyRefund/applyRefund.wxml b/pages/copyright/applyRefund/applyRefund.wxml index 3b8114e..e2c9ef4 100644 --- a/pages/copyright/applyRefund/applyRefund.wxml +++ b/pages/copyright/applyRefund/applyRefund.wxml @@ -70,7 +70,7 @@ - + AI喵著 diff --git a/pages/copyright/applyRepair/applyRepair.wxml b/pages/copyright/applyRepair/applyRepair.wxml index db4dce3..5480578 100644 --- a/pages/copyright/applyRepair/applyRepair.wxml +++ b/pages/copyright/applyRepair/applyRepair.wxml @@ -79,7 +79,7 @@ - + AI喵著 diff --git a/pages/copyright/refund/refund.wxml b/pages/copyright/refund/refund.wxml index e07968c..594865e 100644 --- a/pages/copyright/refund/refund.wxml +++ b/pages/copyright/refund/refund.wxml @@ -64,7 +64,7 @@ - + AI喵著 diff --git a/pages/copyright/repair/repair.wxml b/pages/copyright/repair/repair.wxml index 1e6f662..bd4a52b 100644 --- a/pages/copyright/repair/repair.wxml +++ b/pages/copyright/repair/repair.wxml @@ -85,7 +85,7 @@ - + AI喵著 diff --git a/pages/index/index.wxml b/pages/index/index.wxml index de947f8..ac1228a 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -98,7 +98,7 @@ - + AI喵著 diff --git a/pages/mine/mineAccount/invoiceInfo/invoiceInfo.wxml b/pages/mine/mineAccount/invoiceInfo/invoiceInfo.wxml index 7e3f2c3..f51a505 100644 --- a/pages/mine/mineAccount/invoiceInfo/invoiceInfo.wxml +++ b/pages/mine/mineAccount/invoiceInfo/invoiceInfo.wxml @@ -30,7 +30,7 @@ - + AI喵著 diff --git a/pages/mine/mineAccount/invoiceOrder/invoiceOrder.wxml b/pages/mine/mineAccount/invoiceOrder/invoiceOrder.wxml index dbccb57..b2c56bd 100644 --- a/pages/mine/mineAccount/invoiceOrder/invoiceOrder.wxml +++ b/pages/mine/mineAccount/invoiceOrder/invoiceOrder.wxml @@ -22,7 +22,7 @@ - + AI喵著 diff --git a/pages/mine/mineAccount/mineContact/mineContact.wxml b/pages/mine/mineAccount/mineContact/mineContact.wxml index 69772dc..2a35462 100644 --- a/pages/mine/mineAccount/mineContact/mineContact.wxml +++ b/pages/mine/mineAccount/mineContact/mineContact.wxml @@ -29,7 +29,7 @@ - + AI喵著 diff --git a/pages/mine/mineAccount/mineCoupons/mineCoupons.wxml b/pages/mine/mineAccount/mineCoupons/mineCoupons.wxml index 52eb23c..1c0877f 100644 --- a/pages/mine/mineAccount/mineCoupons/mineCoupons.wxml +++ b/pages/mine/mineAccount/mineCoupons/mineCoupons.wxml @@ -41,7 +41,7 @@ - + AI喵著 diff --git a/pages/mine/mineAccount/mineInvoiceManage/mineInvoiceManage.wxml b/pages/mine/mineAccount/mineInvoiceManage/mineInvoiceManage.wxml index 088371b..ed13f36 100644 --- a/pages/mine/mineAccount/mineInvoiceManage/mineInvoiceManage.wxml +++ b/pages/mine/mineAccount/mineInvoiceManage/mineInvoiceManage.wxml @@ -29,7 +29,7 @@ - + AI喵著 diff --git a/pages/mine/mineAccount/mineMsgNotice/mineMsgNotice.wxml b/pages/mine/mineAccount/mineMsgNotice/mineMsgNotice.wxml index 60e2ad8..dc4a006 100644 --- a/pages/mine/mineAccount/mineMsgNotice/mineMsgNotice.wxml +++ b/pages/mine/mineAccount/mineMsgNotice/mineMsgNotice.wxml @@ -41,7 +41,7 @@ - + AI喵著 diff --git a/pages/mine/mineAccount/mineOrder/mineOrder.wxml b/pages/mine/mineAccount/mineOrder/mineOrder.wxml index 8959d8c..736b9f5 100644 --- a/pages/mine/mineAccount/mineOrder/mineOrder.wxml +++ b/pages/mine/mineAccount/mineOrder/mineOrder.wxml @@ -36,7 +36,7 @@ - + AI喵著 diff --git a/pages/mine/mineAccount/minePayRecord/minePayRecord.wxml b/pages/mine/mineAccount/minePayRecord/minePayRecord.wxml index ffa41f6..e806ba6 100644 --- a/pages/mine/mineAccount/minePayRecord/minePayRecord.wxml +++ b/pages/mine/mineAccount/minePayRecord/minePayRecord.wxml @@ -48,7 +48,7 @@ - + AI喵著 diff --git a/pages/shop/market/market.wxml b/pages/shop/market/market.wxml index 0354921..1a30373 100644 --- a/pages/shop/market/market.wxml +++ b/pages/shop/market/market.wxml @@ -96,7 +96,7 @@ - + AI喵著 diff --git a/pages/shop/purchaseGoods/purchaseGoods.js b/pages/shop/purchaseGoods/purchaseGoods.js index 883ef2c..f962f2a 100644 --- a/pages/shop/purchaseGoods/purchaseGoods.js +++ b/pages/shop/purchaseGoods/purchaseGoods.js @@ -1,66 +1,121 @@ -// pages/shop/purchaseGoods/purchaseGoods.js +import Shop from '../../../net/api/shop' +import { + sImgPrefix +} +from '../../../net/mainUrl' Page({ - /** - * 页面的初始数据 - */ - data: { + /** + * 页面的初始数据 + */ + data: { + pageData: { + page: 1, + rows: 10, + keywords: '', + startTime: '', + endTime: '', + orderStatus: '' + }, + msgShow: false, + msgHint: '', + msgType: 'error', + loadingState: 'loading', + listRefreshTrig: false, + isLoadMore: false, + hasMore: true, + goodsList: [] + }, - }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + wx.setNavigationBarTitle({ + title: '已经购买', + }) + wx.setNavigationBarColor({ + frontColor: '#000000', // 必写项,字体颜色仅支持#ffffff和#000000 + backgroundColor: '#FFFFFF', // 传递的颜色值,仅支持十六进制颜色 + animation: { // 可选项 + duration: 500, + timingFunc: 'easeIn' + } + }) + this.doRefreshList() + }, + inputKeywords(e) { + this.setData({ + 'pageData.keywords': e.detail.value + }) + }, + doSearch() { + this.doRefreshList() + }, + doRefreshList() { + console.log('正在刷新...') + const _self = this + _self.setData({ + listRefreshTrig: true, + loadingState: 'loading', + hasMore: true, + isLoadMore: false, + 'pageData.page': 1, + }) + _self.doGetMineOrders(true) + }, + doLoadMore() { + //判断是否正在加载中 与是否存在更多数据 + const _self = this + if (_self.data.isLoadMore || !_self.data.hasMore) { + return + } + _self.setData({ + isLoadMore: true, + 'pageData.page': ++_self.data.pageData.page, + }) + _self.doGetMineOrders(false) + }, + //获取列表 + doGetMineOrders(isRefresh) { + const _self = this + _self.setData({ + goodsList: isRefresh ? [] : _self.data.goodsList, + loadingState: isRefresh ? 'loading' : '' + }) + Shop.doGetMineOrders(_self.data.pageData) + .then(res => { + console.log(res) + var status = 'success' + status = res.rows && res.rows.length > 0 ? 'success' : 'empty' + const list = _self.addPrefixToPreviewImgs(res.rows) + _self.setData({ + loadingState: isRefresh ? status : '', + goodsList: _self.data.goodsList.concat(list), + listRefreshTrig: false, + isLoadMore: false + }) + _self.setData({ + hasMore: _self.data.goodsList.length < res.total + }) + }, err => { + _self.setData({ + loadingState: 'error', + listRefreshTrig: false, + isLoadMore: false, + hasMore: true + }) + }) + }, + //为数据中图片添加前缀 + addPrefixToPreviewImgs(data) { + const prefix = sImgPrefix + return data.map(item => { + if (item.goodsDTO.goodsPhoto && item.goodsDTO.goodsPhoto != '') { + item.goodsDTO.preImg = prefix + item.goodsDTO.goodsPhoto + } + return item; + }); + }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { - - } }) \ No newline at end of file diff --git a/pages/shop/purchaseGoods/purchaseGoods.json b/pages/shop/purchaseGoods/purchaseGoods.json index 8835af0..d0e66b8 100644 --- a/pages/shop/purchaseGoods/purchaseGoods.json +++ b/pages/shop/purchaseGoods/purchaseGoods.json @@ -1,3 +1,7 @@ { - "usingComponents": {} + "usingComponents": { + "mp-loading": "weui-miniprogram/loading/loading", + "container-loading": "/components/container-loading/container-loading", + "mp-toptips": "weui-miniprogram/toptips/toptips" + } } \ No newline at end of file diff --git a/pages/shop/purchaseGoods/purchaseGoods.wxml b/pages/shop/purchaseGoods/purchaseGoods.wxml index fa89a93..2f190f2 100644 --- a/pages/shop/purchaseGoods/purchaseGoods.wxml +++ b/pages/shop/purchaseGoods/purchaseGoods.wxml @@ -1,2 +1,51 @@ - -pages/shop/purchaseGoods/purchaseGoods.wxml \ No newline at end of file + + + + + + 搜索 + + + + + + + + + + + + + + + {{tools.goodsOrderStatus(item.orderStatus)}} + {{item.goodsDTO.goodsName}} + + + 订单价格 + + + + + 下单时间 + {{item.createTime}} + + + 付款时间 + {{item.payTime==''? '未付款':item.payTime}} + + + + + + + + + AI喵著 + + + + + + + \ No newline at end of file diff --git a/pages/shop/purchaseGoods/purchaseGoods.wxss b/pages/shop/purchaseGoods/purchaseGoods.wxss index c8345bd..81f687a 100644 --- a/pages/shop/purchaseGoods/purchaseGoods.wxss +++ b/pages/shop/purchaseGoods/purchaseGoods.wxss @@ -1 +1,165 @@ -/* pages/shop/purchaseGoods/purchaseGoods.wxss */ \ No newline at end of file +/* pages/shop/purchaseGoods/purchaseGoods.wxss */ +.search-container-fixed { + position: fixed; + top: 0; + left: 0; + display: flex; + flex-direction: column; + box-sizing: border-box; + width: 100%; + z-index: 99; + padding: 30rpx 0rpx; +} + +.search-box { + background-color: var(--bg-gray-color); + display: flex; + flex-direction: row; + align-items: center; + margin: 0rpx 30rpx 0rpx 30rpx; + padding: 15rpx 20rpx; + border-radius: 60rpx; + font-size: 28rpx; +} + +.search-input { + flex: 1; +} + +.list-container { + display: flex; + flex-direction: column; +} + +.container-box { + background-color: var(--white-color); + margin: 120rpx -30rpx 0rpx -30rpx; + padding: 30rpx; + min-height: 83vh; +} + +.list-item { + display: flex; + flex-direction: row; +} + +.list-item:nth-of-type(n+1) { + margin: 15rpx 0rpx; + padding-bottom: 20rpx; + border-bottom: 1rpx solid var(--bg-gray-input-color); +} + +.list-item:last-child { + border-bottom: none; +} + + +.item-img-box { + background-color: var(--divider-color); + flex: 0.4; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + padding: 10rpx; + border-radius: 8rpx; +} + +.item-img { + width: 68%; + height: 180rpx; +} + +.item-container { + display: flex; + flex-direction: column; + flex: 1; + padding: 0rpx 15rpx; +} + +.item-goods-name-box { + display: flex; + flex-direction: row; + align-items: center; +} + +.item-goods-status { + font-size: 22rpx; + text-align: center; + line-height: 32rpx; + height: 32rpx; + white-space: nowrap; + padding: 3rpx 10rpx; + border-radius: 5rpx; + margin-right: 15rpx; +} + +.item-goods-name { + font-size: 28rpx; + color: var(--text-color); + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; + overflow: hidden; + text-overflow: ellipsis; +} + +.item-price-box { + display: flex; + flex-direction: row; + align-items: center; + margin-top: 20rpx; +} + +.item-price-title { + font-size: 28rpx; + color: var(--text-gray-hint-color); +} + +.item-price-price { + margin-left: 20rpx; + color: var(--red-color); + font-weight: bold; +} + +.item-time-box { + display: flex; + flex-direction: column; + margin-top: 15rpx; +} + +.item-time-item { + display: flex; + flex-direction: row; +} + +.item-time-title { + font-size: 24rpx; + color: var(--text-gray-hint-color) +} + +.item-time-time { + font-size: 24rpx; + color: var(--text-gray-desc-color); + margin-left: 20rpx; +} + +.col-gray { + background-color: var(--bg-gray-status-light-color); + color: var(--text-color); +} + +.col-green { + background-color: var(--bg-green-status-light-color); + color: var(--text-color); +} + +.col-primary { + background-color: var(--primary-color-light); + color: var(--text-color); +} + +.col-red { + background-color: var(--bg-red-deep-color); + color: var(--white-color); +} \ No newline at end of file diff --git a/utils/comm.wxs b/utils/comm.wxs index d13220f..e6d0835 100644 --- a/utils/comm.wxs +++ b/utils/comm.wxs @@ -90,6 +90,45 @@ var invoiceStatus = function (status) { } return str } +// 订单状态0:取消订单,1:待付款,2:待填写资料,3:过户中,4:平台下证 +var goodsOrderStatus = function (status) { + var str = '已取消' + switch (status) { + case '0': + str = '已取消' + break + case '1': + str = '待付款' + break + case '2': + str = '写资料' + break + case '3': + str = '过户中' + break + case '4': + str = '已下证' + break + } + return str +} +var goodsOrderColor = function (status) { + var str = 'col-gray' + switch (status) { + case '0': + str = 'col-gray' + break + case '1': + case '2': + case '3': + str = 'col-primary' + break + case '4': + str = 'col-green' + break + } + return str +} var coverTxt = function (price) { return '' + price } @@ -383,5 +422,7 @@ module.exports = { repairType: repairType, repairKind: repairKind, phoneNum: phoneNum, - includes: includes + includes: includes, + goodsOrderStatus: goodsOrderStatus, + goodsOrderColor: goodsOrderColor }; \ No newline at end of file