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> </div>
<div class="btns"> <div class="btns">
<div @click="gotoFamilyList(item)">责任家庭</div>
<!-- <div @click="handleTag(item)">标签设置</div>-->
</div> </div>
</div> </div>
<AiEmpty v-if="!list.length"/> <AiEmpty v-if="!list.length"/>

View File

@@ -15,7 +15,7 @@
</div> </div>
<div class="gird-item" v-if="tertiaryGrid.length"> <div class="gird-item" v-if="tertiaryGrid.length">
<h2>三级网格</h2> <h2>三级网格</h2>
<div class="gird-item__wrapper level3" @click="isShowVillage = true"> <div class="gird-item__wrapper level3" @click="getSubInfo">
<h3>专属网格</h3> <h3>专属网格</h3>
<p>{{ tertiaryGrid.length }}</p> <p>{{ tertiaryGrid.length }}</p>
</div> </div>
@@ -42,12 +42,12 @@
<scroll-view scroll-y class="street-wrapper"> <scroll-view scroll-y class="street-wrapper">
<h2 class="title">数据统计</h2> <h2 class="title">数据统计</h2>
<div class="street-item__wrapper"> <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"> <div class="left">
<i></i> <i></i>
<h2>网格数</h2> <h2>{{ index }}</h2>
</div> </div>
<span>12</span> <span>{{ item }}</span>
</div> </div>
</div> </div>
<h2 class="title">网格列表</h2> <h2 class="title">网格列表</h2>
@@ -75,7 +75,8 @@
isShowVillage: false, isShowVillage: false,
topGrid: [], topGrid: [],
secondaryGrid: [], 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 () { getInfo () {
this.$http.post(`/api/appgirdinfo/listAllByTop`).then(res => { this.$http.post(`/api/appgirdinfo/listAllByTop`).then(res => {
if (res.code === 0) { 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()"/> <u-search placeholder="请输入姓名、手机号、店面" :show-action="false" v-model="keyword" confirm-type="search" @search="current = 1, getList()"/>
</AiTopFixed> </AiTopFixed>
<div class="list"> <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"> <div class="title">
<img :src="$cdn + 'xincheng/icon.png'" alt=""> <img :src="$cdn + 'xincheng/icon.png'" alt="">
<p>{{ item.businessName }}</p> <p>{{ item.businessName }}</p>
@@ -22,7 +31,7 @@
<img :src="$cdn + 'xincheng/wgz@2x.png'" alt=""> <img :src="$cdn + 'xincheng/wgz@2x.png'" alt="">
<div>李毅-网格长</div> <div>李毅-网格长</div>
</div> </div>
</div> </u-swipe-action>
<AiEmpty v-if="!list.length"></AiEmpty> <AiEmpty v-if="!list.length"></AiEmpty>
</div> </div>
<div class="btn" @click="linkTo('./add')">新增商户</div> <div class="btn" @click="linkTo('./add')">新增商户</div>
@@ -40,7 +49,21 @@
keyword: '', keyword: '',
current: 1, current: 1,
pages: 2, pages: 2,
list: [] list: [],
options: [
{
text: '编辑',
style: {
backgroundColor: '#007aff'
}
},
{
text: '删除',
style: {
backgroundColor: '#dd524d'
}
}
]
} }
}, },
@@ -56,7 +79,7 @@
}, },
methods: { methods: {
getList() { getList () {
if (this.current > this.pages && this.current !== 1) return if (this.current > this.pages && this.current !== 1) return
this.$http.post('/app/appcompany/list', null, { this.$http.post('/app/appcompany/list', null, {
@@ -67,12 +90,54 @@
} }
}).then((res) => { }).then((res) => {
if (res.code == 0) { 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 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) { linkTo (url) {
uni.navigateTo({ uni.navigateTo({
url url

View File

@@ -68,79 +68,93 @@
</template> </template>
<script> <script>
import {mapState} from 'vuex' import {mapState} from 'vuex'
export default { export default {
name: 'add', name: 'add',
data() {
return { appName: '新增商户',
name: '',
files: [], data() {
form: { return {
bossName: '', name: '',
businessAddress: '', files: [],
businessName: '', form: {
lat: '', bossName: '',
lon: '', businessAddress: '',
storePicUrl: [], businessName: '',
telephone: '' lat: '',
lng: '',
storePicUrl: [],
telephone: ''
},
id: ''
} }
}
},
computed: {...mapState(['user'])},
onLoad () {
},
onShow() {
document.title = "新增商户"
},
methods: {
chooseLocation () {
uni.chooseLocation({
success: res => {
this.form.businessAddress = res.name
this.form.lat = res.latitude
this.form.lon = res.longitude
}
})
}, },
save () { computed: {...mapState(['user'])},
if (!this.form.bossName) {
return this.$u.toast('请输入店名')
}
if (!this.form.businessAddress) { onLoad (query) {
return this.$u.toast('请输入所在地址') this.id = query.id
} this.getInfo()
},
if (!this.form.businessName) { methods: {
return this.$u.toast('请输入店长名称') chooseLocation () {
} uni.chooseLocation({
success: res => {
this.form.businessAddress = res.name
this.form.lat = res.latitude
this.form.lng = res.longitude
}
})
},
this.$loading() getInfo () {
this.$http.post('/api/appcompany/addORUpdate', { this.$loading()
...this.form, this.$http.post(`/app/appcompany/getDetailById?id=${this.id}`).then(res => {
storePicUrl: this.form.storePicUrl.length ? this.form.storePicUrl[0].url : '' if (res.code === 0) {
}).then(res => { this.form = {
if (res.code === 0) { ...this.form,
this.$u.toast('提交成功') ...res.data,
storePicUrl: res.data.storePicUrl ? [{url: res.data.storePicUrl}] : []
}
}
})
},
setTimeout(() => { save () {
uni.$emit('update') if (!this.form.bossName) {
uni.navigateBack({ return this.$u.toast('请输入店名')
delta: 1 }
})
}, 500) if (!this.form.businessAddress) {
return this.$u.toast('请输入所在地址')
}
if (!this.form.businessName) {
return this.$u.toast('请输入店长名称')
}
this.$loading()
this.$http.post('/api/appcompany/addORUpdate', {
...this.form,
storePicUrl: this.form.storePicUrl.length ? this.form.storePicUrl[0].url : ''
}).then(res => {
if (res.code === 0) {
this.$u.toast('提交成功')
setTimeout(() => {
uni.$emit('update')
uni.navigateBack({
delta: 1
})
}, 500)
}
})
} }
})
} }
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

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

View File

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

View File

@@ -11,49 +11,68 @@
</template> </template>
<script> <script>
export default { export default {
name: 'AppPageMerchant', name: 'AppPageMerchant',
appName: '商户入口', appName: '商户入口',
data() { data() {
return { return {
label: '西城-商户管理', label: '西城-商户管理',
appList: [ appList: [
{ {
name: '商户档案', name: '商户档案',
icon: require('./img/shanghudangan.png'), icon: require('./img/shanghudangan.png'),
url: '../AppMerchantManage/AppMerchantManage', url: '../AppMerchantManage/AppMerchantManage',
isBottom: true isBottom: true
}, },
{ {
name: '网格管理', name: '网格管理',
icon: require('./img/wanggeguanli.png'), icon: require('./img/wanggeguanli.png'),
url: '../AppMerchanGird/AppMerchanGird', url: '../AppMerchanGird/AppMerchanGird',
isBottom: true isBottom: true
}, },
{ {
name: '商户地图', name: '商户地图',
icon: require('./img/shanghuditu.png'), icon: require('./img/shanghuditu.png'),
url: '../AppMerchantMap/AppMerchantMap', url: '../AppMerchantMap/AppMerchantMap',
isBottom: true isBottom: true
}, },
{ {
name: '网格统计', name: '网格统计',
icon: require('./img/wanggetongji.png'), icon: require('./img/wanggetongji.png'),
url: '../AppMerchanStatistics/AppMerchanStatistics' url: '../AppMerchanStatistics/AppMerchanStatistics'
}
],
isGridMember: false
}
},
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) {
if (!this.isGridMember) {
this.$confirm('没有网格员权限', '温馨提示', {
confirmText: '去申报'
}).then(() => {
uni.navigateTo({
url: '../AppMerchanGird/AddUser'
})
}).catch(() => {
})
return
}
uni.navigateTo({url})
}
} }
}, }
onShow() {
document.title = '商户入口'
},
methods: {
linkTo(url) {
console.log(url)
uni.navigateTo({url})
}
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>