更新项目

This commit is contained in:
liuyuan
2025-03-20 16:14:57 +08:00
parent 37829438bc
commit fbce03f09f
6 changed files with 86 additions and 82 deletions

View File

@@ -18,10 +18,6 @@ export default {
}; };
}, },
onLaunch: function() { onLaunch: function() {
// #ifdef APP-PLUS
// 注册事件
plus.globalEvent.addEventListener("plusMessage", this.plusMessageHandler);
// #endif
// 禁止横屏 // 禁止横屏
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.screen.lockOrientation("portrait-primary"); plus.screen.lockOrientation("portrait-primary");

View File

@@ -2,8 +2,8 @@
"name" : "心灵空间", "name" : "心灵空间",
"appid" : "__UNI__BBBDFD2", "appid" : "__UNI__BBBDFD2",
"description" : "心灵空间", "description" : "心灵空间",
"versionName" : "1.0.03", "versionName" : "1.0.04",
"versionCode" : 1003, "versionCode" : 1004,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

View File

@@ -28,7 +28,7 @@
<view class="list_block" v-if="!statusXLCP" :style="labelsList.length>0&&childrenList.length==0?`marginTop: ${45 + statusBarHeight}px;`:''"> <view class="list_block" v-if="!statusXLCP" :style="labelsList.length>0&&childrenList.length==0?`marginTop: ${45 + statusBarHeight}px;`:''">
<view class="list_item" v-if="list.length>0" v-for="(item,index) in list" :key="index" @click.stop="goToDetail(item)"> <view class="list_item" v-if="list.length>0" v-for="(item,index) in list" :key="index" @click.stop="goToDetail(item)">
<view class="list_item_image"> <view class="list_item_image">
<image v-if="item.squareImage" :src="item.squareImage" mode="aspectFit"></image> <image v-if="item.image" :src="item.image" mode="aspectFit"></image>
<text class="image_null" v-else>暂无封面图</text> <text class="image_null" v-else>暂无封面图</text>
</view> </view>
<view class="list_item_right"> <view class="list_item_right">
@@ -44,7 +44,7 @@
{{formatContent(v.title)}}<text v-if="i !== item.courseCatalogueEntityList.length - 1">/</text> {{formatContent(v.title)}}<text v-if="i !== item.courseCatalogueEntityList.length - 1">/</text>
</text> </text>
<text v-if="item.courseCatalogueEntityList[0].halfFee==0" style="padding-left: 20rpx;">免费</text> <text v-if="item.courseCatalogueEntityList[0].halfFee==0" style="padding-left: 20rpx;">免费</text>
<text v-else style="margin-left: 20rpx;">¥{{item.courseCatalogueEntityList[0].halfFee}}/{{item.courseCatalogueEntityList[0].fee}}</text> <text v-else style="margin-left: 20rpx;">{{item.courseCatalogueEntityList[0].halfFee}}/{{item.courseCatalogueEntityList[0].fee}}</text>
</view> </view>
<text class="list_item_study">了解课程</text> <text class="list_item_study">了解课程</text>
</view> </view>
@@ -128,7 +128,7 @@ export default {
this.title = options.title; this.title = options.title;
this.id = options.id; this.id = options.id;
//如果是心理评测 //如果是心理评测
if(this.id==87){ if(this.id==75){
this.statusXLCP = true; this.statusXLCP = true;
this.getFormList(); this.getFormList();
} }
@@ -205,7 +205,7 @@ export default {
this.labelsList = res.labels; this.labelsList = res.labels;
//如果是心理测评 //如果是心理测评
if(this.id == 87){ if(this.id == 75){
this.XL_id = this.labelsList[0].id; this.XL_id = this.labelsList[0].id;
} }
//判断是否有子级 //判断是否有子级
@@ -238,7 +238,7 @@ export default {
this.statusNull = null; this.statusNull = null;
this.activeTab = index; this.activeTab = index;
//如果是心理测评 //如果是心理测评
if(this.id == 87){ if(this.id == 75){
this.XL_id = item.id; this.XL_id = item.id;
} }
if(item.isLast == 1) { if(item.isLast == 1) {
@@ -450,8 +450,8 @@ export default {
border-radius: 10rpx; border-radius: 10rpx;
} }
.list_item_image,.image_null{ .list_item_image,.image_null{
width: 240rpx; width: 250rpx;
height: 240rpx; height: 220rpx;
background-color: rgba(125, 193, 240, 0.1); background-color: rgba(125, 193, 240, 0.1);
display: flex; display: flex;
justify-content: center; justify-content: center;

View File

@@ -169,7 +169,7 @@ export default {
<style scoped> <style scoped>
.viewWrap{ .viewWrap{
height: 100vh; height: 100vh;
background-color: #f4f7ff; background-color: #eff5f8;
} }
.scale_block{ .scale_block{
padding: 20rpx; padding: 20rpx;

View File

@@ -18,7 +18,7 @@
<image style="width: 100%" :src="curriculumData.image" mode="widthFix"></image> <image style="width: 100%" :src="curriculumData.image" mode="widthFix"></image>
</view> </view>
<view class="containerBg1" :style="`${curriculumData.content && curriculumData.content != ''? 'padding:10rpx 0;': ''}`"> <view class="containerBg1">
<view class="course_info_box"> <view class="course_info_box">
<view class="course_info"> <view class="course_info">
<view class="flexbox course_title" v-if="curriculumData.id"> <view class="flexbox course_title" v-if="curriculumData.id">
@@ -30,13 +30,18 @@
<view class="containerBg" v-if="curriculumData.content && curriculumData.content != ''"> <view class="containerBg" v-if="curriculumData.content && curriculumData.content != ''">
<view class="prof"> <view class="prof">
<view style="padding: 0 20rpx; position: relative;"> <view style="padding: 0 20rpx; position: relative;">
<view :class="`${isHideCourseInfo ? 'hidden2' : ''}`" v-html="curriculumData.content"> <view :class="`${isHideCourseInfo ? 'hidden2' : ''}`" v-html="parsedContent"></view>
<view v-for="(image, index) in images" :key="index" style=" width: 100%; margin-top: 10rpx;">
<image
style=" width: 100%;"
:src="image" mode="widthFix"
@tap="handleImageClick(image, index)"
/>
</view> </view>
<br/>
<text @click="isHideCourseInfo = !isHideCourseInfo" style=" <text @click="isHideCourseInfo = !isHideCourseInfo" style="
font-size: 24rpx; font-size: 24rpx;
position: absolute; position: absolute;
bottom: 0; bottom: -40rpx;
right: 20rpx; right: 20rpx;
color: #838588; color: #838588;
"> ">
@@ -250,6 +255,9 @@
userVip: null, //是否是vip userVip: null, //是否是vip
courseVipModule: [], //该课程需要什么类型的vip courseVipModule: [], //该课程需要什么类型的vip
textList: [], //转化文字集合 textList: [], //转化文字集合
//存储解析后的内容
parsedContent: '',
images: []
}; };
}, },
onLoad(options) { onLoad(options) {
@@ -278,6 +286,33 @@
}); });
}, },
methods: { methods: {
//删除文本里的图片
removeImagesFromHTML() {
const cleanText = this.curriculumData.content.replace(/<img[^>]*>/g, '');
this.parsedContent = cleanText; // 更新去除图片后的文本
this.extractImagesFromHTML();
},
//把文本里的图片另存起来
extractImagesFromHTML() {
const imgUrls = [];
// 使用正则表达式从 HTML 中提取所有图片的 src 属性
const regex = /<img[^>]+src="([^"]+)"[^>]*>/g;
let match;
while ((match = regex.exec(this.curriculumData.content)) !== null) {
imgUrls.push(match[1]);
}
this.images = imgUrls; // 更新 images 数组
},
// 处理图片点击事件
handleImageClick(image, index) {
uni.previewImage({
current: image, // 当前点击的图片
urls: this.images, // 所有图片的 URL 列表
currentIndex: index // 当前图片的索引
});
},
//点击顶部按钮 //点击顶部按钮
handleClickGetVip() { handleClickGetVip() {
uni.navigateTo({ uni.navigateTo({
@@ -522,6 +557,8 @@
courseList: [...list], courseList: [...list],
}; };
} }
//获取的数据解析
this.removeImagesFromHTML();
setTimeout(() => { setTimeout(() => {
that.$refs.commonAnchorLink.getDistanceArr(); that.$refs.commonAnchorLink.getDistanceArr();
@@ -1087,10 +1124,6 @@
} }
.course_info_box { .course_info_box {
.course_info {
overflow: hidden;
padding-bottom: 10rpx;
}
} }
.catalogue_title { .catalogue_title {
@@ -1140,8 +1173,6 @@
.containerBg2 { .containerBg2 {
width: 100%; width: 100%;
// padding-top: 40rpx;
// margin-top: 100rpx;
.shiting { .shiting {
line-height: 100rpx; line-height: 100rpx;
@@ -1278,10 +1309,13 @@
width: 100%; width: 100%;
} }
.containerBg{
padding-bottom: 30rpx;
}
.containerBg1 { .containerBg1 {
padding: 20rpx 0;
background: #fff; background: #fff;
border-top: 1px solid #fff; border-top: 1px solid #fff;
margin-top: -4rpx;
} }
.courseTitle { .courseTitle {

View File

@@ -12,7 +12,7 @@
<view class="appJump" v-if="$platform=='android'"> <view class="appJump" v-if="$platform=='android'">
<view class="app_item wumen" @click="appjumpfun('wumen')"> <view class="app_item wumen" @click="appjumpfun('wumen')">
<view class="img"> <view class="img">
<image src="@/static/logo_wumen.png" mode="widthFix"></image> <image src="@/static/logo_wumen.png"></image>
</view> </view>
<view class="text"> <view class="text">
<text>吴门医述</text> <text>吴门医述</text>
@@ -20,7 +20,7 @@
</view> </view>
<view class="app_item zmzm" @click="appjumpfun('zmzm')"> <view class="app_item zmzm" @click="appjumpfun('zmzm')">
<view class="img"> <view class="img">
<image src="@/static/logo_zmzm.png" mode="widthFix"></image> <image src="@/static/logo_zmzm.png"></image>
</view> </view>
<view class="text"> <view class="text">
<text>众妙之门</text> <text>众妙之门</text>
@@ -28,7 +28,7 @@
</view> </view>
<view class="app_item fzds" @click="appjumpfun('nuttyreading')"> <view class="app_item fzds" @click="appjumpfun('nuttyreading')">
<view class="img"> <view class="img">
<image src="@/static/logo_fzds.png" mode="widthFix"></image> <image src="@/static/logo_fzds.png"></image>
</view> </view>
<view class="text"> <view class="text">
<text>疯子读书</text> <text>疯子读书</text>
@@ -36,25 +36,16 @@
</view> </view>
</view> </view>
<view class="cate_box"> <view class="cate_box">
<view class="cate_list"> <scroll-view scroll-x="true">
<view class="cate_item_box" <view class="cate_list" v-if="cateList.length>0">
:class="cateIndex==index?'cate_item_box_active':''" <view class="cate_item_box" v-for="(item, index) in cateList" @click="handleClickCate(item)">
:style="`width: ${(100/cateList.length)}%`"
v-for="(item, index) in cateList" :key="index"
@click="handleClickCate(item,index)"
>
<view class="cate_item_border"> <view class="cate_item_border">
<image :src="item.icon"></image> <image :src="item.icon"></image>
</view> </view>
<view class="cate_item_name">{{ item.title }}</view> <view class="cate_item_name">{{ item.title }}</view>
</view> </view>
</view> </view>
<view class="sub_list"> </scroll-view>
<view class="sub_item_box" v-for="(item,index) in subList" :key="index"
@click="handleClickSub(item)">
<view class="sub_item_name">{{ item.title }}</view>
</view>
</view>
</view> </view>
<view class="notice_box" v-if="noticeList.length>0"> <view class="notice_box" v-if="noticeList.length>0">
<view class="flash_sale_top"> <view class="flash_sale_top">
@@ -122,6 +113,7 @@
</template> </template>
<script> <script>
import $http from "@/config/requestConfig.js";
export default { export default {
data() { data() {
return { return {
@@ -217,9 +209,6 @@ export default {
}) })
.catch(e=>{ .catch(e=>{
uni.setStorageSync("guidePages", 2); uni.setStorageSync("guidePages", 2);
uni.redirectTo({
url: "/pages/user/login",
});
}); });
}, },
//获取二级列表数据 //获取二级列表数据
@@ -345,14 +334,8 @@ export default {
url: url, url: url,
}); });
}, },
//分类点击切换 //课程列表
handleClickCate(item,index){ handleClickCate(item){
this.cateIndex = index;
this.getSubList(item.id);
uni.setStorageSync('cateIndex', this.cateIndex);
},
//二级点击-课程列表
handleClickSub(item){
uni.navigateTo({ uni.navigateTo({
url: `/pages/curriculum/list/index?title=${item.title}&id=${item.id}`, url: `/pages/curriculum/list/index?title=${item.title}&id=${item.id}`,
}); });
@@ -479,53 +462,44 @@ export default {
} }
.cate_box { .cate_box {
border: 1rpx solid #7dc1f0; background: #7dc1f0;
box-shadow: 0rpx 0rpx 6rpx 0rpx #f9f6ea;
border-radius: 10rpx; border-radius: 10rpx;
.cate_list{ .cate_list{
display: flex; display: flex;
align-items: center; align-items: center;
border-bottom: 0.5px solid #fff; justify-content: space-around;
.cate_item_box { .cate_item_box {
padding: 25rpx 0; width: 20%;
display: flex; padding: 40rpx 0 30rpx;
align-items: center;
justify-content: center;
.cate_item_border {
width: 56rpx;
height: 56rpx;
background: #7dc1f0;
border-radius: 10rpx;
display: flex;
align-items: center;
justify-content: center;
margin-right: 12rpx;
image{
width: 40rpx;
height: 40rpx;
}
}
.cate_item_name {
font-size: 28rpx;
line-height: 34rpx;
text-align: center; text-align: center;
color: #294a97;
font-weight: bold;
}
}
.cate_item_box_active{
background: #7dc1f0;
.cate_item_border { .cate_item_border {
width: 60rpx;
height: 60rpx;
background-size: 100% 100%; background-size: 100% 100%;
background-image: url("@/static/cate_bg.png"); background-image: url("@/static/cate_bg.png");
border-radius: 4rpx;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
image{
width: 46rpx;
height: 46rpx;
} }
}
.cate_item_name { .cate_item_name {
margin-top: 15rpx;
font-size: 26rpx;
line-height: 34rpx;
text-align: center;
color: #fff; color: #fff;
font-weight: bold;
} }
} }
} }