login.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <ax-body blank="0" hideIndicatorArea>
  3. <image src="@/static/img/page-bg01.png" class="page-background"></image>
  4. <view class="body">
  5. <view class="title">
  6. <view>
  7. <view class="h1">您好!</view>
  8. <view class="h2">欢迎使用中数电动</view>
  9. </view>
  10. <image src="@/static/img/logo.svg" class="logo" mode="widthFix"></image>
  11. </view>
  12. <view class="logo-wrap">
  13. <image src="@/static/img/login-bg.svg" class="bg" mode="widthFix"></image>
  14. </view>
  15. <view class="footer" style="padding-left: 0;padding-right: 0;">
  16. <button @getphonenumber="onGetPhoneNumber" open-type="getPhoneNumber" class="submit"
  17. :disabled="!agreement" style="margin-left: 35px;width: calc(100% - 70px);">
  18. <text class="ax ax-iconblock i-weixin"></text>
  19. <text>微信用户一键登录</text>
  20. </button>
  21. <view class="cancel">取消返回</view>
  22. <view @click="agreement = !agreement" class="agreement" style="font-size: 17px;">
  23. <view class="mask" :class="{active:agreement}"><text class="ax ax-iconline i-select"></text></view>
  24. <text>我已阅读并理解和同意</text>
  25. <text @click.stop="checkPrivacy()" class="em">《隐私政策协议》</text>
  26. </view>
  27. </view>
  28. </view>
  29. </ax-body>
  30. </template>
  31. <script>
  32. export default {
  33. onLoad() {
  34. uni.getPrivacySetting({
  35. success: res => {
  36. this.privacy.name = res.privacyContractName;
  37. this.privacy.need = res.needAuthorization;
  38. }
  39. });
  40. },
  41. data() {
  42. return {
  43. agreement: false,
  44. privacy: {
  45. need: true,
  46. name: ''
  47. },
  48. }
  49. },
  50. methods: {
  51. // 查看隐私
  52. checkPrivacy() {
  53. uni.openPrivacyContract();
  54. },
  55. onGetPhoneNumber(e) {
  56. if (e.detail.code) {
  57. this.$api.base("post", '/userApi/getPhone', {
  58. code: e.detail.code
  59. }).then(async res => {
  60. await this.$app.storage.set('USER_INFO', res.userInfo);
  61. uni.request({
  62. url: 'http://192.168.2.21:9120/zs/channel/admin/ums/umsAdminUser/distributionBindUser',
  63. method: 'POST',
  64. header: {
  65. 'content-type': 'application/json'
  66. },
  67. data: {
  68. userId: res.userInfo.id,
  69. adminUserId: uni.getStorageSync('adminUserId'),
  70. },
  71. success: (res) => {
  72. console.log('扫码接口调用');
  73. }
  74. });
  75. this.$app.url.back()
  76. });
  77. }
  78. },
  79. }
  80. }
  81. </script>
  82. <style scoped>
  83. @import url("login.css");
  84. </style>