StepSecond.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <!--阅读服务协议-->
  3. <div class="section sectionSeconds">
  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="https://mall.usoftchina.com/help#/issue/50" target="_blank">
  20. 《优软商城服务条款》</a><a href="https://mall.usoftchina.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. // 个人用户,提交缓存的企业信息
  63. if (this.loginData.isSelf) {
  64. this.cacheData.enIsRead = this.checkData.checked
  65. this.$http.post('/basic/user/userCacheEnterprise', this.cacheData)
  66. } else { // 企业用户,设置企业的已读协议
  67. if (this.checkData.checked) { // 勾选了
  68. this.$http.post('/basic/enterprise/openVendorSetRead/' + this.loginData.enterprise.uu)
  69. .then(() => {
  70. this.$http.get('/user/authentication/reflash')
  71. .then(() => {
  72. this.$http.get(`/user/authentication/` + this.loginData.enterprise.uu).then(() => {
  73. this.$store.dispatch('loadUserInfo')
  74. })
  75. })
  76. })
  77. } else { // 没勾选
  78. this.$http.post('/basic/enterprise/openVendorSetNotRead/' + this.loginData.enterprise.uu)
  79. .then(() => {
  80. this.$http.get('/user/authentication/reflash')
  81. .then(() => {
  82. this.$http.get(`/user/authentication/` + this.loginData.enterprise.uu).then(() => {
  83. this.$store.dispatch('loadUserInfo')
  84. })
  85. })
  86. })
  87. }
  88. }
  89. }
  90. }
  91. }
  92. </script>
  93. <style>
  94. @import '~assets/scss/help.css';
  95. .step-two-btn button:first-child{
  96. background: #fff;
  97. color: #5078cb;
  98. border: 1px solid #5078cb;
  99. }
  100. .join_xieyi .ql-editor span,.join_xieyi .ql-editor a {
  101. font-size: 12px;
  102. line-height: 25px;
  103. }
  104. .join_xieyi .ql-editor br {
  105. display: none;
  106. }
  107. .join_xieyi .ql-editor {
  108. padding: 0 0 0 25px;
  109. }
  110. /* .join_xieyi .ql-editor p {
  111. width: 494px;
  112. margin: 0 auto;
  113. }*/
  114. .ql-container.ql-snow {
  115. border: none;
  116. }
  117. </style>