doctorPingList.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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. width: 100%;
  123. padding: 0rpx 20rpx;
  124. position: fixed;
  125. line-height: 88rpx;
  126. display: flex;
  127. flex-direction: row;
  128. align-items: center;
  129. justify-content: space-between;
  130. z-index: 99;
  131. background-color: #f7f7f7;
  132. .left{
  133. display: flex;
  134. align-items: center;
  135. justify-content: center;
  136. .title{
  137. font-size: 32upx;
  138. font-family: PingFang SC;
  139. font-weight: bold;
  140. color: #111111;
  141. }
  142. // .line{
  143. // margin-right: 15rpx;
  144. // height: 30rpx;
  145. // width: 6rpx;
  146. // background-color: #C39A58;
  147. // }
  148. }
  149. .more{
  150. display: flex;
  151. align-items: center;
  152. justify-content: center;
  153. font-size: 28upx;
  154. font-family: PingFang SC;
  155. color: #9a9a9c;
  156. image{
  157. margin-left: 10rpx;
  158. width: 30rpx;
  159. height:30rpx;
  160. }
  161. }
  162. }
  163. .ping-list{
  164. display: flex;
  165. flex-direction: column;
  166. align-items: flex-start;
  167. justify-content: flex-start;
  168. padding: 20rpx;
  169. .ping-item{
  170. margin-bottom: 15rpx;
  171. padding: 15rpx;
  172. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  173. background-color: #fff;
  174. border-radius: 15rpx;
  175. width: 100%;
  176. display: flex;
  177. align-items: flex-start;
  178. justify-content: flex-start;
  179. &:last-child{
  180. margin-bottom: 0rpx;
  181. }
  182. .left{
  183. image{
  184. width:80rpx;
  185. height:80rpx;
  186. border-radius: 50%;
  187. }
  188. }
  189. .right{
  190. width: 100%;
  191. margin-left: 15rpx;
  192. .user-name-box{
  193. display: flex;
  194. align-items: center;
  195. justify-content: space-between;
  196. font-size: 28upx;
  197. font-family: PingFang SC;
  198. font-weight: bold;
  199. color: #111111;
  200. }
  201. .ping-cont{
  202. margin-top: 10rpx;
  203. font-size: 28upx;
  204. font-family: PingFang SC;
  205. color: #9a9a9c;
  206. }
  207. .ping-time{
  208. margin-top: 10rpx;
  209. font-size: 28upx;
  210. font-family: PingFang SC;
  211. color: #9a9a9c;
  212. }
  213. }
  214. }
  215. }
  216. }
  217. }
  218. }
  219. </style>