|
@@ -1,24 +1,34 @@
|
|
<template>
|
|
<template>
|
|
- <view class="main-content">
|
|
|
|
- <view class="home-banner" :style="`height: ${globalData.navBarHeight}px `">
|
|
|
|
|
|
+ <view>
|
|
|
|
+ <!-- 首页顶部定位区域 -->
|
|
|
|
+ <view class="home-banner">
|
|
<view class="home-banner-left" @click="cityClick">
|
|
<view class="home-banner-left" @click="cityClick">
|
|
- <up-icon name="map" color="#000" size="25"></up-icon>
|
|
|
|
|
|
+ <img src="@/static/uview/common/map-pin-fill@1x.png" alt="" class="map-pin-fill">
|
|
<text class="address-text">{{ data.address.name }}</text>
|
|
<text class="address-text">{{ data.address.name }}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
- <view class="home-box" :style="`margin-top: ${globalData.navBarHeight}px `">
|
|
|
|
- <view class="home-main">
|
|
|
|
- <view class="custom-swiper" v-if="list3.length > 0">
|
|
|
|
- <up-swiper :list="list3" indicator indicatorMode="line" circular :height="'554rpx'"></up-swiper>
|
|
|
|
- </view>
|
|
|
|
|
|
+ <!-- 首页顶部区域-轮播图 -->
|
|
|
|
+ <view class="home-main">
|
|
|
|
+ <view class="custom-swiper" v-if="list3.length > 0">
|
|
|
|
+ <up-swiper :list="list3" indicator indicatorMode="line" circular :height="'554rpx'"></up-swiper>
|
|
</view>
|
|
</view>
|
|
|
|
+ </view>
|
|
|
|
|
|
|
|
+ <!-- 首页顶部区域-服务分类 -->
|
|
|
|
+ <view class="Wrapper-Top">
|
|
<view class="home-grid">
|
|
<view class="home-grid">
|
|
<Client />
|
|
<Client />
|
|
</view>
|
|
</view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ <view class="home-swiper">
|
|
|
|
+ <view v-if="ValueZone.length > 0">
|
|
|
|
+ <up-swiper :list="ValueZone" :indicator="false" indicatorMode="line" circular></up-swiper>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
|
|
- <view class="home-grid hot-box" v-if="userType === 1">
|
|
|
|
|
|
+ <!-- <view class="home-grid hot-box" v-if="userType === 1">
|
|
<view
|
|
<view
|
|
v-for="(item, index) in hotList"
|
|
v-for="(item, index) in hotList"
|
|
:key="index + 'hot'"
|
|
:key="index + 'hot'"
|
|
@@ -27,63 +37,37 @@
|
|
<img :src="item" alt="" style="width: 100%; height: 160rpx" />
|
|
<img :src="item" alt="" style="width: 100%; height: 160rpx" />
|
|
</view>
|
|
</view>
|
|
|
|
|
|
- </view>
|
|
|
|
- <view>
|
|
|
|
- <up-notice-bar :text="text1"></up-notice-bar>
|
|
|
|
- </view>
|
|
|
|
-
|
|
|
|
- <view class="home-g-bgc">
|
|
|
|
- <view class="home-grid2">
|
|
|
|
- <view class="serve-title hot-box-title" v-if="userType === 1"
|
|
|
|
- >超值专区</view
|
|
|
|
- >
|
|
|
|
- <view class="hot-swiper" v-if="ValueZone.length > 0">
|
|
|
|
- <up-swiper
|
|
|
|
- :list="ValueZone"
|
|
|
|
- :indicator="false"
|
|
|
|
- indicatorMode="line"
|
|
|
|
- circular
|
|
|
|
- ></up-swiper>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
|
|
+ </view> -->
|
|
|
|
|
|
- <view class="home-ranking home-grid2">
|
|
|
|
-
|
|
|
|
- <ServIces
|
|
|
|
- :leftList="leftList"
|
|
|
|
- :rightList="rightList"
|
|
|
|
- v-if="userType === 1"
|
|
|
|
- ></ServIces>
|
|
|
|
- <RankingList v-if="userType === 2" />
|
|
|
|
- </view>
|
|
|
|
|
|
+ <!-- <view class="hot-swiper">
|
|
|
|
+ <view v-if="ValueZone.length > 0">
|
|
|
|
+ <up-swiper :list="ValueZone" :indicator="false" indicatorMode="line" circular></up-swiper>
|
|
</view>
|
|
</view>
|
|
|
|
+ </view> -->
|
|
|
|
|
|
- <up-loadmore
|
|
|
|
- style="margin-top: 40rpx"
|
|
|
|
- :status="loadmoreInfo.status"
|
|
|
|
- :loadmoreText="loadmoreInfo.loadingText"
|
|
|
|
- :loadingText="loadmoreInfo.loadmoreText"
|
|
|
|
- :nomoreText="loadmoreInfo.nomoreText"
|
|
|
|
- @loadmore="handleLoadmore"
|
|
|
|
- v-if="userType == 1"
|
|
|
|
- />
|
|
|
|
|
|
+
|
|
|
|
+ <view class="home-ranking">
|
|
|
|
+ <ServIces :leftList="leftList" :rightList="rightList" :ValueZoneSwiper="ValueZoneSwiper" v-if="userType == 1"></ServIces>
|
|
|
|
+ <!-- <RankingList v-if="userType === 2" /> -->
|
|
</view>
|
|
</view>
|
|
|
|
|
|
- <view class="Wrapper">
|
|
|
|
|
|
+ <!-- <up-loadmore style="margin-top: 40rpx" :status="loadmoreInfo.status" :loadmoreText="loadmoreInfo.loadingText"
|
|
|
|
+ :loadingText="loadmoreInfo.loadmoreText" :nomoreText="loadmoreInfo.nomoreText" @loadmore="handleLoadmore"
|
|
|
|
+ v-if="userType == 1" /> -->
|
|
|
|
+
|
|
|
|
+ <!-- <view class="Wrapper">
|
|
<view class="home-g-bgc">
|
|
<view class="home-g-bgc">
|
|
<Client />
|
|
<Client />
|
|
- </view>
|
|
|
|
-
|
|
|
|
|
|
+ </view> -->
|
|
|
|
+ <!--
|
|
<view class="hot-swiper" v-if="ValueZone.length > 0">
|
|
<view class="hot-swiper" v-if="ValueZone.length > 0">
|
|
<up-swiper :list="ValueZone" :indicator="false" indicatorMode="line" circular></up-swiper>
|
|
<up-swiper :list="ValueZone" :indicator="false" indicatorMode="line" circular></up-swiper>
|
|
- </view>
|
|
|
|
|
|
+ </view> -->
|
|
|
|
|
|
- <view class="home-ranking">
|
|
|
|
|
|
+ <!-- <view class="home-ranking">
|
|
<ServIces :leftList="leftList" :rightList="rightList" v-if="userType == 1"></ServIces>
|
|
<ServIces :leftList="leftList" :rightList="rightList" v-if="userType == 1"></ServIces>
|
|
<RankingList v-if="userType === 2" />
|
|
<RankingList v-if="userType === 2" />
|
|
- </view>
|
|
|
|
-
|
|
|
|
- </view>
|
|
|
|
|
|
+ </view> -->
|
|
<custom-tab-bar page="home" class="customTabBar" />
|
|
<custom-tab-bar page="home" class="customTabBar" />
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -108,10 +92,9 @@ const leftList = ref([])
|
|
const list3 = ref(['']) // Initialize with at least one empty item
|
|
const list3 = ref(['']) // Initialize with at least one empty item
|
|
const ValueZone = ref(['']) // Initialize with at least one empty item
|
|
const ValueZone = ref(['']) // Initialize with at least one empty item
|
|
const hotList = ref([])
|
|
const hotList = ref([])
|
|
|
|
+const ValueZoneSwiper = ref([''])
|
|
const userType = uni.getStorageSync('userType'); //读取本地存储
|
|
const userType = uni.getStorageSync('userType'); //读取本地存储
|
|
-const text1 = ref(
|
|
|
|
- '热烈祝贺:于5月20日上午9:00点钟召开"金邻助家"平台项目的首次发布会!'
|
|
|
|
-)
|
|
|
|
|
|
+
|
|
const globalData = ref({
|
|
const globalData = ref({
|
|
statusBarHeight: 47,
|
|
statusBarHeight: 47,
|
|
navBarHeight: 91,
|
|
navBarHeight: 91,
|
|
@@ -202,8 +185,8 @@ const getList = async () => {
|
|
res.rows.forEach((item, index) => {
|
|
res.rows.forEach((item, index) => {
|
|
index % 2 !== 0 ? leftList.value.push(item) : rightList.value.push(item)
|
|
index % 2 !== 0 ? leftList.value.push(item) : rightList.value.push(item)
|
|
})
|
|
})
|
|
- console.log('home',leftList.value,rightList.value);
|
|
|
|
-
|
|
|
|
|
|
+ console.log('home', leftList.value, rightList.value);
|
|
|
|
+
|
|
pages.value.total = res.total
|
|
pages.value.total = res.total
|
|
if (pages.value.current >= Math.ceil(res.total / pages.value.pageSize)) {
|
|
if (pages.value.current >= Math.ceil(res.total / pages.value.pageSize)) {
|
|
loadmoreInfo.value.status = 'nomore'
|
|
loadmoreInfo.value.status = 'nomore'
|
|
@@ -245,6 +228,10 @@ const getBanners = async () => {
|
|
if (hot_res.code === 200 && hot_res.data.picture) {
|
|
if (hot_res.code === 200 && hot_res.data.picture) {
|
|
hotList.value = hot_res.data.picture.split(',')
|
|
hotList.value = hot_res.data.picture.split(',')
|
|
}
|
|
}
|
|
|
|
+ const hot_node = await slideshow(22)
|
|
|
|
+ if (hot_node.code === 200 && hot_node.data.picture) {
|
|
|
|
+ ValueZoneSwiper.value = hot_node.data.picture.split(',')
|
|
|
|
+ }
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.log('error', error)
|
|
console.log('error', error)
|
|
}
|
|
}
|
|
@@ -270,7 +257,7 @@ const settingAddress = async () => {
|
|
latitude,
|
|
latitude,
|
|
longitude,
|
|
longitude,
|
|
}
|
|
}
|
|
- console.log("TCL: settingAddress -> parmas", parmas);
|
|
|
|
|
|
+ console.log("TCL: settingAddress -> parmas", parmas);
|
|
const res = await settingHomeAddress(parmas)
|
|
const res = await settingHomeAddress(parmas)
|
|
userType === 1 && getList()
|
|
userType === 1 && getList()
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -296,26 +283,26 @@ onShow(() => {
|
|
const addresstree = ref([])
|
|
const addresstree = ref([])
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
-
|
|
|
|
- const token = getToken();
|
|
|
|
- console.log("TCL: token", token ||'null')
|
|
|
|
- if(token){
|
|
|
|
|
|
+
|
|
|
|
+ const token = getToken();
|
|
|
|
+ console.log("TCL: token", token || 'null')
|
|
|
|
+ if (token) {
|
|
const res_dara = await regionAddresstree()
|
|
const res_dara = await regionAddresstree()
|
|
addresstree.value = res_dara.data
|
|
addresstree.value = res_dara.data
|
|
locateTheCurrentAddress(res_dara.data)
|
|
locateTheCurrentAddress(res_dara.data)
|
|
- .then((res) => {
|
|
|
|
- console.log('locateTheCurrentAddress', res)
|
|
|
|
- data.address = res
|
|
|
|
- settingAddress()
|
|
|
|
- })
|
|
|
|
- .catch((error) => {
|
|
|
|
- console.log('获取地址失败!', error)
|
|
|
|
- getList()
|
|
|
|
- })
|
|
|
|
- }else{
|
|
|
|
- //设置默认角色
|
|
|
|
- uni.setStorageSync('userType', 1);
|
|
|
|
- getList();
|
|
|
|
|
|
+ .then((res) => {
|
|
|
|
+ console.log('locateTheCurrentAddress', res)
|
|
|
|
+ data.address = res
|
|
|
|
+ settingAddress()
|
|
|
|
+ })
|
|
|
|
+ .catch((error) => {
|
|
|
|
+ console.log('获取地址失败!', error)
|
|
|
|
+ getList()
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ //设置默认角色
|
|
|
|
+ uni.setStorageSync('userType', 1);
|
|
|
|
+ getList();
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
@@ -323,118 +310,54 @@ onUnload(() => { })
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
-.customTabBar {
|
|
|
|
- position: fixed;
|
|
|
|
- left: 0;
|
|
|
|
- right: 0;
|
|
|
|
- bottom: 0;
|
|
|
|
- z-index: 9999;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
|
|
+// 首页顶部区域-轮播图
|
|
.home-banner {
|
|
.home-banner {
|
|
- display: flex;
|
|
|
|
- align-items: flex-end;
|
|
|
|
- justify-content: space-between;
|
|
|
|
- padding: 20rpx 16rpx;
|
|
|
|
- color: #fff;
|
|
|
|
- // position: fixed;
|
|
|
|
- // top: 0px;
|
|
|
|
- // left: 0px;
|
|
|
|
- // right: 0;
|
|
|
|
- z-index: 99;
|
|
|
|
- // bottom: 150rpx;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-.home-box {
|
|
|
|
- padding-bottom: 150rpx;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-.home-banner-left {
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- width: 30%;
|
|
|
|
- z-index: 110;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-.Wrapper {
|
|
|
|
- background: rgba(255, 255, 255, 1);
|
|
|
|
- // background: red;
|
|
|
|
position: absolute;
|
|
position: absolute;
|
|
- top: 309px;
|
|
|
|
- left: 0;
|
|
|
|
- right: 0;
|
|
|
|
- bottom: 0;
|
|
|
|
- border-radius: 20rpx 20rpx 0rpx 0rpx;
|
|
|
|
z-index: 130;
|
|
z-index: 130;
|
|
-}
|
|
|
|
|
|
|
|
-.home-main {
|
|
|
|
- padding: 12px 16px 0;
|
|
|
|
- z-index: 99;
|
|
|
|
-}
|
|
|
|
|
|
+ // top: 110rpx;
|
|
|
|
+ .home-banner-left {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
|
|
-.home-ranking {
|
|
|
|
- padding: 24rpx 16px;
|
|
|
|
-}
|
|
|
|
|
|
+ .map-pin-fill {
|
|
|
|
+ width: 34rpx;
|
|
|
|
+ height: 34rpx;
|
|
|
|
+ }
|
|
|
|
|
|
-.hot-box-title {
|
|
|
|
- margin-top: 24rpx;
|
|
|
|
- padding: 0 32rpx;
|
|
|
|
|
|
+ .address-text {
|
|
|
|
+ width: 178rpx;
|
|
|
|
+ height: 42rpx;
|
|
|
|
+ font-family: PingFang SC;
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
+ font-weight: normal;
|
|
|
|
+ line-height: 40rpx;
|
|
|
|
+ letter-spacing: normal;
|
|
|
|
+ color: #000000;
|
|
|
|
+ max-width: 120rpx;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
-.hot-swiper {
|
|
|
|
- // padding: 24rpx 32rpx 0;
|
|
|
|
|
|
+// 分类下轮播图
|
|
|
|
+.home-swiper {
|
|
|
|
+ margin-top: 40rpx;
|
|
|
|
+ margin-right: 23rpx;
|
|
|
|
+ margin-left: 23rpx;
|
|
width: 704rpx;
|
|
width: 704rpx;
|
|
height: 180rpx;
|
|
height: 180rpx;
|
|
border-radius: 16rpx;
|
|
border-radius: 16rpx;
|
|
background: linear-gradient(180deg, #FEF9ED 0%, #FFF9F3 100%);
|
|
background: linear-gradient(180deg, #FEF9ED 0%, #FFF9F3 100%);
|
|
- margin-top: 40rpx;
|
|
|
|
- margin-right: 23rpx;
|
|
|
|
- margin-left: 23rpx;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-.hot-box {
|
|
|
|
- padding: 24rpx 32rpx;
|
|
|
|
- display: grid;
|
|
|
|
- grid-template-columns: repeat(2, 1fr);
|
|
|
|
- gap: 8rpx;
|
|
|
|
-
|
|
|
|
- .hot-item {
|
|
|
|
- // padding: 32rpx 16rpx;
|
|
|
|
- // border-radius: 10rpx;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-.home-grid {
|
|
|
|
- margin-top: 220rpx;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-.home-g-bgc {
|
|
|
|
- background: rgba(255, 255, 255, 1);
|
|
|
|
- padding: -2rpx;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-.custom-swiper {
|
|
|
|
- width: 750rpx;
|
|
|
|
- height: 554rpx;
|
|
|
|
- // position: fixed;
|
|
|
|
- position: absolute;
|
|
|
|
- top: 0px;
|
|
|
|
- left: 0px;
|
|
|
|
- right: 0;
|
|
|
|
- z-index: 99;
|
|
|
|
- // background: red; // 移除测试色
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-.address-text {
|
|
|
|
- white-space: nowrap;
|
|
|
|
- /* 禁止换行 */
|
|
|
|
- overflow: hidden;
|
|
|
|
- /* 隐藏溢出内容 */
|
|
|
|
- text-overflow: ellipsis;
|
|
|
|
- /* 超出部分显示省略号 */
|
|
|
|
- color: #000;
|
|
|
|
|
|
+// 瀑布流
|
|
|
|
+.home-ranking {
|
|
|
|
+ margin-top: 80rpx;
|
|
|
|
+ margin-left: 25rpx;
|
|
|
|
+ margin-right: 25rpx;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|