BUG 26062
This commit is contained in:
		@@ -18,7 +18,7 @@ export default {
 | 
			
		||||
          url: '../AppResidentActivitie/AppResidentActivities'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: '通知公告',
 | 
			
		||||
          name: '小程序公告',
 | 
			
		||||
          icon: require('./img/xcxgg.png'),
 | 
			
		||||
          url: '../AppUniMsg/AppUniMsg'
 | 
			
		||||
        },
 | 
			
		||||
@@ -31,7 +31,7 @@ export default {
 | 
			
		||||
      headerBg: require('./img/header-bg.png'),
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  onShow(){
 | 
			
		||||
  onShow() {
 | 
			
		||||
    document.title = "居民互动"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -3,21 +3,22 @@
 | 
			
		||||
    <div class="header-description">
 | 
			
		||||
      <u-form :model="forms" ref="uForm" label-width="auto" :border-bottom="false">
 | 
			
		||||
        <u-form-item label="标题" prop="title" required :border-bottom="false" class="names">
 | 
			
		||||
          <u-input v-model="forms.title" placeholder="请输入标题" maxlength="30" />
 | 
			
		||||
          <u-input v-model="forms.title" placeholder="请输入标题" maxlength="30"/>
 | 
			
		||||
        </u-form-item>
 | 
			
		||||
 | 
			
		||||
        <u-form-item label="发布组织" prop="publishUnitName" required :border-bottom="false" class="phones">
 | 
			
		||||
          <u-input v-model="forms.publishUnitName" placeholder="请输入发布组织" maxlength="16" />
 | 
			
		||||
          <u-input v-model="forms.publishUnitName" placeholder="请输入发布组织" maxlength="16"/>
 | 
			
		||||
        </u-form-item>
 | 
			
		||||
 | 
			
		||||
        <u-form-item label="正文" prop="content" :border-bottom="false" label-position="top" class="contents">
 | 
			
		||||
          <u-input v-model="forms.content" placeholder="请输入正文" type="textarea" auto-height height="100" maxlength="500" />
 | 
			
		||||
          <AiEditor v-model="forms.content" placeholder="请输入正文" :maxlength="500"/>
 | 
			
		||||
        </u-form-item>
 | 
			
		||||
 | 
			
		||||
        <div class="line"></div>
 | 
			
		||||
 | 
			
		||||
        <u-form-item label="图片上传 (最多9张)" prop="images" :border-bottom="false" class="avatars" label-position="top">
 | 
			
		||||
          <AiUploader :def.sync="forms.images" multiple placeholder="上传图片" :limit="9" action="/admin/file/add2"></AiUploader>
 | 
			
		||||
          <AiUploader :def.sync="forms.images" multiple placeholder="上传图片" :limit="9"
 | 
			
		||||
                      action="/admin/file/add2"/>
 | 
			
		||||
        </u-form-item>
 | 
			
		||||
      </u-form>
 | 
			
		||||
    </div>
 | 
			
		||||
@@ -27,11 +28,10 @@
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { mapState } from 'vuex'
 | 
			
		||||
import {mapState} from 'vuex'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'Add',
 | 
			
		||||
  components: {},
 | 
			
		||||
  props: {},
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
@@ -45,7 +45,7 @@ export default {
 | 
			
		||||
      flag: false,
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  computed: { ...mapState(['user']) },
 | 
			
		||||
  computed: {...mapState(['user'])},
 | 
			
		||||
  onLoad(o) {
 | 
			
		||||
    this.id = o.id
 | 
			
		||||
    this.getDetail()
 | 
			
		||||
@@ -54,7 +54,8 @@ export default {
 | 
			
		||||
    document.title = '新增通知公告'
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  mounted() {},
 | 
			
		||||
  mounted() {
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getDetail() {
 | 
			
		||||
      if (this.id) {
 | 
			
		||||
@@ -93,29 +94,29 @@ export default {
 | 
			
		||||
          const imgs = []
 | 
			
		||||
          if (this.forms.images) {
 | 
			
		||||
            this.forms.images.map((e) => {
 | 
			
		||||
              imgs.push({ url: e.url, id: e.id })
 | 
			
		||||
              imgs.push({url: e.url, id: e.id})
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          this.flag = true
 | 
			
		||||
          this.$http
 | 
			
		||||
            .post(`/app/appmininotice/addOrUpdate`, {
 | 
			
		||||
              title: this.forms.title,
 | 
			
		||||
              publishUnitName: this.forms.publishUnitName,
 | 
			
		||||
              content: this.forms.content,
 | 
			
		||||
              images: JSON.stringify(imgs) || [],
 | 
			
		||||
              id: this.id,
 | 
			
		||||
            })
 | 
			
		||||
            .then((res) => {
 | 
			
		||||
              if (res.code == 0) {
 | 
			
		||||
                this.flag = false
 | 
			
		||||
                this.$u.toast('提交成功')
 | 
			
		||||
                uni.$emit('updateList')
 | 
			
		||||
                setTimeout(() => {
 | 
			
		||||
                  uni.navigateBack()
 | 
			
		||||
                }, 600)
 | 
			
		||||
              }
 | 
			
		||||
            })
 | 
			
		||||
          .post(`/app/appmininotice/addOrUpdate`, {
 | 
			
		||||
            title: this.forms.title,
 | 
			
		||||
            publishUnitName: this.forms.publishUnitName,
 | 
			
		||||
            content: this.forms.content,
 | 
			
		||||
            images: JSON.stringify(imgs) || [],
 | 
			
		||||
            id: this.id,
 | 
			
		||||
          })
 | 
			
		||||
          .then((res) => {
 | 
			
		||||
            if (res.code == 0) {
 | 
			
		||||
              this.flag = false
 | 
			
		||||
              this.$u.toast('提交成功')
 | 
			
		||||
              uni.$emit('updateList')
 | 
			
		||||
              setTimeout(() => {
 | 
			
		||||
                uni.navigateBack()
 | 
			
		||||
              }, 600)
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
        } else {
 | 
			
		||||
          this.$u.toast('失败')
 | 
			
		||||
        }
 | 
			
		||||
@@ -129,17 +130,21 @@ export default {
 | 
			
		||||
uni-page-body {
 | 
			
		||||
  height: 100%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.add {
 | 
			
		||||
  height: 100%;
 | 
			
		||||
 | 
			
		||||
  .header-description {
 | 
			
		||||
    padding-bottom: 112px;
 | 
			
		||||
 | 
			
		||||
    ::v-deep .u-form {
 | 
			
		||||
      .u-form-item {
 | 
			
		||||
        padding: 0 45px !important;
 | 
			
		||||
 | 
			
		||||
        .u-form-item__body {
 | 
			
		||||
          .u-form-item--right__content__slot {
 | 
			
		||||
            padding-bottom: 0;
 | 
			
		||||
 | 
			
		||||
            .u-input {
 | 
			
		||||
              text-align: right !important;
 | 
			
		||||
            }
 | 
			
		||||
@@ -162,12 +167,14 @@ uni-page-body {
 | 
			
		||||
      .avatars,
 | 
			
		||||
      .contents {
 | 
			
		||||
        padding-bottom: 20px !important;
 | 
			
		||||
 | 
			
		||||
        .u-form-item__body {
 | 
			
		||||
          .u-form-item--right__content__slot {
 | 
			
		||||
            .u-input {
 | 
			
		||||
              text-align: left !important;
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          .default {
 | 
			
		||||
            width: 160px;
 | 
			
		||||
            height: 160px;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user