You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
3.1 KiB
110 lines
3.1 KiB
<template>
|
|
<view class="volume-box">
|
|
<scroll-view scroll-x style="height: 100%; width: 100%">
|
|
<view class="flex justify-between">
|
|
<!-- <view class="flex flex-col items-center justify-center" style="flex-shrink: 0" @click="apply">
|
|
<img class="volume-img" src="@/static/image.png" alt="" />
|
|
<span class="mt-2" style="color: #70798c">申请</span>
|
|
</view> -->
|
|
<!-- <view class="flex flex-col items-center justify-center" style="flex-shrink: 0" @click="statistics">
|
|
<img class="volume-img" src="@/static/image.png" alt="" />
|
|
<span class="mt-2" style="color: #70798c">统计</span>
|
|
</view> -->
|
|
<view
|
|
class="flex flex-col items-center justify-center"
|
|
style="flex-shrink: 0"
|
|
v-for="(item, index) in btnList"
|
|
:key="index"
|
|
@click="jumpV(item)"
|
|
>
|
|
<!-- <img class="volume-img" src="@/static/image.png" alt="" /> -->
|
|
<img class="volume-img" :src="item.iconUrl || '@/static/image.png'" alt="" />
|
|
<span class="mt-2" style="color: #70798c">{{ item.name }}</span>
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import { mapState, mapGetters } from 'vuex';
|
|
export default {
|
|
data() {
|
|
return {
|
|
name: '',
|
|
url: '',
|
|
btnList: [],
|
|
};
|
|
},
|
|
computed: {
|
|
...mapState('user', ['user']),
|
|
...mapGetters('user', ['userId']),
|
|
},
|
|
created() {
|
|
this.getInfo();
|
|
},
|
|
methods: {
|
|
statistics() {
|
|
console.log('统计');
|
|
uni.navigateTo({ url: '/pages/Statistics/index' });
|
|
},
|
|
apply() {
|
|
console.log('申请');
|
|
uni.navigateTo({ url: '/pages/Apply/index' });
|
|
},
|
|
// 获取按钮信息及跳转路径
|
|
async getInfo() {
|
|
if (!this.user) {
|
|
setTimeout(() => {
|
|
this.getInfo();
|
|
}, 10);
|
|
return;
|
|
}
|
|
const that = this;
|
|
const data = await that.$u.api.getQueryButton({});
|
|
this.btnList = data;
|
|
console.log('data: ', data);
|
|
if (data && data.length) {
|
|
that.name = data[0].name;
|
|
that.url = data[0].url;
|
|
} else if (data && data.name) {
|
|
that.name = data.name;
|
|
that.url = data.url;
|
|
} else if (!data) {
|
|
setTimeout(() => {
|
|
that.getInfo();
|
|
}, 500);
|
|
}
|
|
},
|
|
// 跳转到问卷调查
|
|
jumpV(item) {
|
|
const url = item.url;
|
|
if (item.jumpType === 0) {
|
|
uni.navigateTo({ url });
|
|
} else {
|
|
if (this.user.phone) {
|
|
console.log('this.userId: ', this.userId);
|
|
this.$u.route('pages/questionnaire-webview/questionnaire-webview', { u: this.userId, url: url });
|
|
} else {
|
|
// this.$u.route('/pages/get-phone-power/get-phone-power');
|
|
this.$u.route('/pages/phone-bind/phone-bind');
|
|
}
|
|
}
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
<style scoped>
|
|
.volume-img {
|
|
height: 100rpx;
|
|
width: 100rpx;
|
|
/* border-radius: 50%; */
|
|
}
|
|
.volume-box {
|
|
width: 670rpx;
|
|
margin: 48rpx 32rpx 0 32rpx;
|
|
/* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.125); */
|
|
border-radius: 8rpx;
|
|
/* padding: 32rpx; */
|
|
}
|
|
</style>
|
|
|