box_details.vue 4.4 KB

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