头像优化
This commit is contained in:
@@ -1,12 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<Cn-page :loading='loading'>
|
<Cn-page :loading="loading">
|
||||||
<view slot='body' class='index'>
|
<view slot="body" class="index">
|
||||||
<uni-list>
|
<uni-list>
|
||||||
<uni-list-item :title="renderData.masterUser.name" :note="renderData.masterUser.phone"
|
<uni-list-item
|
||||||
:thumb="renderData.masterUser.avatar" thumb-size="lg" rightText="主用户">
|
:title="renderData.masterUser.name"
|
||||||
|
:note="renderData.masterUser.phone"
|
||||||
|
:thumb="renderData.masterUser.avatar"
|
||||||
|
thumb-size="lg"
|
||||||
|
rightText="主用户"
|
||||||
|
>
|
||||||
</uni-list-item>
|
</uni-list-item>
|
||||||
<uni-list-item :title="item.name" :note="item.phone" :thumb="item.avatar" thumb-size="lg"
|
<uni-list-item
|
||||||
v-for="item in renderData.subUsers" :key="item.id">
|
:title="item.name"
|
||||||
|
:note="item.phone"
|
||||||
|
:thumb="item.avatar"
|
||||||
|
thumb-size="lg"
|
||||||
|
v-for="item in renderData.subUsers"
|
||||||
|
:key="item.id"
|
||||||
|
>
|
||||||
<template v-slot:footer v-if="options.isPrimaryUser">
|
<template v-slot:footer v-if="options.isPrimaryUser">
|
||||||
<view class="footer-btn mt20" style="background: #e47470" @click="del(item)">移除</view>
|
<view class="footer-btn mt20" style="background: #e47470" @click="del(item)">移除</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -25,60 +36,62 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
renderData: {
|
renderData: {
|
||||||
masterUser: {},
|
masterUser: {},
|
||||||
subUsers:[]
|
subUsers: [],
|
||||||
},
|
},
|
||||||
options: {}
|
options: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
jump() {
|
jump() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/mine/userDetail'
|
url: '/pages/mine/userDetail',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
del(e) {
|
del(e) {
|
||||||
console.log(e);
|
console.log(e)
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '确定要移除该成员吗?',
|
content: '确定要移除该成员吗?',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
cancelShare({eid: this.renderData.devId, userId: e.id}).then(res => {
|
cancelShare({ eid: this.renderData.devId, userId: e.id }).then((res) => {
|
||||||
console.log(res);
|
console.log(res)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '移除成功',
|
title: '移除成功',
|
||||||
icon: 'none'
|
icon: 'none',
|
||||||
})
|
})
|
||||||
this.init()
|
this.init()
|
||||||
|
|
||||||
})
|
})
|
||||||
console.log('用户点击确定')
|
console.log('用户点击确定')
|
||||||
} else if (res.cancel) {
|
} else if (res.cancel) {
|
||||||
console.log('用户点击取消')
|
console.log('用户点击取消')
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
queryDeviceUser(this.options.id).then(res => {
|
queryDeviceUser(this.options.id).then((res) => {
|
||||||
console.log(res);
|
console.log(res)
|
||||||
this.renderData = res.data
|
this.renderData = res.data
|
||||||
this.renderData.masterUser.avatar = this.renderData.masterUser.headSculpture ? this.$config.staticUrl + this.renderData.masterUser.headSculpture : '/static/head.png'
|
this.renderData.masterUser.avatar = this.renderData.masterUser.headSculpture
|
||||||
this.renderData.subUsers.forEach(item => {
|
? this.$config.static + this.renderData.masterUser.headSculpture
|
||||||
item.avatar = item.headSculpture ? this.$config.staticUrl + item.headSculpture : '/static/head.png'
|
: '/static/head.png'
|
||||||
|
this.renderData.subUsers.forEach((item) => {
|
||||||
|
item.avatar = item.headSculpture ? this.$config.static + item.headSculpture : '/static/head.png'
|
||||||
})
|
})
|
||||||
|
console.log(this.renderData)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.options = options
|
this.options = options
|
||||||
console.log(this.loading)
|
console.log(this.loading)
|
||||||
this.init()
|
this.init()
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss'>
|
<style lang="scss">
|
||||||
.index {
|
.index {
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user