This commit is contained in:
liuye
2022-03-16 08:38:51 +08:00
4 changed files with 59 additions and 50 deletions

View File

@@ -44,6 +44,7 @@ export default {
let {corpId, code, suiteId, id} = this.$route.query let {corpId, code, suiteId, id} = this.$route.query
if (this.isPreview) { if (this.isPreview) {
this.access = true this.access = true
} else if (this.access) {
} else if (!!this.token) { } else if (!!this.token) {
this.$http.post("/app/appquestionnairetemplate/commitCheck", null, { this.$http.post("/app/appquestionnairetemplate/commitCheck", null, {
params: {id} params: {id}
@@ -65,12 +66,10 @@ export default {
} else this.getCode() } else this.getCode()
}, },
}, },
created() {
this.checkAccess()
},
onShow() { onShow() {
document.title = '问卷调查' document.title = '问卷调查'
wx.hideOptionMenu() wx.hideOptionMenu()
this.checkAccess()
}, },
} }
</script> </script>

View File

@@ -8,8 +8,7 @@
当前<br>位置 当前<br>位置
</div> --> </div> -->
<div class="map-content"> <div class="map-content">
<AiTMap v-if="user.areaId" :areaId="user.areaId" :map.sync="map" :lib.sync="lib" :ops="ops" <AiTMap :map.sync="map" :lib.sync="lib" :ops="ops" :libraries="['service', 'tools']"/>
:libraries="['service', 'tools']"/>
</div> </div>
<div class="footer"> <div class="footer">
<div class="btn" @click="confirm">确认定位</div> <div class="btn" @click="confirm">确认定位</div>
@@ -63,10 +62,9 @@ export default {
markerLayer: '', markerLayer: '',
isFlag: false, isFlag: false,
latLng: {lat: '', lng: ''}, latLng: {lat: '', lng: ''},
retryTimes: 0
} }
}, },
computed: {...mapState(['user',])}, computed: {...mapState(['user'])},
mounted() { mounted() {
this.initMap() this.initMap()
}, },
@@ -74,36 +72,33 @@ export default {
document.title = "楼栋定位" document.title = "楼栋定位"
}, },
methods: { methods: {
initMap() { //初始化地图 initMap(retryTimes = 0) { //初始化地图
this.$nextTick(() => { this.$nextTick(() => {
let {map, retryTimes} = this let {map} = this
if (map) { if (map) {
map.setZoom(15) map.setZoom(15)
map.on("click", (evt) => { map.on("click", (evt) => {
this.handleMapClick(evt) this.handleMapClick(evt)
}); });
} else { } else {
if (retryTimes < 5) if (retryTimes < 10)
setTimeout(() => { setTimeout(() => {
this.retryTimes++ this.initMap(++retryTimes)
this.initMap() }, 500)
}, 1000) else console.error("地图渲染失败")
} }
}) })
}, },
getLocale() { getLocale() {
wx.getLocation({ wx.getLocation({
type: 'gcj02', type: 'gcj02',
success: res => { success: res => {
console.log(res)
let {latitude: lat, longitude: lng} = res let {latitude: lat, longitude: lng} = res
this.handleMapClick({latlng: {lat, lng}}) this.handleMapClick({latlng: {lat, lng}})
} }
}) })
}, },
handleMapClick(evt) { handleMapClick(evt) {
console.log(evt.latLng)
let {lib: TMap, map} = this let {lib: TMap, map} = this
if (this.markerLayer) { if (this.markerLayer) {
this.markerLayer.setMap(null); this.markerLayer.setMap(null);

View File

@@ -51,6 +51,8 @@
</template> </template>
<script> <script>
import qs from 'query-string'
export default { export default {
name: 'Content', name: 'Content',
components: {}, components: {},
@@ -92,7 +94,6 @@ export default {
document.title = this.titleList[this.status] document.title = this.titleList[this.status]
}, },
methods: { methods: {
typeList() { typeList() {
this.$http.post(`/app/appclapeventgroup/list`, null, { this.$http.post(`/app/appclapeventgroup/list`, null, {
params: { params: {
@@ -106,7 +107,6 @@ export default {
} }
}) })
}, },
confirm() { confirm() {
if (this.status == 4 && !this.forms.name) { if (this.status == 4 && !this.forms.name) {
return this.$u.toast('请选择转交对象') return this.$u.toast('请选择转交对象')
@@ -161,7 +161,8 @@ export default {
this.forms.groupId = e[0].value this.forms.groupId = e[0].value
}, },
toSelectUser() { toSelectUser() {
uni.navigateTo({url: './SelectUser'}) let {id} = this.selectUser
uni.navigateTo({url: qs.stringifyUrl({url: './SelectUser', query: {id}})})
}, },
}, },
} }

View File

@@ -2,7 +2,8 @@
<div class="SelectUser"> <div class="SelectUser">
<div class="header-middle"> <div class="header-middle">
<div class="hint"> <div class="hint">
<span v-for="(item, index) in slectList" :key="index"><span v-if="index" style="margin:0 4px;">/</span><span style="color:#3F8DF5" @click="girdNameClick(item, index)">{{item.girdName}}</span></span> <span v-for="(item, index) in slectList" :key="index"><span v-if="index" style="margin:0 4px;">/</span><span
style="color:#3F8DF5" @click="girdNameClick(item, index)">{{ item.girdName }}</span></span>
</div> </div>
<div class="showTypes" v-if="!userList.length"> <div class="showTypes" v-if="!userList.length">
@@ -11,14 +12,16 @@
<div class="imges"> <div class="imges">
<span v-if="item.girdLevel == 1" style="width: 24px;"></span> <span v-if="item.girdLevel == 1" style="width: 24px;"></span>
<span v-if="item.girdLevel == 2"> <span v-if="item.girdLevel == 2">
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="item.isChecked" @click.stop="girdClick(item, index)" /> <img src="./components/img/xzh.png" alt="" class="imgselect" v-if="item.isChecked"
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click.stop="girdClick(item, index)" /> @click.stop="girdClick(item, index)"/>
<img src="./components/img/xz.png" alt="" class="imgselect" v-else
@click.stop="girdClick(item, index)"/>
</span> </span>
<img src="./components/img/gird--select-icon.png" alt="" class="avatras" /> <img src="./components/img/gird--select-icon.png" alt="" class="avatras"/>
</div> </div>
<div class="rightes"> <div class="rightes">
<div class="applicationNames">{{ item.girdName }}</div> <div class="applicationNames">{{ item.girdName }}</div>
<img src="./components/img/right-icon.png" alt="" class="imgs" /> <img src="./components/img/right-icon.png" alt="" class="imgs"/>
</div> </div>
</div> </div>
</div> </div>
@@ -30,14 +33,17 @@
<div v-if="userList.length > 0"> <div v-if="userList.length > 0">
<div class="cards" v-for="(e, index) in userList" :key="index"> <div class="cards" v-for="(e, index) in userList" :key="index">
<div class="imges"> <div class="imges">
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="e.isChecked" @click="userClick(e, index)" /> <img src="./components/img/xzh.png" alt="" class="imgselect" v-if="e.isChecked"
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click="userClick(e, index)" /> @click="userClick(e, index)"/>
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click="userClick(e, index)"/>
<img src="./components/img/tx@2x.png" alt="" class="avatras" /> <img src="./components/img/tx@2x.png" alt="" class="avatras"/>
</div> </div>
<div class="rights"> <div class="rights">
<div class="applicationNames"><AiOpenData v-if="e.name" type="userName" :openid="e.name" style="display: block;"/></div> <div class="applicationNames">
<AiOpenData v-if="e.name" type="userName" :openid="e.name" style="display: block;"/>
</div>
<div class="idNumbers">{{ e.phone }}</div> <div class="idNumbers">{{ e.phone }}</div>
</div> </div>
</div> </div>
@@ -67,6 +73,7 @@ export default {
} }
}, },
onLoad() { onLoad() {
this.selectUser.id = this.$route.query.id
this.getTree() this.getTree()
}, },
onShow() { onShow() {
@@ -84,14 +91,14 @@ export default {
}, },
treeInit() { treeInit() {
if(this.allData[0].girdLevel == 2) { if (this.allData[0].girdLevel == 2) {
if(this.allData[0].girdMemberList && this.allData[0].girdMemberList.length) { if (this.allData[0].girdMemberList && this.allData[0].girdMemberList.length) {
this.userList = this.allData[0].girdMemberList this.userList = this.allData[0].girdMemberList
this.userList.map((item) => { this.userList.map((item) => {
item.isChecked = false item.isChecked = item.id == this.selectUser.id
}) })
} }
}else { } else {
this.treeList = this.allData[0].girdList this.treeList = this.allData[0].girdList
} }
var obj = { var obj = {
@@ -114,19 +121,19 @@ export default {
searckGird(row) { searckGird(row) {
this.treeList = [] this.treeList = []
if(row.girdLevel != 2) { //查网格 if (row.girdLevel != 2) { //查网格
this.$http.post(`/app/appgirdinfo/list?parentGirdId=${row.id}&size=999`).then((res) => { this.$http.post(`/app/appgirdinfo/list?parentGirdId=${row.id}&size=999`).then((res) => {
if (res?.data) { if (res?.data) {
this.treeList = res.data.records this.treeList = res.data.records.map(e => ({...e, isChecked: e.id == this.selectUser.id}))
} }
}) })
}else { //查网格员 } else { //查网格员
this.userList = [] this.userList = []
this.$http.post(`/app/appgirdmemberinfo/listByGirdIdByThree?girdId=${row.id}`).then((res) => { this.$http.post(`/app/appgirdmemberinfo/listByGirdIdByThree?girdId=${row.id}`).then((res) => {
if (res?.data) { if (res?.data) {
this.userList = res.data this.userList = res.data
this.userList.map((item) => { this.userList.map((item) => {
item.isChecked = false item.isChecked = item.id == this.selectUser.id
}) })
} }
}) })
@@ -135,13 +142,13 @@ export default {
girdNameClick(row, index) { girdNameClick(row, index) {
this.userList = [] this.userList = []
if(!index) { //第一级别 if (!index) { //第一级别
this.slectList = [] this.slectList = []
this.treeInit() this.treeInit()
}else { } else {
var list = [] var list = []
this.slectList.map((item, i) => { this.slectList.map((item, i) => {
if(i <= index) { if (i <= index) {
list.push(item) list.push(item)
} }
}) })
@@ -156,10 +163,9 @@ export default {
this.treeList[index].isChecked = false this.treeList[index].isChecked = false
this.selectUser = {} this.selectUser = {}
} else { } else {
this.treeList.map((item) => { this.treeList.map((item, i) => {
item.isChecked = false item.isChecked = index == i
}) })
this.treeList[index].isChecked = true
this.selectUser = row this.selectUser = row
} }
this.$forceUpdate() this.$forceUpdate()
@@ -170,10 +176,9 @@ export default {
this.userList[index].isChecked = false this.userList[index].isChecked = false
this.selectUser = {} this.selectUser = {}
} else { } else {
this.userList.map((item) => { this.userList.map((item, i) => {
item.isChecked = false item.isChecked = index == i
}) })
this.userList[index].isChecked = true
this.selectUser = row this.selectUser = row
} }
this.$forceUpdate() this.$forceUpdate()
@@ -182,7 +187,7 @@ export default {
submit() { submit() {
if (this.selectUser.id != null) { if (this.selectUser.id != null) {
uni.$emit('goback', this.selectUser) uni.$emit('goback', this.selectUser)
uni.navigateBack() uni.navigateBack({})
} else { } else {
return this.$u.toast('请选择网格或网格员') return this.$u.toast('请选择网格或网格员')
} }
@@ -195,6 +200,7 @@ export default {
.SelectUser { .SelectUser {
height: 100%; height: 100%;
background: #fff; background: #fff;
.header-top { .header-top {
background: #fff; background: #fff;
padding: 20px 32px; padding: 20px 32px;
@@ -202,10 +208,11 @@ export default {
.header-middle { .header-middle {
padding-bottom: 140px; padding-bottom: 140px;
.hint { .hint {
padding: 28px 20px 28px 32px; padding: 28px 20px 28px 32px;
line-height: 56px; line-height: 56px;
box-shadow: 0px 1px 0px 0px #e4e5e6; box-shadow: 0 1px 0 0 #e4e5e6;
font-size: 30px; font-size: 30px;
font-weight: 500; font-weight: 500;
// word-break: break-all; // word-break: break-all;
@@ -244,11 +251,13 @@ export default {
margin-left: 36px; margin-left: 36px;
} }
} }
img { img {
width: 74px; width: 74px;
height: 74px; height: 74px;
border-radius: 8px; border-radius: 8px;
} }
.rightes { .rightes {
width: calc(100% - 160px); width: calc(100% - 160px);
display: flex; display: flex;
@@ -265,6 +274,7 @@ export default {
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.imgs { .imgs {
width: 40px; width: 40px;
height: 40px; height: 40px;
@@ -286,6 +296,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
width: 200px; width: 200px;
.imgselect { .imgselect {
width: 48px; width: 48px;
height: 48px; height: 48px;
@@ -307,6 +318,7 @@ export default {
margin-left: 32px; margin-left: 32px;
border-bottom: 1px solid #e4e5e6; border-bottom: 1px solid #e4e5e6;
padding-right: 40px; padding-right: 40px;
.applicationNames { .applicationNames {
font-size: 36px; font-size: 36px;
font-weight: 500; font-weight: 500;
@@ -315,6 +327,7 @@ export default {
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.idNumbers { .idNumbers {
color: #666; color: #666;
} }
@@ -330,6 +343,7 @@ export default {
width: 100%; width: 100%;
height: 118px; height: 118px;
background: #f4f8fb; background: #f4f8fb;
div { div {
width: 192px; width: 192px;
height: 80px; height: 80px;