Commit 583af469 authored by 秦威威's avatar 秦威威

最新版

parent 4b440e3c
...@@ -43,8 +43,6 @@ ...@@ -43,8 +43,6 @@
images: { images: {
immediate: true, immediate: true,
handler(newVal, oldVal) { handler(newVal, oldVal) {
// console.log(newVal)
// console.log(this.fileList)
this.fileList = [] this.fileList = []
if (newVal) { if (newVal) {
const urlList = newVal.split(",") const urlList = newVal.split(",")
...@@ -70,7 +68,6 @@ ...@@ -70,7 +68,6 @@
}, },
// 新增图片 // 新增图片
async afterRead(event, type) { async afterRead(event, type) {
// console.log(event, type, "et")
let lists = [].concat(event.file) let lists = [].concat(event.file)
let fileListLen = this.fileList.length let fileListLen = this.fileList.length
lists.map((item) => { lists.map((item) => {
...@@ -80,13 +77,9 @@ ...@@ -80,13 +77,9 @@
message: '上传中' message: '上传中'
}) })
}) })
// console.log(lists, "listslistslistslists")
for (let i = 0; i < lists.length; i++) { for (let i = 0; i < lists.length; i++) {
const result = await this.$wskj.uploadImg(lists[i].url) const result = await this.$wskj.uploadImg(lists[i].url)
// console.log(result, "resulttttt")
// console.log(this.fileList, "fileListfileList")
let item = this[[type]][fileListLen] let item = this[[type]][fileListLen]
// console.log(item, "itemssss")
this.fileList.splice(fileListLen, 1, Object.assign(item, { this.fileList.splice(fileListLen, 1, Object.assign(item, {
status: 'success', status: 'success',
message: '', message: '',
......
<template> <template>
<view class='container'> <view class='container'>
<view class="wapper"> <view class="wapper">
<view class="reason"> <view class="reason">
<view class="title">文字描述(必填)</view> <view class="title">文字描述(必填)</view>
<view class="mt-30"> <view class="mt-30">
<u--textarea v-model="reason" height="260rpx" maxlength="150" placeholder="请输入(最低10个字)" count></u--textarea> <u--textarea v-model="reason" height="260rpx" maxlength="150" placeholder="请输入(最低10个字)"
count></u--textarea>
</view> </view>
</view> </view>
<view class="mt-30"> <view class="mt-30">
<text>相关图片(必填,最多9张)</text> <text>相关图片(必填,最多9张)</text>
<view class="control"> <view class="control">
<upload-image <upload-image v-model="images" maxCount="3" width="100" height="100" type="fullurl"></upload-image>
v-model="images"
maxCount="3"
width="100"
height="100"
type="fullurl"
></upload-image>
</view> </view>
</view> </view>
</view> </view>
<view class="btn-box"> <view class="btn-box">
<view @click="onSubmit" class="fullscreen-btn"> <view @click="onSubmit" class="fullscreen-btn">
<text>提交</text> <text>提交</text>
</view> </view>
</view> </view>
<!-- 提交 --> <!-- 提交 -->
<wskj-modal :show="submitShow" :showCancelButton="true" confirmText="确定" confirmColor="#EB7318" <wskj-modal :show="submitShow" :showCancelButton="true" confirmText="确定" confirmColor="#EB7318"
@close="submitShow = false" @confirm="onConfirmSubmit" @cancel="submitShow = false"> @close="submitShow = false" @confirm="onConfirmSubmit" @cancel="submitShow = false">
...@@ -37,92 +32,90 @@ ...@@ -37,92 +32,90 @@
</view> </view>
</view> </view>
</wskj-modal> </wskj-modal>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
reason:'', reason: '',
submitShow: false, submitShow: false,
images: '', images: '',
}; };
},
onLoad() {
this.images = '/assets/img/qrcode.png'
},
methods: {
onSubmit(){
// console.log(this.images)
// this.images = ''
// console.log(this.images)
if(!this.reason){
return this.$u.toast('请输入内容')
}
if(!this.images){
return this.$u.toast('请至少上传一张照片')
}
if(this.reason.length < 10){
return this.$u.toast('文字描述最低10个字')
}
this.submitShow = true
}, },
// 提交 onLoad() {
onConfirmSubmit(){ this.images = '/assets/img/qrcode.png'
const params = { },
url: '/api/user/yijian', methods: {
loadingTip: '', onSubmit() {
data: { // console.log(this.images)
content: this.reason, // this.images = ''
images: this.images // console.log(this.images)
if (!this.reason) {
return this.$u.toast('请输入内容')
} }
} if (!this.images) {
// console.log(params); return this.$u.toast('请至少上传一张照片')
this.$request(params).then(res => { }
// console.log(res) if (this.reason.length < 10) {
this.submitShow = false return this.$u.toast('文字描述最低10个字')
if(res.code === 1) {
this.$u.toast(res.msg || '提交成功')
this.reason = ''
this.images = ''
} else {
this.$u.toast(res.msg || '提交失败')
} }
}).catch(err => { this.submitShow = true
this.submitShow = false },
this.$u.toast(err.msg || '提交失败') // 提交
}) onConfirmSubmit() {
} const params = {
}, url: '/api/user/yijian',
}; loadingTip: '',
data: {
content: this.reason,
images: this.images
}
}
// console.log(params);
this.$request(params).then(res => {
// console.log(res)
this.submitShow = false
if (res.code === 1) {
this.$u.toast(res.msg || '提交成功')
this.reason = ''
this.images = ''
} else {
this.$u.toast(res.msg || '提交失败')
}
}).catch(err => {
this.submitShow = false
this.$u.toast(err.msg || '提交失败')
})
}
},
};
</script> </script>
<style scoped> <style scoped>
.container { .container {
padding: 30rpx; padding: 30rpx;
} }
.wapper {
.wapper {}
}
.reason {}
.reason {
.reason>.title {}
}
.reason > .title { .reason>textarea {
}
.reason > textarea {
margin-top: 20rpx; margin-top: 20rpx;
padding: 15rpx; padding: 15rpx;
width: 100% !important; width: 100% !important;
border: 1px solid #ccc !important; border: 1px solid #ccc !important;
} }
.control { .control {
margin-top: 20rpx; margin-top: 20rpx;
} }
.btn-box { .btn-box {
width: 90%; width: 90%;
position: fixed; position: fixed;
...@@ -130,4 +123,4 @@ export default { ...@@ -130,4 +123,4 @@ export default {
left: 50%; left: 50%;
margin-left: -45%; margin-left: -45%;
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment