Commit 243ef51a by 李伟康

refactor(components/CenterPopup.vue, components/HomeFrame/components/LeftSide.vu…

…e, components/HomeFrame/index.vue, pages/common/components/Scene.vue): 更新组件样式和逻辑

- 在`CenterPopup.vue`中,将`wrap`属性替换为`isLine`,并调整了相关样式。
- 在`LeftSide.vue`中,移除了`tabs`数组的直接定义,并将其移动到计算属性中。同时更新了部分样式的缩放比例。
- 在`HomeFrame/index.vue`中,添加了对`sceneType`为4时的条件判断,以决定是否显示开始按钮。
- 在`Scene.vue`中,当设置`userInfo.openSceneArr`时,确保包含场景4。
- 新增了`pages/usedCar/index.vue`页面,用于展示二手车相关的功能。

这些更改旨在优化用户体验,并适应新的业务需求。
1 parent 17000131
......@@ -6,7 +6,7 @@
animation
class="center-popup"
>
<view :class="['box',{wrap:wrap}]">
<view :class="['box',{line:isLine}]">
<view class="title flex">
<view class="text">{{title}}</view>
<view
......@@ -35,8 +35,10 @@
:class="['sprite-icon',i.icon]"
:style="{zoom: i.zoom || 1}"
></view>
<view class="item-title">{{i.title}}</view>
<text class="item-describe">{{i.describe}}</text>
<view class="item-text">
<view class="item-title">{{i.title}}</view>
<text class="item-describe">{{i.describe}}</text>
</view>
</view>
</template>
......@@ -53,7 +55,7 @@ export default {
title: String,
tag: String,
id: [Number, String],
wrap: Boolean
isLine: Boolean
},
data () {
return {
......@@ -92,7 +94,7 @@ export default {
width: 100%;
height: toRpx(160);
background: url('@/assets/images/boutique/customer-type-bg.webp') no-repeat;
background-size: 100%;
background-size: 100% 100%;
position: relative;
.text {
font-weight: 500;
......@@ -127,6 +129,9 @@ export default {
justify-content: center;
position: relative;
overflow: hidden;
&-text {
text-align: center;
}
.tag {
position: absolute;
width: toRpx(192);
......@@ -148,7 +153,6 @@ export default {
&-describe {
font-size: toRpx(32);
color: #808291;
text-align: center;
}
&:first-child {
&::before,
......@@ -159,18 +163,37 @@ export default {
}
}
}
.wrap {
.line {
height: auto;
.content {
flex-wrap: wrap;
gap: toRpx(56);
.item{
height: 388rpx;
&-title{
gap: 40rpx;
padding: 16rpx 64rpx 64rpx;
.item {
width: 100%;
flex-direction: row;
height: 192rpx;
justify-content: flex-start;
border-radius: 24rpx;
.tag {
right: 0;
left: inherit;
border-radius: 0 0 0 32rpx;
}
&-text {
text-align: left;
}
&-title {
font-size: 36rpx;
text-align: left;
padding: 0 0 12rpx 0;
}
&-describe {
font-size: 28rpx;
color: #999ea8;
}
&-describe{
font-size: 28rpx
.sprite-icon {
margin: 0 32rpx 0 40rpx;
}
}
}
......
......@@ -81,7 +81,7 @@
title="选择场景"
tag="当前场景"
:id="userInfo.sceneType"
wrap
isLine
/>
</view>
</template>
......@@ -101,33 +101,6 @@ export default {
name: '',
data () {
return {
tabs: [
{
label: "首页",
icon: "home",
name: 'HomeSlot'
},
{
label: "接待中心",
icon: "record",
name: 'ReceptionCenter',
eventCode: 'app_reception_center'
},
{
label: "学习中心",
icon: "study",
isTrack: true,
name: 'StudyCenter',
eventCode: 'app_study_center',
hidden: true
},
{
label: "场景集市",
icon: "scene",
name: 'SceneMarket',
eventCode: 'app_scene_market'
}
],
messageData: {
classCountList: [],
recordDetailList: [],
......@@ -147,6 +120,7 @@ export default {
userInfo (n) {
if (n.shopMerchantId) this.haveCustomerAccess(n)
},
// trackId (n) {
// if (!n) {
// clearInterval(this.trackInterval)
......@@ -163,19 +137,19 @@ export default {
title: '轻改',
describe: '太阳膜升级转化',
icon: 'icon-scene-1',
zoom: 1.8335,
zoom: 1.1669,
},
0: {
title: '会员权益/升级',
describe: '权益延保',
icon: 'icon-scene-0',
zoom: 1.8335,
zoom: 1.1669,
},
4:{
4: {
title: '二手车',
describe: '二手车业务',
icon: 'icon-scene-4',
zoom: 1.8335,
zoom: 1.1669,
}
}
......@@ -192,6 +166,38 @@ export default {
})
}
return result
},
tabs () {
const tabs = [
{
label: "首页",
icon: "home",
name: 'HomeSlot'
},
{
label: "接待中心",
icon: "record",
name: 'ReceptionCenter',
eventCode: 'app_reception_center'
},
{
label: "学习中心",
icon: "study",
isTrack: true,
name: 'StudyCenter',
eventCode: 'app_study_center',
hidden: true
},
{
label: "场景集市",
icon: "scene",
name: 'SceneMarket',
eventCode: 'app_scene_market'
}
]
let { sceneType } = uni.$storage.get("userInfo")
if(sceneType == 4) tabs[1].hidden = true
return tabs
}
},
created () {
......@@ -282,8 +288,8 @@ export default {
// } catch (error) {
// }
// if (jumpUrl) {
// this.addTrack()
// this.startTrack()
// this.addTrack()
// this.startTrack()
// }
} else {
......@@ -321,7 +327,7 @@ export default {
// uni.$storage.set('isSaleOpen', result)
if (result) {
this.hasPerson = true
}
}
// const channelType = 1
// // 非直营且非鸿蒙智行, 隐藏学习中心tab
// if (result || channelType == 1) {
......@@ -337,7 +343,7 @@ export default {
businessTypeList = [0, 2]
} else if (sceneType == 1) {
businessTypeList = [1]
}
} else businessTypeList = [4]
const res = await uni.$api.commonApi.getUnreadRecord({
// businessType: sceneType,
businessTypeList,
......@@ -364,7 +370,7 @@ export default {
if (res.ids && res.ids.length > 0) {
if (Array.isArray(res.moduleTypeList) && (res.moduleTypeList.includes(3) || res.moduleTypeList.includes(4))
) {
// 3, 4学习任务弹窗
// 3, 4学习任务弹窗
this.messageType = 'study'
this.messageData = res
this.$refs.kfRef.open()
......@@ -416,7 +422,8 @@ export default {
uni.$storage.set('userInfo', userInfo)
let url = {
1: '/pages/boutique/index',
0: '/pages/equity/index'
0: '/pages/equity/index',
4: '/pages/usedCar/index'
}[userInfo.sceneType]
uni.reLaunch({
url
......@@ -429,13 +436,13 @@ export default {
})
},
// 学习中心权限获取
getStudyCenterPermission() {
getStudyCenterPermission () {
const res = uni.$storage.get('studyCenterPermission')
const {directSaleAuth, hmzxAuth, authorizedBusinessList} = res // 当驻店人员为非直营,且非鸿蒙智行延保业务驻店人员情况下。隐藏左侧【学习中心】图标
const { directSaleAuth, hmzxAuth, authorizedBusinessList } = res // 当驻店人员为非直营,且非鸿蒙智行延保业务驻店人员情况下。隐藏左侧【学习中心】图标
const isYb = authorizedBusinessList && authorizedBusinessList.includes(1) // 1.延保 2.轻改 3.权益
if (directSaleAuth || (hmzxAuth && isYb)) {
this.tabs[2].hidden = false
}
}
}
},
beforeCreate () {
......
......@@ -24,7 +24,9 @@
class="start"
@click="start"
>
<view class="sprite-icon icon-start-text"></view>
<template v-if="sceneType != 4">
<view class="sprite-icon icon-start-text"></view>
</template>
</view>
<view class="right-content-box flex">
<view class="content-left">
......@@ -391,6 +393,8 @@ export default {
this.$emit(name)
},
start () {
const { sceneType } = this
if(sceneType == 4) return //二手车无接待功能
uni.$track.add({
eventCode: 'app_reception_begins'
})
......
......@@ -94,7 +94,7 @@ export default {
sceneList[index].actived = true
this.sceneList = sceneList
userInfo.sceneType = sceneType
userInfo.openSceneArr = openSceneArr
userInfo.openSceneArr = [...openSceneArr, 4]
uni.showLoading({
mask: true
})
......@@ -139,7 +139,8 @@ export default {
uni.$storage.set('userInfo', userInfo)
let url = {
1: '/pages/boutique/index',
0: '/pages/equity/index'
0: '/pages/equity/index',
4: '/pages/usedCar/index'
}[userInfo.sceneType]
uni.reLaunch({
url
......
<template>
<view>
<home-frame
ref="home"
:loadComplete="loadComplete"
>
</home-frame>
</view>
</template>
<script>
import HomeFrame from '@/components/HomeFrame/index.vue'
export default {
components: { HomeFrame },
data () {
return {
loadComplete: true,
requested: false
}
},
computed: {
},
onBackPress (options) {
if (options.from === 'backbutton') {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
uni.navigateBack()
return true
}
// 其他情况允许正常返回
return false
},
async onLoad () {
},
async onShow () {
const userInfo = uni.$storage.get('userInfo')
if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) {
uni.$storage.rm('userInfo')
uni.$storage.rm('sessionId')
uni.reLaunch({
url: '/pages/common/login'
})
return
}
this.$refs.home.updateApp()
this.init()
},
methods: {
init () {
this.$refs.home.$refs.leftBox.getMessageInfo()
},
}
}
</script>
<style scoped lang="scss">
.webview-container {
width: toRpx(100);
height: toRpx(100);
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
transform: translateY(300%);
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!