login.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <view id="login">
  3. <img class="logo-img" :src="imagesUrl('commonality/logo%401x.png')" @click="verificationButton(1)">
  4. <view class="title-1">欢迎使用</view>
  5. <view class="title-2">实验室安全智慧化管控系统</view>
  6. <view class="null-p"></view>
  7. <img class="login-img" @click="verificationButton(2)" :src="imagesUrl('commonality/img_tyrzdl_ch%402x.png')">
  8. <view class="ssoButton" @click="goPage('ssoLogin')">统一身份认证登录</view>
  9. <view class="accountButton" v-if="!weChatProgramVersion" @click="goPage('accountLogin')">账号密码登录</view>
  10. <view class="accountButton" v-if="!weChatProgramVersion" @click="goPage('register')">供应商注册</view>
  11. <view class="position-top-right-box"></view>
  12. <view class="position-bottom-left-box" @click="verificationButton(5)"></view>
  13. </view>
  14. </template>
  15. <script>
  16. import {
  17. config
  18. } from '@/api/request/config.js'
  19. import {
  20. configInfo,
  21. getConfigByType
  22. } from '@/pages/api/index.js'
  23. export default {
  24. onShareAppMessage(res) {
  25. return {
  26. title: '实验室安全智慧化管控系统',
  27. path: '/pages/views/login/login'
  28. }
  29. },
  30. name: "ssoLogin",
  31. data() {
  32. return {
  33. weChatProgramVersion:true,
  34. verificationList:[],
  35. }
  36. },
  37. onLoad(option) {
  38. },
  39. mounted() {
  40. this.getConfigInfo();
  41. },
  42. methods: {
  43. goPage(type){
  44. if(type == 'ssoLogin'){
  45. uni.navigateTo({
  46. url: '/pages/views/login/ssoLogin'
  47. });
  48. }else if(type == 'accountLogin'){
  49. uni.navigateTo({
  50. url: '/pages/views/login/accountLogin'
  51. });
  52. }else if(type == 'register'){
  53. console.log('type',type)
  54. uni.navigateTo({
  55. url: '/pages_supplier/views/register/register?pageStatus=0'
  56. });
  57. }
  58. },
  59. //查询公共配置
  60. async getConfigInfo() {
  61. const {
  62. data
  63. } = await configInfo({
  64. type: '5'
  65. });
  66. if (data.code == 200) {
  67. let list = JSON.parse(data.data)
  68. let newData = {};
  69. list.forEach((item) => {
  70. let obj = JSON.parse(item.configValue)
  71. newData = {
  72. ...newData,
  73. ...obj
  74. }
  75. })
  76. if(config.weChatProgramVersion === newData.weChatProgramVersion){
  77. this.$set(this,'weChatProgramVersion',true);
  78. }else{
  79. this.$set(this,'weChatProgramVersion',false);
  80. }
  81. }
  82. },
  83. verificationButton(val){
  84. if(val == 1){
  85. this.verificationList.push(1)
  86. }else if(val == 2){
  87. this.verificationList.push(2)
  88. }else if(val == 5){
  89. const str = this.verificationList.join('');
  90. if(str === '1122'){
  91. this.$set(this,'verificationList',[]);
  92. uni.navigateTo({
  93. url: '/pages/views/login/accountLogin'
  94. });
  95. }else{
  96. this.$set(this,'verificationList',[]);
  97. }
  98. }
  99. },
  100. },
  101. }
  102. </script>
  103. <style lang="stylus" scoped>
  104. #login{
  105. height: 100%;
  106. width: 100%;
  107. background #fff;
  108. position relative;
  109. display: flex;
  110. flex-direction: column;
  111. position: relative;
  112. .logo-img{
  113. width:370rpx;
  114. height:68rpx;
  115. margin:320rpx 190rpx 0;
  116. }
  117. .position-top-right-box{
  118. position: absolute;
  119. top:0;
  120. right:0;
  121. width:230rpx;
  122. height:230rpx;
  123. border-bottom-left-radius: 100%;
  124. background-color: #E5F2FE;
  125. filter: blur(4px);
  126. }
  127. .position-bottom-left-box{
  128. position: absolute;
  129. bottom:0;
  130. left:0;
  131. width:230rpx;
  132. height:230rpx;
  133. border-top-right-radius: 100%;
  134. background-color: #E5F2FE;
  135. filter: blur(4px);
  136. z-index:0;
  137. }
  138. .title-1{
  139. font-size:38rpx;
  140. line-height:55rpx;
  141. height:55rpx;
  142. text-align: center;
  143. color:#333;
  144. margin:90rpx 0 31rpx;
  145. }
  146. .title-2{
  147. font-size:38rpx;
  148. line-height:55rpx;
  149. height:55rpx;
  150. text-align: center;
  151. color:#0183fa;
  152. }
  153. .null-p{
  154. flex:1;
  155. }
  156. .login-img{
  157. width:600rpx;
  158. height:408rpx;
  159. margin:0 auto 125rpx;
  160. }
  161. .ssoButton{
  162. width:650rpx;
  163. height:80rpx;
  164. line-height:80rpx;
  165. text-align: center;
  166. background-color:#0183fa;
  167. color:#fff;
  168. font-size:32rpx;
  169. margin:0 auto 175rpx;
  170. border-radius:50rpx;
  171. z-index:1;
  172. }
  173. .accountButton{
  174. width:200;
  175. height:80rpx;
  176. line-height:80rpx;
  177. text-align: center;
  178. color:#0183fa;
  179. font-size:28rpx;
  180. margin:0 auto 40rpx;
  181. }
  182. }
  183. </style>