order
This commit is contained in:
@@ -17,30 +17,63 @@
|
||||
<view class="rate">
|
||||
<view>
|
||||
<view class="title">物流评分</view>
|
||||
<u-rate :count="5" current="1" active-color="#FF780F" inactive-color="#CCCCCC" gutter="20" size="32"></u-rate>
|
||||
<u-rate :count="5" active-color="#FF780F" inactive-color="#CCCCCC" v-model="logistics" gutter="20" size="32"></u-rate>
|
||||
</view>
|
||||
<view>
|
||||
<view class="title">服务态度</view>
|
||||
<u-rate :count="5" current="1" active-color="#FF780F" inactive-color="#CCCCCC" gutter="20" size="32"></u-rate>
|
||||
<u-rate :count="5" v-model="service" active-color="#FF780F" inactive-color="#CCCCCC" gutter="20" size="32"></u-rate>
|
||||
</view>
|
||||
<view>
|
||||
<view class="title">描述相符</view>
|
||||
<u-rate :count="5" current="1" active-color="#FF780F" inactive-color="#CCCCCC" gutter="20" size="32"></u-rate>
|
||||
<u-rate :count="5" v-model="describe" active-color="#FF780F" inactive-color="#CCCCCC" gutter="20" size="32"></u-rate>
|
||||
</view>
|
||||
</view>
|
||||
<view class="write-btn">发表意见</view>
|
||||
<view class="write-btn" @click="addOrderEvaluate">发表意见</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
count: 4,
|
||||
logistics: 1,
|
||||
service: 1,
|
||||
describe: 1
|
||||
orderId: '',
|
||||
count: 4, // 最大图片数量
|
||||
logistics: 5,
|
||||
service: 5,
|
||||
describe: 5,
|
||||
content: '',
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.orderId = option.oid;
|
||||
},
|
||||
methods: {
|
||||
verifyParams() {
|
||||
if(this.$u.test.isEmpty(this.content)) {
|
||||
this.$u.toast('内容不可为空');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
addOrderEvaluate() {
|
||||
if(!this.verifyParams()) return false;
|
||||
console.log(this.logistics);
|
||||
console.log(this.service);
|
||||
console.log(this.describe);
|
||||
this.$u.api.updateOrderEvaluate({
|
||||
id: this.orderId,
|
||||
content: this.content,
|
||||
scores_one: this.logistics,
|
||||
scores_two: this.service,
|
||||
scores_three: this.describe,
|
||||
file: '',
|
||||
}).then(res => {
|
||||
|
||||
})
|
||||
},
|
||||
bindTextAreaBlur(event) {
|
||||
this.content = event.detail.value;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<view class="details">
|
||||
<view class="status">
|
||||
<view class="details" v-if="orderInfo.extend_store">
|
||||
<view class="status" v-if="state">
|
||||
<view class="text">
|
||||
<view class="status-text">交易成功</view>
|
||||
<view class="time" v-if="current == 2">距离结束22:22:22</view>
|
||||
<view class="status-text">{{ s_object[state].text }}</view>
|
||||
<view class="time" v-if="state == '2'">距离结束22:22:22</view>
|
||||
</view>
|
||||
<image src="../static/mine/31.png" v-if="current"></image>
|
||||
<image :src="s_object[state].image"></image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="info-address">
|
||||
@@ -49,11 +49,11 @@
|
||||
</view>
|
||||
<view>
|
||||
<view class="title">订单总价</view>
|
||||
<view class="price">¥0.00</view>
|
||||
<view class="price">¥{{ orderInfo.order_amount }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="title">实付费(含运费)</view>
|
||||
<view class="price">¥0.00</view>
|
||||
<view class="price">¥{{ orderInfo.goods_amount }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="title">支付方式</view>
|
||||
@@ -62,15 +62,16 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-order">
|
||||
<view>订单编号:2222222222222222</view>
|
||||
<view>微信交易号:2222222222222222</view>
|
||||
<view>创建时间:2020-05-14</view>
|
||||
<view>订单编号:{{ orderInfo.order_sn }}</view>
|
||||
<view>支付单号:{{ orderInfo.pay_sn }}</view>
|
||||
<view>创建时间:{{ orderInfo.add_time | date}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn" v-if="[0, 2, 4].indexOf(current) < 0">
|
||||
<view class="logistics" v-if="current == 3" @click="toOtherPage('Logistics')">查看物流</view>
|
||||
<view class="comment" v-if="current == 5">立即评价</view>
|
||||
<view class="payment" v-if="current == 1">立即支付</view>
|
||||
<view class="btn" v-if="['1', '2', '6'].indexOf(state) >= 0">
|
||||
<view class="logistics" v-if="state == '1'" @click="toOtherPage('Logistics')">查看物流</view>
|
||||
<view class="comment" v-if="state == '2'" @click="toOtherPage('Comment')">立即评价</view>
|
||||
<view class="cancel" v-if="state == '6'">取消支付</view>
|
||||
<view class="payment" v-if="state == '6'">立即支付</view>
|
||||
<view class="service" v-if="current == 6">联系官方客服</view>
|
||||
<view class="submit" v-if="current == 6">提交官方审核</view>
|
||||
</view>
|
||||
@@ -80,6 +81,33 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
state: '', // 1: 待收货 2: 待评价 3: 交易成功 4: 已取消 5: 已退款 6: 待支付
|
||||
s_object: {
|
||||
'1': {
|
||||
text: '待收货',
|
||||
image: '../static/mine/32.png',
|
||||
},
|
||||
'2': {
|
||||
text: '待评价',
|
||||
image: '../static/mine/35.png',
|
||||
},
|
||||
'3': {
|
||||
text: '交易成功',
|
||||
image: '../static/mine/31.png',
|
||||
},
|
||||
'4': {
|
||||
text: '已取消',
|
||||
image: '../static/mine/33.png',
|
||||
},
|
||||
'5': {
|
||||
text: '已退款',
|
||||
image: '../static/mine/34.png',
|
||||
},
|
||||
'6': {
|
||||
text: '待支付',
|
||||
image: '../static/mine/31.png',
|
||||
},
|
||||
},
|
||||
current: 0,
|
||||
orderInfo: {}
|
||||
}
|
||||
@@ -89,12 +117,37 @@ export default {
|
||||
this.getOrderInfo(option.id);
|
||||
},
|
||||
methods: {
|
||||
viewState(value) {
|
||||
let state;
|
||||
switch (value) {
|
||||
case 0: // 已取消
|
||||
state = '4';
|
||||
break;
|
||||
case 10: // 未付款
|
||||
state = '6';
|
||||
break;
|
||||
case 20: // 已付款
|
||||
state = '3';
|
||||
break;
|
||||
case 30: // 已发货
|
||||
state = '1';
|
||||
break;
|
||||
case 40: // 已收货
|
||||
if(this.orderInfo.evaluation_state == 0) state = '2';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(this.orderInfo.refund_state) state = '5';
|
||||
this.state = state;
|
||||
},
|
||||
getOrderInfo(id) {
|
||||
this.$u.api.getOrderInfo({
|
||||
order_id: id,
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.orderInfo = res.data;
|
||||
this.viewState(this.orderInfo.order_state);
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -113,8 +166,8 @@ export default {
|
||||
});
|
||||
},
|
||||
toOtherPage(url) {
|
||||
uni.navigateTo({
|
||||
url: '/pageE/order/' + url
|
||||
this.$u.route('/pageE/order/' + url, {
|
||||
oid: this.orderInfo.order_id,
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -124,17 +177,15 @@ export default {
|
||||
.details {
|
||||
min-height: calc(100vh - var(--window-top));
|
||||
background-color: #ECECEC;
|
||||
padding-bottom: 98rpx;
|
||||
.status {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
height: calc(180rpx + var(--window-top));
|
||||
height: 180rpx;
|
||||
// height: calc(180rpx + var(--window-top));
|
||||
width: 100%;
|
||||
background: rgba(255,120,15,1);
|
||||
z-index: 9;
|
||||
background: #ff780f;
|
||||
.text {
|
||||
margin: calc(74rpx + var(--window-top)) auto 0 73rpx;
|
||||
margin: 74rpx auto 0 73rpx;
|
||||
color: rgba(255,255,255,1);
|
||||
.status-text {
|
||||
font-size: 36rpx;
|
||||
@@ -148,14 +199,13 @@ export default {
|
||||
}
|
||||
}
|
||||
> image {
|
||||
margin: calc(36rpx + var(--window-top)) 70rpx 0 0;
|
||||
margin: 36rpx 70rpx 0 0;
|
||||
width: 126rpx;
|
||||
height: 109rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
.info {
|
||||
padding-top: 180rpx;
|
||||
margin-bottom: 10rpx;
|
||||
.info-address {
|
||||
padding: 30rpx;
|
||||
@@ -280,6 +330,10 @@ export default {
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 98rpx;
|
||||
background: rgba(255,255,255,1);
|
||||
display: flex;
|
||||
@@ -300,6 +354,9 @@ export default {
|
||||
.logistics, .comment, .payment {
|
||||
@include btn-class($width: 160rpx, $color: rgba(255,119,15,1));
|
||||
}
|
||||
.cancel {
|
||||
@include btn-class($width: 160rpx, $color: rgba(155,153,153,1));
|
||||
}
|
||||
.service {
|
||||
@include btn-class($width: 216rpx, $color: rgba(155,153,153,1));
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ export default {
|
||||
watch: {
|
||||
current(value) {
|
||||
this.page = 0;
|
||||
this.getOrderList('again');
|
||||
this.getOrderList({ reload: 'again' });
|
||||
},
|
||||
},
|
||||
onLoad(option) {
|
||||
@@ -63,7 +63,7 @@ export default {
|
||||
this.setViewHeight();
|
||||
},
|
||||
methods: {
|
||||
async getOrderList(reload = '') {
|
||||
async getOrderList({ reload = '' } = {}) {
|
||||
let type;
|
||||
// state_type 订单状态:0:已取消 10:未付款 20:已付款 30:已发货 40:已收货
|
||||
switch (this.current) {
|
||||
@@ -80,7 +80,7 @@ export default {
|
||||
type = -1; // 试穿试送
|
||||
break;
|
||||
case 5:
|
||||
type = 20; // 待评价
|
||||
type = 'state_noeval'; // 待评价
|
||||
break;
|
||||
case 6:
|
||||
type = 40; // 售后
|
||||
@@ -92,6 +92,7 @@ export default {
|
||||
const res = await this.$u.api.getOrderList({
|
||||
page: this.page,
|
||||
type: type,
|
||||
refund_state: this.current == 6 ? '1' : 0, // 判断是不是售后列表
|
||||
})
|
||||
this.timer = true;
|
||||
if(res.errCode == 0) {
|
||||
@@ -101,11 +102,13 @@ export default {
|
||||
return res;
|
||||
},
|
||||
reachBottom() {
|
||||
// 大于15条才会加载更多
|
||||
if(this.orderList.length < 15) return false;
|
||||
if(!this.timer) return false;
|
||||
this.timer = false;
|
||||
this.loadStatus.splice(this.current, 1, "loading");
|
||||
this.page++;
|
||||
this.getOrderList.then(res => {
|
||||
this.getOrderList().then(res => {
|
||||
this.loadStatus.splice(this.current, 1, "nomore");
|
||||
if(res.data.length == 0) this.page--;
|
||||
}).catch(() => {
|
||||
@@ -135,9 +138,6 @@ export default {
|
||||
background-color: #ECECEC;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// > uni-swiper {
|
||||
// flex: 1;
|
||||
// }
|
||||
.swiper-item {
|
||||
.item-container {
|
||||
padding: 20rpx 30rpx;
|
||||
|
||||
Reference in New Issue
Block a user