Commit 8335cdde by 李伟康

refactor(components): 重构 HomeFrame 组件

- 将 Entrance 组件从 pages/boutique/tool 移动到 components 目录
- 在 HomeFrame 组件中添加 Entrance 组件
- 根据 sceneType 显示不同内容
- 添加 interceptionMixin 混入
- 优化工具箱内容显示逻辑
1 parent f84b6f84
...@@ -43,6 +43,10 @@ ...@@ -43,6 +43,10 @@
<view class="tool-box box-class"> <view class="tool-box box-class">
<view class="common-title">展业工具</view> <view class="common-title">展业工具</view>
<view class="content-box"> <view class="content-box">
<template v-if="sceneType == 1">
<Entrance @entranceClick="entranceClick"></Entrance>
</template>
<template v-else>
<view class="developing flex"> <view class="developing flex">
<image <image
class="developing-icon" class="developing-icon"
...@@ -50,7 +54,7 @@ ...@@ -50,7 +54,7 @@
/> />
功能开发中 功能开发中
</view> </view>
</template>
</view> </view>
</view> </view>
</view> </view>
...@@ -187,9 +191,11 @@ import StudyCenter from './components/StudyCenter.vue' ...@@ -187,9 +191,11 @@ import StudyCenter from './components/StudyCenter.vue'
import SwiperComponent from '../SwiperComponent.vue' import SwiperComponent from '../SwiperComponent.vue'
import MessageIndex from './components/Message/index.vue' import MessageIndex from './components/Message/index.vue'
import permision from '@/js_sdk/wa-permission/permission.js' import permision from '@/js_sdk/wa-permission/permission.js'
import Entrance from '@/components/Entrance.vue';
import { interceptionMixin } from '@/mixin/index'
export default { export default {
mixins: [recorder, uploader, timeout, versionCheck, merge], mixins: [recorder, uploader, timeout, versionCheck, merge, interceptionMixin],
components: { ReceptionCenter, StudyCenter, SceneMarket, LeftSide, Point, dayPoint, rulePoint, Course, Ranking, LevelPoint, Calendar, Promotion, History, LevelMedal, MessageDetail, SwiperComponent, MessageIndex }, components: { ReceptionCenter, StudyCenter, SceneMarket, LeftSide, Point, dayPoint, rulePoint, Course, Ranking, LevelPoint, Calendar, Promotion, History, LevelMedal, MessageDetail, SwiperComponent, MessageIndex, Entrance },
props: { props: {
id: [String, Number], id: [String, Number],
finishDoneText: String, finishDoneText: String,
...@@ -242,6 +248,10 @@ export default { ...@@ -242,6 +248,10 @@ export default {
componentName () { componentName () {
let tabs = this.$refs.leftBox?.tabs let tabs = this.$refs.leftBox?.tabs
return tabs ? tabs[this.tabIndex].name : '' return tabs ? tabs[this.tabIndex].name : ''
},
sceneType () {
const { sceneType } = uni.$storage.get('userInfo')
return sceneType
} }
}, },
methods: { methods: {
...@@ -393,6 +403,13 @@ export default { ...@@ -393,6 +403,13 @@ export default {
eventCode: 'app_reception_begins' eventCode: 'app_reception_begins'
}) })
this.$emit('start') this.$emit('start')
},
async entranceClick (item) {
let staffCheck = await this.checkDailyReport();
if (staffCheck) return
uni.navigateTo({
url: `/pages/boutique/tool/index?componentName=${item.name}`
})
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!