Commit 37ffff50 by cen

fix: 去掉取消上传提示上传失败

1 parent 7a33816b
const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 2
const index = 4
/**
*
0本地
......
......@@ -8,37 +8,16 @@
<view class="tips">完成交付图片上传,拍摄需包含车辆图片(铭牌、45%角)、提车人照片,及提车人身份证照片。</view>
<view class="img-list flex">
<template v-if="imgList.length < 10">
<view
class="img-item upload flex"
@click="chooseImage"
>
<uni-icons
type="plusempty"
:size="22"
color="#347BFF"
class="icon"
></uni-icons>
<view class="img-item upload flex" @click="chooseImage">
<uni-icons type="plusempty" :size="22" color="#347BFF" class="icon"></uni-icons>
{{ imgList.length }}/10
</view>
</template>
<template v-for="(i, index) in imgList">
<view
class="img-item"
:key="index"
>
<image
:src="i"
class="img"
mode="aspectFill"
@click="previewMedia(i, 1)"
/>
<view class="img-item" :key="index">
<image :src="i" class="img" mode="aspectFill" @click="previewMedia(i, 1)" />
<view class="del flex">
<uni-icons
type="closeempty"
:size="10"
color="#fff"
@click="delImage(index)"
></uni-icons>
<uni-icons type="closeempty" :size="10" color="#fff" @click="delImage(index)"></uni-icons>
</view>
</view>
</template>
......@@ -48,14 +27,7 @@
<view class="remark-box box">
<view class="title">交付备注</view>
<view class="remark">
<textarea
placeholder="请描述交付过程备注信息"
placeholder-class="placeholder"
:value="remark"
@input="remark = $event.detail.value"
:maxlength="200"
class="textarea"
></textarea>
<textarea placeholder="请描述交付过程备注信息" placeholder-class="placeholder" :value="remark" @input="remark = $event.detail.value" :maxlength="200" class="textarea"></textarea>
<view class="limit">{{ remark.length }}/200</view>
</view>
</view>
......@@ -65,10 +37,7 @@
客户提车确认
<view class="des">请让客户在拍卖小程序完成交割单签署,签署完成后才可点击确认提车。</view>
</view>
<view
:class="['btn flex', { disabled: !imgList.length }]"
@click="comfirm"
>确认提车</view>
<view :class="['btn flex', { disabled: !imgList.length }]" @click="comfirm">确认提车</view>
</view>
<view class="block"></view>
</view>
......@@ -90,19 +59,19 @@ export default {
}
}
},
data () {
data() {
return {
imgList: [],
remark: ''
}
},
mounted () {
mounted() {
},
methods: {
delImage (index) {
delImage(index) {
this.imgList.splice(index, 1)
},
async chooseImage () {
async chooseImage() {
const { imgList } = this,
_this = this
try {
......@@ -116,7 +85,7 @@ export default {
// #endif
uni.chooseImage({
count: MAX_IMG_COUNT - imgList.length,
async success (res) {
async success(res) {
for (const file of res.tempFiles) {
if (file.size > MAX_IMAGE_SIZE) {
return uni.showToast({
......@@ -132,13 +101,17 @@ export default {
}
if (_this.imgList.length >= res.tempFilePaths.length) uni.hideLoading()
},
fail (err) {
fail(err) {
console.log(err)
uni.hideLoading()
return uni.showToast({
title: '图片上传失败',
icon: 'none'
})
if (err.errMsg.indexOf('cancel') === -1) {
return uni.showToast({
title: '图片上传失败',
icon: 'none'
})
}
},
})
} catch (error) {
......@@ -151,7 +124,7 @@ export default {
}
},
async comfirm () {
async comfirm() {
try {
let { imgList, step, remark, detail } = this,
{ deliveryOrderId } = detail,
......@@ -179,7 +152,7 @@ export default {
if (error) this.$emit('openError', error)
}
},
previewMedia (media, type) {
previewMedia(media, type) {
const url = `/pages/boutique/preview?tabName=预览&sourceType=${type}&detailUrl=${media}`
uni.navigateTo({
url: `${url}`
......@@ -194,11 +167,13 @@ export default {
position: relative;
z-index: 2;
margin: 0 toRpx(48);
.box {
border-radius: toRpx(16);
background: #ffffff;
margin-bottom: toRpx(24);
padding: 0 toRpx(32);
.title {
color: #333333;
font-size: toRpx(28);
......@@ -206,6 +181,7 @@ export default {
display: flex;
line-height: toRpx(40);
padding-top: toRpx(28);
.required {
color: #f24724;
font-size: toRpx(28);
......@@ -213,6 +189,7 @@ export default {
}
}
}
.upload-box {
.tips {
margin: toRpx(4) 0 toRpx(28);
......@@ -220,30 +197,36 @@ export default {
font-size: toRpx(26);
line-height: toRpx(36);
}
.img-list {
flex-wrap: wrap;
gap: toRpx(24);
.upload {
background: #f5f8ff;
flex-direction: column;
justify-content: center;
color: #999999;
font-size: toRpx(26);
.icon {
font-weight: 700;
margin-bottom: toRpx(22);
}
}
.img-item {
width: toRpx(224);
height: toRpx(224);
border-radius: toRpx(12);
position: relative;
overflow: hidden;
.img {
width: 100%;
height: 100%;
}
.del {
position: absolute;
width: toRpx(32);
......@@ -256,6 +239,7 @@ export default {
}
}
}
.img-tips {
color: #999999;
font-size: toRpx(24);
......@@ -263,11 +247,14 @@ export default {
line-height: toRpx(36);
}
}
.remark-box {
padding-bottom: toRpx(28);
.title {
padding-bottom: toRpx(24);
}
.remark {
height: toRpx(200);
border-radius: toRpx(16);
......@@ -275,12 +262,14 @@ export default {
box-sizing: border-box;
padding: toRpx(24) 0 toRpx(24) toRpx(24);
position: relative;
.textarea {
height: toRpx(132);
width: 100%;
color: #333333;
font-size: toRpx(28);
}
.limit {
position: absolute;
bottom: toRpx(8);
......@@ -290,20 +279,24 @@ export default {
line-height: toRpx(44);
}
}
.placeholder {
color: #999999;
font-size: toRpx(28);
}
}
.btn-box {
box-sizing: border-box;
height: toRpx(144);
.info {
margin-left: toRpx(24);
color: #333333;
font-size: toRpx(28);
font-weight: 500;
line-height: toRpx(40);
.des {
color: #666666;
font-size: toRpx(26);
......@@ -312,6 +305,7 @@ export default {
margin-top: toRpx(4);
}
}
.btn {
margin-left: auto;
width: toRpx(192);
......@@ -323,10 +317,12 @@ export default {
font-weight: 500;
justify-content: center;
}
.disabled {
opacity: 0.5;
}
}
.block {
width: 100%;
height: toRpx(24);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!