index.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <route lang="json">
  2. {
  3. "style": {
  4. "navigationBarTitleText": "全部设计师",
  5. "navigationBarBackgroundColor": "#fff"
  6. }
  7. }
  8. </route>
  9. <script setup lang="ts">
  10. import Card from '@/components/card.vue'
  11. import DataForm from '@/components/data-form.vue'
  12. import PageHelperEvo from '@/components/page-helper-evo.vue'
  13. import { getDesigners, updateFollowUp } from '../../core/libs/agent-requests'
  14. import { vipIcon, rightArrowIcon, filterIcon } from '@designer-hub/assets/src/svgs'
  15. import { toHomePage } from '../../core/libs/actions'
  16. import { Designer, FollowUp } from '@designer-hub/app/src/core/libs/models'
  17. import { requestToast } from '@designer-hub/app/src/core/utils/common'
  18. import { ComponentExposed } from 'vue-component-type-helpers'
  19. import { pick } from 'radash'
  20. import { useFollowUp } from '../../composables/followUp'
  21. const searchText = ref('')
  22. const publishState = ref(false)
  23. const pageHelperRef = ref<ComponentExposed<typeof PageHelperEvo>>()
  24. const { schema, rules } = useFollowUp()
  25. const query = ref({})
  26. const searchFocus = () => {
  27. console.log('focus')
  28. }
  29. const searchBlur = () => {
  30. console.log('focus')
  31. }
  32. const search = () => {
  33. console.log('search')
  34. }
  35. const cancelSearch = () => {
  36. console.log('cancel')
  37. }
  38. const searchChange = (e: any) => {
  39. console.log(e)
  40. }
  41. const toDetail = async (designer: any) => {
  42. await uni.navigateTo({ url: '/pages/designer/detail' + '?id=' + designer.id })
  43. }
  44. const callPhone = (phoneNumber) => {
  45. uni.makePhoneCall({
  46. phoneNumber,
  47. })
  48. }
  49. const filterData = () => {
  50. console.log('filter')
  51. }
  52. const handleImportant = async (designer: Designer) => {
  53. // const { code } = await requestToast(
  54. // () =>
  55. // updateFollowUp({
  56. // ...pick(designer, ['id']),
  57. // isFollowFocus: true,
  58. // }),
  59. // {
  60. // success: true,
  61. // successTitle: '重点跟进成功',
  62. // },
  63. // )
  64. // if (code === 0) {
  65. // await pageHelperRef.value?.refresh()
  66. // }
  67. }
  68. </script>
  69. <template>
  70. <view class="flex-grow">
  71. <PageHelperEvo ref="pageHelperRef" :request="getDesigners" :query="query">
  72. <template #top>
  73. <div class="flex items-center justify-between bg-white pr-3.5">
  74. <div class="flex-1">
  75. <wd-search
  76. v-model="searchText"
  77. @focus="searchFocus"
  78. @blur="searchBlur"
  79. @search="search"
  80. @cancel="cancelSearch"
  81. @change="searchChange"
  82. hide-cancel
  83. />
  84. </div>
  85. <wd-img :src="filterIcon" width="22px" height="22px" @click="filterData"></wd-img>
  86. </div>
  87. </template>
  88. <template #default="{ source }">
  89. <div class="p-3.5 gap-3.5 flex flex-col">
  90. <template v-for="(it, i) in source.list" :key="i">
  91. <Card>
  92. <div class="items-center" @click="toDetail(it)">
  93. <div class="">
  94. <div class="flex items-center">
  95. <div
  96. class="w-[55px] h-[55px] bg-neutral-100 rounded-full mr-2 flex items-center justify-center"
  97. >
  98. <wd-img width="100%" height="100%" round :src="it.avatar"></wd-img>
  99. </div>
  100. <div class="flex flex-col flex-1">
  101. <div class="flex-row flex items-center justify-between w-full">
  102. <div class="flex-row flex items-center">
  103. <div
  104. class="text-black/90 text-base font-normal font-['PingFang_SC'] leading-[10.18px]"
  105. >
  106. <!-- 苏小萌 -->
  107. {{ it.name }}
  108. </div>
  109. <div
  110. class="h-4 bg-neutral-100 rounded-[20px] justify-start items-center inline-flex flex-row ml-[9px]"
  111. >
  112. <wd-img width="17" height="17" :src="vipIcon"></wd-img>
  113. <div
  114. class="text-black/40 text-[10px] font-normal font-['PingFang_SC'] px-[7px] leading-none"
  115. >
  116. <!-- 白银会员 -->
  117. {{ it.levelName }}
  118. </div>
  119. </div>
  120. </div>
  121. <div
  122. class="text-black/60 text-xs font-normal font-['PingFang_SC'] leading-snug flex items-center"
  123. @click.stop="toHomePage(it.id)"
  124. >
  125. <div>个人主页</div>
  126. <wd-img width="13" height="13" :src="rightArrowIcon"></wd-img>
  127. </div>
  128. </div>
  129. <div class="flex items-center gap-2 mt-[18px]">
  130. <div
  131. class="text-black/30 text-xs font-normal font-['PingFang_SC'] leading-none"
  132. >
  133. 2天前访问
  134. </div>
  135. <div class="bg-[#eeeeee] w-[2px] h-[10px]"></div>
  136. <div
  137. class="text-black/30 text-xs font-normal font-['PingFang_SC'] leading-none"
  138. >
  139. 积分:{{ it.points || 0 }}
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. <div class="row-start-2 col-start-2 col-end-4">
  146. <div class="flex items-center justify-between w-full mt-[20px]">
  147. <div v-if="!it.followUp30Days" class="flex items-center">
  148. <div class="w-2 h-2 bg-[#89f4e2] rounded-full mr-[7px]"></div>
  149. <div
  150. class="text-black/90 text-xs font-normal font-['PingFang_SC'] leading-snug"
  151. >
  152. 30天未跟进
  153. </div>
  154. </div>
  155. <div class="flex items-center">
  156. <div class="w-2 h-2 bg-[#ffb96a] rounded-full mr-[7px]"></div>
  157. <div
  158. class="text-black/90 text-xs font-normal font-['PingFang_SC'] leading-snug"
  159. >
  160. 60天未产生积分
  161. </div>
  162. </div>
  163. <div class="flex items-center">
  164. <div class="w-2 h-2 bg-[#c493ff] rounded-full mr-[7px]"></div>
  165. <div
  166. class="text-black/90 text-xs font-normal font-['PingFang_SC'] leading-snug"
  167. >
  168. 60天未消耗积分
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. <div
  174. class="row-start-5 col-start-2 col-end-4 flex items-center mt-[26px] justify-around"
  175. >
  176. <div
  177. class="px-3 py-1.5 rounded-[30px] border border-solid border-[#ff2d2d] justify-center items-center gap-1 flex"
  178. @click.stop="handleImportant(it)"
  179. >
  180. <span style="color: #ff2d2d" class="flex items-center">+</span>
  181. <div
  182. class="text-[#ff2d2d] text-xs font-normal font-['PingFang_SC'] leading-none"
  183. >
  184. 重点跟进
  185. </div>
  186. </div>
  187. <div
  188. class="px-5 py-1 bg-[#e1ecff] rounded-[30px] border border-[#2357e9] justify-center items-center gap-1 inline-flex"
  189. @click.stop="callPhone(it.mobile)"
  190. >
  191. <div
  192. class="text-center text-[#2357e9] text-sm font-normal font-['PingFang_SC'] leading-normal"
  193. >
  194. 打电话
  195. </div>
  196. </div>
  197. <div
  198. class="px-5 py-1 bg-[#0052d9] rounded-[30px] justify-center items-center gap-1 inline-flex"
  199. >
  200. <div
  201. class="text-center text-white text-sm font-normal font-['PingFang_SC'] leading-normal"
  202. @click.stop="publishState = true"
  203. >
  204. 写跟进
  205. </div>
  206. </div>
  207. </div>
  208. </div>
  209. </Card>
  210. </template>
  211. </div>
  212. </template>
  213. </PageHelperEvo>
  214. </view>
  215. <wd-action-sheet v-model="publishState" title="创建跟进" @close="publishState = false">
  216. <view class="flex flex-col p-4">
  217. <div><DataForm :schema="schema" :rules="rules" direction="horizontal"></DataForm></div>
  218. <div><wd-button block :round="false">提交</wd-button></div>
  219. </view>
  220. </wd-action-sheet>
  221. </template>
  222. <style scoped lang="scss"></style>