index.vue 5.7 KB

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