|
@@ -2,14 +2,11 @@
|
|
|
<view class="main-content">
|
|
|
<view class="home-banner" :style="`height: ${globalData.navBarHeight}px `">
|
|
|
<view class="home-banner-left" @click="cityClick">
|
|
|
- <up-icon name="map" color="#fff" size="25"></up-icon>
|
|
|
+ <up-icon name="map" color="#000" size="25"></up-icon>
|
|
|
<text class="address-text">{{ data.address.name }}</text>
|
|
|
</view>
|
|
|
- <view class="home-banner-cente">金邻助家</view>
|
|
|
- <view class="home-banner-rigth">
|
|
|
- <!-- <up-icon name="bell" :size="25" color="rgba(46, 46, 46, 1)"></up-icon> -->
|
|
|
- </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">
|
|
@@ -18,33 +15,27 @@
|
|
|
indicator
|
|
|
indicatorMode="line"
|
|
|
circular
|
|
|
+ :height="'554rpx'"
|
|
|
></up-swiper>
|
|
|
</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>
|
|
|
|
|
|
- <view class="home-grid">
|
|
|
+ <view class="Wrapper">
|
|
|
+ <view class="home-g-bgc">
|
|
|
<Client />
|
|
|
</view>
|
|
|
|
|
|
- <view class="home-grid hot-box" v-if="userType === 1">
|
|
|
- <view
|
|
|
- v-for="(item, index) in hotList"
|
|
|
- :key="index + 'hot'"
|
|
|
- class="hot-item"
|
|
|
- >
|
|
|
- <img :src="item" alt="" style="width: 100%; height: 160rpx" />
|
|
|
- </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"
|
|
@@ -54,7 +45,7 @@
|
|
|
></up-swiper>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="home-ranking home-grid2">
|
|
|
<ServIces
|
|
|
:leftList="leftList"
|
|
@@ -63,19 +54,8 @@
|
|
|
></ServIces>
|
|
|
<RankingList v-if="userType === 2" />
|
|
|
</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>
|
|
|
-
|
|
|
<custom-tab-bar page="home" />
|
|
|
</view>
|
|
|
</template>
|
|
@@ -97,8 +77,8 @@ import { getToken } from '@/utils/auth'
|
|
|
|
|
|
const rightList = ref([])
|
|
|
const leftList = ref([])
|
|
|
-const list3 = ref(['']) // Initialize with at least one empty item
|
|
|
-const ValueZone = 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 hotList = ref([])
|
|
|
const userType = uni.getStorageSync('userType') //读取本地存储
|
|
|
const text1 = ref(
|
|
@@ -133,8 +113,11 @@ const pages = ref({
|
|
|
|
|
|
const cityClick = async () => {
|
|
|
const { latitude, longitude } = data.address
|
|
|
- const address = await chooseLocationInit({ latitude, longitude },addresstree.value)
|
|
|
- console.log("TCL: cityClick -> address", address)
|
|
|
+ const address = await chooseLocationInit(
|
|
|
+ { latitude, longitude },
|
|
|
+ addresstree.value
|
|
|
+ )
|
|
|
+ console.log('TCL: cityClick -> address', address)
|
|
|
data.address = { ...data.address, ...address }
|
|
|
settingAddress()
|
|
|
console.log('address', address)
|
|
@@ -241,7 +224,7 @@ const settingAddress = async () => {
|
|
|
try {
|
|
|
console.log('data', data)
|
|
|
|
|
|
- const { address } = data;
|
|
|
+ const { address } = data
|
|
|
const { cityCode, latitude, longitude } = address
|
|
|
const parmas = {
|
|
|
provinceName: cityCode.data[0], // 省
|
|
@@ -281,31 +264,27 @@ onShow(() => {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
-const addresstree = ref([]);
|
|
|
+const addresstree = ref([])
|
|
|
|
|
|
onMounted(async () => {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- const token = getToken();
|
|
|
- if(token){
|
|
|
+ const token = getToken()
|
|
|
+ if (token) {
|
|
|
const res_dara = await regionAddresstree()
|
|
|
- addresstree.value = res_dara.data;
|
|
|
+ addresstree.value = 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()
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -313,8 +292,7 @@ onUnload(() => {})
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
-.main-content {
|
|
|
- background: rgba(255, 255, 255, 1);
|
|
|
+
|
|
|
|
|
|
.home-banner {
|
|
|
display: flex;
|
|
@@ -322,12 +300,12 @@ onUnload(() => {})
|
|
|
justify-content: space-between;
|
|
|
// background: rgba(255, 255, 255, 1);
|
|
|
// background-color: #ED806A;
|
|
|
- background-color: rgba(221, 60, 62, 1);
|
|
|
- box-shadow: 0rpx 0rpx 0rpx rgba(0, 0, 0, 0), 0rpx 0rpx 0rpx rgba(0, 0, 0, 0),
|
|
|
- 0rpx 2.08rpx 4.17rpx rgba(0, 0, 0, 0.05);
|
|
|
+ // background-color: rgba(221, 60, 62, 1);
|
|
|
+ // box-shadow: 0rpx 0rpx 0rpx rgba(0, 0, 0, 0), 0rpx 0rpx 0rpx rgba(0, 0, 0, 0),
|
|
|
+ // 0rpx 2.08rpx 4.17rpx rgba(0, 0, 0, 0.05);
|
|
|
padding: 20rpx 16rpx;
|
|
|
color: #fff;
|
|
|
- position: fixed;
|
|
|
+ // position: fixed;
|
|
|
top: 0px;
|
|
|
left: 0px;
|
|
|
right: 0;
|
|
@@ -343,25 +321,29 @@ onUnload(() => {})
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
width: 30%;
|
|
|
+ z-index: 110;
|
|
|
}
|
|
|
|
|
|
- .home-banner-center {
|
|
|
- flex: 1;
|
|
|
- font-size: 38rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .home-banner-rigth {
|
|
|
- width: 30%;
|
|
|
- }
|
|
|
+ .Wrapper{
|
|
|
+ background: rgba(255, 255, 255, 1);
|
|
|
+ // background: red;
|
|
|
+ // position: absolute;
|
|
|
+ // top: 309px;
|
|
|
+ // left: 0;
|
|
|
+ // right: 0;
|
|
|
+ // bottom: 0;
|
|
|
+ border-radius: 20rpx 20rpx 0rpx 0rpx;
|
|
|
+ z-index: 130;
|
|
|
+}
|
|
|
|
|
|
.home-main {
|
|
|
padding: 12px 16px 0;
|
|
|
+ z-index: 99;
|
|
|
}
|
|
|
|
|
|
.home-ranking {
|
|
|
padding: 24rpx 16px;
|
|
|
}
|
|
|
-}
|
|
|
|
|
|
.hot-box-title {
|
|
|
padding: 0 32rpx;
|
|
@@ -383,18 +365,34 @@ onUnload(() => {})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-.home-grid2 {
|
|
|
- margin-bottom: 32rpx;
|
|
|
- background: #fff;
|
|
|
- padding: 12px 0;
|
|
|
- border-radius: 8px;
|
|
|
+.home-grid{
|
|
|
+ margin-top: 220rpx;
|
|
|
}
|
|
|
|
|
|
+// .home-grid2 {
|
|
|
+// margin-bottom: 32rpx;
|
|
|
+// background: #fff;
|
|
|
+// padding: 12px 0;
|
|
|
+// border-radius: 8px;
|
|
|
+// }
|
|
|
+
|
|
|
.home-g-bgc {
|
|
|
background: #f7f7f7;
|
|
|
padding: 24rpx;
|
|
|
}
|
|
|
|
|
|
+.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;
|
|
|
/* 禁止换行 */
|
|
@@ -402,5 +400,6 @@ onUnload(() => {})
|
|
|
/* 隐藏溢出内容 */
|
|
|
text-overflow: ellipsis;
|
|
|
/* 超出部分显示省略号 */
|
|
|
+ color: #000;
|
|
|
}
|
|
|
</style>
|