适配修改的api

master
paulGao 2022-02-10 18:57:17 +08:00
parent 557d7ef1d9
commit ab4015d0e0
18 changed files with 91 additions and 80 deletions

View File

@ -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,

View File

@ -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",

View File

@ -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,
});
}

View File

@ -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";

View File

@ -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,
});

View File

@ -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",
});
}

View File

@ -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,
});

View File

@ -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,
});

View File

@ -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,
});
}

View File

@ -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,

View File

@ -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),

View File

@ -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",
};
// 生产环境

View File

@ -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}`,
});
},

View File

@ -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;

View File

@ -57,6 +57,7 @@
<script>
import { getLogistics } from "@/api/address.js";
import { fillShipInfo } from "@/api/after-sale.js";
import storage from "@/utils/storage";
export default {
data() {
@ -76,7 +77,8 @@ export default {
};
},
onLoad(options) {
this.sku = JSON.parse(decodeURIComponent(options.sku));
this.sku = storage.getAfterSaleData();
let navTitle = "服务单详情";
uni.setNavigationBarTitle({
title: navTitle, //title

View File

@ -56,6 +56,7 @@
<script>
import { getAfterSaleInfo } from "@/api/after-sale";
import storage from "@/utils/storage";
export default {
data() {
return {
@ -66,10 +67,7 @@ export default {
},
onLoad(options) {
this.sn = options.sn;
let dData = decodeURIComponent(options.sku);
let newData = JSON.parse(dData);
this.sku = newData;
this.sku = storage.getAfterSaleData();
// 退退
this.init()
},
@ -88,9 +86,7 @@ export default {
*/
onSelect(value) {
uni.redirectTo({
url: `./afterSalesDetail?sn=${this.sn}&sku=${encodeURIComponent(
JSON.stringify(this.sku)
)}&value=${value}`,
url: `./afterSalesDetail?sn=${this.sn}&value=${value}`,
});
},

View File

@ -90,9 +90,10 @@
serviceDetail.afterSaleImage &&
serviceDetail.afterSaleImage.split(',').length != 0
">
<image :src="img" @click="preview(serviceDetail.afterSaleImage.split(','), index)"
v-for="(img, index) in serviceDetail.afterSaleImage.split(',')" :key="index"
style="width: 50px; height: 50px; margin: 0px 5px"></image>
<view v-for="(img, index) in serviceDetail.afterSaleImage.split(',')" :key="index">
<u-image width="100" height="100" :src="img" @click="preview(serviceDetail.afterSaleImage.split(','), index)"
></u-image>
</view>
</view>
<!-- 如果服务类型为退款则不显示 -->
<view class="detail-item"

View File

@ -8,6 +8,7 @@ const USER_INFO = isDev ? "user_info_obj_dev" : "user_info_obj";
const FACE_LOGIN = isDev ? "face_login_dev" : "face_login";
const FINGER_LOGIN = isDev ? "finger_login_dev" : "finger_login";
const CART_BACKBTN = isDev ? "cart_backbtn_dev" : "cart_backbtn";
const AFTERSALE_DATA = isDev ? "aftersale_data_dev" : "aftersale_data";
export default {
// 写入热门搜索时间戳
setHotWords(val) {
@ -91,4 +92,16 @@ export default {
removeRefreshToken() {
uni.removeStorageSync(REFRESH_TOKEN);
},
// 写入刷新token
setAfterSaleData(val) {
uni.setStorageSync(AFTERSALE_DATA, val);
},
// 获取刷新token
getAfterSaleData() {
return uni.getStorageSync(AFTERSALE_DATA);
},
// 删除token
removeAfterSaleData() {
uni.removeStorageSync(AFTERSALE_DATA);
},
};