【订单详情】

1. 字段的展示
2. 各状态下的操作按钮
pull/1/MERGE
YunaiV 2023-07-01 21:47:34 +08:00
parent 62644ddb56
commit 2aef6a4fe5
3 changed files with 371 additions and 318 deletions

View File

@ -46,10 +46,6 @@
type: String,
default: '',
},
ids: {
type: Number,
default: 0,
},
jump: {
type: Boolean,
default: false,
@ -79,7 +75,7 @@
// TODO
evaluateTap(item) {
uni.navigateTo({
url: "/pages/users/goods_comment_con/index?unique=" + item.attrId + "&orderId=" + this.orderId + '&id=' + this.ids
url: "/pages/users/goods_comment_con/index?unique=" + item.attrId + "&orderId=" + this.orderId + '&id=' + item.id
})
},
jumpCon: function(id) {

View File

@ -20,7 +20,7 @@
<view class='state' v-if="orderInfo.status === 20"></view>
<view class='state' v-if="orderInfo.status === 30 && !orderInfo.commentStatus"></view>
<view class='state' v-if="orderInfo.status === 30 && orderInfo.commentStatus"></view>
<!-- TODO 芋艿未来可以优化下关闭的原因补充例如说订单超时/订单取消 -->
<!-- TODO 芋艿未来可以优化下关闭的原因补充例如说订单超时/订单取消参考淘宝 -->
<view class='state' v-if="orderInfo.status === 40"></view>
<!-- 下单时间 -->
<view>{{ formatDate(orderInfo.createTime) }}</view>
@ -103,10 +103,15 @@
<text class="iconfont icon-weizhi"></text>查看位置
</view>
</view>
<view v-if="orderInfo.shippingType === 1" class='address borRadius14'>
<view class='name'>{{orderInfo.realName}}<text class='phone'>{{orderInfo.userPhone}}</text></view>
<view>{{orderInfo.userAddress}}</view>
<!-- 收货人信息 -->
<view v-if="orderInfo.deliveryType === 1" class='address borRadius14'>
<view class='name'>{{ orderInfo.receiverName }}
<text class='phone'>{{ orderInfo.receiverMobile }}</text>
</view>
<view>{{ orderInfo.receiverAreaName }} {{ orderInfo.receiverDetailAddress}}</view>
</view>
<!-- TODO 芋艿核销的情况 -->
<view v-else class='address' style="margin-top:15rpx;">
<view class='name' @tap="makePhone">{{orderInfo.systemStore?orderInfo.systemStore.name:''}}<text
class='phone'>{{orderInfo.systemStore?orderInfo.systemStore.phone:''}}</text><text
@ -114,23 +119,34 @@
<view>{{orderInfo.systemStore?orderInfo.systemStore.detailedAddress:''}}</view>
</view>
<orderGoods :evaluate='evaluate' :productType="orderInfo.type" :orderId="order_id" :ids="id" :cartInfo="cartInfo"
:jump="true"></orderGoods>
<!-- 商品列表 -->
<orderGoods
:evaluate='evaluate'
:productType="orderInfo.type"
:orderId="order_id"
:cartInfo="cartInfo"
:jump="true"
/>
<!-- 客服 -->
<!-- #ifndef MP -->
<div class="goodCall borRadius14" @click="kefuClick">
<span class="iconfont icon-kefu"></span><span>联系客服</span>
<span class="iconfont icon-kefu" />
<span>联系客服</span>
</div>
<!-- #endif -->
<!-- #ifdef MP -->
<div class="goodCall borRadius14">
<button open-type='contact' hover-class='none'>
<span class="iconfont icon-kefu"></span><span>联系客服</span>
<span class="iconfont icon-kefu" />
<span>联系客服</span>
</button>
</div>
<!-- #endif -->
</view>
<view class="pad30">
<!-- TODO 芋艿退款各种 -->
<view class='nav refund' v-if="orderInfo.refundStatus>0">
<view class="title">
<image src="/static/images/shuoming.png" mode=""></image>
@ -141,34 +157,35 @@
<view class='wrapper borRadius14'>
<view class='item acea-row row-between'>
<view>订单编号</view>
<view class='conter acea-row row-middle row-right'>{{orderInfo.orderId}}
<view class='conter acea-row row-middle row-right'>{{orderInfo.no}}
<!-- #ifndef H5 -->
<text class='copy' @tap='copy'>复制</text>
<!-- #endif -->
<!-- #ifdef H5 -->
<text class='copy copy-data' :data-clipboard-text="orderInfo.orderId">复制</text>
<text class='copy copy-data' :data-clipboard-text="orderInfo.no">复制</text>
<!-- #endif -->
</view>
</view>
<view class='item acea-row row-between'>
<view>下单时间</view>
<view class='conter'>{{(orderInfo.createTime || 0)}}</view>
<view class='conter'>{{( formatDate(orderInfo.createTime) )}}</view>
</view>
<view class='item acea-row row-between'>
<view>支付状态</view>
<view class='conter' v-if="orderInfo.paid"></view>
<view class='conter' v-if="orderInfo.payStatus"></view>
<view class='conter' v-else></view>
</view>
<!-- TODO 芋艿支付方式的翻译 -->
<view class='item acea-row row-between'>
<view>支付方式</view>
<view class='conter'>{{orderInfo.payTypeStr}}</view>
</view>
<view class='item acea-row row-between' v-if="orderInfo.mark">
<view class='item acea-row row-between' v-if="orderInfo.userRemark">
<view>买家留言</view>
<view class='conter'>{{orderInfo.mark}}</view>
<view class='conter'>{{orderInfo.userRemark}}</view>
</view>
</view>
<!-- 退款订单详情 "-->
<!-- TODO 芋艿退款订单详情 -->
<view v-if="isGoodsReturn" class='wrapper borRadius14' >
<view class='item acea-row row-between'>
<view>收货人</view>
@ -183,8 +200,10 @@
<view class='conter'>{{orderInfo.userAddress}}</view>
</view>
</view>
<view v-if="orderInfo.status>0">
<view class='wrapper borRadius14' v-if='orderInfo.deliveryType=="express"'>
<!-- TODO 芋艿快递相关 -->
<view v-if="orderInfo.status !== 0">
<view class='wrapper borRadius14' v-if='orderInfo.deliveryType === 1'>
<view class='item acea-row row-between'>
<view>配送方式</view>
<view class='conter'>发货</view>
@ -220,30 +239,42 @@
</view>
</view>
</view>
<!-- 价格相关 -->
<view class='wrapper borRadius14'>
<view class='item acea-row row-between'>
<view>商品总价</view>
<view class='conter'>{{orderInfo.proTotalPrice}}</view>
<view class='conter'>{{ fen2yuan(orderInfo.totalPrice) }}</view>
</view>
<view class='item acea-row row-between' v-if="orderInfo.payPostage > 0">
<view class='item acea-row row-between' v-if="orderInfo.deliveryPrice > 0">
<view>运费</view>
<view class='conter'>{{orderInfo.payPostage}}</view>
<view class='conter'>{{ fen2yuan(orderInfo.deliveryPrice) }}</view>
</view>
<view class='item acea-row row-between' v-if='orderInfo.couponId'>
<view>优惠券抵扣</view>
<view class='conter'>-{{orderInfo.couponPrice}}</view>
<view class='conter'>-{{ fen2yuan(orderInfo.couponPrice) }}</view>
</view>
<view class='item acea-row row-between' v-if="orderInfo.useIntegral > 0">
<!-- TODO 芋艿vip 价格减免 from php -->
<!-- TODO 芋艿vip 价格减免 from php -->
<view class='item acea-row row-between' v-if="orderInfo.pointPrice > 0">
<view>积分抵扣</view>
<view class='conter'>-{{orderInfo.deductionPrice}}</view>
<view class='conter'>-{{ fen2yuan(orderInfo.deductionPrice) }}</view>
</view>
<view class='actualPay acea-row row-right'>
实付款<text class='money font-color'>{{ fen2yuan(orderInfo.payPrice) }}</text>
</view>
<view class='actualPay acea-row row-right'>实付款<text
class='money font-color'>{{orderInfo.payPrice}}</text></view>
</view>
<view style='height:120rpx;'></view>
<!-- 操作区域 -->
<view class='footer acea-row row-right row-middle' v-if="isGoodsReturn==false">
<view class="qs-btn" v-if="!orderInfo.paid" @click.stop="cancelOrder"></view>
<view class='bnt bg-color' v-if="!orderInfo.paid" @tap='pay_open(orderInfo.orderId)'>立即付款</view>
<view class="qs-btn" v-if="orderInfo.status === 0" @click.stop="cancelOrder">
取消订单
</view>
<view class='bnt bg-color' v-if="orderInfo.status === 0" @tap='goPay'>
立即付款
</view>
<!-- TODO 芋艿退款各种 -->
<!-- #ifdef MP -->
<view @tap="openSubcribe('/pages/users/goods_return/index?orderId='+orderInfo.orderId)"
class='bnt cancel' v-else-if="orderInfo.paid === true && orderInfo.refundStatus === 0 && orderInfo.type!==1 && type==='normal'">申请退款
@ -254,13 +285,23 @@
class='bnt cancel' v-else-if="orderInfo.paid === true && orderInfo.refundStatus === 0 && orderInfo.type!==1 && type==='normal'">申请退款
</navigator>
<!-- #endif -->
<!-- TODO 芋艿拼团 -->
<view class='bnt bg-color' v-if="orderInfo.combinationId > 0" @tap='goJoinPink'>查看拼团</view>
<navigator class='bnt cancel' v-if="orderInfo.deliveryType == 'express' && orderInfo.status >0"
hover-class='none' :url="'/pages/users/goods_logistics/index?orderId='+ orderInfo.orderId">查看物流
<!-- TODO 芋艿物流 -->
<navigator class='bnt cancel' v-if="orderInfo.deliveryType === 2 && orderInfo.status > 0"
hover-class='none' :url="'/pages/users/goods_logistics/index?orderId='+ orderInfo.orderId">
查看物流
</navigator>
<view class='bnt bg-color' v-if="orderInfo.status==1" @tap='confirmOrder'>确认收货</view>
<view class='bnt cancel' v-if="orderInfo.status==3" @tap='delOrder'>删除订单</view>
<view class='bnt bg-color' v-if="orderInfo.status==3 && orderInfo.type!==1" @tap='goOrderConfirm'>再次购买</view>
<view class='bnt bg-color' v-if="orderInfo.status === 20" @tap='confirmOrder'>
确认收货
</view>
<view class='bnt cancel' v-if="orderInfo.status === 40" @tap='delOrder'>
删除订单
</view>
<!-- TODO 芋艿再次购买 -->
<view class='bnt bg-color' v-if="orderInfo.status==3 && orderInfo.type!==1" @tap='goOrderConfirm'>
再次购买
</view>
</view>
</view>
</view>
@ -268,25 +309,25 @@
</view>
</template>
<script>
import {
import {
orderTake,
orderDel,
orderCancel,
qrcodeApi
} from '@/api/order.js';
import * as OrderApi from '@/api/trade/order.js';
import {
} from '@/api/order.js';
import * as OrderApi from '@/api/trade/order.js';
import {
openOrderRefundSubscribe
} from '@/utils/SubscribeMessage.js';
import home from '@/components/home';
import payment from '@/components/payment';
import orderGoods from "@/components/orderGoods";
import ClipboardJS from "@/plugin/clipboard/clipboard.js";
import { toLogin } from '@/libs/login.js';
import { mapGetters } from "vuex";
import dayjs from '@/plugin/dayjs/dayjs.min.js';
import * as Util from '@/utils/util.js';
export default {
} from '@/utils/SubscribeMessage.js';
import home from '@/components/home';
import payment from '@/components/payment';
import orderGoods from "@/components/orderGoods";
import ClipboardJS from "@/plugin/clipboard/clipboard.js";
import { toLogin } from '@/libs/login.js';
import { mapGetters } from "vuex";
import dayjs from '@/plugin/dayjs/dayjs.min.js';
import * as Util from '@/utils/util.js';
export default {
components: {
payment,
home,
@ -294,21 +335,19 @@ export default {
},
data() {
return {
order_id: '', //
type: 'normal',
orderInfo: { //
systemStore: {},
},
cartInfo: [], //
codeImg: '',
qrcodeSize: 100,
order_id: '',
evaluate: 0,
cartInfo: [], //
orderInfo: {
systemStore: {},
pstatus: {}
}, //
system_store: {},
isGoodsReturn: false, //退
status: {}, //
totalPrice: '0',
id: 0, //id
type: 'normal'
};
},
computed: mapGetters(['isLogin', 'chatUrl', 'userInfo']),
@ -390,23 +429,9 @@ export default {
}, '/pages/users/order_list/index');
});
},
kefuClick() {
location.href = this.chatUrl;
},
openSubcribe: function(e) {
let page = e;
uni.showLoading({
title: '正在加载',
})
openOrderRefundSubscribe().then(res => {
uni.hideLoading();
uni.navigateTo({
url: page,
});
}).catch(() => {
uni.hideLoading();
});
},
// TODO
/**
* 拨打电话
*/
@ -442,17 +467,6 @@ export default {
this.codeImg = res.data.code
});
},
/**
*
* 剪切订单号
*/
// #ifndef H5
copy: function() {
uni.setClipboardData({
data: this.orderInfo.orderId
});
},
// #endif
/**
* 打电话
*/
@ -500,6 +514,14 @@ export default {
}
})
},
/**
* 打开支付组件
*/
goPay() {
uni.navigateTo({
url: `/pages/goods/cashier/index?order_id=${this.orderInfo.payOrderId}&from_type=order`
})
},
/**
* 删除订单
*/
@ -547,6 +569,41 @@ export default {
});
},
// ========== ==========
/**
* 跳转客服
*/
kefuClick() {
location.href = this.chatUrl;
},
/**
* 订阅并前往链接
*/
openSubcribe: function(page) {
uni.showLoading({
title: '正在加载',
})
openOrderRefundSubscribe().then(res => {
uni.hideLoading();
uni.navigateTo({
url: page,
});
}).catch(() => {
uni.hideLoading();
});
},
/**
*
* 剪切订单号
*/
// #ifndef H5
copy: function() {
uni.setClipboardData({
data: this.orderInfo.no
});
},
// #endif
fen2yuan(price) {
return Util.fen2yuan(price)
},
@ -554,7 +611,7 @@ export default {
return dayjs(date).format("YYYY-MM-DD HH:mm:ss");
}
}
}
}
</script>
<style scoped lang="scss">
.shuoming{

View File

@ -36,7 +36,7 @@
</view>
<view class='list'>
<view class='item' v-for="(order, index) in orderList" :key="index">
<view @click='goOrderDetails(order.orderId)'>
<view @click='goOrderDetails(order.id)'>
<view class='title acea-row row-between-wrapper'>
<view class="acea-row row-middle">
<text class="sign cart-color acea-row row-center-wrapper" v-if="order.typeName">{{ order.typeName }}</text>