index.vue 5.5 KB

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