小鹿骑行

This commit is contained in:
吴鹏 2026-06-01 17:31:04 +08:00
parent 2a3dd7a368
commit 4e213c55d0
7 changed files with 679 additions and 73 deletions

View File

@ -182,6 +182,20 @@
</view>
</view>
<view class="mask" v-if="gonggaoflag"></view>
<!-- 投诉提醒弹窗 -->
<view class="complaint-modal" v-if="complaintModalVisible">
<view class="complaint-modal__mask"></view>
<view class="complaint-modal__content">
<view class="complaint-modal__title">用户投诉提醒</view>
<view class="complaint-modal__desc">
您有 <text class="complaint-modal__num">{{ complaintBadge }}</text> 笔投诉订单待处理请尽快处理
</view>
<view class="complaint-modal__actions">
<view class="complaint-modal__btn complaint-modal__btn--later" hover-class="is-hover app-tap-hover" hover-stay-time="100" @click="btnComplaintLater">稍后处理</view>
<view class="complaint-modal__btn complaint-modal__btn--now" hover-class="is-hover app-tap-hover" hover-stay-time="100" @click="btnComplaintNow">立即处理</view>
</view>
</view>
</view>
<u-select v-model="show" :list="list" title='选择运营区' @confirm="confirm" v-if="list.length <= 5"></u-select>
<!-- 自定义选择器 -->
<view class="custom-select" v-if="show && list.length > 5">
@ -246,6 +260,8 @@ export default {
userId:'',
fuwuewm:false,
weinum:0,
complaintModalVisible: false,
complaintEntryFrom: '',
areaname:'',
dateStat: {},
pendingStat: {},
@ -265,6 +281,7 @@ export default {
},
onLoad(option) {
this.yyqid = option.id
this.complaintEntryFrom = option.entryFrom || ''
wx.openBluetoothAdapter({
success: function (res) {
console.log('蓝牙适配器初始化成功')
@ -375,7 +392,7 @@ export default {
if (uni.getStorageSync('adminname')) this.areaname = uni.getStorageSync('adminname')
tasks.push(
this.getinfo({ silent: true }),
this.fetchComplaintBadge(),
this.fetchComplaintBadge({ showModal: false }),
this.fetchAreaAbilityList()
)
}
@ -394,17 +411,28 @@ export default {
})
.catch(() => {})
},
fetchComplaintBadge() {
fetchComplaintBadge(options = {}) {
const showModal = options.showModal !== false
if (!this.areaId) return Promise.resolve()
return this.$u.get(`/dashboard/complaint/statusMap?areaId=${this.areaId}`).then((res) => {
if (res.code == 200){
let min = res.data['1'] || 0
let max = res.data['3'] || 0
this.weinum = Number(min) + Number(max)
if (showModal && this.weinum > 0) {
this.complaintModalVisible = true
}
}
})
.catch(() => {})
},
btnComplaintLater() {
this.complaintModalVisible = false
},
btnComplaintNow() {
this.complaintModalVisible = false
this.btnts()
},
//
btnyy(){
uni.navigateTo({
@ -536,7 +564,12 @@ export default {
//
getweicl() {
if (!this.areaId) return
this.fetchComplaintBadge()
this.fetchComplaintBadge({ showModal: this.consumeComplaintEntryFlag() })
},
consumeComplaintEntryFlag() {
const from = this.complaintEntryFrom
this.complaintEntryFrom = ''
return from === 'nearbystores' || from === 'my'
},
//
btnfuwuewm(){
@ -1345,6 +1378,74 @@ export default {
transform: translateX(-100%);
}
}
.complaint-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 100;
display: flex;
align-items: center;
justify-content: center;
&__mask {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
}
&__content {
position: relative;
width: 620rpx;
background-color: #fff;
border-radius: 24rpx;
padding: 48rpx 40rpx 40rpx;
box-sizing: border-box;
z-index: 1;
}
&__title {
text-align: center;
font-size: 36rpx;
font-weight: 600;
color: #333;
}
&__desc {
margin-top: 32rpx;
text-align: center;
font-size: 30rpx;
color: #666;
line-height: 1.6;
}
&__num {
color: #FF473E;
font-weight: 600;
font-size: 36rpx;
}
&__actions {
display: flex;
margin-top: 48rpx;
gap: 24rpx;
}
&__btn {
flex: 1;
height: 88rpx;
line-height: 88rpx;
text-align: center;
border-radius: 44rpx;
font-size: 30rpx;
font-weight: 600;
&--later {
background-color: #F5F6F8;
color: #666;
}
&--now {
background-color: #4297F3;
color: #fff;
}
}
}
.noticetc{
width: 680rpx;
height: 80vh;

View File

@ -432,61 +432,113 @@
</view>
<view class="maskone" v-if="huancheflag"></view>
<view class="zengsong" v-if="tkflag">
<view class="tops">
退款
</view>
<view class="gai">
<view class="">
骑行费
<view class="zengsong refund-modal" v-if="tkflag">
<view class="refund-modal__header">
<view class="refund-modal__head-text">
<text class="refund-modal__title">订单退款</text>
<text class="refund-modal__desc">在右侧填写退款金额不得超过左侧实收金额</text>
</view>
<input type="text" v-model="orderxqobj.actualReceivedRidingFee" :disabled="true" style="background-color: #efefef;"
placeholder="请输入骑行费" /> >
<input type="text" v-model="qxfei" placeholder="请输入骑行费" />
</view>
<view class="gai">
<view class="">
调度费
</view>
<input type="text" v-model="orderxqobj.actualReceivedDispatchFee" :disabled="true" style="background-color: #efefef;"
placeholder="请输入调度费" /> >
<input type="text" v-model="ddfei" placeholder="请输入调度费" />
<view class="refund-table__head">
<text class="col-name">费用项目</text>
<text class="col-refund">退款()</text>
</view>
<view class="gai">
<view class="">
管理费
</view>
<input type="text" v-model="orderxqobj.actualReceivedManageFee" :disabled="true" style="background-color: #efefef;"
placeholder="请输入管理费" /> >
<input type="text" v-model="glfei" placeholder="请输入管理费" />
<view
class="refund-table__row"
:class="{ 'refund-table__row--disabled': isRefundRowDisabled('riding') }"
>
<text class="col-name">骑行费</text>
<text class="col-original">{{ formatRefundMoney(getRefundOriginal('riding')) }}</text>
<input
v-if="!isRefundRowDisabled('riding')"
class="col-refund-input"
type="digit"
v-model="qxfei"
placeholder="填退款"
/>
<text v-else class="col-refund-placeholder"></text>
</view>
<view class="gai">
<view class="">
车损费
</view>
<input type="text" v-model="orderxqobj.actualReceivedDeductionFee" :disabled="true" style="background-color: #efefef;"
placeholder="请输入车损费" /> >
<input type="text" v-model="csfei" placeholder="请输入车损费" />
<view
class="refund-table__row"
:class="{ 'refund-table__row--disabled': isRefundRowDisabled('dispatch') }"
>
<text class="col-name">调度费</text>
<text class="col-original">{{ formatRefundMoney(getRefundOriginal('dispatch')) }}</text>
<input
v-if="!isRefundRowDisabled('dispatch')"
class="col-refund-input"
type="digit"
v-model="ddfei"
placeholder="填退款"
/>
<text v-else class="col-refund-placeholder"></text>
</view>
<view class="gai">
<view class="">
退款原因
</view>
<input type="text" class="gai-full-input" v-model="yuanyin" placeholder="请输入退款原因" />
<view
class="refund-table__row"
:class="{ 'refund-table__row--disabled': isRefundRowDisabled('manage') }"
>
<text class="col-name">管理费</text>
<text class="col-original">{{ formatRefundMoney(getRefundOriginal('manage')) }}</text>
<input
v-if="!isRefundRowDisabled('manage')"
class="col-refund-input"
type="digit"
v-model="glfei"
placeholder="填退款"
/>
<text v-else class="col-refund-placeholder"></text>
</view>
<view class="" style="margin-top: 20rpx;">
当前操作总退款为<text style="color: #FF4444;font-size: 600;">{{ totalRefund }}</text>
<view
class="refund-table__row"
:class="{ 'refund-table__row--disabled': isRefundRowDisabled('deduction') }"
>
<text class="col-name">车损费</text>
<text class="col-original">{{ formatRefundMoney(getRefundOriginal('deduction')) }}</text>
<input
v-if="!isRefundRowDisabled('deduction')"
class="col-refund-input"
type="digit"
v-model="csfei"
placeholder="填退款"
/>
<text v-else class="col-refund-placeholder"></text>
</view>
<view class="refund-reason">
<text class="refund-reason__label">退款原因</text>
<input
class="refund-reason__input"
type="text"
v-model="yuanyin"
placeholder="请填写退款原因(必填)"
/>
</view>
<view class="refund-total">
<text class="refund-total__label">本次退款合计</text>
<text class="refund-total__amount">{{ totalRefund }}</text>
</view>
<view class="anniu">
<view hover-class="app-tap-hover" class="qx" @click="qxqx">
取消
</view>
<view hover-class="app-tap-hover" class="qd" @click="btntuikuan">
确定
</view>
<view hover-class="app-tap-hover" class="qx" @click="qxqx">取消</view>
<view hover-class="app-tap-hover" class="qd refund-modal__confirm" @click="btntuikuan">确认退款</view>
</view>
</view>
<view style="background-color: rgba(0, 0, 0, .5);width: 100%;height: 100vh;position: fixed;top: 0;left: 0;z-index: 11;" v-if="tkflag"></view>
<!-- 退款二次确认 -->
<view class="refund-confirm-mask" v-if="refundConfirmFlag" @click="closeRefundConfirm"></view>
<view class="refund-confirm-dialog" v-if="refundConfirmFlag">
<view class="refund-confirm-dialog__title">确认退款</view>
<view class="refund-confirm-dialog__content">
<view class="refund-confirm-dialog__line1">
<text class="refund-confirm-dialog__text">本次将退款</text>
<text class="refund-confirm-dialog__amount">{{ totalRefund }}</text>
</view>
<view class="refund-confirm-dialog__line2">确定要执行退款吗</view>
</view>
<view class="refund-confirm-dialog__actions">
<view hover-class="app-tap-hover" class="refund-confirm-dialog__btn refund-confirm-dialog__btn--cancel" @click="closeRefundConfirm">取消</view>
<view hover-class="app-tap-hover" class="refund-confirm-dialog__btn refund-confirm-dialog__btn--ok" @click="confirmRefundSubmit">确定</view>
</view>
</view>
<!-- 辅助还车是否收取调度费 -->
<view class="diaodu" v-if="ddflag">
@ -762,6 +814,7 @@ import ZhimaNoDepositBadge from '@/components/zhima-no-deposit-badge/zhima-no-de
distance: 0
},
tkflag: false,
refundConfirmFlag: false,
amount: '',
orderDeviceList: [],
suitSeconds: '',
@ -837,12 +890,12 @@ import ZhimaNoDepositBadge from '@/components/zhima-no-deposit-badge/zhima-no-de
},
computed: {
totalRefund() {
return (
Number(this.qxfei) +
Number(this.ddfei) +
Number(this.glfei) +
Number(this.csfei)
).toFixed(2); //
return (
Number(this.qxfei || 0) +
Number(this.ddfei || 0) +
Number(this.glfei || 0) +
Number(this.csfei || 0)
).toFixed(2)
},
formattedDuration() {
//
@ -1198,6 +1251,7 @@ import ZhimaNoDepositBadge from '@/components/zhima-no-deposit-badge/zhima-no-de
qxqx() {
this.zengsongflag = false
this.tkflag = false
this.refundConfirmFlag = false
this.orderActionBusy = false
this.priceSubmitting = false
this.qxfei = ''
@ -1366,21 +1420,86 @@ import ZhimaNoDepositBadge from '@/components/zhima-no-deposit-badge/zhima-no-de
})
},
// 退
getRefundOriginal(type) {
const keyMap = {
riding: 'actualReceivedRidingFee',
dispatch: 'actualReceivedDispatchFee',
manage: 'actualReceivedManageFee',
deduction: 'actualReceivedDeductionFee'
}
const v = Number(this.orderxqobj[keyMap[type]])
return isNaN(v) ? 0 : v
},
isRefundRowDisabled(type) {
return this.getRefundOriginal(type) <= 0
},
formatRefundMoney(val) {
const n = Number(val)
return (isNaN(n) ? 0 : n).toFixed(2)
},
resetRefundForm() {
this.qxfei = ''
this.ddfei = ''
this.glfei = ''
this.csfei = ''
this.yuanyin = ''
},
validateRefundForm() {
const rows = [
{ type: 'riding', val: this.qxfei, label: '骑行费' },
{ type: 'dispatch', val: this.ddfei, label: '调度费' },
{ type: 'manage', val: this.glfei, label: '管理费' },
{ type: 'deduction', val: this.csfei, label: '车损费' }
]
let hasRefund = false
for (let i = 0; i < rows.length; i++) {
const row = rows[i]
const original = this.getRefundOriginal(row.type)
if (original <= 0) continue
const amount = Number(row.val || 0)
if (isNaN(amount) || amount < 0) {
uni.showToast({ title: row.label + '退款金额不正确', icon: 'none' })
return false
}
if (amount > original) {
uni.showToast({ title: row.label + '退款不能超过实收', icon: 'none' })
return false
}
if (amount > 0) hasRefund = true
}
if (!hasRefund) {
uni.showToast({ title: '请至少填写一项退款金额', icon: 'none' })
return false
}
return true
},
// 退
btntuikuan() {
if (!this.tkje) return
if (!this.validateRefundForm()) return
this.refundConfirmFlag = true
},
closeRefundConfirm() {
this.refundConfirmFlag = false
},
confirmRefundSubmit() {
this.refundConfirmFlag = false
this.submitRefundOrder()
},
submitRefundOrder() {
if (!this.tkje) return
this.tkje = false
uni.showLoading({
title: '加载中...',
title: '退款中...',
mask: true
})
let data = {
const data = {
orderId: this.orid,
ridingRefund:this.qxfei == '' ? 0 : this.qxfei,
dispatchRefund:this.ddfei == '' ? 0 : this.ddfei,
manageRefund:this.glfei == '' ? 0 : this.glfei,
deductionRefund:this.csfei == '' ? 0 : this.csfei,
reason:this.yuanyin
ridingRefund: this.isRefundRowDisabled('riding') ? 0 : (this.qxfei === '' ? 0 : this.qxfei),
dispatchRefund: this.isRefundRowDisabled('dispatch') ? 0 : (this.ddfei === '' ? 0 : this.ddfei),
manageRefund: this.isRefundRowDisabled('manage') ? 0 : (this.glfei === '' ? 0 : this.glfei),
deductionRefund: this.isRefundRowDisabled('deduction') ? 0 : (this.csfei === '' ? 0 : this.csfei),
reason: this.yuanyin
}
this.$u.put(`/bst/order/refund`, data).then(res => {
if (res.code == 200) {
@ -1389,11 +1508,8 @@ import ZhimaNoDepositBadge from '@/components/zhima-no-deposit-badge/zhima-no-de
icon: 'success',
duration: 2000
})
this.qxfei = ''
this.ddfei = ''
this.glfei = ''
this.csfei = ''
this.yuanyin = ''
this.resetRefundForm()
this.refundConfirmFlag = false
this.tkflag = false
this.deviceInfo()
this.getorderxq()
@ -1851,6 +1967,7 @@ import ZhimaNoDepositBadge from '@/components/zhima-no-deposit-badge/zhima-no-de
} else { //退
if (this.toastIfOrderBusy()) return
this.orderActionBusy = true
this.resetRefundForm()
this.tkflag = true
}
},
@ -3836,6 +3953,262 @@ import ZhimaNoDepositBadge from '@/components/zhima-no-deposit-badge/zhima-no-de
.qd { background: #4C97E7; color: #fff; }
}
}
.refund-modal {
width: 680rpx;
padding: 36rpx 32rpx 32rpx;
.tops { display: none; }
input {
width: auto;
height: auto;
background: transparent;
border-radius: 0;
padding: 0;
margin-bottom: 0;
}
.refund-modal__header {
display: flex;
align-items: flex-start;
margin-bottom: 28rpx;
}
.refund-modal__badge {
width: 72rpx;
height: 72rpx;
line-height: 72rpx;
text-align: center;
border-radius: 16rpx;
background: linear-gradient(135deg, #ff6b6b, #ff4444);
color: #fff;
font-size: 36rpx;
font-weight: 700;
flex-shrink: 0;
margin-right: 20rpx;
}
.refund-modal__head-text {
flex: 1;
min-width: 0;
}
.refund-modal__title {
display: block;
font-size: 36rpx;
font-weight: 700;
color: #1a1a1a;
line-height: 1.3;
}
.refund-modal__desc {
display: block;
margin-top: 8rpx;
font-size: 24rpx;
color: #888;
line-height: 1.5;
}
.refund-table__head,
.refund-table__row {
display: flex;
align-items: center;
padding: 0 16rpx;
box-sizing: border-box;
}
.refund-table__head {
height: 56rpx;
background: #f0f4f8;
border-radius: 10rpx;
margin-bottom: 12rpx;
font-size: 22rpx;
color: #666;
font-weight: 600;
}
.refund-table__row {
min-height: 88rpx;
margin-bottom: 12rpx;
border-radius: 12rpx;
background: #f8fafc;
border: 1rpx solid #e8edf2;
}
.refund-table__row--disabled {
background: #ececec;
border-color: #e0e0e0;
.col-name,
.col-original,
.col-refund-placeholder {
color: #aaa;
}
.col-original {
// background: #e4e4e4;
}
}
.col-name {
width: 120rpx;
flex-shrink: 0;
font-size: 28rpx;
color: #333;
font-weight: 500;
}
.col-original {
width: 140rpx;
flex-shrink: 0;
height: 64rpx;
line-height: 64rpx;
text-align: center;
font-size: 28rpx;
color: #666;
// background: #eef1f5;
border-radius: 8rpx;
margin-right: 100rpx;
}
.col-refund {
flex: 1;
text-align: right;
}
.col-refund-input {
flex: 1;
min-width: 0;
height: 64rpx;
line-height: 64rpx;
padding: 0 16rpx;
font-size: 30rpx;
font-weight: 600;
color: #ff4444;
background: #fff;
border: 2rpx solid #ffb4b4;
border-radius: 8rpx;
box-sizing: border-box;
}
.col-refund-placeholder {
flex: 1;
text-align: center;
font-size: 32rpx;
color: #bbb;
}
.refund-reason {
margin-top: 20rpx;
padding: 20rpx 16rpx;
background: #f8fafc;
border-radius: 12rpx;
border: 1rpx solid #e8edf2;
}
.refund-reason__label {
display: block;
font-size: 26rpx;
color: #666;
margin-bottom: 12rpx;
}
.refund-reason__input {
width: 100%;
height: 72rpx;
padding: 0 20rpx;
font-size: 28rpx;
background: #fff;
border: 1rpx solid #dde3ea;
border-radius: 8rpx;
box-sizing: border-box;
}
.refund-total {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 24rpx;
padding: 20rpx 24rpx;
background: #fff5f5;
border-radius: 12rpx;
border: 1rpx solid #ffd4d4;
}
.refund-total__label {
font-size: 28rpx;
color: #666;
}
.refund-total__amount {
font-size: 40rpx;
font-weight: 700;
color: #ff4444;
}
.refund-modal__confirm {
background: #ff4444 !important;
}
.anniu {
margin-top: 32rpx;
}
}
.refund-confirm-mask {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background: rgba(0, 0, 0, 0.55);
z-index: 1100;
}
.refund-confirm-dialog {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 580rpx;
background: #fff;
border-radius: 24rpx;
z-index: 1101;
padding: 48rpx 40rpx 36rpx;
box-sizing: border-box;
box-shadow: 0 16rpx 48rpx rgba(0, 0, 0, 0.12);
}
.refund-confirm-dialog__title {
font-size: 36rpx;
font-weight: 700;
color: #1a1a1a;
text-align: center;
margin-bottom: 36rpx;
}
.refund-confirm-dialog__content {
text-align: center;
margin-bottom: 48rpx;
}
.refund-confirm-dialog__line1 {
display: flex;
align-items: baseline;
justify-content: center;
flex-wrap: wrap;
line-height: 1.5;
}
.refund-confirm-dialog__text {
font-size: 30rpx;
color: #333;
}
.refund-confirm-dialog__amount {
font-size: 44rpx;
font-weight: 700;
color: #ff4444;
margin-left: 8rpx;
}
.refund-confirm-dialog__line2 {
display: block;
margin-top: 20rpx;
font-size: 28rpx;
color: #666;
line-height: 1.5;
}
.refund-confirm-dialog__actions {
display: flex;
justify-content: space-between;
gap: 24rpx;
}
.refund-confirm-dialog__btn {
flex: 1;
height: 84rpx;
line-height: 84rpx;
text-align: center;
border-radius: 42rpx;
font-size: 32rpx;
}
.refund-confirm-dialog__btn--cancel {
background: #f5f7fa;
color: #666;
}
.refund-confirm-dialog__btn--ok {
background: #ff4444;
color: #fff;
font-weight: 600;
}
.zengsongone.huanche-verify-modal {
max-height: 85vh;

View File

@ -14,7 +14,7 @@
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页",
"enablePullDownRefresh": false,
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#3996FD",
"navigationBarTextStyle": "#FFFFFF",
"navigationStyle": "custom"

View File

@ -27,6 +27,8 @@
<image style="width: 80rpx;height: 80rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/ucMoHgzqfBeC1lh2vo4Q" @click="btnbz" mode=""></image>
</view>
<image style="width: 80rpx;height: 80rpx;position: fixed;right: 22rpx;bottom: 940rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/uvf7K0Sotf7DZOv7nQDr" @click="btnsuofang" mode=""></image>
<image style="width: 80rpx;height: 80rpx;position: fixed;right: 22rpx;bottom: 840rpx;"
@click="toggleIconAndCallout" src="https://api.ccttiot.com/smartmeter/img/static/uqsU8SPl7P8WAZUhy49q"
mode=""></image>
@ -330,6 +332,12 @@
<script>
var xBlufi = require("@/components/blufi/xBlufi.js")
import {
parseBoundaryStrToPoints,
collectOperationAreaPoints,
calcBoundsCenter
} from './utils/mapFenceUtil.js'
export default {
data() {
return {
@ -3177,6 +3185,70 @@
url: '/page_user/bangzhu'
})
},
//
btnsuofang() {
this.fitMapToOperationFence()
},
async fitMapToOperationFence() {
let points = collectOperationAreaPoints(this.polyline)
if (!points.length) {
const areaId = this.areaId || this.orderAreaId || this.yyid
if (!areaId) {
uni.showToast({ title: '暂无运营区围栏数据', icon: 'none' })
return
}
uni.showLoading({ title: '加载围栏...', mask: true })
try {
const res = await this.$u.get(`/app/area/detail?id=${areaId}`)
if (res.code === 200 && res.data && res.data.boundaryStr) {
points = parseBoundaryStrToPoints(res.data.boundaryStr)
const poly = this.convertBoundaryToPolyline(res.data.boundaryStr)
if (poly) {
const others = (this.polyline || []).filter((p) => p && !p.isOperationArea)
this.polyline = [poly, ...others]
}
}
} catch (e) {
uni.hideLoading()
uni.showToast({ title: '获取围栏失败', icon: 'none' })
return
}
uni.hideLoading()
}
if (!points.length) {
uni.showToast({ title: '暂无运营区围栏数据', icon: 'none' })
return
}
const center = calcBoundsCenter(points)
if (center) {
this.latitude = center.latitude
this.longitude = center.longitude
}
this.iconflag = false
// padding includePoints
const vPad = this.orderflag ? 220 : 160
const mapPadding = [vPad, 60, vPad, 60]
this.$nextTick(() => {
const mapContext = uni.createMapContext('map', this)
if (!mapContext || typeof mapContext.includePoints !== 'function') {
uni.showToast({ title: '地图缩放失败', icon: 'none' })
return
}
mapContext.includePoints({
points,
padding: mapPadding,
success: () => {
if (center) {
this.latitude = center.latitude
this.longitude = center.longitude
}
},
fail: () => {
uni.showToast({ title: '地图缩放失败', icon: 'none' })
}
})
})
},
//
btnptkf(tel) {
uni.makePhoneCall({
@ -3204,6 +3276,7 @@
duration: 2000
})
} else {
this.covers = []
this.covers = []
this.rtindex = num
this.shoptcflag = false
@ -4827,7 +4900,7 @@
.lticon {
position: fixed;
right: 20rpx;
bottom: 940rpx;
bottom: 1040rpx;
image {
width: 88rpx;

View File

@ -0,0 +1,59 @@
/**
* 运营区电子围栏解析边界计算中心点 map.includePoints 使用
*/
function toMapPoint(lat, lng) {
const latitude = parseFloat(lat)
const longitude = parseFloat(lng)
if (!isFinite(latitude) || !isFinite(longitude)) return null
if (Math.abs(latitude) > 90 || Math.abs(longitude) > 180) return null
return { latitude, longitude }
}
export function parseBoundaryStrToPoints(boundaryStr) {
if (!boundaryStr || typeof boundaryStr !== 'string') return []
try {
const coords = JSON.parse(boundaryStr)
if (!Array.isArray(coords)) return []
return coords
.map((coord) => {
if (!Array.isArray(coord) || coord.length < 2) return null
return toMapPoint(coord[1], coord[0])
})
.filter(Boolean)
} catch (e) {
return []
}
}
export function collectOperationAreaPoints(polyline) {
const list = Array.isArray(polyline) ? polyline : []
const points = []
list.forEach((poly) => {
if (!poly || !poly.isOperationArea || !Array.isArray(poly.points)) return
poly.points.forEach((pt) => {
if (!pt) return
const p = toMapPoint(pt.latitude, pt.longitude)
if (p) points.push(p)
})
})
return points
}
export function calcBoundsCenter(points) {
if (!points || !points.length) return null
let minLat = Infinity
let maxLat = -Infinity
let minLng = Infinity
let maxLng = -Infinity
points.forEach((p) => {
minLat = Math.min(minLat, p.latitude)
maxLat = Math.max(maxLat, p.latitude)
minLng = Math.min(minLng, p.longitude)
maxLng = Math.max(maxLng, p.longitude)
})
return {
latitude: (minLat + maxLat) / 2,
longitude: (minLng + maxLng) / 2
}
}

View File

@ -266,7 +266,7 @@
uni.setStorageSync('adminAreaid', item.value)
uni.setStorageSync('adminname', item.label)
uni.navigateTo({
url: `/page_shanghu/guanli/admin_worke?id=${item.value}`
url: `/page_shanghu/guanli/admin_worke?id=${item.value}&entryFrom=my`
})
},
//
@ -275,7 +275,7 @@
uni.setStorageSync('adminAreaid', e.value)
uni.setStorageSync('adminname', e.label)
uni.navigateTo({
url: `/page_shanghu/guanli/admin_worke?id=${e.value}`
url: `/page_shanghu/guanli/admin_worke?id=${e.value}&entryFrom=my`
})
},
// 沿
@ -408,7 +408,7 @@
uni.setStorageSync('adminAreaid', this.list[0].value);
uni.setStorageSync('adminname', this.list[0].label)
uni.navigateTo({
url: `/page_shanghu/guanli/admin_worke?id=${this.list[0].value}`
url: `/page_shanghu/guanli/admin_worke?id=${this.list[0].value}&entryFrom=my`
})
} else {
this.show = true

View File

@ -567,7 +567,7 @@
uni.setStorageSync('adminAreaid', e.value)
uni.setStorageSync('adminname', e.label)
uni.navigateTo({
url: `/page_shanghu/guanli/admin_worke?id=${e.value}`
url: `/page_shanghu/guanli/admin_worke?id=${e.value}&entryFrom=nearbystores`
})
},
// 使
@ -1006,7 +1006,7 @@
uni.setStorageSync('adminAreaid', this.list[0].value);
uni.setStorageSync('adminname', this.list[0].label)
uni.navigateTo({
url: `/page_shanghu/guanli/admin_worke?id=${this.list[0].value}`
url: `/page_shanghu/guanli/admin_worke?id=${this.list[0].value}&entryFrom=nearbystores`
})
} else {
this.show = true