|
@@ -13,9 +13,60 @@
|
|
|
<up-swiper :list="list3" 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 class="home-grid">
|
|
|
+ <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"
|
|
|
+ :indicator="false"
|
|
|
+ indicatorMode="line"
|
|
|
+ circular
|
|
|
+ ></up-swiper>
|
|
|
+ </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>
|
|
|
+
|
|
|
+ <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="Wrapper">
|
|
@@ -57,7 +108,7 @@ const leftList = ref([])
|
|
|
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 userType = uni.getStorageSync('userType'); //读取本地存储
|
|
|
const text1 = ref(
|
|
|
'热烈祝贺:于5月20日上午9:00点钟召开"金邻助家"平台项目的首次发布会!'
|
|
|
)
|
|
@@ -151,6 +202,8 @@ const getList = async () => {
|
|
|
res.rows.forEach((item, index) => {
|
|
|
index % 2 !== 0 ? leftList.value.push(item) : rightList.value.push(item)
|
|
|
})
|
|
|
+ console.log('home',leftList.value,rightList.value);
|
|
|
+
|
|
|
pages.value.total = res.total
|
|
|
if (pages.value.current >= Math.ceil(res.total / pages.value.pageSize)) {
|
|
|
loadmoreInfo.value.status = 'nomore'
|
|
@@ -217,8 +270,8 @@ const settingAddress = async () => {
|
|
|
latitude,
|
|
|
longitude,
|
|
|
}
|
|
|
+ console.log("TCL: settingAddress -> parmas", parmas);
|
|
|
const res = await settingHomeAddress(parmas)
|
|
|
- console.log('res', res)
|
|
|
userType === 1 && getList()
|
|
|
} catch (error) {
|
|
|
console.log('设置地址失败', error)
|
|
@@ -232,7 +285,6 @@ onShow(() => {
|
|
|
uni.getSystemInfo({
|
|
|
success: (res) => {
|
|
|
const statusBarHeight = res.statusBarHeight
|
|
|
- console.log('res', res)
|
|
|
|
|
|
const navBarHeight =
|
|
|
res.platform === 'android' ? 48 : 44 + res.statusBarHeight
|
|
@@ -244,24 +296,26 @@ onShow(() => {
|
|
|
const addresstree = ref([])
|
|
|
|
|
|
onMounted(async () => {
|
|
|
- const token = getToken()
|
|
|
- if (token) {
|
|
|
+
|
|
|
+ const token = getToken();
|
|
|
+ console.log("TCL: token", token ||'null')
|
|
|
+ if(token){
|
|
|
const res_dara = await regionAddresstree()
|
|
|
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();
|
|
|
}
|
|
|
})
|
|
|
|