2024-04-15 16:12:55 +08:00
|
|
|
|
<template>
|
2024-04-22 11:59:53 +08:00
|
|
|
|
<view class="vh100 flex column">
|
|
|
|
|
<!-- banner -->
|
|
|
|
|
<u-swiper :list="bannerList" keyName="url" :autoplay="true" height="616rpx"></u-swiper>
|
|
|
|
|
<!-- 登录框 -->
|
|
|
|
|
<view class="flex rad32 boxshadow loginBox mac">
|
|
|
|
|
<view class="m-l-24 w-80rpx h-80rpx">
|
|
|
|
|
<u-avatar size="80rpx" :src="avatarSrc"></u-avatar>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="flex1 m-l-24 flex mac h100">
|
2025-05-12 02:18:55 +08:00
|
|
|
|
<!-- 已登录:只显示手机号 -->
|
|
|
|
|
<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>
|
2024-05-23 14:05:10 +08:00
|
|
|
|
</navigator>
|
2024-04-22 11:59:53 +08:00
|
|
|
|
<u-icon name="arrow-right"></u-icon>
|
|
|
|
|
</view>
|
2025-01-15 13:19:43 +08:00
|
|
|
|
<navigator url="/pages/order/index">
|
2024-06-06 01:44:07 +08:00
|
|
|
|
<view class="flex column mc mac m-r-24 w-80rpx h-80rpx">
|
|
|
|
|
<u-icon size="48rpx" name="order"></u-icon>
|
|
|
|
|
<view class="fz24">订单</view>
|
|
|
|
|
</view>
|
|
|
|
|
</navigator>
|
2024-04-22 11:59:53 +08:00
|
|
|
|
</view>
|
2024-06-12 18:43:35 +08:00
|
|
|
|
<!-- 新订单 提示框 -->
|
|
|
|
|
<!-- 新订单提示框 -->
|
2025-01-16 12:24:40 +08:00
|
|
|
|
<!-- <view v-for="(item, index) in orderList" :key="index">
|
2024-06-12 18:43:35 +08:00
|
|
|
|
订单:{{ item.order_sn }}
|
2024-06-20 20:45:12 +08:00
|
|
|
|
<text>状态:{{ item.shipment_status }}</text>
|
2025-01-16 12:24:40 +08:00
|
|
|
|
</view> -->
|
2024-04-22 11:59:53 +08:00
|
|
|
|
<!-- 主按钮 -->
|
2025-01-16 12:24:40 +08:00
|
|
|
|
<view class="flex mse" style="margin-top: 30rpx;">
|
2025-05-12 02:18:55 +08:00
|
|
|
|
<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" />
|
2024-04-26 23:08:01 +08:00
|
|
|
|
<!-- <mainBut bg="#FFC300" imgSrc="/static/icons/franchise.svg" butBt="项目介绍" butSt="Introduction" /> -->
|
2024-04-22 11:59:53 +08:00
|
|
|
|
</view>
|
|
|
|
|
<!-- 站长推荐 -->
|
2025-05-12 02:18:55 +08:00
|
|
|
|
<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>
|
2024-04-22 11:59:53 +08:00
|
|
|
|
<!-- tabbar -->
|
|
|
|
|
<view>
|
2024-05-30 21:52:53 +08:00
|
|
|
|
<tabbar></tabbar>
|
2024-04-22 11:59:53 +08:00
|
|
|
|
</view>
|
2024-04-15 16:12:55 +08:00
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-05-23 14:05:10 +08:00
|
|
|
|
import {
|
2024-12-23 18:03:00 +08:00
|
|
|
|
checkUserInfo
|
2024-05-29 21:49:52 +08:00
|
|
|
|
} from '@/utils/index.js'
|
2024-05-23 14:05:10 +08:00
|
|
|
|
|
2024-04-15 16:12:55 +08:00
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2024-04-22 11:59:53 +08:00
|
|
|
|
avatarSrc: "", //头像地址
|
2024-04-15 16:12:55 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2024-05-23 14:05:10 +08:00
|
|
|
|
computed: {
|
|
|
|
|
userInfo() {
|
|
|
|
|
return this.$store.state.userInfo
|
2024-06-12 18:43:35 +08:00
|
|
|
|
},
|
2024-06-20 20:45:12 +08:00
|
|
|
|
//订单列表 过滤出 已付款的状态订单
|
2024-06-12 18:43:35 +08:00
|
|
|
|
orderList() {
|
2024-06-20 20:45:12 +08:00
|
|
|
|
return this.$store.state.orderList.filter(item => item.main_status === '已付款')
|
2025-05-12 02:18:55 +08:00
|
|
|
|
},
|
|
|
|
|
//推荐的商品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
|
|
|
|
|
}))
|
2024-05-23 14:05:10 +08:00
|
|
|
|
}
|
2024-04-22 11:59:53 +08:00
|
|
|
|
},
|
2025-05-12 02:18:55 +08:00
|
|
|
|
watch: {},
|
2024-12-23 18:03:00 +08:00
|
|
|
|
created() {
|
2024-05-31 17:22:52 +08:00
|
|
|
|
//检查token 没有则进行无感登录
|
|
|
|
|
this.checkUserInfo()
|
2024-05-30 21:52:53 +08:00
|
|
|
|
// 当页面显示时,设置tabber的激活项
|
|
|
|
|
this.$store.commit('setTabbarCurrent', 0)
|
2024-04-15 16:12:55 +08:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
2024-05-23 14:05:10 +08:00
|
|
|
|
// 检查用户信息
|
2024-12-23 18:03:00 +08:00
|
|
|
|
checkUserInfo,
|
2024-04-15 16:12:55 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
2024-04-22 11:59:53 +08:00
|
|
|
|
.loginBox {
|
|
|
|
|
width: 702rpx;
|
|
|
|
|
height: 128rpx;
|
|
|
|
|
background-color: #faf7f3;
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 50%;
|
|
|
|
|
transform: translateX(-50%);
|
|
|
|
|
top: 494rpx;
|
2024-04-15 16:12:55 +08:00
|
|
|
|
}
|
2025-05-12 02:18:55 +08:00
|
|
|
|
|
|
|
|
|
.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;
|
|
|
|
|
}
|
2024-04-22 11:59:53 +08:00
|
|
|
|
</style>
|