锚链接

This commit is contained in:
2024-07-01 13:49:42 +08:00
parent f1212a42d7
commit a174c3e4d5
172 changed files with 11881 additions and 8893 deletions

View File

@@ -4,85 +4,95 @@
<public-module></public-module>
<z-nav-bar title="课程设置" bgColor="#3AB3AE" fontColor="#fff"></z-nav-bar>
<view :style="`height:calc(100vh - ${50 + statusBarHeight}px) !important`">
<!-- <scroll-view class="scroll-view_H cateList" scroll-x="true" scroll-left="0"> -->
<view class="cateList flexbox">
<text
:class="[currentCateIndex == index ? 'cur' : '']"
@click="setOneCateIndex(item, index)"
v-for="(item, index) in cateList"
:key="item.type"
>{{ item.title }}</text
<common-anchor-link
style="width: 100%"
ref="commonAnchorLink"
baseHeight="80"
:allDataList="allDataList"
titleKey="title"
:dataListKey="currentCateIndex == 0 ? 'courseList' : 'content'"
:titleStyle="{
'font-size': '30px',
'text-align': 'center',
}"
:tabStyle="{
background: '#f3faf3',
}"
>
<template slot="tabs" slot-scope="slotProps">
<common-sticky
label="title"
itemStyle="width:50%;padding-left: 15px; padding-right: 15px; height: 68rpx;"
:list="cateList"
:currentCateIndex="currentCateIndex"
@handleselectCate="handleselectCate"
></common-sticky>
</template>
<template slot="label" slot-scope="slotProps">
<view class="content_title PM_font">{{ slotProps.title }}</view>
</template>
<template slot="contentList" slot-scope="slotProps">
<common-list
v-if="currentCateIndex == 0"
noDataIcon="data"
:isCondition="true"
:isNoIcon="true"
:dataList="slotProps.dataList"
label="title"
@hancleClick="gotoDetail"
>
</view>
<template slot="labelSlot" slot-scope="slotProps">
<image
v-if="slotProps.row.image"
:src="slotProps.row.image"
mode="aspectFil"
class="book_image"
></image>
<image
v-else
src="@/static/icon/videoIcon.png"
mode="aspectFil"
class="book_image"
></image>
<view
:class="`priceDetail commonPageWhiteBox`"
v-if="this.cateList[this.currentCateIndex].type == 'price'"
>
<scroll-view scroll-y="true" class="scroll-Y">
<price
ref="priceDetail"
type="price"
:oid="this.cateList[this.currentCateIndex].oid"
></price>
</scroll-view>
</view>
<view
:class="`priceDetail commonPageWhiteBox`"
v-else-if="
this.cateList[this.currentCateIndex].type == 'purchaseNotice'
"
>
<scroll-view scroll-y="true" class="scroll-Y">
<price
ref="purchaseNotice"
:oid="this.cateList[this.currentCateIndex].oid"
></price>
</scroll-view>
</view>
<view class="related_courses_name">
<view class="" style="font-weight: bold">
{{ slotProps.row.title }}
</view>
<view
:class="`priceDetail commonPageWhiteBox`"
v-else-if="
this.cateList[this.currentCateIndex].type == 'instructionsForUse'
"
>
<instructionsForUse ref="instructionsForUse"></instructionsForUse>
</view>
<view style="margin-top: 10rpx">
<view
v-for="item in slotProps.row.courseCatalogueEntityList"
style="float: left; margin-right: 20rpx"
>
{{
slotProps.row.courseCatalogueEntityList.length > 1
? item.title
: "整部"
}}
<view :class="`dataList priceDetail`" v-else>
<!-- <image src="@/static/image/headImg/top.png" mode="aspectFit" class="headImage"></image> -->
<view
v-if="
this.cateList[this.currentCateIndex].type == 'courseDescription'
"
>
<courseDescription
ref="courseDescription"
:dataList="dataList"
@hancleClick="goCourseDescription"
label="nameCN"
>
</courseDescription>
<text v-if="item.halfFee == 0 && item.fee == 0">免费</text>
<text v-else-if="item.halfFee == 0 || item.fee == 0">
{{ item.halfFee != 0 ? item.halfFee : "免费" }}/{{
item.fee != 0 ? item.fee : "免费"
}}</text
>
<text v-else-if="item.halfFee != 0 || item.fee != 0">
{{ item.halfFee }}/{{ item.fee }}</text
>
</view>
</view>
</view>
</template>
</common-list>
<view v-else style="padding: 20px 20rpx 40px">
<rich-text
:nodes="slotProps.dataList"
:data-nodes="slotProps.dataList"
></rich-text>
</view>
<!-- <template v-if="currentCateIndex == 2 && curTwoCateIndex == 2">
<u-grid :col="3">
<u-grid-item class="scroll-view-item " v-for="(item, index) in dataList" :key="item.id"
@click="previewImage(item.url)" style="align-items: flex-start;">
<img :src="item.url" alt="" class="wmzhimg" mode="aspectFit">
</u-grid-item>
</u-grid>
</template> -->
</view>
</view>
</template>
</common-anchor-link>
</view>
</template>
@@ -102,30 +112,21 @@ export default {
},
data() {
return {
currentTab: "",
allDataList: [],
playData: {},
searchValue: "",
cateList: [
{
title: "课程价格(半年/一年)",
type: "price",
oid: "8a9fb99809e4428888aad6b56a3096a6",
apiUrl: "/sociology/course/getCoursePrice",
},
{
title: "课程说明",
type: "courseDescription",
apiUrl: "app/phoneDoctor.do?getTaiHuToShine",
apiUrl: "/sociology/course/getSociologyCourseRecord",
},
// , {
// title: "使用须知",
// type: 'instructionsForUse'
// }, {
// title: "购买须知",
// type: 'purchaseNotice',
// oid: 'd0f47071c2194e94845fbb373d06f59d',
// }
], // 一级分类标题1
twoCateList: [], // 二级分类标题
dataList: [], // 方剂标题
@@ -141,11 +142,14 @@ export default {
scrollViewHeight: 0,
};
},
onLoad() {
// this.getCourseDescriptionData()
this.getPriceData();
// this.getUserInfo()
// this.getCateList()
// 监听页面滚动
onPageScroll(event) {
// if (this.currentCateIndex == 0) {
this.$refs.commonAnchorLink.pageScroll(event);
// }
},
async onLoad() {
await this.handleselectCate({ ...this.cateList[0], index: 0 }, 0);
},
onHide() {
// this.showSearchList = false
@@ -155,6 +159,13 @@ export default {
...mapState(["userInfo"]),
},
methods: {
gotoDetail(v) {
console.log(v);
uni.navigateTo({
// url: '../bookShop/commodityDetail?id=' + item.id
url: `/pages/curriculum/order/curriculum/index?navTitle=${v.title}&title=${v.title}&id=${v.id}`,
});
},
goCourseDescription(v) {
console.log(v);
uni.navigateTo({
@@ -162,25 +173,7 @@ export default {
url: `/pages/courseInformation/courseDescription/index?navTitle=${v.nameCN}&title=${v.nameCN}&oid=${v.oid}`,
});
},
getCourseDescriptionData() {
console.log(this.$store.state, "11111111111");
this.$http
.post("app/phoneDoctor.do?getTaiHuToShine", {
customerType: "D",
token: uni.getStorageSync("token"),
customerOid: uni.getStorageSync("customerOid"),
oid: "b07e45f6a5f3491db9854b16f3fd8b19",
step: 0,
limit: 100,
})
.then((res) => {
console.log(res.obj.dataLst, "7777777777777777777");
this.dataList = res.obj.dataLst;
// socket.init();
});
},
getPriceData() {
var that = this;
setTimeout(() => {
@@ -385,78 +378,88 @@ export default {
this.curTwoCateIndex = index;
this.getTitles(dictType);
},
async setOneCateIndex(item, index) {
console.log(index, 99999);
getCourseDescriptionData() {
this.allDataList = [];
var data = {};
var that = this;
switch (item.type) {
case "courseDescription":
setTimeout(() => {
that.$nextTick(() => {
that.$refs.courseDescription.getData();
this.$http
.request({
url: this.cateList[this.currentCateIndex].apiUrl,
method: "POST",
data: data,
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
console.log(res, "88888");
if (this.currentCateIndex == 0) {
that.allDataList = res.list.map((e) => {
return {
...e.sociology,
courseList: e.courseList,
};
});
}, 100);
} else {
this.allDataList = [
{
title: "购买须知",
valueName: "buyRecord",
url: "/pages/curriculum/cate/index",
content: res.result.buyRecord,
},
{
title: "使用须知",
valueName: "useRecord",
url: "/pages/curriculum/cate/index",
content: res.result.useRecord,
},
{
title: "学习次序",
valueName: "studyRecord",
url: "/pages/curriculum/cate/index",
content: res.result.studyRecord,
},
{
title: "超v",
valueName: "vipRecord",
url: "/pages/curriculum/cate/index",
content: res.result.vipRecord,
},
];
break;
case "price":
console.log("this.allDataList at line 405:", this.allDataList);
}
// if (this.currentCateIndex == 0) {
setTimeout(() => {
that.$nextTick(() => {
that.$refs.priceDetail.getData();
});
}, 100);
break;
case "purchaseNotice":
setTimeout(() => {
that.$nextTick(() => {
that.$refs.purchaseNotice.getData();
});
}, 100);
break;
case "instructionsForUse":
setTimeout(() => {
that.$nextTick(() => {
that.$refs.instructionsForUse.getData();
});
}, 100);
// that.getPriceData()
break;
}
// if(this.userMes.tgdzPower == 0){
// let that = this
// uni.showModal({
// content: "购买 针灸六经法要上册和下册 后方可使用此功能",
// confirmText: '好的',
// showCancel: false,
// success: function(res) {
// if (res.confirm) {
// // console.log('用户点击确定');
// }
// }
// })
// return
// }
// if(item.title == "时辰取穴"){
// uni.navigateTo({
// url: "../timeAcupoint/timeAcupoint"
// })
// return
// }
let type = item.type;
this.currentCateIndex = index;
this.$refs.commonAnchorLink.getDistanceArr();
}, 200);
// }
// this.indexList = this.allDataList.map((e) => {
// return e.title;
// });
});
},
async handleselectCate(item, index) {
this.allDataList = [];
this.dataList = [];
var data = [];
this.searchValue = "";
this.searchList = [];
this.showSearchList = false;
// if (index != 2) {
var that = this;
this.$nextTick(async () => {
this.currentCateIndex = item.index;
// uni.createSelectorQuery().select('.cateList').boundingClientRect(function (rect) {
// var height = rect.height
// console.log('元素高度:',);
await this.getCourseDescriptionData();
});
console.log(this.allDataList, this.dataList, "1688");
// }).exec();
// } else {
// this.getJFList(dictType)
// }
return data;
},
transformData(inputData) {
@@ -631,6 +634,7 @@ export default {
</script>
<style lang="scss" scoped>
@import "@/style/common.scss";
.u-grid-list {
// height: 40rpx;
}
@@ -807,4 +811,42 @@ export default {
.componentPage {
height: calc(100% - 90rpx) !important;
}
.book_image {
width: 60rpx;
height: 40rpx;
float: left;
margin-right: 10rpx;
}
/deep/.list_item {
padding: 12rpx 20rpx;
display: flex;
align-items: center;
border-color: #efeef4 !important;
// .rightArrow {
// margin-top: 10rpx !important;
// }
}
.section .top .title {
&::before {
display: none !important;
}
}
.content_title {
width: 100%;
text-align: center;
font-size: 30px;
}
// .commonDetailPage{
// background-color: $themeBgColor;
// }
/deep/.wrapper {
background-color: $themeBgColor;
.content_list {
padding: 20rpx 0;
background-color: rgba(255, 255, 255, 0.8) !important;
}
}
</style>