更新
This commit is contained in:
parent
f6ceed4060
commit
f691bf6749
@ -291,6 +291,36 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.position-address {
|
||||||
|
position: absolute;
|
||||||
|
top: 70rpx;
|
||||||
|
right: -10rpx;
|
||||||
|
// background-color: rgba(#000, 0.7);
|
||||||
|
width: 250rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
padding-top: 30rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
background-image: url(https://lihai001.oss-cn-chengdu.aliyuncs.com/def/39cd0202404171145486922.png);
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
position: absolute;
|
||||||
|
right: 10rpx;
|
||||||
|
top: 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
background-color: #40AE36;
|
||||||
|
width: 100%;
|
||||||
|
height: 40rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<template>
|
<template>
|
||||||
<view class="wholeSale">
|
<view class="wholeSale">
|
||||||
@ -299,13 +329,23 @@
|
|||||||
<view class="wholeSale-header" style="position: fixed;top: 0;left: 0;width: 100%;z-index: 999;">
|
<view class="wholeSale-header" style="position: fixed;top: 0;left: 0;width: 100%;z-index: 999;">
|
||||||
<!-- 适配不同机 -->
|
<!-- 适配不同机 -->
|
||||||
<view style="height: var(--status-bar-height);background-color: #40af37;"></view>
|
<view style="height: var(--status-bar-height);background-color: #40af37;"></view>
|
||||||
<view style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;justify-content: space-between;">
|
<view
|
||||||
<view style="display: flex;font-weight: bold;font-size: 32rpx;"><u-icon style="margin-right: 20rpx;" name="arrow-left" size="20"
|
style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;justify-content: space-between;">
|
||||||
color="#fff" @click="navBack"></u-icon>供销综合云市场</view>
|
<view style="display: flex;font-weight: bold;font-size: 32rpx;"><u-icon style="margin-right: 20rpx;"
|
||||||
<view style="display: flex;" @click="changeMap">
|
name="arrow-left" size="20" color="#fff" @click="navBack"></u-icon>供销综合云市场</view>
|
||||||
<view style="width: 250rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;text-align: right;">{{street}}</view>
|
<view style="display: flex;position: relative;" @click="changeMap">
|
||||||
<u-icon name="arrow-down" size="14"
|
<view style="width: 250rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;text-align: right;">
|
||||||
color="#fff"></u-icon>
|
{{street}}
|
||||||
|
</view>
|
||||||
|
<u-icon name="arrow-down" size="14" color="#fff"></u-icon>
|
||||||
|
<view class="position-address" v-if="isShowAddress" @click.stop="">
|
||||||
|
<u-icon class="icon" name="close" size="14" @click="closeShowAddress" color="#fff"></u-icon>
|
||||||
|
<view class="title">
|
||||||
|
<view>开启定位服务</view>
|
||||||
|
<view>查看附近商铺</view>
|
||||||
|
</view>
|
||||||
|
<view class="btn" @click.stop="getLocation">立即开启</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -315,12 +355,12 @@
|
|||||||
<view class="wholeSale-nav">
|
<view class="wholeSale-nav">
|
||||||
<!-- <u-icon class="icon" name="arrow-left" size="20" @click="navBack"></u-icon> -->
|
<!-- <u-icon class="icon" name="arrow-left" size="20" @click="navBack"></u-icon> -->
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<view @click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}&shop=true`)" hover-class="none"
|
<view @click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}&shop=true`)"
|
||||||
class="search_content flex_a_c_j_sb">
|
hover-class="none" class="search_content flex_a_c_j_sb">
|
||||||
<view class="flex_a_c search_content_wrap">
|
<view class="flex_a_c search_content_wrap">
|
||||||
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
|
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
|
||||||
<input type="text" placeholder="搜索店铺名称" :value="where.keyword" placeholder-style="font-size: 30rpx;color:#999;"
|
<input type="text" placeholder="搜索店铺名称" :value="where.keyword"
|
||||||
disabled style="pointer-events: none;">
|
placeholder-style="font-size: 30rpx;color:#999;" disabled style="pointer-events: none;">
|
||||||
</view>
|
</view>
|
||||||
<!-- <button class="search_btn">搜索</button> -->
|
<!-- <button class="search_btn">搜索</button> -->
|
||||||
</view>
|
</view>
|
||||||
@ -333,7 +373,8 @@
|
|||||||
<block v-for="(item,index) in store_category" :key="index">
|
<block v-for="(item,index) in store_category" :key="index">
|
||||||
<view class="category-item" :class="{'category-item-active': index==cate_change}"
|
<view class="category-item" :class="{'category-item-active': index==cate_change}"
|
||||||
@click="changeCate(index)">
|
@click="changeCate(index)">
|
||||||
<u--image class="category-item-img" width="108rpx" :src="item.background" height="108rpx" shape="circle">
|
<u--image class="category-item-img" width="108rpx" :src="item.background" height="108rpx"
|
||||||
|
shape="circle">
|
||||||
<template v-slot:loading>
|
<template v-slot:loading>
|
||||||
<u-loading-icon color="#999" size="15" />
|
<u-loading-icon color="#999" size="15" />
|
||||||
</template>
|
</template>
|
||||||
@ -379,8 +420,8 @@
|
|||||||
<u--image :showLoading="true" src="/static/images/GXSC/DH.png" width="33.85rpx"
|
<u--image :showLoading="true" src="/static/images/GXSC/DH.png" width="33.85rpx"
|
||||||
height="33.85rpx"></u--image>
|
height="33.85rpx"></u--image>
|
||||||
<text> {{item.service_phone}}</text>
|
<text> {{item.service_phone}}</text>
|
||||||
<u--image style="margin-left: 28rpx;" v-if="item.mer_take_time" :showLoading="true" src="/static/images/GXSC/SJ.png" width="33.85rpx"
|
<u--image style="margin-left: 28rpx;" v-if="item.mer_take_time" :showLoading="true"
|
||||||
height="33.85rpx"></u--image>
|
src="/static/images/GXSC/SJ.png" width="33.85rpx" height="33.85rpx"></u--image>
|
||||||
<text v-if="item.mer_take_time">{{item.mer_take_time[0]}}-{{item.mer_take_time[1]}}</text>
|
<text v-if="item.mer_take_time">{{item.mer_take_time[0]}}-{{item.mer_take_time[1]}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="content-two">
|
<view class="content-two">
|
||||||
@ -429,6 +470,7 @@ import { Toast } from '../../../libs/uniApi';
|
|||||||
cate_change: 0,
|
cate_change: 0,
|
||||||
goodsList: [],
|
goodsList: [],
|
||||||
isLoading: 0,
|
isLoading: 0,
|
||||||
|
isShowAddress: false,
|
||||||
street: '定位中',
|
street: '定位中',
|
||||||
where: {
|
where: {
|
||||||
page: 1,
|
page: 1,
|
||||||
@ -451,10 +493,13 @@ import { Toast } from '../../../libs/uniApi';
|
|||||||
}, mapGetters(['viewColor', 'keyColor'])),
|
}, mapGetters(['viewColor', 'keyColor'])),
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
let getAddress = uni.getStorageSync('getAddress');
|
||||||
|
let closeShow = uni.getStorageSync('closeShow');
|
||||||
|
if (!getAddress && !closeShow) this.isShowAddress = true;
|
||||||
this.street = this.$store.state.storage.address.townName;
|
this.street = this.$store.state.storage.address.townName;
|
||||||
if (this.$store.state.storage.location.lat) {
|
if (this.$store.state.storage.location.lat) {
|
||||||
this.where.location = `${this.$store.state.storage.location.lat},${this.$store.state.storage.location.long}`;
|
this.where.location = `${this.$store.state.storage.location.lat},${this.$store.state.storage.location.long}`;
|
||||||
} else if(uni.getStorageSync('getAddress')){
|
} else if (getAddress) {
|
||||||
this.street = '';
|
this.street = '';
|
||||||
this.getLocation();
|
this.getLocation();
|
||||||
} else Toast('点击右上角开启定位后才可获取附近商家')
|
} else Toast('点击右上角开启定位后才可获取附近商家')
|
||||||
@ -522,12 +567,18 @@ import { Toast } from '../../../libs/uniApi';
|
|||||||
this.where.page++;
|
this.where.page++;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
closeShowAddress() {
|
||||||
|
this.isShowAddress = false;
|
||||||
|
uni.setStorageSync('closeShow', true);
|
||||||
|
},
|
||||||
// 选择位置
|
// 选择位置
|
||||||
changeMap() {
|
changeMap() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/select_address_n/select_address_n`,
|
url: `/pages/select_address_n/select_address_n`,
|
||||||
success: () => {
|
success: () => {
|
||||||
uni.$once('changeAddress', (e) => {
|
uni.$once('changeAddress', (e) => {
|
||||||
|
this.isShowAddress = false;
|
||||||
|
uni.setStorageSync('closeShow', true);
|
||||||
this.street = e.street.name;
|
this.street = e.street.name;
|
||||||
this.$store.commit('setAddress', {
|
this.$store.commit('setAddress', {
|
||||||
street_id: e.street.code,
|
street_id: e.street.code,
|
||||||
@ -562,6 +613,9 @@ import { Toast } from '../../../libs/uniApi';
|
|||||||
lat: res.latitude.toFixed(6),
|
lat: res.latitude.toFixed(6),
|
||||||
long: res.longitude.toFixed(6),
|
long: res.longitude.toFixed(6),
|
||||||
});
|
});
|
||||||
|
this.isShowAddress = false;
|
||||||
|
uni.setStorageSync('closeShow', true);
|
||||||
|
uni.setStorageSync('getAddress', true);
|
||||||
getGeocoder({
|
getGeocoder({
|
||||||
lat: latitude,
|
lat: latitude,
|
||||||
long: longitude
|
long: longitude
|
||||||
@ -575,6 +629,12 @@ import { Toast } from '../../../libs/uniApi';
|
|||||||
});
|
});
|
||||||
uni.$emit('getLocation_succees', {
|
uni.$emit('getLocation_succees', {
|
||||||
street_id,
|
street_id,
|
||||||
|
});
|
||||||
|
this.where.location = `${latitude},${longitude}`;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.storeMerchantList(true);
|
||||||
|
}, 200)
|
||||||
})
|
})
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
<view style="height: var(--status-bar-height);"></view>
|
<view style="height: var(--status-bar-height);"></view>
|
||||||
<view class="location">
|
<view class="location">
|
||||||
<view class="box flex_a_c_j_sb">
|
<view class="box flex_a_c_j_sb">
|
||||||
<view class="place_wrapper flex_a_c" @click="changeMap">
|
<view class="place_wrapper flex_a_c">
|
||||||
<view class="iconfont icon-weizhi" style="color:#fff;font-size:40rpx;"></view>
|
<view v-if="street&&street!='未开启定位'" @click="changeMap" class="iconfont icon-weizhi" style="color:#fff;font-size:40rpx;"></view>
|
||||||
<view class="town_name">{{street||'定位中' }}</view>
|
<view v-if="street&&street!='未开启定位'" @click="changeMap" class="town_name">{{street}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex_a_c_j_sb">
|
<view class="flex_a_c_j_sb">
|
||||||
<view style="margin-right: 30rpx;" @click="scanQRcode" hover-class="none">
|
<view style="margin-right: 30rpx;" @click="scanQRcode" hover-class="none">
|
||||||
@ -129,7 +129,7 @@
|
|||||||
isCategory: false,
|
isCategory: false,
|
||||||
swiperTop: 0,
|
swiperTop: 0,
|
||||||
isFixed: true,
|
isFixed: true,
|
||||||
street: '未开启定位'
|
street: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -138,6 +138,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
uni.$on('changeAddress', (e)=>{
|
||||||
|
this.street = e.street.name;
|
||||||
|
})
|
||||||
var that = this
|
var that = this
|
||||||
// 获取设备宽度
|
// 获取设备宽度
|
||||||
uni.getSystemInfo({
|
uni.getSystemInfo({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user