【类 型】:factor

【原  因】:1.首页有用户手机显示用户手机没有显示登录链接2.站长推荐模块3.从服务器获取banner列表 计算属性
【过  程】:
【影  响】:

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
szdot 2025-05-12 02:18:55 +08:00
parent f69f6e7c62
commit 1cd4d15bac

View File

@ -8,8 +8,11 @@
<u-avatar size="80rpx" :src="avatarSrc"></u-avatar>
</view>
<view class="flex1 m-l-24 flex mac h100">
<navigator open-type="redirect" url="/pages/main/login">
<view class="fb fz32">{{userInfo.tel}}</view>
<!-- 已登录只显示手机号 -->
<view v-if="userInfo.tel" class="fb fz32">{{ userInfo.tel }}</view>
<!-- 未登录显示请登录并跳转 -->
<navigator v-else open-type="redirect" url="/pages/main/login">
<view class="fb fz32">请登录</view>
</navigator>
<u-icon name="arrow-right"></u-icon>
</view>
@ -28,12 +31,39 @@
</view> -->
<!-- 主按钮 -->
<view class="flex mse" style="margin-top: 30rpx;">
<mainBut url="/pages/shop/list" bg="#D43030" imgSrc="/static/icons/ordernow.svg" butBt="开始点餐" butSt="Order Now" />
<mainBut url="/pages/shop/list" bg="#FF8D1A" imgSrc="/static/icons/buggoods.svg" butBt="购买商品" butSt="Buy Goods" />
<mainBut url="/pages/shop/list" bg="#D43030" imgSrc="/static/icons/ordernow.svg" butBt="开始点餐"
butSt="Order Now" />
<mainBut url="/pages/shop/list" bg="#FF8D1A" imgSrc="/static/icons/buggoods.svg" butBt="购买商品"
butSt="Buy Goods" />
<!-- <mainBut bg="#FFC300" imgSrc="/static/icons/franchise.svg" butBt="项目介绍" butSt="Introduction" /> -->
</view>
<!-- 站长推荐 -->
<view class="flex mc">
<view class="flex recommendBox column mc">
<!-- 站长推荐标题 -->
<view class="flex recommendTit column">
<view class="flex recommendTitBut rad16 column mac">
<view class="flex w80 mse">
<view class="recommendTitButTiao" v-for="i in 11" :key="i"></view>
</view>
<view class="flex mc mac h100">
<view class="fz32 fb" style="color: #fff">站长推荐</view>
</view>
</view>
<view class="flex mse" style="height: 18rpx;width: 252rpx; ">
<view style="width:6rpx;background-color: #383838;" v-for="i in 2" :key="i"></view>
</view>
</view>
<!-- 站长推荐内容 -->
<swiper class="recommendSwiper" circular autoplay interval="6000">
<swiper-item v-for="(item, index) in recommendList" :key="index">
<!-- <view class="recommendSwiper-item rad8 h100 boxshadow m-l-12 m-r-12" ></view> -->
<listItem :spu="item">
</listItem>
</swiper-item>
</swiper>
</view>
</view>
<!-- tabbar -->
<view>
<tabbar></tabbar>
@ -50,9 +80,6 @@
data() {
return {
avatarSrc: "", //
bannerList: [{ //banner
url: '/static/banner1.png'
}],
}
},
computed: {
@ -62,8 +89,21 @@
//
orderList() {
return this.$store.state.orderList.filter(item => item.main_status === '已付款')
},
//spu
recommendList() {
return this.$store.state.spuList.filter(item => item.recommend === '1')
},
//banner
bannerList() {
return this.$store.state.bannerList
.filter(item => item.type === 'index')
.map(item => ({
url: item.photo
}))
}
},
watch: {},
created() {
//token
this.checkUserInfo()
@ -87,4 +127,36 @@
transform: translateX(-50%);
top: 494rpx;
}
.recommendBox {
width: 702rpx;
margin-top: 48rpx;
}
.recommendTit {
height: 90rpx;
}
.recommendTitBut {
width: 252rpx;
height: 72rpx;
background-color: $uni-color-error;
}
.recommendTitButTiao {
width: 8rpx;
height: 4rpx;
background-color: $uni-text-color-inverse;
}
.recommendSwiper {
width: 702rpx;
height: 224rpx;
}
.recommendSwiper-item {
background-color: $uni-bg-color;
width: 680rpx;
height: 184rpx;
}
</style>