index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view>
  3. <view class="jiazheng-uni-list">
  4. <view class="icon-title-navBar-box">
  5. <view @click="goUpPage" class="nav-bar-icon"></view>
  6. <text class="nav-bar-title">家政人员</text>
  7. <text class="nav-bar-title">+</text>
  8. <uni-icons type="search" size="16" color="#000" @click="toggle('top')"></uni-icons>
  9. </view>
  10. <view class="jiazheng-search-box">
  11. <view @click="clickAlltype" class="select-item-box">
  12. <text>全部类型</text>
  13. <icon :class="allJtClass" />
  14. </view>
  15. <view class="all-type-list">
  16. <view v-if="isOpen" v-for="(item,index) in allType" :key="index" @click="onSelectCell(item,index)"
  17. class="all-type-item all-type-active">
  18. <view class="le-dropdown-cell-active-text">{{item.label}}</view>
  19. <view v-show="item.value==typeChecked"></view>
  20. </view>
  21. </view>
  22. <view class="jiazheng-search-right">
  23. <!-- 当前点击 增加 saixuan-active-->
  24. <view class="saixuan-item-box saixuan-active">
  25. <text @click="timeClick">更新时间</text>
  26. <icon :class="updataJtClass" />
  27. </view>
  28. <view class="saixuan-item-box">
  29. <!-- class切换 saixuan-jt-default saixuan-jt-click-->
  30. <text>录入时间</text>
  31. <icon :class="luruJtClass" />
  32. </view>
  33. </view>
  34. </view>
  35. <view>
  36. <scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="data.loading"
  37. :refresher-threshold="50" refresher-background="transparent" @refresherrefresh="onRefresh"
  38. class="phone-scroll-view">
  39. <uni-list class="admin-list-box">
  40. <uni-list-item v-for="item in data.list" class="admin-list-item-box">
  41. <template v-slot:body>
  42. <view>
  43. <view>{{item.realName}}</view>
  44. <view @click="shareInfo">分享</view>
  45. <view @click="telephone">打电话</view>
  46. </view>
  47. <view @click="lookUserInfo">
  48. <image :src="item.icon ||defauleImg" mode=""></image>
  49. <view>
  50. <p> 1000岁|3年经验</p>
  51. <p>四川成都人</p>
  52. </view>
  53. <view>
  54. 待岗
  55. </view>
  56. </view>
  57. </template>
  58. </uni-list-item>
  59. <uni-load-more :status="data.state" @click="getMore(0)"
  60. :contentText="data.contentText"></uni-load-more>
  61. </uni-list>
  62. </scroll-view>
  63. </view>
  64. <view>
  65. <!-- 普通弹窗 -->
  66. <uni-popup ref="popup" background-color="#fff">
  67. <view>
  68. <view>
  69. <uni-section title="全部" type="line">
  70. <view class="uni-px-5 uni-pb-5">
  71. <uni-data-select v-model="value" :localdata="range"
  72. @change="change"></uni-data-select>
  73. </view>
  74. <view class="phone-search-box">
  75. <input class="search-input" placeholder="请输入职业名称" v-model="zyName" />
  76. <view class="search-icon" @click="handleSearch">
  77. <uni-icons type="search" size="24" color="#fff"></uni-icons>
  78. </view>
  79. </view>
  80. </uni-section>
  81. </view>
  82. </view>
  83. </uni-popup>
  84. </view>
  85. </view>
  86. </view>
  87. </template>
  88. <script setup>
  89. import {
  90. ref,
  91. reactive
  92. } from "vue";
  93. import {
  94. onLoad
  95. } from "@dcloudio/uni-app";
  96. import {
  97. getJiazhengList
  98. } from "@/api/jiazheng.js"
  99. // import {
  100. // DropdownList
  101. // } from "./data.js";
  102. // const menuList = ref(DropdownList)
  103. const allType = [{
  104. label: "由近到远",
  105. value: 0
  106. },
  107. {
  108. label: "由远到近",
  109. value: 1
  110. },
  111. {
  112. label: "由远到近",
  113. value: 2
  114. },
  115. {
  116. label: "由远到近",
  117. value: 3
  118. },
  119. ]
  120. let range = ref([{
  121. "value": 0,
  122. "text": "篮球",
  123. "disable": true
  124. },
  125. {
  126. "value": 1,
  127. "text": "足球"
  128. },
  129. {
  130. "value": 2,
  131. "text": "游泳"
  132. }
  133. ])
  134. let data = reactive({
  135. zyName: '', // 职业名称
  136. list: [], // 考试列表
  137. loading: false,
  138. page: 0,
  139. size: 10,
  140. state: 'more',
  141. contentText: {
  142. contentdown: '查看更多',
  143. contentrefresh: '加载中',
  144. contentnomore: '没有更多'
  145. }
  146. })
  147. let zyName = ref('')
  148. let value = ref(0)
  149. let isOpen = ref(false)
  150. let typeChecked = ref(1)
  151. let defauleImg = ref('@/static/images/my/client-default-icon.png')
  152. const popup = ref(null);
  153. const allJtClass = 'select-jt-default';
  154. const updataJtClass = 'saixuan-jt-default';
  155. const luruJtClass = 'saixuan-jt-click';
  156. const clickAlltype = (data) => {
  157. isOpen.value = true
  158. }
  159. const onSelectCell = (data, index) => {
  160. console.log('data', data);
  161. console.log('index', index);
  162. // isOpen.value = false;
  163. // allJtClass = 'select-jt-click'
  164. }
  165. const toggle = (data, index) => {
  166. popup.value.open('top')
  167. }
  168. const lookUserInfo = (data, index) => {
  169. uni.redirectTo({
  170. url: `/pages/admin/Jiazheng/jiazhengUserInfo`
  171. })
  172. }
  173. function goUpPage() {
  174. uni.redirectTo({
  175. url: `/pages/admin/ShouYe/shouye`
  176. })
  177. }
  178. function onRefresh() {
  179. data.page = 0;
  180. data.list = [];
  181. data.loading = true;
  182. refreshData();
  183. }
  184. function telephone() {
  185. uni.makePhoneCall({
  186. phoneNumber: '114' //仅为示例
  187. });
  188. }
  189. function shareInfo() {
  190. }
  191. function refreshData() {
  192. }
  193. function timeClick() {
  194. }
  195. function change() {
  196. }
  197. function handleSearch() {
  198. }
  199. function getDataList() {
  200. let req = {
  201. "leixing": "",
  202. "page": 1,
  203. "realName": "",
  204. "size": 10,
  205. "sortRule": 0,
  206. "sortType": 0,
  207. "userName": ""
  208. }
  209. getJiazhengList(req).then(res => {
  210. console.log('res', res);
  211. data.list = res.data.data
  212. console.log('data.list', data.list);
  213. })
  214. }
  215. onLoad(() => {
  216. getDataList()
  217. })
  218. </script>
  219. <style>
  220. .jiazheng-uni-list {
  221. display: flex;
  222. width: 100%;
  223. flex-direction: column;
  224. }
  225. .jiazheng-uni-list-left {
  226. position: relative;
  227. display: flex;
  228. flex-direction: row;
  229. justify-content: space-between;
  230. align-items: center;
  231. }
  232. </style>