Merge branch 'mrr_sj_develop_hjy_20260520_商家改版' of https://gitee.com/qtvbidt/mrr.sj.front into mrr_sj_develop_hjy_20260520_商家改版

This commit is contained in:
BAKEYi 2026-06-04 11:51:32 +08:00
commit 89d53394f1
5 changed files with 2125 additions and 1763 deletions

View File

@ -1,212 +1,228 @@
<template>
<view class="brand-card-comp" @click="onClick">
<image class="brand-bg" :src="item.bgSrc" mode="aspectFill"></image>
<image class="mask-bg" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/9bca353c-fa74-407e-a69e-6f5e9aa43955.png" mode="widthFix"></image>
<view class="brand-card-comp" @click="onClick">
<image class="brand-bg" :src="item.bgSrc" mode="aspectFill"></image>
<image class="mask-bg"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/9bca353c-fa74-407e-a69e-6f5e9aa43955.png"
mode="widthFix"></image>
<view class="card-content">
<view class="avatar-wrapper" style="border-color: #F7E5D7;">
<image class="avatar-img" :src="item.avatar || 'https://dummyimage.com/100x100/ccc/fff.png&text=logo'"></image>
</view>
<view class="card-content">
<view class="avatar-wrapper" style="border-color: #F7E5D7;">
<image class="avatar-img" :src="item.avatar || 'https://dummyimage.com/100x100/ccc/fff.png&text=logo'">
</image>
</view>
<text class="brand-name">{{ item.name }}</text>
<text class="brand-name">{{ item.name }}</text>
<view class="tags-container">
<view
class="tag-item"
v-for="(tag, idx) in displayTags"
:key="idx"
:style="getTagStyle(tag)"
>
<image class="tag-icon" v-if="tag.icon" :src="tag.icon"></image>
<text class="tag-text">{{ tag.text }}</text>
</view>
</view>
</view>
</view>
<view class="tags-container">
<view class="tag-item" v-for="(tag, idx) in displayTags" :key="idx" :style="getTagStyle(tag)">
<image class="tag-icon" v-if="tag.icon" :src="tag.icon"></image>
<text class="tag-text">{{ tag.text }}</text>
</view>
</view>
</view>
</view>
</template>
<script>
//
const TAG_LIBRARY = {
franchise: { //
text: '品牌加盟',
color: '#8D4C1B ',
borderColor: '#D6CAC0 ',
icon: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/60816ae2-92ee-4473-9eca-562e1200dbca.png'
},
recruit: { //
text: '学员招募',
color: '#E5505F',
borderColor: '#EFCFD2 ',
icon: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/fd0699b9-9f3c-4b1e-8693-d0c9ec7eabc3.png'
},
more: { //
text: '更多详情',
color: '#333333',
borderColor: '#ECECEC',
icon: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cec453ce-f3fc-4881-8f2c-9ec5c61e759c.png'
}
franchise: { //
text: '品牌加盟',
color: '#8D4C1B ',
borderColor: '#D6CAC0 ',
icon: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/60816ae2-92ee-4473-9eca-562e1200dbca.png'
},
recruit: { //
text: '学员招募',
color: '#E5505F',
borderColor: '#EFCFD2 ',
icon: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/fd0699b9-9f3c-4b1e-8693-d0c9ec7eabc3.png'
},
more: { //
text: '更多详情',
color: '#333333',
borderColor: '#ECECEC',
icon: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cec453ce-f3fc-4881-8f2c-9ec5c61e759c.png'
}
}
export default {
name: 'brand-card',
props: {
//
item: {
type: Object,
default: () => ({})
},
// key ['franchise', 'recruit']
tagKeys: {
type: Array,
default: null
}
},
computed: {
// 使 tagKeys item.tags
displayTags() {
if (this.tagKeys && this.tagKeys.length) {
return this.tagKeys.map(key => TAG_LIBRARY[key]).filter(v => v)
}
// item.tags 使
if (this.item.tags && Array.isArray(this.item.tags)) {
return this.item.tags
}
return []
},
tagsLength() {
return this.displayTags.length
}
},
methods: {
//
onClick() {
// 1. emit便
this.$emit('click', this.item);
name: 'brand-card',
props: {
//
item: {
type: Object,
default: () => ({})
},
// key ['franchise', 'recruit']
tagKeys: {
type: Array,
default: null
}
},
computed: {
// 使 tagKeys item.tags
displayTags() {
if (this.tagKeys && this.tagKeys.length) {
return this.tagKeys.map(key => TAG_LIBRARY[key]).filter(v => v)
}
// item.tags 使
if (this.item.tags && Array.isArray(this.item.tags)) {
return this.item.tags
}
return []
},
tagsLength() {
return this.displayTags.length
}
},
methods: {
//
onClick() {
// 1. emit便
this.$emit('click', this.item);
// 2.
if (this.item && this.item.id) {
uni.navigateTo({
url: `/pages/jingxuan/brand-detail?id=${this.item.id}`
});
}
},
getTagStyle(tag) {
const len = this.tagsLength
let sizeStyle = {}
if (len === 1) {
sizeStyle = {
width: '288rpx',
height: '42rpx',
padding: '0 12rpx',
boxSizing: 'border-box'
}
} else if (len === 2) {
sizeStyle = {
width: '134rpx',
height: '42rpx',
padding: '0 12rpx',
boxSizing: 'border-box'
}
}
return {
...sizeStyle,
color: tag.color,
borderColor: tag.borderColor
}
}
}
// 2.
if (!uni.getStorageSync("accessToken")) {
uni.navigateTo({
url: '/pages/blogPopup/blogPopup'
});
return;
}
// 3.
if (this.item && this.item.id) {
uni.navigateTo({
url: `/pages/jingxuan/brand-detail?id=${this.item.id}`
});
}
},
getTagStyle(tag) {
const len = this.tagsLength
let sizeStyle = {}
if (len === 1) {
sizeStyle = {
width: '288rpx',
height: '42rpx',
padding: '0 12rpx',
boxSizing: 'border-box'
}
} else if (len === 2) {
sizeStyle = {
width: '134rpx',
height: '42rpx',
padding: '0 12rpx',
boxSizing: 'border-box'
}
}
return {
...sizeStyle,
color: tag.color,
borderColor: tag.borderColor
}
}
}
}
</script>
<style lang="scss">
.brand-card-comp {
width: 328rpx;
height: 339rpx;
position: relative;
border-radius: 21rpx;
overflow: hidden;
background-color: #fff;
width: 328rpx;
height: 339rpx;
position: relative;
border-radius: 21rpx;
overflow: hidden;
background-color: #fff;
}
.brand-bg {
width: 100%;
height: 184rpx;
position: absolute;
top: 0;
left: 0;
z-index: 1;
width: 100%;
height: 184rpx;
position: absolute;
top: 0;
left: 0;
z-index: 1;
}
.mask-bg {
width: 100%;
height: 251rpx;
position: absolute;
bottom: 0;
left: 0;
z-index: 2;
display: block;
width: 100%;
height: 251rpx;
position: absolute;
bottom: 0;
left: 0;
z-index: 2;
display: block;
}
.card-content {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
z-index: 3;
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 24rpx;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
z-index: 3;
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 24rpx;
}
.avatar-wrapper {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
border: 2rpx solid;
background-color: #fff;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
margin-top: -38rpx;
margin-bottom: 12rpx;
width: 80rpx;
height: 80rpx;
border-radius: 50%;
border: 2rpx solid;
background-color: #fff;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
margin-top: -38rpx;
margin-bottom: 12rpx;
}
.avatar-img {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
.brand-name {
font-size: 24rpx;
font-weight: 500;
color: #333333;
line-height: 34rpx;
margin-bottom: 12rpx;
font-size: 24rpx;
font-weight: 500;
color: #333333;
line-height: 34rpx;
margin-bottom: 12rpx;
}
.tags-container {
display: flex;
justify-content: center;
align-items: center;
gap: 20rpx;
flex-wrap: wrap;
display: flex;
justify-content: center;
align-items: center;
gap: 20rpx;
flex-wrap: wrap;
}
.tag-item {
display: flex;
align-items: center;
justify-content: center;
border-radius: 21rpx;
border: 1rpx solid;
background-color: transparent;
padding: 7rpx 12rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 21rpx;
border: 1rpx solid;
background-color: transparent;
padding: 7rpx 12rpx;
}
.tag-icon {
width: 24rpx;
height: 22rpx;
margin-right: 6rpx;
flex-shrink: 0;
width: 24rpx;
height: 22rpx;
margin-right: 6rpx;
flex-shrink: 0;
}
.tag-text {
font-size: 20rpx;
line-height: 28rpx;
white-space: nowrap;
margin-top: 4rpx;
padding-right: 2rpx;
font-size: 20rpx;
line-height: 28rpx;
white-space: nowrap;
margin-top: 4rpx;
padding-right: 2rpx;
}
</style>

View File

@ -2,10 +2,8 @@
<view class="skill-item" @click="handleClick">
<view class="cover-box">
<image class="cover" :src="item.coverSrc" mode="aspectFill"></image>
<image
class="play-icon"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/5c1ddfef-a200-424a-a9dc-03d9395568f6.png"
></image>
<image v-if="item.video" class="play-icon"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/5c1ddfef-a200-424a-a9dc-03d9395568f6.png"></image>
</view>
<view class="skill-info">
<view class="skill-title line-2">{{ item.title }}</view>
@ -14,10 +12,9 @@
<text class="type-text">{{ item.type || '平台课程' }}</text>
</view>
<view class="skill-stats">
<image
class="view-icon"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/2409b64a-56bb-4d9e-a4cc-5b3444fcf097.png"
></image>
<image class="view-icon"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/2409b64a-56bb-4d9e-a4cc-5b3444fcf097.png">
</image>
{{ formatViews(item.views) }}观看 · {{ item.time }}
</view>
</view>
@ -69,13 +66,20 @@ export default {
// 1. emit便
this.$emit('click', this.item);
// 2.
// 2.
if (!uni.getStorageSync("accessToken")) {
uni.navigateTo({
url: '/pages/blogPopup/blogPopup'
});
return;
}
// 3.
if (this.item && this.item.id) {
uni.navigateTo({
url: `/pages/jingxuan/skill-detail?id=${this.item.id}`
});
}
// /
}
}
}
@ -188,5 +192,4 @@ export default {
-webkit-line-clamp: 2;
overflow: hidden;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -17,39 +17,25 @@
<text>{{ useMockData ? '关闭模拟数据' : '开启模拟数据' }}</text>
</view> -->
<view class="banner-section" v-if="bannerList && bannerList.length || info.video">
<view class="banner-section" v-if="bannerList && bannerList.length">
<!-- 原生视频组件 (就地播放) -->
<video v-if="info.video && isVideoPlaying" id="myVideo" class="banner-video" :src="info.video" autoplay controls
object-fit="cover"></video>
<!-- 轮播图区域 (当视频播放时隐藏) -->
<swiper v-else class="banner-swiper" circular @change="onSwiperChange" :autoplay="!info.video">
<!-- 轮播图区域 -->
<swiper class="banner-swiper" circular @change="onSwiperChange" :autoplay="false" :current="currentBannerIndex">
<!-- 视频作为第一项 -->
<swiper-item v-if="info.video">
<video id="myVideo" class="banner-video" :src="info.video" :autoplay="currentBannerIndex === 0" controls
object-fit="cover" :show-center-play-btn="false" :show-play-btn="false" @play="onVideoPlay"
@pause="onVideoPause" @ended="onVideoEnded"></video>
</swiper-item>
<!-- 图片轮播 -->
<swiper-item v-for="(item, index) in bannerList" :key="index">
<image class="banner-img" :src="item" mode="aspectFill"></image>
</swiper-item>
</swiper>
<!-- 居中的视频播放大图标 (当视频播放时隐藏) -->
<image v-if="info.video && !isVideoPlaying" class="center-play-icon"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/bb720bb0-4ada-49f6-9ce5-38abfd613d5d.png"
@click="playVideoInPlace"></image>
<!-- 视频/图片 相册切换组件 (当视频播放时隐藏) -->
<view class="album" v-if="(info.video || bannerList.length > 0) && !isVideoPlaying">
<view class="album-left" @click="info.video ? playVideoInPlace() : goAlbum()">
{{ info.video ? "视频" : "图片" }}
</view>
<view class="album-line"></view>
<view class="album-right" @click="goAlbum">
<view class="album-right-text">相册</view>
<image src="/static/images/icons/right7_13.png" class="album-right-img"></image>
</view>
</view>
<!-- 指示器 (当视频播放时隐藏) -->
<view class="indicator" v-if="!isVideoPlaying && bannerList.length > 0">
<text>{{ currentBannerIndex + 1 }} / {{ bannerList.length }}</text>
<!-- 指示器 -->
<view class="indicator" v-if="bannerList.length > 0">
<text>{{ currentBannerIndex + 1 }} / {{ totalSlides }}</text>
</view>
</view>
@ -164,6 +150,27 @@
</view>
</view>
<!-- 拨打电话选择弹窗 -->
<view class="phone-popup" :class="{ show: showPhonePopup }">
<view class="phone-popup-mask" @click="closePhonePopup"></view>
<view class="phone-popup-content">
<view class="phone-popup-header">
<text class="phone-popup-title">拨打电话</text>
</view>
<view class="phone-popup-body">
<view class="phone-option" v-if="info.contact_phone" @click="selectPhone(info.contact_phone)">
<text class="phone-number">{{ info.contact_phone }}</text>
</view>
<view class="phone-option" v-if="info.alternate_phone" @click="selectPhone(info.alternate_phone)">
<text class="phone-number">{{ info.alternate_phone }}</text>
</view>
</view>
<view class="phone-popup-cancel" @click="closePhonePopup">
<text class="cancel-text">取消</text>
</view>
</view>
</view>
<tipsPopup2 :show="tipShow" @closePopup="closePopup" sureText="确认" @okBtn="okBtn">
{{ tipsText }}
</tipsPopup2>
@ -196,6 +203,7 @@ export default {
tipShow: false, //
tipsText: "", //
tipType: "", //
showPhonePopup: false, //
isCollected: false, //
//
@ -204,7 +212,6 @@ export default {
iconCollectOn: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/fe2011b0-a34d-46ee-911a-0ea6f099ad77.png',
// ==================================
isVideoPlaying: false, //
phoneIconTop: 20, // Top
phoneIconRight: 50, // Right
@ -296,6 +303,10 @@ export default {
showTabSection() {
return this.availableTabs.length > 0;
},
// +
totalSlides() {
return this.bannerList.length + (this.info.video ? 1 : 0);
},
canSubmit() {
const d = this.formData;
const baseValid = d.contact_name && d.contact_phone && d.province_code && d.city_code && d.area_code && d.intention;
@ -439,29 +450,69 @@ export default {
//
makeCall() {
//
const phone = this.info.contact_phone || '';
if (phone) {
uni.makePhoneCall({
phoneNumber: String(phone),
fail: (err) => {
console.log('取消拨打或拨打失败', err);
}
});
if (!this.isLogin) {
this.tipsText = "您现在还未登录,是否确定登录?";
this.tipShow = true;
this.tipType = "login";
return; //
}
const contactPhone = this.info.contact_phone || '';
const alternatePhone = this.info.alternate_phone || '';
//
if (contactPhone && alternatePhone) {
this.showPhonePopup = true;
} else if (contactPhone) {
//
this.doMakeCall(contactPhone);
} else if (alternatePhone) {
//
this.doMakeCall(alternatePhone);
} else {
uni.showToast({ title: '暂无联系电话', icon: 'none' });
}
},
//
selectPhone(phone) {
this.closePhonePopup();
this.doMakeCall(phone);
},
//
closePhonePopup() {
this.showPhonePopup = false;
},
//
doMakeCall(phone) {
uni.makePhoneCall({
phoneNumber: String(phone),
fail: (err) => {
console.log('取消拨打或拨打失败', err);
}
});
},
goAlbum() {
uni.navigateTo({
url: `/pages/album/index?id=${this.brandId}&user_type=2`
});
},
//
playVideoInPlace() {
this.isVideoPlaying = true;
//
onVideoPlay() {
console.log('视频开始播放');
},
onVideoPause() {
console.log('视频暂停');
},
onVideoEnded() {
//
if (this.bannerList.length > 0) {
this.currentBannerIndex = 1;
}
},
// Mock
@ -472,7 +523,6 @@ export default {
},
getBrandDetails() {
this.isVideoPlaying = false; //
if (this.useMockData) {
this.injectMockData();
return;
@ -1132,4 +1182,100 @@ export default {
.popup-btn.confirm .btn-text {
color: #FFFFFF;
}
/* 拨打电话弹窗样式 */
.phone-popup {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 999;
visibility: hidden;
opacity: 0;
transition: all 0.3s ease;
}
.phone-popup.show {
visibility: visible;
opacity: 1;
}
.phone-popup-mask {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
}
.phone-popup-content {
position: absolute;
left: 0;
right: 0;
bottom: 0;
background-color: #F5F5F5;
border-radius: 24rpx 24rpx 0 0;
transform: translateY(100%);
transition: transform 0.3s ease;
}
.phone-popup.show .phone-popup-content {
transform: translateY(0);
}
.phone-popup-header {
padding: 30rpx;
text-align: center;
background-color: #FFFFFF;
border-radius: 24rpx 24rpx 0 0;
}
.phone-popup-title {
font-size: 32rpx;
font-weight: 500;
color: #333333;
}
.phone-popup-body {
background-color: #FFFFFF;
margin-top: 2rpx;
}
.phone-option {
display: flex;
flex-direction: column;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #EEEEEE;
}
.phone-option:last-child {
border-bottom: none;
}
.phone-label {
font-size: 26rpx;
color: #999999;
margin-bottom: 10rpx;
}
.phone-number {
font-size: 34rpx;
color: #333333;
font-weight: 500;
}
.phone-popup-cancel {
margin-top: 16rpx;
padding: 30rpx;
text-align: center;
background-color: #FFFFFF;
}
.cancel-text {
font-size: 32rpx;
color: #333333;
}
</style>

View File

@ -2,7 +2,8 @@
<view class="collection-page">
<custom-navbar title="我的收藏" :showBack="true" backgroundColor="#FFFFFF" :show-headle="true" borderBottom="none"
headleSrc="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/51ebca5d-95c5-4fb8-8aa3-560a79100d25.png" @onHeadleClick="goToSearch">
headleSrc="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/51ebca5d-95c5-4fb8-8aa3-560a79100d25.png"
@onHeadleClick="goToSearch">
</custom-navbar>
<view class="nav-placeholder" :style="{ height: navHeight + 'px' }"></view>
@ -10,18 +11,10 @@
<view class="tab-bar-wrap" :style="{ top: navHeight + 'px' }">
<view class="tab-bar">
<view class="tab-items">
<view
class="tab-item"
:class="{ active: currentTab === 'brand' }"
@tap="switchTab('brand')"
>
<view class="tab-item" :class="{ active: currentTab === 'brand' }" @tap="switchTab('brand')">
收藏的品牌
</view>
<view
class="tab-item"
:class="{ active: currentTab === 'course' }"
@tap="switchTab('course')"
>
<view class="tab-item" :class="{ active: currentTab === 'course' }" @tap="switchTab('course')">
收藏的课程
</view>
</view>
@ -32,7 +25,8 @@
</view>
</view>
<view class="filter-panel" :class="{ 'show': filterVisible }" :style="{ top: filterTop + 'px' }" catchtouchmove="true">
<view class="filter-panel" :class="{ 'show': filterVisible }" :style="{ top: filterTop + 'px' }"
catchtouchmove="true">
<view class="filter-mask" @tap="closeFilterPanel"></view>
<view class="filter-container">
@ -40,13 +34,8 @@
<view class="filter-group" v-for="group in brandFilterData" :key="group.id">
<view class="group-title">{{ group.title }}</view>
<view class="pill-list">
<view
class="pill-item"
v-for="sub in group.children"
:key="sub.id"
:class="{ active: selectedSecondIds.includes(sub.id) }"
@tap="toggleSecondSelect(sub.id)"
>
<view class="pill-item" v-for="sub in group.children" :key="sub.id"
:class="{ active: selectedSecondIds.includes(sub.id) }" @tap="toggleSecondSelect(sub.id)">
{{ sub.title }}
</view>
</view>
@ -54,18 +43,12 @@
</scroll-view>
<view v-else class="course-filter">
<view
class="course-type-item"
:class="{ active: selectedCourseType === 'platform' }"
@tap="selectCourseType('platform')"
>
<view class="course-type-item" :class="{ active: selectedCourseType === 'platform' }"
@tap="selectCourseType('platform')">
平台课程
</view>
<view
class="course-type-item"
:class="{ active: selectedCourseType === 'brand' }"
@tap="selectCourseType('brand')"
>
<view class="course-type-item" :class="{ active: selectedCourseType === 'brand' }"
@tap="selectCourseType('brand')">
品牌课程
</view>
</view>
@ -79,30 +62,24 @@
<view class="collection-content" v-if="currentTab === 'brand'">
<view class="brand-grid" v-if="filteredBrandList.length > 0">
<brand-card
class="brand-card-wrap"
v-for="(item, index) in filteredBrandList"
:key="index"
:item="item"
:tagKeys="item.tagKeys"
@click="goToBrandDetail(item)"
></brand-card>
<brand-card class="brand-card-wrap" v-for="(item, index) in filteredBrandList" :key="index" :item="item"
:tagKeys="item.tagKeys" @click="goToBrandDetail(item)"></brand-card>
</view>
<view class="empty-state" v-else>
<image class="empty-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/da814ede-1adc-4f90-8cdf-5357a12fab27.png"></image>
<image class="empty-icon"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/da814ede-1adc-4f90-8cdf-5357a12fab27.png">
</image>
</view>
</view>
<view class="collection-content" v-else>
<view class="course-list" v-if="filteredCourseList.length > 0">
<skill-card
v-for="(item, index) in filteredCourseList"
:key="index"
:item="item"
></skill-card>
<skill-card v-for="(item, index) in filteredCourseList" :key="index" :item="item"></skill-card>
</view>
<view class="empty-state" v-else>
<image class="empty-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/da814ede-1adc-4f90-8cdf-5357a12fab27.png"></image>
<image class="empty-icon"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/da814ede-1adc-4f90-8cdf-5357a12fab27.png">
</image>
</view>
</view>
<view style="height: 120rpx;"></view>
@ -167,9 +144,9 @@ export default {
//
goToSearch() {
// this.currentTab 'brand' 'course'
uni.navigateTo({
url: `/pages/search_common/search?type=collection_${this.currentTab}`
});
uni.navigateTo({
url: `/pages/search_common/search?type=collection_${this.currentTab}`
});
},
goBack() {
uni.navigateBack()
@ -213,7 +190,7 @@ export default {
title: first.title,
children: ((subRes.code === 200 || subRes.state === 1) && subRes.data) ? subRes.data : []
}
} catch(e) {
} catch (e) {
return { id: first.id, title: first.title, children: [] }
}
});
@ -240,9 +217,9 @@ export default {
//
selectCourseType(type) {
//
if(this.selectedCourseType === type){
if (this.selectedCourseType === type) {
this.selectedCourseType = ''
}else{
} else {
this.selectedCourseType = type
}
},
@ -442,7 +419,8 @@ export default {
/* 将页面左右 padding 转移到内容区,保证 Tab 背景贯穿全屏 */
.tab-bar-wrap {
position: sticky; /* 吸顶,保证滑动页面时一直显示在最前面 */
position: sticky;
/* 吸顶,保证滑动页面时一直显示在最前面 */
background: #fff;
padding: 10rpx 24rpx;
z-index: 101;
@ -473,7 +451,7 @@ export default {
color: #FF4767;
background: #FFECEF;
border: 1rpx solid #FFB0BD;
border-radius: 29rpx;
border-radius: 29rpx;
}
}
}
@ -493,6 +471,7 @@ export default {
width: 16rpx;
height: 10rpx;
transition: transform 0.3s ease;
/* 展开时图标倒转 */
&.rotate {
transform: rotate(180deg);
@ -507,39 +486,52 @@ export default {
left: 0;
right: 0;
bottom: 0;
z-index: 100; /* 低于 Tab区的101保证隐藏时躲在其后 */
pointer-events: none; /* 面板关闭时,穿透点击到底部列表 */
overflow: hidden; /* 防止抽屉向上滑出时外溢 */
z-index: 100;
/* 低于 Tab区的101保证隐藏时躲在其后 */
pointer-events: none;
/* 面板关闭时,穿透点击到底部列表 */
overflow: hidden;
/* 防止抽屉向上滑出时外溢 */
&.show {
pointer-events: auto; /* 打开时恢复点击拦截 */
pointer-events: auto;
/* 打开时恢复点击拦截 */
.filter-mask {
opacity: 1;
}
.filter-container {
transform: translateY(50rpx); /* 滑出 */
transform: translateY(50rpx);
/* 滑出 */
}
}
.filter-mask {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.4);
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
opacity: 0;
transition: opacity 0.3s ease-in-out;
}
.filter-container {
position: absolute;
top: 0; left: 0; right: 0;
top: 0;
left: 0;
right: 0;
background: #fff;
border-radius: 0 0 30rpx 30rpx;
padding: 40rpx 30rpx;
max-height: 80vh;
display: flex;
flex-direction: column;
box-shadow: 0 10rpx 20rpx rgba(0,0,0,0.05);
transform: translateY(-100%); /* 默认隐藏在上方即Tab背后 */
box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.05);
transform: translateY(-100%);
/* 默认隐藏在上方即Tab背后 */
transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
}
@ -548,14 +540,15 @@ export default {
.filter-scroll {
max-height: 50vh;
}
.filter-group {
margin-bottom: 30rpx;
.group-title {
font-weight: 500;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
margin-bottom: 20rpx;
}
@ -568,13 +561,14 @@ export default {
/* 通用胶囊按钮 */
.pill-item {
width: calc(25% - 16rpx); /* 25%是一行四个,减去间距 */
width: calc(25% - 16rpx);
/* 25%是一行四个,减去间距 */
height: 58rpx;
background: #F5F5F5;
font-weight: 400;
font-size: 26rpx;
color: #333333;
line-height: 37rpx;
font-size: 26rpx;
color: #333333;
line-height: 37rpx;
/* 使用 flex 居中 */
display: flex;
@ -583,7 +577,8 @@ export default {
border-radius: 12rpx;
transition: all 0.3s;
box-sizing: border-box; /* 防止 padding 会撑大盒子 */
box-sizing: border-box;
/* 防止 padding 会撑大盒子 */
&.active {
background: #FFF0F2;
@ -618,7 +613,8 @@ export default {
padding-top: 20rpx;
/* border-top: 1rpx solid #F5F5F5; */
.reset-btn, .confirm-btn {
.reset-btn,
.confirm-btn {
width: 47%;
text-align: center;
padding: 20rpx 0;
@ -673,7 +669,7 @@ export default {
}
::v-deep .icon-headle {
width: 32rpx !important;
height: 32rpx !important;
width: 32rpx !important;
height: 32rpx !important;
}
</style>