From 623ae704114b4ac1aa8bad8f544c64fa5cdfca2a Mon Sep 17 00:00:00 2001 From: wangjialin Date: Tue, 30 Jul 2024 15:09:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9B=9E=E9=A6=88=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- littleApp_child/app.json | 4 +- .../packageA/pages/feedbacklist/feedbacklist.js | 202 +++++++++++++++++++++ .../packageA/pages/feedbacklist/feedbacklist.json | 8 + .../packageA/pages/feedbacklist/feedbacklist.wxml | 35 ++++ .../packageA/pages/feedbacklist/feedbacklist.wxss | 94 ++++++++++ .../packageA/pages/feedbackxq/feedbackxq.js | 114 ++++++++++++ .../packageA/pages/feedbackxq/feedbackxq.json | 8 + .../packageA/pages/feedbackxq/feedbackxq.wxml | 21 +++ .../packageA/pages/feedbackxq/feedbackxq.wxss | 20 ++ littleApp_child/pages/Setting/Setting.js | 23 +-- littleApp_child/pages/feedback/feedback.js | 51 +++++- littleApp_child/pages/feedback/feedback.wxml | 3 + littleApp_child/pages/feedback/feedback.wxss | 7 +- littleApp_child/pages/home/home.wxml | 4 +- littleApp_child/utils/apiFile.js | 6 +- 15 files changed, 574 insertions(+), 26 deletions(-) create mode 100644 littleApp_child/packageA/pages/feedbacklist/feedbacklist.js create mode 100644 littleApp_child/packageA/pages/feedbacklist/feedbacklist.json create mode 100644 littleApp_child/packageA/pages/feedbacklist/feedbacklist.wxml create mode 100644 littleApp_child/packageA/pages/feedbacklist/feedbacklist.wxss create mode 100644 littleApp_child/packageA/pages/feedbackxq/feedbackxq.js create mode 100644 littleApp_child/packageA/pages/feedbackxq/feedbackxq.json create mode 100644 littleApp_child/packageA/pages/feedbackxq/feedbackxq.wxml create mode 100644 littleApp_child/packageA/pages/feedbackxq/feedbackxq.wxss diff --git a/littleApp_child/app.json b/littleApp_child/app.json index 76ef78d..99c4c39 100644 --- a/littleApp_child/app.json +++ b/littleApp_child/app.json @@ -58,7 +58,9 @@ "pages/serviceNotice/serviceNotice", "pages/eatAddress/eatAddress", "pages/messageNotification/messageNotification", - "pages/messageContent/messageContent" + "pages/messageContent/messageContent", + "pages/feedbacklist/feedbacklist", + "pages/feedbackxq/feedbackxq" ] } ], diff --git a/littleApp_child/packageA/pages/feedbacklist/feedbacklist.js b/littleApp_child/packageA/pages/feedbacklist/feedbacklist.js new file mode 100644 index 0000000..1382b3d --- /dev/null +++ b/littleApp_child/packageA/pages/feedbacklist/feedbacklist.js @@ -0,0 +1,202 @@ +// pages/messageNotification/message.js + +// 网络请求工具类 +var networkUtil = require('../../../utils/network_util.js') +var api = require('../../../utils/apiFile.js') +Page({ + + /** + * 页面的初始数据 + */ + data: { + notificationList:[], // 消息通知列表 + currentPage: 1, // 当前页码 + limit: 10, // 每页显示的数据条数 + hasMoreData: true, // 是否有更多数据可加载 + babyId:null, + formattedDate:null + }, + + //获取消息通知 + getNotificationList:function(){ + + }, + formatDate(milliseconds) { + // 创建 Date 对象 + const date = new Date(milliseconds); + + // 格式化日期和时间 + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份是从0开始的 + const day = String(date.getDate()).padStart(2, '0'); + const hours = String(date.getHours()).padStart(2, '0'); + const minutes = String(date.getMinutes()).padStart(2, '0'); + const seconds = String(date.getSeconds()).padStart(2, '0'); + + // 拼接成 YYYY-MM-DD HH:MM:SS 格式 + return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; +} , + // 下拉加载 + loadMore:function(){ + const self = this; + if (!self.data.hasMoreData) { + return; // 如果没有更多数据,不执行任何操作 + } + // 使用 setData 更新页面状态为正在加载 + self.setData({ + isLoading: true + }); + networkUtil._get(api.getfeedback, { + page: self.data.currentPage, + limit: self.data.limit, + babyId:self.data.babyId, + }, function(res) { + if (res.data && res.data.data.length > 0) { + let newData = self.data.notificationList.concat(res.data.data); + newData.forEach((item,index)=>{ + if(item.created){ + newData[index].createdstr=self.formatDate(item.created) + } + }) + self.setData({ + notificationList: newData, + currentPage: self.data.currentPage + 1, + isLoading: false + }); + // 判断是否还有更多数据 + const hasMoreData = res.data.pageInfo.page < res.data.pageInfo.lastPage + // 更新页面数据(假设你在微信小程序或其他使用setData方法的框架中) + self.setData({ + hasMoreData: hasMoreData + }); + + wx.hideToast(); + } else { + // 如果没有返回数据,表示没有更多数据了 + self.setData({ + hasMoreData: false, + isLoading: false + }); + } + }, function(res) { + networkUtil.showErrorToast(res.errormsg); + wx.hideToast(); + }); + }, + + // 跳转 + messageBtn:function(e){ + const id = e.currentTarget.dataset.index + const str=e.currentTarget.dataset.item + if(id){ + wx.setStorageSync('feedxq', JSON.stringify(str)) + setTimeout(() =>{ + wx.navigateTo({ + url: `/packageA/pages/feedbackxq/feedbackxq?id=${id}`, + }) + },100) + } else { + return + } + }, + // 快速预约课程 + goAddQuestion: function(e) { + networkUtil.showLoading(); + var self = this; + wx.showModal({ + title: '提示', + confirmText: '线上', + content:`您目前是要线上预约还是现场预约?`, + cancelText: '现场', + success(res) { + if (res.confirm) { + var param = { courseId: e.target.dataset.id, type: 1 }; + networkUtil._get(api.orderCourse, param, function(res) { + if (res.data.errorcode == 0) { + networkUtil.showToast('预约成功'); + self.loadMore(); + } + }, + function(res) { + networkUtil.showErrorToast(res.errormsg); + wx.hideToast(); + }); + } else if (res.cancel) { + var param = { courseId: e.target.dataset.id, type: 2 }; + networkUtil._get(api.orderCourse, param, function(res) { + // console.log(ress,'res'); + if (res.data.errorcode == 0) { + networkUtil.showToast('预约成功'); + self.loadMore(); + } + } + , function(res) { + networkUtil.showErrorToast(res.errormsg); + wx.hideToast(); + } + ); + } + } + }); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + networkUtil.showLoading() + console.log('options',options); + this.setData({ + babyId:options.id + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + this.loadMore() + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/littleApp_child/packageA/pages/feedbacklist/feedbacklist.json b/littleApp_child/packageA/pages/feedbacklist/feedbacklist.json new file mode 100644 index 0000000..78605f2 --- /dev/null +++ b/littleApp_child/packageA/pages/feedbacklist/feedbacklist.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "反馈记录", + "navigationBarBackgroundColor": "#48C17B", + "navigationBarTextStyle": "white", + "backgroundColor": "#d8dbd4", + "pageOrientation": "auto", + "usingComponents": {} +} \ No newline at end of file diff --git a/littleApp_child/packageA/pages/feedbacklist/feedbacklist.wxml b/littleApp_child/packageA/pages/feedbacklist/feedbacklist.wxml new file mode 100644 index 0000000..5c3f80c --- /dev/null +++ b/littleApp_child/packageA/pages/feedbacklist/feedbacklist.wxml @@ -0,0 +1,35 @@ + + + + + + + + + + + + {{item.callBack?'已回复':'未回复'}} + + + + {{item.createdstr}} + + + + + + {{item.title}} + + + + {{item.content}} + + + + + + diff --git a/littleApp_child/packageA/pages/feedbacklist/feedbacklist.wxss b/littleApp_child/packageA/pages/feedbacklist/feedbacklist.wxss new file mode 100644 index 0000000..f84b1d8 --- /dev/null +++ b/littleApp_child/packageA/pages/feedbacklist/feedbacklist.wxss @@ -0,0 +1,94 @@ +/* packageA/pages/feedbacklist/feedbacklist.wxss */ + +.messageNotification { + width: 100vw; + height: 100vh; + background-color: #F2F2F2; + } + + .messageNotification .messageNotification-item{ + width: 690rpx; + margin: 28rpx 30rpx; + background: #FFFFFF; + border-radius: 6rpx 6rpx 6rpx 6rpx; + } + + .messageNotification-item .head{ + height: 100rpx; + display: flex; + align-items: center; + justify-content: space-between; + border-bottom: 2rpx solid #F4F4F4; + padding: 0 36rpx; + } + + .head .time{ + font-family: SourceHanSansSC, SourceHanSansSC; + font-weight: 400; + font-size: 22rpx; + color: #636363; + line-height: 0rpx; + text-align: left; + font-style: normal; + text-transform: none; + } + + .messageNotification-item .notice{ + position: relative; + } + + .notice .text { + position: absolute; + top: 10rpx; + left: -20rpx; + width: 10rpx; + height: 10rpx; + background: #FF2727; + border-radius: 5rpx 5rpx 5rpx 5rpx + } + + .notice .notice-title { + font-family: SourceHanSansSC, SourceHanSansSC; + font-weight: 400; + font-size: 22rpx; + color: #FFFFFF; + width: 72rpx; + height: 31rpx; + line-height: 31rpx; + text-align: center; + } + .notice .tile-color{ + background: #FF6D89; + border-radius: 3rpx 3rpx 3rpx 3rpx; + } + .notice .tile-color1 { + background: #FD992F; + border-radius: 3rpx 3rpx 3rpx 3rpx; + } + + .messageNotification-item .content{ + padding: 30rpx; + + } + + .content .title-head{ + font-family: SourceHanSansSC, SourceHanSansSC; + font-weight: 400; + font-size: 28rpx; + color: #0B0B0B; + margin-bottom: 20rpx; + font-style: normal; + text-transform: none; + } + .content .title-content{ + font-family: SourceHanSansSC, SourceHanSansSC; + font-weight: 400; + font-size: 24rpx; + color: #999999; + font-style: normal; + text-transform: none; + display: -webkit-box; + -webkit-line-clamp: 3; /* 设置最大行数 */ + -webkit-box-orient: vertical; /* 设置为垂直方向 */ + overflow: hidden; /* 超出部分隐藏 */ + } \ No newline at end of file diff --git a/littleApp_child/packageA/pages/feedbackxq/feedbackxq.js b/littleApp_child/packageA/pages/feedbackxq/feedbackxq.js new file mode 100644 index 0000000..8d15505 --- /dev/null +++ b/littleApp_child/packageA/pages/feedbackxq/feedbackxq.js @@ -0,0 +1,114 @@ +// packageA/pages/feedbackxq/feedbackxq.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + type:'', + cTime:'', + content:'', + dTime:'', + dContent:'', + hf:1 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + if(wx.getStorageSync('feedxq')){ + let str=JSON.parse(wx.getStorageSync('feedxq')) + console.log('str',str); + let typestr='' + if(str.type==3){ + typestr='其他反馈' + }else if(str.type==2){ + typestr='内容意见' + }else{ + typestr='无法正常使用' + } + if(str.callBack){ + let Dtime=this.formatDate(str.modified) + this.setData({ + dContent:str.callBack, + dTime:Dtime, + hf:1 + }) + }else{ + this.setData({ + hf:0 + }) + } + let Ctime=this.formatDate(str.created) + this.setData({ + content:str.content, + type:typestr, + cTime:Ctime + }) + } + }, + formatDate(milliseconds) { + // 创建 Date 对象 + const date = new Date(milliseconds); + + // 格式化日期和时间 + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份是从0开始的 + const day = String(date.getDate()).padStart(2, '0'); + const hours = String(date.getHours()).padStart(2, '0'); + const minutes = String(date.getMinutes()).padStart(2, '0'); + const seconds = String(date.getSeconds()).padStart(2, '0'); + + // 拼接成 YYYY-MM-DD HH:MM:SS 格式 + return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; + } , + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/littleApp_child/packageA/pages/feedbackxq/feedbackxq.json b/littleApp_child/packageA/pages/feedbackxq/feedbackxq.json new file mode 100644 index 0000000..467fd70 --- /dev/null +++ b/littleApp_child/packageA/pages/feedbackxq/feedbackxq.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "反馈详情", + "navigationBarBackgroundColor": "#48C17B", + "navigationBarTextStyle": "white", + "backgroundColor": "#d8dbd4", + "pageOrientation": "auto", + "usingComponents": {} +} \ No newline at end of file diff --git a/littleApp_child/packageA/pages/feedbackxq/feedbackxq.wxml b/littleApp_child/packageA/pages/feedbackxq/feedbackxq.wxml new file mode 100644 index 0000000..4300061 --- /dev/null +++ b/littleApp_child/packageA/pages/feedbackxq/feedbackxq.wxml @@ -0,0 +1,21 @@ + + + + + 反馈类型:{{type}} + 反馈时间:{{cTime}} + + + {{content}} + + + + + 医生回复: + {{dTime}} + + + {{hf==1?dContent:'暂无回复'}} + + + diff --git a/littleApp_child/packageA/pages/feedbackxq/feedbackxq.wxss b/littleApp_child/packageA/pages/feedbackxq/feedbackxq.wxss new file mode 100644 index 0000000..506270c --- /dev/null +++ b/littleApp_child/packageA/pages/feedbackxq/feedbackxq.wxss @@ -0,0 +1,20 @@ +/* packageA/pages/feedbackxq/feedbackxq.wxss */ +.box1{ + background-color: #fff; + min-height: 100rpx; + border: 1px solid #ccc; + border-radius: 10rpx; + padding: 10rpx; +} +.box2{ + background-color: #fff; + min-height: 100rpx; + border: 1px solid #ccc; + border-radius: 10rpx; + padding: 10rpx; + margin-top: 20rpx; +} +.flex1{ + display: flex; + justify-content: space-between; +} \ No newline at end of file diff --git a/littleApp_child/pages/Setting/Setting.js b/littleApp_child/pages/Setting/Setting.js index 731b256..184791a 100644 --- a/littleApp_child/pages/Setting/Setting.js +++ b/littleApp_child/pages/Setting/Setting.js @@ -17,7 +17,9 @@ Page({ isShowTwo: false, isShowThree: false, isVip:false, - userData:'' + userData:'', + babyname:'', + babyid:'' }, onLoad: function (option) { @@ -45,7 +47,10 @@ Page({ } networkUtil._get(api.userInfo + app.globalData.currentId, param, function (res) { console.log('获取用户信息', res) - + self.setData({ + babyname:res.data.data.username, + babyid:res.data.data.id + }) self.setUserInfo(res.data.data) }, function (res) { @@ -99,25 +104,13 @@ Page({ url = '../inforBind/inforBind' break case 1: - url = '../feedback/feedback' + url = `../feedback/feedback?babyname=${this.data.babyname}&babyid=${this.data.babyid}` break case 2: wx.showToast({ title: '清除成功', }) break - // case 3: - // url = '../PersonalInfo/PersonalInfo' - // break - // case 4: - // url = '../mySaved/mySaved' - // break - // case 5: - // url = '../feedback/feedback' - // break - // case 6: - - // break } wx.navigateTo({ url: url diff --git a/littleApp_child/pages/feedback/feedback.js b/littleApp_child/pages/feedback/feedback.js index 07e7e67..5d091de 100644 --- a/littleApp_child/pages/feedback/feedback.js +++ b/littleApp_child/pages/feedback/feedback.js @@ -3,7 +3,7 @@ // 网络请求工具类 var networkUtil = require('../../utils/network_util.js') var api = require('../../utils/apiFile.js') - +var app = getApp() // 页码 var page = 0 // 地理位置信息 @@ -17,10 +17,16 @@ Page({ chooseOne: 0, chooseTwo: 0, chooseThree: 0, - content: "" - + content: "", + babyname:'', + babyid:'' }, onLoad: function (e) { + console.log('撒大大',e); + this.setData({ + babyname:e.babyname, + babyid:e.babyid + }) wx.getSystemInfo({ success: function (res) { console.log(res) @@ -81,9 +87,42 @@ Page({ networkUtil.showErrorToast('选择反馈类型') return } - console.log(this.data.content) - networkUtil.showErrorToast('提交成功') - wx.navigateBack({ + let type + if(this.data.chooseOne==1){ + type=1 + }else if(this.data.chooseTwo==1){ + type=2 + }else{ + type=3 + } + let params={ + content:this.data.content, + publishId:this.data.babyid, + publishName:this.data.babyname, + type:type, + hospitalId:app.globalData.userInfo.hospitalId + } + networkUtil._post(api.addfeedback, params, function (res) { + if(res.data.errorcode==0){ + networkUtil.showErrorToast('提交成功') + console.log('res',res); + } + }, function (res) { + networkUtil.showErrorToast(res.errormsg) + },'application/json') + }, + submit1:function(){ + wx.navigateTo({ + url: `/packageA/pages/feedbacklist/feedbacklist?id=${this.data.babyid}` }) + // networkUtil._get(api.getfeedback, { + // page:1, + // limit:10, + // babyId:this.data.babyid + // }, function(res) { + + // }, function(res) { + // networkUtil.showErrorToast(res.errormsg) + // }) } }) diff --git a/littleApp_child/pages/feedback/feedback.wxml b/littleApp_child/pages/feedback/feedback.wxml index ce4a668..a161d03 100644 --- a/littleApp_child/pages/feedback/feedback.wxml +++ b/littleApp_child/pages/feedback/feedback.wxml @@ -20,6 +20,9 @@ + + + diff --git a/littleApp_child/pages/feedback/feedback.wxss b/littleApp_child/pages/feedback/feedback.wxss index 843bbb8..bc12377 100644 --- a/littleApp_child/pages/feedback/feedback.wxss +++ b/littleApp_child/pages/feedback/feedback.wxss @@ -38,7 +38,12 @@ textarea { right: 10px; height: 36px; } - +.delete_bt3 { + background: #48c17b; + border-radius: 100px; + color: white; + font-size: 14px; +} .feedback_type { margin-top: 10px; padding: 5px; diff --git a/littleApp_child/pages/home/home.wxml b/littleApp_child/pages/home/home.wxml index 68ba79e..13a638f 100644 --- a/littleApp_child/pages/home/home.wxml +++ b/littleApp_child/pages/home/home.wxml @@ -121,11 +121,11 @@ 补填户籍地址 - + 中医指导文章 - + 服务名目通知 diff --git a/littleApp_child/utils/apiFile.js b/littleApp_child/utils/apiFile.js index 40230e8..a305bea 100644 --- a/littleApp_child/utils/apiFile.js +++ b/littleApp_child/utils/apiFile.js @@ -120,5 +120,9 @@ module.exports = { // 通知详情 getBabyMsgById :'getBabyMsgById', // 消息记录 - getBabyMsgCountById:'getBabyMsgCountById' + getBabyMsgCountById:'getBabyMsgCountById', + //提交反馈 + addfeedback:'baby/feedback/add', + //反馈列表 + getfeedback:'baby/feedback/getList' } -- 1.8.3.1