Commit a36ddfbb by shibukun

首页

parent 1e1439d8
<template>
<view>
<<<<<<< HEAD
<view class="layout">
<view class="title">懒人企业福利社</view>
<view class="header">
<view class="header-top">
<text class="header-name">你好,{{name}}</text>
<view class="integral-detail">积分明细 ></view>
</view>
<view class="header-center">
<view class="header-integral">{{integralCount}}</view>
<view class="header-integral-tip">当前积分</view>
</view>
<view class="layout">
<view class="title">懒人企业福利社</view>
<view class="header">
<view class="header-top">
<text v-if="isLogin" class="header-name">你好,{{ name }}</text>
<text v-else class="header-login" @click="goLogin()">请登录</text>
<view class="integral-detail">积分明细 ></view>
</view>
<view class="header-center">
<view class="header-integral">{{ integralCount }}</view>
<view class="header-integral-tip">当前积分</view>
</view>
<view class="list">
<view class="item" v-for="(item, index) in brandList" :key='index'>
<image class="icon"></image>
<view class="item-right">
<text class="item-title">叮咚买菜</text>
<text class="item-desc">最高70%返现</text>
</view>
</view>
<view class="list">
<view class="item" v-for="(item, index) in brandList" :key="index">
<image class="icon"></image>
<view class="item-right">
<text class="item-title">叮咚买菜</text>
<text class="item-desc">最高70%返现</text>
</view>
</view>
<uni-load-more v-if="brandList.length>0" :status="loadingType"></uni-load-more>
=======
<view class="" @click="goLogin()">
11111
>>>>>>> d5c91777203b7e81e24f3d0960a9eb78343180ea
</view>
<uni-load-more v-if="brandList.length > 0" :status="loadingType"></uni-load-more>
</view>
</template>
<script>
export default {
data() {
return {
<<<<<<< HEAD
name: '',
integralCount: '',
loadingType: 'more',
brandList: [],
page: 1,
pageSize: 20
=======
>>>>>>> d5c91777203b7e81e24f3d0960a9eb78343180ea
};
export default {
data() {
return {
name: '',
integralCount: '0',
loadingType: 'more',
brandList: [],
page: 1,
pageSize: 20,
isLogin: false
};
},
created() {
this.getData();
},
onShow() {
this.getUserInfo()
},
methods: {
goLogin() {
this.$router.push('Login');
},
created() {
this.getData()
getUserInfo() {
if(this.$net.tokenGet().length > 0) {
this.isLogin = true
this.$net.get('/staff/detail', {})
.then(res => {
this.name = res.accountName
this.integralCount = res.allIntegral
})
.catch(err => {
console.log(err)
})
} else {
// 未登录
this.isLogin = false
}
},
methods: {
goLogin() {
this.$router.push('Login')
},
getData() {
this.$net.get('/goods/brand', {page: this.page, pageSize: this.pageSize})
getData() {
this.$net
.get('/goods/brand', { page: this.page, pageSize: this.pageSize })
.then(res => {
if(res.list.length > 0) {
this.brandList.concat(res.list)
if (res.list.length > 0) {
this.brandList.concat(res.list);
}
this.loadingType = res.list.length < this.pageSize ? 'more' : 'noMore'
this.loadingType = res.list.length < this.pageSize ? 'more' : 'noMore';
})
.catch(err => {
console.log(err)
})
}
console.log(err);
});
}
}
};
</script>
<<<<<<< HEAD
<style lang="scss">
.layout {
width: 100%;
......@@ -99,14 +110,19 @@
margin-left: 30rpx;
.header-name {
font-size: 24rpx;
color: #FFFFFF;
color: #ffffff;
}
.header-login {
font-size: 24rpx;
color: #ffffff;
text-decoration: underline;
}
.integral-detail {
background-image: url(../../static/integral-detail-bg.png);
width: 174rpx;
height: 58rpx;
font-size: 26rpx;
color: #FFFFFF;
color: #ffffff;
line-height: 58rpx;
text-align: center;
}
......@@ -118,18 +134,18 @@
.header-integral {
font-size: 82rpx;
font-weight: bolder;
color: #FFFFFF;
color: #ffffff;
margin-top: 15rpx;
}
.header-integral-tip {
font-size: 24rpx;
color: #FFFFFF;
color: #ffffff;
}
}
.list {
display: flex;
flex-direction: row;
background: #FFEEEE;
background: #ffeeee;
border-radius: 30rpx 30rpx 0rpx 0rpx;
padding-top: 25rpx;
.item {
......@@ -160,8 +176,4 @@
}
}
}
=======
<style lang="scss" scoped>
>>>>>>> d5c91777203b7e81e24f3d0960a9eb78343180ea
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment