This commit is contained in:
Gdpao
2020-08-06 20:46:40 +08:00
19 changed files with 374 additions and 90 deletions

View File

@@ -29,6 +29,7 @@
</view>
<view class="edit-tips">注意修改手机号需要原手机号获取验证码无原手机验证码请联系客服</view>
<view class="edit-btn" @click="updateMemberInfo">完成</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
@@ -155,8 +156,11 @@ export default {
birthday: this.birthday,
}).then(res => {
if (res.errCode == 0) {
this.getUserInfo();
// this.$u.toast(res.message);
// this.getUserInfo();
this.$refs.uToast.show({
title: res.message,
back: true,
})
}
})
},

View File

@@ -68,7 +68,7 @@
</view>
</view>
<view class="btn" v-if="['1', '2', '4', '6'].indexOf(orderstate) >= 0">
<view class="cancel" v-if="orderstate == '4' || orderstate == '1'" @click="toOtherPage('RefundOrder')">申请退款</view>
<view class="cancel" v-if="(orderstate == '4' || orderstate == '1') && orderInfo.is_refund == 1" @click="toOtherPage('RefundOrder')">申请退款</view>
<view class="cancel" v-if="orderstate == '1'" @click="toOtherPage('Logistics')">查看物流</view>
<view class="logistics" v-if="orderstate == '1'" @click="confirmReceive">确认收货</view>
<view class="comment" v-if="orderstate == '2'" @click="toOtherPage('Comment')">立即评价</view>

View File

@@ -134,7 +134,7 @@ export default {
if(load == 'reload') this.orderList = res.data;
else if(load == 'loadmore') this.orderList.push(...res.data);
}
return res;
return res.data.length;
},
// 售后
async getAfterSaleList({ load = 'loadmore' } = {}) {
@@ -146,7 +146,7 @@ export default {
if(load == 'reload') this.orderList = res.data;
else if(load == 'loadmore') this.orderList.push(...res.data);
}
return res;
return res.data.length;
},
// 试穿
async goodsTryOrderList({ load = 'loadmore' } = {}) {
@@ -159,7 +159,7 @@ export default {
if(load == 'reload') this.orderList = res.data.list;
else if(load == 'loadmore') this.orderList.push(...res.data.list);
}
return res;
return res.data.list.length;
},
reachBottom() {
// 大于15条才会加载更多
@@ -173,9 +173,9 @@ export default {
// else
if(this.current == 4) promise = this.goodsTryOrderList();
else promise = this.getOrderList();
promise.then(res => {
promise.then(length => {
this.loadStatus.splice(this.current, 1, "nomore");
if(res.data.length == 0) this.page--;
if(length == 0) this.page--;
}).catch(() => {
this.loadStatus.splice(this.current, 1, "nomore");
this.page--;

View File

@@ -31,22 +31,24 @@
<view class="refund-price">
<view class="price">
<view class="title">退款金额</view>
<view class="value">{{ (goods.goods_pay_price * num).toFixed(2) }}</view>
<view class="value">{{ totalPrice }}</view>
</view>
<view class="tips">若退款成功将退还给您 {{ (goods.goods_pay_price * num).toFixed(2) }}</view>
<view class="tips">若退款成功将退还给您 {{ totalPrice }}</view>
</view>
<view class="refund-text">
<view class="title">申请说明</view>
<u-input v-model="refundText" type="textarea" placeholder="必填,请详细说明退款理由" />
</view>
</view>
<view class="submit-btn">提交申请</view>
<view class="submit-btn" @click="applyRefund">提交申请</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
export default {
data() {
return {
oid: '',
goodsList: [],
goods: {
goods_num: 0,
@@ -57,7 +59,13 @@ export default {
num: 0,
}
},
computed: {
totalPrice() {
return (this.goods.goods_pay_price * this.num).toFixed(2);
}
},
onLoad(option) {
this.oid = option.oid;
this.getOrderInfo(option.oid);
},
methods: {
@@ -81,16 +89,41 @@ export default {
// uni.stopPullDownRefresh(); // 结束刷新
})
},
verifyParams() {
if(!this.goods.goods_id) {
this.$u.toast('请选择退款商品');
return false;
}
if(this.num == 0) {
this.$u.toast('请选择退款数量');
return false;
}
if(this.$u.test.isEmpty(this.refundText)) {
this.$u.toast('退款说明不可为空');
return false;
}
return true;
},
applyRefund() {
if(!this.verifyParams()) return false;
let params = {
order_id: this.order.order_id,
// goods_id: goods_id,
// refund_amount: refund_amount,
order_id: this.oid,
goods_id: this.goods.goods_id,
refund_amount: Number(this.totalPrice),
reason_info: this.refundText,
goods_num: this.num,
}
this.$u.api.refundOrder(params).then(res => {
this.$u.toast(res.message);
if(res.errCode == 0) {
this.$refs.uToast.show({
title: res.message,
back: true,
})
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error'
})
}
})
},

View File

@@ -158,7 +158,7 @@
<view class="order-popup">
<view class="check">
<text>选择订单</text>
<u-icon name="close" color="#A29FA3" size="32"></u-icon>
<u-icon name="close" color="#A29FA3" size="32" @click="showPopup=false"></u-icon>
</view>
<scroll-view scroll-y class="order-list">
<u-radio-group v-model="value" @change="radioChange">
@@ -271,7 +271,7 @@ export default {
})
},
confirmType(e) {
console.log(e);
// console.log(e);
this.type = e[0];
},
async getOrderList({ load = 'reload' } = {}) {
@@ -424,6 +424,12 @@ export default {
})
},
animationfinish(e) {
this.goodsStatus = '';
this.type = {};
this.name = '';
this.phone = '';
this.area = '';
this.address = '';
// 可重新提交订单
this.debounce = true;
let current = e.detail.current;
@@ -443,9 +449,6 @@ export default {
this.choose = false;
}
},
close(){
this.showPopup = false
},
showToast(message, type) {
this.$refs.uToast.show({
title: message,