index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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" @click="addJiazhengRenyuan">+</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(item)">
  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. <search-dialog ref="searchDialogRef" @search-btn="dialogSearchBtn" @reset-search="dialogSearchReset"></search-dialog>
  63. </view>
  64. </view>
  65. </template>
  66. <script setup>
  67. import {
  68. ref,
  69. reactive
  70. } from "vue";
  71. import {
  72. onLoad
  73. } from "@dcloudio/uni-app";
  74. import {
  75. getJiazhengList,
  76. getJiazhengLeixing
  77. } from "@/api/jiazheng.js"
  78. import dataChecked from './common/dataChecked.vue';
  79. import searchDialog from "./common/search.vue";
  80. let range = ref([{
  81. "value": 0,
  82. "text": "篮球",
  83. "disable": true
  84. },
  85. {
  86. "value": 1,
  87. "text": "足球"
  88. },
  89. {
  90. "value": 2,
  91. "text": "游泳"
  92. }
  93. ])
  94. const searchDialogRef = ref(null);
  95. let allType = ref([])
  96. let data = reactive({
  97. zyName: '', // 职业名称
  98. list: [], // 考试列表
  99. loading: false,
  100. page: 0,
  101. size: 10,
  102. state: 'more',
  103. contentText: {
  104. contentdown: '查看更多',
  105. contentrefresh: '加载中',
  106. contentnomore: '没有更多'
  107. }
  108. })
  109. let zyName = ref('')
  110. let value = ref(0)
  111. let isOpen = ref(false)
  112. let typeChecked = ref(1)
  113. let defauleImg = ref('@/static/images/my/user-default-img.png')
  114. const popup = ref(null);
  115. const allJtClass = 'select-jt-default';
  116. const updataJtClass = 'saixuan-jt-default';
  117. const luruJtClass = 'saixuan-jt-click';
  118. const isOpenSelect = ref(false);
  119. const selectedOption = ref('');
  120. const options = ref([
  121. { label: '全部', value: 1 },
  122. { label: '姓名', value: 2 },
  123. { label: '手机号', value: 3 }
  124. ]);
  125. function dialogSearchBtn(name,searchData){
  126. switch (name) {
  127. case '姓名':
  128. dialogSearchReset();
  129. data.realName = searchData.value;
  130. break;
  131. case '手机号':
  132. data.userName = searchData.value;
  133. break;
  134. }
  135. refreshData();
  136. }
  137. function dialogSearchReset(){
  138. data.userName='';
  139. data.realName='';
  140. }
  141. const clickAlltype = (data) => {
  142. isOpen.value = !isOpen.value;
  143. }
  144. const toggleDropdown = () => {
  145. isOpenSelect.value = !isOpenSelect.value;
  146. };
  147. const selectOption = (item) => {
  148. selectedOption.value = item.label;
  149. isOpenSelect.value = false;
  150. // 这里可以触发自定义事件
  151. // uni.$emit('select-change', item.value);
  152. };
  153. const onSelectCell = (data, index) => {
  154. console.log('data', data);
  155. console.log('index', index);
  156. // isOpen.value = false;
  157. // allJtClass = 'select-jt-click'
  158. }
  159. const toggle = (data, index) => {
  160. searchDialogRef.value.handleShow();
  161. }
  162. const addJiazhengRenyuan = () => {
  163. let pageInfo = {
  164. status:'add'
  165. }
  166. uni.redirectTo({
  167. url:"/pages/admin/Jiazheng/jiazhengUserManager?pageInfo="+JSON.stringify(pageInfo)
  168. })
  169. }
  170. const lookUserInfo = (data) => {
  171. let pageInfo = {
  172. status:'edit',
  173. id:data.id,
  174. userId:data.userId
  175. }
  176. uni.redirectTo({
  177. url: `/pages/admin/Jiazheng/jiazhengUserInfo?pageInfo=`+JSON.stringify(pageInfo)
  178. })
  179. }
  180. function goUpPage() {
  181. uni.redirectTo({
  182. url: `/pages/admin/ShouYe/shouye`
  183. })
  184. }
  185. function onRefresh() {
  186. data.page = 0;
  187. data.list = [];
  188. data.loading = true;
  189. refreshData();
  190. }
  191. function telephone() {
  192. uni.makePhoneCall({
  193. phoneNumber: '114' //仅为示例
  194. });
  195. }
  196. function shareInfo() {
  197. }
  198. function selectChangeSkill() {
  199. }
  200. function refreshData() {
  201. }
  202. function timeClick() {
  203. }
  204. function change() {
  205. }
  206. function handleSearch() {
  207. }
  208. function getDataList() {
  209. let req = {
  210. "leixing": "",
  211. "page": 1,
  212. "realName": "",
  213. "size": 10,
  214. "sortRule": 0,
  215. "sortType": 0,
  216. "userName": ""
  217. }
  218. getJiazhengList(req).then(res => {
  219. console.log('res', res);
  220. data.list = res.data.data
  221. console.log('data.list', data.list);
  222. })
  223. }
  224. function getLeixing() {
  225. let req = {
  226. }
  227. getJiazhengLeixing(req).then(res => {
  228. allType = dataConversionObject(res.data)
  229. console.log('allType',allType.value);
  230. })
  231. }
  232. function dataConversionObject(data) {
  233. let newList
  234. newList = data.map((name, index) => ({
  235. id: index,
  236. name: name
  237. }));
  238. return newList
  239. }
  240. onLoad(() => {
  241. getDataList()
  242. getLeixing()
  243. })
  244. </script>