会话存档
This commit is contained in:
@@ -13,37 +13,36 @@
|
||||
</div>
|
||||
<div class="top-select">
|
||||
<div class="item">
|
||||
<AiAreaPicker v-model="areaId" :areaId="areaId" @select="areaSelect" :name.sync="areaName" style="color: #666" selectRoot>
|
||||
<AiAreaPicker v-model="areaId" :areaId="user.areaId" @select="areaSelect" :name.sync="areaName" style="color: #666" selectRoot>
|
||||
<span style="margin-left: 4px" v-if="areaName">{{ areaName }}</span>
|
||||
<span v-else style="color:#999;">行政区划</span>
|
||||
<u-icon name="arrow-down" color="#666" size="28" style="margin-left: 4px" />
|
||||
<u-icon name="arrow-down" color="#999" size="28" style="margin-left: 4px" />
|
||||
</AiAreaPicker>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span style="color:#999;">部门名称</span>
|
||||
<!-- <span v-else>{{ $dict.getLabel('EP_handleType', handleType) }}</span> -->
|
||||
<u-icon name="arrow-down" color="#666" size="28" style="margin-left: 4px" />
|
||||
<AiPagePicker type="dept" :selected.sync="deptUserList" nodeKey="id" single @select="deptSelect" isAuth>
|
||||
<span class="label" v-if="deptUserList.length">{{deptUserList[0].name}}</span>
|
||||
<span v-else style="color:#999;">部门名称</span>
|
||||
<u-icon name="arrow-down" color="#999" size="24" style="margin-left:8px;"/>
|
||||
</AiPagePicker>
|
||||
</div>
|
||||
</div>
|
||||
</AiTopFixed>
|
||||
<div class="user-list">
|
||||
<div class="item">
|
||||
<img src="./img/user-img.png" alt="">
|
||||
<p>李毅</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="./img/user-img.png" alt="">
|
||||
<p>李毅</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="./img/user-img.png" alt="">
|
||||
<p>李毅</p>
|
||||
<div class="user-list" v-if="list.length">
|
||||
<div class="item" v-for="(item, index) in list" :key="index" @click="toDetail(item)">
|
||||
<img :src="item.toUserAvatar" alt="" v-if="currentTabs == 1">
|
||||
<p v-if="currentTabs == 1">{{item.toUserName}}</p>
|
||||
|
||||
<img src="./img/group-img.png" alt="" v-if="currentTabs != 1">
|
||||
<p v-if="currentTabs != 1">{{item.roomName}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-else/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
export default {
|
||||
name: "AppConversation",
|
||||
appName: "会话存档",
|
||||
@@ -66,8 +65,21 @@ export default {
|
||||
keyword: '',
|
||||
areaId: '',
|
||||
areaName: '',
|
||||
current: 1,
|
||||
pages: 2,
|
||||
list: [],
|
||||
deptUserList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
},
|
||||
onLoad() {
|
||||
this.areaId = this.user.areaId
|
||||
this.areaName = this.user.areaName
|
||||
this.deptUserList = [{id: this.user.departId, name: this.user.departName}]
|
||||
this.getList()
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
@@ -78,14 +90,47 @@ export default {
|
||||
this.getListInit()
|
||||
},
|
||||
getListInit() {
|
||||
|
||||
this.current = 1
|
||||
this.pages = 2
|
||||
this.list = []
|
||||
this.getList()
|
||||
},
|
||||
areaSelect(e) {
|
||||
this.areaId = e
|
||||
this.getListInit()
|
||||
this.getTotal()
|
||||
},
|
||||
deptSelect(e) {
|
||||
this.deptUserList = e
|
||||
this.getListInit()
|
||||
},
|
||||
getList() {
|
||||
if(this.current > this.pages) return
|
||||
this.$http.post(`/app/appsessionarchiveindex/listByUser`, null, {
|
||||
params: {
|
||||
current: this.current,
|
||||
size: 10,
|
||||
type: this.currentTabs == 1 ? 0 : 1,
|
||||
areaId: this.areaId,
|
||||
toUserName: this.currentTabs == 1 ? this.keyword : '',
|
||||
roomName: this.currentTabs == 1 ? '' : this.keyword,
|
||||
departId: this.deptUserList[0].id
|
||||
}
|
||||
}).then(res=> {
|
||||
if(res?.data) {
|
||||
this.list = this.current > 1 ? [...this.list, ...res.data.records]: res.data.records
|
||||
this.pages = res.data.pages
|
||||
}
|
||||
})
|
||||
},
|
||||
toDetail(row) {
|
||||
var query = row.type == 1 ? `?roomId=${row.roomId}` : `?toUserId=${row.toUserId}`
|
||||
uni.navigateTo({ url: `./conversationDetail${query}&type=${row.type}`})
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.current ++
|
||||
this.getList()
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -138,6 +183,7 @@ export default {
|
||||
img {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 50%;
|
||||
margin-right: 32px;
|
||||
}
|
||||
p {
|
||||
|
||||
Reference in New Issue
Block a user