初始化万家商超用户端仓库

This commit is contained in:
wangxiaowei
2025-04-30 14:04:34 +08:00
commit 022c640d89
425 changed files with 160005 additions and 0 deletions

View File

@ -0,0 +1,542 @@
<template>
<view class="page" :style="themeColor">
<view class="flex benben-position-layout flex flex-wrap align-center activityList_flex_0"
:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
<view class='flex flex-wrap align-center justify-between flex-sub activityList_fd0_0'>
<view class='flex flex-wrap align-stretch justify-center flex-sub'>
<text class='activityList_fd0_0_c0_c0'>活动商家</text>
</view>
</view>
</view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
<view v-if="isHandLocation && !lat" class="kaiqiweizhi flex align-center justify-between"
:style="{top:(70 + StatusBar ) + 'px'}">
<view class="flex align-center">
<view class="" style="font-size: 32upx;font-weight: 550;">开启定位权限,显示周边商家及商品</view>
<view class="kaiqiweizhi-button" @click="_getPermission">
去开启
</view>
</view>
<view class="text-df flex align-center">
<image src="/static/close.png" @click="isHandLocation = false" style="width:32rpx;height: 32rpx;"
mode="aspectFill"></image>
</view>
</view>
<!---flex布局flex布局开始-->
<block v-if="permissionStatus == 1">
<fu-loading v-if="isShowLoading"></fu-loading>
<fu-empty-ui v-if="list.length === 0 && isInit"></fu-empty-ui>
<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout activityList_flex_1"
@tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/`">
<view class='flex flex-wrap align-start activityList_fd1_0' v-for="(item, index) in list" :key="index" @tap.stop="handleJumpDiy" data-type="navigateTo"
:data-url="`/pages/hd/eventDetails/eventDetails?id=${item.aid}&name=${item.store_name}`">
<view class='flex flex-direction flex-wrap align-start' style="position: relative;">
<view class='flex flex-wrap align-center justify-center activityList_fd1_0_c0_c0'>
<text class='activityList_fd1_0_c0_c0_c0'>积分</text>
<text class='activityList_fd1_0_c0_c0_c1'>{{item.score_rate}}</text>
<text class='activityList_fd1_0_c0_c0_c2'>%</text>
</view>
<view class='flex flex-wrap align-center'>
<image class='activityList_fd1_0_c0_c1_c0' mode="aspectFill" :src='item.logo'></image>
</view>
<image style="width: 50rpx; height: 50rpx; position: absolute; top: 0; right: 0; z-index: 10;" v-if="item.storelevel_thumb" :src="item.storelevel_thumb" mode="aspectFill"></image>
</view>
<view class='flex flex-direction flex-wrap align-start flex-sub activityList_fd1_0_c1'>
<view class='flex flex-direction flex-wrap align-start'>
<view class='flex flex-wrap align-center'>
<text class='activityList_fd1_0_c1_c0_c0_c0'>{{item.store_name}}</text>
</view>
<view class='flex align-center activityList_fd1_0_c1_c0_c1'>
<image class='activityList_fd1_0_c1_c0_c1_c0' mode="aspectFit" :src='STATIC_URL+"163.png"'></image>
<view class='activityList_fd1_0_c1_c0_c1_c1'>{{item.address_province + item.address_city + item.address_district + item.address_address}}</view>
</view>
<text class='storeDetails_fd2_0_c1_c1_c1' style="margin: 20rpx 20rpx 0 0; color: #FF9D00;font-size: 26rpx;" v-if="item.store_type">{{item.store_type}}</text>
</view>
<view class='flex flex-wrap align-center activityList_fd1_0_c1_c1'>
<text class='activityList_fd1_0_c1_c1_c0'>{{item.distance}}</text>
<text class='activityList_fd1_0_c1_c1_c1'>km</text>
</view>
</view>
</view>
</view>
<uni-load-more v-if="list.length !=0 " :status="status"></uni-load-more>
</block>
<!---flex布局flex布局结束-->
<block v-if="permissionStatus != 1">
<fu-empty-ui @permission="handlePermission" v-if="permissionStatus == 0" emptyImage="addr" pagingListNoListDataText="暂无开启位置权限"></fu-empty-ui>
<fu-empty-ui @permission="handlePermission" v-if="permissionStatus == -1" emptyImage="permission" pagingListNoListDataText="您已永久拒绝位置权限"></fu-empty-ui>
</block>
</view>
</template>
<script>
import amap from '@/common/amap-wx.js';
import permision from '@/common/permission.js'
export default {
components: {},
data() {
return {
"data": [],
lat: '',
lng: '',
list: [],
isShowLoading: false,
isInit: false,
status: 'more', // 表示是否有数据可以请求
page: 1,
amapPlugin: null, //new地图
key: '886bfe2d6c32bd8eac97c2e6d821ed0b',
permissionStatus: 1,
isHandLocation: false
};
},
computed: {
themeColor() {
return this.$store.getters.themeColor
},
},
watch: {},
onLoad(options) {
this.amapPlugin = new amap.AMapWX({
key: this.key
});
this.judgeIsLocation()
// uni.$on('LOCATION_SUCCESS', () => {
// this.judgeIsLocation()
// })
// if (global.lat && global.lng) {
// this.lat = global.lat
// this.lng = global.lng
// this.status = 'more';
// this.page = 1;
// this.isInit = false;
// this.list = [];
// this.getRecommendList(true);
// } else {
// // #ifdef APP-PLUS
// this._getPermission();
// // #endif
// // #ifndef APP-PLUS
// this._getLocation()
// // #endif
// }
},
onUnload() {
},
onReady() {
},
onShow() {
// if (this.permissionStatus == -1) {
// this.requestAndroidPermission('android.permission.ACCESS_FINE_LOCATION');
// }
// let lat = uni.getStorageSync('LVTAI_LAT') || '';
// let lng = uni.getStorageSync('LVTAI_LNG') || '';
// // 定位功能
// if (!lat) {
// // #ifndef MP-WEIXIN
// let platform = uni.getSystemInfoSync().platform == 'ios' ? 1 : 2
// console.log(platform)
// if (platform == 2) {
// this.isHandLocation = true;
// } else {
// this._getLocation()
// this.isHandLocation = false;
// }
// // #endif
// // #ifdef MP-WEIXIN
// this._getLocation()
// this.toppop = false;
// // #endif
// } else {
// this._getLocation()
// }
// if (global.lat && global.lng) {
// this.lat = global.lat
// this.lng = global.lng
// this.status = 'more';
// this.page = 1;
// this.isInit = false;
// this.list = [];
// this.getRecommendList(true);
// } else {
// this._getLocation()
// }
},
onHide() {
},
onResize() {
},
onPullDownRefresh() {
let lat = uni.getStorageSync('LVTAI_LAT') || '';
let lng = uni.getStorageSync('LVTAI_LNG') || '';
if (!lat) {
// #ifndef MP-WEIXIN
let platform = uni.getSystemInfoSync().platform == 'ios' ? 1 : 2
console.log(platform)
if (platform == 2) {
this.isHandLocation = true;
} else {
this._getLocation()
this.isHandLocation = false;
}
// #endif
// #ifdef MP-WEIXIN
this._getLocation()
this.toppop = false;
// #endif
} else {
this._getLocation()
}
// if(this.lat){
// this.status = 'more';
// this.page = 1;
// this.isInit = false;
// this.list = [];
// this.getRecommendList(true);
// }else{
// this._getLocation()
// }
// this.$refs.guess && this.$refs.guess.refresh();
setTimeout(() => {
uni.stopPullDownRefresh();
}, 1000);
},
onReachBottom(e) {
if (this.lat && this.lng) {
this.getRecommendList();
}
},
onPageScroll(e) {
},
methods: {
judgeIsLocation() {
let lat = uni.getStorageSync('LVTAI_LAT') || '';
let lng = uni.getStorageSync('LVTAI_LNG') || '';
// 定位功能
if (!lat) {
// #ifndef MP-WEIXIN
let platform = uni.getSystemInfoSync().platform == 'ios' ? 1 : 2
console.log(platform)
if (platform == 2) {
this.isHandLocation = true;
} else {
this._getLocation()
this.isHandLocation = false;
}
// #endif
// #ifdef MP-WEIXIN
this._getLocation()
this.toppop = false;
// #endif
} else {
this._getLocation()
}
},
handlePermission(type) {
console.log(123)
if (type ==1) {
this.requestAndroidPermission('android.permission.ACCESS_FINE_LOCATION');
} else {
permision.gotoAppPermissionSetting()
}
},
async requestAndroidPermission(permisionID) {
console.log(123)
var result = await permision.requestAndroidPermission(permisionID);
var strStatus
if (result == 1) {
this._getLocation();
}
this.permissionStatus = result;
},
_getPermission() {
const that = this;
uni.getSystemInfo({
success: (res) => {
if (res.platform == 'android') {
let isLocation = uni.getStorageSync('LVTAI_USER_LOCATION') || false;
if (!isLocation) {
that.$util.showModal({
title:'提示',
content: '获取您的定位权限以展示附近活动商家?',
success: res => {
if (res.confirm) {
that.requestAndroidPermission('android.permission.ACCESS_FINE_LOCATION');
} else {
that.permissionStatus = 0;
}
}
});
} else {
this._getLocation();
}
} else {
this._getLocation();
}
}
});
},
/**
* 获取附近商家列表
* @param {Object} value
*/
getRecommendList(value) {
if (this.status != 'more') return;
this.status = 'loading';
let data = {
list_rows: 20,
page: this.page,
lat: this.lat,
lng: this.lng
};
// console.log('请求的数据', data);
if (this.page == 1 && value) {
this.isShowLoading = true;
}
this.$api
.post(global.apiUrls.getPromotionList, data)
.then(res => {
console.log('订单列表', res);
this.isShowLoading = false;
if (res.data.code == 1) {
var curPageData = res.data.data.data;
if (this.page == 1) this.list = [];
this.list = this.list.concat(curPageData);
console.log('上拉加载', curPageData.length, this.size);
if (res.data.data.last_page > this.page) {
this.status = 'more';
this.page++;
} else {
this.status = 'noMore';
}
} else {
this.$message.info(res.data.msg);
}
this.isInit = true;
uni.stopPullDownRefresh();
})
.catch(err => {
this.isShowLoading = false;
uni.stopPullDownRefresh();
});
},
_getLocation() {
// #ifdef H5
this.lat = '34.738695';
this.lng = '113.64328';
uni.setStorageSync('LVTAI_LAT', this.lat)
uni.setStorageSync('LVTAI_LNG', this.lng)
this.status = 'more';
this.page = 1;
this.isInit = false;
this.list = [];
this.address = '华城国际中心'
this.getRecommendList(true);
// #endif
// #ifndef H5
this.amapPlugin.getRegeo({
success: res => {
console.log(res[0]);
// uni.$off('LOCATION_SUCCESS', ()=>{})
// uni.$emit('LOCATION_SUCCESS', {})
uni.setStorageSync('LVTAI_USER_LOCATION', true);
this.address = res[0].regeocodeData.addressComponent.city;
this.lat = res[0].latitude;
this.lng = res[0].longitude;
uni.setStorageSync('LVTAI_LAT', this.lat)
uni.setStorageSync('LVTAI_LNG', this.lng)
this.status = 'more';
this.page = 1;
this.isInit = false;
this.list = [];
this.getRecommendList(true);
},
fail: err => {
}
});
// #endif
}
}
};
</script>
<style lang="scss" scoped>
.kaiqiweizhi-button {
padding: 8rpx 10rpx;
line-height: 1;
background-color: #64BF1D;
color: #fff;
font-size: 24rpx;
border-radius: 12rpx;
margin-left: 18rpx;
}
.kaiqiweizhi {
position: fixed;
left: 24rpx;
right: 24rpx;
width: calc(100% - 48rpx);
height: 80rpx;
line-height: 80rpx;
border-radius: 18rpx;
padding: 0 24rpx;
background: rgba(0, 0, 0, 0.8);
z-index: 999;
font-size: 24rpx;
color: #fff;
}
.page {
width: 100vw;
overflow-x: hidden;
min-height: calc(100vh - var(--window-bottom));
background: rgba(246, 247, 249, 1);
background-size: 100% auto !important;
}
.activityList_flex_0 {
background: #fff;
width: 750rpx;
height: 88rpx;
overflow: hidden;
z-index: 10;
top: 0rpx;
background-size: 100% auto !important;
}
.activityList_fd0_0_c0_c0 {
font-size: 36rpx;
font-weight: 500;
color: #333;
line-height: 88rpx;
}
.activityList_fd0_0 {
margin: 0rpx 32rpx 0rpx 32rpx;
}
.activityList_flex_1 {
padding: 24rpx 24rpx 0rpx 24rpx;
}
.activityList_fd1_0_c1_c1_c1 {
color: #333333;
font-size: 24rpx;
font-weight: 400;
line-height: 24rpx;
}
.activityList_fd1_0_c1_c1_c0 {
color: #333333;
font-size: 24rpx;
font-weight: 400;
line-height: 24rpx;
}
.activityList_fd1_0_c1_c1 {
margin: 20rpx 0rpx 0rpx 0rpx;
}
.activityList_fd1_0_c1_c0_c1_c1 {
// width: 0;
flex: 1;
line-height: 30rpx;
font-size: 24rpx;
font-weight: 400;
color: #333333;
-webkit-line-clamp: 1;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
// max-width: 475rpx;
}
.activityList_fd1_0_c1_c0_c1_c0 {
width: 20rpx;
height: 24rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin: 0rpx 8rpx 0rpx 0rpx;
}
.activityList_fd1_0_c1_c0_c1 {
margin: 16rpx 0rpx 0rpx 0rpx;
}
.activityList_fd1_0_c1_c0_c0_c0 {
color: #333333;
font-size: 32rpx;
font-weight: 600;
line-height: 50rpx;
}
.activityList_fd1_0_c1 {
margin: 0rpx 0rpx 0rpx 24rpx;
}
.activityList_fd1_0_c0_c1_c0 {
width: 180rpx;
height: 180rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
}
.activityList_fd1_0_c0_c0_c2 {
color: #FFFFFF;
font-size: 20rpx;
font-weight: 500;
line-height: 36rpx;
}
.activityList_fd1_0_c0_c0_c1 {
color: #FFFFFF;
font-size: 20rpx;
font-weight: 500;
line-height: 36rpx;
}
.activityList_fd1_0_c0_c0_c0 {
color: #FFFFFF;
font-size: 20rpx;
font-weight: 500;
line-height: 36rpx;
}
.activityList_fd1_0_c0_c0 {
background: url(https://lvtai-files.oss-cn-beijing.aliyuncs.com/mini/23.png) no-repeat, rgba(255, 162, 31, 1);
width: 128rpx;
height: 36rpx;
background-size: 100% auto !important;
border-radius: 16rpx 0rpx 24rpx 0rpx;
position: absolute;
z-index: 10;
}
.activityList_fd1_0 {
background: rgba(255, 255, 255, 1);
margin: 0rpx 0rpx 24rpx 0rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
background-size: 100% auto !important;
padding: 24rpx 24rpx 24rpx 24rpx;
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,751 @@
<template>
<view class="page" :style="themeColor">
<!-- <view class="flex benben-position-layout flex flex-wrap align-center nearbyMerchants_flex_0"
:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
<view class='flex flex-wrap align-center justify-between flex-sub nearbyMerchants_fd0_0'>
<view class='flex flex-wrap align-stretch justify-center flex-sub'>
<text class='nearbyMerchants_fd0_0_c0_c0'>附近商家</text>
</view>
</view>
</view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view> -->
<!---flex布局flex布局开始-->
<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout nearbyMerchants_flex_1">
<view class='flex flex-wrap align-center justify-between'>
<view class='flex flex-wrap align-center flex-sub nearbyMerchants_fd1_0_c0'>
<image class='nearbyMerchants_fd1_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"53.png"'></image>
<input type="text" placeholder="请输入商家名称" confirm-type="done" :maxlength="-1"
placeholder-style="color:rgba(153, 153, 153, 1);font-size:28rpx" v-model="fd1_0_c0_c1" />
</view>
<text class='nearbyMerchants_fd1_0_c1'>搜索</text>
</view>
<view class='flex flex-wrap align-center justify-around nearbyMerchants_fd1_1'>
<view class='flex flex-wrap align-center justify-center nearbyMerchants_fd1_1_c0'
@tap.stop="stateFunctionFunc()">
<text class='nearbyMerchants_fd1_1_c0_c0' v-if="state=='1'"
@tap.stop="pickerDiy1684578784573=true">{{screeningMerchants_id}}</text><text
class='nearbyMerchants_fd1_1_c0_c0_1' v-if="state=='2'"
@tap.stop="pickerDiy1684578784573=true">{{screeningMerchants_id}}</text>
<image class='nearbyMerchants_fd1_1_c0_c1' :src='STATIC_URL+"92.png"' v-if="state=='1'"></image>
<image class='nearbyMerchants_fd1_1_c0_c1_1' :src='STATIC_URL+"93.png"' v-if="state=='2'"></image>
</view>
<view class='flex nearbyMerchants_fd1_1_c1'></view>
<view class='flex flex-wrap align-center justify-center nearbyMerchants_fd1_1_c2'
@tap.stop="stateFunctionFunc()">
<text class='nearbyMerchants_fd1_1_c2_c0' v-if="state=='1'"
@tap.stop="pickerDiy1684579546665=true">{{filterDistance_id}}</text><text
class='nearbyMerchants_fd1_1_c2_c0_1' v-if="state=='2'"
@tap.stop="pickerDiy1684579546665=true">{{filterDistance_id}}</text>
<image class='nearbyMerchants_fd1_1_c2_c1' :src='STATIC_URL+"93.png"' v-if="state=='1'"></image>
<image class='nearbyMerchants_fd1_1_c2_c1_1' :src='STATIC_URL+"92.png"' v-if="state=='2'"></image>
</view>
</view>
</view>
<!---flex布局flex布局结束-->
<!---flex布局flex布局开始-->
<!-- <view class="flex benben-flex-layout flex-wrap align-center nearbyMerchants_flex_2">
</view> -->
<block>
<map style="width: 750rpx; height: 200px;" :latitude="lat" :longitude="lng" scale="13" :markers="covers"></map>
</block>
<!---flex布局flex布局结束-->
<!---flex布局flex布局开始-->
<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout nearbyMerchants_flex_3">
<view class='flex flex-wrap align-center nearbyMerchants_fd3_0' v-for="(item, index) in list" :key="index">
<view class='flex flex-direction flex-wrap align-start'>
<view class='flex flex-wrap align-center justify-center nearbyMerchants_fd3_0_c0_c0'>
<text class='nearbyMerchants_fd3_0_c0_c0_c0'>积分</text>
<text class='nearbyMerchants_fd3_0_c0_c0_c1'>{{item.score_rate}}</text>
<text class='nearbyMerchants_fd3_0_c0_c0_c2'>%</text>
</view>
<view class='flex flex-wrap align-center'>
<image class='nearbyMerchants_fd3_0_c0_c1_c0' mode="aspectFill" :src='item.logo'></image>
</view>
</view>
<view class='flex flex-direction flex-wrap align-stretch flex-sub nearbyMerchants_fd3_0_c1'>
<view class='flex flex-wrap align-center justify-between'>
<view class='flex flex-wrap align-center'>
<text class='nearbyMerchants_fd3_0_c1_c0_c0_c0'>{{item.store_name}}</text>
</view>
<view class='flex flex-wrap align-center justify-center nearbyMerchants_fd3_0_c1_c0_c1'>
<image class='nearbyMerchants_fd3_0_c1_c0_c1_c0' mode="aspectFit" :src='STATIC_URL+"95.png"'></image>
<text class='nearbyMerchants_fd3_0_c1_c0_c1_c1'>到这里</text>
</view>
</view>
<view class='flex flex-wrap align-center nearbyMerchants_fd3_0_c1_c1'>
<image class='nearbyMerchants_fd3_0_c1_c1_c0' mode="aspectFit" :src='STATIC_URL+"31.png"'></image>
<text class='nearbyMerchants_fd3_0_c1_c1_c1'>{{item.score}}</text>
<text class='nearbyMerchants_fd3_0_c1_c1_c2'></text>
</view>
<view class='flex flex-wrap align-center justify-between nearbyMerchants_fd3_0_c1_c2'>
<view class='flex flex-wrap align-center'>
<text class='nearbyMerchants_fd3_0_c1_c2_c0_c0'>关注人数</text>
<text class='nearbyMerchants_fd3_0_c1_c2_c0_c1'>{{item.collect_num}}</text>
</view>
<view class='flex flex-wrap align-center'>
<text class='nearbyMerchants_fd3_0_c1_c2_c1_c0'>人均</text>
<text class='nearbyMerchants_fd3_0_c1_c2_c1_c1'>{{item.per_capita}}</text>
</view>
</view>
<view class='flex flex-wrap align-center justify-between nearbyMerchants_fd3_0_c1_c3'>
<view class='flex flex-wrap align-center'>
<text class='nearbyMerchants_fd3_0_c1_c3_c0_c0'>起送¥</text>
<text class='nearbyMerchants_fd3_0_c1_c3_c0_c1'>{{item.start_price}} </text>
</view>
<view class='flex flex-wrap align-center'>
<text class='nearbyMerchants_fd3_0_c1_c3_c1_c0'>{{item.distance}}</text>
<text class='nearbyMerchants_fd3_0_c1_c3_c1_c1'>km</text>
</view>
</view>
</view>
</view>
</view>
<!---flex布局flex布局结束-->
<!--筛选全部商家开始 -->
<!-- <benben-picker ref="benbenWritePickerCodepicker4" :visible.sync="pickerDiy1684578784573"
:label.sync='screeningMerchants_id' :options='screeningMerchants_list' mode='selector' :mask-show='true'
:timeout='true' :picker-height='88' default-type='value' :default-props='{"label":"name","value":"value"}'>
<template #picker-header>
<view class='flex flex-wrap align-center justify-between nearbyMerchants_picker4_0'>
<text @tap="$refs.benbenWritePickerCodepicker4.cancel()">取消</text>
<text>筛选全部商家</text>
<text class='nearbyMerchants_picker4_0_c2' @tap="$refs.benbenWritePickerCodepicker4.pickerConfirm()">确认</text>
</view>
</template>
</benben-picker> -->
<!--筛选全部商家结束 -->
<!--筛选距离开始 -->
<!-- <benben-picker ref="benbenWritePickerCodepicker5" :visible.sync="pickerDiy1684579546665"
:label.sync='filterDistance_id' :options='filterDistance_list' mode='selector' :mask-show='true' :timeout='true'
:picker-height='88' default-type='value' :default-props='{"label":"name","value":"value"}'>
<template #picker-header>
<view class='flex flex-wrap align-center justify-between nearbyMerchants_picker5_0'>
<text @tap="$refs.benbenWritePickerCodepicker5.cancel()">取消</text>
<text>筛选距离</text>
<text class='nearbyMerchants_picker5_0_c2' @tap="$refs.benbenWritePickerCodepicker5.pickerConfirm()">确认</text>
</view>
</template>
</benben-picker> -->
<!--筛选距离结束 -->
</view>
</template>
<script>
import amap from '@/common/amap-wx.js';
import {
validate
} from '@/common/utils/validate.js'
export default {
components: {},
data() {
return {
"pickerDiy1684579546665": false,
"pickerDiy1684578784573": false,
"fd1_0_c0_c1": "",
"data": [],
"screeningMerchants_id": "全部商家",
"screeningMerchants_list": [{
"name": "全部商家",
"value": "1",
"image": ""
}, {
"name": "美食",
"value": "2",
"image": ""
}, {
"name": "便利商超",
"value": "3",
"image": ""
}, {
"name": "生鲜水果",
"value": "4",
"image": ""
}, {
"name": "酒水饮料",
"value": "5",
"image": ""
}, {
"name": "蛋糕甜品",
"value": "6",
"image": ""
}],
"filterDistance_id": "距离筛选",
"filterDistance_list": [{
"name": "不限",
"value": "1",
"image": ""
}, {
"name": "0.5KM",
"value": "2",
"image": ""
}, {
"name": "1KM-2KM",
"value": "3",
"image": ""
}, {
"name": "2KM-3KM",
"value": "4",
"image": ""
}, {
"name": "3KM-4KM",
"value": "5",
"image": ""
}, {
"name": "5KM以上",
"value": "6",
"image": ""
}],
"state": "1",
lat: '',
lng: '',
list: [],
isShowLoading: false,
isInit: false,
status: 'more', // 表示是否有数据可以请求
page: 1,
covers: [],
amapPlugin: null, //new地图
key: '886bfe2d6c32bd8eac97c2e6d821ed0b'
};
},
computed: {
themeColor() {
return this.$store.getters.themeColor
},
},
watch: {},
onLoad(options) {
this.amapPlugin = new amap.AMapWX({
key: this.key
});
},
onUnload() {
},
onReady() {
},
onShow() {
// #ifdef APP-PLUS
this._getPermission()
// #endif
// #ifndef APP-PLUS
this._getLocation()
// #endif
},
onHide() {
},
onResize() {
},
onPullDownRefresh() {
// #ifdef APP-PLUS
this._getPermission()
// #endif
// #ifndef APP-PLUS
this._getLocation()
// #endif
// this.$refs.guess && this.$refs.guess.refresh();
setTimeout(() => {
uni.stopPullDownRefresh();
}, 1000);
},
onReachBottom(e) {
this.getRecommendList();
},
onPageScroll(e) {
},
methods: {
/**
* 获取附近商家列表
* @param {Object} value
*/
getRecommendList(value) {
if (this.status != 'more') return;
this.status = 'loading';
let data = {
list_rows: 20,
page: this.page,
lat: this.lat,
lng: this.lng,
is_recommend: 0
};
// console.log('请求的数据', data);
if (this.page == 1 && value) {
this.isShowLoading = true;
}
this.$api
.post(global.apiUrls.getShopList, data)
.then(res => {
console.log('订单列表', res);
this.isShowLoading = false;
if (res.data.code == 1) {
var curPageData = res.data.data.data;
let covers = [];
curPageData.map((item) => {
covers.push({
latitude: item.address_lat,
longitude: item.address_lng,
iconPath: 'https://nongmangmang.oss-cn-qingdao.aliyuncs.com/uploads/images/20230522/2b835a1b9e763b62c44ae4b8b727a604.png?x-oss-process=image/resize,m_fixed,h_60,w_60/rounded-corners,r_40/format,png',
label: {
content: item.store_name
}
})
})
this.covers = covers;
if (this.page == 1) this.list = [];
this.list = this.list.concat(curPageData);
console.log('上拉加载', curPageData.length, this.size);
if (res.data.data.last_page > this.page) {
this.status = 'more';
this.page++;
} else {
this.status = 'noMore';
}
} else {
this.$message.info(res.data.msg);
}
this.isInit = true;
uni.stopPullDownRefresh();
})
.catch(err => {
this.isShowLoading = false;
uni.stopPullDownRefresh();
});
},
_getPermission() {
uni.getSystemInfo({
success: (res) => {
if (res.platform == 'android') {
let isLocation = uni.getStorageSync('LVTAI_USER_LOCATION') || false;
if (!isLocation) {
uni.showModal({
title: '温馨提示',
content: '我们需要获取您的定位权限以提供对应的服务',
// showCancel: false,
confirmText: '去获取',
success: res => {
if (res.confirm) {
this._getLocation();
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
} else {
this._getLocation();
}
} else {
this._getLocation();
}
}
});
},
// vue的method里编写如下代码
async requestAndroidPermission(permisionID) {
var permisionStatus = await permision.requestAndroidPermission(permisionID);
console.log(permisionStatus);
return permisionStatus;
},
_getLocation() {
// #ifdef H5
this.lat = '34.738695';
this.lng = '113.64328';
this.status = 'more';
this.page = 1;
this.isInit = false;
this.list = [];
this.address = '华城国际中心'
this.getRecommendList(true);
// #endif
// #ifdef APP-PLUS
this.amapPlugin.getRegeo({
success: res => {
console.log(res[0]);
uni.setStorageSync('LVTAI_USER_LOCATION', true);
this.address = res[0].regeocodeData.addressComponent.city;
this.lat = res[0].latitude;
this.lng = res[0].longitude;
this.status = 'more';
this.page = 1;
this.isInit = false;
this.list = [];
this.getRecommendList(true);
},
fail: err => {
}
});
// #endif
},
//切换状态
stateFunctionFunc() {
if (this.state == '1') {
this.state = '2';
} else if (this.state == '2') {
this.state = '1';
}
return
}
}
};
</script>
<style lang="scss" scoped>
.page {
width: 100vw;
overflow-x: hidden;
min-height: calc(100vh - var(--window-bottom));
background: rgba(246, 247, 249, 1);
background-size: 100% auto !important;
}
.nearbyMerchants_flex_0 {
background: rgba(255, 147, 0, 1);
width: 750rpx;
height: 88rpx;
overflow: hidden;
z-index: 10;
top: 0rpx;
background-size: 100% auto !important;
}
.nearbyMerchants_fd0_0_c0_c0 {
font-size: 36rpx;
font-weight: 500;
color: rgba(255, 255, 255, 1);
line-height: 88rpx;
}
.nearbyMerchants_fd0_0 {
margin: 0rpx 32rpx 0rpx 32rpx;
}
.nearbyMerchants_flex_1 {
background: rgba(255, 255, 255, 1);
padding: 24rpx 32rpx 0rpx 32rpx;
background-size: 100% auto !important;
}
.nearbyMerchants_fd1_1_c2_c1_1 {
width: 10rpx;
height: 6rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin: 0rpx 0rpx 0rpx 8rpx;
}
.nearbyMerchants_fd1_1_c2_c1 {
width: 10rpx;
height: 6rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin: 0rpx 0rpx 0rpx 8rpx;
}
.nearbyMerchants_fd1_1_c2_c0_1 {
color: rgba(51, 51, 51, 1);
font-size: 28rpx;
font-weight: 400;
line-height: 30rpx;
}
.nearbyMerchants_fd1_1_c2_c0 {
color: rgba(102, 102, 102, 1);
font-size: 28rpx;
font-weight: 400;
line-height: 30rpx;
}
.nearbyMerchants_fd1_1_c2 {
width: 200rpx;
height: 51rpx;
}
.nearbyMerchants_fd1_1_c1 {
background: rgba(238, 238, 238, 1);
width: 1rpx;
height: 40rpx;
transform: scaleX(0.5);
}
.nearbyMerchants_fd1_1_c0_c1_1 {
width: 10rpx;
height: 6rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin: 0rpx 0rpx 0rpx 8rpx;
}
.nearbyMerchants_fd1_1_c0_c1 {
width: 10rpx;
height: 6rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin: 0rpx 0rpx 0rpx 8rpx;
}
.nearbyMerchants_fd1_1_c0_c0_1 {
color: rgba(102, 102, 102, 1);
font-size: 28rpx;
font-weight: 500;
line-height: 30rpx;
}
.nearbyMerchants_fd1_1_c0_c0 {
color: #333333;
font-size: 28rpx;
font-weight: 500;
line-height: 30rpx;
}
.nearbyMerchants_fd1_1_c0 {
width: 200rpx;
height: 51rpx;
}
.nearbyMerchants_fd1_1 {
padding: 32rpx 0rpx 28rpx 0rpx;
}
.nearbyMerchants_fd1_0_c1 {
color: #333333;
font-size: 32rpx;
font-weight: 400;
line-height: 32rpx;
}
.nearbyMerchants_fd1_0_c0_c0 {
width: 28rpx;
height: 28rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin: 0rpx 16rpx 0rpx 0rpx;
}
.nearbyMerchants_fd1_0_c0 {
background: rgba(246, 247, 249, 1);
margin: 0rpx 32rpx 0rpx 0rpx;
border-radius: 32rpx 32rpx 32rpx 32rpx;
background-size: 100% auto !important;
padding: 12rpx 24rpx 12rpx 24rpx;
}
.nearbyMerchants_flex_2 {
background: url(https://lvtai-files.oss-cn-beijing.aliyuncs.com/mini/49.png) no-repeat, #eee;
background-size: 100% auto !important;
width: 750rpx;
height: 400rpx;
}
.nearbyMerchants_flex_3 {
padding: 32rpx 24rpx 0rpx 24rpx;
}
.nearbyMerchants_fd3_0_c1_c3_c1_c1 {
color: #999999;
font-size: 24rpx;
font-weight: 400;
line-height: 24rpx;
}
.nearbyMerchants_fd3_0_c1_c3_c1_c0 {
color: #999999;
font-size: 24rpx;
font-weight: 400;
line-height: 24rpx;
}
.nearbyMerchants_fd3_0_c1_c3_c0_c1 {
color: #333333;
font-size: 24rpx;
font-weight: 400;
line-height: 24rpx;
}
.nearbyMerchants_fd3_0_c1_c3_c0_c0 {
color: #333333;
font-size: 24rpx;
font-weight: 400;
line-height: 24rpx;
}
.nearbyMerchants_fd3_0_c1_c3 {
margin: 18rpx 20rpx 0rpx 0rpx;
}
.nearbyMerchants_fd3_0_c1_c2_c1_c1 {
color: #333333;
font-size: 24rpx;
font-weight: 400;
line-height: 24rpx;
}
.nearbyMerchants_fd3_0_c1_c2_c1_c0 {
color: #333333;
font-size: 24rpx;
font-weight: 400;
line-height: 24rpx;
}
.nearbyMerchants_fd3_0_c1_c2_c0_c1 {
color: #333333;
font-size: 24rpx;
font-weight: 400;
line-height: 24rpx;
}
.nearbyMerchants_fd3_0_c1_c2_c0_c0 {
color: #333333;
font-size: 24rpx;
font-weight: 400;
line-height: 24rpx;
}
.nearbyMerchants_fd3_0_c1_c2 {
margin: 18rpx 20rpx 0rpx 0rpx;
}
.nearbyMerchants_fd3_0_c1_c1_c2 {
color: #FF9D00;
font-size: 28rpx;
font-weight: 700;
line-height: 30rpx;
}
.nearbyMerchants_fd3_0_c1_c1_c1 {
color: #FF9D00;
font-size: 28rpx;
font-weight: 700;
line-height: 30rpx;
}
.nearbyMerchants_fd3_0_c1_c1_c0 {
width: 20rpx;
height: 19rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin: 0rpx 8rpx 0rpx 0rpx;
}
.nearbyMerchants_fd3_0_c1_c1 {
margin: 18rpx 0rpx 0rpx 0rpx;
}
.nearbyMerchants_fd3_0_c1_c0_c1_c1 {
color: #FFFFFF;
font-size: 24rpx;
font-weight: 400;
line-height: 40rpx;
}
.nearbyMerchants_fd3_0_c1_c0_c1_c0 {
width: 24rpx;
height: 24rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin: 0rpx 4rpx 0rpx 0rpx;
}
.nearbyMerchants_fd3_0_c1_c0_c1 {
background: url(https://lvtai-files.oss-cn-beijing.aliyuncs.com/mini/94.png) no-repeat, #eee;
width: 128rpx;
height: 40rpx;
border-radius: 50rpx 0rpx 0rpx 50rpx;
background-size: 100% auto !important;
}
.nearbyMerchants_fd3_0_c1_c0_c0_c0 {
color: #333333;
font-size: 32rpx;
font-weight: 600;
line-height: 32rpx;
}
.nearbyMerchants_fd3_0_c1 {
margin: 0rpx 0rpx 0rpx 24rpx;
}
.nearbyMerchants_fd3_0_c0_c1_c0 {
width: 180rpx;
height: 180rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
}
.nearbyMerchants_fd3_0_c0_c0_c2 {
color: #FFFFFF;
font-size: 20rpx;
font-weight: 500;
line-height: 36rpx;
}
.nearbyMerchants_fd3_0_c0_c0_c1 {
color: #FFFFFF;
font-size: 20rpx;
font-weight: 500;
line-height: 36rpx;
}
.nearbyMerchants_fd3_0_c0_c0_c0 {
color: #FFFFFF;
font-size: 20rpx;
font-weight: 500;
line-height: 36rpx;
}
.nearbyMerchants_fd3_0_c0_c0 {
background: url(https://lvtai-files.oss-cn-beijing.aliyuncs.com/mini/23.png) no-repeat, rgba(255, 162, 31, 1);
width: 128rpx;
height: 36rpx;
background-size: 100% auto !important;
border-radius: 16rpx 0rpx 24rpx 0rpx;
position: absolute;
z-index: 10;
}
.nearbyMerchants_fd3_0 {
background: rgba(255, 255, 255, 1);
margin: 0rpx 0rpx 24rpx 0rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
background-size: 100% auto !important;
padding: 24rpx 0rpx 24rpx 24rpx;
}
.nearbyMerchants_picker4_0_c2 {
color: #4781f5;
}
.nearbyMerchants_picker4_0 {
border-bottom: 1px solid #eee;
background: #fff;
padding: 0rpx 32rpx 0rpx 32rpx;
line-height: 88rpx;
border-radius: 25rpx 25rpx 0rpx 0rpx;
background-size: 100% auto !important;
}
.nearbyMerchants_picker5_0_c2 {
color: #4781f5;
}
.nearbyMerchants_picker5_0 {
border-bottom: 1px solid #eee;
background: #fff;
padding: 0rpx 32rpx 0rpx 32rpx;
line-height: 88rpx;
border-radius: 25rpx 25rpx 0rpx 0rpx;
background-size: 100% auto !important;
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff