xicheng=>xincheng
165
src/project/xincheng/AppMerchanGird/AddGird.vue
Normal file
@@ -0,0 +1,165 @@
|
||||
<template>
|
||||
<div class="AddGird">
|
||||
<AiGroup>
|
||||
<AiItem label="网格名称" required>
|
||||
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" v-model="form.girdName"
|
||||
maxlength="50"/>
|
||||
</AiItem>
|
||||
</AiGroup>
|
||||
<AiGroup>
|
||||
<AiItem label="网格长" topLabel>
|
||||
<AiPagePicker type="sysUser" :selected.sync="form.girdMemberManageList" action="/app/wxcp/wxuser/list?status=1" nodeKey="id">
|
||||
<AiMore :value="getArrayLabel(form.girdMemberManageList)"/>
|
||||
</AiPagePicker>
|
||||
</AiItem>
|
||||
</AiGroup>
|
||||
<AiGroup>
|
||||
<AiItem label="网格员" topLabel>
|
||||
<AiPagePicker type="sysUser" :selected.sync="form.girdMemberList" action="/app/wxcp/wxuser/list?status=1" nodeKey="id">
|
||||
<AiMore :value="getArrayLabel(form.girdMemberList)"/>
|
||||
</AiPagePicker>
|
||||
</AiItem>
|
||||
</AiGroup>
|
||||
<div class="footer" @click="$u.debounce(confirm)">{{ fromType == 'add' ? '确认添加' : '确认修改' }}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: '',
|
||||
form: {
|
||||
girdMemberManageList: [],
|
||||
girdMemberList: []
|
||||
},
|
||||
fromType: 'add', //add新增 edit编辑,
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.id = option.id
|
||||
this.fromType = option.fromType
|
||||
this.getDetail()
|
||||
},
|
||||
onShow() {
|
||||
if (this.fromType == 'add') {
|
||||
document.title = '添加网格'
|
||||
} else {
|
||||
document.title = '编辑网格'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getDetail() {
|
||||
this.$http.post(`/app/appgirdinfo/queryDetailById?id=${this.id}`).then((res) => {
|
||||
if (res?.data) {
|
||||
if (this.fromType == 'edit') {
|
||||
this.form = res.data
|
||||
this.form.girdMemberList?.map(e => e.id = e.wxUserId)
|
||||
this.form.girdMemberManageList?.map(e => e.id = e.wxUserId)
|
||||
}
|
||||
if (this.fromType == 'add') {
|
||||
this.form.parentGirdId = res.data.id
|
||||
this.form.parentGirdName = res.data.girdName
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
confirm() {
|
||||
if (!this.form.girdName) {
|
||||
return this.$u.toast('请输入网格名称')
|
||||
}
|
||||
let girdMemberManageList = this.form.girdMemberManageList?.map((item) => {
|
||||
return {
|
||||
wxUserId: item.id,
|
||||
phone: item.mobile,
|
||||
photo: item.avatar,
|
||||
name: item.name
|
||||
}
|
||||
})
|
||||
let girdMemberList = this.form.girdMemberList?.map((item) => {
|
||||
return {
|
||||
wxUserId: item.id,
|
||||
phone: item.mobile,
|
||||
photo: item.avatar,
|
||||
name: item.name
|
||||
}
|
||||
})
|
||||
this.$http.post(`/app/appgirdinfo/addOrUpdateByEw`, {...this.form, girdMemberManageList, girdMemberList}).then((res) => {
|
||||
if (res?.code == 0) {
|
||||
this.$u.toast('提交成功')
|
||||
uni.$emit('update')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({})
|
||||
}, 600)
|
||||
}
|
||||
}).catch((err) => {
|
||||
this.$u.toast(err)
|
||||
})
|
||||
},
|
||||
getArrayLabel(arr, key = 'name', separation = ',') {
|
||||
return arr?.map(e => e[key])?.join(separation)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AddGird {
|
||||
.item-flex {
|
||||
display: flex;
|
||||
padding: 34px 32px;
|
||||
background-color: #fff;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
margin-bottom: 16px;
|
||||
|
||||
.label {
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
line-height: 22px;
|
||||
width: 150px;
|
||||
|
||||
.tips {
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
color: #F46;
|
||||
line-height: 44px;
|
||||
}
|
||||
}
|
||||
|
||||
.value {
|
||||
width: calc(100% - 150px);
|
||||
line-height: 44px;
|
||||
text-align: right;
|
||||
color: #666;
|
||||
|
||||
img {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
.color-999 {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
background: #1365DD;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
text-align: center;
|
||||
font-size: 36px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #FFF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
230
src/project/xincheng/AppMerchanGird/AddMerchan.vue
Normal file
@@ -0,0 +1,230 @@
|
||||
<template>
|
||||
<div class="AddMerchan">
|
||||
<AiTopFixed>
|
||||
<u-search placeholder="请输入店名、店主、电话" :show-action="false" v-model="businessName" confirm-type="search" @clear="current = 1, getList()" @search="current = 1, getList()"/>
|
||||
</AiTopFixed>
|
||||
<div class="userList" v-if="list.length">
|
||||
<ul v-for="(item,index) in list" :key="index">
|
||||
<li class="main">
|
||||
<div class="user">
|
||||
<div>
|
||||
<img src="./components/img/xz.png" alt="" class="checkbox" v-if="!item.checked" @click="userClick(index)">
|
||||
<img src="./components/img/xzh.png" alt="" class="checkbox" v-else @click="userClick(index)">
|
||||
</div>
|
||||
<div class="userInfo">
|
||||
<div class="item-title">
|
||||
<img :src="$cdn + 'xincheng/icon.png'" alt="">
|
||||
<p>{{ item.businessName }}</p>
|
||||
</div>
|
||||
<div class="info">
|
||||
<img :src="$cdn + 'xincheng/dh.png'" alt="">
|
||||
<div>{{ item.bossName }} {{ item.telephone }}</div>
|
||||
</div>
|
||||
<div class="info" style="margin-bottom: 0;">
|
||||
<img :src="$cdn + 'xincheng/dz@2x.png'" alt="">
|
||||
<div>{{ item.businessAddress }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<AiEmpty description="暂无数据" class="emptyWrap" v-if="!list.length"></AiEmpty>
|
||||
<div style="height:70px;"></div>
|
||||
<div class="footer" @click="confirm">确定选择</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
current: 1,
|
||||
value: '',
|
||||
checked: true,
|
||||
girdMemberId: '',
|
||||
girdId: '',
|
||||
businessName: ''
|
||||
}
|
||||
},
|
||||
computed: { ...mapState(['user']) },
|
||||
|
||||
onLoad (query) {
|
||||
this.girdMemberId = query.id
|
||||
this.girdId = query.girdId
|
||||
|
||||
this.getList()
|
||||
uni.$on('update', () => {
|
||||
this.current = 1
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList(){
|
||||
if (this.current > this.pages && this.current !== 1) return
|
||||
|
||||
this.$loading()
|
||||
this.$http.post('/app/appgirdmembercompany/getUnbindCompany', null, {
|
||||
params: {
|
||||
size: 10,
|
||||
current: this.current,
|
||||
businessName: this.businessName
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.list = this.current > 1 ? [...this.list, ...res.data.records.map(v => {
|
||||
return {
|
||||
...v,
|
||||
checked: false
|
||||
}
|
||||
})] : res.data.records.map(v => {
|
||||
return {
|
||||
...v,
|
||||
checked: false
|
||||
}
|
||||
})
|
||||
this.pages = res.data.pages
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
userClick(index) {
|
||||
this.list[index].checked = !this.list[index].checked
|
||||
},
|
||||
|
||||
confirm() {
|
||||
var checkUserList = this.list.filter(v => v.checked).map(item => {
|
||||
return {
|
||||
companyId: item.id,
|
||||
name: item.businessName,
|
||||
girdId: this.girdId,
|
||||
girdMemberId: this.girdMemberId
|
||||
}
|
||||
})
|
||||
|
||||
if (!checkUserList.length) {
|
||||
return this.$u.toast('请选择责任商户')
|
||||
}
|
||||
|
||||
this.$http.post(`/app/appgirdmembercompany/add`, { companyList: checkUserList}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$u.toast('提交成功')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
uni.$emit('updateList')
|
||||
}, 600)
|
||||
}
|
||||
}).catch((err) => {
|
||||
this.$u.toast(err)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
onReachBottom() {
|
||||
this.current = this.current + 1
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AddMerchan {
|
||||
.userList {
|
||||
width: 100%;
|
||||
margin-top: 24px;
|
||||
ul {
|
||||
padding: 0 32px 0 0;
|
||||
li {
|
||||
list-style-type: none;
|
||||
.user {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
padding-top: 24px;
|
||||
padding-left: 32px;
|
||||
height: 100%;
|
||||
.checkbox{
|
||||
margin-top: 20px;
|
||||
margin-right: 32px;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
.userInfo {
|
||||
width: 100%;
|
||||
background: #FFF;
|
||||
border-radius: 16px;
|
||||
padding: 32px 24px 32px 32px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 30px;
|
||||
.item-title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 32px;
|
||||
margin-bottom: 32px;
|
||||
img{
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
margin-right: 16px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
p{
|
||||
flex: 1;
|
||||
font-size: 32px;
|
||||
font-weight: 500;
|
||||
color: #000;
|
||||
line-height: 1.3;
|
||||
}
|
||||
span{
|
||||
display: inline-block;
|
||||
width: calc(100% - 488px);
|
||||
text-align: right;
|
||||
font-size: 24px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #999;
|
||||
line-height: 24px;
|
||||
}
|
||||
}
|
||||
.info{
|
||||
line-height: 1;
|
||||
margin-bottom: 20px;
|
||||
img{
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
div{
|
||||
display: inline-block;
|
||||
width: calc(100% - 44px);
|
||||
word-break: break-all;
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #333;
|
||||
line-height: 40px;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.footer {
|
||||
position: fixed;
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
background-color: #1365DD;
|
||||
line-height: 112px;
|
||||
text-align: center;
|
||||
font-size: 36px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
138
src/project/xincheng/AppMerchanGird/AddUser.vue
Normal file
@@ -0,0 +1,138 @@
|
||||
<template>
|
||||
<section class="AddGird">
|
||||
<div class="item-flex">
|
||||
<div class="label">
|
||||
<span class="tips">*</span>姓名
|
||||
</div>
|
||||
<div class="value">
|
||||
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" v-model="name" maxlength="50"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-flex">
|
||||
<div class="label">
|
||||
<span class="tips">*</span>手机号
|
||||
</div>
|
||||
<div class="value">
|
||||
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" v-model="phone" maxlength="50"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-flex">
|
||||
<div class="label">
|
||||
<span class="tips">*</span>所属网格
|
||||
</div>
|
||||
<div class="value">
|
||||
<AiPagePicker type="gird" v-model="selectGird" valueObj nodeKey="id" formType="2">
|
||||
<AiMore v-model="selectGird.girdName"/>
|
||||
</AiPagePicker>
|
||||
</div>
|
||||
<div class="footer" @click="confirm">确认添加</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
name: '',
|
||||
phone: '',
|
||||
selectGird: {}
|
||||
}
|
||||
},
|
||||
computed: {...mapState(['user'])},
|
||||
onLoad() {
|
||||
this.name = this.user.name || ''
|
||||
this.phone = this.user.phone || ''
|
||||
},
|
||||
onShow() {
|
||||
document.title = '网格员信息申报'
|
||||
},
|
||||
methods: {
|
||||
confirm() {
|
||||
if (!this.name) {
|
||||
return this.$u.toast('请输入姓名')
|
||||
}
|
||||
if (!this.phone) {
|
||||
return this.$u.toast('请输入手机号')
|
||||
}
|
||||
if (!this.selectGird.girdName) {
|
||||
return this.$u.toast('请选择所属网格')
|
||||
}
|
||||
this.$http.post(`/app/appgirdmemberapply/girdMemberCheck?name=${this.name}&phone=${this.phone}&girdName=${this.selectGird.girdName}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
uni.$emit('updateGird')
|
||||
this.linkTo('./AddUserSuccess?status=1')
|
||||
}
|
||||
}).catch((err) => {
|
||||
this.linkTo('./AddUserSuccess?status=0')
|
||||
})
|
||||
},
|
||||
|
||||
linkTo(url) {
|
||||
uni.navigateTo({url})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AddGird {
|
||||
.item-flex {
|
||||
display: flex;
|
||||
padding: 34px 32px;
|
||||
background-color: #fff;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
margin-bottom: 16px;
|
||||
|
||||
.label {
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
line-height: 22px;
|
||||
width: 150px;
|
||||
|
||||
.tips {
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
color: #F46;
|
||||
line-height: 44px;
|
||||
}
|
||||
}
|
||||
|
||||
.value {
|
||||
width: calc(100% - 150px);
|
||||
line-height: 44px;
|
||||
text-align: right;
|
||||
color: #666;
|
||||
|
||||
img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
vertical-align: middle;
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.color-999 {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
background: #1365DD;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
text-align: center;
|
||||
font-size: 36px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #FFF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
85
src/project/xincheng/AppMerchanGird/AddUserSuccess.vue
Normal file
@@ -0,0 +1,85 @@
|
||||
<template>
|
||||
<div class="success">
|
||||
<img src="./components/img/success.png" alt="" v-if="status">
|
||||
<img src="./components/img/fail.png" alt="" v-else>
|
||||
<p>{{ status == 1 ? '信息申报成功!' : '信息申报失败!' }}</p>
|
||||
<p class="text">{{ status == 1 ? '重新进入即可开始正常使用' : '系统无法匹配该申报信息,请联系管理人员进行处理' }}</p>
|
||||
<div class="footer" @click="back">{{ status == 1 ? '确定' : '我知道了' }}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapActions} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "AddUserSuccess",
|
||||
data() {
|
||||
return {
|
||||
status: 1
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
document.title = '网格员信息申报'
|
||||
},
|
||||
onLoad(option) {
|
||||
this.status = option.status
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['getAccount']),
|
||||
back() {
|
||||
this.getAccount().then(() => {
|
||||
uni.reLaunch({url: './AppGridManagement'})
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
uni-page-body {
|
||||
height: 100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.success {
|
||||
text-align: center;
|
||||
|
||||
img {
|
||||
width: 192px;
|
||||
height: 192px;
|
||||
margin: 96px 0 16px 0;
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: 50px;
|
||||
color: #333;
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
width: calc(100% - 96px);
|
||||
height: 88px;
|
||||
line-height: 88px;
|
||||
background: #1365DD;
|
||||
box-shadow: inset 0px 1px 0px 0px #EEEEEE;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #FFF;
|
||||
text-align: center;
|
||||
border-radius: 8px;
|
||||
margin-left: 48px;
|
||||
}
|
||||
|
||||
.text {
|
||||
line-height: 44px;
|
||||
font-size: 28px;
|
||||
width: 500px;
|
||||
margin: 0 auto 72px;
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
312
src/project/xincheng/AppMerchanGird/AppMerchanGird.vue
Normal file
@@ -0,0 +1,312 @@
|
||||
<template>
|
||||
<div class="AppMerchanGird">
|
||||
<template v-if="isGridMember">
|
||||
<div class="pad-t32" />
|
||||
<div class="select-gird" flex>
|
||||
<AiPagePicker type="custom" class="fill" @select="handleSelectGird" nodeKey="id" :ops="{url:'./pickGrid',label:'name'}">
|
||||
<div flex>
|
||||
<img src="./components/img/gird-icon.png" alt="" class="gird-icon">
|
||||
<AiMore v-model="params.girdName" icon="arrow-down"/>
|
||||
</div>
|
||||
</AiPagePicker>
|
||||
<span @click="linkTo('./SetGird?id='+userGird.id)" v-if="isGridAdmin&&!!userGird.id">网格配置</span>
|
||||
</div>
|
||||
<div class="title">网格人员</div>
|
||||
<div class="user-content" v-for="(item, index) in dataInfo.parentGirdMembers" :key="item.id">
|
||||
<div>
|
||||
<!-- <image :src="item.photo" alt="" mode="aspectFill" v-if="item.photo" /> -->
|
||||
<img :src="item.photo" alt="" v-if="item.photo">
|
||||
<img src="./components/img/big-user.png" alt="" v-else>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="name">{{ item.name }}
|
||||
<div class="gird">{{ item.checkType == 2 ? '网格长' : '网格员' }}</div>
|
||||
<span class="family-btn" @click.stop="linkTo(`./merchanList?id=${item.id}&girdId=${userGird.id}`)">网格成员 ></span>
|
||||
</div>
|
||||
<p>{{ item.girdName }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-content user-item" v-for="(item, index) in dataInfo.girdMembers" :key="item.id" @click="viewUser(item.wxUserId)">
|
||||
<div>
|
||||
<!-- <image :src="item.photo" alt="" mode="aspectFill" v-if="item.photo" /> -->
|
||||
<img :src="item.photo" alt="" v-if="item.photo">
|
||||
<img src="./components/img/big-user.png" alt="" v-else>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="name">{{ item.name }}
|
||||
<span class="gird">{{ item.checkType == 2 ? '网格长' : '网格员' }}</span>
|
||||
<span class="family-btn" @click.stop="linkTo(`./merchanList?id=${item.id}&girdId=${userGird.id}`)">网格成员 ></span>
|
||||
</div>
|
||||
<p>{{ item.girdName }} </p>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty description="暂无数据" class="emptyWrap"
|
||||
v-if="dataInfo.parentGirdMembers && !dataInfo.parentGirdMembers.length && !dataInfo.girdMembers.length"></AiEmpty>
|
||||
<AiGap h="112"/>
|
||||
</template>
|
||||
<div v-if="!isGridMember" class="empty">
|
||||
<img src="./components/img/no-admin.png" alt="">
|
||||
<p>没有网格员权限<br/>无法查看网格信息哦~</p>
|
||||
<div class="add-btn" @click="linkTo('./AddUser')">网格员信息申报</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
export default {
|
||||
name: 'AppMerchanGird',
|
||||
appName: '网格构成',
|
||||
data() {
|
||||
return {
|
||||
dataInfo: {},
|
||||
userGird: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
isGridMember() {
|
||||
return this.user.girdCheckType > 0
|
||||
},
|
||||
isGridAdmin() {
|
||||
return this.user.girdCheckType == 2
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.handleSelectGird(this.user.gridInfo)
|
||||
},
|
||||
onShow() {
|
||||
document.title = '网格构成'
|
||||
},
|
||||
mounted() {
|
||||
this.getGirdUserList()
|
||||
uni.$on('goback', (res) => {
|
||||
this.userGird = res
|
||||
this.getGirdUserList()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleSelectGird(v) {
|
||||
this.userGird = v || {}
|
||||
this.getGirdUserList()
|
||||
},
|
||||
getGirdUserList() {
|
||||
this.$http.post(`/app/appgirdmemberinfo/listGirdMemberByGirdId?girdId=${this.userGird.id}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.dataInfo = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
linkTo(url) {
|
||||
uni.navigateTo({url})
|
||||
},
|
||||
viewUser(userid) {
|
||||
userid && this.injectJWeixin('openUserProfile').then(() => {
|
||||
this.wxInvoke(['openUserProfile', {type: 1, userid}, () => 0])
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AppMerchanGird {
|
||||
background-color: #f5f5f5;
|
||||
|
||||
.title {
|
||||
font-size: 38px;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
line-height: 52px;
|
||||
padding-left: 32px;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.user-content {
|
||||
width: calc(100% - 64px);
|
||||
margin: 0 0 32px 32px;
|
||||
background-color: #fff;
|
||||
padding: 32px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
|
||||
img {
|
||||
display: inline-block;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
margin-right: 32px;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
margin-right: 32px;
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 100%;
|
||||
|
||||
.name {
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
line-height: 44px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.gird {
|
||||
display: inline-block;
|
||||
line-height: 44px;
|
||||
background: #E8EFFF;
|
||||
border-radius: 8px;
|
||||
padding: 0 8px;
|
||||
font-size: 26px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #26F;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 26px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #666;
|
||||
line-height: 36px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.user-item {
|
||||
img {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.gird {
|
||||
display: inline-block;
|
||||
margin-left: 16px;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.name {
|
||||
margin-bottom: 8px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.family-btn {
|
||||
font-size: 26px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #3975C6;
|
||||
line-height: 36px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.pad-b112 {
|
||||
padding-bottom: 112px;
|
||||
}
|
||||
}
|
||||
.pad-t32 {
|
||||
padding-top: 32px;
|
||||
}
|
||||
|
||||
.gird-icon {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.select-gird {
|
||||
width: calc(100% - 60px);
|
||||
padding: 24px 32px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16px;
|
||||
margin: 0 30px 32px;
|
||||
box-sizing: border-box;
|
||||
|
||||
img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
width: 112px;
|
||||
height: 48px;
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #3F8DF5;
|
||||
line-height: 48px;
|
||||
}
|
||||
}
|
||||
|
||||
.tabs {
|
||||
width: 100%;
|
||||
height: 98px;
|
||||
background: #fff;
|
||||
border-top: 1px solid #ddd;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
|
||||
img {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 22px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #c4cad4;
|
||||
line-height: 8px;
|
||||
}
|
||||
|
||||
.color-3267F0 {
|
||||
color: #3267f0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
text-align: center;
|
||||
|
||||
img {
|
||||
width: 282px;
|
||||
height: 306px;
|
||||
margin: 136px auto 0;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #999;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
width: 400px;
|
||||
height: 88px;
|
||||
line-height: 88px;
|
||||
text-align: center;
|
||||
border-radius: 8px;
|
||||
background-color: #3267f0;
|
||||
color: #fff;
|
||||
font-size: 30px;
|
||||
margin: 200px auto 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
257
src/project/xincheng/AppMerchanGird/SelectUser.vue
Normal file
@@ -0,0 +1,257 @@
|
||||
<template>
|
||||
<div class="SelectUser">
|
||||
<div class="header-middle">
|
||||
<div class="hint">
|
||||
<u-search v-model="name" placeholder="请输入姓名" :show-action="false" bg-color="#F5F5F5" search-icon-color="#999" color="#999" height="58" @search="getListInit" :clearabled="false"></u-search>
|
||||
</div>
|
||||
|
||||
<div class="showUsers">
|
||||
<div v-if="userList.length > 0">
|
||||
<div class="cards" v-for="(e, index) in userList" :key="index">
|
||||
<div class="imges">
|
||||
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="e.isChecked" @click="userClick(index)" />
|
||||
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click="userClick(index)" />
|
||||
|
||||
<img src="./components/img/tx@2x.png" alt="" class="avatras" />
|
||||
</div>
|
||||
|
||||
<div class="rights">
|
||||
<div class="applicationNames">{{ e.name }}</div>
|
||||
<div class="idNumbers">{{ e.phone }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pad-b140"></div>
|
||||
<div class="subBtn" @click="submit">
|
||||
<div>确定选择</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'SelectUser',
|
||||
data() {
|
||||
return {
|
||||
selectUserList: [],
|
||||
userList: [],
|
||||
name: '',
|
||||
current: 1
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.selectUserList = uni.getStorageSync('selectUserList')
|
||||
this.selectUserList.map((item) => {
|
||||
item.id =item.wxUserId
|
||||
item.mobile = item.phone
|
||||
item.avatar = item.photo
|
||||
})
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getListInit() {
|
||||
this.userList = []
|
||||
this.current = 1
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
this.$http.post(`/app/wxcp/wxuser/list?name=${this.name}¤t=${this.current}&size=10000`).then((res) => {
|
||||
if (res?.data) {
|
||||
res.data.records.map((item) => {
|
||||
item.isChecked = false
|
||||
})
|
||||
|
||||
this.userList = this.current > 1 ? [...this.userList, ...res.data.records] : res.data.records
|
||||
|
||||
this.userList.map((item) => {
|
||||
this.selectUserList.map((e) => {
|
||||
if(e.id == item.id) {
|
||||
item.isChecked = true
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
userClick(index) {
|
||||
this.userList[index].isChecked = !this.userList[index].isChecked
|
||||
this.$forceUpdate()
|
||||
},
|
||||
|
||||
submit() {
|
||||
var selectUserList = []
|
||||
this.userList.map((item) => {
|
||||
if(item.isChecked) {
|
||||
selectUserList.push(item)
|
||||
}
|
||||
})
|
||||
uni.$emit('selectUser', selectUserList)
|
||||
uni.navigateBack()
|
||||
// if (!selectUserList.length) {
|
||||
// return this.$u.toast('请选择人员')
|
||||
// } else {
|
||||
|
||||
// }
|
||||
},
|
||||
},
|
||||
onReachBottom() {
|
||||
this.current ++
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.SelectUser {
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
.pad-b140{
|
||||
padding-bottom: 140px;
|
||||
}
|
||||
.header-top {
|
||||
background: #fff;
|
||||
padding: 20px 32px;
|
||||
}
|
||||
|
||||
.header-middle {
|
||||
.hint {
|
||||
padding: 28px 20px 28px 32px;
|
||||
line-height: 56px;
|
||||
box-shadow: 0px 1px 0px 0px #e4e5e6;
|
||||
font-size: 30px;
|
||||
font-weight: 500;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.showTypes {
|
||||
.empty-div {
|
||||
height: 16px;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.cards {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 120px;
|
||||
line-height: 120px;
|
||||
// background: pink;
|
||||
padding: 0 0 0 32px;
|
||||
|
||||
.imges {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// width: 200px;
|
||||
.imgselect {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.avatras {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
margin-left: 36px;
|
||||
}
|
||||
}
|
||||
img {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.rightes {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-left: 32px;
|
||||
border-bottom: 1px solid #e4e5e6;
|
||||
.applicationNames {
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
.imgs {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.showUsers {
|
||||
.cards {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 120px;
|
||||
line-height: 120px;
|
||||
// background: pink;
|
||||
padding: 0 0 0 32px;
|
||||
|
||||
.imges {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 200px;
|
||||
.imgselect {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
.avatras {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
margin-left: 36px;
|
||||
}
|
||||
}
|
||||
|
||||
.rights {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-left: 32px;
|
||||
border-bottom: 1px solid #e4e5e6;
|
||||
padding-right: 40px;
|
||||
.applicationNames {
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
.idNumbers {
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.subBtn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 118px;
|
||||
background: #f4f8fb;
|
||||
div {
|
||||
width: 192px;
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
text-align: center;
|
||||
background: #1365dd;
|
||||
border-radius: 4px;
|
||||
font-size: 32px;
|
||||
color: #fff;
|
||||
margin: 20px 34px 0 0;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
184
src/project/xincheng/AppMerchanGird/SetGird.vue
Normal file
@@ -0,0 +1,184 @@
|
||||
<template>
|
||||
<div class="setGird">
|
||||
<AiGroup>
|
||||
<AiItem :label="detail.girdName" :border="false" labelBold>
|
||||
<u-icon name="arrow-right" label="查看网格成员" label-pos="left" label-color="#3F8DF5" @click="showGirdInfo()"/>
|
||||
</AiItem>
|
||||
</AiGroup>
|
||||
<AiGroup>
|
||||
<AiItem label="下级网格" top-label :border="false" labelBold>
|
||||
<div v-if="treeList.length > 0">
|
||||
<div class="cards" v-for="(item, index) in treeList" :key="index">
|
||||
<div class="rightes fill" flex>
|
||||
<img src="./components/img/gird--select-icon.png" alt="" class="avatras"/>
|
||||
<div class="applicationNames fill" @click="showGirdInfo(item)">{{ item.girdName }}</div>
|
||||
<u-icon @click="itemClick(item)" name="arrow-right" color="#ddd"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty description="暂无数据" class="emptyWrap" v-else/>
|
||||
</AiItem>
|
||||
</AiGroup>
|
||||
<div class="subBtn" v-if="detail.girdRight==1" flex>
|
||||
<div class="delete" @click="handleDelete">删除网格</div>
|
||||
<div @click="edit">编辑网格</div>
|
||||
<div @click="toAddGird">添加下级网格</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {mapState} from "vuex"
|
||||
|
||||
export default {
|
||||
name: 'setGird',
|
||||
data() {
|
||||
return {
|
||||
detail: {},
|
||||
treeList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user'])
|
||||
},
|
||||
onShow() {
|
||||
this.getAllGrids()
|
||||
document.title = '网格配置'
|
||||
},
|
||||
methods: {
|
||||
getAllGrids() {
|
||||
let {id: parentGirdId} = this.$route.query
|
||||
this.$http.post(`/app/appgirdinfo/listByInfo`, null, {
|
||||
params: {parentGirdId}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
let parents = [...new Set(res.data.map(e => e.parentGirdId))]
|
||||
this.detail = res.data.find(e => e.id == parentGirdId) || {}
|
||||
this.treeList = res.data.filter(e => e.parentGirdId == parentGirdId).map(e => ({...e, hasChildren: parents.includes(e.id)}))
|
||||
}
|
||||
})
|
||||
},
|
||||
itemClick(row) {
|
||||
uni.navigateTo({url: `./SetGird?id=${row.id}`})
|
||||
},
|
||||
showGirdInfo(row = {id: this.$route.query.id}) {
|
||||
uni.navigateTo({url: `./gridMembers?id=${row.id}`})
|
||||
},
|
||||
callPhone(phone) {
|
||||
uni.makePhoneCall({phoneNumber: phone})
|
||||
},
|
||||
toAddGird() {
|
||||
uni.navigateTo({url: `./AddGird?id=${this.detail.id}&fromType=add`})
|
||||
},
|
||||
edit() {
|
||||
uni.navigateTo({url: `./AddGird?id=${this.detail.id}&fromType=edit`})
|
||||
},
|
||||
handleDelete() {
|
||||
this.$confirm('删除网格后,会清除网格内网格员的责任家庭信息,如有下级网格,会同步删除下级网格所有数据', `您确认要删除该网格?`).then(() => {
|
||||
this.$http.post(`/app/appgirdinfo/delete?ids=${this.detail.id}`).then((res) => {
|
||||
if (res?.code == 0) {
|
||||
this.$u.toast('删除成功!')
|
||||
uni.navigateBack({})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.setGird {
|
||||
min-height: 100vh;
|
||||
background: #F5F6F7;
|
||||
padding-bottom: 140px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.empty-div {
|
||||
height: 16px;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.cards {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 120px;
|
||||
line-height: 120px;
|
||||
// background: pink;
|
||||
|
||||
.avatras {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.rightes {
|
||||
display: flex;
|
||||
border-bottom: 1px solid #e4e5e6;
|
||||
padding-right: 16px;
|
||||
|
||||
.applicationNames {
|
||||
display: inline-block;
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.imgs {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin-right: 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.u-icon {
|
||||
padding: 0 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.subBtn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 118px;
|
||||
background: #f4f8fb;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
justify-content: flex-end;
|
||||
|
||||
div {
|
||||
padding: 0 32px;
|
||||
height: 88px;
|
||||
line-height: 88px;
|
||||
text-align: center;
|
||||
background: #1365dd;
|
||||
border-radius: 8px;
|
||||
font-size: 32px;
|
||||
color: #fff;
|
||||
margin-left: 22px;
|
||||
border: 2px #1365dd solid;
|
||||
|
||||
&.delete {
|
||||
background: #fff;
|
||||
color: #f46;
|
||||
border-color: #f46;
|
||||
}
|
||||
|
||||
&:last-of-type {
|
||||
margin-right: 32px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
BIN
src/project/xincheng/AppMerchanGird/components/img/big-user.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
src/project/xincheng/AppMerchanGird/components/img/down-icon.png
Normal file
|
After Width: | Height: | Size: 314 B |
BIN
src/project/xincheng/AppMerchanGird/components/img/fail.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/project/xincheng/AppMerchanGird/components/img/gird-icon.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/project/xincheng/AppMerchanGird/components/img/jujue.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/project/xincheng/AppMerchanGird/components/img/map-icon.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/project/xincheng/AppMerchanGird/components/img/no-admin.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
BIN
src/project/xincheng/AppMerchanGird/components/img/org-icon.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 373 B |
|
After Width: | Height: | Size: 766 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src/project/xincheng/AppMerchanGird/components/img/success.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/project/xincheng/AppMerchanGird/components/img/tx@2x.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/project/xincheng/AppMerchanGird/components/img/user-img.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
src/project/xincheng/AppMerchanGird/components/img/xz.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/project/xincheng/AppMerchanGird/components/img/xzh.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
186
src/project/xincheng/AppMerchanGird/gridMembers.vue
Normal file
@@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<section class="gridMembers">
|
||||
<div class="title">{{ detail.girdName }}</div>
|
||||
<div flex v-for="(item, index) in list" :key="index" class="listItem">
|
||||
<!-- <img class="avatar" :src="item.photo"/>-->
|
||||
<div class="fill">
|
||||
<div class="memberName" v-text="item.name"/>
|
||||
<div flex>
|
||||
<div class="color-999" v-text="item.userRole"/>
|
||||
<div v-if="item.label" class="tag" v-text="item.label"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btns">
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-if="!list.length"/>
|
||||
<div class="btn" v-if="detail.girdRight == 1">
|
||||
<span class="del" @click="del" v-if="!!detail.parentGirdId">删除网格</span>
|
||||
<span class="edit" @click="edit">编辑网格</span>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "gridMembers",
|
||||
appName: "网格成员",
|
||||
computed: {
|
||||
list() {
|
||||
let {girdMemberManageList, girdMemberList} = this.detail
|
||||
return [girdMemberManageList?.map(e => ({...e, userRole: "网格长"})) || [],
|
||||
girdMemberList?.map(e => ({
|
||||
...e,
|
||||
userRole: "网格员"
|
||||
})) || []].flat()
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
detail: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getDetail() {
|
||||
let {id} = this.$route.query
|
||||
this.$http.post("/app/appgirdinfo/queryDetailById", null, {
|
||||
params: {id}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.detail = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
del() {
|
||||
this.$confirm('删除网格后,会清除网格内网格员和责任家庭信息,如有下级网格,会同步删除下级网格所有数据', `您确认要删除该网格?`).then(() => {
|
||||
this.$http.post(`/app/appgirdinfo/delete?ids=${this.detail.id}`).then((res) => {
|
||||
if (res?.code == 0) {
|
||||
this.$u.toast('删除成功!')
|
||||
this.getDetail()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
edit() {
|
||||
uni.navigateTo({url: `./AddGird?id=${this.detail.id}&fromType=edit`})
|
||||
},
|
||||
handleTag({id, label}) {
|
||||
uni.showModal({
|
||||
title: "设置标签",
|
||||
content: label,
|
||||
editable: true,
|
||||
placeholderText: "请输入标签,最多10字",
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
if (res.content && res.content.length <= 10) {
|
||||
this.$http.post("/app/appgirdmemberinfo/updateGirdMemberLabelById", null, {
|
||||
params: {id, label: res.content}
|
||||
}).then(res => {
|
||||
if (res?.code == 0) {
|
||||
this.$u.toast("设置成功")
|
||||
this.getDetail()
|
||||
} else this.handleTag({id, label})
|
||||
}).catch(() => this.handleTag({id, label}))
|
||||
} else {
|
||||
this.$u.toast("请输入标签,最多10字")
|
||||
this.handleTag({id, label})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
gotoFamilyList(item) {
|
||||
uni.navigateTo({url: `./FamilyList?id=${item.id}&girdId=${item.girdId}`})
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getDetail()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.gridMembers {
|
||||
padding: 16px 32px 170px;
|
||||
min-height: 100vh;
|
||||
box-sizing: border-box;
|
||||
|
||||
.color-999 {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
margin-right: 32px;
|
||||
}
|
||||
|
||||
.btns {
|
||||
margin-left: 32px;
|
||||
line-height: 48px;
|
||||
color: #26f;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36px;
|
||||
font-family: PingFang-SC-Heavy, PingFang-SC;
|
||||
font-weight: 800;
|
||||
color: #333;
|
||||
line-height: 50px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.listItem {
|
||||
padding: 20px 0;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 100%;
|
||||
padding: 32px;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
height: 92px;
|
||||
line-height: 90px;
|
||||
border-radius: 8px;
|
||||
font-size: 34px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.del {
|
||||
color: #f46;
|
||||
border: 1px solid #f46;
|
||||
flex: 1;
|
||||
margin-right: 32px;
|
||||
}
|
||||
|
||||
.edit {
|
||||
background-color: #3671EE;
|
||||
color: #fff;
|
||||
flex: 2;
|
||||
}
|
||||
}
|
||||
|
||||
.memberName {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.tag {
|
||||
margin-left: 32px;
|
||||
padding: 4px 8px;
|
||||
border-radius: 8px;
|
||||
background: #26f;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
241
src/project/xincheng/AppMerchanGird/merchanList.vue
Normal file
@@ -0,0 +1,241 @@
|
||||
<template>
|
||||
<div class="merchanList">
|
||||
<AiTopFixed>
|
||||
<u-search placeholder="请输入店名、店主、电话" :show-action="false" v-model="businessName" @clear="current = 1, getList()" @search="current = 1, getList()"/>
|
||||
<div class="title">
|
||||
<div>商户列表({{ pages }})</div>
|
||||
<div v-if="list.length">
|
||||
<span style="font-size: 14px; color: #2979ff;" @click="changeType" v-if="edit">修改</span>
|
||||
<span style="font-size: 14px; color: #2979ff;" @click="edit = true" v-else>取消</span>
|
||||
</div>
|
||||
</div>
|
||||
</AiTopFixed>
|
||||
<div class="main" v-if="list.length">
|
||||
<ul v-for="(item,index) in list" :key="index" @click="linkTo('../AppMerchantManage/detail?id=' + item.id)">
|
||||
<li>
|
||||
<div class="user">
|
||||
<div v-if="!edit">
|
||||
<img src="./components/img/xz.png" alt="" class="checkbox" v-if="!item.checked" @click.stop="userClick(index)">
|
||||
<img src="./components/img/xzh.png" alt="" class="checkbox" v-else @click.stop="userClick(index)">
|
||||
</div>
|
||||
<div class="item-info">
|
||||
<div class="item-title">
|
||||
<img :src="$cdn + 'xincheng/icon.png'" alt="">
|
||||
<p>{{ item.businessName }}</p>
|
||||
</div>
|
||||
<div class="info">
|
||||
<img :src="$cdn + 'xincheng/dh.png'" alt="">
|
||||
<div>{{ item.bossName }} {{ item.telephone }}</div>
|
||||
</div>
|
||||
<div class="info" style="margin-bottom: 0;">
|
||||
<img :src="$cdn + 'xincheng/dz@2x.png'" alt="">
|
||||
<div>{{ item.businessAddress }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<AiEmpty description="暂无数据" class="emptyWrap" v-if="!list.length"></AiEmpty>
|
||||
<div style="height:70px;"></div>
|
||||
<div class="footer" @click="toAddFamily()" v-if="edit">新增责任商户</div>
|
||||
<div class="footer" @click="delFamily()" v-else>删除</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
appName: '责任商户',
|
||||
|
||||
data () {
|
||||
return {
|
||||
list: [],
|
||||
pages: 0,
|
||||
current: 1,
|
||||
userId: '',
|
||||
edit: true,
|
||||
checked: true,
|
||||
girdId: '',
|
||||
businessName: ''
|
||||
}
|
||||
},
|
||||
|
||||
onLoad (option) {
|
||||
this.userId = option.id
|
||||
this.girdId = option.girdId
|
||||
this.getList()
|
||||
uni.$on('updateList', () => {
|
||||
this.current = 1
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList () {
|
||||
if (this.current > this.pages && this.current !== 1) return
|
||||
|
||||
this.$loading()
|
||||
this.$http.post(`/app/appgirdmembercompany/listByGirdMember`, null, {
|
||||
params: {
|
||||
size: 10,
|
||||
current: this.current,
|
||||
name: this.businessName,
|
||||
girdMemberId: this.userId,
|
||||
girdId: this.girdId
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
|
||||
this.pages = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
toAddFamily() {
|
||||
uni.navigateTo({url: `./AddMerchan?id=${this.userId}&girdId=${this.girdId}`})
|
||||
},
|
||||
userClick(index) {
|
||||
this.list[index].checked = !this.list[index].checked
|
||||
this.$forceUpdate()
|
||||
},
|
||||
delFamily() {
|
||||
const ids = this.list.filter(v => v.checked).map(v => v.gmcId)
|
||||
if (!ids.length) {
|
||||
return this.$u.toast('请选择需要删除的责任商户')
|
||||
}
|
||||
this.$confirm(`是否删除这些关联责任商户?`).then(() => {
|
||||
this.$http.post(`/app/appgirdmembercompany/delete?ids=${ids.join(',')}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$u.toast('删除成功')
|
||||
uni.$emit('updateList')
|
||||
this.$forceUpdate()
|
||||
this.edit = true
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
linkTo (url) {
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
},
|
||||
changeType() {
|
||||
this.edit = false
|
||||
this.list.map((item) => {
|
||||
item.checked = false
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
onReachBottom() {
|
||||
this.current = this.current + 1
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.merchanList {
|
||||
min-height: 100vh;
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 24px 32px;
|
||||
background-color: #fff;
|
||||
font-size: 34px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.main {
|
||||
padding-bottom: 112px;
|
||||
|
||||
ul {
|
||||
padding: 0 32px;
|
||||
|
||||
li {
|
||||
list-style-type: none;
|
||||
|
||||
.user {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
padding-top: 24px;
|
||||
|
||||
.checkbox {
|
||||
margin-top: 20px;
|
||||
margin-right: 32px;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
.item-info {
|
||||
width: 100%;
|
||||
background: #FFF;
|
||||
border-radius: 16px;
|
||||
padding: 32px 24px 32px 32px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 30px;
|
||||
.item-title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 32px;
|
||||
img{
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
margin-right: 16px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
p{
|
||||
flex: 1;
|
||||
font-size: 32px;
|
||||
font-weight: 500;
|
||||
color: #000;
|
||||
line-height: 1.3;
|
||||
}
|
||||
span{
|
||||
display: inline-block;
|
||||
width: calc(100% - 488px);
|
||||
text-align: right;
|
||||
font-size: 24px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #999;
|
||||
line-height: 24px;
|
||||
}
|
||||
}
|
||||
.info{
|
||||
line-height: 1;
|
||||
margin-bottom: 20px;
|
||||
img{
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
div{
|
||||
display: inline-block;
|
||||
width: calc(100% - 44px);
|
||||
word-break: break-all;
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #333;
|
||||
line-height: 40px;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: fixed;
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
background-color: #1365DD;
|
||||
line-height: 112px;
|
||||
text-align: center;
|
||||
font-size: 36px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
246
src/project/xincheng/AppMerchanGird/pickGrid.vue
Normal file
@@ -0,0 +1,246 @@
|
||||
<template>
|
||||
<div class="pickGrid">
|
||||
<div class="header-middle">
|
||||
<div class="hint">
|
||||
<span v-for="(item, index) in selectList" :key="index">
|
||||
<span v-if="index" style="margin:0 4px;" v-text="`/`"/>
|
||||
<span style="color:#3F8DF5" @click="girdNameClick(item, index)" v-text="item.girdName"/>
|
||||
</span>
|
||||
</div>
|
||||
<div class="showTypes">
|
||||
<div v-if="options.length > 0">
|
||||
<div class="cards" v-for="(item, index) in options" :key="index">
|
||||
<div class="imges">
|
||||
<img src="./components/img/gird--select-icon.png" alt="" class="avatras"/>
|
||||
</div>
|
||||
<div class="rightes fill">
|
||||
<div class="applicationNames fill" @click="itemClick(item)">{{ item.girdName }}</div>
|
||||
<u-icon class="more" name="arrow-right" @click="girdClick(item, index)"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty :description="isGridMember?`暂无数据`:`当前人员不是网格员或网格长`" class="emptyWrap" v-else/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name: 'pickGrid',
|
||||
appName: "网格选择",
|
||||
data() {
|
||||
return {
|
||||
SelectGird: {},
|
||||
allData: null,
|
||||
options: [],
|
||||
selectList: [],
|
||||
parentGirdId: '',
|
||||
isFormMap: 0, //1为网格地图 一级不允许选中
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
isMyGirds() {
|
||||
return this.$route?.query.self == true
|
||||
},
|
||||
isGridMember() {
|
||||
return this.user.girdCheckType > 0
|
||||
},
|
||||
//是否是网格员申报
|
||||
isApply: v => v.$route?.query.formType == 2,
|
||||
clearable: v => v.$route?.query.clearable,
|
||||
selected: v => [v.$route?.query.selected].flat()
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.isFormMap) {
|
||||
this.isFormMap = option.isFormMap
|
||||
}
|
||||
this.isGridMember || this.isApply ? this.getAllGrids() : this.$u.toast('当前人员不是网格员或网格长')
|
||||
},
|
||||
methods: {
|
||||
getAllGrids() {
|
||||
this.selectList = []
|
||||
let {girdMemberId} = this.user,
|
||||
url = `/app/appgirdmemberinfo/queryMyGirdListByLevel2AndUser`,
|
||||
params = {girdMemberId}
|
||||
if (this.isApply) {
|
||||
url = `/app/appgirdinfo/listByInfo`
|
||||
params = {}
|
||||
}
|
||||
if (this.isMyGirds) {
|
||||
url = `/app/appgirdmemberinfo/queryMyGirdListByLevel2`
|
||||
}
|
||||
this.$http.post(url, null, {params}).then((res) => {
|
||||
if (res?.data) {
|
||||
let parents = res.data.map(e => e.parentGirdId)
|
||||
this.allData = res.data.map(e => ({...e, hasChildren: parents.includes(e.id)}))
|
||||
this.treeInit()
|
||||
}
|
||||
})
|
||||
},
|
||||
treeInit(isClick) {
|
||||
let last = uni.getStorageSync("lastSelectedGrid")
|
||||
if (!isClick && last && !this.isApply) {
|
||||
this.$http.post("/app/appgirdinfo/listFatherGirdInfo", null, {
|
||||
params: {girdId: last}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.selectList = [{girdName: '可选范围', id: ''}, res.data.filter(e => !!this.allData.find(a => a.id == e.id))].flat()
|
||||
this.getGridsByGridMemberAndParent({id: last})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.options = this.allData.filter((e, i, arr) => !arr.map(e => e.id).includes(e.parentGirdId) || this.isMyGirds)
|
||||
this.options.map((item) => item.isChecked = this.selected.includes(item.id))
|
||||
let obj = {girdName: '可选范围', id: ''}
|
||||
this.selectList.push(obj)
|
||||
}
|
||||
},
|
||||
itemClick(row) {
|
||||
if (row.hasChildren) {
|
||||
let obj = {
|
||||
girdName: row.girdName,
|
||||
id: row.id,
|
||||
}
|
||||
this.selectList.push(obj)
|
||||
this.getGridsByGridMemberAndParent(row)
|
||||
}
|
||||
},
|
||||
getGridsByGridMemberAndParent(row) {
|
||||
let {id: parentGirdId} = row
|
||||
this.options = this.allData.filter(e => e.parentGirdId == parentGirdId)
|
||||
this.options.map((item) => item.isChecked = this.selected.includes(item.id))
|
||||
},
|
||||
girdNameClick(row, index) {
|
||||
if (!index) { //第一级别
|
||||
this.selectList = []
|
||||
this.treeInit(true)
|
||||
} else {
|
||||
this.selectList.splice(index, 8)
|
||||
this.getGridsByGridMemberAndParent(row)
|
||||
}
|
||||
},
|
||||
girdClick(row) {
|
||||
this.SelectGird = row
|
||||
this.$forceUpdate()
|
||||
this.submit()
|
||||
},
|
||||
submit() {
|
||||
if (this.SelectGird.id != null) {
|
||||
if (!this.isApply && !this.isMyGirds) {
|
||||
uni.setStorageSync("lastSelectedGrid", this.SelectGird.parentGirdId)
|
||||
}
|
||||
uni.navigateBack({
|
||||
success: () => {
|
||||
uni.$emit("pagePicker:custom", this.SelectGird)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return this.$u.toast('请选择网格')
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pickGrid {
|
||||
min-height: 100vh;
|
||||
background: #fff;
|
||||
padding-bottom: 140px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.more {
|
||||
width: 80px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.header-middle {
|
||||
.hint {
|
||||
padding: 28px 20px 28px 32px;
|
||||
line-height: 56px;
|
||||
box-shadow: 0px 1px 0px 0px #e4e5e6;
|
||||
font-size: 30px;
|
||||
font-weight: 500;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.showTypes {
|
||||
.cards {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 120px;
|
||||
line-height: 120px;
|
||||
// background: pink;
|
||||
padding: 0 0 0 32px;
|
||||
|
||||
.imges {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// width: 200px;
|
||||
.imgselect {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.avatras {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.rightes {
|
||||
display: flex;
|
||||
border-bottom: 1px solid #e4e5e6;
|
||||
padding: 0 16px;
|
||||
|
||||
.applicationNames {
|
||||
display: inline-block;
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.subBtn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 118px;
|
||||
background: #f4f8fb;
|
||||
justify-content: flex-end;
|
||||
|
||||
div {
|
||||
width: 192px;
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
text-align: center;
|
||||
border: 2px solid #1365dd;
|
||||
background: #1365dd;
|
||||
border-radius: 4px;
|
||||
font-size: 32px;
|
||||
color: #fff;
|
||||
margin-right: 32px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
298
src/project/xincheng/AppMerchanGird/selectGridMember.vue
Normal file
@@ -0,0 +1,298 @@
|
||||
<template>
|
||||
<section class="selectGridMember">
|
||||
<div class="header-middle">
|
||||
<div class="hint">
|
||||
<span v-for="(item, index) in selectGridPath" :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 class="cards" v-for="(item, index) in treeList" :key="item.id" @click="itemClick(item)">
|
||||
<div class="imges">
|
||||
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="item.isChecked" @click.stop="girdClick(item, index)"/>
|
||||
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click.stop="girdClick(item, index)"/>
|
||||
<img src="./components/img/gird--select-icon.png" alt="" class="avatras"/>
|
||||
</div>
|
||||
<div class="rightes">
|
||||
<div class="applicationNames">{{ item.girdName }}</div>
|
||||
<img src="./components/img/right-icon.png" alt="" class="imgs"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="userCards" v-for="(e, index) in userList" :key="e.id">
|
||||
<div class="imges">
|
||||
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="e.isChecked" @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"/>
|
||||
</div>
|
||||
<div class="rights fill">
|
||||
<div class="applicationNames" v-text="e.name"/>
|
||||
<div class="idNumbers">{{ e.phone }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty description="暂无数据" v-if="!hasData"/>
|
||||
</div>
|
||||
<div class="subBtn" @click="submit">
|
||||
<div>确定选择</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "selectGridMember",
|
||||
appName: "选择人员(网格成员)",
|
||||
data() {
|
||||
return {
|
||||
selected: {},
|
||||
allData: null,
|
||||
treeList: [],
|
||||
selectGridPath: [],
|
||||
userList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
hasData() {
|
||||
return this.treeList?.length > 0 || this.userList?.length > 0
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.selected.id = this.$route.query.id
|
||||
this.getAllGrids()
|
||||
},
|
||||
onShow() {
|
||||
document.title = '选择人员'
|
||||
},
|
||||
methods: {
|
||||
getAllGrids() {
|
||||
this.$http.post('/app/appgirdinfo/listByInfo').then((res) => {
|
||||
if (res?.data) {
|
||||
let parents = res.data.map(e => e.parentGirdId)
|
||||
this.allData = res.data.map(e => ({...e, hasChildren: parents.includes(e.id)}))
|
||||
this.gridInit()
|
||||
}
|
||||
})
|
||||
},
|
||||
gridInit() {
|
||||
this.treeList = this.allData.filter(e => !e.parentGirdId)
|
||||
this.selectGridPath = [{girdName: "可选范围", id: ''}]
|
||||
},
|
||||
itemClick({id, girdName}) {
|
||||
this.selectGridPath.push({girdName, id})
|
||||
this.getGridsAndUsersByParent(id)
|
||||
},
|
||||
|
||||
getGridsAndUsersByParent(id) {
|
||||
this.treeList = this.allData.filter(e => e.parentGirdId == id)
|
||||
this.userList = []
|
||||
this.$http.post(`/app/appgirdmemberinfo/listByGirdIdByThree?girdId=${id}`).then((res) => {
|
||||
if (res?.data) {
|
||||
this.userList = res.data.map(e => ({...e, isChecked: e.id == this.selected.id}))
|
||||
}
|
||||
})
|
||||
},
|
||||
girdNameClick(row, index) {
|
||||
this.userList = []
|
||||
if (!index) { //第一级别
|
||||
this.gridInit()
|
||||
} else {
|
||||
let length = this.selectGridPath.length - index
|
||||
this.selectGridPath.splice(index, length)
|
||||
this.getGridsAndUsersByParent(row.id)
|
||||
}
|
||||
},
|
||||
girdClick(row, index) {
|
||||
if (this.treeList[index].isChecked) {//取消
|
||||
this.treeList[index].isChecked = false
|
||||
this.selected = {}
|
||||
} else {
|
||||
this.treeList.map((item, i) => {
|
||||
item.isChecked = index == i
|
||||
})
|
||||
this.selected = {...row, kind: "grid"}
|
||||
}
|
||||
this.$forceUpdate()
|
||||
},
|
||||
|
||||
userClick(row, index) {
|
||||
if (this.userList[index].isChecked) {//取消
|
||||
this.userList[index].isChecked = false
|
||||
this.selected = {}
|
||||
} else {
|
||||
this.userList.map((item, i) => {
|
||||
item.isChecked = index == i
|
||||
})
|
||||
this.selected = {...row, kind: "user"}
|
||||
}
|
||||
this.$forceUpdate()
|
||||
},
|
||||
|
||||
submit() {
|
||||
if (this.selected.id != null) {
|
||||
uni.navigateBack({
|
||||
success: () => {
|
||||
uni.$emit("pagePicker:custom", this.selected)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return this.$u.toast('请选择网格或网格员')
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.selectGridMember {
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
|
||||
.header-top {
|
||||
background: #fff;
|
||||
padding: 20px 32px;
|
||||
}
|
||||
|
||||
.header-middle {
|
||||
padding-bottom: 140px;
|
||||
|
||||
.hint {
|
||||
padding: 28px 20px 28px 32px;
|
||||
line-height: 56px;
|
||||
box-shadow: 0 1px 0 0 #e4e5e6;
|
||||
font-size: 30px;
|
||||
font-weight: 500;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.empty-div {
|
||||
height: 16px;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.cards {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 120px;
|
||||
line-height: 120px;
|
||||
padding: 0 0 0 32px;
|
||||
|
||||
.imges {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.imgselect {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.avatras {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
margin-left: 36px;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.rightes {
|
||||
width: calc(100% - 160px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 32px;
|
||||
border-bottom: 1px solid #e4e5e6;
|
||||
|
||||
.applicationNames {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.imgs {
|
||||
flex-shrink: 0;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.userCards {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 120px;
|
||||
line-height: 120px;
|
||||
padding: 0 0 0 32px;
|
||||
|
||||
.imges {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.imgselect {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
.avatras {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
margin-left: 36px;
|
||||
}
|
||||
}
|
||||
|
||||
.rights {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-left: 32px;
|
||||
border-bottom: 1px solid #e4e5e6;
|
||||
padding-right: 40px;
|
||||
height: inherit;
|
||||
|
||||
.applicationNames {
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.idNumbers {
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.subBtn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 118px;
|
||||
background: #f4f8fb;
|
||||
|
||||
div {
|
||||
width: 192px;
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
text-align: center;
|
||||
background: #1365dd;
|
||||
border-radius: 4px;
|
||||
font-size: 32px;
|
||||
color: #fff;
|
||||
margin: 20px 34px 0 0;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,346 @@
|
||||
<template>
|
||||
<div class="grid" v-if="pageShow">
|
||||
<div class="gird-wrapper">
|
||||
<div class="gird-item">
|
||||
<h2>一级网格</h2>
|
||||
<div class="gird-item__wrapper level1" @click="getStatistics(topGrid.id)">
|
||||
<h3>{{ topGrid.girdName }}</h3>
|
||||
<image :src="$cdn + 'xincheng/w-right.png'" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="gird-item" v-if="secondaryGrid.length">
|
||||
<h2>二级网格</h2>
|
||||
<div class="gird-item__wrapper level2">
|
||||
<div class="grid-item__item" v-for="(item, index) in secondaryGrid" :key="index">{{ item.girdName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gird-item" v-if="tertiaryGrid.length">
|
||||
<h2>三级网格</h2>
|
||||
<div class="gird-item__wrapper level3" @click="getSubInfo">
|
||||
<h3>专属网格</h3>
|
||||
<p>({{ tertiaryGrid.length }}个)</p>
|
||||
<image :src="$cdn + 'xincheng/blue-right.png'" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<u-popup v-model="isShowStreet" :closeable="false" border-radius="16" height="60%" mode="bottom">
|
||||
<div class="street-dialog">
|
||||
<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 streetInfo" :key="index">
|
||||
<div class="left">
|
||||
<i></i>
|
||||
<h2>{{ index }}</h2>
|
||||
</div>
|
||||
<span>{{ item }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</scroll-view>
|
||||
</div>
|
||||
</u-popup>
|
||||
<u-popup v-model="isShowVillage" :closeable="false" border-radius="16" height="60%" mode="bottom">
|
||||
<div class="street-dialog">
|
||||
<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 tertiaryInfo" :key="index">
|
||||
<div class="left">
|
||||
<i></i>
|
||||
<h2>{{ index }}</h2>
|
||||
</div>
|
||||
<span>{{ item }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="title">网格列表</h2>
|
||||
<div class="street-item__wrapper">
|
||||
<div class="street-item" style="justify-content: center" v-for="(item, index) in tertiaryGrid" :key="index">
|
||||
<span>{{ item.girdName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</scroll-view>
|
||||
</div>
|
||||
</u-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'grid',
|
||||
|
||||
appName: '网格统计',
|
||||
|
||||
data () {
|
||||
return {
|
||||
isShowStreet: false,
|
||||
streetInfo: {},
|
||||
isShowVillage: false,
|
||||
topGrid: [],
|
||||
secondaryGrid: [],
|
||||
tertiaryGrid: [],
|
||||
tertiaryInfo: {},
|
||||
pageShow: false
|
||||
}
|
||||
},
|
||||
|
||||
onLoad () {
|
||||
this.$loading()
|
||||
this.getInfo()
|
||||
},
|
||||
|
||||
methods: {
|
||||
getStatistics (girdId) {
|
||||
this.$loading()
|
||||
this.$http.post(`/api/appgirdinfo/girdInfoCountById?girdId=${girdId}`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.isShowStreet = true
|
||||
this.streetInfo = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
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) {
|
||||
this.topGrid = res.data
|
||||
|
||||
if (res.data.girdList.length) {
|
||||
this.secondaryGrid = res.data.girdList
|
||||
|
||||
res.data.girdList.forEach(e => {
|
||||
this.tertiaryGrid.push(...e.girdList)
|
||||
})
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.pageShow = true
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.grid {
|
||||
min-height: 100vh;
|
||||
padding: 32px 0;
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.street-dialog {
|
||||
height: 100%;
|
||||
padding: 0 32px 30px;
|
||||
|
||||
.street-wrapper {
|
||||
.title {
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
width: 128px;
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
color: #262B36;
|
||||
}
|
||||
|
||||
.street-item__wrapper {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.street-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: calc((100% - 30px) / 2);
|
||||
height: 88px;
|
||||
margin-bottom: 16px;
|
||||
padding: 0 32px;
|
||||
background: #F3F5F7;
|
||||
|
||||
&:nth-of-type(2n - 1) {
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
i {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
margin-right: 16px;
|
||||
border-radius: 50%;
|
||||
background: #1365DD;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #666666;
|
||||
font-size: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
span {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
-webkit-line-clamp: 2;
|
||||
font-size: 28px;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.gird-item {
|
||||
position: relative;
|
||||
margin: 0 16px 80px;
|
||||
padding: 16px;
|
||||
border: 2px dashed #CCCCCC;
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
z-index: 11;
|
||||
width: 2px;
|
||||
height: 80px;
|
||||
background: #666666;
|
||||
transform: translate(-50%, 100%);
|
||||
content: ' ';
|
||||
}
|
||||
|
||||
&::before {
|
||||
position: absolute;
|
||||
bottom: -80px;
|
||||
left: 50%;
|
||||
z-index: 11;
|
||||
border: 14px solid transparent;
|
||||
border-top: 14px solid #666666;
|
||||
transform: translate(-50%, 50%);
|
||||
content: ' ';
|
||||
}
|
||||
|
||||
&:last-child::after, &:last-child::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.level1 {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
background: #1365DD;
|
||||
color: #fff;
|
||||
font-size: 32px;
|
||||
|
||||
&:active {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
image {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 16px;
|
||||
z-index: 1;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.level3 {
|
||||
display: flex;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
height: 96px;
|
||||
background: #E8EFFB;
|
||||
color: #fff;
|
||||
font-size: 28px;
|
||||
|
||||
&:active {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
h3 {
|
||||
color: #1365DD;
|
||||
}
|
||||
|
||||
p {
|
||||
color: #CCCCCC;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
image {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 16px;
|
||||
z-index: 1;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.level2 {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.grid-item__item {
|
||||
width: calc((100% - 16px) / 2);
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
margin-bottom: 8px;
|
||||
padding: 0 10px;
|
||||
color: #3B3F59;
|
||||
font-size: 28px;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
background: #F3F5F7;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
&:nth-of-type(2n - 1) {
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& > h2 {
|
||||
margin-bottom: 16px;
|
||||
text-align: center;
|
||||
color: #1365DD;
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
236
src/project/xincheng/AppMerchantManage/AppMerchantManage.vue
Normal file
@@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<div class="AppMerchantManage">
|
||||
<AiTopFixed>
|
||||
<u-search placeholder="请输入姓名、手机号、店名" :show-action="false" v-model="keyword" confirm-type="search" @clear="current = 1, getList()" @search="current = 1, getList()"/>
|
||||
</AiTopFixed>
|
||||
<div class="list">
|
||||
<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>
|
||||
<span>店员 ({{ item.userCount }}) </span>
|
||||
</div>
|
||||
<div class="info">
|
||||
<img :src="$cdn + 'xincheng/dh.png'" alt="">
|
||||
<div>{{ item.bossName }} {{ item.telephone }}</div>
|
||||
</div>
|
||||
<div class="info">
|
||||
<img :src="$cdn + 'xincheng/dz@2x.png'" alt="">
|
||||
<div>{{ item.businessAddress }}</div>
|
||||
</div>
|
||||
<div class="info" style="margin-bottom: 0;">
|
||||
<img :src="$cdn + 'xincheng/wgz@2x.png'" alt="">
|
||||
<div v-if="item.girdUserName">{{ item.girdUserName }}-{{ item.girdUserType }}</div>
|
||||
<div v-else>未绑定网格员</div>
|
||||
</div>
|
||||
</u-swipe-action>
|
||||
<AiEmpty v-if="!list.length"></AiEmpty>
|
||||
</div>
|
||||
<div class="btn" @click="linkTo('./add')">新增商户</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'AppMerchantManage',
|
||||
appName: '商户管理',
|
||||
data() {
|
||||
return {
|
||||
keyword: '',
|
||||
current: 1,
|
||||
pages: 2,
|
||||
list: [],
|
||||
options: [
|
||||
{
|
||||
text: '编辑',
|
||||
style: {
|
||||
backgroundColor: '#007aff'
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#dd524d'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
computed: {...mapState(['user'])},
|
||||
|
||||
onLoad () {
|
||||
this.$loading()
|
||||
this.getList()
|
||||
uni.$on('update', () => {
|
||||
this.current = 1
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList () {
|
||||
if (this.current > this.pages && this.current !== 1) return
|
||||
|
||||
this.$http.post('/app/appcompany/getPageWithGird', null, {
|
||||
params: {
|
||||
size: 10,
|
||||
current: this.current,
|
||||
businessName: this.keyword
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
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
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
onReachBottom() {
|
||||
this.current ++
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AppMerchantManage {
|
||||
.list{
|
||||
padding: 24px 30px 136px;
|
||||
.item{
|
||||
width: 100%;
|
||||
background: #FFF;
|
||||
border-radius: 16px;
|
||||
padding: 32px 24px 32px 32px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 30px;
|
||||
|
||||
&:active {
|
||||
// background: #eee;
|
||||
}
|
||||
.title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 38px;
|
||||
img{
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
margin-right: 16px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
p{
|
||||
display: inline-block;
|
||||
line-height: 1.3;
|
||||
width: 400px;
|
||||
font-size: 32px;
|
||||
font-weight: 500;
|
||||
color: #000;
|
||||
}
|
||||
span{
|
||||
display: inline-block;
|
||||
width: calc(100% - 488px);
|
||||
text-align: right;
|
||||
font-size: 24px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #999;
|
||||
line-height: 24px;
|
||||
}
|
||||
}
|
||||
.info{
|
||||
line-height: 1;
|
||||
margin-bottom: 20px;
|
||||
img{
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
div{
|
||||
display: inline-block;
|
||||
width: calc(100% - 44px);
|
||||
word-break: break-all;
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #333;
|
||||
line-height: 40px;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.btn{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
background: #3975C6;
|
||||
box-shadow: inset 0px 2px 0px 0px #EEEEEE;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #FFF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
338
src/project/xincheng/AppMerchantManage/ChooseAddess.vue
Normal file
@@ -0,0 +1,338 @@
|
||||
<template>
|
||||
<div class="Attendance-address">
|
||||
<AiTMap
|
||||
:map.sync="map"
|
||||
:lib.sync="lib"
|
||||
:ops="ops"
|
||||
:libraries="['service', 'tools']">
|
||||
</AiTMap>
|
||||
<u-popup v-model="isShow" :closeable="false" border-radius="32" height="70%" mode="bottom">
|
||||
<div class="wrapper">
|
||||
<div class="top">
|
||||
<span @click="isShow = false">取消</span>
|
||||
<span @click="confirm">确定</span>
|
||||
</div>
|
||||
<div class="address-search">
|
||||
<div class="address-search__wrapper">
|
||||
<image :src="$cdn + 'xincheng/search.png'" />
|
||||
<input placeholder-style="color: #98A6B6" placeholder="搜索地点" v-model="address" @input="onChange">
|
||||
</div>
|
||||
</div>
|
||||
<scroll-view scroll-y scroll-into-view="address-item1">
|
||||
<div class="address-item" :id="'address-item' + index" v-for="(item, index) in addressList" :key="index" @click="chooseAddress(index)">
|
||||
<div class="left">
|
||||
<h2>{{ item.title }}</h2>
|
||||
<p>{{ item._distance >= 0 ? item._distance + 'm内' : '未知' }} | {{ item.address }}</p>
|
||||
</div>
|
||||
<div class="right" :class="[currIndex === index ? 'active' : '']"></div>
|
||||
</div>
|
||||
</scroll-view>
|
||||
</div>
|
||||
</u-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapActions } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'ChooseAddess',
|
||||
|
||||
appName: '选择地点',
|
||||
|
||||
data () {
|
||||
return {
|
||||
latitude: '',
|
||||
longitude: '',
|
||||
isShow: false,
|
||||
address: '',
|
||||
currIndex: 0,
|
||||
chooseIndex: 0,
|
||||
map: null,
|
||||
ops: {},
|
||||
lib: null,
|
||||
latLng: null,
|
||||
addressList: [],
|
||||
page: 1,
|
||||
marker: null,
|
||||
timeout: null
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
map (v) {
|
||||
if (v) {
|
||||
this.init()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onLoad (query) {
|
||||
},
|
||||
|
||||
methods: {
|
||||
...mapActions(['injectJWeixin']),
|
||||
|
||||
init () {
|
||||
this.map.setZoom(19)
|
||||
this.addMarker(this.map.getCenter())
|
||||
this.map.on('click', e => {
|
||||
this.addressList = []
|
||||
this.latLng = e.latLng
|
||||
this.isShow = true
|
||||
|
||||
this.addMarker(e.latLng)
|
||||
this.getAddress()
|
||||
})
|
||||
},
|
||||
|
||||
confirm () {
|
||||
const address = this.addressList[this.currIndex]
|
||||
uni.$emit('chooseAddress', {
|
||||
address: address.address,
|
||||
title: address.title,
|
||||
lat: address.location.lat,
|
||||
lng: address.location.lng
|
||||
})
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
|
||||
chooseAddress (index) {
|
||||
this.addMarker(this.addressList[index].location)
|
||||
this.currIndex = index
|
||||
},
|
||||
|
||||
addMarker (position) {
|
||||
if (this.marker) {
|
||||
this.marker.setMap(null)
|
||||
this.marker = null
|
||||
}
|
||||
this.marker = new this.lib.MultiMarker({
|
||||
id: 'marker-layer',
|
||||
map: this.map,
|
||||
styles: {
|
||||
marker: new this.lib.MarkerStyle({
|
||||
width: 30,
|
||||
height: 45,
|
||||
anchor: { x: 10, y: 30 }
|
||||
}),
|
||||
},
|
||||
geometries: [{
|
||||
id: 'marker',
|
||||
styleId: 'marker',
|
||||
position: position,
|
||||
properties: {
|
||||
title: 'marker'
|
||||
}
|
||||
}]
|
||||
})
|
||||
this.easeTo(position)
|
||||
},
|
||||
|
||||
easeTo (position) {
|
||||
this.map.easeTo({
|
||||
center: position,
|
||||
zoom: 17
|
||||
},
|
||||
{ duration: 500 })
|
||||
},
|
||||
|
||||
onChange () {
|
||||
if (this.timeout) {
|
||||
clearTimeout(this.timeout)
|
||||
}
|
||||
this.timeout = setTimeout(() => {
|
||||
this.currIndex = -1
|
||||
new this.lib.service.Suggestion({
|
||||
pageSize: 20
|
||||
}).getSuggestions({
|
||||
keyword: this.address
|
||||
}).then(res => {
|
||||
this.addressList = []
|
||||
if (res.data.length) {
|
||||
this.addressList = res.data
|
||||
}
|
||||
})
|
||||
}, 500)
|
||||
},
|
||||
|
||||
getAddress () {
|
||||
this.currIndex = 0
|
||||
new this.lib.service.Search({
|
||||
pageSize: 20
|
||||
}).explore({
|
||||
center: this.latLng,
|
||||
radius: 2000,
|
||||
orderBy: '_distance'
|
||||
}).then(res => {
|
||||
this.addressList = []
|
||||
if (res.data.length) {
|
||||
this.addressList = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.Attendance-address {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
|
||||
.ActionSheet {
|
||||
background: #F5F6F6;
|
||||
|
||||
.ActionSheet-list {
|
||||
margin-bottom: 8px;
|
||||
background: #fff;
|
||||
|
||||
div {
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
text-align: center;
|
||||
color: #333333;
|
||||
font-size: 32px;
|
||||
border-bottom: 1px solid #D8DDE6;
|
||||
|
||||
&.active {
|
||||
color: #1365DD;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&:active {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
color: #333;
|
||||
font-size: 32px;
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
background: #fff;
|
||||
|
||||
&:active {
|
||||
background: #eee;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
line-height: 1;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
|
||||
scroll-view {
|
||||
height: calc(100% - 308px + 112px);
|
||||
padding: 0 32px;
|
||||
|
||||
.address-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 32px 0;
|
||||
border-bottom: 1px solid #EEEEEE;
|
||||
|
||||
&:last-child {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.left {
|
||||
flex: 1;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.right {
|
||||
flex-shrink: 1;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
border: 4px solid #CCCCCC;
|
||||
transition: all ease 0.3s;
|
||||
|
||||
&.active {
|
||||
border: 10px solid #1365DD;
|
||||
}
|
||||
}
|
||||
|
||||
h2 {
|
||||
line-height: 1.3;
|
||||
margin-bottom: 20px;
|
||||
color: #222222;
|
||||
font-weight: 600;
|
||||
font-size: 34px;
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: 1.2;
|
||||
color: #999999;
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.address-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100px;
|
||||
padding: 0 32px;
|
||||
|
||||
.address-search__wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 72px;
|
||||
padding: 0 32px;
|
||||
background: #F6F7F9;
|
||||
border-radius: 36px;
|
||||
|
||||
image {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
input {
|
||||
flex: 1;
|
||||
font-size: 26px;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 96px;
|
||||
padding: 0 32px;
|
||||
font-size: 32px;
|
||||
color: #999;
|
||||
font-weight: 600;
|
||||
|
||||
span:last-child {
|
||||
color: #222;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
map {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
246
src/project/xincheng/AppMerchantManage/add.vue
Normal file
@@ -0,0 +1,246 @@
|
||||
<template>
|
||||
<div class="add">
|
||||
<div class="item">
|
||||
<span class="tips">*</span>
|
||||
<div class="border">
|
||||
<span class="label">店名</span>
|
||||
<span class="value">
|
||||
<input type="text" placeholder="请输入" v-model="form.businessName" maxlength="20">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item mar-b0">
|
||||
<span class="tips">*</span>
|
||||
<div class="border">
|
||||
<span class="label">地址</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-area">
|
||||
<textarea placeholder="请输入" v-model="form.businessAddress" maxlength="50"></textarea>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="tips">*</span>
|
||||
<div class="border">
|
||||
<span class="label">店长</span>
|
||||
<span class="value">
|
||||
<input type="text" placeholder="请输入" v-model="form.bossName">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="tips"></span>
|
||||
<div class="border">
|
||||
<span class="label">电话</span>
|
||||
<span class="value">
|
||||
<input type="text" placeholder="请输入" v-model="form.telephone" maxlength="11">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="tips"></span>
|
||||
<div class="border">
|
||||
<span class="label">身份证号</span>
|
||||
<span class="value">
|
||||
<input type="text" placeholder="请输入" v-model="form.cardId" maxlength="18">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item mar-b0">
|
||||
<span class="tips"></span>
|
||||
<div class="border">
|
||||
<span class="label">门店照片</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-area">
|
||||
<AiUploader :def.sync="form.storePicUrl" :limit="1" multiple action="/admin/file/add2" style="padding-bottom:16px;"></AiUploader>
|
||||
</div>
|
||||
<!-- <AiUploader v-model="form.files" :limit="9" multiple action="/admin/file/add2"></AiUploader> -->
|
||||
<div class="item">
|
||||
<span class="tips"></span>
|
||||
<div class="border">
|
||||
<span class="label">地图标注</span>
|
||||
<span class="value" style="color:#3D94FB;" @click="chooseLocation">{{ form.lat ? '已标绘' : '地图标绘' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<AiGap h="112"/>
|
||||
<div class="btn" @click="save">保存</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'add',
|
||||
|
||||
appName: '新增商户',
|
||||
|
||||
data() {
|
||||
return {
|
||||
name: '',
|
||||
files: [],
|
||||
form: {
|
||||
bossName: '',
|
||||
businessAddress: '',
|
||||
businessName: '',
|
||||
lat: '',
|
||||
lng: '',
|
||||
storePicUrl: [],
|
||||
telephone: ''
|
||||
},
|
||||
id: ''
|
||||
}
|
||||
},
|
||||
|
||||
computed: {...mapState(['user'])},
|
||||
|
||||
onLoad (query) {
|
||||
if (query.id) {
|
||||
this.id = query.id
|
||||
this.getInfo()
|
||||
}
|
||||
|
||||
uni.$on('chooseAddress', e => {
|
||||
this.form.lat = e.lat
|
||||
this.form.lng = e.lng
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
chooseLocation () {
|
||||
// uni.chooseLocation({
|
||||
// success: res => {
|
||||
// this.form.lat = res.latitude
|
||||
// this.form.lng = res.longitude
|
||||
// }
|
||||
// })
|
||||
|
||||
uni.navigateTo({
|
||||
url: './ChooseAddess'
|
||||
})
|
||||
},
|
||||
|
||||
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}] : []
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
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>
|
||||
.add {
|
||||
.item{
|
||||
width: 100%;
|
||||
padding-left: 14px;
|
||||
background: #FFF;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
margin-bottom: 16px;
|
||||
.tips{
|
||||
width: 18px;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #FF4466;
|
||||
line-height: 44px;
|
||||
padding: 34px 0 34px 0;
|
||||
}
|
||||
.border{
|
||||
width: calc(100% - 18px);
|
||||
padding: 34px 32px 34px 0;
|
||||
line-height: 44px;
|
||||
line-height: 44px;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #333;
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
.label{
|
||||
width: 170px;
|
||||
}
|
||||
.value{
|
||||
width: calc(100% - 170px);
|
||||
text-align: right;
|
||||
img{
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-left: 8px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
.color-999{
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
.mar-b0{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.text-area{
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
padding: 0 32px;
|
||||
margin-bottom: 16px;
|
||||
box-sizing: border-box;
|
||||
textarea{
|
||||
width: 100%;
|
||||
height: 88px;
|
||||
padding-bottom: 32px;
|
||||
}
|
||||
}
|
||||
.btn{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
background: #3975C6;
|
||||
box-shadow: inset 0px 2px 0px 0px #EEEEEE;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #FFF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
140
src/project/xincheng/AppMerchantManage/addClerk.vue
Normal file
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<div class="addClerk">
|
||||
<div class="item">
|
||||
<span class="tips">*</span>
|
||||
<div class="border">
|
||||
<span class="label">姓名</span>
|
||||
<span class="value">
|
||||
<input type="text" placeholder="请输入" v-model="userName">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="tips"></span>
|
||||
<div class="border">
|
||||
<span class="label">电话</span>
|
||||
<span class="value">
|
||||
<input type="tel" placeholder="请输入" v-model="userPhone" maxlength="11">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn" @click="save">确认添加</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'addClerk',
|
||||
appName: '新增店员',
|
||||
|
||||
data () {
|
||||
return {
|
||||
id: '',
|
||||
userPhone: '',
|
||||
userName: ''
|
||||
}
|
||||
},
|
||||
|
||||
computed: {...mapState(['user'])},
|
||||
|
||||
onLoad (query) {
|
||||
this.id = query.id
|
||||
},
|
||||
|
||||
methods: {
|
||||
save () {
|
||||
|
||||
if (!this.userName) {
|
||||
return this.$u.toast('请输入姓名')
|
||||
}
|
||||
|
||||
if (!this.userPhone) {
|
||||
// return this.$u.toast('请输入电话')
|
||||
}
|
||||
|
||||
this.$loading()
|
||||
this.$http.post('/app/CompanyUser/addOrupdate', {
|
||||
userName: this.userName,
|
||||
userPhone: this.userPhone,
|
||||
companyId: this.id
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$u.toast('提交成功')
|
||||
|
||||
setTimeout(() => {
|
||||
uni.$emit('updateUser')
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.addClerk {
|
||||
.item{
|
||||
width: 100%;
|
||||
padding-left: 14px;
|
||||
background: #FFF;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
margin-bottom: 16px;
|
||||
.tips{
|
||||
width: 18px;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #FF4466;
|
||||
line-height: 44px;
|
||||
padding: 34px 0 34px 0;
|
||||
}
|
||||
.border{
|
||||
width: calc(100% - 18px);
|
||||
padding: 34px 32px 34px 0;
|
||||
line-height: 44px;
|
||||
line-height: 44px;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #333;
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
.label{
|
||||
width: 170px;
|
||||
}
|
||||
.value{
|
||||
width: calc(100% - 170px);
|
||||
text-align: right;
|
||||
img{
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-left: 8px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
.color-999{
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
.btn{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
background: #3975C6;
|
||||
box-shadow: inset 0px 2px 0px 0px #EEEEEE;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #FFF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
219
src/project/xincheng/AppMerchantManage/detail.vue
Normal file
@@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<div class="detail" v-if="pageShow">
|
||||
<div class="header">
|
||||
<img :src="$cdn + 'xincheng/icon.png'" alt="" class="logo-img">
|
||||
<div class="text-info">
|
||||
<p>{{ info.businessName }}</p>
|
||||
<div>
|
||||
<img :src="$cdn + 'xincheng/dw.png'" alt="" class="local-icon">
|
||||
<span>{{ info.businessAddress }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="title">基础信息</div>
|
||||
<div class="info">
|
||||
<span>店主</span>
|
||||
<span class="color-333">{{ info.bossName }}</span>
|
||||
</div>
|
||||
<div class="info">
|
||||
<span>电话</span>
|
||||
<span class="color-3D94FB" @click="call(info.telephone)">{{ info.telephone }}</span>
|
||||
</div>
|
||||
<div class="info">
|
||||
<span>身份证</span>
|
||||
<span class="color-333">{{ info.cardId }}</span>
|
||||
</div>
|
||||
<div class="img-list">
|
||||
<div class="info">
|
||||
<span>门店照片</span>
|
||||
</div>
|
||||
<image v-if="info.storePicUrl" :src="info.storePicUrl" mode="aspectFill" @click="preview(info.storePicUrl)" />
|
||||
</div>
|
||||
<div class="info">
|
||||
<span>地图</span>
|
||||
<span class="color-3D94FB" @click="openLocation">{{ info.lng ? '已定位' : '未定位' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" v-if="info.detailList.length">
|
||||
<div class="title">店员信息</div>
|
||||
<div class="info" v-for="(item, index) in info.detailList" :key="index">
|
||||
<span>{{ item.userName }}</span>
|
||||
<span class="color-3D94FB" @click="call(item.userPhone)">{{ item.userPhone }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<AiGap h="112"/>
|
||||
<div class="btn" @click="linkTo('./addClerk?id=' + id)">新增店员</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'detail',
|
||||
|
||||
appName: '商户详情',
|
||||
|
||||
data () {
|
||||
return {
|
||||
info: {},
|
||||
pageShow: false
|
||||
}
|
||||
},
|
||||
|
||||
computed: {...mapState(['user'])},
|
||||
|
||||
onLoad (query) {
|
||||
this.id = query.id
|
||||
|
||||
this.getInfo()
|
||||
|
||||
uni.$on('updateUser', () => {
|
||||
this.getInfo()
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
getInfo () {
|
||||
this.$loading()
|
||||
this.$http.post(`/app/appcompany/getDetailById?id=${this.id}`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.info = res.data
|
||||
|
||||
this.pageShow = true
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
linkTo (url) {
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
},
|
||||
|
||||
call (phone) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: phone
|
||||
})
|
||||
},
|
||||
|
||||
openLocation () {
|
||||
if (!this.info.lat) {
|
||||
return false
|
||||
}
|
||||
|
||||
uni.openLocation({
|
||||
latitude: this.info.lat,
|
||||
longitude: this.info.lng
|
||||
})
|
||||
},
|
||||
|
||||
preview (url) {
|
||||
uni.previewImage({
|
||||
urls: [url],
|
||||
current: url
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.detail {
|
||||
.header{
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
padding: 48px 32px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 8px;
|
||||
.logo-img{
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
margin-right: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
.text-info{
|
||||
display: inline-block;
|
||||
width: calc(100% - 120px);
|
||||
p{
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
line-height: 44px;
|
||||
margin-bottom: 6px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.local-icon{
|
||||
width: 20px;
|
||||
height: 26px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
span{
|
||||
display: inline-block;
|
||||
width: calc(100% - 32px);
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #90969E;
|
||||
line-height: 40px;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
}
|
||||
}
|
||||
.content{
|
||||
background-color: #fff;
|
||||
padding: 0 32px 20px;
|
||||
margin-bottom: 8px;
|
||||
.title{
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
line-height: 44px;
|
||||
padding: 32px 0;
|
||||
}
|
||||
.info{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #999;
|
||||
line-height: 44px;
|
||||
padding: 14px 0;
|
||||
.color-333{
|
||||
color: #333;
|
||||
}
|
||||
.color-3D94FB{
|
||||
color: #3D94FB;
|
||||
|
||||
&:active {
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
.img-list{
|
||||
image {
|
||||
width: 100%;
|
||||
height: 320px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.btn{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
background: #3975C6;
|
||||
box-shadow: inset 0px 2px 0px 0px #EEEEEE;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #FFF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
BIN
src/project/xincheng/AppMerchantManage/img/down-icon.png
Normal file
|
After Width: | Height: | Size: 314 B |
457
src/project/xincheng/AppMerchantMap/AppMerchantMap.vue
Normal file
@@ -0,0 +1,457 @@
|
||||
<template>
|
||||
<div class="AppMerchantMap">
|
||||
<div class="search">
|
||||
<image :src="$cdn + 'xincheng/search.png'" />
|
||||
<input placeholder="请输入店主姓名、店名" v-model="businessName" @input="getList(true)">
|
||||
</div>
|
||||
<div class="search-list" v-if="isShow">
|
||||
<div class="item border" v-for="(item, index) in list" :key="index" @click="toDetail(item)">
|
||||
<div class="item-content">
|
||||
<h3>{{ item.businessName }} - {{ item.bossName }}</h3>
|
||||
<p>{{ item.businessAddress }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="map-content" @click.stop="isShow = false">
|
||||
<AiTMap :map.sync="map" :lib.sync="lib" :ops="ops" :libraries="['service', 'tools']"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'AppMerchantMap',
|
||||
appName: '商户地图',
|
||||
data() {
|
||||
return {
|
||||
areaId: '',
|
||||
lib: null,
|
||||
map: null,
|
||||
polygons: [],
|
||||
labels: [],
|
||||
businessName: '',
|
||||
ops: {},
|
||||
markers: [],
|
||||
isShow: false,
|
||||
MarkerCluster: null,
|
||||
list: []
|
||||
}
|
||||
},
|
||||
computed: {...mapState(['user'])},
|
||||
|
||||
created () {
|
||||
this.areaId = this.user.areaId
|
||||
this.getList()
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.initMap()
|
||||
},
|
||||
|
||||
methods: {
|
||||
toDetail (item) {
|
||||
if (!item.lat) {
|
||||
return this.$u.toast('该商户尚未标记')
|
||||
}
|
||||
|
||||
this.businessName = item.businessName
|
||||
this.isShow = false
|
||||
this.map.setCenter(new this.lib.LatLng(item.lat, item.lng))
|
||||
this.map.setZoom(22)
|
||||
|
||||
setTimeout(() => {
|
||||
document.querySelectorAll('.marker').forEach(e => {
|
||||
e.classList.remove('marker-active')
|
||||
})
|
||||
document.querySelector(`.marker-${item.id}`).classList.add('marker-active')
|
||||
}, 400)
|
||||
},
|
||||
|
||||
getList (isSearch) {
|
||||
this.$http.post('/app/appcompany/list', null, {
|
||||
params: {
|
||||
size: isSearch ? 20 : 100000,
|
||||
current: 1,
|
||||
businessName: this.businessName
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
const markers = res.data.records.filter(item => item.lat).map(item => {
|
||||
return {
|
||||
...item,
|
||||
title: item.businessName + '-' + item.bossName,
|
||||
lnglat: [item.lng, item.lat],
|
||||
lat: item.lat,
|
||||
lng: item.lng,
|
||||
id: item.id,
|
||||
name: item.businessName + '-' + item.bossName
|
||||
}
|
||||
})
|
||||
|
||||
if (isSearch) {
|
||||
this.list = res.data.records
|
||||
this.isShow = true
|
||||
} else {
|
||||
this.getMarkerCluster(markers)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getMarkerCluster(points, count = 0) {
|
||||
let {lib: TMap, map} = this
|
||||
if (map) {
|
||||
if (this.markers.length) {
|
||||
this.markers.forEach(v => {
|
||||
v.setMap(null)
|
||||
})
|
||||
}
|
||||
|
||||
class ClusterBubble extends TMap.DOMOverlay {
|
||||
constructor(options) {
|
||||
super(options);
|
||||
}
|
||||
|
||||
onInit(options) {
|
||||
this.content = options.content;
|
||||
this.position = options.position;
|
||||
this.markersId = options.markersId
|
||||
this.customClass = options.customClass
|
||||
};
|
||||
|
||||
onDestroy() {
|
||||
this.dom.removeEventListener('click', this.onClick);
|
||||
this.removeAllListeners();
|
||||
}
|
||||
|
||||
createDOM() {
|
||||
let dom = document.createElement('div');
|
||||
dom.classList.add(this.customClass || 'marker');
|
||||
if (this.markersId) {
|
||||
dom.classList.add(this.markersId);
|
||||
}
|
||||
dom.innerText = this.content;
|
||||
|
||||
// 监听点击事件,实现zoomOnClick
|
||||
this.onClick = this.onClick.bind(this);
|
||||
// pc端注册click事件,移动端注册touchend事件
|
||||
dom.addEventListener('click', this.onClick);
|
||||
dom.addEventListener('touchend', this.onClick);
|
||||
return dom;
|
||||
};
|
||||
|
||||
updateDOM() {
|
||||
if (!this.map) {
|
||||
return;
|
||||
}
|
||||
// 经纬度坐标转容器像素坐标
|
||||
let pixel = this.map.projectToContainer(this.position);
|
||||
|
||||
// 使文本框中心点对齐经纬度坐标点
|
||||
let left = pixel.getX() - this.dom.clientWidth / 2 + 'px';
|
||||
let top = pixel.getY() - this.dom.clientHeight / 2 + 'px';
|
||||
this.dom.style.transform = `translate(${left}, ${top})`;
|
||||
this.emit('dom_updated');
|
||||
};
|
||||
|
||||
onClick() {
|
||||
this.emit('click');
|
||||
}
|
||||
}
|
||||
|
||||
this.MarkerCluster = new TMap.MarkerCluster({
|
||||
map, gridSize: 60,
|
||||
enableDefaultStyle: false, // 关闭默认样式
|
||||
geometries: points.map(e => ({
|
||||
position: new TMap.LatLng(e.lat, e.lng),
|
||||
id: e.id,
|
||||
content: `${e.name}`,
|
||||
properties: {...e}
|
||||
})) || [],
|
||||
zoomOnClick: true,
|
||||
maxZoom: 18
|
||||
})
|
||||
this.setCenter(points.map(e => {
|
||||
return new TMap.LatLng(e.lat, e.lng)
|
||||
}))
|
||||
|
||||
let cls = []
|
||||
this.MarkerCluster.on('cluster_changed', () => {
|
||||
if (this.markers.length) {
|
||||
this.markers.forEach(function (item) {
|
||||
item.destroy();
|
||||
})
|
||||
}
|
||||
cls.forEach(e => e.destroy())
|
||||
cls = []
|
||||
let clusters = this.MarkerCluster.getClusters()
|
||||
clusters.forEach((item) => {
|
||||
if (item.geometries?.length > 1) {
|
||||
//聚合样式
|
||||
let clusterBubble = new ClusterBubble({
|
||||
map,
|
||||
position: item.center,
|
||||
content: item.geometries.length,
|
||||
customClass: 'cluster'
|
||||
})
|
||||
clusterBubble.on('click', () => {
|
||||
map.fitBounds(item.bounds);
|
||||
});
|
||||
cls.push(clusterBubble)
|
||||
} else {
|
||||
//点标记样式
|
||||
let {content, id} = item.geometries?.[0] || {},
|
||||
overlay = new ClusterBubble({map, position: item.center, content, markersId: `marker-${id}`})
|
||||
overlay.on('click', () => {
|
||||
uni.navigateTo({
|
||||
url: `../AppMerchantManage/detail?id=${id}`
|
||||
})
|
||||
})
|
||||
this.markers.push(overlay)
|
||||
}
|
||||
});
|
||||
})
|
||||
return Promise.resolve()
|
||||
} else {
|
||||
if (count < 5) {
|
||||
setTimeout(() => {
|
||||
return this.getMarkerCluster(points, ++count)
|
||||
}, 1000)
|
||||
} else Promise.reject("加载失败")
|
||||
}
|
||||
},
|
||||
|
||||
initMap (retryTimes = 0) {
|
||||
this.$nextTick(() => {
|
||||
let { map, TMap } = this
|
||||
if (map) {
|
||||
map.setZoom(15)
|
||||
} else {
|
||||
if (retryTimes < 10) {
|
||||
setTimeout(() => {
|
||||
this.initMap(++retryTimes)
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
setCenter (arr) {
|
||||
var bounds = new TMap.LatLngBounds()
|
||||
arr.forEach(function(item){
|
||||
if (bounds.isEmpty() || !bounds.contains(item)){
|
||||
bounds.extend(item)
|
||||
}
|
||||
})
|
||||
|
||||
this.map.fitBounds(bounds, {
|
||||
padding: 100
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AppMerchantMap {
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
|
||||
.search-list {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
top: 128px;
|
||||
width: 718px;
|
||||
height: 70%;
|
||||
overflow-y: scroll;
|
||||
box-sizing: border-box;
|
||||
z-index: 2222;
|
||||
transform: translateX(-50%);
|
||||
|
||||
.search-icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
margin-right: 16px;
|
||||
vertical-align: sub;
|
||||
}
|
||||
|
||||
.title {
|
||||
height: 82px;
|
||||
line-height: 82px;
|
||||
font-size: 26px;
|
||||
font-family: MicrosoftYaHeiSemibold;
|
||||
color: #1365DD;
|
||||
padding-left: 44px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 20px 30px;
|
||||
background-color: #fff;
|
||||
|
||||
&:last-child {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
.item-content {
|
||||
display: inline-block;
|
||||
width: 610px;
|
||||
color: #333;
|
||||
|
||||
h3 {
|
||||
font-size: 28px;
|
||||
font-family: MicrosoftYaHeiSemibold;
|
||||
line-height: 32px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
p {
|
||||
width: 100%;
|
||||
font-size: 24px;
|
||||
font-family: MicrosoftYaHei;
|
||||
line-height: 32px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
.user-icon {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.border {
|
||||
border-bottom: 1px solid #DEDFE1;
|
||||
}
|
||||
}
|
||||
@keyframes warn {
|
||||
0% {
|
||||
transform: scale(.5);
|
||||
opacity: 1
|
||||
}
|
||||
|
||||
30% {
|
||||
opacity: .5
|
||||
}
|
||||
|
||||
to {
|
||||
transform: scale(1.6);
|
||||
opacity: 0
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep.cluster {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
color: #fff;
|
||||
border-radius: 50%;
|
||||
background: #0f8f64;
|
||||
|
||||
&:after {
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
border-radius: 50%;
|
||||
-webkit-animation: warn 1s ease-out 0s infinite;
|
||||
animation: warn 1s ease-out 0s infinite;
|
||||
background-color: #0f8f64;
|
||||
content: " ";
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep.marker {
|
||||
position: relative;
|
||||
color: #fff;
|
||||
background: #558BFE;
|
||||
padding: 0 32px;
|
||||
width: fit-content;
|
||||
height: 56px;
|
||||
border-radius: 52px;
|
||||
z-index: 1;
|
||||
transform: translate(-50%, -50%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&:before {
|
||||
content: " ";
|
||||
display: block;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
width: 0;
|
||||
height: 0;
|
||||
transform: translate(-50%, 100%);
|
||||
border: 12px solid transparent;
|
||||
border-top-color: #558BFE;
|
||||
}
|
||||
|
||||
&.marker-active {
|
||||
z-index: 11;
|
||||
background: red;
|
||||
|
||||
&:before {
|
||||
content: " ";
|
||||
display: block;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
width: 0;
|
||||
height: 0;
|
||||
transform: translate(-50%, 100%);
|
||||
border: 12px solid transparent;
|
||||
border-top-color: red;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.search {
|
||||
display: flex;
|
||||
position: fixed;
|
||||
align-items: center;
|
||||
top: 24px;
|
||||
left: 50%;
|
||||
z-index: 11111;
|
||||
width: 718px;
|
||||
height: 88px;
|
||||
padding: 0 16px;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 4px 8px 0px rgba(192, 185, 185, 0.5);
|
||||
border-radius: 16px;
|
||||
transform: translateX(-50%);
|
||||
|
||||
image {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
input {
|
||||
flex: 1;
|
||||
font-size: 28px;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.map-content {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
|
||||
map {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
112
src/project/xincheng/AppPageMerchant/AppPageMerchant.vue
Normal file
@@ -0,0 +1,112 @@
|
||||
<template>
|
||||
<div class="AppPageMerchant">
|
||||
|
||||
<div class="list">
|
||||
<div class="item" v-for="(item, index) in appList" :key="index" @click="linkTo(item.url)" :style="item.isBottom ? 'border-bottom: 1px solid #eee;' : ''">
|
||||
<div class="icon" :style="`backgroundImage: url(${item.icon});`"></div>
|
||||
<p>{{item.name}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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'
|
||||
}
|
||||
],
|
||||
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})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AppPageMerchant{
|
||||
padding: 20px;
|
||||
.list{
|
||||
background-color: #fff;
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
.item{
|
||||
text-align: center;
|
||||
padding-bottom: 38px;
|
||||
border-right: 1px solid #eee;
|
||||
width: calc(33% - 1px);
|
||||
float: left;
|
||||
.icon{
|
||||
display: inline-block;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
margin: 40px 0 8px 0;
|
||||
background-size: 100% 100%;
|
||||
text-align: center;
|
||||
}
|
||||
p{
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #3D434A;
|
||||
line-height: 40px;
|
||||
}
|
||||
}
|
||||
.item:nth-of-type(3n) {
|
||||
border-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
BIN
src/project/xincheng/AppPageMerchant/img/shanghudangan.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/project/xincheng/AppPageMerchant/img/shanghuditu.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/project/xincheng/AppPageMerchant/img/wanggeguanli.png
Normal file
|
After Width: | Height: | Size: 978 B |
BIN
src/project/xincheng/AppPageMerchant/img/wanggetongji.png
Normal file
|
After Width: | Height: | Size: 837 B |