feat:新增地图模块,用于查找附近设备场地

This commit is contained in:
2025-08-18 14:52:39 +08:00
parent c5b8026fba
commit 38eb05fefd
122 changed files with 8317 additions and 1768 deletions
File diff suppressed because it is too large Load Diff
+300 -193
View File
@@ -1,51 +1,78 @@
<template>
<view class="map-container">
<map
id="mainMap"
class="map"
:key="mapKey"
:longitude="mapCenter.longitude"
:latitude="mapCenter.latitude"
:scale="mapZoom"
:markers="mapMarkers"
:show-location="false"
:enable-scroll="true"
:enable-zoom="true"
:enable-rotate="false"
:show-compass="false"
@markertap="handleMarkerTap"
@regionchange="handleRegionChange"
></map>
<!-- 地图容器 -->
<view class="map-wrapper">
<!-- 使用小程序原生地图组件 -->
<map id="map" class="native-map" :longitude="mapCenter.longitude" :latitude="mapCenter.latitude"
:markers="mapMarkers" :scale="mapZoom" :show-location="true" @regionchange="onMapRegionChange"
@markertap="onMapMarkerTap" @callouttap="onCalloutTap" @updated="onMapUpdated"
@error="onMapError"></map>
<!-- 地图加载状态 -->
<view class="map-loading" v-if="!mapCenter.longitude">
<view class="map-loading" v-if="isLoading">
<view class="loading-content">
<view class="loading-spinner"></view>
<text>地图加载中...</text>
</view>
</view>
<!-- 地图上的浮动按钮 -->
<view class="map-controls">
<view class="control-btn location-control" @click="handleRelocate">
<image class="control-icon" src="@/static/scan-icon.png" mode="aspectFit" />
<text>我的位置</text>
</view>
<view class="control-btn scan-control main-btn" @click="handleScan">
<image class="control-icon" src="@/static/scan-icon.png" mode="aspectFit" />
<!-- 地图控制按钮 -->
<view class="map-controls">
<view class="control-btn location-control" @tap="handleRelocate">
<!-- <image class="control-icon" src="/static/scan-icon.png" mode="aspectFit" /> -->
<uv-icon name="map-fill" size="18"></uv-icon>
<text style="margin-left: 8rpx;">我的位置</text>
</view>
<view class="control-btn scan-control main-btn" @tap="handleScan">
<image class="control-icon" src="/static/scan-icon.png" mode="aspectFit" />
<text>扫码使用</text>
</view>
<view class="control-btn list-control" @click="handleShowList">
<image class="control-icon" src="@/static/scan-icon.png" mode="aspectFit" />
<text>附近场地</text>
<view class="control-btn list-control" @tap="handleShowList">
<image class="control-icon" src="/static/map.png" mode="aspectFit" />
<text>附近设备</text>
</view>
</view>
</view>
</template>
<script setup>
import { ref, computed, watch, nextTick, onUnmounted, onMounted, getCurrentInstance } from 'vue'
import AmapUtil from '@/utils/amap.js'
import {
ref,
computed,
watch,
onMounted,
onUnmounted,
nextTick
} from 'vue'
// 导入地图工具函数
import {
calculateDistanceSync
} from '../utils/mapUtils.js'
// 引用折叠面板组件的ref
const collapseRef = ref(null)
// 使用指南步骤
const guideSteps = ref([{
title: '扫码使用',
desc: '找到附近设备,扫描设备上的二维码'
},
{
title: '免押金支付',
desc: '无需支付押金,使用支付分免押即可完成租借'
},
{
title: '开始使用',
desc: '设备自动解锁,风扇弹出后取出即可开始使用'
},
{
title: '归还设备',
desc: '使用完毕后,按照设备规格要求将风扇还入即可结束订单'
}
])
// Props
const props = defineProps({
@@ -77,48 +104,184 @@ const emit = defineEmits([
])
// 响应式数据
const mapKey = ref(0)
const mapZoom = ref(16) // 地图缩放级别 (16级约等于1:500m比例)
const isLoading = ref(true)
const mapCenter = ref({
longitude: 116.397128,
latitude: 39.916527
})
const loadPositionsTimer = ref(null)
const isMapInitialized = ref(false) // 标记地图是否已初始化
const mapZoom = ref(17)
const mapMarkers = ref([]) // 用于地图组件的markers
const mapContext = ref(null) // 地图上下文
// 获取组件实例
const instance = getCurrentInstance()
// 方法
const updateMapMarkers = () => {
mapMarkers.value = []
// 方法定义(需要在watch之前定义)
const updateMapCenter = (longitude, latitude) => {
// 检查是否真的需要更新
if (mapCenter.value.longitude === longitude && mapCenter.value.latitude === latitude) {
// 添加用户位置标记
if (props.userLocation) {
mapMarkers.value.push({
id: 0, // ID必须是数字
// iconPath: '/static/scan-icon.png',
width: 32,
height: 32,
latitude: props.userLocation.latitude,
longitude: props.userLocation.longitude,
title: '我的位置',
callout: {
content: '我的位置',
color: '#ffffff',
fontSize: 12,
borderRadius: 4,
bgColor: '#2196F3',
padding: 6,
display: 'BYCLICK' // 点击时显示
},
customCallout: {
anchorX: 0,
anchorY: 0
}
})
}
// 添加位置点标记
if (props.filteredPositions && props.filteredPositions.length > 0) {
props.filteredPositions.forEach((pos, index) => {
if (pos.longitude && pos.latitude) {
// 验证纬度值是否在有效范围内
const lat = parseFloat(pos.latitude);
const lng = parseFloat(pos.longitude);
// 检查纬度是否在-90到90之间,经度是否在-180到180之间
if (lat >= -90 && lat <= 90 && lng >= -180 && lng <= 180) {
mapMarkers.value.push({
id: index + 1, // ID必须是数字,避免和用户位置的ID冲突
// iconPath: '/static/scan-icon.png',
width: 30,
height: 30,
latitude: lat,
longitude: lng,
title: pos.name,
position: pos, // 存储原始位置数据,用于事件处理
callout: {
content: pos.name,
color: '#333333',
fontSize: 12,
borderRadius: 4,
bgColor: '#ffffff',
padding: 6,
display: 'BYCLICK' // 点击时显示
}
})
} else {
console.warn(`忽略无效坐标: ${pos.name}, 纬度=${lat}, 经度=${lng}`);
}
}
})
}
isLoading.value = false
}
// 移动地图到指定位置
const moveToLocation = (location) => {
if (!location || !location.longitude || !location.latitude) return
if (mapContext.value) {
mapContext.value.moveToLocation({
longitude: location.longitude,
latitude: location.latitude,
success: () => {
console.log('地图已移动到指定位置')
},
fail: (error) => {
console.error('移动地图失败:', error)
}
})
}
}
// 监听用户位置变化
watch(() => props.userLocation, (newLocation) => {
if (newLocation && newLocation.longitude && newLocation.latitude) {
mapCenter.value = {
longitude: newLocation.longitude,
latitude: newLocation.latitude
}
updateMapMarkers()
moveToLocation(newLocation)
}
}, {
immediate: true,
deep: true
})
// 监听位置列表变化
watch(() => props.filteredPositions, (newPositions) => {
updateMapMarkers()
}, {
deep: true
})
// 地图加载完成事件
const onMapUpdated = () => {
isLoading.value = false
}
// 地图区域变化事件
const onMapRegionChange = (e) => {
// 当地图区域变化结束时,更新mapCenter
if (e.type === 'end' && e.causedBy === 'drag') {
// 获取地图中心点
if (mapContext.value) {
mapContext.value.getCenterLocation({
success: (res) => {
if (res.longitude && res.latitude) {
mapCenter.value = {
longitude: res.longitude,
latitude: res.latitude
}
emit('mapCenterChange', mapCenter.value)
}
}
})
}
}
}
// 标记点点击事件
const onMapMarkerTap = (e) => {
const markerId = e.markerId
const marker = mapMarkers.value.find(item => item.id === markerId)
if (marker) {
if (markerId === 0) { // 用户位置标记
uni.showToast({
title: '这是您的位置',
icon: 'none'
})
return
}
mapCenter.value = { longitude, latitude }
mapZoom.value = 16 // 确保缩放级别正确
if (marker.position) {
emit('markerTap', marker.position)
}
}
}
// 延迟调用地图API,确保DOM已更新
nextTick(() => {
setTimeout(() => {
const mapContext = uni.createMapContext('mainMap')
if (mapContext) {
mapContext.setCenterOffset({
longitude,
latitude,
success: () => {},
fail: () => {
// 备用方案
mapContext.includePoints({
points: [{ longitude, latitude }],
padding: [0, 0, 0, 0]
})
// 标记点气泡点击事件
const onCalloutTap = (e) => {
const markerId = e.markerId
const marker = mapMarkers.value.find(item => item.id === markerId)
if (marker && marker.position) {
emit('markerTap', marker.position)
}
})
}
}, 200)
})
// 地图错误事件
const onMapError = (error) => {
console.error('地图加载失败:', error)
isLoading.value = false
}
const handleRelocate = () => {
@@ -133,128 +296,43 @@ const handleShowList = () => {
emit('showList')
}
const handleMarkerTap = (e) => {
if (!e.detail || typeof e.detail.markerId === 'undefined') {
return
}
const markerId = e.detail.markerId
if (markerId === 9999) {
uni.showToast({
title: '这是您的位置',
icon: 'none'
})
return
}
const position = props.filteredPositions[markerId]
if (position) {
emit('markerTap', position)
}
}
const handleRegionChange = (e) => {
if (e.detail.type === 'end') {
const { center } = e.detail
if (!center || typeof center.longitude === 'undefined' || typeof center.latitude === 'undefined') {
return
}
mapCenter.value = {
longitude: center.longitude,
latitude: center.latitude
}
mapZoom.value = 16 // 确保缩放级别保持正确
// 清除之前的定时器
if (loadPositionsTimer.value) {
clearTimeout(loadPositionsTimer.value)
}
// 设置防抖定时器,500ms后执行
loadPositionsTimer.value = setTimeout(() => {
emit('mapCenterChange', mapCenter.value)
}, 500)
}
}
// 计算属性 - 地图标记
const mapMarkers = computed(() => {
const markers = []
// 添加场地标记
props.filteredPositions.forEach((item, index) => {
if (item.longitude && item.latitude) {
markers.push({
id: index,
longitude: parseFloat(item.longitude),
latitude: parseFloat(item.latitude),
title: item.name,
iconPath: '/static/scan-icon.png',
width: 30,
height: 30,
callout: {
content: item.name,
fontSize: 14,
borderRadius: 8,
bgColor: '#ffffff',
padding: 10,
display: 'BYCLICK'
}
})
}
})
// 添加用户位置标记
if (props.userLocation) {
markers.push({
id: 9999, // 特殊ID标识用户位置
longitude: props.userLocation.longitude,
latitude: props.userLocation.latitude,
title: '我的位置',
iconPath: '/static/scan-icon.png',
width: 32,
height: 32,
callout: {
content: '我的位置',
fontSize: 14,
borderRadius: 8,
bgColor: '#2196F3',
color: '#ffffff',
padding: 10,
display: 'BYCLICK'
}
})
}
return markers
})
// 监听用户位置变化,更新地图中心
watch(() => props.userLocation, (newLocation) => {
if (newLocation && newLocation.longitude && newLocation.latitude && !isMapInitialized.value) {
updateMapCenter(newLocation.longitude, newLocation.latitude)
isMapInitialized.value = true
}
}, { immediate: true, deep: true })
// 组件挂载时的初始化
// 生命周期钩子
onMounted(() => {
// 现在组件只在有用户位置时才会渲染,所以不需要默认位置
})
// 初始化地图上下文
nextTick(() => {
// 需要使用nextTick确保地图组件已经渲染
mapContext.value = uni.createMapContext('map')
updateMapMarkers()
// 组件卸载时清理
onUnmounted(() => {
if (loadPositionsTimer.value) {
clearTimeout(loadPositionsTimer.value)
// 初始化折叠面板
if (collapseRef.value) {
collapseRef.value.init()
}
})
})
onUnmounted(() => {
// 清理工作
mapContext.value = null
})
// 折叠面板事件处理
const onCollapseChange = (names) => {}
const onCollapseOpen = (names) => {}
const onCollapseClose = (names) => {}
// 暴露给父组件的方法
defineExpose({
mapCenter: computed(() => mapCenter.value)
mapCenter: computed(() => mapCenter.value),
moveToLocation,
updateMapMarkers,
initCollapse: () => {
if (collapseRef.value) {
collapseRef.value.init()
}
}
})
</script>
@@ -263,15 +341,34 @@ defineExpose({
.map-container {
flex: 1;
position: relative;
height: 100vh;
width: 100%;
height: 60vh;
/* 增加高度 */
width: 92%;
/* 略微增加宽度 */
margin: 10rpx auto 30rpx;
/* 调整上下间距,左右自动居中 */
border-radius: 24rpx;
/* 添加圆角 */
overflow: hidden;
/* 确保圆角生效 */
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
/* 添加阴影效果 */
// min-height: 400rpx; /* 确保有最小高度 */
.map {
.map-wrapper {
width: 100%;
height: 100%;
// min-height: 400rpx; /* 确保地图有最小高度 */
position: relative;
overflow: hidden;
border-radius: 24rpx;
/* 内层也添加圆角 */
.native-map {
width: 100%;
height: 100%;
display: block;
border-radius: 24rpx;
/* 地图也添加圆角 */
}
}
.map-loading {
@@ -312,27 +409,28 @@ defineExpose({
.map-controls {
position: absolute;
right: 30rpx;
right: 20rpx;
bottom: 20rpx;
// margin-bottom: 30rpx;
left: 30rpx;
left: 20rpx;
display: flex;
justify-content: center;
align-items: center;
gap: 30rpx;
gap: 20rpx;
.control-btn {
min-width: 140rpx;
height: 80rpx;
min-width: 120rpx;
/* 减小按钮宽度 */
height: 70rpx;
/* 减小按钮高度 */
background: #ffffff;
border-radius: 40rpx;
border-radius: 35rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
transition: all 0.2s ease;
padding: 0 20rpx;
padding: 0 16rpx;
&:active {
transform: scale(0.95);
@@ -352,8 +450,10 @@ defineExpose({
}
&.main-btn {
min-width: 160rpx;
height: 90rpx;
min-width: 140rpx;
/* 减小主按钮宽度 */
height: 80rpx;
/* 减小主按钮高度 */
box-shadow: 0 6rpx 20rpx rgba(33, 150, 243, 0.4);
transform: translateY(-5rpx);
@@ -414,7 +514,14 @@ defineExpose({
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
+3 -3
View File
@@ -1,5 +1,5 @@
export const URL = "https://my.gxfs123.com/api" //正式服务器
// export const URL = "https://unifans.gxfs123.com/api" //测试服务器
// export const URL = "http://192.168.10.31:8080" //本地调试
// export const URL = "https://my.gxfs123.com/api" //正式服务器
export const URL = "https://fansdev.gxfs123.com/api" //测试服务器
// export const URL = "http://192.168.10.69:8080" //本地调试
export const appid = "wx2165f0be356ae7a9" //小程序appid
+16 -1
View File
@@ -111,7 +111,10 @@ export const rentPowerBank = (deviceNo, phone) => {
return request({
url: '/app/device/rentPowerBank',
method: 'post',
data: { deviceNo, phone }
data: {
deviceNo,
phone
}
})
}
@@ -190,3 +193,15 @@ export const updateUserBalance = (orderId) => {
})
}
/*
*
*弃用
*/
export const getPotionsDetail = (data) => {
console.log(data);
return request({
url: '/device/position/positionDetails',
method: 'get',
data
})
}
+8 -1
View File
@@ -1,10 +1,11 @@
{
"name": "uni-fans",
"name": "uni-fans-score",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"dependencies": {
"@climblee/uv-ui": "^1.1.20",
"axios": "^1.7.9",
"axios-miniprogram-adapter": "0.3.4",
"uniapp-axios-adapter": "^0.3.2",
@@ -15,6 +16,12 @@
"sass-loader": "^13.2.0"
}
},
"node_modules/@climblee/uv-ui": {
"version": "1.1.20",
"resolved": "https://registry.npmmirror.com/@climblee/uv-ui/-/uv-ui-1.1.20.tgz",
"integrity": "sha512-jkyesHJsPJkF4Nap9ZmG1/ibKlxXA5M8+ntqKXwwloIsYSYL5SOKb0gyPj17aBOU1PkJpmeiZ8PwnTolhK2/HA==",
"license": "ISC"
},
"node_modules/@jridgewell/gen-mapping": {
"version": "0.3.8",
"resolved": "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz",
+1
View File
@@ -1,5 +1,6 @@
{
"dependencies": {
"@climblee/uv-ui": "^1.1.20",
"axios": "^1.7.9",
"axios-miniprogram-adapter": "0.3.4",
"uniapp-axios-adapter": "^0.3.2",
+4
View File
@@ -1,6 +1,10 @@
{
"easycom": {
"autoscan": true,
"custom": {
"^uv-(.*)": "@climblee/uv-ui/components/uv-$1/uv-$1.vue",
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}
},
"pages": [{
"path": "pages/index/index",
+324 -77
View File
@@ -1,35 +1,42 @@
<template>
<view class="container">
<!-- 顶部搜索栏 -->
<!-- <view class="header-search">
<view class="search-box">
<image class="search-icon" src="@/static/scan-icon.png" mode="aspectFit" />
<input
class="search-input"
:placeholder="searchPlaceholder"
v-model="searchKeyword"
@input="onSearchInput"
/>
<view class="location-btn" @click="handleRelocate">
<image class="location-icon" src="@/static/scan-icon.png" mode="aspectFit" />
<!-- 顶部Logo区域 -->
<view class="header-section">
<view class="logo-container">
<image class="logo-image" src="/static/logo.png" mode="aspectFit" />
<text class="app-name">共享风扇</text>
</view>
<uv-notice-bar :text="noticeText" mode="link" :speed="50" :show-icon="true" color="#2196F3"
bg-color="#E3F2FD" icon="volume"></uv-notice-bar>
</view>
<!-- 地图标题 -->
<!-- <view class="map-title">
<text>附近场地</text>
</view> -->
<!-- 地图组件 -->
<MapComponent
v-if="!isLoading && userLocation"
ref="mapRef"
:userLocation="userLocation"
:positionList="positionList"
:filteredPositions="filteredPositions"
:searchKeyword="searchKeyword"
@relocate="handleRelocate"
@scan="handleScan"
@showList="showLocationList"
@markerTap="selectPosition"
@mapCenterChange="onMapCenterChange"
/>
<MapComponent v-if="!isLoading && userLocation" ref="mapRef" :userLocation="userLocation"
:positionList="positionList" :filteredPositions="filteredPositions" :searchKeyword="searchKeyword"
@relocate="handleRelocate" @scan="handleScan" @showList="showLocationList" @markerTap="selectPosition"
@mapCenterChange="onMapCenterChange" />
<!-- 操作步骤指引常驻显示 -->
<view class="steps-guide">
<view class="guide-header">
<text class="guide-title">使用指南</text>
</view>
<view class="steps-container">
<view class="step-item" v-for="(step, index) in guideSteps" :key="index">
<view class="step-number">{{ index + 1 }}</view>
<view class="step-content">
<text class="step-title">{{ step.title }}</text>
<text class="step-desc">{{ step.desc }}</text>
</view>
</view>
</view>
</view>
<!-- 地图加载状态 -->
<view v-if="isLoading || !userLocation" class="map-loading-placeholder">
@@ -43,30 +50,25 @@
<view class="location-popup" v-if="showLocationPopup">
<view class="popup-mask" @click="hideLocationList"></view>
<view class="location-sheet" :class="{ 'expanded': isExpanded }">
<view class="sheet-handle" @click="toggleSheet">
<!-- <view class="sheet-handle" @click="toggleSheet">
<view class="handle-bar"></view>
</view>
</view> -->
<view class="sheet-header">
<text class="sheet-title">附近场地 ({{ filteredPositions.length }})</text>
<text class="sheet-title">附近设备场地 ({{ filteredPositions.length }})</text>
<view class="close-btn" @click="hideLocationList">
<image class="close-icon" src="@/static/scan-icon.png" mode="aspectFit" />
<!-- <image class="close-icon" src="/static/scan-icon.png" mode="aspectFit" /> -->
<uv-icon name='close'></uv-icon>
</view>
</view>
<scroll-view class="sheet-content" scroll-y="true">
<view
class="position-item"
v-for="(item, index) in filteredPositions"
:key="item.positionId"
@click="selectPositionFromPopup(item)"
>
<view class="position-item" v-for="(item, index) in filteredPositions" :key="item.positionId"
@click="selectPositionFromPopup(item)">
<view class="position-info">
<view class="position-name">{{ item.name }}</view>
<view class="position-desc">{{ item.describe }}</view>
<view class="position-location">
<image class="location-icon-small" src="@/static/scan-icon.png" mode="aspectFit" />
<text>{{ item.location }}</text>
<view class="status-tag" :class="item.status">
<text>{{ item.status === 'online' ? '可租借/归还' : '不可租借/归还' }}</text>
</view>
<view class="position-time" v-if="item.workTime && item.workTime !== '0'">
<text>营业时间{{ item.workTime }}</text>
@@ -74,11 +76,12 @@
</view>
<view class="position-actions">
<view class="distance-info" v-if="item.distance">
<text>{{ item.distance }}km</text>
<text>{{ item.distance }}</text>
</view>
<view class="status-tag" :class="item.status">
<text>{{ item.status === 'online' ? '营业中' : '暂停服务' }}</text>
</view>
<view class="nav-btn" @click.stop="navigateToPosition(item)">
<text>导航</text>
</view>
@@ -86,8 +89,8 @@
</view>
<view class="empty-state" v-if="filteredPositions.length === 0 && !isLoading">
<image class="empty-icon" src="@/static/scan-icon.png" mode="aspectFit" />
<text class="empty-text">暂无附近场地</text>
<image class="empty-icon" src="/static/scan-icon.png" mode="aspectFit" />
<text class="empty-text">附近5公里内暂无设备</text>
</view>
</scroll-view>
</view>
@@ -125,12 +128,33 @@
</template>
<script setup>
import { ref, computed, onMounted, onUnmounted } from 'vue'
import { getQueryString, wxLogin } from '@/util/index.js'
import { URL } from "@/config/url.js"
import { getDeviceInfo } from '@/config/user.js'
import AmapUtil from '@/utils/amap.js'
import MapComponent from '@/components/MapComponent.vue'
import {
ref,
computed,
onMounted,
onUnmounted
} from 'vue'
import {
getQueryString,
wxLogin
} from '../../util/index.js'
import {
URL
} from "../../config/url.js"
import {
getDeviceInfo,
getPotionsDetail
} from '../../config/user.js'
// 导入地图工具函数
import {
getUserLocation,
getRegeo,
calculateDistanceSync,
testDistanceCalculation
} from '../../utils/mapUtils.js'
// 同样需要使用相对路径引入组件
// 注意:从 pages/index/ 目录访问 components/ 需要使用 ../../components/ 路径
import MapComponent from '../../components/MapComponent.vue'
// 响应式数据
const searchKeyword = ref('')
@@ -143,6 +167,38 @@ const showPhoneAuthPopup = ref(false)
const isLocationInitialized = ref(false)
const showLocationPopup = ref(false)
// 使用指南步骤
const guideSteps = ref([{
title: '扫码使用',
desc: '找到附近设备,扫描设备上的二维码即可开始租借'
},
{
title: '免押金支付',
desc: '无需支付押金,使用支付分免押即可完成租借'
},
{
title: '开始使用',
desc: '设备自动解锁,风扇弹出后取出即可开始使用'
},
{
title: '归还设备',
desc: '使用完毕后,按照设备规格要求将风扇还入即可结束订单'
}
])
// 滚动通知内容
const noticeText = ref('消费规则:每小时5元,不足1小时按1小时计费,最高24小时封顶,请爱护设备,使用后请及时归还')
// 距离格式化函数
const formatDistance = (distanceInMeters) => {
if (distanceInMeters < 1000) {
return `${Math.round(distanceInMeters)}m`
} else {
return `${(distanceInMeters / 1000).toFixed(1)}km`
}
}
// 组件引用
const mapRef = ref(null)
@@ -167,12 +223,20 @@ onUnmounted(() => {
const init = async () => {
isLoading.value = true
try {
// 开发环境测试距离计算
if (process.env.NODE_ENV === 'development') {
testDistanceCalculation()
}
// 1. 先获取用户位置
await getUserLocation()
await getUserLocationAndAddress()
// 2. 加载场地列表
await loadPositions()
// 3. 检查是否需要显示使用指南(可以根据用户行为记录来决定)
// 这里暂时默认显示,后续可以根据用户使用情况优化
} catch (error) {
console.error('初始化失败:', error)
// 即使失败也要加载场地列表
@@ -182,15 +246,10 @@ const init = async () => {
}
}
const getUserLocation = async () => {
const getUserLocationAndAddress = async () => {
try {
const location = await new Promise((resolve, reject) => {
uni.getLocation({
type: 'gcj02',
success: resolve,
fail: reject
})
})
// 使用腾讯地图SDK获取位置
const location = await getUserLocation()
// 保存用户位置
userLocation.value = {
@@ -198,6 +257,16 @@ const getUserLocation = async () => {
latitude: location.latitude
}
// 将经纬度写入本地缓存(基础信息)
try {
uni.setStorageSync('userLocation', {
longitude: location.longitude,
latitude: location.latitude
})
} catch (e) {
console.warn('缓存基础定位信息失败:', e)
}
// 只在首次初始化时设置标记
if (!isLocationInitialized.value) {
isLocationInitialized.value = true
@@ -205,12 +274,25 @@ const getUserLocation = async () => {
// 获取详细地址信息
try {
const addressResult = await AmapUtil.regeocode(location.longitude, location.latitude)
const addressResult = await getRegeo(location.longitude, location.latitude)
if (addressResult.success) {
const addressInfo = addressResult.data
userLocation.value.address = addressInfo.formatted_address
userLocation.value.city = addressInfo.addressComponent.city
userLocation.value.district = addressInfo.addressComponent.district
// 更新本地缓存,包含地址信息
try {
uni.setStorageSync('userLocation', {
longitude: userLocation.value.longitude,
latitude: userLocation.value.latitude,
address: userLocation.value.address,
city: userLocation.value.city,
district: userLocation.value.district
})
} catch (e) {
console.warn('缓存带地址的定位信息失败:', e)
}
}
} catch (error) {
// 忽略地址信息错误,使用基础定位信息
@@ -221,10 +303,6 @@ const getUserLocation = async () => {
await loadPositions()
uni.hideLoading()
uni.showToast({
title: '定位成功',
icon: 'success'
})
}, 800)
} catch (error) {
@@ -243,11 +321,15 @@ const loadPositions = async () => {
}
const res = await uni.request({
url: `${URL}/device/position/list`,
url: `${URL}/device/position/app/list`,
method: 'GET',
header: {
'Authorization': "Bearer " + uni.getStorageSync('token'),
'Clientid': uni.getStorageSync('client_id')
},
data: {
latitude: userLocation.value.latitude,
longitude: userLocation.value.longitude
}
})
@@ -263,7 +345,7 @@ const loadPositions = async () => {
}
}
const calculateDistances = (centerPoint = null) => {
const calculateDistances = async (centerPoint = null) => {
// 如果没有指定中心点,优先使用用户位置,其次使用地图中心
const center = centerPoint || userLocation.value || (mapRef.value?.mapCenter)
@@ -275,23 +357,28 @@ const calculateDistances = (centerPoint = null) => {
positionList.value.forEach(item => {
if (item.longitude && item.latitude) {
try {
const distance = AmapUtil.calculateDistance(
// 使用同步方法计算距离,避免await调用需要改动大量代码
const distanceInMeters = calculateDistanceSync(
center.latitude,
center.longitude,
parseFloat(item.latitude),
parseFloat(item.longitude)
)
item.distance = distance.toFixed(1)
// 使用智能距离格式化
item.distance = formatDistance(distanceInMeters)
// 同时保存原始米数用于排序和过滤
item.distanceInMeters = distanceInMeters
} catch (error) {
console.error('计算距离异常:', error, item)
item.distance = '999.0' // 设置一个默认距离
item.distance = '999.0km' // 设置一个默认距离
item.distanceInMeters = 999000
}
}
})
// 按距离排序
// 按距离排序(使用米数进行排序)
positionList.value.sort((a, b) => {
return (parseFloat(a.distance) || 999) - (parseFloat(b.distance) || 999)
return (a.distanceInMeters || 999000) - (b.distanceInMeters || 999000)
})
}
@@ -317,9 +404,9 @@ const loadPositionsByCenter = async (center) => {
calculateDistances(center)
// 可以选择性过滤距离过远的场地(比如超过10km的)
const maxDistance = 10 // 最大显示距离,单位km
const maxDistanceInMeters = 10000 // 最大显示距离,单位米(10km
filteredPositions.value = positionList.value.filter(item => {
return !item.distance || parseFloat(item.distance) <= maxDistance
return !item.distanceInMeters || item.distanceInMeters <= maxDistanceInMeters
})
} else {
@@ -334,7 +421,9 @@ const loadPositionsByCenter = async (center) => {
}
const handleRelocate = async () => {
uni.showLoading({ title: '定位中...' })
uni.showLoading({
title: '定位中...'
})
// 直接重新加载当前页面
uni.reLaunch({
@@ -526,8 +615,50 @@ const handleScan = async () => {
background-color: #f6f7fb;
display: flex;
flex-direction: column;
// align-items: center;
padding-top: 20rpx;
}
/* 顶部Logo和通知栏 */
.header-section {
width: 92%;
margin: 0 auto 20rpx;
}
.logo-container {
display: flex;
align-items: center;
// margin-bottom: 16rpx;
.logo-image {
width: 80rpx;
height: 80rpx;
margin-right: 8rpx;
}
.app-name {
font-size: 36rpx;
font-weight: 600;
color: #333;
}
}
/* 地图标题 */
.map-title {
width: 92%;
margin: 0 auto 10rpx;
padding: 10rpx 0;
text {
font-size: 32rpx;
font-weight: 600;
color: #333;
}
}
/* 顶部搜索栏 */
.header-search {
padding: 20rpx 30rpx;
@@ -626,7 +757,7 @@ const handleScan = async () => {
}
.sheet-header {
padding: 0 30rpx 20rpx;
padding: 20rpx 30rpx;
border-bottom: 1px solid #f0f0f0;
display: flex;
justify-content: space-between;
@@ -661,9 +792,9 @@ const handleScan = async () => {
}
.sheet-content {
flex: 1;
padding: 20rpx 0;
overflow: hidden;
height: 60vh;
/* 固定高度以保证小程序端 scroll-view 正常滚动 */
}
}
}
@@ -672,6 +803,7 @@ const handleScan = async () => {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
@@ -782,6 +914,29 @@ const handleScan = async () => {
}
}
.status-tag {
padding: 8rpx 16rpx;
border-radius: 20rpx;
font-size: 22rpx;
width: fit-content;
&.online {
background: #e8f5e8;
color: #4caf50;
}
&.offline {
background: #ffeaea;
color: #f44336;
}
&.wait {
background: #ffeaea;
color: #f44336;
}
}
/* 加载状态 */
.loading-overlay {
position: fixed;
@@ -821,8 +976,13 @@ const handleScan = async () => {
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/* 地图加载状态 */
@@ -941,4 +1101,91 @@ const handleScan = async () => {
}
}
}
/* 操作步骤指引 */
.steps-guide {
align-items: center;
align-content: center;
background-color: rgba(255, 255, 255, 0.95);
border-radius: 20rpx;
padding: 0;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.12);
z-index: 10;
// max-width: calc(100% - 40rpx);
backdrop-filter: blur(15rpx);
border: 1rpx solid rgba(255, 255, 255, 0.9);
overflow: hidden;
width: 92%;
margin: 0 auto 20rpx;
}
.guide-header {
padding: 20rpx 24rpx;
background: linear-gradient(135deg, #2196F3, #1976D2);
border-bottom: 1rpx solid rgba(255, 255, 255, 0.2);
.guide-title {
font-size: 32rpx;
font-weight: 600;
color: #ffffff;
text-align: center;
display: block;
}
}
.steps-container {
display: flex;
flex-direction: column;
gap: 16rpx;
padding: 24rpx;
background-color: rgba(255, 255, 255, 0.9);
}
.step-item {
display: flex;
align-items: flex-start;
width: 100%;
padding: 16rpx 0;
border-bottom: 1rpx solid rgba(0, 0, 0, 0.05);
&:last-child {
border-bottom: none;
}
.step-number {
width: 40rpx;
height: 40rpx;
background: linear-gradient(135deg, #2196F3, #1976D2);
color: #ffffff;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
font-weight: bold;
margin-right: 20rpx;
flex-shrink: 0;
box-shadow: 0 4rpx 12rpx rgba(33, 150, 243, 0.4);
}
.step-content {
flex: 1;
padding-top: 4rpx;
.step-title {
font-size: 30rpx;
font-weight: 600;
color: #333;
margin-bottom: 8rpx;
display: block;
}
.step-desc {
font-size: 26rpx;
color: #666;
display: block;
line-height: 1.5;
}
}
}
</style>
@@ -0,0 +1,49 @@
# 距离计算优化文档
## 问题描述
原代码中距离计算存在单位问题:
- `calculateDistanceSync` 函数返回的是米为单位的距离
- 但代码中直接使用 `distance.toFixed(1)` 并显示为 "km"
- 导致距离显示不准确
## 解决方案
### 1. 距离格式化函数
添加了智能距离格式化函数 `formatDistance`
```javascript
const formatDistance = (distanceInMeters) => {
if (distanceInMeters < 1000) {
return `${Math.round(distanceInMeters)}m`
} else {
return `${(distanceInMeters / 1000).toFixed(1)}km`
}
}
```
### 2. 距离数据结构优化
- `item.distance`: 格式化的距离字符串(如 "1.5km" 或 "800m"
- `item.distanceInMeters`: 原始米数,用于排序和过滤
### 3. 排序和过滤逻辑优化
- 排序使用 `distanceInMeters` 进行数值比较
- 过滤使用米数进行距离判断(10km = 10000米)
### 4. 模板显示优化
- 直接显示 `item.distance`,因为已经包含单位
- 移除了模板中的 "km" 后缀
## 测试验证
添加了测试函数 `testDistanceCalculation()` 用于验证距离计算准确性:
- 测试用例:北京天安门到故宫(约1.5公里)
- 开发环境自动运行测试
## 优化效果
1. 距离显示更准确:小于1公里显示为米,大于等于1公里显示为千米
2. 排序更准确:使用数值比较而非字符串比较
3. 过滤更精确:使用米数进行距离判断
4. 用户体验更好:距离显示更直观
## 文件修改清单
- `utils/mapUtils.js`: 添加注释说明单位,添加测试函数
- `pages/index/index.vue`: 优化距离计算逻辑,添加格式化函数
- `project_document/distance_calculation_optimization.md`: 本文档
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

+1 -1
View File
@@ -1 +1 @@
"use strict";exports._imports_0="/static/scan-icon.png",exports._imports_0$1="/static/user-active.png",exports._imports_0$2="/static/images/wxpayflag.png",exports._imports_0$3="/static/images/location-map.svg",exports._imports_1="/static/jl.png",exports._imports_2="/static/complaint.png",exports._imports_3="/static/hlep.png";
"use strict";exports._imports_0="/static/scan-icon.png",exports._imports_0$1="/static/logo.png",exports._imports_0$2="/static/user-active.png",exports._imports_0$3="/static/images/wxpayflag.png",exports._imports_0$4="/static/images/location-map.svg",exports._imports_1="/static/jl.png",exports._imports_1$1="/static/map.png",exports._imports_2="/static/complaint.png",exports._imports_3="/static/hlep.png";
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
"use strict";const e=require("../common/vendor.js"),t=require("../common/assets.js"),i={__name:"MapComponent",props:{userLocation:{type:Object,default:null},positionList:{type:Array,default:()=>[]},filteredPositions:{type:Array,default:()=>[]},searchKeyword:{type:String,default:""}},emits:["relocate","scan","showList","markerTap","mapCenterChange"],setup(i,{expose:o,emit:a}){const n=i,l=a,u=e.ref(0),d=e.ref(16),r=e.ref({longitude:116.397128,latitude:39.916527}),s=e.ref(null),c=e.ref(!1),p=()=>{l("relocate")},f=()=>{l("scan")},m=()=>{l("showList")},g=t=>{if(!t.detail||void 0===t.detail.markerId)return;const i=t.detail.markerId;if(9999===i)return void e.index.showToast({title:"这是您的位置",icon:"none"});const o=n.filteredPositions[i];o&&l("markerTap",o)},v=e=>{if("end"===e.detail.type){const{center:t}=e.detail;if(!t||void 0===t.longitude||void 0===t.latitude)return;r.value={longitude:t.longitude,latitude:t.latitude},d.value=16,s.value&&clearTimeout(s.value),s.value=setTimeout((()=>{l("mapCenterChange",r.value)}),500)}},h=e.computed((()=>{const e=[];return n.filteredPositions.forEach(((t,i)=>{t.longitude&&t.latitude&&e.push({id:i,longitude:parseFloat(t.longitude),latitude:parseFloat(t.latitude),title:t.name,iconPath:"/static/scan-icon.png",width:30,height:30,callout:{content:t.name,fontSize:14,borderRadius:8,bgColor:"#ffffff",padding:10,display:"BYCLICK"}})})),n.userLocation&&e.push({id:9999,longitude:n.userLocation.longitude,latitude:n.userLocation.latitude,title:"我的位置",iconPath:"/static/scan-icon.png",width:32,height:32,callout:{content:"我的位置",fontSize:14,borderRadius:8,bgColor:"#2196F3",color:"#ffffff",padding:10,display:"BYCLICK"}}),e}));return e.watch((()=>n.userLocation),(t=>{var i,o;t&&t.longitude&&t.latitude&&!c.value&&(i=t.longitude,o=t.latitude,r.value.longitude===i&&r.value.latitude===o||(r.value={longitude:i,latitude:o},d.value=16,e.nextTick$1((()=>{setTimeout((()=>{const t=e.index.createMapContext("mainMap");t&&t.setCenterOffset({longitude:i,latitude:o,success:()=>{},fail:()=>{t.includePoints({points:[{longitude:i,latitude:o}],padding:[0,0,0,0]})}})}),200)}))),c.value=!0)}),{immediate:!0,deep:!0}),e.onMounted((()=>{})),e.onUnmounted((()=>{s.value&&clearTimeout(s.value)})),o({mapCenter:e.computed((()=>r.value))}),(i,o)=>e.e({a:u.value,b:r.value.longitude,c:r.value.latitude,d:d.value,e:h.value,f:e.o(g),g:e.o(v),h:!r.value.longitude},(r.value.longitude,{}),{i:t._imports_0,j:e.o(p),k:t._imports_0,l:e.o(f),m:t._imports_0,n:e.o(m)})}},o=e._export_sfc(i,[["__scopeId","data-v-65e2cece"]]);wx.createComponent(o);
"use strict";const e=require("../common/vendor.js"),t=require("../common/assets.js");if(!Array){e.resolveComponent("uv-icon")()}Math;const o={__name:"MapComponent",props:{userLocation:{type:Object,default:null},positionList:{type:Array,default:()=>[]},filteredPositions:{type:Array,default:()=>[]},searchKeyword:{type:String,default:""}},emits:["relocate","scan","showList","markerTap","mapCenterChange"],setup(o,{expose:i,emit:a}){const l=e.ref(null);e.ref([{title:"扫码使用",desc:"找到附近设备,扫描设备上的二维码"},{title:"免押金支付",desc:"无需支付押金,使用支付分免押即可完成租借"},{title:"开始使用",desc:"设备自动解锁,风扇弹出后取出即可开始使用"},{title:"归还设备",desc:"使用完毕后,按照设备规格要求将风扇还入即可结束订单"}]);const n=o,u=a,d=e.ref(!0),r=e.ref({longitude:116.397128,latitude:39.916527}),s=e.ref(17),c=e.ref([]),p=e.ref(null),f=()=>{c.value=[],n.userLocation&&c.value.push({id:0,width:32,height:32,latitude:n.userLocation.latitude,longitude:n.userLocation.longitude,title:"我的位置",callout:{content:"我的位置",color:"#ffffff",fontSize:12,borderRadius:4,bgColor:"#2196F3",padding:6,display:"BYCLICK"},customCallout:{anchorX:0,anchorY:0}}),n.filteredPositions&&n.filteredPositions.length>0&&n.filteredPositions.forEach(((e,t)=>{if(e.longitude&&e.latitude){const o=parseFloat(e.latitude),i=parseFloat(e.longitude);o>=-90&&o<=90&&i>=-180&&i<=180?c.value.push({id:t+1,width:30,height:30,latitude:o,longitude:i,title:e.name,position:e,callout:{content:e.name,color:"#333333",fontSize:12,borderRadius:4,bgColor:"#ffffff",padding:6,display:"BYCLICK"}}):console.warn(`忽略无效坐标: ${e.name}, 纬度=${o}, 经度=${i}`)}})),d.value=!1},v=e=>{e&&e.longitude&&e.latitude&&p.value&&p.value.moveToLocation({longitude:e.longitude,latitude:e.latitude,success:()=>{console.log("地图已移动到指定位置")},fail:e=>{console.error("移动地图失败:",e)}})};e.watch((()=>n.userLocation),(e=>{e&&e.longitude&&e.latitude&&(r.value={longitude:e.longitude,latitude:e.latitude},f(),v(e))}),{immediate:!0,deep:!0}),e.watch((()=>n.filteredPositions),(e=>{f()}),{deep:!0});const m=()=>{d.value=!1},g=e=>{"end"===e.type&&"drag"===e.causedBy&&p.value&&p.value.getCenterLocation({success:e=>{e.longitude&&e.latitude&&(r.value={longitude:e.longitude,latitude:e.latitude},u("mapCenterChange",r.value))}})},h=t=>{const o=t.markerId,i=c.value.find((e=>e.id===o));if(i){if(0===o)return void e.index.showToast({title:"这是您的位置",icon:"none"});i.position&&u("markerTap",i.position)}},C=e=>{const t=e.markerId,o=c.value.find((e=>e.id===t));o&&o.position&&u("markerTap",o.position)},L=e=>{console.error("地图加载失败:",e),d.value=!1},y=()=>{u("relocate")},w=()=>{u("scan")},_=()=>{u("showList")};return e.onMounted((()=>{e.nextTick$1((()=>{p.value=e.index.createMapContext("map"),f(),l.value&&l.value.init()}))})),e.onUnmounted((()=>{p.value=null})),i({mapCenter:e.computed((()=>r.value)),moveToLocation:v,updateMapMarkers:f,initCollapse:()=>{l.value&&l.value.init()}}),(o,i)=>e.e({a:r.value.longitude,b:r.value.latitude,c:c.value,d:s.value,e:e.o(g),f:e.o(h),g:e.o(C),h:e.o(m),i:e.o(L),j:d.value},(d.value,{}),{k:e.p({name:"map-fill",size:"18"}),l:e.o(y),m:t._imports_0,n:e.o(w),o:t._imports_1$1,p:e.o(_)})}},i=e._export_sfc(o,[["__scopeId","data-v-bb5e40bd"]]);wx.createComponent(i);
@@ -1,4 +1,6 @@
{
"component": true,
"usingComponents": {}
"usingComponents": {
"uv-icon": "../node-modules/@climblee/uv-ui/components/uv-icon/uv-icon"
}
}
@@ -1 +1 @@
<view class="map-container data-v-65e2cece"><map id="mainMap" class="map data-v-65e2cece" key="{{a}}" longitude="{{b}}" latitude="{{c}}" scale="{{d}}" markers="{{e}}" show-location="{{false}}" enable-scroll="{{true}}" enable-zoom="{{true}}" enable-rotate="{{false}}" show-compass="{{false}}" bindmarkertap="{{f}}" bindregionchange="{{g}}"></map><view wx:if="{{h}}" class="map-loading data-v-65e2cece"><view class="loading-content data-v-65e2cece"><view class="loading-spinner data-v-65e2cece"></view><text class="data-v-65e2cece">地图加载中...</text></view></view><view class="map-controls data-v-65e2cece"><view class="control-btn location-control data-v-65e2cece" bindtap="{{j}}"><image class="control-icon data-v-65e2cece" src="{{i}}" mode="aspectFit"/><text class="data-v-65e2cece">我的位置</text></view><view class="control-btn scan-control main-btn data-v-65e2cece" bindtap="{{l}}"><image class="control-icon data-v-65e2cece" src="{{k}}" mode="aspectFit"/><text class="data-v-65e2cece">扫码使用</text></view><view class="control-btn list-control data-v-65e2cece" bindtap="{{n}}"><image class="control-icon data-v-65e2cece" src="{{m}}" mode="aspectFit"/><text class="data-v-65e2cece">附近场地</text></view></view></view>
<view class="map-container data-v-bb5e40bd"><view class="map-wrapper data-v-bb5e40bd"><map id="map" class="native-map data-v-bb5e40bd" longitude="{{a}}" latitude="{{b}}" markers="{{c}}" scale="{{d}}" show-location="{{true}}" bindregionchange="{{e}}" bindmarkertap="{{f}}" bindcallouttap="{{g}}" bindupdated="{{h}}" binderror="{{i}}"></map><view wx:if="{{j}}" class="map-loading data-v-bb5e40bd"><view class="loading-content data-v-bb5e40bd"><view class="loading-spinner data-v-bb5e40bd"></view><text class="data-v-bb5e40bd">地图加载中...</text></view></view></view><view class="map-controls data-v-bb5e40bd"><view class="control-btn location-control data-v-bb5e40bd" bindtap="{{l}}"><uv-icon wx:if="{{k}}" class="data-v-bb5e40bd" u-i="bb5e40bd-0" bind:__l="__l" u-p="{{k}}"></uv-icon><text class="data-v-bb5e40bd" style="margin-left:8rpx">我的位置</text></view><view class="control-btn scan-control main-btn data-v-bb5e40bd" bindtap="{{n}}"><image class="control-icon data-v-bb5e40bd" src="{{m}}" mode="aspectFit"/><text class="data-v-bb5e40bd">扫码使用</text></view><view class="control-btn list-control data-v-bb5e40bd" bindtap="{{p}}"><image class="control-icon data-v-bb5e40bd" src="{{o}}" mode="aspectFit"/><text class="data-v-bb5e40bd">附近设备</text></view></view></view>
@@ -1 +1 @@
.map-container.data-v-65e2cece{flex:1;position:relative;height:100vh;width:100%}.map-container .map.data-v-65e2cece{width:100%;height:100%}.map-container .map-loading.data-v-65e2cece{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(255,255,255,.8);display:flex;justify-content:center;align-items:center;z-index:10}.map-container .map-loading .loading-content.data-v-65e2cece{display:flex;flex-direction:column;align-items:center;justify-content:center}.map-container .map-loading .loading-content .loading-spinner.data-v-65e2cece{width:60rpx;height:60rpx;border:8rpx solid #f3f3f3;border-top:8rpx solid #3498db;border-radius:50%;animation:spin-65e2cece 1s linear infinite;margin-bottom:20rpx}.map-container .map-loading .loading-content text.data-v-65e2cece{font-size:32rpx;color:#333;font-weight:500}.map-container .map-controls.data-v-65e2cece{position:absolute;right:30rpx;bottom:20rpx;left:30rpx;display:flex;justify-content:center;align-items:center;gap:30rpx}.map-container .map-controls .control-btn.data-v-65e2cece{min-width:140rpx;height:80rpx;background:#fff;border-radius:40rpx;display:flex;flex-direction:row;align-items:center;justify-content:center;box-shadow:0 4rpx 12rpx rgba(0,0,0,.1);transition:all .2s ease;padding:0 20rpx}.map-container .map-controls .control-btn.data-v-65e2cece:active{transform:scale(.95)}.map-container .map-controls .control-btn .control-icon.data-v-65e2cece{width:32rpx;height:32rpx;margin-right:12rpx}.map-container .map-controls .control-btn text.data-v-65e2cece{font-size:26rpx;color:#333;white-space:nowrap;font-weight:500}.map-container .map-controls .control-btn.main-btn.data-v-65e2cece{min-width:160rpx;height:90rpx;box-shadow:0 6rpx 20rpx rgba(33,150,243,.4);transform:translateY(-5rpx)}.map-container .map-controls .control-btn.main-btn .control-icon.data-v-65e2cece{width:36rpx;height:36rpx;margin-right:16rpx}.map-container .map-controls .control-btn.main-btn text.data-v-65e2cece{font-size:28rpx;font-weight:600}.map-container .map-controls .control-btn.main-btn.data-v-65e2cece:active{transform:translateY(-5rpx) scale(.95)}.map-container .map-controls .scan-control.data-v-65e2cece{background:#2196f3}.map-container .map-controls .scan-control .control-icon.data-v-65e2cece{filter:brightness(0) invert(1)}.map-container .map-controls .scan-control text.data-v-65e2cece{color:#fff}.map-container .map-controls .list-control.data-v-65e2cece{background:#4caf50}.map-container .map-controls .list-control .control-icon.data-v-65e2cece{filter:brightness(0) invert(1)}.map-container .map-controls .list-control text.data-v-65e2cece{color:#fff}.map-container .map-controls .location-control.data-v-65e2cece{background:#fff;border:2rpx solid #e0e0e0}.map-container .map-controls .location-control .control-icon.data-v-65e2cece{filter:none}.map-container .map-controls .location-control text.data-v-65e2cece{color:#333}@keyframes spin-65e2cece{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
.map-container.data-v-bb5e40bd{flex:1;position:relative;height:60vh;width:92%;margin:10rpx auto 30rpx;border-radius:24rpx;overflow:hidden;box-shadow:0 4rpx 16rpx rgba(0,0,0,.1)}.map-container .map-wrapper.data-v-bb5e40bd{width:100%;height:100%;position:relative;overflow:hidden;border-radius:24rpx}.map-container .map-wrapper .native-map.data-v-bb5e40bd{width:100%;height:100%;display:block;border-radius:24rpx}.map-container .map-loading.data-v-bb5e40bd{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(255,255,255,.8);display:flex;justify-content:center;align-items:center;z-index:10}.map-container .map-loading .loading-content.data-v-bb5e40bd{display:flex;flex-direction:column;align-items:center;justify-content:center}.map-container .map-loading .loading-content .loading-spinner.data-v-bb5e40bd{width:60rpx;height:60rpx;border:8rpx solid #f3f3f3;border-top:8rpx solid #3498db;border-radius:50%;animation:spin-bb5e40bd 1s linear infinite;margin-bottom:20rpx}.map-container .map-loading .loading-content text.data-v-bb5e40bd{font-size:32rpx;color:#333;font-weight:500}.map-container .map-controls.data-v-bb5e40bd{position:absolute;right:20rpx;bottom:20rpx;left:20rpx;display:flex;justify-content:center;align-items:center;gap:20rpx}.map-container .map-controls .control-btn.data-v-bb5e40bd{min-width:120rpx;height:70rpx;background:#fff;border-radius:35rpx;display:flex;flex-direction:row;align-items:center;justify-content:center;box-shadow:0 4rpx 12rpx rgba(0,0,0,.1);transition:all .2s ease;padding:0 16rpx}.map-container .map-controls .control-btn.data-v-bb5e40bd:active{transform:scale(.95)}.map-container .map-controls .control-btn .control-icon.data-v-bb5e40bd{width:32rpx;height:32rpx;margin-right:12rpx}.map-container .map-controls .control-btn text.data-v-bb5e40bd{font-size:26rpx;color:#333;white-space:nowrap;font-weight:500}.map-container .map-controls .control-btn.main-btn.data-v-bb5e40bd{min-width:140rpx;height:80rpx;box-shadow:0 6rpx 20rpx rgba(33,150,243,.4);transform:translateY(-5rpx)}.map-container .map-controls .control-btn.main-btn .control-icon.data-v-bb5e40bd{width:36rpx;height:36rpx;margin-right:16rpx}.map-container .map-controls .control-btn.main-btn text.data-v-bb5e40bd{font-size:28rpx;font-weight:600}.map-container .map-controls .control-btn.main-btn.data-v-bb5e40bd:active{transform:translateY(-5rpx) scale(.95)}.map-container .map-controls .scan-control.data-v-bb5e40bd{background:#2196f3}.map-container .map-controls .scan-control .control-icon.data-v-bb5e40bd{filter:brightness(0) invert(1)}.map-container .map-controls .scan-control text.data-v-bb5e40bd{color:#fff}.map-container .map-controls .list-control.data-v-bb5e40bd{background:#4caf50}.map-container .map-controls .list-control .control-icon.data-v-bb5e40bd{filter:brightness(0) invert(1)}.map-container .map-controls .list-control text.data-v-bb5e40bd{color:#fff}.map-container .map-controls .location-control.data-v-bb5e40bd{background:#fff;border:2rpx solid #e0e0e0}.map-container .map-controls .location-control .control-icon.data-v-bb5e40bd{filter:none}.map-container .map-controls .location-control text.data-v-bb5e40bd{color:#333}@keyframes spin-bb5e40bd{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
+1 -1
View File
@@ -1 +1 @@
"use strict";exports.URL="https://my.gxfs123.com/api",exports.appid="wx2165f0be356ae7a9";
"use strict";exports.URL="https://fansdev.gxfs123.com/api",exports.appid="wx2165f0be356ae7a9";
@@ -0,0 +1 @@
"use strict";const e=require("../../../../../common/vendor.js"),o={emits:["click","close","change"],mixins:[e.mpMixin,e.mixin,e.props$2],watch:{text:{immediate:!0,handler(e,o){this.$uv.test.array(e)||this.$uv.error("noticebar组件direction为column时,要求text参数为数组形式")}}},computed:{textStyle(){let e={};return e.color=this.color,e.fontSize=this.$uv.addUnit(this.fontSize),e},vertical(){return"horizontal"!=this.mode},swiperStyle:()=>({})},data:()=>({index:0}),methods:{noticeChange(e){this.index=e.detail.current,this.$emit("change",this.index)},clickHandler(){this.$emit("click",this.index)},close(){this.$emit("close")}}};if(!Array){e.resolveComponent("uv-icon")()}Math;const i=e._export_sfc(o,[["render",function(o,i,t,c,n,l){return e.e({a:o.icon},o.icon?{b:e.p({name:o.icon,color:o.color,size:"19"})}:{},{c:e.f(o.text,((o,i,t)=>({a:e.t(o),b:i}))),d:e.s(l.textStyle),e:o.disableTouch,f:!o.step,g:o.duration,h:!o.disableScroll,i:e.s(l.swiperStyle),j:e.o(((...e)=>l.noticeChange&&l.noticeChange(...e))),k:["link","closable"].includes(o.mode)},["link","closable"].includes(o.mode)?e.e({l:"link"===o.mode},"link"===o.mode?{m:e.p({name:"arrow-right",size:17,color:o.color})}:{},{n:"closable"===o.mode},"closable"===o.mode?{o:e.o(l.close),p:e.p({name:"close",size:16,color:o.color})}:{}):{},{q:e.o(((...e)=>l.clickHandler&&l.clickHandler(...e)))})}],["__scopeId","data-v-1e0ed8e8"]]);wx.createComponent(i);
@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"uv-icon": "../uv-icon/uv-icon"
}
}
@@ -0,0 +1 @@
<view class="uv-notice data-v-1e0ed8e8" bindtap="{{q}}"><block wx:if="{{$slots.icon}}"><slot name="icon"></slot></block><block wx:else><view wx:if="{{a}}" class="uv-notice__left-icon data-v-1e0ed8e8"><uv-icon wx:if="{{b}}" class="data-v-1e0ed8e8" u-i="1e0ed8e8-0" bind:__l="__l" u-p="{{b}}"></uv-icon></view></block><swiper disable-touch="{{e}}" vertical="{{f}}" circular interval="{{g}}" autoplay="{{h}}" class="uv-notice__swiper data-v-1e0ed8e8" style="{{i}}" bindchange="{{j}}"><swiper-item wx:for="{{c}}" wx:for-item="item" wx:key="b" class="uv-notice__swiper__item data-v-1e0ed8e8"><text class="uv-notice__swiper__item__text uv-line-1 data-v-1e0ed8e8" style="{{d}}">{{item.a}}</text></swiper-item></swiper><view wx:if="{{k}}" class="uv-notice__right-icon data-v-1e0ed8e8"><uv-icon wx:if="{{l}}" class="data-v-1e0ed8e8" u-i="1e0ed8e8-1" bind:__l="__l" u-p="{{m}}"></uv-icon><uv-icon wx:if="{{n}}" class="data-v-1e0ed8e8" bindclick="{{o}}" u-i="1e0ed8e8-2" bind:__l="__l" u-p="{{p}}"></uv-icon></view></view>
@@ -0,0 +1 @@
.uv-line-1.data-v-1e0ed8e8{display:-webkit-box!important;overflow:hidden;text-overflow:ellipsis;word-break:break-all;-webkit-line-clamp:1;-webkit-box-orient:vertical!important}.uv-line-2.data-v-1e0ed8e8{display:-webkit-box!important;overflow:hidden;text-overflow:ellipsis;word-break:break-all;-webkit-line-clamp:2;-webkit-box-orient:vertical!important}.uv-line-3.data-v-1e0ed8e8{display:-webkit-box!important;overflow:hidden;text-overflow:ellipsis;word-break:break-all;-webkit-line-clamp:3;-webkit-box-orient:vertical!important}.uv-line-4.data-v-1e0ed8e8{display:-webkit-box!important;overflow:hidden;text-overflow:ellipsis;word-break:break-all;-webkit-line-clamp:4;-webkit-box-orient:vertical!important}.uv-line-5.data-v-1e0ed8e8{display:-webkit-box!important;overflow:hidden;text-overflow:ellipsis;word-break:break-all;-webkit-line-clamp:5;-webkit-box-orient:vertical!important}view.data-v-1e0ed8e8,scroll-view.data-v-1e0ed8e8,swiper-item.data-v-1e0ed8e8{display:flex;flex-direction:column;flex-shrink:0;flex-grow:0;flex-basis:auto;align-items:stretch;align-content:flex-start}.uv-notice.data-v-1e0ed8e8{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.uv-notice__left-icon.data-v-1e0ed8e8{align-items:center;margin-right:5px}.uv-notice__right-icon.data-v-1e0ed8e8{margin-left:5px;align-items:center}.uv-notice__swiper.data-v-1e0ed8e8{height:16px;display:flex;flex-direction:row;align-items:center;flex:1}.uv-notice__swiper__item.data-v-1e0ed8e8{display:flex;flex-direction:row;align-items:center;overflow:hidden}.uv-notice__swiper__item__text.data-v-1e0ed8e8{font-size:14px;color:#f9ae3d}
@@ -0,0 +1 @@
"use strict";const i=require("../../../../../common/vendor.js"),t={name:"uv-icon",emits:["click"],mixins:[i.mpMixin,i.mixin,i.props$1],data:()=>({colorType:["primary","success","info","error","warning"]}),computed:{uClasses(){let i=[];return i.push(this.customPrefix),i.push(this.customPrefix+"-"+this.name),this.color&&this.colorType.includes(this.color)&&i.push("uv-icon__icon--"+this.color),i},iconStyle(){let i={};return i={fontSize:this.$uv.addUnit(this.size),lineHeight:this.$uv.addUnit(this.size),fontWeight:this.bold?"bold":"normal",top:this.$uv.addUnit(this.top)},this.color&&!this.colorType.includes(this.color)&&(i.color=this.color),i},isImg(){const i=this.name.indexOf("data:")>-1&&this.name.indexOf("base64")>-1;return-1!==this.name.indexOf("/")||i},imgStyle(){let i={};return i.width=this.width?this.$uv.addUnit(this.width):this.$uv.addUnit(this.size),i.height=this.height?this.$uv.addUnit(this.height):this.$uv.addUnit(this.size),i},icon(){const t=i.icons["uvicon-"+this.name];return t?unescape(`%u${t}`):["uvicon"].indexOf(this.customPrefix)>-1?this.name:""}},methods:{clickHandler(i){this.$emit("click",this.index),this.stop&&this.preventEvent(i)}}};const e=i._export_sfc(t,[["render",function(t,e,s,o,n,l){return i.e({a:l.isImg},l.isImg?{b:t.name,c:t.imgMode,d:i.s(l.imgStyle),e:i.s(t.$uv.addStyle(t.customStyle))}:{f:i.t(l.icon),g:i.n(l.uClasses),h:i.s(l.iconStyle),i:i.s(t.$uv.addStyle(t.customStyle)),j:t.hoverClass},{k:""!==t.label},""!==t.label?{l:i.t(t.label),m:t.labelColor,n:t.$uv.addUnit(t.labelSize),o:"right"==t.labelPos?t.$uv.addUnit(t.space):0,p:"bottom"==t.labelPos?t.$uv.addUnit(t.space):0,q:"left"==t.labelPos?t.$uv.addUnit(t.space):0,r:"top"==t.labelPos?t.$uv.addUnit(t.space):0}:{},{s:i.o(((...i)=>l.clickHandler&&l.clickHandler(...i))),t:i.n("uv-icon--"+t.labelPos)})}],["__scopeId","data-v-553bbf60"]]);wx.createComponent(e);
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
@@ -0,0 +1 @@
<view bindtap="{{s}}" class="{{['uv-icon', 'data-v-553bbf60', t]}}"><image wx:if="{{a}}" class="uv-icon__img data-v-553bbf60" src="{{b}}" mode="{{c}}" style="{{d + ';' + e}}"></image><text wx:else class="{{['uv-icon__icon', 'data-v-553bbf60', g]}}" style="{{h + ';' + i}}" hover-class="{{j}}">{{f}}</text><text wx:if="{{k}}" class="uv-icon__label data-v-553bbf60" style="{{'color:' + m + ';' + ('font-size:' + n) + ';' + ('margin-left:' + o) + ';' + ('margin-top:' + p) + ';' + ('margin-right:' + q) + ';' + ('margin-bottom:' + r)}}">{{l}}</text></view>
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
"use strict";const o=require("../../../../../common/vendor.js"),e={name:"uv-notice-bar",emits:["click","close","change"],mixins:[o.mpMixin,o.mixin,o.props],data:()=>({show:!0}),methods:{click(o){this.$emit("click",o),this.url&&this.linkType&&this.openPage()},close(){this.show=!1,this.$emit("close")},change(o){this.$emit("change",o)}}};if(!Array){(o.resolveComponent("uv-column-notice")+o.resolveComponent("uv-row-notice"))()}Math||((()=>"../uv-column-notice/uv-column-notice.js")+(()=>"../uv-row-notice/uv-row-notice.js"))();const c=o._export_sfc(e,[["render",function(e,c,i,t,n,s){return o.e({a:n.show},n.show?o.e({b:"column"===e.direction||"row"===e.direction&&e.step},"column"===e.direction||"row"===e.direction&&e.step?{c:o.o(s.close),d:o.o(s.click),e:o.o(s.change),f:o.p({color:e.color,bgColor:e.bgColor,text:e.text,mode:e.mode,step:e.step,icon:e.icon,"disable-touch":e.disableTouch,"disable-scroll":e.disableScroll,fontSize:e.fontSize,duration:e.duration})}:{g:o.o(s.close),h:o.o(s.click),i:o.p({color:e.color,bgColor:e.bgColor,text:e.text,mode:e.mode,fontSize:e.fontSize,speed:e.speed,url:e.url,linkType:e.linkType,icon:e.icon})},{j:o.s({backgroundColor:e.bgColor}),k:o.s(e.$uv.addStyle(e.customStyle))}):{})}],["__scopeId","data-v-20a3c1e7"]]);wx.createComponent(c);
@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"uv-column-notice": "../uv-column-notice/uv-column-notice",
"uv-row-notice": "../uv-row-notice/uv-row-notice"
}
}
@@ -0,0 +1 @@
<view wx:if="{{a}}" class="uv-notice-bar data-v-20a3c1e7" style="{{j + ';' + k}}"><block wx:if="{{b}}"><uv-column-notice wx:if="{{f}}" class="data-v-20a3c1e7" bindclose="{{c}}" bindclick="{{d}}" bindchange="{{e}}" u-i="20a3c1e7-0" bind:__l="__l" u-p="{{f}}"></uv-column-notice></block><block wx:else><uv-row-notice wx:if="{{i}}" class="data-v-20a3c1e7" bindclose="{{g}}" bindclick="{{h}}" u-i="20a3c1e7-1" bind:__l="__l" u-p="{{i}}"></uv-row-notice></block></view>
@@ -0,0 +1 @@
view.data-v-20a3c1e7,scroll-view.data-v-20a3c1e7,swiper-item.data-v-20a3c1e7{display:flex;flex-direction:column;flex-shrink:0;flex-grow:0;flex-basis:auto;align-items:stretch;align-content:flex-start}.uv-notice-bar.data-v-20a3c1e7{overflow:hidden;padding:9px 12px;flex:1}
@@ -0,0 +1 @@
"use strict";const t=require("../../../../../common/vendor.js"),e={name:"uv-row-notice",emits:["click","close"],mixins:[t.mpMixin,t.mixin,t.props$3],data:()=>({animationDuration:"0",animationPlayState:"paused",nvueInit:!0,show:!0}),watch:{text:{immediate:!0,handler(t,e){this.vue(),this.$uv.test.string(t)||this.$uv.error("noticebar组件direction为row时,要求text参数为字符串形式")}},fontSize(){this.vue()},speed(){this.vue()}},computed:{textStyle(){let t={};return t.color=this.color,t.fontSize=this.$uv.addUnit(this.fontSize),t},animationStyle(){let t={};return t.animationDuration=this.animationDuration,t.animationPlayState=this.animationPlayState,t},innerText(){let t=[];const e=this.text?this.text.split(""):[];for(let i=0;i<e.length;i+=20)t.push(e.slice(i,i+20).join(""));return t}},mounted(){this.init()},methods:{init(){this.vue(),this.$uv.test.string(this.text)||this.$uv.error("noticebar组件direction为row时,要求text参数为字符串形式")},async vue(){let t=0;await this.$uv.sleep(),t=(await this.$uvGetRect(".uv-notice__content__text")).width,(await this.$uvGetRect(".uv-notice__content")).width,this.animationDuration=t/this.$uv.getPx(this.speed)+"s",this.animationPlayState="paused",setTimeout((()=>{this.animationPlayState="running"}),10)},async nvue(){},loopAnimation(t,e){},getNvueRect(t){},clickHandler(t){this.$emit("click")},close(){this.$emit("close")}}};if(!Array){t.resolveComponent("uv-icon")()}Math;const i=t._export_sfc(e,[["render",function(e,i,n,o,a,s){return t.e({a:e.icon},e.icon?{b:t.p({name:e.icon,color:e.color,size:"19"})}:{},{c:t.f(s.innerText,((e,i,n)=>({a:t.t(e),b:i}))),d:t.s(s.textStyle),e:t.s(s.animationStyle),f:["link","closable"].includes(e.mode)},["link","closable"].includes(e.mode)?t.e({g:"link"===e.mode},"link"===e.mode?{h:t.p({name:"arrow-right",size:17,color:e.color})}:{},{i:"closable"===e.mode},"closable"===e.mode?{j:t.o(s.close),k:t.p({name:"close",size:16,color:e.color})}:{}):{},{l:t.o(((...t)=>s.clickHandler&&s.clickHandler(...t)))})}],["__scopeId","data-v-07c5f837"]]);wx.createComponent(i);
@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"uv-icon": "../uv-icon/uv-icon"
}
}
@@ -0,0 +1 @@
<view class="uv-notice data-v-07c5f837" bindtap="{{l}}"><block wx:if="{{$slots.icon}}"><slot name="icon"></slot></block><block wx:else><view wx:if="{{a}}" class="uv-notice__left-icon data-v-07c5f837"><uv-icon wx:if="{{b}}" class="data-v-07c5f837" u-i="07c5f837-0" bind:__l="__l" u-p="{{b}}"></uv-icon></view></block><view class="uv-notice__content data-v-07c5f837" ref="uv-notice__content"><view ref="uv-notice__content__text" class="uv-notice__content__text data-v-07c5f837" style="{{e}}"><text wx:for="{{c}}" wx:for-item="item" wx:key="b" class="data-v-07c5f837" style="{{d}}">{{item.a}}</text></view></view><view wx:if="{{f}}" class="uv-notice__right-icon data-v-07c5f837"><uv-icon wx:if="{{g}}" class="data-v-07c5f837" u-i="07c5f837-1" bind:__l="__l" u-p="{{h}}"></uv-icon><uv-icon wx:if="{{i}}" class="data-v-07c5f837" bindclick="{{j}}" u-i="07c5f837-2" bind:__l="__l" u-p="{{k}}"></uv-icon></view></view>
@@ -0,0 +1 @@
view.data-v-07c5f837,scroll-view.data-v-07c5f837,swiper-item.data-v-07c5f837{display:flex;flex-direction:column;flex-shrink:0;flex-grow:0;flex-basis:auto;align-items:stretch;align-content:flex-start}.uv-notice.data-v-07c5f837{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.uv-notice__left-icon.data-v-07c5f837{align-items:center;margin-right:5px}.uv-notice__right-icon.data-v-07c5f837{margin-left:5px;align-items:center}.uv-notice__content.data-v-07c5f837{text-align:right;flex:1;display:flex;flex-direction:row;flex-wrap:nowrap;overflow:hidden}.uv-notice__content__text.data-v-07c5f837{font-size:14px;color:#f9ae3d;padding-left:100%;word-break:keep-all;white-space:nowrap;animation:uv-loop-animation-07c5f837 10s linear infinite both;display:flex;flex-direction:row}@keyframes uv-loop-animation-07c5f837{0%{transform:translateZ(0)}to{transform:translate3d(-100%,0,0)}}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2
View File
@@ -1,6 +1,8 @@
{
"navigationBarTitleText": "附近场地",
"usingComponents": {
"uv-notice-bar": "../../node-modules/@climblee/uv-ui/components/uv-notice-bar/uv-notice-bar",
"uv-icon": "../../node-modules/@climblee/uv-ui/components/uv-icon/uv-icon",
"map-component": "../../components/MapComponent"
}
}
+1 -1
View File
@@ -1 +1 @@
<view class="container data-v-ef66b09a"><map-component wx:if="{{a}}" class="r data-v-ef66b09a" u-r="mapRef" bindrelocate="{{c}}" bindscan="{{d}}" bindshowList="{{e}}" bindmarkerTap="{{f}}" bindmapCenterChange="{{g}}" u-i="ef66b09a-0" bind:__l="__l" u-p="{{h}}"/><view wx:if="{{i}}" class="map-loading-placeholder data-v-ef66b09a"><view class="loading-content data-v-ef66b09a"><view class="loading-spinner data-v-ef66b09a"></view><text class="data-v-ef66b09a">正在获取位置信息...</text></view></view><view wx:if="{{j}}" class="location-popup data-v-ef66b09a"><view class="popup-mask data-v-ef66b09a" bindtap="{{k}}"></view><view class="{{['location-sheet', 'data-v-ef66b09a', t && 'expanded']}}"><view class="sheet-handle data-v-ef66b09a" bindtap="{{l}}"><view class="handle-bar data-v-ef66b09a"></view></view><view class="sheet-header data-v-ef66b09a"><text class="sheet-title data-v-ef66b09a">附近场地 ({{m}})</text><view class="close-btn data-v-ef66b09a" bindtap="{{o}}"><image class="close-icon data-v-ef66b09a" src="{{n}}" mode="aspectFit"/></view></view><scroll-view class="sheet-content data-v-ef66b09a" scroll-y="true"><view wx:for="{{p}}" wx:for-item="item" wx:key="k" class="position-item data-v-ef66b09a" bindtap="{{item.l}}"><view class="position-info data-v-ef66b09a"><view class="position-name data-v-ef66b09a">{{item.a}}</view><view class="position-desc data-v-ef66b09a">{{item.b}}</view><view class="position-location data-v-ef66b09a"><image class="location-icon-small data-v-ef66b09a" src="{{q}}" mode="aspectFit"/><text class="data-v-ef66b09a">{{item.c}}</text></view><view wx:if="{{item.d}}" class="position-time data-v-ef66b09a"><text class="data-v-ef66b09a">营业时间:{{item.e}}</text></view></view><view class="position-actions data-v-ef66b09a"><view wx:if="{{item.f}}" class="distance-info data-v-ef66b09a"><text class="data-v-ef66b09a">{{item.g}}km</text></view><view class="{{['status-tag', 'data-v-ef66b09a', item.i]}}"><text class="data-v-ef66b09a">{{item.h}}</text></view><view class="nav-btn data-v-ef66b09a" catchtap="{{item.j}}"><text class="data-v-ef66b09a">导航</text></view></view></view><view wx:if="{{r}}" class="empty-state data-v-ef66b09a"><image class="empty-icon data-v-ef66b09a" src="{{s}}" mode="aspectFit"/><text class="empty-text data-v-ef66b09a">暂无附近场地</text></view></scroll-view></view></view><view wx:if="{{v}}" class="loading-overlay data-v-ef66b09a"><view class="loading-content data-v-ef66b09a"><view class="loading-spinner data-v-ef66b09a"></view><text class="data-v-ef66b09a">正在获取场地信息...</text></view></view><view wx:if="{{w}}" class="phone-auth-popup data-v-ef66b09a"><view class="popup-mask data-v-ef66b09a" catchtap="{{x}}"></view><view class="popup-content data-v-ef66b09a"><view class="popup-header data-v-ef66b09a"><text class="popup-title data-v-ef66b09a">授权获取手机号</text></view><view class="popup-body data-v-ef66b09a"><view class="auth-desc data-v-ef66b09a"><text class="data-v-ef66b09a">为了提供更好的服务和紧急联系,需要授权获取您的手机号</text></view><button class="auth-btn data-v-ef66b09a" open-type="getPhoneNumber" bindgetphonenumber="{{y}}"><text class="data-v-ef66b09a">一键获取手机号</text></button><view class="auth-cancel data-v-ef66b09a" bindtap="{{z}}"><text class="data-v-ef66b09a">暂不授权</text></view></view></view></view></view>
<view class="container data-v-d45cdca7"><view class="header-section data-v-d45cdca7"><view class="logo-container data-v-d45cdca7"><image class="logo-image data-v-d45cdca7" src="{{a}}" mode="aspectFit"/><text class="app-name data-v-d45cdca7">共享风扇</text></view><uv-notice-bar wx:if="{{b}}" class="data-v-d45cdca7" u-i="d45cdca7-0" bind:__l="__l" u-p="{{b}}"></uv-notice-bar></view><map-component wx:if="{{c}}" class="r data-v-d45cdca7" u-r="mapRef" bindrelocate="{{e}}" bindscan="{{f}}" bindshowList="{{g}}" bindmarkerTap="{{h}}" bindmapCenterChange="{{i}}" u-i="d45cdca7-1" bind:__l="__l" u-p="{{j}}"/><view class="steps-guide data-v-d45cdca7"><view class="guide-header data-v-d45cdca7"><text class="guide-title data-v-d45cdca7">使用指南</text></view><view class="steps-container data-v-d45cdca7"><view wx:for="{{k}}" wx:for-item="step" wx:key="d" class="step-item data-v-d45cdca7"><view class="step-number data-v-d45cdca7">{{step.a}}</view><view class="step-content data-v-d45cdca7"><text class="step-title data-v-d45cdca7">{{step.b}}</text><text class="step-desc data-v-d45cdca7">{{step.c}}</text></view></view></view></view><view wx:if="{{l}}" class="map-loading-placeholder data-v-d45cdca7"><view class="loading-content data-v-d45cdca7"><view class="loading-spinner data-v-d45cdca7"></view><text class="data-v-d45cdca7">正在获取位置信息...</text></view></view><view wx:if="{{m}}" class="location-popup data-v-d45cdca7"><view class="popup-mask data-v-d45cdca7" bindtap="{{n}}"></view><view class="{{['location-sheet', 'data-v-d45cdca7', v && 'expanded']}}"><view class="sheet-header data-v-d45cdca7"><text class="sheet-title data-v-d45cdca7">附近设备场地 ({{o}})</text><view class="close-btn data-v-d45cdca7" bindtap="{{q}}"><uv-icon wx:if="{{p}}" class="data-v-d45cdca7" u-i="d45cdca7-2" bind:__l="__l" u-p="{{p}}"></uv-icon></view></view><scroll-view class="sheet-content data-v-d45cdca7" scroll-y="true"><view wx:for="{{r}}" wx:for-item="item" wx:key="k" class="position-item data-v-d45cdca7" bindtap="{{item.l}}"><view class="position-info data-v-d45cdca7"><view class="position-name data-v-d45cdca7">{{item.a}}</view><view class="{{['status-tag', 'data-v-d45cdca7', item.c]}}"><text class="data-v-d45cdca7">{{item.b}}</text></view><view wx:if="{{item.d}}" class="position-time data-v-d45cdca7"><text class="data-v-d45cdca7">营业时间:{{item.e}}</text></view></view><view class="position-actions data-v-d45cdca7"><view wx:if="{{item.f}}" class="distance-info data-v-d45cdca7"><text class="data-v-d45cdca7">{{item.g}}</text></view><view class="{{['status-tag', 'data-v-d45cdca7', item.i]}}"><text class="data-v-d45cdca7">{{item.h}}</text></view><view class="nav-btn data-v-d45cdca7" catchtap="{{item.j}}"><text class="data-v-d45cdca7">导航</text></view></view></view><view wx:if="{{s}}" class="empty-state data-v-d45cdca7"><image class="empty-icon data-v-d45cdca7" src="{{t}}" mode="aspectFit"/><text class="empty-text data-v-d45cdca7">附近5公里内暂无设备</text></view></scroll-view></view></view><view wx:if="{{w}}" class="loading-overlay data-v-d45cdca7"><view class="loading-content data-v-d45cdca7"><view class="loading-spinner data-v-d45cdca7"></view><text class="data-v-d45cdca7">正在获取场地信息...</text></view></view><view wx:if="{{x}}" class="phone-auth-popup data-v-d45cdca7"><view class="popup-mask data-v-d45cdca7" catchtap="{{y}}"></view><view class="popup-content data-v-d45cdca7"><view class="popup-header data-v-d45cdca7"><text class="popup-title data-v-d45cdca7">授权获取手机号</text></view><view class="popup-body data-v-d45cdca7"><view class="auth-desc data-v-d45cdca7"><text class="data-v-d45cdca7">为了提供更好的服务和紧急联系,需要授权获取您的手机号</text></view><button class="auth-btn data-v-d45cdca7" open-type="getPhoneNumber" bindgetphonenumber="{{z}}"><text class="data-v-d45cdca7">一键获取手机号</text></button><view class="auth-cancel data-v-d45cdca7" bindtap="{{A}}"><text class="data-v-d45cdca7">暂不授权</text></view></view></view></view></view>
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
"use strict";const e=require("../../common/vendor.js"),a=require("../../common/assets.js"),o=require("../../util/index.js");if(!Array){e.resolveComponent("uni-icons")()}const n={__name:"index",setup(n){const t=e.ref({}),r=e.ref("0.00"),i=e.ref(""),s=e.ref(null),d=e.ref(!1);e.onMounted((()=>{l()}));const l=async()=>{try{if(!e.index.getStorageSync("token"))return void(await o.wxLogin());const a=await o.getUserInfo();console.log("User info response:",a),200==a.code&&(a.data.openId&&(i.value=a.data.openId,e.index.setStorageSync("openId",a.data.openId)),t.value={nickName:a.data.nickname,phone:a.data.phone,avatar:a.data.iconUrl,isAdmin:a.data.isAdmin},e.index.setStorageSync("userInfo",t.value),r.value=a.data.balanceAmount||"0.00")}catch(a){console.error("获取用户信息失败:",a),e.index.showToast({title:"获取用户信息失败",icon:"none"})}},c=a=>{e.index.navigateTo({url:a})},p=()=>{c("/pages/deposit/index")},u=()=>{t.value||v()},v=()=>{s.value&&(s.value.open(),d.value=!0)};return(o,n)=>{return e.e({a:t.value.avatar},t.value.avatar?{b:t.value.avatar}:{c:a._imports_0$1},{d:t.value.isAdmin},(t.value.isAdmin,{}),{e:t.value},t.value?{f:e.t(t.value.nickName),g:e.t(t.value.phone?(i=t.value.phone,i?i.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2"):""):"未绑定手机号")}:{},{h:e.p({type:"right",size:"16",color:"#999"}),i:e.o(u),j:e.t(r.value),k:e.o(p),l:a._imports_1,m:e.p({type:"right",size:"16",color:"#999"}),n:e.o((e=>c("/pages/order/index"))),o:a._imports_2,p:e.p({type:"right",size:"16",color:"#999"}),q:e.o((e=>c("/pages/feedback/index"))),r:a._imports_3,s:e.p({type:"right",size:"16",color:"#999"}),t:e.o((e=>c("/pages/help/index")))});var i}}},t=e._export_sfc(n,[["__scopeId","data-v-6fbc3933"]]);wx.createPage(t);
"use strict";const e=require("../../common/vendor.js"),a=require("../../common/assets.js"),o=require("../../util/index.js");if(!Array){e.resolveComponent("uni-icons")()}const n={__name:"index",setup(n){const t=e.ref({}),r=e.ref("0.00"),i=e.ref(""),s=e.ref(null),d=e.ref(!1);e.onMounted((()=>{l()}));const l=async()=>{try{if(!e.index.getStorageSync("token"))return void(await o.wxLogin());const a=await o.getUserInfo();console.log("User info response:",a),200==a.code&&(a.data.openId&&(i.value=a.data.openId,e.index.setStorageSync("openId",a.data.openId)),t.value={nickName:a.data.nickname,phone:a.data.phone,avatar:a.data.iconUrl,isAdmin:a.data.isAdmin},e.index.setStorageSync("userInfo",t.value),r.value=a.data.balanceAmount||"0.00")}catch(a){console.error("获取用户信息失败:",a),e.index.showToast({title:"获取用户信息失败",icon:"none"})}},c=a=>{e.index.navigateTo({url:a})},p=()=>{c("/pages/deposit/index")},u=()=>{t.value||v()},v=()=>{s.value&&(s.value.open(),d.value=!0)};return(o,n)=>{return e.e({a:t.value.avatar},t.value.avatar?{b:t.value.avatar}:{c:a._imports_0$2},{d:t.value.isAdmin},(t.value.isAdmin,{}),{e:t.value},t.value?{f:e.t(t.value.nickName),g:e.t(t.value.phone?(i=t.value.phone,i?i.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2"):""):"未绑定手机号")}:{},{h:e.p({type:"right",size:"16",color:"#999"}),i:e.o(u),j:e.t(r.value),k:e.o(p),l:a._imports_1,m:e.p({type:"right",size:"16",color:"#999"}),n:e.o((e=>c("/pages/order/index"))),o:a._imports_2,p:e.p({type:"right",size:"16",color:"#999"}),q:e.o((e=>c("/pages/feedback/index"))),r:a._imports_3,s:e.p({type:"right",size:"16",color:"#999"}),t:e.o((e=>c("/pages/help/index")))});var i}}},t=e._export_sfc(n,[["__scopeId","data-v-6fbc3933"]]);wx.createPage(t);
+1 -1
View File
@@ -1 +1 @@
"use strict";const e=require("../../common/vendor.js"),a=require("../../common/assets.js"),t=require("../../config/user.js"),r={__name:"details",setup(r){const n=e.ref(""),o=e.ref({}),i=e.computed((()=>{switch(o.value.orderStatus){case"waiting_for_payment":return"待支付";case"in_used":default:return"使用中";case"used_done":return"已完成";case"order_cancelled":return"已取消"}}));e.onLoad((async a=>{a&&a.orderId?(n.value=a.orderId,await u()):(e.index.showToast({title:"订单信息不存在",icon:"none"}),setTimeout((()=>{e.index.navigateBack()}),1500))}));const u=async()=>{try{e.index.showLoading({title:"加载中"});const a=await t.queryById(n.value);if(200!==a.code||!a.data)throw new Error("获取订单详情失败");o.value=a.data,o.value.createTime&&(o.value.createTime=s(new Date(o.value.createTime))),o.value.startTime&&(o.value.startTime=s(new Date(o.value.startTime))),o.value.endTime&&(o.value.endTime=s(new Date(o.value.endTime))),e.index.hideLoading()}catch(a){e.index.hideLoading(),e.index.showToast({title:a.message||"获取订单详情失败",icon:"none"})}},s=e=>`${e.getFullYear()}-${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")} ${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}`,d=e=>{if(!e)return"";const a=parseInt(e);if(a<60)return`${a}分钟`;{const e=Math.floor(a/60),t=a%60;return t>0?`${e}小时${t}分钟`:`${e}小时`}};return(t,r)=>e.e({a:e.t(i.value),b:e.t(o.value.orderNo||"-"),c:e.t(o.value.deviceNo||"-"),d:"wx_score_pay"===o.value.payWay},"wx_score_pay"===o.value.payWay?{e:a._imports_0$2}:{},{f:e.t(o.value.startTime||"-"),g:o.value.endTime},o.value.endTime?{h:e.t(o.value.endTime)}:{},{i:o.value.phone},o.value.phone?{j:e.t(o.value.phone)}:{},{k:o.value.depositAmount},o.value.depositAmount?{l:e.t(o.value.depositAmount)}:{},{m:o.value.packageTime&&o.value.packagePrice},o.value.packageTime&&o.value.packagePrice?{n:e.t(o.value.packagePrice),o:e.t(d(o.value.packageTime))}:{},{p:e.t(o.value.payAmount||0)})}},n=e._export_sfc(r,[["__scopeId","data-v-f9b4f795"]]);wx.createPage(n);
"use strict";const e=require("../../common/vendor.js"),a=require("../../common/assets.js"),t=require("../../config/user.js"),r={__name:"details",setup(r){const n=e.ref(""),o=e.ref({}),i=e.computed((()=>{switch(o.value.orderStatus){case"waiting_for_payment":return"待支付";case"in_used":default:return"使用中";case"used_done":return"已完成";case"order_cancelled":return"已取消"}}));e.onLoad((async a=>{a&&a.orderId?(n.value=a.orderId,await u()):(e.index.showToast({title:"订单信息不存在",icon:"none"}),setTimeout((()=>{e.index.navigateBack()}),1500))}));const u=async()=>{try{e.index.showLoading({title:"加载中"});const a=await t.queryById(n.value);if(200!==a.code||!a.data)throw new Error("获取订单详情失败");o.value=a.data,o.value.createTime&&(o.value.createTime=s(new Date(o.value.createTime))),o.value.startTime&&(o.value.startTime=s(new Date(o.value.startTime))),o.value.endTime&&(o.value.endTime=s(new Date(o.value.endTime))),e.index.hideLoading()}catch(a){e.index.hideLoading(),e.index.showToast({title:a.message||"获取订单详情失败",icon:"none"})}},s=e=>`${e.getFullYear()}-${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")} ${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}`,d=e=>{if(!e)return"";const a=parseInt(e);if(a<60)return`${a}分钟`;{const e=Math.floor(a/60),t=a%60;return t>0?`${e}小时${t}分钟`:`${e}小时`}};return(t,r)=>e.e({a:e.t(i.value),b:e.t(o.value.orderNo||"-"),c:e.t(o.value.deviceNo||"-"),d:"wx_score_pay"===o.value.payWay},"wx_score_pay"===o.value.payWay?{e:a._imports_0$3}:{},{f:e.t(o.value.startTime||"-"),g:o.value.endTime},o.value.endTime?{h:e.t(o.value.endTime)}:{},{i:o.value.phone},o.value.phone?{j:e.t(o.value.phone)}:{},{k:o.value.depositAmount},o.value.depositAmount?{l:e.t(o.value.depositAmount)}:{},{m:o.value.packageTime&&o.value.packagePrice},o.value.packageTime&&o.value.packagePrice?{n:e.t(o.value.packagePrice),o:e.t(d(o.value.packageTime))}:{},{p:e.t(o.value.payAmount||0)})}},n=e._export_sfc(r,[["__scopeId","data-v-f9b4f795"]]);wx.createPage(n);
+1 -1
View File
@@ -1 +1 @@
"use strict";const e=require("../../common/vendor.js"),t=require("../../common/assets.js"),a=require("../../config/user.js"),s=require("../../config/url.js"),r={__name:"index",setup(r){const o=e.ref(0),n=e.ref([]),d=e.reactive({0:{text:"待支付",class:"status-waiting"},1:{text:"使用中",class:"status-using"},2:{text:"已完成",class:"status-finished"},3:{text:"已取消",class:"status-cancelled"},waiting_for_payment:{text:"待支付",class:"status-waiting"},in_used:{text:"使用中",class:"status-using"},used_done:{text:"已完成",class:"status-finished"},order_cancelled:{text:"已取消",class:"status-cancelled"}}),i=e.reactive([{text:"全部",status:[]},{text:"待付款",status:["waiting_for_payment"]},{text:"使用中",status:["in_used"]},{text:"已完成",status:["used_done"]},{text:"已取消",status:["order_cancelled"]}]);e.onLoad((async e=>{if(e&&e.orderId)try{const t=await a.queryById(e.orderId);if(200===t.code&&t.data){const e=t.data,a=e.startTime||e.createTime||"",s={orderNo:e.orderId,status:e.orderStatus,deviceId:e.deviceNo,payWay:e.payWay,startTime:a,endTime:e.endTime||"",amount:e.payAmount||e.actualDeviceAmount||"0.00"};n.value=[s,...n.value];const r=i.findIndex((t=>t.status.includes(e.orderStatus)));-1!==r&&c(r)}}catch(t){console.error("获取订单详情失败:",t)}await u()}));const c=async e=>{o.value=e;const t=i[e].status[0];await u(t)},u=async t=>{try{null!=t&&(t={orderStatus:t});const e=await a.getOrderList(t);200===e.code&&e.data&&e.data.records&&(n.value=e.data.records.map((e=>{const t=e.startTime||e.createTime||"";return{orderNo:e.orderNo,orderId:e.orderId,orderStatus:e.orderStatus,deviceId:e.deviceNo,payWay:e.payWay,startTime:t,endTime:e.endTime||"",amount:e.payAmount||e.actualDeviceAmount||"0.00"}})))}catch(s){console.error("获取订单列表失败:",s),e.index.showToast({title:"获取订单列表失败",icon:"none"})}};return(r,l)=>e.e({a:e.f(i,((t,a,s)=>({a:e.t(t.text),b:a,c:o.value===a?1:"",d:e.o((e=>c(a)),a)}))),b:0===n.value.length},(n.value.length,{}),{c:e.f(n.value,((r,n,c)=>{var l,m;return e.e({a:e.t(r.orderNo),b:e.t(null==(l=d[r.orderStatus])?void 0:l.text),c:e.n(null==(m=d[r.orderStatus])?void 0:m.class),d:e.t(r.deviceId),e:"wx_score_pay"==r.payWay},"wx_score_pay"==r.payWay?{f:t._imports_0$2}:{},{g:e.t(r.startTime),h:e.t(r.endTime||"-"),i:e.t(r.amount),j:"waiting_for_payment"===r.status||"waiting_for_payment"===r.orderStatus},"waiting_for_payment"===r.status||"waiting_for_payment"===r.orderStatus?{k:e.o((t=>(async t=>{try{e.index.showLoading({title:"处理中"});const r=await e.index.request({url:`${s.URL||"http://127.0.0.1:8080"}/app/wx-payment/create/${t.orderNo}`,method:"GET",header:{Authorization:"Bearer "+e.index.getStorageSync("token"),Clientid:e.index.getStorageSync("client_id")}});if(200!==r.statusCode||200!==r.data.code)throw new Error(r.data.msg||"创建支付订单失败");{const s=r.data.data;await e.index.requestPayment({...s,success:async()=>{e.index.showToast({title:"支付成功",icon:"success"});try{await a.updateUserBalance(t.orderId||t.orderNo)}catch(s){console.warn("更新用户余额失败:",s)}await u(i[o.value].status)},fail:e=>{throw console.error("支付失败:",e),new Error("支付失败,请重试")}})}e.index.hideLoading()}catch(r){e.index.hideLoading(),e.index.showToast({title:r.message||"支付失败",icon:"none"})}})(r)),n)}:{},{l:"waiting_for_payment"===r.status||"waiting_for_payment"===r.orderStatus},"waiting_for_payment"===r.status||"waiting_for_payment"===r.orderStatus?{m:e.o((t=>(async t=>{try{e.index.showModal({title:"确认取消",content:"确定要取消此订单吗?",success:async s=>{if(s.confirm){e.index.showLoading({title:"处理中"});const s=await a.cancelOrder({orderId:t.orderNo});if(!s)throw new Error(s.msg||"取消订单失败");e.index.hideLoading(),e.index.showToast({title:"订单已取消",icon:"success"}),await u()}}})}catch(s){e.index.hideLoading(),e.index.showToast({title:s.message||"取消订单失败",icon:"none"})}})(r)),n)}:{},{n:"in_used"==r.status||"in_used"==r.orderStatus},"in_used"==r.status||"in_used"==r.orderStatus?{o:e.o((t=>{return a=r.deviceId,s=r.orderId,console.log(s),void e.index.navigateTo({url:`/pages/return/index?deviceId=${a}&orderId=${s}`});var a,s}),n)}:{},{p:e.o((t=>(t=>{e.index.navigateTo({url:`/pages/order/details?orderId=${t.orderId||t.orderNo}`})})(r)),n),q:n})}))})}},o=e._export_sfc(r,[["__scopeId","data-v-57aa6fd9"]]);wx.createPage(o);
"use strict";const e=require("../../common/vendor.js"),t=require("../../common/assets.js"),a=require("../../config/user.js"),s=require("../../config/url.js"),r={__name:"index",setup(r){const o=e.ref(0),n=e.ref([]),d=e.reactive({0:{text:"待支付",class:"status-waiting"},1:{text:"使用中",class:"status-using"},2:{text:"已完成",class:"status-finished"},3:{text:"已取消",class:"status-cancelled"},waiting_for_payment:{text:"待支付",class:"status-waiting"},in_used:{text:"使用中",class:"status-using"},used_done:{text:"已完成",class:"status-finished"},order_cancelled:{text:"已取消",class:"status-cancelled"}}),i=e.reactive([{text:"全部",status:[]},{text:"待付款",status:["waiting_for_payment"]},{text:"使用中",status:["in_used"]},{text:"已完成",status:["used_done"]},{text:"已取消",status:["order_cancelled"]}]);e.onLoad((async e=>{if(e&&e.orderId)try{const t=await a.queryById(e.orderId);if(200===t.code&&t.data){const e=t.data,a=e.startTime||e.createTime||"",s={orderNo:e.orderId,status:e.orderStatus,deviceId:e.deviceNo,payWay:e.payWay,startTime:a,endTime:e.endTime||"",amount:e.payAmount||e.actualDeviceAmount||"0.00"};n.value=[s,...n.value];const r=i.findIndex((t=>t.status.includes(e.orderStatus)));-1!==r&&c(r)}}catch(t){console.error("获取订单详情失败:",t)}await u()}));const c=async e=>{o.value=e;const t=i[e].status[0];await u(t)},u=async t=>{try{null!=t&&(t={orderStatus:t});const e=await a.getOrderList(t);200===e.code&&e.data&&e.data.records&&(n.value=e.data.records.map((e=>{const t=e.startTime||e.createTime||"";return{orderNo:e.orderNo,orderId:e.orderId,orderStatus:e.orderStatus,deviceId:e.deviceNo,payWay:e.payWay,startTime:t,endTime:e.endTime||"",amount:e.payAmount||e.actualDeviceAmount||"0.00"}})))}catch(s){console.error("获取订单列表失败:",s),e.index.showToast({title:"获取订单列表失败",icon:"none"})}};return(r,l)=>e.e({a:e.f(i,((t,a,s)=>({a:e.t(t.text),b:a,c:o.value===a?1:"",d:e.o((e=>c(a)),a)}))),b:0===n.value.length},(n.value.length,{}),{c:e.f(n.value,((r,n,c)=>{var l,m;return e.e({a:e.t(r.orderNo),b:e.t(null==(l=d[r.orderStatus])?void 0:l.text),c:e.n(null==(m=d[r.orderStatus])?void 0:m.class),d:e.t(r.deviceId),e:"wx_score_pay"==r.payWay},"wx_score_pay"==r.payWay?{f:t._imports_0$3}:{},{g:e.t(r.startTime),h:e.t(r.endTime||"-"),i:e.t(r.amount),j:"waiting_for_payment"===r.status||"waiting_for_payment"===r.orderStatus},"waiting_for_payment"===r.status||"waiting_for_payment"===r.orderStatus?{k:e.o((t=>(async t=>{try{e.index.showLoading({title:"处理中"});const r=await e.index.request({url:`${s.URL||"http://127.0.0.1:8080"}/app/wx-payment/create/${t.orderNo}`,method:"GET",header:{Authorization:"Bearer "+e.index.getStorageSync("token"),Clientid:e.index.getStorageSync("client_id")}});if(200!==r.statusCode||200!==r.data.code)throw new Error(r.data.msg||"创建支付订单失败");{const s=r.data.data;await e.index.requestPayment({...s,success:async()=>{e.index.showToast({title:"支付成功",icon:"success"});try{await a.updateUserBalance(t.orderId||t.orderNo)}catch(s){console.warn("更新用户余额失败:",s)}await u(i[o.value].status)},fail:e=>{throw console.error("支付失败:",e),new Error("支付失败,请重试")}})}e.index.hideLoading()}catch(r){e.index.hideLoading(),e.index.showToast({title:r.message||"支付失败",icon:"none"})}})(r)),n)}:{},{l:"waiting_for_payment"===r.status||"waiting_for_payment"===r.orderStatus},"waiting_for_payment"===r.status||"waiting_for_payment"===r.orderStatus?{m:e.o((t=>(async t=>{try{e.index.showModal({title:"确认取消",content:"确定要取消此订单吗?",success:async s=>{if(s.confirm){e.index.showLoading({title:"处理中"});const s=await a.cancelOrder({orderId:t.orderNo});if(!s)throw new Error(s.msg||"取消订单失败");e.index.hideLoading(),e.index.showToast({title:"订单已取消",icon:"success"}),await u()}}})}catch(s){e.index.hideLoading(),e.index.showToast({title:s.message||"取消订单失败",icon:"none"})}})(r)),n)}:{},{n:"in_used"==r.status||"in_used"==r.orderStatus},"in_used"==r.status||"in_used"==r.orderStatus?{o:e.o((t=>{return a=r.deviceId,s=r.orderId,console.log(s),void e.index.navigateTo({url:`/pages/return/index?deviceId=${a}&orderId=${s}`});var a,s}),n)}:{},{p:e.o((t=>(t=>{e.index.navigateTo({url:`/pages/order/details?orderId=${t.orderId||t.orderNo}`})})(r)),n),q:n})}))})}},o=e._export_sfc(r,[["__scopeId","data-v-57aa6fd9"]]);wx.createPage(o);
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

-1
View File
@@ -1 +0,0 @@
"use strict";const t=require("../common/vendor.js");const e=new class{constructor(){this.key="4c513a688938fd89b88b296e867f66ec"}async regeocode(e,s){try{const a=await t.index.request({url:"https://restapi.amap.com/v3/geocode/regeo",method:"GET",data:{key:this.key,location:`${e},${s}`,poitype:"",radius:1e3,extensions:"base",batch:!1,roadlevel:0}});return 200===a.statusCode&&"1"===a.data.status?{success:!0,data:a.data.regeocode}:{success:!1,message:a.data.info||"逆地理编码失败"}}catch(a){return console.error("逆地理编码异常:",a),{success:!1,message:"网络异常"}}}async geocode(e,s=""){try{const a=await t.index.request({url:"https://restapi.amap.com/v3/geocode/geo",method:"GET",data:{key:this.key,address:e,city:s}});return 200===a.statusCode&&"1"===a.data.status&&a.data.geocodes.length>0?{success:!0,data:a.data.geocodes[0]}:{success:!1,message:a.data.info||"地理编码失败"}}catch(a){return console.error("地理编码异常:",a),{success:!1,message:"网络异常"}}}async searchPOI(e,s="",a=3e3,c=""){try{const o=await t.index.request({url:"https://restapi.amap.com/v3/place/text",method:"GET",data:{key:this.key,keywords:e,location:s,radius:a,city:c,citylimit:!0}});return 200===o.statusCode&&"1"===o.data.status?{success:!0,data:o.data.pois||[]}:{success:!1,message:o.data.info||"搜索失败"}}catch(o){return console.error("POI搜索异常:",o),{success:!1,message:"网络异常"}}}async getRoute(e,s,a=0){try{const c=await t.index.request({url:"https://restapi.amap.com/v3/direction/driving",method:"GET",data:{key:this.key,origin:e,destination:s,strategy:a,extensions:"base"}});return 200===c.statusCode&&"1"===c.data.status?{success:!0,data:c.data.route}:{success:!1,message:c.data.info||"路径规划失败"}}catch(c){return console.error("路径规划异常:",c),{success:!1,message:"网络异常"}}}calculateDistance(t,e,s,a){const c=t*Math.PI/180,o=s*Math.PI/180,r=c-o,n=e*Math.PI/180-a*Math.PI/180;let d=2*Math.asin(Math.sqrt(Math.pow(Math.sin(r/2),2)+Math.cos(c)*Math.cos(o)*Math.pow(Math.sin(n/2),2)));return d*=6378.137,d=Math.round(1e4*d)/1e4,d}};exports.AmapUtil=e;
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
{"version":3,"file":"assets.js","sources":["static/scan-icon.png","static/user-active.png","static/jl.png","static/complaint.png","static/hlep.png","static/images/wxpayflag.png","static/images/location-map.svg"],"sourcesContent":["export default \"__VITE_ASSET__b9d91c1a__\"","export default \"__VITE_ASSET__e217d500__\"","export default \"__VITE_ASSET__44ff4dfa__\"","export default \"__VITE_ASSET__d1c6bbb6__\"","export default \"__VITE_ASSET__f0ed8f64__\"","export default \"__VITE_ASSET__9081434a__\"","export default \"__VITE_ASSET__52e4836e__\""],"names":[],"mappings":";AAAA,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,aAAA;ACAf,MAAe,aAAA;ACAf,MAAe,aAAA;ACAf,MAAe,eAAA;ACAf,MAAe,aAAA;;;;;;;;"}
{"version":3,"file":"assets.js","sources":["static/logo.png","static/scan-icon.png","static/user-active.png","static/jl.png","static/complaint.png","static/hlep.png","static/images/wxpayflag.png","static/images/location-map.svg","static/map.png"],"sourcesContent":["export default \"__VITE_ASSET__fcf1191c__\"","export default \"__VITE_ASSET__b9d91c1a__\"","export default \"__VITE_ASSET__e217d500__\"","export default \"__VITE_ASSET__44ff4dfa__\"","export default \"__VITE_ASSET__d1c6bbb6__\"","export default \"__VITE_ASSET__f0ed8f64__\"","export default \"__VITE_ASSET__9081434a__\"","export default \"__VITE_ASSET__52e4836e__\"","export default \"__VITE_ASSET__8941e55a__\""],"names":[],"mappings":";AAAA,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,eAAA;ACAf,MAAe,aAAA;ACAf,MAAe,aAAA;ACAf,MAAe,eAAA;ACAf,MAAe,aAAA;ACAf,MAAe,aAAA;;;;;;;;;;"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"url.js","sources":["config/url.js"],"sourcesContent":["export const URL = \"https://my.gxfs123.com/api\" //正式服务器\r\n// export const URL = \"https://unifans.gxfs123.com/api\" //测试服务器\r\n// export const URL = \"http://192.168.10.31:8080\" \t\t//本地调试\r\n\r\nexport const appid = \"wx2165f0be356ae7a9\" //小程序appid"],"names":[],"mappings":";AAAY,MAAC,MAAM;AAIP,MAAC,QAAQ;;;"}
{"version":3,"file":"url.js","sources":["config/url.js"],"sourcesContent":["// export const URL = \"https://my.gxfs123.com/api\" //正式服务器\r\nexport const URL = \"https://fansdev.gxfs123.com/api\" //测试服务器\r\n// export const URL = \"http://192.168.10.69:8080\" \t\t//本地调试\r\n\r\nexport const appid = \"wx2165f0be356ae7a9\" //小程序appid"],"names":[],"mappings":";AACY,MAAC,MAAM;AAGP,MAAC,QAAQ;;;"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
{"version":3,"file":"uv-collapse.js","sources":["node_modules/@climblee/uv-ui/components/uv-collapse/uv-collapse.vue","E:/HBuilderX.4.24.2024072208/plugins/uniapp-cli-vite/uniComponent:/RDovdW5pLWZhbnMtc2NvcmUvbm9kZV9tb2R1bGVzL0BjbGltYmxlZS91di11aS9jb21wb25lbnRzL3V2LWNvbGxhcHNlL3V2LWNvbGxhcHNlLnZ1ZQ"],"sourcesContent":["<template>\r\n\t<view class=\"uv-collapse\">\r\n\t\t<uv-line v-if=\"border\"></uv-line>\r\n\t\t<slot />\r\n\t</view>\r\n</template>\r\n\r\n<script>\r\n\timport mpMixin from '../../libs/mixin/mpMixin.js'\r\n\timport mixin from '../../libs/mixin/mixin.js'\r\n\timport props from './props.js';\r\n\t/**\r\n\t * collapse 折叠面板 \r\n\t * @description 通过折叠面板收纳内容区域\r\n\t * @tutorial https://www.uvui.cn/components/collapse.html\r\n\t * @property {String | Number | Array}\tvalue\t\t当前展开面板的name,非手风琴模式:[<string | number>],手风琴模式:string | number\r\n\t * @property {Boolean}\t\t\t\t\taccordion\t是否手风琴模式( 默认 false \r\n\t * @property {Boolean}\t\t\t\t\tborder\t\t是否显示外边框 ( 默认 true \r\n\t * @event {Function}\tchange \t\t当前激活面板展开时触发(如果是手风琴模式,参数activeNames类型为String,否则为Array)\r\n\t * @example <uv-collapse></uv-collapse>\r\n\t */\r\n\texport default {\r\n\t\tname: \"uv-collapse\",\r\n\t\tmixins: [mpMixin, mixin, props],\r\n\t\twatch: {\r\n\t\t\tneedInit() {\r\n\t\t\t\tthis.init()\r\n\t\t\t},\r\n\t\t\t// 当父组件需要子组件需要共享的参数发生了变化,手动通知子组件\r\n\t\t\tparentData() {\r\n\t\t\t\tif (this.children.length) {\r\n\t\t\t\t\tthis.children.map(child => {\r\n\t\t\t\t\t\t// 判断子组件(uv-checkbox)如果有updateParentData方法的话,就就执行(执行的结果是子组件重新从父组件拉取了最新的值)\r\n\t\t\t\t\t\ttypeof(child.updateParentData) === 'function' && child.updateParentData()\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tcreated() {\r\n\t\t\tthis.children = []\r\n\t\t},\r\n\t\tcomputed: {\r\n\t\t\tneedInit() {\r\n\t\t\t\t// 通过computed,同时监听accordion和value值的变化\r\n\t\t\t\t// 再通过watch去执行init()方法,进行再一次的初始化\r\n\t\t\t\treturn [this.accordion, this.value]\r\n\t\t\t}\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\t// 重新初始化一次内部的所有子元素\r\n\t\t\tinit() {\r\n\t\t\t\tthis.children.map(child => {\r\n\t\t\t\t\tchild.init()\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t/**\r\n\t\t\t * collapse-item被点击时触发,由collapse统一处理各子组件的状态\r\n\t\t\t * @param {Object} target 被操作的面板的实例\r\n\t\t\t */\r\n\t\t\tonChange(target) {\r\n\t\t\t\tlet changeArr = []\r\n\t\t\t\tthis.children.map((child, index) => {\r\n\t\t\t\t\t// 如果是手风琴模式,将其他的折叠面板收起来\r\n\t\t\t\t\tif (this.accordion) {\r\n\t\t\t\t\t\tchild.expanded = child === target ? !target.expanded : false\r\n\t\t\t\t\t\tchild.setContentAnimate()\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(child === target) {\r\n\t\t\t\t\t\t\tchild.expanded = !child.expanded\r\n\t\t\t\t\t\t\tchild.setContentAnimate()\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// 拼接change事件中,数组元素的状态\r\n\t\t\t\t\tchangeArr.push({\r\n\t\t\t\t\t\t// 如果没有定义name属性,则默认返回组件的index索引\r\n\t\t\t\t\t\tname: child.name || index,\r\n\t\t\t\t\t\tstatus: child.expanded ? 'open' : 'close'\r\n\t\t\t\t\t})\r\n\t\t\t\t})\r\n\r\n\t\t\t\tthis.$emit('change', changeArr)\r\n\t\t\t\tthis.$emit(target.expanded ? 'open' : 'close', target.name)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n</script>\r\n","import Component from 'D:/uni-fans-score/node_modules/@climblee/uv-ui/components/uv-collapse/uv-collapse.vue'\nwx.createComponent(Component)"],"names":["mpMixin","mixin","props"],"mappings":";;AAqBC,MAAK,YAAU;AAAA,EACd,MAAM;AAAA,EACN,QAAQ,CAACA,cAAAA,SAASC,cAAK,OAAEC,qBAAK;AAAA,EAC9B,OAAO;AAAA,IACN,WAAW;AACV,WAAK,KAAK;AAAA,IACV;AAAA;AAAA,IAED,aAAa;AACZ,UAAI,KAAK,SAAS,QAAQ;AACzB,aAAK,SAAS,IAAI,WAAS;AAE1B,iBAAO,MAAM,qBAAsB,cAAc,MAAM,iBAAiB;AAAA,SACxE;AAAA,MACF;AAAA,IACD;AAAA,EACA;AAAA,EACD,UAAU;AACT,SAAK,WAAW,CAAC;AAAA,EACjB;AAAA,EACD,UAAU;AAAA,IACT,WAAW;AAGV,aAAO,CAAC,KAAK,WAAW,KAAK,KAAK;AAAA,IACnC;AAAA,EACA;AAAA,EACD,SAAS;AAAA;AAAA,IAER,OAAO;AACN,WAAK,SAAS,IAAI,WAAS;AAC1B,cAAM,KAAK;AAAA,OACX;AAAA,IACD;AAAA;AAAA;AAAA;AAAA;AAAA,IAKD,SAAS,QAAQ;AAChB,UAAI,YAAY,CAAC;AACjB,WAAK,SAAS,IAAI,CAAC,OAAO,UAAU;AAEnC,YAAI,KAAK,WAAW;AACnB,gBAAM,WAAW,UAAU,SAAS,CAAC,OAAO,WAAW;AACvD,gBAAM,kBAAkB;AAAA,eAClB;AACN,cAAG,UAAU,QAAQ;AACpB,kBAAM,WAAW,CAAC,MAAM;AACxB,kBAAM,kBAAkB;AAAA,UACzB;AAAA,QACD;AAEA,kBAAU,KAAK;AAAA;AAAA,UAEd,MAAM,MAAM,QAAQ;AAAA,UACpB,QAAQ,MAAM,WAAW,SAAS;AAAA,SAClC;AAAA,OACD;AAED,WAAK,MAAM,UAAU,SAAS;AAC9B,WAAK,MAAM,OAAO,WAAW,SAAS,SAAS,OAAO,IAAI;AAAA,IAC3D;AAAA,EACD;AACD;;;;;;;;;;;;;;;ACnFD,GAAG,gBAAgB,SAAS;","x_google_ignoreList":[0]}
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
{"version":3,"file":"uv-line.js","sources":["node_modules/@climblee/uv-ui/components/uv-line/uv-line.vue","E:/HBuilderX.4.24.2024072208/plugins/uniapp-cli-vite/uniComponent:/RDovdW5pLWZhbnMtc2NvcmUvbm9kZV9tb2R1bGVzL0BjbGltYmxlZS91di11aS9jb21wb25lbnRzL3V2LWxpbmUvdXYtbGluZS52dWU"],"sourcesContent":["<template>\r\n\t<view\r\n\t class=\"uv-line\"\r\n\t :style=\"[lineStyle]\"\r\n\t>\r\n\t</view>\r\n</template>\r\n\r\n<script>\r\n\timport mpMixin from '../../libs/mixin/mpMixin.js'\r\n\timport mixin from '../../libs/mixin/mixin.js'\r\n\timport props from './props.js';\r\n\t/**\r\n\t * line 线条\r\n\t * @description 此组件一般用于显示一根线条,用于分隔内容块,有横向和竖向两种模式,且能设置0.5px线条,使用也很简单\r\n\t * @tutorial https://www.uvui.cn/components/line.html\r\n\t * @property {String}\t\t\tcolor\t\t线条的颜色 ( 默认 '#d6d7d9' )\r\n\t * @property {String | Number}\tlength\t\t长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带px单位的值等 ( 默认 '100%' )\r\n\t * @property {String}\t\t\tdirection\t线条的方向,row-横向,col-竖向 (默认 'row' )\r\n\t * @property {Boolean}\t\t\thairline\t是否显示细线条 (默认 true )\r\n\t * @property {String | Number}\tmargin\t\t线条与上下左右元素的间距,字符串形式,如\"30px\" (默认 0 )\r\n\t * @property {Boolean}\t\t\tdashed\t\t是否虚线,true-虚线,false-实线 (默认 false )\r\n\t * @property {Object}\t\t\tcustomStyle\t定义需要用到的外部样式\r\n\t * @example <uv-line color=\"red\"></uv-line>\r\n\t */\r\n\texport default {\r\n\t\tname: 'uv-line',\r\n\t\tmixins: [mpMixin, mixin, props],\r\n\t\tcomputed: {\r\n\t\t\tlineStyle() {\r\n\t\t\t\tconst style = {}\r\n\t\t\t\tstyle.margin = this.margin\r\n\t\t\t\t// 如果是水平线条,边框高度为1px,再通过transform缩小一半,就是0.5px了\r\n\t\t\t\tif (this.direction === 'row') {\r\n\t\t\t\t\t// 此处采用兼容分开写,兼容nvue的写法\r\n\t\t\t\t\tstyle.borderBottomWidth = '1px'\r\n\t\t\t\t\tstyle.borderBottomStyle = this.dashed ? 'dashed' : 'solid'\r\n\t\t\t\t\tstyle.width = this.$uv.addUnit(this.length)\r\n\t\t\t\t\tif (this.hairline) style.transform = 'scaleY(0.5)'\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// 如果是竖向线条,边框宽度为1px,再通过transform缩小一半,就是0.5px了\r\n\t\t\t\t\tstyle.borderLeftWidth = '1px'\r\n\t\t\t\t\tstyle.borderLeftStyle = this.dashed ? 'dashed' : 'solid'\r\n\t\t\t\t\tstyle.height = this.$uv.addUnit(this.length)\r\n\t\t\t\t\tif (this.hairline) style.transform = 'scaleX(0.5)'\r\n\t\t\t\t}\r\n\t\t\t\tstyle.borderColor = this.color\r\n\t\t\t\treturn this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle))\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n\t.uv-line {\r\n\t\t/* #ifndef APP-NVUE */\r\n\t\tvertical-align: middle;\r\n\t\t/* #endif */\r\n\t}\r\n</style>\r\n","import Component from 'D:/uni-fans-score/node_modules/@climblee/uv-ui/components/uv-line/uv-line.vue'\nwx.createComponent(Component)"],"names":["mpMixin","mixin","props"],"mappings":";;AAyBC,MAAK,YAAU;AAAA,EACd,MAAM;AAAA,EACN,QAAQ,CAACA,cAAAA,SAASC,cAAK,OAAEC,qBAAK;AAAA,EAC9B,UAAU;AAAA,IACT,YAAY;AACX,YAAM,QAAQ,CAAC;AACf,YAAM,SAAS,KAAK;AAEpB,UAAI,KAAK,cAAc,OAAO;AAE7B,cAAM,oBAAoB;AAC1B,cAAM,oBAAoB,KAAK,SAAS,WAAW;AACnD,cAAM,QAAQ,KAAK,IAAI,QAAQ,KAAK,MAAM;AAC1C,YAAI,KAAK;AAAU,gBAAM,YAAY;AAAA,aAC/B;AAEN,cAAM,kBAAkB;AACxB,cAAM,kBAAkB,KAAK,SAAS,WAAW;AACjD,cAAM,SAAS,KAAK,IAAI,QAAQ,KAAK,MAAM;AAC3C,YAAI,KAAK;AAAU,gBAAM,YAAY;AAAA,MACtC;AACA,YAAM,cAAc,KAAK;AACzB,aAAO,KAAK,IAAI,UAAU,OAAO,KAAK,IAAI,SAAS,KAAK,WAAW,CAAC;AAAA,IACrE;AAAA,EACD;AACD;;;;;;;ACjDD,GAAG,gBAAgB,SAAS;","x_google_ignoreList":[0]}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
{"version":3,"file":"amap-adapter.js","sources":["utils/amap-adapter.js"],"sourcesContent":["// 高德地图适配器,使用官方SDK\r\nimport { AMapWX } from './amap-wx.130.js';\r\n\r\n// 简化的SDK实例获取函数\r\nfunction getAMapWXInstance(key) {\r\n // 直接创建实例\r\n return new AMapWX({key: key});\r\n}\r\n\r\n// 导出获取实例的方法\r\nexport { getAMapWXInstance };"],"names":["AMapWX"],"mappings":";;AAIA,SAAS,kBAAkB,KAAK;AAE9B,SAAO,IAAIA,iBAAAA,OAAO,EAAC,IAAQ,CAAC;AAC9B;;"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+9 -5
View File
@@ -1,16 +1,20 @@
"use strict";
const _imports_0$4 = "/static/logo.png";
const _imports_0$3 = "/static/scan-icon.png";
const _imports_0$2 = "/static/user-active.png";
const _imports_1 = "/static/jl.png";
const _imports_1$1 = "/static/jl.png";
const _imports_2 = "/static/complaint.png";
const _imports_3 = "/static/hlep.png";
const _imports_0$1 = "/static/images/wxpayflag.png";
const _imports_0 = "/static/images/location-map.svg";
const _imports_1 = "/static/map.png";
exports._imports_0 = _imports_0$3;
exports._imports_0$1 = _imports_0$2;
exports._imports_0$2 = _imports_0$1;
exports._imports_0$3 = _imports_0;
exports._imports_1 = _imports_1;
exports._imports_0$1 = _imports_0$4;
exports._imports_0$2 = _imports_0$2;
exports._imports_0$3 = _imports_0$1;
exports._imports_0$4 = _imports_0;
exports._imports_1 = _imports_1$1;
exports._imports_1$1 = _imports_1;
exports._imports_2 = _imports_2;
exports._imports_3 = _imports_3;
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/assets.js.map
File diff suppressed because it is too large Load Diff
+205 -130
View File
@@ -1,6 +1,14 @@
"use strict";
const common_vendor = require("../common/vendor.js");
const common_assets = require("../common/assets.js");
if (!Array) {
const _easycom_uv_icon2 = common_vendor.resolveComponent("uv-icon");
_easycom_uv_icon2();
}
const _easycom_uv_icon = () => "../node-modules/@climblee/uv-ui/components/uv-icon/uv-icon.js";
if (!Math) {
_easycom_uv_icon();
}
const _sfc_main = {
__name: "MapComponent",
props: {
@@ -29,41 +37,179 @@ const _sfc_main = {
"mapCenterChange"
],
setup(__props, { expose: __expose, emit: __emit }) {
const collapseRef = common_vendor.ref(null);
common_vendor.ref([
{
title: "扫码使用",
desc: "找到附近设备,扫描设备上的二维码"
},
{
title: "免押金支付",
desc: "无需支付押金,使用支付分免押即可完成租借"
},
{
title: "开始使用",
desc: "设备自动解锁,风扇弹出后取出即可开始使用"
},
{
title: "归还设备",
desc: "使用完毕后,按照设备规格要求将风扇还入即可结束订单"
}
]);
const props = __props;
const emit = __emit;
const mapKey = common_vendor.ref(0);
const mapZoom = common_vendor.ref(16);
const isLoading = common_vendor.ref(true);
const mapCenter = common_vendor.ref({
longitude: 116.397128,
latitude: 39.916527
});
const loadPositionsTimer = common_vendor.ref(null);
const isMapInitialized = common_vendor.ref(false);
const updateMapCenter = (longitude, latitude) => {
if (mapCenter.value.longitude === longitude && mapCenter.value.latitude === latitude) {
const mapZoom = common_vendor.ref(17);
const mapMarkers = common_vendor.ref([]);
const mapContext = common_vendor.ref(null);
const updateMapMarkers = () => {
mapMarkers.value = [];
if (props.userLocation) {
mapMarkers.value.push({
id: 0,
// ID必须是数字
// iconPath: '/static/scan-icon.png',
width: 32,
height: 32,
latitude: props.userLocation.latitude,
longitude: props.userLocation.longitude,
title: "我的位置",
callout: {
content: "我的位置",
color: "#ffffff",
fontSize: 12,
borderRadius: 4,
bgColor: "#2196F3",
padding: 6,
display: "BYCLICK"
// 点击时显示
},
customCallout: {
anchorX: 0,
anchorY: 0
}
});
}
if (props.filteredPositions && props.filteredPositions.length > 0) {
props.filteredPositions.forEach((pos, index) => {
if (pos.longitude && pos.latitude) {
const lat = parseFloat(pos.latitude);
const lng = parseFloat(pos.longitude);
if (lat >= -90 && lat <= 90 && lng >= -180 && lng <= 180) {
mapMarkers.value.push({
id: index + 1,
// ID必须是数字,避免和用户位置的ID冲突
// iconPath: '/static/scan-icon.png',
width: 30,
height: 30,
latitude: lat,
longitude: lng,
title: pos.name,
position: pos,
// 存储原始位置数据,用于事件处理
callout: {
content: pos.name,
color: "#333333",
fontSize: 12,
borderRadius: 4,
bgColor: "#ffffff",
padding: 6,
display: "BYCLICK"
// 点击时显示
}
});
} else {
common_vendor.index.__f__("warn", "at components/MapComponent.vue:176", `忽略无效坐标: ${pos.name}, 纬度=${lat}, 经度=${lng}`);
}
}
});
}
isLoading.value = false;
};
const moveToLocation = (location) => {
if (!location || !location.longitude || !location.latitude)
return;
if (mapContext.value) {
mapContext.value.moveToLocation({
longitude: location.longitude,
latitude: location.latitude,
success: () => {
common_vendor.index.__f__("log", "at components/MapComponent.vue:194", "地图已移动到指定位置");
},
fail: (error) => {
common_vendor.index.__f__("error", "at components/MapComponent.vue:197", "移动地图失败:", error);
}
});
}
};
common_vendor.watch(() => props.userLocation, (newLocation) => {
if (newLocation && newLocation.longitude && newLocation.latitude) {
mapCenter.value = {
longitude: newLocation.longitude,
latitude: newLocation.latitude
};
updateMapMarkers();
moveToLocation(newLocation);
}
}, {
immediate: true,
deep: true
});
common_vendor.watch(() => props.filteredPositions, (newPositions) => {
updateMapMarkers();
}, {
deep: true
});
const onMapUpdated = () => {
isLoading.value = false;
};
const onMapRegionChange = (e) => {
if (e.type === "end" && e.causedBy === "drag") {
if (mapContext.value) {
mapContext.value.getCenterLocation({
success: (res) => {
if (res.longitude && res.latitude) {
mapCenter.value = {
longitude: res.longitude,
latitude: res.latitude
};
emit("mapCenterChange", mapCenter.value);
}
}
});
}
}
};
const onMapMarkerTap = (e) => {
const markerId = e.markerId;
const marker = mapMarkers.value.find((item) => item.id === markerId);
if (marker) {
if (markerId === 0) {
common_vendor.index.showToast({
title: "这是您的位置",
icon: "none"
});
return;
}
mapCenter.value = { longitude, latitude };
mapZoom.value = 16;
common_vendor.nextTick$1(() => {
setTimeout(() => {
const mapContext = common_vendor.index.createMapContext("mainMap");
if (mapContext) {
mapContext.setCenterOffset({
longitude,
latitude,
success: () => {
},
fail: () => {
mapContext.includePoints({
points: [{ longitude, latitude }],
padding: [0, 0, 0, 0]
});
if (marker.position) {
emit("markerTap", marker.position);
}
});
}
}, 200);
});
};
const onCalloutTap = (e) => {
const markerId = e.markerId;
const marker = mapMarkers.value.find((item) => item.id === markerId);
if (marker && marker.position) {
emit("markerTap", marker.position);
}
};
const onMapError = (error) => {
common_vendor.index.__f__("error", "at components/MapComponent.vue:283", "地图加载失败:", error);
isLoading.value = false;
};
const handleRelocate = () => {
emit("relocate");
@@ -74,121 +220,50 @@ const _sfc_main = {
const handleShowList = () => {
emit("showList");
};
const handleMarkerTap = (e) => {
if (!e.detail || typeof e.detail.markerId === "undefined") {
return;
}
const markerId = e.detail.markerId;
if (markerId === 9999) {
common_vendor.index.showToast({
title: "这是您的位置",
icon: "none"
});
return;
}
const position = props.filteredPositions[markerId];
if (position) {
emit("markerTap", position);
}
};
const handleRegionChange = (e) => {
if (e.detail.type === "end") {
const { center } = e.detail;
if (!center || typeof center.longitude === "undefined" || typeof center.latitude === "undefined") {
return;
}
mapCenter.value = {
longitude: center.longitude,
latitude: center.latitude
};
mapZoom.value = 16;
if (loadPositionsTimer.value) {
clearTimeout(loadPositionsTimer.value);
}
loadPositionsTimer.value = setTimeout(() => {
emit("mapCenterChange", mapCenter.value);
}, 500);
}
};
const mapMarkers = common_vendor.computed(() => {
const markers = [];
props.filteredPositions.forEach((item, index) => {
if (item.longitude && item.latitude) {
markers.push({
id: index,
longitude: parseFloat(item.longitude),
latitude: parseFloat(item.latitude),
title: item.name,
iconPath: "/static/scan-icon.png",
width: 30,
height: 30,
callout: {
content: item.name,
fontSize: 14,
borderRadius: 8,
bgColor: "#ffffff",
padding: 10,
display: "BYCLICK"
}
});
}
});
if (props.userLocation) {
markers.push({
id: 9999,
// 特殊ID标识用户位置
longitude: props.userLocation.longitude,
latitude: props.userLocation.latitude,
title: "我的位置",
iconPath: "/static/scan-icon.png",
width: 32,
height: 32,
callout: {
content: "我的位置",
fontSize: 14,
borderRadius: 8,
bgColor: "#2196F3",
color: "#ffffff",
padding: 10,
display: "BYCLICK"
}
});
}
return markers;
});
common_vendor.watch(() => props.userLocation, (newLocation) => {
if (newLocation && newLocation.longitude && newLocation.latitude && !isMapInitialized.value) {
updateMapCenter(newLocation.longitude, newLocation.latitude);
isMapInitialized.value = true;
}
}, { immediate: true, deep: true });
common_vendor.onMounted(() => {
common_vendor.nextTick$1(() => {
mapContext.value = common_vendor.index.createMapContext("map");
updateMapMarkers();
if (collapseRef.value) {
collapseRef.value.init();
}
});
});
common_vendor.onUnmounted(() => {
if (loadPositionsTimer.value) {
clearTimeout(loadPositionsTimer.value);
}
mapContext.value = null;
});
__expose({
mapCenter: common_vendor.computed(() => mapCenter.value)
mapCenter: common_vendor.computed(() => mapCenter.value),
moveToLocation,
updateMapMarkers,
initCollapse: () => {
if (collapseRef.value) {
collapseRef.value.init();
}
}
});
return (_ctx, _cache) => {
return common_vendor.e({
a: mapKey.value,
b: mapCenter.value.longitude,
c: mapCenter.value.latitude,
a: mapCenter.value.longitude,
b: mapCenter.value.latitude,
c: mapMarkers.value,
d: mapZoom.value,
e: mapMarkers.value,
f: common_vendor.o(handleMarkerTap),
g: common_vendor.o(handleRegionChange),
h: !mapCenter.value.longitude
}, !mapCenter.value.longitude ? {} : {}, {
i: common_assets._imports_0,
j: common_vendor.o(handleRelocate),
k: common_assets._imports_0,
l: common_vendor.o(handleScan),
e: common_vendor.o(onMapRegionChange),
f: common_vendor.o(onMapMarkerTap),
g: common_vendor.o(onCalloutTap),
h: common_vendor.o(onMapUpdated),
i: common_vendor.o(onMapError),
j: isLoading.value
}, isLoading.value ? {} : {}, {
k: common_vendor.p({
name: "map-fill",
size: "18"
}),
l: common_vendor.o(handleRelocate),
m: common_assets._imports_0,
n: common_vendor.o(handleShowList)
n: common_vendor.o(handleScan),
o: common_assets._imports_1$1,
p: common_vendor.o(handleShowList)
});
};
}
+3 -1
View File
@@ -1,4 +1,6 @@
{
"component": true,
"usingComponents": {}
"usingComponents": {
"uv-icon": "../node-modules/@climblee/uv-ui/components/uv-icon/uv-icon"
}
}
+1 -1
View File
@@ -1 +1 @@
<view class="map-container data-v-651a9dc3"><map id="mainMap" class="map data-v-651a9dc3" key="{{a}}" longitude="{{b}}" latitude="{{c}}" scale="{{d}}" markers="{{e}}" show-location="{{false}}" enable-scroll="{{true}}" enable-zoom="{{true}}" enable-rotate="{{false}}" show-compass="{{false}}" bindmarkertap="{{f}}" bindregionchange="{{g}}"></map><view wx:if="{{h}}" class="map-loading data-v-651a9dc3"><view class="loading-content data-v-651a9dc3"><view class="loading-spinner data-v-651a9dc3"></view><text class="data-v-651a9dc3">地图加载中...</text></view></view><view class="map-controls data-v-651a9dc3"><view class="control-btn location-control data-v-651a9dc3" bindtap="{{j}}"><image class="control-icon data-v-651a9dc3" src="{{i}}" mode="aspectFit"/><text class="data-v-651a9dc3">我的位置</text></view><view class="control-btn scan-control main-btn data-v-651a9dc3" bindtap="{{l}}"><image class="control-icon data-v-651a9dc3" src="{{k}}" mode="aspectFit"/><text class="data-v-651a9dc3">扫码使用</text></view><view class="control-btn list-control data-v-651a9dc3" bindtap="{{n}}"><image class="control-icon data-v-651a9dc3" src="{{m}}" mode="aspectFit"/><text class="data-v-651a9dc3">附近场地</text></view></view></view>
<view class="map-container data-v-651a9dc3"><view class="map-wrapper data-v-651a9dc3"><map id="map" class="native-map data-v-651a9dc3" longitude="{{a}}" latitude="{{b}}" markers="{{c}}" scale="{{d}}" show-location="{{true}}" bindregionchange="{{e}}" bindmarkertap="{{f}}" bindcallouttap="{{g}}" bindupdated="{{h}}" binderror="{{i}}"></map><view wx:if="{{j}}" class="map-loading data-v-651a9dc3"><view class="loading-content data-v-651a9dc3"><view class="loading-spinner data-v-651a9dc3"></view><text class="data-v-651a9dc3">地图加载中...</text></view></view></view><view class="map-controls data-v-651a9dc3"><view class="control-btn location-control data-v-651a9dc3" bindtap="{{l}}"><uv-icon wx:if="{{k}}" class="data-v-651a9dc3" u-i="651a9dc3-0" bind:__l="__l" u-p="{{k}}"></uv-icon><text class="data-v-651a9dc3" style="margin-left:8rpx">我的位置</text></view><view class="control-btn scan-control main-btn data-v-651a9dc3" bindtap="{{n}}"><image class="control-icon data-v-651a9dc3" src="{{m}}" mode="aspectFit"/><text class="data-v-651a9dc3">扫码使用</text></view><view class="control-btn list-control data-v-651a9dc3" bindtap="{{p}}"><image class="control-icon data-v-651a9dc3" src="{{o}}" mode="aspectFit"/><text class="data-v-651a9dc3">附近设备</text></view></view></view>
+37 -12
View File
@@ -27,12 +27,33 @@
.map-container.data-v-651a9dc3 {
flex: 1;
position: relative;
height: 100vh;
width: 100%;
height: 60vh;
/* 增加高度 */
width: 92%;
/* 略微增加宽度 */
margin: 10rpx auto 30rpx;
/* 调整上下间距,左右自动居中 */
border-radius: 24rpx;
/* 添加圆角 */
overflow: hidden;
/* 确保圆角生效 */
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
/* 添加阴影效果 */
}
.map-container .map.data-v-651a9dc3 {
.map-container .map-wrapper.data-v-651a9dc3 {
width: 100%;
height: 100%;
position: relative;
overflow: hidden;
border-radius: 24rpx;
/* 内层也添加圆角 */
}
.map-container .map-wrapper .native-map.data-v-651a9dc3 {
width: 100%;
height: 100%;
display: block;
border-radius: 24rpx;
/* 地图也添加圆角 */
}
.map-container .map-loading.data-v-651a9dc3 {
position: absolute;
@@ -68,26 +89,28 @@
}
.map-container .map-controls.data-v-651a9dc3 {
position: absolute;
right: 30rpx;
right: 20rpx;
bottom: 20rpx;
left: 30rpx;
left: 20rpx;
display: flex;
justify-content: center;
align-items: center;
gap: 30rpx;
gap: 20rpx;
}
.map-container .map-controls .control-btn.data-v-651a9dc3 {
min-width: 140rpx;
height: 80rpx;
min-width: 120rpx;
/* 减小按钮宽度 */
height: 70rpx;
/* 减小按钮高度 */
background: #ffffff;
border-radius: 40rpx;
border-radius: 35rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
transition: all 0.2s ease;
padding: 0 20rpx;
padding: 0 16rpx;
}
.map-container .map-controls .control-btn.data-v-651a9dc3:active {
transform: scale(0.95);
@@ -104,8 +127,10 @@
font-weight: 500;
}
.map-container .map-controls .control-btn.main-btn.data-v-651a9dc3 {
min-width: 160rpx;
height: 90rpx;
min-width: 140rpx;
/* 减小主按钮宽度 */
height: 80rpx;
/* 减小主按钮高度 */
box-shadow: 0 6rpx 20rpx rgba(33, 150, 243, 0.4);
transform: translateY(-5rpx);
}
+1 -1
View File
@@ -1,5 +1,5 @@
"use strict";
const URL = "https://my.gxfs123.com/api";
const URL = "https://fansdev.gxfs123.com/api";
const appid = "wx2165f0be356ae7a9";
exports.URL = URL;
exports.appid = appid;
+8 -5
View File
@@ -67,11 +67,14 @@ const rentPowerBank = (deviceNo, phone) => {
return config_http.request({
url: "/app/device/rentPowerBank",
method: "post",
data: { deviceNo, phone }
data: {
deviceNo,
phone
}
});
};
const confirmPaymentAndRent = (orderId) => {
common_vendor.index.__f__("log", "at config/user.js:120", `确认支付并弹出风扇, orderId: ${orderId}`);
common_vendor.index.__f__("log", "at config/user.js:123", `确认支付并弹出风扇, orderId: ${orderId}`);
return config_http.request({
url: `/app/device/confirmPaymentAndRent?orderId=${orderId}`,
method: "GET"
@@ -85,7 +88,7 @@ const getOrderByOrderNo = (orderNo) => {
});
};
const getOrderByOrderNoScore = (orderNo) => {
common_vendor.index.__f__("log", "at config/user.js:157", "通过订单号获取支付分订单信息", orderNo);
common_vendor.index.__f__("log", "at config/user.js:160", "通过订单号获取支付分订单信息", orderNo);
return config_http.request({
url: `/app/wx-payment/score/create/${orderNo}`,
method: "get",
@@ -93,7 +96,7 @@ const getOrderByOrderNoScore = (orderNo) => {
});
};
const getOrderByOrderNoScorePayStatus = (orderNo) => {
common_vendor.index.__f__("log", "at config/user.js:166", "通过订单号获取支付分订单状态", orderNo);
common_vendor.index.__f__("log", "at config/user.js:169", "通过订单号获取支付分订单状态", orderNo);
return config_http.request({
url: `/app/wx-payment/score/status/${orderNo}`,
method: "get",
@@ -101,7 +104,7 @@ const getOrderByOrderNoScorePayStatus = (orderNo) => {
});
};
const updateOrderPackage = (data) => {
common_vendor.index.__f__("log", "at config/user.js:176", "更新订单套餐信息:", data);
common_vendor.index.__f__("log", "at config/user.js:179", "更新订单套餐信息:", data);
return config_http.request({
url: "/app/device/updateOrderPackage",
method: "post",
@@ -0,0 +1,90 @@
"use strict";
const common_vendor = require("../../../../../common/vendor.js");
const _sfc_main = {
name: "uv-cell",
emits: ["click"],
mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$6],
computed: {
titleTextStyle() {
return this.$uv.addStyle(this.titleStyle);
}
},
methods: {
// 点击cell
clickHandler(e) {
if (this.disabled)
return;
this.$emit("click", {
name: this.name
});
this.openPage();
this.stop && this.preventEvent(e);
}
}
};
if (!Array) {
const _easycom_uv_icon2 = common_vendor.resolveComponent("uv-icon");
const _easycom_uv_line2 = common_vendor.resolveComponent("uv-line");
(_easycom_uv_icon2 + _easycom_uv_line2)();
}
const _easycom_uv_icon = () => "../uv-icon/uv-icon.js";
const _easycom_uv_line = () => "../uv-line/uv-line.js";
if (!Math) {
(_easycom_uv_icon + _easycom_uv_line)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.icon
}, _ctx.icon ? {
b: common_vendor.p({
name: _ctx.icon,
["custom-style"]: _ctx.iconStyle,
size: _ctx.size === "large" ? 22 : 18
})
} : {}, {
c: _ctx.title
}, _ctx.title ? {
d: common_vendor.t(_ctx.title),
e: common_vendor.s($options.titleTextStyle),
f: common_vendor.n(_ctx.disabled && "uv-cell--disabled"),
g: common_vendor.n(_ctx.size === "large" && "uv-cell__title-text--large")
} : {}, {
h: _ctx.label
}, _ctx.label ? {
i: common_vendor.t(_ctx.label),
j: common_vendor.n(_ctx.disabled && "uv-cell--disabled"),
k: common_vendor.n(_ctx.size === "large" && "uv-cell__label--large")
} : {}, {
l: !_ctx.$uv.test.empty(_ctx.value)
}, !_ctx.$uv.test.empty(_ctx.value) ? {
m: common_vendor.t(_ctx.value),
n: common_vendor.n(_ctx.disabled && "uv-cell--disabled"),
o: common_vendor.n(_ctx.size === "large" && "uv-cell__value--large")
} : {}, {
p: _ctx.$slots["right-icon"] || _ctx.isLink
}, _ctx.$slots["right-icon"] || _ctx.isLink ? common_vendor.e({
q: _ctx.$slots["right-icon"]
}, _ctx.$slots["right-icon"] ? {} : {
r: common_vendor.p({
name: _ctx.rightIcon,
["custom-style"]: _ctx.rightIconStyle,
color: _ctx.disabled ? "#c8c9cc" : "info",
size: _ctx.size === "large" ? 18 : 16
})
}, {
s: common_vendor.n(`uv-cell__right-icon-wrap--${_ctx.arrowDirection}`)
}) : {}, {
t: common_vendor.n(_ctx.center && "uv-cell--center"),
v: common_vendor.n(_ctx.size === "large" && "uv-cell__body--large"),
w: common_vendor.s(_ctx.cellStyle),
x: _ctx.border
}, _ctx.border ? {} : {}, {
y: common_vendor.n(_ctx.customClass),
z: common_vendor.s(_ctx.$uv.addStyle(_ctx.customStyle)),
A: !_ctx.disabled && (_ctx.clickable || _ctx.isLink) ? "uv-cell--clickable" : "",
B: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args))
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-fd61d93a"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/node-modules/@climblee/uv-ui/components/uv-cell/uv-cell.js.map
@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"uv-icon": "../uv-icon/uv-icon",
"uv-line": "../uv-line/uv-line"
}
}
@@ -0,0 +1 @@
<view class="{{['uv-cell', 'data-v-fd61d93a', y]}}" style="{{z}}" hover-class="{{A}}" hover-stay-time="{{250}}" bindtap="{{B}}"><view class="{{['uv-cell__body', 'data-v-fd61d93a', t, v]}}" style="{{w}}"><view class="uv-cell__body__content data-v-fd61d93a"><view class="uv-cell__left-icon-wrap data-v-fd61d93a"><block wx:if="{{$slots.icon}}"><slot name="icon"></slot></block><block wx:else><uv-icon wx:if="{{a}}" class="data-v-fd61d93a" u-i="fd61d93a-0" bind:__l="__l" u-p="{{b}}"></uv-icon></block></view><view class="uv-cell__title data-v-fd61d93a"><block wx:if="{{$slots.title}}"><slot name="title"></slot></block><block wx:else><text wx:if="{{c}}" style="{{e}}" class="{{['uv-cell__title-text', 'data-v-fd61d93a', f, g]}}">{{d}}</text></block><block wx:if="{{$slots.label}}"><slot name="label"></slot></block><block wx:else><text wx:if="{{h}}" class="{{['uv-cell__label', 'data-v-fd61d93a', j, k]}}">{{i}}</text></block></view></view><block wx:if="{{$slots.value}}"><slot name="value"></slot></block><block wx:else><text wx:if="{{l}}" class="{{['uv-cell__value', 'data-v-fd61d93a', n, o]}}">{{m}}</text></block><view wx:if="{{p}}" class="{{['uv-cell__right-icon-wrap', 'data-v-fd61d93a', s]}}"><slot wx:if="{{q}}" name="right-icon"></slot><uv-icon wx:else class="data-v-fd61d93a" u-i="fd61d93a-1" bind:__l="__l" u-p="{{r||''}}"></uv-icon></view></view><uv-line wx:if="{{x}}" class="data-v-fd61d93a" u-i="fd61d93a-2" bind:__l="__l"></uv-line></view>
@@ -0,0 +1,110 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
view.data-v-fd61d93a, scroll-view.data-v-fd61d93a, swiper-item.data-v-fd61d93a {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.uv-cell__body.data-v-fd61d93a {
display: flex;
flex-direction: row;
box-sizing: border-box;
padding: 10px 15px;
font-size: 15px;
color: #303133;
}
.uv-cell__body__content.data-v-fd61d93a {
display: flex;
flex-direction: row;
align-items: center;
flex: 1;
}
.uv-cell__body--large.data-v-fd61d93a {
padding-top: 13px;
padding-bottom: 13px;
}
.uv-cell__left-icon-wrap.data-v-fd61d93a, .uv-cell__right-icon-wrap.data-v-fd61d93a {
display: flex;
flex-direction: row;
align-items: center;
font-size: 16px;
}
.uv-cell__left-icon-wrap.data-v-fd61d93a {
margin-right: 4px;
}
.uv-cell__right-icon-wrap.data-v-fd61d93a {
margin-left: 4px;
transition: transform 0.3s;
}
.uv-cell__right-icon-wrap--up.data-v-fd61d93a {
transform: rotate(-90deg);
}
.uv-cell__right-icon-wrap--down.data-v-fd61d93a {
transform: rotate(90deg);
}
.uv-cell__title.data-v-fd61d93a {
flex: 1;
}
.uv-cell__title-text.data-v-fd61d93a {
font-size: 15px;
line-height: 22px;
color: #303133;
}
.uv-cell__title-text--large.data-v-fd61d93a {
font-size: 16px;
}
.uv-cell__label.data-v-fd61d93a {
margin-top: 5px;
font-size: 12px;
color: #909193;
line-height: 18px;
}
.uv-cell__label--large.data-v-fd61d93a {
font-size: 14px;
}
.uv-cell__value.data-v-fd61d93a {
text-align: right;
font-size: 14px;
line-height: 24px;
color: #606266;
}
.uv-cell__value--large.data-v-fd61d93a {
font-size: 15px;
}
.uv-cell--clickable.data-v-fd61d93a {
background-color: #f3f4f6;
}
.uv-cell--disabled.data-v-fd61d93a {
color: #c8c9cc;
cursor: not-allowed;
}
.uv-cell--center.data-v-fd61d93a {
align-items: center;
}
@@ -0,0 +1,132 @@
"use strict";
const common_vendor = require("../../../../../common/vendor.js");
const _sfc_main = {
name: "uv-collapse-item",
mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$1],
data() {
return {
elId: "",
// uni.createAnimation的导出数据
animationData: {},
// 是否展开状态
expanded: false,
// 根据expanded确定是否显示border,为了控制展开时,cell的下划线更好的显示效果,进行一定时间的延时
showBorder: false,
// 是否动画中,如果是则不允许继续触发点击
animating: false,
// 父组件uv-collapse的参数
parentData: {
accordion: false,
border: false
}
};
},
watch: {
expanded(n) {
clearTimeout(this.timer);
this.timer = null;
this.timer = setTimeout(() => {
this.showBorder = n;
}, n ? 10 : 290);
}
},
created() {
this.elId = this.$uv.guid();
},
mounted() {
this.init();
},
methods: {
// 异步获取内容,或者动态修改了内容时,需要重新初始化
init() {
this.updateParentData();
if (!this.parent) {
return this.$uv.error("uv-collapse-item必须要搭配uv-collapse组件使用");
}
const {
value,
accordion,
children = []
} = this.parent;
if (accordion) {
if (this.$uv.test.array(value)) {
return this.$uv.error("手风琴模式下,uv-collapse组件的value参数不能为数组");
}
this.expanded = this.name == value;
} else {
if (!this.$uv.test.array(value) && value !== null) {
return this.$uv.error("非手风琴模式下,uv-collapse组件的value参数必须为数组");
}
this.expanded = (value || []).some((item) => item == this.name);
}
this.$nextTick(function() {
this.setContentAnimate();
});
},
updateParentData() {
this.getParentData("uv-collapse");
},
async setContentAnimate() {
const rect = await this.queryRect();
const height = this.expanded ? rect.height : 0;
this.animating = true;
const animation = common_vendor.index.createAnimation({
timingFunction: "ease-in-out"
});
animation.height(height).step({
duration: this.duration
}).step();
this.animationData = animation.export();
this.$uv.sleep(this.duration).then(() => {
this.animating = false;
});
},
// 点击collapsehead头部
clickHandler() {
if (this.disabled && this.animating)
return;
this.parent && this.parent.onChange(this);
},
// 查询内容高度
queryRect() {
return new Promise((resolve) => {
this.$uvGetRect(`#${this.elId}`).then((size) => {
resolve(size);
});
});
}
}
};
if (!Array) {
const _easycom_uv_cell2 = common_vendor.resolveComponent("uv-cell");
const _easycom_uv_line2 = common_vendor.resolveComponent("uv-line");
(_easycom_uv_cell2 + _easycom_uv_line2)();
}
const _easycom_uv_cell = () => "../uv-cell/uv-cell.js";
const _easycom_uv_line = () => "../uv-line/uv-line.js";
if (!Math) {
(_easycom_uv_cell + _easycom_uv_line)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_vendor.o($options.clickHandler),
b: common_vendor.p({
title: _ctx.title,
value: _ctx.value,
label: _ctx.label,
icon: _ctx.icon,
isLink: _ctx.isLink,
clickable: _ctx.clickable,
border: $data.parentData.border && $data.showBorder,
arrowDirection: $data.expanded ? "up" : "down",
disabled: _ctx.disabled
}),
c: $data.elId,
d: $data.elId,
e: $data.animationData,
f: $data.parentData.border
}, $data.parentData.border ? {} : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-b32ffb1f"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/node-modules/@climblee/uv-ui/components/uv-collapse-item/uv-collapse-item.js.map
@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"uv-cell": "../uv-cell/uv-cell",
"uv-line": "../uv-line/uv-line"
}
}
@@ -0,0 +1 @@
<view class="uv-collapse-item data-v-b32ffb1f"><uv-cell wx:if="{{b}}" class="data-v-b32ffb1f" bindclick="{{a}}" u-i="b32ffb1f-0" bind:__l="__l" u-p="{{b}}"></uv-cell><view class="uv-collapse-item__content data-v-b32ffb1f" animation="{{e}}" ref="animation"><view class="uv-collapse-item__content__text content-class data-v-b32ffb1f" id="{{c}}" ref="{{d}}"><slot/></view></view><uv-line wx:if="{{f}}" class="data-v-b32ffb1f" u-i="b32ffb1f-1" bind:__l="__l"></uv-line></view>
@@ -0,0 +1,44 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
view.data-v-b32ffb1f, scroll-view.data-v-b32ffb1f, swiper-item.data-v-b32ffb1f {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.uv-collapse-item__content.data-v-b32ffb1f {
overflow: hidden;
height: 0;
}
.uv-collapse-item__content__text.data-v-b32ffb1f {
padding: 12px 15px;
color: #606266;
font-size: 14px;
line-height: 18px;
}
@@ -0,0 +1,76 @@
"use strict";
const common_vendor = require("../../../../../common/vendor.js");
const _sfc_main = {
name: "uv-collapse",
mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$2],
watch: {
needInit() {
this.init();
},
// 当父组件需要子组件需要共享的参数发生了变化,手动通知子组件
parentData() {
if (this.children.length) {
this.children.map((child) => {
typeof child.updateParentData === "function" && child.updateParentData();
});
}
}
},
created() {
this.children = [];
},
computed: {
needInit() {
return [this.accordion, this.value];
}
},
methods: {
// 重新初始化一次内部的所有子元素
init() {
this.children.map((child) => {
child.init();
});
},
/**
* collapse-item被点击时触发由collapse统一处理各子组件的状态
* @param {Object} target 被操作的面板的实例
*/
onChange(target) {
let changeArr = [];
this.children.map((child, index) => {
if (this.accordion) {
child.expanded = child === target ? !target.expanded : false;
child.setContentAnimate();
} else {
if (child === target) {
child.expanded = !child.expanded;
child.setContentAnimate();
}
}
changeArr.push({
// 如果没有定义name属性,则默认返回组件的index索引
name: child.name || index,
status: child.expanded ? "open" : "close"
});
});
this.$emit("change", changeArr);
this.$emit(target.expanded ? "open" : "close", target.name);
}
}
};
if (!Array) {
const _easycom_uv_line2 = common_vendor.resolveComponent("uv-line");
_easycom_uv_line2();
}
const _easycom_uv_line = () => "../uv-line/uv-line.js";
if (!Math) {
_easycom_uv_line();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.border
}, _ctx.border ? {} : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/node-modules/@climblee/uv-ui/components/uv-collapse/uv-collapse.js.map
@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"uv-line": "../uv-line/uv-line"
}
}
@@ -0,0 +1 @@
<view class="uv-collapse"><uv-line wx:if="{{a}}" u-i="544d1ba4-0" bind:__l="__l"></uv-line><slot/></view>
@@ -0,0 +1,112 @@
"use strict";
const common_vendor = require("../../../../../common/vendor.js");
const _sfc_main = {
emits: ["click", "close", "change"],
mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$2],
watch: {
text: {
immediate: true,
handler(newValue, oldValue) {
if (!this.$uv.test.array(newValue)) {
this.$uv.error("noticebar组件direction为column时,要求text参数为数组形式");
}
}
}
},
computed: {
// 文字内容的样式
textStyle() {
let style = {};
style.color = this.color;
style.fontSize = this.$uv.addUnit(this.fontSize);
return style;
},
// 垂直或者水平滚动
vertical() {
if (this.mode == "horizontal")
return false;
else
return true;
},
// NVUE中的swiper在css中样式不生效
swiperStyle() {
const style = {};
return style;
}
},
data() {
return {
index: 0
};
},
methods: {
noticeChange(e) {
this.index = e.detail.current;
this.$emit("change", this.index);
},
// 点击通告栏
clickHandler() {
this.$emit("click", this.index);
},
// 点击关闭按钮
close() {
this.$emit("close");
}
}
};
if (!Array) {
const _easycom_uv_icon2 = common_vendor.resolveComponent("uv-icon");
_easycom_uv_icon2();
}
const _easycom_uv_icon = () => "../uv-icon/uv-icon.js";
if (!Math) {
_easycom_uv_icon();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: _ctx.icon
}, _ctx.icon ? {
b: common_vendor.p({
name: _ctx.icon,
color: _ctx.color,
size: "19"
})
} : {}, {
c: common_vendor.f(_ctx.text, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: index
};
}),
d: common_vendor.s($options.textStyle),
e: _ctx.disableTouch,
f: _ctx.step ? false : true,
g: _ctx.duration,
h: !_ctx.disableScroll,
i: common_vendor.s($options.swiperStyle),
j: common_vendor.o((...args) => $options.noticeChange && $options.noticeChange(...args)),
k: ["link", "closable"].includes(_ctx.mode)
}, ["link", "closable"].includes(_ctx.mode) ? common_vendor.e({
l: _ctx.mode === "link"
}, _ctx.mode === "link" ? {
m: common_vendor.p({
name: "arrow-right",
size: 17,
color: _ctx.color
})
} : {}, {
n: _ctx.mode === "closable"
}, _ctx.mode === "closable" ? {
o: common_vendor.o($options.close),
p: common_vendor.p({
name: "close",
size: 16,
color: _ctx.color
})
} : {}) : {}, {
q: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args))
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-edae50b8"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/node-modules/@climblee/uv-ui/components/uv-column-notice/uv-column-notice.js.map
@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"uv-icon": "../uv-icon/uv-icon"
}
}
@@ -0,0 +1 @@
<view class="uv-notice data-v-edae50b8" bindtap="{{q}}"><block wx:if="{{$slots.icon}}"><slot name="icon"></slot></block><block wx:else><view wx:if="{{a}}" class="uv-notice__left-icon data-v-edae50b8"><uv-icon wx:if="{{b}}" class="data-v-edae50b8" u-i="edae50b8-0" bind:__l="__l" u-p="{{b}}"></uv-icon></view></block><swiper disable-touch="{{e}}" vertical="{{f}}" circular interval="{{g}}" autoplay="{{h}}" class="uv-notice__swiper data-v-edae50b8" style="{{i}}" bindchange="{{j}}"><swiper-item wx:for="{{c}}" wx:for-item="item" wx:key="b" class="uv-notice__swiper__item data-v-edae50b8"><text class="uv-notice__swiper__item__text uv-line-1 data-v-edae50b8" style="{{d}}">{{item.a}}</text></swiper-item></swiper><view wx:if="{{k}}" class="uv-notice__right-icon data-v-edae50b8"><uv-icon wx:if="{{l}}" class="data-v-edae50b8" u-i="edae50b8-1" bind:__l="__l" u-p="{{m}}"></uv-icon><uv-icon wx:if="{{n}}" class="data-v-edae50b8" bindclick="{{o}}" u-i="edae50b8-2" bind:__l="__l" u-p="{{p}}"></uv-icon></view></view>
@@ -0,0 +1,105 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.uv-line-1.data-v-edae50b8 {
display: -webkit-box !important;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical !important;
}
.uv-line-2.data-v-edae50b8 {
display: -webkit-box !important;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical !important;
}
.uv-line-3.data-v-edae50b8 {
display: -webkit-box !important;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical !important;
}
.uv-line-4.data-v-edae50b8 {
display: -webkit-box !important;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
-webkit-line-clamp: 4;
-webkit-box-orient: vertical !important;
}
.uv-line-5.data-v-edae50b8 {
display: -webkit-box !important;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
-webkit-line-clamp: 5;
-webkit-box-orient: vertical !important;
}
view.data-v-edae50b8, scroll-view.data-v-edae50b8, swiper-item.data-v-edae50b8 {
display: flex;
flex-direction: column;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
.uv-notice.data-v-edae50b8 {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.uv-notice__left-icon.data-v-edae50b8 {
align-items: center;
margin-right: 5px;
}
.uv-notice__right-icon.data-v-edae50b8 {
margin-left: 5px;
align-items: center;
}
.uv-notice__swiper.data-v-edae50b8 {
height: 16px;
display: flex;
flex-direction: row;
align-items: center;
flex: 1;
}
.uv-notice__swiper__item.data-v-edae50b8 {
display: flex;
flex-direction: row;
align-items: center;
overflow: hidden;
}
.uv-notice__swiper__item__text.data-v-edae50b8 {
font-size: 14px;
color: #f9ae3d;
}
@@ -0,0 +1,95 @@
"use strict";
const common_vendor = require("../../../../../common/vendor.js");
const _sfc_main = {
name: "uv-icon",
emits: ["click"],
mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$1],
data() {
return {
colorType: [
"primary",
"success",
"info",
"error",
"warning"
]
};
},
computed: {
uClasses() {
let classes = [];
classes.push(this.customPrefix);
classes.push(this.customPrefix + "-" + this.name);
if (this.color && this.colorType.includes(this.color))
classes.push("uv-icon__icon--" + this.color);
return classes;
},
iconStyle() {
let style = {};
style = {
fontSize: this.$uv.addUnit(this.size),
lineHeight: this.$uv.addUnit(this.size),
fontWeight: this.bold ? "bold" : "normal",
// 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中
top: this.$uv.addUnit(this.top)
};
if (this.color && !this.colorType.includes(this.color))
style.color = this.color;
return style;
},
// 判断传入的name属性,是否图片路径,只要带有"/"均认为是图片形式
isImg() {
const isBase64 = this.name.indexOf("data:") > -1 && this.name.indexOf("base64") > -1;
return this.name.indexOf("/") !== -1 || isBase64;
},
imgStyle() {
let style = {};
style.width = this.width ? this.$uv.addUnit(this.width) : this.$uv.addUnit(this.size);
style.height = this.height ? this.$uv.addUnit(this.height) : this.$uv.addUnit(this.size);
return style;
},
// 通过图标名,查找对应的图标
icon() {
const code = common_vendor.icons["uvicon-" + this.name];
return code ? unescape(`%u${code}`) : ["uvicon"].indexOf(this.customPrefix) > -1 ? this.name : "";
}
},
methods: {
clickHandler(e) {
this.$emit("click", this.index);
this.stop && this.preventEvent(e);
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $options.isImg
}, $options.isImg ? {
b: _ctx.name,
c: _ctx.imgMode,
d: common_vendor.s($options.imgStyle),
e: common_vendor.s(_ctx.$uv.addStyle(_ctx.customStyle))
} : {
f: common_vendor.t($options.icon),
g: common_vendor.n($options.uClasses),
h: common_vendor.s($options.iconStyle),
i: common_vendor.s(_ctx.$uv.addStyle(_ctx.customStyle)),
j: _ctx.hoverClass
}, {
k: _ctx.label !== ""
}, _ctx.label !== "" ? {
l: common_vendor.t(_ctx.label),
m: _ctx.labelColor,
n: _ctx.$uv.addUnit(_ctx.labelSize),
o: _ctx.labelPos == "right" ? _ctx.$uv.addUnit(_ctx.space) : 0,
p: _ctx.labelPos == "bottom" ? _ctx.$uv.addUnit(_ctx.space) : 0,
q: _ctx.labelPos == "left" ? _ctx.$uv.addUnit(_ctx.space) : 0,
r: _ctx.labelPos == "top" ? _ctx.$uv.addUnit(_ctx.space) : 0
} : {}, {
s: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args)),
t: common_vendor.n("uv-icon--" + _ctx.labelPos)
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-7cc7ad3f"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/node-modules/@climblee/uv-ui/components/uv-icon/uv-icon.js.map
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
@@ -0,0 +1 @@
<view bindtap="{{s}}" class="{{['uv-icon', 'data-v-7cc7ad3f', t]}}"><image wx:if="{{a}}" class="uv-icon__img data-v-7cc7ad3f" src="{{b}}" mode="{{c}}" style="{{d + ';' + e}}"></image><text wx:else class="{{['uv-icon__icon', 'data-v-7cc7ad3f', g]}}" style="{{h + ';' + i}}" hover-class="{{j}}">{{f}}</text><text wx:if="{{k}}" class="uv-icon__label data-v-7cc7ad3f" style="{{'color:' + m + ';' + ('font-size:' + n) + ';' + ('margin-left:' + o) + ';' + ('margin-top:' + p) + ';' + ('margin-right:' + q) + ';' + ('margin-bottom:' + r)}}">{{l}}</text></view>
File diff suppressed because one or more lines are too long
@@ -0,0 +1,35 @@
"use strict";
const common_vendor = require("../../../../../common/vendor.js");
const _sfc_main = {
name: "uv-line",
mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$7],
computed: {
lineStyle() {
const style = {};
style.margin = this.margin;
if (this.direction === "row") {
style.borderBottomWidth = "1px";
style.borderBottomStyle = this.dashed ? "dashed" : "solid";
style.width = this.$uv.addUnit(this.length);
if (this.hairline)
style.transform = "scaleY(0.5)";
} else {
style.borderLeftWidth = "1px";
style.borderLeftStyle = this.dashed ? "dashed" : "solid";
style.height = this.$uv.addUnit(this.length);
if (this.hairline)
style.transform = "scaleX(0.5)";
}
style.borderColor = this.color;
return this.$uv.deepMerge(style, this.$uv.addStyle(this.customStyle));
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.s($options.lineStyle)
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-0a68c4fc"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/node-modules/@climblee/uv-ui/components/uv-line/uv-line.js.map
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
@@ -0,0 +1 @@
<view class="uv-line data-v-0a68c4fc" style="{{a}}"></view>
@@ -0,0 +1,28 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.uv-line.data-v-0a68c4fc {
vertical-align: middle;
}
@@ -0,0 +1,85 @@
"use strict";
const common_vendor = require("../../../../../common/vendor.js");
const _sfc_main = {
name: "uv-notice-bar",
emits: ["click", "close", "change"],
mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props],
data() {
return {
show: true
};
},
methods: {
// 点击通告栏
click(index) {
this.$emit("click", index);
if (this.url && this.linkType) {
this.openPage();
}
},
// 点击关闭按钮
close() {
this.show = false;
this.$emit("close");
},
// 竖向滚动时触发
change(index) {
this.$emit("change", index);
}
}
};
if (!Array) {
const _easycom_uv_column_notice2 = common_vendor.resolveComponent("uv-column-notice");
const _easycom_uv_row_notice2 = common_vendor.resolveComponent("uv-row-notice");
(_easycom_uv_column_notice2 + _easycom_uv_row_notice2)();
}
const _easycom_uv_column_notice = () => "../uv-column-notice/uv-column-notice.js";
const _easycom_uv_row_notice = () => "../uv-row-notice/uv-row-notice.js";
if (!Math) {
(_easycom_uv_column_notice + _easycom_uv_row_notice)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $data.show
}, $data.show ? common_vendor.e({
b: _ctx.direction === "column" || _ctx.direction === "row" && _ctx.step
}, _ctx.direction === "column" || _ctx.direction === "row" && _ctx.step ? {
c: common_vendor.o($options.close),
d: common_vendor.o($options.click),
e: common_vendor.o($options.change),
f: common_vendor.p({
color: _ctx.color,
bgColor: _ctx.bgColor,
text: _ctx.text,
mode: _ctx.mode,
step: _ctx.step,
icon: _ctx.icon,
["disable-touch"]: _ctx.disableTouch,
["disable-scroll"]: _ctx.disableScroll,
fontSize: _ctx.fontSize,
duration: _ctx.duration
})
} : {
g: common_vendor.o($options.close),
h: common_vendor.o($options.click),
i: common_vendor.p({
color: _ctx.color,
bgColor: _ctx.bgColor,
text: _ctx.text,
mode: _ctx.mode,
fontSize: _ctx.fontSize,
speed: _ctx.speed,
url: _ctx.url,
linkType: _ctx.linkType,
icon: _ctx.icon
})
}, {
j: common_vendor.s({
backgroundColor: _ctx.bgColor
}),
k: common_vendor.s(_ctx.$uv.addStyle(_ctx.customStyle))
}) : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-47251d11"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/node-modules/@climblee/uv-ui/components/uv-notice-bar/uv-notice-bar.js.map
@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"uv-column-notice": "../uv-column-notice/uv-column-notice",
"uv-row-notice": "../uv-row-notice/uv-row-notice"
}
}

Some files were not shown because too many files have changed in this diff Show More