index.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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. <!-- 普通弹窗 -->
  63. <uni-popup ref="popup" background-color="#fff">
  64. <view>
  65. <view>
  66. <view class="container">
  67. <!-- 下拉触发按钮 -->
  68. <view class="select-box" @click="toggleDropdown">
  69. <text class="selected-label">{{ selectedOption || '请选择' }}</text>
  70. <text class="arrow" :class="{ 'rotate': isOpen }">▼</text>
  71. </view>
  72. <!-- 下拉菜单 -->
  73. <view v-if="isOpenSelect" class="dropdown-menu">
  74. <view
  75. v-for="(item, index) in options"
  76. :key="index"
  77. class="dropdown-item"
  78. @click="selectOption(item)"
  79. >
  80. <text>{{ item.label }}</text>
  81. </view>
  82. </view>
  83. <!-- 点击外部关闭的遮罩层 -->
  84. <view v-if="isOpenSelect" class="mask" @click="isOpenSelect = false"></view>
  85. </view>
  86. <view class="phone-search-box">
  87. <input class="search-input" placeholder="请输入职业名称" v-model="zyName" />
  88. <view class="search-icon" @click="handleSearch">
  89. <uni-icons type="search" size="24" color="#fff"></uni-icons>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. </uni-popup>
  95. </view>
  96. </view>
  97. </template>
  98. <script setup>
  99. import {
  100. ref,
  101. reactive
  102. } from "vue";
  103. import {
  104. onLoad
  105. } from "@dcloudio/uni-app";
  106. import {
  107. getJiazhengList,
  108. getJiazhengLeixing
  109. } from "@/api/jiazheng.js"
  110. import dataChecked from './common/dataChecked.vue';
  111. let range = ref([{
  112. "value": 0,
  113. "text": "篮球",
  114. "disable": true
  115. },
  116. {
  117. "value": 1,
  118. "text": "足球"
  119. },
  120. {
  121. "value": 2,
  122. "text": "游泳"
  123. }
  124. ])
  125. let allType = ref([])
  126. let data = reactive({
  127. zyName: '', // 职业名称
  128. list: [], // 考试列表
  129. list2:[
  130. {
  131. "value": 0,
  132. "text": "全部",
  133. },
  134. {
  135. "value": 1,
  136. "text": "姓名"
  137. },
  138. {
  139. "value": 2,
  140. "text": "手机号"
  141. }
  142. ],
  143. loading: false,
  144. page: 0,
  145. size: 10,
  146. state: 'more',
  147. contentText: {
  148. contentdown: '查看更多',
  149. contentrefresh: '加载中',
  150. contentnomore: '没有更多'
  151. }
  152. })
  153. let zyName = ref('')
  154. let value = ref(0)
  155. let isOpen = ref(false)
  156. let typeChecked = ref(1)
  157. let defauleImg = ref('@/static/images/my/client-default-icon.png')
  158. const popup = ref(null);
  159. const allJtClass = 'select-jt-default';
  160. const updataJtClass = 'saixuan-jt-default';
  161. const luruJtClass = 'saixuan-jt-click';
  162. const isOpenSelect = ref(false);
  163. const selectedOption = ref('');
  164. const options = ref([
  165. { label: '全部', value: 1 },
  166. { label: '姓名', value: 2 },
  167. { label: '手机号', value: 3 }
  168. ]);
  169. const clickAlltype = (data) => {
  170. isOpen.value = !isOpen.value;
  171. }
  172. const toggleDropdown = () => {
  173. isOpenSelect.value = !isOpenSelect.value;
  174. };
  175. const selectOption = (item) => {
  176. selectedOption.value = item.label;
  177. isOpenSelect.value = false;
  178. // 这里可以触发自定义事件
  179. // uni.$emit('select-change', item.value);
  180. };
  181. const onSelectCell = (data, index) => {
  182. console.log('data', data);
  183. console.log('index', index);
  184. // isOpen.value = false;
  185. // allJtClass = 'select-jt-click'
  186. }
  187. const toggle = (data, index) => {
  188. popup.value.open('top')
  189. }
  190. const addJiazhengRenyuan = () => {
  191. let pageInfo = {
  192. status:'add'
  193. }
  194. uni.redirectTo({
  195. url:"/pages/admin/Jiazheng/jiazhengUserManager?pageInfo="+JSON.stringify(pageInfo)
  196. })
  197. }
  198. const lookUserInfo = (data) => {
  199. let pageInfo = {
  200. status:'edit',
  201. id:data.id,
  202. userId:data.userId
  203. }
  204. uni.redirectTo({
  205. url: `/pages/admin/Jiazheng/jiazhengUserInfo?pageInfo=`+JSON.stringify(pageInfo)
  206. })
  207. }
  208. function goUpPage() {
  209. uni.redirectTo({
  210. url: `/pages/admin/ShouYe/shouye`
  211. })
  212. }
  213. function onRefresh() {
  214. data.page = 0;
  215. data.list = [];
  216. data.loading = true;
  217. refreshData();
  218. }
  219. function telephone() {
  220. uni.makePhoneCall({
  221. phoneNumber: '114' //仅为示例
  222. });
  223. }
  224. function shareInfo() {
  225. }
  226. function selectChangeSkill() {
  227. }
  228. function refreshData() {
  229. }
  230. function timeClick() {
  231. }
  232. function change() {
  233. }
  234. function handleSearch() {
  235. }
  236. function getDataList() {
  237. let req = {
  238. "leixing": "",
  239. "page": 1,
  240. "realName": "",
  241. "size": 10,
  242. "sortRule": 0,
  243. "sortType": 0,
  244. "userName": ""
  245. }
  246. getJiazhengList(req).then(res => {
  247. console.log('res', res);
  248. data.list = res.data.data
  249. console.log('data.list', data.list);
  250. })
  251. }
  252. function getLeixing() {
  253. let req = {
  254. }
  255. getJiazhengLeixing(req).then(res => {
  256. allType = dataConversionObject(res.data)
  257. console.log('allType',allType.value);
  258. })
  259. }
  260. function dataConversionObject(data) {
  261. let newList
  262. newList = data.map((name, index) => ({
  263. id: index,
  264. name: name
  265. }));
  266. return newList
  267. }
  268. onLoad(() => {
  269. getDataList()
  270. getLeixing()
  271. })
  272. </script>