|
@@ -18,12 +18,15 @@
|
|
|
</scroll-view>
|
|
|
</view> -->
|
|
|
<navigator url="/pages/address/user_address_list/index">
|
|
|
- <view class="fast-top">
|
|
|
+ <view class="fast-top flex-between-center">
|
|
|
<view>
|
|
|
- 送至:{{addressItem.province}}{{addressItem.city}}{{addressItem.district}}{{addressItem.street}}{{addressItem.detail}}
|
|
|
+ <view>送至:{{addressItem.province}}{{addressItem.city}}{{addressItem.district}}{{addressItem.street}}{{addressItem.detail}}</view>
|
|
|
+ <view style="margin-top: 10rpx;">
|
|
|
+ <text>{{addressItem.realName}}</text> 收 {{addressItem.phone}}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view style="margin-top: 10rpx;">
|
|
|
- <text>{{addressItem.realName}}</text> 收 {{addressItem.phone}}<text class="iconfont icon-jiantou"></text>
|
|
|
+ <view>
|
|
|
+ <text class="iconfont icon-jiantou"></text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</navigator>
|
|
@@ -36,8 +39,8 @@
|
|
|
</view>
|
|
|
<!-- </navigator> -->
|
|
|
<scroll-view scroll-y scroll-with-animation style="flex: 1;overflow: hidden;">
|
|
|
- <view class="fast-box" v-for="(item, index) in fastMailData.postOrderList || []" :key="index">
|
|
|
- <view class="flex-between-center">
|
|
|
+ <view class="fast-box" v-for="(item, index) in fastMailData" :key="index">
|
|
|
+ <view class="flex-between-center mb-20">
|
|
|
<view>
|
|
|
<view class="fast-yz">{{item.postName}}</view>
|
|
|
<view class="fast-xx">{{item.addressDetail}}</view>
|
|
@@ -46,14 +49,16 @@
|
|
|
<image src="/static/img/phone.png" class="image2" /><text>联系驿站</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="fast-item" v-for="(value, index) in item.orderInfoList">
|
|
|
- <view class="flex-between-center">
|
|
|
- <radio class="radios" :checked="value.radio" color="#FF6702" @tap="value.radio = !value.radio" />
|
|
|
- <image style="width: 135rpx; height: 135rpx;border-radius: 30rpx;" src="/static/img/ic-qu-chengse.png"></image>
|
|
|
- <view>
|
|
|
- <view class="fast-yz">取件码 <text>{{value.pickUpCode}}</text></view>
|
|
|
- <view class="fast-xx">{{value.expressCompany}} {{value.expressNo}}</view>
|
|
|
- <view class="fast-yz">规格:{{value.spec}}</view>
|
|
|
+ <view class="fast-item" v-for="(value, key) in item.orderInfoList" :key="key">
|
|
|
+ <view class="flex-between-center mb-20" @click="onValRadio(value)">
|
|
|
+ <radio class="radios" :checked="value.radio" color="#FF6702" />
|
|
|
+ <view class="flex-y-center">
|
|
|
+ <image style="width: 135rpx; height: 135rpx;border-radius: 30rpx;margin-right: 23rpx;" src="/static/img/ic-qu-chengse.png"></image>
|
|
|
+ <view>
|
|
|
+ <view class="fast-yz">取件码 <text>{{value.pickUpCode}}</text></view>
|
|
|
+ <view class="fast-xx">{{value.expressCompany}} {{value.expressNo}}</view>
|
|
|
+ <view class="fast-yz">规格:{{value.spec}}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view>
|
|
|
<!-- <view class="fast-yz">134m</view> -->
|
|
@@ -62,7 +67,7 @@
|
|
|
</view>
|
|
|
<view class="fast-remark">
|
|
|
<view v-if="value.remark">备注:{{value.remark}}</view>
|
|
|
- <view class="flex-y-center" v-if="value.image" @tap="lookImg(value.image)">
|
|
|
+ <view class="flex-y-center" v-if="value.image" @click="lookImg(value.image)">
|
|
|
<text>附图:</text>
|
|
|
<image style="width: 38rpx; height: 38rpx;" src="/static/img/ic-figure.png"></image>
|
|
|
</view>
|
|
@@ -78,8 +83,8 @@
|
|
|
</template>
|
|
|
</view> -->
|
|
|
<view class="fast-tip flex-y-center">
|
|
|
- <radio :checked="radioArr" color="#FF6702" @tap="onRadioChang()" />全选
|
|
|
- <view style="margin-left: 30rpx;">删除</view>
|
|
|
+ <!-- <radio :checked="radioArr" color="#FF6702" @tap="onRadioChang()" />全选 -->
|
|
|
+ <view @tap="onRadioDel()">删除</view>
|
|
|
</view>
|
|
|
<view class="flex-between-center fast-tip" @tap="isTip = true">
|
|
|
<view class="remark-name">小费</view>
|
|
@@ -124,14 +129,21 @@
|
|
|
import fastMailTip from '../components/fast_mail_tip/index.vue'
|
|
|
import {
|
|
|
preExpressApi,
|
|
|
- loadPreExpressApi
|
|
|
+ loadPreExpressApi,
|
|
|
+ loadPreExpressDelApi,
|
|
|
+ expressCreate
|
|
|
} from '@/api/fastMail.js';
|
|
|
import {
|
|
|
getAddressDefault,
|
|
|
getAddressExpressDefault
|
|
|
} from '@/api/user.js';
|
|
|
+ import orderPay from "@/mixins/OrderPay.js";
|
|
|
+ import {
|
|
|
+ Debounce
|
|
|
+ } from '@/utils/validate.js'
|
|
|
let app = getApp();
|
|
|
export default {
|
|
|
+ mixins: [orderPay],
|
|
|
components: {
|
|
|
tuiSkeleton,
|
|
|
navBar,
|
|
@@ -145,7 +157,7 @@
|
|
|
isOrder: false, // 提交快递订单弹窗
|
|
|
isTake: false, // 新增快递弹窗
|
|
|
isTip: false, // 小费弹窗
|
|
|
- giveTips: '',
|
|
|
+ giveTips: 0,
|
|
|
winHeight: 0,
|
|
|
isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
|
|
|
autoplay: true,
|
|
@@ -161,7 +173,7 @@
|
|
|
name: '寄快递',
|
|
|
preOrderType: 'send'
|
|
|
}],
|
|
|
- fastMailData: {},
|
|
|
+ fastMailData: [],
|
|
|
navListIndex: 0,
|
|
|
active: 0,
|
|
|
scrollLeft: 0,
|
|
@@ -186,23 +198,32 @@
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: function() {
|
|
|
+ let that = this
|
|
|
uni.$on('addressItem', function(res) {
|
|
|
- that.$set(this, 'addressItem', res);
|
|
|
- this.preOrderNo = ''
|
|
|
- this.fastMailData = {}
|
|
|
- this.orderPrice = 0
|
|
|
+ that.$set(that, 'addressItem', res);
|
|
|
+ that.preOrderNo = ''
|
|
|
+ that.fastMailData = []
|
|
|
+ that.orderPrice = 0
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
lookImg(url) {
|
|
|
uni.previewImage({
|
|
|
- urls: url
|
|
|
+ current: url, // 传 Number H5端出现不兼容
|
|
|
+ urls: [url]
|
|
|
});
|
|
|
},
|
|
|
getPreExpressApi(orderNo) {
|
|
|
loadPreExpressApi(orderNo).then(res => {
|
|
|
- this.fastMailData = res.data
|
|
|
- this.orderPrice = res.data.payFee
|
|
|
+ this.fastMailData = res.data.postOrderList.map(item => {
|
|
|
+ item.orderInfoList.forEach(val => {
|
|
|
+ val.radio = false
|
|
|
+ })
|
|
|
+ return { ...item
|
|
|
+ }
|
|
|
+ }) || []
|
|
|
+ console.log(this.fastMailData)
|
|
|
+ this.orderPrice = +res.data.payFee
|
|
|
})
|
|
|
},
|
|
|
onAddFastMail() {
|
|
@@ -216,18 +237,39 @@
|
|
|
this.navListIndex = e;
|
|
|
this.scrollLeft = e * 60;
|
|
|
},
|
|
|
- toPay() {
|
|
|
- console.log(this.fastMailData)
|
|
|
- console.log('提交订单')
|
|
|
- },
|
|
|
- pay(item) {
|
|
|
- uni.showLoading({
|
|
|
+ async toPay() {
|
|
|
+ await uni.showLoading({
|
|
|
title: '加载中...'
|
|
|
});
|
|
|
- this.getToPayment(item.secondType, item)
|
|
|
+ // let tip = true;
|
|
|
+ // this.fastMailData.forEach(item => {
|
|
|
+ // item.orderInfoList.forEach(val => {
|
|
|
+ // val.radio ? tip = false : ''
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // if (tip) {
|
|
|
+ // return this.$util.Tips({
|
|
|
+ // title: '请选择快件'
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ await expressCreate({
|
|
|
+ preOrderNo: this.preOrderNo,
|
|
|
+ giveTips: this.giveTips
|
|
|
+ }).then(res => {
|
|
|
+ uni.hideLoading()
|
|
|
+ console.log(res)
|
|
|
+ let data = {
|
|
|
+ payPrice: +res.data.payPrice,
|
|
|
+ orderNo: res.data.orderNo
|
|
|
+ }
|
|
|
+ this.getToPayment('', data, 'fast')
|
|
|
+ }).catch(err => {
|
|
|
+ uni.hideLoading()
|
|
|
+ console.log('提交快递')
|
|
|
+ })
|
|
|
},
|
|
|
onTipValue(value) {
|
|
|
- this.giveTips = value
|
|
|
+ this.giveTips = +value
|
|
|
this.isTip = false;
|
|
|
console.log(value)
|
|
|
},
|
|
@@ -241,13 +283,56 @@
|
|
|
this.isTake = val
|
|
|
this.isTip = val
|
|
|
},
|
|
|
+ onValRadio(val) {
|
|
|
+ val.radio = !val.radio
|
|
|
+ },
|
|
|
onRadioChang() {
|
|
|
+ // let price = 0;
|
|
|
this.radioArr = !this.radioArr
|
|
|
- if (!this.fastMailData.postOrderList) return
|
|
|
- this.fastMailData.postOrderList.forEach(item => {
|
|
|
+ if (this.fastMailData.length === 0) return
|
|
|
+ this.fastMailData = this.fastMailData.map((item, index) => {
|
|
|
+ item.orderInfoList.forEach(val => {
|
|
|
+ val.radio = this.radioArr
|
|
|
+ // val.radio ? price += +val.price : ''
|
|
|
+ })
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ // this.orderPrice = price
|
|
|
+ },
|
|
|
+ onRadioDel() {
|
|
|
+ if (this.fastMailData.length === 0) return
|
|
|
+ const arr = []
|
|
|
+ this.fastMailData.map((item, index) => {
|
|
|
item.orderInfoList.forEach(val => {
|
|
|
- val.radar = this.radioArr
|
|
|
+ val.radio ? arr.push(val.expressId) : ''
|
|
|
})
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ console.log(arr)
|
|
|
+ let that = this
|
|
|
+ uni.showModal({
|
|
|
+ content: '确定删除?',
|
|
|
+ cancelText: "取消",
|
|
|
+ confirmText: "确定",
|
|
|
+ showCancel: true,
|
|
|
+ confirmColor: '#f55850',
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '正在删除中'
|
|
|
+ });
|
|
|
+ loadPreExpressDelApi(that.preOrderNo, arr).then(res => {
|
|
|
+ if (res.data) {
|
|
|
+ uni.hideLoading();
|
|
|
+ that.getPreExpressApi(that.preOrderNo)
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ uni.hideLoading();
|
|
|
+ })
|
|
|
+ console.log(that.fastMailData)
|
|
|
+ }
|
|
|
+ },
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -269,6 +354,15 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ .noCheck {
|
|
|
+ width: 32rpx;
|
|
|
+ height: 32rpx;
|
|
|
+ border-radius: 50%;
|
|
|
+ overflow: hidden;
|
|
|
+ border: 1px solid #999999;
|
|
|
+ background-color: #eee;
|
|
|
+ }
|
|
|
+
|
|
|
.fast-top {
|
|
|
width: 100%;
|
|
|
padding: 28rpx 30rpx;
|
|
@@ -289,7 +383,7 @@
|
|
|
.fast-tip {
|
|
|
background-color: #fff;
|
|
|
margin-top: 20rpx;
|
|
|
- padding: 20rpx;
|
|
|
+ padding: 20rpx 30rpx;
|
|
|
}
|
|
|
|
|
|
.image2 {
|
|
@@ -315,7 +409,8 @@
|
|
|
background-color: #fff;
|
|
|
|
|
|
.fast-item {
|
|
|
- padding: 20rpx 20rpx 20rpx 84rpx;
|
|
|
+ position: relative;
|
|
|
+ padding: 20rpx 20rpx 20rpx 86rpx;
|
|
|
background-color: #F8F9FB;
|
|
|
margin-bottom: 10rpx;
|
|
|
}
|
|
@@ -329,10 +424,10 @@
|
|
|
font-weight: 400;
|
|
|
font-size: 21rpx;
|
|
|
color: #999999;
|
|
|
- }
|
|
|
|
|
|
- .flex-between-center {
|
|
|
- margin-bottom: 20rpx;
|
|
|
+ view {
|
|
|
+ margin-bottom: 10rpx;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.fast-yz {
|