inquiryOrderPingList.vue 4.8 KB

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