优化代码

This commit is contained in:
王创世 2025-08-06 09:22:24 +08:00
parent 72633579e0
commit ed01d833b9
9 changed files with 1352 additions and 1240 deletions

View File

@ -18,7 +18,8 @@
</view> --> </view> -->
<view> <view>
<tn-swiper :list="banners" :radius="0" :height="400" :effect3d="false" mode="dot" @click="clickSwiper"></tn-swiper> <tn-swiper :list="banners" :radius="0" :height="400" :effect3d="false" mode="dot"
@click="clickSwiper"></tn-swiper>
</view> </view>
<!-- 公告 --> <!-- 公告 -->
@ -40,26 +41,66 @@
<!-- 功能列表 start --> <!-- 功能列表 start -->
<view class="about-shadow tn-padding-top-sm tn-padding-bottom-sm"> <view class="about-shadow tn-padding-top-sm tn-padding-bottom-sm">
<view style="display: flex;justify-content: center;align-items: center;gap: 12px;"> <view style="display: flex;justify-content: center;align-items: center;gap: 12px;">
<block v-for="(item, index) in moduleList" :key="index"> <view v-if="classes_show == 1" class="tn-padding-sm tn-margin-xs" @click="goPage('/pagesSubject/video/index')">
<view class="tn-padding-sm tn-margin-xs" @click="goPage(item.path)">
<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center"> <view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
<view v-if="item.type == 'icon'" <view
class="icon15__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-color-white"
:class="[item.color]">
<view :class="[item.icon]"></view>
</view>
<view v-else-if="item.type == 'image'"
class="icon15__item--image tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-color-white"> class="icon15__item--image tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-color-white">
<image :src="item.image" style="width: 100%;height: 100%"></image> <image src="/static/img/1.png" style="width: 100%;height: 100%"></image>
</view> </view>
<view class="tn-text-center"> <view class="tn-text-center">
<text class="tn-text-ellipsis" style="font-size: 28rpx">{{ item.name }}</text> <text class="tn-text-ellipsis" style="font-size: 28rpx">课程中心</text>
</view>
</view>
</view>
<view v-if="classes_show == 1" class="tn-padding-sm tn-margin-xs" @click="goPage('/pages/index/news-list')">
<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
<view
class="icon15__item--image tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-color-white">
<image src="/static/img/1.png" style="width: 100%;height: 100%"></image>
</view>
<view class="tn-text-center">
<text class="tn-text-ellipsis" style="font-size: 28rpx">关于我们</text>
</view>
</view>
</view>
<!-- <view class="tn-padding-sm tn-margin-xs" @click="goPage('/pages/train/index?page=train')">
<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
<view
class="icon15__item--image tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-color-white">
<image src="/static/img/2.png" style="width: 100%;height: 100%"></image>
</view>
<view class="tn-text-center">
<text class="tn-text-ellipsis" style="font-size: 28rpx">平台题库</text>
</view>
</view>
</view> -->
<view class="tn-padding-sm tn-margin-xs" @click="goPage('/pages/wrong/index')">
<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
<view
class="icon15__item--image tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-color-white">
<image src="/static/img/3.png" style="width: 100%;height: 100%"></image>
</view>
<view class="tn-text-center">
<text class="tn-text-ellipsis" style="font-size: 28rpx">错题本</text>
</view>
</view>
</view>
<view class="tn-padding-sm tn-margin-xs" @click="goPage('/pages/collect/index')">
<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
<view
class="icon15__item--image tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-color-white">
<image src="/static/img/4.png" style="width: 100%;height: 100%"></image>
</view>
<view class="tn-text-center">
<text class="tn-text-ellipsis" style="font-size: 28rpx">题目收藏</text>
</view> </view>
</view> </view>
</view> </view>
</block>
</view> </view>
</view> </view>
<!-- 功能列表 end --> <!-- 功能列表 end -->
@ -199,10 +240,10 @@
</template> </template>
<script> <script>
import template_page_mixin from "@/libs/mixin/template_page_mixin.js"; import template_page_mixin from "@/libs/mixin/template_page_mixin.js";
// import NavIndexButton from '@/libs/components/nav-index-button.vue' // import NavIndexButton from '@/libs/components/nav-index-button.vue'
export default { export default {
name: "kz-page-index-list1", name: "kz-page-index-list1",
mixins: [template_page_mixin], mixins: [template_page_mixin],
components: { components: {
@ -269,6 +310,10 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
classes_show: {
type: String,
default: "",
}
}, },
watch: { watch: {
/** /**
@ -300,7 +345,7 @@ export default {
* 监听rooms * 监听rooms
* @param list * @param list
*/ */
rooms(list) { }, rooms(list) {},
/** /**
* 监听modules * 监听modules
* @param list * @param list
@ -313,6 +358,7 @@ export default {
// }, // },
}, },
mounted() { mounted() {
console.log(this.modules);
let diyIndexButton = uni.getStorageSync("diyIndexButton"); let diyIndexButton = uni.getStorageSync("diyIndexButton");
if (diyIndexButton) { if (diyIndexButton) {
this.moduleList = diyIndexButton; this.moduleList = diyIndexButton;
@ -424,16 +470,16 @@ export default {
} }
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page-index-list { .page-index-list {
background-color: #ffffff; background-color: #ffffff;
} }
/* 自定义导航栏内容 start */ /* 自定义导航栏内容 start */
.custom-nav { .custom-nav {
height: 100%; height: 100%;
&__back { &__back {
@ -468,36 +514,36 @@ export default {
color: #aaaaaa; color: #aaaaaa;
} }
} }
} }
/*logo start */ /*logo start */
.logo-image { .logo-image {
width: 65rpx; width: 65rpx;
height: 65rpx; height: 65rpx;
position: relative; position: relative;
} }
.logo-pic { .logo-pic {
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
// background-attachment:fixed; // background-attachment:fixed;
background-position: top; background-position: top;
border-radius: 50%; border-radius: 50%;
} }
/* 自定义导航栏内容 end */ /* 自定义导航栏内容 end */
/* 内容布局 start*/ /* 内容布局 start*/
.course-shadow { .course-shadow {
box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.07); box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.07);
} }
.course-radius { .course-radius {
border-radius: 15rpx; border-radius: 15rpx;
} }
/* 图标容器15 start */ /* 图标容器15 start */
.icon15 { .icon15 {
&__item { &__item {
width: 30%; width: 30%;
background-color: #ffffff; background-color: #ffffff;
@ -546,10 +592,10 @@ export default {
} }
} }
} }
} }
/* 业务展示 start */ /* 业务展示 start */
.tn-info { .tn-info {
&__container { &__container {
margin-top: 10rpx; margin-top: 10rpx;
margin-bottom: 50rpx; margin-bottom: 50rpx;
@ -629,12 +675,12 @@ export default {
} }
} }
} }
} }
/* 业务展示 end */ /* 业务展示 end */
/* 文章内容 start*/ /* 文章内容 start*/
.tn-blogger-content { .tn-blogger-content {
&__wrap { &__wrap {
box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.07); box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.07);
border-radius: 20rpx; border-radius: 20rpx;
@ -690,36 +736,36 @@ export default {
font-size: 30rpx; font-size: 30rpx;
padding-right: 5rpx; padding-right: 5rpx;
} }
} }
.image-music { .image-music {
padding: 100rpx 0rpx; padding: 100rpx 0rpx;
font-size: 16rpx; font-size: 16rpx;
font-weight: 300; font-weight: 300;
position: relative; position: relative;
} }
.image-pic { .image-pic {
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
// background-attachment:fixed; // background-attachment:fixed;
background-position: top; background-position: top;
border-radius: 20rpx 20rpx 0 0; border-radius: 20rpx 20rpx 0 0;
} }
/* 文章内容 end*/ /* 文章内容 end*/
/* 底部tabbar start*/ /* 底部tabbar start*/
.footerfixed { .footerfixed {
position: fixed; position: fixed;
width: 100%; width: 100%;
bottom: 0; bottom: 0;
z-index: 999; z-index: 999;
background-color: #ffffff; background-color: #ffffff;
box-shadow: 0rpx 0rpx 30rpx 0rpx rgba(0, 0, 0, 0.07); box-shadow: 0rpx 0rpx 30rpx 0rpx rgba(0, 0, 0, 0.07);
} }
.tabbar { .tabbar {
display: flex; display: flex;
align-items: center; align-items: center;
min-height: 110rpx; min-height: 110rpx;
@ -727,9 +773,9 @@ export default {
padding: 0; padding: 0;
height: calc(110rpx + env(safe-area-inset-bottom) / 2); height: calc(110rpx + env(safe-area-inset-bottom) / 2);
padding-bottom: calc(env(safe-area-inset-bottom) / 2); padding-bottom: calc(env(safe-area-inset-bottom) / 2);
} }
.tabbar .action { .tabbar .action {
font-size: 22rpx; font-size: 22rpx;
position: relative; position: relative;
flex: 1; flex: 1;
@ -740,9 +786,9 @@ export default {
line-height: 1; line-height: 1;
margin: 0; margin: 0;
overflow: initial; overflow: initial;
} }
.tabbar .action .bar-icon { .tabbar .action .bar-icon {
width: 100rpx; width: 100rpx;
position: relative; position: relative;
display: block; display: block;
@ -750,54 +796,54 @@ export default {
margin: 0 auto 10rpx; margin: 0 auto 10rpx;
text-align: center; text-align: center;
font-size: 42rpx; font-size: 42rpx;
} }
.tabbar .action .bar-icon image { .tabbar .action .bar-icon image {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
display: inline-block; display: inline-block;
} }
/*scroll-view外层*/ /*scroll-view外层*/
.skill-sequence-panel-content-wrapper { .skill-sequence-panel-content-wrapper {
position: relative; position: relative;
white-space: nowrap; white-space: nowrap;
padding: 10rpx 0 10rpx 10rpx; padding: 10rpx 0 10rpx 10rpx;
// background-color: #f2f5f9; // background-color: #f2f5f9;
} }
/*左右渐变遮罩*/ /*左右渐变遮罩*/
.hide-content-box { .hide-content-box {
position: absolute; position: absolute;
top: 0; top: 0;
height: 100%; height: 100%;
width: 10px; width: 10px;
z-index: 2; z-index: 2;
} }
.hide-content-box-left { .hide-content-box-left {
left: 0; left: 0;
background-image: linear-gradient(to left, background-image: linear-gradient(to left,
rgba(255, 255, 255, 0), rgba(255, 255, 255, 0),
#f3f3f3 60%); #f3f3f3 60%);
} }
.hide-content-box-right { .hide-content-box-right {
right: 0; right: 0;
background-image: linear-gradient(to right, background-image: linear-gradient(to right,
rgba(255, 255, 255, 0), rgba(255, 255, 255, 0),
#f3f3f3 60%); #f3f3f3 60%);
} }
.kite-classify-scroll { .kite-classify-scroll {
width: 100%; width: 100%;
height: 380rpx; height: 380rpx;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
padding-top: 15rpx; padding-top: 15rpx;
} }
.kite-classify-cell { .kite-classify-cell {
display: inline-block; display: inline-block;
width: 266rpx; width: 266rpx;
height: 350rpx; height: 350rpx;
@ -806,15 +852,15 @@ export default {
border-radius: 20rpx; border-radius: 20rpx;
overflow: hidden; overflow: hidden;
box-shadow: 2px 2px 3px rgba(26, 26, 26, 0.2); box-shadow: 2px 2px 3px rgba(26, 26, 26, 0.2);
} }
/* 垂直布局样式 */ /* 垂直布局样式 */
.skill-sequence-panel-content-wrapper-vertical { .skill-sequence-panel-content-wrapper-vertical {
position: relative; position: relative;
padding: 10rpx 20rpx; padding: 10rpx 20rpx;
} }
.kite-classify-cell-vertical { .kite-classify-cell-vertical {
display: block; display: block;
width: 100%; width: 100%;
height: 280rpx; height: 280rpx;
@ -823,9 +869,9 @@ export default {
border-radius: 20rpx; border-radius: 20rpx;
overflow: hidden; overflow: hidden;
box-shadow: 2px 2px 3px rgba(26, 26, 26, 0.2); box-shadow: 2px 2px 3px rgba(26, 26, 26, 0.2);
} }
.nav-li { .nav-li {
padding: 40rpx 30rpx; padding: 40rpx 30rpx;
width: 100%; width: 100%;
background-image: url(https://s1.ax1x.com/2020/06/27/NyU04x.png); background-image: url(https://s1.ax1x.com/2020/06/27/NyU04x.png);
@ -834,18 +880,18 @@ export default {
position: relative; position: relative;
z-index: 1; z-index: 1;
margin: 0 !important; margin: 0 !important;
} }
.nav-name { .nav-name {
font-size: 28upx; font-size: 30rpx;
text-transform: Capitalize; text-transform: Capitalize;
margin-top: 20upx; margin-top: 20upx;
position: relative; position: relative;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
} }
.nav-name::before { .nav-name::before {
content: ""; content: "";
position: absolute; position: absolute;
display: block; display: block;
@ -855,9 +901,9 @@ export default {
bottom: 0; bottom: 0;
right: 0; right: 0;
opacity: 0.5; opacity: 0.5;
} }
.nav-name::after { .nav-name::after {
content: ""; content: "";
position: absolute; position: absolute;
display: block; display: block;
@ -867,69 +913,70 @@ export default {
bottom: 0; bottom: 0;
right: 40rpx; right: 40rpx;
opacity: 0.3; opacity: 0.3;
} }
.nav-content { .nav-content {
width: 100%; width: 100%;
padding: 15rpx; padding: 15rpx;
display: inline-block; display: inline-block;
overflow-wrap: break-word; overflow-wrap: break-word;
white-space: normal; white-space: normal;
} }
.nav-btn { .nav-btn {
width: 200rpx; width: 200rpx;
height: 60rpx; height: 60rpx;
margin-right: 30rpx; margin-right: 30rpx;
text-align: center; text-align: center;
line-height: 60rpx; line-height: 60rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
.bg-index1 { .bg-index1 {
background-color: #19cf8a; background-color: #19cf8a;
color: #fff; color: #fff;
} }
.bg-index2 { .bg-index2 {
background-color: #954ff6; background-color: #954ff6;
color: #fff; color: #fff;
} }
.bg-index3 { .bg-index3 {
font-size: 30rpx;
background-color: #5177ee; background-color: #5177ee;
color: #fff; color: #fff;
} }
.bg-index4 { .bg-index4 {
background-color: #f49a02; background-color: #f49a02;
color: #fff; color: #fff;
} }
.bg-index5 { .bg-index5 {
background-color: #ff4f94; background-color: #ff4f94;
color: #fff; color: #fff;
} }
.bg-index6 { .bg-index6 {
background-color: #7fd02b; background-color: #7fd02b;
color: #fff; color: #fff;
} }
/* 页面阴影 start*/ /* 页面阴影 start*/
.wallpaper-shadow { .wallpaper-shadow {
border-radius: 15rpx; border-radius: 15rpx;
box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07); box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
} }
/* 用户头像 start */ /* 用户头像 start */
.logo-image { .logo-image {
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
position: relative; position: relative;
} }
.logo-pic { .logo-pic {
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
// background-attachment:fixed; // background-attachment:fixed;
@ -939,10 +986,10 @@ export default {
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
// background-color: #FFFFFF; // background-color: #FFFFFF;
} }
/*公告*/ /*公告*/
.tui-rolling-news { .tui-rolling-news {
width: calc(100% - 40rpx); width: calc(100% - 40rpx);
padding: 12rpx 20rpx; padding: 12rpx 20rpx;
box-sizing: border-box; box-sizing: border-box;
@ -953,28 +1000,28 @@ export default {
background: #fff; background: #fff;
border-radius: 10rpx; border-radius: 10rpx;
margin: 0 20rpx 30rpx; margin: 0 20rpx 30rpx;
} }
.tui-swiper { .tui-swiper {
font-size: 28rpx; font-size: 28rpx;
height: 50rpx; height: 50rpx;
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.tui-swiper-item { .tui-swiper-item {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.tui-news-item { .tui-news-item {
line-height: 24rpx; line-height: 24rpx;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
/*公告*/ /*公告*/
</style> </style>

View File

@ -2000,7 +2000,7 @@
flex-wrap: wrap; flex-wrap: wrap;
flex: 1; flex: 1;
height: 100%; height: 100%;
font-p: 32rpx; font-size: 30rpx;
.image { .image {
width: 50%; width: 50%;
@ -2463,7 +2463,7 @@
} }
.text-right-answer-val { .text-right-answer-val {
font-size: 28rpx; font-size: 30rpx;
color: #1A73E8; color: #1A73E8;
padding: 8rpx 0rpx; padding: 8rpx 0rpx;
border-radius: 15rpx 15rpx 15rpx 0; border-radius: 15rpx 15rpx 15rpx 0;

View File

@ -110,15 +110,15 @@
path: '/pages/index/index' path: '/pages/index/index'
}, },
{ {
name: '模拟考试', name: '平台题库',
icon: 'tn-icon-edit-form', icon: 'tn-icon-edit-form',
path: '/pages/paper/index', path: '/pages/train/index',
},
{
name: '关于我们',
icon: 'tn-icon-inventory',
path: '/pages/index/news-list',
}, },
// {
// name: '',
// icon: 'tn-icon-inventory',
// path: '/pages/index/news-list',
// },
{ {
name: '考试公示', name: '考试公示',
icon: 'tn-icon-menu-list', icon: 'tn-icon-menu-list',

View File

@ -111,7 +111,7 @@
//tabs //tabs
size: { size: {
type: Number, type: Number,
default: 28 default: 30
}, },
//tabs //tabs
color: { color: {
@ -180,7 +180,7 @@
//item text //item text
textSize: { textSize: {
type: Number, type: Number,
default: 28 default: 30
}, },
//text //text
nowrap: { nowrap: {
@ -195,7 +195,7 @@
//item subText //item subText
subTextSize: { subTextSize: {
type: Number, type: Number,
default: 24 default: 30
}, },
// item padding // item padding
padding: { padding: {
@ -546,6 +546,7 @@
.tui-cell-title { .tui-cell-title {
word-break: break-all; word-break: break-all;
font-size: 30rpx;
} }
.tui-flex-shrink { .tui-flex-shrink {

View File

@ -1,12 +1,8 @@
<template> <template>
<view> <view>
<!-- 骨架屏 --> <!-- 骨架屏 -->
<kz-skeleton <kz-skeleton v-if="showSkeleton" :showSkeleton="showSkeleton" backgroundColor="#fafafa"
v-if="showSkeleton" borderRadius="10rpx"></kz-skeleton>
:showSkeleton="showSkeleton"
backgroundColor="#fafafa"
borderRadius="10rpx"
></kz-skeleton>
<!-- 添加小程序提示组件 --> <!-- 添加小程序提示组件 -->
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
@ -14,45 +10,19 @@
<!-- #endif --> <!-- #endif -->
<!-- 首页多彩列表风格组件1 --> <!-- 首页多彩列表风格组件1 -->
<kz-page-index-color-1 <kz-page-index-color-1 :classes_show="classes_show" :title="title" :banners="banners" :slides="slides" :papers="papers" :rooms="rooms"
:title="title" :news="news" :notices="notices" :modules="diyIndexButton" :subjectId="subjectId" :subjectName="subjectName"
:banners="banners" v-if="pageStyle == 'color'"></kz-page-index-color-1>
:slides="slides"
:papers="papers"
:rooms="rooms"
:news="news"
:notices="notices"
:modules="diyIndexButton"
:subjectId="subjectId"
:subjectName="subjectName"
v-if="pageStyle == 'color'"
></kz-page-index-color-1>
<!-- 首页多彩列表风格组件2 --> <!-- 首页多彩列表风格组件2 -->
<kz-page-index-color-2 <kz-page-index-color-2 :title="title" :banners="banners" :slides="slides" :papers="papers" :rooms="rooms"
:title="title" :news="news" :notices="notices" :modules="diyIndexButton" :subjectId="subjectId" :subjectName="subjectName"
:banners="banners" v-else-if="pageStyle == 'color2'"></kz-page-index-color-2>
:slides="slides"
:papers="papers"
:rooms="rooms"
:news="news"
:notices="notices"
:modules="diyIndexButton"
:subjectId="subjectId"
:subjectName="subjectName"
v-else-if="pageStyle == 'color2'"
></kz-page-index-color-2>
<!-- 首页简约风格组件 --> <!-- 首页简约风格组件 -->
<kz-page-index-simple-1 <kz-page-index-simple-1 :title="title" :notices="notices" :subjectName="subjectName" :userInfo="userInfo"
:title="title" :diyIndexButton="diyIndexButton" v-else-if="pageStyle == 'simple'"
:notices="notices" @clickUserInfo="clickUserInfo"></kz-page-index-simple-1>
:subjectName="subjectName"
:userInfo="userInfo"
:diyIndexButton="diyIndexButton"
v-else-if="pageStyle == 'simple'"
@clickUserInfo="clickUserInfo"
></kz-page-index-simple-1>
<!-- <kz-page-index-simple :banners="banners" v-if="pageStyle == 'simple'"></kz-page-index-simple> --> <!-- <kz-page-index-simple :banners="banners" v-if="pageStyle == 'simple'"></kz-page-index-simple> -->
<!-- 悬浮组件 --> <!-- 悬浮组件 -->
@ -110,19 +80,20 @@
</template> </template>
<script> <script>
// import HeadLine from '@/components/headline/headline.vue' // import HeadLine from '@/components/headline/headline.vue'
import AddTip from "@/components/struggler-uniapp-add-tip/struggler-uniapp-add-tip.vue"; import AddTip from "@/components/struggler-uniapp-add-tip/struggler-uniapp-add-tip.vue";
import subjectApi from "@/common/api/subject.js"; import subjectApi from "@/common/api/subject.js";
var interstitialAd = null; var interstitialAd = null;
export default { export default {
components: { components: {
// HeadLine, // HeadLine,
AddTip, AddTip,
}, },
data() { data() {
return { return {
classes_show:'',
loadText: { loadText: {
loadmore: '灵睿网络', loadmore: '灵睿网络',
loading: '灵睿网络', loading: '灵睿网络',
@ -201,7 +172,9 @@ export default {
}, },
getSetting() { getSetting() {
this.http("common/index", { subject_id: this.subjectId }, "get").then( this.http("common/index", {
subject_id: this.subjectId
}, "get").then(
(res) => { (res) => {
if (!res.code) { if (!res.code) {
uni.showToast({ uni.showToast({
@ -210,7 +183,7 @@ export default {
}); });
return; return;
} }
this.classes_show=res.data.classes_show;
// //
let point = res.data.point; let point = res.data.point;
// if (point?.get_point) { // if (point?.get_point) {
@ -292,14 +265,14 @@ export default {
} }
// //
this.pageStyle = page.page_index_style this.pageStyle = page.page_index_style ?
? page.page_index_style page.page_index_style :
: "color"; "color";
// this.pageStyle = 'color' // this.pageStyle = 'color'
// //
this.tabbarStyle = page.page_tabbar_style this.tabbarStyle = page.page_tabbar_style ?
? page.page_tabbar_style page.page_tabbar_style :
: "glass"; "glass";
// //
this.showAdBtn = parseInt(page.page_index_ad_btn) == 1; this.showAdBtn = parseInt(page.page_index_ad_btn) == 1;
this.showShareBtn = parseInt(page.page_index_share_btn) == 1; this.showShareBtn = parseInt(page.page_index_share_btn) == 1;
@ -352,7 +325,9 @@ export default {
let user_subject = uni.getStorageSync("user_subject"); let user_subject = uni.getStorageSync("user_subject");
if (user_subject && user_subject.subject2 && user_subject.subject2.id) { if (user_subject && user_subject.subject2 && user_subject.subject2.id) {
subjectApi subjectApi
.getSubjectDetail(this, { subject_id: user_subject.subject2.id }) .getSubjectDetail(this, {
subject_id: user_subject.subject2.id
})
.then((res) => { .then((res) => {
console.log("res", res); console.log("res", res);
if (res && res.code == 1) { if (res && res.code == 1) {
@ -397,22 +372,22 @@ export default {
this.utils.goto("/pagesSubject/index?type=subject"); this.utils.goto("/pagesSubject/index?type=subject");
}, },
}, },
}; };
</script> </script>
<style> <style>
page { page {
background-color: #fff; background-color: #fff;
} }
.nav-list { .nav-list {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
padding: 0px 40upx 0px; padding: 0px 40upx 0px;
justify-content: space-between; justify-content: space-between;
} }
.nav-li { .nav-li {
padding: 30upx; padding: 30upx;
border-radius: 12upx; border-radius: 12upx;
width: 45%; width: 45%;
@ -422,9 +397,9 @@ page {
background-position: center; background-position: center;
position: relative; position: relative;
z-index: 1; z-index: 1;
} }
.nav-li::after { .nav-li::after {
content: ""; content: "";
position: absolute; position: absolute;
z-index: -1; z-index: -1;
@ -436,32 +411,32 @@ page {
border-radius: 10upx; border-radius: 10upx;
opacity: 0.2; opacity: 0.2;
transform: scale(0.9, 0.9); transform: scale(0.9, 0.9);
} }
.nav-li.cur { .nav-li.cur {
color: #fff; color: #fff;
background: rgb(94, 185, 94); background: rgb(94, 185, 94);
box-shadow: 4upx 4upx 6upx rgba(94, 185, 94, 0.4); box-shadow: 4upx 4upx 6upx rgba(94, 185, 94, 0.4);
} }
.nav-title { .nav-title {
font-size: 32upx; font-size: 32upx;
font-weight: 300; font-weight: 300;
} }
.nav-title::first-letter { .nav-title::first-letter {
font-size: 40upx; font-size: 40upx;
margin-right: 4upx; margin-right: 4upx;
} }
.nav-name { .nav-name {
font-size: 28upx; font-size: 28upx;
text-transform: Capitalize; text-transform: Capitalize;
margin-top: 20upx; margin-top: 20upx;
position: relative; position: relative;
} }
.nav-name::before { .nav-name::before {
content: ""; content: "";
position: absolute; position: absolute;
display: block; display: block;
@ -471,9 +446,9 @@ page {
bottom: 0; bottom: 0;
right: 0; right: 0;
opacity: 0.5; opacity: 0.5;
} }
.nav-name::after { .nav-name::after {
content: ""; content: "";
position: absolute; position: absolute;
display: block; display: block;
@ -483,15 +458,15 @@ page {
bottom: 0; bottom: 0;
right: 40upx; right: 40upx;
opacity: 0.3; opacity: 0.3;
} }
.nav-name::first-letter { .nav-name::first-letter {
font-weight: bold; font-weight: bold;
font-size: 36upx; font-size: 36upx;
margin-right: 1px; margin-right: 1px;
} }
.nav-li text { .nav-li text {
position: absolute; position: absolute;
right: 30upx; right: 30upx;
top: 30upx; top: 30upx;
@ -500,13 +475,13 @@ page {
height: 60upx; height: 60upx;
text-align: center; text-align: center;
line-height: 60upx; line-height: 60upx;
} }
.text-light { .text-light {
font-weight: 300; font-weight: 300;
} }
@keyframes show { @keyframes show {
0% { 0% {
transform: translateY(-50px); transform: translateY(-50px);
} }
@ -518,9 +493,9 @@ page {
100% { 100% {
transform: translateY(0px); transform: translateY(0px);
} }
} }
@-webkit-keyframes show { @-webkit-keyframes show {
0% { 0% {
transform: translateY(-50px); transform: translateY(-50px);
} }
@ -532,65 +507,65 @@ page {
100% { 100% {
transform: translateY(0px); transform: translateY(0px);
} }
} }
/*banner*/ /*banner*/
.tui-banner-box { .tui-banner-box {
width: 100%; width: 100%;
padding-top: 20rpx; padding-top: 20rpx;
box-sizing: border-box; box-sizing: border-box;
background: #fff; background: #fff;
} }
.tui-banner-swiper { .tui-banner-swiper {
width: 100%; width: 100%;
height: 320rpx; height: 320rpx;
} }
.tui-banner-item { .tui-banner-item {
padding: 0 16rpx; padding: 0 16rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.tui-slide-image { .tui-slide-image {
width: 100%; width: 100%;
height: 320rpx; height: 320rpx;
display: block; display: block;
border-radius: 12rpx; border-radius: 12rpx;
/* transition: all 0.1s linear; */ /* transition: all 0.1s linear; */
} }
.tui-banner-scale { .tui-banner-scale {
transform: scaleY(0.9); transform: scaleY(0.9);
transform-origin: center center; transform-origin: center center;
} }
/* #ifdef MP-WEIXIN */ /* #ifdef MP-WEIXIN */
.tui-banner-swiper .wx-swiper-dot { .tui-banner-swiper .wx-swiper-dot {
width: 8rpx; width: 8rpx;
height: 8rpx; height: 8rpx;
display: inline-flex; display: inline-flex;
background: none; background: none;
justify-content: space-between; justify-content: space-between;
} }
.tui-banner-swiper .wx-swiper-dot::before { .tui-banner-swiper .wx-swiper-dot::before {
content: ""; content: "";
flex-grow: 1; flex-grow: 1;
background: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.8);
border-radius: 16rpx; border-radius: 16rpx;
overflow: hidden; overflow: hidden;
} }
.tui-banner-swiper .wx-swiper-dot-active::before { .tui-banner-swiper .wx-swiper-dot-active::before {
background: #fff; background: #fff;
} }
.tui-banner-swiper .wx-swiper-dot.wx-swiper-dot-active { .tui-banner-swiper .wx-swiper-dot.wx-swiper-dot-active {
width: 16rpx; width: 16rpx;
} }
/* #endif */ /* #endif */
/*banner*/ /*banner*/
</style> </style>

View File

@ -2,19 +2,30 @@
<template> <template>
<view class="container"> <view class="container">
<view> <view>
<view style="background-color: #FFFFFF;padding: 30rpx 30rpx 30rpx 30rpx;"> <view style="background-color: #FFFFFF;padding: 30rpx 30rpx 80rpx 30rpx;">
<view class="titleBox text-xl text-black text-bold">{{ newsData.name }}</view> <view class="contentBox text-lg text-black">
<view class="flex justify-between text-df text-gray margin-top-sm margin-bottom-sm">
<text>{{ newsData.create_time_text }}</text>
<!-- <text>{{newsData.type | typeF}}</text> -->
</view>
<!-- <image mode="widthFix" :src="newsData.cover_image" @click="previewImage(0)"></image> -->
<!-- 中间文章区域 -->
<view class="contentBox text-lg text-black margin-top-sm margin-tb-lg">
<mp-html :tag-style="tagStyle" :scroll-table="true" :content="newsData.contents" /> <mp-html :tag-style="tagStyle" :scroll-table="true" :content="newsData.contents" />
</view> </view>
<!-- 地图区域 -->
<view class="mapSection margin-top-lg">
<view class="mapTitle text-xl text-black text-bold margin-bottom-sm">
<text class="cuIcon-locationfill text-blue margin-right-xs"></text>
我们的位置
</view>
<view class="mapContainer">
<map
:latitude="mapData.latitude"
:longitude="mapData.longitude"
:markers="mapData.markers"
:scale="mapData.scale"
:show-location="true"
@markertap="handleMarkerTap"
@callouttap="handleCalloutTap"
class="map"
></map>
</view>
</view>
</view> </view>
<!-- <view class="cu-bar justify-left bg-white margin-top-sm"> <!-- <view class="cu-bar justify-left bg-white margin-top-sm">
@ -68,6 +79,29 @@
table: 'border: 1px solid gray;border-collapse:collapse', table: 'border: 1px solid gray;border-collapse:collapse',
th: 'border: 1px solid gray;', th: 'border: 1px solid gray;',
td: 'border: 1px solid gray;' td: 'border: 1px solid gray;'
},
//
mapData: {
latitude: 34.621881, //
longitude: 112.436631, //
scale: 17, //
markers: [{
id: 1,
latitude: 34.621881,
longitude: 112.436631,
title: '名扬体育学院',
width:15,
height:20,
callout: {
content: '名扬体育学院',
color: '#000000',
fontSize: 14,
borderRadius: 8,
bgColor: '#ffffff',
padding: 8,
display: 'ALWAYS'
}
}]
} }
} }
}, },
@ -88,6 +122,36 @@
} }
}) })
}, },
//
openNavigation() {
uni.openLocation({
latitude: this.mapData.latitude,
longitude: this.mapData.longitude,
name: '名扬体育学院',
address: '名扬体育学院',
scale: 18,
success: () => {
console.log('成功打开地图导航');
},
fail: (err) => {
console.error('打开地图导航失败', err);
uni.showToast({
title: '打开地图失败',
icon: 'none'
});
}
});
},
//
handleMarkerTap(e) {
console.log('标记点被点击', e);
this.openNavigation();
},
// callout
handleCalloutTap(e) {
console.log('callout被点击', e);
this.openNavigation();
},
handleBack() { handleBack() {
this.utils.goto('news-list') this.utils.goto('news-list')
}, },
@ -121,8 +185,6 @@
.container { .container {
background-color: #f2f2f2; background-color: #f2f2f2;
width: 750rpx;
} }
.solid { .solid {
@ -140,4 +202,30 @@
left: 0; left: 0;
bottom: 0rpx; bottom: 0rpx;
} }
/* 地图相关样式 */
.mapSection {
background-color: #FFFFFF;
margin-top: 20rpx;
border-radius: 16rpx;
}
.mapTitle {
display: flex;
align-items: center;
margin-bottom: 20rpx;
}
.mapContainer {
width: 100%;
height: 400rpx;
border-radius: 12rpx;
overflow: hidden;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
}
.map {
width: 100%;
height: 100%;
}
</style> </style>

View File

@ -42,7 +42,7 @@
<view class="tn-tabbar-height"></view> <view class="tn-tabbar-height"></view>
<!-- 底部导航栏组件 --> <!-- 底部导航栏组件 -->
<tabbar :theme="tabbarStyle"></tabbar> <!-- <tabbar :theme="tabbarStyle"></tabbar> -->
</view> </view>
</template> </template>

View File

@ -37,6 +37,7 @@
:confirmCateContent="confirmCateContent" v-on:paySuccess="goTrain()" v-on:codeSuccess="goTrain()" :confirmCateContent="confirmCateContent" v-on:paySuccess="goTrain()" v-on:codeSuccess="goTrain()"
v-on:cancel="closeDialog"> v-on:cancel="closeDialog">
</kz-cate-pay> </kz-cate-pay>
<tabbar :theme="tabbarStyle"></tabbar>
</view> </view>
</template> </template>

View File

@ -33,7 +33,7 @@ const store = new Vuex.Store({
state: { state: {
// 如果上面从本地获取的lifeData对象下有对应的属性就赋值给state中对应的变量 // 如果上面从本地获取的lifeData对象下有对应的属性就赋值给state中对应的变量
// 加上vuex_前缀是防止变量名冲突也让人一目了然 // 加上vuex_前缀是防止变量名冲突也让人一目了然
vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {name: '图鸟'}, vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {name: '灵睿'},
// 如果vuex_version无需保存到本地永久存储无需lifeData.vuex_version方式 // 如果vuex_version无需保存到本地永久存储无需lifeData.vuex_version方式
// app版本 // app版本