From 05aa460aaab0ff5454dae91c0a11f256652c7fa5 Mon Sep 17 00:00:00 2001 From: "453530270@qq.com" Date: Wed, 25 Oct 2023 18:05:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8D=E9=80=82=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/order.js | 47 ++++++ api/upload.js | 18 +++ pages.json | 188 +----------------------- pages/address/create.vue | 187 ----------------------- pages/address/index.vue | 309 --------------------------------------- pages/address/update.vue | 225 ---------------------------- pages/article/detail.vue | 107 -------------- pages/article/index.vue | 251 ------------------------------- 8 files changed, 69 insertions(+), 1263 deletions(-) create mode 100644 api/order.js create mode 100644 api/upload.js delete mode 100644 pages/address/create.vue delete mode 100644 pages/address/index.vue delete mode 100644 pages/address/update.vue delete mode 100644 pages/article/detail.vue delete mode 100644 pages/article/index.vue diff --git a/api/order.js b/api/order.js new file mode 100644 index 0000000..8a9c16c --- /dev/null +++ b/api/order.js @@ -0,0 +1,47 @@ +import request from '@/utils/request' + +// api地址 +const api = { + todoCounts: 'order/todoCounts', + list: 'order/list', + detail: 'order/detail', + express: 'order/express', + cancel: 'order/cancel', + receipt: 'order/receipt', + pay: 'order/pay' +} + +// 当前用户待处理的订单数量 +export function todoCounts(param, option) { + return request.get(api.todoCounts, param, option) +} + +// 我的订单列表 +export function list(param, option) { + return request.get(api.list, param, option) +} + +// 订单详情 +export function detail(orderId, param) { + return request.get(api.detail, { orderId, ...param }) +} + +// 获取物流信息 +export function express(orderId, param) { + return request.get(api.express, { orderId, ...param }) +} + +// 取消订单 +export function cancel(orderId, data) { + return request.post(api.cancel, { orderId, ...data }) +} + +// 确认收货 +export function receipt(orderId, data) { + return request.post(api.receipt, { orderId, ...data }) +} + +// 立即支付 +export function pay(orderId, payType, param) { + return request.get(api.pay, { orderId, payType, ...param }) +} diff --git a/api/upload.js b/api/upload.js new file mode 100644 index 0000000..4e28551 --- /dev/null +++ b/api/upload.js @@ -0,0 +1,18 @@ +import request from '@/utils/request' + +// api地址 +const api = { + image: 'upload/image' +} + +// 图片上传 +export const image = files => { + // 文件上传大小, 2M + const maxSize = 1024 * 1024 * 2 + // 执行上传 + return new Promise((resolve, reject) => { + request.urlFileUpload({ files, maxSize }) + .then(result => resolve(result.map(item => item.data.fileInfo.file_id), result)) + .catch(reject) + }) +} diff --git a/pages.json b/pages.json index 9cfbc4d..8cc6e09 100644 --- a/pages.json +++ b/pages.json @@ -14,17 +14,7 @@ "iconPath": "static/tabbar/cate.png", "selectedIconPath": "static/tabbar/cate-active.png", "text": "分类" - }, { - "pagePath": "pages/cart/index", - "iconPath": "static/tabbar/cart.png", - "selectedIconPath": "static/tabbar/cart-active.png", - "text": "购物车" - }, { - "pagePath": "pages/user/index", - "iconPath": "static/tabbar/user.png", - "selectedIconPath": "static/tabbar/user-active.png", - "text": "我的" - }] + } ] }, "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages { @@ -33,18 +23,6 @@ "enablePullDownRefresh": true } }, - { - "path": "pages/category/index", - "style": { - "navigationBarTitleText": "全部分类" - } - }, - { - "path": "pages/cart/index", - "style": { - "navigationBarTitleText": "购物车" - } - }, { "path": "pages/user/index", "style": { @@ -53,18 +31,8 @@ "navigationStyle": "custom" } }, - { - "path": "pages/custom/index", - "style": { - "enablePullDownRefresh": true - } - }, - { - "path": "pages/search/index", - "style": { - "navigationBarTitleText": "商品搜索" - } - }, + + { "path": "pages/login/index", "style": { @@ -83,161 +51,13 @@ "navigationBarTitleText": "个人信息" } }, - { - "path": "pages/article/index", - "style": { - "navigationBarTitleText": "资讯列表" - } - }, - { - "path": "pages/article/detail", - "style": { - "navigationBarTitleText": "资讯详情" - } - }, { "path": "pages/help/index", "style": { "navigationBarTitleText": "帮助中心" } - }, - { - "path": "pages/coupon/index", - "style": { - "navigationBarTitleText": "领券中心" - } - }, - { - "path": "pages/goods/list", - "style": { - "navigationBarTitleText": "商品列表", - "enablePullDownRefresh": true - } - }, - { - "path": "pages/goods/detail", - "style": { - "navigationBarTitleText": "商品详情页" - } - }, - { - "path": "pages/comment/index", - "style": { - "navigationBarTitleText": "商品评价页" - } - }, - { - "path": "pages/my-coupon/index", - "style": { - "navigationBarTitleText": "我的优惠券" - } - }, - { - "path": "pages/address/index", - "style": { - "navigationBarTitleText": "收货地址" - } - }, - { - "path": "pages/address/create", - "style": { - "navigationBarTitleText": "新增收货地址" - } - }, - { - "path": "pages/address/update", - "style": { - "navigationBarTitleText": "编辑收货地址" - } - }, - { - "path": "pages/points/log", - "style": { - "navigationBarTitleText": "账单明细" - } - }, - { - "path": "pages/wallet/index", - "style": { - "navigationBarTitleText": "我的钱包" - } - }, - { - "path": "pages/wallet/balance/log", - "style": { - "navigationBarTitleText": "账单详情" - } - }, - { - "path": "pages/wallet/recharge/index", - "style": { - "navigationBarTitleText": "充值中心" - } - }, - { - "path": "pages/wallet/recharge/order", - "style": { - "navigationBarTitleText": "充值记录" - } - }, - { - "path": "pages/checkout/index", - "style": { - "navigationBarTitleText": "订单结算台" - } - }, - { - "path": "pages/order/center", - "style": { - "navigationBarTitleText": "订单中心", - "enablePullDownRefresh": true - } - }, - { - "path": "pages/order/index", - "style": { - "navigationBarTitleText": "我的订单", - "enablePullDownRefresh": true - } - }, - { - "path": "pages/order/detail", - "style": { - "navigationBarTitleText": "订单详情", - "navigationBarTextStyle": "white", - "navigationBarBackgroundColor": "#e8c269" - } - }, - { - "path": "pages/order/express/index", - "style": { - "navigationBarTitleText": "物流跟踪" - } - }, - { - "path": "pages/order/comment/index", - "style": { - "navigationBarTitleText": "订单评价" - } - }, - { - "path": "pages/refund/index", - "style": { - "navigationBarTitleText": "退换/售后" - } - }, - { - "path": "pages/refund/detail", - "style": { - "navigationBarTitleText": "售后详情" - } - }, - { - "path": "pages/refund/apply", - "style": { - "navigationBarTitleText": "申请售后" - } } + ], "globalStyle": { // #ifdef H5 diff --git a/pages/address/create.vue b/pages/address/create.vue deleted file mode 100644 index 2208a8d..0000000 --- a/pages/address/create.vue +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - diff --git a/pages/address/index.vue b/pages/address/index.vue deleted file mode 100644 index 182a589..0000000 --- a/pages/address/index.vue +++ /dev/null @@ -1,309 +0,0 @@ - - - - - diff --git a/pages/address/update.vue b/pages/address/update.vue deleted file mode 100644 index c2fc682..0000000 --- a/pages/address/update.vue +++ /dev/null @@ -1,225 +0,0 @@ - - - - - - diff --git a/pages/article/detail.vue b/pages/article/detail.vue deleted file mode 100644 index 9023d15..0000000 --- a/pages/article/detail.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - - - diff --git a/pages/article/index.vue b/pages/article/index.vue deleted file mode 100644 index 35ef17e..0000000 --- a/pages/article/index.vue +++ /dev/null @@ -1,251 +0,0 @@ - - - - -