This commit is contained in:
2025-04-18 16:32:32 +08:00
parent 09c087508f
commit 8e44473164
74 changed files with 24833 additions and 10335 deletions

202
components/buyPupFudu.vue Normal file
View File

@@ -0,0 +1,202 @@
<template>
<view>
<u-popup key="1" :show="pricespop" :round="10" @close="closePup">
<view class="proListPrice" v-if="proPriceList.length > 0">
<view class="title">
请选择
</view>
<view class="list">
<view :class="['item',curProId == index ? 'active' : '']"
v-for="(item,index) in proPriceList" :key="index" @click="choosePrice(item,index)">
{{item.productName}} - {{item.price}}
</view>
</view>
<view class="tbn flexbox" style="padding-bottom: 20px;">
<view class="saveBtnss buybtn flexbox" @click="oprate('buy')">
<u-icon name="bag" color="#fff" size="28"></u-icon>
<text>立即购买</text>
</view>
<!-- <view class="saveBtnss gouwuche flexbox" @click="oprate('gouwuche')">
<uni-icons type="cart" size="28" style="color: #666;"></uni-icons>
<text>加入购物车</text>
</view> -->
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
name:"buyPup",
props:['proPriceList'],
data() {
return {
pricespop:true,
curProId:null,
curPro:{}
};
},methods:{
closePup() {
this.pricespop = false
this.$emit('closePup')
},
choosePrice(item,index) {
console.log(index, 'choosePrice')
this.curProId = index
this.curPro = item
},
oprate(val){
if(this.curProId==null){
uni.showToast({
title:'请选择您的课程',
icon:'none'
})
return
}
if(val=='buy'){
console.log('直接购买');
this.$emit('oprate',{name:val,item:this.curPro,index:this.curProId})
}else if(val == 'gouwuche'){
console.log('加入购物车');
this.$emit('oprate',{name:val,item:this.curPro,index:this.curProId})
}
this.closePup()
}
}
}
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.flexbox {
display: flex;
}
.saveBtn {
align-items: center;
justify-content: center;
height: 80rpx;
background-color: #00d8df;
// width: 46%;
overflow: hidden;
border-radius: 30rpx;
text {
padding-left: 10rpx;
font-size: 28rpx;
color: #fff;
}
}
.vipBtn {
@include theme("vipbtnbg");
border-radius: 100rpx;
justify-content: center;
width: 150px;
color: #fff;
margin: 10rpx auto;
}
.buyBox {
// position: fixed;
// z-index: 2;
// bottom: 100rpx;
// left: 0;
@include pleft_right(4px);
// @include mshadow(10px, 1);
padding: 20rpx 10rpx;
width: 100%;
font-size: 28rpx;
flex-wrap: wrap;
background-image: linear-gradient(60deg, #e0e9f6 0%,#ece6fa 30%,#d7e8f0 60%, #fff 100%);
// background: rgba(255, 255, 255, 0.9);
.item {
width: 100%;
text-align: center; line-height: 70rpx !important;
}
.tbn {
align-items: center;
}
.buybtn {
color: #fff;
}
}
.proListPrice {
text-align: center;
.title {
font-size: 28rpx;
margin: 10px 0;
}
.list {
padding: 0 10px;
padding-bottom: 20rpx;
.item {
font-size: 26rpx;
color: #333;
margin-bottom: 10rpx;
padding-top:20rpx ;
padding-bottom:20rpx ;
line-height:40rpx;
border-radius: 50rpx;
border: 1px solid #eee;
}
.item.active {
color: $themeColor;
border: 1px solid $themeColor;
}
.item:last-child {
// border-bottom: none
}
}
.tbn {
justify-content: center;
}
.buybtn { padding: 0 20rpx;
background-color: #00d8df;
margin: 0;
margin-right: 20rpx;
text {
color: #fff;
}
}
.saveBtnss {
align-items: center;
justify-content: center;
height: 80rpx;
// width: 46%;
overflow: hidden;
border-radius: 50rpx;
text {
padding-left: 10rpx;
font-size: 28rpx;
}
}
.gouwuche {
border: 1px solid #666;
padding-right: 20rpx;
text {
// color: #fff;
}
}
}
</style>

394
components/commentsList.vue Normal file
View File

@@ -0,0 +1,394 @@
<template>
<view class="">
<view class="box" v-if="sayList && sayList.length > 0">
<view class="firstLeve flexbox leve" v-for="(item, index) in sayList" :key="index" style="flex-wrap: wrap;">
<view v-if="item.user && item.user != null && item.user != 'null'" class="imgbox" :style="getBackGround(item.user.avatar)">
<view class="img">
<!-- <image :src="item.user.avatar" mode="aspectFit" style="width: 80rpx; height: 80rpx;"></image> -->
</view>
</view>
<view class="contentBox contentBoxfirstLeve">
<view class="name" v-if="item.user && item.user != null && item.user != 'null'">
{{item.user.name == '' ? '暂无昵称': item.user.name}}
</view>
<view class="content" v-if="item.content != ''">
<rich-text class="content" :nodes="formatRichText(item.content)"></rich-text>
</view>
<view class="imagesList flexbox" v-if="item.images !=''">
<view class="item" v-for="(item2, index2) in item.imgList" :key="index2">
<image @click="previewImage(item2)" :src="item2" mode="widthFix"
style="width: 80rpx; height: 80rpx;"></image>
</view>
</view>
<view class="others flexbox">
<view class="dianzan flexbox" @click="support('one',index,item)">
<u-icon v-if="item.support" name="heart-fill" color="#ff5500" size="24"></u-icon>
<u-icon v-else name="heart" color="#999" size="24"></u-icon>
<text>{{item.supportCount}}</text>
</view>
<view class="pinglun flexbox" @click="addSay(index,item)">
<!-- <u-icon name="chat-fill" color="#999" size="24"></u-icon> -->
<u-icon name="chat" color="#999" size="24"></u-icon>
<text>{{item.children && item.children.length > 0? item.children.length : 0}}</text>
</view>
<text>{{item.createTime}}</text>
</view>
</view>
<!-- 二级 -->
<view class="boxB" v-if="item.Bchildren && item.Bchildren.length > 0" style="width: 100%;">
<view class=" flexbox leve" v-for="(citem, cindex) in item.Bchildren" :key="cindex">
<view class="imgbox" :style="getBackGround(citem.user.avatar)">
<view class="img">
<image :src="citem.user.avatar" mode="aspectFit"></image>
</view>
</view>
<view class="contentBox">
<view class="name">
{{citem.user.name == '' ? '暂无昵称': citem.user.name}}
</view>
<view class="content" v-if="citem.content != ''">
<rich-text class="content" :nodes="formatRichText(citem.content)"></rich-text>
</view>
<view class="imagesList flexbox" v-if="citem.images !=''">
<view class="item" v-for="(item3, index3) in citem.imgList" :key="index3">
<image @click="previewImage(item3)" :src="item3" mode="widthFix"
style="width: 80rpx; height: 80rpx;"></image>
</view>
</view>
<view class="others flexbox">
<view class="dianzan flexbox" @click="support(index,cindex,citem)">
<u-icon v-if="citem.support" name="heart-fill" color="#ff5500" size="24"></u-icon>
<u-icon v-else name="heart" color="#999" size="24"></u-icon>
<text>{{citem.supportCount}}</text>
</view>
<!-- <view class="pinglun flexbox" @click="addSay(cindex,citem)">
<u-icon name="chat" color="#999" size="24"></u-icon>
<text>{{citem.children && citem.children.length > 0? item.children.length : 0}}</text>
</view> -->
<text style="margin-left: 20rpx;">{{citem.createTime}}</text>
</view>
</view>
</view>
<view class="loadMore" v-show="item.Bchildren.length < item.children.length" @click="showMoreChildren(index,item)">
<text>加载更多追评</text>
</view>
</view>
<!-- end -->
</view>
</view>
</view>
</template>
<script>
export default {
props:['sayList'],
name:"commentsList",
data() {
return {
};
},methods:{
// 加载更多子评论
showMoreChildren(i,val){
console.log('更多评论');
if(val.children.length <= val.Bchildren.length){
uni.showToast({
title:'没有更多了哦',
icon:'none'
})
return
}
let _list = []
let _cc = [...val.children]
_list = _cc.slice(val.Bchildren.length, val.Bchildren.length + 6)
this.sayList[i].Bchildren = this.sayList[i].Bchildren.concat(_list)
},
// 点赞
support(index1,index,val){
console.log(index1,index,val, '点赞');
this.$emit('support',{index1,index,val})
},
getBackGround(src){
// console.log(src,'src')
if(src == '' || src == null){
return `background: url(./static/icon/morenAvavter.png); background-size: cover;`
}else{
return `background: url(${src});background-size: cover;`
}
},
formatRichText(html) { //控制图片大小
let newContent = html.replace(/<img[^>]*>/gi, function(match, capture) {
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
return match;
});
newContent = newContent.replace(/style="[^"]+"/gi, function(match, capture) {
match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi,
'max-width:100%;');
return match;
});
newContent = newContent.replace(/<br[^>]*\/>/gi, '');
newContent = newContent.replace(/\<img/gi,
'<img style="max-width:40rpx;height:40rpx;display:inline-block;margin:10rpx auto;"');
return newContent;
},
previewImage(url) {
console.log(url)
uni.previewImage({
urls: [url],
longPressActions: {
itemList: ['很抱歉,暂不支持保存图片到本地'],
success: function(res) {
// console.log(res,'+++++')
}
}
});
},
addSay(index,item){
// console.log(index,item,'添加评论')
this.$emit('showSayModule',{index,item})
}
}
}
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.flexbox{display: flex;}
// ::v-deep .contentBox {
// .ql-editor {
// font-size: 26rpx;
// font-style: normal;
// min-height: 50rpx !important;
// padding: 20rpx;
// }
// img {
// width: 20px;
// }
// .u-upload__button {
// margin: 0 auto;
// }
// }
.liuyanBox {
padding: 0 20rpx;
margin-top: 20rpx;
.contentBoxfirstLeve{
width: calc(100% - 70rpx);
}
}
.leve {
margin-bottom: 20rpx;
.imgbox {
border: 1px solid #eee;
margin-right: 10rpx;
width: 60rpx;
height: 60rpx;
border-radius: 100%; overflow: hidden;
}
.contentBox {
font-size: 24rpx;
.name {
color: #999; font-size: 28rpx;
@include toe();
}
.content {
color: #333;
font-size: 28rpx;
margin-top: 10rpx;
}
.others {
margin-top: 10rpx;
color: #999; font-size: 28rpx;
align-items: center;
.dianzan {
align-items: center;
}
.pinglun {
align-items: center;
margin-left: 10rpx;
margin-right: 20rpx;
}
}
}
}
.firstLeve{padding-bottom: 10rpx; border-bottom: 1px solid #f7f8f9;}
.loadMore{text-align: center; margin-bottom: 20rpx;
text{color: $themeColor; font-size: 26rpx;}
}
.contentBox {
padding: 0 20rpx;
.icon {
width: 80rpx;
justify-content: center;
margin-left: 10rpx;
height: 80rpx;
align-items: center;
border: 1px solid #eee;
border-radius: 50rpx;
}
.addEmoji {
margin-right: 20rpx;
}
.imagesList { margin-top: 20rpx;
.item {
margin-right: 20rpx;
}
}
}
.boxB{margin-left: 60rpx; margin-top: 20rpx; background-color: #f7f8f9;
padding-top: 20rpx; padding-left:10rpx;
.imgbox{
width: 40rpx !important;
height: 40rpx !important;
}
.contentBox{width: calc(100% - 60rpx);}
// .img{ width: 60rpx;
// height: 60rpx;
// image{width:60rpx; height: 60rpx; border-radius: 100%;}
// }
}
.chooseImgType {
margin-top: 20rpx;
.item {
text-align: center;
margin-right: 20rpx;
padding: 10rpx;
box-sizing: border-box;
justify-content: center;
align-items: center;
width: 60px;
border: 1px solid #eee;
height: 60px;
text-align: center;
border-radius: 20rpx;
background-color: #f4f5f7;
// background-color: red;
text {
font-size: 24rpx;
display: inline-block;
width: 100%;
margin-top: -10rpx;
}
.img {
margin: 0 auto;
}
.ss {
line-height: 20rpx;
color: #666;
}
}
}
.sbmitBox {
button {
margin-top: 20rpx;
margin-bottom: 20rpx;
@include theme("btn_bg");
color: #fff;
}
}
.upimgList {
margin-top: 15px;
.item {
border: 1px solid #eee;
padding: 10rpx;
margin-right: 20rpx;
width: 100rpx;
height: 100rpx;
position: relative; overflow: hidden;
image {
width: 100%;
height: 100rpx;
}
span {
display: inline-block;
width: 20px;
height: 20px;
position: absolute;
right: -10px;
top: -10px;
z-index: 1;
border: 1px solid #eee;
border-radius: 20rpx;
background-color: #fff;
line-height: 20px;
font-size: 26rpx;
text-align: center;
}
}
}
.emojiBtn {
.img {
width: 50rpx;
height: 50rpx;
image {
width: 100%;
height: 50rpx;
}
}
}
.editorBox {
width: calc(100vw - 100rpx);
}
.ql-container {
min-height: 50rpx !important;
height: auto !important;
border: 1px solid #eee;
border-radius: 50rpx;
}
.contentBox {
padding: 0 20rpx;
.icon {
width: 80rpx;
justify-content: center;
margin-left: 10rpx;
height: 80rpx;
align-items: center;
border: 1px solid #eee;
border-radius: 50rpx;
}
.addEmoji {
margin-right: 20rpx;
}
.imagesList { margin-top: 20rpx;
.item {
margin-right: 20rpx;
}
}
}
</style>

388
components/orderCoupon.vue Normal file
View File

@@ -0,0 +1,388 @@
<template>
<view>
<!-- 优惠券弹出 -->
<u-popup :show="youhuiShow" :round="10" @close="closePup">
<view class="tanchu">
<view class="dp_title">请选择优惠券</view>
<template v-if="list.length > 0">
<view style="max-height: 40vh; overflow-y: scroll">
<view v-for="(item, index) in list" :key="index">
<view
:class="`youhuiItem ${
youhuiIndex === index ? ' youItem_style' : ''
} ${item.canUse === 0 ? 'disableSelect' : ''}`"
@click="choseYouhui(index)"
><text
class="border_radius_10"
style="
position: absolute;
top: 10rpx;
right: 10rpx;
font-size: 25rpx;
background-color: #ffe3e9;
color: #c81346;
padding: 6rpx;
"
>{{ item.couponEntity.couponRange | couponType }}</text
>
<view
style="width: 25%; color: #ff0043; text-align: center"
class="couponPrice"
>
<text></text>
<b style="font-size: 45rpx">{{
item.couponEntity.couponAmount
}}</b>
<text
class="useLevel"
style="
display: block;
color: #666;
font-size: 25rpx;
margin-top: 10rpx;
"
>{{ item.couponEntity.useLevel }}元可用</text
>
</view>
<view style="width: 68%; padding-left: 5%">
<view>
<text
style="
display: inline-block;
margin-right: 6rpx;
line-height: 36rpx;
"
>{{ item.couponEntity.couponName }}</text
>
</view>
<text
style="
display: block;
font-size: 22rpx;
color: #999;
margin-top: 10rpx;
"
>有效期至{{
item.effectType == 0 ? "永久有效" : item.endTime
}}</text
>
<template v-if="item.canUse == 0">
<view
class=""
style="font-size: 20rpx; display: inline-block"
>
<text style="color: #333">不可用原因</text>
<text style="color: #333">{{ item.canUseReason }}</text>
</view>
</template>
</view>
<view
style="width: 7%; position: absolute; right: 20rpx; top: 43%"
>
<!-- <view class="" style="background-color: #d9d9d9; border-radius: 10rpx; 0 0 10rpx; text-align: center;" v-if="item.canUse == 0">
<text
style="color: #999; "
>不可用</text>
</view> -->
<template v-if="item.canUse == 1">
<text
style="
border: 1px solid #d9d9d9;
width: 35rpx;
height: 35rpx;
display: inline-block;
border-radius: 30rpx;
"
v-if="youhuiIndex !== index"
></text>
<u-icon
name="checkmark-circle-fill"
color="#fd6004"
size="20"
v-if="youhuiIndex === index"
>
</u-icon>
</template>
</view>
<br clear="both" />
</view>
<u-collapse
v-if="source != 'goodsDetail' && item.couponEntity.remark"
style="
margin-top: 0rpx;
z-index: 10 !important;
background-color: #fafafa;
border-bottom-left-radius: 10rpx;
border-bottom-right-radius: 10rpx;
"
:border="false"
>
<u-collapse-item title="详细信息" name="Docs guide">
<view
v-if="item.couponEntity.remark"
style="
font-size: 22rpx;
width: 100%;
margin-right: 20rpx !important;
"
>使用说明{{ item.couponEntity.remark }}</view
>
</u-collapse-item>
</u-collapse>
</view>
<!-- <view style="font-size: 20rpx;color: #aaa;margin-top: 30rpx;">* 每笔订单只能使用一张优惠价</view> -->
</view>
<view class="btnBox flex_box flex_between" v-if="selectcouponList.length>0">
<view class="" style="width: 48%">
<button type="default" @click="confirmCoupon('none')">
不使用优惠券
</button>
</view>
<view class="" style="width: 48%">
<button type="primary" @click="confirmCoupon()">选好了</button>
</view>
</view>
<view class="btnBox flex_box flex_between" v-else>
<view class="" style="width: 100%">
<button type="default" @click="confirmCoupon('none')">
取消
</button>
</view>
</view>
</template>
<view class="" v-else>
<u-divider text="暂无可用优惠券哦"></u-divider>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
name: "orderCoupon",
props: ["list", "curCouponId", "sumMeony",'selectcouponList'],
data() {
return {
youhuiShow: true,
youhuiIndex: undefined,
};
},
mounted() {
console.log("进入了", this.curCouponId, this.sumMeony);
if (this.curCouponId) {
this.youhuiIndex = this.list.findIndex(
(item) => item.couponEntity.id === this.curCouponId
);
console.log("查找后的结果", this.youhuiIndex);
}
},
filters: {
couponType(type) {
// 0无限制 1课程卷 2课程品类卷
var str = "";
switch (type) {
case 0:
str = "全场通用";
break;
case 1:
str = "指定课程可用";
break;
case 2:
str = "指定课程品类可用";
break;
}
return str;
},
},
computed: {},
methods: {
closePup() {
this.youhuiIndex = undefined;
this.$emit("close");
},
// 确定选中优惠券
confirmCoupon(str) {
console.log(str, "6666");
if (str && str == "none") {
// 清空优惠券操作
this.$emit("confirmCoupon");
setTimeout(() => {
this.closePup();
}, 300);
return;
}
if (this.youhuiIndex == 0 || this.youhuiIndex) {
this.$emit("confirmCoupon", this.list[this.youhuiIndex]);
setTimeout(() => {
this.closePup();
}, 300);
} else {
uni.showToast({
title: "请选择您要使用的优惠券",
icon: "none",
});
}
},
// 选择优惠券
choseYouhui(e) {
if (this.list[e].canUse == 0) {
return;
}
console.log("选中优惠券e", e);
this.youhuiIndex = e;
},
},
};
</script>
<style lang="scss" scoped>
.btnBox {
margin-top: 20rpx;
}
.tanchu {
padding: 40rpx 30rpx 40rpx 30rpx;
position: relative;
// max-height: 60vh;
// overflow-y: scroll;
.dp_title {
font-size: 32rpx;
margin-bottom: 50rpx;
color: #555;
text-align: center;
font-weight: bold;
}
.dp_add {
position: absolute;
top: 40rpx;
right: 30rpx;
font-size: 22rpx;
background-color: #fd6004;
color: #fff;
border-radius: 10rpx;
padding: 5rpx 10rpx;
.u-icon {
display: inline-block;
margin-right: 5rpx;
}
}
.addressItem {
border: 2px dashed #d9d9d9;
border-radius: 10rpx;
width: 100%;
display: flex;
padding: 20rpx 10rpx;
margin: 25rpx 0 0 0;
align-items: center;
background-color: #fff;
.addrContent {
margin-left: 40rpx;
flex: 1;
.addrContentTop {
display: flex;
align-items: flex-end;
margin: 0 0 15rpx 0;
position: relative;
.userName {
font-size: 35rpx;
font-weight: bold;
margin-right: 30rpx;
}
.userTel {
font-size: 25rpx;
color: #888;
}
.userMoren {
border: 1px solid #fd6004;
color: #fd6004;
padding: 3rpx 10rpx;
font-size: 22rpx;
border-radius: 10rpx;
margin: 0 0 0 20rpx;
}
.chooseCheck {
position: absolute;
top: 3rpx;
right: 6rpx;
}
}
.addrContentBottom {
font-size: 32rpx;
}
}
}
.addressItem.addItem_style {
border-color: #fd6004;
}
.youhuiItem {
position: relative;
background: linear-gradient(to top right, #fff, #fef2f4);
border: 1px solid #d9d9d9;
border-radius: 10rpx;
width: 100%;
padding: 50rpx 20rpx 20rpx;
margin: 25rpx 0 0 0;
align-items: center;
background-color: #fff;
font-size: 30rpx;
}
.disableSelect {
background: linear-gradient(to top right, #fafafa, #fafafa) !important;
color: #979797 !important;
.couponPrice {
color: #979797 !important;
}
.useLevel {
color: #979797 !important;
}
.border_radius_10 {
color: #98989a !important;
background-color: #fafafa !important;
}
}
.youhuiItem > view {
float: left;
}
.youhuiItem.youItem_style {
border-color: #fd6004;
}
}
::v-deep .u-cell__body {
padding-top: 0 !important ;
padding-bottom: 0 !important ;
z-index: 10 !important ;
.u-cell__title-text {
color: #333 !important;
font-size: 24rpx !important;
padding-left: 0 !important;
}
}
::v-deep .u-collapse-item__content__text {
padding: 10rpx 20rpx !important;
box-sizing: border-box;
}
</style>

256
components/tagTree.vue Normal file
View File

@@ -0,0 +1,256 @@
<template>
<view>
<uni-drawer
ref="showRight"
mode="right"
:width="320"
@change="changeD($event, 'showRight')"
>
<view class="close">
<view class="zhan" style="width: 100%"></view>
<u-icon
name="close"
@click="closeDrawer('showRight')"
color="#117e4c"
size="28"
></u-icon>
</view>
<view class="proTitle">
<text>请选择课程分类</text>
</view>
<scroll-view class="warp" scroll-y="true" style="max-height: 80vh">
<uni-collapse
accordion
v-if="treeList.length > 0"
@change="collapseChange"
>
<view v-for="(item, index) in treeList" @click.stop="clickCourseInfo(item)" style=" padding: 20rpx;box-sizing: border-box;border-bottom: 1px solid #ebeef5;"> {{ item.title}}</view>
<!-- <uni-collapse-item
v-for="(item, index) in treeList"
:key="index"
:title="item.title"
:show-animation="true"
@click.stop="clickCourseInfo(item)"
>
<view class="content">
<view class="sub1List">
<view
class="item leve2"
@click.stop="clickCourseInfo(item)"
v-if="item.isLast == 1"
>
<text class="textss"> 本目录下全部课程</text>
</view>
<view
:class="['item', 'leve2']"
v-for="(item1, index1) in item.children"
:key="index1"
@click.stop="clickCourseInfo(item1)"
>
<text class="textss"> {{ item1.title }}</text>
<view class="sub2List" v-if="item1.children">
<view
:class="['item', 'leve3']"
v-for="(item2, index2) in item1.children"
:key="index2"
@click.stop="clickCourseInfo(item2)"
>
<text class="textss">{{ item2.title }}</text>
<view
class="sub3List"
v-if="
item2.isLast == 0 &&
item2.children &&
item2.children.length > 0
"
>
<text
class="textss"
v-for="(item3, index3) in item2.children"
:key="index3"
@click.stop="clickCourseInfo(item3)"
>{{ item3.title }}</text
>
</view>
</view>
</view>
</view>
</view>
</view>
</uni-collapse-item> -->
</uni-collapse>
</scroll-view>
</uni-drawer>
</view>
</template>
<script>
export default {
name: "tagTree",
// props:['treeList'],
data() {
return {
treeList: [],
};
},
methods: {
showDrawer(e) {
this.$refs[e].open();
// this.videoContext.pause()
// this.showTemp = true
console.log("打开抽屉");
},
getData() {
var data = { id: 0 };
this.$http
.request({
url: "sociology/home/getSociologyLabels",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then((res) => {
if (res.code == 0 && res.labels.length > 0) {
this.treeList = res.labels;
} else {
this.treeList = [];
}
this.showDrawer("showRight");
})
.catch((e) => {
console.log(e, "报错");
uni.showToast({
title: "获取课程分类失败",
icon: "none",
});
});
},
clickCourseInfo(val) {
this.$emit("clickCourseInfo", val);
this.closeDrawer("showRight");
},
closeDrawer(e) {
this.$refs[e].close();
},
changeD(e, type) {
// console.log((type === 'showRight' ? '左窗口' : '右窗口') + (e ? '打开' : '关闭'));
this[type] = e;
if (!e) {
console.log("关闭弹窗");
}
},
collapseChange(e) {
// console.log(e, '折叠面板点击');
// if (e) {
// this.tagId = this.treeList[e].id
// }
},
},
};
</script>
<style lang="scss" scoped>
// ::v-deep uni-drawer{ height: 50vh !important;
// .uni-drawer__content{
// overflow-y: scroll !important;
// }
// }
.sub1List {
background-color: #f7f7f7;
// padding-left: 20rpx;
}
.content {
.item {
background-color: #fff;
line-height: 80rpx;
font-size: 28rpx;
color: #1b2a32;
// border-bottom: 1px solid #dae8f0;
text {
padding-left: 20rpx;
}
.item:last-child {
border-bottom: 0;
}
}
.item.active {
// background-color: #aed1ec;
color: #fff;
background-image: linear-gradient(
90deg,
#3ab3ae 0%,
#00e1ec 100%
) !important;
}
.textss {
display: inline-block;
width: 100%;
border-bottom: 1px solid #ebeef5;
}
.leve2 {
.textss {
padding-left: 20rpx;
}
}
.leve2 {
.textss {
padding-left: 40rpx;
}
}
.leve3 {
.sub3List {
border-bottom: 1px solid #ebeef5;
padding-left: 60rpx;
.textss {
background-color: #ebeef5;
border-radius: 20rpx;
padding: 10rpx 14rpx !important;
}
}
.textss {
padding-left: 60rpx;
display: inline;
margin-right: 20rpx;
border: none !important;
}
}
.leve4 {
.textss {
padding-left: 80rpx;
}
}
}
.proTitle {
text-align: center;
padding: 20rpx 0;
margin-top: 60rpx;
// margin-bottom: 20rpx;
color: #888;
font-size: 28rpx;
}
.close {
display: flex;
justify-content: right;
padding-top: 60rpx;
padding-right: 20px;
}.uni-collapse-item .uni-collapse-item-header .uni-collapse-item-arrow {
display: none; /* 隐藏右箭头 */
}
</style>