coupon.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view class="container home clearfix" v-if="hasLogin">
  3. <!-- <view class="coupon-title" v-if="userIdentity == 4">优惠券仅限{{userName}}(机构)使用 </view> -->
  4. <view class="coupon-title" v-if="userIdentity == 4 || userIdentity == 2">优惠券仅限采美机构会员使用</view>
  5. <!-- <view class="coupon-title" v-if="userIdentity == 2">优惠券仅限{{userName}}使用 </view> -->
  6. <image class="coupon-image" src="http://static.caimei365.com/app/meibohui/app/activity-detail.jpg" mode=""></image>
  7. </view>
  8. </template>
  9. <script>
  10. import { mapState,mapMutations} from 'vuex';
  11. export default {
  12. components:{
  13. },
  14. data() {
  15. return {
  16. userName:'',
  17. userIdentity:0
  18. }
  19. },
  20. onLoad() {
  21. if(!this.hasLogin){
  22. uni.redirectTo({
  23. url:'../../login/login'
  24. })
  25. }
  26. },
  27. computed: {
  28. ...mapState(['hasLogin','userInfo','identity','isActivity'])
  29. },
  30. methods: {
  31. },
  32. onShow(){
  33. this.$api.getComStorage('userInfo').then((resolve) =>{
  34. this.userName = resolve.name;
  35. this.userIdentity = resolve.userIdentity
  36. }).catch(error =>{
  37. })
  38. }
  39. }
  40. </script>
  41. <style lang="scss">
  42. page{
  43. }
  44. .container{
  45. width: 100%;
  46. height: auto;
  47. background-color: #ff2e4c;
  48. .coupon-title{
  49. position: absolute;
  50. width: 100%;
  51. height: 110rpx;
  52. line-height: 110rpx;
  53. font-size: $font-size-28;
  54. font-weight: bold;
  55. background-image: linear-gradient(0deg, #fffaec 0%, #fff7d6 50%, #fff4b9 100%), linear-gradient(#fffaef, #fffaef);
  56. box-sizing: border-box;
  57. padding: 0 24rpx;
  58. white-space: nowrap;
  59. text-overflow: ellipsis;
  60. overflow: hidden;
  61. color: #fd3c5b;
  62. text-align: center;
  63. }
  64. .coupon-image{
  65. width: 100%;
  66. height: 1860rpx;
  67. display: block;
  68. }
  69. }
  70. </style>