cc-protocolBox.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <view class="protocol_box">
  3. <view class="select" :class="{active: agree}" @click="agreeClick"></view>
  4. 我已仔细阅读
  5. <view v-for="(item, index) in protocolArr" :key="index">
  6. <text @click="protocolClick(index)">{{protocolArr[index]}}</text>
  7. <span v-if="index < (protocolArr.length - 1)">{{" 、"}}</span>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. props: {
  14. // 是否同意
  15. agree: {
  16. type: Boolean,
  17. default: false
  18. },
  19. // 协议数组
  20. protocolArr: {
  21. type: Array,
  22. default: function() {
  23. return [];
  24. }
  25. },
  26. },
  27. methods: {
  28. // 是否同意勾选
  29. agreeClick() {
  30. this.$emit('click')
  31. },
  32. protocolClick(tag) {
  33. this.$emit('protocolClick', tag)
  34. }
  35. }
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. //主题色 #ea552d
  40. $themeColor: #ea552d;
  41. .protocol_box {
  42. display: flex;
  43. flex-wrap: wrap;
  44. justify-content: center;
  45. align-items: center;
  46. margin-top: 40rpx;
  47. margin-left: 2%;
  48. width: 96%;
  49. font-size: 28rpx;
  50. color: #333333;
  51. font-size: 13px;
  52. .select {
  53. width: 36rpx;
  54. height: 36rpx;
  55. background-image: url("./ic_nor.png");
  56. background-position: center center;
  57. background-repeat: no-repeat;
  58. background-size: 100% auto;
  59. margin-right: 15rpx;
  60. margin-top: 2px;
  61. &.active {
  62. background-image: url("./ic_sel.png");
  63. }
  64. }
  65. text {
  66. color: $themeColor;
  67. font-size: 13px;
  68. white-space: pre-wrap;
  69. }
  70. }
  71. </style>