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 @@