parent
e629285b51
commit
7d512ef9a6
|
@ -9,3 +9,7 @@ export function getAfterSaleReasonList(way) {
|
||||||
way
|
way
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function createAfterSale(data) {
|
||||||
|
return request.post("app-api/trade/after-sale/create", data);
|
||||||
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class='item textarea acea-row row-between'>
|
<view class='item textarea acea-row row-between'>
|
||||||
<view>备注说明</view>
|
<view>备注说明</view>
|
||||||
<textarea placeholder='填写备注信息,100字以内' class='num' name="refund_reason_wap_explain"
|
<textarea placeholder='填写备注信息,100字以内' class='num' name="applyDescription"
|
||||||
placeholder-class='填写备注信息,100字以内' />
|
placeholder-class='填写备注信息,100字以内' />
|
||||||
</view>
|
</view>
|
||||||
<view class='item acea-row row-between' style="border: none;">
|
<view class='item acea-row row-between' style="border: none;">
|
||||||
|
@ -57,12 +57,12 @@
|
||||||
<view class='tip'>( 最多可上传3张 )</view>
|
<view class='tip'>( 最多可上传3张 )</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='upload acea-row row-middle'>
|
<view class='upload acea-row row-middle'>
|
||||||
<view class='pictrue' v-for="(item,index) in refund_reason_wap_imgPath" :key="index">
|
<view class='pictrue' v-for="(item,index) in applyPicUrls" :key="index">
|
||||||
<image :src='item' />
|
<image :src='item' />
|
||||||
<view class='iconfont icon-guanbi1 font-color' @tap='DelPic(index)' />
|
<view class='iconfont icon-guanbi1 font-color' @tap='DelPic(index)' />
|
||||||
</view>
|
</view>
|
||||||
<view class='pictrue acea-row row-center-wrapper row-column' @tap='uploadpic'
|
<view class='pictrue acea-row row-center-wrapper row-column' @tap='uploadpic'
|
||||||
v-if="refund_reason_wap_imgPath.length < 3">
|
v-if="applyPicUrls.length < 3">
|
||||||
<text class='iconfont icon-icon25201' />
|
<text class='iconfont icon-icon25201' />
|
||||||
<view>上传凭证</view>
|
<view>上传凭证</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -75,11 +75,11 @@
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { orderRefundVerify } from '@/api/order.js';
|
|
||||||
import { toLogin } from '@/libs/login.js';
|
import { toLogin } from '@/libs/login.js';
|
||||||
import { mapGetters } from "vuex";
|
import { mapGetters } from "vuex";
|
||||||
import * as TradeOrderApi from '@/api/trade/order.js';
|
import * as TradeOrderApi from '@/api/trade/order.js';
|
||||||
import * as AfterSaleApi from '@/api/trade/afterSale.js';
|
import * as AfterSaleApi from '@/api/trade/afterSale.js';
|
||||||
|
import {createAfterSale} from "../../../api/trade/afterSale";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -94,16 +94,14 @@
|
||||||
reasons: [], // 售后原因
|
reasons: [], // 售后原因
|
||||||
reasonIndex: 0, // 选中 reasons 的位置
|
reasonIndex: 0, // 选中 reasons 的位置
|
||||||
|
|
||||||
refund_reason_wap_img:[],
|
applyPicUrls: [], // 补充凭证图片
|
||||||
refund_reason_wap_imgPath:[],
|
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: mapGetters(['isLogin']),
|
computed: mapGetters(['isLogin']),
|
||||||
watch:{
|
watch:{
|
||||||
isLogin:{
|
isLogin:{
|
||||||
handler: function(newV, oldV) {
|
handler: function(newV, oldV) {
|
||||||
if(newV){
|
if (newV) {
|
||||||
this.getOrderInfo();
|
this.getOrderInfo();
|
||||||
this.getRefundReason();
|
this.getRefundReason();
|
||||||
}
|
}
|
||||||
|
@ -172,43 +170,54 @@
|
||||||
this.reasons = res.data;
|
this.reasons = res.data;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 选择售后原因
|
||||||
|
*/
|
||||||
|
bindPickerChange: function(e) {
|
||||||
|
this.$set(this, 'reasonIndex', e.detail.value);
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 删除图片
|
* 删除图片
|
||||||
*/
|
*/
|
||||||
DelPic:function(e) {
|
DelPic:function(index) {
|
||||||
let index = e, that = this;
|
this.applyPicUrls.splice(index, 1);
|
||||||
that.refund_reason_wap_imgPath.splice(index, 1);
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 上传文件
|
* 上传文件
|
||||||
*/
|
*/
|
||||||
uploadpic:function(){
|
uploadpic:function(){
|
||||||
let that=this;
|
this.$util.uploadImageOne({}, res => {
|
||||||
that.$util.uploadImageOne({url:'user/upload/image',name:'multipart', model:"product", pid:1}, function(res){
|
this.applyPicUrls.push(res.data);
|
||||||
that.refund_reason_wap_imgPath.push(res.data.url);
|
this.$set(this, 'applyPicUrls', this.applyPicUrls);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请退货
|
* 申请退货
|
||||||
*/
|
*/
|
||||||
subRefund:function(e){
|
subRefund:function(e) {
|
||||||
let that = this, value = e.detail.value;
|
const formData = e.detail.value;
|
||||||
//收集form表单
|
AfterSaleApi.createAfterSale({
|
||||||
// if (!value.refund_reason_wap_explain) return this.$util.Tips({title:'请输入退款原因'});
|
orderItemId: this.orderItemId,
|
||||||
orderRefundVerify({
|
way: this.getWay(),
|
||||||
text: that.RefundArray[that.index] || '',
|
refundPrice: this.orderItem.payPrice,
|
||||||
refund_reason_wap_explain: value.refund_reason_wap_explain,
|
applyReason: this.reasons[this.reasonIndex],
|
||||||
refund_reason_wap_img: that.refund_reason_wap_imgPath.join(','),
|
applyDescription: formData.applyDescription,
|
||||||
uni: that.orderId
|
applyPicUrls: this.applyPicUrls,
|
||||||
}).then(res=>{
|
}).then(res => {
|
||||||
return this.$util.Tips({ title: '申请成功', icon: 'success' }, { tab: 5, url: '/pages/users/user_return_list/index?isT=1' });
|
// TODO 芋艿:这里要改成跳转到售后详情页
|
||||||
|
this.$util.Tips({
|
||||||
|
title: '申请成功',
|
||||||
|
icon: 'success'
|
||||||
|
}, {
|
||||||
|
tab: 5,
|
||||||
|
url: '/pages/users/user_return_list/index?isT=1'
|
||||||
|
});
|
||||||
}).catch(err=>{
|
}).catch(err=>{
|
||||||
return this.$util.Tips({ title: err });
|
return this.$util.Tips({
|
||||||
|
title: err
|
||||||
|
});
|
||||||
})
|
})
|
||||||
},
|
|
||||||
bindPickerChange: function (e) {
|
|
||||||
this.$set(this,'index',e.detail.value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue