Merge branch 'feature/task1.0.0-0505-ch' into feature/task1.0.0

merge-requests/64/head
ch 2 years ago
commit 5b5710caa9

@ -2,14 +2,13 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-08 14:41:42 * @Date: 2022-05-08 14:41:42
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-12 14:37:00 * @LastEditTime: 2022-05-16 16:13:11
* @Description: file content * @Description: file content
--> -->
<template> <template>
<div class="ui-goods-info" @click="$router.push(`/goods/detail/${goods.productId}`)"> <div class="ui-goods-info" @click="$router.push(`/goods/detail/${goods.productId}`)">
<div class="ui-goods-info--img"> <div class="ui-goods-info--img"
<img :src="goods.productImageUrl || goods.productMainPicture"/> :style="`background-image:url(${goods.productImageUrl || goods.productMainPicture})`"></div>
</div>
<p> <p>
<b>{{goods.productName}}</b> <b>{{goods.productName}}</b>
<span>{{goods.skuDescribe}}</span> <span>{{goods.skuDescribe}}</span>
@ -34,6 +33,9 @@ export default {
width: 100px; width: 100px;
height: 100px; height: 100px;
border: 1px solid #eee; border: 1px solid #eee;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
} }
p{ p{
width: 270px; width: 270px;

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-09 15:52:51 * @Date: 2022-05-09 15:52:51
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-10 13:50:29 * @LastEditTime: 2022-05-16 14:43:24
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -19,11 +19,11 @@
</p> </p>
<p> <p>
<label>收货地址</label> <label>收货地址</label>
<span>{{logisitcsInfo.recipientAddress}}{{logisitcsInfo.recipientAddress}}{{logisitcsInfo.recipientAddress}}</span> <span>{{logisitcsInfo.recipientAddress}}</span>
</p> </p>
</div> </div>
</UiLineBox> </UiLineBox>
<UiLineBox class="logisitcs--list" v-if="logisitcsList.length"> <UiLineBox class="logisitcs--list" v-if="orderInfo.orderStatus >= 4">
<div slot="head" class="title"> <div slot="head" class="title">
<b>物流信息</b> <b>物流信息</b>
<span>{{logisitcsInfo.companyName}}<small>{{logisitcsInfo.trackingNo}}</small></span> <span>{{logisitcsInfo.companyName}}<small>{{logisitcsInfo.trackingNo}}</small></span>

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-09 14:41:37 * @Date: 2022-05-09 14:41:37
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-12 11:08:57 * @LastEditTime: 2022-05-16 16:40:50
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -24,6 +24,7 @@
</div> </div>
</template> </template>
<script> <script>
import {ApiPutOrderReceive} from '@/plugins/api/order';
import BsPay from '@/components/BsPay.vue' import BsPay from '@/components/BsPay.vue'
import UiButton from '@/components/UiButton.vue' import UiButton from '@/components/UiButton.vue'
import BsCancelOrder from '../../../../../../components/BsCancelOrder.vue' import BsCancelOrder from '../../../../../../components/BsCancelOrder.vue'
@ -45,7 +46,7 @@ export default {
// //
'3' : {name:'等待发货', tips:'您的包裹整装待发'}, '3' : {name:'等待发货', tips:'您的包裹整装待发'},
// //
'4' : {name:'已发货', tips:'您的包裹正向您飞来'}, '4' : {name:'待收货', tips:'您的包裹正向您飞来'},
// //
'5' : {name:'已收货'}, '5' : {name:'已收货'},
// //
@ -61,7 +62,7 @@ export default {
}, },
watch : { watch : {
orderInfo(nVal){ orderInfo(nVal){
const {orderStatus} = this.orderInfo; const {orderStatus, autoReceiveTime, serverTime} = this.orderInfo;
this.ctxCon = this.ctxData[orderStatus]; this.ctxCon = this.ctxData[orderStatus];
if(orderStatus === 1){ if(orderStatus === 1){
@ -72,14 +73,25 @@ export default {
this.calcTimerStartSecondNum(); this.calcTimerStartSecondNum();
this.timer(); this.timer();
}else if(orderStatus === 4){
const receiveTime = (new Date(autoReceiveTime.replace(/-/g,'/'))).getTime();
const curTime = (new Date(serverTime.replace(/-/g,'/'))).getTime();
const minute = parseInt((receiveTime - curTime) / 60000);
const day = parseInt(Math.floor(minute / 1440));
const hour = parseInt(Math.floor((minute - day * 1440) / 60));
const m = parseInt(Math.floor(minute - ((day * 24 + hour) * 60)));
let str = `${day ? `${day}${hour}${m}` : (hour ? `${hour}${m}` : ( m ? `${m}` : '1分'))}`;
this.ctxCon.tips = `${str}后,将自动确认收货`
}else if(orderStatus === 2){ }else if(orderStatus === 2){
this.ctxCon.tips = this.orderInfo.cancelReason; this.ctxCon.tips = this.orderInfo.cancelReason;
} }
} }
}, },
methods:{ methods:{
/** /**
* 计算倒计时开始秒数 * 计算待支付倒计时开始秒数
*/ */
calcTimerStartSecondNum(){ calcTimerStartSecondNum(){
let expireTime = (new Date(this.orderInfo.expireTime.replace(/-/g,'/'))).getTime(), let expireTime = (new Date(this.orderInfo.expireTime.replace(/-/g,'/'))).getTime(),
@ -124,7 +136,11 @@ export default {
}); });
}, },
emitStatus(){ emitStatus(){
this.$emit('changeStatus') //
if(this.timerStop){
clearTimeout(this.timerStop);
}
this.$emit('changeStatus');
} }
} }

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-09 14:41:37 * @Date: 2022-05-09 14:41:37
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-12 10:43:37 * @LastEditTime: 2022-05-16 14:46:43
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -99,7 +99,7 @@ export default {
icon: require('@/assets/img/account/order/order_status_5.png'), icon: require('@/assets/img/account/order/order_status_5.png'),
iconActive : require('@/assets/img/account/order/order_status_5_active.png') iconActive : require('@/assets/img/account/order/order_status_5_active.png')
} }
if(lastLog.id === 8){ if(lastLog.operationType === 8){
lastStep.createTime = lastLog.createTime; lastStep.createTime = lastLog.createTime;
lastStep.active = true; lastStep.active = true;
} }

@ -2,12 +2,12 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-04 20:47:29 * @Date: 2022-05-04 20:47:29
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-12 16:55:56 * @LastEditTime: 2022-05-16 16:14:47
* @Description: file content * @Description: file content
--> -->
<template> <template>
<div class="main"> <div class="main">
<Tab :active="tabActive" @change="changeTab"></Tab> <Tab :active="tabActive" @change="changeTab" ref="tab"></Tab>
<UiLoading v-if="loading"></UiLoading> <UiLoading v-if="loading"></UiLoading>
<UiEmpty v-if="!orderTotal && !loading" desc="暂无订单数据" :icon="require('@/assets/img/account/order/empty.png')"> <UiEmpty v-if="!orderTotal && !loading" desc="暂无订单数据" :icon="require('@/assets/img/account/order/empty.png')">
<UiButton type="grey" @click="$router.push('/')"></UiButton> <UiButton type="grey" @click="$router.push('/')"></UiButton>
@ -39,22 +39,25 @@
<td class="not-border"> <td class="not-border">
<UIGoodsInfo :goods="i"/> <UIGoodsInfo :goods="i"/>
</td> </td>
<td class="not-border" width="96">{{i.realAmount}}</td> <td class="not-border" width="96">
<UiMoney :money="i.realAmount" />
</td>
<td class="not-border" width="96">{{i.quantity}}</td> <td class="not-border" width="96">{{i.quantity}}</td>
<template v-if="!idx"> <template v-if="!idx">
<td width="120" :rowspan="item.products.length">{{item.payAmount}}</td> <td width="120" :rowspan="item.products.length">
<UiMoney :money="item.payAmount" />
</td>
<td width="110" :rowspan="item.products.length">{{item.orderStatusDesc}}</td> <td width="110" :rowspan="item.products.length">{{item.orderStatusDesc}}</td>
<td width="145" :rowspan="item.products.length"> <td width="145" :rowspan="item.products.length">
<template v-if="item.orderStatus === 1"> <template v-if="item.orderStatus === 1">
<UiButton type="yellow_gradual" @click="pay(item)"></UiButton> <UiButton type="yellow_gradual" @click="pay(item)"></UiButton>
<span class="link-btn" @click="canvelPay(item)"></span> <span class="link-btn" @click="cancelPay(item)"></span>
</template> </template>
<router-link :to="`./detail?id=${item.orderId}`" v-if="item.orderStatus > 4"></router-link> <router-link :to="`./detail?id=${item.orderId}`" v-if="item.orderStatus > 4"></router-link>
<template v-if="item.orderStatus === 4"> <template v-if="item.orderStatus === 4">
<UiButton type="yellow_gradual" @click="receive(item)"></UiButton> <UiButton type="yellow_gradual" @click="receive(item)"></UiButton>
<router-link class="link-btn" :to="`./detail?id=${item.orderId}`">查看物流</router-link> <router-link class="link-btn" :to="`./detail?id=${item.orderId}`">查看物流</router-link>
</template> </template>
</td> </td>
</template> </template>
</tr> </tr>
@ -67,8 +70,8 @@
</template> </template>
<BsCancelOrder :visible.sync="cancelVisible" :orderId="operationOrder.orderId"/> <BsCancelOrder :visible.sync="cancelVisible" :orderId="operationOrder.orderId" @cancel="reloadData"/>
<BsPay :visible.sync="payVisible" :orderId="operationOrder.orderId" @finish="getOrderList"/> <BsPay :visible.sync="payVisible" :orderId="operationOrder.orderId" @finish="reloadData"/>
</div> </div>
</template> </template>
<script> <script>
@ -81,8 +84,9 @@ import UIGoodsInfo from '@/components/UIGoodsInfo.vue';
import UiLineBox from '@/components/UiLineBox.vue'; import UiLineBox from '@/components/UiLineBox.vue';
import Tab from './module/Tab.vue'; import Tab from './module/Tab.vue';
import UiLoading from '../../../../../components/UiLoading.vue'; import UiLoading from '../../../../../components/UiLoading.vue';
import UiMoney from '../../../../../components/UiMoney.vue';
export default { export default {
components: { UiLineBox, UIGoodsInfo, Tab, UiButton, BsPay, UiEmpty, BsCancelOrder, UiLoading }, components: { UiLineBox, UIGoodsInfo, Tab, UiButton, BsPay, UiEmpty, BsCancelOrder, UiLoading, UiMoney },
data(){ data(){
return { return {
tabActive : this.$route.query.type || -1, tabActive : this.$route.query.type || -1,
@ -114,6 +118,9 @@ export default {
this.getOrderList(); this.getOrderList();
}, },
/**
* 查询订单列表
*/
async getOrderList(){ async getOrderList(){
this.loading = true; this.loading = true;
const {error, result} = await ApiGetOrderList({ const {error, result} = await ApiGetOrderList({
@ -129,30 +136,38 @@ export default {
this.orderList = result.records; this.orderList = result.records;
this.orderTotal = result.total this.orderTotal = result.total
}, },
/**
* 重新加载数据确认收货和取消支付订单这些操作完成后需要
*/
reloadData(){
this.getOrderList();
this.$refs.tab.getOrderStatistics();
},
pay(item){ pay(item){
this.operationOrder = item; this.operationOrder = item;
this.payVisible = true; this.payVisible = true;
}, },
canvelPay(item){ cancelPay(item){
this.operationOrder = item; this.operationOrder = item;
this.cancelVisible = true; this.cancelVisible = true;
}, },
receive(){ receive(item){
this.$confirm('确认已经收到货了吗?', '提示', { this.$confirm('确认已经收到货了吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(async () => { }).then(async () => {
const {error} = await ApiPutOrderReceive({orderId : this.operationOrder.orderId}); const {error} = await ApiPutOrderReceive({orderId : item.orderId});
if(error){ if(error){
uni.$toast(error.message); this.$$message.error(error.message);
return false; return false;
} }
this.$message({ this.$message({
type: 'success', type: 'success',
message: '成功收货!' message: '成功收货!'
}); });
this.emitStatus() this.reloadData()
}); });
}, },
} }

@ -2,16 +2,16 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-03 22:41:15 * @Date: 2022-05-03 22:41:15
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-12 19:40:43 * @LastEditTime: 2022-05-16 16:50:09
* @Description: file content * @Description: file content
--> -->
<template> <template>
<div> <div>
<UiLoading v-if="isLoading" ></UiLoading>
<UiEmpty v-if="!isLoading && !list.length" desc="购物车空空如也,去挑点喜欢的好货吧~" <UiEmpty v-if="!isLoading && !list.length" desc="购物车空空如也,去挑点喜欢的好货吧~"
:icon="require('@/assets/img/cart/empty.png')"> :icon="require('@/assets/img/cart/empty.png')">
<UiButton type="grey" @click="$router.push('/')"></UiButton> <UiButton type="grey" @click="$router.push('/')"></UiButton>
</UiEmpty> </UiEmpty>
<UiLoading v-if="isLoading" ></UiLoading>
<div class="main" v-else> <div class="main" v-else>
<table class="table table--head"> <table class="table table--head">
<thead> <thead>
@ -59,7 +59,7 @@
<div class="operation"> <div class="operation">
<div> <div>
<el-checkbox label="全选" @change="handleCheckAll" v-model="checkAll" :indeterminate="isIndeterminate" /> <el-checkbox label="全选" @change="handleCheckAll" v-model="checkAll" :indeterminate="isIndeterminate" />
<a @click="handleDelete()" class="operation--del">批量删</a> <a class="operation--del" href="javascript:void" @click="handleDelete()" v-if="checkedIds.length"></a>
</div> </div>
<div class="operation--right"> <div class="operation--right">
<p>已选<span class="operation--count">{{checkedIds.length}}</span></p> <p>已选<span class="operation--count">{{checkedIds.length}}</span></p>

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-04 17:30:58 * @Date: 2022-05-04 17:30:58
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-12 09:58:47 * @LastEditTime: 2022-05-16 16:01:17
* @Description: file content * @Description: file content
--> -->
@ -18,7 +18,7 @@
<h3 class="title">确认商品信息</h3> <h3 class="title">确认商品信息</h3>
<OrderInfo :products="orderInfo.products" /> <OrderInfo :products="orderInfo.products" />
<Message :orderInfo="orderInfo" :message.sync="userMessage"/> <Message :orderInfo="orderInfo" :message.sync="userMessage"/>
<Amount :amount="orderInfo.payAmount"/> <Amount :amount="orderInfo.payAmount" :address="address"/>
<div class="pay"> <div class="pay">
<UiButton radius type="red_panel" @click="submit"></UiButton> <UiButton radius type="red_panel" @click="submit"></UiButton>
</div> </div>
@ -27,7 +27,7 @@
</div> </div>
</template> </template>
<script> <script>
import {ApiPostSubmitOrder, ApiGetBeforeOrder, ApiGetBeforeCartOrder} from '@/plugins/api/order'; import {ApiPostSubmitOrder, ApiGetBeforeOrder, ApiGetBeforeCartOrder, ApiGetOrderPaySatus} from '@/plugins/api/order';
import BsPay from '../../../components/BsPay.vue'; import BsPay from '../../../components/BsPay.vue';
import UIGoodsInfo from '../../../components/UIGoodsInfo.vue'; import UIGoodsInfo from '../../../components/UIGoodsInfo.vue';
import OrderInfo from './module/OrderInfo.vue'; import OrderInfo from './module/OrderInfo.vue';
@ -116,9 +116,31 @@ export default {
} }
this.payVisible = true; this.payVisible = true;
this.payOrder = result; this.payOrder = result;
setTimeout(()=>{
this.getOrderPayStatus();
}, 5000)
},
/**
* 查询订单支付状态提交订单成功后每隔5秒调一次跳到支付结果页
*/
async getOrderPayStatus(){
const {error, result} = await ApiGetOrderPaySatus({orderId : this.payOrder.orderId});
if(error){
this.$router.replace(`/account/order/detail?id=${this.payOrder.orderId}`);
return false
}
if(!result.isSuccess){
setTimeout(()=>{
this.getOrderPayStatus();
}, 5000)
return false;
}
this.$router.replace(`/order/payResult?id=${this.payOrder.orderId}`)
}, },
cancelPay(){ cancelPay(){
this.$router.replace(`/account/order/detail?id=${this.payOrder.orderId}`) this.$router.replace(`/account/order/detail?id=${this.payOrder.orderId}`);
}, },
finishPay(){ finishPay(){
this.$router.replace(`/order/payResult?id=${this.payOrder.orderId}`) this.$router.replace(`/order/payResult?id=${this.payOrder.orderId}`)

@ -1,22 +0,0 @@
<!--
* @Author: ch
* @Date: 2022-05-04 17:35:44
* @LastEditors: ch
* @LastEditTime: 2022-05-04 17:38:31
* @Description: file content
-->
<template>
<div>我是地址模块</div>
</template>
<script>
export default {
data(){
return {
}
}
}
</script>
<style lang="scss" scoped>
</style>

@ -2,21 +2,23 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-08 16:12:18 * @Date: 2022-05-08 16:12:18
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-08 16:14:57 * @LastEditTime: 2022-05-16 15:41:08
* @Description: file content * @Description: file content
--> -->
<template> <template>
<div class="amount"> <div class="amount">
<div> <div>
<span>应付款</span> <span>应付款</span>
<b>{{amount}}</b> <UiMoney class="money" size="20px" preSize="14px" sufSize="14px" :money="amount" float prefix suffix/>
</div> </div>
<p>北京市XXXXX区XXXX路xxxxxx小区XXX单元</p> <p>{{address.province + address.city + address.area + address.detailAddress}}</p>
<p>卖火柴的灰姑凉 18888888888</p> <p>{{address.name}} {{address.phone}}</p>
</div> </div>
</template> </template>
<script> <script>
import UiMoney from '../../../../components/UiMoney.vue'
export default { export default {
components: { UiMoney },
props : { props : {
amount : { amount : {
type : Number, type : Number,
@ -37,8 +39,11 @@ export default {
text-align: right; text-align: right;
padding: 20px 40px; padding: 20px 40px;
margin-top: 10px; margin-top: 10px;
b{ .money{
font-size: 20px; font-size: 0;
color: #FF512B;
display: inline-block;
font-weight: bold;
} }
p{ p{
font-size: 12px; font-size: 12px;

Loading…
Cancel
Save