367 lines
12 KiB
Vue
367 lines
12 KiB
Vue
<template>
|
||
<view class="farmer-order-distribution-detail" v-if="detail.id">
|
||
<uni-nav-bar :fixed="true" :shadow="false" :statusBar="true" color="#fff"
|
||
:backgroundColor="scrollTop < 20 ?``:primaryColor" leftIcon="icon-left" title="配送订单详情">
|
||
</uni-nav-bar>
|
||
<view :style="{height:`${configInfo.navBarHeight}px`}"></view>
|
||
<image mode="aspectFill" lazy-load class="common-bg abs" src="https://lbqny.migugu.com/admin/farm/bg-cash.png"></image>
|
||
<view class="pl-lg pr-lg c-base" style="height: 120rpx;">
|
||
<view class="f-sm-title text-bold pt-md">{{statusType[detail.pay_type]}}</view>
|
||
<view class="f-caption">
|
||
<block v-if="detail.pay_type == -1">已退配送费 ¥{{detail.pay_price}}</block>
|
||
<block v-if="detail.pay_type == 2">请尽快为买家配送该商品</block>
|
||
</view>
|
||
</view>
|
||
<view class="order-text-info ml-md mr-md pd-lg fill-base f-paragraph c-title box-shadow radius-24"
|
||
v-if="detail.send_type == 2">
|
||
<view @tap.stop="toMap" class="flex-warp">
|
||
<i class="iconfont icon-dingwei mr-sm" style="font-size: 28rpx;margin-top: 6rpx;"></i>
|
||
<view class="flex-1">{{detail.address}}</view>
|
||
</view>
|
||
<view @tap.stop="$util.goUrl({url:detail.mobile,openType:'call'})" class="flex-y-baseline c-caption"
|
||
style="margin:5rpx 0 0 38rpx;">{{detail.user_name}}
|
||
<view class="ml-lg">
|
||
{{detail.mobile}}
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="order-text-info mt-md ml-md mr-md pl-lg pr-lg fill-base f-paragraph c-title box-shadow radius-24">
|
||
<view class="flex-between pt-lg pb-lg">
|
||
<view class="text c-desc">配送单号</view>
|
||
<view class="flex-y-center">
|
||
<view class="max-350 ellipsis">{{detail.order_code}}</view>
|
||
<view @tap="$util.goUrl( {url:`${detail.order_code}`,openType:'copy'})"
|
||
class="copy-btn flex-center fill-body" :style="{color:primaryColor}">复制</view>
|
||
</view>
|
||
</view>
|
||
<view class="flex-between pt-lg pb-lg b-1px-t">
|
||
<view class="text c-desc">{{detail.send_type == 1 ? '自提时间':'送货时间'}}</view>
|
||
<view>{{detail.time_text}}</view>
|
||
</view>
|
||
<view class="flex-between pt-lg pb-lg b-1px-t">
|
||
<view class="text c-desc">配送方式</view>
|
||
<view>{{sendType[detail.send_type]}}</view>
|
||
</view>
|
||
<view class="flex-between pt-lg pb-lg b-1px-t" v-if="detail.send_type == 1">
|
||
<view class="text c-desc">自提人</view>
|
||
<view class="flex-y-center">
|
||
<view class="max-350">{{`${detail.user_name} ${detail.mobile}`}}</view>
|
||
<view @tap="$util.goUrl( {url:`${detail.mobile}`,openType:'call'})"
|
||
class="copy-btn flex-center fill-body" :style="{color:primaryColor}">拨打</view>
|
||
</view>
|
||
</view>
|
||
<view class="flex-between pt-lg pb-lg b-1px-t" v-if="detail.pay_type > 2 && detail.send_type == 2">
|
||
<view class="text c-desc">发货时间</view>
|
||
<view>{{detail.send_time}}</view>
|
||
</view>
|
||
<view class="flex-between pt-lg pb-lg b-1px-t" v-if="detail.pay_type == 7">
|
||
<view class="text c-desc">{{detail.send_type == 1 ? '取货时间':'收货时间'}}</view>
|
||
<view>{{detail.receiving_time}}</view>
|
||
</view>
|
||
<view class="pt-lg pb-lg b-1px-t" v-if="detail.text">
|
||
<view class="text c-desc">备注</view>
|
||
<view class="mt-sm">
|
||
<text decode="emsp" style="word-break:break-all;">{{detail.text}}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="mt-md ml-md mr-md pd-lg fill-base f-paragraph c-title box-shadow radius-24">
|
||
<view class="order-item flex-center">
|
||
<image mode="aspectFill" lazy-load class="avatar box-shadow-mini radius-24"
|
||
:src="detail[orderText[options.type]].goods_cover"></image>
|
||
<view class="flex-1 ml-lg">
|
||
<view class="f-title c-title text-bold max-490 ellipsis">
|
||
{{detail[orderText[options.type]].goods_name}}
|
||
</view>
|
||
<block v-if="options.type == 1">
|
||
<view class="f-caption c-caption mt-sm">
|
||
数量:{{`${detail[orderText[options.type]].num}/${detail[orderText[options.type]].unit}`}}
|
||
</view>
|
||
<view class="f-caption c-caption"> 配送周期:{{detail[orderText[options.type]].send_cycle}}
|
||
</view>
|
||
</block>
|
||
<block v-if="options.type == 2">
|
||
<view class="f-caption c-caption mt-sm">租赁期限:{{detail[orderText[options.type]].end_time}} 到期
|
||
</view>
|
||
<view class="f-caption c-caption"> 租赁面积:{{detail[orderText[options.type]].area}}㎡ </view>
|
||
</block>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
|
||
<view class="fill-base mt-md ml-md mr-md pl-lg pr-lg f-paragraph c-title box-shadow radius-24"
|
||
v-if="options.type == 1">
|
||
<view class="pt-lg pb-lg f-title text-bold b-1px-b">认养收获</view>
|
||
<view class="pt-lg pb-lg">
|
||
<view class="order-seed-item flex-center">
|
||
<image mode="aspectFill" lazy-load classload class="seed-img radius-10"
|
||
:src="detail.claim_order.harvest_cover"></image>
|
||
<view class="flex-1 ml-lg f-paragraph c-title ellipsis">{{detail.claim_order.harvest_text}}</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="mt-md ml-md mr-md pl-lg pr-lg fill-base f-paragraph c-title box-shadow radius-24"
|
||
v-if="options.type == 2 && detail.land_order.seed.length > 0">
|
||
<view class="pt-lg pb-lg f-title text-bold b-1px-b">种子管理</view>
|
||
<view class="pt-lg pb-lg">
|
||
<view class="order-seed-item flex-center" :class="[{'mt-md':index!=0}]"
|
||
v-for="(item,index) in detail.land_order.seed" :key="index">
|
||
<image mode="aspectFill" lazy-load classload class="seed-img radius-10" :src="item.imgs"></image>
|
||
<view class="flex-1 ml-lg c-title">
|
||
<view class="flex-between">
|
||
<view class="f-paragraph max-380 ellipsis">{{item.title}}</view>
|
||
<view class="f-caption">{{item.area}}㎡</view>
|
||
</view>
|
||
<view class="flex-between f-caption c-caption">
|
||
<view class="c-warning">¥{{item.seed_price}}</view>
|
||
<view>x{{item.num}}</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="order-text-info mt-md ml-md mr-md pl-lg pr-lg fill-base f-paragraph c-title box-shadow radius-24"
|
||
v-if="detail.send_type == 2">
|
||
<view class="flex-between pt-lg pb-lg">
|
||
<view class="text">配送费</view>
|
||
<view>¥{{detail.pay_price}}</view>
|
||
</view>
|
||
<view class="flex-between pt-lg pb-lg b-1px-t">
|
||
<view class="text">实付金额</view>
|
||
<view class="c-warning text-bold">¥{{detail.pay_price}}</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="order-text-info mt-md ml-md mr-md pd-lg fill-base f-caption c-title box-shadow radius-24">
|
||
<view class="flex-warp pt-sm">
|
||
<view class="text c-caption">订单类型</view>
|
||
<view class="flex-1">{{orderType[options.type]}}</view>
|
||
</view>
|
||
<block v-if="detail.send_type == 2">
|
||
<view class="flex-warp pt-md">
|
||
<view class="text c-caption">付款单号</view>
|
||
<view class="flex-1 flex-y-center">{{detail.transaction_id}}
|
||
<view @tap="$util.goUrl( {url:`${detail.transaction_id}`,openType:'copy'})"
|
||
class="copy-btn sm flex-center fill-body" :style="{color:primaryColor}">复制</view>
|
||
</view>
|
||
</view>
|
||
<view class="flex-warp pt-md" v-if="detail.pay_type == -1">
|
||
<view class="text c-caption">退款单号</view>
|
||
<view class="flex-1 flex-y-center">{{detail.refund_code}}
|
||
<view @tap="$util.goUrl( {url:`${detail.refund_code}`,openType:'copy'})"
|
||
class="copy-btn sm flex-center fill-body" :style="{color:primaryColor}">复制</view>
|
||
</view>
|
||
</view>
|
||
</block>
|
||
<view class="flex-warp pt-md">
|
||
<view class="text c-caption">下单时间</view>
|
||
<view class="flex-1">{{detail.create_time}}</view>
|
||
</view>
|
||
<block v-if="detail.send_type == 2">
|
||
<view class="flex-warp pt-md" v-if="detail.pay_time">
|
||
<view class="text c-caption">支付时间</view>
|
||
<view class="flex-1">{{detail.pay_time}}</view>
|
||
</view>
|
||
<view class="flex-warp pt-md" v-if="detail.pay_type == -1">
|
||
<view class="text c-caption">退款时间</view>
|
||
<view class="flex-1">{{detail.refund_time}}</view>
|
||
</view>
|
||
<view class="flex-warp pt-md">
|
||
<view class="text c-caption">支付方式</view>
|
||
<view class="flex-1">{{payType[detail.pay_model]}}</view>
|
||
</view>
|
||
</block>
|
||
</view>
|
||
|
||
<view :class="[{'space-max-footer':detail.pay_type == 2},{'space-footer':detail.pay_type != 2}]"></view>
|
||
<block v-if="detail.pay_type == 2">
|
||
<fix-bottom-button @confirm="toChangeOrder('confirm_get_item')" :text="[{type:'confirm',text: '确认取货'}]"
|
||
v-if="detail.send_type == 1">
|
||
</fix-bottom-button>
|
||
<fix-bottom-button @confirm="toChangeOrder('confirm_send_item')" :text="[{type:'confirm',text: '立即发货'}]"
|
||
v-if="detail.send_type == 2">
|
||
</fix-bottom-button>
|
||
</block>
|
||
|
||
<common-popup @confirm="confirmChangeOrder" ref="confirm_get_item" title="确认取货" desc="请确认是否取货,确认后将无法恢复"
|
||
text="确认取货" :info="popupInfo">
|
||
</common-popup>
|
||
<common-popup @confirm="confirmChangeOrder" ref="confirm_send_item" title="立即发货" desc="请确认是否发货,确认后将无法恢复"
|
||
text="确认发货" :info="popupInfo">
|
||
</common-popup>
|
||
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import {
|
||
mapState,
|
||
mapActions
|
||
} from "vuex"
|
||
export default {
|
||
components: {},
|
||
data() {
|
||
return {
|
||
scrollTop: 0,
|
||
options: {},
|
||
detail: {},
|
||
payType: {
|
||
1: '微信支付',
|
||
2: '余额支付',
|
||
3: '支付宝支付'
|
||
},
|
||
statusType: {
|
||
'-1': '已取消',
|
||
2: '待配送',
|
||
3: '配送中',
|
||
7: '已完成',
|
||
},
|
||
orderType: {
|
||
1: '认养订单',
|
||
2: '土地订单'
|
||
},
|
||
orderText: {
|
||
1: 'claim_order',
|
||
2: 'land_order'
|
||
},
|
||
sendType: {
|
||
1: '自提',
|
||
2: '快递'
|
||
},
|
||
param: {
|
||
page: 1,
|
||
},
|
||
list: {
|
||
data: []
|
||
},
|
||
loading: true,
|
||
popupInfo: {},
|
||
lockTap: false
|
||
}
|
||
},
|
||
computed: mapState({
|
||
primaryColor: state => state.config.configInfo.primaryColor,
|
||
subColor: state => state.config.configInfo.subColor,
|
||
configInfo: state => state.config.configInfo,
|
||
userInfo: state => state.user.userInfo,
|
||
}),
|
||
onLoad(options) {
|
||
this.options = options
|
||
this.$util.showLoading()
|
||
this.initIndex()
|
||
},
|
||
onPageScroll(e) {
|
||
this.scrollTop = e.scrollTop
|
||
},
|
||
methods: {
|
||
...mapActions(['getConfigInfo']),
|
||
async initIndex() {
|
||
let {
|
||
id,
|
||
type
|
||
} = this.options
|
||
let methodModel = type == 1 ? 'claim' : 'land'
|
||
let data = await this.$api[methodModel].sendOrderInfo({
|
||
id
|
||
})
|
||
this.detail = data
|
||
this.$util.hideAll()
|
||
},
|
||
initRefresh() {
|
||
this.initIndex()
|
||
},
|
||
async toMap() {
|
||
let {
|
||
lat,
|
||
lng,
|
||
address
|
||
} = this.detail
|
||
await this.$util.checkAuth({
|
||
type: 'userLocation'
|
||
})
|
||
await uni.getLocation({
|
||
type: 'gcj02',
|
||
})
|
||
await uni.openLocation({
|
||
latitude: lat * 1,
|
||
longitude: lng * 1,
|
||
name: address,
|
||
scale: 28
|
||
})
|
||
},
|
||
// 确认取货/开始配送/配送到家
|
||
async toChangeOrder(key) {
|
||
let {
|
||
id,
|
||
order_code,
|
||
} = this.detail
|
||
this.popupInfo = {
|
||
id,
|
||
name: `订单编号:${order_code}`,
|
||
image: '',
|
||
refs_key: key
|
||
}
|
||
this.$refs[key].open()
|
||
},
|
||
async confirmChangeOrder() {
|
||
let {
|
||
id,
|
||
refs_key
|
||
} = this.popupInfo
|
||
if (this.lockTap) return;
|
||
this.lockTap = true;
|
||
this.$util.showLoading()
|
||
let methodModel = {
|
||
'confirm_get_item': {
|
||
method: 'sendOrderPickup',
|
||
msg: '取货成功'
|
||
},
|
||
'confirm_send_item': {
|
||
method: 'sendOrderSend',
|
||
msg: '发货成功'
|
||
}
|
||
}
|
||
let {
|
||
method,
|
||
msg,
|
||
} = methodModel[refs_key]
|
||
try {
|
||
await this.$api.farmer[method]({
|
||
id
|
||
})
|
||
this.$util.hideAll()
|
||
this.$util.showToast({
|
||
title: msg
|
||
})
|
||
this.initRefresh()
|
||
this.$util.back()
|
||
this.lockTap = false
|
||
this.$refs[refs_key].close()
|
||
} catch (e) {
|
||
setTimeout(() => {
|
||
this.lockTap = false
|
||
this.$util.hideAll()
|
||
}, 2000)
|
||
}
|
||
},
|
||
}
|
||
}
|
||
</script>
|
||
|
||
|
||
<style lang="scss">
|
||
.farmer-order-distribution-detail {
|
||
.order-seed-item {
|
||
.seed-img {
|
||
width: 80rpx;
|
||
height: 80rpx;
|
||
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
|
||
}
|
||
}
|
||
}
|
||
</style>
|