index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <page-theme :theme="theme">
  3. <template>
  4. <view class="f-30 p-40 flex-dir-column flex-x-center">
  5. <view class="col-info-d t-c m-b-30">欢迎使用</view>
  6. </view>
  7. </template>
  8. </page-theme>
  9. </template>
  10. <script>
  11. import themeMixins from '@/pages/yuecai/mixins/themeMixins.js';
  12. export default {
  13. mixins: [themeMixins],
  14. data() {
  15. return {
  16. isForcelogin: false, //是否强制重新登录
  17. checkeds: [],
  18. btnEnabled: false,
  19. isScaned: false,
  20. content: '<p>创建您的账户,您必须同意我们的' +
  21. '<a name="userAgreement" style="text-decoration:none"><strong><span style="color: black;">《用户协议》</span></strong></a>' +
  22. '和' +
  23. '<a name="privacyPolicy" style="text-decoration:none"><strong><span style="color: black;">《隐私协议》</span></strong></a></p>',
  24. }
  25. },
  26. methods: {
  27. gotoHome() {
  28. if (!this.btnEnabled) {
  29. return
  30. }
  31. if (this.isForcelogin || !this.$u.func.checkLogin()) {
  32. //强制重登或未登录,就登录一次
  33. console.log('强制重登或未登录,就登录一次')
  34. this.$u.func.wxLogin()
  35. } else {
  36. this.$u.func.toHome()
  37. }
  38. },
  39. gotoFollow() {
  40. uni.navigateTo({
  41. url: "./blocktime/follow"
  42. })
  43. },
  44. change(e) {
  45. this.btnEnabled = e.length > 0
  46. },
  47. clickLink(e) {
  48. if (e.name == 'userAgreement') {
  49. this.openUserAgreement()
  50. } else {
  51. this.openPrivacyPolicy()
  52. }
  53. },
  54. openUserAgreement() {
  55. uni.navigateTo({
  56. url: './blocktime/protocol'
  57. })
  58. },
  59. openPrivacyPolicy() {
  60. uni.navigateTo({
  61. url: './blocktime/privacy'
  62. })
  63. },
  64. sceneInfo() {
  65. let options = uni.getLaunchOptionsSync()
  66. console.log("options:" + JSON.stringify(options))
  67. let scanScene = [
  68. 1011, //扫描二维码
  69. 1047 //扫描小程序码
  70. ]
  71. if (scanScene.indexOf(options.scene) > -1) {
  72. this.isScaned = true
  73. }
  74. },
  75. },
  76. onLoad(options) {
  77. wx.showLoading();
  78. /** 扫码进入 */
  79. this.sceneInfo()
  80. this.isForcelogin = options.f == 1
  81. console.log("index onload")
  82. uni.$u.sleep(500).then(() => {
  83. wx.hideLoading();
  84. this.$u.func.toHome()
  85. // if (this.$u.func.checkLogin()) {
  86. // this.$u.func.toHome()
  87. // } else {
  88. // this.$u.func.wxLogin()
  89. // }
  90. })
  91. },
  92. }
  93. </script>
  94. <style scoped lang="scss">
  95. .u-checkbox-group {
  96. justify-content: center !important;
  97. }
  98. </style>