feat: 调整了目录结构
This commit is contained in:
48
src/pages/ChatModule/RecommendPostsList/index.vue
Normal file
48
src/pages/ChatModule/RecommendPostsList/index.vue
Normal file
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<ModuleTitle :title="recommendTheme.themeName" />
|
||||
|
||||
<view class="container-scroll font-size-0 scroll-x whitespace-nowrap">
|
||||
<view class="card-item bg-white inline-block rounded-20 mr-8"
|
||||
v-for="(item, index) in recommendTheme.recommendPostsList" :key="index" @click="sendReply(item)">
|
||||
<view class="m-4 relative">
|
||||
<image class="card-img rounded-16 relative z-10" :src="item.coverPhoto" mode="aspectFill" />
|
||||
|
||||
<view class="shadow absolute rounded-16"></view>
|
||||
</view>
|
||||
|
||||
<view class="card-text border-box">
|
||||
<view class="font-size-11 color-99A0AE ellipsis-1">
|
||||
{{ item.topic }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { defineProps } from "vue";
|
||||
import { SEND_MESSAGE_CONTENT_TEXT, SEND_MESSAGE_COMMAND_TYPE } from "@/constant/constant";
|
||||
import ModuleTitle from "@/components/ModuleTitle/index.vue";
|
||||
|
||||
const props = defineProps({
|
||||
recommendTheme: {
|
||||
type: Object,
|
||||
default: {},
|
||||
},
|
||||
});
|
||||
|
||||
const sendReply = (item) => {
|
||||
if (item.userInputContentType && item.userInputContentType === '1') {
|
||||
const commonItem = { type: item.userInputContent, title: item.topic }
|
||||
uni.$emit(SEND_MESSAGE_COMMAND_TYPE, commonItem);
|
||||
return;
|
||||
}
|
||||
uni.$emit(SEND_MESSAGE_CONTENT_TEXT, item.userInputContent);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "./styles/index.scss";
|
||||
</style>
|
||||
26
src/pages/ChatModule/RecommendPostsList/styles/index.scss
Normal file
26
src/pages/ChatModule/RecommendPostsList/styles/index.scss
Normal file
@@ -0,0 +1,26 @@
|
||||
.container-scroll {
|
||||
margin: 4px 0 6px;
|
||||
}
|
||||
|
||||
.card-item {
|
||||
width: 128px;
|
||||
}
|
||||
|
||||
.card-img {
|
||||
height: 120px;
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.shadow {
|
||||
background-color: #e5e8ee;
|
||||
height: 96px;
|
||||
width: 96px;
|
||||
bottom: -4px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.card-text {
|
||||
padding: 4px 8px 8px;
|
||||
}
|
||||
Reference in New Issue
Block a user