This commit is contained in:
weipengfei 2023-11-21 10:56:02 +08:00
commit 3227c7bf8a
3 changed files with 135 additions and 110 deletions

View File

@ -16,8 +16,9 @@
<view class="site-box1 flex_a_c_j_sb"> <view class="site-box1 flex_a_c_j_sb">
<view class="place_wrapper flex_a_c" @click="selectLocation"> <view class="place_wrapper flex_a_c" @click="selectLocation">
<view class="iconfont icon-weizhi"></view> <view class="iconfont icon-weizhi"></view>
<view class="town_name">{{street||'定位中' }}</view> <view class="town_name">{{street||'定位中' }}</view>
<view class="town_name rotate-box" @click.stop="getPositionFn()"><uni-icons type="loop" color="#fff"></uni-icons></view> <view class="town_name rotate-box" @click.stop="getPositionFn()"><uni-icons type="loop"
color="#fff"></uni-icons></view>
</view> </view>
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none"> <navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
<view class="iconfont icon-xiaoxi" style="color: #fff"> </view> <view class="iconfont icon-xiaoxi" style="color: #fff"> </view>
@ -66,11 +67,11 @@
</u-transition> </u-transition>
</view> </view>
</view> </view>
<view class="location" v-if="isshow"> <view class="location" v-if="isshow">
<view class="locationa"> 位置权限使用说明 </view> <view class="locationa"> 位置权限使用说明 </view>
<view class="locationb"> 用于向你推荐最近门店 </view> <view class="locationb"> 用于向你推荐最近门店 </view>
<view class="locationx" @click.stop="isshow=false">x</view> <view class="locationx" @click.stop="isshow=false">x</view>
</view> </view>
<u-picker :defaultIndex="[0, 0]" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm" <u-picker :defaultIndex="[0, 0]" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm"
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker> @cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker>
<!-- <m-tabbar native> <!-- <m-tabbar native>
@ -126,7 +127,7 @@
data() { data() {
return { return {
locationArr: ({}), locationArr: ({}),
isshow: false, isshow: false,
emptyText: '暂无可用应用', emptyText: '暂无可用应用',
jurisdiction: false, // jurisdiction: false, //
mer_id: '', mer_id: '',
@ -208,6 +209,26 @@
}, },
type: 3, type: 3,
}, },
{
name: '里海直播',
icon: '/static/applet/live.png',
data: {
id: "__UNI__0E46DAD",
url: "https://lihai001.oss-cn-chengdu.aliyuncs.com/app/__UNI__0E46DAD.wgt",
},
type: 4,
},
{
name: 'oa小程序',
icon: '/static/applet/oa.png',
data: {
id: "__UNI__40723E1",
url: "https://lihai001.oss-cn-chengdu.aliyuncs.com/app/__UNI__40723E1.wgt",
},
type: 4
}
// { // {
// name: '', // name: '',
// icon: '/static/applet/icons.png', // icon: '/static/applet/icons.png',
@ -217,17 +238,17 @@
// }, // },
// type: 4, // type: 4,
// }, // },
// { // {
// name: '', // name: '',
// icon: '/static/applet/live.png', // icon: '/static/applet/live.png',
// data: { // data: {
// id: "__UNI__0E46DAD", // id: "__UNI__0E46DAD",
// url:'https://lihai001.oss-cn-chengdu.aliyuncs.com/app/__UNI__0E46DAD.wgt', // url:'https://lihai001.oss-cn-chengdu.aliyuncs.com/app/__UNI__0E46DAD.wgt',
// }, // },
// type: 4, // type: 4,
// } // }
// { // {
// name: '', // name: '',
@ -309,13 +330,16 @@
// #endif // #endif
methods: { methods: {
getPositionFn() { getPositionFn() {
this.street = '定位中' this.street = '定位中'
this.$store.commit('setLocation', {lat: null, long: null}) this.$store.commit('setLocation', {
uni.removeStorageSync('RejectTarget') lat: null,
this.selfLocation() long: null
})
}, uni.removeStorageSync('RejectTarget')
this.selfLocation()
},
scrolling() { scrolling() {
// //
let scrollTop = let scrollTop =
@ -416,12 +440,14 @@
case 1: case 1:
uniMP.loadMP(data); uniMP.loadMP(data);
break; break;
case 2: uniMP.loadMPx(data); break; case 2:
// case 2: uniMP.loadMPx(data);
// // this.navigator(data); break;
// // uniMP.loadMPx(data); // case 2:
// that.navigator(`/pages/moreProject/moreProject`); // // this.navigator(data);
// break; // // uniMP.loadMPx(data);
// that.navigator(`/pages/moreProject/moreProject`);
// break;
case 3: case 3:
uniMP.loadMPurl(data); uniMP.loadMPurl(data);
@ -441,10 +467,10 @@
// title: 'H5' // title: 'H5'
// }) // })
// } // }
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: 'H5不支持打开小程序' title: 'H5不支持打开小程序'
}) })
// #endif // #endif
}, },
@ -493,37 +519,36 @@
this.showPicker = false this.showPicker = false
}, },
selfLocation() { selfLocation() {
if (uni.getStorageSync('RejectTarget')) return; if (uni.getStorageSync('RejectTarget')) return;
if (uni.getStorageSync('loction') == true) { if (uni.getStorageSync('loction') == true) {
this.isshow = false this.isshow = false
} else { } else {
this.isshow = true this.isshow = true
uni.setStorageSync('loction', true); uni.setStorageSync('loction', true);
} }
if(this.$store?.state?.storage?.location?.lat){ if (this.$store?.state?.storage?.location?.lat) {
this.isshow = false this.isshow = false
getGeocoder({ getGeocoder({
lat: this.$store.state.storage.location.lat, lat: this.$store.state.storage.location.lat,
long: this.$store.state.storage.location.long long: this.$store.state.storage.location.long
}).then(res => { }).then(res => {
let town = res.data.address_reference.town.title let town = res.data.address_reference.town.title
let street_id = res.data.address_reference.town.id let street_id = res.data.address_reference.town.id
this.street = res.data.address_reference.town.title; this.street = res.data.address_reference.town.title;
this.$nextTick(() => { this.$nextTick(() => {
this.$bus.$emit('value-updated', this.street + ',' + this.$bus.$emit('value-updated', this.street + ',' +
street_id); street_id);
}) })
}).catch(err => { }).catch(err => {
this.isshow = false this.isshow = false
uni.showToast({ uni.showToast({
title: err, title: err,
icon: 'none' icon: 'none'
}) })
}) })
} } else uni.getLocation({
else uni.getLocation({
type: 'wgs84', type: 'wgs84',
timeout: '10', timeout: '10',
success: (res) => { success: (res) => {
@ -532,10 +557,10 @@
let latitude, longitude; let latitude, longitude;
latitude = res.latitude.toString(); latitude = res.latitude.toString();
longitude = res.longitude.toString(); longitude = res.longitude.toString();
this.$store.commit('setLocation', { this.$store.commit('setLocation', {
lat: res.latitude.toFixed(6), lat: res.latitude.toFixed(6),
long: res.longitude.toFixed(6), long: res.longitude.toFixed(6),
}); });
getGeocoder({ getGeocoder({
lat: latitude, lat: latitude,
long: longitude long: longitude
@ -555,14 +580,14 @@
title: err, title: err,
icon: 'none' icon: 'none'
}) })
this.street = '定位失败' this.street = '定位失败'
}) })
}, },
fail: (err) => { fail: (err) => {
this.isshow = false this.isshow = false
uni.setStorageSync("RejectTarget", true) uni.setStorageSync("RejectTarget", true)
Toast('定位失败,请检查定位权限是否开启') Toast('定位失败,请检查定位权限是否开启')
this.street = '定位失败' this.street = '定位失败'
} }
}); });
}, },
@ -807,47 +832,47 @@
background-color: #fff; background-color: #fff;
padding-top: 28rpx; padding-top: 28rpx;
} }
.rotate-box { .rotate-box {
transform: rotate(0deg); transform: rotate(0deg);
transition: transform .5s ease-out; transition: transform .5s ease-out;
} }
.rotate-box:active { .rotate-box:active {
transform: rotate(360deg); transform: rotate(360deg);
} }
.location { .location {
background-color: #f6f6f6; background-color: #f6f6f6;
width: 680rpx; width: 680rpx;
height: 150rpx; height: 150rpx;
position: absolute; position: absolute;
top: 0; top: 0;
z-index: 9999; z-index: 9999;
border-radius: 20rpx; border-radius: 20rpx;
left: 50%; left: 50%;
margin-left: -340rpx; margin-left: -340rpx;
margin-top: 80rpx; margin-top: 80rpx;
padding-left: 20rpx; padding-left: 20rpx;
.locationa { .locationa {
font-size: 28rpx; font-size: 28rpx;
color: #000; color: #000;
font-weight: 500; font-weight: 500;
margin-top: 30rpx; margin-top: 30rpx;
margin-bottom: 15rpx; margin-bottom: 15rpx;
} }
.locationb { .locationb {
font-size: 20rpx; font-size: 20rpx;
color: #5a5a5a; color: #5a5a5a;
} }
.locationx{ .locationx {
color: #000; color: #000;
position: absolute; position: absolute;
top: 10rpx; top: 10rpx;
right: 20rpx; right: 20rpx;
} }
} }
</style> </style>

BIN
static/applet/oa.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
static/img/missing-face.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB