bug
This commit is contained in:
@@ -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"/>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -56,7 +79,7 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
getList () {
|
||||
if (this.current > this.pages && this.current !== 1) return
|
||||
|
||||
this.$http.post('/app/appcompany/list', null, {
|
||||
@@ -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
|
||||
|
||||
@@ -68,79 +68,93 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'add',
|
||||
data() {
|
||||
return {
|
||||
name: '',
|
||||
files: [],
|
||||
form: {
|
||||
bossName: '',
|
||||
businessAddress: '',
|
||||
businessName: '',
|
||||
lat: '',
|
||||
lon: '',
|
||||
storePicUrl: [],
|
||||
telephone: ''
|
||||
export default {
|
||||
name: 'add',
|
||||
|
||||
appName: '新增商户',
|
||||
|
||||
data() {
|
||||
return {
|
||||
name: '',
|
||||
files: [],
|
||||
form: {
|
||||
bossName: '',
|
||||
businessAddress: '',
|
||||
businessName: '',
|
||||
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 () {
|
||||
if (!this.form.bossName) {
|
||||
return this.$u.toast('请输入店名')
|
||||
}
|
||||
computed: {...mapState(['user'])},
|
||||
|
||||
if (!this.form.businessAddress) {
|
||||
return this.$u.toast('请输入所在地址')
|
||||
}
|
||||
onLoad (query) {
|
||||
this.id = query.id
|
||||
this.getInfo()
|
||||
},
|
||||
|
||||
if (!this.form.businessName) {
|
||||
return this.$u.toast('请输入店长名称')
|
||||
}
|
||||
methods: {
|
||||
chooseLocation () {
|
||||
uni.chooseLocation({
|
||||
success: res => {
|
||||
this.form.businessAddress = res.name
|
||||
this.form.lat = res.latitude
|
||||
this.form.lng = res.longitude
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
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('提交成功')
|
||||
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}] : []
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
setTimeout(() => {
|
||||
uni.$emit('update')
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 500)
|
||||
save () {
|
||||
if (!this.form.bossName) {
|
||||
return this.$u.toast('请输入店名')
|
||||
}
|
||||
|
||||
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>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -11,49 +11,68 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'AppPageMerchant',
|
||||
appName: '商户入口',
|
||||
data() {
|
||||
return {
|
||||
label: '西城-商户管理',
|
||||
appList: [
|
||||
{
|
||||
name: '商户档案',
|
||||
icon: require('./img/shanghudangan.png'),
|
||||
url: '../AppMerchantManage/AppMerchantManage',
|
||||
isBottom: true
|
||||
},
|
||||
{
|
||||
name: '网格管理',
|
||||
icon: require('./img/wanggeguanli.png'),
|
||||
url: '../AppMerchanGird/AppMerchanGird',
|
||||
isBottom: true
|
||||
},
|
||||
{
|
||||
name: '商户地图',
|
||||
icon: require('./img/shanghuditu.png'),
|
||||
url: '../AppMerchantMap/AppMerchantMap',
|
||||
isBottom: true
|
||||
},
|
||||
{
|
||||
name: '网格统计',
|
||||
icon: require('./img/wanggetongji.png'),
|
||||
url: '../AppMerchanStatistics/AppMerchanStatistics'
|
||||
export default {
|
||||
name: 'AppPageMerchant',
|
||||
appName: '商户入口',
|
||||
data() {
|
||||
return {
|
||||
label: '西城-商户管理',
|
||||
appList: [
|
||||
{
|
||||
name: '商户档案',
|
||||
icon: require('./img/shanghudangan.png'),
|
||||
url: '../AppMerchantManage/AppMerchantManage',
|
||||
isBottom: true
|
||||
},
|
||||
{
|
||||
name: '网格管理',
|
||||
icon: require('./img/wanggeguanli.png'),
|
||||
url: '../AppMerchanGird/AppMerchanGird',
|
||||
isBottom: true
|
||||
},
|
||||
{
|
||||
name: '商户地图',
|
||||
icon: require('./img/shanghuditu.png'),
|
||||
url: '../AppMerchantMap/AppMerchantMap',
|
||||
isBottom: true
|
||||
},
|
||||
{
|
||||
name: '网格统计',
|
||||
icon: require('./img/wanggetongji.png'),
|
||||
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>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user