|
|
@@ -4,16 +4,16 @@
|
|
|
<view>
|
|
|
<scroll-view :scroll-y="true" @scroll="handleContentScroll">
|
|
|
<!-- 导航栏 :leftIconColor="!isTop ? '#fff' : '#000'"-->
|
|
|
- <u-navbar :placeholder="true" autoBack @click="autoBackFun">
|
|
|
+ <!-- <u-navbar :placeholder="true" autoBack @click="autoBackFun">
|
|
|
<view slot="center">
|
|
|
<view class="centerTitle" style="background-color: #fff;">
|
|
|
{{ receivedStatus == '1' || receivedStatus == '2' ? '申请退款' : '申请换货' }}</view>
|
|
|
</view>
|
|
|
- </u-navbar>
|
|
|
+ </u-navbar> -->
|
|
|
|
|
|
<view class="content">
|
|
|
- <view v-if="tab == '1'">
|
|
|
- <view class="contentDetail">
|
|
|
+ <view>
|
|
|
+ <view class="contentDetail" v-if="orderStatus && tab==1">
|
|
|
<view class="tip">请选择取消订单的原因(必选):</view>
|
|
|
<u-radio-group v-model="selectReason" @change="groupChange">
|
|
|
<view>
|
|
|
@@ -29,7 +29,7 @@
|
|
|
</view>
|
|
|
</u-radio-group>
|
|
|
</view>
|
|
|
- <view class="tip2" v-if="receivedStatus == '1'">
|
|
|
+ <view class="tip2" v-if="orderStatus == 1">
|
|
|
<view class="title">温馨提示:</view>
|
|
|
<view class="textClass">
|
|
|
1.订单一旦取消,无法恢复<br>
|
|
|
@@ -38,7 +38,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if="tab == '2'">
|
|
|
+ <view v-if="orderStatus == 3 && tab==2">
|
|
|
<view class="Box">
|
|
|
<view class="questionOrDiscribe">
|
|
|
<view>问题与描述:</view>
|
|
|
@@ -72,7 +72,7 @@
|
|
|
<u-button :customStyle="{
|
|
|
color: '#fff',
|
|
|
background: '#03C1B8'
|
|
|
- }" @click="goSubmit">{{ receivedStatus == 3 ? '确认' : '提交' }}</u-button>
|
|
|
+ }" @click="goSubmit">{{ orderStatus == 3 ? '确认' : '提交' }}</u-button>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
@@ -82,21 +82,21 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { afterSaleOrder } from '@/api/pointOrder'
|
|
|
+import { afterSaleOrder, productOrderCancel } from '@/api/pointOrder'
|
|
|
import Upload from '@/components/upload/index.vue';
|
|
|
export default {
|
|
|
components: { Upload },
|
|
|
data() {
|
|
|
return {
|
|
|
+ tab: '1',//1 申请换货-申请原因选择 2申请换货-描述、凭证
|
|
|
orderNo: null,
|
|
|
orderId: null,
|
|
|
+ orderStatus: null,
|
|
|
fileList: [],
|
|
|
- tab: null,//1 退款/换货申请第一步 2 已收货-换货申请第二步
|
|
|
headPhotoImg: [],
|
|
|
questionOrDiscribeValue: '',
|
|
|
selectReason: '',
|
|
|
selectReasonValue: null,
|
|
|
- receivedStatus: null,//1 未收到,申请退款;2.已收到货,申请退款 3.已收货-换货申请
|
|
|
isTop: 0,
|
|
|
list: [],
|
|
|
servicePromise: [
|
|
|
@@ -158,18 +158,30 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
filteredList() {
|
|
|
- if (this.receivedStatus === '1') return this.list1;
|
|
|
- if (this.receivedStatus === '2') return this.list2;
|
|
|
+ if (this.orderStatus == 1) return this.list1;
|
|
|
+ if (this.orderStatus == 2) return this.list2;
|
|
|
return this.list3;
|
|
|
}
|
|
|
},
|
|
|
onLoad(data) {
|
|
|
+ //订单状态(0:待付款 1:待发货 2:待收货 3:已收货 4:售后中 11:取消订单)
|
|
|
console.log(data, 'onLoad-applyRefund')
|
|
|
if (data) {
|
|
|
- this.receivedStatus = data.receivedStatus
|
|
|
- this.tab = data.tab ? data.tab : null
|
|
|
+ if (data.tab) this.tab = data.tab
|
|
|
if (data.orderId) this.orderId = data.orderId
|
|
|
if (data.orderNo) this.orderNo = data.orderNo
|
|
|
+ if (data.orderStatus) this.orderStatus = data.orderStatus
|
|
|
+ if (this.orderStatus == 1 || this.orderStatus == 2) {
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: '申请退款'
|
|
|
+ });
|
|
|
+ } else if (this.orderStatus == 3) {
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: '申请换货'
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ if (data.servicePromise) this.servicePromise = data.servicePromise
|
|
|
if (data.questionOrDiscribeValue && data.questionOrDiscribeValue !== "null") {
|
|
|
this.questionOrDiscribeValue = data.questionOrDiscribeValue
|
|
|
}
|
|
|
@@ -194,6 +206,7 @@ export default {
|
|
|
|
|
|
},
|
|
|
onShow(data) {
|
|
|
+ console.log(this.orderStatus,this.filteredList)
|
|
|
let flag = this.servicePromise.some(f => {
|
|
|
return f.indexOf('7天无理由退') !== -1
|
|
|
})
|
|
|
@@ -250,22 +263,48 @@ export default {
|
|
|
//提交
|
|
|
goSubmit() {
|
|
|
console.log('提交 applyRefund')
|
|
|
- //receivedStatus 1 未收到,申请退款;2.已收到货,申请退款 3.已收货-换货申请
|
|
|
- //tab 1 退款 2 换货
|
|
|
- afterSaleOrder({ // 未收到-申请退款,已收到货-申请退款
|
|
|
- orderId: this.orderId,
|
|
|
- orderNo: this.orderNo,
|
|
|
- applyReason: this.selectReasonValue,
|
|
|
- afterSaleType: this.receivedStatus == 1 ? 3 : this.receivedStatus == 2 ? 1 : null,//1:退货 2:换 3:未收到货
|
|
|
- //applyDesc:'',
|
|
|
- //applyImages:'',
|
|
|
- }).then(res => {
|
|
|
+ if (this.orderStatus == 0 || this.orderStatus == 1) { //待支付、待发货 走订单取消接口
|
|
|
+ let params = {
|
|
|
+ openId: uni.getStorageSync('wx_copenid'),
|
|
|
+ orderNo: this.orderNo,
|
|
|
+ cancelReason: this.selectReasonValue,
|
|
|
+ }
|
|
|
+ productOrderCancel(params).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ clearInterval(this.timer);
|
|
|
+ this.cancelOrderShowPopup = false
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/points/productDetails/pendingPayment?orderNo=${this.orderNo}`
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ //alert(res.data.msg)
|
|
|
+ uni.showToast({
|
|
|
+ title: res.data.msg,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
- })
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ //订单状态(2:待收货 3:已收货 4:售后中)
|
|
|
+ if (this.orderStatus == 2) {
|
|
|
+ afterSaleOrder({ // 未收到-申请退款,已收到货-申请退款
|
|
|
+ orderId: this.orderId,
|
|
|
+ orderNo: this.orderNo,
|
|
|
+ applyReason: this.selectReasonValue,
|
|
|
+ afterSaleType: this.orderStatus == 2 ? 3 : null, // afterSaleType 1:退货 2:换 3:未收到货
|
|
|
+ //applyDesc:'',
|
|
|
+ //applyImages:'',
|
|
|
+ }).then(res => {
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
- if (this.receivedStatus == 3) {
|
|
|
+ if (this.orderStatus == 3) { //换货
|
|
|
uni.navigateTo({
|
|
|
- url: `/points/productDetails/applyExchange?selectReasonValue=${encodeURIComponent(this.selectReasonValue)}&questionOrDiscribeValue=${encodeURIComponent(this.questionOrDiscribeValue)}&fileList=${JSON.stringify(this.fileList)}&orderNo=${this.orderNo}&orderId=${this.orderId}`
|
|
|
+ url: `/points/productDetails/applyExchange?selectReasonValue=${encodeURIComponent(this.selectReasonValue)}&questionOrDiscribeValue=${encodeURIComponent(this.questionOrDiscribeValue)}&fileList=${JSON.stringify(this.fileList)}&orderNo=${this.orderNo}&orderId=${this.orderId}&orderStatus=${this.orderStatus}`
|
|
|
});
|
|
|
|
|
|
}
|