This commit is contained in:
yanran200730
2022-07-02 16:17:55 +08:00
parent 54f0d57b37
commit 58022d5154
7 changed files with 230 additions and 123 deletions

View File

@@ -11,8 +11,6 @@
</div>
</div>
<div class="btns">
<div @click="gotoFamilyList(item)">责任家庭</div>
<!-- <div @click="handleTag(item)">标签设置</div>-->
</div>
</div>
<AiEmpty v-if="!list.length"/>

View File

@@ -15,7 +15,7 @@
</div>
<div class="gird-item" v-if="tertiaryGrid.length">
<h2>三级网格</h2>
<div class="gird-item__wrapper level3" @click="isShowVillage = true">
<div class="gird-item__wrapper level3" @click="getSubInfo">
<h3>专属网格</h3>
<p>{{ tertiaryGrid.length }}</p>
</div>
@@ -42,12 +42,12 @@
<scroll-view scroll-y class="street-wrapper">
<h2 class="title">数据统计</h2>
<div class="street-item__wrapper">
<div class="street-item" v-for="(item, index) in 9" :key="index">
<div class="street-item" v-for="(item, index) in tertiaryInfo" :key="index">
<div class="left">
<i></i>
<h2>网格数</h2>
<h2>{{ index }}</h2>
</div>
<span>12</span>
<span>{{ item }}</span>
</div>
</div>
<h2 class="title">网格列表</h2>
@@ -75,7 +75,8 @@
isShowVillage: false,
topGrid: [],
secondaryGrid: [],
tertiaryGrid: []
tertiaryGrid: [],
tertiaryInfo: {}
}
},
@@ -94,6 +95,16 @@
})
},
getSubInfo () {
this.$loading()
this.$http.post(`/api/appgirdinfo/girdInfoCountByThree`).then(res => {
if (res.code === 0) {
this.isShowVillage = true
this.tertiaryInfo = res.data
}
})
},
getInfo () {
this.$http.post(`/api/appgirdinfo/listAllByTop`).then(res => {
if (res.code === 0) {

View File

@@ -4,7 +4,16 @@
<u-search placeholder="请输入姓名、手机号、店面" :show-action="false" v-model="keyword" confirm-type="search" @search="current = 1, getList()"/>
</AiTopFixed>
<div class="list">
<div class="item" v-for="item in list" :key="item.id" @click="linkTo('./detail?id=' + item.id)">
<u-swipe-action
class="item"
:show="item.show"
:index="index"
v-for="(item, index) in list"
:key="item.id"
@click="onClick"
@open="onOpen"
@content-click="toDetail(item.id, index)"
:options="options">
<div class="title">
<img :src="$cdn + 'xincheng/icon.png'" alt="">
<p>{{ item.businessName }}</p>
@@ -22,7 +31,7 @@
<img :src="$cdn + 'xincheng/wgz@2x.png'" alt="">
<div>李毅-网格长</div>
</div>
</div>
</u-swipe-action>
<AiEmpty v-if="!list.length"></AiEmpty>
</div>
<div class="btn" @click="linkTo('./add')">新增商户</div>
@@ -40,7 +49,21 @@
keyword: '',
current: 1,
pages: 2,
list: []
list: [],
options: [
{
text: '编辑',
style: {
backgroundColor: '#007aff'
}
},
{
text: '删除',
style: {
backgroundColor: '#dd524d'
}
}
]
}
},
@@ -67,12 +90,54 @@
}
}).then((res) => {
if (res.code == 0) {
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
this.list = this.current > 1 ? [...this.list, ...res.data.records.map(v => {
return {
...v,
show: false
}
})] : res.data.records.map(v => {
return {
...v,
show: false
}
})
this.pages = res.data.pages
}
})
},
toDetail (id, index) {
this.list[index].show = false
this.linkTo('./detail?id=' + id)
},
onClick (index, i) {
if (i == 1) {
this.$confirm('确定删除该数据?').then(() => {
this.$http.post('/app/appcompany/delete?id=' + this.list[index].id).then(res => {
if (res.code === 0) {
this.current = 1
this.getList()
}
})
}).catch(() => {
})
} else {
this.list[index].show = false
this.linkTo('./add?id=' + this.list[index].id)
}
},
onOpen (index) {
this.list[index].show = true
this.list.map((val, idx) => {
if(index != idx) {
this.list[idx].show = false
}
})
},
linkTo (url) {
uni.navigateTo({
url

View File

@@ -72,6 +72,9 @@ import {mapState} from 'vuex'
export default {
name: 'add',
appName: '新增商户',
data() {
return {
name: '',
@@ -81,21 +84,19 @@ export default {
businessAddress: '',
businessName: '',
lat: '',
lon: '',
lng: '',
storePicUrl: [],
telephone: ''
}
},
id: ''
}
},
computed: {...mapState(['user'])},
onLoad () {
},
onShow() {
document.title = "新增商户"
onLoad (query) {
this.id = query.id
this.getInfo()
},
methods: {
@@ -104,7 +105,20 @@ export default {
success: res => {
this.form.businessAddress = res.name
this.form.lat = res.latitude
this.form.lon = res.longitude
this.form.lng = res.longitude
}
})
},
getInfo () {
this.$loading()
this.$http.post(`/app/appcompany/getDetailById?id=${this.id}`).then(res => {
if (res.code === 0) {
this.form = {
...this.form,
...res.data,
storePicUrl: res.data.storePicUrl ? [{url: res.data.storePicUrl}] : []
}
}
})
},

View File

@@ -6,7 +6,7 @@
<p>{{ info.bossName }}</p>
<div>
<img :src="$cdn + 'xincheng/dw.png'" alt="" class="local-icon">
<span>{{ info.businessAddress }}</span>
<span>{{ info.businessName }}</span>
</div>
</div>
</div>
@@ -32,7 +32,7 @@
</div>
<div class="info">
<span>地图</span>
<span class="color-3D94FB" @click="openLocation">定位</span>
<span class="color-3D94FB" @click="openLocation">{{ info.businessAddress }}</span>
</div>
</div>
<div class="content" v-if="info.detailList.length">
@@ -94,7 +94,7 @@
call (phone) {
uni.makePhoneCall({
phoneNumber: '114'
phoneNumber: phone
})
},
@@ -105,7 +105,7 @@
uni.openLocation({
latitude: this.info.lat,
longitude: this.info.lon,
longitude: this.info.lng,
success: function () {
console.log('success');
}

View File

@@ -54,9 +54,9 @@
const markers = res.data.records.filter(item => item.lat).map(item => {
return {
title: item.businessName,
lnglat: [item.lon, item.lat],
lnglat: [item.lng, item.lat],
lat: item.lat,
lng: item.lon,
lng: item.lng,
id: item.id,
name: item.businessName
}

View File

@@ -42,17 +42,36 @@ export default {
url: '../AppMerchanStatistics/AppMerchanStatistics'
}
],
isGridMember: false
}
},
onShow() {
document.title = '商户入口'
onLoad () {
this.$http.post(`/api/appgirdmemberinfo/checkLogOnUser`).then(res => {
if (res.code === 0) {
this.isGridMember = res.data.checkType === '1' || res.data.checkType === '2'
}
})
},
methods: {
linkTo (url) {
console.log(url)
if (!this.isGridMember) {
this.$confirm('没有网格员权限', '温馨提示', {
confirmText: '去申报'
}).then(() => {
uni.navigateTo({
url: '../AppMerchanGird/AddUser'
})
}).catch(() => {
})
return
}
uni.navigateTo({url})
}
},
}
}
</script>