27602
This commit is contained in:
		@@ -3,12 +3,15 @@
 | 
			
		||||
    <div class="form-item__group">
 | 
			
		||||
      <div class="form-item">
 | 
			
		||||
        <div class="form-item__wrapper">
 | 
			
		||||
          <div class="form-item__title">
 | 
			
		||||
          <div class="form-item__title" @click="showSel = true">
 | 
			
		||||
            <i>*</i>
 | 
			
		||||
            <h2>事件类型</h2>
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="form-item__right">
 | 
			
		||||
            <ai-select :list="dictList" v-model="form.groupId"></ai-select>
 | 
			
		||||
            <!-- <ai-select :list="dictList" v-model="form.groupId"></ai-select>
 | 
			
		||||
             -->
 | 
			
		||||
 | 
			
		||||
            <u-select v-model="showSel" value-name="value" label-name="label" :list="dictList"></u-select>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
@@ -35,7 +38,7 @@
 | 
			
		||||
          <div class="form-item__right" @click="chooseAddress">
 | 
			
		||||
            <span v-if="form.address">{{ form.address }}</span>
 | 
			
		||||
            <i v-else>请选择</i>
 | 
			
		||||
            <u-icon name="arrow-right" color="#ddd"/>
 | 
			
		||||
            <u-icon name="arrow-right" color="#ddd" />
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
@@ -45,12 +48,11 @@
 | 
			
		||||
            <i>*</i>
 | 
			
		||||
            <h2>所属网格</h2>
 | 
			
		||||
          </div>
 | 
			
		||||
          <picker :range="gridList" mode="multiSelector" range-key="girdName" @columnchange="onColumnChange"
 | 
			
		||||
                  @change="onChange">
 | 
			
		||||
          <picker :range="gridList" mode="multiSelector" range-key="girdName" @columnchange="onColumnChange" @change="onChange">
 | 
			
		||||
            <div class="form-item__right">
 | 
			
		||||
              <span v-if="form.girdName">{{ form.girdName }}</span>
 | 
			
		||||
              <i v-else>请选择</i>
 | 
			
		||||
              <u-icon name="arrow-right" color="#ddd"/>
 | 
			
		||||
              <u-icon name="arrow-right" color="#ddd" />
 | 
			
		||||
            </div>
 | 
			
		||||
          </picker>
 | 
			
		||||
        </div>
 | 
			
		||||
@@ -60,7 +62,7 @@
 | 
			
		||||
      <div class="form-item form-item__imgs">
 | 
			
		||||
        <div class="form-item__wrapper">
 | 
			
		||||
          <div class="form-item__title">
 | 
			
		||||
            <i style="opacity: 0;">*</i>
 | 
			
		||||
            <i style="opacity: 0">*</i>
 | 
			
		||||
            <h2>图片上传</h2>
 | 
			
		||||
            <span>(最多9张)</span>
 | 
			
		||||
          </div>
 | 
			
		||||
@@ -78,7 +80,7 @@
 | 
			
		||||
            <h2>姓名</h2>
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="form-item__right">
 | 
			
		||||
            <input placeholder="请输入" v-model="form.name" :maxlength="20"/>
 | 
			
		||||
            <input placeholder="请输入" v-model="form.name" :maxlength="20" />
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
@@ -89,7 +91,7 @@
 | 
			
		||||
            <h2>联系方式</h2>
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="form-item__right">
 | 
			
		||||
            <input placeholder="请输入" v-model="form.phone" :maxlength="20"/>
 | 
			
		||||
            <input placeholder="请输入" v-model="form.phone" :maxlength="20" />
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
@@ -101,7 +103,7 @@
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import {mapState} from 'vuex'
 | 
			
		||||
import { mapState } from 'vuex'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  data() {
 | 
			
		||||
@@ -118,17 +120,18 @@ export default {
 | 
			
		||||
        groupName: '',
 | 
			
		||||
        girdName: '',
 | 
			
		||||
        girdId: '',
 | 
			
		||||
        files: []
 | 
			
		||||
        files: [],
 | 
			
		||||
      },
 | 
			
		||||
      dictList: [],
 | 
			
		||||
      arr: [],
 | 
			
		||||
      gridList: [[], []],
 | 
			
		||||
      flag: false
 | 
			
		||||
      flag: false,
 | 
			
		||||
      showSel: false,
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  computed: {
 | 
			
		||||
    ...mapState(['user'])
 | 
			
		||||
    ...mapState(['user']),
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  onLoad() {
 | 
			
		||||
@@ -144,41 +147,44 @@ export default {
 | 
			
		||||
        scope: 'scope.userLocation',
 | 
			
		||||
        success: () => {
 | 
			
		||||
          uni.chooseLocation({
 | 
			
		||||
            success: res => {
 | 
			
		||||
            success: (res) => {
 | 
			
		||||
              this.form.address = res.address
 | 
			
		||||
              this.form.lat = res.latitude
 | 
			
		||||
              this.form.lng = res.longitude
 | 
			
		||||
            }
 | 
			
		||||
            },
 | 
			
		||||
          })
 | 
			
		||||
        },
 | 
			
		||||
        fail: () => {
 | 
			
		||||
          this.$dialog.confirm({
 | 
			
		||||
            content: '您未授权定位权限,无法选择位置'
 | 
			
		||||
          }).then(() => {
 | 
			
		||||
            wx.openSetting({
 | 
			
		||||
              success: res => {
 | 
			
		||||
                if (!res.authSetting['scope.userLocation']) {
 | 
			
		||||
                  this.$dialog.alert({
 | 
			
		||||
                    content: '您未授权定位权限,无法选择位置'
 | 
			
		||||
                  }).then(() => {
 | 
			
		||||
                  })
 | 
			
		||||
                } else {
 | 
			
		||||
                  console.log('设置定位权限')
 | 
			
		||||
                }
 | 
			
		||||
              }
 | 
			
		||||
          this.$dialog
 | 
			
		||||
            .confirm({
 | 
			
		||||
              content: '您未授权定位权限,无法选择位置',
 | 
			
		||||
            })
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
            .then(() => {
 | 
			
		||||
              wx.openSetting({
 | 
			
		||||
                success: (res) => {
 | 
			
		||||
                  if (!res.authSetting['scope.userLocation']) {
 | 
			
		||||
                    this.$dialog
 | 
			
		||||
                      .alert({
 | 
			
		||||
                        content: '您未授权定位权限,无法选择位置',
 | 
			
		||||
                      })
 | 
			
		||||
                      .then(() => {})
 | 
			
		||||
                  } else {
 | 
			
		||||
                    console.log('设置定位权限')
 | 
			
		||||
                  }
 | 
			
		||||
                },
 | 
			
		||||
              })
 | 
			
		||||
            })
 | 
			
		||||
        },
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    getDict() {
 | 
			
		||||
      this.$instance.post(`/app/appclapeventgroup/list?current=1&size=100000`).then(res => {
 | 
			
		||||
      this.$instance.post(`/app/appclapeventgroup/list?current=1&size=100000`).then((res) => {
 | 
			
		||||
        if (res.code == 0) {
 | 
			
		||||
          this.dictList = res.data.records.map(v => {
 | 
			
		||||
          this.dictList = res.data.records.map((v) => {
 | 
			
		||||
            return {
 | 
			
		||||
              value: v.id,
 | 
			
		||||
              label: v.groupName
 | 
			
		||||
              label: v.groupName,
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
@@ -192,7 +198,7 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    getGirdList() {
 | 
			
		||||
      this.$instance.post(`/app/appgirdinfo/listAllByTop`).then(res => {
 | 
			
		||||
      this.$instance.post(`/app/appgirdinfo/listAllByTop`).then((res) => {
 | 
			
		||||
        if (res.code == 0) {
 | 
			
		||||
          this.arr = res.data
 | 
			
		||||
          this.gridList[0] = res.data[0].girdList
 | 
			
		||||
@@ -205,7 +211,6 @@ export default {
 | 
			
		||||
      const column = e.detail.column
 | 
			
		||||
      const value = e.detail.value
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      if (column === column) {
 | 
			
		||||
        this.getGirdData(value)
 | 
			
		||||
      }
 | 
			
		||||
@@ -251,27 +256,29 @@ export default {
 | 
			
		||||
      this.flag = true
 | 
			
		||||
 | 
			
		||||
      this.$loading()
 | 
			
		||||
      this.$instance.post(`/app/appclapeventinfo/addOrUpdate`, {
 | 
			
		||||
        ...this.form,
 | 
			
		||||
        openid: this.user.openid,
 | 
			
		||||
        portrait: this.user.avatarUrl,
 | 
			
		||||
        files: this.form.files,
 | 
			
		||||
        groupName: this.dictList.filter(v => v.value === this.form.groupId)[0].label
 | 
			
		||||
      }).then(res => {
 | 
			
		||||
        this.$hideLoading()
 | 
			
		||||
        this.flag = false
 | 
			
		||||
        if (res.code == 0) {
 | 
			
		||||
          uni.$emit('update')
 | 
			
		||||
          setTimeout(() => {
 | 
			
		||||
            uni.redirectTo({
 | 
			
		||||
              url: './PhotoResult?id=' + res.data.id
 | 
			
		||||
            })
 | 
			
		||||
          }, 400)
 | 
			
		||||
        }
 | 
			
		||||
        this.$hideLoading()
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
      this.$instance
 | 
			
		||||
        .post(`/app/appclapeventinfo/addOrUpdate`, {
 | 
			
		||||
          ...this.form,
 | 
			
		||||
          openid: this.user.openid,
 | 
			
		||||
          portrait: this.user.avatarUrl,
 | 
			
		||||
          files: this.form.files,
 | 
			
		||||
          groupName: this.dictList.filter((v) => v.value === this.form.groupId)[0].label,
 | 
			
		||||
        })
 | 
			
		||||
        .then((res) => {
 | 
			
		||||
          this.$hideLoading()
 | 
			
		||||
          this.flag = false
 | 
			
		||||
          if (res.code == 0) {
 | 
			
		||||
            uni.$emit('update')
 | 
			
		||||
            setTimeout(() => {
 | 
			
		||||
              uni.redirectTo({
 | 
			
		||||
                url: './PhotoResult?id=' + res.data.id,
 | 
			
		||||
              })
 | 
			
		||||
            }, 400)
 | 
			
		||||
          }
 | 
			
		||||
          this.$hideLoading()
 | 
			
		||||
        })
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
@@ -293,7 +300,7 @@ export default {
 | 
			
		||||
      justify-content: space-between;
 | 
			
		||||
      height: 128px;
 | 
			
		||||
      padding-right: 28px;
 | 
			
		||||
      border-bottom: 1px solid #DDDDDD;
 | 
			
		||||
      border-bottom: 1px solid #dddddd;
 | 
			
		||||
 | 
			
		||||
      input {
 | 
			
		||||
        flex: 1;
 | 
			
		||||
@@ -335,7 +342,7 @@ export default {
 | 
			
		||||
 | 
			
		||||
      i {
 | 
			
		||||
        font-size: 32px;
 | 
			
		||||
        color: #FF4466;
 | 
			
		||||
        color: #ff4466;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      span {
 | 
			
		||||
@@ -351,8 +358,8 @@ export default {
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    &.form-item__imgs, &.form-item__textarea {
 | 
			
		||||
    &.form-item__imgs,
 | 
			
		||||
    &.form-item__textarea {
 | 
			
		||||
      .form-item__wrapper {
 | 
			
		||||
        display: block;
 | 
			
		||||
        height: auto;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user