1. 更新 YlTable 组件,添加圆角和斑马纹样式 2. 修改搜索框边框颜色为绿色(#70b937) 3. 调整分析页面表格列宽和样式 4. 启用首页的我的任务组件 5. 优化分析信息组件的标签样式
113 lines
2.9 KiB
Vue
113 lines
2.9 KiB
Vue
<script setup>
|
|
import LastSurvey from './components/LastSurvey/Index.vue';
|
|
import Market from './components/Market/Index.vue';
|
|
import CreateSurvey from './components/CreateSurvey/Index.vue';
|
|
import NewSurvey from './components/NewSurvey/index.vue';
|
|
import { onMounted, ref } from 'vue';
|
|
import utils from '@/assets/js/common';
|
|
import { getUserInfo } from '@/api/common/index.js';
|
|
import { showFailToast } from 'vant';
|
|
import appBridge from '@/assets/js/appBridge';
|
|
import ImageSlider from './components/ImageSlider/Index.vue';
|
|
import SearchBar from '@/components/Search/Index.vue';
|
|
import Navigation from '@/components/Navigation/Index.vue';
|
|
import router from '@/router';
|
|
|
|
const contentShow = ref(false);
|
|
|
|
onMounted(async () => {
|
|
if (appBridge.isInReactNative()) {
|
|
const appToken = utils.getSessionStorage('xToken');
|
|
getUserInfo(appToken)
|
|
.then((res) => {
|
|
if (res.data) {
|
|
contentShow.value = true;
|
|
const token = res.data.data.token;
|
|
localStorage.setItem('plantToken', token);
|
|
utils.setSessionStorage('userInfo', res.data.data);
|
|
} else {
|
|
contentShow.value = false;
|
|
showFailToast(
|
|
error.response.data?.message || error.data?.message || error.message || '服务器错误'
|
|
);
|
|
}
|
|
})
|
|
.catch((error) => {
|
|
contentShow.value = false;
|
|
showFailToast(error?.response?.data?.message || error?.message || '服务器错误');
|
|
});
|
|
} else {
|
|
utils.setSessionStorage('xToken', 'f74ba36d7fc3468480648dedba5672ff');
|
|
contentShow.value = true;
|
|
}
|
|
});
|
|
|
|
function handleSearchClick() {
|
|
router.push({ name: 'search' });
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<div v-if="contentShow" class="container-home">
|
|
<div class="container-body">
|
|
<!-- 搜索栏 -->
|
|
<search-bar :value="''" @click="handleSearchClick" />
|
|
<!-- 首页轮播图 -->
|
|
<image-slider />
|
|
<create-survey :createdNewPage="false" />
|
|
<!-- 最新问卷 -->
|
|
<!--<last-survey/>-->
|
|
<!-- 模板市场 -->
|
|
<!-- <Market/> -->
|
|
<!--底部新建问卷-->
|
|
<NewSurvey />
|
|
|
|
<mine-task />
|
|
|
|
<navigation />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped lang="scss">
|
|
.container-home {
|
|
overflow: hidden;
|
|
width: 100%;
|
|
|
|
//background: #f2f2f2;
|
|
//position: relative;
|
|
|
|
.home-pen {
|
|
//height: 200px;
|
|
position: absolute;
|
|
top: -10px;
|
|
left: 0;
|
|
z-index: 8;
|
|
|
|
//width: 100%;
|
|
background: #fff;
|
|
|
|
//background: linear-gradient(180deg, rgba(242, 242, 242, 0) 0%, #ebffe9 100%);
|
|
img {
|
|
width: 100%;
|
|
|
|
//height: 200px;
|
|
}
|
|
}
|
|
}
|
|
|
|
.container-body {
|
|
padding: 0 10px 80px;
|
|
|
|
& > :first-child {
|
|
& > div {
|
|
display: flex;
|
|
flex-direction: column;
|
|
width: 50px;
|
|
height: 50px;
|
|
margin: 10px;
|
|
}
|
|
}
|
|
}
|
|
</style>
|