This commit is contained in:
花有清香月有阴
2022-02-23 13:45:24 +08:00
5 changed files with 136 additions and 82 deletions

View File

@@ -112,7 +112,7 @@ export default {
})
})
uni.navigateTo({
url: "/pages/supermarket/balance?category=" + JSON.stringify(filter)
url: "./balance?category=" + JSON.stringify(filter)
})
},
active(key) {
@@ -255,7 +255,6 @@ uni-page-body {
.less {
width: 40px;
height: 40px;
font-size: 20px;
display: flex;
align-items: center;
justify-content: center;

View File

@@ -109,12 +109,12 @@ export default {
.then(res => {
if (res.code == 0) {
uni.navigateTo({
url: '/pages/supermarket/components/resultPage/resultPage'
url: './resultPage'
})
} else {
uni.navigateTo({
url:
'/pages/supermarket/components/resultPage/resultPage?flag=' +
'./resultPage?flag=' +
false
})
}
@@ -128,7 +128,7 @@ export default {
},
handleSelect() {
uni.navigateTo({
url: '/pages/supermarket/search'
url: './search'
})
}
}

View File

@@ -0,0 +1,69 @@
<template>
<div class="result-page">
<img :src="imgSrc" alt="">
<text>{{ text }}</text>
<u-button type="primary" :custom-style="{width:'100%',borderRadius:'4px',marginTop:'48px'}" @click="goBack">
{{ btnText }}
</u-button>
</div>
</template>
<script>
export default {
name: "result-page",
data() {
return {
flag: true
}
},
onLoad(val) {
if (val.flag) {
this.flag = val.flag
}
},
methods: {
goBack() {
uni.navigateBack({
delta: 3
})
}
},
computed: {
text() {
return this.flag ? '领取成功!' : '领取失败!请联系管理员处理'
},
btnText() {
return this.flag ? '确定' : '我知道了'
},
imgSrc() {
return this.flag ? (this.$cdn + 'other/' + 'kztcg.png') : (this.$cdn + 'other/' + 'kztsb.png')
}
}
}
</script>
<style lang="scss" scoped>
.result-page {
min-height: 100%;
background-color: #ffffff;
display: flex;
flex-direction: column;
align-items: center;
padding: 96px;
img {
width: 192px;
height: 192px;
}
text {
font-size: 36px;
font-weight: 800;
color: #333333;
line-height: 50px;
display: flex;
justify-content: center;
}
}
</style>

View File

@@ -2,17 +2,13 @@
<div class="album">
<div class="form-item__group">
<div class="form-item">
<div class="form-item__wrapper" @click="showSel = true">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>事件类型</h2>
</div>
<div class="form-item__right">
<!-- <ai-select :list="dictList" v-model="form.groupId"></ai-select>
-->
<span :style="{ color: form.groupIdvalue ? '' : '#999' }">{{ form.groupIdvalue ? form.groupIdvalue : '请选择' }}</span>
<u-select v-model="showSel" value-name="value" label-name="label" :list="dictList" @confirm="confirm"></u-select>
<AiSelect :list="dictList" v-model="form.groupId" placeholder="请选择"></AiSelect>
</div>
</div>
</div>
@@ -39,7 +35,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>
@@ -49,11 +45,12 @@
<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>
@@ -63,7 +60,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>
@@ -81,7 +78,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>
@@ -92,7 +89,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>
@@ -104,7 +101,7 @@
</template>
<script>
import { mapState } from 'vuex'
import {mapState} from 'vuex'
export default {
data() {
@@ -121,19 +118,17 @@ export default {
groupName: '',
girdName: '',
girdId: '',
groupIdvalue: '',
files: [],
files: []
},
dictList: [],
arr: [],
gridList: [[], []],
flag: false,
showSel: false,
flag: false
}
},
computed: {
...mapState(['user']),
...mapState(['user'])
},
onLoad() {
@@ -149,44 +144,41 @@ 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: '您未授权定位权限,无法选择位置',
this.$dialog.confirm({
content: '您未授权定位权限,无法选择位置'
}).then(() => {
wx.openSetting({
success: res => {
if (!res.authSetting['scope.userLocation']) {
this.$dialog.alert({
content: '您未授权定位权限,无法选择位置'
}).then(() => {
})
} else {
console.log('设置定位权限')
}
}
})
.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
}
})
}
@@ -200,7 +192,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
@@ -213,6 +205,7 @@ export default {
const column = e.detail.column
const value = e.detail.value
if (column === column) {
this.getGirdData(value)
}
@@ -258,34 +251,27 @@ 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()
})
},
confirm(e) {
this.form.groupId = e[0].value
this.form.groupIdvalue = e[0].label
},
},
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>
@@ -307,7 +293,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;
@@ -349,7 +335,7 @@ export default {
i {
font-size: 32px;
color: #ff4466;
color: #FF4466;
}
span {
@@ -365,8 +351,8 @@ export default {
}
}
&.form-item__imgs,
&.form-item__textarea {
&.form-item__imgs, &.form-item__textarea {
.form-item__wrapper {
display: block;
height: auto;

View File

@@ -42,7 +42,7 @@
<h2>人员类别</h2>
</div>
<div class="form-item__right">
<ai-select v-model="form.type" dict="epidemicRecentPersonType" class="select"></ai-select>
<AiSelect v-model="form.type" dict="epidemicRecentPersonType" class="select"></AiSelect>
</div>
</div>
</div>
@@ -55,7 +55,7 @@
<h2>出行方式</h2>
</div>
<div class="form-item__right">
<ai-select dict="epidemicRecentTravel" v-model="form.travelType" class="select"></ai-select>
<AiSelect dict="epidemicRecentTravel" v-model="form.travelType" class="select"></AiSelect>
</div>
</div>
</div>