food_wechat/pages/index/index.vue
sszdot c8018ceb97 【类 型】:fix
【原  因】:checkUserInfo的函数之前修改过 不用接受参数 再函数内部直接调用的全局变量 ,前端调用时并没有删掉传参
【过  程】:去掉多余的wxLogin函数引用 checkUserInfo这个函数不用传参
【影  响】:

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
2024-12-23 18:03:00 +08:00

94 lines
2.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<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">
<navigator open-type="redirect" url="/pages/main/login">
<view class="fb fz32">{{userInfo.tel}}</view>
</navigator>
<u-icon name="arrow-right"></u-icon>
</view>
<navigator url="/pages/main/order">
<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>
</view>
<!-- 新订单 提示框 -->
<!-- 新订单提示框 -->
<view v-for="(item, index) in orderList" :key="index">
订单{{ item.order_sn }}
<text>状态{{ item.shipment_status }}</text>
</view>
<!-- 主按钮 -->
<view class="flex mse" style="height: 222rpx;margin-top: 30rpx;">
<navigator url="/pages/shop/list">
<mainBut bg="#D43030" imgSrc="/static/icons/ordernow.svg" butBt="开始点餐" butSt="Order Now" />
</navigator>
<navigator url="/pages/main/order">
<mainBut bg="#FF8D1A" imgSrc="/static/icons/buggoods.svg" butBt="购买商品" butSt="Buy Goods" />
</navigator>
<!-- <mainBut bg="#FFC300" imgSrc="/static/icons/franchise.svg" butBt="项目介绍" butSt="Introduction" /> -->
</view>
<!-- 站长推荐 -->
<!-- tabbar -->
<view>
<tabbar></tabbar>
</view>
</view>
</template>
<script>
import {
checkUserInfo
} from '@/utils/index.js'
export default {
data() {
return {
avatarSrc: "", //头像地址
bannerList: [{ //banner
url: '/static/banner1.png'
}],
}
},
computed: {
userInfo() {
return this.$store.state.userInfo
},
//订单列表 过滤出 已付款的状态订单
orderList() {
return this.$store.state.orderList.filter(item => item.main_status === '已付款')
}
},
created() {
//检查token 没有则进行无感登录
this.checkUserInfo()
// 当页面显示时设置tabber的激活项
this.$store.commit('setTabbarCurrent', 0)
},
methods: {
// 检查用户信息
checkUserInfo,
}
}
</script>
<style lang="scss">
.loginBox {
width: 702rpx;
height: 128rpx;
background-color: #faf7f3;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 494rpx;
}
</style>