master
王文杰 7 months ago
parent c5bfd5d4f4
commit 8a641307aa

@ -112,7 +112,7 @@
"desc" : "你的位置信息将用于小程序位置接口的效果展示"
}
},
"requiredPrivateInfos" : [ "getLocation" ],
"requiredPrivateInfos" : [ "chooseLocation", "getLocation" ],
"uniStatistics" : {
"enable" : true
}

@ -13,21 +13,21 @@
},
"pages": [
{
"path": "pages/index/index",
"path": "pages/login/login",
"style": {
"navigationStyle": "custom"
"navigationBarTitleText": "登录"
}
},
{
"path": "pages/booking/booking",
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "一键预约"
"navigationStyle": "custom"
}
},
{
"path": "pages/login/login",
"path": "pages/booking/booking",
"style": {
"navigationBarTitleText": "登录"
"navigationBarTitleText": "一键预约"
}
},
{

@ -197,9 +197,9 @@ const handlePopClose = (item) => {
if (popupName.value == 'time') {
appointmentTime.value = item
}
if (popupName.value == 'address') {
recycleAddress.value = item.location
}
// if (popupName.value == 'address') {
// recycleAddress.value = item.location
// }
if (popupName.value == 'site') {
if (siteObj.value.id != item.id) {
siteObj.value = item
@ -238,6 +238,18 @@ const bindPickerChange = (e, item) => {
item.productWeight = weightMenuList[idx].val
item.productWeightLabel = weightMenuList[idx].name
}
//
const handlePointer = () => {
uni.chooseLocation({
success: async function (res) {
recycleAddress.value = res.address
console.log(res, '返回地址')
},
fail: function (e) {
console.log(e, '报错')
},
})
}
</script>
<template>
<view class="booking">
@ -258,10 +270,14 @@ const bindPickerChange = (e, item) => {
<text class="label">时间</text>
<text class="text ellipsis"> {{ appointmentTime }} </text>
</view>
<view @tap="openPopup('address')" class="item arrow">
<view @tap="handlePointer()" class="item arrow">
<text class="label">地址</text>
<text class="text ellipsis"> {{ recycleAddress }} </text>
</view>
<!-- <view @tap="openPopup('site')" class="item arrow">
<text class="label">地址</text>
<text class="text ellipsis"> {{ recycleAddress }} </text>
</view> -->
<view @tap="openPopup('site')" class="item arrow">
<text class="label">站点</text>
<text class="text ellipsis">{{ siteObj?.stationName || '请选择回收站点' }}</text>

@ -102,6 +102,7 @@ onReady(async () => {
:data-val="index"
@click="handleSelected"
>
<uni-icons class="location" type="location" color="#3775F6" size="20"></uni-icons>
<view class="user">{{ item.stationName }}</view>
<view class="address">{{ item.address }}</view>
<text :class="[activeIndex == index ? 'icon-checked' : 'icon-ring', 'icon']"></text>
@ -134,8 +135,6 @@ page {
border-radius: 10rpx 10rpx 0 0;
position: relative;
background-color: #fff;
height: 600rpx;
overflow: auto;
.title {
line-height: 1;
padding: 40rpx;
@ -157,13 +156,21 @@ page {
max-height: 540rpx;
overflow: auto;
padding: 20rpx;
margin-bottom: 40rpx;
.item {
padding: 30rpx 50rpx 30rpx 60rpx;
background-size: 40rpx;
background-repeat: no-repeat;
background-position: 0 center;
background-image: url(/static/images/location.png);
position: relative;
box-shadow: 0px -2px 8px 0px rgba(133, 155, 180, 0.4);
margin: 10rpx 0;
border-radius: 10rpx;
}
.location {
color: #999;
font-size: 40rpx;
transform: translateY(-50%);
position: absolute;
top: 50%;
left: 10rpx;
}
.icon {
color: #999;
@ -171,7 +178,7 @@ page {
transform: translateY(-50%);
position: absolute;
top: 50%;
right: 0;
right: 10rpx;
}
.icon-checked {
color: #3775F6;
@ -179,6 +186,7 @@ page {
.icon-ring {
color: #444;
}
.user {
font-size: 28rpx;
color: #444;

@ -1,6 +1,6 @@
<script setup lang="ts">
import type { BannerItem, CategoryItem } from '@/types/home'
import { onLoad } from '@dcloudio/uni-app'
import { onShow, onReady } from '@dcloudio/uni-app'
import { computed, ref, reactive } from 'vue'
import { useMemberStore } from '@/stores'
import CustomNavbar from './components/CustomNavbar.vue'
@ -44,16 +44,15 @@ const isLogin = computed(() => {
//
const isLoading = ref(false)
//
onLoad(async () => {
getHomeCategory()
onReady(async () => {
// getHomeCategory()
if (isLogin.value) {
getSettingInfo()
}
})
const init = async () => {
isLoading.value = true
// await Promise.all([getHomeCategory(), getHomeSite()])
await getHomeSite()
await Promise.all([getHomeCategory(), getHomeSite()])
isLoading.value = false
}
@ -229,4 +228,4 @@ page {
}
}
</style>import type { parse } from 'path'
, onReady, onShow

@ -167,10 +167,10 @@ const getMemberProfileData = async () => {
<uni-icons type="phone" color="#3775F6" size="20"></uni-icons>
<view class="label"> 联系我们 </view>
</button>
<navigator class="loation item arrow" url="/pagesMember/address/address" hover-class="none">
<!-- <navigator class="loation item arrow" url="/pagesMember/address/address" hover-class="none">
<uni-icons type="location" color="#3775F6" size="20"></uni-icons>
<view class="label"> 地址 </view>
</navigator>
</navigator> -->
<navigator
class="settings item arrow"
url="/pagesMember/settings/settings"

Loading…
Cancel
Save