coupon-exchange.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="container clearfix">
  3. <view class="coupon-content">
  4. <view class="coupon-input">
  5. <input class="input" type="text" v-model="params.couponCode" maxlength="16" placeholder="请输入16位兑换码"/>
  6. </view>
  7. <view class="coupon-main">
  8. <view class="coupon-button" @click="exchangeConfirm">立即兑换</view>
  9. <view class="coupon-text">
  10. <view class="coupon-h1">注意事项:</view>
  11. <view class="coupon-h2">1. 兑换码获取:可通过采美线下发放或者销售顾问线上发放</view>
  12. <view class="coupon-h2 indet">获得优惠券兑换码,兑换码由16位数字和字母组成。</view>
  13. <view class="coupon-h2">2. 兑换码使用:在当前页面输入兑换码即可兑换相应优惠券</view>
  14. <view class="coupon-h2 indet">一个兑换码只能兑换一张优惠券,不可重复使用。</view>
  15. <view class="coupon-h2">3. 输入兑换码时请区分字母大小写。</view>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import { mapState,mapMutations} from 'vuex';
  23. export default {
  24. components:{
  25. },
  26. data() {
  27. return {
  28. params:{
  29. couponCode:'',
  30. },
  31. userName:'',
  32. userIdentity:0
  33. }
  34. },
  35. onLoad() {
  36. },
  37. computed: {
  38. ...mapState(['hasLogin','userInfo','identity','isActivity'])
  39. },
  40. methods: {
  41. exchangeConfirm(){
  42. if( this.params.couponCode == ''){
  43. this.$util.msg('请输入位兑换码',2000)
  44. return
  45. }
  46. }
  47. },
  48. onShow(){
  49. this.$api.getComStorage('userInfo').then((resolve) =>{
  50. this.userName = resolve.name;
  51. this.userIdentity = resolve.userIdentity
  52. }).catch(error =>{
  53. })
  54. }
  55. }
  56. </script>
  57. <style lang="scss">
  58. .container{
  59. width: 100%;
  60. height: auto;
  61. .coupon-content{
  62. width: 100%;
  63. height: auto;
  64. box-sizing: border-box;
  65. padding: 0 40rpx;
  66. padding-top: 60rpx;
  67. .coupon-input{
  68. width: 100%;
  69. height: auto;
  70. margin-bottom: 88rpx;
  71. .input{
  72. width: 100%;
  73. height: 66rpx;
  74. box-sizing: border-box;
  75. border: 1px solid #e2e2e2;
  76. line-height: 66rpx;
  77. padding: 0 20rpx;
  78. font-size: $font-size-26;
  79. color: #b2b2b2;
  80. border-radius: 2rpx;
  81. }
  82. }
  83. .coupon-main{
  84. width: 100%;
  85. height: auto;
  86. box-sizing: border-box;
  87. .coupon-button{
  88. width: 600rpx;
  89. height: 90rpx;
  90. margin: 0 auto;
  91. border-radius: 50rpx;
  92. line-height: 90rpx;
  93. text-align: center;
  94. background: $btn-confirm;
  95. color: #FFFFFF;
  96. font-size: $font-size-30;
  97. }
  98. .coupon-text{
  99. width: 100%;
  100. box-sizing: border-box;
  101. padding: 0 20rpx;
  102. margin-top: 40rpx;
  103. line-height: 44rpx;
  104. text-align: justify;
  105. font-size: $font-size-24;
  106. .coupon-h1{
  107. color: #333333;
  108. }
  109. .coupon-h2{
  110. color: #999999;
  111. &.indet{
  112. text-indent: 28rpx;
  113. }
  114. }
  115. }
  116. }
  117. }
  118. }
  119. </style>