diff --git a/api/mall.js b/api/mall.js index 60f5a1d..240b290 100644 --- a/api/mall.js +++ b/api/mall.js @@ -9,8 +9,6 @@ export const mallAPI = { getCategory: () => http.get(baseUrl + '/api/category'), getMallDetail: (id) => http.get(baseUrl + '/api/products/' + id), getRecommended: (id) => http.get(baseUrl + `/api/products/${id}/recommended`), // 推荐商品 - createOrder: (data) => http.post(baseUrl + `/api/orders/create-from-cart`, data), // 创建订单 - getOrder: (orderId) => http.get(baseUrl + `/api/orders/pending-payment/${orderId}`), // 获取订单 payment: (data) => http.post(baseUrl + "/api/orders/confirm-payment", data), // 支付订单 getCouponList: (uid) => http.get(baseUrl + `/api/coupon/user/${uid}`), // 获取优惠券列表 @@ -19,6 +17,12 @@ export const mallAPI = { addCart: (data) => http.post(baseUrl + "/api/cart/add", data), // 添加购物车 editCartQuantity: (item) => http.put(baseUrl + `/api/cart/${item.id}`, {quantity: item.quantity}), // 修改数量 deleteCart: (id) => http.delete(baseUrl + `/api/cart/${id}`), // 删除 + + getOrderList: (params) => http.get(baseUrl + "/api/orders", params), // 获取订单列表 + createOrder: (data) => http.post(baseUrl + `/api/orders/create-from-cart`, data), // 创建订单 + getOrder: (orderId) => http.get(baseUrl + `/api/orders/pending-payment/${orderId}`), // 获取订单 + cancelOrder: (orderId) => http.put(baseUrl + `/api/orders/${orderId}/cancel`), // 取消订单 + confirmOrder: (orderId) => http.put(baseUrl + `/orders/${orderId}/confirm`), // 收货 } export default { diff --git a/pages.json b/pages.json index 162ab45..d672c9e 100644 --- a/pages.json +++ b/pages.json @@ -76,13 +76,6 @@ "navigationStyle": "custom" } }, - { - "path": "pages/mall/mall", - "style": { - "navigationBarTitleText": "商城", - "navigationStyle": "custom" - } - }, { "path": "pages/message/chat", "style": { @@ -148,7 +141,8 @@ { "path": "pages/my/order", "style": { - "navigationBarTitleText": "我的订单" + "navigationBarTitleText": "我的订单", + "navigationStyle": "custom" } }, { diff --git a/pages/home/mallDetail.vue b/pages/home/mallDetail.vue index a93e8d1..cb5c4b3 100644 --- a/pages/home/mallDetail.vue +++ b/pages/home/mallDetail.vue @@ -118,11 +118,11 @@ - + {{popTitle}} - + @@ -167,15 +167,15 @@ - + + {{popTitle}} @@ -199,7 +199,8 @@ mallAPI } from '../../api/mall'; import { - getImageUrl, arrayContainsAll + getImageUrl, + arrayContainsAll } from '../../util/common.js'; const instance = getCurrentInstance(); @@ -679,6 +680,7 @@ .sure-popup { background: #F5F8FF; padding-bottom: 20rpx; + height: 100%; .title { font-weight: 274; @@ -763,5 +765,12 @@ } } } + + .submit-btn { + padding: 0 20rpx; + position: absolute; + bottom: 20rpx; + width: 100%; + } } \ No newline at end of file diff --git a/pages/mall/mall.vue b/pages/mall/mall.vue deleted file mode 100644 index f26856a..0000000 --- a/pages/mall/mall.vue +++ /dev/null @@ -1,336 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/my/car.vue b/pages/my/car.vue index 5c9686e..c68bf77 100644 --- a/pages/my/car.vue +++ b/pages/my/car.vue @@ -80,7 +80,8 @@ } from '../../api/mall.js'; import { getImageUrl - } from '../../util/common.js' + } from '../../util/common.js'; + import {onShow} from '@dcloudio/uni-app' const msgRef = ref() @@ -199,10 +200,13 @@ cartList.value.forEach(item => item.isCheck = false) }) } + + onShow(()=>{ + loadData() + }) onMounted(() => { loadHeight() - loadData() }) diff --git a/pages/my/my.vue b/pages/my/my.vue index b0d6ef1..b1d53e6 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -123,7 +123,7 @@ 收货地址 - + 我的订单 @@ -163,6 +163,12 @@ }) } + const handleOrder = () => { + uni.navigateTo({ + url: '/pages/my/order' + }) + } + const loadData = () => { authAPI.me().then(res => { user.value = res.user @@ -182,17 +188,17 @@ url: '/pages/login/login' }) } - const navigatorSrc = ()=>{ - uni.navigateTo({ - url:'/pages/my/getCoupons' - }) - } - //购物车跳转 - const shop_car = ()=>{ - uni.navigateTo({ - url:'/pages/my/car' - }) - } + const navigatorSrc = () => { + uni.navigateTo({ + url: '/pages/my/getCoupons' + }) + } + //购物车跳转 + const shop_car = () => { + uni.navigateTo({ + url: '/pages/my/car' + }) + } + \ No newline at end of file