StepSecond.vue 4.2 KB

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