index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <!-- 使用 type="home" 属性设置首页,其他页面不需要设置,默认为page;推荐使用json5,更强大,且允许注释 -->
  2. <route lang="json5" type="home">
  3. {
  4. layout: 'tabbar',
  5. style: {
  6. navigationStyle: 'custom',
  7. navigationBarTitleText: '首页',
  8. },
  9. }
  10. </route>
  11. <script lang="ts" setup>
  12. import HotActivity from '@/components/hot-activity.vue'
  13. import MomentItem from '@/components/moment-item.vue'
  14. import useRequest from '../../hooks/useRequest'
  15. import dayjs from 'dayjs'
  16. import Menus from './components/menus.vue'
  17. import ScheduleCard from './components/schedule-card.vue'
  18. import { getCircles } from '../../core/libs/requests'
  19. import SectionHeading from '@designer-hub/app/src/components/section-heading.vue'
  20. import Card from '@designer-hub/app/src/components/card.vue'
  21. import { merchantPageHeaderBg } from '@designer-hub/assets/src/svgs'
  22. defineOptions({
  23. name: 'Home',
  24. })
  25. // 测试 uni API 自动引入
  26. const { data } = useRequest(async () => ({ code: 0, msg: '', data: {} }) as IResData<any>, {
  27. initialData: {
  28. banners: [],
  29. hots: [
  30. {
  31. id: 1,
  32. title: '日本研学·东京艺术大学游学',
  33. img: '',
  34. start: dayjs('2024-07-15').toDate(),
  35. end: dayjs('2024-08-10').toDate(),
  36. },
  37. {
  38. id: 1,
  39. title: '日本研学·东京艺术大学游学',
  40. img: '',
  41. start: dayjs('2024-07-15').toDate(),
  42. end: dayjs('2024-08-10').toDate(),
  43. },
  44. ],
  45. dynamics: [
  46. {
  47. author: {
  48. avatar: 'https://via.placeholder.com/35x35',
  49. nickname: '苏小萌',
  50. level: '0',
  51. },
  52. content: '用心做好设计,为客户创造美好家居环境',
  53. images: ['https://via.placeholder.com/165x220'],
  54. tags: ['意大利游学设计班'],
  55. shares: 0,
  56. comments: 0,
  57. likes: 0,
  58. createdAt: dayjs('2024-07-15').toDate(),
  59. },
  60. {
  61. author: {
  62. avatar: 'https://via.placeholder.com/35x35',
  63. nickname: '苏小萌',
  64. level: '0',
  65. },
  66. content: '用心做好设计,为客户创造美好家居环境',
  67. images: ['https://via.placeholder.com/220x165'],
  68. tags: ['意大利游学设计班'],
  69. shares: 0,
  70. comments: 0,
  71. likes: 0,
  72. createdAt: dayjs('2024-07-15').toDate(),
  73. },
  74. {
  75. author: {
  76. avatar: 'https://via.placeholder.com/35x35',
  77. nickname: '苏小萌',
  78. level: '0',
  79. },
  80. content: '用心做好设计,为客户创造美好家居环境',
  81. images: [
  82. 'https://via.placeholder.com/104x104',
  83. 'https://via.placeholder.com/104x204',
  84. 'https://via.placeholder.com/204x104',
  85. ],
  86. tags: ['意大利游学设计班'],
  87. shares: 0,
  88. comments: 0,
  89. likes: 0,
  90. createdAt: dayjs('2024-07-15').toDate(),
  91. },
  92. ],
  93. studyTour: null,
  94. },
  95. })
  96. const { data: circlesData, run } = useRequest(() => getCircles({}), { initialData: { list: [] } })
  97. console.log(data.value)
  98. onShow(async () => {
  99. // await run()
  100. console.log(circlesData.value)
  101. })
  102. onLoad(() => {})
  103. onShareAppMessage(() => ({}))
  104. </script>
  105. <template>
  106. <view class="flex-grow relative">
  107. <div class="aspect-[0.96/1] absolute left-0 right-0 top--1">
  108. <wd-img
  109. width="100%"
  110. height="100%"
  111. :src="merchantPageHeaderBg"
  112. custom-class="vertical-bottom"
  113. ></wd-img>
  114. </div>
  115. 1
  116. <wd-navbar custom-class="bg-transparent!" safe-area-inset-top :bordered="false">
  117. <template #left>
  118. <div
  119. class="ml-1 text-center text-white text-lg font-normal font-['PingFang SC'] leading-relaxed"
  120. >
  121. 今日待办
  122. </div>
  123. </template>
  124. </wd-navbar>
  125. <div class="flex flex-col gap-8 p-4 relative box-border">
  126. <div>
  127. <SectionHeading
  128. title="渠道任务"
  129. path="/pages/home/index"
  130. end-text="查看全部"
  131. custom-class="mb-5"
  132. ></SectionHeading>
  133. <Card><wd-status-tip image="search" tip="当前暂无未开始/进行中的任务" /></Card>
  134. </div>
  135. <div>
  136. <SectionHeading title="设计师" path="" custom-class="mb-5"></SectionHeading>
  137. <div class="flex flex-col gap-4">
  138. <template
  139. v-for="{ label, color } of [
  140. { label: '重点跟进设计师', color: '#FF523F' },
  141. { label: '全部设计师', color: '#7199FF' },
  142. { label: '本月新增设计师', color: '#FFE786' },
  143. { label: '超过30天未跟进', color: '#89F4E3' },
  144. { label: '超过60天未产生积分设计师', color: '#FFBA6A' },
  145. { label: '超过60天未消耗积分设计师', color: '#C494FF' },
  146. { label: '未成交过设计师', color: '#FF9EE2' },
  147. ]"
  148. :key="label"
  149. >
  150. <div class="h-12 bg-white rounded-lg shadow flex items-center hover:bg-[#fff6f5]">
  151. <div
  152. class="w-1.5 h-12 rounded-tl-lg rounded-bl-lg shadow"
  153. :style="{ background: color }"
  154. ></div>
  155. <div class="flex-1 mx-3">
  156. <SectionHeading :title="label" path="/pages/home/index" size="sm"></SectionHeading>
  157. </div>
  158. </div>
  159. </template>
  160. </div>
  161. </div>
  162. <div>
  163. <SectionHeading title="设计师最新动态" path="" custom-class="mb-5"></SectionHeading>
  164. <div class="flex flex-col gap-4">
  165. <template
  166. v-for="{ title, date } of [
  167. { title: '苏小萌报名了日本设计游学', date: new Date() },
  168. { title: '苏小萌报名了骑行活动', date: new Date() },
  169. { title: '苏小萌获取imola16000积分', date: new Date() },
  170. ]"
  171. :key="title"
  172. >
  173. <Card>
  174. <div class="text-black/90 text-sm font-normal font-['PingFang SC'] leading-none">
  175. {{ title }}
  176. </div>
  177. <div class="mt-3 text-black/30 text-xs font-normal font-['PingFang SC'] leading-none">
  178. {{ dayjs(date).format('YYYY-MM-DD hh:mm') }}
  179. </div>
  180. </Card>
  181. </template>
  182. </div>
  183. </div>
  184. </div>
  185. <!-- <view class="bg-black w-full pos-relative aspect-[1.26/1]">
  186. <wd-img custom-class="w-[375px] h-[297px]" src="https://via.placeholder.com/375x297" />
  187. <div
  188. class="w-[375px] h-[90px] bg-gradient-to-t from-black to-black/0 absolute left-0 bottom-0 w-full flex items-center"
  189. >
  190. <view class="mx-7">
  191. <wd-button plain custom-class="bg-transparent! border-white! text-white!">
  192. 02:30
  193. </wd-button>
  194. </view>
  195. </div>
  196. </view>
  197. <view class="bg-[#f6f6f6] relative bottom-4 rounded-t-2xl py-1">
  198. <ScheduleCard custom-class="my-6 mx-3.5"></ScheduleCard>
  199. <menus></menus>
  200. <view class="my-6 mx-3.5">
  201. <HotActivity></HotActivity>
  202. </view>
  203. <view class="my-6 mx-3.5">
  204. <Card>一分钟快速了解筑巢荟</Card>
  205. </view>
  206. <view class="mx-3.5 text-5 font-400">设计圈</view>
  207. <view class="mx-3.5">
  208. <template v-for="it of circlesData.list" :key="it.id">
  209. <view class="my-6">
  210. <MomentItem :options="it"></MomentItem>
  211. </view>
  212. </template>
  213. </view>
  214. </view> -->
  215. </view>
  216. </template>
  217. <style></style>