会员权益
This commit is contained in:
223
pagesMall/refund/apply.vue
Normal file
223
pagesMall/refund/apply.vue
Normal file
@@ -0,0 +1,223 @@
|
||||
<!-- +----------------------------------------------------------------------
|
||||
| 麦沃德科技赋能开发者,助力商协会发展
|
||||
+----------------------------------------------------------------------
|
||||
| Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
+----------------------------------------------------------------------
|
||||
| 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
+----------------------------------------------------------------------
|
||||
| Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
+----------------------------------------------------------------------
|
||||
| 退款申请 开发者: 麦沃德科技-半夏
|
||||
+---------------------------------------------------------------------- -->
|
||||
|
||||
<template>
|
||||
<view class="container" :style="{ '--theme-color': themeColor }">
|
||||
<!-- 标题栏 -->
|
||||
<title-bar :showBack="true" title="申请退款"></title-bar>
|
||||
<!-- 内容区 -->
|
||||
<view class="container-main" v-if="loadEnd">
|
||||
<view class="main-column">
|
||||
<view class="column-title">退款原因</view>
|
||||
<view class="column-list">
|
||||
<view class="list-item flex align-items-center" v-for="(item, index) in reasonList" :key="index" @click="changeReason(index)">
|
||||
<view class="item-radio" :class="{active: selectReason == index}">
|
||||
<image src="/static/tick.png" mode="aspectFill" v-if="selectReason == index"></image>
|
||||
</view>
|
||||
<view class="item-label">{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="main-column">
|
||||
<view class="column-title">退款描述</view>
|
||||
<view class="column-content">
|
||||
<textarea class="input" placeholder="请填写您的退款描述,200字以内" v-model="formData.refund_content" placeholder-class="placeholder" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="main-footer">
|
||||
<view class="footer-btn" @click="handleSubmit()">提交退款申请</view>
|
||||
<view class="safe-padding"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from "vuex"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 是否加载完成
|
||||
loadEnd: false,
|
||||
// 原因列表
|
||||
reasonList: [{
|
||||
id: 1,
|
||||
name: '产品存在质量问题'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '产品实物与描述不符'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '卖家的发货环节出现问题'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: '卖家存在延迟发货问题'
|
||||
}
|
||||
],
|
||||
// 已选原因
|
||||
selectReason: null,
|
||||
// 表单内容
|
||||
formData: {
|
||||
order_id: "",
|
||||
refund_reason: "",
|
||||
refund_content: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
themeColor: state => state.app.themeColor
|
||||
})
|
||||
},
|
||||
onLoad(option) {
|
||||
this.formData.order_id = option.id
|
||||
this.$nextTick(() => {
|
||||
this.loadEnd = true
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 更换退款原因
|
||||
changeReason(index) {
|
||||
this.selectReason = index
|
||||
this.formData.refund_reason = this.reasonList[index].name
|
||||
},
|
||||
// 提交退款申请
|
||||
handleSubmit() {
|
||||
if (!this.formData.refund_reason && !this.formData.refund_content) {
|
||||
uni.showToast({
|
||||
title: "请选择退款原因或填写退款描述",
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
mask: true
|
||||
})
|
||||
this.$util.request("mall.orderRefund", this.formData).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res.code == 1) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesMall/refund/success"
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
}).catch(error => {
|
||||
uni.hideLoading()
|
||||
console.error('提交退款申请', error)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
.container-main {
|
||||
padding: 32rpx 32rpx 144rpx;
|
||||
|
||||
.main-column {
|
||||
padding: 24rpx 32rpx 48rpx;
|
||||
border-radius: 20rpx;
|
||||
background: #FFF;
|
||||
margin-top: 32rpx;
|
||||
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.column-title {
|
||||
color: #5A5B6E;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
line-height: 44rpx;
|
||||
}
|
||||
|
||||
.column-list {
|
||||
margin-top: 24rpx;
|
||||
|
||||
.list-item {
|
||||
padding: 24rpx 16rpx;
|
||||
|
||||
.item-radio {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
background: #D6DBDE;
|
||||
border-radius: 50%;
|
||||
|
||||
&.active {
|
||||
background: var(--theme-color);
|
||||
}
|
||||
}
|
||||
|
||||
.item-label {
|
||||
margin-left: 24rpx;
|
||||
color: #5A5B6E;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.column-content {
|
||||
margin-top: 32rpx;
|
||||
padding: 24rpx;
|
||||
border-radius: 10rpx;
|
||||
background: #F6F7FB;
|
||||
height: 260rpx;
|
||||
|
||||
.input {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: #5A5B6E;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 96;
|
||||
background: #FFF;
|
||||
border-top: 1rpx solid #F6F7FB;
|
||||
padding: 16rpx 24rpx;
|
||||
|
||||
.footer-btn {
|
||||
padding: 20rpx 44rpx;
|
||||
background: var(--theme-color);
|
||||
border-radius: 40rpx;
|
||||
color: #FFF;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
411
pagesMall/refund/details.vue
Normal file
411
pagesMall/refund/details.vue
Normal file
@@ -0,0 +1,411 @@
|
||||
<!-- +----------------------------------------------------------------------
|
||||
| 麦沃德科技赋能开发者,助力商协会发展
|
||||
+----------------------------------------------------------------------
|
||||
| Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
+----------------------------------------------------------------------
|
||||
| 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
+----------------------------------------------------------------------
|
||||
| Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
+----------------------------------------------------------------------
|
||||
| 退款详情 开发者: 麦沃德科技-半夏
|
||||
+---------------------------------------------------------------------- -->
|
||||
|
||||
<template>
|
||||
<view class="container" :style="{ '--theme-color': themeColor }">
|
||||
<!-- 标题栏 -->
|
||||
<title-bar :showBack="true" title="退款详情"></title-bar>
|
||||
<!-- 内容区 -->
|
||||
<view class="container-main" :style="{paddingBottom: (orderInfo.refund_status == 2 || orderInfo.refund_status == 3) ? '144rpx' : '32rpx'}" v-if="loadEnd">
|
||||
<!-- 订单状态 -->
|
||||
<view class="main-status">
|
||||
<block v-if="orderInfo.refund_status == 2">
|
||||
<view class="status-text">申请中</view>
|
||||
<view class="status-tips flex align-items-center">
|
||||
<view class="icon" :style="{'background-image': 'url('+ iconClock +')'}" v-if="iconClock"></view>
|
||||
<view class="text">等待平台退款申请通过</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="orderInfo.refund_status == 3">
|
||||
<view class="status-text">待退货</view>
|
||||
<view class="status-tips flex align-items-center">
|
||||
<view class="icon" :style="{'background-image': 'url('+ iconClock +')'}" v-if="iconClock"></view>
|
||||
<view class="text">请及时提交退货信息</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="orderInfo.refund_status == 4">
|
||||
<view class="status-text">退款中</view>
|
||||
<view class="status-tips flex align-items-center">
|
||||
<view class="icon" :style="{'background-image': 'url('+ iconClock +')'}" v-if="iconClock"></view>
|
||||
<view class="text">等待平台退款</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="orderInfo.refund_status == 5">
|
||||
<view class="status-text">已退款</view>
|
||||
<view class="status-tips flex align-items-center">
|
||||
<view class="icon" :style="{'background-image': 'url('+ iconClock +')'}" v-if="iconClock"></view>
|
||||
<view class="text">平台已完成退款</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 退款原因 -->
|
||||
<view class="main-reason">{{orderInfo.refund_reason}}</view>
|
||||
<!-- 到店自提 -->
|
||||
<view class="main-address" v-if="orderInfo.delivery_method == 2">
|
||||
<view class="address-title">自提地址</view>
|
||||
<view class="address-box flex align-items-center" @click="toNavigation()">
|
||||
<view class="box-text flex-item">{{mallConfig.address}}</view>
|
||||
<view class="box-icon" :style="{'background-image': 'url('+ iconMore +')'}" v-if="iconMore"></view>
|
||||
</view>
|
||||
<view class="address-info flex flex-wrap" v-if="mallConfig.mobile" @click="onContact()">{{mallConfig.mobile}}</view>
|
||||
</view>
|
||||
<!-- 收货地址 -->
|
||||
<view class="main-address" v-else>
|
||||
<view class="address-name">{{orderInfo.user_address || ""}}</view>
|
||||
<view class="address-info flex flex-wrap" v-if="orderInfo.real_name || orderInfo.user_phone">
|
||||
<text v-if="orderInfo.real_name">{{orderInfo.real_name}}</text>
|
||||
<text v-if="orderInfo.user_phone">{{orderInfo.user_phone}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 商品信息 -->
|
||||
<view class="main-goods">
|
||||
<block v-for="(item, index) in orderInfo.goods" :key="index">
|
||||
<mall-store :show-data="item"></mall-store>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 订单信息 -->
|
||||
<view class="main-order">
|
||||
<view class="order-info">
|
||||
<view class="title">商品总额</view>
|
||||
<view class="value">¥{{orderInfo.goods_price || ''}}</view>
|
||||
</view>
|
||||
<view class="order-info" v-if="orderInfo.delivery_method == 1">
|
||||
<view class="title">运费总额</view>
|
||||
<view class="value">¥{{orderInfo.pay_postage || '0.00'}}</view>
|
||||
</view>
|
||||
<view class="order-info">
|
||||
<view class="title">总计金额</view>
|
||||
<view class="value">¥{{orderInfo.total_price || '0.00'}}</view>
|
||||
</view>
|
||||
<view class="order-info" v-if="orderInfo.delivery_method == 2">
|
||||
<view class="title">发货方式</view>
|
||||
<view class="value" style="color: #5A5B6E;">到店自提</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部按钮 -->
|
||||
<view class="main-footer" v-if="orderInfo.refund_status == 2 || orderInfo.refund_status == 3">
|
||||
<view class="footer-btn" style="background: #FF626E;" @click="handleCancel()" v-if="orderInfo.refund_status == 2">取消退款</view>
|
||||
<view class="footer-btn" :style="{background: themeColor}" @click="handleWrite()" v-if="orderInfo.refund_status == 3">填写信息</view>
|
||||
<view class="safe-padding"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from "vuex"
|
||||
import mallStore from "@/pagesMall/component/mall/store.vue"
|
||||
import svgData from "@/common/svg.js"
|
||||
export default {
|
||||
components: {
|
||||
mallStore
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 是否加载完成
|
||||
loadEnd: false,
|
||||
// 订单id
|
||||
orderId: '',
|
||||
// 订单详情
|
||||
orderInfo: {},
|
||||
// 商城配置
|
||||
mallConfig: {},
|
||||
// 延时器
|
||||
delayer: null,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
themeColor: state => state.app.themeColor,
|
||||
iconClock: state => {
|
||||
return svgData.svgToUrl("clock", state.app.themeColor)
|
||||
},
|
||||
iconMore: state => {
|
||||
return svgData.svgToUrl("more", state.app.themeColor)
|
||||
},
|
||||
})
|
||||
},
|
||||
onLoad(option) {
|
||||
uni.showLoading({
|
||||
title: "加载中"
|
||||
})
|
||||
this.orderId = option.id;
|
||||
this.getMallConfig()
|
||||
this.getOrderDetails(() => {
|
||||
uni.hideLoading()
|
||||
this.loadEnd = true
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
if (this.loadEnd) this.getOrderDetails()
|
||||
},
|
||||
onUnload() {
|
||||
clearTimeout(this.delayer)
|
||||
},
|
||||
methods: {
|
||||
// 获取订单详情
|
||||
getOrderDetails(fn) {
|
||||
this.$util.request("mall.orderDetails", {
|
||||
id: this.orderId
|
||||
}).then(res => {
|
||||
if (fn) fn()
|
||||
if (res.code == 1) {
|
||||
this.orderInfo = res.data
|
||||
this.orderInfo.goods_price = parseFloat(parseFloat(this.orderInfo.total_price) - parseFloat(this.orderInfo.pay_postage || 0)).toFixed(2)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('获取订单详情', error)
|
||||
})
|
||||
},
|
||||
// 获取商城配置
|
||||
getMallConfig() {
|
||||
this.$util.request("mall.config").then(res => {
|
||||
if (res.code == 1) {
|
||||
this.mallConfig = res.data
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('获取商城配置', error)
|
||||
})
|
||||
},
|
||||
// 取消退款
|
||||
handleCancel() {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "确定取消退款申请? \n 点击取消退款后取消申请",
|
||||
confirmText: '取消退款',
|
||||
confirmColor: this.themeColor,
|
||||
cancelText: '我再想想',
|
||||
cancelColor: '#999999',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
mask: true
|
||||
})
|
||||
this.$util.request("mall.cancelRefund", {
|
||||
id: this.orderId
|
||||
}).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: "取消成功",
|
||||
icon: "success",
|
||||
mask: true,
|
||||
duration: 1500
|
||||
})
|
||||
this.delayer = setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}).catch(error => {
|
||||
uni.hideLoading()
|
||||
console.error('取消退款', error)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 填写信息
|
||||
handleWrite() {
|
||||
this.$util.toPage({
|
||||
mode: 1,
|
||||
path: "/pagesMall/refund/goods?id=" + this.orderId
|
||||
})
|
||||
},
|
||||
// 跳转地图导航
|
||||
toNavigation() {
|
||||
this.$util.toPage({
|
||||
mode: 7,
|
||||
address: {
|
||||
latitude: this.mallConfig.latitude,
|
||||
longitude: this.mallConfig.longitude,
|
||||
address: this.mallConfig.address,
|
||||
},
|
||||
})
|
||||
},
|
||||
// 联系
|
||||
onContact() {
|
||||
this.$util.toPage({
|
||||
mode: 6,
|
||||
phone: this.mallConfig.mobile,
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
.container-main {
|
||||
padding: 32rpx 32rpx 144rpx;
|
||||
|
||||
.main-status {
|
||||
padding: 16rpx 16rpx 48rpx;
|
||||
|
||||
.status-text {
|
||||
color: #5A5B6E;
|
||||
font-size: 48rpx;
|
||||
line-height: 68rpx;
|
||||
}
|
||||
|
||||
.status-tips {
|
||||
margin-top: 16rpx;
|
||||
|
||||
.icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
background-size: 32rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
margin-left: 16rpx;
|
||||
color: var(--theme-color);
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main-reason {
|
||||
margin-bottom: 32rpx;
|
||||
border-radius: 20rpx;
|
||||
padding: 24rpx 32rpx;
|
||||
background: #FFF;
|
||||
color: #FF626E;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.main-address {
|
||||
border-radius: 20rpx;
|
||||
padding: 32rpx;
|
||||
background: #FFF;
|
||||
|
||||
.address-title {
|
||||
color: #5A5B6E;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
line-height: 40rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.address-name {
|
||||
color: #5A5B6E;
|
||||
font-size: 32rpx;
|
||||
line-height: 44rpx;
|
||||
}
|
||||
|
||||
.address-box {
|
||||
.box-text {
|
||||
color: #5A5B6E;
|
||||
font-size: 32rpx;
|
||||
line-height: 44rpx;
|
||||
margin-right: 64rpx;
|
||||
}
|
||||
|
||||
.box-icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
background-size: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.address-info {
|
||||
margin-top: 24rpx;
|
||||
color: #979797;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
gap: 16rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.main-goods {
|
||||
margin-top: 32rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
row-gap: 32rpx;
|
||||
}
|
||||
|
||||
.main-order {
|
||||
margin-top: 32rpx;
|
||||
padding: 32rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #FFFFFF;
|
||||
|
||||
.order-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 32rpx;
|
||||
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.title {
|
||||
color: #979797;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: var(--theme-color);
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
margin-left: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 96;
|
||||
background: #FFF;
|
||||
border-top: 1rpx solid #F6F7FB;
|
||||
padding: 16rpx 24rpx;
|
||||
|
||||
.footer-btn {
|
||||
margin-left: 24rpx;
|
||||
padding: 20rpx 44rpx;
|
||||
background: var(--theme-color);
|
||||
border-radius: 16rpx;
|
||||
color: #FFF;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
202
pagesMall/refund/goods.vue
Normal file
202
pagesMall/refund/goods.vue
Normal file
@@ -0,0 +1,202 @@
|
||||
<!-- +----------------------------------------------------------------------
|
||||
| 麦沃德科技赋能开发者,助力商协会发展
|
||||
+----------------------------------------------------------------------
|
||||
| Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
+----------------------------------------------------------------------
|
||||
| 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
+----------------------------------------------------------------------
|
||||
| Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
+----------------------------------------------------------------------
|
||||
| 退货信息填写 开发者: 麦沃德科技-半夏
|
||||
+---------------------------------------------------------------------- -->
|
||||
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 标题栏 -->
|
||||
<title-bar :showBack="true" title="填写信息"></title-bar>
|
||||
<!-- 内容区 -->
|
||||
<view class="container-main" v-if="loadEnd">
|
||||
<!-- 商品信息 -->
|
||||
<view class="main-goods">
|
||||
<block v-for="(item, index) in orderInfo.goods" :key="index">
|
||||
<mall-store :show-data="item"></mall-store>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 填写快递单号 -->
|
||||
<view class="main-form">
|
||||
<view class="form-title">填写快递单号</view>
|
||||
<input class="form-input" type="text" v-model="trackingNumber" placeholder="填写快递单号" placeholder-class="placeholder" />
|
||||
</view>
|
||||
<!-- 底部按钮 -->
|
||||
<view class="main-footer">
|
||||
<view class="footer-btn" :style="{background: themeColor}" @click="handleSubmit()">提交信息</view>
|
||||
<view class="safe-padding"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from "vuex"
|
||||
import mallStore from "@/pagesMall/component/mall/store.vue"
|
||||
export default {
|
||||
components: {
|
||||
mallStore,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 是否加载完成
|
||||
loadEnd: false,
|
||||
// 订单id
|
||||
orderId: '',
|
||||
// 订单详情
|
||||
orderInfo: {},
|
||||
// 快递单号
|
||||
trackingNumber: '',
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
themeColor: state => state.app.themeColor,
|
||||
})
|
||||
},
|
||||
onLoad(option) {
|
||||
uni.showLoading({
|
||||
title: "加载中"
|
||||
})
|
||||
this.orderId = option.id;
|
||||
this.getOrderDetails(() => {
|
||||
uni.hideLoading()
|
||||
this.loadEnd = true
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
if (this.loadEnd) this.getOrderDetails()
|
||||
},
|
||||
methods: {
|
||||
// 获取订单详情
|
||||
getOrderDetails(fn) {
|
||||
this.$util.request("mall.orderDetails", {
|
||||
id: this.orderId
|
||||
}).then(res => {
|
||||
if (fn) fn()
|
||||
if (res.code == 1) {
|
||||
this.orderInfo = res.data
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('获取订单详情', error)
|
||||
})
|
||||
},
|
||||
// 提交快递信息
|
||||
handleSubmit() {
|
||||
if (!this.trackingNumber) {
|
||||
uni.showToast({
|
||||
title: "请填写快递单号",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
mask: true,
|
||||
})
|
||||
this.$util.request("mall.receipt", {
|
||||
order_id: this.orderInfo.id,
|
||||
refund_express_no: this.trackingNumber
|
||||
}).then(res => {
|
||||
if (res.code == 1) {
|
||||
uni.redirectTo({
|
||||
url: "/pagesMall/refund/success",
|
||||
success: () => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}).catch(error => {
|
||||
uni.hideLoading()
|
||||
console.error('提交快递信息', error)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
.container-main {
|
||||
padding: 32rpx 32rpx 144rpx;
|
||||
|
||||
.main-goods {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
row-gap: 32rpx;
|
||||
}
|
||||
|
||||
.main-form {
|
||||
margin-top: 32rpx;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx 32rpx 48rpx;
|
||||
background: #FFF;
|
||||
|
||||
.form-title {
|
||||
color: #5A5B6E;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
line-height: 44rpx;
|
||||
}
|
||||
|
||||
.form-input {
|
||||
margin-top: 24rpx;
|
||||
color: #5A5B6E;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 32rpx;
|
||||
background: #F6F7FB;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.main-footer {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 96;
|
||||
background: #FFF;
|
||||
border-top: 1rpx solid #F6F7FB;
|
||||
padding: 16rpx 24rpx;
|
||||
|
||||
.footer-btn {
|
||||
margin-left: 24rpx;
|
||||
padding: 20rpx 44rpx;
|
||||
background: var(--theme-color);
|
||||
border-radius: 16rpx;
|
||||
color: #FFF;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
196
pagesMall/refund/index.vue
Normal file
196
pagesMall/refund/index.vue
Normal file
@@ -0,0 +1,196 @@
|
||||
<!-- +----------------------------------------------------------------------
|
||||
| 麦沃德科技赋能开发者,助力商协会发展
|
||||
+----------------------------------------------------------------------
|
||||
| Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
+----------------------------------------------------------------------
|
||||
| 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
+----------------------------------------------------------------------
|
||||
| Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
+----------------------------------------------------------------------
|
||||
| 退款列表 开发者: 麦沃德科技-半夏
|
||||
+---------------------------------------------------------------------- -->
|
||||
|
||||
<template>
|
||||
<view class="container" :style="{'--theme-color': themeColor}">
|
||||
<!-- 标题栏 -->
|
||||
<title-bar title="退款列表"></title-bar>
|
||||
<!-- 内容区 -->
|
||||
<view class="container-main" v-if="loadEnd">
|
||||
<!-- 顶部导航 -->
|
||||
<scroll-view scroll-x class="main-screen" :style="{top: titleBarHeight + 'px'}">
|
||||
<view class="screen-item" :class="{active: selectScreen == index}" @click="changeScreen(index)" v-for="(item, index) in screenList" :key="index">{{item.text}}</view>
|
||||
</scroll-view>
|
||||
<!-- 订单列表 -->
|
||||
<view class="main-list">
|
||||
<mall-refund :show-data="orderList" @getOrderList="resetOrderList"></mall-refund>
|
||||
<empty top="36%" title="暂无相关订单~" v-if="orderList.length == 0"></empty>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部导航 -->
|
||||
<tab-bar></tab-bar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from "vuex"
|
||||
import mallRefund from "@/pagesMall/component/mall/refund.vue"
|
||||
export default {
|
||||
components: {
|
||||
mallRefund,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 是否加载完成
|
||||
loadEnd: false,
|
||||
// 标题栏高度
|
||||
titleBarHeight: 0,
|
||||
// 分类列表
|
||||
screenList: [{
|
||||
text: "全部",
|
||||
},
|
||||
{
|
||||
text: "申请中",
|
||||
state: 2
|
||||
},
|
||||
{
|
||||
text: "待退货",
|
||||
state: 3
|
||||
},
|
||||
{
|
||||
text: "退款中",
|
||||
state: 4
|
||||
},
|
||||
{
|
||||
text: "已退款",
|
||||
state: 5
|
||||
}
|
||||
],
|
||||
// 已选分类
|
||||
selectScreen: 0,
|
||||
// 订单列表
|
||||
orderList: [],
|
||||
// 分类查询参数
|
||||
page: 1,
|
||||
limit: 20,
|
||||
hasMore: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
themeColor: state => state.app.themeColor,
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
// #ifdef MP-WEIXIN
|
||||
let statusBarHeight = uni.getSystemInfoSync().statusBarHeight
|
||||
let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
|
||||
this.titleBarHeight = statusBarHeight + (menuButtonInfo.top - statusBarHeight) * 2 + menuButtonInfo.height
|
||||
// #endif
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.id) {
|
||||
this.selectScreen = this.screenList.findIndex(item => {
|
||||
if (item.state == option.id) return true
|
||||
})
|
||||
}
|
||||
uni.showLoading({
|
||||
title: "加载中"
|
||||
})
|
||||
this.getOrderList(() => {
|
||||
uni.hideLoading()
|
||||
this.loadEnd = true
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
if (this.loadEnd) {
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 0
|
||||
});
|
||||
this.page = 1
|
||||
this.getOrderList()
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.page = 1
|
||||
this.getOrderList(() => {
|
||||
uni.stopPullDownRefresh();
|
||||
})
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.hasMore) {
|
||||
this.page++
|
||||
this.getOrderList()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 更改分类
|
||||
changeScreen(index) {
|
||||
this.selectScreen = index
|
||||
this.page = 1
|
||||
this.getOrderList()
|
||||
},
|
||||
// 获取退款订单列表
|
||||
getOrderList(fn) {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
}
|
||||
if (this.screenList[this.selectScreen].state) data.refund_status = this.screenList[this.selectScreen].state
|
||||
this.$util.request("mall.refundList", data).then(res => {
|
||||
if (fn) fn()
|
||||
if (res.code == 1) {
|
||||
let list = res.data.data
|
||||
this.hasMore = this.page < res.data.total / this.limit ? true : false
|
||||
this.orderList = this.page == 1 ? list : [...this.orderList, ...list];
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}).catch(error => {
|
||||
if (fn) fn()
|
||||
console.error('获取退款订单列表', error)
|
||||
})
|
||||
},
|
||||
// 重新获取订单列表
|
||||
resetOrderList() {
|
||||
this.page = 1
|
||||
this.getOrderList()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
.container-main {
|
||||
.main-screen {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 99;
|
||||
background: #FFF;
|
||||
white-space: nowrap;
|
||||
|
||||
.screen-item {
|
||||
display: inline-block;
|
||||
min-width: 20%;
|
||||
padding: 40rpx 12rpx;
|
||||
color: #8D929C;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
|
||||
&.active {
|
||||
color: var(--theme-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main-list {
|
||||
padding: 32rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
126
pagesMall/refund/success.vue
Normal file
126
pagesMall/refund/success.vue
Normal file
@@ -0,0 +1,126 @@
|
||||
<!-- +----------------------------------------------------------------------
|
||||
| 麦沃德科技赋能开发者,助力商协会发展
|
||||
+----------------------------------------------------------------------
|
||||
| Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
+----------------------------------------------------------------------
|
||||
| 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
+----------------------------------------------------------------------
|
||||
| Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
+----------------------------------------------------------------------
|
||||
| 支付成功 开发者: 麦沃德科技-半夏
|
||||
+---------------------------------------------------------------------- -->
|
||||
|
||||
<template>
|
||||
<view class="container" :style="{'--theme-color': themeColor}">
|
||||
<!-- 标题栏 -->
|
||||
<title-bar :showBack="true" title="提交成功"></title-bar>
|
||||
<!-- 内容区 -->
|
||||
<view class="container-main" v-if="loadEnd">
|
||||
<view class="main-image">
|
||||
<image class="icon" src="/static/check.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="main-title">提交成功</view>
|
||||
<view class="main-subtitle">请前往退款列表查看退款进度</view>
|
||||
<view class="main-btn" @click="toOrder()">前往查看</view>
|
||||
<view class="main-back" @click="toIndex()">返回首页</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from "vuex"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 加载完成
|
||||
loadEnd: false,
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
this.loadEnd = true
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
themeColor: state => state.app.themeColor
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 前往退款列表
|
||||
toOrder() {
|
||||
let prevPage = getCurrentPages()[getCurrentPages().length - 2];
|
||||
if (prevPage && (prevPage.route.indexOf('pagesMall/refund/index') > -1 || prevPage.route.indexOf('pagesMall/refund/details') > -1)) {
|
||||
uni.navigateBack()
|
||||
} else {
|
||||
this.$util.toPage({
|
||||
mode: 2,
|
||||
path: "/pagesMall/refund/index"
|
||||
})
|
||||
}
|
||||
},
|
||||
// 返回首页
|
||||
toIndex() {
|
||||
uni.switchTab({
|
||||
url: "/pages/index/index"
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
.container {
|
||||
.container-main {
|
||||
padding: 144rpx 32rpx 32rpx;
|
||||
|
||||
.main-image {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
margin: 0 auto;
|
||||
padding: 48rpx;
|
||||
background: var(--theme-color);
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.main-title {
|
||||
color: #333;
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
line-height: 50rpx;
|
||||
margin-top: 48rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.main-subtitle {
|
||||
color: #979797;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
margin-top: 16rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.main-btn {
|
||||
margin-top: 64rpx;
|
||||
color: #FFF;
|
||||
font-size: 32rpx;
|
||||
line-height: 44rpx;
|
||||
padding: 22rpx 32rpx;
|
||||
border-radius: 16rpx;
|
||||
text-align: center;
|
||||
background: var(--theme-color);
|
||||
}
|
||||
|
||||
.main-back {
|
||||
margin-top: 16rpx;
|
||||
color: #979797;
|
||||
font-size: 32rpx;
|
||||
line-height: 44rpx;
|
||||
padding: 32rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user