zhangjintao 1 year ago
parent
commit
76bb1a7bcf
46 changed files with 1091 additions and 805 deletions
  1. 144 0
      components/userPrivacy/userPrivacy.vue
  2. 1 0
      manifest.json
  3. 248 221
      pages/command/finish.vue
  4. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/common/runtime.js.map
  5. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map
  6. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/components/userPrivacy/userPrivacy.js.map
  7. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/command/finish.js.map
  8. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/uview-ui/components/u-upload/u-upload.js.map
  9. 1 0
      unpackage/dist/dev/mp-weixin/app.json
  10. 0 0
      unpackage/dist/dev/mp-weixin/common/runtime.js
  11. 0 0
      unpackage/dist/dev/mp-weixin/common/vendor.js
  12. 0 0
      unpackage/dist/dev/mp-weixin/components/userPrivacy/userPrivacy.js
  13. 6 0
      unpackage/dist/dev/mp-weixin/components/userPrivacy/userPrivacy.json
  14. 1 0
      unpackage/dist/dev/mp-weixin/components/userPrivacy/userPrivacy.wxml
  15. 84 0
      unpackage/dist/dev/mp-weixin/components/userPrivacy/userPrivacy.wxss
  16. 0 0
      unpackage/dist/dev/mp-weixin/pages/agreement/agreement.js
  17. 0 0
      unpackage/dist/dev/mp-weixin/pages/command/finish.js
  18. 2 1
      unpackage/dist/dev/mp-weixin/pages/command/finish.json
  19. 0 0
      unpackage/dist/dev/mp-weixin/pages/command/finish.wxml
  20. 5 5
      unpackage/dist/dev/mp-weixin/pages/command/finish.wxss
  21. 0 0
      unpackage/dist/dev/mp-weixin/pages/throughTrain/components/selectLei.js
  22. 0 0
      unpackage/dist/dev/mp-weixin/pages/throughTrain/throughTrainDetails.js
  23. 1 1
      unpackage/dist/dev/mp-weixin/project.config.json
  24. 2 1
      unpackage/dist/dev/mp-weixin/project.private.config.json
  25. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-badge/u-badge.js
  26. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-button/u-button.js
  27. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-calendar/u-calendar.js
  28. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-checkbox/u-checkbox.js
  29. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-empty/u-empty.js
  30. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-icon/u-icon.js
  31. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-image/u-image.js
  32. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-input/u-input.js
  33. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-line-progress/u-line-progress.js
  34. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-loading/u-loading.js
  35. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-mask/u-mask.js
  36. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-modal/u-modal.js
  37. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-number-box/u-number-box.js
  38. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-parse/libs/trees.js
  39. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-parse/u-parse.js
  40. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-popup/u-popup.js
  41. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-search/u-search.js
  42. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-select/u-select.js
  43. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-tabs/u-tabs.js
  44. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-tag/u-tag.js
  45. 0 0
      unpackage/dist/dev/mp-weixin/uview-ui/components/u-upload/u-upload.js
  46. 596 576
      uview-ui/components/u-upload/u-upload.vue

+ 144 - 0
components/userPrivacy/userPrivacy.vue

@@ -0,0 +1,144 @@
+<template>
+	<view>
+		<!-- 隐私保护指引弹窗 -->
+		<u-popup v-model="privacyShow" mode="bottom" border-radius="12" :mask-close-able="false">
+			<view class="privacyBox">
+				<view class="privacyTit">{{ title }}</view>
+				<view class="privacyDesc">
+					感谢您的使用,在使用本小程序前,您应当阅读并同意
+					<text @click="openClick">{{ title }}</text>
+					。当您点击同意并开始使用程序服务时,即表示您已理解并同意该条款内容,该条款将对您产生法律约束力。如您拒绝,将无法使用该功能。
+				</view>
+				<view class="privacyPost">
+					<view class="refuseBtn" @click="close">
+						<!-- <navigator target="miniProgram" open-type="exit">不同意并退出</navigator> -->
+						不同意
+					</view>
+					<button class="agreeBtn" open-type="agreePrivacyAuthorization" @agreeprivacyauthorization="agreeClick">同意并继续</button>
+				</view>
+			</view>
+		</u-popup>
+	</view>
+</template>
+
+<script>
+export default {
+	name: 'userPrivacy',
+	data() {
+		return {
+			// 隐私设置弹窗开关
+			privacyShow: false,
+			title: '',
+			resolve: null
+		};
+	},
+	methods: {
+		// 打开隐私协议
+		openClick() {
+			wx.openPrivacyContract({
+				success: () => {}, // 打开成功
+				fail: () => {}, // 打开失败
+				complete: () => {}
+			});
+		},
+
+		// 同意
+		agreeClick() {
+			// 用户点击了同意,之后所有已声明过的隐私接口和组件都可以调用了
+			this.privacyShow = false;
+			uni.showTabBar();
+		},
+		//close
+		close() {
+			this.privacyShow = false;
+			uni.showTabBar();
+		},
+		//获取隐私协议
+		getPrivacySettingFn() {
+			var _this = this;
+			// 隐私政策
+			wx.getPrivacySetting({
+				success: (res) => {
+					console.log(res);
+					// 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' }
+					if (res.needAuthorization) {
+						// 需要弹出隐私协议
+						_this.privacyShow = true;
+						_this.title = res.privacyContractName;
+						uni.hideTabBar();
+						return;
+					} else {
+						// 用户已经同意过隐私协议,所以不需要再弹出隐私协议,也能调用隐私接口
+					}
+				},
+				fail: () => {},
+				complete: () => {}
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.privacyBox {
+	width: 100%;
+	padding: 60rpx;
+	box-sizing: border-box;
+}
+
+.privacyTit {
+	font-size: 32rpx;
+	font-weight: bold;
+	text-align: center;
+	overflow: hidden;
+}
+
+.privacyDesc {
+	font-size: 28rpx;
+	overflow: hidden;
+	margin-top: 30rpx;
+	color: #000;
+}
+
+.privacyDesc text {
+	color: #409eff;
+}
+
+.privacyPost {
+	overflow: hidden;
+	margin-top: 60rpx;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+}
+
+.privacyPost .refuseBtn {
+	flex: 1;
+	height: 80rpx;
+	line-height: 80rpx;
+	text-align: center;
+	font-size: 28rpx;
+	font-weight: bold;
+	color: #fff;
+	background-color: #f5f5f5;
+	border-radius: 12rpx;
+	box-sizing: border-box;
+	overflow: hidden;
+	color: #a5a5a5;
+}
+
+.privacyPost .agreeBtn {
+	flex: 1;
+	height: 80rpx;
+	line-height: 80rpx;
+	text-align: center;
+	font-size: 28rpx;
+	font-weight: bold;
+	color: #fff;
+	background-color: #07c25f;
+	border-radius: 12rpx;
+	box-sizing: border-box;
+	overflow: hidden;
+	margin-left: 20rpx;
+}
+</style>

+ 1 - 0
manifest.json

@@ -53,6 +53,7 @@
 	},
 	"quickapp": {},
 	"mp-weixin": {
+		"__usePrivacyCheck__": true, //隐私政策
 		"appid": "wxe7bdb2158aec1d71",
 		"setting": {
 			"urlCheck": false,

+ 248 - 221
pages/command/finish.vue

@@ -6,30 +6,57 @@
 				<text class="mim-font-16 bold mimRed">*</text>
 			</view>
 			<view class="select">
-				<u-input type="select" v-model="form.complain_date" placeholder='请选择完成的日期'
-					placeholder-style="color: #BDBDBD;" height="96" cursor-spacing="12" :clearable='false' disabled
-					:custom-style="customStyle" @click="show = true" />
-				<u-image src='@/static/icon/jt.png' class="select_img" width="64rpx" height="64rpx"></u-image>
+				<u-input
+					type="select"
+					v-model="form.complain_date"
+					placeholder="请选择完成的日期"
+					placeholder-style="color: #BDBDBD;"
+					height="96"
+					cursor-spacing="12"
+					:clearable="false"
+					disabled
+					:custom-style="customStyle"
+					@click="show = true"
+				/>
+				<u-image src="@/static/icon/jt.png" class="select_img" width="64rpx" height="64rpx"></u-image>
 				<u-calendar v-model="show" mode="date" @change="change"></u-calendar>
 			</view>
 		</view>
-		<view class="mim-view" style="margin-top: -24rpx;">
+		<view class="mim-view" style="margin-top: -24rpx">
 			<view class="mim-font-16 bold mim-flex-wrap-left">
 				<text class="mim-font-16 bold">完成意见</text>
 				<text class="mim-font-16 bold mimRed">*</text>
 			</view>
-			<u-input type="textarea" v-model="form.deal_idea" placeholder='请填写你的完成意见'
-				placeholder-style="color: #BDBDBD;" height="240" :auto-height='true' :clearable='false'
-				:custom-style="customTestStyle" maxlength="-1" cursor-spacing="12" />
+			<u-input
+				type="textarea"
+				v-model="form.deal_idea"
+				placeholder="请填写你的完成意见"
+				placeholder-style="color: #BDBDBD;"
+				height="240"
+				:auto-height="true"
+				:clearable="false"
+				:custom-style="customTestStyle"
+				maxlength="-1"
+				cursor-spacing="12"
+			/>
 		</view>
 
 		<view class="mim-view">
 			<text class="mim-font-16 bold">附件上传</text>
 			<view class="wrap">
 				<view class="mim-flex-wrap-left">
-					<u-upload :custom-btn="true" ref="uUpload" :auto-upload="true" :show-upload-list="showUploadList"
-						:max-size="20 * 1024 * 1024" max-count="9" :action="action" :form-data='formData'
-						:header='header' accept="video">
+					<u-upload
+						:custom-btn="true"
+						ref="uUpload"
+						:auto-upload="true"
+						:show-upload-list="showUploadList"
+						:max-size="20 * 1024 * 1024"
+						max-count="9"
+						:action="action"
+						:form-data="formData"
+						:header="header"
+						accept="video"
+					>
 						<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
 							<view class="mim-flex-vertical-center">
 								<u-image src="@/static/icon/camera.png" width="40rpx" height="40rpx"></u-image>
@@ -39,11 +66,9 @@
 					</u-upload>
 					<view class="pre-box" v-if="!showUploadList">
 						<view class="pre-item" v-for="(item, index) in lists" :key="index">
-							<view style="position: relative;">
-								<image class="pre-item-image" :src="item.url" mode="aspectFill"
-									@click="previewImage(index)"></image>
-								<u-image src="@/static/icon/cuo.png" mode="widthFix" class="cha"
-									@click="deleteImage(index)"></u-image>
+							<view style="position: relative">
+								<image class="pre-item-image" :src="item.url" mode="aspectFill" @click="previewImage(index)"></image>
+								<u-image src="@/static/icon/cuo.png" mode="widthFix" class="cha" @click="deleteImage(index)"></u-image>
 							</view>
 						</view>
 					</view>
@@ -51,256 +76,258 @@
 			</view>
 		</view>
 
-		<view class="mim-view mim-flex-wrap-space-between" style="margin-top: 24rpx;padding-bottom: 200rpx;">
+		<view class="mim-view mim-flex-wrap-space-between" style="margin-top: 24rpx; padding-bottom: 200rpx">
 			<view class="mim-font-16 bold mim-flex-wrap-left">
 				<text class="mim-font-16 bold">群众满意度</text>
 				<text class="mim-font-16 bold mimRed">*</text>
 			</view>
 			<view>
-				<u-number-box v-model="form.deal_evaluation" bg-color='#f7f7f7' :min="0" :max="100"
-					@change="valChange"></u-number-box>
+				<u-number-box v-model="form.deal_evaluation" bg-color="#f7f7f7" :min="0" :max="100" @change="valChange"></u-number-box>
 			</view>
 		</view>
 
 		<view class="mim-view-list"></view>
 		<view class="mim-view-last"></view>
 		<view class="mim-foot">
-			<view class="mim-foot-button mim-flex-wrap mim-button" :class="{ disabled: isButtonDisabled }"
-				@click="save">
-				确定
-			</view>
+			<view class="mim-foot-button mim-flex-wrap mim-button" :class="{ disabled: isButtonDisabled }" @click="save">确定</view>
 		</view>
+		<UserPrivacy ref="privacy"></UserPrivacy>
 	</view>
 </template>
 
 <script>
-	import {
-		prodUrl
-	} from '@/common/settings.js'
-	export default {
-		data() {
-			return {
-				customStyle: {
-					marginTop: '24rpx',
-					fontSize: '32rpx',
-					paddingLeft: '24rpx',
-					background: '#f7f7f7',
-					borderRadius: '8rpx'
-				},
-				customTestStyle: {
-					"box-sizing": 'border-box',
-					marginTop: '24rpx',
-					fontSize: '32rpx',
-					padding: '32rpx 24rpx',
-					background: '#f7f7f7',
-					borderRadius: '8rpx',
-				},
-				show: false,
-				form: {
-					id: '',
-					complain_date: '',
-					deal_file_ids: [],
-					deal_idea: '',
-					deal_evaluation: 100
-				},
-				formData: {
-					dir: 'file_account',
-					file_type: 'file'
-				},
-				header: {
-					'Authorization': uni.getStorageSync('token')
-				},
-				action: prodUrl + '/base/resource/upload', //上传的地址
-				showUploadList: false,
-				lists: [],
-				isButtonDisabled: false, // 按钮是否禁用
-			};
-		},
-		onLoad(e) {
-			this.form.id = e.id
-			console.log(e.id)
-		},
-		onReady() {
-			this.lists = this.$refs.uUpload.lists;
-		},
-		methods: {
-			//放大图片查看
-			previewImage(index) {
-				const urls = this.lists.map(item => item.url);
-				const current = urls[index]; // 当前显示的图片地址
-				uni.previewImage({
-					current: current, // 当前显示的图片地址
-					urls: urls, // 图片地址数组
-				});
+import UserPrivacy from '@/components/userPrivacy/userPrivacy.vue';
+import { prodUrl } from '@/common/settings.js';
+export default {
+	components: {
+		UserPrivacy
+	},
+	data() {
+		return {
+			customStyle: {
+				marginTop: '24rpx',
+				fontSize: '32rpx',
+				paddingLeft: '24rpx',
+				background: '#f7f7f7',
+				borderRadius: '8rpx'
 			},
-			change(e) {
-				console.log(e)
-				this.form.complain_date = e.result
+			customTestStyle: {
+				'box-sizing': 'border-box',
+				marginTop: '24rpx',
+				fontSize: '32rpx',
+				padding: '32rpx 24rpx',
+				background: '#f7f7f7',
+				borderRadius: '8rpx'
 			},
-			valChange(e) {
-				this.form.deal_evaluation = e.value
+			show: false,
+			form: {
+				id: '',
+				complain_date: '',
+				deal_file_ids: [],
+				deal_idea: '',
+				deal_evaluation: 100
 			},
-			//删除图片
-			deleteImage(index) {
-				this.show = true
-				this.confirmDel(index)
+			formData: {
+				dir: 'file_account',
+				file_type: 'file'
 			},
-			confirmDel(index) {
-				this.show = false
-				this.lists.splice(index, 1) //手动移除列表的某一个图片,index为lists数组的索引
+			header: {
+				Authorization: uni.getStorageSync('token')
 			},
-			save() {
-				if (this.isButtonDisabled) {
-					return false; // 如果按钮已禁用,直接返回
-				}
-				if (!this.form.complain_date) {
-					this.$u.toast('请选择完成日期!')
-					return false
-				}
-				if (!this.form.deal_idea) {
-					this.$u.toast('请填写完成意见!')
-					return false
-				}
-				this.form.deal_file_ids = this.lists.map((item) => item.response.data.id)
-				console.log(this.form)
-				this.isButtonDisabled = true; // 禁用按钮	
-				this.doCompleteFn()
-			},
-			//完成
-			async doCompleteFn() {
+			action: prodUrl + '/base/resource/upload', //上传的地址
+			showUploadList: false,
+			lists: [],
+			isButtonDisabled: false // 按钮是否禁用
+		};
+	},
+	onLoad(e) {
+		this.form.id = e.id;
+		this.$refs.privacy.getPrivacySettingFn();
+		wx.onNeedPrivacyAuthorization((resolve, eventInfo) => {
+			console.log('触发本次事件的接口是:' + eventInfo.referrer);
+			this.$refs.privacy.getPrivacySettingFn();
+			resolve({ event: 'disagree' });
+		});
+	},
+	onReady() {
+		this.lists = this.$refs.uUpload.lists;
+	},
+	methods: {
+		//放大图片查看
+		previewImage(index) {
+			const urls = this.lists.map((item) => item.url);
+			const current = urls[index]; // 当前显示的图片地址
+			uni.previewImage({
+				current: current, // 当前显示的图片地址
+				urls: urls // 图片地址数组
+			});
+		},
+		change(e) {
+			console.log(e);
+			this.form.complain_date = e.result;
+		},
+		valChange(e) {
+			this.form.deal_evaluation = e.value;
+		},
+		//删除图片
+		deleteImage(index) {
+			this.show = true;
+			this.confirmDel(index);
+		},
+		confirmDel(index) {
+			this.show = false;
+			this.lists.splice(index, 1); //手动移除列表的某一个图片,index为lists数组的索引
+		},
+		save() {
+			if (this.isButtonDisabled) {
+				return false; // 如果按钮已禁用,直接返回
+			}
+			if (!this.form.complain_date) {
+				this.$u.toast('请选择完成日期!');
+				return false;
+			}
+			if (!this.form.deal_idea) {
+				this.$u.toast('请填写完成意见!');
+				return false;
+			}
+			this.form.deal_file_ids = this.lists.map((item) => item.response.data.id);
+			console.log(this.form);
+			this.isButtonDisabled = true; // 禁用按钮
+			this.doCompleteFn();
+		},
+		//完成
+		async doCompleteFn() {
+			setTimeout(() => {
+				this.isButtonDisabled = false; // 启用按钮
+			}, 500);
+			const res = await this.$u.api.doComplete(this.form);
+			if (res.status === 'success') {
+				this.$u.toast(res.message);
 				setTimeout(() => {
-					this.isButtonDisabled = false; // 启用按钮
-				}, 500)
-				const res = await this.$u.api.doComplete(this.form)
-				if (res.status === "success") {
-					this.$u.toast(res.message)
-					setTimeout(() => {
-						this.$u.route({
-							type: 'navigateBack',
-							url: '/pages/throughTrain/throughTrainDetails'
-						});
-					}, 1500)
-				}
-			},
+					this.$u.route({
+						type: 'navigateBack',
+						url: '/pages/throughTrain/throughTrainDetails'
+					});
+				}, 1500);
+			}
 		}
 	}
+};
 </script>
 
 <style lang="scss">
-	page {
-		background-color: #f7f7f7;
-
-		.container {
-			.mim-view {
-				margin: 0;
-				border-radius: 0;
-
-				u-input {
-					/deep/ .u-input__right-icon {
-						display: none !important;
-					}
-				}
-
-				.select {
-					position: relative;
+page {
+	background-color: #f7f7f7;
 
-					.select_img {
-						position: absolute;
-						right: 0;
-						top: 38rpx;
-					}
-				}
+	.container {
+		.mim-view {
+			margin: 0;
+			border-radius: 0;
 
-				.wrap {
-					margin-top: 24rpx;
+			u-input {
+				/deep/ .u-input__right-icon {
+					display: none !important;
 				}
+			}
 
-				.slot-btn {
-					width: 144rpx;
-					height: 144rpx;
-					display: flex;
-					justify-content: center;
-					align-items: center;
-					background: #FFFFFF;
-					box-sizing: border-box;
-					border: 2px dashed #DBDBDB;
-					margin-bottom: 20rpx;
-				}
+			.select {
+				position: relative;
 
-				.slot-btn__hover {
-					background-color: rgb(235, 236, 238);
+				.select_img {
+					position: absolute;
+					right: 0;
+					top: 38rpx;
 				}
+			}
 
-				.uploading_test {
-					font-size: 24rpx;
-					font-weight: normal;
-					line-height: 24rpx;
-					letter-spacing: 0em;
-					color: #DBDBDB;
-					margin-top: 20rpx;
-				}
+			.wrap {
+				margin-top: 24rpx;
+			}
 
-				.pre-box {
-					display: flex;
-					align-items: center;
-					// justify-content: space-between;
-					flex-wrap: wrap;
-				}
+			.slot-btn {
+				width: 144rpx;
+				height: 144rpx;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				background: #ffffff;
+				box-sizing: border-box;
+				border: 2px dashed #dbdbdb;
+				margin-bottom: 20rpx;
+			}
 
-				.pre-item {
-					width: 140rpx;
-					height: 140rpx;
-					overflow: hidden;
-					position: relative;
-					margin-left: 20rpx;
-					margin-bottom: 20rpx;
-				}
+			.slot-btn__hover {
+				background-color: rgb(235, 236, 238);
+			}
 
-				.pre-item-image {
-					width: 100%;
-					height: 140rpx;
-				}
+			.uploading_test {
+				font-size: 24rpx;
+				font-weight: normal;
+				line-height: 24rpx;
+				letter-spacing: 0em;
+				color: #dbdbdb;
+				margin-top: 20rpx;
+			}
 
-				.cha {
-					position: absolute;
-					height: 30rpx;
-					width: 30rpx;
-					right: 6rpx;
-					top: 6rpx
-				}
+			.pre-box {
+				display: flex;
+				align-items: center;
+				// justify-content: space-between;
+				flex-wrap: wrap;
 			}
 
+			.pre-item {
+				width: 140rpx;
+				height: 140rpx;
+				overflow: hidden;
+				position: relative;
+				margin-left: 20rpx;
+				margin-bottom: 20rpx;
+			}
 
+			.pre-item-image {
+				width: 100%;
+				height: 140rpx;
+			}
 
-			.mim-view-last {
-				padding: 56rpx;
-				background: transparent;
+			.cha {
+				position: absolute;
+				height: 30rpx;
+				width: 30rpx;
+				right: 6rpx;
+				top: 6rpx;
 			}
+		}
 
-			.mim-foot {
-				width: 100%;
-				height: 136rpx;
-				position: fixed;
-				bottom: 0;
-				left: 0;
-				background-color: #ffffff;
-				padding: 20rpx 24rpx;
-				box-sizing: border-box;
-				z-index: 9;
+		.mim-view-last {
+			padding: 56rpx;
+			background: transparent;
+		}
 
-				&-button {
-					border-radius: 48rpx;
-					opacity: 1;
-					background: #DE2E27;
-					font-size: 32rpx;
-					font-weight: normal;
-					line-height: 32rpx;
-					letter-spacing: 0px;
-					color: #FFFFFF;
-					height: 96rpx;
-					cursor: pointer;
-				}
+		.mim-foot {
+			width: 100%;
+			height: 136rpx;
+			position: fixed;
+			bottom: 0;
+			left: 0;
+			background-color: #ffffff;
+			padding: 20rpx 24rpx;
+			box-sizing: border-box;
+			z-index: 9;
+
+			&-button {
+				border-radius: 48rpx;
+				opacity: 1;
+				background: #de2e27;
+				font-size: 32rpx;
+				font-weight: normal;
+				line-height: 32rpx;
+				letter-spacing: 0px;
+				color: #ffffff;
+				height: 96rpx;
+				cursor: pointer;
 			}
 		}
 	}
-</style>
+}
+</style>

File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/common/runtime.js.map


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/components/userPrivacy/userPrivacy.js.map


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pages/command/finish.js.map


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/uview-ui/components/u-upload/u-upload.js.map


+ 1 - 0
unpackage/dist/dev/mp-weixin/app.json

@@ -41,6 +41,7 @@
       }
     ]
   },
+  "__usePrivacyCheck__": true,
   "permission": {
     "scope.userInfo": {
       "desc": "用于获取您的头像、昵称等信息"

File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/common/runtime.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/common/vendor.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/components/userPrivacy/userPrivacy.js


+ 6 - 0
unpackage/dist/dev/mp-weixin/components/userPrivacy/userPrivacy.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {
+    "u-popup": "/uview-ui/components/u-popup/u-popup"
+  },
+  "component": true
+}

+ 1 - 0
unpackage/dist/dev/mp-weixin/components/userPrivacy/userPrivacy.wxml

@@ -0,0 +1 @@
+<view><u-popup bind:input="__e" vue-id="75d2b486-1" mode="bottom" border-radius="12" mask-close-able="{{false}}" value="{{privacyShow}}" data-event-opts="{{[['^input',[['__set_model',['','privacyShow','$event',[]]]]]]}}" bind:__l="__l" vue-slots="{{['default']}}"><view class="privacyBox"><view class="privacyTit">{{title}}</view><view class="privacyDesc">感谢您的使用,在使用本小程序前,您应当阅读并同意<text data-event-opts="{{[['tap',[['openClick',['$event']]]]]}}" bindtap="__e">{{title}}</text>。当您点击同意并开始使用程序服务时,即表示您已理解并同意该条款内容,该条款将对您产生法律约束力。如您拒绝,将无法使用该功能。</view><view class="privacyPost"><view data-event-opts="{{[['tap',[['close',['$event']]]]]}}" class="refuseBtn" bindtap="__e">不同意</view><button class="agreeBtn" open-type="agreePrivacyAuthorization" data-event-opts="{{[['agreeprivacyauthorization',[['agreeClick',['$event']]]]]}}" bindagreeprivacyauthorization="__e">同意并继续</button></view></view></u-popup></view>

+ 84 - 0
unpackage/dist/dev/mp-weixin/components/userPrivacy/userPrivacy.wxss

@@ -0,0 +1,84 @@
+@charset "UTF-8";
+/**
+ * 这里是uni-app内置的常用样式变量
+ *
+ * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
+ * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
+ *
+ */
+/**
+ * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
+ *
+ * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
+ */
+/* 颜色变量 */
+/* 颜色变量 */
+/* 页面背景色 */
+/* 行为相关颜色 */
+/* 文字基本颜色 */
+/* 背景颜色 */
+/* 边框颜色 */
+/* 尺寸变量 */
+/* 文字尺寸 */
+/* 图片尺寸 */
+/* Border Radius */
+/* 水平间距 */
+/* 垂直间距 */
+/* 透明度 */
+/* 文章场景相关 */
+.privacyBox {
+  width: 100%;
+  padding: 60rpx;
+  box-sizing: border-box;
+}
+.privacyTit {
+  font-size: 32rpx;
+  font-weight: bold;
+  text-align: center;
+  overflow: hidden;
+}
+.privacyDesc {
+  font-size: 28rpx;
+  overflow: hidden;
+  margin-top: 30rpx;
+  color: #000;
+}
+.privacyDesc text {
+  color: #409eff;
+}
+.privacyPost {
+  overflow: hidden;
+  margin-top: 60rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.privacyPost .refuseBtn {
+  flex: 1;
+  height: 80rpx;
+  line-height: 80rpx;
+  text-align: center;
+  font-size: 28rpx;
+  font-weight: bold;
+  color: #fff;
+  background-color: #f5f5f5;
+  border-radius: 12rpx;
+  box-sizing: border-box;
+  overflow: hidden;
+  color: #a5a5a5;
+}
+.privacyPost .agreeBtn {
+  flex: 1;
+  height: 80rpx;
+  line-height: 80rpx;
+  text-align: center;
+  font-size: 28rpx;
+  font-weight: bold;
+  color: #fff;
+  background-color: #07c25f;
+  border-radius: 12rpx;
+  box-sizing: border-box;
+  overflow: hidden;
+  margin-left: 20rpx;
+}
+

File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/agreement/agreement.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/command/finish.js


+ 2 - 1
unpackage/dist/dev/mp-weixin/pages/command/finish.json

@@ -6,6 +6,7 @@
     "u-image": "/uview-ui/components/u-image/u-image",
     "u-calendar": "/uview-ui/components/u-calendar/u-calendar",
     "u-upload": "/uview-ui/components/u-upload/u-upload",
-    "u-number-box": "/uview-ui/components/u-number-box/u-number-box"
+    "u-number-box": "/uview-ui/components/u-number-box/u-number-box",
+    "user-privacy": "/components/userPrivacy/userPrivacy"
   }
 }

File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/command/finish.wxml


+ 5 - 5
unpackage/dist/dev/mp-weixin/pages/command/finish.wxss

@@ -53,9 +53,9 @@ page .container .mim-view .slot-btn {
   display: flex;
   justify-content: center;
   align-items: center;
-  background: #FFFFFF;
+  background: #ffffff;
   box-sizing: border-box;
-  border: 2px dashed #DBDBDB;
+  border: 2px dashed #dbdbdb;
   margin-bottom: 20rpx;
 }
 page .container .mim-view .slot-btn__hover {
@@ -66,7 +66,7 @@ page .container .mim-view .uploading_test {
   font-weight: normal;
   line-height: 24rpx;
   letter-spacing: 0em;
-  color: #DBDBDB;
+  color: #dbdbdb;
   margin-top: 20rpx;
 }
 page .container .mim-view .pre-box {
@@ -111,12 +111,12 @@ page .container .mim-foot {
 page .container .mim-foot-button {
   border-radius: 48rpx;
   opacity: 1;
-  background: #DE2E27;
+  background: #de2e27;
   font-size: 32rpx;
   font-weight: normal;
   line-height: 32rpx;
   letter-spacing: 0px;
-  color: #FFFFFF;
+  color: #ffffff;
   height: 96rpx;
   cursor: pointer;
 }

File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/throughTrain/components/selectLei.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/throughTrain/throughTrainDetails.js


+ 1 - 1
unpackage/dist/dev/mp-weixin/project.config.json

@@ -20,7 +20,7 @@
         "ignoreUploadUnusedFiles": true
     },
     "compileType": "miniprogram",
-    "libVersion": "2.32.1",
+    "libVersion": "",
     "appid": "wxe7bdb2158aec1d71",
     "projectname": "爱罗山",
     "condition": {},

+ 2 - 1
unpackage/dist/dev/mp-weixin/project.private.config.json

@@ -3,5 +3,6 @@
     "projectname": "luoshan_web",
     "setting": {
         "compileHotReLoad": true
-    }
+    },
+    "libVersion": "3.0.1"
 }

File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-badge/u-badge.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-button/u-button.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-calendar/u-calendar.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-checkbox/u-checkbox.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-empty/u-empty.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-icon/u-icon.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-image/u-image.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-input/u-input.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-line-progress/u-line-progress.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-loading/u-loading.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-mask/u-mask.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-modal/u-modal.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-number-box/u-number-box.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-parse/libs/trees.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-parse/u-parse.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-popup/u-popup.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-search/u-search.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-select/u-select.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-tabs/u-tabs.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-tag/u-tag.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/mp-weixin/uview-ui/components/u-upload/u-upload.js


+ 596 - 576
uview-ui/components/u-upload/u-upload.vue

@@ -1,29 +1,48 @@
 <template>
 	<view class="u-upload" v-if="!disabled">
-		<view v-if="showUploadList" class="u-list-item u-preview-wrap" v-for="(item, index) in lists" :key="index"
+		<view
+			v-if="showUploadList"
+			class="u-list-item u-preview-wrap"
+			v-for="(item, index) in lists"
+			:key="index"
 			:style="{
 				width: $u.addUnit(width),
 				height: $u.addUnit(height)
-			}">
-			<view v-if="deletable" class="u-delete-icon" @tap.stop="deleteItem(index)" :style="{
+			}"
+		>
+			<view
+				v-if="deletable"
+				class="u-delete-icon"
+				@tap.stop="deleteItem(index)"
+				:style="{
 					background: delBgColor
-				}">
+				}"
+			>
 				<u-icon class="u-icon" :name="delIcon" size="20" :color="delColor"></u-icon>
 			</view>
-			<u-line-progress v-if="showProgress && item.progress > 0 && !item.error" :show-percent="false" height="16"
-				class="u-progress" :percent="item.progress"></u-line-progress>
+			<u-line-progress
+				v-if="showProgress && item.progress > 0 && !item.error"
+				:show-percent="false"
+				height="16"
+				class="u-progress"
+				:percent="item.progress"
+			></u-line-progress>
 			<view @tap.stop="retry(index)" v-if="item.error" class="u-error-btn">点击重试</view>
-			<image @tap.stop="doPreviewImage(item.url || item.path, index)" class="u-preview-image" v-if="!item.isImage"
-				:src="item.url || item.path" :mode="imageMode"></image>
+			<image @tap.stop="doPreviewImage(item.url || item.path, index)" class="u-preview-image" v-if="!item.isImage" :src="item.url || item.path" :mode="imageMode"></image>
 		</view>
 		<slot name="file" :file="lists"></slot>
-		<view style="display: inline-block;" @tap="selectFile" v-if="maxCount > lists.length">
+		<view style="display: inline-block" @tap="selectFile" v-if="maxCount > lists.length">
 			<slot name="addBtn"></slot>
-			<view v-if="!customBtn" class="u-list-item u-add-wrap" hover-class="u-add-wrap__hover" hover-stay-time="150"
+			<view
+				v-if="!customBtn"
+				class="u-list-item u-add-wrap"
+				hover-class="u-add-wrap__hover"
+				hover-stay-time="150"
 				:style="{
 					width: $u.addUnit(width),
 					height: $u.addUnit(height)
-				}">
+				}"
+			>
 				<u-icon name="plus" class="u-add-btn" size="40"></u-icon>
 				<view class="u-add-tips">{{ uploadText }}</view>
 			</view>
@@ -32,612 +51,613 @@
 </template>
 
 <script>
-	/**
-	 * upload 图片上传
-	 * @description 该组件用于上传图片场景
-	 * @tutorial https://www.uviewui.com/components/upload.html
-	 * @property {String} action 服务器上传地址
-	 * @property {String Number} max-count 最大选择图片的数量(默认99)
-	 * @property {Boolean} custom-btn 如果需要自定义选择图片的按钮,设置为true(默认false)
-	 * @property {Boolean} show-progress 是否显示进度条(默认true)
-	 * @property {Boolean} disabled 是否启用(显示/移仓)组件(默认false)
-	 * @property {String} image-mode 预览图片等显示模式,可选值为uni的image的mode属性值(默认aspectFill)
-	 * @property {String} del-icon 右上角删除图标名称,只能为uView内置图标
-	 * @property {String} del-bg-color 右上角关闭按钮的背景颜色
-	 * @property {String | Number} index 在各个回调事件中的最后一个参数返回,用于区别是哪一个组件的事件
-	 * @property {String} del-color 右上角关闭按钮图标的颜色
-	 * @property {Object} header 上传携带的头信息,对象形式
-	 * @property {Object} form-data 上传额外携带的参数
-	 * @property {String} name 上传文件的字段名,供后端获取使用(默认file)
-	 * @property {Array<String>} size-type original 原图,compressed 压缩图,默认二者都有(默认['original', 'compressed'])
-	 * @property {Array<String>} source-type 选择图片的来源,album-从相册选图,camera-使用相机,默认二者都有(默认['album', 'camera'])
-	 * @property {Boolean} preview-full-image	是否可以通过uni.previewImage预览已选择的图片(默认true)
-	 * @property {Boolean} multiple	是否开启图片多选,部分安卓机型不支持(默认true)
-	 * @property {Boolean} deletable 是否显示删除图片的按钮(默认true)
-	 * @property {String Number} max-size 选择单个文件的最大大小,单位B(byte),默认不限制(默认Number.MAX_VALUE)
-	 * @property {Array<Object>} file-list 默认显示的图片列表,数组元素为对象,必须提供url属性
-	 * @property {Boolean} upload-text 选择图片按钮的提示文字(默认“选择图片”)
-	 * @property {Boolean} auto-upload 选择完图片是否自动上传,见上方说明(默认true)
-	 * @property {Boolean} show-tips 特殊情况下是否自动提示toast,见上方说明(默认true)
-	 * @property {Boolean} show-upload-list 是否显示组件内部的图片预览(默认true)
-	 * @event {Function} on-oversize 图片大小超出最大允许大小
-	 * @event {Function} on-preview 全屏预览图片时触发
-	 * @event {Function} on-remove 移除图片时触发
-	 * @event {Function} on-success 图片上传成功时触发
-	 * @event {Function} on-change 图片上传后,无论成功或者失败都会触发
-	 * @event {Function} on-error 图片上传失败时触发
-	 * @event {Function} on-progress 图片上传过程中的进度变化过程触发
-	 * @event {Function} on-uploaded 所有图片上传完毕触发
-	 * @event {Function} on-choose-complete 每次选择图片后触发,只是让外部可以得知每次选择后,内部的文件列表
-	 * @example <u-upload :action="action" :file-list="fileList" ></u-upload>
-	 */
-	export default {
-		name: 'u-upload',
-		props: {
-			//是否显示组件自带的图片预览功能
-			showUploadList: {
-				type: Boolean,
-				default: true
-			},
-			// 后端地址
-			action: {
-				type: String,
-				default: ''
-			},
-			// 最大上传数量
-			maxCount: {
-				type: [String, Number],
-				default: 52
-			},
-			//  是否显示进度条
-			showProgress: {
-				type: Boolean,
-				default: true
-			},
-			// 是否启用
-			disabled: {
-				type: Boolean,
-				default: false
-			},
-			// 预览上传的图片时的裁剪模式,和image组件mode属性一致
-			imageMode: {
-				type: String,
-				default: 'aspectFill'
-			},
-			// 头部信息
-			header: {
-				type: Object,
-				default () {
-					return {};
-				}
-			},
-			// 额外携带的参数
-			formData: {
-				type: Object,
-				default () {
-					return {};
-				}
-			},
-			// 上传的文件字段名
-			name: {
-				type: String,
-				default: 'file'
-			},
-			// 所选的图片的尺寸, 可选值为original compressed
-			sizeType: {
-				type: Array,
-				default () {
-					return ['original', 'compressed'];
-				}
-			},
-			sourceType: {
-				type: Array,
-				default () {
-					return ['album', 'camera'];
-				}
-			},
-			// 是否在点击预览图后展示全屏图片预览
-			previewFullImage: {
-				type: Boolean,
-				default: true
-			},
-			// 是否开启图片多选,部分安卓机型不支持
-			multiple: {
-				type: Boolean,
-				default: true
-			},
-			// 是否展示删除按钮
-			deletable: {
-				type: Boolean,
-				default: true
-			},
-			// 文件大小限制,单位为byte
-			maxSize: {
-				type: [String, Number],
-				default: Number.MAX_VALUE
-			},
-			// 显示已上传的文件列表
-			fileList: {
-				type: Array,
-				default () {
-					return [];
-				}
-			},
-			// 上传区域的提示文字
-			uploadText: {
-				type: String,
-				default: '选择图片'
-			},
-			// 是否自动上传
-			autoUpload: {
-				type: Boolean,
-				default: true
-			},
-			// 是否显示toast消息提示
-			showTips: {
-				type: Boolean,
-				default: true
-			},
-			// 是否通过slot自定义传入选择图标的按钮
-			customBtn: {
-				type: Boolean,
-				default: false
-			},
-			// 内部预览图片区域和选择图片按钮的区域宽度
-			width: {
-				type: [String, Number],
-				default: 200
-			},
-			// 内部预览图片区域和选择图片按钮的区域高度
-			height: {
-				type: [String, Number],
-				default: 200
-			},
-			// 右上角关闭按钮的背景颜色
-			delBgColor: {
-				type: String,
-				default: '#fa3534'
-			},
-			// 右上角关闭按钮的叉号图标的颜色
-			delColor: {
-				type: String,
-				default: '#ffffff'
-			},
-			// 右上角删除图标名称,只能为uView内置图标
-			delIcon: {
-				type: String,
-				default: 'close'
-			},
-			// 如果上传后的返回值为json字符串,是否自动转json
-			toJson: {
-				type: Boolean,
-				default: true
-			},
-			// 上传前的钩子,每个文件上传前都会执行
-			beforeUpload: {
-				type: Function,
-				default: null
-			},
-			// 移除文件前的钩子
-			beforeRemove: {
-				type: Function,
-				default: null
-			},
-			// 允许上传的图片后缀
-			limitType: {
-				type: Array,
-				default () {
-					// 支付宝小程序真机选择图片的后缀为"image"
-					// https://opendocs.alipay.com/mini/api/media-image
-					return ['png', 'jpg', 'jpeg', 'webp', 'gif', 'image', "mp4", "avi", "mov", "wmv"];
-				}
-			},
-			// 在各个回调事件中的最后一个参数返回,用于区别是哪一个组件的事件
-			index: {
-				type: [Number, String],
-				default: ''
+/**
+ * upload 图片上传
+ * @description 该组件用于上传图片场景
+ * @tutorial https://www.uviewui.com/components/upload.html
+ * @property {String} action 服务器上传地址
+ * @property {String Number} max-count 最大选择图片的数量(默认99)
+ * @property {Boolean} custom-btn 如果需要自定义选择图片的按钮,设置为true(默认false)
+ * @property {Boolean} show-progress 是否显示进度条(默认true)
+ * @property {Boolean} disabled 是否启用(显示/移仓)组件(默认false)
+ * @property {String} image-mode 预览图片等显示模式,可选值为uni的image的mode属性值(默认aspectFill)
+ * @property {String} del-icon 右上角删除图标名称,只能为uView内置图标
+ * @property {String} del-bg-color 右上角关闭按钮的背景颜色
+ * @property {String | Number} index 在各个回调事件中的最后一个参数返回,用于区别是哪一个组件的事件
+ * @property {String} del-color 右上角关闭按钮图标的颜色
+ * @property {Object} header 上传携带的头信息,对象形式
+ * @property {Object} form-data 上传额外携带的参数
+ * @property {String} name 上传文件的字段名,供后端获取使用(默认file)
+ * @property {Array<String>} size-type original 原图,compressed 压缩图,默认二者都有(默认['original', 'compressed'])
+ * @property {Array<String>} source-type 选择图片的来源,album-从相册选图,camera-使用相机,默认二者都有(默认['album', 'camera'])
+ * @property {Boolean} preview-full-image	是否可以通过uni.previewImage预览已选择的图片(默认true)
+ * @property {Boolean} multiple	是否开启图片多选,部分安卓机型不支持(默认true)
+ * @property {Boolean} deletable 是否显示删除图片的按钮(默认true)
+ * @property {String Number} max-size 选择单个文件的最大大小,单位B(byte),默认不限制(默认Number.MAX_VALUE)
+ * @property {Array<Object>} file-list 默认显示的图片列表,数组元素为对象,必须提供url属性
+ * @property {Boolean} upload-text 选择图片按钮的提示文字(默认“选择图片”)
+ * @property {Boolean} auto-upload 选择完图片是否自动上传,见上方说明(默认true)
+ * @property {Boolean} show-tips 特殊情况下是否自动提示toast,见上方说明(默认true)
+ * @property {Boolean} show-upload-list 是否显示组件内部的图片预览(默认true)
+ * @event {Function} on-oversize 图片大小超出最大允许大小
+ * @event {Function} on-preview 全屏预览图片时触发
+ * @event {Function} on-remove 移除图片时触发
+ * @event {Function} on-success 图片上传成功时触发
+ * @event {Function} on-change 图片上传后,无论成功或者失败都会触发
+ * @event {Function} on-error 图片上传失败时触发
+ * @event {Function} on-progress 图片上传过程中的进度变化过程触发
+ * @event {Function} on-uploaded 所有图片上传完毕触发
+ * @event {Function} on-choose-complete 每次选择图片后触发,只是让外部可以得知每次选择后,内部的文件列表
+ * @example <u-upload :action="action" :file-list="fileList" ></u-upload>
+ */
+export default {
+	name: 'u-upload',
+	props: {
+		//是否显示组件自带的图片预览功能
+		showUploadList: {
+			type: Boolean,
+			default: true
+		},
+		// 后端地址
+		action: {
+			type: String,
+			default: ''
+		},
+		// 最大上传数量
+		maxCount: {
+			type: [String, Number],
+			default: 52
+		},
+		//  是否显示进度条
+		showProgress: {
+			type: Boolean,
+			default: true
+		},
+		// 是否启用
+		disabled: {
+			type: Boolean,
+			default: false
+		},
+		// 预览上传的图片时的裁剪模式,和image组件mode属性一致
+		imageMode: {
+			type: String,
+			default: 'aspectFill'
+		},
+		// 头部信息
+		header: {
+			type: Object,
+			default() {
+				return {};
 			}
 		},
-		mounted() {},
-		data() {
-			return {
-				lists: [],
-				isInCount: true,
-				uploading: false
-			};
-		},
-		watch: {
-			fileList: {
-				immediate: true,
-				handler(val) {
-					val.map(value => {
-						// 首先检查内部是否已经添加过这张图片,因为外部绑定了一个对象给fileList的话(对象引用),进行修改外部fileList
-						// 时,会触发watch,导致重新把原来的图片再次添加到this.lists
-						// 数组的some方法意思是,只要数组元素有任意一个元素条件符合,就返回true,而另一个数组的every方法的意思是数组所有元素都符合条件才返回true
-						let tmp = this.lists.some(val => {
-								return val.url == value.url;
-							})
-							// 如果内部没有这个图片(tmp为false),则添加到内部
-							!tmp && this.lists.push({
-								url: value.url,
-								error: false,
-								progress: 100
-							});
-					});
-				}
-			},
-			// 监听lists的变化,发出事件
-			lists(n) {
-				this.$emit('on-list-change', n, this.index);
+		// 额外携带的参数
+		formData: {
+			type: Object,
+			default() {
+				return {};
+			}
+		},
+		// 上传的文件字段名
+		name: {
+			type: String,
+			default: 'file'
+		},
+		// 所选的图片的尺寸, 可选值为original compressed
+		sizeType: {
+			type: Array,
+			default() {
+				return ['original', 'compressed'];
+			}
+		},
+		sourceType: {
+			type: Array,
+			default() {
+				return ['album', 'camera'];
+			}
+		},
+		// 是否在点击预览图后展示全屏图片预览
+		previewFullImage: {
+			type: Boolean,
+			default: true
+		},
+		// 是否开启图片多选,部分安卓机型不支持
+		multiple: {
+			type: Boolean,
+			default: true
+		},
+		// 是否展示删除按钮
+		deletable: {
+			type: Boolean,
+			default: true
+		},
+		// 文件大小限制,单位为byte
+		maxSize: {
+			type: [String, Number],
+			default: Number.MAX_VALUE
+		},
+		// 显示已上传的文件列表
+		fileList: {
+			type: Array,
+			default() {
+				return [];
+			}
+		},
+		// 上传区域的提示文字
+		uploadText: {
+			type: String,
+			default: '选择图片'
+		},
+		// 是否自动上传
+		autoUpload: {
+			type: Boolean,
+			default: true
+		},
+		// 是否显示toast消息提示
+		showTips: {
+			type: Boolean,
+			default: true
+		},
+		// 是否通过slot自定义传入选择图标的按钮
+		customBtn: {
+			type: Boolean,
+			default: false
+		},
+		// 内部预览图片区域和选择图片按钮的区域宽度
+		width: {
+			type: [String, Number],
+			default: 200
+		},
+		// 内部预览图片区域和选择图片按钮的区域高度
+		height: {
+			type: [String, Number],
+			default: 200
+		},
+		// 右上角关闭按钮的背景颜色
+		delBgColor: {
+			type: String,
+			default: '#fa3534'
+		},
+		// 右上角关闭按钮的叉号图标的颜色
+		delColor: {
+			type: String,
+			default: '#ffffff'
+		},
+		// 右上角删除图标名称,只能为uView内置图标
+		delIcon: {
+			type: String,
+			default: 'close'
+		},
+		// 如果上传后的返回值为json字符串,是否自动转json
+		toJson: {
+			type: Boolean,
+			default: true
+		},
+		// 上传前的钩子,每个文件上传前都会执行
+		beforeUpload: {
+			type: Function,
+			default: null
+		},
+		// 移除文件前的钩子
+		beforeRemove: {
+			type: Function,
+			default: null
+		},
+		// 允许上传的图片后缀
+		limitType: {
+			type: Array,
+			default() {
+				// 支付宝小程序真机选择图片的后缀为"image"
+				// https://opendocs.alipay.com/mini/api/media-image
+				return ['png', 'jpg', 'jpeg', 'webp', 'gif', 'image', 'mp4', 'avi', 'mov', 'wmv'];
 			}
 		},
-		methods: {
-			// 清除列表
-			clear() {
-				this.lists = [];
-			},
-			// 重新上传队列中上传失败的所有文件
-			reUpload() {
-				this.uploadFile();
-			},
-			// 选择图片
-			selectFile() {
-				if (this.disabled) return;
-				const {
-					name = '', maxCount, multiple, maxSize, sizeType, lists, camera, compressed, maxDuration, sourceType
-				} = this;
-				let chooseFile = null;
-				const newMaxCount = maxCount - lists.length;
-				// 设置为只选择图片的时候使用 chooseImage 来实现
-				chooseFile = new Promise((resolve, reject) => {
-					uni.chooseImage({
-						count: multiple ? (newMaxCount > 9 ? 9 : newMaxCount) : 1,
-						sourceType: sourceType,
-						sizeType,
-						success: resolve,
-						fail: reject
+		// 在各个回调事件中的最后一个参数返回,用于区别是哪一个组件的事件
+		index: {
+			type: [Number, String],
+			default: ''
+		}
+	},
+	mounted() {},
+	data() {
+		return {
+			lists: [],
+			isInCount: true,
+			uploading: false
+		};
+	},
+	watch: {
+		fileList: {
+			immediate: true,
+			handler(val) {
+				val.map((value) => {
+					// 首先检查内部是否已经添加过这张图片,因为外部绑定了一个对象给fileList的话(对象引用),进行修改外部fileList
+					// 时,会触发watch,导致重新把原来的图片再次添加到this.lists
+					// 数组的some方法意思是,只要数组元素有任意一个元素条件符合,就返回true,而另一个数组的every方法的意思是数组所有元素都符合条件才返回true
+					let tmp = this.lists.some((val) => {
+						return val.url == value.url;
 					});
+					// 如果内部没有这个图片(tmp为false),则添加到内部
+					!tmp &&
+						this.lists.push({
+							url: value.url,
+							error: false,
+							progress: 100
+						});
 				});
-				chooseFile
-					.then(res => {
-						let file = null;
-						let listOldLength = this.lists.length;
-						res.tempFiles.map((val, index) => {
-							// 检查文件后缀是否允许,如果不在this.limitType内,就会返回false
-							if (!this.checkFileExt(val)) return;
+			}
+		},
+		// 监听lists的变化,发出事件
+		lists(n) {
+			this.$emit('on-list-change', n, this.index);
+		}
+	},
+	methods: {
+		// 清除列表
+		clear() {
+			this.lists = [];
+		},
+		// 重新上传队列中上传失败的所有文件
+		reUpload() {
+			this.uploadFile();
+		},
+		// 选择图片
+		selectFile() {
+			if (this.disabled) return;
+			const { name = '', maxCount, multiple, maxSize, sizeType, lists, camera, compressed, maxDuration, sourceType } = this;
+			let chooseFile = null;
+			const newMaxCount = maxCount - lists.length;
+			// 设置为只选择图片的时候使用 chooseImage 来实现
+			chooseFile = new Promise((resolve, reject) => {
+				wx.chooseImage({
+					count: multiple ? (newMaxCount > 9 ? 9 : newMaxCount) : 1,
+					sourceType: sourceType,
+					sizeType,
+					success: resolve,
+					fail: reject
+				});
+			});
+			chooseFile
+				.then((res) => {
+					let file = null;
+					let listOldLength = this.lists.length;
+					res.tempFiles.map((val, index) => {
+						// 检查文件后缀是否允许,如果不在this.limitType内,就会返回false
+						if (!this.checkFileExt(val)) return;
 
-							// 如果是非多选,index大于等于1或者超出最大限制数量时,不处理
-							if (!multiple && index >= 1) return;
-							if (val.size > maxSize) {
-								this.$emit('on-oversize', val, this.lists, this.index);
-								this.showToast('超出允许的文件大小');
-							} else {
-								if (maxCount <= lists.length) {
-									this.$emit('on-exceed', val, this.lists, this.index);
-									this.showToast('超出最大允许的文件个数');
-									return;
-								}
-								lists.push({
-									url: val.path,
-									progress: 0,
-									error: false,
-									file: val
-								});
+						// 如果是非多选,index大于等于1或者超出最大限制数量时,不处理
+						if (!multiple && index >= 1) return;
+						if (val.size > maxSize) {
+							this.$emit('on-oversize', val, this.lists, this.index);
+							this.showToast('超出允许的文件大小');
+						} else {
+							if (maxCount <= lists.length) {
+								this.$emit('on-exceed', val, this.lists, this.index);
+								this.showToast('超出最大允许的文件个数');
+								return;
 							}
-						});
-						// 每次图片选择完,抛出一个事件,并将当前内部选择的图片数组抛出去
-						this.$emit('on-choose-complete', this.lists, this.index);
-						if (this.autoUpload) this.uploadFile(listOldLength);
-					})
-					.catch(error => {
-						this.$emit('on-choose-fail', error);
-					});
-			},
-			// 提示用户消息
-			showToast(message, force = false) {
-				if (this.showTips || force) {
-					uni.showToast({
-						title: message,
-						icon: 'none'
+							lists.push({
+								url: val.path,
+								progress: 0,
+								error: false,
+								file: val
+							});
+						}
 					});
-				}
-			},
-			// 该方法供用户通过ref调用,手动上传
-			upload() {
-				this.uploadFile();
-			},
-			// 对失败的图片重新上传
-			retry(index) {
-				this.lists[index].progress = 0;
-				this.lists[index].error = false;
-				this.lists[index].response = null;
-				uni.showLoading({
-					title: '重新上传'
+					// 每次图片选择完,抛出一个事件,并将当前内部选择的图片数组抛出去
+					this.$emit('on-choose-complete', this.lists, this.index);
+					if (this.autoUpload) this.uploadFile(listOldLength);
+				})
+				.catch((error) => {
+					this.$emit('on-choose-fail', error);
 				});
-				this.uploadFile(index);
-			},
-			// 上传图片
-			async uploadFile(index = 0) {
-				if (this.disabled) return;
-				if (this.uploading) return;
-				// 全部上传完成
-				if (index >= this.lists.length) {
-					this.$emit('on-uploaded', this.lists, this.index);
-					return;
-				}
-				// 检查是否是已上传或者正在上传中
-				if (this.lists[index].progress == 100) {
-					if (this.autoUpload == false) this.uploadFile(index + 1);
-					return;
-				}
-				// 执行before-upload钩子
-				if (this.beforeUpload && typeof(this.beforeUpload) === 'function') {
-					// 执行回调,同时传入索引和文件列表当作参数
-					// 在微信,支付宝等环境(H5正常),会导致父组件定义的customBack()函数体中的this变成子组件的this
-					// 通过bind()方法,绑定父组件的this,让this.customBack()的this为父组件的上下文
-					// 因为upload组件可能会被嵌套在其他组件内,比如u-form,这时this.$parent其实为u-form的this,
-					// 非页面的this,所以这里需要往上历遍,一直寻找到最顶端的$parent,这里用了this.$u.$parent.call(this)
-					// 明白意思即可,无需纠结this.$u.$parent.call(this)的细节
-					let beforeResponse = this.beforeUpload.bind(this.$u.$parent.call(this))(index, this.lists);
-					// 判断是否返回了promise
-					if (!!beforeResponse && typeof beforeResponse.then === 'function') {
-						await beforeResponse.then(res => {
+		},
+		// 提示用户消息
+		showToast(message, force = false) {
+			if (this.showTips || force) {
+				uni.showToast({
+					title: message,
+					icon: 'none'
+				});
+			}
+		},
+		// 该方法供用户通过ref调用,手动上传
+		upload() {
+			this.uploadFile();
+		},
+		// 对失败的图片重新上传
+		retry(index) {
+			this.lists[index].progress = 0;
+			this.lists[index].error = false;
+			this.lists[index].response = null;
+			uni.showLoading({
+				title: '重新上传'
+			});
+			this.uploadFile(index);
+		},
+		// 上传图片
+		async uploadFile(index = 0) {
+			if (this.disabled) return;
+			if (this.uploading) return;
+			// 全部上传完成
+			if (index >= this.lists.length) {
+				this.$emit('on-uploaded', this.lists, this.index);
+				return;
+			}
+			// 检查是否是已上传或者正在上传中
+			if (this.lists[index].progress == 100) {
+				if (this.autoUpload == false) this.uploadFile(index + 1);
+				return;
+			}
+			// 执行before-upload钩子
+			if (this.beforeUpload && typeof this.beforeUpload === 'function') {
+				// 执行回调,同时传入索引和文件列表当作参数
+				// 在微信,支付宝等环境(H5正常),会导致父组件定义的customBack()函数体中的this变成子组件的this
+				// 通过bind()方法,绑定父组件的this,让this.customBack()的this为父组件的上下文
+				// 因为upload组件可能会被嵌套在其他组件内,比如u-form,这时this.$parent其实为u-form的this,
+				// 非页面的this,所以这里需要往上历遍,一直寻找到最顶端的$parent,这里用了this.$u.$parent.call(this)
+				// 明白意思即可,无需纠结this.$u.$parent.call(this)的细节
+				let beforeResponse = this.beforeUpload.bind(this.$u.$parent.call(this))(index, this.lists);
+				// 判断是否返回了promise
+				if (!!beforeResponse && typeof beforeResponse.then === 'function') {
+					await beforeResponse
+						.then((res) => {
 							// promise返回成功,不进行动作,继续上传
-						}).catch(err => {
+						})
+						.catch((err) => {
 							// 进入catch回调的话,继续下一张
 							return this.uploadFile(index + 1);
-						})
-					} else if (beforeResponse === false) {
-						// 如果返回false,继续下一张图片的上传
-						return this.uploadFile(index + 1);
+						});
+				} else if (beforeResponse === false) {
+					// 如果返回false,继续下一张图片的上传
+					return this.uploadFile(index + 1);
+				} else {
+					// 此处为返回"true"的情形,这里不写代码,就跳过此处,继续执行当前的上传逻辑
+				}
+			}
+			// 检查上传地址
+			if (!this.action) {
+				this.showToast('请配置上传地址', true);
+				return;
+			}
+			this.lists[index].error = false;
+			this.uploading = true;
+			// 创建上传对象
+			const task = uni.uploadFile({
+				url: this.action,
+				filePath: this.lists[index].url,
+				name: this.name,
+				formData: this.formData,
+				header: this.header,
+				success: (res) => {
+					// 判断是否json字符串,将其转为json格式
+					let data = this.toJson && this.$u.test.jsonString(res.data) ? JSON.parse(res.data) : res.data;
+					if (![200, 201, 204].includes(res.statusCode)) {
+						this.uploadError(index, data);
 					} else {
-						// 此处为返回"true"的情形,这里不写代码,就跳过此处,继续执行当前的上传逻辑
+						// 上传成功
+						this.lists[index].response = data;
+						this.lists[index].progress = 100;
+						this.lists[index].error = false;
+						this.$emit('on-success', data, index, this.lists, this.index);
 					}
+				},
+				fail: (e) => {
+					this.uploadError(index, e);
+				},
+				complete: (res) => {
+					uni.hideLoading();
+					this.uploading = false;
+					this.uploadFile(index + 1);
+					this.$emit('on-change', res, index, this.lists, this.index);
 				}
-				// 检查上传地址
-				if (!this.action) {
-					this.showToast('请配置上传地址', true);
-					return;
+			});
+			task.onProgressUpdate((res) => {
+				if (res.progress > 0) {
+					this.lists[index].progress = res.progress;
+					this.$emit('on-progress', res, index, this.lists, this.index);
 				}
-				this.lists[index].error = false;
-				this.uploading = true;
-				// 创建上传对象
-				const task = uni.uploadFile({
-					url: this.action,
-					filePath: this.lists[index].url,
-					name: this.name,
-					formData: this.formData,
-					header: this.header,
-					success: res => {
-						// 判断是否json字符串,将其转为json格式
-						let data = this.toJson && this.$u.test.jsonString(res.data) ? JSON.parse(res
-							.data) : res.data;
-						if (![200, 201, 204].includes(res.statusCode)) {
-							this.uploadError(index, data);
-						} else {
-							// 上传成功
-							this.lists[index].response = data;
-							this.lists[index].progress = 100;
-							this.lists[index].error = false;
-							this.$emit('on-success', data, index, this.lists, this.index);
-						}
-					},
-					fail: e => {
-						this.uploadError(index, e);
-					},
-					complete: res => {
-						uni.hideLoading();
-						this.uploading = false;
-						this.uploadFile(index + 1);
-						this.$emit('on-change', res, index, this.lists, this.index);
-					}
-				});
-				task.onProgressUpdate(res => {
-					if (res.progress > 0) {
-						this.lists[index].progress = res.progress;
-						this.$emit('on-progress', res, index, this.lists, this.index);
-					}
-				});
-			},
-			// 上传失败
-			uploadError(index, err) {
-				this.lists[index].progress = 0;
-				this.lists[index].error = true;
-				this.lists[index].response = null;
-				this.$emit('on-error', err, index, this.lists, this.index);
-				this.showToast('上传失败,请重试');
-			},
-			// 删除一个图片
-			deleteItem(index) {
-				uni.showModal({
-					title: '提示',
-					content: '您确定要删除此项吗?',
-					success: async (res) => {
-						if (res.confirm) {
-							// 先检查是否有定义before-remove移除前钩子
-							// 执行before-remove钩子
-							if (this.beforeRemove && typeof(this.beforeRemove) === 'function') {
-								// 此处钩子执行 原理同before-remove参数,见上方注释
-								let beforeResponse = this.beforeRemove.bind(this.$u.$parent.call(this))(index,
-									this.lists);
-								// 判断是否返回了promise
-								if (!!beforeResponse && typeof beforeResponse.then === 'function') {
-									await beforeResponse.then(res => {
+			});
+		},
+		// 上传失败
+		uploadError(index, err) {
+			this.lists[index].progress = 0;
+			this.lists[index].error = true;
+			this.lists[index].response = null;
+			this.$emit('on-error', err, index, this.lists, this.index);
+			this.showToast('上传失败,请重试');
+		},
+		// 删除一个图片
+		deleteItem(index) {
+			uni.showModal({
+				title: '提示',
+				content: '您确定要删除此项吗?',
+				success: async (res) => {
+					if (res.confirm) {
+						// 先检查是否有定义before-remove移除前钩子
+						// 执行before-remove钩子
+						if (this.beforeRemove && typeof this.beforeRemove === 'function') {
+							// 此处钩子执行 原理同before-remove参数,见上方注释
+							let beforeResponse = this.beforeRemove.bind(this.$u.$parent.call(this))(index, this.lists);
+							// 判断是否返回了promise
+							if (!!beforeResponse && typeof beforeResponse.then === 'function') {
+								await beforeResponse
+									.then((res) => {
 										// promise返回成功,不进行动作,继续上传
 										this.handlerDeleteItem(index);
-									}).catch(err => {
+									})
+									.catch((err) => {
 										// 如果进入promise的reject,终止删除操作
 										this.showToast('已终止移除');
-									})
-								} else if (beforeResponse === false) {
-									// 返回false,终止删除
-									this.showToast('已终止移除');
-								} else {
-									// 如果返回true,执行删除操作
-									this.handlerDeleteItem(index);
-								}
+									});
+							} else if (beforeResponse === false) {
+								// 返回false,终止删除
+								this.showToast('已终止移除');
 							} else {
-								// 如果不存在before-remove钩子,
+								// 如果返回true,执行删除操作
 								this.handlerDeleteItem(index);
 							}
+						} else {
+							// 如果不存在before-remove钩子,
+							this.handlerDeleteItem(index);
 						}
 					}
-				});
-			},
-			// 执行移除图片的动作,上方代码只是判断是否可以移除
-			handlerDeleteItem(index) {
-				// 如果文件正在上传中,终止上传任务,进度在0 < progress < 100则意味着正在上传
-				if (this.lists[index].process < 100 && this.lists[index].process > 0) {
-					typeof this.lists[index].uploadTask != 'undefined' && this.lists[index].uploadTask.abort();
 				}
+			});
+		},
+		// 执行移除图片的动作,上方代码只是判断是否可以移除
+		handlerDeleteItem(index) {
+			// 如果文件正在上传中,终止上传任务,进度在0 < progress < 100则意味着正在上传
+			if (this.lists[index].process < 100 && this.lists[index].process > 0) {
+				typeof this.lists[index].uploadTask != 'undefined' && this.lists[index].uploadTask.abort();
+			}
+			this.lists.splice(index, 1);
+			this.$forceUpdate();
+			this.$emit('on-remove', index, this.lists, this.index);
+			this.showToast('移除成功');
+		},
+		// 用户通过ref手动的形式,移除一张图片
+		remove(index) {
+			// 判断索引的合法范围
+			if (index >= 0 && index < this.lists.length) {
 				this.lists.splice(index, 1);
-				this.$forceUpdate();
-				this.$emit('on-remove', index, this.lists, this.index);
-				this.showToast('移除成功');
-			},
-			// 用户通过ref手动的形式,移除一张图片
-			remove(index) {
-				// 判断索引的合法范围
-				if (index >= 0 && index < this.lists.length) {
-					this.lists.splice(index, 1);
-					this.$emit('on-list-change', this.lists, this.index);
-				}
-			},
-			// 预览图片
-			doPreviewImage(url, index) {
-				if (!this.previewFullImage) return;
-				const images = this.lists.map(item => item.url || item.path);
-				uni.previewImage({
-					urls: images,
-					current: url,
-					success: () => {
-						this.$emit('on-preview', url, this.lists, this.index);
-					},
-					fail: () => {
-						uni.showToast({
-							title: '预览图片失败',
-							icon: 'none'
-						});
-					}
-				});
-			},
-			// 判断文件后缀是否允许
-			checkFileExt(file) {
-				// 检查是否在允许的后缀中
-				let noArrowExt = false;
-				// 获取后缀名
-				let fileExt = '';
-				const reg = /.+\./;
-				// 如果是H5,需要从name中判断
-				// #ifdef H5
-				fileExt = file.name.replace(reg, "").toLowerCase();
-				// #endif
-				// 非H5,需要从path中读取后缀
-				// #ifndef H5
-				fileExt = file.path.replace(reg, "").toLowerCase();
-				// #endif
-				// 使用数组的some方法,只要符合limitType中的一个,就返回true
-				noArrowExt = this.limitType.some(ext => {
-					// 转为小写
-					return ext.toLowerCase() === fileExt;
-				})
-				if (!noArrowExt) this.showToast(`不允许选择${fileExt}格式的文件`);
-				return noArrowExt;
+				this.$emit('on-list-change', this.lists, this.index);
 			}
+		},
+		// 预览图片
+		doPreviewImage(url, index) {
+			if (!this.previewFullImage) return;
+			const images = this.lists.map((item) => item.url || item.path);
+			uni.previewImage({
+				urls: images,
+				current: url,
+				success: () => {
+					this.$emit('on-preview', url, this.lists, this.index);
+				},
+				fail: () => {
+					uni.showToast({
+						title: '预览图片失败',
+						icon: 'none'
+					});
+				}
+			});
+		},
+		// 判断文件后缀是否允许
+		checkFileExt(file) {
+			// 检查是否在允许的后缀中
+			let noArrowExt = false;
+			// 获取后缀名
+			let fileExt = '';
+			const reg = /.+\./;
+			// 如果是H5,需要从name中判断
+			// #ifdef H5
+			fileExt = file.name.replace(reg, '').toLowerCase();
+			// #endif
+			// 非H5,需要从path中读取后缀
+			// #ifndef H5
+			fileExt = file.path.replace(reg, '').toLowerCase();
+			// #endif
+			// 使用数组的some方法,只要符合limitType中的一个,就返回true
+			noArrowExt = this.limitType.some((ext) => {
+				// 转为小写
+				return ext.toLowerCase() === fileExt;
+			});
+			if (!noArrowExt) this.showToast(`不允许选择${fileExt}格式的文件`);
+			return noArrowExt;
 		}
-	};
+	}
+};
 </script>
 
 <style lang="scss" scoped>
-	@import '../../libs/css/style.components.scss';
+@import '../../libs/css/style.components.scss';
 
-	.u-upload {
-		@include vue-flex;
-		flex-wrap: wrap;
-		align-items: center;
-	}
+.u-upload {
+	@include vue-flex;
+	flex-wrap: wrap;
+	align-items: center;
+}
 
-	.u-list-item {
-		width: 200rpx;
-		height: 200rpx;
-		overflow: hidden;
-		margin: 10rpx;
-		background: rgb(244, 245, 246);
-		position: relative;
-		border-radius: 10rpx;
-		/* #ifndef APP-NVUE */
-		display: flex;
-		/* #endif */
-		align-items: center;
-		justify-content: center;
-	}
+.u-list-item {
+	width: 200rpx;
+	height: 200rpx;
+	overflow: hidden;
+	margin: 10rpx;
+	background: rgb(244, 245, 246);
+	position: relative;
+	border-radius: 10rpx;
+	/* #ifndef APP-NVUE */
+	display: flex;
+	/* #endif */
+	align-items: center;
+	justify-content: center;
+}
 
-	.u-preview-wrap {
-		border: 1px solid rgb(235, 236, 238);
-	}
+.u-preview-wrap {
+	border: 1px solid rgb(235, 236, 238);
+}
 
-	.u-add-wrap {
-		flex-direction: column;
-		color: $u-content-color;
-		font-size: 26rpx;
-	}
+.u-add-wrap {
+	flex-direction: column;
+	color: $u-content-color;
+	font-size: 26rpx;
+}
 
-	.u-add-tips {
-		margin-top: 20rpx;
-		line-height: 40rpx;
-	}
+.u-add-tips {
+	margin-top: 20rpx;
+	line-height: 40rpx;
+}
 
-	.u-add-wrap__hover {
-		background-color: rgb(235, 236, 238);
-	}
+.u-add-wrap__hover {
+	background-color: rgb(235, 236, 238);
+}
 
-	.u-preview-image {
-		display: block;
-		width: 100%;
-		height: 100%;
-		border-radius: 10rpx;
-	}
+.u-preview-image {
+	display: block;
+	width: 100%;
+	height: 100%;
+	border-radius: 10rpx;
+}
 
-	.u-delete-icon {
-		position: absolute;
-		top: 10rpx;
-		right: 10rpx;
-		z-index: 10;
-		background-color: $u-type-error;
-		border-radius: 100rpx;
-		width: 44rpx;
-		height: 44rpx;
-		@include vue-flex;
-		align-items: center;
-		justify-content: center;
-	}
+.u-delete-icon {
+	position: absolute;
+	top: 10rpx;
+	right: 10rpx;
+	z-index: 10;
+	background-color: $u-type-error;
+	border-radius: 100rpx;
+	width: 44rpx;
+	height: 44rpx;
+	@include vue-flex;
+	align-items: center;
+	justify-content: center;
+}
 
-	.u-icon {
-		@include vue-flex;
-		align-items: center;
-		justify-content: center;
-	}
+.u-icon {
+	@include vue-flex;
+	align-items: center;
+	justify-content: center;
+}
 
-	.u-progress {
-		position: absolute;
-		bottom: 10rpx;
-		left: 8rpx;
-		right: 8rpx;
-		z-index: 9;
-		width: auto;
-	}
+.u-progress {
+	position: absolute;
+	bottom: 10rpx;
+	left: 8rpx;
+	right: 8rpx;
+	z-index: 9;
+	width: auto;
+}
 
-	.u-error-btn {
-		color: #ffffff;
-		background-color: $u-type-error;
-		font-size: 20rpx;
-		padding: 4px 0;
-		text-align: center;
-		position: absolute;
-		bottom: 0;
-		left: 0;
-		right: 0;
-		z-index: 9;
-		line-height: 1;
-	}
-</style>
+.u-error-btn {
+	color: #ffffff;
+	background-color: $u-type-error;
+	font-size: 20rpx;
+	padding: 4px 0;
+	text-align: center;
+	position: absolute;
+	bottom: 0;
+	left: 0;
+	right: 0;
+	z-index: 9;
+	line-height: 1;
+}
+</style>

Some files were not shown because too many files changed in this diff