|
@@ -6,30 +6,58 @@
|
|
<text>售后商品</text>
|
|
<text>售后商品</text>
|
|
</view>
|
|
</view>
|
|
<view class="one_2">
|
|
<view class="one_2">
|
|
- <view class="list" v-for="(item,index) in info.goods" :key="index">
|
|
|
|
- <view class="list_1">
|
|
|
|
- <image class="image"
|
|
|
|
- :src="item.goods.file&&item.goods.file.length>0?item.goods.file[0].url:''" mode="">
|
|
|
|
- </image>
|
|
|
|
|
|
+ <view v-for="(item,index) in info.goods" :key="index">
|
|
|
|
+ <view class="set_name" v-if="item.is_set=='0'">
|
|
|
|
+ <text class="set">套装</text> {{item.name}}
|
|
</view>
|
|
</view>
|
|
- <view class="list_2">
|
|
|
|
- <view class="name">
|
|
|
|
- {{item.goods_name}}
|
|
|
|
|
|
+ <view class="list" v-if="item.is_set=='0'" v-for="(tag,indexx) in item.goods" :key="indexx">
|
|
|
|
+ <view class="list_1">
|
|
|
|
+ <image class="image"
|
|
|
|
+ :src="tag.goods.file&&tag.goods.file.length>0?tag.goods.file[0].url:''" mode="">
|
|
|
|
+ </image>
|
|
</view>
|
|
</view>
|
|
- <view class="other_1">
|
|
|
|
- <text>规格:</text>
|
|
|
|
- <text>{{item.name}}</text>
|
|
|
|
|
|
+ <view class="list_2">
|
|
|
|
+ <view class="name">
|
|
|
|
+ {{tag.goods_name}}
|
|
|
|
+ </view>
|
|
|
|
+ <view class="other_1">
|
|
|
|
+ <text>规格:</text>
|
|
|
|
+ <text>{{tag.spec_name}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="other_1">
|
|
|
|
+ <text>数量:</text>
|
|
|
|
+ <text>×{{tag.set_num}}</text>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- <view class="other_1">
|
|
|
|
- <text>金额:</text>
|
|
|
|
- <text
|
|
|
|
- class="money">¥{{info.type=='0'?item.price||item.sell_money:item.group_config.money}}</text>
|
|
|
|
|
|
+ </view>
|
|
|
|
+ <view class="set" v-if="item.is_set=='0'">
|
|
|
|
+ <view class="set_1">套装价:¥{{item.sell_money}}</view>
|
|
|
|
+ <view class="set_2">数量:×{{item.buy_num}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="list" v-else>
|
|
|
|
+ <view class="list_1">
|
|
|
|
+ <image class="image"
|
|
|
|
+ :src="item.goods.file&&item.goods.file.length>0?item.goods.file[0].url:''" mode="">
|
|
|
|
+ </image>
|
|
</view>
|
|
</view>
|
|
- <view class="other_1">
|
|
|
|
- <text>数量:</text>
|
|
|
|
- <text>×{{item.buy_num}}</text>
|
|
|
|
|
|
+ <view class="list_2">
|
|
|
|
+ <view class="name">
|
|
|
|
+ {{item.goods_name}}
|
|
|
|
+ </view>
|
|
|
|
+ <view class="other_1">
|
|
|
|
+ <text>规格:</text>
|
|
|
|
+ <text>{{item.name}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="other_1">
|
|
|
|
+ <text>金额:</text>
|
|
|
|
+ <text
|
|
|
|
+ class="money">¥{{info.type=='0'?item.price||item.sell_money:item.group_config.money}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="other_1">
|
|
|
|
+ <text>数量:</text>
|
|
|
|
+ <text>×{{item.buy_num}}</text>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -37,12 +65,26 @@
|
|
<view class="two">
|
|
<view class="two">
|
|
<view class="two_1" v-if="status=='3'||status=='-3'">
|
|
<view class="two_1" v-if="status=='3'||status=='-3'">
|
|
<uni-forms ref="thrform" :rules="thrrules" :model="thrform" label-width="auto">
|
|
<uni-forms ref="thrform" :rules="thrrules" :model="thrform" label-width="auto">
|
|
- <uni-forms-item label="售后商品" name="goods" v-if="status!='-3'">
|
|
|
|
- <picker class="picker" mode="selector" :range="info.goods" @change="goodsChange"
|
|
|
|
|
|
+ <uni-forms-item label="售后商品" name="goods"
|
|
|
|
+ v-if="status!='-3'&&goodsList.length>0&&!thrform.set_id">
|
|
|
|
+ <picker class="picker" mode="selector" :range="goodsList" @change="goodsChange"
|
|
range-key="goods_name">
|
|
range-key="goods_name">
|
|
<view>{{thrform.goods_name||'请选择退款商品'}}</view>
|
|
<view>{{thrform.goods_name||'请选择退款商品'}}</view>
|
|
</picker>
|
|
</picker>
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
|
|
+ <uni-forms-item label="售后套装" name="set_id"
|
|
|
|
+ v-if="status!='-3'&&!thrform.goods_name&&setList.length>0">
|
|
|
|
+ <picker class="picker" mode="selector" :range="setList" @change="setChange"
|
|
|
|
+ range-key="name">
|
|
|
|
+ <view>{{thrform.set_name||'请选择退款套装'}}</view>
|
|
|
|
+ </picker>
|
|
|
|
+ </uni-forms-item>
|
|
|
|
+ <uni-forms-item label="售后套装商品" name="goods" v-if="status!='-3'&&thrform.set_name">
|
|
|
|
+ <picker class="picker" mode="selector" :range="setgoodsList" @change="setgoodsChange"
|
|
|
|
+ range-key="goods_name">
|
|
|
|
+ <view>{{thrform.goods_name||'请选择退款套装商品'}}</view>
|
|
|
|
+ </picker>
|
|
|
|
+ </uni-forms-item>
|
|
<uni-forms-item label="售后类型" name="type">
|
|
<uni-forms-item label="售后类型" name="type">
|
|
<picker class="picker" mode="selector" :range="typeList" @change="typeChange"
|
|
<picker class="picker" mode="selector" :range="typeList" @change="typeChange"
|
|
range-key="label">
|
|
range-key="label">
|
|
@@ -53,7 +95,7 @@
|
|
<uni-easyinput type="digit" v-model="thrform.money" @input="toMoney"
|
|
<uni-easyinput type="digit" v-model="thrform.money" @input="toMoney"
|
|
placeholder="请输入退款金额" />
|
|
placeholder="请输入退款金额" />
|
|
<view class="money">
|
|
<view class="money">
|
|
- 最大退款金额不能超过 <text>{{moneyInfo.payTotal||0}}</text>,<text @tap="toAll">全部提现</text>
|
|
|
|
|
|
+ 最大退款金额不能超过 <text>{{moneyInfo.payTotal||0}}</text>,<text @tap="toAll">全部退款</text>
|
|
</view>
|
|
</view>
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
<uni-forms-item label="申请理由" name="reason">
|
|
<uni-forms-item label="申请理由" name="reason">
|
|
@@ -143,6 +185,12 @@
|
|
typeList: [],
|
|
typeList: [],
|
|
// 申请理由
|
|
// 申请理由
|
|
reasonList: [],
|
|
reasonList: [],
|
|
|
|
+ // 正常商品
|
|
|
|
+ goodsList: [],
|
|
|
|
+ // 套装
|
|
|
|
+ setList: [],
|
|
|
|
+ // 套装商品
|
|
|
|
+ setgoodsList: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
onLoad: async function(e) {
|
|
onLoad: async function(e) {
|
|
@@ -181,6 +229,10 @@
|
|
if (res.errcode == '0') {
|
|
if (res.errcode == '0') {
|
|
for (let val of res.data.goods) val.goods_name = val.goods.name;
|
|
for (let val of res.data.goods) val.goods_name = val.goods.name;
|
|
that.$set(that, `info`, res.data)
|
|
that.$set(that, `info`, res.data)
|
|
|
|
+ let goodsList = res.data.goods.filter(i => i.is_set != '0')
|
|
|
|
+ that.$set(that, `goodsList`, goodsList)
|
|
|
|
+ let setList = res.data.goods.filter(i => i.is_set == '0')
|
|
|
|
+ that.$set(that, `setList`, setList)
|
|
} else {
|
|
} else {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: res.errmsg,
|
|
title: res.errmsg,
|
|
@@ -204,11 +256,29 @@
|
|
// 已收到货
|
|
// 已收到货
|
|
goodsChange(e) {
|
|
goodsChange(e) {
|
|
const that = this;
|
|
const that = this;
|
|
- let data = that.info.goods[e.detail.value];
|
|
|
|
|
|
+ let data = that.goodsList[e.detail.value];
|
|
if (data) that.$set(that.info, `goods`, [data])
|
|
if (data) that.$set(that.info, `goods`, [data])
|
|
that.$set(that.thrform, `goods`, data._id);
|
|
that.$set(that.thrform, `goods`, data._id);
|
|
that.$set(that.thrform, `goods_name`, data.goods_name);
|
|
that.$set(that.thrform, `goods_name`, data.goods_name);
|
|
},
|
|
},
|
|
|
|
+ // 套装
|
|
|
|
+ setChange(e) {
|
|
|
|
+ const that = this;
|
|
|
|
+ let data = that.setList[e.detail.value];
|
|
|
|
+ if (data) {
|
|
|
|
+ that.$set(that, `setgoodsList`, data.goods)
|
|
|
|
+ that.$set(that.info, `goods`, [data])
|
|
|
|
+ }
|
|
|
|
+ that.$set(that.thrform, `set_id`, data._id);
|
|
|
|
+ that.$set(that.thrform, `set_name`, data.name);
|
|
|
|
+ },
|
|
|
|
+ // 套装商品
|
|
|
|
+ setgoodsChange(e) {
|
|
|
|
+ const that = this;
|
|
|
|
+ let data = that.setgoodsList[e.detail.value];
|
|
|
|
+ that.$set(that.thrform, `goods`, data.spec._id);
|
|
|
|
+ that.$set(that.thrform, `goods_name`, data.goods_name);
|
|
|
|
+ },
|
|
// 选择售后类型
|
|
// 选择售后类型
|
|
async typeChange(e) {
|
|
async typeChange(e) {
|
|
const that = this;
|
|
const that = this;
|
|
@@ -221,10 +291,12 @@
|
|
if (that.status != '-3') {
|
|
if (that.status != '-3') {
|
|
if (data.value != '3') {
|
|
if (data.value != '3') {
|
|
if (thrform.goods) {
|
|
if (thrform.goods) {
|
|
- const arr = await that.$api(`/afterSale/cgfr`, 'POST', {
|
|
|
|
|
|
+ let obj = {
|
|
order_detail: that.id,
|
|
order_detail: that.id,
|
|
- goods_id: thrform.goods
|
|
|
|
- });
|
|
|
|
|
|
+ }
|
|
|
|
+ if (thrform.set_id) obj.goods_id = thrform.set_id;
|
|
|
|
+ else obj.goods_id = thrform.goods;
|
|
|
|
+ const arr = await that.$api(`/afterSale/cgfr`, 'POST', obj);
|
|
if (arr.errcode == '0') {
|
|
if (arr.errcode == '0') {
|
|
that.$set(that, `moneyInfo`, arr.data);
|
|
that.$set(that, `moneyInfo`, arr.data);
|
|
} else {
|
|
} else {
|
|
@@ -287,6 +359,7 @@
|
|
let status = that.status;
|
|
let status = that.status;
|
|
that.$refs[ref].validate().then(async params => {
|
|
that.$refs[ref].validate().then(async params => {
|
|
// 判断是否团长提现完成 如果提现成功不能退款 过了规定日期
|
|
// 判断是否团长提现完成 如果提现成功不能退款 过了规定日期
|
|
|
|
+ if (that.thrform.set_id) params.set_id = that.thrform.set_id;
|
|
let arr;
|
|
let arr;
|
|
if (that.status != '-3') arr = await that.$api(`/afterSale/canRefund/${that.id}`,
|
|
if (that.status != '-3') arr = await that.$api(`/afterSale/canRefund/${that.id}`,
|
|
'GET');
|
|
'GET');
|
|
@@ -298,6 +371,7 @@
|
|
that.Receip(params)
|
|
that.Receip(params)
|
|
} else {
|
|
} else {
|
|
that.orderCancel(params)
|
|
that.orderCancel(params)
|
|
|
|
+ console.log(params);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -483,6 +557,38 @@
|
|
.list:last-child {
|
|
.list:last-child {
|
|
margin: 0;
|
|
margin: 0;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .set_name {
|
|
|
|
+ display: flex;
|
|
|
|
+ padding: 2vw 0;
|
|
|
|
+
|
|
|
|
+ .set {
|
|
|
|
+ margin: 0 1vw 0 0;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ border-radius: 5px;
|
|
|
|
+ padding: 0 1vw;
|
|
|
|
+ color: #ffffff;
|
|
|
|
+ background-color: #FF6347;
|
|
|
|
+ border: 1px solid #FFA500;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .set {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ margin: 0 0 2vw 0;
|
|
|
|
+ padding: 2vw 0;
|
|
|
|
+
|
|
|
|
+ .set_1 {
|
|
|
|
+ font-size: var(--font16Size);
|
|
|
|
+ color: var(--f85Color);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ text {
|
|
|
|
+ padding: 0 1vw 0 0;
|
|
|
|
+ font-size: var(--font20Szie);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|