增加品牌方案管理
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="detail-root">
|
||||
<view class="header-wrap" :style="{ paddingTop: statusBarHeight + 'px' }">
|
||||
<view class="nav-bar" :style="{ height: navBarHeight + 'px' }">
|
||||
<view class="header-wrap" :style="headerStyle">
|
||||
<view class="nav-bar" :style="navStyle">
|
||||
<text class="back-btn" @click="goBack">‹</text>
|
||||
<text class="nav-title">课程详情</text>
|
||||
</view>
|
||||
@@ -10,7 +10,7 @@
|
||||
<view class="cover-area">
|
||||
<image v-if="course.coverImage" class="cover-img" :src="course.coverImage" mode="aspectFill"
|
||||
@error="course.coverError = true" />
|
||||
<view v-if="!course.coverImage || course.coverError" class="cover-bg">
|
||||
<view v-if="!course.coverImage || course.coverError" class="cover-bg" :style="{ background: coverGradient }">
|
||||
<text class="cover-text">{{ course.typeName ? course.typeName.slice(0, 2) : '课程' }}</text>
|
||||
</view>
|
||||
<view class="status-tag" :class="course.statusClass" v-if="course.statusText">{{ course.statusText }}</view>
|
||||
@@ -117,7 +117,7 @@
|
||||
<text class="bottom-desc">/ 次</text>
|
||||
</view>
|
||||
<button class="booking-btn" :class="{ disabled: !course.canBook }" :disabled="!course.canBook"
|
||||
@click="handleBooking">
|
||||
@click="handleBooking" :style="course.canBook ? bookingBtnStyle : ''">
|
||||
{{ course.btnText }}
|
||||
</button>
|
||||
</view>
|
||||
@@ -128,6 +128,7 @@
|
||||
const courseApi = require('../../api/course')
|
||||
const bookingApi = require('../../api/booking')
|
||||
const store = require('../../store/index')
|
||||
const brandStore = require('../../store/brand')
|
||||
const { resolveCoverUrl } = require('../../utils/request')
|
||||
|
||||
export default {
|
||||
@@ -166,7 +167,8 @@
|
||||
coverImage: '',
|
||||
coverError: false
|
||||
},
|
||||
realMemberCount: 0
|
||||
realMemberCount: 0,
|
||||
brandConfig: brandStore.config
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
@@ -183,6 +185,24 @@
|
||||
this.navBarHeight = navBarHeight
|
||||
this.totalHeaderHeight = statusBarHeight + navBarHeight
|
||||
if (options.id) this.loadCourseDetail(options.id)
|
||||
uni.$on('brand:updated', (config) => { this.brandConfig = config })
|
||||
},
|
||||
onUnload() {
|
||||
uni.$off('brand:updated')
|
||||
},
|
||||
computed: {
|
||||
coverGradient() {
|
||||
return 'linear-gradient(135deg, ' + this.brandConfig.primaryColor + ', ' + this.brandConfig.secondaryColor + ')'
|
||||
},
|
||||
headerStyle() {
|
||||
return 'padding-top:' + this.statusBarHeight + 'px;background-color:' + this.brandConfig.secondaryColor
|
||||
},
|
||||
navStyle() {
|
||||
return 'height:' + this.navBarHeight + 'px;background-color:' + this.brandConfig.secondaryColor
|
||||
},
|
||||
bookingBtnStyle() {
|
||||
return 'background:' + this.brandConfig.primaryColor + ';color:' + this.brandConfig.secondaryColor
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async loadCourseDetail(id) {
|
||||
|
||||
Reference in New Issue
Block a user