privacyAgree.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view>
  3. <view class="agree-content" v-html="html"></view>
  4. </view>
  5. </template>
  6. <script>
  7. import { getPrivacyAgree, getUserAgree, getCancelAgree } from '@/api/user.js'
  8. export default {
  9. data() {
  10. return {
  11. html: '隐私政策'
  12. }
  13. },
  14. methods: {
  15. init(mode){
  16. if(mode==="privacy"){
  17. getPrivacyAgree().then(res=>{
  18. uni.setNavigationBarTitle({
  19. title: "小程序隐私政策"
  20. })
  21. this.html = res.data.content
  22. })
  23. }else if(mode==='user'){
  24. uni.setNavigationBarTitle({
  25. title: "小程序用户手册"
  26. })
  27. getUserAgree().then(res=>{
  28. this.html = res.data.content
  29. })
  30. }else if(mode==='cancel'){
  31. uni.setNavigationBarTitle({
  32. title: "会员中心小程序账号注销通知"
  33. })
  34. getCancelAgree().then(res=>{
  35. this.html = res.data.content
  36. })
  37. }
  38. }
  39. },
  40. onLoad(options) {
  41. let { mode } = options
  42. this.init(mode)
  43. }
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. .agree-title{
  48. text-align: center;
  49. font-size: 35rpx;
  50. font-weight: bold;
  51. line-height: 60rpx;
  52. }
  53. .agree-content {
  54. padding: 30rpx;
  55. margin-bottom: 20rpx;
  56. .content-text{
  57. display: block;
  58. text-indent: 2em;
  59. line-height: 60rpx;
  60. }
  61. }
  62. .agree-name{
  63. padding: 30rpx;
  64. margin-bottom: 20rpx;
  65. .name-text{
  66. text-align: right;
  67. display: block;
  68. // text-indent: 2em;
  69. line-height: 60rpx;
  70. }
  71. }
  72. </style>