box_details.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <view class="container">
  3. <u-tabs :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
  4. <view style="width: 100vw;height: auto;background-color: #f6f6f6;">
  5. <view style="width: 100%;height: 100%;">
  6. <view v-for="(item,index) in serviceList" :key="index">
  7. <view class="card flex justify-center" v-for="itm,idx in item.order_pack" :key="idx">
  8. <view class="taocan" :data-id="item.id" @click="details">
  9. <view class="tc_left">
  10. <text>{{itm.pack_name}}</text>
  11. </view>
  12. <view class="tc_right">
  13. <view style="width: 100%;">
  14. <view class="text">{{itm.pack_intro}}</view>
  15. <!-- <view class="text">{{item.desc}}</view> -->
  16. <view class="text">
  17. <text style="text-align: left;">时长:{{itm.effective_days}}天</text>
  18. <text style="float: right;color: #FF4F61;font-weight: bold;">¥{{itm.pack_price/100}}</text>
  19. </view>
  20. </view>
  21. <view class="margin-top-xs">
  22. 剩余时长:<u-count-down v-if="true" color="#EEAA3F" separator="zh" :timestamp="itm.end_time-miao"></u-count-down><text
  23. v-else>已结束</text>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <u-empty text="暂无数据" :show="show" mode="order" margin-top="250"></u-empty>
  32. <view class="cu-tabbar-height"></view>
  33. <view class="cu-tabbar-height"></view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. onLoad() {
  39. this.getserviceList()
  40. },
  41. onShow() {
  42. this.miao = parseInt(new Date().getTime() / 1000)
  43. },
  44. data() {
  45. return {
  46. list: [{
  47. name: '服务中服务包'
  48. }, {
  49. name: '历史服务包'
  50. }, ],
  51. current: 0,
  52. serviceList: [],
  53. miao: "",
  54. pageindex: 1,
  55. show:false
  56. }
  57. },
  58. methods: {
  59. change(index) {
  60. this.current = index;
  61. },
  62. getserviceList: async function() {
  63. let res = await this.$request.post("/api/v1/order/orderList", {
  64. page: this.pageindex,
  65. list_type: 1,
  66. product_type: 6
  67. })
  68. if (res.status == 0) {
  69. if (this.pageindex > res.data.last_page) {
  70. uni.showToast({
  71. title: "没有更多了",
  72. icon: "none"
  73. })
  74. } else {
  75. this.serviceList = this.serviceList.concat(res.data.data)
  76. this.pageindex++
  77. }
  78. }
  79. if (this.serviceList.length == 0) {
  80. this.show = true
  81. } else {
  82. this.show = false
  83. }
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss">
  89. .container {
  90. width: 100%;
  91. height: 100%;
  92. background-color: #F6F6F6;
  93. }
  94. .card {
  95. width: 100%;
  96. height: auto;
  97. margin-top: 20rpx;
  98. // background-image: url(../../static/服务包.png);
  99. .taocan {
  100. width: 710rpx;
  101. height: 230rpx;
  102. position: relative;
  103. display: flex;
  104. border-radius: 10rpx;
  105. background: radial-gradient(circle at right top, transparent 15rpx, #ffffff 0) top left / 152rpx 51% no-repeat,
  106. radial-gradient(circle at right bottom, transparent 15rpx, #ffffff 0) bottom left /152rpx 51% no-repeat,
  107. radial-gradient(circle at left top, transparent 15rpx, #ffffff 0) top right /560rpx 51% no-repeat,
  108. radial-gradient(circle at left bottom, transparent 15rpx, #ffffff 0) bottom right /560rpx 51% no-repeat;
  109. filter: drop-shadow(0rpx 2rpx 12rpx 0rpx rgba(0, 0, 0, 0.04));
  110. }
  111. }
  112. .tc_left {
  113. display: flex;
  114. justify-content: center;
  115. align-items: center;
  116. width: 152rpx;
  117. text {
  118. font-size: 30rpx;
  119. font-weight: bold;
  120. }
  121. }
  122. .tc_right {
  123. display: flex;
  124. flex-direction: column;
  125. justify-content: center;
  126. width: 550rpx;
  127. padding: 0 20rpx;
  128. font-size: 26rpx;
  129. .text {
  130. padding: 10rpx 0rpx;
  131. width: 100%;
  132. }
  133. }
  134. </style>