appointment.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <view class="center">
  3. <view class="box" v-for="(item, index) in list" :key="index" @click="nav(item.id)">
  4. <view class="top flex">
  5. <view class="bg"><image src=".../../static/img/index4.png" mode=""></image></view>
  6. <view class="title">{{ item.name }}</view>
  7. </view>
  8. <view class="main-bg">
  9. <image src="../../static/img/auto.png" mode=""></image>
  10. </view>
  11. <view class="font">
  12. 预约消耗:<span class="money">{{ item.money * 1}}{{ item.money_type }}</span>
  13. </view>
  14. <view class="font" style="margin-top: 10rpx;">
  15. 预约时间:<span class="time" >{{item.is_forever == 1? '永久' : item.valid_date+'天'}}</span>
  16. </view>
  17. <view class="btn">查看详情</view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import { auto } from '@/api/product.js';
  23. export default {
  24. data() {
  25. return {
  26. list: []
  27. };
  28. },
  29. onLoad() {
  30. this.loadData();
  31. },
  32. methods: {
  33. async loadData() {
  34. auto({}).then(({ data }) => {
  35. this.list = data.data;
  36. });
  37. },
  38. nav(id) {
  39. uni.navigateTo({
  40. url: '/pages/index/appointmentD?id=' + id
  41. });
  42. }
  43. }
  44. };
  45. </script>
  46. <style lang="scss">
  47. .center,
  48. page {
  49. background: #f5f5f5;
  50. }
  51. .box {
  52. margin: 20rpx auto 0;
  53. width: 690rpx;
  54. padding: 20rpx 20rpx 52rpx 30rpx;
  55. background: #ffffff;
  56. box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
  57. border-radius: 20rpx;
  58. .top {
  59. justify-content: flex-start;
  60. align-items: center;
  61. .bg {
  62. width: 48rpx;
  63. height: 46rpx;
  64. image {
  65. width: 100%;
  66. height: 100%;
  67. }
  68. }
  69. .title {
  70. margin-left: 10rpx;
  71. font-size: 34rpx;
  72. font-family: PingFang SC;
  73. font-weight: bold;
  74. color: #0F253A;
  75. }
  76. }
  77. .main-bg {
  78. width: 520rpx;
  79. height: 165rpx;
  80. margin: 55rpx auto 0;
  81. image{
  82. width: 100%;
  83. height: 100%;
  84. }
  85. }
  86. .font {
  87. margin-top: 62rpx;
  88. font-size: 26rpx;
  89. font-family: PingFang SC;
  90. font-weight: 500;
  91. color: #6D7C88;
  92. .money {
  93. font-size: 30rpx;
  94. color: #44969D;
  95. }
  96. .time {
  97. color:#0F253A;
  98. }
  99. }
  100. .btn {
  101. width: 558rpx;
  102. height: 80rpx;
  103. background: linear-gradient(90deg, #60BAB0, #60BAB0, #45969B);
  104. border-radius: 40rpx;
  105. margin: 49rpx auto 0;
  106. text-align: center;
  107. line-height: 80rpx;
  108. font-size: 30rpx;
  109. font-family: PingFang SC;
  110. font-weight: 500;
  111. color: #FFFFFF;
  112. }
  113. }
  114. </style>