小程序底座架构完成
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
<span>(最多9张)</span>
|
||||
</div>
|
||||
<div class="form-item__img">
|
||||
<ai-uploader v-model="images" :limit="9"></ai-uploader>
|
||||
<AiUploader v-model="images" :limit="9"></AiUploader>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,103 +30,97 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AiUploader from '@/components/AiUploader/AiUploader'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
content: '',
|
||||
images: [],
|
||||
id: '',
|
||||
flag: false
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
content: '',
|
||||
images: [],
|
||||
id: '',
|
||||
flag: false
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.id = e.activityId
|
||||
},
|
||||
|
||||
methods: {
|
||||
submit() {
|
||||
if (this.flag) return
|
||||
|
||||
if (!this.content && !this.images.length) {
|
||||
return this.$u.toast('内容或图片不能为空')
|
||||
}
|
||||
},
|
||||
this.flag = true
|
||||
|
||||
components: {
|
||||
AiUploader
|
||||
},
|
||||
|
||||
onLoad (e) {
|
||||
this.id = e.activityId
|
||||
},
|
||||
|
||||
methods: {
|
||||
submit () {
|
||||
if (this.flag) return
|
||||
|
||||
if (!this.content && !this.images.length) {
|
||||
return this.$u.toast('内容或图片不能为空')
|
||||
this.$loading()
|
||||
this.$instance.post('/app/appvillageactivitypost/addOrUpdate', {
|
||||
content: this.content,
|
||||
activityId: this.id,
|
||||
avatar: this.$store.state.user.avatarUrl,
|
||||
name: this.$store.state.user.nickName,
|
||||
images: JSON.stringify(this.images)
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$toast('提交成功')
|
||||
uni.$emit('update')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 800)
|
||||
}
|
||||
this.flag = true
|
||||
|
||||
|
||||
this.$loading()
|
||||
this.$instance.post('/app/appvillageactivitypost/addOrUpdate', {
|
||||
content: this.content,
|
||||
activityId: this.id,
|
||||
avatar: this.$store.state.user.avatarUrl,
|
||||
name: this.$store.state.user.nickName,
|
||||
images: JSON.stringify(this.images)
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$toast('提交成功')
|
||||
uni.$emit('update')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 800)
|
||||
}
|
||||
|
||||
this.$hideLoading()
|
||||
})
|
||||
}
|
||||
this.$hideLoading()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.dynamic {
|
||||
.form-item {
|
||||
margin-bottom: 24px;
|
||||
padding-left: 32px;
|
||||
padding-bottom: 20px;
|
||||
background: #fff;
|
||||
.dynamic {
|
||||
.form-item {
|
||||
margin-bottom: 24px;
|
||||
padding-left: 32px;
|
||||
padding-bottom: 20px;
|
||||
background: #fff;
|
||||
|
||||
.form-item__wrapper {
|
||||
padding-right: 32px;
|
||||
.form-item__wrapper {
|
||||
padding-right: 32px;
|
||||
}
|
||||
|
||||
.form-item__textarea, .form-item__img {
|
||||
padding-left: 18px;
|
||||
|
||||
textarea {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.form-item__title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 32px 0;
|
||||
|
||||
i {
|
||||
font-size: 32px;
|
||||
color: #FF4466;
|
||||
}
|
||||
|
||||
.form-item__textarea, .form-item__img {
|
||||
padding-left: 18px;
|
||||
|
||||
textarea {
|
||||
width: 100%;
|
||||
}
|
||||
span {
|
||||
font-size: 28px;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.form-item__title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 32px 0;
|
||||
|
||||
i {
|
||||
font-size: 32px;
|
||||
color: #FF4466;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 28px;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
h2 {
|
||||
padding: 0 4px;
|
||||
font-weight: 600;
|
||||
font-size: 32px;
|
||||
color: #333333;
|
||||
}
|
||||
h2 {
|
||||
padding: 0 4px;
|
||||
font-weight: 600;
|
||||
font-size: 32px;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user