<template>
|
<view class="box">
|
<view class="title">核销订单
|
<text v-if="info.orderStatus ==0" class="status status-b">待支付</text>
|
<text v-if="info.orderStatus ==1"class="status status-a" >{{info.receiveType==1?'待自提':'待发货'}}</text>
|
<text v-if="info.orderStatus ==2" class="status status-b">待收货</text>
|
<text v-if="info.orderStatus ==3" class="status status-b" >交易完成</text>
|
<text v-if="info.orderStatus ==4" class="status status-b">已取消</text>
|
<text v-if="info.orderStatus ==6"class="status status-b" >已退款</text>
|
</view>
|
<view class="item">
|
<view class="item-user">
|
<view class="item-user-image">
|
<image :src="info.member && info.member.imgFullUrl? info.member.imgFullUrl:'/static/icon/default.png'" mode="widthFix"></image>
|
</view>
|
<view class="item-user-info">
|
<text>{{info.linkName || ''}}</text>
|
<text>{{info.linkPhone || ''}}</text>
|
</view>
|
</view>
|
<view class="item-info">订单备注:{{info.memberInfo || ''}}</view>
|
</view>
|
<view class="item">
|
<view class="item-title">商品列表</view>
|
<template v-if="info.goodsorderDetailList && info.goodsorderDetailList.length">
|
<view class="row" v-for="(item, index) in info.goodsorderDetailList" :key="index" >
|
<view class="row-image">
|
<image :src="item.imgurl?item.imgurl:'/static/icon/default2.png'" mode="widthFix"></image>
|
</view>
|
<view class="row-info">
|
{{info.name || ''}}
|
</view>
|
<view class="row-price">
|
<text¥{{(info.price || 0).toFixed(2)}}</text>
|
<text>x{{info.goodsNum || 1}}</text>
|
</view>
|
</view>
|
</template>
|
</view>
|
<view style="width: 100%; height: calc(env(safe-area-inset-bottom) + 108rpx);"></view>
|
<view class="button" @click="confirm" v-if="info.orderStatus==1 && info.receiveType ==1">确认核销</view>
|
|
<u-popup :show="show" round="15" :safeAreaInsetBottom="false" mode="center">
|
<view class="tc">
|
<view class="tc-contemt">
|
<view class="tc-contemt-title">操作提醒</view>
|
<view class="tc-contemt-nr">
|
您确认核销该订单吗?
|
</view>
|
</view>
|
<view class="tc-btn">
|
<view class="tc-btn-item" @click="show = false; ">我再想想</view>
|
<view class="tc-btn-item" style="color: #004096;" @click="confirmDo">确认核销</view>
|
</view>
|
</view>
|
</u-popup>
|
<u-popup :show="show1" round="15" :safeAreaInsetBottom="false" mode="center">
|
<view class="tc">
|
<view class="tc-contemt">
|
<view class="tc-contemt-title">操作结果</view>
|
<view class="tc-contemt-nr">
|
核销成功,是否继续核销其他订单?
|
</view>
|
</view>
|
<view class="tc-btn">
|
<view class="tc-btn-item" @click="jumpBack ">返回</view>
|
<view class="tc-btn-item" style="color: #004096;" @click="jumpWriteoff()">继续核销</view>
|
</view>
|
</view>
|
</u-popup>
|
</view>
|
</template>
|
|
<script>
|
import QRCode from 'qrcode';
|
import { mapState } from 'vuex'
|
export default {
|
computed: {
|
...mapState(['navHeight', 'statusbarHeight','shopInfo', 'shopToken'])
|
},
|
data() {
|
return {
|
show:false,
|
show1:false,
|
shop:{},
|
id:null,
|
info:{}
|
};
|
},
|
onShow() {
|
this.show1 =false
|
this.show =false
|
this.info={}
|
this.shop ={}
|
this.checkShopLogin()
|
this.shop = this.shopInfo || {}
|
this.getShopDetail()
|
},
|
onLoad(options) {
|
this.id = options.id
|
},
|
methods:{
|
async confirmDo(){
|
this.show = !this.show
|
var that =this
|
var that =this
|
let res = await that.$u.api.writeOffOrder({ orderId: this.info.orderId });
|
if (res.code === 200 ) {
|
this.info.orderStatus = 3
|
this.show = false
|
this.show1 = true
|
uni.$emit('updateOrder',{info:this.info,delete:0})
|
}else{
|
}
|
},
|
jumpWriteoff(){
|
uni.navigateTo({
|
url: '/pagesA/pages/write-off/write-off'
|
})
|
},
|
jumpBack(){
|
uni.navigateBack({delta:1})
|
},
|
confirm(){
|
this.show = !this.show
|
},
|
async getShopDetail(){
|
var that =this
|
let res = await that.$u.api.shopOrderDetail({orderId:this.id,tokenType:1 })
|
if (res.code === 200) {
|
this.info = res.data
|
}
|
},
|
checkShopLogin(){
|
var that =this
|
if( this.shopInfo ==null || this.shopInfo.id==null || this.shopToken==null || this.shopToken==''){
|
uni.navigateTo({
|
url: '/pages/login/login'
|
})
|
}
|
},
|
}
|
}
|
</script>
|
|
<style>
|
page {
|
background-color: #F9F9FB;
|
}
|
</style>
|
<style lang="scss" scoped>
|
.box {
|
width: 100%;
|
padding: 30rpx;
|
box-sizing: border-box;
|
.button {
|
width: calc(100vw - 60rpx);
|
height: 88rpx;
|
line-height: 88rpx;
|
text-align: center;
|
background: #004096;
|
border-radius: 44rpx;
|
font-weight: 600;
|
font-size: 32rpx;
|
color: #FFFFFF;
|
position: fixed;
|
left: 30rpx;
|
bottom: calc(env(safe-area-inset-bottom) + 20rpx);
|
}
|
.title {
|
font-weight: 600;
|
font-size: 32rpx;
|
color: #111111;
|
.status{
|
padding: 0 6rpx;
|
height: 40rpx;
|
line-height: 40rpx;
|
border-radius: 8rpx;
|
font-weight: 400;
|
font-size: 22rpx;
|
color: #FFFFFF;
|
margin-right: 16rpx;
|
}
|
.status-a {
|
background: #00B775;
|
border: 1rpx solid #00B775;
|
}
|
.status-b {
|
background: #666666;
|
border: 1rpx solid #004096;
|
}
|
}
|
.item {
|
width: 100%;
|
padding: 30rpx;
|
box-sizing: border-box;
|
background: #FFFFFF;
|
border-radius: 16rpx;
|
margin-top: 30rpx;
|
.row {
|
width: 100%;
|
display: flex;
|
align-items: flex-start;
|
margin-top: 32rpx;
|
.row-image {
|
flex-shrink: 0;
|
margin-right: 20rpx;
|
width: 136rpx;
|
height: 136rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
overflow: hidden;
|
border-radius: 8rpx;
|
border: 1rpx solid #E5E5E5;
|
image {
|
width: 100%;
|
}
|
}
|
.row-info {
|
flex: 1;
|
font-weight: 400;
|
font-size: 30rpx;
|
color: #222222;
|
margin-right: 30rpx;
|
line-height: 42rpx;
|
}
|
.row-price {
|
flex-shrink: 0;
|
display: flex;
|
flex-direction: column;
|
text {
|
&:nth-child(1) {
|
font-weight: 500;
|
font-size: 30rpx;
|
color: #222222;
|
}
|
&:nth-child(2) {
|
font-weight: 400;
|
font-size: 24rpx;
|
color: #999999;
|
margin-top: 14rpx;
|
}
|
}
|
}
|
}
|
.item-title {
|
font-weight: 500;
|
font-size: 30rpx;
|
color: #222222;
|
}
|
.item-info {
|
width: 100%;
|
padding: 20rpx;
|
box-sizing: border-box;
|
background: #F8F9FB;
|
border-radius: 8rpx;
|
margin-top: 30rpx;
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #666666;
|
}
|
.item-user {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
.item-user-image {
|
flex-shrink: 0;
|
width: 80rpx;
|
height: 80rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
border-radius: 50%;
|
overflow: hidden;
|
margin-right: 20rpx;
|
image {
|
width: 100%;
|
}
|
}
|
.item-user-info {
|
flex: 1;
|
height: 80rpx;
|
display: flex;
|
flex-direction: column;
|
justify-content: space-between;
|
text {
|
&:nth-child(1) {
|
font-weight: 400;
|
font-size: 30rpx;
|
color: #222222;
|
}
|
&:nth-child(2) {
|
font-weight: 400;
|
font-size: 24rpx;
|
color: #999999;
|
}
|
}
|
}
|
}
|
}
|
}
|
</style>
|