StepSecond.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <!--阅读服务协议-->
  3. <div class="section">
  4. <div class="agreement">
  5. <div class="join_xieyi">
  6. <div class="article-flag">
  7. <span @click="chooseTag=1" :class="chooseTag==1?'active':''">优软商城服务条款</span>
  8. <span @click="chooseTag=2" :class="chooseTag==2?'active':''">优软商城买卖条例</span>
  9. </div>
  10. <!--<textarea readonly></textarea>-->
  11. <div class="text-area">
  12. <div class="ql-container ql-snow" v-html="article"></div>
  13. </div>
  14. </div>
  15. </div>
  16. <div class="row" style="margin-left: 30px; text-align: center;">
  17. <label class="checkbox-inline">
  18. <input type="checkbox" id="agree" name="agree" value="1" :checked="checkData.checked" @click="onCheck()" >
  19. 我已阅读并同意<a href="http://www.usoftmall.com/help#/issue/50" target="_blank">
  20. 《优软商城服务条款》</a>、<a href="http://www.usoftmall.com/help#/issue/16" target="_blank">
  21. 《优软商城买卖条例》</a>
  22. </label>
  23. </div>
  24. <div class="row next-btn step-two-btn" style="margin-top: 20px">
  25. <button @click="sectionChange(1)" class="btn">上一步</button>
  26. <button @click="sectionChange(3)" class="btn" :style="!checkData.checked ? 'opacity: .65;':''">下一步</button>
  27. </div>
  28. </div>
  29. </template>
  30. <script>
  31. export default {
  32. props: ['checkData', 'loginData', 'cacheData'],
  33. data () {
  34. return {
  35. chooseTag: 1,
  36. article: ''
  37. }
  38. },
  39. watch: {
  40. chooseTag: function (val) {
  41. this.getArticle(val === 1 ? 50 : 16)
  42. }
  43. },
  44. mounted () {
  45. this.getArticle(50)
  46. },
  47. methods: {
  48. sectionChange: function (type) {
  49. if (!this.checkData.checked && type === 3) {
  50. this.$message.error('请阅读相关条例')
  51. } else {
  52. this.$emit('sectionEvent', type)
  53. }
  54. },
  55. getArticle: function (num) {
  56. this.$http.get('/api/help-service/issues/' + num).then(response => {
  57. this.article = response.data.article
  58. })
  59. },
  60. onCheck: function () {
  61. this.checkData.checked = !this.checkData.checked
  62. if (this.loginData.isSelf) {
  63. this.cacheData.enIsRead = this.checkData.checked
  64. this.$http.post('/basic/user/userCacheEnterprise', this.cacheData)
  65. } else {
  66. if (this.checkData.checked) {
  67. this.$http.post('/basic/enterprise/openVendorSetRead/' + this.loginData.enterprise.uu)
  68. .then(() => {
  69. this.$http.get('/user/authentication/reflash')
  70. .then(() => {
  71. this.$http.get(`/user/authentication/` + this.loginData.enterprise.uu).then(() => {
  72. this.$store.dispatch('loadUserInfo')
  73. })
  74. })
  75. })
  76. } else {
  77. this.$http.post('/basic/enterprise/openVendorSetNotRead/' + this.loginData.enterprise.uu)
  78. .then(() => {
  79. this.$http.get('/user/authentication/reflash')
  80. .then(() => {
  81. this.$http.get(`/user/authentication/` + this.loginData.enterprise.uu).then(() => {
  82. this.$store.dispatch('loadUserInfo')
  83. })
  84. })
  85. })
  86. }
  87. }
  88. }
  89. }
  90. }
  91. </script>
  92. <style>
  93. @import '~assets/scss/help.css';
  94. .step-two-btn button:first-child{
  95. background: #fff;
  96. color: #5078cb;
  97. border: 1px solid #5078cb;
  98. }
  99. .join_xieyi .ql-editor span,.join_xieyi .ql-editor a {
  100. font-size: 12px;
  101. line-height: 25px;
  102. }
  103. .join_xieyi .ql-editor br {
  104. display: none;
  105. }
  106. .join_xieyi .ql-editor {
  107. padding: 0 0 0 25px;
  108. }
  109. /* .join_xieyi .ql-editor p {
  110. width: 494px;
  111. margin: 0 auto;
  112. }*/
  113. .ql-container.ql-snow {
  114. border: none;
  115. }
  116. </style>