Commit f020ca35 by 姜雷

用户框添加showMoney的key控制用户信息框中是否显示艾米豆信息

parent d86ad317
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
title: '', title: '',
selectedRoute: [], selectedRoute: [],
routerDone: false, routerDone: false,
isInnerPage: true, isInnerPage: false,
showFastLink: true, showFastLink: true,
showSelected: false, showSelected: false,
}; };
......
...@@ -12,3 +12,8 @@ export const fetchUserBaseInfoByPhone = entity => ...@@ -12,3 +12,8 @@ export const fetchUserBaseInfoByPhone = entity =>
url: path + '/dcxy/customerInfo/baseCustomer', url: path + '/dcxy/customerInfo/baseCustomer',
params: entity, params: entity,
}); });
export const fetchUserAccount = entity =>
fetch({
url: path + '/dcxy/customerInfo/queryAccount',
params: entity,
});
...@@ -61,6 +61,19 @@ ...@@ -61,6 +61,19 @@
</div> </div>
<div class="UserInfo-Content-Col">注册时间:{{$formatDate(customerBaseInfo.createAt,'yyyy-MM-dd')}}</div> <div class="UserInfo-Content-Col">注册时间:{{$formatDate(customerBaseInfo.createAt,'yyyy-MM-dd')}}</div>
<div class="UserInfo-Content-Col UserInfo-CampusName">{{customerBaseInfo.areaName}}</div> <div class="UserInfo-Content-Col UserInfo-CampusName">{{customerBaseInfo.areaName}}</div>
<div
class="UserInfo-Content-serviceBox"
v-if="showMoney"
>
<div
v-for="(item, index) in serviceList"
:key="index"
class="UserInfo-Content-serviceBox-item"
>
<div>{{getServiceName(item.serviceId)}}</div>
<div>{{item.money}}</div>
</div>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -71,10 +84,6 @@ import UserBaseInfoMixin from '../../mixins/user/userBaseInfo.js'; ...@@ -71,10 +84,6 @@ import UserBaseInfoMixin from '../../mixins/user/userBaseInfo.js';
import getUserInfoLabelMixin from '@/mixins/user/getUserInfoLabel.js'; import getUserInfoLabelMixin from '@/mixins/user/getUserInfoLabel.js';
export default { export default {
props: {
customerId: Number,
customerPhone: String,
},
mixins: [UserBaseInfoMixin, getUserInfoLabelMixin], mixins: [UserBaseInfoMixin, getUserInfoLabelMixin],
}; };
</script> </script>
...@@ -132,7 +141,7 @@ export default { ...@@ -132,7 +141,7 @@ export default {
} }
} }
.UserInfo-Content { .UserInfo-Content {
height: 90px; // height: 90px;
background-color: #fff; background-color: #fff;
padding: 10px; padding: 10px;
.UserInfo-Content-Col { .UserInfo-Content-Col {
...@@ -156,6 +165,13 @@ export default { ...@@ -156,6 +165,13 @@ export default {
line-height: 1; line-height: 1;
margin-top: 0px; margin-top: 0px;
} }
.UserInfo-Content-serviceBox {
line-height: 24px;
.UserInfo-Content-serviceBox-item {
display: flex;
justify-content: space-between;
}
}
} }
} }
@media screen and (min-width: $bigScreenWidth) { @media screen and (min-width: $bigScreenWidth) {
...@@ -187,7 +203,7 @@ export default { ...@@ -187,7 +203,7 @@ export default {
} }
} }
.UserInfo-Content { .UserInfo-Content {
height: 180px; // height: 180px;
padding: 20px; padding: 20px;
.UserInfo-Content-Col { .UserInfo-Content-Col {
line-height: 38px; line-height: 38px;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
class="left-part" class="left-part"
:customerId="customerId" :customerId="customerId"
:customerPhone="customerPhone" :customerPhone="customerPhone"
:showMoney="showMoney"
:visible="visible" :visible="visible"
/> />
<div class="right-part"> <div class="right-part">
...@@ -39,6 +40,10 @@ export default { ...@@ -39,6 +40,10 @@ export default {
default: true, default: true,
}, },
customerPhone: String, customerPhone: String,
showMoney: {
type: Boolean,
default: false,
},
}, },
}; };
</script> </script>
......
...@@ -72,6 +72,15 @@ export const operClassifyName4User = [ ...@@ -72,6 +72,15 @@ export const operClassifyName4User = [
{ label: '新增', value: '05' }, { label: '新增', value: '05' },
]; ];
export const serviceMap = [
{ label: '艾米', value: '0' },
{ label: '通用', value: '1' },
{ label: '洗衣', value: '2' },
{ label: '饮水', value: '3' },
{ label: '吹风', value: '4' },
{ label: '洗浴', value: '5' },
];
export default { export default {
selectTypeMapping, selectTypeMapping,
customerStateOptions, customerStateOptions,
......
import { mapActions, mapGetters } from 'vuex'; import { mapActions, mapGetters } from 'vuex';
import { fetchUserAccount } from '../../api/base/customer';
import { serviceMap } from '@/config';
export default { export default {
props: { props: {
visible: { type: Boolean, default: false }, visible: { type: Boolean, default: false },
customerId: Number, customerId: Number,
customerPhone: String, customerPhone: String,
showMoney: {
type: Boolean,
default: false,
},
},
data() {
return {
serviceList: [],
};
}, },
watch: { watch: {
visible(newVal) { visible(newVal) {
...@@ -12,6 +23,7 @@ export default { ...@@ -12,6 +23,7 @@ export default {
this.fetchUserBaseInfo({ this.fetchUserBaseInfo({
customerId: this.customerId, customerId: this.customerId,
}); });
this.getAllData();
} }
}, },
customerId(newId) { customerId(newId) {
...@@ -19,6 +31,7 @@ export default { ...@@ -19,6 +31,7 @@ export default {
this.fetchUserBaseInfo({ this.fetchUserBaseInfo({
customerId: this.customerId, customerId: this.customerId,
}); });
this.getAllData();
} }
}, },
customerPhone(newPhone) { customerPhone(newPhone) {
...@@ -26,6 +39,7 @@ export default { ...@@ -26,6 +39,7 @@ export default {
this.fetchUserBaseInfoByPhone({ this.fetchUserBaseInfoByPhone({
customerPhone: this.customerPhone, customerPhone: this.customerPhone,
}); });
this.getAllData();
} }
}, },
}, },
...@@ -34,11 +48,13 @@ export default { ...@@ -34,11 +48,13 @@ export default {
this.fetchUserBaseInfo({ this.fetchUserBaseInfo({
customerId: this.customerId, customerId: this.customerId,
}); });
this.getAllData();
} }
if (this.visible && !this.customerId && this.customerPhone) { if (this.visible && !this.customerId && this.customerPhone) {
this.fetchUserBaseInfoByPhone({ this.fetchUserBaseInfoByPhone({
customerPhone: this.customerPhone, customerPhone: this.customerPhone,
}); });
this.getAllData();
} }
}, },
computed: { computed: {
...@@ -46,5 +62,24 @@ export default { ...@@ -46,5 +62,24 @@ export default {
}, },
methods: { methods: {
...mapActions(['fetchUserBaseInfo', 'fetchUserBaseInfoByPhone']), ...mapActions(['fetchUserBaseInfo', 'fetchUserBaseInfoByPhone']),
getAllData() {
console.log('in getAllData', this.showMoney);
if (this.showMoney) {
fetchUserAccount({
customerId: this.customerId,
})
.then(res => {
this.serviceList = res.data;
})
.catch(err => {
console.error(err);
});
}
},
getServiceName(id) {
let item = serviceMap.find(item => item.value === id);
return item ? item.label : id;
},
}, },
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment