|
@@ -10,40 +10,48 @@
|
|
|
<van-search placeholder="搜索" v-model="value" />
|
|
|
</van-col>
|
|
|
<van-col :span="24">
|
|
|
- <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
|
|
|
- <van-collapse v-model="activeNames">
|
|
|
- <van-collapse-item title="群组" name="1">
|
|
|
- <van-swipe-cell v-for="item in group" :key="item">
|
|
|
- <van-cell :title="item.title" :label="item.label" :value="item.time" @click="$router.push({ path: '/xjc/common/chat' })">
|
|
|
- <template #icon>
|
|
|
- <van-icon dot>
|
|
|
- <van-image :src="headIcon" fit="contain" style="height: 3.5rem; width:3.5rem;padding-right:1rem" />
|
|
|
- </van-icon>
|
|
|
- </template>
|
|
|
- </van-cell>
|
|
|
- <template slot="right">
|
|
|
- <van-button square type="primary" text="标为已读" style="height:100%;background-color:#ccc;border-color:#ccc" />
|
|
|
- <van-button square type="danger" text="删除" style="height:100%" />
|
|
|
+ <van-collapse v-model="activeNames">
|
|
|
+ <van-collapse-item title="群组" name="1">
|
|
|
+ <van-swipe-cell v-for="(item, index) in group" :key="index">
|
|
|
+ <van-cell
|
|
|
+ :title="item.title"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.time"
|
|
|
+ @click="$router.push({ path: `/xjc/common/chat/${item.type}`, query: { returns: 'firstpage' } })"
|
|
|
+ >
|
|
|
+ <template #icon>
|
|
|
+ <van-icon dot>
|
|
|
+ <van-image :src="headIcon" fit="contain" style="height: 3.5rem; width:3.5rem" />
|
|
|
+ </van-icon>
|
|
|
</template>
|
|
|
- </van-swipe-cell>
|
|
|
- </van-collapse-item>
|
|
|
- <van-collapse-item title="我的好友" name="2">
|
|
|
- <van-swipe-cell v-for="item in person" :key="item">
|
|
|
- <van-cell :title="item.title" :label="item.label" :value="item.time" @click="$router.push({ path: '/xjc/common/chat' })">
|
|
|
- <template #icon>
|
|
|
- <van-icon info="99">
|
|
|
- <van-image :src="headIcon" fit="contain" style="height: 3.5rem; width:3.5rem;padding-right:1rem" />
|
|
|
- </van-icon>
|
|
|
- </template>
|
|
|
- </van-cell>
|
|
|
- <template slot="right">
|
|
|
- <van-button square type="primary" text="标为已读" style="height:100%;background-color:#ccc;border-color:#ccc" />
|
|
|
- <van-button square type="danger" text="删除" style="height:100%" />
|
|
|
+ </van-cell>
|
|
|
+ <template slot="right">
|
|
|
+ <van-button square type="primary" text="标为已读" style="height:100%;background-color:#ccc;border-color:#ccc" />
|
|
|
+ <van-button square type="danger" text="删除" style="height:100%" />
|
|
|
+ </template>
|
|
|
+ </van-swipe-cell>
|
|
|
+ </van-collapse-item>
|
|
|
+ <van-collapse-item title="我的好友" name="2">
|
|
|
+ <van-swipe-cell v-for="(item, index) in person" :key="index">
|
|
|
+ <van-cell
|
|
|
+ :title="item.title"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.time"
|
|
|
+ @click="$router.push({ path: `/xjc/common/chat/${item.type}`, query: { returns: 'firstpage' } })"
|
|
|
+ >
|
|
|
+ <template #icon>
|
|
|
+ <van-icon info="99+">
|
|
|
+ <van-image :src="headIcon" fit="contain" style="height: 3.5rem; width:3.5rem" />
|
|
|
+ </van-icon>
|
|
|
</template>
|
|
|
- </van-swipe-cell>
|
|
|
- </van-collapse-item>
|
|
|
- </van-collapse>
|
|
|
- </van-list>
|
|
|
+ </van-cell>
|
|
|
+ <template slot="right">
|
|
|
+ <van-button square type="primary" text="标为已读" style="height:100%;background-color:#ccc;border-color:#ccc" />
|
|
|
+ <van-button square type="danger" text="删除" style="height:100%" />
|
|
|
+ </template>
|
|
|
+ </van-swipe-cell>
|
|
|
+ </van-collapse-item>
|
|
|
+ </van-collapse>
|
|
|
</van-col>
|
|
|
</van-row>
|
|
|
</div>
|
|
@@ -59,12 +67,11 @@ export default {
|
|
|
},
|
|
|
data: () => {
|
|
|
return {
|
|
|
- activeNames: ['1'],
|
|
|
- active: 'chat',
|
|
|
- group: [{ title: '群组名称', label: 'content', time: 'time' }],
|
|
|
- person: [{ title: '个人姓名', label: 'content', time: 'time' }],
|
|
|
- loading: false,
|
|
|
- finished: false,
|
|
|
+ value: '',
|
|
|
+ activeNames: ['1', '2'],
|
|
|
+ active: 'firstpage',
|
|
|
+ group: [{ title: '群组名称', label: 'content', time: 'time', type: 'group' }],
|
|
|
+ person: [{ title: '个人姓名', label: 'content', time: 'time', type: 'person' }],
|
|
|
headIcon: require('@/assets/head_icon.jpg'),
|
|
|
};
|
|
|
},
|
|
@@ -74,27 +81,15 @@ export default {
|
|
|
rNav() {
|
|
|
console.log('click add-o');
|
|
|
},
|
|
|
- onLoad() {
|
|
|
- // 异步更新数据
|
|
|
- setTimeout(() => {
|
|
|
- for (let i = 0; i < 5; i++) {
|
|
|
- this.list.push(this.list.length + 1);
|
|
|
- }
|
|
|
- // 加载状态结束
|
|
|
- this.loading = false;
|
|
|
-
|
|
|
- // 数据全部加载完成
|
|
|
- if (this.list.length >= 5) {
|
|
|
- this.finished = true;
|
|
|
- }
|
|
|
- }, 500);
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
/deep/.van-collapse-item__content {
|
|
|
- padding: 0px;
|
|
|
+ padding: 0px;
|
|
|
+}
|
|
|
+/deep/.van-cell__title {
|
|
|
+ padding-left: 1rem;
|
|
|
}
|
|
|
</style>
|