StepSecond.vue 4.8 KB

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