diff --git a/pages.json b/pages.json index 1563cc0..0d7fe1f 100644 --- a/pages.json +++ b/pages.json @@ -108,6 +108,15 @@ "navigationBarTextStyle": "white" } }, + { + "path" : "pages/common/im_chat_info", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "default", + "navigationBarBackgroundColor": "#292929", + "navigationBarTextStyle": "white" + } + }, { "path" : "pages/common/sys_msg_list", "style": { diff --git a/pages/common/im_chat_info.vue b/pages/common/im_chat_info.vue index e11e705..652d250 100644 --- a/pages/common/im_chat_info.vue +++ b/pages/common/im_chat_info.vue @@ -3,11 +3,45 @@ - - + + + 2024-05-15 - + + + 你好,aaaaaaaaaaaaaaaaaaaaaaaaa1111111111111111111@@@@@@@@@@@@@@@@@ + + + + + + + 你好,是呢么时间可以到课是呢么时间可以到课是呢么时间可以到课 + + + + + + + 间可以到课 + + + + + + + + + + + @@ -26,6 +60,18 @@ export default { }, data() { return { + loading:false,//加载状态 + lowerThreshold: 100,//距离底部多远触发 + isReachedBottom: false,//防止重复加载|true=不可加载|false=可加载 + + //筛选条件 + filteredData:{ + page:1,//当前页码 + limit:10,//每页返回数据条数 + total:10,//数据总条数 + status: '',//1=未提交,2=已提交,3=已批改 + }, + formData: { images_arr: [], images: '', @@ -37,6 +83,69 @@ export default { onLoad() { }, methods: { + + //初始化 + async init(){ + await this.getList(); + }, + + //加载更多(下一页) + loadMoreData() { + return; //不用下拉加载 + //判断是否加载 + if (!this.isReachedBottom) { + this.isReachedBottom = true;//设置为不可请求状态 + this.getList(); + } + }, + //重置为第一页 + async resetFilteredData() { + this.isReachedBottom = false; // 重置状态,以便下次触发加载更多 + + this.filteredData.page = 1//当前页码 + this.filteredData.limit = 10//每页返回数据条数 + this.filteredData.total = 10//数据总条数 + }, + + //获取作业列表 + async getList(){ + this.loading = true + + let data = {...this.filteredData} + + //判断是否还有数据 + if(this.filteredData.page * this.filteredData.limit > this.filteredData.total){ + this.loading = false + uni.showToast({ + title: '暂无更多', + icon: 'none' + }) + return + } + + if(data.page == 1){ + this.tableList = [] + } + + let res = await memberApi.assignmentsList(data) + this.loading = false + this.isReachedBottom = false; + if (res.code != 1){ + uni.showToast({ + title: res.msg, + icon: 'none' + }) + return + } + + this.tableList = this.tableList.concat(res.data.data); // 使用 concat 方法 将新数据追加到数组中 + + console.log('列表',this.tableList) + this.filteredData.total = res.data.total + this.filteredData.page++ + }, + + //######AQ上传文件组件相关###### // 上传文件回调 AQUploadSuccess(res) { @@ -120,19 +229,83 @@ export default { } .section_1{ + color: #FFFFFF; + font-size: 28rpx; padding: 0 24rpx; display: flex; flex-direction: column; - gap: 38rpx; - .item{ - + gap: 40rpx; + .ul{ + .time_section{ + text-align: center; + font-size: 28rpx; + color: #989898; + } + .li{ + margin: 40rpx 0; + display: flex; + justify-content: space-between; + .item{ + max-width: 70%; + padding: 32rpx; + border-radius: 32rpx; + word-wrap: break-word; /* 允许长单词或 URL 换行 */ + word-break: break-all; /* 强制所有字符换行 */ + .text_box{} + } + .left_item{ + background-color: #f4f6f9; + color: #343434; + } + .right_item{ + background-color: #1684fc; + color: #fff; + } + } } } + } + //输入框板块 + .input_section{ + width: 100%; + position: fixed; + bottom: 0; + padding: 50rpx 50rpx; + display: flex; + justify-content:space-between; + align-items: center; + .left_box{ + width: 70%; + .input{ + background-color: #f4f6f9; + height: 88rpx; + padding: 28rpx; + font-size: 28rpx; + border-radius: 32rpx; - } + width: 532rpx; + color: #292929; + font-size: 28rpx; + } + } + .right_box{ + border-radius: 50%; + background-color: #a2cefe; + width: 88rpx; + height: 88rpx; + display: flex; + justify-content: center; + align-items: center; + .send_img{ + width: 36rpx; + height: 36rpx; + } + } + + } .describe { color: #999999; diff --git a/pages/common/my_message.vue b/pages/common/my_message.vue index 189da0b..78d6e23 100644 --- a/pages/common/my_message.vue +++ b/pages/common/my_message.vue @@ -15,7 +15,7 @@ - + 张老师 @@ -26,7 +26,7 @@ - + 李老师 @@ -116,6 +116,14 @@ export default { }) }, + //跳转页面-聊天页面 + openViewImChatInfo(v){ + let user_id = 1 + uni.navigateTo({ + url: `/pages/common/im_chat_info?user_id=${user_id}` + }) + }, + } }