activityDetail.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view>
  3. <view class="" v-show="!loading">
  4. <video class="works-video" :src="activity.videoUrl"></video>
  5. <view style="padding: 20rpx 30rpx 50rpx 30rpx;background: white;">
  6. <view class="title" style="border-bottom: 1rpx solid #EEEEEE ;">
  7. <span class="bg-red work-no"> {{activity.productNo}}号</span>
  8. <span class="work-title">{{activity.title}}</span>
  9. <view class="work-info-box">
  10. <image class="remen-icon" src="../../static/icon/remen.png"></image>
  11. <span class="vote-count">{{activity.voteCount}}</span>
  12. <span class="work-rank">排行榜第{{activity.rank}}名</span>
  13. </view>
  14. </view>
  15. <view style="font-size: 24rpx;color: #888888;padding: 30rpx 10rpx 20rpx 10rpx;">
  16. <u-parse :html="content"></u-parse>
  17. </view>
  18. </view>
  19. <view class="bg-white padding-30 margin-top-30 flex">
  20. <view class="basis-xs">
  21. <image style="width: 84rpx;height: 84rpx;" src="../../static/icon/ic_zhuanfa.png"></image>
  22. </view>
  23. <view class="basis-lg flex flex-direction">
  24. <view style="font-size: 28rpx;color: #353535;">转发邀请投票</view>
  25. <view style="font-size: 22rpx;color: #AEACAF;padding-top: 10rpx;">成功邀请一位好友投票,获得{{vuex_active_setting.voteAndHeatRate}}热力值</view>
  26. </view>
  27. <view class="flex justify-center align-center" style="color: #666666;flex-basis: 20%;">去邀请 ></view>
  28. </view>
  29. <view class="footer-bar">
  30. <u-button @click="login" shape="circle" :custom-style="customStyle">给ta投票</u-button>
  31. </view>
  32. </view>
  33. <login ref="login" @signIn="signIn" @phoneSuccess="showVote"></login>
  34. <toast ref="toast" ></toast>
  35. <loading ref="loading" type="3" theme="2"/>
  36. <vote-popup ref="votePopup"></vote-popup>
  37. </view>
  38. </template>
  39. <script>
  40. import votePopup from '../../components/alert/votePopup.vue'
  41. export default {
  42. components:{ votePopup },
  43. onLoad(props) {
  44. this.$refs.loading.showLoading()
  45. const { id } = props;
  46. this.$api.activity.getWorksDetail(id).then(res=> {
  47. this.activity = res.data.data;
  48. this.$refs.loading.hide()
  49. this.loading=false
  50. })
  51. //处理授权结果
  52. this.handelAuthResult(props)
  53. },
  54. computed:{
  55. content(){
  56. return decodeURIComponent(this.activity.content)
  57. }
  58. },
  59. data() {
  60. return {
  61. loading:false,
  62. authResult:{},
  63. activity: {},
  64. customStyle: {
  65. color: 'white',
  66. background: "#E72226",
  67. fontSize: '32rpx',
  68. width: '500rpx',
  69. margin: '25rpx auto'
  70. }
  71. }
  72. },
  73. methods: {
  74. handelAuthResult(options){
  75. if (options.result==undefined) {
  76. return
  77. }
  78. this.authResult=JSON.parse(options.result)
  79. if (this.authResult.resultCode == '0000') {
  80. //授权成功,直接弹出礼物框
  81. this.$refs.toast.info('积分授权成功')
  82. this.showVote()
  83. return
  84. }
  85. if (this.authResult.resultCode=='9999') {
  86. //授权失败
  87. this.$refs.toast.error(this.authResult.message)
  88. return
  89. }
  90. },
  91. async showVote(){
  92. this.$refs.votePopup.showVote();
  93. },
  94. init(){
  95. if (this.vuex_phone) {
  96. this.showVote()
  97. }
  98. }
  99. }
  100. }
  101. </script>
  102. <style lang="scss" scoped>
  103. .works-video{
  104. width: 100%;
  105. height: 422rpx;
  106. }
  107. .title{
  108. padding: 20rpx;
  109. .work-no{
  110. padding: 5rpx 10rpx 5rpx 10rpx;
  111. border-radius: 7rpx;
  112. }
  113. .work-title{
  114. padding: 0 0 0 20rpx ;
  115. color: #353535;
  116. font-size: 32rpx;
  117. font-weight: 800;
  118. }
  119. }
  120. .work-info-box{
  121. padding: 30rpx 0 15rpx 10rpx;
  122. .remen-icon{
  123. width: 30rpx;
  124. height: 30rpx;
  125. }
  126. .vote-count{
  127. padding: 0 40rpx 0 20rpx;
  128. font-size: 40rpx;
  129. color: #353535;
  130. font-weight: 800;
  131. }
  132. .work-rank{
  133. color: #353535;
  134. background: #FDEBEC;
  135. border-radius: 21px 21px 21px 21px;
  136. font-size: 22rpx;
  137. padding: 8rpx 15rpx 8rpx 15rpx;
  138. }
  139. }
  140. .footer-bar{
  141. position: absolute;
  142. bottom: 0;
  143. left: 0;
  144. width: 100%;
  145. height: 170rpx;
  146. background-color: white;
  147. }
  148. </style>