Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
aixianling
2022-02-23 12:04:27 +08:00
2 changed files with 121 additions and 112 deletions

View File

@@ -9,8 +9,7 @@
</div>
</div>
<div class="activity-list">
<div class="item" hover-class="bg-hover" @click="$linkTo(`/village/villageActivity/ActivityDetail?id=${item.id}`)"
v-for="(item, index) in list" :key="index">
<div class="item" hover-class="bg-hover" @click="$linkTo(`./ActivityDetail?id=${item.id}`)" v-for="(item, index) in list" :key="index">
<div class="left">
<h2>{{ item.title }}</h2>
<div class="left-info">
@@ -23,7 +22,7 @@
</div>
<div class="right">
<span :class="'status' + item.status">{{ item.statusName }}</span>
<image :src="item.url" mode="aspectFill"/>
<image :src="item.url" mode="aspectFill" />
</div>
</div>
<AiEmpty v-if="!list.length"></AiEmpty>
@@ -33,15 +32,15 @@
<script>
export default {
name: "AppVillageActivity",
appName: "居民活动",
name: 'AppVillageActivity',
appName: '居民活动',
data() {
return {
list: [],
pageShow: false,
current: 1,
total: 0,
isMore: false
isMore: false,
}
},
@@ -56,29 +55,31 @@ export default {
getList() {
if (this.isMore) return
this.$instance.post(`/app/appvillageactivityinfo/listUp`, null, {
this.$instance
.post(`/app/appvillageactivityinfo/listUp`, null, {
params: {
current: this.current,
size: 15,
areaId: uni.getStorageSync('areaId')
}
}).then(res => {
areaId: uni.getStorageSync('areaId'),
},
})
.then((res) => {
if (res.code == 0) {
this.total = res.data.total
if (this.current > 1) {
this.list = [...this.list, ...res.data.records].map(v => {
this.list = [...this.list, ...res.data.records].map((v) => {
return {
...v,
statusName: this.$dict.getLabel('villageActivityStatus', v.status),
url: v.url ? JSON.parse(v.url)[0].url : ''
url: v.url ? JSON.parse(v.url)[0].url : '',
}
})
} else {
this.list = res.data.records.map(v => {
this.list = res.data.records.map((v) => {
return {
...v,
statusName: this.$dict.getLabel('villageActivityStatus', v.status),
url: v.url ? JSON.parse(v.url)[0].url : ''
url: v.url ? JSON.parse(v.url)[0].url : '',
}
})
}
@@ -94,15 +95,16 @@ export default {
} else {
uni.hideLoading()
}
}).catch(() => {
})
.catch(() => {
uni.hideLoading()
})
}
},
},
onReachBottom() {
this.getList()
}
},
}
</script>
@@ -133,7 +135,7 @@ export default {
}
i {
color: #4181FF;
color: #4181ff;
font-style: normal;
font-size: 28px;
}
@@ -173,7 +175,7 @@ export default {
align-items: center;
i {
color: #4181FF;
color: #4181ff;
font-style: normal;
font-size: 26px;
}
@@ -207,15 +209,15 @@ export default {
}
.status0 {
background: #42D784;
background: #42d784;
}
.status1 {
background: #1AAAFF;
background: #1aaaff;
}
.status2 {
background: #E4E4E4;
background: #e4e4e4;
}
}
}

View File

@@ -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(() => {
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.$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 => {
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
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;