123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- <template>
- <view class="page_view">
- <top-return :color="'#FFF'" text="活动列表"></top-return>
-
- <view class="bg_card"></view>
-
- <!-- 页面标题内容 -->
- <view class="cloumn">
- <view class="flex_baseline">
- <view class="content_title" style="font-size: 60rpx;">{{dayTime.split('月')[0]}}</view>
- <view class="content_title" style="margin-left: 10rpx;">月</view>
- <view class="content_title" style="font-size: 60rpx; margin-left: 10rpx;">{{dayTime.split('月')[1]}}</view>
- <view class="content_title" style="margin-left: 10rpx;">日</view>
- <view class="content_title" style="font-size: 40rpx;margin-left: 20rpx;">完成率</view>
- <view class="content_title" style="margin-left: 10rpx;font-size: 60rpx;">{{value}}%</view>
- </view>
- <view class="flex_baseline">
- <view class="content_subtitle" style="opacity: 0.8;">当前共</view>
- <view class="content_subtitle" style="margin-left: 20rpx;font-size: 40rpx;transform: skew(-15deg);">{{swapData.length}}</view>
- <view class="content_subtitle" style="margin-left: 20rpx;opacity: 0.8;">场活动</view>
- </view>
- </view>
-
- <view class="card_view">
- <view class="card_item" style="width: 100%;" v-for="(item,index) in swapData" :key="index" @click="navSwapData(index)">
- <view class="card_title">
- <view class="front_tag" style="height: 40rpx;"></view>
- <view class="title" style="font-size: 36rpx;">{{item.survey.name||item.vote.name}}</view>
- <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>
- </view>
- <view class="flex_cloumn" style="margin: 20rpx 50rpx;">
- <view class="flex_row">
- <u-parse class="title" style="font-size: 30rpx;" :content="item.survey.description||item.vote.description" :selectable="true"></u-parse>
- </view>
- <view class="flex_baseline" style="margin-top: 20rpx;">
- <view class="subtitle">布置老师:</view>
- <view class="title" style="margin-left: 20rpx; font-size: 30rpx;">{{item.survey.creatorId||item.vote.creatorId}}</view>
- <view class="subtitle" style="margin-left: 20rpx;">截至时间:</view>
- <view class="title" style="margin-left: 20rpx; font-size: 30rpx;" v-if="item.survey">{{$timeStampToTime(item.survey.endTime)}}</view>
- <view class="title" style="margin-left: 20rpx; font-size: 30rpx;" v-if="item.vote">{{$timeStampToTime(item.vote.endTime)}}</view>
- </view>
- </view>
- <!-- 正文 -->
- <view class="content_box">
- <!-- 问卷 -->
- <view class="title_box" :style="{backgroundColor: item.survey.progress === 'finish'? '#23b46c': '#FF6D31' }" v-if="item.survey">
- <view class="title_text">问卷详情</view>
- </view>
- <view class="flex_row" style="justify-content: space-around;">
- <view class="option_box" :style="{backgroundColor: item.survey.progress === 'finish'? '#23b46c': '#FF6D31' }" v-for="(option,i) in item.survey.answers[0]" :key="i">
- <view class="content_subtitle">{{option}}</view>
- </view>
- </view>
- <!-- 投票 -->
- <view class="title_box" :style="{backgroundColor: item.vote.progress === 'finish'? '#23b46c': '#FF6D31' }" v-if="item.vote">
- <view class="title_text">{{item.vote.secret ? '匿名投票':'普通投票'}}</view>
- </view>
- <view class="flex_row" style="justify-content: space-around;">
- <view class="flex_cloumn" style="align-items: center;" v-for="(option,j) in item.vote.options" :key="j">
- <u-parse class="title" style="font-size: 30rpx;margin-bottom: 15rpx;" :content="option.value"></u-parse>
- <view class="option_box" :style="{backgroundColor: item.vote.progress === 'finish'? '#23b46c': '#FF6D31' }">
- <view class="content_subtitle">{{option.code}}</view>
- </view>
- </view>
- </view>
- </view>
-
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState,
- mapMutations
- } from 'vuex'
- export default {
- computed: {
- ...mapState('m_children',['swapData'])
- },
- data(){
- return {
- value: '',
- dayTime: ''
- }
- },
- onLoad(parameter) {
- this.value = parameter.value
- this.dayTime = (new Date()).format('M-d').replace('-', '月')
- },
- methods: {
- fixNum(num){
- return num.toFixed(2)
- },
- navSwapData(index){
- uni.navigateTo({
- url: `/subpkg/datalist/swapData?index=${index}`
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .subtitle{
- font-weight: 400;
- font-size: 26rpx;
- }
- .content_box{
- margin: 20rpx;
- padding: 0 20rpx 20rpx 20rpx;
- background-color: #f6f6f6;
- border-radius: 10rpx;
- .title_box{
- position: relative;
- top: -20rpx;
- width:fit-content;
- height: 36rpx;
- border-radius: 10rpx;
- padding: 5rpx 20rpx;
- .title_text{
- font-size: 25rpx;
- font-weight: bold;
- color: #FFF;
- }
- }
- .content_subtitle {
- font-size: 30rpx;
- font-weight: bold;
- color: #FFF;
- }
- .option_box{
- display: flex;
- align-items: center;
- justify-content: center;
- width:120rpx;
- height: 50rpx;
- border-radius: 10rpx;
- padding: 5rpx;
- }
- }
- .cloumn {
- display: flex;
- flex-direction: column;
- margin: 140rpx 0 0 50rpx;
- height: 170rpx;
- justify-content: space-around;
-
- .content_title {
- font-size: 35rpx;
- font-weight: bold;
- transform: skew(-15deg);
- color: #FFF;
- z-index: 2;
- text-shadow: 1px -1px 0px #c0c0c0, 2px -2px 0px #b0b0b0, 1px -1px 0px #a0a0a0, 2px -2px 0px #909090;
- }
-
- .content_subtitle {
- font-size: 35rpx;
- color: #FFF;
- z-index: 2;
- }
- }
- </style>
|