rule-info.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <view class="flex-common-css iPhone-bottom">
  3. <Nav title="规则详情" titleColor="#333" bgckgroundBox='#fff'></Nav>
  4. <scroll-view :scroll-y="true" class="scroll-view-css" @scrolltolower="scrolltolower">
  5. <view class="contetn-box">
  6. <view class="item-box display-flex mb-20">
  7. <view class="item-left flex-direction align-items-center flex-justify-center"
  8. :class="ticketData.status == 1?'bgc-FCE7E2':'bgc-E6E6E6'">
  9. <view class="align-items-center">
  10. <view class="fs-30 fw-600" :class="ticketData.status == 1?'fc-FB3D03':'fc-9'">¥</view>
  11. <view class="fs-48 fw-600" :class="ticketData.status == 1?'fc-FB3D03':'fc-9'">{{ticketData.money||''}}</view>
  12. </view>
  13. <view class="fs-24" :class="ticketData.status == 1?'fc-6':'fc-9'">
  14. 需满{{ticketData.full_money || ''}}元
  15. </view>
  16. <view class="ball"></view>
  17. <view class="ball-two"></view>
  18. </view>
  19. <view class="item-hr" :class="ticketData.status == 1?'':'item-hr-two'"></view>
  20. <view class="item-right flex-1 bgc-f">
  21. <view class="fs-28 mb-12 ticket-name text-overflow-ellipsis fw-600"
  22. :class="ticketData.status == 1?'fc-3':'fc-9'">
  23. {{ticketData.name||''}}
  24. </view>
  25. <view class="fs-24 mb-12" :class="ticketData.status == 1?'fc-FB3D03':'fc-9'">
  26. {{ticketData.time_str||''}}
  27. </view>
  28. <view class="flex-justify-space">
  29. <view class="fs-24" :class="ticketData.status == 1?'fc-3':'fc-9'">
  30. 券类型:{{ticketData.scene_str||''}}
  31. </view>
  32. </view>
  33. <image class="item-img" src="@/static/img/my/ysy.png" mode="" v-if="ticketData.status == 2">
  34. </image>
  35. <image class="item-img" src="@/static/img/my/ysx.png" mode="" v-if="ticketData.status == 3"></image>
  36. </view>
  37. </view>
  38. <view class="but-box" v-if="ticketData.status == 1">
  39. <view class="but fs-32 fc-f fw-500" @click="goToUrl()">去使用</view>
  40. </view>
  41. <view class="fs-34 fw-600 fc-0 mb-12">使用范围</view>
  42. <view class="describe fs-28 fc-6">{{ticketData.str||''}}</view>
  43. </view>
  44. </scroll-view>
  45. </view>
  46. </template>
  47. <script>
  48. import {couponRule} from '@/api/coupon.js';
  49. import tools from "@/service/tools";
  50. export default {
  51. components: {},
  52. data() {
  53. return {
  54. ticketData: {},
  55. id:"",
  56. };
  57. },
  58. onLoad(e) {
  59. if(e.id){
  60. this.id = e.id;
  61. this.getRole();
  62. }
  63. },
  64. methods: {
  65. getRole(){
  66. couponRule({id:this.id}).then((res)=>{
  67. if(res.code === 1){
  68. this.ticketData = res.data
  69. }
  70. })
  71. },
  72. goToUrl(){
  73. if (this.ticketData.scene == 1) {
  74. // 去外卖
  75. uni.navigateTo({
  76. url: `/pages-my/search-list?ticketId=` + this.ticketData.id
  77. })
  78. } else {
  79. uni.navigateTo({
  80. url: '/pages-takeout/replace-take'
  81. })
  82. }
  83. },
  84. scrolltolower() {},
  85. },
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .contetn-box {
  90. padding: 24rpx;
  91. box-sizing: border-box;
  92. }
  93. .item-hr {
  94. width: 0px;
  95. height: auto;
  96. border-right: 1rpx dashed #FB7850;
  97. }
  98. .item-hr-two {
  99. width: 0px;
  100. height: auto;
  101. border-right: 1rpx dashed #999;
  102. }
  103. .item-left {
  104. width: 200rpx;
  105. height: auto;
  106. padding: 34rpx 32rpx 44rpx;
  107. box-sizing: border-box;
  108. position: relative;
  109. border-radius: 20rpx 0 0 20rpx;
  110. }
  111. .ball {
  112. width: 24rpx;
  113. height: 24rpx;
  114. border-radius: 50%;
  115. position: absolute;
  116. top: -12rpx;
  117. right: -12rpx;
  118. background: #F5F5F5;
  119. z-index: 10;
  120. }
  121. .ball-two {
  122. width: 24rpx;
  123. height: 24rpx;
  124. border-radius: 50%;
  125. position: absolute;
  126. background: #F5F5F5;
  127. z-index: 10;
  128. bottom: -12rpx;
  129. right: -12rpx;
  130. }
  131. .item-right {
  132. padding: 24rpx;
  133. box-sizing: border-box;
  134. border-radius: 0 20rpx 20rpx 0;
  135. position: relative;
  136. }
  137. .ticket-name {
  138. max-width: 280rpx;
  139. }
  140. .item-img {
  141. width: 88rpx;
  142. height: 88rpx;
  143. position: absolute;
  144. bottom: 40%;
  145. right: 24rpx;
  146. }
  147. .but-box{
  148. padding: 12rpx 44rpx 46rpx;
  149. box-sizing: border-box;
  150. .but{
  151. width: 100%;
  152. height: 92rpx;
  153. line-height: 92rpx;
  154. text-align: center;
  155. background: linear-gradient( 144deg, #57CAFF 0%, #41ABF5 100%);
  156. border-radius: 380rpx;
  157. }
  158. }
  159. .describe{
  160. padding: 0 0 32rpx 0;
  161. border-bottom: 2rpx solid #EEEEEE;
  162. }
  163. </style>