Pārlūkot izejas kodu

修改文件上传

zs 1 gadu atpakaļ
vecāks
revīzija
e9de5820be
30 mainītis faili ar 5374 papildinājumiem un 924 dzēšanām
  1. 63 91
      pagesHome/create/components/activity.vue
  2. 51 64
      pagesHome/create/components/match.vue
  3. 33 3
      pagesHome/create/index.vue
  4. 1 1
      pagesHome/team/info.vue
  5. 3563 649
      unpackage/dist/dev/mp-weixin/common/vendor.js
  6. 100 60
      unpackage/dist/dev/mp-weixin/pagesHome/create/components/activity.js
  7. 3 1
      unpackage/dist/dev/mp-weixin/pagesHome/create/components/activity.json
  8. 1 1
      unpackage/dist/dev/mp-weixin/pagesHome/create/components/activity.wxml
  9. 1 0
      unpackage/dist/dev/mp-weixin/pagesHome/create/components/activity.wxss
  10. 83 43
      unpackage/dist/dev/mp-weixin/pagesHome/create/components/match.js
  11. 3 1
      unpackage/dist/dev/mp-weixin/pagesHome/create/components/match.json
  12. 1 1
      unpackage/dist/dev/mp-weixin/pagesHome/create/components/match.wxml
  13. 1 0
      unpackage/dist/dev/mp-weixin/pagesHome/create/components/match.wxss
  14. 46 7
      unpackage/dist/dev/mp-weixin/pagesHome/create/index.js
  15. 1 1
      unpackage/dist/dev/mp-weixin/pagesHome/create/index.wxml
  16. 1 1
      unpackage/dist/dev/mp-weixin/pagesHome/team/info.wxss
  17. 200 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js
  18. 531 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.js
  19. 7 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.json
  20. 1 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.wxml
  21. 42 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.wxss
  22. 172 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.js
  23. 4 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.json
  24. 1 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.wxml
  25. 98 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.wxss
  26. 182 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.js
  27. 4 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.json
  28. 1 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.wxml
  29. 89 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.wxss
  30. 90 0
      unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/utils.js

+ 63 - 91
pagesHome/create/components/activity.vue

@@ -4,31 +4,21 @@
 			<view class="value other">
 				<view class="title">类型</view>
 				<view class="label">
-					<picker name="type" @change="typeChange" :value="index" :range="typeList" range-key="dictLabel">
-						<view class="picker">{{form.type||'请选择类型'}}</view>
+					<picker v-if="type=='0'" name="type" @change="typeChange" :value="index" :range="typeList"
+						range-key="dictLabel">
+						<view class="picker">{{form.type||'普通训练'}}</view>
 					</picker>
-				</view>
-			</view>
-			<view class="value other margin">
-				<view class="title">人数</view>
-				<view class="label">
-					<picker name="number" @change="numberChange" :value="index" :range="numberList"
+					<picker v-else name="type" @change="typeChange" :value="index" :range="activityList"
 						range-key="dictLabel">
-						<view class="picker">{{form.number||'请选择人数'}}</view>
+						<view class="picker">{{form.type||'请选择'}}</view>
 					</picker>
 				</view>
 			</view>
-			<view class="value other">
-				<view class="title">对手</view>
-				<view class="label">
-					<input name="name" class="input" :value="form.name" placeholder="请选择" />
-				</view>
-			</view>
 			<view class="value other">
 				<view class="title">日期</view>
 				<view class="label">
 					<picker name="date" mode="date" @change="dateChange" :value="index">
-						<view class="picker">{{form.date||'请选择日期'}}</view>
+						<view class="picker">{{form.date||'请选择'}}</view>
 					</picker>
 				</view>
 			</view>
@@ -36,7 +26,7 @@
 				<view class="title">时间</view>
 				<view class="label">
 					<picker name="time" mode="time" @change="timeChange" :value="index">
-						<view class="picker">{{form.time||'请选择时间'}}</view>
+						<view class="picker">{{form.time||'请选择'}}</view>
 					</picker>
 				</view>
 			</view>
@@ -49,18 +39,12 @@
 					</picker>
 				</view>
 			</view>
-			<view class="value other">
+			<view class="value other margin">
 				<view class="title">地点</view>
 				<view class="label">
 					<input name="name" class="input" :value="form.address" placeholder="请选择" />
 				</view>
 			</view>
-			<view class="value other margin">
-				<view class="title">队服颜色</view>
-				<view class="label">
-					<input name="color" class="input" :value="form.color" placeholder="请输入队服颜色" />
-				</view>
-			</view>
 			<view class="value other">
 				<view class="title">费用</view>
 				<view class="label">
@@ -70,13 +54,13 @@
 			<view class="value other">
 				<view class="title">人数上限</view>
 				<view class="label">
-					<input name="name" class="input" :value="form.address" placeholder="请选择" />
+					<input name="name" class="input" :value="form.number" placeholder="请选择" />
 				</view>
 			</view>
 			<view class="value other">
 				<view class="title">公开报名</view>
 				<view class="label">
-					<input name="name" class="input" :value="form.address" placeholder="请选择" />
+					<input name="name" class="input" :value="form.sign" placeholder="请选择" />
 				</view>
 			</view>
 			<view class="value other">
@@ -88,7 +72,7 @@
 			<view class="value other">
 				<view class="title">报名截止时间</view>
 				<view class="label">
-					<input name="name" class="input" :value="form.address" placeholder="请选择" />
+					<input name="name" class="input" :value="form.time" placeholder="请选择" />
 				</view>
 			</view>
 			<view class="value other">
@@ -109,15 +93,16 @@
 					<input name="title" class="input" :value="form.title" placeholder="请输入活动标题" />
 				</view>
 			</view>
-			<view class="remark">
+			<view class="remark margin">
 				<view class="label">
 					<textarea name="brief" :value="form.brief" placeholder="请输入简介" />
 				</view>
 			</view>
-			<view class="value other">
+			<view class="remark">
 				<view class="title">上传图片</view>
 				<view class="label">
-					
+					<uni-file-picker v-model="form.file" fileMediatype="image" :list-styles="imageStyles" limit="6"
+						title="最多选择6张图片" @select="toUpload" @delete="toDelete"></uni-file-picker>
 				</view>
 			</view>
 		</form>
@@ -125,51 +110,39 @@
 </template>
 
 <script setup lang="ts">
-	import { getCurrentInstance, computed, ref } from 'vue';
-	//该依赖已内置不需要单独安装
-	import { onShow } from "@dcloudio/uni-app";
+	import { ref, toRefs, getCurrentInstance } from 'vue';
 	// 请求接口
 	const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
-	const $config = getCurrentInstance()?.appContext.config.globalProperties.$config;
 	const $apifile = getCurrentInstance()?.appContext.config.globalProperties.$apifile;
-	// openid
-	const openid = computed(() => {
-		return uni.getStorageSync('openid');
-	})
 	// 信息
-	const form = ref({});
-	// 字典表
-	const typeList = ref([]);
-	const numberList = ref([]);
-	const durationList = ref([]);
-	onShow(async () => {
-		await searchOther();
-		await search();
-	})
-	// 查询其他信息
-	const searchOther = async () => {
-		let res;
-		// 类型
-		res = await $api(`dict/data/list`, 'GET', { dictType: 'sys_user_type' });
-		if (res.code === 200 && res.total > 0) typeList.value = res.rows
-		// 人数
-		res = await $api(`dict/data/list`, 'GET', { dictType: 'sys_match_number' });
-		if (res.code === 200 && res.total > 0) numberList.value = res.rows
-		// 时长
-		res = await $api(`dict/data/list`, 'GET', { dictType: 'sys_match_duration' });
-		if (res.code === 200 && res.total > 0) durationList.value = res.rows
-	};
-	// 查询
-	const search = async () => { };
+	const form = ref({ file: [] });
+	const listStyles = ref({
+		width: 64,
+		height: 64,
+		border: {
+			color: "#ff5a5f",
+			width: 2,
+			style: 'dashed',
+			radius: '2px'
+		}
+	});
+	const props = defineProps({
+		type: { type: String, default: () => '0' },
+		typeList: { type: Array, default: () => [] },
+		activityList: { type: Array, default: () => [] },
+		durationList: { type: Array, default: () => [] },
+	});
+	const { type, typeList, activityList, durationList } = toRefs(props);
 	// 类型选择
 	const typeChange = (e) => {
-		const data = typeList.value[e.detail.value]
-		if (data) form.value.type = data.dictLabel
-	};
-	// 人数选择
-	const numberChange = (e) => {
-		const data = numberList.value[e.detail.value]
-		if (data) form.value.number = data.dictLabel
+		let data
+		if (type.value == 0) {
+			data = typeList.value[e.detail.value]
+			if (data) form.value.type = data.dictLabel
+		} else {
+			data = activityList.value[e.detail.value]
+			if (data) form.value.type = data.dictLabel
+		}
 	};
 	// 时长选择选择
 	const durationChange = (e) => {
@@ -185,29 +158,27 @@
 		form.value.time = e.detail.value
 	};
 	// 上传图片
-	const Preview = () => {
-		uni.chooseImage({
-			count: 1,
-			sizeType: ['original', 'compressed'],
-			sourceType: ['album', 'camera'],
-			success: async function (res) {
-				let tempFile = JSON.parse(JSON.stringify(res.tempFilePaths));
-				const arr = await $apifile(`/common/upload`, 'file', tempFile[0],
-					'file');
-				if (arr.code == 200) {
-					form.value.logo = arr.url
-				} else {
-					uni.showToast({
-						title: arr.msg,
-						icon: 'none'
-					});
-				}
-			}
-		});
+	const toUpload = async (e) => {
+		const arr = await $apifile(`/common/upload`, 'file', e.tempFilePaths[0],
+			'file');
+		if (arr.code == 200) {
+			form.value.file.push({
+				newFileName: arr.newFileName,
+				originalFilename: arr.originalFilename,
+				url: arr.url
+			})
+			console.log(form.value.file);
+		} else {
+			uni.showToast({
+				title: arr.msg,
+				icon: 'none'
+			});
+		}
 	};
-	// 创建
-	const formSubmit = (e) => {
-		console.log(e.deatil.value);
+	// 删除图片
+	const toDelete = async (e) => {
+		form.value.file = form.value.file.filter(i => i.originalFilename != e.tempFile.name)
+		console.log(form.value.file);
 	};
 </script>
 <style lang="scss" scoped>
@@ -231,6 +202,7 @@
 
 			.title {
 				padding: 0 0 3vw 0;
+				border-bottom: 1px solid var(--footColor);
 			}
 		}
 

+ 51 - 64
pagesHome/create/components/match.vue

@@ -109,15 +109,16 @@
 					<input name="title" class="input" :value="form.title" placeholder="请输入活动标题" />
 				</view>
 			</view>
-			<view class="remark">
+			<view class="remark margin">
 				<view class="label">
 					<textarea name="brief" :value="form.brief" placeholder="请输入简介" />
 				</view>
 			</view>
-			<view class="value other">
+			<view class="remark">
 				<view class="title">上传图片</view>
 				<view class="label">
-					
+					<uni-file-picker v-model="form.file" fileMediatype="image" :list-styles="imageStyles" limit="6"
+						title="最多选择6张图片" @select="toUpload" @delete="toDelete"></uni-file-picker>
 				</view>
 			</view>
 		</form>
@@ -125,51 +126,38 @@
 </template>
 
 <script setup lang="ts">
-	import { getCurrentInstance, computed, ref } from 'vue';
-	//该依赖已内置不需要单独安装
-	import { onShow } from "@dcloudio/uni-app";
+	import { ref, toRefs, getCurrentInstance } from 'vue';
 	// 请求接口
 	const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
-	const $config = getCurrentInstance()?.appContext.config.globalProperties.$config;
 	const $apifile = getCurrentInstance()?.appContext.config.globalProperties.$apifile;
-	// openid
-	const openid = computed(() => {
-		return uni.getStorageSync('openid');
-	})
 	// 信息
-	const form = ref({});
-	// 字典表
-	const typeList = ref([]);
-	const numberList = ref([]);
-	const durationList = ref([]);
-	onShow(async () => {
-		await searchOther();
-		await search();
-	})
-	// 查询其他信息
-	const searchOther = async () => {
-		let res;
-		// 类型
-		res = await $api(`dict/data/list`, 'GET', { dictType: 'sys_user_type' });
-		if (res.code === 200 && res.total > 0) typeList.value = res.rows
-		// 人数
-		res = await $api(`dict/data/list`, 'GET', { dictType: 'sys_match_number' });
-		if (res.code === 200 && res.total > 0) numberList.value = res.rows
-		// 时长
-		res = await $api(`dict/data/list`, 'GET', { dictType: 'sys_match_duration' });
-		if (res.code === 200 && res.total > 0) durationList.value = res.rows
-	};
-	// 查询
-	const search = async () => { };
+	const form = ref({ file: [] });
+	const listStyles = ref({
+		width: 64,
+		height: 64,
+		border: {
+			color: "#ff5a5f",
+			width: 2,
+			style: 'dashed',
+			radius: '2px'
+		}
+	});
+	const props = defineProps({
+		typeList: { type: Array, default: () => [] },
+		numberList: { type: Array, default: () => [] },
+		durationList: { type: Array, default: () => [] },
+	});
+	const { typeList, durationList, numberList } = toRefs(props);
 	// 类型选择
 	const typeChange = (e) => {
-		const data = typeList.value[e.detail.value]
-		if (data) form.value.type = data.dictLabel
-	};
-	// 人数选择
-	const numberChange = (e) => {
-		const data = numberList.value[e.detail.value]
-		if (data) form.value.number = data.dictLabel
+		let data
+		if (type.value == 0) {
+			data = typeList.value[e.detail.value]
+			if (data) form.value.type = data.dictLabel
+		} else {
+			data = activityList.value[e.detail.value]
+			if (data) form.value.type = data.dictLabel
+		}
 	};
 	// 时长选择选择
 	const durationChange = (e) => {
@@ -185,29 +173,27 @@
 		form.value.time = e.detail.value
 	};
 	// 上传图片
-	const Preview = () => {
-		uni.chooseImage({
-			count: 1,
-			sizeType: ['original', 'compressed'],
-			sourceType: ['album', 'camera'],
-			success: async function (res) {
-				let tempFile = JSON.parse(JSON.stringify(res.tempFilePaths));
-				const arr = await $apifile(`/common/upload`, 'file', tempFile[0],
-					'file');
-				if (arr.code == 200) {
-					form.value.logo = arr.url
-				} else {
-					uni.showToast({
-						title: arr.msg,
-						icon: 'none'
-					});
-				}
-			}
-		});
+	const toUpload = async (e) => {
+		const arr = await $apifile(`/common/upload`, 'file', e.tempFilePaths[0],
+			'file');
+		if (arr.code == 200) {
+			form.value.file.push({
+				newFileName: arr.newFileName,
+				originalFilename: arr.originalFilename,
+				url: arr.url
+			})
+			console.log(form.value.file);
+		} else {
+			uni.showToast({
+				title: arr.msg,
+				icon: 'none'
+			});
+		}
 	};
-	// 创建
-	const formSubmit = (e) => {
-		console.log(e.deatil.value);
+	// 删除图片
+	const toDelete = async (e) => {
+		form.value.file = form.value.file.filter(i => i.originalFilename != e.tempFile.name)
+		console.log(form.value.file);
 	};
 </script>
 <style lang="scss" scoped>
@@ -231,6 +217,7 @@
 
 			.title {
 				padding: 0 0 3vw 0;
+				border-bottom: 1px solid var(--footColor);
 			}
 		}
 

+ 33 - 3
pagesHome/create/index.vue

@@ -8,13 +8,13 @@
 						activeColor="#dd524d"></uni-segmented-control>
 					<view class="one_2">
 						<view v-show="current === 0">
-							<match></match>
+							<match :typeList="typeList" :numberList="numberList" :durationList='durationList'></match>
 						</view>
 						<view v-show="current === 1">
-							<activity></activity>
+							<activity :typeList="matchList" :durationList='durationList' type="0"></activity>
 						</view>
 						<view v-show="current === 2">
-							<activity></activity>
+							<activity :activityList="activityList" :durationList='durationList' type="1"></activity>
 						</view>
 					</view>
 				</view>
@@ -55,16 +55,42 @@
 	const id = ref('');
 	const list = ref(['友谊赛', '训练', '活动']);
 	const current = ref(0);
+	// 字典表
+	const typeList = ref([]);
+	const numberList = ref([]);
+	const matchList = ref([]);
+	const activityList = ref([]);
+	const durationList = ref([]);
 	onLoad(async (options) => {
 		// 球队id
 		id.value = options && options.id
 		await searchConfig();
+		await searchOther();
 		await search();
 	})
 	// config信息
 	const searchConfig = async () => {
 		config.value = uni.getStorageSync('config');
 	};
+	// 查询其他信息
+	const searchOther = async () => {
+		let res;
+		// 比赛类型
+		res = await $api(`dict/data/list`, 'GET', { dictType: 'sys_user_type' });
+		if (res.code === 200 && res.total > 0) typeList.value = res.rows
+		// 比赛人数
+		res = await $api(`dict/data/list`, 'GET', { dictType: 'sys_match_number' });
+		if (res.code === 200 && res.total > 0) numberList.value = res.rows
+		// 训练类型
+		res = await $api(`dict/data/list`, 'GET', { dictType: 'sys_train_type' });
+		if (res.code === 200 && res.total > 0) matchList.value = res.rows
+		// 活动类型
+		res = await $api(`dict/data/list`, 'GET', { dictType: 'sys_activity_type' });
+		if (res.code === 200 && res.total > 0) activityList.value = res.rows
+		// 时长
+		res = await $api(`dict/data/list`, 'GET', { dictType: 'sys_match_duration' });
+		if (res.code === 200 && res.total > 0) durationList.value = res.rows
+	};
 	// 查询
 	const search = async () => {
 		if (id.value) { }
@@ -81,6 +107,10 @@
 	const toCopy = async () => {
 		console.log('复用');
 	};
+	// 创建
+	const formSubmit = (e) => {
+		console.log(e.deatil.value);
+	};
 </script>
 <style lang="scss" scoped>
 	.content {

+ 1 - 1
pagesHome/team/info.vue

@@ -311,7 +311,7 @@
 					display: flex;
 					justify-content: space-between;
 					align-items: center;
-					padding: 4vw 2vw;
+					padding: 4vw;
 
 					.fraction {
 						display: flex;

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 3563 - 649
unpackage/dist/dev/mp-weixin/common/vendor.js


+ 100 - 60
unpackage/dist/dev/mp-weixin/pagesHome/create/components/activity.js

@@ -1,46 +1,49 @@
 "use strict";
 const common_vendor = require("../../../common/vendor.js");
+if (!Array) {
+  const _easycom_uni_file_picker2 = common_vendor.resolveComponent("uni-file-picker");
+  _easycom_uni_file_picker2();
+}
+const _easycom_uni_file_picker = () => "../../../uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.js";
+if (!Math) {
+  _easycom_uni_file_picker();
+}
 const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   __name: "activity",
+  props: {
+    type: { type: String, default: () => "0" },
+    typeList: { type: Array, default: () => [] },
+    activityList: { type: Array, default: () => [] },
+    durationList: { type: Array, default: () => [] }
+  },
   setup(__props) {
-    var _a, _b, _c;
-    const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
-    (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$config;
-    (_c = common_vendor.getCurrentInstance()) == null ? void 0 : _c.appContext.config.globalProperties.$apifile;
-    common_vendor.computed(() => {
-      return common_vendor.index.getStorageSync("openid");
+    var _a, _b;
+    const props = __props;
+    (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
+    const $apifile = (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$apifile;
+    const form = common_vendor.ref({ file: [] });
+    common_vendor.ref({
+      width: 64,
+      height: 64,
+      border: {
+        color: "#ff5a5f",
+        width: 2,
+        style: "dashed",
+        radius: "2px"
+      }
     });
-    const form = common_vendor.ref({});
-    const typeList = common_vendor.ref([]);
-    const numberList = common_vendor.ref([]);
-    const durationList = common_vendor.ref([]);
-    common_vendor.onShow(async () => {
-      await searchOther();
-      await search();
-    });
-    const searchOther = async () => {
-      let res;
-      res = await $api(`dict/data/list`, "GET", { dictType: "sys_user_type" });
-      if (res.code === 200 && res.total > 0)
-        typeList.value = res.rows;
-      res = await $api(`dict/data/list`, "GET", { dictType: "sys_match_number" });
-      if (res.code === 200 && res.total > 0)
-        numberList.value = res.rows;
-      res = await $api(`dict/data/list`, "GET", { dictType: "sys_match_duration" });
-      if (res.code === 200 && res.total > 0)
-        durationList.value = res.rows;
-    };
-    const search = async () => {
-    };
+    const { type, typeList, activityList, durationList } = common_vendor.toRefs(props);
     const typeChange = (e) => {
-      const data = typeList.value[e.detail.value];
-      if (data)
-        form.value.type = data.dictLabel;
-    };
-    const numberChange = (e) => {
-      const data = numberList.value[e.detail.value];
-      if (data)
-        form.value.number = data.dictLabel;
+      let data;
+      if (type.value == 0) {
+        data = typeList.value[e.detail.value];
+        if (data)
+          form.value.type = data.dictLabel;
+      } else {
+        data = activityList.value[e.detail.value];
+        if (data)
+          form.value.type = data.dictLabel;
+      }
     };
     const durationChange = (e) => {
       const data = durationList.value[e.detail.value];
@@ -53,43 +56,80 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     const timeChange = (e) => {
       form.value.time = e.detail.value;
     };
-    const formSubmit = (e) => {
-      console.log(e.deatil.value);
+    const toUpload = async (e) => {
+      const arr = await $apifile(
+        `/common/upload`,
+        "file",
+        e.tempFilePaths[0],
+        "file"
+      );
+      if (arr.code == 200) {
+        form.value.file.push({
+          newFileName: arr.newFileName,
+          originalFilename: arr.originalFilename,
+          url: arr.url
+        });
+        console.log(form.value.file);
+      } else {
+        common_vendor.index.showToast({
+          title: arr.msg,
+          icon: "none"
+        });
+      }
+    };
+    const toDelete = async (e) => {
+      form.value.file = form.value.file.filter((i) => i.originalFilename != e.tempFile.name);
+      console.log(form.value.file);
     };
     return (_ctx, _cache) => {
-      return {
-        a: common_vendor.t(form.value.type || "请选择类型"),
-        b: common_vendor.o(typeChange),
-        c: _ctx.index,
-        d: typeList.value,
-        e: common_vendor.t(form.value.number || "请选择人数"),
-        f: common_vendor.o(numberChange),
-        g: _ctx.index,
-        h: numberList.value,
-        i: form.value.name,
-        j: common_vendor.t(form.value.date || "请选择日期"),
+      return common_vendor.e({
+        a: common_vendor.unref(type) == "0"
+      }, common_vendor.unref(type) == "0" ? {
+        b: common_vendor.t(form.value.type || "普通训练"),
+        c: common_vendor.o(typeChange),
+        d: _ctx.index,
+        e: common_vendor.unref(typeList)
+      } : {
+        f: common_vendor.t(form.value.type || "请选择"),
+        g: common_vendor.o(typeChange),
+        h: _ctx.index,
+        i: common_vendor.unref(activityList)
+      }, {
+        j: common_vendor.t(form.value.date || "请选择"),
         k: common_vendor.o(dateChange),
         l: _ctx.index,
-        m: common_vendor.t(form.value.time || "请选择时间"),
+        m: common_vendor.t(form.value.time || "请选择"),
         n: common_vendor.o(timeChange),
         o: _ctx.index,
         p: common_vendor.t(form.value.duration || "请选择时长"),
         q: common_vendor.o(durationChange),
         r: _ctx.index,
-        s: durationList.value,
+        s: common_vendor.unref(durationList),
         t: form.value.address,
-        v: form.value.color,
-        w: form.value.money,
-        x: form.value.address,
+        v: form.value.money,
+        w: form.value.number,
+        x: form.value.sign,
         y: form.value.address,
-        z: form.value.address,
+        z: form.value.time,
         A: form.value.address,
         B: form.value.address,
-        C: form.value.address,
-        D: form.value.title,
-        E: form.value.brief,
-        F: common_vendor.o(formSubmit)
-      };
+        C: form.value.title,
+        D: form.value.brief,
+        E: common_vendor.o(toUpload),
+        F: common_vendor.o(toDelete),
+        G: common_vendor.o(($event) => form.value.file = $event),
+        H: common_vendor.p({
+          fileMediatype: "image",
+          ["list-styles"]: _ctx.imageStyles,
+          limit: "6",
+          title: "最多选择6张图片",
+          modelValue: form.value.file
+        }),
+        I: common_vendor.o(
+          //@ts-ignore
+          (...args) => _ctx.formSubmit && _ctx.formSubmit(...args)
+        )
+      });
     };
   }
 });

+ 3 - 1
unpackage/dist/dev/mp-weixin/pagesHome/create/components/activity.json

@@ -1,4 +1,6 @@
 {
   "component": true,
-  "usingComponents": {}
+  "usingComponents": {
+    "uni-file-picker": "../../../uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker"
+  }
 }

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/create/components/activity.wxml


+ 1 - 0
unpackage/dist/dev/mp-weixin/pagesHome/create/components/activity.wxss

@@ -18,6 +18,7 @@
 }
 .form .remark .title.data-v-b4c340fa {
   padding: 0 0 3vw 0;
+  border-bottom: 1px solid var(--footColor);
 }
 .form .value.data-v-b4c340fa {
   display: flex;

+ 83 - 43
unpackage/dist/dev/mp-weixin/pagesHome/create/components/match.js

@@ -1,46 +1,48 @@
 "use strict";
 const common_vendor = require("../../../common/vendor.js");
+if (!Array) {
+  const _easycom_uni_file_picker2 = common_vendor.resolveComponent("uni-file-picker");
+  _easycom_uni_file_picker2();
+}
+const _easycom_uni_file_picker = () => "../../../uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.js";
+if (!Math) {
+  _easycom_uni_file_picker();
+}
 const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   __name: "match",
+  props: {
+    typeList: { type: Array, default: () => [] },
+    numberList: { type: Array, default: () => [] },
+    durationList: { type: Array, default: () => [] }
+  },
   setup(__props) {
-    var _a, _b, _c;
-    const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
-    (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$config;
-    (_c = common_vendor.getCurrentInstance()) == null ? void 0 : _c.appContext.config.globalProperties.$apifile;
-    common_vendor.computed(() => {
-      return common_vendor.index.getStorageSync("openid");
+    var _a, _b;
+    const props = __props;
+    (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
+    const $apifile = (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$apifile;
+    const form = common_vendor.ref({ file: [] });
+    common_vendor.ref({
+      width: 64,
+      height: 64,
+      border: {
+        color: "#ff5a5f",
+        width: 2,
+        style: "dashed",
+        radius: "2px"
+      }
     });
-    const form = common_vendor.ref({});
-    const typeList = common_vendor.ref([]);
-    const numberList = common_vendor.ref([]);
-    const durationList = common_vendor.ref([]);
-    common_vendor.onShow(async () => {
-      await searchOther();
-      await search();
-    });
-    const searchOther = async () => {
-      let res;
-      res = await $api(`dict/data/list`, "GET", { dictType: "sys_user_type" });
-      if (res.code === 200 && res.total > 0)
-        typeList.value = res.rows;
-      res = await $api(`dict/data/list`, "GET", { dictType: "sys_match_number" });
-      if (res.code === 200 && res.total > 0)
-        numberList.value = res.rows;
-      res = await $api(`dict/data/list`, "GET", { dictType: "sys_match_duration" });
-      if (res.code === 200 && res.total > 0)
-        durationList.value = res.rows;
-    };
-    const search = async () => {
-    };
+    const { typeList, durationList, numberList } = common_vendor.toRefs(props);
     const typeChange = (e) => {
-      const data = typeList.value[e.detail.value];
-      if (data)
-        form.value.type = data.dictLabel;
-    };
-    const numberChange = (e) => {
-      const data = numberList.value[e.detail.value];
-      if (data)
-        form.value.number = data.dictLabel;
+      let data;
+      if (type.value == 0) {
+        data = typeList.value[e.detail.value];
+        if (data)
+          form.value.type = data.dictLabel;
+      } else {
+        data = activityList.value[e.detail.value];
+        if (data)
+          form.value.type = data.dictLabel;
+      }
     };
     const durationChange = (e) => {
       const data = durationList.value[e.detail.value];
@@ -53,19 +55,44 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     const timeChange = (e) => {
       form.value.time = e.detail.value;
     };
-    const formSubmit = (e) => {
-      console.log(e.deatil.value);
+    const toUpload = async (e) => {
+      const arr = await $apifile(
+        `/common/upload`,
+        "file",
+        e.tempFilePaths[0],
+        "file"
+      );
+      if (arr.code == 200) {
+        form.value.file.push({
+          newFileName: arr.newFileName,
+          originalFilename: arr.originalFilename,
+          url: arr.url
+        });
+        console.log(form.value.file);
+      } else {
+        common_vendor.index.showToast({
+          title: arr.msg,
+          icon: "none"
+        });
+      }
+    };
+    const toDelete = async (e) => {
+      form.value.file = form.value.file.filter((i) => i.originalFilename != e.tempFile.name);
+      console.log(form.value.file);
     };
     return (_ctx, _cache) => {
       return {
         a: common_vendor.t(form.value.type || "请选择类型"),
         b: common_vendor.o(typeChange),
         c: _ctx.index,
-        d: typeList.value,
+        d: common_vendor.unref(typeList),
         e: common_vendor.t(form.value.number || "请选择人数"),
-        f: common_vendor.o(numberChange),
+        f: common_vendor.o(
+          //@ts-ignore
+          (...args) => _ctx.numberChange && _ctx.numberChange(...args)
+        ),
         g: _ctx.index,
-        h: numberList.value,
+        h: common_vendor.unref(numberList),
         i: form.value.name,
         j: common_vendor.t(form.value.date || "请选择日期"),
         k: common_vendor.o(dateChange),
@@ -76,7 +103,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         p: common_vendor.t(form.value.duration || "请选择时长"),
         q: common_vendor.o(durationChange),
         r: _ctx.index,
-        s: durationList.value,
+        s: common_vendor.unref(durationList),
         t: form.value.address,
         v: form.value.color,
         w: form.value.money,
@@ -88,7 +115,20 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         C: form.value.address,
         D: form.value.title,
         E: form.value.brief,
-        F: common_vendor.o(formSubmit)
+        F: common_vendor.o(toUpload),
+        G: common_vendor.o(toDelete),
+        H: common_vendor.o(($event) => form.value.file = $event),
+        I: common_vendor.p({
+          fileMediatype: "image",
+          ["list-styles"]: _ctx.imageStyles,
+          limit: "6",
+          title: "最多选择6张图片",
+          modelValue: form.value.file
+        }),
+        J: common_vendor.o(
+          //@ts-ignore
+          (...args) => _ctx.formSubmit && _ctx.formSubmit(...args)
+        )
       };
     };
   }

+ 3 - 1
unpackage/dist/dev/mp-weixin/pagesHome/create/components/match.json

@@ -1,4 +1,6 @@
 {
   "component": true,
-  "usingComponents": {}
+  "usingComponents": {
+    "uni-file-picker": "../../../uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker"
+  }
 }

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/create/components/match.wxml


+ 1 - 0
unpackage/dist/dev/mp-weixin/pagesHome/create/components/match.wxss

@@ -18,6 +18,7 @@
 }
 .form .remark .title.data-v-6bad03e0 {
   padding: 0 0 3vw 0;
+  border-bottom: 1px solid var(--footColor);
 }
 .form .value.data-v-6bad03e0 {
   display: flex;

+ 46 - 7
unpackage/dist/dev/mp-weixin/pagesHome/create/index.js

@@ -16,19 +16,43 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   __name: "index",
   setup(__props) {
     var _a;
-    (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
+    const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
     const config = common_vendor.ref({});
     const id = common_vendor.ref("");
     const list = common_vendor.ref(["友谊赛", "训练", "活动"]);
     const current = common_vendor.ref(0);
+    const typeList = common_vendor.ref([]);
+    const numberList = common_vendor.ref([]);
+    const matchList = common_vendor.ref([]);
+    const activityList = common_vendor.ref([]);
+    const durationList = common_vendor.ref([]);
     common_vendor.onLoad(async (options) => {
       id.value = options && options.id;
       await searchConfig();
+      await searchOther();
       await search();
     });
     const searchConfig = async () => {
       config.value = common_vendor.index.getStorageSync("config");
     };
+    const searchOther = async () => {
+      let res;
+      res = await $api(`dict/data/list`, "GET", { dictType: "sys_user_type" });
+      if (res.code === 200 && res.total > 0)
+        typeList.value = res.rows;
+      res = await $api(`dict/data/list`, "GET", { dictType: "sys_match_number" });
+      if (res.code === 200 && res.total > 0)
+        numberList.value = res.rows;
+      res = await $api(`dict/data/list`, "GET", { dictType: "sys_train_type" });
+      if (res.code === 200 && res.total > 0)
+        matchList.value = res.rows;
+      res = await $api(`dict/data/list`, "GET", { dictType: "sys_activity_type" });
+      if (res.code === 200 && res.total > 0)
+        activityList.value = res.rows;
+      res = await $api(`dict/data/list`, "GET", { dictType: "sys_match_duration" });
+      if (res.code === 200 && res.total > 0)
+        durationList.value = res.rows;
+    };
     const search = async () => {
       if (id.value)
         ;
@@ -52,18 +76,33 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
           styleType: "text",
           activeColor: "#dd524d"
         }),
-        c: current.value === 0,
-        d: current.value === 1,
-        e: current.value === 2,
-        f: common_vendor.o(toAdd),
+        c: common_vendor.p({
+          typeList: typeList.value,
+          numberList: numberList.value,
+          durationList: durationList.value
+        }),
+        d: current.value === 0,
+        e: common_vendor.p({
+          typeList: matchList.value,
+          durationList: durationList.value,
+          type: "0"
+        }),
+        f: current.value === 1,
         g: common_vendor.p({
+          activityList: activityList.value,
+          durationList: durationList.value,
+          type: "1"
+        }),
+        h: current.value === 2,
+        i: common_vendor.o(toAdd),
+        j: common_vendor.p({
           ["custom-prefix"]: "iconfont",
           type: "icon-caogao04",
           size: "20",
           color: "#696969"
         }),
-        h: common_vendor.o(toCopy),
-        i: common_vendor.p({
+        k: common_vendor.o(toCopy),
+        l: common_vendor.p({
           ["custom-prefix"]: "iconfont",
           type: "icon-icon_cz",
           size: "20",

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/create/index.wxml


+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/team/info.wxss

@@ -105,7 +105,7 @@
   display: flex;
   justify-content: space-between;
   align-items: center;
-  padding: 4vw 2vw;
+  padding: 4vw;
 }
 .content .position .thr .thr_2 .fraction.data-v-b14ffc51 {
   display: flex;

+ 200 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js

@@ -0,0 +1,200 @@
+"use strict";
+const common_vendor = require("../../../../common/vendor.js");
+const ERR_MSG_OK = "chooseAndUploadFile:ok";
+const ERR_MSG_FAIL = "chooseAndUploadFile:fail";
+function chooseImage(opts) {
+  const {
+    count,
+    sizeType = ["original", "compressed"],
+    sourceType,
+    extension
+  } = opts;
+  return new Promise((resolve, reject) => {
+    common_vendor.index.chooseImage({
+      count,
+      sizeType,
+      sourceType,
+      extension,
+      success(res) {
+        resolve(normalizeChooseAndUploadFileRes(res, "image"));
+      },
+      fail(res) {
+        reject({
+          errMsg: res.errMsg.replace("chooseImage:fail", ERR_MSG_FAIL)
+        });
+      }
+    });
+  });
+}
+function chooseVideo(opts) {
+  const {
+    camera,
+    compressed,
+    maxDuration,
+    sourceType,
+    extension
+  } = opts;
+  return new Promise((resolve, reject) => {
+    common_vendor.index.chooseVideo({
+      camera,
+      compressed,
+      maxDuration,
+      sourceType,
+      extension,
+      success(res) {
+        const {
+          tempFilePath,
+          duration,
+          size,
+          height,
+          width
+        } = res;
+        resolve(normalizeChooseAndUploadFileRes({
+          errMsg: "chooseVideo:ok",
+          tempFilePaths: [tempFilePath],
+          tempFiles: [
+            {
+              name: res.tempFile && res.tempFile.name || "",
+              path: tempFilePath,
+              size,
+              type: res.tempFile && res.tempFile.type || "",
+              width,
+              height,
+              duration,
+              fileType: "video",
+              cloudPath: ""
+            }
+          ]
+        }, "video"));
+      },
+      fail(res) {
+        reject({
+          errMsg: res.errMsg.replace("chooseVideo:fail", ERR_MSG_FAIL)
+        });
+      }
+    });
+  });
+}
+function chooseAll(opts) {
+  const {
+    count,
+    extension
+  } = opts;
+  return new Promise((resolve, reject) => {
+    let chooseFile = common_vendor.index.chooseFile;
+    if (typeof common_vendor.wx$1 !== "undefined" && typeof common_vendor.wx$1.chooseMessageFile === "function") {
+      chooseFile = common_vendor.wx$1.chooseMessageFile;
+    }
+    if (typeof chooseFile !== "function") {
+      return reject({
+        errMsg: ERR_MSG_FAIL + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
+      });
+    }
+    chooseFile({
+      type: "all",
+      count,
+      extension,
+      success(res) {
+        resolve(normalizeChooseAndUploadFileRes(res));
+      },
+      fail(res) {
+        reject({
+          errMsg: res.errMsg.replace("chooseFile:fail", ERR_MSG_FAIL)
+        });
+      }
+    });
+  });
+}
+function normalizeChooseAndUploadFileRes(res, fileType) {
+  res.tempFiles.forEach((item, index) => {
+    if (!item.name) {
+      item.name = item.path.substring(item.path.lastIndexOf("/") + 1);
+    }
+    if (fileType) {
+      item.fileType = fileType;
+    }
+    item.cloudPath = Date.now() + "_" + index + item.name.substring(item.name.lastIndexOf("."));
+  });
+  if (!res.tempFilePaths) {
+    res.tempFilePaths = res.tempFiles.map((file) => file.path);
+  }
+  return res;
+}
+function uploadCloudFiles(files, max = 5, onUploadProgress) {
+  files = JSON.parse(JSON.stringify(files));
+  const len = files.length;
+  let count = 0;
+  let self = this;
+  return new Promise((resolve) => {
+    while (count < max) {
+      next();
+    }
+    function next() {
+      let cur = count++;
+      if (cur >= len) {
+        !files.find((item) => !item.url && !item.errMsg) && resolve(files);
+        return;
+      }
+      const fileItem = files[cur];
+      const index = self.files.findIndex((v) => v.uuid === fileItem.uuid);
+      fileItem.url = "";
+      delete fileItem.errMsg;
+      common_vendor.Ds.uploadFile({
+        filePath: fileItem.path,
+        cloudPath: fileItem.cloudPath,
+        fileType: fileItem.fileType,
+        onUploadProgress: (res) => {
+          res.index = index;
+          onUploadProgress && onUploadProgress(res);
+        }
+      }).then((res) => {
+        fileItem.url = res.fileID;
+        fileItem.index = index;
+        if (cur < len) {
+          next();
+        }
+      }).catch((res) => {
+        fileItem.errMsg = res.errMsg || res.message;
+        fileItem.index = index;
+        if (cur < len) {
+          next();
+        }
+      });
+    }
+  });
+}
+function uploadFiles(choosePromise, {
+  onChooseFile,
+  onUploadProgress
+}) {
+  return choosePromise.then((res) => {
+    if (onChooseFile) {
+      const customChooseRes = onChooseFile(res);
+      if (typeof customChooseRes !== "undefined") {
+        return Promise.resolve(customChooseRes).then((chooseRes) => typeof chooseRes === "undefined" ? res : chooseRes);
+      }
+    }
+    return res;
+  }).then((res) => {
+    if (res === false) {
+      return {
+        errMsg: ERR_MSG_OK,
+        tempFilePaths: [],
+        tempFiles: []
+      };
+    }
+    return res;
+  });
+}
+function chooseAndUploadFile(opts = {
+  type: "all"
+}) {
+  if (opts.type === "image") {
+    return uploadFiles(chooseImage(opts), opts);
+  } else if (opts.type === "video") {
+    return uploadFiles(chooseVideo(opts), opts);
+  }
+  return uploadFiles(chooseAll(opts), opts);
+}
+exports.chooseAndUploadFile = chooseAndUploadFile;
+exports.uploadCloudFiles = uploadCloudFiles;

+ 531 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.js

@@ -0,0 +1,531 @@
+"use strict";
+const common_vendor = require("../../../../common/vendor.js");
+const uni_modules_uniFilePicker_components_uniFilePicker_chooseAndUploadFile = require("./choose-and-upload-file.js");
+const uni_modules_uniFilePicker_components_uniFilePicker_utils = require("./utils.js");
+const uploadImage = () => "./upload-image.js";
+const uploadFile = () => "./upload-file.js";
+const _sfc_main = {
+  name: "uniFilePicker",
+  components: {
+    uploadImage,
+    uploadFile
+  },
+  options: {
+    virtualHost: true
+  },
+  emits: ["select", "success", "fail", "progress", "delete", "update:modelValue", "input"],
+  props: {
+    modelValue: {
+      type: [Array, Object],
+      default() {
+        return [];
+      }
+    },
+    disabled: {
+      type: Boolean,
+      default: false
+    },
+    disablePreview: {
+      type: Boolean,
+      default: false
+    },
+    delIcon: {
+      type: Boolean,
+      default: true
+    },
+    // 自动上传
+    autoUpload: {
+      type: Boolean,
+      default: true
+    },
+    // 最大选择个数 ,h5只能限制单选或是多选
+    limit: {
+      type: [Number, String],
+      default: 9
+    },
+    // 列表样式 grid | list | list-card
+    mode: {
+      type: String,
+      default: "grid"
+    },
+    // 选择文件类型  image/video/all
+    fileMediatype: {
+      type: String,
+      default: "image"
+    },
+    // 文件类型筛选
+    fileExtname: {
+      type: [Array, String],
+      default() {
+        return [];
+      }
+    },
+    title: {
+      type: String,
+      default: ""
+    },
+    listStyles: {
+      type: Object,
+      default() {
+        return {
+          // 是否显示边框
+          border: true,
+          // 是否显示分隔线
+          dividline: true,
+          // 线条样式
+          borderStyle: {}
+        };
+      }
+    },
+    imageStyles: {
+      type: Object,
+      default() {
+        return {
+          width: "auto",
+          height: "auto"
+        };
+      }
+    },
+    readonly: {
+      type: Boolean,
+      default: false
+    },
+    returnType: {
+      type: String,
+      default: "array"
+    },
+    sizeType: {
+      type: Array,
+      default() {
+        return ["original", "compressed"];
+      }
+    },
+    sourceType: {
+      type: Array,
+      default() {
+        return ["album", "camera"];
+      }
+    }
+  },
+  data() {
+    return {
+      files: [],
+      localValue: []
+    };
+  },
+  watch: {
+    modelValue: {
+      handler(newVal, oldVal) {
+        this.setValue(newVal, oldVal);
+      },
+      immediate: true
+    }
+  },
+  computed: {
+    filesList() {
+      let files = [];
+      this.files.forEach((v) => {
+        files.push(v);
+      });
+      return files;
+    },
+    showType() {
+      if (this.fileMediatype === "image") {
+        return this.mode;
+      }
+      return "list";
+    },
+    limitLength() {
+      if (this.returnType === "object") {
+        return 1;
+      }
+      if (!this.limit) {
+        return 1;
+      }
+      if (this.limit >= 9) {
+        return 9;
+      }
+      return this.limit;
+    }
+  },
+  created() {
+    if (!(common_vendor.Ds.config && common_vendor.Ds.config.provider)) {
+      this.noSpace = true;
+      common_vendor.Ds.chooseAndUploadFile = uni_modules_uniFilePicker_components_uniFilePicker_chooseAndUploadFile.chooseAndUploadFile;
+    }
+    this.form = this.getForm("uniForms");
+    this.formItem = this.getForm("uniFormsItem");
+    if (this.form && this.formItem) {
+      if (this.formItem.name) {
+        this.rename = this.formItem.name;
+        this.form.inputChildrens.push(this);
+      }
+    }
+  },
+  methods: {
+    /**
+     * 公开用户使用,清空文件
+     * @param {Object} index
+     */
+    clearFiles(index) {
+      if (index !== 0 && !index) {
+        this.files = [];
+        this.$nextTick(() => {
+          this.setEmit();
+        });
+      } else {
+        this.files.splice(index, 1);
+      }
+      this.$nextTick(() => {
+        this.setEmit();
+      });
+    },
+    /**
+     * 公开用户使用,继续上传
+     */
+    upload() {
+      let files = [];
+      this.files.forEach((v, index) => {
+        if (v.status === "ready" || v.status === "error") {
+          files.push(Object.assign({}, v));
+        }
+      });
+      return this.uploadFiles(files);
+    },
+    async setValue(newVal, oldVal) {
+      const newData = async (v) => {
+        const reg = /cloud:\/\/([\w.]+\/?)\S*/;
+        let url = "";
+        if (v.fileID) {
+          url = v.fileID;
+        } else {
+          url = v.url;
+        }
+        if (reg.test(url)) {
+          v.fileID = url;
+          v.url = await this.getTempFileURL(url);
+        }
+        if (v.url)
+          v.path = v.url;
+        return v;
+      };
+      if (this.returnType === "object") {
+        if (newVal) {
+          await newData(newVal);
+        } else {
+          newVal = {};
+        }
+      } else {
+        if (!newVal)
+          newVal = [];
+        for (let i = 0; i < newVal.length; i++) {
+          let v = newVal[i];
+          await newData(v);
+        }
+      }
+      this.localValue = newVal;
+      if (this.form && this.formItem && !this.is_reset) {
+        this.is_reset = false;
+        this.formItem.setValue(this.localValue);
+      }
+      let filesData = Object.keys(newVal).length > 0 ? newVal : [];
+      this.files = [].concat(filesData);
+    },
+    /**
+     * 选择文件
+     */
+    choose() {
+      if (this.disabled)
+        return;
+      if (this.files.length >= Number(this.limitLength) && this.showType !== "grid" && this.returnType === "array") {
+        common_vendor.index.showToast({
+          title: `您最多选择 ${this.limitLength} 个文件`,
+          icon: "none"
+        });
+        return;
+      }
+      this.chooseFiles();
+    },
+    /**
+     * 选择文件并上传
+     */
+    chooseFiles() {
+      const _extname = uni_modules_uniFilePicker_components_uniFilePicker_utils.get_extname(this.fileExtname);
+      common_vendor.Ds.chooseAndUploadFile({
+        type: this.fileMediatype,
+        compressed: false,
+        sizeType: this.sizeType,
+        sourceType: this.sourceType,
+        // TODO 如果为空,video 有问题
+        extension: _extname.length > 0 ? _extname : void 0,
+        count: this.limitLength - this.files.length,
+        //默认9
+        onChooseFile: this.chooseFileCallback,
+        onUploadProgress: (progressEvent) => {
+          this.setProgress(progressEvent, progressEvent.index);
+        }
+      }).then((result) => {
+        this.setSuccessAndError(result.tempFiles);
+      }).catch((err) => {
+        console.log("选择失败", err);
+      });
+    },
+    /**
+     * 选择文件回调
+     * @param {Object} res
+     */
+    async chooseFileCallback(res) {
+      const _extname = uni_modules_uniFilePicker_components_uniFilePicker_utils.get_extname(this.fileExtname);
+      const is_one = Number(this.limitLength) === 1 && this.disablePreview && !this.disabled || this.returnType === "object";
+      if (is_one) {
+        this.files = [];
+      }
+      let {
+        filePaths,
+        files
+      } = uni_modules_uniFilePicker_components_uniFilePicker_utils.get_files_and_is_max(res, _extname);
+      if (!(_extname && _extname.length > 0)) {
+        filePaths = res.tempFilePaths;
+        files = res.tempFiles;
+      }
+      let currentData = [];
+      for (let i = 0; i < files.length; i++) {
+        if (this.limitLength - this.files.length <= 0)
+          break;
+        files[i].uuid = Date.now();
+        let filedata = await uni_modules_uniFilePicker_components_uniFilePicker_utils.get_file_data(files[i], this.fileMediatype);
+        filedata.progress = 0;
+        filedata.status = "ready";
+        this.files.push(filedata);
+        currentData.push({
+          ...filedata,
+          file: files[i]
+        });
+      }
+      this.$emit("select", {
+        tempFiles: currentData,
+        tempFilePaths: filePaths
+      });
+      res.tempFiles = files;
+      if (!this.autoUpload || this.noSpace) {
+        res.tempFiles = [];
+      }
+    },
+    /**
+     * 批传
+     * @param {Object} e
+     */
+    uploadFiles(files) {
+      files = [].concat(files);
+      return uni_modules_uniFilePicker_components_uniFilePicker_chooseAndUploadFile.uploadCloudFiles.call(this, files, 5, (res) => {
+        this.setProgress(res, res.index, true);
+      }).then((result) => {
+        this.setSuccessAndError(result);
+        return result;
+      }).catch((err) => {
+        console.log(err);
+      });
+    },
+    /**
+     * 成功或失败
+     */
+    async setSuccessAndError(res, fn) {
+      let successData = [];
+      let errorData = [];
+      let tempFilePath = [];
+      let errorTempFilePath = [];
+      for (let i = 0; i < res.length; i++) {
+        const item = res[i];
+        const index = item.uuid ? this.files.findIndex((p) => p.uuid === item.uuid) : item.index;
+        if (index === -1 || !this.files)
+          break;
+        if (item.errMsg === "request:fail") {
+          this.files[index].url = item.path;
+          this.files[index].status = "error";
+          this.files[index].errMsg = item.errMsg;
+          errorData.push(this.files[index]);
+          errorTempFilePath.push(this.files[index].url);
+        } else {
+          this.files[index].errMsg = "";
+          this.files[index].fileID = item.url;
+          const reg = /cloud:\/\/([\w.]+\/?)\S*/;
+          if (reg.test(item.url)) {
+            this.files[index].url = await this.getTempFileURL(item.url);
+          } else {
+            this.files[index].url = item.url;
+          }
+          this.files[index].status = "success";
+          this.files[index].progress += 1;
+          successData.push(this.files[index]);
+          tempFilePath.push(this.files[index].fileID);
+        }
+      }
+      if (successData.length > 0) {
+        this.setEmit();
+        this.$emit("success", {
+          tempFiles: this.backObject(successData),
+          tempFilePaths: tempFilePath
+        });
+      }
+      if (errorData.length > 0) {
+        this.$emit("fail", {
+          tempFiles: this.backObject(errorData),
+          tempFilePaths: errorTempFilePath
+        });
+      }
+    },
+    /**
+     * 获取进度
+     * @param {Object} progressEvent
+     * @param {Object} index
+     * @param {Object} type
+     */
+    setProgress(progressEvent, index, type) {
+      this.files.length;
+      const percentCompleted = Math.round(progressEvent.loaded * 100 / progressEvent.total);
+      let idx = index;
+      if (!type) {
+        idx = this.files.findIndex((p) => p.uuid === progressEvent.tempFile.uuid);
+      }
+      if (idx === -1 || !this.files[idx])
+        return;
+      this.files[idx].progress = percentCompleted - 1;
+      this.$emit("progress", {
+        index: idx,
+        progress: parseInt(percentCompleted),
+        tempFile: this.files[idx]
+      });
+    },
+    /**
+     * 删除文件
+     * @param {Object} index
+     */
+    delFile(index) {
+      this.$emit("delete", {
+        tempFile: this.files[index],
+        tempFilePath: this.files[index].url
+      });
+      this.files.splice(index, 1);
+      this.$nextTick(() => {
+        this.setEmit();
+      });
+    },
+    /**
+     * 获取文件名和后缀
+     * @param {Object} name
+     */
+    getFileExt(name) {
+      const last_len = name.lastIndexOf(".");
+      const len = name.length;
+      return {
+        name: name.substring(0, last_len),
+        ext: name.substring(last_len + 1, len)
+      };
+    },
+    /**
+     * 处理返回事件
+     */
+    setEmit() {
+      let data = [];
+      if (this.returnType === "object") {
+        data = this.backObject(this.files)[0];
+        this.localValue = data ? data : null;
+      } else {
+        data = this.backObject(this.files);
+        if (!this.localValue) {
+          this.localValue = [];
+        }
+        this.localValue = [...data];
+      }
+      this.$emit("update:modelValue", this.localValue);
+    },
+    /**
+     * 处理返回参数
+     * @param {Object} files
+     */
+    backObject(files) {
+      let newFilesData = [];
+      files.forEach((v) => {
+        newFilesData.push({
+          extname: v.extname,
+          fileType: v.fileType,
+          image: v.image,
+          name: v.name,
+          path: v.path,
+          size: v.size,
+          fileID: v.fileID,
+          url: v.url,
+          // 修改删除一个文件后不能再上传的bug, #694
+          uuid: v.uuid,
+          status: v.status,
+          cloudPath: v.cloudPath
+        });
+      });
+      return newFilesData;
+    },
+    async getTempFileURL(fileList) {
+      fileList = {
+        fileList: [].concat(fileList)
+      };
+      const urls = await common_vendor.Ds.getTempFileURL(fileList);
+      return urls.fileList[0].tempFileURL || "";
+    },
+    /**
+     * 获取父元素实例
+     */
+    getForm(name = "uniForms") {
+      let parent = this.$parent;
+      let parentName = parent.$options.name;
+      while (parentName !== name) {
+        parent = parent.$parent;
+        if (!parent)
+          return false;
+        parentName = parent.$options.name;
+      }
+      return parent;
+    }
+  }
+};
+if (!Array) {
+  const _component_upload_image = common_vendor.resolveComponent("upload-image");
+  const _component_upload_file = common_vendor.resolveComponent("upload-file");
+  (_component_upload_image + _component_upload_file)();
+}
+function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
+  return common_vendor.e({
+    a: $props.title
+  }, $props.title ? {
+    b: common_vendor.t($props.title),
+    c: common_vendor.t($options.filesList.length),
+    d: common_vendor.t($options.limitLength)
+  } : {}, {
+    e: $props.fileMediatype === "image" && $options.showType === "grid"
+  }, $props.fileMediatype === "image" && $options.showType === "grid" ? {
+    f: common_vendor.o($options.uploadFiles),
+    g: common_vendor.o($options.choose),
+    h: common_vendor.o($options.delFile),
+    i: common_vendor.p({
+      readonly: $props.readonly,
+      ["image-styles"]: $props.imageStyles,
+      ["files-list"]: $options.filesList,
+      limit: $options.limitLength,
+      disablePreview: $props.disablePreview,
+      delIcon: $props.delIcon
+    })
+  } : {}, {
+    j: $props.fileMediatype !== "image" || $options.showType !== "grid"
+  }, $props.fileMediatype !== "image" || $options.showType !== "grid" ? {
+    k: common_vendor.o($options.uploadFiles),
+    l: common_vendor.o($options.choose),
+    m: common_vendor.o($options.delFile),
+    n: common_vendor.p({
+      readonly: $props.readonly,
+      ["list-styles"]: $props.listStyles,
+      ["files-list"]: $options.filesList,
+      showType: $options.showType,
+      delIcon: $props.delIcon
+    })
+  } : {});
+}
+const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/project/足球比赛/match_applet/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue"]]);
+wx.createComponent(Component);

+ 7 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.json

@@ -0,0 +1,7 @@
+{
+  "component": true,
+  "usingComponents": {
+    "upload-image": "./upload-image",
+    "upload-file": "./upload-file"
+  }
+}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.wxml


+ 42 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.wxss

@@ -0,0 +1,42 @@
+
+.uni-file-picker {
+
+		box-sizing: border-box;
+		overflow: hidden;
+		width: 100%;
+
+		flex: 1;
+}
+.uni-file-picker__header {
+		padding-top: 5px;
+		padding-bottom: 10px;
+
+		display: flex;
+
+		justify-content: space-between;
+}
+.file-title {
+		font-size: 14px;
+		color: #333;
+}
+.file-count {
+		font-size: 14px;
+		color: #999;
+}
+.is-add {
+
+		display: flex;
+
+		align-items: center;
+		justify-content: center;
+}
+.icon-add {
+		width: 50px;
+		height: 5px;
+		background-color: #f1f1f1;
+		border-radius: 2px;
+}
+.rotate {
+		position: absolute;
+		transform: rotate(90deg);
+}

+ 172 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.js

@@ -0,0 +1,172 @@
+"use strict";
+const common_vendor = require("../../../../common/vendor.js");
+const _sfc_main = {
+  name: "uploadFile",
+  emits: ["uploadFiles", "choose", "delFile"],
+  props: {
+    filesList: {
+      type: Array,
+      default() {
+        return [];
+      }
+    },
+    delIcon: {
+      type: Boolean,
+      default: true
+    },
+    limit: {
+      type: [Number, String],
+      default: 9
+    },
+    showType: {
+      type: String,
+      default: ""
+    },
+    listStyles: {
+      type: Object,
+      default() {
+        return {
+          // 是否显示边框
+          border: true,
+          // 是否显示分隔线
+          dividline: true,
+          // 线条样式
+          borderStyle: {}
+        };
+      }
+    },
+    readonly: {
+      type: Boolean,
+      default: false
+    }
+  },
+  computed: {
+    list() {
+      let files = [];
+      this.filesList.forEach((v) => {
+        files.push(v);
+      });
+      return files;
+    },
+    styles() {
+      let styles = {
+        border: true,
+        dividline: true,
+        "border-style": {}
+      };
+      return Object.assign(styles, this.listStyles);
+    },
+    borderStyle() {
+      let {
+        borderStyle,
+        border
+      } = this.styles;
+      let obj = {};
+      if (!border) {
+        obj.border = "none";
+      } else {
+        let width = borderStyle && borderStyle.width || 1;
+        width = this.value2px(width);
+        let radius = borderStyle && borderStyle.radius || 5;
+        radius = this.value2px(radius);
+        obj = {
+          "border-width": width,
+          "border-style": borderStyle && borderStyle.style || "solid",
+          "border-color": borderStyle && borderStyle.color || "#eee",
+          "border-radius": radius
+        };
+      }
+      let classles = "";
+      for (let i in obj) {
+        classles += `${i}:${obj[i]};`;
+      }
+      return classles;
+    },
+    borderLineStyle() {
+      let obj = {};
+      let {
+        borderStyle
+      } = this.styles;
+      if (borderStyle && borderStyle.color) {
+        obj["border-color"] = borderStyle.color;
+      }
+      if (borderStyle && borderStyle.width) {
+        let width = borderStyle && borderStyle.width || 1;
+        let style = borderStyle && borderStyle.style || 0;
+        if (typeof width === "number") {
+          width += "px";
+        } else {
+          width = width.indexOf("px") ? width : width + "px";
+        }
+        obj["border-width"] = width;
+        if (typeof style === "number") {
+          style += "px";
+        } else {
+          style = style.indexOf("px") ? style : style + "px";
+        }
+        obj["border-top-style"] = style;
+      }
+      let classles = "";
+      for (let i in obj) {
+        classles += `${i}:${obj[i]};`;
+      }
+      return classles;
+    }
+  },
+  methods: {
+    uploadFiles(item, index) {
+      this.$emit("uploadFiles", {
+        item,
+        index
+      });
+    },
+    choose() {
+      this.$emit("choose");
+    },
+    delFile(index) {
+      this.$emit("delFile", index);
+    },
+    value2px(value) {
+      if (typeof value === "number") {
+        value += "px";
+      } else {
+        value = value.indexOf("px") !== -1 ? value : value + "px";
+      }
+      return value;
+    }
+  }
+};
+function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
+  return common_vendor.e({
+    a: !$props.readonly
+  }, !$props.readonly ? {
+    b: common_vendor.o((...args) => $options.choose && $options.choose(...args))
+  } : {}, {
+    c: $options.list.length > 0
+  }, $options.list.length > 0 ? {
+    d: common_vendor.f($options.list, (item, index, i0) => {
+      return common_vendor.e({
+        a: common_vendor.t(item.name)
+      }, $props.delIcon && !$props.readonly ? {
+        b: common_vendor.o(($event) => $options.delFile(index), index)
+      } : {}, {
+        c: item.progress && item.progress !== 100 || item.progress === 0
+      }, item.progress && item.progress !== 100 || item.progress === 0 ? {
+        d: item.progress === -1 ? 0 : item.progress,
+        e: item.errMsg ? "#ff5a5f" : "#EBEBEB"
+      } : {}, {
+        f: item.status === "error"
+      }, item.status === "error" ? {
+        g: common_vendor.o(($event) => $options.uploadFiles(item, index), index)
+      } : {}, {
+        h: index,
+        i: index !== 0 && $options.styles.dividline ? 1 : "",
+        j: common_vendor.s(index !== 0 && $options.styles.dividline && $options.borderLineStyle)
+      });
+    }),
+    e: $props.delIcon && !$props.readonly,
+    f: common_vendor.s($options.borderStyle)
+  } : {});
+}
+const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/project/足球比赛/match_applet/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue"]]);
+wx.createComponent(Component);

+ 4 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.wxml


+ 98 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.wxss

@@ -0,0 +1,98 @@
+/* 水平间距 */
+/* 水平间距 */
+.uni-file-picker__files {
+  display: flex;
+  flex-direction: column;
+  justify-content: flex-start;
+}
+.uni-file-picker__lists {
+  position: relative;
+  margin-top: 5px;
+  overflow: hidden;
+}
+.file-picker__mask {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  position: absolute;
+  right: 0;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  color: #fff;
+  font-size: 14px;
+  background-color: rgba(0, 0, 0, 0.4);
+}
+.uni-file-picker__lists-box {
+  position: relative;
+}
+.uni-file-picker__item {
+  display: flex;
+  align-items: center;
+  padding: 8px 10px;
+  padding-right: 5px;
+  padding-left: 10px;
+}
+.files-border {
+  border-top: 1px #eee solid;
+}
+.files__name {
+  flex: 1;
+  font-size: 14px;
+  color: #666;
+  margin-right: 25px;
+  word-break: break-all;
+  word-wrap: break-word;
+}
+.icon-files {
+  position: static;
+  background-color: initial;
+}
+.is-list-card {
+  border: 1px #eee solid;
+  margin-bottom: 5px;
+  border-radius: 5px;
+  box-shadow: 0 0 2px 0px rgba(0, 0, 0, 0.1);
+  padding: 5px;
+}
+.files__image {
+  width: 40px;
+  height: 40px;
+  margin-right: 10px;
+}
+.header-image {
+  width: 100%;
+  height: 100%;
+}
+.is-text-box {
+  border: 1px #eee solid;
+  border-radius: 5px;
+}
+.is-text-image {
+  width: 25px;
+  height: 25px;
+  margin-left: 5px;
+}
+.rotate {
+  position: absolute;
+  transform: rotate(90deg);
+}
+.icon-del-box {
+  display: flex;
+  margin: auto 0;
+  align-items: center;
+  justify-content: center;
+  position: absolute;
+  top: 0px;
+  bottom: 0;
+  right: 5px;
+  height: 26px;
+  width: 26px;
+  z-index: 2;
+  transform: rotate(-45deg);
+}
+.icon-del {
+  width: 15px;
+  height: 1px;
+  background-color: #333;
+}

+ 182 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.js

@@ -0,0 +1,182 @@
+"use strict";
+const common_vendor = require("../../../../common/vendor.js");
+const _sfc_main = {
+  name: "uploadImage",
+  emits: ["uploadFiles", "choose", "delFile"],
+  props: {
+    filesList: {
+      type: Array,
+      default() {
+        return [];
+      }
+    },
+    disabled: {
+      type: Boolean,
+      default: false
+    },
+    disablePreview: {
+      type: Boolean,
+      default: false
+    },
+    limit: {
+      type: [Number, String],
+      default: 9
+    },
+    imageStyles: {
+      type: Object,
+      default() {
+        return {
+          width: "auto",
+          height: "auto",
+          border: {}
+        };
+      }
+    },
+    delIcon: {
+      type: Boolean,
+      default: true
+    },
+    readonly: {
+      type: Boolean,
+      default: false
+    }
+  },
+  computed: {
+    styles() {
+      let styles = {
+        width: "auto",
+        height: "auto",
+        border: {}
+      };
+      return Object.assign(styles, this.imageStyles);
+    },
+    boxStyle() {
+      const {
+        width = "auto",
+        height = "auto"
+      } = this.styles;
+      let obj = {};
+      if (height === "auto") {
+        if (width !== "auto") {
+          obj.height = this.value2px(width);
+          obj["padding-top"] = 0;
+        } else {
+          obj.height = 0;
+        }
+      } else {
+        obj.height = this.value2px(height);
+        obj["padding-top"] = 0;
+      }
+      if (width === "auto") {
+        if (height !== "auto") {
+          obj.width = this.value2px(height);
+        } else {
+          obj.width = "33.3%";
+        }
+      } else {
+        obj.width = this.value2px(width);
+      }
+      let classles = "";
+      for (let i in obj) {
+        classles += `${i}:${obj[i]};`;
+      }
+      return classles;
+    },
+    borderStyle() {
+      let {
+        border
+      } = this.styles;
+      let obj = {};
+      const widthDefaultValue = 1;
+      const radiusDefaultValue = 3;
+      if (typeof border === "boolean") {
+        obj.border = border ? "1px #eee solid" : "none";
+      } else {
+        let width = border && border.width || widthDefaultValue;
+        width = this.value2px(width);
+        let radius = border && border.radius || radiusDefaultValue;
+        radius = this.value2px(radius);
+        obj = {
+          "border-width": width,
+          "border-style": border && border.style || "solid",
+          "border-color": border && border.color || "#eee",
+          "border-radius": radius
+        };
+      }
+      let classles = "";
+      for (let i in obj) {
+        classles += `${i}:${obj[i]};`;
+      }
+      return classles;
+    }
+  },
+  methods: {
+    uploadFiles(item, index) {
+      this.$emit("uploadFiles", item);
+    },
+    choose() {
+      this.$emit("choose");
+    },
+    delFile(index) {
+      this.$emit("delFile", index);
+    },
+    prviewImage(img, index) {
+      let urls = [];
+      if (Number(this.limit) === 1 && this.disablePreview && !this.disabled) {
+        this.$emit("choose");
+      }
+      if (this.disablePreview)
+        return;
+      this.filesList.forEach((i) => {
+        urls.push(i.url);
+      });
+      common_vendor.index.previewImage({
+        urls,
+        current: index
+      });
+    },
+    value2px(value) {
+      if (typeof value === "number") {
+        value += "px";
+      } else {
+        if (value.indexOf("%") === -1) {
+          value = value.indexOf("px") !== -1 ? value : value + "px";
+        }
+      }
+      return value;
+    }
+  }
+};
+function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
+  return common_vendor.e({
+    a: common_vendor.f($props.filesList, (item, index, i0) => {
+      return common_vendor.e({
+        a: item.url,
+        b: common_vendor.o(($event) => $options.prviewImage(item, index), index)
+      }, $props.delIcon && !$props.readonly ? {
+        c: common_vendor.o(($event) => $options.delFile(index), index)
+      } : {}, {
+        d: item.progress && item.progress !== 100 || item.progress === 0
+      }, item.progress && item.progress !== 100 || item.progress === 0 ? {
+        e: item.progress === -1 ? 0 : item.progress,
+        f: item.errMsg ? "#ff5a5f" : "#EBEBEB"
+      } : {}, {
+        g: item.errMsg
+      }, item.errMsg ? {
+        h: common_vendor.o(($event) => $options.uploadFiles(item, index), index)
+      } : {}, {
+        i: index
+      });
+    }),
+    b: $props.delIcon && !$props.readonly,
+    c: common_vendor.s($options.borderStyle),
+    d: common_vendor.s($options.boxStyle),
+    e: $props.filesList.length < $props.limit && !$props.readonly
+  }, $props.filesList.length < $props.limit && !$props.readonly ? {
+    f: common_vendor.s($options.borderStyle),
+    g: common_vendor.o((...args) => $options.choose && $options.choose(...args)),
+    h: common_vendor.s($options.boxStyle)
+  } : {});
+}
+const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/project/足球比赛/match_applet/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue"]]);
+wx.createComponent(Component);

+ 4 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.wxml


+ 89 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.wxss

@@ -0,0 +1,89 @@
+/* 水平间距 */
+/* 水平间距 */
+.uni-file-picker__container {
+  display: flex;
+  box-sizing: border-box;
+  flex-wrap: wrap;
+  margin: -5px;
+}
+.file-picker__box {
+  position: relative;
+  width: 33.3%;
+  height: 0;
+  padding-top: 33.33%;
+  box-sizing: border-box;
+}
+.file-picker__box-content {
+  position: absolute;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  margin: 5px;
+  border: 1px #eee solid;
+  border-radius: 5px;
+  overflow: hidden;
+}
+.file-picker__progress {
+  position: absolute;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  /* border: 1px red solid; */
+  z-index: 2;
+}
+.file-picker__progress-item {
+  width: 100%;
+}
+.file-picker__mask {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  position: absolute;
+  right: 0;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  color: #fff;
+  font-size: 12px;
+  background-color: rgba(0, 0, 0, 0.4);
+}
+.file-image {
+  width: 100%;
+  height: 100%;
+}
+.is-add {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.icon-add {
+  width: 50px;
+  height: 5px;
+  background-color: #f1f1f1;
+  border-radius: 2px;
+}
+.rotate {
+  position: absolute;
+  transform: rotate(90deg);
+}
+.icon-del-box {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  position: absolute;
+  top: 3px;
+  right: 3px;
+  height: 26px;
+  width: 26px;
+  border-radius: 50%;
+  background-color: rgba(0, 0, 0, 0.5);
+  z-index: 2;
+  transform: rotate(-45deg);
+}
+.icon-del {
+  width: 15px;
+  height: 2px;
+  background-color: #fff;
+  border-radius: 2px;
+}

+ 90 - 0
unpackage/dist/dev/mp-weixin/uni_modules/uni-file-picker/components/uni-file-picker/utils.js

@@ -0,0 +1,90 @@
+"use strict";
+const common_vendor = require("../../../../common/vendor.js");
+const get_file_ext = (name) => {
+  const last_len = name.lastIndexOf(".");
+  const len = name.length;
+  return {
+    name: name.substring(0, last_len),
+    ext: name.substring(last_len + 1, len)
+  };
+};
+const get_extname = (fileExtname) => {
+  if (!Array.isArray(fileExtname)) {
+    let extname = fileExtname.replace(/(\[|\])/g, "");
+    return extname.split(",");
+  } else {
+    return fileExtname;
+  }
+};
+const get_files_and_is_max = (res, _extname) => {
+  let filePaths = [];
+  let files = [];
+  if (!_extname || _extname.length === 0) {
+    return {
+      filePaths,
+      files
+    };
+  }
+  res.tempFiles.forEach((v) => {
+    let fileFullName = get_file_ext(v.name);
+    const extname = fileFullName.ext.toLowerCase();
+    if (_extname.indexOf(extname) !== -1) {
+      files.push(v);
+      filePaths.push(v.path);
+    }
+  });
+  if (files.length !== res.tempFiles.length) {
+    common_vendor.index.showToast({
+      title: `当前选择了${res.tempFiles.length}个文件 ,${res.tempFiles.length - files.length} 个文件格式不正确`,
+      icon: "none",
+      duration: 5e3
+    });
+  }
+  return {
+    filePaths,
+    files
+  };
+};
+const get_file_info = (filepath) => {
+  return new Promise((resolve, reject) => {
+    common_vendor.index.getImageInfo({
+      src: filepath,
+      success(res) {
+        resolve(res);
+      },
+      fail(err) {
+        reject(err);
+      }
+    });
+  });
+};
+const get_file_data = async (files, type = "image") => {
+  let fileFullName = get_file_ext(files.name);
+  const extname = fileFullName.ext.toLowerCase();
+  let filedata = {
+    name: files.name,
+    uuid: files.uuid,
+    extname: extname || "",
+    cloudPath: files.cloudPath,
+    fileType: files.fileType,
+    url: files.path || files.path,
+    size: files.size,
+    //单位是字节
+    image: {},
+    path: files.path,
+    video: {}
+  };
+  if (type === "image") {
+    const imageinfo = await get_file_info(files.path);
+    delete filedata.video;
+    filedata.image.width = imageinfo.width;
+    filedata.image.height = imageinfo.height;
+    filedata.image.location = imageinfo.path;
+  } else {
+    delete filedata.image;
+  }
+  return filedata;
+};
+exports.get_extname = get_extname;
+exports.get_file_data = get_file_data;
+exports.get_files_and_is_max = get_files_and_is_max;