Refactor:分包

This commit is contained in:
lifizer
2026-05-12 15:19:37 +08:00
parent 6caf9afcc0
commit 535a98e43a
62 changed files with 250 additions and 20914 deletions
+151
View File
@@ -0,0 +1,151 @@
<template>
<view class="apply-return">
<view class="goodsStyle acea-row row-between" v-for="cart in orderInfo.cartInfo" :key="cart.id">
<view class="pictrue">
<image v-if="orderInfo.isGiftCardReceiveBlind === 0" :src="cart.productInfo.image" class="image" />
<image v-else class="image" :src="webUrl+'/orderIcon/盲盒礼包.png'"></image>
</view>
<view class="text acea-row row-between" >
<view class="name line2">{{ orderInfo.isGiftCardReceiveBlind === 0 ? cart.productInfo.storeName : '盲盒礼包' }}</view>
<view class="money" v-if="orderInfo.isGiftCardReceiveBlind === 0">
<view>
{{
cart.productInfo.attrInfo
? cart.productInfo.attrInfo.price
: cart.productInfo.price
}}
</view>
<view class="num">x{{ cart.cartNum }}</view>
</view>
</view>
</view>
<view class="list">
<view class="item acea-row row-between-wrapper">
<view>退货件数</view>
<view class="num">{{ orderInfo.totalNum }}</view>
</view>
<view class="item acea-row row-between-wrapper" v-if="orderInfo.isGiftCardReceiveBlind === 0">
<view>退款金额</view>
<view class="num">{{ orderInfo.payPrice }}</view>
</view>
<picker :value="reason" :range="reasonList" @change="changeReason">
<view class="item acea-row row-between-wrapper">
<view>退款原因</view>
<view class="num">{{reason}}</view>
<text class="iconfont icon-jiantou"></text>
</view>
</picker>
<view class="item textarea acea-row row-between">
<view>备注说明</view>
<textarea placeholder="填写备注信息,100字以内" class="num inp" v-model="refundReasonWapExplain"></textarea>
</view>
</view>
<view class="returnBnt bg-color-red" @click="submit">申请退款</view>
</view>
</template>
<script>
import {
orderDetail,
getRefundReason,
postOrderRefund
} from "@/api/order";
import {
trim
} from "@/utils";
import {
VUE_APP_API_URL
} from "@/config";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default {
name: "goodsReturn",
components: {
// VueCoreImageUpload
},
mixins: [pageListenMixins],
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
url: `${VUE_APP_API_URL}/upload/image`,
headers: {
Authorization: "Bearer " + this.$store.state.token
},
id: 0,
orderInfo: {},
reasonList: [],
reason: "",
refundReasonWapExplain: "",
pageKeyId: Object.freeze('userOrderRefundApply')
};
},
methods: {
changeReason(e) {
this.reason = this.reasonList[e.mp.detail.value];
},
getOrderDetail() {
orderDetail(this.id)
.then(res => {
this.orderInfo = res.data;
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none',
duration: 2000
});
});
},
getRefundReason() {
getRefundReason().then(res => {
this.reasonList = res.data;
});
},
submit() {
const refundReasonWapExplain = trim(this.refundReasonWapExplain),
text = this.reason;
if (!text) {
uni.showToast({
title: "请选择退款原因",
icon: 'none',
duration: 2000
});
return
}
postOrderRefund({
text,
uni: this.orderInfo.orderId,
refundReasonWapExplain
})
.then(res => {
uni.showToast({
title: res.msg,
icon: "success",
duration: 2000
});
setTimeout(() => {
this.$yrouter.back();
}, 1500);
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none',
duration: 2000
});
});
}
},
mounted() {
this.id = this.$yroute.query.id || 0;
this.getOrderDetail();
this.getRefundReason();
}
};
</script>
<style scoped>
.apply-return .list .item .inp {
padding: 4rpx 20rpx;
text-align: left;
}
</style>
+403
View File
@@ -0,0 +1,403 @@
<template>
<view class="logistics">
<view class="header acea-row row-between row-top" v-for="cart in cartInfo" :key="cart.id">
<view class="pictrue">
<image :src="cart.productInfo.image" />
</view>
<view class="text acea-row row-between">
<view class="name line2">{{ cart.productInfo.store_name }}</view>
<view class="money">
<view>{{ cart.truePrice }}</view>
<view>x{{ cart.cart_num }}</view>
</view>
</view>
</view>
<view class="logisticsCon" style="margin-bottom: 5px">
<view class="company acea-row row-between-wrapper">
<view class="picTxt acea-row row-between-wrapper">
<view class="iconfont icon-wuliu"></view>
<view class="text">
<view>
<text class="name line1">物流公司</text>
{{ orderInfo.deliveryName }}
</view>
<view class="express line1">
<text class="name">快递单号</text>
{{ orderInfo.deliveryId }}
</view>
</view>
</view>
<view
class="copy acea-row row-center-wrapper copy-data"
@click="copyClipboard(orderInfo.deliveryId)"
>复制单号</view>
</view>
<view class="item" v-for="(express, expressListIndex) in expressList" :key="expressListIndex">
<view class="circular" :class="expressListIndex === 0 ? 'on' : ''"></view>
<view class="text">
<view :class="expressListIndex === 0 ? 'font-color-red' : ''">{{ express.status }}</view>
<view class="data">{{ express.time }}</view>
</view>
</view>
</view>
<!-- 物流进度条 -->
<view class="div-bg bg-white" style="font-size:12px; background:#fff;">
<!--物流跟踪-->
<view style="margin-bottom:5px;">
<view
class="bg-white"
style="width: 92%; margin-left: 4%;margin: auto;padding-left: 15px;padding-right: 15px;padding-top: 10px"
>
<view style="font-size: 26rpx;color: #111111; margin: 5px 0">
物流跟踪
<!--物流跟踪-->
</view>
<view>
<view class="track-rcol">
<view class="track-list">
<view>
<view
class="track-list-item"
v-for="(item,logisticsListindex) in logisticsList"
:key="logisticsListindex"
>
<view class="active" v-if="logisticsListindex===0">
<view></view>
<i class="node-icon"></i>
<text class="txt">{{item.acceptStation}}</text>
<text class="time">{{item.acceptTime}}</text>
</view>
<view
v-if="logisticsListindex > 0 && logisticsListindex !== logisticsList.length-1"
>
<i class="node-icon"></i>
<text class="txt">{{item.acceptStation}}</text>
<text class="time">{{item.acceptTime}}</text>
</view>
<view v-if="logisticsListindex === logisticsList.length-1" class="finall">
<i class="div-spilander"></i>
<i class="node-icon"></i>
<text class="txt">{{item.acceptStation}}</text>
<text class="time">{{item.acceptTime}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="no-express" v-if="loaded && !expressList.length">
<image :src="webUrl+'/20210203153343122397.png'" />
</view>
<Recommend></Recommend>
</view>
</template>
<script>
import Recommend from "@/components/Recommend";
import { express, orderDetail } from "@/api/order";
import { copyClipboard } from "@/utils";
const NAME = "Logistics";
export default {
name: NAME,
components: {
Recommend
},
data: function() {
return {
webUrl:this.$VUE_APP_RESOURCES_URL,
id: "",
index: null,
cartInfo: [],
orderInfo: {},
expressList: [],
loaded: false,
logisticsList: [
{
message: "暂无数据",
messageDate: ""
}
]
};
},
onLoad(opts) {
this.index = opts.index || 0;
},
watch: {
$yroute(n) {
if (n.name === NAME && this.$yroute.query.id !== this.id) {
this.id = this.$yroute.query.id;
this.getExpress();
}
}
},
mounted: function() {
this.id = this.$yroute.query.id;
this.getExpress();
},
methods: {
copyClipboard,
getExpressInfo() {
let params = {
orderCode: this.id,
shipperCode: this.orderInfo.deliverySn,
logisticCode: this.orderInfo.deliveryId
};
express(params)
.then(res => {
this.logisticsList = res.data.Traces.reverse();
})
.catch(err => {
uni.showToast({
title:
err.msg ,
icon: "none",
duration: 2000
});
});
},
getExpress() {
console.log(this.id, "this.id");
if (!this.id) {
uni.showToast({
title: '订单信息错误',
icon: "none",
duration: 2000
});
return;
}
this.loaded = false;
orderDetail(this.id)
.then(res => {
console.log(this.index, "this.orderInfo");
const { data } = res;
const current = data.deliveryInfo[+this.index ];
console.log(current, "current");
this.orderInfo = current;
this.getExpressInfo();
// const result = res.data.express.result || {};
// this.cartInfo = res.data.order.cartInfo;
// this.expressList = result.list || [];
// this.loaded = true;
})
.catch(err => {
uni.showToast({
title: err.msg ,
icon: "none",
duration: 2000
});
});
}
}
};
</script>
<style scoped lang="less">
.no-express {
margin: 1.5 * 100rpx 0;
}
.no-express image {
width: 6 * 100rpx;
margin: 0 auto;
display: block;
}
.message-text {
font-family: MicrosoftYaHei;
font-size: 1 * 100rpx;
font-weight: normal;
font-stretch: normal;
line-height: 3 * 100rpx;
letter-spacing: 0 * 100rpx;
color: #333333;
width: 50%;
}
.fontblack {
color: #999999;
}
.img2 {
width: 0.81 * 100rpx;
height: 0.8 * 100rpx;
float: right;
}
.addressshow2 {
height: auto;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
width: 75%;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
white-space: normal;
word-wrap: break-word;
word-break: break-all;
font-size: 1 * 100rpx;
}
.addressshow1 {
height: auto;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
width: 75%;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
white-space: normal;
word-wrap: break-word;
word-break: break-all;
font-size: 1 * 100rpx;
}
.orderTitle {
font-size: 1 * 100rpx;
color: #333333;
height: auto;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
white-space: normal;
word-wrap: break-word;
word-break: break-all;
height: 2.5 * 100rpx;
}
.orderDetail {
font-size: 0.26 * 100rpx;
color: #666666;
text-align: left;
}
.border-ceter {
width: 92%;
padding-left: 15px;
padding-right: 15px;
}
.pay-button {
width: 88%;
height: 2.6 * 100rpx;
position: relative;
background-color: red;
color: white;
margin-left: 6%;
}
ul view {
list-style: none;
font-size: 0.24 * 100rpx;
}
ul {
}
.track-rcol {
}
.track-list {
position: relative;
}
.track-list > view {
position: relative;
padding: 0 0 0.5 * 100rpx 20rpx;
}
.track-list .track-list-item {
position: relative;
padding: 0 0 0.5 * 100rpx 20rpx;
line-height: 0.3 * 100rpx;
border-left: 1px solid #d9d9d9;
color: #999;
}
.track-list view.first {
color: red;
padding-top: 0;
width: 100%;
text-align: left;
border-left: 1px solid #d9d9d9;
}
.track-list view.node-icon {
position: absolute;
left: -6.5px;
border-radius: 50%;
width: 0.2 * 100rpx;
height: 0.2 * 100rpx;
top: 4px;
background-color: #b2b2b2;
padding: 0 !important;
}
.track-list view.active .node-icon {
background-position: 0 -72px;
background-color: #ea7c0a;
width: 0.3 * 100rpx;
z-index: 2;
height: 0.3 * 100rpx;
position: absolute;
left: -0.19 * 100rpx;
top: 0;
border-radius: 50%;
}
.track-list view.time {
margin-right: 20px;
position: relative;
top: 4px;
display: inline-block;
vertical-align: middle;
color: #999;
width: 100%;
text-align: left;
}
.track-list view.txt {
position: relative;
display: inline-block;
vertical-align: top;
color: #999;
left: 0.2 * 100rpx;
top: 0.04 * 100rpx;
}
.track-list view.first .time {
text-align: left;
width: 94%;
color: red;
}
.track-list view.first .txt {
color: red;
text-align: left;
width: 94%;
}
.track-list view.finall {
padding: 0px 0 0.5 * 100rpx 5px;
line-height: 18px;
border-color: white;
border-left: 1px solid #ffffff;
color: #999;
}
.track-list view.finall .div-spilander {
width: 1px;
position: absolute;
left: -1.5px;
height: 0.5 * 100rpx;
background-color: #d9d9d9;
}
</style>
File diff suppressed because it is too large Load Diff
+106
View File
@@ -0,0 +1,106 @@
<template>
<view class="return-list" ref="container">
<view class="goodWrapper" v-for="(order,orderListIndex) in orderList" :key="orderListIndex">
<view class="iconfont icon-tuikuanzhong powder" v-if="parseInt(order._status._type) === -1"></view>
<view class="iconfont icon-yituikuan" v-if="parseInt(order._status._type) === -2"></view>
<image class="iconfont" :src="webUrl+'/20230713110051999762.png'" v-if="parseInt(order._status._type) === -3"/>
<view class="orderNum">订单号{{ order.orderId }}</view>
<view
class="item acea-row row-between-wrapper"
v-for="(cart,cartInfoIndex) in order.cartInfo"
:key="cartInfoIndex"
@click="goOrderDetails(order)"
>
<view class="pictrue">
<image :src="cart.productInfo.image" class="image" @click.stop="goGoodsCon(cart)"/>
</view>
<view class="text">
<view class="acea-row row-between-wrapper">
<view class="name line1">{{ cart.productInfo.storeName }}</view>
<view class="num">x {{ cart.cartNum }}</view>
</view>
<view
class="attr line1"
v-if="cart.productInfo.attrInfo"
>{{ cart.productInfo.attrInfo.sku }}
</view>
<view class="attr line1" v-else>{{ cart.productInfo.storeName }}</view>
<view class="money">{{ cart.productInfo.price }}</view>
</view>
</view>
<view class="totalSum">
{{ order.cartInfo.length || 0 }}件商品总金额
<text
class="font-color-red price"
>{{ order.payPrice }}
</text>
</view>
</view>
<view class="noCart" v-if="orderList.length === 0 && page > 1">
<view class="pictrue">
<image :src="webUrl+'/20210203155245713983.png'"/>
</view>
</view>
<Loading :loaded="loaded" :loading="loading"></Loading>
</view>
</template>
<script>
import {getOrderList} from "@/api/order";
import Loading from "@/components/Loading";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default {
name: "ReturnList",
components: {
Loading
},
mixins: [pageListenMixins],
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
orderList: [],
page: 1,
limit: 20,
loading: false,
loaded: false,
pageKeyId: Object.freeze('userOrderRefundList')
};
},
methods: {
goGoodsCon(cart) {
this.$yrouter.push({
path: "/pages/shop/GoodsCon/index",
query: {id: cart.productInfo.id}
});
},
goOrderDetails(order) {
this.$yrouter.push({
path: "/pagesOrder/order/OrderDetails/index",
query: {id: order.orderId}
});
},
getOrderList() {
const {page, limit} = this;
if (this.loading || this.loaded) return;
this.loading = true;
getOrderList({
page,
limit,
type: -3
}).then(res => {
this.orderList = this.orderList.concat(res.data);
this.loading = false;
this.loaded = res.data.length < limit;
this.page++;
});
}
},
mounted() {
this.getOrderList();
},
onReachBottom() {
!this.loading && this.getOrderList();
}
};
</script>