瀏覽代碼

Merge branch '2025北京诚祥' of https://gogs.mtavip.com/wangguoyu/uniProject into 2025北京诚祥

tanxue 2 月之前
父節點
當前提交
6f16783ee9
共有 4 個文件被更改,包括 264 次插入154 次删除
  1. 48 0
      components/customMap/customMap.vue
  2. 8 1
      manifest.json
  3. 208 153
      pages/admin/Jiazheng/index.vue
  4. 二進制
      static/images/common/markIcon.png

+ 48 - 0
components/customMap/customMap.vue

@@ -0,0 +1,48 @@
+<template>
+	<view>
+		<map style="width: 100%; height: 300px;" :latitude="data.latitude" :longitude="data.longitude" :markers="data.covers"> </map>
+	</view>
+</template>
+
+<script setup>
+	import {
+		reactive,
+	} from "vue"
+	import myIcon from "@/static/images/common/markIcon.png"
+	import {onLoad} from "@dcloudio/uni-app"
+
+	const data = reactive({
+		id: 0, // 使用 marker点击事件 需要填写id
+		title: 'map',
+		latitude: 39.909,
+		longitude: 116.39742,
+		covers: [{
+			latitude: 39.909,
+			longitude: 116.39742,
+			iconPath: myIcon,
+		}]
+	})
+	
+	function initLocation() {
+		uni.getLocation({
+			type: 'gcj02',
+			success: function (res) {
+				data.longitude = res.longitude;
+				data.latitude = res.latitude;
+				data.covers[0].longitude = res.longitude;
+				data.covers[0].latitude = res.latitude;
+				console.log('当前位置的经度:' + res.longitude);
+				console.log('当前位置的纬度:' + res.latitude);
+			}
+		});
+	}
+	
+	onLoad(() => {
+		initLocation();
+	})
+	
+</script>
+
+<style>
+
+</style>

+ 8 - 1
manifest.json

@@ -144,7 +144,14 @@
             "mode" : "history"
         },
         "title" : "北京诚祥",
-        "template" : "template.h5.html"
+        "template" : "template.h5.html",
+        "sdkConfigs" : {
+            "maps" : {
+                "qqmap" : {
+                    "key" : "KBYBZ-FS3KZ-U2FXR-7VPDX-L7J46-23F55"
+                }
+            }
+        }
     },
     "fallbackLocale" : "zh-Hans"
 }

+ 208 - 153
pages/admin/Jiazheng/index.vue

@@ -1,68 +1,70 @@
 <template>
-		<view class="admin-jiazheng-list">
-			<view class="phone-navBar-box">
-				<view @click="goUpPage" class="nav-bar-icon"></view>
-				<text class="nav-bar-title">家政人员</text>
-				<view class="nav-bar-icon-box">
-					<text class="nav-bar-right-icon" @click="addJiazhengRenyuan">+</text>
-					<uni-icons class="nav-bar-right-icon" type="search" size="18" color="#666" @click="toggle('top')"></uni-icons>
-				</view>
+	<view class="admin-jiazheng-list">
+		<view class="phone-navBar-box">
+			<view @click="goUpPage" class="nav-bar-icon"></view>
+			<text class="nav-bar-title">家政人员</text>
+			<view class="nav-bar-icon-box">
+				<text class="nav-bar-right-icon" @click="addJiazhengRenyuan">+</text>
+				<uni-icons class="nav-bar-right-icon" type="search" size="18" color="#666"
+					@click="toggle('top')"></uni-icons>
+			</view>
+		</view>
+		<view class="jiazheng-search-box">
+			<view @click.stop="clickAlltype" class="select-item-box">
+				<text>{{data.leixing}}</text>
+				<icon :class="allJtClass" />
 			</view>
-			<view class="jiazheng-search-box">
-				<view @click="clickAlltype" class="select-item-box">
-					<text>全部类型</text>
-					<icon :class="allJtClass" />
+
+			<view class="jiazheng-search-right">
+				<!--  当前点击 增加 saixuan-active-->
+				<view @click="updateTimeClick" :class="shaixuanStyleUpdate">
+					<text>更新时间</text>
+					<icon :class="updataJtClass" />
 				</view>
-				
-				<view class="jiazheng-search-right">
-					<!--  当前点击 增加 saixuan-active-->
-					<view class="saixuan-item-box saixuan-active">
-						<text @click="timeClick">更新时间</text>
-						<icon :class="updataJtClass" />
-					</view>
-					<view class="saixuan-item-box">
-						<!-- class切换  saixuan-jt-default  saixuan-jt-click-->
-						<text>录入时间</text>
-						<icon :class="luruJtClass" />
-					</view>
+				<view @click="luruTimeClick" :class="shaixuanStyleluru">
+					<!-- class切换  saixuan-jt-default  saixuan-jt-click-->
+					<text>录入时间</text>
+					<icon :class="luruJtClass" />
 				</view>
-			</view>	
-			<view class="all-type-box" v-show="isOpen">
-				<dataChecked :list="allType" mode="multiple" :defaultCount="99" :showAdd="false" @change="selectChangeSkill" />
 			</view>
-			<view>
-				<scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="data.loading"
-					:refresher-threshold="50" refresher-background="transparent" @refresherrefresh="onRefresh"
-					class="phone-scroll-view">
-					<uni-list class="admin-list-box">
-						<uni-list-item v-for="item in data.list" class="admin-list-item-box">
-							<template v-slot:body>
+		</view>
+		<view class="all-type-box" v-show="isOpen" @click="clickAlltype">
+			<dataChecked :list="allType" mode="single" :defaultCount="99" :showAdd="false"
+				@change="selectChangeSkill" />
+		</view>
+		<view>
+			<scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="data.loading"
+				:refresher-threshold="50" refresher-background="transparent" @refresherrefresh="onRefresh"
+				class="phone-scroll-view">
+				<uni-list class="admin-list-box">
+					<uni-list-item v-for="item in data.list" class="admin-list-item-box">
+						<template v-slot:body>
+							<view>
+								<view>{{item.realName}}</view>
+								<view @click="telephone(item)">打电话</view>
+							</view>
+							<view @click="lookUserInfo(item)">
+								<image :src="item.icon ||defauleImg" mode=""></image>
 								<view>
-									<view>{{item.realName}}</view>
-									<view @click="shareInfo">分享</view>
-									<view @click="telephone">打电话</view>
+									<p> {{item.age}}岁|{{item.jingyan}}年经验</p>
+									<p>{{item.jiguan}}</p>
 								</view>
-								<view @click="lookUserInfo(item)">
-									<image :src="item.icon ||defauleImg" mode=""></image>
-									<view>
-										<p> {{item.age}}岁|{{item.jingyan}}年经验</p>
-										<p>{{item.jiguan}}</p>
-									</view>
-									<view>
-										{{item.zhuangtai}}
-									</view>
-								</view>				
-							</template>
-						</uni-list-item>
-						<uni-load-more :status="data.state" @click="getMore(0)"
-							:contentText="data.contentText"></uni-load-more>
-					</uni-list>
-				</scroll-view>
-			</view>
-			<view>
-		<search-dialog ref="searchDialogRef" @search-btn="dialogSearchBtn" @reset-search="dialogSearchReset"></search-dialog>
-			</view>
+								<view>
+									{{item.zhuangtai}}
+								</view>
+							</view>
+						</template>
+					</uni-list-item>
+					<uni-load-more :status="data.state" @click="getMore(0)"
+						:contentText="data.contentText"></uni-load-more>
+				</uni-list>
+			</scroll-view>
 		</view>
+		<view>
+			<search-dialog ref="searchDialogRef" @search-btn="dialogSearchBtn"
+				@reset-search="dialogSearchReset"></search-dialog>
+		</view>
+	</view>
 </template>
 
 <script setup>
@@ -79,28 +81,18 @@
 	} from "@/api/jiazheng.js"
 	import dataChecked from './common/dataChecked.vue';
 	import searchDialog from "./common/search.vue";
-	let range = ref([{
-			"value": 0,
-			"text": "篮球",
-			"disable": true
-		},
-		{
-			"value": 1,
-			"text": "足球"
-		},
-		{
-			"value": 2,
-			"text": "游泳"
-		}
-	])
 	const searchDialogRef = ref(null);
 	let allType = ref([])
 	let data = reactive({
-		zyName: '', // 职业名称
-		list: [], // 考试列表
-		loading: false,
+		leixing: '全部类型',
 		page: 0,
 		size: 10,
+		realName: '',
+		sortRule: '', //排序规则(1降序,2升序
+		sortRule: '', //排序类型(1更新时间,2录入时间)
+		userName: '',
+		list: [], // 考试列表
+		loading: false,
 		state: 'more',
 		contentText: {
 			contentdown: '查看更多',
@@ -108,79 +100,108 @@
 			contentnomore: '没有更多'
 		}
 	})
-	let zyName = ref('')
-	let value = ref(0)
 	let isOpen = ref(false)
-	let typeChecked = ref(1)
 	let defauleImg = ref('@/static/images/my/user-default-img.png')
-	const popup = ref(null);
 	const allJtClass = 'select-jt-default';
-	const updataJtClass = 'saixuan-jt-default';
-	const luruJtClass = 'saixuan-jt-click';
-	
+	let updataJtClass = ref('');
+	let luruJtClass = ref('');
+	let shaixuanStyleUpdate = ref('saixuan-item-box');
+	let shaixuanStyleluru = ref('saixuan-item-box');
 	const isOpenSelect = ref(false);
 	const selectedOption = ref('');
-	const options = ref([
-	  { label: '全部', value: 1 },
-	  { label: '姓名', value: 2 },
-	  { label: '手机号', value: 3 }
-	]);
-	function dialogSearchBtn(name,searchData){
+	let isFirstClickUpdate = ref('true')
+	let isFirstClickluru = ref('true')
+
+	function updateTimeClick() {
+		data.sortType = 1
+		const isFirst = isFirstClickUpdate.value == 'true';
+		const isSecond = isFirstClickUpdate.value == 'false';
+		if (isFirst) {
+			shaixuanStyleUpdate.value = 'saixuan-item-box saixuan-active';
+			updataJtClass.value = 'saixuan-jt-default';
+			isFirstClickUpdate.value = 'false';
+			data.sortRule = 1
+		} else if (isSecond) {
+			shaixuanStyleUpdate.value = 'saixuan-item-box saixuan-active';
+			updataJtClass.value = 'saixuan-jt-click';
+			isFirstClickUpdate.value = 'empty';
+			data.sortRule = 2
+		} else {
+			shaixuanStyleUpdate.value = 'saixuan-item-box';
+			updataJtClass.value = '';
+			isFirstClickUpdate.value = 'true';
+			data.sortRule = 0
+		}
+		data.page = 0;
+		refreshData()
+	}
+
+	function luruTimeClick() {
+		data.sortType = 2
+		const isFirst = isFirstClickluru.value == 'true';
+		const isSecond = isFirstClickluru.value == 'false';
+		if (isFirst) {
+			shaixuanStyleluru.value = 'saixuan-item-box saixuan-active';
+			luruJtClass.value = 'saixuan-jt-default';
+			isFirstClickluru.value = 'false';
+			data.sortRule = 1
+		} else if (isSecond) {
+			shaixuanStyleluru.value = 'saixuan-item-box saixuan-active';
+			luruJtClass.value = 'saixuan-jt-click';
+			isFirstClickluru.value = 'empty';
+			data.sortRule = 2
+		} else {
+			shaixuanStyleluru.value = 'saixuan-item-box';
+			luruJtClass.value = '';
+			isFirstClickluru.value = 'true';
+			data.sortRule = 0
+		}
+		data.page = 0;
+		refreshData()
+	}
+
+	function dialogSearchBtn(name, searchData) {
 		switch (name) {
 			case '姓名':
 				dialogSearchReset();
-			    data.realName = searchData.value;
-			    break;
+				data.realName = searchData.value;
+				break;
 			case '手机号':
-			    data.userName = searchData.value;
-			    break;	
+				data.userName = searchData.value;
+				break;
 		}
+		data.page = 0;
 		refreshData();
-		
+
 	}
-	
-	function dialogSearchReset(){
-		data.userName='';
-		data.realName='';
+
+	function dialogSearchReset() {
+		data.userName = '';
+		data.realName = '';
 	}
 	const clickAlltype = (data) => {
-	 isOpen.value = !isOpen.value;
-	}
-	const toggleDropdown = () => {
-	  isOpenSelect.value = !isOpenSelect.value;
-	};
-	const selectOption = (item) => {
-	  selectedOption.value = item.label;
-	  isOpenSelect.value = false;
-	  // 这里可以触发自定义事件
-	  // uni.$emit('select-change', item.value);
-	};
-	
-	const onSelectCell = (data, index) => {
-		console.log('data', data);
-		console.log('index', index);
-		//	isOpen.value = false;
-		//	allJtClass = 'select-jt-click'
+		isOpen.value = !isOpen.value;
 	}
+
 	const toggle = (data, index) => {
-	searchDialogRef.value.handleShow();	
+		searchDialogRef.value.handleShow();
 	}
 	const addJiazhengRenyuan = () => {
 		let pageInfo = {
-			status:'add'
+			status: 'add'
 		}
 		uni.redirectTo({
-			url:"/pages/admin/Jiazheng/jiazhengUserManager?pageInfo="+JSON.stringify(pageInfo) 
+			url: "/pages/admin/Jiazheng/jiazhengUserManager?pageInfo=" + JSON.stringify(pageInfo)
 		})
 	}
 	const lookUserInfo = (data) => {
 		let pageInfo = {
-			status:'edit',
-			id:data.id,
-			userId:data.userId
+			status: 'edit',
+			id: data.id,
+			userId: data.userId
 		}
 		uni.redirectTo({
-			url: `/pages/admin/Jiazheng/jiazhengUserInfo?pageInfo=`+JSON.stringify(pageInfo)
+			url: `/pages/admin/Jiazheng/jiazhengUserInfo?pageInfo=` + JSON.stringify(pageInfo)
 		})
 	}
 
@@ -197,59 +218,93 @@
 		refreshData();
 	}
 
-	function telephone() {
+	function telephone(data) {
+		console.log('data', data);
 		uni.makePhoneCall({
 			phoneNumber: '114' //仅为示例
 		});
 	}
 
-	function shareInfo() {
-
-	}
-	function selectChangeSkill() {
 
+	function selectChangeSkill(item) {
+		data.leixing = item[0].name
+		console.log('selectChangeSkill', item);
+		data.page = 0;
+		refreshData()
 	}
 
 	function refreshData() {
+		const opt = {
+			"leixing": data.leixing == '全部类型' ? '' : data.leixing,
+			"page": 1,
+			"realName": data.realName,
+			"size": 10,
+			"sortRule": data.sortRule,
+			"sortType": data.sortType,
+			"userName": data.userName
+		}
+		data.list = [];
+		// 数学
+		data.state = 'loading';
+		data.page++;
+		opt.page = data.page;
 
-	}
-
-	function timeClick() {
-
-	}
-
-	function change() {
-
-	}
-
-	function handleSearch() {
+		getJiazhengList(opt).then(res => {
+			data.list = data.list.concat(res.data.data);
+			data.loading = false;
 
+			if (res.data.total > data.list.length) {
+				data.state = 'more';
+				data.loading = false;
+			} else {
+				data.state = 'no-more';
+				data.loading = false;
+			}
+		}).catch(err => {
+			data.state = 'more';
+			data.loading = false;
+		})
 	}
 
-	function getDataList() {
-		let req = {
-			"leixing": "",
+	function getMore() {
+		const opt = {
+			"leixing": data.leixing == '全部类型' ? '' : data.leixing,
 			"page": 1,
-			"realName": "",
+			"realName": data.realName,
 			"size": 10,
-			"sortRule": 0,
-			"sortType": 0,
-			"userName": ""
+			"sortRule": data.sortRule,
+			"sortType": data.sortType,
+			"userName": data.userName
 		}
-		getJiazhengList(req).then(res => {
-			console.log('res', res);
-			data.list = res.data.data
-			console.log('data.list', data.list);
+		if (data.state == 'no-more') return;
+		data.state = 'loading';
+		data.page++;
+		opt.page = data.page;
+		getJiazhengList(opt).then(res => {
+			data.list = data.list.concat(res.data.data);
+			data.loading = false;
+
+			if (res.data.total > data.list.length) {
+				data.state = 'more';
+				data.loading = false;
+			} else {
+				data.state = 'no-more';
+				data.loading = false;
+			}
+		}).catch(err => {
+			data.state = 'more';
+			data.loading = false;
 		})
 	}
+
 	function getLeixing() {
-		let req = {
-		}
+		let req = {}
 		getJiazhengLeixing(req).then(res => {
-				allType = dataConversionObject(res.data)
-			console.log('allType',allType.value);
+			allType = dataConversionObject(res.data)
+			console.log('allType', allType.value);
 		})
 	}
+
 	function dataConversionObject(data) {
 		let newList
 		newList = data.map((name, index) => ({
@@ -259,7 +314,7 @@
 		return newList
 	}
 	onLoad(() => {
-		getDataList()
+		getMore()
 		getLeixing()
 	})
-</script>
+</script>

二進制
static/images/common/markIcon.png