wechat-login.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <view>
  3. <!-- <view class="head-box ss-flex-col">-->
  4. <!-- <view class="ss-flex ss-m-b-20">-->
  5. <!-- <view class="head-title ss-m-r-40 head-title-animation">微信登录</view>-->
  6. <!-- </view>-->
  7. <!-- </view>-->
  8. <view>欢迎您登录【若依商城电商系统】</view>
  9. <view style="margin-top: 200rpx">
  10. <button
  11. class="ss-reset-button buy-btn ui-Success-Main"
  12. open-type="getPhoneNumber"
  13. @getphonenumber="wechatLogin"
  14. >
  15. <view class="ss-flex">
  16. <!-- <image class="auto-login-img" :src="sheep.$url.static('/image/weixin.svg')"/>-->
  17. <view>手机号快捷登录</view>
  18. </view>
  19. </button>
  20. <view style="height: 10rpx"></view>
  21. <button
  22. class="ss-reset-button cancel-btn ui-Shadow-Pioneer-Main"
  23. @tap="closeAuthModal"
  24. >
  25. <view class="ss-flex">
  26. <!-- <image class="auto-login-img" :src="sheep.$url.static('/image/weixin.svg')"/>-->
  27. <view>暂不登录</view>
  28. </view>
  29. </button>
  30. </view>
  31. <view class="agreement-text ss-flex">
  32. 登录遇到问题?点此
  33. <button class="btnStyle" open-type="contact">联系客服</button>
  34. </view>
  35. </view>
  36. </template>
  37. <script setup>
  38. import sheep from "@/sheep";
  39. import { computed, reactive } from "vue";
  40. import { closeAuthModal } from "@/sheep/hooks/useModal";
  41. const appInfo = computed(() => sheep.$store("app").info);
  42. const state = reactive({
  43. protocol: false,
  44. });
  45. //勾选协议
  46. function onChange() {
  47. state.protocol = !state.protocol;
  48. }
  49. async function wechatLogin(e) {
  50. const loginRes = await sheep.$platform.useProvider("wechat").login(e.detail);
  51. if (loginRes) {
  52. sheep.$helper.toast("登录成功");
  53. closeAuthModal();
  54. }
  55. }
  56. // 查看协议
  57. function onProtocol(id, title) {
  58. closeAuthModal();
  59. sheep.$router.go("/pages/public/richtext", {
  60. id,
  61. title,
  62. });
  63. }
  64. // 请先登录提示
  65. function handleTip() {
  66. uni.showToast({
  67. title: "请勾选我已阅读并同意《用户协议》和《隐私政策》!",
  68. icon: "none",
  69. mask: true,
  70. });
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .cancel-btn {
  75. width: 100%;
  76. height: 72rpx;
  77. font-weight: 500;
  78. font-size: 28rpx;
  79. border-radius: 40rpx;
  80. background: red;
  81. color: $white;
  82. }
  83. .btnStyle {
  84. border: none;
  85. font-size: 15px;
  86. padding: 0 !important;
  87. color: #82abcc;
  88. margin: 0;
  89. background-color: transparent;
  90. &::after {
  91. border: none;
  92. }
  93. }
  94. .agreement-text {
  95. justify-content: center;
  96. position: absolute;
  97. bottom: 0;
  98. width: calc(100% - 68rpx);
  99. }
  100. .buy-btn {
  101. width: 100%;
  102. height: 72rpx;
  103. font-weight: 500;
  104. font-size: 28rpx;
  105. border-radius: 40rpx;
  106. background: #0dd116;
  107. color: $white;
  108. }
  109. .auto-login-img {
  110. width: 48rpx;
  111. height: 48rpx;
  112. border-radius: 50%;
  113. }
  114. </style>