drugReportList.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <template>
  2. <view class="content">
  3. <u-sticky>
  4. <view class="top-fixed">
  5. <u-tabs
  6. :scrollable="false"
  7. :list="tabs"
  8. lineColor="#2583EB"
  9. @change="statusChange">
  10. </u-tabs>
  11. </view>
  12. </u-sticky>
  13. <mescroll-body top="88rpx" bottom="0" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback" @up="upCallback">
  14. <view class="order-list">
  15. <view class="order-item" v-for="(item) in dataList" @click="navTo('./inquiryOrderDetails?orderId='+item.orderId)">
  16. <view class="order-top" >
  17. <view class="left" >
  18. <image class="head" mode="aspectFill" :src="item.avatar"></image>
  19. <view class="name">
  20. {{item.doctorName}}
  21. </view>
  22. </view>
  23. <view class="status red" v-if="item.status==1">
  24. 未评价
  25. </view>
  26. <view class="status green" v-if="item.status==2">
  27. 已评价
  28. </view>
  29. </view>
  30. <view class="order-cont">
  31. <view class="order-desc">咨询总结:{{item.reportSummary}}</view>
  32. <view class="order-time-box">
  33. <view class="order-time">
  34. <view class="time">{{item.createTime}} </view>
  35. </view>
  36. <view class="right">
  37. <view class="btn green" v-if="item.status==1" @click.stop="doPing(item)">去评价</view>
  38. <view class="btn green" @click.stop="showDetails(item)">查看</view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </mescroll-body>
  45. </view>
  46. </template>
  47. <script>
  48. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  49. import {getDrugReportList} from '@/api/drugReport'
  50. export default {
  51. mixins: [MescrollMixin], // 使用mixin
  52. data() {
  53. return {
  54. tabs:[
  55. {
  56. id:0,
  57. name:'全部'
  58. },
  59. {
  60. id:1,
  61. name:'待评价'
  62. },
  63. {
  64. id:2,
  65. name:'已评价'
  66. }
  67. ],
  68. status:0,
  69. mescroll:null,
  70. downOption: { //下拉刷新
  71. use:true,
  72. auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
  73. },
  74. upOption: {
  75. onScroll:false,
  76. use: true, // 是否启用上拉加载; 默认true
  77. page: {
  78. pae: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  79. size: 10 // 每页数据的数量,默认10
  80. },
  81. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  82. textNoMore:"已经到底了",
  83. empty: {
  84. icon:'https://zkzh-2025.oss-cn-beijing.aliyuncs.com/appimgs/cf4a86b913a04341bb44e34bb4d37aa2.png',
  85. tip: '暂无数据'
  86. }
  87. },
  88. dataList: []
  89. }
  90. },
  91. onLoad() {
  92. var that=this;
  93. uni.$on('refreshDrugReportList', () => {
  94. that.mescroll.resetUpScroll()
  95. })
  96. },
  97. onShow() {
  98. },
  99. methods: {
  100. doPing(item){
  101. uni.navigateTo({
  102. url: "./drugReportPing?reportId="+item.reportId
  103. })
  104. },
  105. showDetails(item){
  106. uni.navigateTo({
  107. url: "./drugReportDetails?reportId="+item.reportId
  108. })
  109. },
  110. statusChange(item){
  111. this.status=item.id
  112. console.log(item)
  113. this.mescroll.resetUpScroll()
  114. },
  115. navTo(url){
  116. uni.navigateTo({
  117. url: url
  118. })
  119. },
  120. mescrollInit(mescroll) {
  121. this.mescroll = mescroll;
  122. },
  123. /*下拉刷新的回调 */
  124. downCallback() {
  125. this.mescroll.resetUpScroll()
  126. },
  127. /*上拉加载的回调*/
  128. upCallback(page) {
  129. //联网加载数据
  130. var that = this;
  131. var data = {
  132. pageNum: page.num,
  133. pageSize: page.size
  134. };
  135. if(this.status!=0){
  136. data.status=this.status
  137. }
  138. getDrugReportList(data).then(res => {
  139. if(res.code==200){
  140. if (page.num == 1) {
  141. that.dataList = res.data.list;
  142. } else {
  143. that.dataList = that.dataList.concat(res.data.list);
  144. }
  145. that.mescroll.endBySize(res.data.list.length, res.data.total);
  146. }else{
  147. uni.showToast({
  148. icon:'none',
  149. title: "请求失败",
  150. });
  151. that.dataList = null;
  152. that.mescroll.endErr();
  153. }
  154. });
  155. },
  156. }
  157. }
  158. </script>
  159. <style lang="scss">
  160. page{
  161. height: 100%;
  162. background: #f6f6f6;
  163. }
  164. </style>
  165. <style scoped lang="scss">
  166. .content{
  167. // height: 100%;
  168. .top-fixed{
  169. width: 100%;
  170. position: absolute;
  171. top: 0;
  172. left: 0;
  173. z-index: 10;
  174. height: 88upx;
  175. background-color: #fff;
  176. }
  177. .order-list{
  178. width: 100%;
  179. padding: 15rpx;
  180. display: flex;
  181. flex-direction: column;
  182. align-items: flex-start;
  183. justify-content: flex-start;
  184. .order-item{
  185. margin-bottom: 20rpx;
  186. width: 100%;
  187. padding: 20rpx;
  188. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  189. background-color: #fff;
  190. border-radius: 15rpx;
  191. display: flex;
  192. flex-direction: column;
  193. align-items: flex-start;
  194. justify-content: flex-start;
  195. .order-top{
  196. display: flex;
  197. align-items: center;
  198. justify-content: space-between;
  199. width: 100%;
  200. padding-bottom: 15rpx;
  201. border-bottom: 1px solid #efefef;
  202. .left{
  203. display: flex;
  204. align-items: center;
  205. justify-content: flex-start;
  206. image{
  207. width:80rpx;
  208. height:80rpx;
  209. border-radius: 50%;
  210. }
  211. .title{
  212. font-size: 32upx;
  213. font-family: PingFang SC;
  214. font-weight: bold;
  215. color: #111111;
  216. }
  217. .name{
  218. margin-left: 20rpx;
  219. font-size: 32upx;
  220. font-family: PingFang SC;
  221. font-weight: bold;
  222. color: #111111;
  223. }
  224. }
  225. .status{
  226. font-size: 28upx;
  227. font-family: PingFang SC;
  228. }
  229. .red{
  230. color: #db5053;
  231. }
  232. .green{
  233. color: #2583EB;
  234. }
  235. }
  236. .order-cont{
  237. width: 100%;
  238. margin-top: 20rpx;
  239. .order-desc{
  240. margin-top: 15rpx;
  241. font-size: 28upx;
  242. font-family: PingFang SC;
  243. // font-weight: bold;
  244. color: #111111;
  245. }
  246. .order-time-box{
  247. width: 100%;
  248. margin-top: 15rpx;
  249. display: flex;
  250. align-items: center;
  251. justify-content: space-between;
  252. .order-time{
  253. display: flex;
  254. align-items: center;
  255. justify-content: flex-start;
  256. .time{
  257. font-size: 28upx;
  258. font-family: PingFang SC;
  259. color: #9a9a9c;
  260. }
  261. .count{
  262. margin-left: 10rpx;
  263. font-size: 28upx;
  264. font-family: PingFang SC;
  265. color: #111;
  266. }
  267. }
  268. .right{
  269. display: flex;
  270. align-items: center;
  271. justify-content: flex-end;
  272. .btn{
  273. margin-left: 10rpx;
  274. padding: 10rpx 30rpx;
  275. font-size: 28rpx;
  276. border-radius: 30rpx;
  277. }
  278. .red{
  279. background-color: #2583EB;
  280. color: #fff;
  281. }
  282. .green{
  283. border: 1rpx solid #2583EB;
  284. color: #2583EB;
  285. }
  286. }
  287. }
  288. }
  289. }
  290. }
  291. }
  292. </style>