微信

calendar.vue 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <div style="padding-bottom:.6rem;">
  3. <div class="top">
  4. <img :src="topImg" alt>
  5. </div>
  6. <div class="middle">
  7. <p>云台天境定制专属你的台历</p>
  8. <span>时间: 2018年12月12日-2018年12月19日</span>
  9. <span>地点: 江宁区云台山河路1号云台天境售楼处</span>
  10. </div>
  11. <div class="bottom">
  12. <p class="title">活动详情</p>
  13. <div>用户在线上传照片生成2019年台历,可通过填写邮箱,获得电子版台历(1个工作日内)。</div>
  14. <div>前200名上传成功用户,可在关注【城的空间】公众号接到推送或接到短信通知后来云台天境售楼处领取精美实物台历一份。</div>
  15. <div>活动电话:025-86426666</div>
  16. <div>服务案场:银城旭辉云台天境</div>
  17. <div>地址:江宁区云台山河路1号云台天境售楼处</div>
  18. <div>*活动最终解释权归南京佳运城房地产开发有限公司所有</div>
  19. </div>
  20. <div class="btn">
  21. <div v-if="state === 1" @click="toCheckModel">立即参与</div>
  22. <div v-if="state === 2" class="disable">已参与</div>
  23. <div v-if="state === 3" class="disable">活动已结束</div>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. import wxsdk from '../../../util/share'
  29. import { mapState, createNamespacedHelpers } from 'vuex'
  30. const { mapActions: mapMakingActions } = createNamespacedHelpers('making')
  31. const { mapActions: actions } = createNamespacedHelpers('userCenter')
  32. import topImg from '@/common/icon/topImg.png'
  33. export default {
  34. data () {
  35. return {
  36. topImg,
  37. state: 1,
  38. endTime: "2018/12/19 00:00:00"
  39. }
  40. },
  41. created () {
  42. wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
  43. title: '幸福升舱 云帆起航',
  44. desc: '有一份2019年的台历待您查收!',
  45. link: `${window.location.origin}${window.location.pathname}#/calendar`,
  46. thu_image: 'http://spaceofcheng.oss-cn-beijing.aliyuncs.com/DE4F9402-9449-48fc-8C0D-61C198E82E481543982444.png'
  47. })
  48. this.getUserInfo({ org: this.org }).then(() => {
  49. this.getCalendarCustomer().then((res) => {
  50. if (res) {
  51. this.state = 2
  52. } else {
  53. let timestamp = new Date(this.endTime).getTime()
  54. let now = new Date().getTime()
  55. if (timestamp >= now) {
  56. this.state = 1
  57. } else {
  58. this.state = 3
  59. }
  60. }
  61. })
  62. })
  63. },
  64. computed: {
  65. ...mapState({
  66. org: x => x.app.orgId,
  67. userInfo: x => x.userCenter.userInfo
  68. })
  69. },
  70. methods: {
  71. ...actions(['getUserInfo']),
  72. ...mapMakingActions(['getCalendarCustomer']),
  73. toCheckModel () {
  74. if (!this.userInfo.customer.Phone) {
  75. this.$dialog.confirm({
  76. title: '提示',
  77. message: '您还不是注册会员,注册成功后即可参与此活动'
  78. }).then(() => {
  79. // on confirm
  80. this.$router.push({ name: 'bindMobile' })
  81. }).catch(() => {
  82. // on cancel
  83. });
  84. } else {
  85. this.$router.push({ name: 'checkModel' })
  86. }
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. .top {
  93. width: 100%;
  94. img {
  95. width: 100%;
  96. }
  97. }
  98. .middle {
  99. padding: 0.14rem 0.25rem;
  100. border-bottom: 0.1rem solid rgba(235, 241, 242, 1);
  101. p {
  102. font-size: 0.16rem;
  103. padding-bottom: 0.05rem;
  104. font-weight: bold;
  105. }
  106. span {
  107. padding-bottom: 0.05rem;
  108. display: block;
  109. }
  110. }
  111. .bottom {
  112. padding: 0.14rem 0.25rem;
  113. p {
  114. font-size: 0.16rem;
  115. padding-bottom: 0.05rem;
  116. font-weight: bold;
  117. }
  118. div {
  119. padding-bottom: 0.08rem;
  120. }
  121. }
  122. .btn {
  123. position: fixed;
  124. bottom: 0;
  125. left: 0;
  126. width: 100%;
  127. padding: 0.1rem 0.25rem;
  128. box-sizing: border-box;
  129. background: #fff;
  130. div {
  131. width: 100%;
  132. height: 0.4rem;
  133. border-radius: 0.2rem;
  134. background-color: rgba(252, 98, 67, 1);
  135. color: #fff;
  136. text-align: center;
  137. line-height: 0.4rem;
  138. }
  139. .disable {
  140. background: #ccc;
  141. }
  142. }
  143. </style>