Fly 1 kuukausi sitten
vanhempi
commit
2583f6c113

+ 1 - 0
components/tiandituMap/tiandituMap.vue

@@ -31,6 +31,7 @@
 		data() {
 			return {
 				isGetLocation:c.isGetLocation,
+				isFeedback:c.isFeedback,
 				checkedDot: false,
 				Tmap: null,
 				option: {

+ 40 - 10
pages/feedback/SelectClassify.vue

@@ -1,15 +1,28 @@
 <template>
-	<uni-popup ref="SelectMap" :isMaskClick='true' type="bottom" border-radius="10px 10px 0 0"
+	<!-- 	<uni-popup ref="SelectMap" :isMaskClick='true' type="bottom" border-radius="10px 10px 0 0"
 		maskBackgroundColor='rgba(0, 0, 0, 0.1)'>
 		<view class="map-list">
 			<view class="title">请选择问题分类</view>
 			<view class="map-item" @click.stop="handlerFeedbackType(item.value)" v-for="item in list">
 				{{item.label }}
 			</view>
-			<view class="map-item cancel">
+			<view class="map-item cancel" @click.stop="close()">
 				取消
 			</view>
 		</view>
+	</uni-popup> -->
+	<uni-popup class="picker-popup" ref="popupRef" type="bottom" border-radius="10px 10px 0 0">
+		<div class="picker-content">
+			<div class="city-picker-btn">
+				<text @click.stop="close()">取消</text>
+				<text @click.stop="confirm()">确定</text>
+			</div>
+			<picker-view indicator-class="indicator-class" :value="value||[]" class="picker-view" @change="bindChange">
+				<picker-view-column>
+					<view class="item" v-for="(item,index) in list" :key="index">{{item.label}}</view>
+				</picker-view-column>
+			</picker-view>
+		</div>
 	</uni-popup>
 </template>
 
@@ -23,11 +36,11 @@
 		},
 		data() {
 			return {
-
+				value: undefined
 			};
 		},
 		created() {
-	 
+
 		},
 		mounted() {
 			// setTimeout(() => {
@@ -36,15 +49,31 @@
 		},
 		methods: {
 			open() {
-				this.$refs.SelectMap.open()
+				if (!this.value || this.value.length === 0) {
+					this.value = [0]
+				}
+				this.$refs.popupRef.open()
 			},
 			close() {
-				this.$refs.SelectMap.close()
+				this.$refs.popupRef.close()
+			},
+			confirm() {
+				if (this.value && this.value.length > 0) {
+					const index = this.value[0];
+					const value = this.list[index].value;
+					this.$emit("chang", value)
+					this.close()
+				} else {
+					uni.showToast({
+						title: '请选择问题分类',
+						icon: 'none'
+					})
+				}
+			},
+			bindChange(val) {
+				const { value } = val.detail;
+				this.value = value;
 			},
-			handlerFeedbackType(val) {
-				this.$emit("chang" , val)
-				this.close()
-			}
 
 		}
 	}
@@ -72,6 +101,7 @@
 
 		.cancel {
 			padding: 50rpx 30rpx;
+			color: #9f9f9f;
 		}
 	}
 </style>

+ 23 - 15
pages/feedback/feedback.vue

@@ -49,7 +49,7 @@
 				</view>
 				<view class="item-value from-item-code">
 					<u--input class="code-input" placeholder="请输入内容" border="surround" v-model="from.validCode" />
-					<image class="code-img" :src="CaptchaImg" mode="scaleToFill" />
+					<image class="code-img" :src="CaptchaImg" mode="scaleToFill" @click.stop="getPicCaptcha()" />
 				</view>
 			</view>
 			<view class="from-item file-box">
@@ -96,17 +96,34 @@
 		},
 		methods: {
 			init() {
+				this.getPicCaptcha()
 				this.from = {
 					score: 0,
 					feedbackType: undefined,
 					phone: undefined,
 					feedbackContent: undefined,
 					validCode: undefined,
-					attachmentList: undefined
+					attachmentList: undefined,
+					validCodeReqNo:undefined
 				}
 			},
-			getLable(val){
-				const item  = this.FeedbackType.find(el => el.value === val)
+			async getPicCaptcha() {
+				try {
+					const data = await getPicCaptcha_Api();
+					console.log("data == ", data)
+					if (data) {
+						this.CaptchaImg = data.validCodeBase64;
+						this.from.validCodeReqNo = data.validCodeReqNo;
+					};
+				} catch (error) {
+					
+					//TODO handle the exception
+				}
+			},
+
+
+			getLable(val) {
+				const item = this.FeedbackType.find(el => el.value === val)
 				return item ? item.label : item
 			},
 			isPlaceholder(val) {
@@ -160,25 +177,16 @@
 						if (!regex.test(phone) || phone.length !== 11) {
 							throw new Error("请输入正确的手机号码")
 						}
-					}else{
+					} else {
 						throw new Error("请输入手机号码")
 					};
-					
+
 					if (!this.from.feedbackContent) {
 						throw new Error("请输入建议内容")
 					}
 					if (this.CaptchaImg && !this.from.validCode) {
 						throw new Error("请输入验证码")
 					}
-					const { data } = await getPicCaptcha_Api();
-					if (data) {
-						this.CaptchaImg = data;
-						uni.showToast({
-							title: '请先输入验证码',
-							icon: 'none'
-						}); 
-						return
-					};
 					await addMapuserfeedback_Api(this.from)
 					uni.showToast({
 						title: '提交成功'

+ 5 - 1
pages/map/model/SelectMapNavigation.vue

@@ -6,7 +6,7 @@
 			<view class="map-item" @click.stop="goNavigation(item.value)" v-for="item in MapTypeList">
 				{{item.label}}
 			</view>
-			<view class="map-item cancel">
+			<view class="map-item cancel" @click.stop="close()">
 				取消
 			</view>
 		</view>
@@ -34,6 +34,9 @@
 				this.$refs.SelectMap.open()
 
 			},
+			close() {
+				this.$refs.SelectMap.close()
+			},	
 			goNavigation(type) {
 				const { areaCode, cityCode, provinceCode, provinceName, cityName, areaName, address } =  this.siteInfo
 				const name = `${provinceName}${cityName}${areaName}${address}`;
@@ -67,6 +70,7 @@
 
 		.cancel {
 			padding: 50rpx 30rpx;
+			color: #9f9f9f;
 		}
 	}
 </style>

+ 1 - 2
pages/map/model/hint.vue

@@ -4,8 +4,7 @@
 		<view class="hint-box">
 			<view class="hint-title">服务声明</view>
 			<view class="hint-val">
-				尊敬的市民朋友,您好!【武汉公安政务服务地图】正在试运行中,如有任何疑问和建议,欢迎致电武汉公安政务服务专线85395115。
-
+				尊敬的市民朋友,您好!【武汉公安政务服务地图】正在试运行中,如有任何疑问和建议,欢迎致电武汉公安政务服务专线027-85395115。
 			</view>
 			<view class="hint-btns" @click.stop="onClose()">
 				<view class="hint-btn">关闭</view>

+ 3 - 2
utils/tool.js

@@ -74,12 +74,13 @@ export const getLocation = () => {
 
 
 
-export const uploadImage = (num = 1, type = 'img') => {
+export const uploadImage = (num = 1, type = 'img' , extension = ['.png','.jpg']) => {
 	return new Promise(async (resolve, reject) => {
 		uni.chooseImage({
 			count: num,
 			sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
 			sourceType: ['album'], //从相册选择
+			extension:extension,
 			// crop: {
 			// 	quality: 100, // 图片裁剪质量
 			// 	width: 100, // 裁剪的宽度
@@ -90,7 +91,7 @@ export const uploadImage = (num = 1, type = 'img') => {
 				console.log("res = ", res)
 				// 选中的文件对象
 				const FilePaths = res.tempFilePaths;
-				const Names = []
+				const Names = [];
 				res.tempFiles.forEach(el => {
 					Names.push(el.name)
 				})