box_details.vue 4.5 KB

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