login.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <template>
  2. <view class="login">
  3. <!-- 返回按钮 -->
  4. <view class="zindex999" @click="href('/pages/login/index')">
  5. <image src="@/static/index/details/arrow_back.png" mode="widthFix"
  6. style="width: 48rpx;margin-left: 20rpx;margin-top:50rpx;"></image>
  7. </view>
  8. <!-- 返回按钮 -->
  9. <view class="title">
  10. <view class="login_view">
  11. <view class="">
  12. 鲑鱼数藏
  13. </view>
  14. <view class="">
  15. 开启你的数字藏品之旅
  16. </view>
  17. </view>
  18. <view class="text">
  19. <image src="@/static/logo.png" mode="widthFix" style="width: 120rpx;"></image>
  20. </view>
  21. </view>
  22. <!-- logo部分 结束-->
  23. <view class="logincontent">
  24. <!-- 手机号登录 -->
  25. <view class="login_content">
  26. <!-- 输入框部分 -->
  27. <!-- 手机号 -->
  28. <view class="iptLogin">
  29. <view class="input_item">
  30. <view class="">
  31. <input type="number" v-model="tel" placeholder="输入账号">
  32. </view>
  33. </view>
  34. </view>
  35. <!-- 手机号 结束-->
  36. <!-- 密码 -->
  37. <view class="iptLogin" style="margin-top: 50rpx;">
  38. <view class="input_item">
  39. <view class="">
  40. <input type="password" v-model="pwd" placeholder="输入密码">
  41. </view>
  42. </view>
  43. <view class="forgetpass" @click="href('/pages/login/forgetpassword')">
  44. 忘记密码
  45. </view>
  46. </view>
  47. <!-- 密码 结束-->
  48. </view>
  49. <view class="regist">
  50. 还没有账号?<text style="color: #fff;" @click="href('/pages/login/register')">注册账号</text>
  51. </view>
  52. <!-- 登录按钮 -->
  53. <view class="login_btn" @click="login">
  54. 登录
  55. </view>
  56. <!-- 登录按钮 结束-->
  57. <!-- 用户协议 -->
  58. <view class="agreement">
  59. <!-- 是否选中样式 -->
  60. <view class="">
  61. <view class="circle_checked" v-if="confim" @click="confim=false"></view>
  62. <view class="circle" v-else @click="confim=true"></view>
  63. </view>
  64. <view class="">
  65. 已阅读并同意<text class="blue" @click="href('/pages/my/set/relevant?type=1')">《用户协议》</text>和<text
  66. class="blue" @click="href('/pages/my/set/relevant?type=2')">《隐私政策》</text>
  67. </view>
  68. <!-- 是否选中样式 结束-->
  69. </view>
  70. <!-- 用户协议 结束-->
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. //隐私政策弹框
  77. export default {
  78. components: {
  79. },
  80. data() {
  81. return {
  82. //是否同意授权登录
  83. confim: false,
  84. //动画类名
  85. add_class: "",
  86. //是否显示隐私弹框
  87. Jur: false,
  88. //是否显示权限谈款
  89. Privacy: false,
  90. // 账号
  91. tel: "admin",
  92. // 密码
  93. pwd: "",
  94. // 验证码还是密码登录 2 验证码登录 1 密码登录
  95. loginType: 1,
  96. // 手机验证码
  97. code: "",
  98. // 验证码倒计数
  99. count: 0,
  100. time: ""
  101. }
  102. },
  103. onLoad() {
  104. //判断是否是第一次打开系统
  105. // #ifdef APP
  106. if (!uni.getStorageSync("isInSystem")) {
  107. this.Jur = true
  108. }
  109. // #endif
  110. // #ifdef H5
  111. if (uni.getStorageSync("isInSystemH5") == "" || uni.getStorageSync("isInSystemH5") == null) {
  112. this.Jur = true
  113. }
  114. // #endif
  115. },
  116. watch: {
  117. },
  118. methods: {
  119. setInSystem() {
  120. // #ifdef APP
  121. uni.setStorageSync("isInSystem", "true")
  122. // #endif
  123. // #ifdef H5
  124. uni.setStorageSync("isInSystemH5", "true")
  125. // #endif
  126. },
  127. // 点击登录
  128. login() {
  129. if (!this.confim) {
  130. this.$api.pop("请选勾选用户协议及隐私政策")
  131. return;
  132. }
  133. this.api.login(this.tel, this.pwd).then(res => {
  134. if (res.code == 1) {
  135. uni.setStorageSync("user_info", res.data)
  136. uni.setStorageSync("token", res.data.token.token)
  137. this.$api.pop("登录成功")
  138. this.tel = ""
  139. this.pwd = ""
  140. setTimeout(() => {
  141. this.$api.totabar("/pages/index/index")
  142. }, 500)
  143. }
  144. })
  145. },
  146. }
  147. }
  148. </script>
  149. <style scoped>
  150. .login {
  151. width: 100%;
  152. height: 100vh;
  153. background: #171918;
  154. overflow-x: hidden;
  155. color: #fff;
  156. }
  157. .logincontent {
  158. width: 710rpx;
  159. margin: auto;
  160. border-radius: 30rpx;
  161. padding-bottom: 70rpx;
  162. }
  163. .title {
  164. font-size: 46rpx;
  165. /* margin-top: 130rpx; */
  166. display: flex;
  167. align-items: center;
  168. }
  169. .login_view {
  170. margin: 166rpx 158rpx 164rpx 96rpx;
  171. }
  172. .login_view>view:first-child {
  173. font-size: 68rpx;
  174. }
  175. .login_view>view:last-child {
  176. font-size: 28rpx;
  177. }
  178. .title>view:last-child {
  179. width: 120rpx;
  180. height: 106rpx;
  181. }
  182. .login_content {
  183. margin-left: 80rpx;
  184. }
  185. .input_item {
  186. display: flex;
  187. width: 558rpx;
  188. height: 80rpx;
  189. font-size: 32rpx;
  190. position: relative;
  191. /* background: #F0F9FD; */
  192. /* border-radius: 30rpx; */
  193. border-bottom: 1px solid #333333;
  194. }
  195. .input_item:last-of-type {
  196. margin-top: 20rpx;
  197. }
  198. input {
  199. height: 70rpx;
  200. width: 400rpx;
  201. line-height: 70rpx;
  202. /* margin-left: 30rpx; */
  203. }
  204. .tools {
  205. width: 550rpx;
  206. display: flex;
  207. justify-content: space-between;
  208. font-size: 30rpx;
  209. margin: 134rpx auto 0 auto;
  210. }
  211. .tools>view:first-child {
  212. color: #999;
  213. }
  214. .tools>view:last-child {
  215. color: #fff;
  216. }
  217. .blue {
  218. color: #fff;
  219. }
  220. .login_btn {
  221. width: 558rpx;
  222. height: 96rpx;
  223. color: #000;
  224. background: linear-gradient(to bottom, #69FF60, #0C9D5B);
  225. font-size: 32rpx;
  226. line-height: 96rpx;
  227. margin: 0 auto;
  228. margin-top: 88rpx;
  229. text-align: center;
  230. border-radius: 138rpx;
  231. }
  232. .agreement {
  233. /* width: 550rpx; */
  234. /* margin: 50rpx 30rpx; */
  235. font-size: 28rpx;
  236. display: flex;
  237. align-items: center;
  238. justify-content: center;
  239. color: #999999;
  240. text-indent: 14rpx;
  241. margin-top: 32rpx;
  242. }
  243. .circle {
  244. width: 24rpx;
  245. height: 24rpx;
  246. border-radius: 50%;
  247. border: 1px solid #999999;
  248. }
  249. .circle_checked {
  250. width: 24rpx;
  251. height: 24rpx;
  252. border-radius: 50%;
  253. background: #0C9D5B;
  254. border: 1px solid #0C9D5B;
  255. }
  256. .changeType {
  257. margin: 0 auto;
  258. /* margin-top: 346rpx; */
  259. /* margin-top: 146rpx; */
  260. width: 432rpx;
  261. display: flex;
  262. justify-content: space-between;
  263. font-size: 28rpx;
  264. font-weight: 400;
  265. color: #999999;
  266. }
  267. .colorWhite {
  268. color: #fff;
  269. }
  270. .colorGray {
  271. color: #999999;
  272. }
  273. .sendcode {
  274. color: #E5D798;
  275. font-size: 24rpx;
  276. height: 70rpx;
  277. line-height: 70rpx;
  278. text-align: right;
  279. width: 200rpx;
  280. position: absolute;
  281. right: 0;
  282. margin-right: 20rpx;
  283. }
  284. .sendcode_count {
  285. color: #E5D798;
  286. font-size: 24rpx;
  287. height: 70rpx;
  288. line-height: 70rpx;
  289. width: 200rpx;
  290. position: absolute;
  291. right: 0;
  292. }
  293. .iptLogin>view:first-child>view:first-child {
  294. width: 24rpx;
  295. height: 28rpx;
  296. margin-top: 8rpx;
  297. margin-right: 10rpx;
  298. }
  299. .iptLogin>view:first-child {
  300. display: flex;
  301. }
  302. .iptLogin:last-child {
  303. position: relative;
  304. }
  305. /deep/.uni-input-wrapper {
  306. color: #fff;
  307. }
  308. .text {
  309. height: 50rpx;
  310. width: 170rpx;
  311. }
  312. .forgetpass {
  313. height: 42rpx;
  314. font-size: 28rpx;
  315. text-align: center;
  316. line-height: 42rpx;
  317. color: #fff;
  318. position: absolute;
  319. bottom: 0;
  320. right: 0;
  321. margin-right: 80rpx;
  322. margin-bottom: 10rpx;
  323. border-bottom: 1px solid #fff;
  324. }
  325. .regist {
  326. text-align: center;
  327. font-size: 22rpx;
  328. margin-top: 24rpx;
  329. color: #999;
  330. }
  331. </style>