Forráskód Böngészése

修改一些志愿者相关的bug

shang 7 hónapja
szülő
commit
3adfe70628

+ 1 - 0
components/SCimage/SCimage.vue

@@ -85,6 +85,7 @@ export default {
 		deletePic(event) {
 			console.log(event, 'event');
 			this[`fileList${event.name}`].splice(event.index, 1);
+			this.$emit('childEvent', this[`fileList${event.name}`]);
 		},
 		uploadFilePromise(url) {
 			return new Promise((resolve, reject) => {

+ 4 - 0
config/api.js

@@ -438,6 +438,10 @@ export const getWuyuanUser = (data, callback) => post('getWuyuanUser', data, cal
 export const getCulturalRelicCategory = (data, callback) => get('api/content/category/getCategoryList' + queryParams(
 	data,
 	true), callback);
+//取级联分类
+export const getCategoryCascadeList = (data, callback) => get('api/content/category/getCategoryCascadeList' +
+	queryParams(
+		data, true), callback);
 // 投稿
 export const contribute = (data, callback) => post('contribute', data, callback, '',
 	'api/content/style/contribute');

+ 1 - 1
index_fenbao/GuanLi/zhiYuanGeRen.vue

@@ -116,7 +116,7 @@ export default {
 					id: -1
 				},
 				{
-					title: '未提交',
+					title: '已过期',
 					id: -2
 				}
 			],

+ 20 - 52
index_fenbao/fuWu/baoMing/baoMing.vue

@@ -22,24 +22,15 @@
 				<uni-forms-item label="您的身份证" label-width="100px" required name="id_card">
 					<uni-easyinput type="idcard" v-model="valiFormData.id_card" placeholder="请输入身份证号" />
 				</uni-forms-item>
+				<uni-forms-item label="您的区域" label-width="100px" required name="id_card">
+					<uni-data-picker :localdata="regionList" popup-title="请选择班级" @change="onchange" @nodeclick="onnodeclick"></uni-data-picker>
+				</uni-forms-item>
 				<uni-forms-item label="住址" label-width="100px" required name="address">
 					<uni-easyinput v-model="valiFormData.address" placeholder="请输入住址" />
 				</uni-forms-item>
 				<uni-forms-item label="单位" label-width="80px" required name="unit_name">
 					<uni-easyinput v-model="valiFormData.unit_name" placeholder="请输入单位名称" />
 				</uni-forms-item>
-				<!-- 			<uni-forms-item label="所在区域" label-width="80px" required name="region_id">
-					<view style="width: 100%; height: 72rpx; border-radius: 10rpx; background-color: #f7dfc0">
-						<uni-data-picker
-							v-model="valiFormData.region_id"
-							:clear-icon="false"
-							:localdata="regionList"
-							popup-title="请选择区域"
-							@nodeclick="onnodeclick"
-							:map="{ text: 'title', value: 'id' }"
-						></uni-data-picker>
-					</view>
-				</uni-forms-item> -->
 				<!-- 		<uni-forms-item label="备注" label-width="80px" required name="notesVal">
 					<uni-easyinput v-model="valiFormData.notesVal" placeholder="请输入申请类型(个人、家庭、机构)" />
 				</uni-forms-item> -->
@@ -70,6 +61,7 @@ export default {
 	data() {
 		return {
 			regionList: [],
+			region_id: '',
 			cr_id: '' /* 文物id */,
 			modifyId: '' /* 修改资料的文物id */,
 			volunteer_id: '' /* 志愿者id */,
@@ -82,7 +74,6 @@ export default {
 				unit_name: '',
 				fullurl: '',
 				intro: ''
-				// region_id: '' /* 区域id */
 			},
 
 			/* 校验规则 */
@@ -185,14 +176,6 @@ export default {
 						}
 					]
 				}
-				// region_id: {
-				// 	rules: [
-				// 		{
-				// 			required: true,
-				// 			errorMessage: '请选择所在区域'
-				// 		}
-				// 	]
-				// }
 			}
 		};
 	},
@@ -202,38 +185,22 @@ export default {
 		this.volunteer_id = o.volunteer_id;
 		this.modifyId = o.modifyId;
 		this.details();
-		// this.getCulturalRelicCategory();
+		this.getCategoryCascadeList();
 	},
 	methods: {
-		// onnodeclick(e) {
-		// 	this.region_id = e.id;
-		// 	console.log(this.region_id, 1212);
-		// },
+		onchange(e) {
+			const value = e.detail.value;
+		},
+		onnodeclick(node) {
+			this.region_id = node.value;
+			console.log(node);
+		},
 		// 区域
-		// getCulturalRelicCategory() {
-		// 	this.$api.getCulturalRelicCategory({ main_body_id: 1, type: 1 }, function (res) {
-		// 		// console.log(res, 565656);
-		// 		const result = [];
-		// 		for (const item of res.data) {
-		// 			let parent = result.find((parentItem) => parentItem.id === item.pid);
-		// 			// 如果父级对象尚未存在于结果数组中,将其添加进去
-		// 			if (!parent) {
-		// 				parent = {
-		// 					...item,
-		// 					children: []
-		// 				};
-		// 				result.push(parent);
-		// 			} else {
-		// 				// 确保不将父级自身添加到其children数组
-		// 				if (parent.id !== item.id) {
-		// 					parent.children.push(item);
-		// 				}
-		// 			}
-		// 		}
-		// 		that.regionList = result;
-		// 		// console.log(that.regionList, 66666);
-		// 	});
-		// },
+		getCategoryCascadeList() {
+			this.$api.getCategoryCascadeList({ main_body_id: 1, pid: 5, level: 2 }, function (res) {
+				that.regionList = res.data;
+			});
+		},
 
 		// 测试上传文件
 		chooseFile() {
@@ -282,6 +249,7 @@ export default {
 							main_body_id: 1,
 							name: name,
 							mobile: mobile,
+							region_id: this.region_id,
 							address: address,
 							unit_name: unit_name,
 							id_card: id_card,
@@ -313,10 +281,10 @@ export default {
 			this.$api.details({ main_body_id: 1 }, function (res) {
 				// 被驳回
 				if (res.data != null && res.data.status == '-1') {
-					console.log(res);
+					// console.log(res);
 					that.valiFormData = res.data;
 
-					console.log(that.valiFormData, '被驳回');
+					// console.log(that.valiFormData, '被驳回');
 				}
 				if (res.data != null && res.data.status == '2') {
 					that.$common.errorToShow('您已经是志愿者,正在前往守护');

+ 4 - 1
index_fenbao/fuWu/baoMing/renLing.vue

@@ -382,18 +382,21 @@ export default {
 						if (res.data == 'volunteer') {
 							that.$common.successToShow(res.msg);
 							that.queren = true;
+							console.log('1');
 						} else if (res.data == 'mobile' || res.data == 'isBoundMobile') {
 							// 手动输入手机号
-							// console.log('手动输入');
+							console.log('2');
 							that.$common.errorToShow(res.msg);
 							setTimeout(() => {
 								that.deleteShow = true;
 							}, 2000);
 						} else if (res.data == 'bound') {
+							console.log('3');
 							setTimeout(() => {
 								that.$common.errorToShow(res.msg);
 							}, 1000);
 						} else {
+							console.log('4');
 							// console.log('失败');
 							setTimeout(() => {
 								that.$common.errorToShow(res.msg);

+ 0 - 12
pages/index/index.vue

@@ -333,19 +333,7 @@ export default {
 				that.research = res.data[0];
 			});
 		},
-		// 时间戳转换
-		// timestampToDate(timestamp) {
-		//   const date = new Date(timestamp);
-		//   const year = date.getFullYear();
-		//   const month = date.getMonth() + 1; // JavaScript月份从0开始,所以需要加1
-		//   const day = date.getDate();
 
-		//   // 补零操作,确保日期和月份始终为两位数
-		//   const formattedMonth = month < 10 ? '0' + month : month;
-		//   const formattedDay = day < 10 ? '0' + day : day;
-
-		//   return year + '-' + formattedMonth + '-' + formattedDay;
-		// },
 		checkInOnce() {
 			// 获取当前UTC日期,确保跨时区的一致性
 			const now = new Date();

+ 42 - 8
pages/shouhu/shouhu.vue

@@ -20,6 +20,10 @@
 					<view class="fg"></view>
 					<view class="">志愿者状态:{{ volunteerDetails.status_text }}</view>
 					<view class="fg"></view>
+					<view class="" @click="crDetailsBtn(volunteerDetails.cr_list[0].id)">认领的文物:{{ volunteerDetails.cr_list[0].title }}</view>
+					<view class="fg"></view>
+					<view class="">认领描述:{{ volunteerDetails.cr_list[0].desc ? volunteerDetails.cr_list[0].desc : '' }}</view>
+					<view class="fg"></view>
 					<view v-if="volunteerDetails.status == '-1'" class="">反馈信息:{{ volunteerDetails.feedback ? volunteerDetails.feedback : '' }}</view>
 					<view v-if="volunteerDetails.status == '-1'" class="fg"></view>
 					<view v-if="volunteerDetails.status == '-1'" class="item_xg" @click="modifyBtn">
@@ -96,7 +100,23 @@
 				</view>
 
 				<view class="" style="width: 92%; display: flex; justify-content: center; margin: auto">
-					<u-tabs keyName="title" :list="updatedList" @click="tabsClick" lineColor="#c87d5a" activeStyle="{color: '#c87d5a'}"></u-tabs>
+					<u-tabs
+						keyName="title"
+						:list="updatedList"
+						@click="tabsClick"
+						lineWidth="30"
+						lineColor="#f56c6c"
+						:activeStyle="{
+							color: '#303133',
+							fontWeight: 'bold',
+							transform: 'scale(1.05)'
+						}"
+						:inactiveStyle="{
+							color: '#606266',
+							transform: 'scale(1)'
+						}"
+						itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;"
+					></u-tabs>
 				</view>
 				<view class="gg_box2">
 					<view class="gg_item2" v-for="(item, index) in 3" :key="item.index">
@@ -290,7 +310,6 @@ export default {
 				id: '',
 				cr_id: '',
 				cr_code: '',
-				submit_statuso: '',
 				progress_text: '未派发'
 			};
 			if (t == 1) {
@@ -344,8 +363,9 @@ export default {
 					if (item.type == 2 && item.progress == 3) {
 						item.id = 'new';
 					}
+					console.log(item, 7878);
 					uni.navigateTo({
-						url: '/shouhu_fenbao/xunCha/xunCha?id=' + item.id + '&submit_statuso=' + item.status + '&cr_id=' + item.cr_id + '&cr_code=' + item.cr_code
+						url: '/shouhu_fenbao/xunCha/xunCha?id=' + item.id + '&cr_id=' + item.cr_id + '&cr_code=' + item.cr_code
 					});
 				}
 			}
@@ -356,18 +376,23 @@ export default {
 				if (res.code == 1) {
 					if (res.data != false && res.data.id != undefined) {
 						that.volunteerDetails = res.data;
-						that.syVal = that.volunteerDetails.cr_list[0].title;
 
 						// console.log(that.volunteerDetails.cr_list, '是志愿者');
 						// 剔除认领未审核通过的文物
-						that.updatedList = that.volunteerDetails.cr_list.filter((item) => item.status != 0);
+						that.updatedList = that.volunteerDetails.cr_list.filter((item) => item.status == 1);
 						that.cr_id = that.updatedList[0].id;
 						// console.log(that.volunteerDetails, '是志愿者');
-						that.getPatrolTask(that.updatedList[0]);
+						if (that.syVal === '') {
+							that.syVal = that.volunteerDetails.cr_list[0].title;
+						}
+						//获取syVal当前文物名的文物数据
+						let getPatrolTaskCr = that.updatedList.filter((item) => item.title === that.syVal);
+						that.getPatrolTask(getPatrolTaskCr[0]);
 						that.volhow = false;
 						that.volunteerShow = false;
 						if (res.data.cr_list.length > 0) {
-							that.list2 = res.data.cr_list.filter((item) => item.status != 0);
+							// 剔除认领但未审核通过的文物
+							that.list2 = res.data.cr_list.filter((item) => item.status == 1);
 						}
 					} else {
 						// 控制非志愿者弹层
@@ -497,6 +522,15 @@ export default {
 				});
 			}
 		},
+		crDetailsBtn(id) {
+			if (this.volunteerShow) {
+				that.volhow = true;
+			} else {
+				uni.navigateTo({
+					url: '/index_fenbao/GuanLi/XiangQing?id=' + id
+				});
+			}
+		},
 		close() {
 			this.show = false;
 			this.volhow = false;
@@ -703,7 +737,7 @@ export default {
 	left: 10rpx;
 	opacity: 0.3;
 	font-size: 32rpx;
-	color: #ebc9a9;
+	color: #ffffff;
 	transform: rotate(35deg);
 }
 

+ 143 - 128
pages/user/index.vue

@@ -5,22 +5,29 @@
 		<view class="bg_box">
 			<view class="top_box" @click="modifyShow = true">
 				<view class="img_box" style="display: flex">
-					<image class="img" :src="mainBodyUserInfo.avatar? mainBodyUserInfo.avatar:'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'"></image>
+					<image
+						class="img"
+						:src="
+							mainBodyUserInfo.avatar
+								? mainBodyUserInfo.avatar
+								: 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
+						"
+					></image>
 
 					<view class="">
-						<view v-if="mainBodyUserInfo.nickname=='微信用户'" class="name">{{ mainBodyUserInfo.nickname}}{{mainBodyUserInfo.id}}</view>
-						<view v-else class="name">{{ mainBodyUserInfo.nickname}}</view>
-						<view class="" style="display: flex;align-items: center;">
-							<view style="margin-left: 32rpx; font-size: 28rpx; color: rgba(68, 68, 68, 0.6)">总积分:{{mainBodyUserInfo.score}}</view>
-							<view style="margin-left: 32rpx; font-size: 28rpx; color: rgba(68, 68, 68, 0.6)">id:{{mainBodyUserInfo.id}}</view>
+						<view v-if="mainBodyUserInfo.nickname == '微信用户'" class="name">{{ mainBodyUserInfo.nickname }}{{ mainBodyUserInfo.id }}</view>
+						<view v-else class="name">{{ mainBodyUserInfo.nickname }}</view>
+						<view class="" style="display: flex; align-items: center">
+							<view style="margin-left: 32rpx; font-size: 28rpx; color: rgba(68, 68, 68, 0.6)">总积分:{{ mainBodyUserInfo.score }}</view>
+							<view style="margin-left: 32rpx; font-size: 28rpx; color: rgba(68, 68, 68, 0.6)">id:{{ mainBodyUserInfo.id }}</view>
 						</view>
 					</view>
 				</view>
-				<view class=""> 
+				<view class="">
 					<image style="width: 40rpx; height: 40rpx" src="/static/img/more.png"></image>
 				</view>
 			</view>
-		</view> 
+		</view>
 
 		<!--  -->
 		<view class="btm_box">
@@ -51,16 +58,22 @@
 				<view>
 					<text>点击以下头像获取微信默认头像</text>
 					<button open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
-						<image style="width: 150rpx; height: 150rpx; margin-top: 20rpx" :src="mainBodyUserInfo.avatar? mainBodyUserInfo.avatar:'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'"></image>
+						<image
+							style="width: 150rpx; height: 150rpx; margin-top: 20rpx"
+							:src="
+								mainBodyUserInfo.avatar
+									? mainBodyUserInfo.avatar
+									: 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
+							"
+						></image>
 					</button>
 				</view>
 				<view style="margin-top: 20rpx">
 					<input class="ipt" @change="blurname" v-model="wxnickname" type="nickname" placeholder="请输入昵称" />
-					
 				</view>
-				<view style="margin-top: 40rpx">
+				<!-- 	<view style="margin-top: 40rpx">
 					<input placeholder="请输入邮箱(非必填)" border="surround" v-model="mailbox"></input>
-				</view>
+				</view> -->
 			</view>
 		</u-modal>
 	</view>
@@ -80,7 +93,7 @@ export default {
 			},
 			avatarUrl: '',
 			wxnickname: '',
-			mailbox:"",/*邮箱  */
+			mailbox: '' /*邮箱  */,
 			getFace: false,
 			userdata: {
 				friendsLists: [],
@@ -127,8 +140,8 @@ export default {
 	onShow() {
 		/* 调用userInfo()从本地获取用户信息 */
 		this.user = this.$common.userInfo();
-		
-		if (this.user && this.user.nickname.indexOf('微信') >= 0) { 
+
+		if (this.user && this.user.nickname.indexOf('微信') >= 0) {
 			this.getFace = true;
 		}
 	},
@@ -136,7 +149,7 @@ export default {
 		/* 来到我的页面判断用户是否登录 */
 		_this = this;
 		this.user = this.$common.userInfo();
-		this.mainBodyUserInfo= this.$db.get('mainBodyUserInfo');
+		this.mainBodyUserInfo = this.$db.get('mainBodyUserInfo');
 		// console.log(this.user);
 		if (this.user === 'undefined' || this.user === '' || this.user === [] || this.user === null) {
 			/* 跳转到登录页 */
@@ -145,8 +158,7 @@ export default {
 			/* 刷新 */
 			this.$api.refreshUser(
 				{
-					main_body_id: 1,
-				
+					main_body_id: 1
 				},
 				(val) => {
 					console.log(val, 999);
@@ -159,22 +171,21 @@ export default {
 					this.auth = val.data.auth;
 					this.$db.set('user', val.data.user);
 					this.$db.set('auth', val.data.auth);
-					 _this.$db.set('mainBodyUserInfo',val.data.mainBodyUserInfo);
-					 this.mainBodyUserInfo= this.$db.get('mainBodyUserInfo');
+					_this.$db.set('mainBodyUserInfo', val.data.mainBodyUserInfo);
+					this.mainBodyUserInfo = this.$db.get('mainBodyUserInfo');
 				}
 			);
-			
 		}
 		// this.getMainBodyUser()
 	},
 
 	methods: {
-// getMainBodyUser(){
+		// getMainBodyUser(){
 
-// 	this.$api.getMainBodyUser({main_body_id:1,main_body_user_id:this.mainBodyUserInfo.},function(res){
-// 		console.log(res,78787878)
-// 	})
-// },
+		// 	this.$api.getMainBodyUser({main_body_id:1,main_body_user_id:this.mainBodyUserInfo.},function(res){
+		// 		console.log(res,78787878)
+		// 	})
+		// },
 		myList(i) {
 			uni.navigateTo({
 				url: this.items[i].path
@@ -182,7 +193,7 @@ export default {
 		},
 		// 获取头像
 		onChooseAvatar(e) {
-			this.mainBodyUserInfo.avatar=e.detail.avatarUrl
+			this.mainBodyUserInfo.avatar = e.detail.avatarUrl;
 			// this.avatarUrl = e.detail.avatarUrl;
 		},
 		// 获取昵称
@@ -190,105 +201,109 @@ export default {
 			this.wxnickname = e.detail.value;
 			this.mainBodyUserInfo.nickname = e.detail.value;
 		},
-	isOk() {
-	    this.modifyShow = false;
-	    let userToken = '';
-	    let auth = this.$db.get('auth');
-	    userToken = auth.token;
-	
-	    // 准备formData,无论filePath是否存在都添加
-	    let formData = {
-	        nickname: this.wxnickname
-	    };
-	    
-	    // 如果有图片路径,则准备上传
-	    let uploadPromise = Promise.resolve();
-	    if (this.mainBodyUserInfo.avatar) {
-	        uploadPromise = new Promise((resolve, reject) => {
-	            uni.uploadFile({
-	                url: this.$config.baseUrl + 'api/common/upload?token=' + userToken,
-	                filePath: this.mainBodyUserInfo.avatar,
-	                fileType: 'image',
-	                name: 'file',
-	                headers: {
-	                    Accept: 'application/json',
-	                    'Content-Type': 'multipart/form-data'
-	                },
-	                formData: formData,
-	                success: (uploadFileRes) => {
-	                    var dataimg = JSON.parse(uploadFileRes.data);
-	                    formData.avatar = dataimg.data.fullurl; // 若上传成功,更新formData中的avatar
-	                    resolve(); // 成功后调用resolve
-	                },
-	                fail: (err) => {
-	                    console.error('图片上传失败', err);
-	                    reject(err); // 失败后调用reject,但后续操作仍会执行
-	                },
-	                complete: () => {
-	                    // 无论成功还是失败,都继续执行编辑用户信息的API调用
-	                    _this.$api.editMainBodyUser({
-	                        avatar: formData.avatar || '', // 确保有值,即使上传失败也尝试提交
-	                        main_body_id: 1,
-	                        main_body_user_id: this.mainBodyUserInfo.id,
-	                        nickname: this.wxnickname
-	                    }, (data) => { 
-	                        _this.$common.successToShow('修改成功');                
-	                        if (formData.avatar) {
-	                            // 只有上传成功才更新
-	                            _this.mainBodyUserInfo.avatar = formData.avatar;
-	                        }
-	                        _this.mainBodyUserInfo.nickname = _this.wxnickname;
-	                        _this.$db.set('mainBodyUserInfo', _this.mainBodyUserInfo);
-	                        console.log(_this.mainBodyUserInfo,56456456);
-	                    });
-	                }
-	            });
-	        });
-	    }
-	
-	  
-	}
-	// isOk() {
-			
-	// 		this.modifyShow = false;
-	// 		let userToken = '';
-	// 		let auth = this.$db.get('auth');
-	// 		userToken = auth.token;
-	// 		uni.uploadFile({
-	// 			url: this.$config.baseUrl + 'api/common/upload?token=' + userToken,
-	// 			filePath: this.mainBodyUserInfo.avatar,
-	// 			fileType: 'image',
-	// 			name: 'file',
-	// 			headers: {
-	// 				Accept: 'application/json',
-	// 				'Content-Type': 'multipart/form-data'
-	// 			},
-	// 			formData: { nickname: this.wxnickname },
-	// 			success: (uploadFileRes) => {
-	// 				console.log(9999)
-	// 				// console.log(JSON.parse(uploadFileRes.data), 6666);
-	// 				var dataimg = JSON.parse(uploadFileRes.data);
-	// 				// console.log(dataimg.data.fullurl, 6666);
-	// 				_this.$api.editMainBodyUser( 
-	// 					{
-	// 						avatar: dataimg.data.fullurl,
-	// 						main_body_id: 1,
-	// 						main_body_user_id: this.mainBodyUserInfo.id,
-	// 						nickname: this.wxnickname
-	// 					},
-	// 					(data) => { 
-	// 						_this.$common.successToShow('修改成功');				
-	// 						_this.mainBodyUserInfo.avatar =dataimg.data.fullurl;
-	// 						_this.mainBodyUserInfo.nickname = _this.wxnickname;
-	// 						_this.$db.set('mainBodyUserInfo', _this.mainBodyUserInfo);
-	// 						console.log(_this.mainBodyUserInfo,56456456)
-	// 					}
-	// 				);
-	// 			}
-	// 		});   
-	// 	}
-	
-		
+
+		isOk() {
+			if (this.wxnickname == '' || this.wxnickname == undefined) {
+				this.$common.errorToShow('请输入昵称');
+			} else {
+				this.modifyShow = false;
+				let userToken = '';
+				let auth = this.$db.get('auth');
+				userToken = auth.token;
+
+				// 准备formData,无论filePath是否存在都添加
+				let formData = {
+					nickname: this.wxnickname
+				};
+
+				// 如果有图片路径,则准备上传
+				let uploadPromise = Promise.resolve();
+				if (this.mainBodyUserInfo.avatar) {
+					uploadPromise = new Promise((resolve, reject) => {
+						uni.uploadFile({
+							url: this.$config.baseUrl + 'api/common/upload?token=' + userToken,
+							filePath: this.mainBodyUserInfo.avatar,
+							fileType: 'image',
+							name: 'file',
+							headers: {
+								Accept: 'application/json',
+								'Content-Type': 'multipart/form-data'
+							},
+							formData: formData,
+							success: (uploadFileRes) => {
+								var dataimg = JSON.parse(uploadFileRes.data);
+								formData.avatar = dataimg.data.fullurl; // 若上传成功,更新formData中的avatar
+								resolve(); // 成功后调用resolve
+							},
+							fail: (err) => {
+								console.error('图片上传失败', err);
+								reject(err); // 失败后调用reject,但后续操作仍会执行
+							},
+							complete: () => {
+								// 无论成功还是失败,都继续执行编辑用户信息的API调用
+								_this.$api.editMainBodyUser(
+									{
+										avatar: formData.avatar || '', // 确保有值,即使上传失败也尝试提交
+										main_body_id: 1,
+										main_body_user_id: this.mainBodyUserInfo.id,
+										nickname: this.wxnickname
+									},
+									(data) => {
+										_this.$common.successToShow('修改成功');
+										if (formData.avatar) {
+											// 只有上传成功才更新
+											_this.mainBodyUserInfo.avatar = formData.avatar;
+										}
+										_this.mainBodyUserInfo.nickname = _this.wxnickname;
+										_this.$db.set('mainBodyUserInfo', _this.mainBodyUserInfo);
+										// console.log(_this.mainBodyUserInfo,56456456);
+									}
+								);
+							}
+						});
+					});
+				}
+			}
+		}
+		// isOk() {
+
+		// 		this.modifyShow = false;
+		// 		let userToken = '';
+		// 		let auth = this.$db.get('auth');
+		// 		userToken = auth.token;
+		// 		uni.uploadFile({
+		// 			url: this.$config.baseUrl + 'api/common/upload?token=' + userToken,
+		// 			filePath: this.mainBodyUserInfo.avatar,
+		// 			fileType: 'image',
+		// 			name: 'file',
+		// 			headers: {
+		// 				Accept: 'application/json',
+		// 				'Content-Type': 'multipart/form-data'
+		// 			},
+		// 			formData: { nickname: this.wxnickname },
+		// 			success: (uploadFileRes) => {
+		// 				console.log(9999)
+		// 				// console.log(JSON.parse(uploadFileRes.data), 6666);
+		// 				var dataimg = JSON.parse(uploadFileRes.data);
+		// 				// console.log(dataimg.data.fullurl, 6666);
+		// 				_this.$api.editMainBodyUser(
+		// 					{
+		// 						avatar: dataimg.data.fullurl,
+		// 						main_body_id: 1,
+		// 						main_body_user_id: this.mainBodyUserInfo.id,
+		// 						nickname: this.wxnickname
+		// 					},
+		// 					(data) => {
+		// 						_this.$common.successToShow('修改成功');
+		// 						_this.mainBodyUserInfo.avatar =dataimg.data.fullurl;
+		// 						_this.mainBodyUserInfo.nickname = _this.wxnickname;
+		// 						_this.$db.set('mainBodyUserInfo', _this.mainBodyUserInfo);
+		// 						console.log(_this.mainBodyUserInfo,56456456)
+		// 					}
+		// 				);
+		// 			}
+		// 		});
+		// 	}
 	}
 };
 </script>
@@ -356,11 +371,11 @@ button {
 .item_tit {
 	margin-left: 20rpx;
 	font-size: 32rpx;
-	 
+
 	font-weight: 900;
 	line-height: 48rpx;
 	background: linear-gradient(180deg, #af7e44 0%, #934b36 100%);
 	-webkit-background-clip: text;
 	-webkit-text-fill-color: transparent;
 }
-</style>
+</style>

+ 1 - 1
shouhu_fenbao/shouHu/woDe.vue

@@ -142,7 +142,7 @@ export default {
 					id: -1
 				},
 				{
-					title: '未提交',
+					title: '已过期',
 					id: -2
 				}
 			],

+ 90 - 59
shouhu_fenbao/xunCha/xunCha.vue

@@ -46,9 +46,10 @@
 		<!-- 线下巡查 -->
 		<view class="map_tit">
 			<image style="width: 186rpx; height: 40rpx" src="/static/img/right_img.png"></image>
-			<view class="">巡查报告</view>
+			<view class="">{{ taskDetails.cr_title }}</view>
 			<image style="width: 186rpx; height: 40rpx" src="/static/img/left_img.png"></image>
 		</view>
+		<view v-if="taskDetails.progress == '-1'" style="margin-left: 10%; font-size: 36rpx; color: red">驳回原因:{{ taskDetails.feedback }}</view>
 		<view class="" style="width: 90%; margin: auto">
 			<view class="" style="display: flex; align-items: center">
 				<view class="dw" @click="dwBtn">
@@ -57,7 +58,7 @@
 				</view>
 
 				<view v-if="longitude != ''" :style="{ color: dwShow ? '#07c160' : 'red' }" style="width: 340rpx; margin-left: 20rpx; font-size: 24rpx">
-					当前经纬度{{ longitude }},{{ latitude }}
+					当前经纬度{{ latitude }},{{ longitude }}
 				</view>
 				<view v-else style="margin-left: 20rpx; color: rgba(68, 68, 68, 0.6)">请点击左侧签到按钮获取当前经纬度</view>
 			</view>
@@ -94,7 +95,14 @@
 					<view style="width: 100%; margin: auto">
 						<!-- 	<Segmented activeColor="#EDA98E" :current="item.status" :target="item" :values="displayedItems" @clickItem="onClickItem" styleType="button"></Segmented> -->
 						<!-- 默认选中未知 -->
-						<Segmented activeColor="#c87d5a" :target="item" :values="displayedItems" @clickItem="onClickItem" styleType="button"></Segmented>
+						<Segmented
+							activeColor="#c87d5a"
+							:current="item.segCurrent ? item.segCurrent : 0"
+							:target="item"
+							:values="displayedItems"
+							@clickItem="onClickItem"
+							styleType="button"
+						></Segmented>
 						<!-- 每项上传的照片 -->
 						<view class="" style="display: flex; flex-wrap: wrap; justify-content: start; margin-top: 20rpx">
 							<image
@@ -186,7 +194,7 @@ export default {
 			videoSrc: 'https://huli-app.wenlvti.net/map_source/static/images/video/',
 			taskDetails: {} /* 任务详情 */,
 			taskId: '' /* 任务id */,
-			submitStatuso: '' /*  任务状态*/,
+			submitStatus: 1 /*  提交状态*/,
 			eventTypeId: '' /* 异常事件类型id */,
 			stateId: '' /* 状态id */,
 			items: [{ title: '未知' }, { title: '正常', status: 1 }, { title: '异常', status: 2 }],
@@ -236,7 +244,6 @@ export default {
 		this.taskId = o.id; /* 任务id */
 		this.cr_id = o.cr_id; /* 文物id */
 		this.cr_code = o.cr_code;
-		this.submitStatuso = o.submit_statuso; /* 提交的任务状态 */
 		// 处理状态
 		this.displayedItems = this.items.map((item) => item.title);
 		this.getPatrolTaskDetails(o.id);
@@ -258,8 +265,11 @@ export default {
 		dwBtn() {
 			uni.getLocation({
 				type: 'gcj02',
+				isHighAccuracy: true,
 				success: function (data) {
 					that.$api.distanceCheck({ cr_id: that.cr_id, longitude: data.longitude, latitude: data.latitude }, function (res) {
+						//存储经纬度
+						that.position = res.longitude + ',' + res.latitude;
 						if (res.data === false && res.code == 0) {
 							that.dwShow = false;
 							that.longitude = data.longitude;
@@ -321,6 +331,7 @@ export default {
 				// console.log(res, 'resres');
 				if (res.code === 1) {
 					// that.assetList = res.data;
+					//这边是巡查记录给资产赋值,如果有资产巡查记录,则改变显示的资产信息
 					let alist = res.data;
 					that.taskDetails.patrolTaskAnnexList.forEach((requestItem, index) => {
 						// console.log(alist, '999999');
@@ -336,13 +347,23 @@ export default {
 								});
 
 								alist[i].status_text = requestItem.status_text;
+								//状态高光
+								alist[i].segCurrent = requestItem.status;
 							}
 						});
 					});
 
+					alist.forEach((item, i) => {
+						//如果资产是特殊文物,则提交状态改为特殊文物
+						if (item.is_special == 1) {
+							alist[i].submitStatus = 2;
+							that.submitStatus = 2;
+						}
+					});
+
 					that.assetList = alist;
 
-					that.postList = { main_body_id: 1, task_id: that.taskId, submit_status: that.submitStatuso, property_list: [] };
+					that.postList = { main_body_id: 1, task_id: that.taskId, submit_status: that.submitStatus, property_list: [] };
 				} else {
 					console.log(res.msg);
 				}
@@ -434,28 +455,25 @@ export default {
 			this.postList.property_list[tarIndex].event_type = this.eventTypeId;
 
 			// 检查描述和图片是否已填写
-			for (var i = 0; i < this.postList.property_list.length; i++) {
-				let property = this.postList.property_list[i];
-
-				// 检查描述是否已填写
-				if (!property.desc || property.desc.trim() === '') {
-					// 新加
-					if (this.normal) {
-						this.$common.errorToShow('请填写问题描述');
-					} else {
-						this.describeVal = '未发现异常';
-					}
-
-					// this.$common.errorToShow('请填写问题描述');
-					return;
+			let property = this.postList.property_list[tarIndex];
+			// 检查描述是否已填写
+			if (!property.desc || property.desc.trim() === '') {
+				// 新加
+				if (this.normal) {
+					this.$common.errorToShow('请填写问题描述');
+				} else {
+					this.describeVal = '未发现异常';
 				}
 
-				// 检查是否有至少一张图片
-				if (property.images.length === 0) {
-					this.$common.errorToShow('请上传图片');
-					return;
-				}
+				// this.$common.errorToShow('请填写问题描述');
+				return;
+			}
+			// 检查是否有至少一张图片
+			if (property.images.length === 0) {
+				this.$common.errorToShow('请上传图片');
+				return;
 			}
+
 			// 检查描述和图片是否已填写end
 			this.show = false;
 			this.normal = false;
@@ -464,27 +482,30 @@ export default {
 			// console.log('上传的照片66', this.fileList); /* 照片 */
 			let arr = [];
 			//显示每项上传的图片, 遍历this.fileList,为每个项创建包含url属性的对象,并推送到新数组
-			this.assetList.forEach((obj) => {
-				if (!obj.extraImages) {
-					obj.extraImages = [];
-				}
-
-				const uniqueUrls = new Set();
-				const deduplicatedExtraImages = [];
-
-				obj.extraImages.forEach((imageObj) => {
-					const url = imageObj.url;
-					if (!uniqueUrls.has(url)) {
-						uniqueUrls.add(url);
-						deduplicatedExtraImages.push(imageObj);
-					}
-				});
-
-				obj.extraImages = deduplicatedExtraImages;
-			});
+			// this.assetList.forEach((obj) => {
+			// 	//当前资产图片清空重新写入(还存在一个问题,删掉不另外增加图片,无法触发this.fileList的修改,导致单纯删某张图片删不掉)
+			// 	if (obj.id == this.postList.property_list[tarIndex].id) {
+			// 		obj.extraImages = [];
+			// 	}
+
+			// const uniqueUrls = new Set();
+			// const deduplicatedExtraImages = [];
+
+			// obj.extraImages.forEach((imageObj) => {
+			// 	const url = imageObj.url;
+			// 	if (!uniqueUrls.has(url)) {
+			// 		uniqueUrls.add(url);
+			// 		deduplicatedExtraImages.push(imageObj);
+			// 	}
+			// });
+
+			// obj.extraImages = deduplicatedExtraImages;
+			// });
 
 			this.assetList.forEach((obj) => {
 				if (obj.id === this.assetDetails.id) {
+					//先将当前资产图片清空,再重新写入
+					obj.extraImages = [];
 					this.postList.property_list.forEach((item) => {
 						obj.describeVal = item.desc;
 					});
@@ -518,20 +539,28 @@ export default {
 					allItemsValid = false; // 遇到不符合条件的对象时,标记为不通过
 				}
 			});
-
+			// 移除的域名
 			if (allItemsValid) {
-				// 需要移除的域名
-				const domainToRemove = 'https://meng.wenlvti.net';
+				const prefixToKeep = '/uploads/';
+
+				// 检查 postList 和其 property_list 是否存在并结构正确
 				if (this.postList && Array.isArray(this.postList.property_list)) {
-					for (const property of this.postList.property_list) {
+					// 遍历每个 property
+					this.postList.property_list.forEach((property) => {
+						// 检查 images 是否存在并是一个数组
 						if (property.images && Array.isArray(property.images)) {
-							for (const imageObj of property.images) {
-								if (imageObj.url && imageObj.url.startsWith(domainToRemove)) {
-									imageObj.url = imageObj.url.substring(domainToRemove.length);
+							// 更新每个图片的 URL
+							property.images.forEach((imageObj) => {
+								// 检查 URL 是否包含需要保留的前缀
+								if (imageObj.url && imageObj.url.includes(prefixToKeep)) {
+									// 获取 "uploads" 在 URL 中的位置
+									const index = imageObj.url.indexOf(prefixToKeep);
+									// 从 "uploads" 开始截取 URL
+									imageObj.url = imageObj.url.substring(index);
 								}
-							}
+							});
 						}
-					}
+					});
 				}
 				// 需要移除的域名end
 
@@ -552,7 +581,7 @@ export default {
 				if (that.assetList[0].is_special === 0) {
 					uni.getLocation({
 						type: 'gcj02',
-
+						isHighAccuracy: true,
 						success: function (res) {
 							that.position = res.longitude + ',' + res.latitude;
 							mypost.position = that.position;
@@ -561,20 +590,20 @@ export default {
 							that.$api.distanceCheck({ cr_id: that.cr_id, longitude: res.longitude, latitude: res.latitude }, function (res) {
 								if (res.data === false && res.code == 0) {
 									that.$common.errorToShow(res.msg);
-									console.log(res, '不是特殊文物距离过远');
+									// console.log(res, '不是特殊文物距离过远');
 								} else {
-									console.log(res, '不是特殊文物距离ok');
+									// console.log(res, '不是特殊文物距离ok');
 									that.$api.submitTask(mypost, function (res) {
 										if (res.code == 1) {
 											// console.log(res, '提交成功');
-											that.$common.successToShow('提交成功');
+											that.$common.successToShow(res.msg);
 											setTimeout(() => {
 												uni.switchTab({
 													url: '/pages/shouhu/shouhu'
 												});
 											}, 1000);
 										} else {
-											that.$common.errorToShow('请稍后再试');
+											that.$common.errorToShow(res.msg);
 										}
 									});
 								}
@@ -587,17 +616,19 @@ export default {
 				} else {
 					// 特殊文物不用判断距离
 					console.log('特殊文物不用判断距离');
+					//提交参数传入经纬度
+					mypost.position = that.position;
 					that.$api.submitTask(mypost, function (res) {
 						if (res.code == 1) {
 							// console.log(res, '提交成功');
-							that.$common.successToShow('提交成功');
+							that.$common.successToShow(res.msg);
 							setTimeout(() => {
 								uni.switchTab({
 									url: '/pages/shouhu/shouhu'
 								});
 							}, 1000);
 						} else {
-							that.$common.errorToShow('请稍后再试');
+							that.$common.errorToShow(res.msg);
 						}
 					});
 				}

+ 5 - 2
user_fenbao/houTai/taskDEetailsPage.vue

@@ -7,8 +7,10 @@
 					<uni-icons type="sound" size="22" color="#b75830"></uni-icons>
 					<view>任务详情</view>
 				</view>
+
 				<view>
 					<view style="color: #90592a">
+						<view class="">{{ cr_title }}</view>
 						<!-- <text>{{ taskDetails.type_text || '暂无任务' }}:</text> -->
 						<text>巡查时间:{{ taskDetails.progress == 3 ? taskDetails.submit_time : taskDetails.created_at }}</text>
 					</view>
@@ -124,6 +126,7 @@ let that;
 export default {
 	data() {
 		return {
+			cr_title: '',
 			returnShow: false,
 			returnVal: '',
 			currents: [],
@@ -161,7 +164,7 @@ export default {
 		this.task_id = o.id; /* 任务id */
 		this.cr_id = o.cr_id; /* 文物id */
 		this.cr_code = o.cr_code;
-
+		this.cr_title = o.cr_title;
 		// 处理状态
 		this.displayedItems = this.items.map((item) => item.title);
 		this.getPatrolTaskDetails(o.id);
@@ -424,7 +427,7 @@ export default {
 	padding-right: 20rpx;
 }
 .fzdj {
-	width: 100%;
+	width: 92%;
 	height: 40px;
 	background-color: transparent;
 	position: absolute;

+ 4 - 3
user_fenbao/houTai/xunCha.vue

@@ -42,7 +42,7 @@
 						<!-- <view v-if="item.status == '-2'" class="bk" style="display: flex; justify-content: space-around">
 							<view class="ck">提醒</view>
 						</view> -->
-						<view @click="checkBtn(item.id)" class="bk" style="display: flex; justify-content: space-around">
+						<view @click="checkBtn(item)" class="bk" style="display: flex; justify-content: space-around">
 							<view class="ck">查看</view>
 						</view>
 					</view>
@@ -172,9 +172,10 @@ export default {
 			}
 		},
 		// 查看巡查详情
-		checkBtn(id) {
+		checkBtn(item) {
+			console.log(item);
 			uni.navigateTo({
-				url: '/user_fenbao/houTai/taskDEetailsPage?id=' + id
+				url: '/user_fenbao/houTai/taskDEetailsPage?id=' + item.id + '&cr_title=' + item.cr_title
 			});
 		},
 		// 时间筛选

+ 2 - 2
user_fenbao/houTai/zhiYuanZhe.vue

@@ -256,7 +256,7 @@ export default {
 				if (res.code === 1) {
 					that.detailsList = res.data;
 				} else {
-					that.$common.errorToShow('请稍后再试');
+					that.$common.errorToShow(res.msg);
 				}
 			});
 		},
@@ -312,7 +312,7 @@ export default {
 					}
 					that.$common.errorToShow(res.msg);
 				} else {
-					that.$common.errorToShow('请稍后再试');
+					that.$common.errorToShow(res.msg);
 				}
 			});
 		},