珠宝小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
2.8 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <view class="login">
  3. <view class="logo">
  4. <image :src="configList.logo_image" mode=""></image>
  5. </view>
  6. <view class="title">
  7. 欢迎使用{{ configList.logo_name }}
  8. </view>
  9. <view class="btn mt"
  10. @click="wxLogin">
  11. <view class="icon">
  12. <image src="../static/auth/wx.png" mode=""></image>
  13. </view>
  14. <view class="">
  15. 微信授权登录
  16. </view>
  17. </view>
  18. <view class="btn b2"
  19. @click="qux">
  20. 取消登录
  21. </view>
  22. <view class="config">
  23. <uv-checkbox-group
  24. v-model="checkboxValue"
  25. shape="circle">
  26. <view class="content">
  27. <view
  28. style="display: flex;">
  29. <uv-checkbox
  30. size="40rpx"
  31. icon-size="30rpx"
  32. activeColor="#E3441A"
  33. :name="1"
  34. ></uv-checkbox>
  35. 阅读并同意我们的<text @click="$refs.popup.open('user_xy')">用户协议</text>
  36. </view>
  37. <view class="">
  38. 以及<text @click="$refs.popup.open('user_ys')">隐私政策</text>
  39. </view>
  40. </view>
  41. </uv-checkbox-group>
  42. </view>
  43. <configPopup ref="popup"></configPopup>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. name : 'Login',
  49. data() {
  50. return {
  51. checkboxValue : []
  52. }
  53. },
  54. methods: {
  55. getPhoneNumber(e){
  56. console.log(e, e.detail.code);
  57. this.wxLogin(phoneCode)
  58. },
  59. wxLogin(phoneCode){
  60. if(!this.checkboxValue.length){
  61. return uni.showToast({
  62. title: '请先同意隐私协议',
  63. icon:'none'
  64. })
  65. }
  66. this.$store.commit('login', phoneCode)
  67. },
  68. //打开应用配置
  69. openConfigDetail(key){
  70. this.$refs.popup.open(key)
  71. },
  72. qux(){
  73. uni.reLaunch({
  74. url: '/pages/index/index'
  75. })
  76. },
  77. }
  78. }
  79. </script>
  80. <style scoped lang="scss">
  81. .login{
  82. display: flex;
  83. justify-content: center;
  84. align-items: center;
  85. height: 80vh;
  86. flex-direction: column;
  87. position: relative;
  88. .logo{
  89. height: 140rpx;
  90. width: 140rpx;
  91. image{
  92. height: 140rpx;
  93. width: 140rpx;
  94. border-radius: 30rpx;
  95. }
  96. margin-bottom: 20rpx;
  97. }
  98. .title{
  99. position: relative;
  100. font-weight: 900;
  101. font-size: 45rpx;
  102. &::after{
  103. content: '';
  104. position: absolute;
  105. left: 0;
  106. top: 100%;
  107. display: block;
  108. height: 8rpx;
  109. width: 210rpx;
  110. background: linear-gradient(to right,$uni-color, #fff);
  111. }
  112. }
  113. .btn{
  114. all: unset;
  115. width: 80%;
  116. height: 100rpx;
  117. background-color: $uni-color;
  118. color: #fff;
  119. display: flex;
  120. justify-content: center;
  121. align-items: center;
  122. margin: 20rpx 0;
  123. border-radius: 20rpx;
  124. border: none;
  125. &::after{
  126. }
  127. .icon{
  128. margin-right: 10rpx;
  129. image{
  130. width: 40rpx;
  131. height: 35rpx;
  132. }
  133. }
  134. }
  135. .b2{
  136. background-color: rgba($uni-color, 0.2);
  137. color: $uni-color;
  138. }
  139. .mt{
  140. margin-top: 200rpx;
  141. }
  142. .config{
  143. position: absolute;
  144. bottom: 0;
  145. font-size: 24rpx;
  146. text-align: center;
  147. line-height: 40rpx;
  148. text{
  149. color: $uni-color;
  150. }
  151. }
  152. }
  153. </style>