feat: 优化处理了滚动条的问题

This commit is contained in:
2025-08-13 19:29:11 +08:00
parent 6e365fd187
commit ef8d388837
8 changed files with 587 additions and 586 deletions

View File

@@ -47,6 +47,11 @@ body,
width: 100vw; width: 100vw;
} }
/*每个页面公共css */
::-webkit-scrollbar {
display: none;
}
.mb12 { .mb12 {
margin-bottom: 12px; margin-bottom: 12px;
} }

View File

@@ -50,12 +50,6 @@ const sendReply = (text) => {
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
padding-bottom: 12px; padding-bottom: 12px;
box-sizing: border-box; box-sizing: border-box;
/* 隐藏滚动条 */
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
} }
.more-tips-item { .more-tips-item {

View File

@@ -1,61 +1,71 @@
<template> <template>
<view class="quick-access"> <view class="quick-access">
<view class="quick-access-scroll"> <view class="quick-access-scroll">
<view class="quick-access-item" v-for="(item, index) in itemList" :key="index" @click="sendReply(item)"> <view
<image class="quick-access-item-bg" src="/static/quick/quick_icon_bg.png" mode="aspectFill"></image> class="quick-access-item"
v-for="(item, index) in itemList"
:key="index"
@click="sendReply(item)"
>
<image
class="quick-access-item-bg"
src="/static/quick/quick_icon_bg.png"
mode="aspectFill"
></image>
<view class="quick-access-item-title"> <view class="quick-access-item-title">
<image :src="item.icon"></image> <image :src="item.icon"></image>
<text>{{ item.title }}</text> <text>{{ item.title }}</text>
</view> </view>
<text class="quick-access-item-content">{{ item.content }}</text> <text class="quick-access-item-content">{{
item.content
}}</text>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { onMounted, ref } from 'vue'; import { onMounted, ref } from "vue";
const itemList = ref([]) const itemList = ref([]);
const emits = defineEmits(['replySent']); const emits = defineEmits(["replySent"]);
const sendReply = (item) => { const sendReply = (item) => {
emits('replySent', item); // 向父组件传递数据 emits("replySent", item); // 向父组件传递数据
} };
onMounted(() => { onMounted(() => {
initData() initData();
}) });
const initData = () => { const initData = () => {
itemList.value = [ itemList.value = [
{ {
icon: '/static/quick/quick_icon_yuding.png', icon: "/static/quick/quick_icon_yuding.png",
title: '快速预定', title: "快速预定",
content: '预定门票、房间、餐食', content: "预定门票、房间、餐食",
type: 'Command.quickBooking' type: "Command.quickBooking",
}, },
{ {
icon: '/static/quick/quick_icon_find.png', icon: "/static/quick/quick_icon_find.png",
title: '探索发现', title: "探索发现",
content: '探索玩法、出片佳地', content: "探索玩法、出片佳地",
type: 'Command.discovery' type: "Command.discovery",
}, },
{ {
icon: '/static/quick/quick_icon_order.png', icon: "/static/quick/quick_icon_order.png",
title: '订单/工单', title: "订单/工单",
content: '我的订单/工单', content: "我的订单/工单",
type: 'MyOrder' type: "MyOrder",
}, },
{ {
icon: '/static/quick/quick_icon_call.png', icon: "/static/quick/quick_icon_call.png",
title: '呼叫服务', title: "呼叫服务",
content: '加水、客房服务等', content: "加水、客房服务等",
type: 'Command.createWorkOrder' type: "Command.createWorkOrder",
} },
] ];
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -68,12 +78,6 @@
overflow-x: auto; overflow-x: auto;
white-space: nowrap; white-space: nowrap;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
/* 隐藏滚动条 */
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
} }
.quick-access-item { .quick-access-item {
@@ -120,7 +124,7 @@
font-family: PingFang SC, PingFang SC; font-family: PingFang SC, PingFang SC;
font-weight: 500; font-weight: 500;
font-size: 12px; font-size: 12px;
color: #201F32; color: #201f32;
line-height: 16px; line-height: 16px;
} }
} }
@@ -131,10 +135,9 @@
font-family: PingFang SC, PingFang SC; font-family: PingFang SC, PingFang SC;
font-weight: 400; font-weight: 400;
font-size: 10px; font-size: 10px;
color: #678CAD; color: #678cad;
line-height: 18px; line-height: 18px;
} }
} }
} }
</style> </style>

View File

@@ -49,14 +49,6 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.area-msg-list-content {
/* 隐藏滚动条 */
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
}
.message-item-ai { .message-item-ai {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
@@ -141,15 +133,6 @@
} }
} }
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
color: transparent;
}
// 打字机光标闪烁动画 // 打字机光标闪烁动画
.typing-cursor { .typing-cursor {
display: inline-block; display: inline-block;

View File

@@ -2,24 +2,46 @@
<view class="container"> <view class="container">
<ModuleTitle :title="commodityDTO.title" /> <ModuleTitle :title="commodityDTO.title" />
<view class="container-scroll"> <view class="container-scroll">
<view v-for="(item, index) in commodityDTO.commodityList" :key="`${item.commodityId}-${index}`"> <view
v-for="(item, index) in commodityDTO.commodityList"
:key="`${item.commodityId}-${index}`"
>
<view class="mk-card-item" @click="placeOrderHandle(item)"> <view class="mk-card-item" @click="placeOrderHandle(item)">
<!-- <view class="card-badge">超值推荐</view> --> <!-- <view class="card-badge">超值推荐</view> -->
<image class="card-img" :src="item.commodityIcon" mode="aspectFill" /> <image
class="card-img"
:src="item.commodityIcon"
mode="aspectFill"
/>
<view class="card-content"> <view class="card-content">
<view class="card-title-column"> <view class="card-title-column">
<text class="card-title">{{ item.commodityName }}</text> <text class="card-title">{{
<view class="card-tags" v-for="(tag) in item.commodityTradeRuleList" :key="tag"> item.commodityName
}}</text>
<view
class="card-tags"
v-for="tag in item.commodityTradeRuleList"
:key="tag"
>
<text class="card-tag">{{ tag }}</text> <text class="card-tag">{{ tag }}</text>
</view> </view>
</view> </view>
<template v-for="(serviceItem, index) in item.commodityServices" :key="serviceItem.serviceTitle"> <template
<view v-if="index < 3" class="card-desc">· {{ serviceItem.serviceTitle }}</view> v-for="(
serviceItem, index
) in item.commodityServices"
:key="serviceItem.serviceTitle"
>
<view v-if="index < 3" class="card-desc"
>· {{ serviceItem.serviceTitle }}</view
>
</template> </template>
<view class="card-bottom-row"> <view class="card-bottom-row">
<view class="card-price-row"> <view class="card-price-row">
<text class="card-price-fu">¥</text> <text class="card-price-fu">¥</text>
<text class="card-price">{{ item.commodityPrice }}</text> <text class="card-price">{{
item.commodityPrice
}}</text>
<text class="card-unit">/人</text> <text class="card-unit">/人</text>
</view> </view>
@@ -33,27 +55,25 @@
</template> </template>
<script setup> <script setup>
import ModuleTitle from '@/components/ModuleTitle/index.vue' import ModuleTitle from "@/components/ModuleTitle/index.vue";
import { defineProps } from 'vue' import { defineProps } from "vue";
const props = defineProps({ const props = defineProps({
commodityDTO: { commodityDTO: {
type: Object, type: Object,
default: {} default: {},
} },
}) });
/// 去下单 /// 去下单
const placeOrderHandle = (item) => { const placeOrderHandle = (item) => {
uni.navigateTo({ uni.navigateTo({
url: `/pages/goods/index?commodityId=${item.commodityId}`, url: `/pages/goods/index?commodityId=${item.commodityId}`,
}) });
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .container {
.container-scroll { .container-scroll {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@@ -61,12 +81,6 @@
overflow-y: hidden; overflow-y: hidden;
margin: 4px 0; margin: 4px 0;
/* 隐藏滚动条 */
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
.mk-card-item { .mk-card-item {
position: relative; position: relative;
@@ -195,7 +209,6 @@
line-height: 32px; line-height: 32px;
} }
} }
} }
} }
</style> </style>

View File

@@ -2,23 +2,45 @@
<view class="container"> <view class="container">
<ModuleTitle title="相关商品" /> <ModuleTitle title="相关商品" />
<view class="container-scroll"> <view class="container-scroll">
<view v-for="(item, index) in commodityList" :key="`${item.commodityId}-${index}`"> <view
v-for="(item, index) in commodityList"
:key="`${item.commodityId}-${index}`"
>
<view class="mk-card-item" @click="placeOrderHandle(item)"> <view class="mk-card-item" @click="placeOrderHandle(item)">
<image class="card-img" :src="item.commodityPhoto" mode="aspectFill" /> <image
class="card-img"
:src="item.commodityPhoto"
mode="aspectFill"
/>
<view class="card-content"> <view class="card-content">
<view class="card-title-column"> <view class="card-title-column">
<text class="card-title">{{ item.commodityName }}</text> <text class="card-title">{{
<view class="card-tags" v-for="(tag) in item.commodityTradeRuleList" :key="tag"> item.commodityName
}}</text>
<view
class="card-tags"
v-for="tag in item.commodityTradeRuleList"
:key="tag"
>
<text class="card-tag">{{ tag }}</text> <text class="card-tag">{{ tag }}</text>
</view> </view>
</view> </view>
<template v-for="(serviceItem, index) in item.commodityServices" :key="serviceItem.serviceTitle"> <template
<view v-if="index < 3" class="card-desc">· {{ serviceItem.serviceTitle }}</view> v-for="(
serviceItem, index
) in item.commodityServices"
:key="serviceItem.serviceTitle"
>
<view v-if="index < 3" class="card-desc"
>· {{ serviceItem.serviceTitle }}</view
>
</template> </template>
<view class="card-bottom-row"> <view class="card-bottom-row">
<view class="card-price-row"> <view class="card-price-row">
<text class="card-price-fu">¥</text> <text class="card-price-fu">¥</text>
<text class="card-price">{{ item.specificationPrice }}</text> <text class="card-price">{{
item.specificationPrice
}}</text>
<text class="card-unit">/人</text> <text class="card-unit">/人</text>
</view> </view>
<text class="card-btn">下单</text> <text class="card-btn">下单</text>
@@ -31,22 +53,21 @@
</template> </template>
<script setup> <script setup>
import ModuleTitle from '@/components/ModuleTitle/index.vue' import ModuleTitle from "@/components/ModuleTitle/index.vue";
import { defineProps } from 'vue' import { defineProps } from "vue";
const props = defineProps({ const props = defineProps({
commodityList: { commodityList: {
type: Array, type: Array,
default: [] default: [],
} },
}) });
/// 去下单 /// 去下单
const placeOrderHandle = (item) => { const placeOrderHandle = (item) => {
uni.navigateTo({ uni.navigateTo({
url: `/pages/goods/index?commodityId=${item.commodityId}`, url: `/pages/goods/index?commodityId=${item.commodityId}`,
}) });
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -60,12 +81,6 @@
overflow-y: hidden; overflow-y: hidden;
margin: 4px 0; margin: 4px 0;
/* 隐藏滚动条 */
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
.mk-card-item { .mk-card-item {
position: relative; position: relative;
@@ -194,7 +209,6 @@
line-height: 32px; line-height: 32px;
} }
} }
} }
} }
</style> </style>

View File

@@ -2,7 +2,10 @@
<view class="container"> <view class="container">
<ModuleTitle :title="recommendTheme.themeName" /> <ModuleTitle :title="recommendTheme.themeName" />
<view class="container-scroll"> <view class="container-scroll">
<view v-for="(item, index) in recommendTheme.recommendPostsList" :key="index"> <view
v-for="(item, index) in recommendTheme.recommendPostsList"
:key="index"
>
<view class="mk-card-item" @click="sendReply(item)"> <view class="mk-card-item" @click="sendReply(item)">
<image :src="item.coverPhoto" mode="widthFix"></image> <image :src="item.coverPhoto" mode="widthFix"></image>
<text>{{ item.topic }}</text> <text>{{ item.topic }}</text>
@@ -13,38 +16,30 @@
</template> </template>
<script setup> <script setup>
import ModuleTitle from '@/components/ModuleTitle/index.vue' import ModuleTitle from "@/components/ModuleTitle/index.vue";
import { RECOMMEND_POSTS_TITLE } from '@/constant/constant' import { RECOMMEND_POSTS_TITLE } from "@/constant/constant";
import { defineProps } from 'vue' import { defineProps } from "vue";
const props = defineProps({ const props = defineProps({
recommendTheme: { recommendTheme: {
type: Object, type: Object,
default: {} default: {},
} },
}) });
const sendReply = (item) => { const sendReply = (item) => {
const topic = item.userInputContent || item.topic.replace(/^#/, ''); const topic = item.userInputContent || item.topic.replace(/^#/, "");
uni.$emit(RECOMMEND_POSTS_TITLE, topic); uni.$emit(RECOMMEND_POSTS_TITLE, topic);
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .container {
.container-scroll { .container-scroll {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
overflow-x: auto; overflow-x: auto;
margin-top: 4px; margin-top: 4px;
/* 隐藏滚动条 */
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
.mk-card-item { .mk-card-item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@@ -44,12 +44,6 @@
overflow-x: auto; overflow-x: auto;
margin-top: 4px; margin-top: 4px;
/* 隐藏滚动条 */
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
.mk-card-item { .mk-card-item {
flex-shrink: 0; /* 关键:防止 flex 布局压缩子元素宽度 */ flex-shrink: 0; /* 关键:防止 flex 布局压缩子元素宽度 */
width: 142px; width: 142px;