doctorPingList.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view class="content">
  3. <view class="cont">
  4. <view class="ping-box">
  5. <view class="title-box">
  6. <view class="left">
  7. <view class="title">患者评价({{total}})</view>
  8. </view>
  9. </view>
  10. <mescroll-body top="88rpx" bottom="0" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback" @up="upCallback">
  11. <view class="ping-list">
  12. <view class="ping-item" v-for="(item) in dataList">
  13. <view class="left">
  14. <image :src="item.avatar==null?'https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/dfdd555016854b0d9fb623937238729f.jpg':item.avatar"></image>
  15. </view>
  16. <view class="right">
  17. <view class="user-name-box">
  18. <view class="user-name">
  19. {{item.nickName}}
  20. </view>
  21. <view class="ping-star">
  22. <u-rate activeColor="#ffc603" count="5" readonly v-model="item.pingStar"></u-rate>
  23. </view>
  24. </view>
  25. <view class="ping-cont">
  26. {{item.pingContent}}
  27. </view>
  28. <view class="ping-time">
  29. {{item.pingTime}}
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </mescroll-body>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import {getDoctorPingList} from '@/api/doctor.js'
  41. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  42. export default {
  43. mixins: [MescrollMixin], // 使用mixin
  44. data() {
  45. return {
  46. total:0,
  47. doctorId:null,
  48. mescroll:null,
  49. downOption: { //下拉刷新
  50. use:true,
  51. auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
  52. },
  53. upOption: {
  54. onScroll:false,
  55. use: true, // 是否启用上拉加载; 默认true
  56. page: {
  57. pae: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  58. size: 10 // 每页数据的数量,默认10
  59. },
  60. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  61. textNoMore:"已经到底了",
  62. empty: {
  63. icon:'https://cos.his.cdwjyyh.com/fs/20240423/cf4a86b913a04341bb44e34bb4d37aa2.png',
  64. tip: '暂无数据'
  65. }
  66. },
  67. dataList: []
  68. }
  69. },
  70. onLoad(options) {
  71. this.doctorId=options.doctorId;
  72. },
  73. methods: {
  74. mescrollInit(mescroll) {
  75. this.mescroll = mescroll;
  76. },
  77. /*下拉刷新的回调 */
  78. downCallback() {
  79. this.mescroll.resetUpScroll()
  80. },
  81. /*上拉加载的回调*/
  82. upCallback(page) {
  83. //联网加载数据
  84. var that = this;
  85. var data = {
  86. doctorId: this.doctorId,
  87. pageNum: page.num,
  88. pageSize: page.size
  89. };
  90. getDoctorPingList(data).then(res => {
  91. if(res.code==200){
  92. this.total=res.data.total;
  93. if (page.num == 1) {
  94. that.dataList = res.data.list;
  95. } else {
  96. that.dataList = that.dataList.concat(res.data.list);
  97. }
  98. that.mescroll.endBySize(res.data.list.length, res.data.total);
  99. }else{
  100. uni.showToast({
  101. icon:'none',
  102. title: "请求失败",
  103. });
  104. that.dataList = null;
  105. that.mescroll.endErr();
  106. }
  107. });
  108. },
  109. }
  110. }
  111. </script>
  112. <style scoped lang="scss">
  113. .content{
  114. height: 100%;
  115. position: relative;
  116. .cont{
  117. width: 100%;
  118. display: flex;
  119. flex-direction: column;
  120. .ping-box{
  121. .title-box{
  122. padding: 0rpx 20rpx;
  123. position: fixed;
  124. line-height: 88rpx;
  125. display: flex;
  126. flex-direction: row;
  127. align-items: center;
  128. justify-content: space-between;
  129. .left{
  130. display: flex;
  131. align-items: center;
  132. justify-content: center;
  133. .title{
  134. font-size: 32upx;
  135. font-family: PingFang SC;
  136. font-weight: bold;
  137. color: #111111;
  138. }
  139. // .line{
  140. // margin-right: 15rpx;
  141. // height: 30rpx;
  142. // width: 6rpx;
  143. // background-color: #C39A58;
  144. // }
  145. }
  146. .more{
  147. display: flex;
  148. align-items: center;
  149. justify-content: center;
  150. font-size: 28upx;
  151. font-family: PingFang SC;
  152. color: #9a9a9c;
  153. image{
  154. margin-left: 10rpx;
  155. width: 30rpx;
  156. height:30rpx;
  157. }
  158. }
  159. }
  160. .ping-list{
  161. display: flex;
  162. flex-direction: column;
  163. align-items: flex-start;
  164. justify-content: flex-start;
  165. padding: 20rpx;
  166. .ping-item{
  167. margin-bottom: 15rpx;
  168. padding: 15rpx;
  169. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  170. background-color: #fff;
  171. border-radius: 15rpx;
  172. width: 100%;
  173. display: flex;
  174. align-items: flex-start;
  175. justify-content: flex-start;
  176. &:last-child{
  177. margin-bottom: 0rpx;
  178. }
  179. .left{
  180. image{
  181. width:80rpx;
  182. height:80rpx;
  183. border-radius: 50%;
  184. }
  185. }
  186. .right{
  187. width: 100%;
  188. margin-left: 15rpx;
  189. .user-name-box{
  190. display: flex;
  191. align-items: center;
  192. justify-content: space-between;
  193. font-size: 28upx;
  194. font-family: PingFang SC;
  195. font-weight: bold;
  196. color: #111111;
  197. }
  198. .ping-cont{
  199. margin-top: 10rpx;
  200. font-size: 28upx;
  201. font-family: PingFang SC;
  202. color: #9a9a9c;
  203. }
  204. .ping-time{
  205. margin-top: 10rpx;
  206. font-size: 28upx;
  207. font-family: PingFang SC;
  208. color: #9a9a9c;
  209. }
  210. }
  211. }
  212. }
  213. }
  214. }
  215. }
  216. </style>