源文件
This commit is contained in:
20
pages/plugins/delivery/logistics/logistics.css
Normal file
20
pages/plugins/delivery/logistics/logistics.css
Normal file
@@ -0,0 +1,20 @@
|
||||
.map-container {
|
||||
height: 100vh;
|
||||
}
|
||||
.team {
|
||||
left: 20rpx;
|
||||
bottom: calc(env(safe-area-inset-bottom) + 20rpx);
|
||||
width: calc(100% - 40rpx);
|
||||
background-color: rgb(255 255 255 / 0.85);
|
||||
}
|
||||
.team .base .avatar {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.team .tel {
|
||||
right: 20rpx;
|
||||
top: calc(50% - 27rpx);
|
||||
line-height: 54rpx;
|
||||
height: 54rpx;
|
||||
width: 54rpx;
|
||||
}
|
||||
169
pages/plugins/delivery/logistics/logistics.vue
Normal file
169
pages/plugins/delivery/logistics/logistics.vue
Normal file
@@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<block v-if="data_list_loding_status == 3">
|
||||
<view class="map-container pr">
|
||||
<map class="wh-auto ht-auto"
|
||||
:enable-zoom="true"
|
||||
:enable-scroll="true"
|
||||
:show-location="true"
|
||||
:latitude="latitude"
|
||||
:longitude="longitude"
|
||||
:scale="scale"
|
||||
:markers="markers"
|
||||
:polyline="polyline"
|
||||
></map>
|
||||
<view class="team bs-bb oh pa border-radius-main padding-main">
|
||||
<view class="top pr">
|
||||
<view class="base">
|
||||
<image class="avatar circle br va-m" :src="team.work_photo" mode="aspectFit"></image>
|
||||
<text class="cr-base text-size-sm margin-left-sm">{{team.idcard_name}}</text>
|
||||
</view>
|
||||
<view v-if="(team.user.mobile || null) != null" class="tel circle bg-base br tc cp pa" data-event="tel" :data-value="team.user.mobile" @tap="text_event">
|
||||
<uni-icons type="phone" size="34rpx" color="#fd8008"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="br-t-dashed margin-top-sm padding-top-sm text-size-sm cr-base">
|
||||
<view>
|
||||
<text>{{$t('logistics.logistics.dxu6ql')}}</text>
|
||||
<text v-if="(start_delivery_time || null) != null">{{start_delivery_time}}</text>
|
||||
<text v-else class="cr-grey-9">{{$t('logistics.logistics.5542tq')}}</text>
|
||||
</view>
|
||||
<view class="margin-top-sm">
|
||||
<text>{{$t('logistics.logistics.895ug2')}}</text>
|
||||
<text v-if="(success_delivery_time || null) != null">{{success_delivery_time}}</text>
|
||||
<text v-else class="cr-grey-9">{{$t('logistics.logistics.76q0ii')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from "@/components/no-data/no-data";
|
||||
import componentBottomLine from "@/components/bottom-line/bottom-line";
|
||||
|
||||
var plugins_static_url = app.globalData.get_static_url('delivery', true);
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
params: {},
|
||||
scale: 10,
|
||||
latitude: 39.909,
|
||||
longitude: 116.39742,
|
||||
markers: [],
|
||||
polyline: [],
|
||||
team: null,
|
||||
start_delivery_time: null,
|
||||
success_delivery_time: null,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
this.get_data();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
this.setData({
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("logistics", "order", "delivery"),
|
||||
method: "POST",
|
||||
data: this.params,
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
latitude: data.latitude || 39.909,
|
||||
longitude: data.longitude || 116.39742,
|
||||
markers: data.markers || [],
|
||||
polyline: data.polyline || [],
|
||||
scale: data.scale || 10,
|
||||
team: data.team || null,
|
||||
start_delivery_time: data.start_delivery_time || null,
|
||||
success_delivery_time: data.success_delivery_time || null,
|
||||
data_list_loding_status: 3,
|
||||
data_list_loding_msg: ''
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: res.data.msg
|
||||
});
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips')
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 文本事件
|
||||
text_event(e) {
|
||||
app.globalData.text_event_handle(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./logistics.css";
|
||||
</style>
|
||||
48
pages/plugins/delivery/order-detail/order-detail.css
Normal file
48
pages/plugins/delivery/order-detail/order-detail.css
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 商品信息
|
||||
*/
|
||||
.goods-base {
|
||||
min-height: 160rpx;
|
||||
margin-left: 180rpx;
|
||||
}
|
||||
.goods .goods-item:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
.goods-image {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 地址信息
|
||||
*/
|
||||
.address-base,
|
||||
.address-detail {
|
||||
padding: 10rpx 0;
|
||||
}
|
||||
.address-detail .icon {
|
||||
width: 30rpx;
|
||||
height: 35rpx !important;
|
||||
}
|
||||
.address-detail .text {
|
||||
width: calc(100% - 40rpx);
|
||||
}
|
||||
.address-detail .text {
|
||||
line-height: 36rpx;
|
||||
}
|
||||
.address-alias,
|
||||
.address-map-submit {
|
||||
padding: 0 15rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片列表
|
||||
*/
|
||||
.images-list .item-images {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.images-list .item-images:not(:last-child) {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
261
pages/plugins/delivery/order-detail/order-detail.vue
Normal file
261
pages/plugins/delivery/order-detail/order-detail.vue
Normal file
@@ -0,0 +1,261 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="detail != null">
|
||||
<view class="padding-horizontal-main padding-top-main">
|
||||
<!-- 发货地址 -->
|
||||
<view v-if="(detail.warehouse_address || null) != null" class="bg-white padding-main border-radius-main spacing-mb">
|
||||
<view class="br-b padding-bottom-sm fw-b text-size">{{$t('order.order.jhgfd1')}}</view>
|
||||
<view class="address-base oh margin-top-sm">
|
||||
<text v-if="(detail.warehouse_address.alias || null) != null" class="address-alias round br-main cr-main bg-white margin-right-sm">{{detail.warehouse_address.alias}}</text>
|
||||
<text data-event="copy" :data-value="detail.warehouse_address.name" @tap="text_event">{{detail.warehouse_address.name}}</text>
|
||||
<text class="fr" data-event="tel" :data-value="detail.warehouse_address.tel" @tap="text_event">{{detail.warehouse_address.tel}}</text>
|
||||
</view>
|
||||
<view class="address-detail oh margin-bottom-main">
|
||||
<image class="icon fl" :src="common_static_url+'map-icon.png'" mode="widthFix"></image>
|
||||
<view class="text fr">
|
||||
<text data-event="copy" :data-value="detail.warehouse_address.address_info" @tap="text_event">{{detail.warehouse_address.address_info}}</text>
|
||||
<text v-if="(detail.warehouse_address.lng || 0) != 0 && (detail.warehouse_address.lat || 0) != 0" class="address-map-submit cr-base br round bg-white margin-left-sm text-size-xs" @tap="address_map_event">{{$t('user-order-detail.user-order-detail.7lp6gw')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="address-divider margin-bottom-sm"></view>
|
||||
</view>
|
||||
|
||||
<!-- 收货地址 -->
|
||||
<view v-if="(detail.user_address || null) != null" class="bg-white padding-main border-radius-main spacing-mb">
|
||||
<view class="br-b padding-bottom-sm fw-b text-size">{{$t('order.order.hbvwq4')}}</view>
|
||||
<view class="address-base oh margin-top-sm">
|
||||
<text v-if="(detail.user_address.alias || null) != null" class="address-alias round br-main cr-main bg-white margin-right-sm">{{detail.user_address.alias}}</text>
|
||||
<text data-event="copy" :data-value="detail.user_address.name" @tap="text_event">{{detail.user_address.name}}</text>
|
||||
<text class="fr" data-event="tel" :data-value="detail.user_address.tel" @tap="text_event">{{detail.user_address.tel}}</text>
|
||||
</view>
|
||||
<view v-if="(detail.user_address.appoint_time || null) != null" class="cr-red margin-top-xs">{{detail.user_address.appoint_time}}</view>
|
||||
<view class="address-detail oh margin-bottom-main">
|
||||
<image class="icon fl" :src="common_static_url+'map-icon.png'" mode="widthFix"></image>
|
||||
<view class="text fr">
|
||||
<text data-event="copy" :data-value="detail.user_address.address_info" @tap="text_event">{{detail.user_address.address_info}}</text>
|
||||
<text v-if="(detail.user_address.lng || 0) != 0 && (detail.user_address.lat || 0) != 0" class="address-map-submit cr-base br round bg-white margin-left-sm text-size-xs" @tap="address_map_event">{{$t('user-order-detail.user-order-detail.7lp6gw')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="address-divider margin-bottom-sm"></view>
|
||||
</view>
|
||||
|
||||
<!-- 基础信息 -->
|
||||
<view v-if="detail_list.length > 0" class="panel-item padding-main border-radius-main bg-white spacing-mb">
|
||||
<view class="br-b padding-bottom-main fw-b text-size">{{$t('order-detail.order-detail.9er1pc')}}</view>
|
||||
<view class="panel-content oh">
|
||||
<view v-for="(item, index) in detail_list" :key="index" class="item br-b-dashed oh padding-vertical-main">
|
||||
<view class="title fl padding-right-main cr-gray">{{item.name}}</view>
|
||||
<view class="content fl br-l padding-left-main">
|
||||
<block v-if="(item.type || null) == 'images-list'">
|
||||
<view v-if="(item.value || null) != null && item.value.length > 0" class="images-list">
|
||||
<block v-for="(iv, ii) in item.value" :key="ii">
|
||||
<image class="item-images radius fl dis-block br padding-xs" :src="iv" mode="aspectFit" :data-ii="ii" @tap="images_list_event"></image>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<block v-if="(item.event || null) == null">
|
||||
<text>{{item.value}}</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view data-event="copy" :data-value="item.value" @tap="text_event">{{item.value}}</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品列表 -->
|
||||
<view v-if="detail.goods_data.length > 0" class="goods bg-white padding-main border-radius-main spacing-mb">
|
||||
<view class="br-b padding-bottom-main fw-b text-size">{{$t('user-order-detail.user-order-detail.7f8p26')}}</view>
|
||||
<view v-for="(item, index) in detail.goods_data" :key="index" class="goods-item br-b-dashed oh padding-main">
|
||||
<view :data-value="item.goods_url" @tap="url_event" class="cp">
|
||||
<image class="goods-image fl radius" :src="item.images" mode="aspectFill"></image>
|
||||
<view class="goods-base pr">
|
||||
<view class="multi-text">{{item.title}}</view>
|
||||
<view v-if="item.spec != null" class="margin-top-sm">
|
||||
<block v-for="(sv, si) in item.spec" :key="si">
|
||||
<text v-if="si > 0" class="cr-grey padding-left-xs padding-right-xs">;</text>
|
||||
<text class="cr-gray">{{sv.value}}</text>
|
||||
</block>
|
||||
</view>
|
||||
<view class="margin-top-sm">
|
||||
<text class="fw-b">{{detail.currency_data.currency_symbol}}{{item.price}}</text>
|
||||
<text class="margin-left-sm">x{{item.buy_number}}</text>
|
||||
</view>
|
||||
<view v-if="detail.is_can_launch_aftersale == 1 && (item.orderaftersale_btn_text || null) != null" class="orderaftersale-btn-text cr-blue pa bg-white" @tap.stop="orderaftersale_event" :data-oid="detail.id" :data-did="item.id">{{item.orderaftersale_btn_text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-top-main tr cr-base text-size">
|
||||
<text>{{$t('user-order-detail.user-order-detail.423rmr')}}<text class="fw-b">{{detail.buy_number_count}}</text>{{$t('user-order-detail.user-order-detail.41ty94')}}<text class="sales-price margin-right-xs">{{detail.currency_data.currency_symbol}}{{detail.total_price}}</text></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from "@/components/no-data/no-data";
|
||||
import componentBottomLine from "@/components/bottom-line/bottom-line";
|
||||
|
||||
var common_static_url = app.globalData.get_static_url('common');
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
common_static_url: common_static_url,
|
||||
params: null,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
detail: null,
|
||||
detail_list: []
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.init();
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
this.setData({
|
||||
data_list_loding_status: 1
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("detail", "order", "delivery"),
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: this.params.id
|
||||
},
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
detail: data.data,
|
||||
detail_list: [
|
||||
{ name: this.$t('order-detail.order-detail.36op8f'), value: data.data.main_order_no || '', event: 'copy' },
|
||||
{ name: this.$t('order-detail.order-detail.ygvc34'), value: data.data.merchant_name || '' },
|
||||
{ name: this.$t('order-detail.order-detail.x3ge6c'), value: data.data.total_price || '' },
|
||||
{ name: this.$t('order-detail.order-detail.8n1f72'), value: data.data.buy_number_count || '' },
|
||||
{ name: this.$t('order-detail.order-detail.2443o1'), value: data.data.status_name || '' },
|
||||
{ name: this.$t('order-detail.order-detail.342sfz'), value: data.data.start_delivery_time || '' },
|
||||
{ name: this.$t('order-detail.order-detail.2dw4gd'), value: data.data.success_delivery_time || '' },
|
||||
{ name: this.$t('order-detail.order-detail.r3bg45'), value: data.data.success_delivery_msg || '' },
|
||||
{ name: this.$t('order-detail.order-detail.521pp4'), value: data.data.success_delivery_images || '', type: 'images-list' },
|
||||
{ name: this.$t('order-detail.order-detail.u745i8'), value: data.data.abnormal_delivery_time || '' },
|
||||
{ name: this.$t('order.order.865029'), value: data.data.reason || '' },
|
||||
{ name: this.$t('order-detail.order-detail.5fq8pr'), value: data.data.add_time || '' },
|
||||
{ name: this.$t('common.upd_time'), value: data.data.upd_time || '' },
|
||||
],
|
||||
data_list_loding_status: 3,
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_msg: ''
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_msg: res.data.msg
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'init')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips')
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 图片列表查看
|
||||
images_list_event(e) {
|
||||
var ii = e.currentTarget.dataset.ii;
|
||||
uni.previewImage({
|
||||
current: this.detail.success_delivery_images[ii],
|
||||
urls: this.detail.success_delivery_images
|
||||
});
|
||||
},
|
||||
|
||||
// 文本事件
|
||||
text_event(e) {
|
||||
app.globalData.text_event_handle(e);
|
||||
},
|
||||
|
||||
// 地图查看
|
||||
address_map_event(e) {
|
||||
if ((this.detail.user_address || null) == null) {
|
||||
app.globalData.showToast(this.$t('user-order-detail.user-order-detail.i876o3'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// 打开地图
|
||||
var data = this.detail.user_address;
|
||||
var name = data.alias || data.name || '';
|
||||
app.globalData.open_location(data.lng, data.lat, name, data.address_info);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './order-detail.css';
|
||||
</style>
|
||||
62
pages/plugins/delivery/order/order.css
Normal file
62
pages/plugins/delivery/order/order.css
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 头部
|
||||
*/
|
||||
.header {
|
||||
height: 160rpx;
|
||||
}
|
||||
.nav-base .item {
|
||||
width: 20%;
|
||||
}
|
||||
.nav-base .item .badge-icon {
|
||||
top: -18rpx;
|
||||
left: calc(50% + 52rpx);
|
||||
z-index: 1;
|
||||
}
|
||||
.nav-search .search-keywords {
|
||||
margin-right: 80rpx;
|
||||
}
|
||||
.nav-search .map-submit {
|
||||
top: 0;
|
||||
right: 20rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
.scroll-box {
|
||||
height: calc(100vh - 160rpx);
|
||||
}
|
||||
.data-list .address-info {
|
||||
width: calc(100% - 58rpx);
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
}
|
||||
.data-list .address-info .icon-item {
|
||||
right: 0;
|
||||
top: -6rpx;
|
||||
line-height: 54rpx;
|
||||
height: 54rpx;
|
||||
width: 54rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 地图
|
||||
*/
|
||||
.map-container {
|
||||
height: calc(100vh - 160rpx);
|
||||
}
|
||||
.map-container .map-markers-active-data {
|
||||
background-color: rgb(255 255 255 / 0.85);
|
||||
width: calc(100% - 40rpx);
|
||||
left: 20rpx;
|
||||
bottom: 20rpx;
|
||||
line-height: 58rpx;
|
||||
box-shadow: 0 0 20rpx rgba(50,55,58,0.2);
|
||||
}
|
||||
.map-container .map-markers-active-data .map-send-icon {
|
||||
right: 0;
|
||||
top: calc(50% - 22rpx);
|
||||
line-height: 54rpx;
|
||||
height: 54rpx;
|
||||
width: 54rpx;
|
||||
}
|
||||
853
pages/plugins/delivery/order/order.vue
Normal file
853
pages/plugins/delivery/order/order.vue
Normal file
@@ -0,0 +1,853 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="nav_type_list.length > 0" class="header bg-white">
|
||||
<!-- 导航 -->
|
||||
<view class="nav-base">
|
||||
<block v-for="(item, index) in nav_type_list" :key="index">
|
||||
<view :class="'item fl tc pr ' + (nav_type_index == index ? 'cr-main' : '')" :data-index="index" @tap="nav_event">
|
||||
<text>{{ item.name }}</text>
|
||||
<view class="badge-icon pa">
|
||||
<component-badge :propNumber="item.count || 0"></component-badge>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 关键字搜索 -->
|
||||
<view class="padding-horizontal-main padding-bottom-main margin-top-xs pr nav-search">
|
||||
<view class="search-keywords">
|
||||
<component-search
|
||||
@onsearch="search_submit_event"
|
||||
:propIsOnEvent="true"
|
||||
:propIsRequired="false"
|
||||
:propPlaceholder="$t('order.order.725882')"
|
||||
propClass="br"
|
||||
:propIsBtn="true"
|
||||
:propDefaultValue="search_input_keywords_value"
|
||||
<!-- #ifdef MP || APP -->
|
||||
propIcon="icon-scan"
|
||||
propIconColor="#333"
|
||||
@onicon="search_icon_event"
|
||||
:propIsIconOnEvent="true"
|
||||
<!-- #endif -->
|
||||
></component-search>
|
||||
<view class="map-submit pa" data-event="copy" @tap="map_show_type_event">
|
||||
<uni-icons :type="(show_type == 0) ? 'map' : 'list'" size="56rpx" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<scroll-view v-if="show_type == 0" :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<block v-if="data_list.length > 0">
|
||||
<view class="data-list padding-horizontal-main padding-top-main">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="item padding-main border-radius-main oh bg-white spacing-mb">
|
||||
<view class="base oh br-b padding-bottom-main">
|
||||
<text class="cr-base">{{ item.add_time_concise || item.add_time }}</text>
|
||||
<text :class="'fr ' + (item.status == 4 ? 'cr-red' : item.status == 3 ? 'cr-green' : item.status == 2 ? 'cr-main' : 'cr-grey')">{{ item.status_name }}</text>
|
||||
</view>
|
||||
<view class="content margin-top">
|
||||
<view class="oh margin-top-sm">
|
||||
<view class="single-text fl" data-event="copy" :data-value="item.main_order_no" @tap="text_event">
|
||||
<text class="cr-grey">{{$t('order.order.232ygr')}}</text>
|
||||
<text class="cr-base margin-left-sm">{{ item.main_order_no }}</text>
|
||||
</view>
|
||||
<view class="single-text fr" data-event="copy" :data-value="item.main_order_id" @tap="text_event">
|
||||
<text class="cr-grey">{{$t('order.order.71n22h')}}</text>
|
||||
<text class="cr-base margin-left-sm">{{ item.main_order_id }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="(item.warehouse_address || null) != null" class="margin-top">
|
||||
<view class="cr-grey-d tc">{{$t('order.order.jhgfd1')}}</view>
|
||||
<view class="cr-base margin-top-xs">
|
||||
<view>
|
||||
<text data-event="copy" :data-value="item.warehouse_address.name" @tap="text_event">{{item.warehouse_address.name}}</text>
|
||||
<text class="margin-left-xl" data-event="copy" :data-value="item.warehouse_address.tel" @tap="text_event">{{item.warehouse_address.tel}}</text>
|
||||
<text v-if="(item.merchant_name || null) != null" class="fr" data-event="copy" :data-value="item.merchant_name" @tap="text_event">{{item.merchant_name}}</text>
|
||||
</view>
|
||||
<view class="pr margin-top-xs">
|
||||
<view class="address-info">
|
||||
<text class="cr-base" data-event="copy" :data-value="item.warehouse_address.address_info" @tap="text_event">{{ item.warehouse_address.address_info }}</text>
|
||||
<view v-if="(item.warehouse_address.lng || 0) != 0 && (item.warehouse_address.lat || 0) != 0" class="icon-item bg-base circle dis-inline-block tc cp pa" data-type="warehouse_address" :data-index="index" @tap.stop="address_map_event">
|
||||
<uni-icons type="paperplane-filled" size="32rpx" color="#666"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="(item.user_address || null) != null" class="margin-top">
|
||||
<view class="cr-grey-d tc">{{$t('order.order.hbvwq4')}}</view>
|
||||
<view class="cr-base margin-top-xs">
|
||||
<view>
|
||||
<text data-event="copy" :data-value="item.user_address.name" @tap="text_event">{{item.user_address.name}}</text>
|
||||
<text class="margin-left-xl" data-event="copy" :data-value="item.user_address.tel" @tap="text_event">{{item.user_address.tel}}</text>
|
||||
</view>
|
||||
<view v-if="(item.user_address.extraction_contact_name || null) != null || (item.user_address.extraction_contact_tel || null) != null" class="padding-vertical-xs">
|
||||
<text v-if="(item.user_address.extraction_contact_name || null) != null" class="margin-right-xl">{{item.user_address.extraction_contact_name}}</text>
|
||||
<text v-if="(item.user_address.extraction_contact_tel || null) != null">{{item.user_address.extraction_contact_tel}}</text>
|
||||
</view>
|
||||
<view v-if="(item.user_address.appoint_time || null) != null" class="cr-red padding-vertical-xs">{{item.user_address.appoint_time}}</view>
|
||||
<view class="pr margin-top-xs">
|
||||
<view class="address-info">
|
||||
<text class="cr-base" data-event="copy" :data-value="item.user_address.address_info" @tap="text_event">{{ item.user_address.address_info }}</text>
|
||||
<view v-if="(item.user_address.lng || 0) != 0 && (item.user_address.lat || 0) != 0" class="icon-item bg-base circle dis-inline-block tc cp pa" data-type="user_address" :data-index="index" @tap.stop="address_map_event">
|
||||
<uni-icons type="paperplane-filled" size="32rpx" color="#666"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-lg padding-top-sm">
|
||||
<text>{{ item.describe }}</text>
|
||||
<text v-if="(item.distance || null) != null" class="fr cr-grey">{{$t('extraction-address.extraction-address.42v8tv')}}{{ item.distance }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-operation tr br-t padding-top-main margin-top-main">
|
||||
<button class="round bg-white br-base cr-base" type="default" size="mini" hover-class="none" :data-value="'/pages/plugins/delivery/order-detail/order-detail?id=' + item.id" @tap="url_event">{{$t('order.order.75ie9c')}}</button>
|
||||
<button v-if="item.status == 1" class="round bg-white br-blue cr-blue" type="default" size="mini" hover-class="none" :data-index="index" @tap="start_delivery_event">{{$t('order.order.021438')}}</button>
|
||||
<button v-if="item.status == 4" class="round bg-white br-main cr-main" type="default" size="mini" hover-class="none" :data-index="index" @tap="start_delivery_event">{{$t('order.order.ip4xo5')}}</button>
|
||||
<block v-if="item.status == 2">
|
||||
<button class="round bg-white br-green cr-green" type="default" size="mini" hover-class="none" :data-index="index" @tap="popup_success_content_event">{{$t('order.order.51q275')}}</button>
|
||||
<button class="round bg-white br-red cr-red" type="default" size="mini" hover-class="none" :data-index="index" @tap="popup_abnormal_content_event">{{$t('order.order.fb6dge')}}</button>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</block>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 地图 -->
|
||||
<view v-if="show_type == 1" class="map-container pr">
|
||||
<block v-if="markers.length > 0">
|
||||
<map class="wh-auto ht-auto"
|
||||
:enable-zoom="true"
|
||||
:enable-scroll="true"
|
||||
:show-location="true"
|
||||
:latitude="markers[0]['latitude'] || latitude"
|
||||
:longitude="markers[0]['longitude'] || longitude"
|
||||
:scale="scale"
|
||||
:markers="markers"
|
||||
@markertap="marker_tap_event"
|
||||
></map>
|
||||
<view v-if="markers_active_data.length > 0" class="map-markers-active-data pa border-radius-main padding-main bs-bb">
|
||||
<block v-for="(item,index) in markers_active_data" :key="index">
|
||||
<view :class="'pr '+(index > 0 ? 'br-t padding-top-sm margin-top-sm' : '')">
|
||||
<view>
|
||||
<text>{{$t('order.order.71n22h')}}:</text>
|
||||
<text class="cp" data-event="copy" :data-value="item.main_order_id" @tap="text_event">{{item.main_order_id}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>{{$t('order.order.232ygr')}}:</text>
|
||||
<text class="cp" data-event="copy" :data-value="item.main_order_no" @tap="text_event">{{item.main_order_no}}</text>
|
||||
</view>
|
||||
<view class="single-text">
|
||||
<text>{{$t('order.order.ra8222')}}:</text>
|
||||
<text class="cp" data-event="copy" :data-value="item.user_address.address_info" @tap="text_event">{{ item.user_address.address_info }}</text>
|
||||
</view>
|
||||
<view v-if="(item.user_address.lng || 0) != 0 && (item.user_address.lat || 0) != 0" class="map-send-icon bg-base circle tc cp pa" data-type="map" :data-index="index" @tap.stop="address_map_event">
|
||||
<uni-icons type="paperplane-filled" size="44rpx" color="#666"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data propStatus="0"></component-no-data>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 订单完成弹窗 -->
|
||||
<component-popup :propShow="popup_success_content_status" propPosition="bottom" @onclose="popup_success_content_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="close oh">
|
||||
<view class="fr" @tap.stop="popup_success_content_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<form @submit="form_delivery_success_submit_event" class="form-container">
|
||||
<view class="form-container">
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('form.form.xy87t8')}}</view>
|
||||
<view class="br padding-main radius margin-top">
|
||||
<textarea placeholder-class="cr-grey" class="cr-base margin-0" :placeholder="$t('order.order.q4c8j0')" maxlength="200" :auto-height="true" :value="form_delivery_success_msg_value" @input="form_delivery_success_msg_event"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-gorup form-container-upload oh">
|
||||
<view class="form-gorup-title">{{$t('order.order.46q2z7')}}<text class="form-group-tips-must">*</text><text class="form-group-tips">{{$t('order.order.o11d44')}}{{form_delivery_success_images_max_count}}{{$t('buy.buy.5iuqow')}}</text></view>
|
||||
<view class="form-upload-data oh">
|
||||
<block v-if="form_delivery_success_images_list.length > 0">
|
||||
<view v-for="(item, index) in form_delivery_success_images_list" :key="index" class="item fl">
|
||||
<text class="delete-icon" @tap="upload_delete_event" :data-index="index">x</text>
|
||||
<image :src="item" @tap="upload_show_event" :data-index="index" mode="aspectFill"></image>
|
||||
</view>
|
||||
</block>
|
||||
<image v-if="(form_delivery_success_images_list || null) == null || form_delivery_success_images_list.length < form_delivery_success_images_max_count" class="item fl upload-icon" :src="common_static_url + 'upload-icon.png'" mode="aspectFill" @tap="file_upload_event"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-gorup form-gorup-submit bottom-line-exclude">
|
||||
<button class="bg-main br-main cr-white round text-size" type="default" form-type="submit" hover-class="none">{{$t('order.order.9cvj96')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</component-popup>
|
||||
|
||||
<!-- 订单异常弹窗 -->
|
||||
<component-popup :propShow="popup_abnormal_content_status" propPosition="bottom" @onclose="popup_abnormal_content_close_event">
|
||||
<view class="padding-horizontal-main padding-top-main bg-white">
|
||||
<view class="close oh">
|
||||
<view class="fr" @tap.stop="popup_abnormal_content_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<form @submit="form_delivery_abnormal_submit_event" class="form-container">
|
||||
<view class="form-container">
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('order.order.865029')}}<text class="form-group-tips-must">*</text></view>
|
||||
<view class="br padding-main radius margin-top">
|
||||
<textarea placeholder-class="cr-grey" class="cr-base margin-0" :placeholder="$t('order.order.g23kyj')" maxlength="200" :auto-height="true" :value="form_delivery_abnormal_msg_value" @input="form_delivery_abnormal_msg_event"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-gorup form-gorup-submit bottom-line-exclude">
|
||||
<button class="bg-red br-red cr-white round text-size" type="default" form-type="submit" hover-class="none">{{$t('order.order.eyir7g')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</component-popup>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from "@/components/no-data/no-data";
|
||||
import componentBottomLine from "@/components/bottom-line/bottom-line";
|
||||
import componentBadge from "@/components/badge/badge";
|
||||
import componentPopup from "@/components/popup/popup";
|
||||
import componentSearch from '@/components/search/search';
|
||||
|
||||
var common_static_url = app.globalData.get_static_url("common");
|
||||
var plugins_static_url = app.globalData.get_static_url('delivery', true);
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
common_static_url: common_static_url,
|
||||
plugins_static_url: plugins_static_url,
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
params: null,
|
||||
nav_type_list: [],
|
||||
nav_type_index: 0,
|
||||
latitude: 0,
|
||||
longitude: 0,
|
||||
search_input_keywords_value: "",
|
||||
popup_abnormal_content_status: false,
|
||||
popup_abnormal_data_index: null,
|
||||
form_delivery_abnormal_msg_value: "",
|
||||
popup_success_content_status: false,
|
||||
popup_success_data_index: null,
|
||||
form_delivery_success_msg_value: "",
|
||||
form_delivery_success_images_list: [],
|
||||
form_delivery_success_images_max_count: 30,
|
||||
editor_path_type: "",
|
||||
show_type: 0,
|
||||
scale: 10,
|
||||
markers: [],
|
||||
markers_active_data: []
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentBadge,
|
||||
componentPopup,
|
||||
componentSearch
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
this.init();
|
||||
|
||||
// 位置实时监听
|
||||
this.start_location_update();
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
// 位置权限、回调并获取数据
|
||||
app.globalData.get_location_check("scope.userLocation", this, "location_back_handle");
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 位置实时监听
|
||||
start_location_update(e = null) {
|
||||
if (e == null) {
|
||||
app.globalData.start_location_update(0, this, "start_location_update");
|
||||
} else {
|
||||
if ((e.status || 0) == 1) {
|
||||
// 更新当前页面的位置
|
||||
this.setData({
|
||||
latitude: e.lat,
|
||||
longitude: e.lng,
|
||||
});
|
||||
// 位置上报
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("locationreport", "user", "delivery"),
|
||||
method: "POST",
|
||||
data: {
|
||||
lat: e.lat,
|
||||
lng: e.lng,
|
||||
},
|
||||
dataType: "json",
|
||||
});
|
||||
} else {
|
||||
console.log("error", e);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 位置权限校验回调
|
||||
location_back_handle(status = 0) {
|
||||
var self = this;
|
||||
if (status == 1) {
|
||||
uni.getLocation({
|
||||
type: "wgs84",
|
||||
success: function (res) {
|
||||
self.setData({
|
||||
longitude: res.longitude,
|
||||
latitude: res.latitude,
|
||||
});
|
||||
// 获取数据
|
||||
self.get_data_list();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
if (app.globalData.data.is_distribution_map_force_location == 1) {
|
||||
app.globalData.url_open('/pages/common/open-setting-location/open-setting-location?is_check_success_back=1');
|
||||
} else {
|
||||
// 获取数据
|
||||
self.get_data_list();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
|
||||
// 加载loding
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
|
||||
// 参数
|
||||
var type = (this.nav_type_list[this.nav_type_index] || null) == null ? -1 : this.nav_type_list[this.nav_type_index]["value"];
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "order", "delivery"),
|
||||
method: "POST",
|
||||
data: {
|
||||
page: this.data_page,
|
||||
type: type,
|
||||
keywords: this.search_input_keywords_value || "",
|
||||
lat: this.latitude,
|
||||
lng: this.longitude,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// 地图标记
|
||||
var temp_markers = [];
|
||||
if(temp_data_list.length > 0) {
|
||||
temp_data_list.forEach((item, index) => {
|
||||
if((item.user_address || null) != null && (item.user_address.lat || 0) != 0 && (item.user_address.lng || 0) != 0) {
|
||||
temp_markers.push({
|
||||
id: index,
|
||||
width: 30,
|
||||
height: 30,
|
||||
latitude: item.user_address.lat,
|
||||
longitude: item.user_address.lng,
|
||||
iconPath: this.plugins_static_url+'order.png'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
this.setData({
|
||||
editor_path_type: data.editor_path_type || "",
|
||||
nav_type_list: data.nav_type_list || [],
|
||||
markers: temp_markers,
|
||||
data_list: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: temp_data_list.length > 0 ? 3 : 0,
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, "get_data_list")) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
this.setData({
|
||||
nav_type_index: e.currentTarget.dataset.index || 0,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// 文本事件
|
||||
text_event(e) {
|
||||
app.globalData.text_event_handle(e);
|
||||
},
|
||||
|
||||
// 打开url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
},
|
||||
|
||||
// 搜索关键字事件
|
||||
search_input_keywords_event(e) {
|
||||
this.setData({
|
||||
search_input_keywords_value: e.detail.value,
|
||||
});
|
||||
},
|
||||
|
||||
// 搜索确认事件
|
||||
search_submit_event(e) {
|
||||
this.setData({
|
||||
search_input_keywords_value: e,
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// icon事件
|
||||
search_icon_event(e) {
|
||||
var self = this;
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
self.setData({
|
||||
search_input_keywords_value: res.result,
|
||||
data_page: 1
|
||||
});
|
||||
self.get_data_list(1);
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 地图查看
|
||||
address_map_event(e) {
|
||||
var index = e.currentTarget.dataset.index;
|
||||
var type = e.currentTarget.dataset.type;
|
||||
if(type == 'map') {
|
||||
this.address_map_handle(this.markers_active_data[index]['user_address']);
|
||||
} else {
|
||||
var temp_data = this.data_list;
|
||||
if ((temp_data[index] || null) == null || (temp_data[index][type] || null) == null) {
|
||||
app.globalData.showToast(this.$t('user-order-detail.user-order-detail.i876o3'));
|
||||
return false;
|
||||
}
|
||||
this.address_map_handle(temp_data[index][type]);
|
||||
}
|
||||
},
|
||||
|
||||
// 地址打开地图
|
||||
address_map_handle(ads) {
|
||||
var name = ads.alias || ads.name || "";
|
||||
app.globalData.open_location(ads.lng, ads.lat, name, ads.address_info);
|
||||
},
|
||||
|
||||
// 订单完成开启弹层
|
||||
popup_success_content_event(e) {
|
||||
this.setData({
|
||||
popup_success_content_status: true,
|
||||
popup_success_data_index: e.currentTarget.dataset.index,
|
||||
form_delivery_success_msg_value: "",
|
||||
form_delivery_success_images_list: []
|
||||
});
|
||||
},
|
||||
|
||||
// 订单完成弹层关闭
|
||||
popup_success_content_close_event(e) {
|
||||
this.setData({
|
||||
popup_success_content_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 订单完成说明输入事件
|
||||
form_delivery_success_msg_event(e) {
|
||||
this.setData({
|
||||
form_delivery_success_msg_value: e.detail.value
|
||||
});
|
||||
},
|
||||
|
||||
// 上传图片预览
|
||||
upload_show_event(e) {
|
||||
uni.previewImage({
|
||||
current: this.form_delivery_success_images_list[e.currentTarget.dataset.index],
|
||||
urls: this.form_delivery_success_images_list,
|
||||
});
|
||||
},
|
||||
|
||||
// 图片删除
|
||||
upload_delete_event(e) {
|
||||
var self = this;
|
||||
uni.showModal({
|
||||
title: this.$t('common.warm_tips'),
|
||||
content: this.$t('order.order.psi67g'),
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
var list = self.form_delivery_success_images_list;
|
||||
list.splice(e.currentTarget.dataset.index, 1);
|
||||
self.setData({
|
||||
form_delivery_success_images_list: list,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 文件上传
|
||||
file_upload_event(e) {
|
||||
var self = this;
|
||||
uni.chooseImage({
|
||||
count: this.form_delivery_success_images_max_count,
|
||||
success(res) {
|
||||
var success = 0;
|
||||
var fail = 0;
|
||||
var length = res.tempFilePaths.length;
|
||||
var count = 0;
|
||||
self.upload_one_by_one(res.tempFilePaths, success, fail, count, length);
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 采用递归的方式上传多张
|
||||
upload_one_by_one(img_paths, success, fail, count, length) {
|
||||
var self = this;
|
||||
if (self.form_delivery_success_images_list.length < this.form_delivery_success_images_max_count) {
|
||||
uni.uploadFile({
|
||||
url: app.globalData.get_request_url("index", "ueditor"),
|
||||
filePath: img_paths[count],
|
||||
name: "upfile",
|
||||
formData: {
|
||||
action: "uploadimage",
|
||||
path_type: self.editor_path_type,
|
||||
},
|
||||
success: function (res) {
|
||||
success++;
|
||||
if (res.statusCode == 200) {
|
||||
var data = typeof res.data == "object" ? res.data : JSON.parse(res.data);
|
||||
if (data.code == 0 && (data.data.url || null) != null) {
|
||||
var list = self.form_delivery_success_images_list;
|
||||
list.push(data.data.url);
|
||||
self.setData({
|
||||
form_delivery_success_images_list: list,
|
||||
});
|
||||
} else {
|
||||
app.globalData.showToast(data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: function (e) {
|
||||
fail++;
|
||||
},
|
||||
complete: function (e) {
|
||||
count++;
|
||||
|
||||
// 下一张
|
||||
if (count >= length) {
|
||||
// 上传完毕,作一下提示
|
||||
//app.showToast('上传成功' + success +'张', 'success');
|
||||
} else {
|
||||
// 递归调用,上传下一张
|
||||
self.upload_one_by_one(img_paths, success, fail, count, length);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 订单异常开启弹层
|
||||
popup_abnormal_content_event(e) {
|
||||
this.setData({
|
||||
popup_abnormal_content_status: true,
|
||||
popup_abnormal_data_index: e.currentTarget.dataset.index,
|
||||
form_delivery_abnormal_msg_value: ""
|
||||
});
|
||||
},
|
||||
|
||||
// 订单异常弹层关闭
|
||||
popup_abnormal_content_close_event(e) {
|
||||
this.setData({
|
||||
popup_abnormal_content_status: false,
|
||||
});
|
||||
},
|
||||
|
||||
// 订单异常原因输入事件
|
||||
form_delivery_abnormal_msg_event(e) {
|
||||
this.setData({
|
||||
form_delivery_abnormal_msg_value: e.detail.value
|
||||
});
|
||||
},
|
||||
|
||||
// 开始配送
|
||||
start_delivery_event(e) {
|
||||
uni.showModal({
|
||||
title: this.$t('common.warm_tips'),
|
||||
content: this.$t('order.order.s5cpq5'),
|
||||
confirmText: this.$t('common.confirm'),
|
||||
cancelText: this.$t('common.not_yet'),
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
this.order_status_handle({
|
||||
index: e.currentTarget.dataset.index,
|
||||
new_status: 2,
|
||||
status_name: this.$t('order.order.13j20t'),
|
||||
action: "startdelivery",
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 完成配送表单提交
|
||||
form_delivery_success_submit_event(e) {
|
||||
if(this.form_delivery_success_images_list.length == 0) {
|
||||
app.globalData.showToast(this.$t('order.order.7ltibl'));
|
||||
return false;
|
||||
}
|
||||
this.order_status_handle({
|
||||
index: this.popup_success_data_index,
|
||||
new_status: 3,
|
||||
status_name: this.$t('order.order.c69064'),
|
||||
action: "successdelivery",
|
||||
msg: this.form_delivery_success_msg_value || '',
|
||||
images: this.form_delivery_success_images_list
|
||||
});
|
||||
},
|
||||
|
||||
// 异常表单提交
|
||||
form_delivery_abnormal_submit_event(e) {
|
||||
var msg = this.form_delivery_abnormal_msg_value || null;
|
||||
if (msg == null) {
|
||||
app.globalData.showToast(this.$t('order.order.hun5n3'));
|
||||
} else {
|
||||
this.order_status_handle({
|
||||
index: this.popup_abnormal_data_index,
|
||||
new_status: 4,
|
||||
status_name: this.$t('order.order.fb6dge'),
|
||||
action: "abnormaldelivery",
|
||||
msg: msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 订单状态处理
|
||||
order_status_handle(params) {
|
||||
var temp_data = this.data_list;
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url(params.action, "order", "delivery"),
|
||||
method: "POST",
|
||||
data: {
|
||||
id: temp_data[params.index]["id"],
|
||||
msg: params.msg || "",
|
||||
images: params.images || ""
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var temp_nav = this.nav_type_list;
|
||||
for (var i in temp_nav) {
|
||||
if (temp_nav[i]["value"] == temp_data[params.index]["status"] && (temp_nav[i]["count"] || 0) != 0) {
|
||||
temp_nav[i]["count"] = parseInt(temp_nav[i]["count"]) - 1;
|
||||
}
|
||||
if (temp_nav[i]["value"] == params.new_status) {
|
||||
temp_nav[i]["count"] = parseInt(temp_nav[i]["count"] || 0) + 1;
|
||||
}
|
||||
}
|
||||
temp_data[params.index]["status"] = params.new_status;
|
||||
temp_data[params.index]["status_name"] = params.status_name;
|
||||
this.setData({
|
||||
data_list: temp_data,
|
||||
nav_type_list: temp_nav,
|
||||
popup_success_content_status: false,
|
||||
popup_abnormal_content_status: false
|
||||
});
|
||||
app.globalData.showToast(res.data.msg, "success");
|
||||
} else {
|
||||
if (app.globalData.is_login_check(res.data, this, "order_status_handle", params)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 展示类型
|
||||
map_show_type_event(e) {
|
||||
this.setData({
|
||||
show_type: this.show_type == 0 ? 1 : 0
|
||||
});
|
||||
},
|
||||
|
||||
// 点击标记点事件
|
||||
marker_tap_event(e) {
|
||||
// 点中数据id
|
||||
var index = e.detail.markerId;
|
||||
// 标记数据
|
||||
var temp_markers = this.markers;
|
||||
for(var i in temp_markers) {
|
||||
if(temp_markers[i]['id'] == index) {
|
||||
temp_markers[i]['iconPath'] = this.plugins_static_url+'order-active.png';
|
||||
} else {
|
||||
temp_markers[i]['iconPath'] = this.plugins_static_url+'order.png';
|
||||
}
|
||||
}
|
||||
// 订单数据、先匹配实际点击的订单
|
||||
var temp = null;
|
||||
var temp_data_list = this.data_list;
|
||||
for(var i in temp_data_list) {
|
||||
if(i == index) {
|
||||
temp = temp_data_list[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 再匹配相同坐标的订单
|
||||
var markers_active_data = [];
|
||||
if(temp != null) {
|
||||
for(var i in temp_data_list) {
|
||||
if((temp_data_list[i]['user_address'] || null) != null && (temp_data_list[i]['user_address']['lng'] || 0) != 0 && (temp_data_list[i]['user_address']['lat'] || 0) != 0 && temp.user_address.lng == temp_data_list[i]['user_address']['lng'] && temp.user_address.lat == temp_data_list[i]['user_address']['lat']) {
|
||||
markers_active_data.push(temp_data_list[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
markers: temp_markers,
|
||||
markers_active_data: markers_active_data,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import "./order.css";
|
||||
</style>
|
||||
Reference in New Issue
Block a user