box_details.vue 4.4 KB

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