index.vue 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <view class="page" :style="{'height':windowHeight}">
  3. <view class="flex-row">
  4. <view class="flex-col justify-center" @click="noUseChange">
  5. <u-icon v-if="noUse" name="checkmark-circle-fill" color="#38db38" size="25" ></u-icon>
  6. <u-icon v-else name="/static/order/ud9.png" color="green" size="25"></u-icon>
  7. </view>
  8. <view class="noUse">
  9. <text>不使用优惠券</text>
  10. </view>
  11. </view>
  12. <view :style="{'height':scrollViewHeight}">
  13. <scroll-view class="scroll " :style="{'height':scrollViewHeight}" scroll-y>
  14. <view class="row-list flex-row justify-start" v-for="(it,i) in 10" @click="useCoupons(i)">
  15. <view class="h-text flex-col justify-center ">
  16. <view class="money">
  17. <text>¥{{item.discountsPrice || '100'}}</text>
  18. </view>
  19. <view class="desc">
  20. <text>{{item.name || '优惠券名字'}}</text>
  21. </view>
  22. </view>
  23. <view class="h-center-content flex-col ">
  24. <view class="h-value">
  25. <text>门店通用</text>
  26. </view>
  27. <view class="title">
  28. 使用平台:<text v-if="item.strategyType == '0'">全平台</text>
  29. <text v-else-if="item.strategyType == '1'">个人优惠卷</text>
  30. </view>
  31. <view class="title">
  32. 使用次数:{{item.degree}}
  33. </view>
  34. <view class="title">
  35. 到期时间:{{item.endTime.substring(0,10)}}
  36. </view>
  37. </view>
  38. <view class="h-right-content flex-col justify-center ">
  39. <u-icon v-if="index == i " name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
  40. <u-icon v-else name="/static/order/ud9.png" color="green" size="25"></u-icon>
  41. </view>
  42. </view>
  43. </scroll-view>
  44. </view>
  45. <view>
  46. <view class="btn">
  47. <text>确定</text>
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. export default {
  54. data() {
  55. return {
  56. index:-1,
  57. noUse:true,
  58. windowHeight:'',
  59. scrollViewHeight:''
  60. };
  61. },
  62. onLoad(option) {
  63. let sysInfo = uni.getSystemInfoSync()
  64. this.windowHeight =sysInfo.windowHeight +'px'
  65. this.scrollViewHeight =sysInfo.windowHeight -(sysInfo.windowWidth/750)*252 +'px'
  66. },
  67. computed: {
  68. },
  69. methods: {
  70. noUseChange(){
  71. this.noUse = !this.noUse
  72. if (this.noUse){
  73. this.index = -1
  74. }
  75. },
  76. useCoupons(i){
  77. this.noUse = false
  78. this.index = i
  79. }
  80. },
  81. };
  82. </script>
  83. <style lang="scss" scoped>
  84. @import '/common/css/common.css';
  85. @import './index.rpx.scss';
  86. </style>