Merge branch 'dev' of gitee.com:zongzhige/shopxo-uniapp into dev-sws

master
sws 2023-10-08 15:48:56 +08:00
commit 8e1350e2be
4 changed files with 247 additions and 21 deletions

View File

@ -978,6 +978,13 @@
"enablePullDownRefresh": true,
"navigationBarTitleText": "订单详情"
}
},
{
"path": "logistics/logistics",
"style": {
"enablePullDownRefresh": false,
"navigationBarTitleText": "物流信息"
}
}
]
},

View 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;
}

View File

@ -0,0 +1,202 @@
<template>
<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"
@markertap="marker_tap_event"
></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 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>配送时间</text>
<text v-if="(start_delivery_time || null) != null">{{start_delivery_time}}</text>
<text v-else class="cr-grey-9">未开始配送</text>
</view>
<view class="margin-top-sm">
<text>送达时间</text>
<text v-if="(success_delivery_time || null) != null">{{success_delivery_time}}</text>
<text v-else class="cr-grey-9">还没有送达</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>
</view>
</template>
<script>
const app = getApp();
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 {
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: {
componentNoData,
componentBottomLine
},
props: {},
onLoad(params) {
this.setData({
params: params
});
this.init();
},
methods: {
//
init() {
var user = app.globalData.get_user_info(this, "init");
if (user != false) {
//
if (app.globalData.user_is_need_login(user)) {
uni.redirectTo({
url: "/pages/login/login?event_callback=init",
});
return false;
} else {
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,
});
// loding
uni.showLoading({
title: "加载中...",
});
//
uni.request({
url: app.globalData.get_request_url("logistics", "order", "delivery"),
method: "POST",
data: {
id: this.params.id || 0
},
dataType: "json",
success: (res) => {
uni.hideLoading();
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: () => {
uni.hideLoading();
this.setData({
data_list_loding_status: 2,
data_list_loding_msg: '服务器请求出错'
});
app.globalData.showToast("服务器请求出错");
},
});
},
//
text_event(e) {
app.globalData.text_event_handle(e);
},
// url
url_event(e) {
app.globalData.url_event(e);
},
//
address_map_event(e) {
var index = e.currentTarget.dataset.index;
var type = e.currentTarget.dataset.type || null;
if(type == 'map') {
this.address_map_handle(this.markers_active_data[index]['address_data']);
} else {
var temp_data = this.data_list;
if ((temp_data[index] || null) == null || (temp_data[index]["address_data"] || null) == null) {
app.globalData.showToast("地址有误");
return false;
}
this.address_map_handle(temp_data[index]["address_data"]);
}
},
//
address_map_handle(ads) {
var name = ads.alias || ads.name || "";
app.globalData.open_location(ads.lng, ads.lat, name, ads.address_info);
},
//
marker_tap_event(e) {
var index = e.detail.markerId;
console.log(index)
},
},
};
</script>
<style>
@import "./logistics.css";
</style>

View File

@ -56,32 +56,29 @@
</view>
<view
v-if="
item.operate_data.is_cancel +
item.operate_data.is_pay +
item.operate_data.is_collect +
item.operate_data.is_comments +
item.operate_data.is_delete +
(item.plugins_is_order_allot_button || 0) +
(item.plugins_is_order_batch_button || 0) +
(item.plugins_is_order_frequencycard_button || 0) >
0 ||
(item.operate_data.is_cancel +
item.operate_data.is_pay +
item.operate_data.is_collect +
item.operate_data.is_comments +
item.operate_data.is_delete +
(item.plugins_is_order_allot_button || 0) +
(item.plugins_is_order_batch_button || 0) +
(item.plugins_is_order_frequencycard_button || 0)) > 0 ||
(item.status == 2 && item.order_model != 2) ||
((item.plugins_express_data || 0) == 1 && (item.express_number || null) != null)
"
class="item-operation tr br-t padding-vertical-main"
>
((item.plugins_express_data || 0) == 1 && (item.express_number || null) != null) ||
(item.plugins_delivery_data || 0) == 1
" class="item-operation tr br-t padding-vertical-main">
<button v-if="item.operate_data.is_cancel == 1" class="round bg-white cr-yellow br-yellow" type="default" size="mini" @tap="cancel_event" :data-value="item.id" :data-index="index" hover-class="none"></button>
<button v-if="item.operate_data.is_pay == 1" class="round bg-white cr-green br-green" type="default" size="mini" @tap="pay_event" :data-value="item.id" :data-index="index" :data-price="item.total_price" hover-class="none"></button>
<button v-if="item.operate_data.is_collect == 1" class="round bg-white cr-green br-green" type="default" size="mini" @tap="collect_event" :data-value="item.id" :data-index="index" hover-class="none"></button>
<button v-if="(item.plugins_express_data || 0) == 1 && (item.express_number || null) != null" class="round bg-white cr-main br-main" type="default" size="mini" @tap="url_event" :data-value="'/pages/plugins/express/detail/detail?id=' + item.id" hover-class="none"></button>
<button v-if="(item.plugins_delivery_data || 0) == 1" class="round bg-white cr-main br-main" type="default" size="mini" @tap="url_event" :data-value="'/pages/plugins/delivery/logistics/logistics?id=' + item.id" hover-class="none"></button>
<button v-if="item.operate_data.is_comments == 1" class="round bg-white cr-green br-green" type="default" size="mini" @tap="comments_event" :data-value="item.id" :data-index="index" hover-class="none"></button>
<button v-if="item.status == 2 && item.order_model != 2" class="round cr-base br" type="default" size="mini" @tap="rush_event" :data-value="item.id" :data-index="index" hover-class="none"></button>
<button v-if="item.operate_data.is_delete == 1" class="round bg-white cr-red br-red" type="default" size="mini" @tap="delete_event" :data-value="item.id" :data-index="index" hover-class="none"></button>
<button v-if="(item.plugins_is_order_allot_button || 0) == 1" class="round bg-white cr-main br-main" type="default" size="mini" @tap="url_event" :data-value="'/pages/plugins/realstore/orderallot-list/orderallot-list?oid=' + item.id" hover-class="none"></button>
<button v-if="(item.plugins_is_order_batch_button || 0) == 1" class="round bg-white cr-blue br-blue" type="default" size="mini" @tap="url_event" :data-value="'/pages/plugins/realstore/batchorder-list/batchorder-list?oid=' + item.id" hover-class="none"></button>
<button v-if="(item.plugins_is_order_frequencycard_button || 0) == 1" class="round bg-white cr-green br-green" type="default" size="mini" @tap="url_event" :data-value="'/pages/plugins/realstore/frequencycard-list/frequencycard-list?oid=' + item.id" hover-class="none">
次卡
</button>
<button v-if="(item.plugins_is_order_frequencycard_button || 0) == 1" class="round bg-white cr-green br-green" type="default" size="mini" @tap="url_event" :data-value="'/pages/plugins/realstore/frequencycard-list/frequencycard-list?oid=' + item.id" hover-class="none"></button>
</view>
</view>
</view>
@ -194,15 +191,15 @@
params: params.data,
});
}
},
onShow() {
//
this.init();
//
this.init_config();
//
this.init();
},
onShow() {
//
app.globalData.page_share_handle();
},