更新
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,14 +355,14 @@
|
|||||||
<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>
|
||||||
</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>
|
||||||
@ -377,15 +418,15 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="content-two">
|
<view class="content-two">
|
||||||
<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">
|
||||||
<u--image :showLoading="true" src="/static/images/GXSC/DW.png" width="33.85rpx"
|
<u--image :showLoading="true" src="/static/images/GXSC/DW.png" width="33.85rpx"
|
||||||
height="33.85rpx"></u--image>
|
height="33.85rpx"></u--image>
|
||||||
<text class="address">{{item.mer_address}}</text>
|
<text class="address">{{item.mer_address}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -416,7 +457,7 @@
|
|||||||
import {
|
import {
|
||||||
HTTP_REQUEST_URL
|
HTTP_REQUEST_URL
|
||||||
} from '@/config/app';
|
} from '@/config/app';
|
||||||
import { Toast } from '../../../libs/uniApi';
|
import { Toast } from '../../../libs/uniApi';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
WaterfallsFlow
|
WaterfallsFlow
|
||||||
@ -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('点击右上角开启定位后才可获取附近商家')
|
||||||
@ -468,18 +513,18 @@ import { Toast } from '../../../libs/uniApi';
|
|||||||
uni.$emit('scroll');
|
uni.$emit('scroll');
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
navTo(url){
|
navTo(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:url,
|
url: url,
|
||||||
success: () => {
|
success: () => {
|
||||||
uni.$once('searchValue', (e)=>{
|
uni.$once('searchValue', (e) => {
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(() => {
|
||||||
this.where.keyword = e;
|
this.where.keyword = e;
|
||||||
this.storeMerchantList(true);
|
this.storeMerchantList(true);
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
navBack() {
|
navBack() {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
@ -494,9 +539,9 @@ import { Toast } from '../../../libs/uniApi';
|
|||||||
},
|
},
|
||||||
// 进店
|
// 进店
|
||||||
goStore(id) {
|
goStore(id) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/store/home/index?id=${id}`
|
url: `/pages/store/home/index?id=${id}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
merClassifly() {
|
merClassifly() {
|
||||||
merClassifly().then(res => {
|
merClassifly().then(res => {
|
||||||
@ -508,50 +553,56 @@ import { Toast } from '../../../libs/uniApi';
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
storeMerchantList(reLoad = false) {
|
storeMerchantList(reLoad = false) {
|
||||||
if(reLoad){
|
if (reLoad) {
|
||||||
this.where.page = 1;
|
this.where.page = 1;
|
||||||
this.goodsList = [];
|
this.goodsList = [];
|
||||||
this.isLoading = 0;
|
this.isLoading = 0;
|
||||||
}
|
}
|
||||||
if(this.isLoading==-1)return;
|
if (this.isLoading == -1) return;
|
||||||
this.isLoading = 1;
|
this.isLoading = 1;
|
||||||
storeMerchantList(this.where).then(res => {
|
storeMerchantList(this.where).then(res => {
|
||||||
this.goodsList = [...this.goodsList, ...res.data.list];
|
this.goodsList = [...this.goodsList, ...res.data.list];
|
||||||
this.isLoading = 0;
|
this.isLoading = 0;
|
||||||
if(res.data.list.length<this.where.limit) this.isLoading = -1;
|
if (res.data.list.length < this.where.limit) this.isLoading = -1;
|
||||||
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.street = e.street.name;
|
this.isShowAddress = false;
|
||||||
this.$store.commit('setAddress', {
|
uni.setStorageSync('closeShow', true);
|
||||||
street_id: e.street.code,
|
this.street = e.street.name;
|
||||||
townName: e.street.name
|
this.$store.commit('setAddress', {
|
||||||
});
|
street_id: e.street.code,
|
||||||
if (e.longitude) {
|
townName: e.street.name
|
||||||
let latitude = e.latitude;
|
});
|
||||||
let longitude = e.longitude;
|
if (e.longitude) {
|
||||||
|
let latitude = e.latitude;
|
||||||
|
let longitude = e.longitude;
|
||||||
this.where.location = `${latitude},${longitude}`;
|
this.where.location = `${latitude},${longitude}`;
|
||||||
this.$store.commit('setLocation', {
|
this.$store.commit('setLocation', {
|
||||||
lat: e.latitude,
|
lat: e.latitude,
|
||||||
long: e.longitude,
|
long: e.longitude,
|
||||||
});
|
});
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(() => {
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
this.storeMerchantList(true);
|
this.storeMerchantList(true);
|
||||||
}, 200)
|
}, 200)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getLocation(){
|
getLocation() {
|
||||||
uni.getLocation({
|
uni.getLocation({
|
||||||
type: 'gcj02',
|
type: 'gcj02',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
@ -559,29 +610,38 @@ import { Toast } from '../../../libs/uniApi';
|
|||||||
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),
|
||||||
});
|
});
|
||||||
|
this.isShowAddress = false;
|
||||||
|
uni.setStorageSync('closeShow', true);
|
||||||
|
uni.setStorageSync('getAddress', true);
|
||||||
getGeocoder({
|
getGeocoder({
|
||||||
lat: latitude,
|
lat: latitude,
|
||||||
long: longitude
|
long: longitude
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
let town = res.data.address_reference.town.title
|
let town = res.data.address_reference.town.title
|
||||||
let street_id = street_id = res.data.address_reference.town.id
|
let street_id = 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.$store.commit('setAddress', {
|
this.$store.commit('setAddress', {
|
||||||
street_id: street_id,
|
street_id: street_id,
|
||||||
townName: town
|
townName: town
|
||||||
});
|
});
|
||||||
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({
|
||||||
title: err,
|
title: err,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
this.street = '定位失败'
|
this.street = '定位失败'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -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