商户管理
This commit is contained in:
@@ -24,53 +24,67 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn">新增商户</div>
|
||||
<div class="btn" @click="linkTo('./add')">新增商户</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'AppMerchantManage',
|
||||
appName: '商户管理',
|
||||
data() {
|
||||
return {
|
||||
keyword: '',
|
||||
current: 1,
|
||||
pages: 2,
|
||||
list: []
|
||||
}
|
||||
},
|
||||
computed: {...mapState(['user'])},
|
||||
created() {
|
||||
export default {
|
||||
name: 'AppMerchantManage',
|
||||
appName: '商户管理',
|
||||
data() {
|
||||
return {
|
||||
keyword: '',
|
||||
current: 1,
|
||||
pages: 2,
|
||||
list: []
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
onShow() {
|
||||
document.title = "商户管理"
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
if(this.current > this.pages) return
|
||||
this.$http.post('/app/appresident/list', null, {
|
||||
params: {
|
||||
size: 10,
|
||||
current: this.current,
|
||||
con: this.keyword,
|
||||
},
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
|
||||
this.pages = res.data.pages
|
||||
}
|
||||
computed: {...mapState(['user'])},
|
||||
|
||||
onLoad () {
|
||||
this.getList()
|
||||
uni.$on('update', () => {
|
||||
this.current = 1
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
},
|
||||
onReachBottom() {
|
||||
this.current ++
|
||||
this.getList()
|
||||
|
||||
onShow() {
|
||||
document.title = "商户管理"
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
if(this.current > this.pages) return
|
||||
this.$http.post('/app/appcompany/list', null, {
|
||||
params: {
|
||||
size: 10,
|
||||
current: this.current,
|
||||
con: this.keyword,
|
||||
},
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
|
||||
this.pages = res.data.pages
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
linkTo (url) {
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.current ++
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="border">
|
||||
<span class="label">店名</span>
|
||||
<span class="value">
|
||||
<input type="text" placeholder="请输入" v-model="name" maxlength="6">
|
||||
<input type="text" placeholder="请输入" v-model="form.bossName" maxlength="10">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -16,14 +16,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-area">
|
||||
<textarea placeholder="请输入" maxlength="30" v-model="name"></textarea>
|
||||
<textarea placeholder="请输入" maxlength="30" v-model="form.businessAddress"></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="name" maxlength="6">
|
||||
<input type="text" placeholder="请输入" v-model="form.businessName" maxlength="6">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -32,7 +32,7 @@
|
||||
<div class="border">
|
||||
<span class="label">电话</span>
|
||||
<span class="value">
|
||||
<input type="text" placeholder="请输入" v-model="name" maxlength="6">
|
||||
<input type="text" placeholder="请输入" v-model="form.telephone" maxlength="6">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,7 +41,7 @@
|
||||
<div class="border">
|
||||
<span class="label">身份证号</span>
|
||||
<span class="value">
|
||||
<input type="text" placeholder="请输入" v-model="name" maxlength="6">
|
||||
<input type="text" placeholder="请输入" v-model="form.cardId" maxlength="6">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -52,18 +52,18 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-area">
|
||||
<AiUploader v-model="files" :limit="1" multiple action="/admin/file/add2" style="padding-bottom:16px;"></AiUploader>
|
||||
<AiUploader v-model="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;">地图标绘</span>
|
||||
<span class="value" style="color:#3D94FB;" @click="chooseLocation">{{ form.businessAddress || '地图标绘' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<AiGap h="112"/>
|
||||
<div class="btn">保存</div>
|
||||
<div class="btn" @click="save">保存</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -75,18 +75,69 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
name: '',
|
||||
files: []
|
||||
files: [],
|
||||
form: {
|
||||
bossName: '',
|
||||
businessAddress: '',
|
||||
businessName: '',
|
||||
lat: '',
|
||||
lon: '',
|
||||
storePicUrl: '',
|
||||
telephone: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
computed: {...mapState(['user'])},
|
||||
created() {
|
||||
|
||||
onLoad () {
|
||||
|
||||
},
|
||||
|
||||
onShow() {
|
||||
document.title = "新增商户"
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
chooseLocation () {
|
||||
uni.chooseLocation({
|
||||
success: res => {
|
||||
this.form.businessAddress = res.name
|
||||
this.form.lat = res.latitude
|
||||
this.form.lon = res.longitude
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
save () {
|
||||
if (!this.form.bossName) {
|
||||
return this.$u.toast('请输入店名')
|
||||
}
|
||||
|
||||
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
|
||||
}).then(() => {
|
||||
if (res.code === 0) {
|
||||
this.$u.toast('提交成功')
|
||||
|
||||
setTimeout(() => {
|
||||
uni.$emit('update')
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user