| | |
| | | |
| | | <script> |
| | | import uploadMixin from "@/mixin/uploadMixinPicCheck"; |
| | | import { handlePublish } from "@/api/circle/circle.js" |
| | | import { |
| | | handlePublish |
| | | } from "@/api/circle/circle.js" |
| | | export default { |
| | | mixins: [uploadMixin], |
| | | data() { |
| | |
| | | form: { |
| | | images: [] |
| | | }, |
| | | content:"", |
| | | roleType:0 |
| | | content: "", |
| | | roleType: 0 |
| | | } |
| | | }, |
| | | |
| | | onLoad(){ |
| | | let role = uni.getStorageSync('activeRole') |
| | | if(role.roleAlias == "inhabitant"){ |
| | | |
| | | onLoad() { |
| | | let role = uni.getStorageSync('activeRole') |
| | | if (role.roleAlias == "inhabitant") { |
| | | this.roleType = 0 |
| | | }else { |
| | | } else { |
| | | this.roleType = 1; |
| | | } |
| | | }, |
| | | |
| | | |
| | | methods: { |
| | | |
| | | getImagesUrl(){ |
| | | if(this.form.images.length){ |
| | | |
| | | getImagesUrl() { |
| | | if (this.form.images.length) { |
| | | let arr = []; |
| | | for(let i of this.form.images){ |
| | | for (let i of this.form.images) { |
| | | arr.push(i.name) |
| | | } |
| | | return arr.join(",") |
| | | }else { |
| | | } else { |
| | | return "" |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | submitInfo() { |
| | | handlePublish({ |
| | | circleText:this.content, |
| | | circleImages:this.getImagesUrl(), |
| | | circleType:this.roleType |
| | | }).then(res=>{ |
| | | if(res.code == 200){ |
| | | uni.showToast({ |
| | | title:res.msg |
| | | }) |
| | | setTimeout(()=>{ |
| | | uni.navigateBack(); |
| | | uni.$emit("refreshList") |
| | | },1000) |
| | | } |
| | | }) |
| | | let param = { |
| | | circleText: this.content, |
| | | circleImages: this.getImagesUrl(), |
| | | circleType: this.roleType, |
| | | } |
| | | let role = uni.getStorageSync('activeRole') |
| | | if (role.roleAlias == "inhabitant") { |
| | | param.houseCode = uni.getStorageSync("siteInfo").houseCode |
| | | } |
| | | handlePublish(param).then(res => { |
| | | if (res.code == 200) { |
| | | uni.showToast({ |
| | | title: res.msg |
| | | }) |
| | | setTimeout(() => { |
| | | uni.navigateBack(); |
| | | uni.$emit("refreshList") |
| | | }, 1000) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |