box_details.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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(item.order_pack[idx])">
  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="current!=1" 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. this.pageindex = 1
  62. this.serviceList = []
  63. this.getserviceList()
  64. },
  65. getserviceList: async function() {
  66. let num = 0
  67. if (this.current == 0) {
  68. num = 2
  69. } else {
  70. num = 1
  71. }
  72. let res = await this.$request.post("/api/v1/order/orderList", {
  73. page: this.pageindex,
  74. list_type: 1,
  75. product_type: 6,
  76. is_pack_expire: num
  77. })
  78. console.log(res)
  79. if (res.status == 0) {
  80. if (this.pageindex > res.data.last_page) {
  81. uni.showToast({
  82. title: "没有更多了",
  83. icon: "none"
  84. })
  85. } else {
  86. this.serviceList = this.serviceList.concat(res.data.data)
  87. this.pageindex++
  88. }
  89. }
  90. if (this.serviceList.length == 0) {
  91. this.show = true
  92. } else {
  93. this.show = false
  94. }
  95. },
  96. details(data) {
  97. // console.log(data)
  98. uni.navigateTo({
  99. url: "choiceBox?data=" + JSON.stringify(data)
  100. })
  101. }
  102. }
  103. }
  104. </script>
  105. <style lang="scss">
  106. .container {
  107. width: 100%;
  108. height: 100%;
  109. background-color: #F6F6F6;
  110. }
  111. .card {
  112. width: 100%;
  113. height: auto;
  114. margin-top: 20rpx;
  115. // background-image: url(../../static/服务包.png);
  116. .taocan {
  117. width: 710rpx;
  118. height: 230rpx;
  119. position: relative;
  120. display: flex;
  121. border-radius: 10rpx;
  122. background: radial-gradient(circle at right top, transparent 15rpx, #ffffff 0) top left / 152rpx 51% no-repeat,
  123. radial-gradient(circle at right bottom, transparent 15rpx, #ffffff 0) bottom left /152rpx 51% no-repeat,
  124. radial-gradient(circle at left top, transparent 15rpx, #ffffff 0) top right /560rpx 51% no-repeat,
  125. radial-gradient(circle at left bottom, transparent 15rpx, #ffffff 0) bottom right /560rpx 51% no-repeat;
  126. filter: drop-shadow(0rpx 2rpx 12rpx 0rpx rgba(0, 0, 0, 0.04));
  127. }
  128. }
  129. .tc_left {
  130. display: flex;
  131. justify-content: center;
  132. align-items: center;
  133. width: 152rpx;
  134. text {
  135. font-size: 30rpx;
  136. font-weight: bold;
  137. }
  138. }
  139. .tc_right {
  140. display: flex;
  141. flex-direction: column;
  142. justify-content: center;
  143. width: 550rpx;
  144. padding: 0 20rpx;
  145. font-size: 26rpx;
  146. .text {
  147. padding: 10rpx 0rpx;
  148. width: 100%;
  149. }
  150. }
  151. </style>