theme.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="theme">
  3. <view class="title">请先选定一个主题进行追踪</view>
  4. <view class="content">
  5. <view class="item"
  6. v-for="(item, index) in themeList"
  7. @click="checkedHandle(item,index)"
  8. :key="index">
  9. <div class="up">
  10. <view class="left">
  11. <image :src="`../../static/theme${item.id}.png`"></image>
  12. </view>
  13. <view class="right">
  14. <text>{{item.title}}</text>
  15. <text>{{item.des}}</text>
  16. </view>
  17. </div>
  18. <div class="down" v-if="index == 1">
  19. <div class="leftBtn" @click="checkedHandle(item,index,'NORMAL')">普通</div>
  20. <div class="rightBtn" @click="checkedHandle(item,index,'MULTI')">督查+自查</div>
  21. </div>
  22. <image class="checkmark" v-if="theme.id === item.id" src="../../../static/theme.png"></image>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import { mapState } from "vuex";
  29. import {themeList} from "./utils.js";
  30. export default {
  31. data() {
  32. return {
  33. themeList
  34. }
  35. },
  36. computed: {
  37. ...mapState({
  38. theme: state => state.creatingSituations.theme
  39. })
  40. },
  41. methods: {
  42. /**
  43. * @param {Object} item 操作数据
  44. * @param {number} index 操作下标
  45. * @param {string} type 操作类型
  46. */
  47. checkedHandle: function(item,index,type) {
  48. if(index==0||(index == 1&&type == 'NORMAL')){
  49. //个案/普通系统追踪
  50. this.myCommit('theme',{...item,type:'NORMAL'});
  51. this.myCommit('needReload', true);
  52. this.myCommit('stepActive', 1);
  53. }
  54. if(index == 1 && type == 'MULTI'){
  55. //督查+自查
  56. this.myCommit('theme',{...item,type:type});
  57. this.myCommit('needReload', true);
  58. this.myCommit('stepActive', 1);
  59. }
  60. },
  61. myCommit: function(key, data) {
  62. this.$store.commit({type: 'creatingSituations/comChangeState',key,data});
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="less">
  68. .theme {
  69. overflow: hidden;
  70. width: 100%;
  71. height: 100%;
  72. .content {
  73. display: flex;
  74. flex-direction: column;
  75. align-items: center;
  76. .item {
  77. position: relative;
  78. width:80%;
  79. margin: 0 auto;
  80. border-radius: 15rpx;
  81. background: linear-gradient(270deg, #6697FE 0%, #4980F2 100%);
  82. box-shadow: 0 12.5rpx 12.5rpx 0 rgba(73, 128, 242, 0.2);
  83. .checkmark {
  84. position: absolute;
  85. top: 10rpx;
  86. right: 10rpx;
  87. width: 46.87rpx;
  88. height: 46.87rpx;
  89. }
  90. .up {
  91. display: flex;
  92. flex-direction: row;
  93. padding: 37.5rpx 50rpx;
  94. // >image {
  95. // position: absolute;
  96. // top: 10rpx;
  97. // right: 10rpx;
  98. // width: 46.87rpx;
  99. // height: 46.87rpx;
  100. // }
  101. .left {
  102. margin-right: 25rpx;
  103. image {
  104. width: 112.5rpx;
  105. height: 112.5rpx;
  106. }
  107. }
  108. .right {
  109. display: flex;
  110. flex-direction: column;
  111. text {
  112. font-size: 17.5rpx;
  113. line-height: 25rpx;
  114. color: #fff;
  115. &:first-child {
  116. margin-bottom: 5rpx;
  117. font-size: 30rpx;
  118. font-weight: bold;
  119. line-height: 45rpx;
  120. }
  121. }
  122. }
  123. }
  124. .down {
  125. display: flex;
  126. flex-direction: row;
  127. align-items: center;
  128. justify-content: center;
  129. padding-bottom:50rpx;
  130. .leftBtn,.rightBtn {
  131. width: 237.5rpx;
  132. height: 62.5rpx;
  133. line-height:62.5rpx;
  134. background: #FFFFFF;
  135. border-radius: 31.25rpx;
  136. text-align: center;
  137. font-size: 30rpx;
  138. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  139. font-weight: 500;
  140. color: #4980F2;
  141. }
  142. .rightBtn {
  143. margin-left: 37.5rpx;
  144. }
  145. }
  146. &:first-child {
  147. margin-top: 125rpx;
  148. margin-bottom: 125rpx;
  149. background: linear-gradient(270deg, #00CCBB 0%, #00CCAA 100%);
  150. box-shadow: 0 12.5rpx 12.5rpx 0 rgba(0, 204, 170, 0.2);
  151. }
  152. }
  153. }
  154. }
  155. </style>