Compare commits

..

No commits in common. "931511b0cfede7796f4d324777a76e18c8bf836e" and "81c86586217ffdce615b8bb40303968e5e3a55f9" have entirely different histories.

21 changed files with 116 additions and 160 deletions

View File

@ -1,7 +1,6 @@
<script setup> <script setup>
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app"; import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
import { checkPhone } from "@/manager/LoginManager"; import { checkPhone } from "@/manager/LoginManager";
import { goLogin } from "@/hooks/useGoLogin";
import { goHome } from "@/hooks/useGoHome"; import { goHome } from "@/hooks/useGoHome";
onLaunch(async () => { onLaunch(async () => {
@ -10,12 +9,6 @@ onLaunch(async () => {
const token = uni.getStorageSync("token"); const token = uni.getStorageSync("token");
// token // token
if (!token) {
goLogin();
return;
}
if (token) { if (token) {
const res = await checkPhone(); const res = await checkPhone();

View File

@ -1,5 +1,2 @@
// 滚动到底部
export const SCROLL_TO_BOTTOM = 'SCROLL_TO_BOTTOM'
// 推荐帖子 export const SCROLL_TO_BOTTOM = 'SCROLL_TO_BOTTOM'
export const RECOMMEND_POSTS_TITLE = 'RECOMMEND_POSTS_TITLE'

View File

@ -1 +0,0 @@
export const goLogin = () => uni.reLaunch({ url: "/pages/login/index" });

View File

@ -8,7 +8,7 @@
<textarea <textarea
class="textarea" class="textarea"
type="text" type="text"
:placeholder="placeholder" placeholder="快速订票,呼叫服务"
cursor-spacing="65" cursor-spacing="65"
confirm-type='done' confirm-type='done'
v-model="inputMessage" v-model="inputMessage"
@ -35,7 +35,6 @@ const props = defineProps({
}) })
const emit = defineEmits(['update:inputMessage', 'send', 'noHideKeyboard']) const emit = defineEmits(['update:inputMessage', 'send', 'noHideKeyboard'])
const placeholder = ref('快告诉朵朵您在想什么~')
const inputMessage = ref(props.inputMessage || '') const inputMessage = ref(props.inputMessage || '')
// //

View File

@ -76,7 +76,7 @@
import { ref } from 'vue' import { ref } from 'vue'
import { defineEmits } from 'vue' import { defineEmits } from 'vue'
import { onLoad } from '@dcloudio/uni-app'; import { onLoad } from '@dcloudio/uni-app';
import { SCROLL_TO_BOTTOM, RECOMMEND_POSTS_TITLE } from '@/constant/constant' import { SCROLL_TO_BOTTOM } from '../../constant/constant'
import { MessageRole, MessageType, CompName } from '../../model/ChatModel'; import { MessageRole, MessageType, CompName } from '../../model/ChatModel';
import ChatTopWelcome from './ChatTopWelcome.vue'; import ChatTopWelcome from './ChatTopWelcome.vue';
@ -231,13 +231,6 @@
scrollToBottom() scrollToBottom()
}, 200) }, 200)
}) })
uni.$on(RECOMMEND_POSTS_TITLE, (value) => {
console.log('RECOMMEND_POSTS_TITLE:', value)
if(value && value.length > 0) {
handleReply(value)
}
})
} }
/// id /// id

View File

@ -31,27 +31,27 @@
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',
title: '订单/工单',
content: '我的订单/工单',
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'
},
{
icon: '/static/quick/quick_icon_order.png',
title: '我的订单',
content: '快速查看订单',
type: 'MyOrder'
} }
] ]
} }

View File

@ -1,5 +1,6 @@
<template> <template>
<view class="top-bg"> <view class="top-bg">
<image src="/static/top_bg_icon.png" mode="aspectFit" class="top-bg-img"></image>
</view> </view>
</template> </template>
@ -11,7 +12,6 @@
width: 100%; width: 100%;
height: 270px; height: 270px;
overflow: hidden; overflow: hidden;
background: linear-gradient( 180deg, #42ADF9 0%, #6CD1FF 51%, #E9F3F7 99%);
.top-bg-img { .top-bg-img {
width: 100%; width: 100%;
height: 100%; height: 100%;

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="nav-bar"> <view class="nav-bar">
<view class="nav-item" @click="showDrawer('showLeft')"> <view class="nav-item" @click="showDrawer('showLeft')">
<uni-icons type="bars" size="24" color="#333"></uni-icons> <image class="nav-item-icon" src="/static/drawer_icon.png" mode="aspectFit"></image>
</view> </view>
<uni-drawer ref="showLeft" mode="left" :width="320"> <uni-drawer ref="showLeft" mode="left" :width="320">

View File

@ -1,9 +1,14 @@
<template> <template>
<view class="top-bg-content"> <view class="top-bg-content">
<view class="top-item" > <view class="top-item1" >
<!-- :style="backgroundStyle" --> <!-- :style="backgroundStyle" -->
<image class="top-item-left" :src="initPageImages.welcomeImageUrl"></image> <view class="top-item1-left">
<image class="top-item-right" :src="initPageImages.logoImageUrl"></image> <image :src="initPageImages.welcomeImageUrl"></image>
<text>{{ currentDate }} 多云 -36 dd </text>
</view>
<view class="top-item1-right">
<image :src="initPageImages.logoImageUrl"></image>
</view>
</view> </view>
<ChatCardAI :text='welcomeContent'/> <ChatCardAI :text='welcomeContent'/>
</view> </view>
@ -28,6 +33,13 @@
} }
}) })
//
const today = new Date();
const currentDate = ref(today.getFullYear() + '/' +
((today.getMonth() + 1) < 10 ? '0' : '') + (today.getMonth() + 1) + '/' +
(today.getDate() < 10 ? '0' : '') + today.getDate());
// //
const backgroundStyle = computed(() => { const backgroundStyle = computed(() => {
return { return {
@ -48,23 +60,40 @@
flex-direction: column; flex-direction: column;
} }
.top-item { .top-item1 {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
align-items: center; padding: 0 32px 0 32px;
padding: 0 32px; margin-bottom: -6px;
margin-bottom: -8px;
}
.top-item-left { .top-item1-left {
display: flex;
flex-direction: column;
justify-content: flex-end;
image {
width: 118px; width: 118px;
height: 52px; height: 52px;
} }
text {
font-family: PingFang SC, PingFang SC;
font-weight: 400;
font-size: 12px;
color: #1E4C69;
line-height: 24px;
text-align: justify;
font-style: normal;
text-transform: none;
}
}
.top-item-right { .top-item1-right {
image {
width: 130px; width: 130px;
height: 130px; height: 130px;
margin: -12px 0; margin-bottom: -20px;
}
}
} }
</style> </style>

View File

@ -4,8 +4,7 @@
<view class="user-card"> <view class="user-card">
<view class="row avatar-row"> <view class="row avatar-row">
<text class="label">头像 </text> <text class="label">头像 </text>
<!-- <image class="avatar" :src="userInfo.avatar" mode="aspectFill" /> --> <image class="avatar" :src="userInfo.avatar" mode="aspectFill" />
<uni-icons type="contact" size="40" color="#ccc"></uni-icons>
</view> </view>
<view class="row"> <view class="row">
<text class="label">昵称</text> <text class="label">昵称</text>

View File

@ -10,7 +10,6 @@
<swiper-item v-for="item in activityList" :key="item.id"> <swiper-item v-for="item in activityList" :key="item.id">
<view class="swiper-item"> <view class="swiper-item">
<image :src="item.activityCover" mode="aspectFill"></image> <image :src="item.activityCover" mode="aspectFill"></image>
<view class="corner-btn">快速预定</view>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
@ -46,32 +45,15 @@
border-radius: 8px; border-radius: 8px;
} }
.swiper-item { .swiper-item {
position: relative;
display: block; display: block;
height: 120px; height: 120px;
line-height: 120px; line-height: 120px;
text-align: center; text-align: center;
}
image { .swiper-item image {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 8px; border-radius: 8px;
display: block;
} }
.corner-btn {
position: absolute;
right: 12px;
bottom: 12px;
background-color: #ffeb00;
color: #333;
font-size: 14px;
font-weight: 500;
padding: 4px 12px;
border-radius: 20px;
line-height: 1.5;
}
}
} }
</style> </style>

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="container"> <view class="container">
<view v-for="item in themeDTOList" :key="item.title"> <view v-for="item in themeDTOList" :key="item.title">
<RecommendPostsList :recommendTheme="item" /> <DiscoveryCradContentList :recommendTheme="item" />
</view> </view>
</view> </view>
</template> </template>
@ -10,8 +10,8 @@
import { ref, nextTick } from 'vue' import { ref, nextTick } from 'vue'
import { onMounted } from 'vue' import { onMounted } from 'vue'
import { discoveryCradComponent } from '@/request/api/MainPageDataApi' import { discoveryCradComponent } from '@/request/api/MainPageDataApi'
import RecommendPostsList from '../recommend/RecommendPostsList.vue'
import { SCROLL_TO_BOTTOM } from '@/constant/constant' import { SCROLL_TO_BOTTOM } from '@/constant/constant'
import DiscoveryCradContentList from './DiscoveryCradContentList.vue'
const themeDTOList = ref([]) const themeDTOList = ref([])

View File

@ -2,7 +2,7 @@
<view class="container"> <view class="container">
<ModuleTitle :title="recommendTheme.themeName" /> <ModuleTitle :title="recommendTheme.themeName" />
<view class="container-scroll"> <view class="container-scroll">
<view class="mk-card-item" v-for="(item, index) in recommendTheme.recommendPostsList" :key="index" @click="sendReply(item)"> <view class="mk-card-item" v-for="(item, index) in recommendTheme.recommendPostsList" :key="index">
<image :src="item.coverPhoto" mode="widthFix"></image> <image :src="item.coverPhoto" mode="widthFix"></image>
<text>{{ item.topic }}</text> <text>{{ item.topic }}</text>
</view> </view>
@ -12,7 +12,7 @@
<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 { defineProps } from 'vue' import { defineProps } from 'vue'
const props = defineProps({ const props = defineProps({
recommendTheme: { recommendTheme: {
@ -21,11 +21,6 @@
} }
}) })
const sendReply = (item) => {
const topic = item.userInputContent || item.topic.replace(/^#/, '');
uni.$emit(RECOMMEND_POSTS_TITLE, topic);
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -2,11 +2,9 @@
<view class="container"> <view class="container">
<ModuleTitle :title="recommendTheme.themeName" /> <ModuleTitle :title="recommendTheme.themeName" />
<view class="container-scroll"> <view class="container-scroll">
<view class="mk-card-item" v-for="(item, index) in recommendTheme.recommendPostsList" :key="index" @click="sendReply(item)"> <view class="mk-card-item" v-for="(item, index) in recommendTheme.recommendPostsList" :key="index">
<image :src="item.coverPhoto" mode="aspectFill"></image> <image :src="item.coverPhoto" mode="widthFix"></image>
<view class="overlay-gradient"> <text>{{ item.topic }}</text>
<text class="overlay-text">{{ item.topic }}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -15,8 +13,6 @@
<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'
import { RECOMMEND_POSTS_TITLE } from '@/constant/constant.js'
const props = defineProps({ const props = defineProps({
recommendTheme: { recommendTheme: {
type: Object, type: Object,
@ -24,16 +20,10 @@
} }
}) })
const sendReply = (item) => {
const topic = item.userInputContent || item.topic.replace(/^#/, '');
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;
@ -48,47 +38,27 @@
} }
.mk-card-item { .mk-card-item {
flex-shrink: 0; /* 关键:防止 flex 布局压缩子元素宽度 */ display: flex;
width: 142px; flex-direction: column;
height: 126px; align-items: start;
width: 188px;
height: 154px;
background-color: #ffffff;
border-radius: 10px; border-radius: 10px;
overflow: hidden;
margin-right: 8px; margin-right: 8px;
position: relative;
image { image {
width: 100%; width: 188px;
height: 100%; height: 112px;
display: block;
} }
text {
/* 渐变背景层 */ padding: 12px;
.overlay-gradient { text-align: center;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 50px; /* 渐变层高度,可调 */
background: linear-gradient(
to bottom,
rgba(0, 0, 0, 0.001) 0%,
rgba(0, 0, 0, 0.5) 100%
);
display: flex;
align-items: flex-end; /* 文字贴近底部 */
padding: 0 8px 6px; /* 内边距让文字与边缘保持距离 */
box-sizing: border-box;
}
/* 渐变层上的文字 */
.overlay-text {
color: #fff;
font-weight: 500; font-weight: 500;
font-size: 12px; font-size: 12px;
text-align: left; color: #333333;
width: 100%; }
}
} }
} }
}
</style> </style>

BIN
static/drawer_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
static/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
static/test/mk_img_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

BIN
static/top_bg_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB