You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong_qianduan/pages/news3/sendOutGoods.vue

329 lines
6.5 KiB

10 months ago
<template>
<view class="updatePrice">
<view class="dispatchContent">
<view class="orderNum">
订单号{{orderInfo.order_no}}
</view>
<view class="dispatchItem" v-for="item in orderInfo.goods">
<image :src="item.goods_image" mode="aspectFill"></image>
<view class="right">
<view class="title">
{{item.goods_name}}
</view>
<view class="subTitle" v-for="p in item.goods_props" :key="p.group">
{{p.group.name}}:{{p.value.name}}
</view>
<view class="num">
x{{item.total_num}}
</view>
<view class="price">
<text style="font-size: 26upx;">¥</text>
<text>{{item.total_price}}</text>
</view>
10 months ago
</view>
</view>
10 months ago
</view>
<view class="selectContent" style="border:none;background-color: #fff;">
<picker @change="changeOption" mode="selector" range-key="express_name" :value="index" :range="wlList">
<u-field v-model="expressName" :disabled="true" label="物流公司" placeholder="请选择物流公司"
right-icon="arrow-right">
</u-field>
</picker>
<view class="scan">
<u-field style="flex: 1;padding:30upx 0 30upx 30upx" v-model="codeNum" label="物流单号"
placeholder="请填写物流单号">
</u-field>
<image :src="$picUrl+'/static/news3/scan.png'" @click="scanCode" mode=""></image>
10 months ago
</view>
<view class="footerBtn" @click="onCheck" v-if="source==1">
<view class="wuliuBtn">
物流链接
</view>
10 months ago
</view>
</view>
<view class="goods-fd">
<view class="btn" @click="sendGoodsHandle">{{source==1?'保存修改':'确认发货'}}</view>
</view>
10 months ago
</view>
</template>
<script>
import * as newFunApi from '@/api/newFun'
export default {
data() {
return {
modifyInfo: false,
newPrice: null,
wlList: [
],
codeNum: '',
orderInfo: {},
expressList: [],
expressId: null,
expressName: '',
source: 1
}
10 months ago
},
methods: {
/**
* 查快递
*/
onCheck() {
if (!this.codeNum) {
return this.$toast('请填写物流单号')
}
uni.navigateTo({
url: "/pages/news3/LogisticsDetails?logisticsNum=" + this.codeNum
})
},
scanCode() {
uni.scanCode({
success: (res) => {
this.codeNum = res.result;
},
fail: (res) => {
uni.showToast({
title: '扫描失败',
icon: 'none'
})
}
})
},
// 选择物流
changeOption(e) {
this.expressName = this.wlList[e.detail.value].express_name;
this.expressId = this.wlList[e.detail.value].express_id
},
async sendGoodsHandle() {
if (!this.expressId) {
return that.$toast('请选择物流公司')
10 months ago
}
if (!this.codeNum) {
return that.$toast('请填写物流单号')
10 months ago
}
let goosList = this.orderInfo.goods.map(item => {
10 months ago
return {
orderGoodsId: item.order_goods_id,
deliveryNum: item.delivery_num
10 months ago
}
})
let params = {
"orderId": this.orderInfo.order_id,
"form": {
"deliveryMethod": this.wuliu ? 10 : 20,
"packGoodsData": goosList,
"expressId": this.expressId,
"expressNo": this.codeNum,
"syncMpWeixinShipping": 1
}
}
let {
status,
message,
data
} = await newFunApi.sendGoods(params);
if (status == 200) {
uni.hideLoading();
uni.showToast({
title: this.source == 1 ? '修改成功' : '发货成功',
icon: 'none'
})
9 months ago
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 1000)
}
},
async getWuliuList() {
let {
status,
message,
data
} = await newFunApi.wuliuList();
if (status == 200) {
uni.hideLoading();
if (this.source == 1) {
if (this.expressId) {
data.list.forEach(item => {
if (item.express_id == this.expressId) {
this.expressName = item.express_name || '';
}
});
}
}
this.wlList = data.list
}
},
10 months ago
},
onLoad(option) {
this.orderInfo = JSON.parse(option.item)
this.source = option.source;
if (this.source == 1) {
this.expressId = this.orderInfo.delivery[0].express_id
this.codeNum = this.orderInfo.delivery[0].express_no
}
this.getWuliuList()
}
10 months ago
}
</script>
<style lang="scss" scoped>
page {
min-height: 100%;
background-color: #F7F8FA;
10 months ago
}
10 months ago
::v-deep .uni-input-wrapper {
text-align: left !important;
}
.orderNum {
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #707070;
margin: 10upx 0upx;
}
.dispatchContent {
margin: 20upx 0;
background: #FFFFFF;
// border-radius: 6px 6px 6px 6px;
opacity: 1;
padding: 20upx 30upx;
}
.dispatchItem {
10 months ago
display: flex;
align-items: center;
image {
width: 194upx;
height: 194upx;
10 months ago
}
.right {
flex: 1;
margin-left: 40upx;
position: relative;
display: flex;
flex-direction: column;
justify-content: space-around;
.title {
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #3B3B3B;
}
.subTitle {
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #7C7C7C;
margin: 14upx 0;
}
.num {
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #1E1E1E;
}
.price {
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 32upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #F21A1C;
position: absolute;
right: 20upx;
bottom: 0upx;
z-index: 9;
}
10 months ago
}
}
.scan {
display: flex;
align-items: center;
image {
width: 40upx;
height: 40upx;
margin-right: 32upx;
10 months ago
}
}
::v-deep .u-field {
padding: 30upx;
}
::v-deep .uni-input-wrapper {
text-align: right;
}
.footerBtn {
padding: 30upx;
display: flex;
align-items: center;
justify-content: flex-end;
}
.wuliuBtn {
// padding:8upx 46upx;
text-align: center;
height: 60upx;
line-height: 60upx;
border: 1px solid #F63116;
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #F83F11;
border-radius: 20px;
width: 200upx;
}
.goods-fd {
width: 100%;
position: fixed;
left: 0;
bottom: 0;
padding: 0.9375rem;
z-index: 99;
background-color: #fafafa;
box-sizing: border-box;
.btn {
width: 630rpx;
line-height: 88rpx;
background: #F34A40;
border-radius: 88rpx;
text-align: center;
font-size: 28rpx;
10 months ago
font-weight: 500;
color: #FFFFFF;
margin: auto;
10 months ago
}
}
</style>