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

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

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

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

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

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-05-09 14:41:37
* @LastEditors: ch
* @LastEditTime: 2022-05-12 10:43:37
* @LastEditTime: 2022-05-16 14:46:43
* @Description: file content
-->
<template>
@ -99,7 +99,7 @@ export default {
icon: require('@/assets/img/account/order/order_status_5.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.active = true;
}

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

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

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-05-04 17:30:58
* @LastEditors: ch
* @LastEditTime: 2022-05-12 09:58:47
* @LastEditTime: 2022-05-16 16:01:17
* @Description: file content
-->
@ -18,7 +18,7 @@
<h3 class="title">确认商品信息</h3>
<OrderInfo :products="orderInfo.products" />
<Message :orderInfo="orderInfo" :message.sync="userMessage"/>
<Amount :amount="orderInfo.payAmount"/>
<Amount :amount="orderInfo.payAmount" :address="address"/>
<div class="pay">
<UiButton radius type="red_panel" @click="submit"></UiButton>
</div>
@ -27,7 +27,7 @@
</div>
</template>
<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 UIGoodsInfo from '../../../components/UIGoodsInfo.vue';
import OrderInfo from './module/OrderInfo.vue';
@ -116,9 +116,31 @@ export default {
}
this.payVisible = true;
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(){
this.$router.replace(`/account/order/detail?id=${this.payOrder.orderId}`)
this.$router.replace(`/account/order/detail?id=${this.payOrder.orderId}`);
},
finishPay(){
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
* @Date: 2022-05-08 16:12:18
* @LastEditors: ch
* @LastEditTime: 2022-05-08 16:14:57
* @LastEditTime: 2022-05-16 15:41:08
* @Description: file content
-->
<template>
<div class="amount">
<div>
<span>应付款</span>
<b>{{amount}}</b>
<UiMoney class="money" size="20px" preSize="14px" sufSize="14px" :money="amount" float prefix suffix/>
</div>
<p>北京市XXXXX区XXXX路xxxxxx小区XXX单元</p>
<p>卖火柴的灰姑凉 18888888888</p>
<p>{{address.province + address.city + address.area + address.detailAddress}}</p>
<p>{{address.name}} {{address.phone}}</p>
</div>
</template>
<script>
import UiMoney from '../../../../components/UiMoney.vue'
export default {
components: { UiMoney },
props : {
amount : {
type : Number,
@ -37,8 +39,11 @@ export default {
text-align: right;
padding: 20px 40px;
margin-top: 10px;
b{
font-size: 20px;
.money{
font-size: 0;
color: #FF512B;
display: inline-block;
font-weight: bold;
}
p{
font-size: 12px;

Loading…
Cancel
Save