From ab4015d0e0ac73afbbd514377f18e58940fb5ddb Mon Sep 17 00:00:00 2001 From: paulGao Date: Thu, 10 Feb 2022 18:57:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E4=BF=AE=E6=94=B9=E7=9A=84ap?= =?UTF-8?q?i?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/address.js | 14 ++++----- api/after-sale.js | 30 +++++++++---------- api/article.js | 2 +- api/common.js | 4 +-- api/goods.js | 10 +++---- api/home.js | 6 ++-- api/members.js | 24 +++++++-------- api/order.js | 8 ++--- api/store.js | 6 ++-- api/trade.js | 6 ++-- components/verification/verification.vue | 4 +-- config/api.js | 7 +++-- pages/order/afterSales/afterSales.vue | 12 ++++---- pages/order/afterSales/afterSalesDetail.vue | 4 +-- .../afterSales/afterSalesDetailExpress.vue | 4 ++- pages/order/afterSales/afterSalesSelect.vue | 10 ++----- pages/order/afterSales/applyDetail.vue | 7 +++-- utils/storage.js | 13 ++++++++ 18 files changed, 91 insertions(+), 80 deletions(-) diff --git a/api/address.js b/api/address.js index 22b8cfa..1eee63f 100644 --- a/api/address.js +++ b/api/address.js @@ -12,7 +12,7 @@ import api from "@/config/api.js"; */ export function getAddressList(pageNumber, pageSize) { return http.request({ - url: "/memberAddress", + url: "/member/address", method: Method.GET, needToken: true, params: { pageNumber, pageSize }, @@ -37,7 +37,7 @@ export function getLogistics() { */ export function getAddressCode(cityCode, townName) { return http.request({ - url: api.common + "/region/region", + url: api.common + "/common/region/region", method: Method.GET, needToken: true, params: { cityCode, townName }, @@ -51,7 +51,7 @@ export function getAddressCode(cityCode, townName) { */ export function addAddress(data) { return http.request({ - url: "/memberAddress", + url: "/member/address", method: Method.POST, needToken: true, header: { "content-type": "application/x-www-form-urlencoded" }, @@ -67,7 +67,7 @@ export function addAddress(data) { */ export function editAddress(params) { return http.request({ - url: `/memberAddress`, + url: `/member/address`, method: Method.PUT, needToken: true, header: { "content-type": "application/x-www-form-urlencoded" }, @@ -81,7 +81,7 @@ export function editAddress(params) { */ export function deleteAddress(id) { return http.request({ - url: `/memberAddress/delById/${id}`, + url: `/member/address/delById/${id}`, method: Method.DELETE, needToken: true, }); @@ -95,7 +95,7 @@ export function deleteAddress(id) { */ export function getAddressDetail(id) { return http.request({ - url: `/memberAddress/get/${id}`, + url: `/member/address/get/${id}`, method: Method.GET, loading: false, needToken: true, @@ -107,7 +107,7 @@ export function getAddressDetail(id) { */ export function getAddressDefault() { return http.request({ - url: `/memberAddress/get/default`, + url: `/member/address/get/default`, method: Method.GET, loading: false, needToken: true, diff --git a/api/after-sale.js b/api/after-sale.js index a4aa898..eb61cbd 100644 --- a/api/after-sale.js +++ b/api/after-sale.js @@ -40,7 +40,7 @@ export function applyCancelOrder(params) { */ export function getStoreAfterSaleAddress(sn) { return http.request({ - url: `/afterSale/getStoreAfterSaleAddress/${sn}`, + url: `/order/afterSale/getStoreAfterSaleAddress/${sn}`, method: Method.GET, needToken: true, }); @@ -50,7 +50,7 @@ export function getStoreAfterSaleAddress(sn) { */ export function cancelAfterSale(afterSaleSn) { return http.request({ - url: `/afterSale/cancel/${afterSaleSn}`, + url: `/order/afterSale/cancel/${afterSaleSn}`, method: Method.POST, needToken: true, }); @@ -64,7 +64,7 @@ export function cancelAfterSale(afterSaleSn) { */ export function getAfterSaleList(params) { return http.request({ - url: `/afterSale/page`, + url: `/order/afterSale/page`, method: Method.GET, needToken: true, params, @@ -77,7 +77,7 @@ export function getAfterSaleList(params) { */ export function getServiceDetail(sn) { return http.request({ - url: `/afterSale/get/${sn}`, + url: `/order/afterSale/get/${sn}`, method: Method.GET, needToken: true, }); @@ -89,7 +89,7 @@ export function getServiceDetail(sn) { */ export function addComplain(params) { return http.request({ - url: `/complain`, + url: `/order/complain`, method: Method.POST, needToken: true, header: { @@ -104,7 +104,7 @@ export function addComplain(params) { */ export function clearComplain(id, params) { return http.request({ - url: `/complain/status/${id}`, + url: `/order/complain/status/${id}`, method: Method.PUT, needToken: true, params, @@ -116,7 +116,7 @@ export function clearComplain(id, params) { */ export function getAfterSaleLog(sn) { return http.request({ - url: `/afterSale/get/getAfterSaleLog/${sn}`, + url: `/order/afterSale/get/getAfterSaleLog/${sn}`, method: Method.GET, needToken: true, }); @@ -127,7 +127,7 @@ export function getAfterSaleLog(sn) { */ export function getComplain(params) { return http.request({ - url: `/complain`, + url: `/order/complain`, method: Method.GET, needToken: true, params, @@ -139,7 +139,7 @@ export function getComplain(params) { */ export function getAfterSaleReason(serviceType) { return http.request({ - url: `/afterSale/get/afterSaleReason/${serviceType}`, + url: `/order/afterSale/get/afterSaleReason/${serviceType}`, method: Method.GET, needToken: true, }); @@ -150,7 +150,7 @@ export function getAfterSaleReason(serviceType) { */ export function getClearReason() { return http.request({ - url: `/afterSale/get/afterSaleReason/CANCEL`, + url: `/order/afterSale/get/afterSaleReason/CANCEL`, method: Method.GET, needToken: true, }); @@ -161,7 +161,7 @@ export function getClearReason() { */ export function getComplainReason() { return http.request({ - url: `/afterSale/get/afterSaleReason/COMPLAIN`, + url: `/order/afterSale/get/afterSaleReason/COMPLAIN`, method: Method.GET, needToken: true, }); @@ -171,7 +171,7 @@ export function getComplainReason() { */ export function getComplainDetail(id) { return http.request({ - url: `/complain/${id}`, + url: `/order/complain/${id}`, method: Method.GET, needToken: true, }); @@ -182,7 +182,7 @@ export function getComplainDetail(id) { */ export function getAfterSaleInfo(sn) { return http.request({ - url: `/afterSale/applyAfterSaleInfo/${sn}`, + url: `/order/afterSale/applyAfterSaleInfo/${sn}`, method: Method.GET, needToken: true, }); @@ -194,7 +194,7 @@ export function getAfterSaleInfo(sn) { */ export function applyReturn(orderItemSn, params) { return http.request({ - url: `/afterSale/save/${orderItemSn}`, + url: `/order/afterSale/save/${orderItemSn}`, method: Method.POST, header: { "Content-Type": "application/x-www-form-urlencoded", @@ -210,7 +210,7 @@ export function applyReturn(orderItemSn, params) { */ export function fillShipInfo(afterSaleSn, params) { return http.request({ - url: `/afterSale/delivery/${afterSaleSn}`, + url: `/order/afterSale/delivery/${afterSaleSn}`, method: Method.POST, header: { "Content-Type": "application/x-www-form-urlencoded", diff --git a/api/article.js b/api/article.js index 788e38a..0d5bacc 100644 --- a/api/article.js +++ b/api/article.js @@ -23,7 +23,7 @@ export function getArticleCategory(category_type) { */ export function getArticleDetail(type) { return http.request({ - url: `/article/get/${type}`, + url: `/other/article/get/${type}`, method: Method.GET, }); } diff --git a/api/common.js b/api/common.js index 030e5e2..20f7ce3 100644 --- a/api/common.js +++ b/api/common.js @@ -10,7 +10,7 @@ import api from "@/config/api.js"; */ export function getRegionsById(id = 0) { return http.request({ - url: `${api.common}/region/item/${id}`, + url: `${api.common}/common/region/item/${id}`, method: Method.GET, message: false, }); @@ -29,4 +29,4 @@ export function getIMDetail() { * 文件上传地址 * @type {string} */ -export const upload = api.common + "/upload/file"; +export const upload = api.common + "/common/upload/file"; diff --git a/api/goods.js b/api/goods.js index 885bb17..f453c13 100644 --- a/api/goods.js +++ b/api/goods.js @@ -9,7 +9,7 @@ import { http, Method } from "@/utils/request.js"; */ export function getGoodsMessage(goodsId) { return http.request({ - url: `/goods/get/${goodsId}`, + url: `/goods/goods/get/${goodsId}`, method: Method.GET, }); } @@ -19,7 +19,7 @@ import { http, Method } from "@/utils/request.js"; */ export function getGoodsRelated(params) { return http.request({ - url: `/goods/es/related`, + url: `/goods/goods/es/related`, method: Method.GET, params, }); @@ -32,7 +32,7 @@ export function getGoodsRelated(params) { */ export function getGoods(skuId, goodsId) { return http.request({ - url: `/goods/sku/${goodsId}/${skuId}`, + url: `/goods/goods/sku/${goodsId}/${skuId}`, method: Method.GET, }); } @@ -56,7 +56,7 @@ export function getGoodsRelated(params) { */ export function getGoodsList(params) { return http.request({ - url: "/goods/es", + url: "/goods/goods/es", method: Method.GET, params, }); @@ -112,7 +112,7 @@ export function getPlateformTagGoods(tag_id) { */ export function getCategoryList(id) { return http.request({ - url: `/category/get/${id}`, + url: `/goods/category/get/${id}`, method: Method.GET, loading: false, }); diff --git a/api/home.js b/api/home.js index fc94bcc..a5dee69 100644 --- a/api/home.js +++ b/api/home.js @@ -32,7 +32,7 @@ export function getCategory(parent_id = 0) { */ export function getHotKeywords(count) { return http.request({ - url: "/goods/hot-words", + url: "/goods/goods/hot-words", method: Method.GET, loading: false, params: { count }, @@ -46,7 +46,7 @@ export function getHotKeywords(count) { */ export function getFloorData() { return http.request({ - url: `/pageData/getIndex?clientType=H5`, + url: `/other/pageData/getIndex?clientType=H5`, method: "get", }); } @@ -56,7 +56,7 @@ export function getFloorData() { */ export function getCategoryIndexData(parentId = 0) { return http.request({ - url: `/category/get/${parentId}`, + url: `/goods/category/get/${parentId}`, method: "get", }); } diff --git a/api/members.js b/api/members.js index 08bba68..b6541a7 100644 --- a/api/members.js +++ b/api/members.js @@ -6,7 +6,7 @@ import { http, Method } from "@/utils/request.js"; */ export function feedBack(params) { return http.request({ - url: "/feedback", + url: "/other/feedback", method: Method.POST, needToken: true, params, @@ -16,7 +16,7 @@ export function feedBack(params) { // 提现 export function withdrawalApply(params) { return http.request({ - url: "/members/wallet/withdrawal", + url: "/wallet/wallet/withdrawal", method: Method.POST, needToken: true, params, @@ -30,7 +30,7 @@ export function withdrawalApply(params) { */ export function payCallback(params) { return http.request({ - url: `/cashier/result`, + url: `/payment/cashier/result`, method: Method.GET, params, }); @@ -117,7 +117,7 @@ export function getPointsData(params) { */ export function getComments(params) { return http.request({ - url: "/memberEvaluation", + url: "/member/evaluation", method: Method.GET, needToken: true, params, @@ -131,7 +131,7 @@ export function getComments(params) { */ export function getFootprintNum(params) { return http.request({ - url: "/footprint/getFootprintNum", + url: "/member/footprint/getFootprintNum", method: Method.GET, needToken: true, params, @@ -144,7 +144,7 @@ export function getFootprintNum(params) { */ export function commentsMemberOrder(params) { return http.request({ - url: "/memberEvaluation", + url: "/member/evaluation", method: Method.POST, needToken: true, header: { "content-type": "application/x-www-form-urlencoded" }, @@ -287,7 +287,7 @@ export function getUserInfo() { */ export function getUserWallet() { return http.request({ - url: "/members/wallet", + url: "/wallet/wallet", method: Method.GET, needToken: true, }); @@ -300,7 +300,7 @@ export function getUserWallet() { */ export function saveUserInfo(params) { return http.request({ - url: "/members/editOwn", + url: "/passport/members/editOwn", method: Method.PUT, header: { "content-type": "application/x-www-form-urlencoded" }, needToken: true, @@ -328,7 +328,7 @@ export function addReceipt(params) { */ export function getGoodsComments(goodsId, params) { return http.request({ - url: `/memberEvaluation/${goodsId}/goodsEvaluation`, + url: `/member/evaluation/${goodsId}/goodsEvaluation`, method: Method.GET, loading: false, params, @@ -341,7 +341,7 @@ export function getGoodsComments(goodsId, params) { */ export function getGoodsCommentsCount(goodsId) { return http.request({ - url: `/memberEvaluation/${goodsId}/evaluationNumber`, + url: `/member/evaluation/${goodsId}/evaluationNumber`, method: Method.GET, loading: false, }); @@ -365,7 +365,7 @@ export function getNoReadMessageNum() { */ export function myTrackList(params) { return http.request({ - url: `/footprint`, + url: `/member/footprint`, method: Method.GET, needToken: true, params, @@ -378,7 +378,7 @@ export function myTrackList(params) { */ export function deleteHistoryListId(ids) { return http.request({ - url: `/footprint/delByIds/${ids}`, + url: `/member/footprint/delByIds/${ids}`, method: Method.DELETE, needToken: true, }); diff --git a/api/order.js b/api/order.js index d9b7f1e..a718297 100644 --- a/api/order.js +++ b/api/order.js @@ -51,7 +51,7 @@ export function selectedShipMethod(params) { */ export function getOrderList(params) { return http.request({ - url: "/orders", + url: "/order/order", method: Method.GET, needToken: true, params, @@ -64,7 +64,7 @@ export function getOrderList(params) { */ export function getOrderDetail(orderSn) { return http.request({ - url: `/orders/${orderSn}`, + url: `/order/order/${orderSn}`, method: Method.GET, needToken: true, }); @@ -77,7 +77,7 @@ export function getOrderDetail(orderSn) { */ export function cancelOrder(orderSn, reason) { return http.request({ - url: `/orders/${orderSn}/cancel`, + url: `/order/order/${orderSn}/cancel`, method: Method.POST, needToken: true, header: { "content-type": "application/x-www-form-urlencoded" }, @@ -91,7 +91,7 @@ export function cancelOrder(orderSn, reason) { */ export function confirmReceipt(orderSn) { return http.request({ - url: `/orders/${orderSn}/receiving`, + url: `/order/order/${orderSn}/receiving`, method: Method.POST, needToken: true, }); diff --git a/api/store.js b/api/store.js index b682100..20e5ee2 100644 --- a/api/store.js +++ b/api/store.js @@ -25,7 +25,7 @@ export function getStoreList(params) { */ export function getStoreBaseInfo(storeId) { return http.request({ - url: `/store/get/detail/${storeId}`, + url: `/store/store/get/detail/${storeId}`, method: Method.GET, loading: false, }); @@ -37,7 +37,7 @@ export function getStoreList(params) { */ export function getStoreCategory(id) { return http.request({ - url: `/store/label/get/${id}`, + url: `/store/store/label/get/${id}`, method: Method.GET, }); } @@ -49,7 +49,7 @@ export function getStoreList(params) { */ export function getLicencePhoto(id) { return http.request({ - url: `/store/get/licencePhoto/${id}`, + url: `/store/store/get/licencePhoto/${id}`, method: Method.GET, }); } diff --git a/api/trade.js b/api/trade.js index 54c962b..bc4beb1 100644 --- a/api/trade.js +++ b/api/trade.js @@ -177,7 +177,7 @@ export function createTrade(params) { */ export function getCashierData(params) { return http.request({ - url: "cashier/tradeDetail", + url: "payment/cashier/tradeDetail", method: Method.GET, needToken: true, params, @@ -194,7 +194,7 @@ export function getCashierData(params) { */ export function initiatePay(paymentMethod, paymentClient, params) { return http.request({ - url: `cashier/pay/${paymentMethod}/${paymentClient}`, + url: `payment/cashier/pay/${paymentMethod}/${paymentClient}`, method: Method.GET, needToken: true, params, @@ -209,7 +209,7 @@ export function initiatePay(paymentMethod, paymentClient, params) { */ export function getExpress(orderSn) { return http.request({ - url: `/orders/getTraces/${orderSn}`, + url: `/order/order/getTraces/${orderSn}`, method: Method.POST, needToken: true, diff --git a/components/verification/verification.vue b/components/verification/verification.vue index 1ba7f26..3fe807b 100644 --- a/components/verification/verification.vue +++ b/components/verification/verification.vue @@ -144,7 +144,7 @@ export default { storage.setUuid(uuid.v1()); } uni.request({ - url: api.common + "/slider/" + this.business, + url: api.common + "/common/slider/" + this.business, header: { uuid: storage.getUuid(), }, @@ -179,7 +179,7 @@ export default { method: "POST", url: api.common + - "/slider/" + + "/common/slider/" + this.business + "?xPos=" + parseInt(this.moveCode * this.tl), diff --git a/config/api.js b/config/api.js index e7ca7fa..2055106 100644 --- a/config/api.js +++ b/config/api.js @@ -4,8 +4,11 @@ */ // 开发环境 const dev = { - common: "https://common-api.pickmall.cn", - buyer: "https://buyer-api.pickmall.cn", + // common: "https://common-api.pickmall.cn", + // buyer: "https://buyer-api.pickmall.cn", + + common: "http://127.0.0.1:8888", + buyer: "http://127.0.0.1:8888", }; // 生产环境 diff --git a/pages/order/afterSales/afterSales.vue b/pages/order/afterSales/afterSales.vue index e55a186..0334375 100644 --- a/pages/order/afterSales/afterSales.vue +++ b/pages/order/afterSales/afterSales.vue @@ -119,6 +119,7 @@ import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue"; import { getAfterSaleList, cancelAfterSale } from "@/api/after-sale.js"; import { getOrderList } from "@/api/order.js"; +import storage from "@/utils/storage"; export default { components: { @@ -295,11 +296,9 @@ export default { ...order, ...sku, }; - + storage.setAfterSaleData(data); uni.navigateTo({ - url: `/pages/order/afterSales/afterSalesSelect?sn=${sn}&sku=${encodeURIComponent( - JSON.stringify(data) - )}`, + url: `/pages/order/afterSales/afterSalesSelect?sn=${sn}`, }); }, @@ -309,10 +308,9 @@ export default { onExpress(order, sku) { sku.storeName = order.storeName; + storage.setAfterSaleData(data); uni.navigateTo({ - url: `./afterSalesDetailExpress?serviceSn=${ - order.sn - }&sku=${encodeURIComponent(JSON.stringify(sku))}`, + url: `./afterSalesDetailExpress?serviceSn=${order.sn}`, }); }, diff --git a/pages/order/afterSales/afterSalesDetail.vue b/pages/order/afterSales/afterSalesDetail.vue index 3f0161c..5f12746 100644 --- a/pages/order/afterSales/afterSalesDetail.vue +++ b/pages/order/afterSales/afterSalesDetail.vue @@ -195,9 +195,7 @@ export default { title: navTitle, //此处写页面的title }); this.sn = options.sn; - let dsku = decodeURIComponent(options.sku); - let newSku = JSON.parse(dsku); - this.sku = newSku; + this.sku = storage.getAfterSaleData();; this.form.orderItemSn = options.sn; this.form.skuId = this.sku.skuId; diff --git a/pages/order/afterSales/afterSalesDetailExpress.vue b/pages/order/afterSales/afterSalesDetailExpress.vue index fae49d4..9f755f7 100644 --- a/pages/order/afterSales/afterSalesDetailExpress.vue +++ b/pages/order/afterSales/afterSalesDetailExpress.vue @@ -57,6 +57,7 @@