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 @@ ...@@ -6,7 +6,7 @@
animation animation
class="center-popup" class="center-popup"
> >
<view :class="['box',{wrap:wrap}]"> <view :class="['box',{line:isLine}]">
<view class="title flex"> <view class="title flex">
<view class="text">{{title}}</view> <view class="text">{{title}}</view>
<view <view
...@@ -35,9 +35,11 @@ ...@@ -35,9 +35,11 @@
:class="['sprite-icon',i.icon]" :class="['sprite-icon',i.icon]"
:style="{zoom: i.zoom || 1}" :style="{zoom: i.zoom || 1}"
></view> ></view>
<view class="item-text">
<view class="item-title">{{i.title}}</view> <view class="item-title">{{i.title}}</view>
<text class="item-describe">{{i.describe}}</text> <text class="item-describe">{{i.describe}}</text>
</view> </view>
</view>
</template> </template>
</view> </view>
...@@ -53,7 +55,7 @@ export default { ...@@ -53,7 +55,7 @@ export default {
title: String, title: String,
tag: String, tag: String,
id: [Number, String], id: [Number, String],
wrap: Boolean isLine: Boolean
}, },
data () { data () {
return { return {
...@@ -92,7 +94,7 @@ export default { ...@@ -92,7 +94,7 @@ export default {
width: 100%; width: 100%;
height: toRpx(160); height: toRpx(160);
background: url('@/assets/images/boutique/customer-type-bg.webp') no-repeat; background: url('@/assets/images/boutique/customer-type-bg.webp') no-repeat;
background-size: 100%; background-size: 100% 100%;
position: relative; position: relative;
.text { .text {
font-weight: 500; font-weight: 500;
...@@ -127,6 +129,9 @@ export default { ...@@ -127,6 +129,9 @@ export default {
justify-content: center; justify-content: center;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
&-text {
text-align: center;
}
.tag { .tag {
position: absolute; position: absolute;
width: toRpx(192); width: toRpx(192);
...@@ -148,7 +153,6 @@ export default { ...@@ -148,7 +153,6 @@ export default {
&-describe { &-describe {
font-size: toRpx(32); font-size: toRpx(32);
color: #808291; color: #808291;
text-align: center;
} }
&:first-child { &:first-child {
&::before, &::before,
...@@ -159,18 +163,37 @@ export default { ...@@ -159,18 +163,37 @@ export default {
} }
} }
} }
.wrap { .line {
height: auto; height: auto;
.content { .content {
flex-wrap: wrap; flex-wrap: wrap;
gap: toRpx(56); gap: 40rpx;
.item{ padding: 16rpx 64rpx 64rpx;
height: 388rpx; .item {
&-title{ 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; font-size: 36rpx;
text-align: left;
padding: 0 0 12rpx 0;
}
&-describe {
font-size: 28rpx;
color: #999ea8;
} }
&-describe{ .sprite-icon {
font-size: 28rpx margin: 0 32rpx 0 40rpx;
} }
} }
} }
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
title="选择场景" title="选择场景"
tag="当前场景" tag="当前场景"
:id="userInfo.sceneType" :id="userInfo.sceneType"
wrap isLine
/> />
</view> </view>
</template> </template>
...@@ -101,33 +101,6 @@ export default { ...@@ -101,33 +101,6 @@ export default {
name: '', name: '',
data () { data () {
return { 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: { messageData: {
classCountList: [], classCountList: [],
recordDetailList: [], recordDetailList: [],
...@@ -147,6 +120,7 @@ export default { ...@@ -147,6 +120,7 @@ export default {
userInfo (n) { userInfo (n) {
if (n.shopMerchantId) this.haveCustomerAccess(n) if (n.shopMerchantId) this.haveCustomerAccess(n)
}, },
// trackId (n) { // trackId (n) {
// if (!n) { // if (!n) {
// clearInterval(this.trackInterval) // clearInterval(this.trackInterval)
...@@ -163,19 +137,19 @@ export default { ...@@ -163,19 +137,19 @@ export default {
title: '轻改', title: '轻改',
describe: '太阳膜升级转化', describe: '太阳膜升级转化',
icon: 'icon-scene-1', icon: 'icon-scene-1',
zoom: 1.8335, zoom: 1.1669,
}, },
0: { 0: {
title: '会员权益/升级', title: '会员权益/升级',
describe: '权益延保', describe: '权益延保',
icon: 'icon-scene-0', icon: 'icon-scene-0',
zoom: 1.8335, zoom: 1.1669,
}, },
4:{ 4: {
title: '二手车', title: '二手车',
describe: '二手车业务', describe: '二手车业务',
icon: 'icon-scene-4', icon: 'icon-scene-4',
zoom: 1.8335, zoom: 1.1669,
} }
} }
...@@ -192,6 +166,38 @@ export default { ...@@ -192,6 +166,38 @@ export default {
}) })
} }
return result 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 () { created () {
...@@ -337,7 +343,7 @@ export default { ...@@ -337,7 +343,7 @@ export default {
businessTypeList = [0, 2] businessTypeList = [0, 2]
} else if (sceneType == 1) { } else if (sceneType == 1) {
businessTypeList = [1] businessTypeList = [1]
} } else businessTypeList = [4]
const res = await uni.$api.commonApi.getUnreadRecord({ const res = await uni.$api.commonApi.getUnreadRecord({
// businessType: sceneType, // businessType: sceneType,
businessTypeList, businessTypeList,
...@@ -416,7 +422,8 @@ export default { ...@@ -416,7 +422,8 @@ export default {
uni.$storage.set('userInfo', userInfo) uni.$storage.set('userInfo', userInfo)
let url = { let url = {
1: '/pages/boutique/index', 1: '/pages/boutique/index',
0: '/pages/equity/index' 0: '/pages/equity/index',
4: '/pages/usedCar/index'
}[userInfo.sceneType] }[userInfo.sceneType]
uni.reLaunch({ uni.reLaunch({
url url
...@@ -429,9 +436,9 @@ export default { ...@@ -429,9 +436,9 @@ export default {
}) })
}, },
// 学习中心权限获取 // 学习中心权限获取
getStudyCenterPermission() { getStudyCenterPermission () {
const res = uni.$storage.get('studyCenterPermission') 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.权益 const isYb = authorizedBusinessList && authorizedBusinessList.includes(1) // 1.延保 2.轻改 3.权益
if (directSaleAuth || (hmzxAuth && isYb)) { if (directSaleAuth || (hmzxAuth && isYb)) {
this.tabs[2].hidden = false this.tabs[2].hidden = false
......
...@@ -24,7 +24,9 @@ ...@@ -24,7 +24,9 @@
class="start" class="start"
@click="start" @click="start"
> >
<template v-if="sceneType != 4">
<view class="sprite-icon icon-start-text"></view> <view class="sprite-icon icon-start-text"></view>
</template>
</view> </view>
<view class="right-content-box flex"> <view class="right-content-box flex">
<view class="content-left"> <view class="content-left">
...@@ -391,6 +393,8 @@ export default { ...@@ -391,6 +393,8 @@ export default {
this.$emit(name) this.$emit(name)
}, },
start () { start () {
const { sceneType } = this
if(sceneType == 4) return //二手车无接待功能
uni.$track.add({ uni.$track.add({
eventCode: 'app_reception_begins' eventCode: 'app_reception_begins'
}) })
......
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
sceneList[index].actived = true sceneList[index].actived = true
this.sceneList = sceneList this.sceneList = sceneList
userInfo.sceneType = sceneType userInfo.sceneType = sceneType
userInfo.openSceneArr = openSceneArr userInfo.openSceneArr = [...openSceneArr, 4]
uni.showLoading({ uni.showLoading({
mask: true mask: true
}) })
...@@ -139,7 +139,8 @@ export default { ...@@ -139,7 +139,8 @@ export default {
uni.$storage.set('userInfo', userInfo) uni.$storage.set('userInfo', userInfo)
let url = { let url = {
1: '/pages/boutique/index', 1: '/pages/boutique/index',
0: '/pages/equity/index' 0: '/pages/equity/index',
4: '/pages/usedCar/index'
}[userInfo.sceneType] }[userInfo.sceneType]
uni.reLaunch({ uni.reLaunch({
url 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!