Merge pull request 'zhy' (#59) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/59
This commit is contained in:
commit
1854ffff03
@ -236,10 +236,28 @@ export default {
|
|||||||
if(refund_state) Object.assign(params, {refund_state: refund_state});
|
if(refund_state) Object.assign(params, {refund_state: refund_state});
|
||||||
return vm.$u.post('Order/orderList', params);
|
return vm.$u.post('Order/orderList', params);
|
||||||
},
|
},
|
||||||
|
// 售后列表
|
||||||
|
getAfterSaleList({ page }) {
|
||||||
|
return vm.$u.post('order/afterSaleList', { page: page });
|
||||||
|
},
|
||||||
// 订单详情
|
// 订单详情
|
||||||
getOrderInfo({ order_id }) {
|
getOrderInfo({ order_id }) {
|
||||||
return vm.$u.post('Order/orderInfo', { order_id: order_id });
|
return vm.$u.post('Order/orderInfo', { order_id: order_id });
|
||||||
},
|
},
|
||||||
|
// 取消订单
|
||||||
|
cancelOrder({ order_id, msg = '' } = {}) {
|
||||||
|
let params = { order_id: order_id };
|
||||||
|
if(msg) Object.assign(params, {msg: msg});
|
||||||
|
return vm.$u.post('Order/buyer_cancel', params);
|
||||||
|
},
|
||||||
|
// 删除订单
|
||||||
|
deleteOrder({ order_id }) {
|
||||||
|
return vm.$u.post('order/order_delete', { order_id: order_id });
|
||||||
|
},
|
||||||
|
// 确认收货
|
||||||
|
confirmReceive ({ order_id }) {
|
||||||
|
return vm.$u.post('Order/order_receive', { order_id: order_id });
|
||||||
|
},
|
||||||
// 查询订单的评价信息
|
// 查询订单的评价信息
|
||||||
getOrderEvaluateInfo({ id }) {
|
getOrderEvaluateInfo({ id }) {
|
||||||
return vm.$u.post('Order/getOrderEvaluateInfo', { id: id });
|
return vm.$u.post('Order/getOrderEvaluateInfo', { id: id });
|
||||||
|
@ -23,9 +23,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-btn" v-if="[10, 30, 20, 40].indexOf(order.order_state) >= 0">
|
<view class="order-btn" v-if="[10, 30, 20, 40].indexOf(order.order_state) >= 0">
|
||||||
|
<view class="logistics" v-if="order.order_state == 30">确认收货</view>
|
||||||
<view class="logistics" v-if="order.order_state == 30" @click="toOtherPage('Logistics')">查看物流</view>
|
<view class="logistics" v-if="order.order_state == 30" @click="toOtherPage('Logistics')">查看物流</view>
|
||||||
<view class="comment" v-if="order.order_state == 40 && order.evaluation_state == 0" @click="toOtherPage('Comment')">立即评价</view>
|
<view class="comment" v-if="order.order_state == 40 && order.evaluation_state == 0" @click="toOtherPage('Comment')">立即评价</view>
|
||||||
<view class="calcel" v-if="order.order_state == 10">取消支付</view>
|
<view class="calcel" v-if="order.order_state == 10" @click="cancelOrder">取消支付</view>
|
||||||
<view class="payment" v-if="order.order_state == 10">立即支付</view>
|
<view class="payment" v-if="order.order_state == 10">立即支付</view>
|
||||||
<view class="service" v-if="order.order_state == 20">联系官方客服</view>
|
<view class="service" v-if="order.order_state == 20">联系官方客服</view>
|
||||||
<view class="submit" v-if="order.order_state == 20">提交官方审核</view>
|
<view class="submit" v-if="order.order_state == 20">提交官方审核</view>
|
||||||
@ -36,7 +37,7 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
state: '', // 1: 待收货 2: 待评价 3: 交易成功 4: 已取消 5: 已退款 6: 待支付
|
state: '', // 1: 待收货 2: 待评价 3: 交易成功 4: 已取消 5: 已退款 6: 待支付, 7: 售后
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@ -69,8 +70,23 @@ export default {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(this.order.refund_state) state = '已退款';
|
if(this.order.refund_state) state = '已退款';
|
||||||
|
// 申请退款
|
||||||
|
if(this.order.refund_data) {
|
||||||
|
if([1, 2].indexOf(this.order.refund_data.refund_state) >= 0) state = '待退款';
|
||||||
|
if(this.order.refund_data.refund_state == 3) state = '已退款';
|
||||||
|
}
|
||||||
|
|
||||||
this.state = state;
|
this.state = state;
|
||||||
},
|
},
|
||||||
|
cancelOrder() {
|
||||||
|
this.$u.api.cancelOrder({
|
||||||
|
order_id: this.order.order_id,
|
||||||
|
}).then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.$emit("refreshOrderList", { reload: 'again' });
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
toOtherPage(url) {
|
toOtherPage(url) {
|
||||||
this.$u.route('/pageE/order/' + url, {
|
this.$u.route('/pageE/order/' + url, {
|
||||||
oid: this.order.order_id,
|
oid: this.order.order_id,
|
||||||
|
@ -26,7 +26,8 @@
|
|||||||
<view class="name u-line-2">{{ goods.goods_name }}</view>
|
<view class="name u-line-2">{{ goods.goods_name }}</view>
|
||||||
<view class="cart-info">
|
<view class="cart-info">
|
||||||
<view class="price">¥{{ goods.goods_price }}</view>
|
<view class="price">¥{{ goods.goods_price }}</view>
|
||||||
<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" color="#FF780F" :index="g_index" v-model="goods.goods_num"></u-number-box>
|
<!-- <u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" color="#FF780F" :index="g_index" v-model="goods.goods_num" :disabled="true"></u-number-box> -->
|
||||||
|
<view>×{{ goods.goods_num }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -73,7 +74,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view class="num">共件{{ orderInfo.store_cart_list | setTotalNumber }}商品</view>
|
<view class="num">共件{{ orderInfo.store_cart_list | setTotalNumber }}商品</view>
|
||||||
<view class="btn" @click="settlement">结算</view>
|
<view class="btn" @click="sendOrder">结算</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -103,9 +104,10 @@ export default {
|
|||||||
let num = 0;
|
let num = 0;
|
||||||
for (const key in data) {
|
for (const key in data) {
|
||||||
if (data.hasOwnProperty(key)) {
|
if (data.hasOwnProperty(key)) {
|
||||||
const element = data[key][0];
|
const element = data[key];
|
||||||
console.log(element);
|
element.forEach(item => {
|
||||||
num += element.goods_num;
|
num += item.goods_num;
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return num;
|
return num;
|
||||||
@ -115,12 +117,39 @@ export default {
|
|||||||
console.log(JSON.parse(option.info));
|
console.log(JSON.parse(option.info));
|
||||||
this.orderInfo = JSON.parse(option.info);
|
this.orderInfo = JSON.parse(option.info);
|
||||||
this.addressInfo = this.orderInfo.address_info;
|
this.addressInfo = this.orderInfo.address_info;
|
||||||
this.showTotalPrice();
|
|
||||||
this.getFreight();
|
this.getFreight();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showTotalPrice() {
|
sendOrder() {
|
||||||
|
// 拼接后端需要的数据形式
|
||||||
|
let id = [], temp = '';
|
||||||
|
const object = this.orderInfo.store_cart_list;
|
||||||
|
for (const key in object) {
|
||||||
|
if (object.hasOwnProperty(key)) {
|
||||||
|
const element = object[key];
|
||||||
|
element.forEach(item => {
|
||||||
|
temp = item.cart_id + '|' + item.goods_num;
|
||||||
|
id.push(temp);
|
||||||
|
temp = '';
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$u.api.sendOrder({
|
||||||
|
ifcart: 1,
|
||||||
|
cart_id: id,
|
||||||
|
address_id: this.addressInfo.address_id,
|
||||||
|
buy_city_id: this.addressInfo.city_id,
|
||||||
|
}).then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.$u.route({
|
||||||
|
url: '/pageC/cart/cashier',
|
||||||
|
params: {
|
||||||
|
pay_sn: res.data.pay_sn,
|
||||||
|
price: res.data.order_total_amount,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
getFreight() {
|
getFreight() {
|
||||||
this.$u.api.getFreight({
|
this.$u.api.getFreight({
|
||||||
@ -191,6 +220,7 @@ export default {
|
|||||||
.main {
|
.main {
|
||||||
margin-bottom: 50rpx;
|
margin-bottom: 50rpx;
|
||||||
> view {
|
> view {
|
||||||
|
margin-bottom: 20rpx;
|
||||||
.goods-info {
|
.goods-info {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
|
188
pageC/cart/cashier.vue
Normal file
188
pageC/cart/cashier.vue
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
<template>
|
||||||
|
<view class="cashier">
|
||||||
|
<view class="top">
|
||||||
|
<view class="title">支付金额</view>
|
||||||
|
<view class="price">¥{{ price }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="pay-view">
|
||||||
|
<u-radio-group v-model="pay_way" @change="radioGroupChange" size="16">
|
||||||
|
<view v-for="(item, index) in payLiat" :key="index" class="pay-item">
|
||||||
|
<view class="pay-way">
|
||||||
|
<image :src="item.icon"></image>
|
||||||
|
<text class="name">{{ item.pay_way }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="radio-view" :class="pay_way == item.name ? 'active' : 'default'">
|
||||||
|
<u-radio :name="item.name" active-color="#FF780F" :disabled="item.disabled"></u-radio>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-radio-group>
|
||||||
|
</view>
|
||||||
|
<view class="pay-btn" @click="sendPay">去支付</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
payLiat: [
|
||||||
|
{
|
||||||
|
name: 'wxpay_app',
|
||||||
|
icon: '/static/image/common/14.png',
|
||||||
|
pay_way: '微信支付',
|
||||||
|
disabled: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'alipay_app',
|
||||||
|
icon: '/static/image/common/13.png',
|
||||||
|
pay_way: '支付宝',
|
||||||
|
disabled: false,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
pay_way: '',
|
||||||
|
pay_sn: '',
|
||||||
|
price: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
this.pay_sn = option.pay_sn;
|
||||||
|
this.price = option.price;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
radioGroupChange(e) {
|
||||||
|
// console.log(e);
|
||||||
|
},
|
||||||
|
// getProvider() {
|
||||||
|
// uni.getProvider({service: 'payment'})
|
||||||
|
// },
|
||||||
|
// 支付宝支付
|
||||||
|
payByAlipay (orderInfo) {
|
||||||
|
uni.requestPayment({
|
||||||
|
provider: 'alipay',
|
||||||
|
orderInfo: orderInfo, //支付宝订单数据
|
||||||
|
success: function (res) {
|
||||||
|
console.log('success:' + JSON.stringify(res));
|
||||||
|
},
|
||||||
|
fail: function (err) {
|
||||||
|
console.log('fail:' + JSON.stringify(err));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 微信支付
|
||||||
|
payByWxpay (orderInfo) {
|
||||||
|
uni.requestPayment({
|
||||||
|
provider: 'wxpay',
|
||||||
|
orderInfo: orderInfo, //微信订单数据
|
||||||
|
success: function (res) {
|
||||||
|
console.log('success:' + JSON.stringify(res));
|
||||||
|
},
|
||||||
|
fail: function (err) {
|
||||||
|
console.log('fail:' + JSON.stringify(err));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
sendPay() {
|
||||||
|
this.$u.api.sendPay({
|
||||||
|
pay_sn: this.pay_sn,
|
||||||
|
payment_code: this.pay_way,
|
||||||
|
}).then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
// this.$u.toast(res.message);
|
||||||
|
// uni.navigateBack();
|
||||||
|
const orderInfo = JSON.parse(res.data.content);
|
||||||
|
console.log(orderInfo);
|
||||||
|
this.pay_way == 'wxpay_app' ? this.payByWxpay(orderInfo) : this.payByAlipay(orderInfo);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.cashier {
|
||||||
|
min-height: calc(100vh - var(--window-top));
|
||||||
|
background-color: #ECECEC;
|
||||||
|
padding-top: 1rpx;
|
||||||
|
.top {
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
height: 240rpx;
|
||||||
|
background:rgba(255,255,255,1);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
.title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: rgba(51,51,51,1);
|
||||||
|
margin-bottom: 50rpx;
|
||||||
|
}
|
||||||
|
.price {
|
||||||
|
font-size: 42rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: rgba(243,13,13,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.pay-view {
|
||||||
|
/deep/ .u-radio-group {
|
||||||
|
width: 100%;
|
||||||
|
flex-direction: column;
|
||||||
|
.radio-view {
|
||||||
|
padding: 6rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
.active {
|
||||||
|
border: 2rpx solid rgba(255,120,15,1);
|
||||||
|
}
|
||||||
|
.default {
|
||||||
|
border: 2rpx solid rgba(219,219,219,1);
|
||||||
|
}
|
||||||
|
.u-radio {
|
||||||
|
.u-icon {
|
||||||
|
border-color: rgba(219,219,219,1);
|
||||||
|
background-color: rgba(219,219,219,1);
|
||||||
|
.u-icon__icon::before {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.pay-item {
|
||||||
|
height: 98rpx;
|
||||||
|
background: rgba(255,255,255,1);
|
||||||
|
padding: 24rpx 30rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 2rpx;
|
||||||
|
.pay-way {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
> image {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
.name {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: rgba(51,51,51,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.pay-btn {
|
||||||
|
z-index: 9;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 200rpx;
|
||||||
|
left: 30rpx;
|
||||||
|
width: 690rpx;
|
||||||
|
height: 98rpx;
|
||||||
|
background: rgba(255,120,15,1);
|
||||||
|
border-radius: 49rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: rgba(255,255,255,1);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -26,6 +26,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-checkbox-group>
|
</u-checkbox-group>
|
||||||
|
<view class="empty-view">
|
||||||
|
<u-empty mode="car" v-if="!list.length" :margin-top="240"></u-empty>
|
||||||
|
</view>
|
||||||
<view class="balance">
|
<view class="balance">
|
||||||
<u-checkbox-group>
|
<u-checkbox-group>
|
||||||
<u-checkbox v-model="checkedAll" shape="circle" active-color="#FF780F" icon-size="35" label-size="30" @change="totalChange">
|
<u-checkbox v-model="checkedAll" shape="circle" active-color="#FF780F" icon-size="35" label-size="30" @change="totalChange">
|
||||||
@ -85,6 +88,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 结算
|
// 结算
|
||||||
settlementOrder() {
|
settlementOrder() {
|
||||||
|
if(!this.checkedGoods.length) return false;
|
||||||
// 拼接后端需要的数据形式
|
// 拼接后端需要的数据形式
|
||||||
let id = [], temp = '';
|
let id = [], temp = '';
|
||||||
this.checkedGoods.forEach(item => {
|
this.checkedGoods.forEach(item => {
|
||||||
@ -193,6 +197,13 @@ export default {
|
|||||||
},
|
},
|
||||||
onNavigationBarButtonTap(btn) {
|
onNavigationBarButtonTap(btn) {
|
||||||
// console.log(btn);
|
// console.log(btn);
|
||||||
|
// #ifdef H5
|
||||||
|
if(this.status == '编辑'){
|
||||||
|
this.status = "完成";
|
||||||
|
}else{
|
||||||
|
this.status = "编辑";
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
if(btn.index == 0){
|
if(btn.index == 0){
|
||||||
let pages = getCurrentPages();
|
let pages = getCurrentPages();
|
||||||
let page = pages[pages.length - 1];
|
let page = pages[pages.length - 1];
|
||||||
@ -213,13 +224,14 @@ export default {
|
|||||||
});
|
});
|
||||||
this.status = titleObj.buttons[0].text;
|
this.status = titleObj.buttons[0].text;
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.cart {
|
.cart {
|
||||||
|
min-height: calc(100vh - var(--window-top));
|
||||||
|
position: relative;
|
||||||
padding-bottom: 100rpx;
|
padding-bottom: 100rpx;
|
||||||
.cart-main {
|
.cart-main {
|
||||||
display: block;
|
display: block;
|
||||||
@ -329,6 +341,12 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.empty-view {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -100%);
|
||||||
|
}
|
||||||
.balance {
|
.balance {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
@ -61,6 +61,7 @@ export default {
|
|||||||
birthday: '',
|
birthday: '',
|
||||||
phoneNumber: '',
|
phoneNumber: '',
|
||||||
avatar: '',
|
avatar: '',
|
||||||
|
uploadPath: '', // 上传时的路径
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@ -83,7 +84,10 @@ export default {
|
|||||||
name: 'avatar',
|
name: 'avatar',
|
||||||
filePath: res.tempFilePaths[0]
|
filePath: res.tempFilePaths[0]
|
||||||
}).then(result => {
|
}).then(result => {
|
||||||
this.avatar = result;
|
// console.log(result);
|
||||||
|
this.$set(this, 'avatar', result.file_path);
|
||||||
|
// this.avatar = result.file_path;
|
||||||
|
this.uploadPath = result.file_name;
|
||||||
}, error => {
|
}, error => {
|
||||||
this.$u.toast(error);
|
this.$u.toast(error);
|
||||||
})
|
})
|
||||||
@ -108,7 +112,7 @@ export default {
|
|||||||
this.$u.api.updateMemberInfo({
|
this.$u.api.updateMemberInfo({
|
||||||
nickname: this.nickname,
|
nickname: this.nickname,
|
||||||
gender: this.gender,
|
gender: this.gender,
|
||||||
avatar: this.avatar,
|
avatar: this.uploadPath,
|
||||||
birthday: this.birthday,
|
birthday: this.birthday,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.errCode == 0) {
|
if (res.errCode == 0) {
|
||||||
|
@ -51,7 +51,8 @@ export default {
|
|||||||
getUserInfo() {
|
getUserInfo() {
|
||||||
this.$u.api.getMemberInfo().then(res => {
|
this.$u.api.getMemberInfo().then(res => {
|
||||||
if (res.errCode == 0) {
|
if (res.errCode == 0) {
|
||||||
this.userInfo = res.data.MemberArray;
|
// this.userInfo = res.data.MemberArray;
|
||||||
|
this.$set(this, 'userInfo', res.data.MemberArray);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -67,9 +67,15 @@ export default {
|
|||||||
fb_images: this.imageList,
|
fb_images: this.imageList,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if(res.errCode == 0) {
|
if(res.errCode == 0) {
|
||||||
this.$u.route({
|
this.$refs.uToast.show({
|
||||||
type: "redirect",
|
title: res.message,
|
||||||
url: '/pageE/more/Complaints',
|
duration: 2000,
|
||||||
|
callback:() => {
|
||||||
|
this.$u.route({
|
||||||
|
type: "navigateBack",
|
||||||
|
url: '/pageE/more/Complaints',
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$u.toast(res.message);
|
this.$u.toast(res.message);
|
||||||
|
@ -12,10 +12,10 @@
|
|||||||
<image src="../static/mine/28.png"></image>
|
<image src="../static/mine/28.png"></image>
|
||||||
<view class="address-right">
|
<view class="address-right">
|
||||||
<view class="user-info">
|
<view class="user-info">
|
||||||
<view>胖胖</view>
|
<view>{{ orderInfo.extend_order_common.reciver_name }}</view>
|
||||||
<view>18220171014</view>
|
<view>{{ orderInfo.extend_order_common.reciver_info.mob_phone }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="address-text u-line-2">山东省泰安市泰山区东岳大街与克山路交汇口银山店四楼橙天影视南邻山东省泰安市泰山区东岳大街与克山路交汇口银山店四楼橙天影视南邻</view>
|
<view class="address-text u-line-2">{{ orderInfo.extend_order_common.reciver_info.address }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-goods">
|
<view class="info-goods">
|
||||||
@ -41,19 +41,19 @@
|
|||||||
<view class="goods-others">
|
<view class="goods-others">
|
||||||
<view>
|
<view>
|
||||||
<view class="title">运费(快递/骑手)</view>
|
<view class="title">运费(快递/骑手)</view>
|
||||||
<view class="price">¥0.00</view>
|
<view class="price">¥{{ orderInfo.shipping_fee }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="title">店铺优惠</view>
|
<view class="title">店铺优惠</view>
|
||||||
<view class="price">¥0.00</view>
|
<view class="price">¥{{ orderInfo.extend_order_common.voucher_price || '0.00' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="title">订单总价</view>
|
<view class="title">订单总价</view>
|
||||||
<view class="price">¥{{ orderInfo.order_amount }}</view>
|
<view class="price">¥{{ orderInfo.goods_amount }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="title">实付费(含运费)</view>
|
<view class="title">实付费(含运费)</view>
|
||||||
<view class="price">¥{{ orderInfo.goods_amount }}</view>
|
<view class="price">¥{{ orderInfo.order_amount }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="title">支付方式</view>
|
<view class="title">支付方式</view>
|
||||||
@ -70,10 +70,10 @@
|
|||||||
<view class="btn" v-if="['1', '2', '6'].indexOf(state) >= 0">
|
<view class="btn" v-if="['1', '2', '6'].indexOf(state) >= 0">
|
||||||
<view class="logistics" v-if="state == '1'" @click="toOtherPage('Logistics')">查看物流</view>
|
<view class="logistics" v-if="state == '1'" @click="toOtherPage('Logistics')">查看物流</view>
|
||||||
<view class="comment" v-if="state == '2'" @click="toOtherPage('Comment')">立即评价</view>
|
<view class="comment" v-if="state == '2'" @click="toOtherPage('Comment')">立即评价</view>
|
||||||
<view class="cancel" v-if="state == '6'">取消支付</view>
|
<view class="cancel" v-if="state == '6'" @click="cancelOrder">取消支付</view>
|
||||||
<view class="payment" v-if="state == '6'">立即支付</view>
|
<view class="payment" v-if="state == '6'">立即支付</view>
|
||||||
<view class="service" v-if="current == 6">联系官方客服</view>
|
<view class="service" v-if="state == '7'">联系官方客服</view>
|
||||||
<view class="submit" v-if="current == 6">提交官方审核</view>
|
<view class="submit" v-if="state == '7'">提交官方审核</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -81,7 +81,7 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
state: '', // 1: 待收货 2: 待评价 3: 交易成功 4: 已取消 5: 已退款 6: 待支付
|
state: '', // 1: 待收货 2: 待评价 3: 交易成功 4: 已取消 5: 已退款 6: 待支付 7: 待退款 8: 已退款
|
||||||
s_object: {
|
s_object: {
|
||||||
'1': {
|
'1': {
|
||||||
text: '待收货',
|
text: '待收货',
|
||||||
@ -107,6 +107,10 @@ export default {
|
|||||||
text: '待支付',
|
text: '待支付',
|
||||||
image: '../static/mine/31.png',
|
image: '../static/mine/31.png',
|
||||||
},
|
},
|
||||||
|
'7': {
|
||||||
|
text: '待退款',
|
||||||
|
image: '../static/mine/34.png',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
current: 0,
|
current: 0,
|
||||||
orderInfo: {}
|
orderInfo: {}
|
||||||
@ -114,7 +118,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.setTitle();
|
this.setTitle();
|
||||||
this.getOrderInfo(option.id);
|
this.getOrderInfo(option.oid);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
viewState(value) {
|
viewState(value) {
|
||||||
@ -139,6 +143,14 @@ export default {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(this.orderInfo.refund_state) state = '5';
|
if(this.orderInfo.refund_state) state = '5';
|
||||||
|
// 申请退款
|
||||||
|
if(this.orderInfo.refund_list) {
|
||||||
|
const refund = this.orderInfo.refund_list[this.orderInfo.extend_order_common.order_id];
|
||||||
|
if(this.orderInfo.refund_list) {
|
||||||
|
if([1, 2].indexOf(refund.refund_state) >= 0) state = '7';
|
||||||
|
if(refund.refund_state == 3) state = '8';
|
||||||
|
}
|
||||||
|
}
|
||||||
this.state = state;
|
this.state = state;
|
||||||
},
|
},
|
||||||
getOrderInfo(id) {
|
getOrderInfo(id) {
|
||||||
@ -151,6 +163,15 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
cancelOrder() {
|
||||||
|
this.$u.api.cancelOrder({
|
||||||
|
order_id: this.orderInfo.order_id,
|
||||||
|
}).then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
uni.navigateBack();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
setTitle(){
|
setTitle(){
|
||||||
let title = '';
|
let title = '';
|
||||||
switch (this.current) {
|
switch (this.current) {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom">
|
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom">
|
||||||
<view>
|
<view>
|
||||||
<view class="item-container" v-for="order in orderList" :key="order.order_id">
|
<view class="item-container" v-for="order in orderList" :key="order.order_id">
|
||||||
<OrderItem :order="order"></OrderItem>
|
<OrderItem :order="order" @refreshOrderList="getOrderList"></OrderItem>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-empty text="暂无订单" mode="order" color="#000000" v-if="!orderList.length"></u-empty>
|
<u-empty text="暂无订单" mode="order" color="#000000" v-if="!orderList.length"></u-empty>
|
||||||
@ -53,7 +53,8 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
current(value) {
|
current(value) {
|
||||||
this.page = 0;
|
this.page = 0;
|
||||||
this.getOrderList({ reload: 'again' });
|
// again 重新请求列表 不然往列表里添加
|
||||||
|
value == 6 ? this.getAfterSaleList({ reload: 'again' }): this.getOrderList({ reload: 'again' });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
@ -63,7 +64,7 @@ export default {
|
|||||||
this.setViewHeight();
|
this.setViewHeight();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getOrderList({ reload = '' } = {}) {
|
setOrderType() {
|
||||||
let type;
|
let type;
|
||||||
// state_type 订单状态:0:已取消 10:未付款 20:已付款 30:已发货 40:已收货
|
// state_type 订单状态:0:已取消 10:未付款 20:已付款 30:已发货 40:已收货
|
||||||
switch (this.current) {
|
switch (this.current) {
|
||||||
@ -82,17 +83,28 @@ export default {
|
|||||||
case 5:
|
case 5:
|
||||||
type = 'state_noeval'; // 待评价
|
type = 'state_noeval'; // 待评价
|
||||||
break;
|
break;
|
||||||
case 6:
|
|
||||||
type = 40; // 售后
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
type = -1;
|
type = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
return type;
|
||||||
|
},
|
||||||
|
async getOrderList({ reload = '' } = {}) {
|
||||||
|
const type = this.setOrderType();
|
||||||
const res = await this.$u.api.getOrderList({
|
const res = await this.$u.api.getOrderList({
|
||||||
page: this.page,
|
page: this.page,
|
||||||
type: type,
|
type: type,
|
||||||
refund_state: this.current == 6 ? '1' : 0, // 判断是不是售后列表
|
})
|
||||||
|
this.timer = true;
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
if(reload) this.orderList = res.data;
|
||||||
|
else this.orderList.push(...res.data);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
},
|
||||||
|
async getAfterSaleList({ reload = '' } = {}) {
|
||||||
|
const res = await this.$u.api.getAfterSaleList({
|
||||||
|
page: this.page,
|
||||||
})
|
})
|
||||||
this.timer = true;
|
this.timer = true;
|
||||||
if(res.errCode == 0) {
|
if(res.errCode == 0) {
|
||||||
@ -108,7 +120,10 @@ export default {
|
|||||||
this.timer = false;
|
this.timer = false;
|
||||||
this.loadStatus.splice(this.current, 1, "loading");
|
this.loadStatus.splice(this.current, 1, "loading");
|
||||||
this.page++;
|
this.page++;
|
||||||
this.getOrderList().then(res => {
|
let promise;
|
||||||
|
if(this.current == 6) promise = this.getAfterSaleList();
|
||||||
|
else promise = this.getOrderList();
|
||||||
|
promise.then(res => {
|
||||||
this.loadStatus.splice(this.current, 1, "nomore");
|
this.loadStatus.splice(this.current, 1, "nomore");
|
||||||
if(res.data.length == 0) this.page--;
|
if(res.data.length == 0) this.page--;
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
|
14
pages.json
14
pages.json
@ -189,7 +189,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "cart/cashier",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "收银台",
|
||||||
|
"app-plus": {
|
||||||
|
"titleSize": "36px",
|
||||||
|
"titleNView": {
|
||||||
|
"titleColor": "#333333",
|
||||||
|
"backgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "merchant/index",
|
"path": "merchant/index",
|
||||||
|
@ -145,7 +145,8 @@ export default {
|
|||||||
getUserInfo() {
|
getUserInfo() {
|
||||||
this.$u.api.getMemberInfo().then(res => {
|
this.$u.api.getMemberInfo().then(res => {
|
||||||
if (res.errCode == 0) {
|
if (res.errCode == 0) {
|
||||||
this.userInfo = res.data.MemberArray;
|
// this.userInfo = res.data.MemberArray;
|
||||||
|
this.$set(this, 'userInfo', res.data.MemberArray);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
BIN
static/image/common/13.png
Normal file
BIN
static/image/common/13.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
BIN
static/image/common/14.png
Normal file
BIN
static/image/common/14.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
Loading…
Reference in New Issue
Block a user