<template>
|
<view class="content">
|
<u-swiper class="swiper-item" :list="list5" @change="e=>current = e.current" :autoplay="true">
|
<view slot="indicator" class="indicator">
|
<view class="indicator__dot" v-for="(item, index) in list5" :key="index"
|
:class="[index === current && 'indicator__dot--active']">
|
</view>
|
</view>
|
</u-swiper>
|
|
<u--text type="primary" class="infoText" text="功能列表"></u--text>
|
<view class="grid-box">
|
<u-grid :border="true" col="3" @click="gridClick">
|
<u-grid-item v-for="(listItem,listIndex) in gridList" :key="listIndex">
|
<u-icon :customStyle="{paddingTop:80+'rpx'}" :name="listItem.name" :size="33"></u-icon>
|
<text class="grid-text">{{listItem.title}}</text>
|
</u-grid-item>
|
</u-grid>
|
</view>
|
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
token:'',
|
current: 0,
|
list5: [
|
'/static/swiper/swiper1.png',
|
'/static/swiper/swiper2.png',
|
'/static/swiper/swiper3.png',
|
],
|
gridList: [{
|
name: 'photo',
|
title: '资产领用'
|
},
|
{
|
name: 'lock',
|
title: '资产借用'
|
},
|
{
|
name: 'star',
|
title: '资产归还'
|
},
|
{
|
name: 'hourglass',
|
title: '资产报修'
|
},
|
|
{
|
name: 'star',
|
title: '资产清单'
|
},
|
],
|
code:0,
|
state:0
|
}
|
},
|
onLoad(options) {
|
console.log('code='+options.code)
|
this.code=options.code;
|
this.state=options.state;
|
//发布使用
|
// this.login(this.code);
|
//this.getUserInfo();
|
},
|
methods: {
|
//登陆
|
login(code){
|
this.$http.get('/h5login',{params:{code:code}})
|
.then(res => {
|
// debugger;
|
console.log(res.data)
|
if (res.data.code === 0) {
|
this.token=res.data.token;
|
console.log('token='+this.token);
|
uni.setStorageSync('token', this.token);
|
}
|
}).catch(err => {
|
|
console.log('错误',err.data)
|
})
|
},
|
|
getUserInfo(){
|
this.$http.get('/assets/approval/getUserDetail')
|
.then(res => {
|
// debugger;
|
|
if (res.data.code === 0) {
|
let data = res.data.data
|
uni.setStorageSync('user', data);
|
}
|
}).catch(err => {
|
|
console.log('错误',err.data)
|
})
|
},
|
|
gridClick(index) {
|
// console.log(index);
|
switch (index) {
|
case 0: {
|
this.navTo("../assets/use");
|
break;
|
}
|
case 1: {
|
this.navTo("../assets/borrow");
|
break;
|
}
|
case 2: {
|
this.navTo("../assets/return");
|
break;
|
}
|
case 3: {
|
this.navTo("../assets/repair");
|
break;
|
}
|
case 4: {
|
this.navTo("../assets/list");
|
break;
|
}
|
case 5: {
|
this.navTo("../assets/list");
|
break;
|
}
|
|
default:
|
break;
|
};
|
|
},
|
navTo(Url) {
|
uni.navigateTo({
|
url: Url
|
})
|
}
|
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
.swiper-item {
|
border-radius: 0rpx;
|
}
|
|
.indicator {
|
@include flex(row);
|
justify-content: center;
|
|
&__dot {
|
height: 6px;
|
width: 6px;
|
border-radius: 100px;
|
background-color: rgba(255, 255, 255, 0.35);
|
margin: 0 5px;
|
transition: background-color 0.3s;
|
|
&--active {
|
background-color: #ffffff;
|
}
|
}
|
}
|
|
.indicator-num {
|
padding: 2px 0;
|
background-color: rgba(0, 0, 0, 0.35);
|
border-radius: 100px;
|
width: 35px;
|
@include flex;
|
justify-content: center;
|
|
&__text {
|
color: #FFFFFF;
|
font-size: 12px;
|
}
|
}
|
|
.infoText {
|
// border: 1rpx red solid;
|
padding: 20rpx 0 20rpx 20rpx;
|
|
}
|
|
.grid-text {
|
font-size: 14px;
|
color: #909399;
|
padding: 10rpx 0 50rpx 0rpx;
|
/* #ifndef APP-PLUS */
|
box-sizing: border-box;
|
/* #endif */
|
}
|
</style>
|