choicepacks.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <view style="width: 100vw;height: auto;padding: 30rpx 20rpx;background-color: #f6f6f6;">
  3. <view style="width: 100%;height: 100%;">
  4. <text style="font-size: 30rpx;font-weight: bold;">官方套餐</text>
  5. <view v-for="(item,index) in serviceList" :key='index'>
  6. <view class="card">
  7. <view class="taocan" :data-id="item.id" @click="details">
  8. <view class="tc_left">
  9. <text style="text-align: center;">{{item.name}}</text>
  10. </view>
  11. <view class="tc_right">
  12. <view style="width: 100%;">
  13. <view class="text">{{item.intro}}</view>
  14. <view class="text">
  15. <text class="margin-right-sm text_style" v-for="(itm,idx) in item.label_texts" :key="idx">{{itm.name}}</text>
  16. </view>
  17. <view class="text">
  18. <text style="text-align: left;">时长:{{item.effective_days}}天</text>
  19. <text style="float: right;color: #FF4F61;font-weight: bold;">¥{{item.price/100}}</text>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. mounted() {
  32. this.getservice()
  33. },
  34. data() {
  35. return {
  36. pageindex: 1,
  37. serviceList: []
  38. }
  39. },
  40. methods: {
  41. details(e) {
  42. uni.navigateTo({
  43. url: '/pages/service_packs/packs_details?id=' + e.currentTarget.dataset.id
  44. })
  45. },
  46. getservice: async function() {
  47. let res = await this.$request.post("/api/v1/ServicePack/servicePackList", {
  48. page: this.pageindex
  49. })
  50. console.log(res)
  51. if (res.status == 0) {
  52. if (this.pageindex > res.data.last_page) {
  53. uni.showToast({
  54. title: "没有更多了",
  55. icon: "none"
  56. })
  57. } else {
  58. this.serviceList = this.serviceList.concat(res.data.data)
  59. this.pageindex++
  60. }
  61. }
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss">
  67. .card {
  68. width: 100%;
  69. height: auto;
  70. margin-top: 20rpx;
  71. // background-image: url(../../static/服务包.png);
  72. .taocan {
  73. width: 710rpx;
  74. height: 230rpx;
  75. position: relative;
  76. display: flex;
  77. border-radius: 10rpx;
  78. background: radial-gradient(circle at right top, transparent 15rpx, #ffffff 0) top left / 152rpx 51% no-repeat,
  79. radial-gradient(circle at right bottom, transparent 15rpx, #ffffff 0) bottom left /152rpx 51% no-repeat,
  80. radial-gradient(circle at left top, transparent 15rpx, #ffffff 0) top right /560rpx 51% no-repeat,
  81. radial-gradient(circle at left bottom, transparent 15rpx, #ffffff 0) bottom right /560rpx 51% no-repeat;
  82. filter: drop-shadow(0rpx 2rpx 12rpx 0rpx rgba(0, 0, 0, 0.04));
  83. }
  84. }
  85. .text_style{
  86. // display: flex;
  87. // justify-content: center;
  88. // align-items: center;
  89. text-align: center;
  90. display: inline-block;
  91. font-weight: 400;
  92. background-color: #E5F5FF;
  93. color: #0B73B9;
  94. width: 100rpx;
  95. height: 28rpx;
  96. font-size: 20rpx;
  97. border-radius: 10rpx;
  98. }
  99. .tc_left {
  100. display: flex;
  101. justify-content: center;
  102. align-items: center;
  103. width: 152rpx;
  104. text {
  105. font-size: 30rpx;
  106. font-weight: bold;
  107. }
  108. }
  109. .tc_right {
  110. display: flex;
  111. align-items: center;
  112. width: 550rpx;
  113. padding: 0 20rpx;
  114. font-size: 26rpx;
  115. .text {
  116. padding: 10rpx 0rpx;
  117. width: 100%;
  118. }
  119. }
  120. </style>