This commit is contained in:
aihe 2024-06-03 16:45:36 +08:00
parent 3cc545157c
commit 905f639146
10 changed files with 898 additions and 1173 deletions

View File

@ -24,9 +24,9 @@
align="center"></u-text> align="center"></u-text>
</u-col> </u-col>
<u-col span="4" justify="center" align="center" custom-style="text-align: center;"> <u-col span="4" justify="center" align="center" custom-style="text-align: center;">
<image style="width: 70rpx;height: 14rpx;" :src="getCdnUrl('post/toline.png')"> <image style="width: 70rpx;height: 14rpx;" :src="getCdnUrl('search/toline.png')">
</image> </image>
<!-- getCdnUrl('post/toline-grey.png') --> <!-- getCdnUrl('search/toline-grey.png') -->
<view class="mt-10"> <view class="mt-10">
<tpx-text-dic :value="modelInfo.waybillStatus" :list="dicData.emis_waybill_status" ></tpx-text-dic> <tpx-text-dic :value="modelInfo.waybillStatus" :list="dicData.emis_waybill_status" ></tpx-text-dic>
</view> </view>

View File

@ -1,10 +1,10 @@
<template> <template>
<tpx-page>
<tpx-layout> <tpx-layout>
<template v-slot:body> <template v-slot:body>
<view class="com-jianju pos-rlt pb-30" style="padding-top: 2rpx;"> <view class="com-jianju pos-rlt pb-30" style="padding-top: 2rpx;">
<view class="blcok-white radius-20"> <view class="blcok-white radius-20">
<u-textarea v-model="submitParam.otherDes" border="none" height="110" placeholder="粘贴或输入地址,点击“智能识别”自动拆分姓名、电话和地址" custom-style="border:0;padding: 0;"></u-textarea> <u-textarea v-model="ansValue" border="none" height="110" placeholder="粘贴或输入地址,点击“智能识别”自动拆分姓名、电话和地址" custom-style="border:0;padding: 0;"></u-textarea>
<u-row justify="end"> <u-row justify="end">
<view class="mt-10"> <view class="mt-10">
<u-button @click="handleAnsText()" type="primary" size="mini" shape="circle" custom-style="width: 130rpx;font-size: 24rpx;padding:0;">智能识别</u-button> <u-button @click="handleAnsText()" type="primary" size="mini" shape="circle" custom-style="width: 130rpx;font-size: 24rpx;padding:0;">智能识别</u-button>
@ -12,11 +12,6 @@
</u-row> </u-row>
</view> </view>
<view class="mt-40">
<tpx-select placeholder="国家" v-model:value="country" :list="[]" :isWhite="true" custom-style="border:0;"
></tpx-select>
</view>
<view class="blcok-white radius-20"> <view class="blcok-white radius-20">
<view class=""> <view class="">
@ -26,34 +21,30 @@
<tpx-input v-model:value="submitParam.name" placeholder="真实姓名"></tpx-input> <tpx-input v-model:value="submitParam.name" placeholder="真实姓名"></tpx-input>
</u-col> </u-col>
<u-col offset="1" span="7"> <u-col offset="1" span="7">
<tpx-input v-model:value="submitParam.tel" placeholder="电话"></tpx-input> <tpx-input v-model:value="submitParam.phone" placeholder="电话"></tpx-input>
</u-col> </u-col>
</u-row> </u-row>
</view> </view>
<view class="mt-40"> <view class="mt-40 pos-rlt">
<tpx-select placeholder="省市区" v-model:value="country" :list="[]" custom-style="border:0;" <tpx-input :value="getAddressDetail(submitParam, false)" placeholder="所在地区"></tpx-input>
></tpx-select> <view @click="handleDialogClick(addressModal)" class="pos-abt-all"></view>
</view> </view>
<view class="mt-30"> <view class="mt-30">
<tpx-textarea v-model:value="submitParam.detail" placeholder="详细地址(例如**街道**号**)"></tpx-textarea> <tpx-textarea v-model:value="submitParam.address" placeholder="详细地址(例如**街道**号**)"></tpx-textarea>
</view> </view>
<view class="mt-30"> <view class="mt-30">
<tpx-input v-model:value="submitParam.tel" placeholder="电话"></tpx-input> <tpx-input v-model:value="submitParam.postCode" placeholder="邮编"></tpx-input>
</view> </view>
<view class="mt-30"> <view class="mt-30">
<tpx-input v-model:value="submitParam.tel" placeholder="邮编"></tpx-input> <tpx-input v-model:value="submitParam.email" placeholder="邮箱(选填"></tpx-input>
</view> </view>
<view class="mt-30"> <view class="mt-30">
<tpx-input v-model:value="submitParam.tel" placeholder="邮箱(选填"></tpx-input> <tpx-input v-model:value="submitParam.company" placeholder="公司名称(选填)"></tpx-input>
</view>
<view class="mt-30">
<tpx-input v-model:value="submitParam.tel" placeholder="公司名称(选填)"></tpx-input>
</view> </view>
</view> </view>
</view> </view>
@ -61,16 +52,17 @@
<view class="mt-30 pl-30 pr-30"> <view class="mt-30 pl-30 pr-30">
<u-row justify="between"> <u-row justify="between">
<view> <view>
<u-checkbox-group v-model="radiovalue1" placement="column" @change="handleFormChange()"> <u-checkbox-group v-model="submitParam.blDefaultFlag" placement="column">
<u-checkbox <u-checkbox
:name="true"
shape="circle" shape="circle"
size="30" label="默认地址" active-color="#B12D29" la size="30" label="默认地址" active-color="#B12D29"
label-size="28" hange="handleFormChange()" label-size="28"
> >
</u-checkbox> </u-checkbox>
</u-checkbox-group> </u-checkbox-group>
</view> </view>
<view> <view @click="handleReset">
<u-text text="清空" size="28" color="#0E0708"></u-text> <u-text text="清空" size="28" color="#0E0708"></u-text>
</view> </view>
</u-row> </u-row>
@ -85,27 +77,37 @@
</view> </view>
</template> </template>
</tpx-layout> </tpx-layout>
<buns-address-sheet v-model:show="addressModal.show" v-model:value="addressModal.values" @onSure="handleAddressChoose"></buns-address-sheet>
</tpx-page>
</template> </template>
<script> <script>
import getCdnUrl from "@/common/getCdnUrl" import { getAddressModels } from "./model"
import { import * as apiService from "@/common/api"
goto import { addressNameCodeMap } from "@/common/enum"
} from "@/common/untool" import { getAddressDetail, setAddresModalParam } from "@/common/util"
export default { export default {
props: { props: {
// hasLeftWin: {
// type: Boolean
// }
}, },
computed: { computed: {
}, },
data() { data() {
return { return {
queryOption: {
id: undefined
},
addressModal: {
show: false,
values: {
regIds: [],
regNames: []
}
},
ansValue: '',
submitParam: { submitParam: {
type: 1, ...getAddressModels(),
otherDes: ''
} }
} }
}, },
@ -115,29 +117,62 @@
// path: 'TODO' // path: 'TODO'
} }
}, },
onLoad() { onLoad(queryOption) {
this.queryOption = queryOption
this.initData(); this.initData();
}, },
onUnload() { onUnload() {
}, },
methods: { methods: {
getCdnUrl, getAddressDetail,
async initData() {
initData() { if(this.queryOption.id) {
// uni.showLoading({ let res = await apiService.getAddressById({ id: this.queryOption.id, _loading: true })
// title: '加载中' if(res.data.blDefaultFlag) {
// }); res.data.blDefaultFlag = [true]
}
// 回显 国家-省市区组件数据
this.addressModal.values = setAddresModalParam(res.data);
this.submitParam = res.data
}
}, },
handleAnsText(){
async handleAnsText(){
let res = await apiService.parseAddress({ content: this.ansValue, _loading: true })
let data = res.data || {}
this.addressModal.values = setAddresModalParam(data);
Object.assign(this.submitParam, data)
}, },
handleFormChange(){ handleAddressChoose(data) {
data.regIds.map((regId, index)=> {
}, let nameCodeMap = addressNameCodeMap[index]
handleSubmit() { this.submitParam[nameCodeMap.codeKey] = regId
this.submitParam[nameCodeMap.nameKey] = data.regNames[index]
})
},
handleReset(){
this.submitParam = getAddressModels()
this.addressModal.values = {
regIds: [],
regNames: [],
}
},
async handleSubmit() {
let params = { ...this.submitParam }
let curServiceHand = apiService.addAddress
if(this.queryOption.id) {
curServiceHand = apiService.editAddress
}
params.blDefaultFlag = Number(!!(params.blDefaultFlag && params.blDefaultFlag.length > 0));
await curServiceHand({ ...params, _loading: true })
this.showToast("操作成功")
this.goBack()
}, },
handleDialogClick(curModal) {
curModal.show = true
}
} }
} }
</script> </script>

View File

@ -1,20 +1,23 @@
<template> <template>
<tpx-page>
<tpx-layout> <tpx-layout>
<template v-slot:header> </template> <template v-slot:header> </template>
<template v-slot:body> <template v-slot:body>
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom()" class="pos-abt-all" <view class="pos-abt-all">
<tpx-scroll-view v-model:resObject="resData" :searchParam="searchParam" :getListFun="getListFun"
ref="listRef"
> >
<view class="pgb-header"> <view class="pgb-header">
<view class="com-jianju"> <view class="com-jianju">
<!-- 关键字搜索框 --> <!-- 关键字搜索框 -->
<tpx-search placeholder="请输入姓名/电话/地址关键字" v-model:value="searchParam.keyword" @change="handleSearchParamChange()" ></tpx-search> <tpx-search placeholder="请输入姓名/电话/地址关键字" v-model:value="searchParam.searchValue"></tpx-search>
</view> </view>
<view class="com-jianju" style="padding-top: 40rpx;"> <view class="com-jianju" style="padding-top: 40rpx;">
<u-row justify="between" align="top"> <u-row justify="between" align="top">
<u-col span="12"> <u-col span="12">
<tpx-tabs :list="tabList" v-model:value="searchParam.tabType" <tpx-tabs :list="tabList" v-model:value="searchParam.addressType"
@tabchange="(val)=> { handleSearchParamChange() }" v-slot="curTab" v-slot="curTab"
> >
<text slot> <text slot>
(<text>{{curTab.item.val}}</text>) (<text>{{curTab.item.val}}</text>)
@ -27,17 +30,17 @@
</view> </view>
<view class="pgb-cont"> <view class="pgb-cont">
<!-- 列表数据 --> <!-- 列表数据 -->
<view v-for="(item) in dataList" class="data-list-item"> <view v-for="(item) in resData.list" class="data-list-item">
<view @click="handleItemClick(item)"> <view @click="handleItemClick(item)">
<u-row> <u-row>
<view class="pr-20"> <view class="pr-20">
<u-text :text="'李先生'" size="30" :bold="true"></u-text> <u-text :text="item.name" size="30" :bold="true"></u-text>
</view> </view>
<view> <view>
<u-text :text="'18627068352'" size="28" mode="phone" color="#999"></u-text> <u-text :text="item.phone" size="28" mode="phone" color="#999"></u-text>
</view> </view>
</u-row> </u-row>
<u-text :text="'上海市大世界大世界大世界大世界大世界大世界大世界大世界大世界大世界大世界大世界大世界大世界大世界大世界大世界大世界大世界大世界大世界'" <u-text :text="getAddressDetail(item)"
size="24" margin="20rpx 0 0 0" color="#999" size="24" margin="20rpx 0 0 0" color="#999"
></u-text> ></u-text>
</view> </view>
@ -46,7 +49,7 @@
<u-row custom-style="margin-top:20rpx;" justify="between"> <u-row custom-style="margin-top:20rpx;" justify="between">
<u-row> <u-row>
<text class="pr-20 clr-sub">默认地址</text> <text class="pr-20 clr-sub">默认地址</text>
<u-switch v-model="item.morenTODO" @change="handleDefaultSwitch(item)" active-color="#B12D29" size="34"></u-switch> <u-switch v-model="item.blDefaultFlag" @change="handleDefaultSwitch(item)" activeValue="1" active-color="#B12D29" size="34"></u-switch>
</u-row> </u-row>
<u-row> <u-row>
<u-text @click="handleEditItem(item)" text="编辑" prefixIcon="edit-pen" size="26"></u-text> <u-text @click="handleEditItem(item)" text="编辑" prefixIcon="edit-pen" size="26"></u-text>
@ -54,18 +57,9 @@
</u-row> </u-row>
</u-row> </u-row>
</view> </view>
<!-- 加载更多 -->
<u-loadmore icon-size="28" font-size="28" margin-top="30" v-if="showLoadMore || loadedAll"
:status="loadedAll ? 'nomore' : 'loading'" />
<!-- 空数据页 -->
<view v-if="dataList.length == 0" style="padding-top: 100rpx;">
<u-empty text="无数据" :icon="getCdnUrl('kong.png')" textSize="28" width="86" height="97">
</u-empty>
</view> </view>
</tpx-scroll-view>
</view> </view>
</scroll-view>
</template> </template>
<template v-slot:footer> <template v-slot:footer>
@ -83,16 +77,18 @@
</view> </view>
</template> </template>
</tpx-layout> </tpx-layout>
</tpx-page>
</template> </template>
<script> <script>
import getCdnUrl from "@/common/getCdnUrl" import * as apiService from "@/common/api"
import { goto, goBack, setClipboardData, confirmModal, showLoading } from "@/common/untool" import { pageEventNames } from "@/common/enum"
import { getAddressDetail } from "@/common/util"
const tabList = [ const tabList = [
{ title: '收件地址', val: 1 }, { title: '寄件地址', val: 1 },
{ title: '寄件地址', val: 2 }, { title: '收件地址', val: 2 },
{ title: '其他', val: 3 } // { title: '其他', val: 3 }
] ]
export default { export default {
props: { props: {
@ -109,15 +105,16 @@
return { return {
tabList , tabList ,
searchParam: { searchParam: {
keyword: '', searchValue: '',
tabType: tabList[0].val addressType: tabList[0].val
}, },
queryOption: {}, queryOption: {
dataList: [ tab: tabList[0].val, // 当前tab
{},{},{},{},{},{},{},{} type: '', // 'choose' 选择操作
], },
showLoadMore: false, resData: {
loadedAll: false list: []
}
} }
}, },
onShareAppMessage() { onShareAppMessage() {
@ -128,61 +125,49 @@
}, },
onLoad(queryOption) { onLoad(queryOption) {
this.queryOption = queryOption this.queryOption = queryOption
this.searchParam.tabType = queryOption.tab || tabList[0].val this.searchParam.addressType = queryOption.tab || tabList[0].val
this.initData(); this.initData();
}, },
onUnload() { unmounted() {
}, },
methods: { methods: {
getCdnUrl, getAddressDetail,
initData(){ initData(){
// showLoading()
setTimeout(() => {
uni.stopPullDownRefresh();
}, 300);
},
setListData() {
}, },
getListFun: apiService.getCustomerUserAddressList,
onScrollBottom() {
console.log("onScrollBottom");
if (this.loadedAll) {
return;
}
this.showLoadMore = true;
setTimeout(() => {
this.setListData();
}, 300);
},
handleSearchMoreBtn(){
if(!this.showLoadMore) {
// 回显更多条件
Object.keys(this.tmpSearchParam).map(t=> {
this.tmpSearchParam[t] = this.searchParam[t] || ''
})
}
this.showSearchMore = !this.showSearchMore
},
handleSearchParamChange(key, val) {
if(key) {
this.searchParam[key] = val
}
},
handleItemClick(item){ handleItemClick(item){
if(this.queryOption.type == "choose") { switch(this.queryOption.type) {
goBack() case 'choose':
uni.$emit(pageEventNames.chooseAddress, {
queryOption: this.queryOption,
data: item
})
this.goBack()
break
;
} }
}, },
handleEditItem(item={}) { handleEditItem(item={}) {
goto(`address/edit?id=${item.id}`) this.goto(`address/edit?id=${item.id || ''}`)
}, },
async handleDelItem(item) { async handleDelItem(item) {
await confirmModal('确认要删除吗?') await this.confirmModal('确认要删除吗?')
await apiService.deleteAddressById({ id: item.id, _loading: true })
this.showToast('操作成功')
this.$refs.listRef.getDataList(true) // 重置到第一页数据
}, },
handleDefaultSwitch(item) { async handleDefaultSwitch(item) {
try{
await apiService.setDefaultAddressById({ id: item.id, _loading: true })
this.showToast('操作成功')
this.$refs.listRef.getDataList(true) // 重置到第一页数据
}catch(e){
// 操作失败,切回按钮状态
item.blDefaultFlag = !item.blDefaultFlag
}
}, },
} }
} }

22
pages/address/model.js Normal file
View File

@ -0,0 +1,22 @@
export const getAddressModels = () => {
return {
"remark": null,
"name": "", // 姓名
"phone": "", // 手机号
"country": "", // 国家代码
"countryName": "", // 国家名称
"province": "", // 省份code
"provinceName": "", // 省份名称
"city": "", // 城市code
"cityName": "", // 城市名称
"county": "", // 城镇 code
"countyName": "", // 城镇名称
"town": "", // 街道编号
"townName": "", // 街道名称
"address": "", // 详细地址
"postCode": "", // 邮编
"email": null,
"company": "", // 公司
"blDefaultFlag": undefined, // 是否是 默认地址
}
}

View File

@ -1,214 +1,10 @@
<template> <template>
<tpx-page>
<tpx-layout> <tpx-layout>
<template v-slot:header></template> <template v-slot:header></template>
<template v-slot:body> <template v-slot:body>
<view class="dt-block"> <view class="mt-30">
<view class="dt-tle"> <bo-detail-tmp v-model:value="submitParam" :billCode="queryOption.billCode"></bo-detail-tmp>
<view class="t1">订单号: Tw891823727001</view>
<view class="t2">
<text class="clr-prm">{{'待遗收'}}</text>
</view>
</view>
<u-line margin="20rpx 0 20rpx"></u-line>
<view>
<u-row custom-style="position:relative;" align="top"
justify="between">
<view>
<image style="height: 50rpx;width: 42rpx;" :src="getCdnUrl(`post/ji.png`)"></image>
</view>
<view style="flex: 1;padding: 0 30rpx;">
<u-text text="寄件人信息" size="28" :bold="true"></u-text>
<view style="margin: 8rpx 0 0 0;">
<u-text text="请新建您的寄件地址信息" size="26" color="#999"></u-text>
</view>
</view>
<view class="flex-column-center">
<image style="height: 32rpx;width: 28rpx;" :src="getCdnUrl(`post/eye-off.svg`)">
</image>
</view>
<view style="position: absolute;left: 20rpx;bottom: -20rpx;top: 46rpx;">
<u-line custom-style="height:100%;" direction="col" dashed="true"></u-line>
</view>
</u-row>
<view style="padding-left: 76rpx;">
<u-line margin="20rpx 0"></u-line>
</view>
<u-row custom-style="position:relative;" align="top"
justify="between">
<view style="position: absolute;left: 20rpx;top: -20rpx;bottom: 100%;">
<u-line custom-style="height:100%;" direction="col" dashed="true"></u-line>
</view>
<view>
<image style="height: 50rpx;width: 42rpx;" :src="getCdnUrl(`post/shou.png`)">
</image>
</view>
<view class="pr-30 pl-30" style="flex: 1;">
<u-text text="收件人信息" size="28" :bold="true"></u-text>
<view style="margin: 8rpx 0 0 0;">
<u-text text="请填写收件人国家、姓名,电话" size="26" color="#999"></u-text>
</view>
</view>
<view class="flex-column-center">
<image style="height: 32rpx;width: 28rpx;" :src="getCdnUrl(`post/eye-line.svg`)">
</image>
</view>
</u-row>
</view>
</view>
<view class="dt-block">
<view class="dt-tle">
<view class="t1">托寄货物描述</view>
<view class="t2">
<text class="clr-prm">{{'待确认'}}</text>
</view>
</view>
<u-line margin="20rpx 0 20rpx"></u-line>
<view v-for="(item) in ydList" class="yditem">
<view class="ydi-lab">
<text class="font-weight">女士针织棉上衣</text>
<text>预报: 300</text>
</view>
<view class="ydi-lab mt-10">
<text class="clr-sub">无 12L 中国内地</text>
<text>实入仓: 0</text>
</view>
<view class="ydi-lab mt-10">
<text class="clr-prm">12 CNY</text>
</view>
</view>
<view class="dt-item">
<view class="font-weight">
<text>总重量:50kg</text>
<text class="pl-20">总体积:50m</text>
</view>
</view>
<u-row justify="end">
<view style="display: inline-block;white-space: nowrap;" class="mt-10">
<u-row>
<u-button @click="goto(`warehousing/detail?id=${211}`)" shape="circle" type="primary"
custom-style="height: 54rpx;margin-left: 20rpx;">进仓单</u-button>
<u-button shape="circle" type="primary" :plain="true"
custom-style="height: 54rpx;margin-left: 20rpx;">补单证资料</u-button>
</u-row>
</view>
</u-row>
</view>
<view class="dt-block">
<view class="dt-tle">
<view class="t1">产品类型及费用</view>
<view class="t2">
<text class="clr-prm">{{'已付款/待付款月结'}}</text>
</view>
</view>
<u-line margin="20rpx 0 20rpx"></u-line>
<view class="blcok-grey-sm">
<view class="dt-item">
<view>
<text class="clr-sub pr-10">目的国家:</text>
<text class="">柬埔寨</text>
</view>
<view>
<text class="clr-sub pr-10">线路:</text>
<text class="">柬埔寨快递</text>
</view>
</view>
<view class="dt-item">
<view>
<text class="clr-sub pr-10">产品类型:</text>
<text class="">柬埔寨国际特快</text>
</view>
<view>
<text class="clr-sub pr-10">时效:</text>
<text class="">23天</text>
</view>
</view>
<view class="dt-item">
<view>
<text class="clr-sub pr-10">基础运费:</text>
<text class="">¥80.00</text>
</view>
<view>
<text class="clr-sub pr-10">付款方式:</text>
<text class="">寄付现结</text>
</view>
</view>
<view class="dt-item">
<view>
<text class="clr-sub pr-10">报关方式:</text>
<text class="">快递报关</text>
</view>
<view>
<text class="clr-sub pr-10">清关方式:</text>
<text class="">快递清关</text>
</view>
</view>
<view class="dt-item">
<view>
<text class="clr-sub pr-10">运费:</text>
<text class="clr-prm font-32">¥ 80.00</text>
</view>
</view>
</view>
</view>
<view class="dt-block">
<view class="dt-tle">
<view class="t1">取件信息</view>
<view class="t2">
<text class="clr-prm">{{'已付款/待付款月结'}}</text>
</view>
</view>
<u-line margin="20rpx 0 20rpx"></u-line>
<view class="blcok-grey-sm">
<view class="dt-item">
<view>
<text class="clr-sub pr-10">取货方式:</text>
<text class="">上门取件 整柜提货</text>
</view>
</view>
<view class="dt-item">
<view>
<text class="clr-sub pr-10">预约上门:</text>
<text class=""> 2023 11-22 09:00 - 10:00</text>
</view>
</view>
<view class="dt-item">
<view>
<text class="clr-sub pr-10">安排信息:</text>
<text >已安排快递员上门取货</text>
</view>
</view>
</view>
<u-line margin="20rpx 0 10rpx 0"></u-line>
<u-row justify="between">
<u-text text="快递员" size="28" :bold="true"></u-text>
<u-row>
<u-text text="李晓" size="28" :bold="true" margin="0 30rpx 0 0"></u-text>
<view>
<u-avatar size="50" :src="''"></u-avatar>
</view>
</u-row>
</u-row>
</view>
<view class="dt-block">
<view class="dt-tle">
<view class="t1">物流动态</view>
<view class="t2">
<u-button @click="goto(`post/locus?id=${222}`)" shape="circle" :plain="true" custom-style="height: 50rpx;font-size:28rpx;">查看轨迹</u-button>
</view>
</view>
<u-line margin="20rpx 0 20rpx"></u-line>
<view class="dt-item">
<buns-locus-pos :list="[{},{},{}]"></buns-locus-pos>
</view>
</view> </view>
</template> </template>
<template v-slot:footer> <template v-slot:footer>
@ -220,20 +16,23 @@
<u-button :plain="true" size="large" shape="circle" custom-style="margin: 0 10rpx;height:80rpx;font-size: 30rpx;" <u-button :plain="true" size="large" shape="circle" custom-style="margin: 0 10rpx;height:80rpx;font-size: 30rpx;"
>取消 >取消
</u-button> </u-button>
<u-button @click="goto(`post/post?id=${222}`)" type="primary" size="large" shape="circle" custom-style="margin: 0 10rpx;height:80rpx;font-size: 30rpx;" <u-button @click="goto(`post/openorder?copyBillCode=${queryOption.billCode}`)" type="primary" size="large" shape="circle" custom-style="margin: 0 10rpx;height:80rpx;font-size: 30rpx;"
>再来一单 >再来一单
</u-button> </u-button>
</u-row> </u-row>
</view> </view>
</template> </template>
</tpx-layout> </tpx-layout>
</tpx-page>
</template> </template>
<script> <script>
import getCdnUrl from "@/common/getCdnUrl" import BoDetailTmp from "@/components/buns-order-templates/bo-detail-tmp"
import { goto, goBack, setClipboardData, confirmModal, showLoading } from "@/common/untool" import * as apiService from "@/common/api"
export default { export default {
components: { BoDetailTmp },
props: { props: {
// hasLeftWin: { // hasLeftWin: {
// type: Boolean // type: Boolean
@ -243,28 +42,26 @@
}, },
data() { data() {
return { return {
ydList: [ submitParam: {},
{},{},{} queryOption: {
] billCode: '', // 运单id
},
} }
}, },
onShareAppMessage() { onShareAppMessage() {
return { return {
// title: '',
// path: 'TODO'
} }
}, },
onLoad(queryOption) { onLoad(option) {
this.queryOption = queryOption this.queryOption = option
this.initData(); this.initData();
}, },
onUnload() { onUnload() {
}, },
methods: { methods: {
goto,
getCdnUrl,
initData(){ initData(){
// showLoading()
}, },
} }
@ -280,41 +77,5 @@
</style> </style>
<style scoped lang="scss"> <style scoped lang="scss">
.dt-block {
margin-top: 30rpx;
padding: 30rpx;
background-color: #FFF;
position: relative;
}
.dt-tle {
display: flex;
flex-direction: row;
justify-content: space-between;
.t1 {
font-size: 30rpx;
font-weight: 600;
}
.t2{
font-size: 30rpx;
}
}
.dt-item {
display: flex;
flex-direction: row;
margin-bottom: 20rpx;
justify-content: space-between;
}
.yditem{
padding: 20rpx 20rpx;
background-color: #F6F6F6;
border-radius: 10rpx;
margin-bottom: 20rpx;
}
.ydi-lab{
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
</style> </style>

View File

@ -1,57 +1,11 @@
<template> <template>
<tpx-page>
<tpx-layout> <tpx-layout>
<template v-slot:body> <template v-slot:body>
<view class="com-jianju pos-rlt pb-30" style="padding-top: 2rpx;"> <view class="com-jianju pos-rlt pb-30" style="padding-top: 2rpx;">
<view class="blcok-white"> <view class="blcok-white">
<view>
<u-row @click="handleAddressChoose(1)" custom-style="position:relative;" align="top"
justify="between">
<view>
<image style="height: 50rpx;width: 42rpx;" :src="getCdnUrl(`post/ji.png`)"></image>
</view>
<view style="flex: 1;padding: 0 30rpx;">
<u-text text="寄件人信息" size="28" :bold="true"></u-text>
<view style="margin: 8rpx 0 0 0;">
<u-text text="请新建您的寄件地址信息" size="26" color="#999"></u-text>
</view>
</view>
<view class="flex-column-center">
<image style="height: 32rpx;width: 28rpx;" :src="getCdnUrl(`post/adress.png`)">
</image>
<u-text align="center" text="地址薄" size="26" :bold="true"
margin="8rpx 0 0 0"></u-text>
</view>
<view style="position: absolute;left: 20rpx;bottom: -20rpx;top: 46rpx;">
<u-line custom-style="height:100%;" direction="col" dashed="true"></u-line>
</view>
</u-row>
<view style="padding-left: 76rpx;">
<u-line margin="20rpx 0"></u-line>
</view>
<u-row @click="handleAddressChoose(2)" custom-style="position:relative;" align="top"
justify="between">
<view style="position: absolute;left: 20rpx;top: -20rpx;bottom: 100%;">
<u-line custom-style="height:100%;" direction="col" dashed="true"></u-line>
</view>
<view>
<image style="height: 50rpx;width: 42rpx;" :src="getCdnUrl(`post/shou.png`)">
</image>
</view>
<view class="pr-30 pl-30" style="flex: 1;">
<u-text text="收件人信息" size="28" :bold="true"></u-text>
<view style="margin: 8rpx 0 0 0;">
<u-text text="请填写收件人国家、姓名,电话" size="26" color="#999"></u-text>
</view>
</view>
<view class="flex-column-center">
<image style="height: 32rpx;width: 28rpx;" :src="getCdnUrl(`post/adress.png`)">
</image>
<u-text align="center" text="地址薄" size="26" :bold="true"
margin="8rpx 0 0 0"></u-text>
</view>
</u-row>
</view>
</view> </view>
<view class="blcok-white" style="padding-top: 0;padding-bottom: 0;"> <view class="blcok-white" style="padding-top: 0;padding-bottom: 0;">
@ -156,6 +110,7 @@
<buns-country-sheet v-model:show="countryModal.show" v-model:value="submitParam.countryId"></buns-country-sheet> <buns-country-sheet v-model:show="countryModal.show" v-model:value="submitParam.countryId"></buns-country-sheet>
<buns-way-sheet v-model:show="wayModal.show" v-model:value="submitParam.wayId"></buns-way-sheet> <buns-way-sheet v-model:show="wayModal.show" v-model:value="submitParam.wayId"></buns-way-sheet>
<buns-goodsize-sheet v-model:show="goodChooseModal.show" v-model:value="submitParam.goods"></buns-goodsize-sheet> <buns-goodsize-sheet v-model:show="goodChooseModal.show" v-model:value="submitParam.goods"></buns-goodsize-sheet>
</tpx-page>
</template> </template>
<script> <script>
@ -194,7 +149,7 @@
stockRoomId: '', stockRoomId: '',
countryId: '', countryId: '',
wayId: '', wayId: '',
type: sendTypeList[0].val, type: '',
paytype: '', paytype: '',
otherDes: '', otherDes: '',
prodId: 1, prodId: 1,

View File

@ -1,64 +1,32 @@
<template> <template>
<tpx-page>
<tpx-layout> <tpx-layout>
<template v-slot:header></template> <template v-slot:header></template>
<template v-slot:body> <template v-slot:body>
<div style="min-height: 100%;display: flex;flex-direction: column;"> <div style="min-height: 100%;display: flex;flex-direction: column;">
<view style="position: relative;"> <view style="position: relative;">
<map :markers="map.markers" :latitude="map.latitude" :longitude="map.longitude" <map :markers="map.markers" :latitude="map.latitude" :longitude="map.longitude"
style="width: 750rpx;height: 600rpx;" style="width: 750rpx;height: 400rpx;"
></map> ></map>
<view class="mp-address-mask"> <view class="mp-base-block">
<u-row justify="between"> <bpd-send-reciever-tmp :value="modelInfo"></bpd-send-reciever-tmp>
<u-row @click="setClipboardData(`T7080304038`)">
<view>
<u-text :text="'运单号:'+ 'T7080304038'" size="26"></u-text>
</view> </view>
<view class="pl-10">
<u-icon name="file-text" size="32" custom-style=""></u-icon>
</view>
</u-row>
<view @click="goto(`post/detail?id={${22}}`)" class="com-tag-grey">
运单信息
</view>
</u-row>
<u-row @click="handleDealItem(orItem, { type: 1 })" custom-style="margin-top: 30rpx;" justify="center"> <view class="mp-base-block blackbg" @click="makePhoneCall(modelInfo.takePieceEmployeePhone)">
<u-col span="4">
<u-text :text="'中国上海'" size="30" :bold="true" align="center"></u-text>
<u-text :text="'张三'" size="26" color="#999" margin="20rpx 0 0 0"
align="center"></u-text>
</u-col>
<u-col span="4" justify="center" align="center" custom-style="text-align: center;">
<image style="width: 70rpx;height: 14rpx;" :src="getCdnUrl('search/toline.png')">
</image>
<!-- getCdnUrl('search/toline-grey.png') -->
<u-text :text="'待付款'" align="center" size="22" margin="10rpx 0 0 0"></u-text>
</u-col>
<u-col span="4">
<u-text :text="'越南'" size="30" :bold="true" align="center"></u-text>
<u-text :text="'李四'" size="26" color="#999" margin="20rpx 0 0 0"
align="center"></u-text>
</u-col>
</u-row>
<u-text :text="'下单时间:' + '2022-04-30 15:25'" color="#999" size="24"
margin="30rpx 0 0 0"></u-text>
</view>
<view class="mp-kuadiyuan-mask" @click="handleCallTel">
<u-row justify="between"> <u-row justify="between">
<u-row> <u-row>
<tpx-image :src="getCdnUrl('post/run.png')" width="30" height="30"></tpx-image> <tpx-image :src="getCdnUrl('post/run.png')" width="30" height="30"></tpx-image>
<view class="ml-20">探路小哥 - 黎明</view> <view class="ml-20">探路小哥 - {{modelInfo.takePieceEmployeeName}}</view>
</u-row> </u-row>
<tpx-image :src="getCdnUrl('post/call.png')" width="60" height="60"></tpx-image> <tpx-image v-if="modelInfo.takePieceEmployeePhone" :src="getCdnUrl('post/call.png')" width="60" height="60"></tpx-image>
</u-row> </u-row>
</view> </view>
</view> </view>
<view class="dt-block"> <view class="dt-block mt-20">
<view class="dt-item"> <view class="mb-20">
<buns-locus-pos :list="[{},{},{},{},{}]"></buns-locus-pos> <buns-locus-pos :billCode="queryOption.billCode"></buns-locus-pos>
</view> </view>
</view> </view>
</div> </div>
@ -70,36 +38,37 @@
custom-style="margin: 0 10rpx;height:80rpx;font-size: 30rpx;"> custom-style="margin: 0 10rpx;height:80rpx;font-size: 30rpx;">
返回 返回
</u-button> </u-button>
<u-button @click="goto(`post/post?id=${222}`)" type="primary" size="large" shape="circle" <u-button @click="goto(`post/openorder?copyBillCode=${queryOption.billCode}`)" type="primary" size="large" shape="circle"
custom-style="margin: 0 10rpx;height:80rpx;font-size: 30rpx;">再来一单 custom-style="margin: 0 10rpx;height:80rpx;font-size: 30rpx;">再来一单
</u-button> </u-button>
</u-row> </u-row>
</view> </view>
</template> </template>
</tpx-layout> </tpx-layout>
</tpx-page>
</template> </template>
<script> <script>
import getCdnUrl from "@/common/getCdnUrl" import * as apiService from "@/common/api"
import BpdSendRecieverTmp from "@/components/buns-post-detail-templates/bpd-send-reciever-tmp"
import {
goto,
goBack,
setClipboardData,
confirmModal,
makePhoneCall,
showLoading
} from "@/common/untool"
export default { export default {
props: { props: {
// hasLeftWin: {
// type: Boolean
// }
}, },
computed: {}, computed: {
dicData() {
return this.$store.getters.dicData
},
},
components: { BpdSendRecieverTmp },
data() { data() {
return { return {
queryOption: {
billCode: '', // 运单id
},
modelInfo: {},
map: { map: {
latitude: 23.106574, //纬度 latitude: 23.106574, //纬度
longitude: 113.324587, //经度 longitude: 113.324587, //经度
@ -107,8 +76,8 @@
markers: [{ markers: [{
latitude: 23.106574, //纬度 latitude: 23.106574, //纬度
longitude: 113.324587, //经度 longitude: 113.324587, //经度
title: '出发地', title: '出发地------',
iconPath: getCdnUrl('mine/tousu.png'), iconPath: this.getCdnUrl('mine/kjcha.png'),
width: 50, width: 50,
height: 50, height: 50,
label: { label: {
@ -123,26 +92,20 @@
} }
}, },
onShareAppMessage() { onShareAppMessage() {
return {
// title: '',
// path: 'TODO'
}
}, },
onLoad(queryOption) { onLoad(option) {
this.queryOption = queryOption this.queryOption = option
this.initData(); this.initData();
}, },
onUnload() {}, onUnload() {},
methods: { methods: {
setClipboardData,
goBack, async initData() {
goto, let res = await apiService.getOrderDetail({billCode: this.queryOption.billCode, _loading: true})
getCdnUrl, // 通过对象合并才能修改父级 数据
initData() { Object.assign(this.modelInfo, res.data || {})
// showLoading()
},
handleCallTel() {
makePhoneCall("114")
} }
} }
} }
@ -157,18 +120,29 @@
} }
</style> </style>
<style scoped lang="scss"> <style scoped lang="scss">
.mp-address-mask, .mp-kuadiyuan-mask{
z-index: 1000; .mp-base-block{
position: absolute; margin-top: 20rpx;
left: 30rpx;
right: 30rpx;
}
.mp-address-mask{
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
top: 30rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 20rpx; border-radius: 20rpx;
position: relative;
&.blackbg{
&::after{
border-radius: 36rpx;
content: ' ';
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: #0E0708;
opacity: 0.5;
z-index: -1;
} }
}
}
.mp-kuadiyuan-mask{ .mp-kuadiyuan-mask{
padding: 12rpx 10rpx 12rpx 30rpx; padding: 12rpx 10rpx 12rpx 30rpx;
bottom: 20rpx; bottom: 20rpx;
@ -208,10 +182,4 @@
} }
} }
.dt-item {
display: flex;
flex-direction: row;
margin-bottom: 20rpx;
justify-content: space-between;
}
</style> </style>

155
pages/post/model.js Normal file
View File

@ -0,0 +1,155 @@
export const getOrderModels = () => {
return {
reciever: { // 收件人信息
country: undefined,
name: '',
phone: undefined,
province: undefined,
city: undefined,
district: undefined,
town: undefined,
address: undefined,
postCode: undefined,
email: undefined,
company: undefined
},
sender: { // 发件人信息
country: undefined,
name: '',
phone: undefined,
province: undefined,
city: undefined,
district: undefined,
town: undefined,
address: undefined,
postCode: undefined,
email: undefined,
company: undefined
},
custOrderId: undefined, // 客户单号
billCode: '', // 运单号
billCodeSub: undefined, // 子单号
orderDate: undefined,
userId: '',
openId: undefined,
paymentType: undefined, // 付款方式
calcFeeType: '1', // 计费方式
custNo: undefined, // 月结账号
transLine: '', // 路线
productType: undefined, // 产品
customsClear: undefined, // 清关方式
customsEclaration: undefined, // 报关方式
packType: undefined, // 包装类型
dispatchMethod: undefined, // 派送方式
pickupMethod: undefined, // 取件方式
pickStartDate: undefined,
pickFinishDate: undefined,
intoWarehouseCode: undefined,
intoWarehouseName: undefined,
intoWarehouseAddress: undefined,
intoWarehouseContact: undefined,
intoWarehousePhone: undefined,
intoWarehouseBillCode: undefined,
customerDeliveryBeginTime: undefined,
goodsType: undefined,
goodsInfo: undefined,
totalWeight: undefined, // 总重量 = 结算重量
totalVolume: undefined, // 总体积
parcelQty: 1, // 总件数
billWeight: undefined, // 实际重量
volumeWeight: undefined, // 体积重量 = 实际体积(立方厘米)*(1000000/泡重比) (长宽高都是按 cm 来计量的 )
currency: undefined,
settlementWeight: undefined, // 结算重量
feeWeight: undefined,
blOverLong: undefined,
blOverWeight: undefined,
overWeightNumber: undefined,
feeRemaker: undefined, // 付款方式-其他-备注
realValue: undefined,
blDispFd: undefined,
transferCode: undefined,
transferBillcode: undefined,
dispFdDate: undefined,
takePieceEmployeeCode: undefined, // 收派员
sendSiteCode: undefined, // 发件站点 -- 当前登录账号的siteCode
destinationCode: undefined, // 目的地 code
destinationProvince: undefined,
destinationCity: undefined,
destinationCounty: undefined,
dispatchUnderlingSiteCode: undefined, // 目的网点 - code
dispatchUnderlingSiteName: undefined, // 目的网点 - 名称
destinationCenterCode: undefined,
marketManCode: undefined,
payee: undefined, // 回款联系人
salesmen: undefined, // 销售员
operateEmployeeCode: undefined, // 操作员
blMessage: '1', // 寄件 短信开关
blAcceptMessage: '1', // 签收 短信开关
remark: undefined, // 备注
customerCode: undefined, // 客户code
feeItems: [ // 计费信息
// {
// feeCode: 费用类型 eg:1001,
// feeName: 费用名称:保险费,
// fee: 10,
// currency: 币种 CNY,
// quoteId: 报价ID,
// orderNum: 序号: 1,
// calcExp: 计算公式,
// addWeight: 续重,
// remark: 费用条码描述
// }
],
freight: undefined, // 计费总计
cargoList: [ // 货物列表
{
cargoQty: 1,
}
// {
// goodsCode: 货物代码:eg 123,
// goodsName: 货物名称,
// cargoQty: 货物数量: 10,
// unit: 件,
// price: 1.2,
// currency: CNY,
// nationArea: 中国,
// taxNo: 行邮税号,
// hscode: 海关编码,
// brand: 品牌,
// material: 材质,
// purpose: 用途,
// ingredients: 成分,
// goodsModel: 规格,
// orderNum: 序号,
// supplier: 供应商, //
// abnormalQty: 异常数量, //
// isSave: 是否保存 1-保存
// }
],
blPrepareInFreight: 0, // 是否入仓代垫运费 1-是 0-否
prepareInEstFee: undefined, // 入仓代垫运费
prepareInRealFee: undefined, // 代垫实际运费
prepareInExpress: undefined, // 快递公司
prepareInBillCode: undefined, // 快递单号
prepareInRemark: undefined, // 预入仓自定义标识
prepareInSupplier: undefined, // 预入仓供应商
warehouseInNo: '', // 进仓单号
goodsPics: [], // 货物图片
customerName: '', // 客户名称
transLineTypeName: '', // 线路名称
productTypeName: '', // 产品类型名称
operateEmployeeName: '', // 操作员名称
takePieceEmployeeName: '', // 收件员名称
dispatchManName: '', // 派件员名称
dispatchSiteName: '', // 派件网点名称
customerName: '', // 月结账户名称
salesmen: '', // 销售联系人名称
payee: '', // 回款联系人名称
sendSiteName: '', // 发件网点名称
destinationName: '', // 目的地名称
blSpecialQuote: 0, // 特殊报价
blSpecialGoods: 0, // 敏感物
}
}

View File

@ -1,86 +1,47 @@
<template> <template>
<tpx-page>
<tpx-layout> <tpx-layout>
<template v-slot:header> <template v-slot:header>
<view class="pgb-header"> <view class="pgb-header">
<view class="com-jianju"> <view class="com-jianju">
<!-- 关键字搜索框 --> <tpx-scan-input v-model:value="searchParam.billCode" placeholder="请输入单号或扫码"
<tpx-search placeholder="请输入运单号/订单号/进仓单号" v-model:value="searchParam.keyword" @change="handleSearchParamChange()" > @change="handleScanValChange" iconPos="right"></tpx-scan-input>
<template v-slot:rightIcon>
<u-icon @click="handleScan" name="scan" size="46" color="#B12D29"></u-icon>
</template>
</tpx-search>
</view> </view>
</view> </view>
</template> </template>
<template v-slot:body> <template v-slot:body>
<div style="min-height: 100%;display: flex;flex-direction: column;"> <div v-if="modelInfo.billCode" style="min-height: 100%;display: flex;flex-direction: column;">
<view style="position: relative;"> <view style="position: relative;">
<view class="mp-aside"> <view class="mp-aside">
<u-row justify="between"> <bpd-send-reciever-tmp :value="modelInfo"></bpd-send-reciever-tmp>
<u-row @click="setClipboardData(`T7080304038`)">
<view>
<u-text :text="'运单号:'+ 'T7080304038'" size="26"></u-text>
</view>
<view class="pl-10">
<u-icon name="file-text" size="32" custom-style=""></u-icon>
</view>
</u-row>
<view @click="goto(`post/detail?id={${22}}`)" class="com-tag-grey">
运单信息
</view>
</u-row>
<u-row @click="handleDealItem(orItem, { type: 1 })" custom-style="margin-top: 30rpx;" justify="center">
<u-col span="4">
<u-text :text="'中国上海'" size="30" :bold="true" align="center"></u-text>
<u-text :text="'张三'" size="26" color="#999" margin="20rpx 0 0 0"
align="center"></u-text>
</u-col>
<u-col span="4" justify="center" align="center" custom-style="text-align: center;">
<image style="width: 70rpx;height: 14rpx;" :src="getCdnUrl('search/toline.png')">
</image>
<!-- getCdnUrl('search/toline-grey.png') -->
<u-text :text="'待付款'" align="center" size="22" margin="10rpx 0 0 0"></u-text>
</u-col>
<u-col span="4">
<u-text :text="'越南'" size="30" :bold="true" align="center"></u-text>
<u-text :text="'李四'" size="26" color="#999" margin="20rpx 0 0 0"
align="center"></u-text>
</u-col>
</u-row>
<u-text :text="'下单时间:' + '2022-04-30 15:25'" color="#999" size="24"
margin="30rpx 0 0 0"></u-text>
</view> </view>
<view class="mp-aside"> <view class="mp-aside">
<u-row justify="between" align="top"> <view class="">
<view class="font-28 font-weight"> <bpd-pic-preview-tmp :list="modelInfo.billPicGoodsRmk" label="货物图片"></bpd-pic-preview-tmp>
签收底单
</view> </view>
<view style="width: 120rpx;">
<u-button @click="handleCheckDanJu" :plain="true" shape="circle" custom-style="margin: 0 10rpx;height:50rpx;font-size: 28rpx;"> <view class="mt-30">
查看 <bpd-pic-preview-tmp :list="modelInfo.billPicSendRmk" label="揽收底单图片"></bpd-pic-preview-tmp>
</u-button>
</view> </view>
</u-row>
<view> <view class="mt-30">
<u-row> <bpd-pic-preview-tmp :list="modelInfo.billPicDispatchRmk" label="签收底单"></bpd-pic-preview-tmp>
<u-image @click="handlePreviewDiDan()" :src="getCdnUrl(`mine/kjcha.png`)" width="100" height="50" mode="aspectFill"
custom-style="margin: 20rpx 20rpx 0 0;"
></u-image>
</u-row>
</view> </view>
</view> </view>
</view> </view>
<view class="dt-block"> <view class="dt-block">
<view class="dt-item"> <view class="mb-20">
<buns-locus-pos :list="[{},{},{},{},{}]"></buns-locus-pos> <buns-locus-pos :billCode="searchParam.billCode"></buns-locus-pos>
</view> </view>
</view> </view>
</div> </div>
<view v-if="!modelInfo.billCode">
<tpx-empty></tpx-empty>
</view>
</template> </template>
</tpx-layout> </tpx-layout>
@ -112,20 +73,15 @@
</view> </view>
</tpx-dialog> </tpx-dialog>
</tpx-page>
</template> </template>
<script> <script>
import getCdnUrl from "@/common/getCdnUrl" import { debounce } from "@/common/util"
import * as apiService from "@/common/api"
import { import BpdSendRecieverTmp from "@/components/buns-post-detail-templates/bpd-send-reciever-tmp"
goto, import BpdPicPreviewTmp from "@/components/buns-post-detail-templates/bpd-pic-preview-tmp"
goBack,
scanCode,
setClipboardData,
confirmModal,
makePhoneCall,
showLoading
} from "@/common/untool"
export default { export default {
props: { props: {
@ -133,51 +89,51 @@
// type: Boolean // type: Boolean
// } // }
}, },
computed: {}, computed: {
dicData() {
return this.$store.getters.dicData
},
},
components: { BpdSendRecieverTmp, BpdPicPreviewTmp },
data() { data() {
return { return {
queryOption: {
billCode: '', // 运单id
},
modelInfo: {
},
danCheckModal: { danCheckModal: {
show: false show: false
}, },
searchParam: { searchParam: {
keyword: '' billCode: ''
} }
} }
}, },
onShareAppMessage() { onShareAppMessage() {
return { return {
// title: '',
// path: 'TODO'
} }
}, },
onLoad(queryOption) { onLoad(option) {
this.queryOption = queryOption this.queryOption = option
this.searchParam.billCode = option.billCode
this.initData(); this.initData();
}, },
onUnload() {}, onUnload() {},
methods: { methods: {
setClipboardData,
goBack,
goto,
getCdnUrl,
initData() { initData() {
// showLoading()
},
handleCheckDanJu() {
this.danCheckModal.show = true
},
handlePreviewDiDan() {
uni.previewImage({
urls: [
this.getCdnUrl(`mine/kjcha.png`)
]
})
},
handleSearchParamChange() {
}, },
async handleScan () { handleScanValChange: debounce(function(val){
const res = await scanCode() val && (this.handleSearch(val))
}),
async handleSearch(val) {
let res = await apiService.getOrderDetail({...this.searchParam, _loading: true})
// 通过对象合并才能修改父级 数据
Object.assign(this.modelInfo, res.data || {})
}, },
handleSubmitDanCheck() { handleSubmitDanCheck() {
this.danCheckModal.show = false this.danCheckModal.show = false
@ -230,11 +186,4 @@
font-size: 30rpx; font-size: 30rpx;
} }
} }
.dt-item {
display: flex;
flex-direction: row;
margin-bottom: 20rpx;
justify-content: space-between;
}
</style> </style>

View File

@ -1,4 +1,5 @@
<template> <template>
<tpx-page>
<tpx-layout> <tpx-layout>
<template v-slot:header> <template v-slot:header>
<view class="customer_nav_bar"> <view class="customer_nav_bar">
@ -11,7 +12,7 @@
<u-row justify="between" align="top"> <u-row justify="between" align="top">
<u-col span="9"> <u-col span="9">
<!-- 订单状态 --> <!-- 订单状态 -->
<tpx-tabs :list="ordStatusList" v-model:value="searchParam.ordStatus" <tpx-tabs :list="dicData.emis_order_status" v-model:value="searchParam.ordStatus"
@tabchange="(val)=> { handleSearchParamChange() }" mode="info" v-slot="curOrdTab" @tabchange="(val)=> { handleSearchParamChange() }" mode="info" v-slot="curOrdTab"
> >
<text slot> <text slot>
@ -71,49 +72,17 @@
</view> </view>
</template> </template>
<template v-slot:body> <template v-slot:body>
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom()" class="pos-abt-all" <view class="pos-abt-all">
<tpx-scroll-view v-model:resObject="resData" :searchParam="searchParam" :getListFun="getListFun"
ref="listRef"
> >
<view class="pgb-cont"> <view class="pgb-cont">
<!-- 列表数据 --> <!-- 列表数据 -->
<view v-for="(orItem) in ordList" class="ord-list-item"> <view v-for="(item) in resData.list" class="ord-list-item">
<u-row justify="between"> <view class="mt-10">
<u-col span="11"> <bpd-send-reciever-tmp :value="item" :showInfoBtn="false"></bpd-send-reciever-tmp>
<u-row @click="handleDealItem(orItem, { type: 2 })">
<view>
<u-text :text="'运单号:'+ 'T7080304038'" size="26"></u-text>
</view> </view>
<view class="pl-10">
<u-icon name="file-text" size="32" custom-style=""></u-icon>
</view>
</u-row>
</u-col>
<u-icon @click="handleDealItem(orItem, { type: 3 })" name="trash"></u-icon>
</u-row>
<u-row @click="handleDealItem(orItem, { type: 1 })" custom-style="margin-top: 30rpx;" justify="center">
<u-col span="4">
<u-text :text="'中国上海'" size="30" :bold="true" align="center"></u-text>
<u-text :text="'张三'" size="26" color="#999" margin="20rpx 0 0 0"
align="center"></u-text>
</u-col>
<u-col span="4" justify="center" align="center" custom-style="text-align: center;">
<image style="width: 70rpx;height: 14rpx;" :src="getCdnUrl('search/toline.png')">
</image>
<!-- getCdnUrl('search/toline-grey.png') -->
<u-text :text="'待付款'" align="center" size="22" margin="10rpx 0 0 0"></u-text>
</u-col>
<u-col span="4">
<u-text :text="'越南'" size="30" :bold="true" align="center"></u-text>
<u-text :text="'李四'" size="26" color="#999" margin="20rpx 0 0 0"
align="center"></u-text>
</u-col>
</u-row>
<u-text :text="'签收时间:' + '2022-04-30 15:25'" color="#999" size="24"
margin="30rpx 0 0 0"></u-text>
<u-line color="#DEDEDE" margin="30rpx 0 0 0"></u-line> <u-line color="#DEDEDE" margin="30rpx 0 0 0"></u-line>
<u-row justify="end" custom-style="margin-top:20rpx;"> <u-row justify="end" custom-style="margin-top:20rpx;">
<view style="display: inline-block;white-space: nowrap;"> <view style="display: inline-block;white-space: nowrap;">
<u-row> <u-row>
@ -122,47 +91,38 @@
<u-button @click="goto(`post/post?id=${222}`)" shape="circle" type="primary" <u-button @click="goto(`post/post?id=${222}`)" shape="circle" type="primary"
custom-style="height: 54rpx;margin-left: 12rpx;">再来一单</u-button> custom-style="height: 54rpx;margin-left: 12rpx;">再来一单</u-button>
<!-- <u-button shape="circle" type="primary" :plain="true" custom-style="height: 54rpx;margin-left: 16rpx;">单据</u-button> --> <!-- <u-button shape="circle" type="primary" :plain="true" custom-style="height: 54rpx;margin-left: 16rpx;">单据</u-button> -->
<u-button @click="handleDealItem(orItem, { type: 4 })" shape="circle" type="primary" <u-button @click="handleDealItem(item, { type: 4 })" shape="circle" type="primary"
:plain="true" custom-style="height: 54rpx;margin-left: 12rpx;">取消</u-button> :plain="true" custom-style="height: 54rpx;margin-left: 12rpx;">取消</u-button>
<u-button @click="goto(`bill/detail?id=${222}`)" shape="circle" type="primary" :plain="true" <u-button @click="goto(`bill/detail?id=${222}`)" shape="circle" type="primary" :plain="true"
custom-style="height: 54rpx;margin-left: 12rpx;">去付款</u-button> custom-style="height: 54rpx;margin-left: 12rpx;">去付款</u-button>
</u-row> </u-row>
</view> </view>
</u-row> </u-row>
</view>
<!-- 加载更多 -->
<u-loadmore icon-size="28" font-size="28" margin-top="30" v-if="showLoadMore || loadedAll"
:status="loadedAll ? 'nomore' : 'loading'" />
<!-- 空数据页 -->
<view v-if="ordList.length == 0" style="padding-top: 100rpx;">
<u-empty text="无数据" :icon="getCdnUrl('kong.png')" textSize="28" width="86" height="97">
</u-empty>
</view> </view>
</view> </view>
</scroll-view> </tpx-scroll-view>
</view>
</template> </template>
</tpx-layout> </tpx-layout>
<!-- 日历 --> <!-- 日历 -->
<!-- @close="handleSwitchCladar()" --> <!-- @close="handleSwitchCladar()" -->
<u-calendar title="请选择日期范围" color="#B12D29" mode="range" rowHeight="90" closeOnClickOverlay :show="showCladar" :defaultDate="tmpSearchParam.date.split('~')" @confirm="handleClaOk" @close="handleSwitchCladar" <!-- <u-calendar title="请选择日期范围" color="#B12D29" mode="range" rowHeight="90" closeOnClickOverlay :show="showCladar" :defaultDate="tmpSearchParam.date.split('~')" @confirm="handleClaOk" @close="handleSwitchCladar"
></u-calendar> ></u-calendar> -->
</tpx-page>
</template> </template>
<script> <script>
import getCdnUrl from "@/common/getCdnUrl" import * as apiService from "@/common/api"
import { goto, setClipboardData, confirmModal, showLoading } from "@/common/untool" import BpdSendRecieverTmp from "@/components/buns-post-detail-templates/bpd-send-reciever-tmp"
export default { export default {
props: { props: {
// hasLeftWin: {
// type: Boolean
// }
}, },
computed: { computed: {
dicData() {
return this.$store.getters.dicData
},
hasExtSchParam() { hasExtSchParam() {
let hasExt = false let hasExt = false
const searchParam = this.searchParam const searchParam = this.searchParam
@ -176,128 +136,63 @@
return hasExt return hasExt
}, },
}, },
components: { BpdSendRecieverTmp },
data() { data() {
let { dicData } = this.$store.getters
return { return {
searchParam: {
keyword: '',
ordStatus: ordStatusList[0].val // 订单状态, 1:寄件; 2:收件; 3:待付款;
},
showSearchMore: false, showSearchMore: false,
showCladar: false, showCladar: false,
tmpSearchParam: { tmpSearchParam: {
}, },
ordList: [ searchParam: {
{} keyword: '',
// ,{},{},{},{},{},{},{} ordStatus: dicData.emis_order_status[0].val
], },
showLoadMore: false, queryOption: {
loadedAll: false
},
resData: {
list: []
}
} }
}, },
onShareAppMessage() { onShareAppMessage() {
return { return {
// title: '',
// path: 'TODO'
} }
}, },
onLoad() { onLoad(option) {
this.initTmpSrchParam() this.queryOption = option
this.initData(); this.initData();
}, },
onUnload() { onUnload() {
}, },
methods: { methods: {
getCdnUrl, getListFun: apiService.getOrderList,
goto,
initData(){ initData(){
// showLoading()
setTimeout(() => {
uni.stopPullDownRefresh();
}, 300);
},
initTmpSrchParam(){
this.tmpSearchParam = {
postStatus: [], // 快递状态
payType: [], // 支付类型
dateType: '', // 日期类型
date: '' // 日期
}
},
loadListData() {
// 请求列表数据 TODO
console.log('====this.searchParam===', this.searchParam)
},
onScrollBottom() {
console.log("onScrollBottom");
if (this.loadedAll) {
return;
}
this.showLoadMore = true;
this.handleSearchParamChange();
},
handleSearchMoreBtn(){
if(!this.showLoadMore) {
// 回显更多条件
Object.keys(this.tmpSearchParam).map(t=> {
const val = this.searchParam[t]
typeof val != 'undefined' && (this.tmpSearchParam[t] = val)
})
}
this.showSearchMore = !this.showSearchMore
},
handleSearchParamChange(key, val) {
if(key) {
this.searchParam[key] = val
}
this.loadListData()
}, },
async handleDealItem(item, deal = { type: '1' }) { async handleDealItem(item, deal = { type: '1' }) {
let itemQuery = `?billCode=${item.billCode || ''}&orderSn=${item.orderSn || ''}`
switch (deal.type){ switch (deal.type){
case 1: // 跳转 case 1: // 跳转
goto(`post/detail?id=${item.id}`) this.goto(`post/detail${itemQuery}`)
break; break;
case 2: // 复制订单号 case 2: // 复制订单号
setClipboardData('xxxxxxx') this.setClipboardData(item.billCode || item.orderSn)
break; break;
case 3: // 删除 case 3: // 删除
await confirmModal('确认要删除吗?') await this.confirmModal('确认要删除吗?')
break; break;
case 4: // 取消 case 4: // 取消
await confirmModal('确认要取消吗?') await this.confirmModal('确认要取消吗?')
break; break;
default: default:
break; break;
} }
}, },
handleResetTempSearch(){ handleSearchParamChange() {
this.initTmpSrchParam()
},
handleConfirmTempSearch(){
Object.assign(this.searchParam, this.tmpSearchParam)
this.showSearchMore = false
this.handleSearchParamChange();
},
handleCheckDate(item) {
let newVal = item.val
if(newVal == dateTypeEnum.custom) {
this.handleSwitchCladar()
} else {
this.tmpSearchParam.date = ''
}
},
handleClaOk(res){
const ary = Object.values(res)
const val = [ary[0], ary[ary.length-1]].join("~")
this.handleSwitchCladar()
this.tmpSearchParam.date = val
},
handleSwitchCladar() {
this.showCladar = !this.showCladar
if(!this.showCladar) {
!this.tmpSearchParam.date && (this.tmpSearchParam.dateType = '')
}
} }
} }
} }