login.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917
  1. <template>
  2. <view class="container">
  3. <!-- <image @click="navBack" src="../../static/images/index/close.png" style="width: 32upx;height: 32upx;margin-left: 46upx;"></image> -->
  4. <!-- 小程序状态下登录 -->
  5. <!-- #ifdef MP-WEIXIN -->
  6. <view class="login-box">
  7. <view class="mp_wxBox">
  8. <view>
  9. <view class="logo-box">
  10. <image src="@/static/images/jobApplicant/logo.svg" mode="scaleToFill" />
  11. </view>
  12. <view class="content">
  13. <view>申请获取以下权限</view>
  14. <text>获得你的公开信息(昵称,头像、地区等)</text>
  15. </view>
  16. <view v-if="weixinPhone == true || weixinPhone == 'true'" class="login-btn wechat"
  17. open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
  18. <image src="@/static/images/jobApplicant/phone.svg" mode="scaleToFill" />
  19. 授权手机号
  20. </view>
  21. <button v-else style="background: rgba(13, 39, 247, 1); color: #ffffff" class="bottom"
  22. bindtap="getUserProfile" @tap="login()">
  23. 授权登录
  24. </button>
  25. </view>
  26. </view>
  27. <view style="text-align: center">
  28. <view class="footer">
  29. <view class="check-box" @click="checked = !checked">
  30. <image src="@/static/images/jobApplicant/check.svg" v-if="checked" mode="scaleToFill" />
  31. <image src="@/static/images/jobApplicant/border.svg" v-else mode="scaleToFill" />
  32. </view>
  33. 已阅读并同意<navigator url="/my/setting/xieyi">《亿职赞用户协议》</navigator>
  34. 和<navigator url="/my/setting/mimi">《隐私协议》</navigator>,允许亿职赞统一管理本人账号信息
  35. </view>
  36. </view>
  37. </view>
  38. <!-- #endif -->
  39. <!-- #ifndef MP-WEIXIN -->
  40. <view style="text-align: center" class="login-box">
  41. <view class="logo-box">
  42. <image src="@/static/images/jobApplicant/logo.svg" mode="scaleToFill" />
  43. </view>
  44. <!-- <button class="confirm-btn" style="margin-top: 100rpx" @click="register">
  45. 手机号登录
  46. </button> -->
  47. <!-- #ifdef APP -->
  48. <view v-if="isAndroid||true" class="login-btn wechat" :class="{ disabled: !checked }" :disabled="checked" @click="wxAppLogin">
  49. <image src="@/static/images/jobApplicant/wx.svg" mode="scaleToFill" />微信登录
  50. </view>
  51. <!-- #endif -->
  52. <view class="login-btn password" :class="{ disabled: !checked }" :disabled="checked" @click="register(1)">
  53. <image src="@/static/images/jobApplicant/account.svg" mode="scaleToFill" />账号密码登录
  54. </view>
  55. <view class="login-btn wechat" :class="{ disabled: !checked }" :disabled="checked" @click="register(2)">
  56. <image src="@/static/images/jobApplicant/phone.svg" mode="scaleToFill" />手机验证码登录
  57. </view>
  58. <!-- <view class="" v-if="isopen" @click="weixinLo" style="width: 100%; padding-top: 100rpx">
  59. <view class="">
  60. <u-icon name="weixin-circle-fill" color="#5fcd73" size="100"></u-icon>
  61. </view>
  62. <view class="login-btn wechat"> 公众号快捷登录 </view>
  63. </view> -->
  64. <!-- 底部信息 -->
  65. <view class="footer">
  66. <view class="check-box" @click="checked = !checked">
  67. <image src="@/static/images/jobApplicant/check.svg" v-if="checked" mode="scaleToFill" />
  68. <image src="@/static/images/jobApplicant/border.svg" v-else mode="scaleToFill" />
  69. </view>
  70. 已阅读并同意<navigator url="/my/setting/xieyi">《亿职赞用户协议》</navigator>
  71. 和<navigator url="/my/setting/mimi">《隐私协议》</navigator>,允许亿职赞统一管理本人账号信息
  72. </view>
  73. <!-- <view class="footer">
  74. <u-checkbox shape="circle" v-model="checked"> </u-checkbox>
  75. <text>同意</text>
  76. 协议地址
  77. <navigator url="/my/setting/mimi" open-type="navigate">《隐私政策》</navigator>
  78. <navigator url="/my/setting/xieyi" open-type="navigate">《用户协议》</navigator>
  79. </view> -->
  80. </view>
  81. <!-- #endif -->
  82. </view>
  83. </template>
  84. <script>
  85. export default {
  86. data() {
  87. return {
  88. checked: false,
  89. mobile: "",
  90. code: "",
  91. weixinLogin: false,
  92. sending: false,
  93. sendTime: "获取验证码",
  94. count: 60,
  95. weixinPhone: false,
  96. sendDataList: {},
  97. sessionkey: "",
  98. phoneNum: false,
  99. isopen: false,
  100. isAndroid:false,
  101. };
  102. },
  103. onLoad(e) {
  104. if (e.inviterCode) {
  105. this.$queue.setData("inviterCode", e.inviterCode);
  106. }
  107. console.log(uni.getSystemInfoSync());
  108. this.isAndroid=uni.getSystemInfoSync().platform=='android'
  109. this.sessionkey = uni.getStorageSync("sessionkey");
  110. this.weixinPhone = uni.getStorageSync("weixinPhone");
  111. console.log(this.weixinPhone);
  112. if (uni.getStorageSync("sendDataList")) {
  113. this.sendDataList = uni.getStorageSync("sendDataList");
  114. }
  115. // //微信登录开启
  116. // this.$Request.getT('/app/common/type/53').then(res => {
  117. // if (res.code == 0) {
  118. // if (res.data && res.data.value && res.data.value == '是') {
  119. // // this.weixinLogin = true;
  120. // }
  121. // }
  122. // });
  123. this.$Request.getT("/app/common/type/188").then((res) => {
  124. if (res.code == 0) {
  125. if (res.data && res.data.value && res.data.value == "是") {
  126. this.phoneNum = true;
  127. }
  128. }
  129. });
  130. // #ifdef H5
  131. let ua = navigator.userAgent.toLowerCase();
  132. if (ua.indexOf("micromessenger") !== -1) {
  133. //公众号是否自动登录 108
  134. this.$Request.getT("/app/common/type/108").then((res) => {
  135. if (res.code == 0) {
  136. if (res.data && res.data.value && res.data.value == "是") {
  137. this.isopen = true;
  138. } else {
  139. this.isopen = false;
  140. }
  141. }
  142. });
  143. } else {
  144. this.isopen = false;
  145. }
  146. this.selbindwx();
  147. // #endif
  148. },
  149. methods: {
  150. selbindwx() {
  151. let ua = navigator.userAgent.toLowerCase();
  152. if (ua.indexOf("micromessenger") !== -1) {
  153. let openid = uni.getStorageSync("openid");
  154. let userId = uni.getStorageSync("userId");
  155. // let that = this;
  156. if (
  157. window.location.href.indexOf("?code=") !== -1 ||
  158. window.location.href.indexOf("&code=") !== -1
  159. ) {
  160. let code;
  161. if (window.location.href.indexOf("?code=") !== -1) {
  162. code = window.location.href.split("?code=")[1].split("&")[0];
  163. } else {
  164. code = window.location.href.split("&code=")[1].split("&")[0];
  165. }
  166. let data = {
  167. code: code,
  168. };
  169. this.$Request.getT("/app/Login/getOpenId", data).then((ret) => {
  170. if (ret.code == 0) {
  171. uni.setStorageSync("openid", ret.data);
  172. this.$Request
  173. .getT("/app/Login/openid/login", {
  174. openId: ret.data,
  175. })
  176. .then((res) => {
  177. if (res.code == 0) {
  178. uni.setStorageSync("token", res.token);
  179. uni.setStorageSync("userName", res.user.userName);
  180. uni.setStorageSync("avatar", res.user.avatar);
  181. uni.setStorageSync("phone", res.user.phone);
  182. uni.setStorageSync("invitationCode", res.user.invitationCode);
  183. this.$queue.setData("inviterCode", res.user.inviterCode);
  184. uni.setStorageSync("sex", res.user.sex);
  185. uni.setStorageSync("userId", res.user.userId);
  186. uni.setStorageSync("openId", res.user.openId);
  187. uni.setStorageSync("userType", res.user.userType);
  188. this.$Request.get("/app/UserVip/isUserVip").then((res) => {
  189. if (res.code == 0 && res.data && res.data.isVip == 2) {
  190. uni.setStorageSync("isVIP", true);
  191. } else {
  192. uni.setStorageSync("isVIP", false);
  193. }
  194. });
  195. //判断是否开启身份选择 是/否
  196. this.$Request.get("/app/common/type/339").then((rest) => {
  197. if (rest.code == 0) {
  198. if (rest.data.value == "是") {
  199. uni.reLaunch({
  200. url: "/pages/public/selectIdentity/selectIdentity",
  201. });
  202. } else {
  203. uni.navigateBack();
  204. }
  205. } else {
  206. uni.navigateBack();
  207. }
  208. });
  209. } else {
  210. uni.navigateTo({
  211. url: "/pages/public/bind",
  212. });
  213. }
  214. });
  215. }
  216. });
  217. }
  218. }
  219. },
  220. //微信公众号登录
  221. weixinLo() {
  222. if (this.checked == false) {
  223. uni.showToast({
  224. title: "请先同意《隐私政策》和《用户服务协议》",
  225. icon: "none",
  226. });
  227. return;
  228. }
  229. let ua = navigator.userAgent.toLowerCase();
  230. if (ua.indexOf("micromessenger") !== -1) {
  231. let openid = uni.getStorageSync("openid");
  232. let userId = uni.getStorageSync("userId");
  233. if (!openid) {
  234. if (
  235. window.location.href.indexOf("?code=") !== -1 ||
  236. window.location.href.indexOf("&code=") !== -1
  237. ) {
  238. let code;
  239. if (window.location.href.indexOf("?code=") !== -1) {
  240. code = window.location.href.split("?code=")[1].split("&")[0];
  241. } else {
  242. code = window.location.href.split("&code=")[1].split("&")[0];
  243. }
  244. let data = {
  245. code: code,
  246. };
  247. this.$Request.getT("/app/Login/getOpenId", data).then((res) => {
  248. if (ret.code == 0) {
  249. uni.setStorageSync("openid", ret.data);
  250. let datas = {
  251. openId: ret.data,
  252. };
  253. this.$Request.getT("/app/Login/openid/login", datas).then((res) => {
  254. if (res.code == 0) {
  255. uni.setStorageSync("token", res.token);
  256. uni.setStorageSync("userName", res.user.userName);
  257. uni.setStorageSync("avatar", res.user.avatar);
  258. uni.setStorageSync("phone", res.user.phone);
  259. uni.setStorageSync("invitationCode", res.user.invitationCode);
  260. this.$queue.setData("inviterCode", res.user.inviterCode);
  261. uni.setStorageSync("sex", res.user.sex);
  262. uni.setStorageSync("userId", res.user.userId);
  263. uni.setStorageSync("openId", res.user.openId);
  264. uni.setStorageSync("userType", res.user.userType);
  265. this.$Request.get("/app/UserVip/isUserVip").then((res) => {
  266. if (res.code == 0 && res.data && res.data.isVip ==
  267. 2) {
  268. uni.setStorageSync("isVIP", true);
  269. } else {
  270. uni.setStorageSync("isVIP", false);
  271. }
  272. });
  273. //判断是否开启身份选择 是/否
  274. this.$Request.get("/app/common/type/339").then((rest) => {
  275. if (rest.code == 0) {
  276. if (rest.data.value == "是") {
  277. uni.reLaunch({
  278. url: "/pages/public/selectIdentity/selectIdentity",
  279. });
  280. } else {
  281. uni.navigateBack();
  282. }
  283. } else {
  284. uni.navigateBack();
  285. }
  286. });
  287. } else {
  288. uni.navigateTo({
  289. url: "/pages/public/bind",
  290. });
  291. }
  292. });
  293. }
  294. });
  295. } else {
  296. let that = this;
  297. window.location.href =
  298. "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
  299. that.$queue.getWxAppid() +
  300. "&redirect_uri=" +
  301. window.location.href.split("#")[0] +
  302. "&response_type=code&scope=snsapi_userinfo#wechat_redirect";
  303. }
  304. } else {
  305. this.$Request
  306. .getT("/app/Login/openid/login", {
  307. openId: openid,
  308. })
  309. .then((res) => {
  310. if (res.code == 0) {
  311. uni.setStorageSync("token", res.token);
  312. uni.setStorageSync("userName", res.user.userName);
  313. uni.setStorageSync("avatar", res.user.avatar);
  314. uni.setStorageSync("phone", res.user.phone);
  315. uni.setStorageSync("invitationCode", res.user.invitationCode);
  316. this.$queue.setData("inviterCode", res.user.inviterCode);
  317. uni.setStorageSync("sex", res.user.sex);
  318. uni.setStorageSync("userId", res.user.userId);
  319. uni.setStorageSync("openId", res.user.openId);
  320. uni.setStorageSync("userType", res.user.userType);
  321. this.$Request.get("/app/UserVip/isUserVip").then((res) => {
  322. if (res.code == 0 && res.data && res.data.isVip == 2) {
  323. uni.setStorageSync("isVIP", true);
  324. } else {
  325. uni.setStorageSync("isVIP", false);
  326. }
  327. });
  328. //判断是否开启身份选择 是/否
  329. this.$Request.get("/app/common/type/339").then((rest) => {
  330. if (rest.code == 0) {
  331. if (rest.data.value == "是") {
  332. uni.reLaunch({
  333. url: "/pages/public/selectIdentity/selectIdentity",
  334. });
  335. } else {
  336. uni.navigateBack();
  337. }
  338. } else {
  339. uni.navigateBack();
  340. }
  341. });
  342. } else {
  343. uni.navigateTo({
  344. url: "/pages/public/bind",
  345. });
  346. }
  347. });
  348. }
  349. }
  350. },
  351. // wxGetUserInfo(e) {
  352. // if (this.checked) {
  353. // wx.getUserProfile({
  354. // desc: "业务需要",
  355. // success: (infoRes) => {
  356. // console.log(
  357. // "infoRes.encryptedData__________:" + JSON.stringify(infoRes.userInfo)
  358. // );
  359. // let nickName = infoRes.userInfo.nickName; //昵称
  360. // let avatarUrl = infoRes.userInfo.avatarUrl; //头像
  361. // let sex = infoRes.userInfo.gender; //头像
  362. // try {
  363. // this.$queue.showLoading("正在登录中...");
  364. // this.login(nickName, avatarUrl, sex);
  365. // } catch (e) {}
  366. // },
  367. // });
  368. // } else {
  369. // uni.showToast({
  370. // title: "请阅读并同意《隐私协议》和《用户服务协议》",
  371. // icon: "none",
  372. // });
  373. // }
  374. // },
  375. // APP微信登录
  376. wxAppLogin() {
  377. if (!this.checked) {
  378. uni.showToast({
  379. title: "请阅读并同意《隐私协议》和《用户服务协议》",
  380. icon: "none",
  381. });
  382. return;
  383. }
  384. let that = this;
  385. uni.login({
  386. provider: "weixin",
  387. success: function(loginRes) {
  388. console.log(loginRes);
  389. uni.setStorageSync("openId", loginRes.authResult.openid)
  390. uni.setStorageSync("unionId", loginRes.authResult.unionid)
  391. let data = {
  392. wxOpenId: loginRes.authResult.openid,
  393. token: loginRes.authResult.access_token
  394. };
  395. that.$Request.postT("/app/Login/wxAppLogin", data)
  396. .then((res) => {
  397. console.log(res)
  398. if (res.code == 0) {
  399. that.$queue.setData("userId", res.user.userId);
  400. that.$queue.setData("token", res.token);
  401. that.$queue.setData("phone", res.user.phone);
  402. that.$queue.setData("userName", res.user.userName);
  403. that.$queue.setData("avatar", res.user.avatar);
  404. that.$queue.setData("invitationCode", res.user.invitationCode);
  405. that.$queue.setData("inviterCode", res.user.inviterCode);
  406. that.getIsVip();
  407. uni.hideLoading();
  408. that.$queue.setData("userType", res.user.userType);
  409. //判断是否开启身份选择 是/否
  410. that.$Request.get("/app/common/type/339").then((rest) => {
  411. if (rest.code == 0) {
  412. if (rest.data.value == "是") {
  413. // 这里是跳转到选择职场身份的界面
  414. uni.reLaunch({
  415. url: "/pages/public/selectIdentity/selectIdentity",
  416. });
  417. } else {
  418. if (res.user.userType == 2) { //企业
  419. // 原有的。判断第一次根据userType ==null
  420. uni.reLaunch({
  421. url: "/pages/my/index",
  422. });
  423. } else if (res.user.userType == 1) {
  424. uni.reLaunch({
  425. url: "/pages/my/index",
  426. });
  427. } else {
  428. //表示是第一次进来,走引导页
  429. uni.navigateTo({
  430. url: "/pages/my/jobApplicant/guidePage",
  431. });
  432. }
  433. }
  434. } else {
  435. if (res.user.userType == 2) { //企业
  436. // 原有的。判断第一次根据userType ==null
  437. uni.reLaunch({
  438. url: "/pages/my/index",
  439. });
  440. } else if (res.user.userType == 1) {
  441. uni.reLaunch({
  442. url: "/pages/my/index",
  443. });
  444. } else {
  445. //表示是第一次进来,走引导页
  446. uni.navigateTo({
  447. url: "/pages/my/jobApplicant/guidePage",
  448. });
  449. }
  450. }
  451. });
  452. } else {
  453. uni.navigateTo({
  454. url: `/pages/public/loginphone?type=1`,
  455. });
  456. }
  457. })
  458. },
  459. });
  460. },
  461. //小程序登录
  462. login(nickName, avatarUrl, sex) {
  463. if (!this.checked) {
  464. uni.showToast({
  465. title: "请阅读并同意《隐私协议》和《用户服务协议》",
  466. icon: "none",
  467. });
  468. return;
  469. }
  470. let that = this;
  471. // 1.wx获取登录用户code
  472. uni.login({
  473. provider: "weixin",
  474. onlyAuthorize: true,
  475. success: function(loginRes) {
  476. console.log(loginRes, "************");
  477. let data = {
  478. code: loginRes.code,
  479. };
  480. that.$Request.get("/app/Login/wxLogin", data)
  481. .then((res) => {
  482. if (res.code == 0) {
  483. uni.hideLoading();
  484. uni.setStorageSync("openId", res.data.open_id);
  485. uni.setStorageSync("unionId", res.data.unionId);
  486. that.sessionkey = res.data.session_key;
  487. let sendData = {
  488. openId: uni.getStorageSync("openId"),
  489. unionId: uni.getStorageSync("unionId"),
  490. userName: "游客",
  491. avatar: "",
  492. sex: "1", //性别
  493. inviterCode: that.$queue.getData(
  494. "inviterCode"), //别人登录进来携带你的邀请码
  495. };
  496. that.sendDataList = sendData;
  497. that.flag = res.data.flag;
  498. // 第一次登录获取手机号
  499. // console.log(that.phoneNum,'**********************1')
  500. // console.log(that.flag,'**********************2')
  501. if (that.flag == "2" && that.phoneNum) {
  502. that.weixinPhone = true;
  503. } else {
  504. that.getWeixinInfo(sendData);
  505. }
  506. } else {
  507. uni.showToast({
  508. icon: "none",
  509. title: res.msg,
  510. duration: 2000,
  511. });
  512. console.log(res, "失败");
  513. }
  514. })
  515. },
  516. });
  517. },
  518. //小程序微信登录后获取手机号
  519. getPhoneNumber: function(e) {
  520. if (e.detail.errMsg == "getPhoneNumber:fail user deny") {
  521. console.log("用户拒绝提供手机号");
  522. } else {
  523. console.log("用户同意提供手机号");
  524. console.log(e);
  525. this.setPhoneByInsert(e.detail.encryptedData, e.detail.iv);
  526. }
  527. },
  528. //小程序微信登录后获取手机号
  529. setPhoneByInsert(decryptData, iv) {
  530. let data = {
  531. decryptData: decryptData,
  532. key: this.sessionkey,
  533. iv: iv,
  534. };
  535. this.$Request.postJson("/app/Login/selectPhone", data).then((res) => {
  536. if (res.code == 0) {
  537. this.phone = res.data.phoneNumber;
  538. this.getWeixinInfo(this.sendDataList);
  539. } else {
  540. uni.showToast({
  541. title: res.msg,
  542. icon: "none",
  543. duration: 2000,
  544. });
  545. }
  546. });
  547. },
  548. getIsVip() {
  549. this.$Request.get("/app/UserVip/isUserVip").then((res) => {
  550. if (res.code == 0) {
  551. // this.isVip = res.data
  552. console.log(res.data);
  553. this.$queue.setData("isVip", res.data);
  554. }
  555. });
  556. },
  557. //获取个人信息
  558. getWeixinInfo(sendData) {
  559. let that = this;
  560. uni.showLoading({
  561. title: "登录中...",
  562. });
  563. let postData = {
  564. openId: sendData.openId, //小程序openId
  565. unionId: sendData.unionId, //unionId
  566. userName: sendData.userName, //微信名称
  567. avatar: sendData.avatar, //头像
  568. sex: sendData.sex, //性别
  569. phone: that.phone,
  570. inviterCode: sendData.inviterCode,
  571. };
  572. that.$Request.postJson("/app/Login/insertWxUser", postData).then((res) => {
  573. uni.hideLoading();
  574. if (res.code == 0) {
  575. uni.setStorageSync("token", res.token);
  576. uni.setStorageSync("userName", res.user.userName);
  577. uni.setStorageSync("avatar", res.user.avatar);
  578. uni.setStorageSync("phone", res.user.phone);
  579. uni.setStorageSync("invitationCode", res.user.invitationCode);
  580. this.$queue.setData("inviterCode", res.user.inviterCode);
  581. uni.setStorageSync("sex", res.user.sex);
  582. uni.setStorageSync("userId", res.user.userId);
  583. uni.setStorageSync("openId", res.user.openId);
  584. uni.setStorageSync("userType", res.user.userType);
  585. this.$Request.get("/app/UserVip/isUserVip").then((res) => {
  586. if (res.code == 0 && res.data && res.data.isVip == 2) {
  587. uni.setStorageSync("isVIP", true);
  588. } else {
  589. uni.setStorageSync("isVIP", false);
  590. }
  591. });
  592. //判断是否开启身份选择 是/否
  593. this.$Request.get("/app/common/type/339").then((rest) => {
  594. if (rest.code == 0) {
  595. if (rest.data.value == "是") {
  596. uni.reLaunch({
  597. url: "/pages/public/selectIdentity/selectIdentity",
  598. });
  599. } else {
  600. uni.navigateBack();
  601. }
  602. } else {
  603. uni.navigateBack();
  604. }
  605. });
  606. } else {
  607. uni.showModal({
  608. showCancel: false,
  609. title: "登录失败",
  610. content: res.msg,
  611. });
  612. }
  613. });
  614. },
  615. forget() {
  616. uni.navigateTo({
  617. url: "/pages/public/pwd",
  618. });
  619. },
  620. register(type) {
  621. if (!this.checked) {
  622. uni.showToast({
  623. title: "请阅读并同意《隐私协议》和《用户服务协议》",
  624. icon: "none",
  625. });
  626. } else {
  627. uni.navigateTo({
  628. url: `/pages/public/loginphone?type=${type}`,
  629. });
  630. }
  631. },
  632. inputChange(e) {
  633. const key = e.currentTarget.dataset.key;
  634. this[key] = e.detail.value;
  635. },
  636. navBack() {
  637. uni.navigateBack();
  638. },
  639. },
  640. };
  641. </script>
  642. <style lang="scss" scoped>
  643. .login-box {
  644. position: absolute;
  645. left: 0;
  646. right: 0;
  647. top: 0;
  648. bottom: 0;
  649. display: flex;
  650. flex-direction: column;
  651. padding: 0 32rpx;
  652. padding-bottom: 180rpx;
  653. box-sizing: border-box;
  654. }
  655. .logo-box {
  656. flex: 1;
  657. display: flex;
  658. justify-content: center;
  659. align-items: center;
  660. image {
  661. width: 160rpx;
  662. height: 160rpx;
  663. }
  664. }
  665. page {
  666. height: 100%;
  667. background: #ffffff !important;
  668. }
  669. /deep/.u-checkbox__label {
  670. margin-right: 0rpx !important;
  671. }
  672. /deep/.u-checkbox {
  673. padding: 0 !important;
  674. }
  675. .footer {
  676. font-family: DM Sans;
  677. font-size: 16rpx;
  678. font-weight: 400;
  679. letter-spacing: 0%;
  680. text-align: left;
  681. display: flex;
  682. align-items: center;
  683. justify-content: center;
  684. color: #605d67;
  685. margin-top: 16rpx;
  686. navigator {
  687. color: #016bf6;
  688. }
  689. .check-box {
  690. display: flex;
  691. justify-content: center;
  692. align-items: center;
  693. margin-right: 16rpx;
  694. image {
  695. width: 24rpx;
  696. height: 24rpx;
  697. }
  698. }
  699. }
  700. .container {
  701. top: 0;
  702. padding: 50rpx 32rpx;
  703. box-sizing: border-box;
  704. position: relative;
  705. overflow: hidden;
  706. color: #fff;
  707. }
  708. .confirm-btn-weixin {
  709. width: 200px;
  710. height: 42px;
  711. line-height: 42px;
  712. border-radius: 30px;
  713. margin-top: 40upx;
  714. background: -moz-linear-gradient(left, #f15b6c, #e10a07 100%);
  715. background: -webkit-gradient(linear,
  716. left top,
  717. left right,
  718. color-stop(0, #f15b6c),
  719. color-stop(100%, #e10a07));
  720. background: -webkit-linear-gradient(left, #f15b6c 0, #e10a07 100%);
  721. background: -o-linear-gradient(left, #f15b6c 0, #e10a07 100%);
  722. background: -ms-linear-gradient(left, #f15b6c 0, #e10a07 100%);
  723. background: linear-gradient(to left, #f15b6c 0, #e10a07 100%);
  724. color: #fff;
  725. font-size: 32upx;
  726. &:after {
  727. border-radius: 60px;
  728. }
  729. }
  730. .confirm-btn {
  731. width: 200px;
  732. height: 42px;
  733. line-height: 42px;
  734. border-radius: 30px;
  735. margin-top: 300upx;
  736. background: -moz-linear-gradient(left, #f15b6c, #e10a07 100%);
  737. background: -webkit-gradient(linear,
  738. left top,
  739. left right,
  740. color-stop(0, #f15b6c),
  741. color-stop(100%, #e10a07));
  742. background: -webkit-linear-gradient(left, #f15b6c 0, #e10a07 100%);
  743. background: -o-linear-gradient(left, #f15b6c 0, #e10a07 100%);
  744. background: -ms-linear-gradient(left, #f15b6c 0, #e10a07 100%);
  745. background: linear-gradient(to left, #f15b6c 0, #e10a07 100%);
  746. color: #fff;
  747. font-size: 32upx;
  748. &:after {
  749. border-radius: 60px;
  750. }
  751. }
  752. .headers {
  753. text-align: center;
  754. }
  755. .headers>image {
  756. width: 400upx;
  757. height: 400upx;
  758. }
  759. // .footer {
  760. // padding-left: 100upx;
  761. // margin-top: 32upx;
  762. // font-size: 24upx;
  763. // color: #666666;
  764. // text-align: center;
  765. // display: flex;
  766. // }
  767. .login-btn {
  768. padding: 0 32rpx;
  769. box-sizing: border-box;
  770. border-radius: 252rpx;
  771. color: rgba(255, 255, 255, 1) !important;
  772. font-family: DM Sans;
  773. font-size: 32rpx;
  774. font-weight: 400;
  775. line-height: 90rpx;
  776. display: flex;
  777. justify-content: center;
  778. align-items: center;
  779. margin-bottom: 16rpx;
  780. width: 100%;
  781. image {
  782. width: 28rpx;
  783. height: 28rpx;
  784. margin-right: 20rpx;
  785. }
  786. }
  787. .wechat {
  788. background: linear-gradient(90.00deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
  789. }
  790. .password {
  791. background: rgba(1, 107, 246, 1);
  792. }
  793. .disabled {
  794. background: #99c4fa;
  795. }
  796. uni-button[disabled]:not([type]) {
  797. background-color: rgba(1, 107, 246, 1);
  798. }
  799. uni-button:after {
  800. border: none;
  801. }
  802. page {
  803. background: #fff;
  804. }
  805. .send-msg {
  806. border-radius: 30px;
  807. color: black;
  808. background: white;
  809. height: 30px;
  810. font-size: 14px;
  811. line-height: 30px;
  812. }
  813. .container {
  814. top: 0;
  815. padding-top: 32rpx;
  816. position: relative;
  817. width: 100%;
  818. height: 100vh;
  819. overflow: hidden;
  820. background: #ffffff;
  821. color: #fff;
  822. .mp_wxBox {
  823. .headers {
  824. margin: 35% auto 50rpx;
  825. text-align: center;
  826. border-radius: 60rpx;
  827. width: 650rpx;
  828. height: 300rpx;
  829. line-height: 450rpx;
  830. image {
  831. width: 300rpx;
  832. height: 300rpx;
  833. }
  834. }
  835. .content {
  836. text-align: center;
  837. }
  838. text {
  839. display: block;
  840. color: #9d9d9d;
  841. margin-top: 40rpx;
  842. }
  843. .bottom {
  844. line-height: 80upx;
  845. border-radius: 80upx;
  846. margin: 70rpx 50rpx;
  847. height: 80upx;
  848. font-size: 35rpx;
  849. }
  850. }
  851. }
  852. .wrapper {
  853. position: relative;
  854. z-index: 90;
  855. background: #fff;
  856. padding-bottom: 20px;
  857. }
  858. .input-content {
  859. padding: 0 20px;
  860. }
  861. .confirm-btn {
  862. width: 300px;
  863. height: 42px;
  864. line-height: 42px;
  865. border-radius: 30px;
  866. margin-top: 40px;
  867. background: #016bf6;
  868. color: #fff;
  869. // font-size: $font-lg;
  870. &:after {
  871. border-radius: 60px;
  872. }
  873. }
  874. </style>