|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <view class="flex-col container" :style="{height: winHeight + 'px'}">
|
|
|
+ <view class="flex-col container" :style="{top: navH + 'rpx'}">
|
|
|
<view class='newsList tui-skeleton' style="background-color: #fff;flex: 1;">
|
|
|
<!-- <view class='nav'>
|
|
|
<scroll-view class="scroll-view_x" scroll-x scroll-with-animation :scroll-left="scrollLeft" style="width:auto;overflow:hidden;">
|
|
@@ -13,26 +13,7 @@
|
|
|
</view> -->
|
|
|
<view class='list flex-col' style="background-color: #F5F5F5;">
|
|
|
<view style="padding: 40rpx 24rpx;background-color: #fff;border-bottom-left-radius: 23rpx;">
|
|
|
- <view class="flex-y-center flex-between-center" style="margin-bottom: 20rpx;">
|
|
|
- <view class="flex-y-center" style="flex: 1">
|
|
|
- <image style="width: 135rpx; height: 135rpx;border-radius: 50%;" src="/static/img/ic-shou.png"></image>
|
|
|
- <view style="margin-left: 29rpx;flex: 1;">
|
|
|
- <template v-if="Object.keys(addressObj).length == 0">
|
|
|
- <view class="send-name">送到哪里</view>
|
|
|
- <view class="send-tips">请输入收件人信息</view>
|
|
|
- </template>
|
|
|
- <view class="send-info" v-else>
|
|
|
- <view class='consignee'>收货人:{{addressObj.realName}}<text class='phone'>{{addressObj.phone}}</text></view>
|
|
|
- <view>收货地址:{{addressObj.province}}{{addressObj.city}}{{addressObj.district}}{{ addressObj.street}}{{addressObj.detail}}</view>
|
|
|
- </view>
|
|
|
- <!-- <view style="font-weight: 500;font-size: 23rpx;color: #FF6702;">可送单时间段00:00——23:59</view> -->
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <navigator url="/pages/address/user_address_list/index">
|
|
|
- <view class='iconfont icon-jiantou' style="font-size: 55rpx;margin-left: 29rpx;"></view>
|
|
|
- </navigator>
|
|
|
- </view>
|
|
|
- <view class="flex-y-center flex-between-center" style="margin-bottom: 20rpx">
|
|
|
+ <view class="flex-y-center flex-between-center" style="margin-bottom: 20rpx;border: none;">
|
|
|
<view class="flex-y-center" style="flex: 1">
|
|
|
<image style="width: 135rpx; height: 135rpx;border-radius: 50%;" src="/static/img/ic-qu-chengse.png"></image>
|
|
|
<view style="margin-left: 29rpx;flex: 1;">
|
|
@@ -62,9 +43,18 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="flex-between-center">
|
|
|
- <view class="remark-name">取件信息</view>
|
|
|
+ <view class="remark-name">取件码</view>
|
|
|
<view class="flex-y-center">
|
|
|
- <input v-model="fastMailObj.expressInfo" class="uni-input" focus placeholder="请输入内容" />
|
|
|
+ <input v-model="fastMailObj.expressInfo" class="uni-input" placeholder="请输入取件码" />
|
|
|
+ <view class='iconfont icon-jiantou' style="opacity: 0;"></view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="flex-between-center">
|
|
|
+ <view class="remark-name">快递单号</view>
|
|
|
+ <view class="flex-y-center" @tap="isExpress = true">
|
|
|
+ <text style="font-weight: 400;font-size: 27rpx;color: #646464;" v-if="fastMailObj.expressObj">{{fastMailObj.expressObj.companyName}}
|
|
|
+ {{fastMailObj.expressObj.odd}}</text>
|
|
|
+ <view class='iconfont icon-jiantou' style="font-size: 30rpx;margin: 0 19rpx;"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="flex-between-center">
|
|
@@ -91,20 +81,25 @@
|
|
|
<view class="remark-name">备注</view>
|
|
|
<view class="flex-y-center">
|
|
|
<input v-model="fastMailObj.remark" class="uni-input" />
|
|
|
+ <view class='iconfont icon-jiantou' style="opacity: 0;"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="flex-between-center">
|
|
|
+ <!-- <view class="flex-between-center">
|
|
|
<view class="remark-name">小费</view>
|
|
|
<view class="flex-y-center" @tap="isTip = true">
|
|
|
<text style="font-weight: 400;font-size: 27rpx;color: #646464;">{{fastMailObj.giveTips ? '¥' + fastMailObj.giveTips : ''}}</text>
|
|
|
<view class='iconfont icon-jiantou' style="font-size: 30rpx;margin: 0 19rpx;"></view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
<!-- <view class="courie flex-y-center">
|
|
|
<image src="/static/img/ic-courie.png" mode=""></image><text>当前1名快递员接单</text>
|
|
|
</view> -->
|
|
|
</view>
|
|
|
+ <view class="flex-center" style="margin-top: 58rpx;">
|
|
|
+ <button class="sub-default flex-center" @tap="onDefault">取消</button>
|
|
|
+ <button class="sub flex-center" @tap="onSure">确定</button>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view v-if="visible" class="picker-box">
|
|
|
<picker-view :indicator-style="indicatorStyle" :value="timeValue" class="picker-view" @change="bindChange">
|
|
@@ -121,10 +116,11 @@
|
|
|
</picker-view-column>
|
|
|
</picker-view>
|
|
|
</view>
|
|
|
- <fast-mail-tip v-if="isTip" :value="fastMailObj.giveTips" @tipValue="onTipValue" @onCancel="onCanCel"></fast-mail-tip>
|
|
|
+ <!-- <fast-mail-tip v-if="isTip" :value="fastMailObj.giveTips" @tipValue="onTipValue" @onCancel="onCanCel"></fast-mail-tip> -->
|
|
|
<fast-mail-specs v-if="isSpecs" :obj="fastMailObj.sepec" @specsValue="onSpecsValue" @onCancel="onCanCel"></fast-mail-specs>
|
|
|
<fast-mail-figure v-if="isFigure" :picDefault="fastMailObj.figureArr" @figureValue="onFigureValue" @onCancel="onFigureCanCel"></fast-mail-figure>
|
|
|
<fast-mail-point v-if="isPoint" @pointValue="onPointValue" @onCancel="onCanCel"></fast-mail-point>
|
|
|
+ <fast-mail-express v-if="isExpress" @expressObj="onExpressObj" @onCancel="onCanCel"></fast-mail-express>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -143,17 +139,35 @@
|
|
|
import fastMailSpecs from '../components/fast_mail_specs/index.vue'
|
|
|
import fastMailFigure from '../components/fast_mail_figure/index.vue'
|
|
|
import fastMailPoint from '../components/fast_mail_point/index.vue'
|
|
|
+ import fastMailExpress from '../components/fast_mail_express/index.vue'
|
|
|
import {
|
|
|
- getAddressDefault,
|
|
|
getAddressExpressDefault
|
|
|
} from '@/api/user.js';
|
|
|
+ import {
|
|
|
+ mapGetters
|
|
|
+ } from "vuex";
|
|
|
+ import {
|
|
|
+ preExpressApi
|
|
|
+ } from '@/api/fastMail.js';
|
|
|
let app = getApp();
|
|
|
export default {
|
|
|
components: {
|
|
|
fastMailTip,
|
|
|
fastMailSpecs,
|
|
|
fastMailFigure,
|
|
|
- fastMailPoint
|
|
|
+ fastMailPoint,
|
|
|
+ fastMailExpress
|
|
|
+ },
|
|
|
+ computed: mapGetters(['globalData']),
|
|
|
+ props: {
|
|
|
+ addressObj: {
|
|
|
+ type: Object,
|
|
|
+ default: {}
|
|
|
+ },
|
|
|
+ orderNo: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -162,8 +176,9 @@
|
|
|
isFigure: false, // 附图弹窗
|
|
|
isPoint: false, // 选择快递点弹窗
|
|
|
visible: false, // 送达时间弹窗
|
|
|
+ isExpress: false, // 快递公司弹窗
|
|
|
+ navH: 0,
|
|
|
timeValue: [0, 0],
|
|
|
- addressObj: {},
|
|
|
addressExpressObj: {},
|
|
|
fastMailObj: {},
|
|
|
hours: 0,
|
|
@@ -196,20 +211,17 @@
|
|
|
indicatorStyle: `height: 50px;background-color: #F8F8F8;z-index: -1;`
|
|
|
};
|
|
|
},
|
|
|
- onLoad(options) {
|
|
|
- let that = this;
|
|
|
- uni.getSystemInfo({
|
|
|
- success: function(res) {
|
|
|
- that.winHeight = res.windowHeight
|
|
|
- },
|
|
|
- });
|
|
|
- },
|
|
|
+ onLoad(options) {},
|
|
|
mounted() {
|
|
|
+ // #ifdef MP || APP-PLUS
|
|
|
+ // 获取导航高度;
|
|
|
+ this.navH = this.globalData.navHeight;
|
|
|
+ // #endif
|
|
|
+ // #ifdef H5
|
|
|
+ this.navH = 80;
|
|
|
+ // #endif
|
|
|
this.initTime()
|
|
|
this.getaddressInfo()
|
|
|
- uni.$on('addressItem', function(res) {
|
|
|
- that.$set(this, 'addressObj', res);
|
|
|
- })
|
|
|
uni.$on('addressExpressItem', function(res) {
|
|
|
that.$set(this, 'addressExpressObj', res);
|
|
|
})
|
|
@@ -219,10 +231,6 @@
|
|
|
* 获取默认收货地址或者获取某条地址信息
|
|
|
*/
|
|
|
getaddressInfo: function() {
|
|
|
- getAddressDefault().then(res => {
|
|
|
- console.log('地址', res)
|
|
|
- this.addressObj = res.data || {}
|
|
|
- })
|
|
|
getAddressExpressDefault().then(res => {
|
|
|
console.log('驿站地址', res)
|
|
|
this.addressExpressObj = res.data || {}
|
|
@@ -281,6 +289,7 @@
|
|
|
this.isTip = val
|
|
|
this.isSpecs = val
|
|
|
this.isPoint = val
|
|
|
+ this.isExpress = false
|
|
|
},
|
|
|
onFigureCanCel(arr) {
|
|
|
this.isFigure = false
|
|
@@ -301,6 +310,14 @@
|
|
|
this.isPoint = false
|
|
|
console.log(obj)
|
|
|
},
|
|
|
+ onExpressObj(obj) {
|
|
|
+ this.fastMailObj.expressObj = obj
|
|
|
+ this.isExpress = false
|
|
|
+ console.log(obj)
|
|
|
+ },
|
|
|
+ onDefault() {
|
|
|
+ this.$emit('onCancel', false)
|
|
|
+ },
|
|
|
bindChange: function(e) {
|
|
|
console.log(e)
|
|
|
this.timeValue = e.detail.value
|
|
@@ -324,6 +341,55 @@
|
|
|
this.fastMailObj.dayTimeName = timeStr
|
|
|
this.visible = false
|
|
|
console.log(this.fastMailObj)
|
|
|
+ },
|
|
|
+ onSure() {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '保存中',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ let value = {
|
|
|
+ orderDetails: [{
|
|
|
+ expressNo: this.fastMailObj.expressObj?.odd || '',
|
|
|
+ expressCompany: this.fastMailObj.expressObj?.companyName || '',
|
|
|
+ pickUpCode: this.fastMailObj.expressInfo || '',
|
|
|
+ expressNum: 1,
|
|
|
+ postAddressId: this.addressExpressObj.id || null,
|
|
|
+ postName: this.addressExpressObj.expressName || '',
|
|
|
+ postPhone: this.addressExpressObj.phone || '',
|
|
|
+ image: this.fastMailObj.figureArr ? this.fastMailObj.figureArr[0] : '',
|
|
|
+ spec: this.fastMailObj.sepec?.spceName || '',
|
|
|
+ price: +this.fastMailObj.sepec?.fee || 0,
|
|
|
+ remark: this.fastMailObj.remark || ''
|
|
|
+ }],
|
|
|
+ preOrderType: 'take',
|
|
|
+ preOrderNo: this.orderNo,
|
|
|
+ userAddressId: this.addressObj.id
|
|
|
+ }
|
|
|
+ const tips = this.checkData(value)
|
|
|
+ if (tips) {
|
|
|
+ uni.hideLoading();
|
|
|
+ return this.$util.Tips({
|
|
|
+ title: tips
|
|
|
+ });
|
|
|
+ }
|
|
|
+ preExpressApi(value).then(res => {
|
|
|
+ this.isOrder = true;
|
|
|
+ console.log(res)
|
|
|
+ uni.hideLoading();
|
|
|
+ this.$emit('onTakeFastOk', res.data)
|
|
|
+ }).catch(err => {
|
|
|
+ uni.showToast({
|
|
|
+ title: err,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ uni.hideLoading();
|
|
|
+ })
|
|
|
+ },
|
|
|
+ checkData(val) {
|
|
|
+ if (!val.orderDetails[0].postAddressId) return '请填写取件地'
|
|
|
+ if (!val.orderDetails[0].spec) return '快递规格必选'
|
|
|
+ if (!val.orderDetails[0].pickUpCode) return '请填写取件码'
|
|
|
+ if (!val.orderDetails[0].expressCompany) return '请填写快递单号'
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -332,9 +398,30 @@
|
|
|
<style lang="scss" scoped>
|
|
|
.container {
|
|
|
width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ z-index: 99999;
|
|
|
position: fixed;
|
|
|
}
|
|
|
|
|
|
+ .sub {
|
|
|
+ background-color: $bg-color-primary;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 31rpx;
|
|
|
+ color: #FFFFFF;
|
|
|
+ width: 154rpx;
|
|
|
+ height: 77rpx
|
|
|
+ }
|
|
|
+
|
|
|
+ .sub-default {
|
|
|
+ background: #C2C2C2;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 31rpx;
|
|
|
+ color: #FFFFFF;
|
|
|
+ width: 154rpx;
|
|
|
+ height: 77rpx;
|
|
|
+ margin-right: 39rpx;
|
|
|
+ }
|
|
|
+
|
|
|
.send-name {
|
|
|
font-weight: 500;
|
|
|
font-size: 23rpx;
|
|
@@ -413,9 +500,13 @@
|
|
|
z-index: 99999;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
.item-picker {
|
|
|
text-align: center;
|
|
|
}
|
|
|
+
|
|
|
+ .uni-input {
|
|
|
+ text-align: right;
|
|
|
+ margin: 0 10rpx;
|
|
|
+ }
|
|
|
</style>
|