|
|
@ -7,14 +7,14 @@ |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
<view class="list"> |
|
|
<view class="list"> |
|
|
<view class="lf-row-between list-item" hover-class="lf-opacity" |
|
|
|
|
|
v-for="(item, index) in block_list" :key="index" |
|
|
|
|
|
@click="$url(item.path)"> |
|
|
|
|
|
|
|
|
<view class="lf-row-between list-item" hover-class="lf-opacity" v-for="(item, index) in block_list" |
|
|
|
|
|
:key="index" @click="$url(item.path)"> |
|
|
<view class="lf-row-center"> |
|
|
<view class="lf-row-center"> |
|
|
<image class="icon-img" :src="item.icon"></image> |
|
|
<image class="icon-img" :src="item.icon"></image> |
|
|
<text class="lf-text-vertical lf-m-l-20 lf-font-28 lf-color-black">{{ item.name }}</text> |
|
|
<text class="lf-text-vertical lf-m-l-20 lf-font-28 lf-color-black">{{ item.name }}</text> |
|
|
</view> |
|
|
</view> |
|
|
<view> |
|
|
|
|
|
|
|
|
<view class="lf-flex"> |
|
|
|
|
|
<view class="message-tag" v-if="index == 1">1</view> |
|
|
<u-icon name="arrow-right"></u-icon> |
|
|
<u-icon name="arrow-right"></u-icon> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -28,41 +28,41 @@ |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
export default { |
|
|
export default { |
|
|
data(){ |
|
|
|
|
|
|
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
canteen: {}, |
|
|
canteen: {}, |
|
|
block_list: [] |
|
|
block_list: [] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad(){ |
|
|
|
|
|
|
|
|
onLoad() { |
|
|
// todo 优化:显示订单角标 |
|
|
// todo 优化:显示订单角标 |
|
|
this.getHomeData(); |
|
|
this.getHomeData(); |
|
|
}, |
|
|
}, |
|
|
onReady(){ |
|
|
|
|
|
|
|
|
onReady() { |
|
|
// #ifndef MP |
|
|
// #ifndef MP |
|
|
var a = document.getElementsByClassName('uni-page-head-hd')[0]; |
|
|
var a = document.getElementsByClassName('uni-page-head-hd')[0]; |
|
|
a.style.display = 'none'; |
|
|
a.style.display = 'none'; |
|
|
// #endif |
|
|
// #endif |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
getHomeData(){ |
|
|
|
|
|
|
|
|
getHomeData() { |
|
|
this.$http(this.API.API_CANTEEN_INDEX).then(res => { |
|
|
this.$http(this.API.API_CANTEEN_INDEX).then(res => { |
|
|
console.log("getHomeData", res); |
|
|
console.log("getHomeData", res); |
|
|
this.block_list = res.data.block; |
|
|
this.block_list = res.data.block; |
|
|
this.canteen = res.data.canteen; |
|
|
this.canteen = res.data.canteen; |
|
|
uni.setNavigationBarTitle({ |
|
|
uni.setNavigationBarTitle({ |
|
|
title: this.canteen.user.canteen.canteen_name |
|
|
|
|
|
|
|
|
title: this.canteen.user.canteen.canteen_name |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 退出登录 |
|
|
// 退出登录 |
|
|
loginOut(){ |
|
|
|
|
|
|
|
|
loginOut() { |
|
|
uni.showModal({ |
|
|
uni.showModal({ |
|
|
title: '温馨提示', |
|
|
title: '温馨提示', |
|
|
content: '确定退出登录吗?', |
|
|
content: '确定退出登录吗?', |
|
|
confirmColor: '#11D189', |
|
|
confirmColor: '#11D189', |
|
|
success: result => { |
|
|
success: result => { |
|
|
if(result.confirm){ |
|
|
|
|
|
|
|
|
if (result.confirm) { |
|
|
uni.removeStorageSync('canteen_token'); |
|
|
uni.removeStorageSync('canteen_token'); |
|
|
this.$redirectToLogin('您已退出登录, 即将跳转...'); |
|
|
this.$redirectToLogin('您已退出登录, 即将跳转...'); |
|
|
} |
|
|
} |
|
|
@ -74,57 +74,78 @@ |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style> |
|
|
<style> |
|
|
page{ |
|
|
|
|
|
|
|
|
page { |
|
|
background-color: #F6F6F6; |
|
|
background-color: #F6F6F6; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |
|
|
<style lang="scss" scoped="scoped"> |
|
|
<style lang="scss" scoped="scoped"> |
|
|
.head{ |
|
|
|
|
|
|
|
|
.message-tag { |
|
|
|
|
|
width: 36rpx; |
|
|
|
|
|
height: 36rpx; |
|
|
|
|
|
background-color: red; |
|
|
|
|
|
border-radius: 50%; |
|
|
|
|
|
margin-right: 10rpx; |
|
|
|
|
|
text-align: center; |
|
|
|
|
|
align-content: center; |
|
|
|
|
|
color: white; |
|
|
|
|
|
display: flex; |
|
|
|
|
|
justify-content: space-around; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.head { |
|
|
height: 374rpx; |
|
|
height: 374rpx; |
|
|
width: 750rpx; |
|
|
width: 750rpx; |
|
|
background-color: #FFFFFF; |
|
|
background-color: #FFFFFF; |
|
|
image{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
image { |
|
|
width: 200rpx; |
|
|
width: 200rpx; |
|
|
height: 200rpx; |
|
|
height: 200rpx; |
|
|
border: 2rpx solid #FFFFFF; |
|
|
border: 2rpx solid #FFFFFF; |
|
|
border-radius: 50%; |
|
|
border-radius: 50%; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.list{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.list { |
|
|
margin-top: 20rpx; |
|
|
margin-top: 20rpx; |
|
|
padding: 0 32rpx; |
|
|
padding: 0 32rpx; |
|
|
background-color: #FFFFFF; |
|
|
background-color: #FFFFFF; |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
height: auto; |
|
|
height: auto; |
|
|
} |
|
|
} |
|
|
.list-item{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.list-item { |
|
|
border-bottom: 1rpx solid #EEEEEE; |
|
|
border-bottom: 1rpx solid #EEEEEE; |
|
|
height: 110rpx; |
|
|
height: 110rpx; |
|
|
box-sizing: border-box; |
|
|
box-sizing: border-box; |
|
|
position: relative; |
|
|
position: relative; |
|
|
.icon-img{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.icon-img { |
|
|
width: 50rpx; |
|
|
width: 50rpx; |
|
|
height: 50rpx; |
|
|
height: 50rpx; |
|
|
} |
|
|
} |
|
|
.feedback-btn{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.feedback-btn { |
|
|
position: absolute; |
|
|
position: absolute; |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
height: 100%; |
|
|
height: 100%; |
|
|
z-index: 1; |
|
|
z-index: 1; |
|
|
background: transparent; |
|
|
background: transparent; |
|
|
} |
|
|
} |
|
|
&:last-child{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&:last-child { |
|
|
border-bottom: none; |
|
|
border-bottom: none; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.exit{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.exit { |
|
|
padding: 0 32rpx; |
|
|
padding: 0 32rpx; |
|
|
// bottom: 50rpx; |
|
|
// bottom: 50rpx; |
|
|
padding-top: 10rpx; |
|
|
padding-top: 10rpx; |
|
|
padding-bottom: 50rpx; |
|
|
padding-bottom: 50rpx; |
|
|
box-sizing: border-box; |
|
|
box-sizing: border-box; |
|
|
background-color: #F6F6F6; |
|
|
background-color: #F6F6F6; |
|
|
button{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
button { |
|
|
background-color: #f0f0f0; |
|
|
background-color: #f0f0f0; |
|
|
color: #777777; |
|
|
color: #777777; |
|
|
} |
|
|
} |
|
|
|