This commit is contained in:
陈浩 2025-05-02 17:32:03 +08:00
parent 0185f1eaf2
commit 96407c7a02
7 changed files with 225 additions and 55 deletions

View File

@ -4,8 +4,11 @@
*/ */
// 开发环境 // 开发环境
const dev = { const dev = {
// common: "https://common-api.pickmall.cn", // common: "http://192.168.1.211:8890",
// buyer: "https://buyer-api.pickmall.cn", // buyer: "http://192.168.1.211:8888",
// vlog: "http://192.168.1.211:8099",
// web: "http://192.168.1.211:8099",
// seller: "http://192.168.1.211:8889",
common: "http://43.143.227.203:8890", common: "http://43.143.227.203:8890",
buyer: "http://43.143.227.203:8888", buyer: "http://43.143.227.203:8888",
vlog: "http://43.143.227.203:8099", vlog: "http://43.143.227.203:8099",

View File

@ -1,33 +1,80 @@
<template> <template>
<view class="content"> <view class="content">
<view class="navbar"> <view class="navbar">
<view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view> <view
v-for="(item, index) in navList"
:key="index"
class="nav-item"
:class="{ current: tabCurrentIndex === index }"
@click="tabClick(index)"
>{{ item.text }}</view
>
</view> </view>
<swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab"> <swiper
<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex"> :current="tabCurrentIndex"
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData(tabIndex)"> class="swiper-box"
duration="300"
@change="changeTab"
>
<swiper-item
class="tab-content"
v-for="(tabItem, tabIndex) in navList"
:key="tabIndex"
>
<scroll-view
class="list-scroll-content"
scroll-y
@scrolltolower="loadData(tabIndex)"
>
<!-- 空白页 --> <!-- 空白页 -->
<u-empty text="暂无订单" mode="list" v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></u-empty> <u-empty
text="暂无订单"
mode="list"
v-if="tabItem.loaded === true && tabItem.orderList.length === 0"
></u-empty>
<!-- 订单列表 --> <!-- 订单列表 -->
<view class="seller-view" :key="oderIndex" v-for="(order, oderIndex) in tabItem.orderList"> <view
class="seller-view"
:key="oderIndex"
v-for="(order, oderIndex) in tabItem.orderList"
>
<!-- 店铺名称 --> <!-- 店铺名称 -->
<view class="seller-info u-flex u-row-between"> <view class="seller-info u-flex u-row-between">
<view class="seller-name" @click="navigateToStore(order)"> <view class="seller-name" @click="navigateToStore(order)">
<view class="name">{{ order.storeName }}</view> <view class="name">{{ order.storeName }}</view>
</view> </view>
<view class="order-sn">{{ <view class="order-sn">
order.orderStatus | orderStatusList {{ order.orderStatus | orderStatusList }}</view
}}</view> >
</view> </view>
<view> <view>
<view> <view>
<view class="goods-item-view" @click="navigateToOrderDetail(order.sn)"> <view
<view class="goods-img" v-for="(goods, goodsIndex) in order.orderItems" :key="goodsIndex"> class="goods-item-view"
<u-image border-radius="6" width="100%" height="100%" :src="imgfun(goods.image)"></u-image> @click="navigateToOrderDetail(order.sn)"
>
<view
class="goods-img"
v-for="(goods, goodsIndex) in order.orderItems"
:key="goodsIndex"
>
<u-image
border-radius="6"
width="100%"
height="100%"
:src="imgfun(goods.image)"
></u-image>
</view> </view>
<view class="goods-info"> <view class="goods-info">
<view v-if="order.orderItems.length <= 1" class="goods-title u-line-2">{{ order.groupName }}</view> <view
<view v-if="order.orderItems.length <= 1" class="goods-price"> v-if="order.orderItems.length <= 1"
class="goods-title u-line-2"
>{{ order.groupName }}</view
>
<view
v-if="order.orderItems.length <= 1"
class="goods-price"
>
{{ order.flowPrice | unitPrice }} {{ order.flowPrice | unitPrice }}
</view> </view>
</view> </view>
@ -45,23 +92,62 @@
</view> </view>
<view> <view>
<!-- 全部 --> <!-- 全部 -->
<u-button ripple class="pay-btn" shape="circle" size="mini" v-if="order.allowOperationVO.pay" @click="waitPay(order)">立即付款</u-button> <u-button
ripple
class="pay-btn"
shape="circle"
size="mini"
v-if="order.allowOperationVO.pay"
@click="waitPay(order)"
>立即付款</u-button
>
<!-- 取消订单 --> <!-- 取消订单 -->
<u-button ripple class="cancel-btn" shape="circle" size="mini" v-if="order.allowOperationVO.cancel" @click="onCancel(order.sn)"> <u-button
ripple
class="cancel-btn"
shape="circle"
size="mini"
v-if="order.allowOperationVO.cancel"
@click="onCancel(order.sn)"
>
取消订单 取消订单
</u-button> </u-button>
<!-- 等待收货 --> <!-- 等待收货 -->
<u-button ripple shape="circle" class="rebuy-btn" size="mini" v-if="order.allowOperationVO.showLogistics" @click="navigateToLogistics(order)"> <u-button
ripple
shape="circle"
class="rebuy-btn"
size="mini"
v-if="order.allowOperationVO.showLogistics"
@click="navigateToLogistics(order)"
>
查看物流 查看物流
</u-button> </u-button>
<u-button ripple :customStyle="{'background':lightColor,'color':'#fff' }" shape="circle" class="pay-btn" size="mini" v-if="order.allowOperationVO.rog" @click="onRog(order.sn)"> <u-button
ripple
:customStyle="{ background: lightColor, color: '#fff' }"
shape="circle"
class="pay-btn"
size="mini"
v-if="order.allowOperationVO.rog"
@click="onRog(order.sn)"
>
确认收货 确认收货
</u-button> </u-button>
<u-button ripple shape="circle" class="cancel-btn" size="mini" <u-button
v-if="order.groupAfterSaleStatus.includes('NOT_APPLIED')" @click="showcancel=true"> ripple
shape="circle"
class="cancel-btn"
size="mini"
v-if="!order.allowOperationVO.pay"
@click="maging(order)"
>
退款/售后 退款/售后
</u-button> </u-button>
<u-modal v-model="showcancel" :content="contenttitle"></u-modal> <u-modal
v-model="showcancel"
:content="contenttitle"
></u-modal>
<!-- <u-button ripple shape="circle" class="cancel-btn" size="mini" v-if="order.groupAfterSaleStatus.includes('NOT_APPLIED')" @click="applyService(order)"> <!-- <u-button ripple shape="circle" class="cancel-btn" size="mini" v-if="order.groupAfterSaleStatus.includes('NOT_APPLIED')" @click="applyService(order)">
退款/售后 退款/售后
</u-button> --> </u-button> -->
@ -80,26 +166,57 @@
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
</swiper> </swiper>
<u-popup class="cancel-popup" v-model="cancelShow" mode="bottom" length="60%"> <u-popup
class="cancel-popup"
v-model="cancelShow"
mode="bottom"
length="60%"
>
<view class="header">取消订单</view> <view class="header">取消订单</view>
<view class="body"> <view class="body">
<view class="title">取消订单后本单享有的优惠可能会一并取消是否继续</view> <view class="title"
>取消订单后本单享有的优惠可能会一并取消是否继续</view
>
<view> <view>
<u-radio-group v-model="reason"> <u-radio-group v-model="reason">
<view class="value"> <view class="value">
<view class="radio-view" :key="index" v-for="(item, index) in cancelList"> <view
<u-radio :active-color="lightColor" label-size="25" shape="circle" :name="item.reason" @change="reasonChange">{{ item.reason }}</u-radio> class="radio-view"
:key="index"
v-for="(item, index) in cancelList"
>
<u-radio
:active-color="lightColor"
label-size="25"
shape="circle"
:name="item.reason"
@change="reasonChange"
>{{ item.reason }}</u-radio
>
</view> </view>
</view> </view>
</u-radio-group> </u-radio-group>
</view> </view>
</view> </view>
<view class="footer"> <view class="footer">
<u-button size="medium" ripple v-if="reason" shape="circle" @click="submitCancel">提交</u-button> <u-button
size="medium"
ripple
v-if="reason"
shape="circle"
@click="submitCancel"
>提交</u-button
>
</view> </view>
</u-popup> </u-popup>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
<u-modal :confirm-color="lightColor" v-model="rogShow" :show-cancel-button="true" :content="'是否确认收货?'" @confirm="confirmRog"></u-modal> <u-modal
:confirm-color="lightColor"
v-model="rogShow"
:show-cancel-button="true"
:content="'是否确认收货?'"
@confirm="confirmRog"
></u-modal>
</view> </view>
</template> </template>
@ -162,6 +279,13 @@ export default {
orderList: [], orderList: [],
pageNumber: 1, pageNumber: 1,
}, },
{
state: 6,
text: "已退款",
loadStatus: "more",
orderList: [],
pageNumber: 1,
},
], ],
status: "", // status: "", //
params: { params: {
@ -186,9 +310,13 @@ export default {
{ {
orderStatus: "COMPLETE", // orderStatus: "COMPLETE", //
}, },
{ {
orderStatus: "CANCELLED", // orderStatus: "CANCELLED", //
}, },
{
orderStatus: "REFUNDED", //退
},
], ],
cancelShow: false, // cancelShow: false, //
orderSn: "", //ordersn orderSn: "", //ordersn
@ -213,8 +341,6 @@ export default {
this.loadData(this.status); this.loadData(this.status);
}, },
onLoad(options) { onLoad(options) {
/** /**
* 修复app端点击除全部订单外的按钮进入时不加载数据的问题 * 修复app端点击除全部订单外的按钮进入时不加载数据的问题
@ -226,7 +352,6 @@ export default {
if (status == 0) { if (status == 0) {
this.loadData(status); this.loadData(status);
} }
}, },
watch: { watch: {
@ -243,16 +368,16 @@ export default {
}, },
}, },
methods: { methods: {
maging(val) {
this.contenttitle = "请先联系商家:" + val.mobile;
this.showcancel = true;
},
// //
applyService(order) { applyService(order) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/order/afterSales/afterSales?orderSn=${order.sn}` url: `/pages/order/afterSales/afterSales?orderSn=${order.sn}`,
}); });
}, },
// //
@ -482,7 +607,6 @@ export default {
* 重新购买 * 重新购买
*/ */
reBuy(order) { reBuy(order) {
console.log(order);
return; return;
uni.navigateTo({ uni.navigateTo({
url: url:

View File

@ -8,7 +8,30 @@
</div> </div>
</div> </div>
<!-- 物流信息 --> <!-- 物流信息 -->
<view class="info-view logi-view"> <view
class="info-view logi-view"
:style="{ display: 'flex', flexDirection: 'column' }"
v-if="orderDetail.ste == '1'"
>
<view :style="{ width: '100%' }">
<view class="order-info-view">
<view class="title">快递编号</view>
<view class="value">
{{ order.logisticsNo }}
<u-tag
class="copy"
text="复制"
type="info"
size="mini"
@click="onCopy(order.logisticsNo)"
/>
</view>
</view>
<view class="order-info-view">
<view class="title">快递</view>
<view class="value">{{ order.logisticsName }}</view>
</view>
</view>
<view class="logi-List" v-if="logiList && logiList.traces.length != 0"> <view class="logi-List" v-if="logiList && logiList.traces.length != 0">
<view class="logi-List-title"> <view class="logi-List-title">
{{ logiList.traces[logiList.traces.length - 1].AcceptStation }} {{ logiList.traces[logiList.traces.length - 1].AcceptStation }}
@ -22,12 +45,16 @@
<view class="verificationCode" v-if="order.verificationCode"> <view class="verificationCode" v-if="order.verificationCode">
券码 {{ order.verificationCode }} 券码 {{ order.verificationCode }}
</view> </view>
<view v-else class="logi-List-title"> <!-- <view v-else class="logi-List-title">
{{ "暂无物流信息" }} {{ "暂无物流信息" }}
</view> -->
</view> </view>
</view> </view>
</view> <view
<view class="info-view" style="justify-content: center"> class="info-view"
style="justify-content: center"
v-if="orderDetail.ste == '0'"
>
<img :src="code" alt="" /> <img :src="code" alt="" />
</view> </view>
<!-- 地址 --> <!-- 地址 -->
@ -412,7 +439,15 @@ export default {
orderSn: this.order.sn, orderSn: this.order.sn,
num: this.order.goodsNum, num: this.order.goodsNum,
}; };
if (this.orderDetail.ste == 0) {
if (
(this.orderDetail.ste == 0 &&
this.orderDetail.orderStatusValue == "已付款") ||
(this.orderDetail.ste == 0 &&
this.orderDetail.orderStatusValue == "待发货") ||
(this.orderDetail.ste == 0 &&
this.orderDetail.orderStatusValue == "待收货")
) {
createWithVerificatio(params).then((res) => { createWithVerificatio(params).then((res) => {
if (res.data.success) { if (res.data.success) {
this.code = res.data.result; this.code = res.data.result;

View File

@ -15,6 +15,10 @@
.layout{ .layout{
width: 100%; width: 100%;
height: 100%; height: 100%;
img{
width: 100%;
height: 100%;
}
} }
</style> </style>

View File

@ -192,11 +192,11 @@ export default {
Promise.all([ Promise.all([
getCouponsNum(), // getCouponsNum(), //
getFootprintNum(), // getFootprintNum(), //
getUserWallet(), // // getUserWallet(), //
]).then((res) => { ]).then((res) => {
this.couponNum = res[0].data.result; this.couponNum = res[0].data.result;
this.footNum = res[1].data.result; this.footNum = res[1].data.result;
this.walletNum = res[2].data.result.memberWallet; // this.walletNum = res[2].data.result.memberWallet;
}); });
}, },
}, },

View File

@ -198,6 +198,7 @@ export function orderStatusList(val) {
COMPLETED: "已完成", COMPLETED: "已完成",
COMPLETE: "已完成", COMPLETE: "已完成",
TAKE: "待核验", TAKE: "待核验",
REFUNDED: "已退款",
}; };
return orderStatusList[val]; return orderStatusList[val];
} }

View File

@ -30,7 +30,7 @@ function cleanStorage() {
storage.setHasLogin(false); storage.setHasLogin(false);
storage.setAccessToken(""); storage.setAccessToken("");
storage.setRefreshToken(""); storage.setRefreshToken("");
storage.setUuid("wzj666"); storage.setUuid("");
storage.setUserInfo({}); storage.setUserInfo({});
// 清理vlog信息 // 清理vlog信息
storage.setVlogToken(""); storage.setVlogToken("");
@ -66,7 +66,6 @@ let http = new Request();
http.setConfig((config) => { http.setConfig((config) => {
// 没有uuid创建 // 没有uuid创建
if (!storage.getUuid()) { if (!storage.getUuid()) {
// storage.setUuid(uuid.v1());
storage.setUuid("wzj666"); storage.setUuid("wzj666");
} }
@ -114,8 +113,7 @@ http.interceptors.request.use(
} }
config.header = { config.header = {
...config.header, ...config.header,
// uuid: storage.getUuid() || uuid.v1(), uuid: "wzj666",
uuid: 'wzj666',
}; };
return config; return config;
}, },
@ -131,7 +129,6 @@ let requests = [];
// 必须使用异步函数,注意 // 必须使用异步函数,注意
http.interceptors.response.use( http.interceptors.response.use(
async (response) => { async (response) => {
// console.log(isRefreshing)
console.log(response) console.log(response)
/* 请求之后拦截器。可以使用async await 做异步操作 */ /* 请求之后拦截器。可以使用async await 做异步操作 */
// token存在并且token过期 // token存在并且token过期
@ -149,12 +146,17 @@ http.interceptors.response.use(
// } // }
let token = storage.getAccessToken(); let token = storage.getAccessToken();
if(response.statusCode === 408){
cleanStorage();
}
if ( if (
(token && response.statusCode === 403) || (token && response.statusCode === 403) ||
(token && response.data.status === 403) (token && response.data.status === 403)
) { ) {
console.log('去刷tk1')
if (!isRefreshing) { if (!isRefreshing) {
isRefreshing = true; isRefreshing = true;
console.log('去刷tk2')
//调用刷新token的接口 //调用刷新token的接口
return refreshTokenFn(storage.getRefreshToken()) return refreshTokenFn(storage.getRefreshToken())
.then((res) => { .then((res) => {
@ -207,7 +209,8 @@ http.interceptors.response.use(
) { ) {
if (response.data.message) { if (response.data.message) {
uni.showToast({ uni.showToast({
title: response.data.message, // title: response.data.message,
title: "请重试",
icon: "none", icon: "none",
duration: 1500, duration: 1500,
}); });