Commit 9ff7ce2d by cwq0219

修改

1 parent 7be6e49d
......@@ -35,7 +35,19 @@ Vue.use(VeeValidate, {
var mixin = {
data() {
return {
flag: true
flag: true,
// paramsTrans: '',
/**
* 定义一个事件传输总线
* 提示:页面与子组件间的参数都可以用之来互相传递
* 如:
* this.$root.eventBus.$emit('params', {id:123});
*
this.$root.eventBus.$on('params', (params)=>{
console.log(params);
});
*/
eventBus: new Vue()
}
},
mounted() {
......@@ -86,21 +98,10 @@ var mixin = {
})
}
}
},
data() {
return {
/**
* 定义一个事件传输总线
* 提示:页面与子组件间的参数都可以用之来互相传递
* 如:
* this.$root.eventBus.$emit('params', {id:123});
*
this.$root.eventBus.$on('params', (params)=>{
console.log(params);
});
*/
eventBus: new Vue()
}
// getParamsTrans() {
// console.log(this.paramsTrans)
// return this.paramsTrans
// }
}
}
const URL = ' http://192.168.3.171:7300/mock/5be17454f31545347559d499/config'
......
......@@ -3,7 +3,7 @@
<gl-breadcrumb separator='/'>
<gl-breadcrumb-item><a href='#' @click='back'>商户列表</a></gl-breadcrumb-item>
<gl-breadcrumb-item>商户详情</gl-breadcrumb-item>
<gl-breadcrumb-item>{{name}}</gl-breadcrumb-item>
<gl-breadcrumb-item>{{List[0].value}}</gl-breadcrumb-item>
</gl-breadcrumb>
<!-- <gl-button type='text' @click='back'>商户列表</gl-button>
<span>\ 商户详情 \{{name}}</span> -->
......@@ -36,7 +36,7 @@
<script>
import VueAMap from 'vue-amap'
import Vue from 'vue'
import { merchantPersonal } from '@/api/index'
import { merchantDetail } from '@/api/index'
import notice from '@/common/notice'
const amapManager = new VueAMap.AMapManager()
VueAMap.initAMapApiLoader({
......@@ -49,28 +49,36 @@ export default {
data() {
const _this = this
return {
name: '',
merchantId: '',
activeName: 'first',
merchantInfo: {},
List: [
{
name: 'merchantName',
label: '商户名称',
value: '深圳市安卓讯航科技有限公司'
}, {
name: 'merchantId',
label: '商户号',
value: '44186213'
}, {
name: 'address',
label: '商户地址',
value: '广东省深圳市南山区科兴科学园C3单元'
}, {
name: 'merchantChannelName',
label: '商户渠道',
value: '自有渠道'
}, {
name: 'contactor',
label: '联系人',
value: '彭裕'
}, {
name: 'createTime',
label: '注册时间',
value: '2018-03-16'
}, {
name: 'contactPhone',
label: '联系电话',
value: '15999682114'
}, {
......@@ -78,9 +86,11 @@ export default {
value: '深圳市安卓讯航科技有限公司',
isMap: true
}, {
name: 'phone',
label: '服务电话',
value: '0755-88888888'
}, {
name: 'email',
label: '邮箱',
value: 'GLSX@didihu.com'
}, {
......@@ -129,11 +139,16 @@ export default {
}
}
},
watch: {
merchantId(val) {
this.getStaffList()
}
},
mounted() {
console.log(this)
this.$root.eventBus.$on('params', (params) => {
console.log(params)
this.name = params.name
if (params.merchantId !== this.merchantId) {
this.merchantId = params.merchantId
}
})
// setTimeout(() => {
// const theme = new this.$Theme()
......@@ -168,13 +183,28 @@ export default {
handleClick(tab, event) {
console.log(tab, event)
},
// 员工信息-接口
// 员工信息-接口--start
getStaffList() {
merchantPersonal.req().then(res => {
notice.okTips(res)
merchantDetail.req({ merchantId: this.merchantId }).then(res => {
this.merchantInfo = res
this.assignStaffInfo()
notice.okTips()
}).catch(err => {
notice.errorTips(err)
})
},
assignStaffInfo() {
console.log(this.merchantInfo)
for (var i in this.List) {
if (this.List[i].isMap) {
console.log('000')
this.point = [this.merchantInfo.lng, this.merchantId.lat]
} else if (this.List[i].isImg) {
console.log('000')
} else {
this.List[i].value = this.merchantInfo[this.List[i].name]
}
}
}
}
}
......
......@@ -128,8 +128,8 @@ export default {
label: '详情',
type: 'text',
callback: (index, rows) => {
const url = encodeURI(`../../customer/businessDetails.html?id=${rows[index].merchantId}&name=${rows[index].merchantName}`)
location.href = url
this.$root.to(['商户数据平台', '商户数据平台', '商户数据平台', '业务管理', '商户详情'], { merchantId: rows[index].merchantId })
// this.$root.getParamsTrans()
}
}]
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!