bloodSugarList.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. <template>
  2. <view class="content">
  3. <view class="top-fixed">
  4. <!-- tab切换 -->
  5. <view class="pub-tab-box">
  6. <view class="tab-inner">
  7. <view
  8. v-for="(item,index) in orderStatus"
  9. :key="index"
  10. :class="item.val == orderStatusValue?'item active':'item'"
  11. @click="orderStatusChange(item)">
  12. <view class="text">
  13. {{ item.name }}
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="consu-list">
  20. <view class="tab-time">
  21. <picker class="birth-picker" mode="date" fields="month" @change="bindDateChange">
  22. <view class="left-box">
  23. <view>{{day}}</view>
  24. <image class="w48 h48" src="../static/images/health/arrow_down.png"></image>
  25. </view>
  26. </picker>
  27. </view>
  28. <mescroll-body top="176upx" ref="mescrollRef">
  29. <view v-for="(item,index) in dataList" :key="index" class="item">
  30. <view class="item-top">
  31. {{item.date}}
  32. </view>
  33. <view class="bottom-box" v-for="(it,idx) in item.list" :key="idx" @click="showDetail(it)">
  34. <view class="amount-paid">
  35. <view :class="'title bg'+it.type">{{it.typeName}}</view>
  36. <view class="data">{{it.data}} mmol/L</view>
  37. </view>
  38. <view class="time">{{utils.formatDate(it.createTime)}}</view>
  39. </view>
  40. </view>
  41. </mescroll-body>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import {getMyDoctorOrderList,cancelOrder} from '@/api/doctorOrder.js'
  47. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  48. export default {
  49. mixins: [MescrollMixin],
  50. data() {
  51. return {
  52. day:this.utils.timeFormat(new Date(),'yyyy年mm月'),
  53. orderStatus:[
  54. {name:"全部",val:""},
  55. {name:"正常",val:"0"},
  56. {name:"轻微",val:"1"},
  57. {name:"严重",val:"2"},
  58. ],
  59. orderStatusValue:'',
  60. mescroll:null,
  61. // 上拉加载的配置
  62. upOption: {
  63. onScroll:true,
  64. use: true, // 是否启用上拉加载; 默认true
  65. page: {
  66. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  67. size: 10 // 每页数据的数量,默认10
  68. },
  69. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  70. empty: {
  71. icon:'/static/images/no_data.png',
  72. tip: '暂无数据'
  73. }
  74. },
  75. // 列表数据
  76. dataList: [
  77. {
  78. list:[
  79. {
  80. type:1,
  81. typeName:'正常',
  82. data:10.9,
  83. createTime:'2025-06-25 12:39:55'
  84. },
  85. {
  86. type:2,
  87. typeName:'轻微',
  88. data:10.9,
  89. createTime:'2025-06-25 22:39:55'
  90. },
  91. {
  92. type:3,
  93. typeName:'严重',
  94. data:10.9,
  95. createTime:'2025-06-25 17:39:55'
  96. }
  97. ],
  98. date:'2025-06-25',
  99. id:1
  100. },
  101. {
  102. list:[
  103. {
  104. type:1,
  105. typeName:'正常',
  106. data:10.9,
  107. createTime:'2025-02-25 12:39:55'
  108. },
  109. {
  110. type:2,
  111. typeName:'轻微',
  112. data:10.9,
  113. createTime:'2025-02-25 20:39:55'
  114. }
  115. ],
  116. date:'2025-02-25',
  117. id:2
  118. }
  119. ]
  120. }
  121. },
  122. onLoad() {
  123. // uni.$on('refreshDoctorOrder', () => {
  124. // this.mescroll.resetUpScroll()
  125. // })
  126. },
  127. methods: {
  128. // 时间选择
  129. bindDateChange: function(e) {
  130. this.day = this.utils.timeFormat(new Date(e.target.value),'yyyy年mm月')
  131. },
  132. navgetTo(index){
  133. uni.navigateTo({
  134. url: index==0?'/pages_health/addServe':'/pages_health/addCompetitors'
  135. })
  136. },
  137. cancel(item){
  138. var that=this;
  139. uni.showModal({
  140. title: '提示',
  141. content: '确定取消订单吗',
  142. success: function (res) {
  143. if (res.confirm) {
  144. var data = {
  145. orderId:item.orderId
  146. };
  147. cancelOrder(data).then(res => {
  148. if(res.code==200){
  149. uni.showToast({
  150. icon:'success',
  151. title: '订单已取消',
  152. });
  153. that.mescroll.resetUpScroll()
  154. }else{
  155. uni.showToast({
  156. icon:'none',
  157. title: res.msg,
  158. });
  159. }
  160. });
  161. }
  162. else if (res.cancel) {
  163. }
  164. }
  165. });
  166. },
  167. // tab切换
  168. orderStatusChange(item) {
  169. this.orderStatusValue = item.val
  170. if(item.val==1){
  171. this.dataList=this.dataList2
  172. }
  173. this.mescroll.resetUpScroll()
  174. },
  175. mescrollInit(mescroll) {
  176. this.mescroll = mescroll;
  177. },
  178. /*下拉刷新的回调 */
  179. downCallback(mescroll) {
  180. mescroll.resetUpScroll()
  181. },
  182. upCallback(page) {
  183. //联网加载数据
  184. var that = this;
  185. var data = {
  186. status:this.orderStatusValue,
  187. page: page.num,
  188. pageSize: page.size
  189. };
  190. // getMyDoctorOrderList(data).then(res => {
  191. // if(res.code==200){
  192. // //设置列表数据
  193. // if (page.num == 1) {
  194. // that.dataList = res.data.list;
  195. // } else {
  196. // that.dataList = that.dataList.concat(res.data.list);
  197. // }
  198. // that.mescroll.endBySize(res.data.list.length, res.data.total);
  199. // }else{
  200. // uni.showToast({
  201. // icon:'none',
  202. // title: "请求失败",
  203. // });
  204. // that.dataList = null;
  205. // that.mescroll.endErr();
  206. // }
  207. // });
  208. },
  209. showDetail(item){
  210. console.log(item,'pp')
  211. uni.navigateTo({
  212. url: '/pages_echarts/bloodSugarDetail'
  213. })
  214. }
  215. }
  216. }
  217. </script>
  218. <style lang="scss">
  219. .content{
  220. padding: 20upx;
  221. .top-fixed{
  222. width: 100%;
  223. position: fixed;
  224. top: 0;
  225. left: 0;
  226. z-index: 10;
  227. }
  228. .pub-tab-box{
  229. box-sizing: border-box;
  230. width: 100%;
  231. padding: 0 60upx;
  232. background-color: #FFFFFF;
  233. .tab-inner{
  234. height: 88upx;
  235. line-height: 88upx;
  236. display: flex;
  237. align-items: center;
  238. justify-content:space-between;
  239. overflow-x: auto;
  240. }
  241. .item{
  242. font-size: 28upx;
  243. white-space: nowrap;
  244. line-height: 1;
  245. font-family: PingFang SC;
  246. font-weight: 500;
  247. color: #666666;
  248. // margin-right: 60upx;
  249. display: flex;
  250. align-items: center;
  251. justify-content: center;
  252. &:last-child{
  253. margin-right: 0;
  254. }
  255. &.active{
  256. font-weight: bold;
  257. color: #333333;
  258. &::after {
  259. content: "";
  260. width: 48rpx;
  261. height: 8rpx;
  262. background: linear-gradient(120deg, #31A1FE 0%, #008FD3 100%);
  263. position: absolute;
  264. bottom: 0;
  265. border-radius: 6upx 6upx 0upx 0;
  266. }
  267. }
  268. .text{
  269. position: relative;
  270. z-index: 1;
  271. }
  272. .tab-bg{
  273. width: 72upx;
  274. height: 28upx;
  275. position: absolute;
  276. top: 17upx;
  277. left: 50%;
  278. transform: translateX(-36upx);
  279. z-index: -1;
  280. }
  281. }
  282. }
  283. .tab-time{
  284. padding: 32rpx 24rpx;
  285. font-size: 30rpx;
  286. color: #222426;
  287. text-align: left;
  288. position: fixed;
  289. top:88upx;
  290. z-index:10;
  291. .birth-picker {
  292. flex: 1;
  293. display: flex;
  294. align-items: center;
  295. .left-box{
  296. width: 100%;
  297. font-weight: 500;
  298. font-size: 30rpx;
  299. color: #222426;
  300. display: flex;
  301. align-items: center;
  302. .input-box{
  303. // width: 470upx;
  304. }
  305. .arrow{
  306. width: 13upx;
  307. height: 23upx;
  308. margin-left: 20upx;
  309. }
  310. }
  311. }
  312. }
  313. .consu-list{
  314. .item{
  315. background: #FFFFFF;
  316. border-radius: 16upx;
  317. padding: 24rpx;
  318. position: relative;
  319. margin-bottom: 20upx;
  320. .item-top{
  321. font-family: PingFang SC;
  322. font-weight: 500;
  323. font-size: 28rpx;
  324. color: #626468;
  325. text-align: left;
  326. padding:16rpx 0;
  327. .item-title{
  328. display: flex;
  329. align-items: center;
  330. justify-content: space-between;
  331. margin-bottom: 12rpx;
  332. }
  333. .ask-text{
  334. font-family: PingFang SC;
  335. font-weight: 500;
  336. font-size: 36rpx;
  337. color: #222426;
  338. text-align: left;
  339. }
  340. .ask-time{
  341. font-size: 24rpx;
  342. color: #898E91;
  343. text-align: left;
  344. line-height: 40rpx;
  345. }
  346. }
  347. .bottom-box{
  348. // height: 80upx;
  349. display: flex;
  350. align-items: center;
  351. justify-content: space-between;
  352. padding:32rpx 0;
  353. border-bottom: 1px solid #ECECEC;
  354. &:last-child{
  355. border-bottom: 0;
  356. }
  357. .amount-paid{
  358. display: flex;
  359. align-items: center;
  360. .title{
  361. width: 72rpx;
  362. height: 72rpx;
  363. line-height: 72rpx;
  364. font-family: PingFang SC;
  365. font-weight: 500;
  366. font-size: 24rpx;
  367. color: #FFFFFF;
  368. text-align: center;
  369. margin-right: 18rpx;
  370. border-radius:50%;
  371. }
  372. .bg1{
  373. background: #52D087;
  374. }
  375. .bg2{
  376. background: #FFB992;
  377. }
  378. .bg3{
  379. background: #FF5558;
  380. }
  381. .data{
  382. font-weight: 500;
  383. font-size: 30rpx;
  384. color: #222426;
  385. text-align: left;
  386. }
  387. }
  388. .time{
  389. font-size: 24rpx;
  390. color: #898E91;
  391. text-align: right;
  392. }
  393. }
  394. }
  395. }
  396. }
  397. </style>