From 8b48fadb16148bdbedfa44e057a4c898e3129315 Mon Sep 17 00:00:00 2001
From: aihe <961836564@qq.com>
Date: Tue, 12 Dec 2023 13:36:04 +0800
Subject: [PATCH] uu
---
common/upload.js | 6 ++-
components/tpx-image/tpx-image.vue | 2 +-
.../tpx-select/default-select-input.vue | 36 ++++++++-----
components/tpx-select/tpx-select.vue | 3 +-
components/tpx-upload/tpx-upload.vue | 53 ++++++++++++-------
pages/address/edit.vue | 25 +++------
pages/complaint/edit.vue | 35 +++---------
7 files changed, 76 insertions(+), 84 deletions(-)
diff --git a/common/upload.js b/common/upload.js
index dd9d651..920ec99 100644
--- a/common/upload.js
+++ b/common/upload.js
@@ -16,7 +16,11 @@ const chooseFile = function (action = 'chooseImage', opt = {}) {
...opts,
success: function (res) {
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
- var tempFilePaths = res.tempFilePaths || [res.tempFilePath]
+ var tempFilePaths = res.tempFilePaths || [res.tempFilePath]debugger
+ if (tempFilePaths.length > opts.count) {
+ reject()
+ return showToast(`最多选择${opts.count}个`)
+ }
resolve(tempFilePaths)
},
fail: function (res) {
diff --git a/components/tpx-image/tpx-image.vue b/components/tpx-image/tpx-image.vue
index 5ae6f30..5abd1ff 100644
--- a/components/tpx-image/tpx-image.vue
+++ b/components/tpx-image/tpx-image.vue
@@ -12,7 +12,7 @@
},
mode: {
default () {
- return 'widthFix'
+ return 'aspectFit' // aspectFit | widthFix
}
},
scale: {
diff --git a/components/tpx-select/default-select-input.vue b/components/tpx-select/default-select-input.vue
index 42a2ea7..5cc1afd 100644
--- a/components/tpx-select/default-select-input.vue
+++ b/components/tpx-select/default-select-input.vue
@@ -2,7 +2,7 @@
-
+
@@ -16,45 +16,54 @@
computed: {
leftText() {
let str = ''
- if(this.value) {
- const curItem = this.list.filter(item=> item.val == this.value)[0] || {}
+ if (this.value) {
+ const curItem = this.list.filter(item => item.val == this.value)[0] || {}
curItem.title && (str = curItem.title)
} else {
str = this.placeholder
}
return str
},
+ contClass() {
+ let pre = ['radius-20']
+ if (this.isWhite) {
+ pre.push('blcok-white')
+ } else {
+ pre.push('blcok-grey')
+ }
+ return pre.join(" ")
+ }
},
props: {
- contClass: {
- default(){
- return 'blcok-grey radius-20 '
+ isWhite: {
+ default () {
+ return false
}
},
placeholder: {
- default(){
+ default () {
return ''
}
},
show: {
- default(){
+ default () {
return false
}
},
value: {
- default(){
+ default () {
return ''
}
},
list: {
- default(){
+ default () {
return []
}
}
},
data() {
return {
-
+
}
},
created() {
@@ -65,11 +74,10 @@
},
destroyed() {},
- methods: {
- }
+ methods: {}
}
\ No newline at end of file
diff --git a/components/tpx-select/tpx-select.vue b/components/tpx-select/tpx-select.vue
index 9bb02db..a76f359 100644
--- a/components/tpx-select/tpx-select.vue
+++ b/components/tpx-select/tpx-select.vue
@@ -2,7 +2,7 @@
-
+
@@ -41,6 +41,7 @@
ContentItems, DefaultSelectInput
},
props: {
+ isWhite: {},
customInput: {
default () {
return false
diff --git a/components/tpx-upload/tpx-upload.vue b/components/tpx-upload/tpx-upload.vue
index 4c3a92a..d605c86 100644
--- a/components/tpx-upload/tpx-upload.vue
+++ b/components/tpx-upload/tpx-upload.vue
@@ -1,22 +1,27 @@
-
-
-
-
+
+
+
+
+
+
+
+ 上传
+ 图片
+ 视频
+ 文件
+
-
- 上传
- 照片
- 视频
+
+
-
-
-
-
+
+
-
+
+ {{item}}
@@ -28,7 +33,7 @@
import { showToast } from "@/common/untool"
const fileTypeEnum = {
- // all: "all",
+ all: "all",
image: "image",
video: "video",
}
@@ -49,6 +54,21 @@
},
},
props: {
+ customstyle: {
+ default () {
+ return ''
+ }
+ },
+ itemstyle: {
+ default () {
+ return ''
+ }
+ },
+ value: {
+ default () {
+ return ''
+ }
+ },
value: {
default () {
return ''
@@ -74,11 +94,6 @@
return 1
}
},
- scale: {
- default () {
- return [1, 1] // 宽高比
- }
- },
isSlot: {
default () {
return false
diff --git a/pages/address/edit.vue b/pages/address/edit.vue
index b297d3d..a7741cf 100644
--- a/pages/address/edit.vue
+++ b/pages/address/edit.vue
@@ -12,17 +12,10 @@
-
-
-
-
-
-
-
-
-
+
+
-
@@ -38,15 +31,9 @@
-
-
-
-
-
-
-
-
-
+
+
diff --git a/pages/complaint/edit.vue b/pages/complaint/edit.vue
index 92f43bb..c3b597a 100644
--- a/pages/complaint/edit.vue
+++ b/pages/complaint/edit.vue
@@ -9,27 +9,14 @@
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
@@ -55,16 +42,6 @@