coupon.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template name="navbars">
  2. <view>
  3. <view class="coupon-content clearfix" @click.stop="navigator('/pages/user/coupon/coupon-collection')" :class="isShow?'show':'hide'">
  4. <image src="https://static.caimei365.com/app/img/bg/coupun_banner_h5@2x.jpg" mode=""></image>
  5. <view class="coupon-content-close" @click.stop="handleClick">
  6. <text class="iconfont icon-reeor-fill"></text>
  7. </view>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. import { mapState,mapMutations } from 'vuex'
  13. export default{
  14. name:'navbars',
  15. data() {
  16. return{
  17. isShow:true
  18. }
  19. },
  20. created(){
  21. },
  22. computed: {
  23. ...mapState(['hasLogin','userInfo','isWxAuthorize'])
  24. },
  25. methods:{
  26. handleClick(){
  27. this.isShow = false
  28. },
  29. navigator(url){
  30. // 友盟埋点收集首页优惠券宣传图点击
  31. if (process.env.NODE_ENV != 'development') {
  32. this.$uma.trackEvent('Um_Event_homeCouponBannerClick', {
  33. Um_Key_PageName: '采美商城首页',
  34. Um_Key_SourcePage: '首页优惠券宣传图',
  35. })
  36. }
  37. this.$api.navigateTo(url)
  38. },
  39. }
  40. }
  41. </script>
  42. <style lang="scss">
  43. .coupon-content{
  44. width: 100%;
  45. height: 160rpx;
  46. box-sizing: border-box;
  47. padding: 20rpx 24rpx 0rpx 24rpx;
  48. background-color: #f7f7f7;
  49. position: relative;
  50. &.hide{
  51. display: none;
  52. }
  53. image{
  54. width: 100%;
  55. height: 140rpx;
  56. display: block;
  57. border-radius: 12rpx;
  58. }
  59. .coupon-content-close{
  60. width: 60rpx;
  61. height: 60rpx;
  62. line-height: 60rpx;
  63. text-align: center;
  64. position: absolute;
  65. right: 20rpx;
  66. top: 15rpx;
  67. .iconfont{
  68. font-size: $font-size-32;
  69. color: #FFFFFF;
  70. }
  71. }
  72. }
  73. </style>