Kaynağa Gözat

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

娄底高职分支
ndbs 2 yıl önce
ebeveyn
işleme
0bc9ff096f
1 değiştirilmiş dosya ile 53 ekleme ve 5 silme
  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 Dosyayı Görüntüle

@@ -10,32 +10,80 @@
></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>
<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">
<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>
</template>

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

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

methods: {
init(){
if(this.value){
this.selectIds = this.value.split(",")
}
},
// 点击事件
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: {
@@ -50,7 +98,7 @@ export default {

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

// 获取 tag 的颜色


Yükleniyor…
İptal
Kaydet