| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680 |
- <!-- 邮寄发货 -->
- <template>
- <view>
- <view class="tits">收货信息</view>
- <ul class="ddinfo">
- <li>
- <span>收货人</span>
- <view v-text="order.name"></view>
- </li>
- <li>
- <span>收货人电话</span>
- <view v-text="order.phone"></view>
- </li>
- <li>
- <span>收货人地址</span>
- <view v-text="order.address"></view>
- </li>
- </ul>
- <view class="tits">发货方式</view>
- <view class="express">
- <view class="li dflex">
- <label class="label">发货方式</label>
- <view class="item flex">
- <picker class="picker active" :range="goodstype" @change="onSelect" range-key="label">
- <view>{{ goodstype[psSwyIndex].label }}</view>
- <image src="../merchant/static/images/rico.png" class="rico"></image>
- </picker>
- </view>
- </view>
- <block v-if="index == 2">
- <view class="li dflex">
- <label class="label">快递公司</label>
- <view class="item flex">
- <picker :class="'picker ' + (expressIndex > -1 ? 'active' : '')" @change="bindPickerExpressChange" :range="express" range-key="label">
- <view v-if="expressIndex >= 0">{{ express[expressIndex].label }}</view>
- <view v-else>请选择</view>
- <image src="../merchant/static/images/rico.png" class="rico"></image>
- </picker>
- </view>
- </view>
- <view class="li dflex">
- <label class="label">快递单号</label>
- <view class="item flex dflex">
- <input v-model="valueOrder" placeholder="请输入快递单号" placeholder-class="placeholder" class="ipt flex" />
- <view class="sao" @click="toScanCode()"><image src="../merchant/static/images/sao.png"></image></view>
- </view>
- </view>
- </block>
- <block v-if="index == 4">
- <view class="li dflex">
- <label class="label">配送人员</label>
- <view class="item flex dflex"><input v-model="distributionName" placeholder="请输入配送人姓名" placeholder-class="placeholder" class="ipt flex" /></view>
- </view>
- <view class="li dflex">
- <label class="label">联系方式</label>
- <view class="item flex dflex"><input v-model="distributionPhone" placeholder="请输入联系方式" placeholder-class="placeholder" class="ipt flex" /></view>
- </view>
- </block>
- <block v-if="index == 3">
- <view class="li dflex">
- <label class="label">订单类型</label>
- <view class="dflex flex radio-rr">
- <radio-group @change="radioTypeGroup">
- <label class="radio" v-for="(item, index) in type" :key="index">
- <radio :value="item.value" />
- {{ item.label }}
- </label>
- </radio-group>
- </view>
- </view>
- <view class="li dflex">
- <label class="label">需要打包</label>
- <view class="dflex flex radio-rr">
- <radio-group @change="radioIsGroup">
- <label class="radio" v-for="(item, index) in is" :key="index">
- <radio :value="item.value" />
- {{ item.label }}
- </label>
- </radio-group>
- </view>
- </view>
- <!-- <van-cell is-link @click="showTime = true"
- v-if="orderType == 2"
- :value="time"
- title=":" class="time" />
- <van-popup v-model="showTime"
- position="bottom"
- :style="{ height: '50%' }" round>
- <van-datetime-picker
- v-model="currentDate"
- type="datetime"
- title="选择送达时间"
- :min-date="minDate"
- :max-date="maxDate"
- @confirm="getTiem"
- @cancel="showTime = false"
- />
- </van-popup> -->
- </block>
- <view class="bot"><view class="sta-btn w" @click="showlog()">确定</view></view>
- </view>
- <view class="ceng" v-if="showexp"></view>
- <view class="dialog" v-if="showexp">
- <view class="dialog-tit">请核对信息</view>
- <view class="pad20">
- <view class="expressinfo">
- 发货方式:
- <view>{{ goodstype[psSwyIndex].label }}</view>
- </view>
- <block v-if="index == 2">
- <view class="expressinfo">
- 快递公司:
- <view>{{ expressRadio }}</view>
- </view>
- <view class="expressinfo" v-if="index == 2">
- 快递单号:
- <view>{{ valueOrder }}</view>
- </view>
- </block>
- <block v-if="index == 3">
- <view class="expressinfo">
- 快递公司:
- <view>{{ expressRadio }}</view>
- </view>
- <view class="expressinfo">
- 订单类型:
- <view>{{ orderType != '' ? type[orderType - 1].label : '无' }}</view>
- </view>
- <view class="expressinfo">
- 需要打包:
- <view>{{ pack != '' ? is[pack].label : '无' }}</view>
- </view>
- <view class="expressinfo" v-if="orderType == 2">
- 送达时间:
- <view>{{ time }}</view>
- </view>
- </block>
- <block v-if="index == 4">
- <view class="expressinfo">
- 配送人员姓名:
- <view>{{ distributionName }}</view>
- </view>
- <view class="expressinfo">
- 配送人员电话:
- <view>{{ distributionPhone }}</view>
- </view>
- </block>
- </view>
- <view class="dialog-btn dflex">
- <view class="dia-cancel" @click="beforeClose(false)">取消</view>
- <view class="dia-confirm" @click="beforeClose(true)">确认</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- const req = require('../utils/request');
- export default {
- data: () => ({
- minDate: new Date(2020, 0, 1),
- maxDate: new Date(2025, 10, 1),
- currentDate: new Date(),
- pack: '',
- psSwyIndex: 0,
- orderType: '',
- showexp: false,
- showFH: false,
- popup: false,
- expressNo: true,
- merchant: {},
- express: [],
- radio: '请选择',
- expressRadio: '请选择',
- valueOrder: '',
- index: 2,
- expressIndex: -1,
- goodstype: [
- {
- label: '快递',
- value: 2,
- disabled: false
- },
- // {
- // label: '同城配送',
- // value: 3,
- // disabled: true
- // },
- {
- label: '自主配送',
- value: 4,
- disabled: false
- }
- ],
- type: [
- {
- label: '及时单',
- value: '1'
- },
- {
- label: '预约单',
- value: '2'
- }
- ],
- is: [
- {
- label: '否',
- value: '0'
- },
- {
- label: '是',
- value: '1'
- }
- ],
- id: '',
- merchantId: '',
- time: '',
- showTime: false,
- distributionName: '',
- distributionPhone: '',
- times: '',
- orderId: '',
- order: ''
- }),
- onLoad(opt) {
- this.id = opt.id;
- this.merchantId = opt.merchantId;
- this.orderType = opt.orderType;
- this.deliverId = opt.deliverId;
- this.getType(1);
- this.loadDetail();
- },
- methods: {
- // 发货方式切换
- onSelect(e) {
- this.psSwyIndex = e.target.value;
- this.kuidimethod(this.goodstype[this.psSwyIndex].value);
- },
- toScanCode(e) {
- var tah = this;
- console.log('扫描二维码>>>>');
- uni.scanCode({
- success: function(res) {
- console.log('条码类型:' + res.scanType);
- console.log('条码内容:' + res.result);
- tah.valueOrder = res.result;
- tah.$forceUpdate();
- }
- });
- },
- loadDetail() {
- let from = {
- id: this.id
- };
- req.getRequest(
- '/api/order/detail',
- from,
- data => {
- this.order = data;
- this.isShowView = true;
- },
- true
- );
- },
- // 显示发货方式弹窗
- showPopup() {
- this.showFH = true;
- console.log(this.showFH);
- },
- bindPickerExpressChange(event) {
- this.expressIndex = event.detail.value;
- this.expressRadio = this.express[this.expressIndex].label;
- },
- // 得到发货方式 2快递,3同城配送,4自主配送
- kuidimethod(index) {
- console.log(index);
- this.index = index;
- },
- onClick(name, index) {
- // console.log( event.currentTarget.dataset)
- // const { name } = event.currentTarget.dataset;
- this.index = index;
- this.radio = name;
- },
- // 得到快递公司
- expressMethod(name, value) {
- this.expressIndex = value;
- this.expressRadio = name;
- console.log(this.expressIndex);
- },
- // 获取快递单号
- getValue(event) {
- this.value = event.detail;
- },
- // 获取配送人员姓名
- getdistributionName(event) {
- this.distributionName = event.detail;
- },
- // 获取配送人员联系方式
- getdistributionPhone(event) {
- this.distributionPhone = event.detail;
- },
- // 获取订单类型
- getorderType(event) {
- this.orderType = event.detail;
- },
- // 二次确认
- showlog() {
- // 发货方式为2快递
- if (this.index == 2) {
- if (this.expressIndex < 0) {
- req.msg('请选择快递公司');
- } else if (this.valueOrder == '') {
- req.msg('请输入快递单号');
- } else {
- this.showexp = true;
- }
- }
- // 发货方式为3同城配送
- if (this.index == 3) {
- // 及时单
- if (this.orderType != 0) {
- if (this.orderType == 1) {
- if (this.expressIndex < 0) {
- req.msg('请选择快递公司');
- } else if (this.pack == '') {
- req.msg('请选择是否需要打包');
- } else {
- this.showexp = true;
- }
- }
- // 预约单
- if (this.orderType == 2) {
- if (this.expressIndex < 0) {
- req.msg('请选择快递公司');
- } else if (this.pack == '') {
- req.msg('请选择是否需要打包');
- } else if (this.time == '') {
- req.msg('请选择送达时间');
- } else {
- this.showexp = true;
- }
- }
- } else {
- req.msg('请选择订单类型');
- }
- }
- // 自主配送
- if (this.index == 4) {
- if (this.distributionName == '') {
- req.msg('请输入配送人员姓名');
- } else if (this.distributionPhone == '') {
- req.msg('请输入配送人员电话');
- } else {
- this.showexp = true;
- }
- }
- // this.showexp = true
- },
- // 获取快递信息
- getexpress() {
- // this.req.getexpress({}, (data) => {
- let express = [];
- req.getRequest('/api/orderRefund/refundReason', {}, data => {
- this.express = data.express;
- });
- if (this.index == 3) {
- // if (this.merchant.syncEle == 1) {
- // this.express = []
- this.expressRadio = '请选择';
- this.expressIndex = -1;
- // this.express.push(data.express[21])
- this.express = express;
- this.expressNo = false;
- // }
- }
- if (this.index == 2) {
- // express.splice(data.express.length - 3, 3)
- this.expressRadio = '请选择';
- this.expressIndex = -1;
- this.express = express;
- this.expressNo = true;
- }
- // })
- },
- // 确认按钮的,弹窗显示隐藏
- getType(index) {
- this.showFH = false;
- this.popup = false;
- if (index == 1) {
- this.getexpress();
- }
- },
- // 传发货信息给后台
- beforeClose(isOk) {
- if (isOk) {
- this.deliver();
- // this.save();
- setTimeout(() => {
- this.showexp = false;
- }, 1000);
- } else {
- // done() // 关闭
- this.showexp = false;
- }
- },
- // 发货信息保存
- deliver() {
- let param;
- // param = {
- // id: this.orderId,
- // deliverId: this.id,
- // express: this.expressRadio,
- // expressNo: this.valueOrder
- // };
- if (this.index == 2) {
- param = {
- mode: this.index,
- id: this.id,
- expressCode: this.expressIndex,
- express: this.expressRadio,
- expressNo: this.value
- };
- }
- if (this.index == 3) {
- param = {
- id: this.id,
- expressCode: this.expressIndex,
- express: this.expressRadio,
- orderSendType: this.orderType,
- isPack: this.pack,
- mode: this.index
- };
- if (this.orderType == 2) {
- param.sendTime = this.times;
- }
- }
- if (this.index == 4) {
- param = {
- id: this.id,
- mode: this.index,
- deliveryUserName: this.distributionName,
- deliveryUserPhone: this.distributionPhone
- };
- }
- if (!this.deliverId) {
- } else {
- param.deliverId = this.deliverId;
- }
- console.log(param);
- let that = this;
- req.postRequest(
- '/api/order/confirm',
- param,
- data => {
- if (data == 1) {
- uni.showToast({
- title: '发货成功',
- icon: 'none'
- });
- setTimeout(function() {
- uni.navigateBack();
- }, 1000);
- }
- },
- true
- );
- },
- back() {
- // 返回上一层
- uni.navigateBack();
- },
- // 时间显示
- getTiem(value) {
- let date = new Date(value);
- const year = date.getFullYear();
- const month = date.getMonth() + 1;
- const day = date.getDate();
- const hour = date.getHours();
- const minute = date.getMinutes();
- console.log(year, month, day, hour, minute);
- this.time = year + '年' + month + '月' + day + '日' + hour + '点' + minute + '分';
- this.times = year + '-' + month + '-' + day + ' ' + hour + ':' + minute;
- this.showTime = false;
- console.log(this.times);
- }
- }
- };
- </script>
- <style scoped>
- @import './static/css/main.css';
- .express {
- background: #fff;
- padding: 0 30rpx;
- }
- .express .li {
- border-bottom: 1rpx solid #e5e5e5;
- align-items: center;
- }
- .express .li:last-child {
- border: none;
- }
- .label {
- font-size: 30rpx;
- color: #333;
- margin-right: 20rpx;
- padding: 30rpx 0;
- }
- .item {
- align-items: center;
- }
- .picker {
- position: relative;
- }
- .picker view {
- display: inline-block;
- width: 100%;
- padding: 30rpx 0;
- font-size: 30rpx;
- color: #999;
- text-align: right;
- padding-right: 35rpx;
- box-sizing: border-box;
- }
- .picker.active view {
- color: #333;
- }
- .rico {
- width: 15rpx;
- height: 26rpx;
- position: absolute;
- right: 0;
- top: 50%;
- transform: translateY(-50%);
- }
- .ipt {
- font-size: 30rpx;
- color: #333;
- text-align: right;
- }
- .placegolder {
- color: #999;
- }
- .sao {
- padding: 10rpx 10rpx 10rpx 30rpx;
- }
- .sao image {
- width: 30rpx;
- height: 34rpx;
- }
- .bot {
- height: 70rpx;
- }
- .sta-btn {
- background: #fe0419;
- color: #fff;
- width: 100%;
- height: 70rpx;
- line-height: 70rpx;
- font-size: 30rpx;
- }
- .expressinfo {
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- }
- .pad20 {
- padding: 0 20px;
- }
- .delivertype {
- height: 300px;
- }
- /* .delivertype .radio {
- height: 211px;
- position: fixed;
- overflow-y: auto;
- width: 100%;
- } */
- .delivertype .bottom {
- width: 335px;
- height: 50px;
- background: linear-gradient(to left, #ff5548, #fe0419);
- border-radius: 25px;
- text-align: center;
- line-height: 50px;
- color: #ffffff;
- font-size: 18px;
- position: fixed;
- left: 0;
- right: 0;
- bottom: 15px;
- margin: 0 auto;
- }
- /* .van-radio:not(:last-child) {
- margin-right: 10px;
- } */
- /* .time{font-size: 13px;} */
- .van-cell__title {
- flex: 0.9;
- }
- .tits {
- font-size: 28rpx;
- color: #666;
- padding: 20rpx 30rpx;
- }
- .ddinfo {
- margin: 0;
- border-radius: 0;
- }
- .ddinfo li span {
- font-size: 30rpx;
- color: #333;
- margin-right: 20rpx;
- }
- .ceng {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0, 0, 0, 0.5);
- z-index: 99;
- }
- .dialog {
- position: fixed;
- top: 50%;
- transform: translateY(-50%);
- left: 40rpx;
- right: 40rpx;
- background: #fff;
- border-radius: 15rpx;
- z-index: 100;
- }
- .dialog-tit {
- font-size: 32rpx;
- color: #333;
- padding: 40rpx 0;
- text-align: center;
- }
- .dialog-btn {
- border-top: 1rpx solid #e5e5e5;
- margin-top: 40rpx;
- }
- .dia-cancel {
- width: 50%;
- font-size: 30rpx;
- color: #666;
- text-align: center;
- padding: 30rpx 0;
- box-sizing: border-box;
- border-right: 1rpx solid #e5e5e5;
- }
- .dia-confirm {
- width: 50%;
- font-size: 30rpx;
- color: #1678ff;
- text-align: center;
- padding: 30rpx 0;
- }
- </style>
|