订单相关修改提测
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="navtab flex-center">
|
||||
<!-- <view class="navtab flex-center">
|
||||
<view class="navtabpost flex-center">
|
||||
<view :class="navtabindex == 0 ? 'navtabone':'navtabtow'" @click="navtabclick(0)">
|
||||
到店订单
|
||||
@@ -9,46 +9,33 @@
|
||||
团购订单
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-sticky bgColor="#fff">
|
||||
</view> -->
|
||||
<u-sticky >
|
||||
<view class="tab-wrap">
|
||||
<block v-if="navtabindex==1">
|
||||
<view class="item" v-for="(item, index) in tabs2" :key="index" @click="orderswitch(item,index)">
|
||||
<text>{{ item.name }}</text>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<block v-if="navtabindex==0">
|
||||
<view class="item" v-for="(item, index) in tabs" :key="index" @click="orderswitch(item,index)">
|
||||
<text>{{ item.name }}</text>
|
||||
</view>
|
||||
</block>
|
||||
<view class="line-wrap"
|
||||
:style="{ left: `${(100 / tabs.length) * active}%`, width: `${100 / tabs.length}%` }">
|
||||
<view class="line">
|
||||
<image style="width:40rpx; height: 10rpx;"
|
||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/dgs.png"
|
||||
mode="aspectFill">
|
||||
</image>
|
||||
</view>
|
||||
<view class="item" :class="{'active':active == index}" v-for="(item, index) in tabs" :key="index" @click="orderswitch(item,index)">
|
||||
<text>{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-sticky>
|
||||
<view class="list-wrap" v-if="navtabindex == 0">
|
||||
<view class="list-wrap" v-if="!is_end">
|
||||
<view class="item" v-for="(item,index) in list" :key="index" @click="orderinfo(item)">
|
||||
<view class="header-wrap">
|
||||
<text v-if="item.sendType == 'post'">快递</text>
|
||||
<text v-if="item.sendType == 'takeaway'">外卖</text>
|
||||
<text v-if="item.sendType == 'takeself'">自提</text>
|
||||
<text v-if="item.sendType == 'table'">堂食</text>
|
||||
<view class="header-wrap-left">
|
||||
<text class="sendType" v-if="item.sendType == 'post'">快递</text>
|
||||
<text class="sendType" v-if="item.sendType == 'takeaway'">外卖</text>
|
||||
<text class="sendType" v-if="item.sendType == 'takeself'">自提</text>
|
||||
<text class="sendType" v-if="item.sendType == 'table'">堂食</text>
|
||||
<text class="shopName"> {{ item.shopName || ''}} </text>
|
||||
</view>
|
||||
|
||||
<text class="status" v-if="item.status == 'unpaid' || item.status == 'paying'">
|
||||
<text>待支付</text>
|
||||
<text style="color: #333;">待付款</text>
|
||||
</text>
|
||||
<text class="status" v-if="item.status == 'unsend'">
|
||||
<text>待发货</text>
|
||||
</text>
|
||||
<text class="status" v-if="item.status == 'closed'">
|
||||
<text>订单完成</text>
|
||||
<text>已完成</text>
|
||||
</text>
|
||||
<text class="status" v-if="item.status == 'send'">
|
||||
<text> 已发</text>
|
||||
@@ -67,32 +54,27 @@
|
||||
</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view></view>
|
||||
<view class="intro-wrap">
|
||||
下单日期:{{$u.timeFormat(item.createdAt, 'yyyy-mm-dd hh:MM')}}
|
||||
</view>
|
||||
<view class="shop-info">
|
||||
<view class="shop-item">
|
||||
<view class="cover flex-start" v-for="(item1,index1) in item.detailList" :key="index1">
|
||||
<!-- <image :src="item1.productImg" style="width: 200rpx;height: 200rpx; border-radius: 20rpx;" mode="widthFix"></image> -->
|
||||
<c-image width="200" height="200" radius="20" :src="item1.productImg"></c-image>
|
||||
<view class="cover" v-for="(item1,index1) in item.detailList" :key="index1">
|
||||
<u-image width="112" height="112" radius="20" :src="item1.productImg"></u-image>
|
||||
<text class="productName"> {{ item1.productName }} </text>
|
||||
</view>
|
||||
<!-- <view class="info">
|
||||
<text class="name">美味大宅蟹</text>
|
||||
<text class="num">数量:1</text>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="shop-amount">
|
||||
<text class="orderAmount">¥{{item.orderAmount}}</text>
|
||||
<text class="totalNumber">共{{item.totalNumber}}件</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="total" v-if="item.status != 'cancelled'">
|
||||
<text class="t">{{item.description}}</text>
|
||||
<text class="i">¥</text>
|
||||
<text class="num">{{item.orderAmount}}</text>
|
||||
</view>
|
||||
<view class="intro-wrap">
|
||||
<text class="time">下单日期:{{$u.timeFormat(item.createdAt, 'yyyy-mm-dd hh:MM')}}</text>
|
||||
<text class="intro num">共{{item.totalNumber}}件商品 合计:¥{{item.orderAmount}}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="footer-wrap">
|
||||
<view class="btn">
|
||||
<text>查看详情</text>
|
||||
</view>
|
||||
<view class="btn" @click.stop="$u.debounce(isRemoveOrder(item,index),1000)" v-if="item.status != 'unpaid' && item.status != 'paying'"> 删除订单 </view>
|
||||
<view class="btn s" @click.stop="$u.debounce(showpopupclick(item),1000)" v-if="item.status == 'unpaid' || item.status == 'paying'"> 去付款 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -120,8 +102,9 @@
|
||||
<button v-if="item.status=='unpaid'" type="primary" class="buttonStyle">去付款</button>
|
||||
</view>
|
||||
</view>
|
||||
<image style="margin:32rpx auto;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png"
|
||||
v-if="is_end" mode="aspectFill"></image>
|
||||
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png"
|
||||
v-if="list.length <= 0 " mode="aspectFill"></image>
|
||||
<u-modal width="450rpx" :show="removeOrderShow" @confirm="$u.debounce(removeOrder(),1000)" @cancel="removeOrderShow = false" @close="removeOrderShow = false" :showCancelButton="true" :closeOnClickOverlay="true" :title="'是否删除当前订单'" ></u-modal>
|
||||
<u-loadmore :status="form.status" fontSize="28" color="#999" iconSize="28" />
|
||||
</view>
|
||||
</template>
|
||||
@@ -155,7 +138,7 @@
|
||||
status: 'closed'
|
||||
},
|
||||
{
|
||||
name: '退款',
|
||||
name: '退款/售后',
|
||||
type: 5,
|
||||
status: 'refund'
|
||||
},
|
||||
@@ -196,6 +179,9 @@
|
||||
size: 10,
|
||||
status: 'loadmore',
|
||||
},
|
||||
removeOrderShow: false,
|
||||
orderItem: null,
|
||||
orderIndex: 0,
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
@@ -295,24 +281,103 @@
|
||||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
setTimeout(() => {
|
||||
if (this.form.page == 1) {
|
||||
console.log(111)
|
||||
this.list = res.data.list
|
||||
} else {
|
||||
console.log(222)
|
||||
this.list = [...this.list, ...res.data.list];
|
||||
}
|
||||
this.form.page = ++this.form.page;
|
||||
if (this.form.page > res.data.pages) {
|
||||
this.form.status = 'nomore';
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
}
|
||||
}, 500)
|
||||
if (this.form.page == 1) {
|
||||
this.list = res.data.list
|
||||
} else {
|
||||
this.list = [...this.list, ...res.data.list];
|
||||
}
|
||||
this.form.page = ++this.form.page;
|
||||
if (this.form.page > res.data.pages) {
|
||||
this.form.status = 'nomore';
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
isRemoveOrder ( item , index ) {
|
||||
this.removeOrderShow = true;
|
||||
this.orderItem = item;
|
||||
this.orderIndex = index;
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*/
|
||||
async removeOrder () {
|
||||
let res = await this.api.removeOrder({
|
||||
orderId: this.orderItem.id,
|
||||
})
|
||||
if ( res.code == 0 ) {
|
||||
this.removeOrderShow = false;
|
||||
this.list.splice(this.orderIndex , 1 )
|
||||
uni.showToast({
|
||||
title: "删除成功",
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 立即付款
|
||||
*/
|
||||
async showpopupclick(item) {
|
||||
let res = await this.api.payorderPay({
|
||||
orderId: item.id,
|
||||
}) //判断是否支付成功
|
||||
if (res.code == 0) {
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay', //支付类型-固定值
|
||||
partnerid: res.data.appId, // 微信支付商户号
|
||||
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
|
||||
nonceStr: res.data.nonceStr, // 随机字符串
|
||||
package: res.data.package, // 固定值
|
||||
signType: res.data.signType, //固定值
|
||||
paySign: res.data.paySign, //签名
|
||||
success: (res) => {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
})
|
||||
setTimeout(res => {
|
||||
uni.hideLoading()
|
||||
uni.switchTab({
|
||||
url: '/pages/order/order'
|
||||
});
|
||||
}, 500)
|
||||
this.paymodfiyOrderInfo()
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '支付失败'
|
||||
})
|
||||
setTimeout(res => {
|
||||
uni.hideLoading()
|
||||
uni.switchTab({
|
||||
url: '/pages/order/order'
|
||||
});
|
||||
}, 500)
|
||||
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 支付完成后请求
|
||||
*/
|
||||
async paymodfiyOrderInfo() {
|
||||
let res = await this.api.paymodfiyOrderInfo({
|
||||
orderId: this.listinfo.orderId,
|
||||
})
|
||||
},
|
||||
|
||||
async getorderList() {
|
||||
let res = await this.api.groupOrderInfo({
|
||||
page: this.form.page,
|
||||
@@ -339,17 +404,17 @@
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
$tabH: 80upx;
|
||||
$color: #ff411d;
|
||||
|
||||
|
||||
page {
|
||||
background: #f6f6f6;
|
||||
// background: #f6f6f6;
|
||||
}
|
||||
|
||||
.navtab {
|
||||
@@ -393,51 +458,43 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.tab-wrap {
|
||||
display: flex;
|
||||
position: relative;
|
||||
background: #ffd158;
|
||||
padding: 48rpx 0 72rpx 0;
|
||||
|
||||
background: #fff;
|
||||
padding: 40rpx 46rpx;
|
||||
border-radius: 0rpx 0rpx 34rpx 34rpx;
|
||||
.item {
|
||||
flex: 1;
|
||||
flex: auto;
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
||||
text {
|
||||
color: #fff;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.item.active{
|
||||
text{
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
||||
.line-wrap {
|
||||
position: absolute;
|
||||
bottom: 48rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding-bottom: 8upx;
|
||||
transition: all 0.3s ease-in-out;
|
||||
|
||||
.line {
|
||||
$h: 6upx;
|
||||
margin-top: 6rpx;
|
||||
// width: 30%;
|
||||
// height: $h;
|
||||
border-radius: $h;
|
||||
// background-color: $color;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.list-wrap {
|
||||
padding: $paddingSize;
|
||||
padding: 0 28rpx 48rpx 28rpx;
|
||||
position: relative;
|
||||
margin-top: -24rpx;
|
||||
z-index: 99999;
|
||||
background: #f6f6f6;
|
||||
margin-top: 48rpx;
|
||||
border-radius: 24rpx 24rpx 0rpx 0rpx;
|
||||
|
||||
.item {
|
||||
@@ -445,98 +502,122 @@
|
||||
background-color: #fff;
|
||||
|
||||
&:not(:first-child) {
|
||||
margin-top: $paddingSize;
|
||||
margin-top: 48rpx;
|
||||
}
|
||||
|
||||
.header-wrap {
|
||||
padding: $paddingSize;
|
||||
border-bottom: 1upx solid #ececec;
|
||||
padding: 16rpx 18rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
align-items: center;
|
||||
.header-wrap-left{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.sendType{
|
||||
height: 48rpx;
|
||||
line-height: 48rpx;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #E3AD7F;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
border: 2rpx solid #E3AD7F;
|
||||
margin-right: 24rpx;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
.shopName{
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.status {
|
||||
color: $color;
|
||||
text{
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: $paddingSize;
|
||||
padding: 0 18rpx 18rpx 18rpx;
|
||||
|
||||
.shop-info {
|
||||
display: flex;
|
||||
.shop-item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
overflow-x: scroll;
|
||||
|
||||
.cover:nth-child(1) {
|
||||
margin-left: 0rpx;
|
||||
}
|
||||
|
||||
.cover {
|
||||
|
||||
// white-space: nowrap;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
padding-left: 20upx;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
.productName{
|
||||
flex-shrink: 0;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.total {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: flex-end;
|
||||
|
||||
.t {
|
||||
font-weight: bold;
|
||||
font-size: 32upx;
|
||||
}
|
||||
|
||||
.i {
|
||||
font-size: 24upx;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 38upx;
|
||||
position: relative;
|
||||
top: 8upx;
|
||||
.shop-amount{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: flex-end;
|
||||
flex-shrink: 0;
|
||||
padding-left: 20rpx;
|
||||
.orderAmount{
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 22rpx;
|
||||
}
|
||||
.totalNumber{
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.intro-wrap {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-top: $paddingSize;
|
||||
|
||||
.time {
|
||||
color: #999;
|
||||
font-size: 24upx;
|
||||
}
|
||||
|
||||
.intro {
|
||||
font-size: 24upx;
|
||||
}
|
||||
font-weight: 400;
|
||||
color: #666;
|
||||
font-size: 24upx;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.footer-wrap {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
border-top: 1upx solid #ececec;
|
||||
padding: $paddingSize;
|
||||
|
||||
padding: 0 18rpx 32rpx 18rpx;
|
||||
|
||||
.btn {
|
||||
padding: 8upx 24upx;
|
||||
border-radius: 100upx;
|
||||
border: 1px solid #333;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 128rpx;
|
||||
height: 48rpx;
|
||||
line-height: 43rpx;
|
||||
text-align: center;
|
||||
background: #FFFFFF;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
border: 2rpx solid #EDEDED;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
margin-left: 32rpx;
|
||||
}
|
||||
|
||||
.s{
|
||||
background: #343030;
|
||||
border: 2rpx solid #EDEDED;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user