swaplist.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view class="page_view">
  3. <top-return :color="'#FFF'" text="活动列表"></top-return>
  4. <view class="bg_card"></view>
  5. <!-- 页面标题内容 -->
  6. <view class="cloumn">
  7. <view class="flex_baseline">
  8. <view class="content_title" style="font-size: 60rpx;">{{dayTime.split('月')[0]}}</view>
  9. <view class="content_title" style="margin-left: 10rpx;">月</view>
  10. <view class="content_title" style="font-size: 60rpx; margin-left: 10rpx;">{{dayTime.split('月')[1]}}</view>
  11. <view class="content_title" style="margin-left: 10rpx;">日</view>
  12. <view class="content_title" style="font-size: 40rpx;margin-left: 20rpx;">完成率</view>
  13. <view class="content_title" style="margin-left: 10rpx;font-size: 60rpx;">{{value}}%</view>
  14. </view>
  15. <view class="flex_baseline">
  16. <view class="content_subtitle" style="opacity: 0.8;">当前共</view>
  17. <view class="content_subtitle" style="margin-left: 20rpx;font-size: 40rpx;transform: skew(-15deg);">{{swapData.length}}</view>
  18. <view class="content_subtitle" style="margin-left: 20rpx;opacity: 0.8;">场活动</view>
  19. </view>
  20. </view>
  21. <view class="card_view">
  22. <view class="card_item" style="width: 100%;" v-for="(item,index) in swapData" :key="index" @click="navSwapData(index)">
  23. <view class="card_title">
  24. <view class="front_tag" style="height: 40rpx;"></view>
  25. <view class="title" style="font-size: 36rpx;">{{item.survey.name||item.vote.name}}</view>
  26. <view :class="item.survey.progress === 'finish'||item.vote.progress === 'finish'?'t-icon t-icon-yiwancheng1':'t-icon t-icon-jinhangzhong-copy'" style="position: absolute; width: 100rpx; height: 100rpx;margin-left: 570rpx;margin-top: 50rpx;"></view>
  27. </view>
  28. <view class="flex_cloumn" style="margin: 20rpx 50rpx;">
  29. <view class="flex_row">
  30. <u-parse class="title" style="font-size: 30rpx;" :content="item.survey.description||item.vote.description" :selectable="true"></u-parse>
  31. </view>
  32. <view class="flex_baseline" style="margin-top: 20rpx;">
  33. <view class="subtitle">布置老师:</view>
  34. <view class="title" style="margin-left: 20rpx; font-size: 30rpx;">{{item.survey.creatorId||item.vote.creatorId}}</view>
  35. <view class="subtitle" style="margin-left: 20rpx;">截至时间:</view>
  36. <view class="title" style="margin-left: 20rpx; font-size: 30rpx;" v-if="item.survey">{{$timeStampToTime(item.survey.endTime)}}</view>
  37. <view class="title" style="margin-left: 20rpx; font-size: 30rpx;" v-if="item.vote">{{$timeStampToTime(item.vote.endTime)}}</view>
  38. </view>
  39. </view>
  40. <!-- 正文 -->
  41. <view class="content_box">
  42. <!-- 问卷 -->
  43. <view class="title_box" :style="{backgroundColor: item.survey.progress === 'finish'? '#23b46c': '#FF6D31' }" v-if="item.survey">
  44. <view class="title_text">问卷详情</view>
  45. </view>
  46. <view class="flex_row" style="justify-content: space-around;">
  47. <view class="option_box" :style="{backgroundColor: item.survey.progress === 'finish'? '#23b46c': '#FF6D31' }" v-for="(option,i) in item.survey.answers[0]" :key="i">
  48. <view class="content_subtitle">{{option}}</view>
  49. </view>
  50. </view>
  51. <!-- 投票 -->
  52. <view class="title_box" :style="{backgroundColor: item.vote.progress === 'finish'? '#23b46c': '#FF6D31' }" v-if="item.vote">
  53. <view class="title_text">{{item.vote.secret ? '匿名投票':'普通投票'}}</view>
  54. </view>
  55. <view class="flex_row" style="justify-content: space-around;">
  56. <view class="flex_cloumn" style="align-items: center;" v-for="(option,j) in item.vote.options" :key="j">
  57. <u-parse class="title" style="font-size: 30rpx;margin-bottom: 15rpx;" :content="option.value"></u-parse>
  58. <view class="option_box" :style="{backgroundColor: item.vote.progress === 'finish'? '#23b46c': '#FF6D31' }">
  59. <view class="content_subtitle">{{option.code}}</view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. import {
  70. mapState,
  71. mapMutations
  72. } from 'vuex'
  73. export default {
  74. computed: {
  75. ...mapState('m_children',['swapData'])
  76. },
  77. data(){
  78. return {
  79. value: '',
  80. dayTime: ''
  81. }
  82. },
  83. onLoad(parameter) {
  84. this.value = parameter.value
  85. this.dayTime = (new Date()).format('M-d').replace('-', '月')
  86. },
  87. methods: {
  88. fixNum(num){
  89. return num.toFixed(2)
  90. },
  91. navSwapData(index){
  92. uni.navigateTo({
  93. url: `/subpkg/datalist/swapData?index=${index}`
  94. })
  95. }
  96. }
  97. }
  98. </script>
  99. <style lang="scss">
  100. .subtitle{
  101. font-weight: 400;
  102. font-size: 26rpx;
  103. }
  104. .content_box{
  105. margin: 20rpx;
  106. padding: 0 20rpx 20rpx 20rpx;
  107. background-color: #f6f6f6;
  108. border-radius: 10rpx;
  109. .title_box{
  110. position: relative;
  111. top: -20rpx;
  112. width:fit-content;
  113. height: 36rpx;
  114. border-radius: 10rpx;
  115. padding: 5rpx 20rpx;
  116. .title_text{
  117. font-size: 25rpx;
  118. font-weight: bold;
  119. color: #FFF;
  120. }
  121. }
  122. .content_subtitle {
  123. font-size: 30rpx;
  124. font-weight: bold;
  125. color: #FFF;
  126. }
  127. .option_box{
  128. display: flex;
  129. align-items: center;
  130. justify-content: center;
  131. width:120rpx;
  132. height: 50rpx;
  133. border-radius: 10rpx;
  134. padding: 5rpx;
  135. }
  136. }
  137. .cloumn {
  138. display: flex;
  139. flex-direction: column;
  140. margin: 140rpx 0 0 50rpx;
  141. height: 170rpx;
  142. justify-content: space-around;
  143. .content_title {
  144. font-size: 35rpx;
  145. font-weight: bold;
  146. transform: skew(-15deg);
  147. color: #FFF;
  148. z-index: 2;
  149. text-shadow: 1px -1px 0px #c0c0c0, 2px -2px 0px #b0b0b0, 1px -1px 0px #a0a0a0, 2px -2px 0px #909090;
  150. }
  151. .content_subtitle {
  152. font-size: 35rpx;
  153. color: #FFF;
  154. z-index: 2;
  155. }
  156. }
  157. </style>