Browse Source

app2.0 通讯录优化;显示和复制手机号;单选多选;

娄底高职分支
ndbs 2 years ago
parent
commit
0bc9ff096f
1 changed files with 53 additions and 5 deletions
  1. +53
    -5
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/organize-single-item.vue

+ 53
- 5
Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/organize-single-item.vue View File

@@ -10,32 +10,80 @@
></image> ></image>


<!-- 名称 --> <!-- 名称 -->
<text class="tree-item-title">{{ item.name }}</text>
<text class="tree-item-title">{{ item.name + (item.mobile ? '(' +item.mobile + ')' : "") }}</text>


<!-- 用户标签 --> <!-- 用户标签 -->
<l-tag :line="tagColor" size="sm" class="margin-left-sm">{{ tagName }}</l-tag> <l-tag :line="tagColor" size="sm" class="margin-left-sm">{{ tagName }}</l-tag>
<uni-view v-if="item.type === 'user' && item.mobile" class="margin-left-sm sm line-gray cu-tag" style="z-index: 1;" @tap="copy(item.mobile)">复制</uni-view>


<!-- 如果开启选择按钮显示,并且级别符合,则显示按钮 --> <!-- 如果开启选择按钮显示,并且级别符合,则显示按钮 -->
<view v-if="button" class="tree-item-action"> <view v-if="button" class="tree-item-action">
<l-button @click="$emit('buttonClick', item)" line="green" size="sm">选择</l-button>
<l-button v-if="!selectIds.includes(item.id)" @click="itemClick(item)" line="green" size="sm">选择</l-button>
<l-button v-else @click="itemClick(item)" line="blue" size="sm">取消选择</l-button>
</view> </view>
</view> </view>
</template> </template>


<script> <script>
import uniCopy from "@/common/js/uni-copy.js"
export default { export default {
name: 'l-organize-single-item', name: 'l-organize-single-item',


props: { props: {
item: {}, item: {},
button: {}
button: {},
value:{},
},
data(){
return{
selectIds:[],
}
},
created() {
this.init()
}, },


methods: { methods: {
init(){
if(this.value){
this.selectIds = this.value.split(",")
}
},
// 点击事件 // 点击事件
click(e) { click(e) {
this.$emit('click', e) this.$emit('click', e)
}
},
itemClick(root){
if(this.selectIds.indexOf(root.id) !== -1){
this.selectIds.splice(this.selectIds.indexOf(root.id),1)
}else{
this.selectIds.push(root.id)
}
this.$emit('buttonClick', root)
},
copy(mobile){
uniCopy({
content:mobile,
success:(res)=>{
uni.showToast({
title: "复制手机号成功~",
icon: 'none',
duration:3000,
})
},
error:(e)=>{
uni.showToast({
title: e,
icon: 'none',
duration:3000,
})
}
})
}
}, },


computed: { computed: {
@@ -50,7 +98,7 @@ export default {


// 获取树形列表每一项后面 tag 的显示 // 获取树形列表每一项后面 tag 的显示
tagName() { tagName() {
return { user: '职员', department: '部门', company: '公司' }[this.item.type]
return { user: '职员', department: '部门', company: '学校' }[this.item.type]
}, },


// 获取 tag 的颜色 // 获取 tag 的颜色


Loading…
Cancel
Save