t-o-news-tab-3.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view>
  3. <view class="list">
  4. <view class="item" v-for="(item,index) in list" :key="index">
  5. <view class="title">{{item.title}}</view>
  6. <view class="box">
  7. <view class="box_item"
  8. :style="{backgroundImage:'url('+ item_2.picture +')'}"
  9. v-for="(item_2,index_2) in item.special_list" :key="index_2" @click="go_h5(item_2.id,item_2.name)">
  10. <view class="time">有效时间:{{item_2.start_time}}——{{item_2.end_time}}</view>
  11. <view class="inner">
  12. <view class="left">
  13. {{item_2.name}}
  14. </view>
  15. <view class="right" @click.stop="go_ranking(item_2.id)">
  16. <image src="./icon/rank.png" mode="aspectFill"></image>
  17. </view>
  18. </view>
  19. <view class="bottom">
  20. <view class="line">
  21. <view class="line_box" :style="{width: + item_2.percent_complete + '%'}"></view>
  22. </view>
  23. <view class="num">{{item_2.percent_complete.toFixed(2)}}%</view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. name: "t-o-news-tab-3",
  34. data() {
  35. return {
  36. list: [],
  37. };
  38. },
  39. created() {
  40. this.get_jigsawPuzzle_specialList()
  41. },
  42. methods: {
  43. get_jigsawPuzzle_specialList() {
  44. this.$api.jigsawPuzzle_specialList({
  45. staff_num:uni.getStorageSync('user').staff_num
  46. }).then((res) => {
  47. console.log(res.data.data)
  48. const data = res.data.data
  49. // data.forEach((item, index) => {
  50. // this.list = this.list.concat(item.special_list)
  51. // })
  52. this.list = res.data.data
  53. // console.log(this.list)
  54. })
  55. },
  56. go_h5(id,name) {
  57. // uni.navigateTo({
  58. // url: "../../origanization/news/tab_3/h5/h5?id="+id
  59. // })
  60. uni.navigateTo({
  61. url: "../../origanization/news/tab_3/pin_tu/picture_list/picture_list?id="+id+"&title="+name
  62. })
  63. },
  64. go_ranking(id){
  65. uni.navigateTo({
  66. url:"../../origanization/news/tab_3/ranking/ranking?id="+id
  67. })
  68. }
  69. }
  70. }
  71. </script>
  72. <style lang="scss">
  73. .list {
  74. box-sizing: border-box;
  75. padding: 0 25rpx;
  76. .item {
  77. width: 700rpx;
  78. margin-bottom: 20rpx;
  79. box-sizing: border-box;
  80. padding: 20rpx;
  81. background: #FFFFFF;
  82. border-radius: 20rpx;
  83. .title{
  84. line-height: 80rpx;
  85. font-size: 42rpx;
  86. font-weight: 700;
  87. color: #00A0E8;
  88. }
  89. .box{
  90. margin-top: 10rpx;
  91. .box_item{
  92. margin-bottom: 20rpx;
  93. // background-image: url(./icon/bg.png);
  94. background-size: 100% 100%;
  95. background-repeat: no-repeat;
  96. border-radius: 20rpx;
  97. box-sizing: border-box;
  98. padding: 20rpx 30rpx;
  99. .time{
  100. color: #FFFFFF;
  101. font-size: 28rpx;
  102. }
  103. .inner{
  104. margin-top: 20rpx;
  105. display: flex;
  106. justify-content: space-between;
  107. align-items: center;
  108. .left{
  109. color: #FFFFFF;
  110. }
  111. .right{
  112. margin-left: 20rpx;
  113. image{
  114. width: 58rpx;
  115. height: 64rpx;
  116. display: block;
  117. }
  118. }
  119. }
  120. .bottom {
  121. margin-top: 20rpx;
  122. display: flex;
  123. align-items: center;
  124. .line {
  125. width:520rpx;
  126. height: 6rpx;
  127. background-color: #FFFFFF33;
  128. border-radius: 10rpx;
  129. .line_box {
  130. width: 36%;
  131. height: 6rpx;
  132. background-color: #FFFFFF;
  133. border-radius: 10rpx;
  134. }
  135. }
  136. .num {
  137. margin-left: 10rpx;
  138. font-size: 24rpx;
  139. color: #FFFFFF;
  140. }
  141. }
  142. }
  143. }
  144. }
  145. }
  146. </style>