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

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

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

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

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

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { BannerItem, CategoryItem } from '@/types/home' 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 { computed, ref, reactive } from 'vue'
import { useMemberStore } from '@/stores' import { useMemberStore } from '@/stores'
import CustomNavbar from './components/CustomNavbar.vue' import CustomNavbar from './components/CustomNavbar.vue'
@ -44,16 +44,15 @@ const isLogin = computed(() => {
// //
const isLoading = ref(false) const isLoading = ref(false)
// //
onLoad(async () => { onReady(async () => {
getHomeCategory() // getHomeCategory()
if (isLogin.value) { if (isLogin.value) {
getSettingInfo() getSettingInfo()
} }
}) })
const init = async () => { const init = async () => {
isLoading.value = true isLoading.value = true
// await Promise.all([getHomeCategory(), getHomeSite()]) await Promise.all([getHomeCategory(), getHomeSite()])
await getHomeSite()
isLoading.value = false isLoading.value = false
} }
@ -229,4 +228,4 @@ page {
} }
} }
</style>import type { parse } from 'path' </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> <uni-icons type="phone" color="#3775F6" size="20"></uni-icons>
<view class="label"> 联系我们 </view> <view class="label"> 联系我们 </view>
</button> </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> <uni-icons type="location" color="#3775F6" size="20"></uni-icons>
<view class="label"> 地址 </view> <view class="label"> 地址 </view>
</navigator> </navigator> -->
<navigator <navigator
class="settings item arrow" class="settings item arrow"
url="/pagesMember/settings/settings" url="/pagesMember/settings/settings"

Loading…
Cancel
Save