login_Wechat.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080
  1. <template>
  2. <view class="login_Wechat">
  3. <statusBar :item='navBarData'></statusBar>
  4. <view class="block">
  5. <button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
  6. <!-- <button class="avatar-wrapper" @click="getImg"> -->
  7. <image class="avatar" :src="avatarUrl" ></image>
  8. </button>
  9. </view>
  10. <view class="collpopul" v-if="popmsg">
  11. <view class="contxt">
  12. <!-- <image :src="i.collAoff?img1:img2" mode="aspectFill" style="width: 30rpx;height: 30rpx;">
  13. </image> -->
  14. 登录成功
  15. <!-- 收藏成功 -->
  16. </view>
  17. </view>
  18. <!-- <view class="inp">
  19. <view class="nc">昵称:</view>
  20. <input type="nickname" class="weui-input" :value="nickname" @blur="inpvalue" placeholder="请输入昵称" />
  21. </view> -->
  22. <view class="mid">
  23. <!-- <radio value="r1" @click="radioCheck" size="10" :checked="isOK" /> -->
  24. <view class="" style="position: relative;padding-left:30rpx;">
  25. 我已阅读并同意<text>《教育小程序服务条款》</text>和 <text>《 隐私协议》</text>新用户自动注册
  26. <view class="quan" @click="isDui">
  27. <image v-if="isShow" class="dui"
  28. src="https://teacherapi.cocorobo.cn/teaching-file/static//yym/dui.png" mode="aspectFill">
  29. </image>
  30. </view>
  31. </view>
  32. </view>
  33. <button class="btn" @click="gotoIndex">一键登录</button>
  34. <!-- <button class="btn" @click="gotoIndex2">一键登录</button> -->
  35. <!-- <view class="footer" @click="goto">
  36. <text>手机号登录/账号密码登录</text>
  37. </view> -->
  38. <view class="popupBlock" v-if="popupShow">
  39. <view class="shade" v-if="allShow" @click="hiddenShade">
  40. </view>
  41. <view class="pop">
  42. <view class="poptit">
  43. 完善信息
  44. </view>
  45. <view class="infoTxt">
  46. <view class="txtcell">
  47. <view class="">
  48. <text class="celTit">学号/工号</text>
  49. </view>
  50. <input @blur="judgeNum" type="number" class="inpSty" maxlength="11" placeholder="输入后自动获取信息"
  51. placeholder-style="font-size: 28rpx; color: rgb(153, 153, 153);" v-model="judgeNumber" />
  52. </view>
  53. <view class="txtcell">
  54. <view class="">
  55. <text class="dian">*</text><text class="celTit">姓名</text>
  56. </view>
  57. <input type="text" class="inpSty" maxlength="10" placeholder="请输入真实姓名"
  58. placeholder-style="font-size: 28rpx; color: rgb(153, 153, 153);"
  59. v-model="userData.username" />
  60. </view>
  61. <view class="txtcell">
  62. <view class="">
  63. <text class="dian">*</text><text class="celTit">联系方式</text>
  64. </view>
  65. <input @blur="handleInput" type="number" class="inpSty" maxlength="11" placeholder="请输入联系方式"
  66. placeholder-style="font-size: 28rpx; color: rgb(153, 153, 153);" v-model="userData.tel" />
  67. </view>
  68. <view class="txtcell">
  69. <view class="" style="width: 100rpx;">
  70. <text class="dian">*</text><text class="celTit">学院</text>
  71. </view>
  72. <view class="pickerBlock" @click="show">
  73. <view class="" style="position: relative;">
  74. <view class="">
  75. {{ !stuName?'请选择学院':stuName }}
  76. </view>
  77. <view class="stuListSty" v-if="isshow">
  78. <view class="Usearch">
  79. <u-search placeholder="搜索学院" :showAction="false" shape="square"
  80. v-model="searchStudent"></u-search>
  81. <view class="UsearchBtn" @click.stop="typeIn(0)">
  82. 手动录入
  83. </view>
  84. </view>
  85. <scroll-view scroll-y="true" show-scrollbar="true" class="list">
  86. <view id="demo1" class="listcon" @click.stop="addStu" :data-item="i"
  87. v-for="(i,index) in colleges" :key="i">{{i.name}}</view>
  88. </scroll-view>
  89. </view>
  90. </view>
  91. <uni-icons type="right" class="icooo" size="20" color='rgba(0, 0, 0, 0.4)'></uni-icons>
  92. </view>
  93. </view>
  94. <view class="txtcell">
  95. <view class="" style="width: 100rpx;">
  96. <text class="celTit">专业</text>
  97. </view>
  98. <view class="pickerBlock" @click="majorshow">
  99. <view class="" style="position: relative;">
  100. <view class="">
  101. {{ !majorName?'请选择专业':majorName }}
  102. </view>
  103. <view class="stuListSty" v-if="jorshow">
  104. <view class="Usearch">
  105. <u-search placeholder="搜索专业" :showAction="false" shape="square"
  106. v-model="searchMajor"></u-search>
  107. <view class="UsearchBtn" @click.stop="typeIn(1)">
  108. 手动录入
  109. </view>
  110. </view>
  111. <scroll-view scroll-y="true" show-scrollbar="true" class="list">
  112. <view class="listcon" v-if="!majorList.length">
  113. 此学院暂时没有专业分类哦
  114. </view>
  115. <view id="demo1" class="listcon" @click.stop="addmajor" :data-jor="i"
  116. v-for="(i,index) in majorList" :key="index">{{i.name}}</view>
  117. </scroll-view>
  118. </view>
  119. </view>
  120. <uni-icons type="right" class="icooo" size="20" color='rgba(0, 0, 0, 0.4)'></uni-icons>
  121. </view>
  122. </view>
  123. <view class="txtcell">
  124. <view class="">
  125. <text class="celTit">职称</text><text
  126. style="color: rgba(0, 0, 0, 0.26);padding-left: 10rpx;">(选填)</text>
  127. </view>
  128. <view class="pickerBlock">
  129. <picker mode="selector" @change="rankChange" :range="rankList">
  130. <view class="uni-input">{{!userData.rankl?'请选择':userData.rankl}}</view>
  131. </picker>
  132. <uni-icons type="right" class="icooo" size="20" color='rgba(0, 0, 0, 0.4)'></uni-icons>
  133. </view>
  134. </view>
  135. </view>
  136. <!-- <view :class="btnColor" @click="register">
  137. 完善信息并登录
  138. </view> -->
  139. <view class="logbtn2" @click="register">
  140. 完善信息并登录
  141. </view>
  142. <view class="logbri">
  143. 完善个人信息后即可加入“丽湖国际双创虚拟教研室”会员,免费获取海量精品资源~
  144. </view>
  145. </view>
  146. </view>
  147. <u-popup :show="popupshow" mode="center" round="10" :closeable='true' @close="popupclose">
  148. <view style="width: 600rpx;box-sizing: border-box;padding: 40px 20rpx; padding-bottom: 30px;">
  149. <view class="" style="display: flex;align-items: center;">
  150. <!-- <text>{{ typyInall?'专业':'学校' }} :</text> -->
  151. <u--input :placeholder="typyInall?'请输入专业':'请输入学院'" border="surround" v-model="typyInCon"></u--input>
  152. </view>
  153. <view style="display: flex;width: 100%;justify-content: space-around;margin-top: 20rpx;">
  154. <view class="typyInbtn" @click="popupclose">
  155. 取消
  156. </view>
  157. <view class="typyInbtn" @click="popupaffirm">
  158. 确定
  159. </view>
  160. </view>
  161. </view>
  162. </u-popup>
  163. </view>
  164. </template>
  165. <script>
  166. export default {
  167. data() {
  168. return {
  169. // 遮罩框
  170. allShow: false,
  171. isLogin: false,
  172. searchStudent: '', //学校搜索栏
  173. searchMajor: '', //专业搜索栏
  174. popmsg: false,
  175. logbtn: 'logbtn',
  176. logbtn2: 'logbtn2',
  177. avatarUrl: '',
  178. nickname: '',
  179. // 学校
  180. isshow: false,
  181. stuName: '', //学校名称
  182. colleges: [], //学校列表
  183. // inpTxt: '', //学校id
  184. // scharray: ['深圳城市××大学', '深圳××大学', '深圳××大学', '深圳××大学'],
  185. // 专业
  186. jorshow: false,
  187. majorList: [],
  188. majorName: '',
  189. // majorInpTxt: '', //专业id
  190. // speList: ['互联网', '网络通信', '航空', '汽修', '珠宝', '文秘', '设计'],
  191. // 职称
  192. rankList: ['教授', '副教授', '讲师', '助教', '其他'],
  193. // 默认头像的
  194. isShow: false,
  195. // 完善信息弹窗的
  196. popupShow: false,
  197. navBarData: {
  198. title: '登录',
  199. btn: 2 //判断是否显示返回按钮
  200. },
  201. btnCol: [],
  202. // 这两个因为要监视,所以不能放对象里面
  203. inpTxt: '', //学校id
  204. majorInpTxt: '', //专业id
  205. // 手动录入弹窗
  206. popupshow: false,
  207. typyInCon: '',
  208. typyInall: 0,
  209. // 第一次登录
  210. // name2:'', //被监视name
  211. // 学号工号
  212. judgeNumber: '',
  213. userData: {
  214. openid: '',
  215. username: '',
  216. avatar: '',
  217. tel: '',
  218. inpTxt: '', //学校id
  219. majorInpTxt: '', //专业id
  220. rankl: '', //职称
  221. schName: '', //学校名字
  222. jorName: '' //专业名字
  223. }
  224. };
  225. },
  226. watch: {
  227. // judgeNumber:{
  228. // handler(val){
  229. // }
  230. // },
  231. searchMajor: {
  232. handler(val) {
  233. // 模糊搜索专业
  234. let data = {
  235. mid: this.inpTxt,
  236. txt: val
  237. }
  238. this.$request('/selectLikeMajors', "get", data).then(res => {
  239. // console.log('模糊搜索专业', res);
  240. this.majorList = res[0]
  241. })
  242. // this.selectMajor(val)
  243. }
  244. },
  245. searchStudent: {
  246. handler(val) {
  247. this.$request('/selectLikeColleges', "get", {
  248. txt: val
  249. }).then(res => {
  250. // console.log(res);
  251. this.colleges = res[0]
  252. })
  253. // this.selectMajor(val)
  254. }
  255. },
  256. inpTxt: {
  257. handler(val) {
  258. // console.log('val', val);
  259. this.selectMajor(val)
  260. }
  261. }
  262. },
  263. methods: {
  264. popupclose() {
  265. this.popupshow = false
  266. this.typyInCon = ''
  267. this.searchStudent = ''
  268. },
  269. popupaffirm() {
  270. if (!this.typyInall) {
  271. if (!this.typyInCon) return uni.showToast({
  272. title: '请输入学院',
  273. icon: 'none',
  274. })
  275. this.stuName = this.typyInCon
  276. this.searchStudent = ''
  277. this.inpTxt = ''
  278. this.majorInpTxt = ''
  279. this.searchMajor = ''
  280. this.majorName = ''
  281. this.popupshow = false
  282. // 赋值完清空
  283. this.typyInCon = ''
  284. } else {
  285. if (!this.typyInCon) return uni.showToast({
  286. title: '请输入专业',
  287. icon: 'none',
  288. })
  289. this.majorName = this.typyInCon
  290. this.majorInpTxt = ''
  291. this.searchMajor = ''
  292. this.popupshow = false
  293. // 赋值完清空
  294. this.typyInCon = ''
  295. }
  296. },
  297. typeIn(e) {
  298. this.hiddenShade()
  299. this.typyInall = e
  300. this.popupshow = true
  301. },
  302. // 遮罩层
  303. hiddenShade() {
  304. this.isshow = false
  305. this.jorshow = false
  306. this.allShow = false
  307. },
  308. // typeInSch(){
  309. // if(!this.searchStudent) return
  310. // this.stuName = this.searchStudent
  311. // this.searchStudent=''
  312. // this.inpTxt=''
  313. // this.majorInpTxt=''
  314. // this.searchMajor=''
  315. // this.majorName=''
  316. // this.hiddenShade()
  317. // },
  318. // typeInMajor(){
  319. // if(!this.searchMajor) return
  320. // this.majorName = this.searchMajor
  321. // this.majorInpTxt=''
  322. // this.searchMajor=''
  323. // this.hiddenShade()
  324. // },
  325. // 学校list显示与隐藏
  326. show() {
  327. this.isshow = true
  328. // this.jorshow = false
  329. this.allShow = true
  330. },
  331. // 选择学校
  332. addStu(e) {
  333. // 选择学校时,将专业的数据清除,让其重新选择
  334. this.majorInpTxt = ''
  335. this.majorName = ''
  336. this.majorList = []
  337. // 为学校选项赋值
  338. let data = e.currentTarget.dataset.item
  339. this.inpTxt = data.id
  340. this.stuName = data.name
  341. // 学校list隐藏/显示
  342. this.isshow = false
  343. // 遮罩层隐藏
  344. this.allShow = false
  345. },
  346. // 专业list显示与隐藏
  347. majorshow() {
  348. // 学校未选择则提示
  349. if (!this.stuName) {
  350. uni.showToast({
  351. title: '请先选择学院',
  352. icon: 'none',
  353. duration: 1000
  354. });
  355. return
  356. }
  357. // 遮罩层显示
  358. this.allShow = true
  359. this.jorshow = true
  360. },
  361. // 选择专业
  362. addmajor(e) {
  363. let data = e.currentTarget.dataset.jor
  364. // console.log('选择专业', e);
  365. this.majorInpTxt = data.id
  366. this.majorName = data.name
  367. // console.log('选择专业', this.majorInpTxt);
  368. this.jorshow = false
  369. this.allShow = false
  370. },
  371. // 根据选择的学校来进行显示专业
  372. selectMajor(e) {
  373. // console.log('根据选择的学院来进行显示专业', e);
  374. let data = {
  375. mid: e
  376. }
  377. this.$request('/selectMajors', "get", data).then(res => {
  378. // console.log('显示专业列表', res);
  379. // if (res[0].length === 0) {
  380. // this.majorList[0] = {
  381. // name: '此学校没有专业分类哦'
  382. // }
  383. // } else {
  384. this.majorList = res[0]
  385. // }
  386. // this.majorList = res[0]
  387. })
  388. },
  389. // 判断手机号
  390. handleInput(e) {
  391. // console.log(e.target);
  392. const {
  393. value
  394. } = e.target
  395. // console.log(value);
  396. const newValue = value.replace(/\s*/g, '') // 只允许输入数字
  397. // console.log(newValue);
  398. // if (newValue.length <= 11) {
  399. this.userData.tel = newValue
  400. // }
  401. // console.log(this.userData.tel);
  402. },
  403. // 失去焦点查询学号工号
  404. judgeNum() {
  405. if (!this.judgeNumber) return
  406. let opid = uni.getStorageSync('oId')
  407. let data = {
  408. txt: this.judgeNumber
  409. }
  410. this.$request('/selectStudentNumber', "Get", data).then(res => {
  411. // console.log('失去焦点查询学号工号', res);
  412. if (res[0].length) {
  413. let aaa = res[0][0]
  414. if (aaa.cid !== null) {
  415. // console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
  416. this.inpTxt = aaa.cid
  417. }
  418. if (aaa.sid !== null) {
  419. this.majorInpTxt = aaa.sid
  420. }
  421. if (aaa.department === '') {
  422. this.stuName = ''
  423. } else {
  424. this.stuName = aaa.department
  425. }
  426. if (aaa.class_name === '') {
  427. this.majorName = ''
  428. } else {
  429. this.majorName = aaa.class_name
  430. }
  431. this.userData.username = aaa.name
  432. } else {
  433. uni.showToast({
  434. title: '学号/工号暂无查询结果',
  435. icon: 'none',
  436. duration: 1000
  437. })
  438. }
  439. })
  440. },
  441. // 选择用户名称
  442. inpvalue(e) {
  443. this.nickname = e.detail.value
  444. },
  445. rankChange(e) {
  446. // console.log('picker发送选择改变,携带值为', e.detail)
  447. this.userData.rankl = this.rankList[e.detail.value]
  448. },
  449. // 上传图片
  450. onChooseAvatar(e) {
  451. // 获取上传的图片
  452. const {
  453. avatarUrl
  454. } = e.detail
  455. // this.avatarUrl = avatarUrl
  456. // console.log(avatarUrl)
  457. let that = this
  458. const uploadTask = uni.uploadFile({
  459. // url: 'http://127.0.0.1:7334/img', // post请求地址
  460. url: 'https://awsupload.cocorobo.cn/img', // post请求地址
  461. // url: 'https://cxcy.ssti.net.cn/api/UploadFirmFile', // post请求地址
  462. // filePath: tempFilePaths,
  463. filePath: avatarUrl,
  464. name: 'file', // 待确认
  465. header: {
  466. // 不要写这个不然报错
  467. // 'Content-Type': 'multipart/form-data',
  468. },
  469. success: function(res) {
  470. let img = JSON.parse(res.data)
  471. console.log('上传图片', img);
  472. that.avatarUrl = img.fileUrl
  473. },
  474. fail: function(uploadFileFail) {
  475. console.log('Error:', uploadFileFail.data);
  476. },
  477. complete: () => {
  478. // 接口调用结束的回调函数(调用成功、失败都会执行)
  479. // console.log('Complete:');
  480. }
  481. });
  482. // this.avatarUrl = avatarUrl
  483. },
  484. // 手机号一键登录
  485. gotoIndex2(){
  486. uni.getProvider({
  487. service: 'oauth',
  488. success: function (res) {
  489. console.log(res.provider)// ['qq', 'univerify']
  490. }
  491. });
  492. return
  493. uni.preLogin({
  494. provider: 'univerify',
  495. success(){ //预登录成功
  496. // 显示一键登录选项
  497. },
  498. fail(res){ // 预登录失败
  499. // 不显示一键登录选项(或置灰)
  500. // 根据错误信息判断失败原因,如有需要可将错误提交给统计服务器
  501. console.log(res.errCode)
  502. console.log(res.errMsg)
  503. }
  504. })
  505. },
  506. // 登录
  507. gotoIndex() {
  508. if (this.avatarUrl ==
  509. 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
  510. ) {
  511. uni.showToast({
  512. title: '请选择头像',
  513. icon: 'error',
  514. duration: 1000
  515. });
  516. return
  517. }
  518. if (!this.isShow) return uni.showToast({
  519. title: '请勾选条约',
  520. icon: 'error',
  521. duration: 1000
  522. });
  523. let oId = uni.getStorageSync('oId')
  524. // 判断是否登录过
  525. if (this.isLogin) {
  526. // console.log('已注册过直接登录', res[0][0]);
  527. // 修改昵称头像
  528. this.$request('/updateUser', "POST", {
  529. openid: oId,
  530. Nme: this.nickname,
  531. avatar: this.avatarUrl
  532. }).then(res => {
  533. // console.log('updateUser', res);
  534. this.$request('/selectUser', 'POST', {
  535. oId: oId,
  536. }).then(res => {
  537. console.log('已注册过直接登录', res[0]);
  538. this.$store.dispatch('asyncUpdateUser', res[0][0])
  539. this.popmsg = true
  540. setTimeout(() => {
  541. uni.switchTab({
  542. url: '/pages/index/index'
  543. })
  544. }, 1000)
  545. })
  546. })
  547. } else {
  548. console.log('还未注册过,开始注册');
  549. this.userData.openid = oId
  550. this.userData.username = this.nickname
  551. this.userData.avatar = this.avatarUrl
  552. return this.popupShow = true
  553. }
  554. },
  555. register() {
  556. // username: '',
  557. // tel: '',
  558. // sch: '请选择',
  559. // spe: '请选择',
  560. if (!this.userData.username) return uni.showToast({
  561. title: '请输入姓名',
  562. icon: 'none'
  563. });
  564. if (!this.userData.tel) return uni.showToast({
  565. title: '请输入联系方式',
  566. icon: 'none'
  567. });
  568. if (!this.stuName) return uni.showToast({
  569. title: '请选择学院',
  570. icon: 'none'
  571. });
  572. // if (this.majorInpTxt == '') return uni.showToast({
  573. // title: '请选择专业',
  574. // icon: 'none'
  575. // });
  576. // var reg = /^1[3|4|5|6|7|8|9][0-9]{9}$/;
  577. // if(!reg.test(this.userData.tel)){
  578. // uni.showToast({
  579. // title: '请输入正确的手机号格式',
  580. // icon: 'none'
  581. // });
  582. // return
  583. // }
  584. // return
  585. if (this.userData.tel.length != 11) return uni.showToast({
  586. title: '号码不足11位,请检查',
  587. icon: 'none'
  588. });
  589. this.userData.inpTxt = this.inpTxt
  590. this.userData.majorInpTxt = this.majorInpTxt
  591. this.userData.username=encodeURIComponent(this.userData.username)
  592. this.userData.schName = encodeURIComponent(this.stuName)
  593. this.userData.jorName = encodeURIComponent(this.majorName)
  594. // return console.log(this.userData);
  595. let oId = uni.getStorageSync('oId')
  596. this.$request('/login', 'POST', this.userData).then(res => {
  597. console.log('注册成功', res);
  598. // 添加消息页面系统通知提示已加入会员
  599. this.addMessage()
  600. this.$request('/selectUser', 'POST', {
  601. oId: oId,
  602. }).then(res => {
  603. this.$store.dispatch('asyncUpdateUser', res[0][0])
  604. uni.switchTab({
  605. url: '/pages/index/index'
  606. })
  607. })
  608. })
  609. },
  610. // 添加消息页面系统通知提示加入会员
  611. addMessage() {
  612. let opid = uni.getStorageSync('oId')
  613. let data = {
  614. oid: opid,
  615. acid: '',
  616. type: 1,
  617. }
  618. this.$request('/insertMessage', "POST", data).then(res => {
  619. console.log(res);
  620. })
  621. },
  622. // 跳转其他登录方式
  623. goto() {
  624. uni.navigateTo({
  625. url: "/pages/login_two/login_two"
  626. })
  627. },
  628. // 勾选取消条约
  629. isDui() {
  630. this.isShow = !this.isShow
  631. },
  632. //获取用户信息(授权)
  633. getImg() {
  634. uni.getUserProfile({
  635. desc: "获取你的昵称、头像、地区及性别",
  636. success: (res) => {
  637. // console.log("所有", res);
  638. this.avatarUrl = res.userInfo.avatarUrl; //获取微信头像
  639. },
  640. fail() {}
  641. })
  642. },
  643. getdata() {
  644. this.$request('/selectUserInfo', "POST", {
  645. openid: uni.getStorageSync('oId')
  646. }).then(res => {
  647. // console.log('获取渲染数据', res[0][0]);
  648. let data = res[0][0]
  649. // console.log(data);
  650. if (!data) {
  651. return
  652. } else {
  653. this.isLogin = true
  654. this.avatarUrl = data.avatar
  655. this.nickname = data.username
  656. }
  657. })
  658. // 获取学院
  659. this.$request('/selectColleges', "get", {}).then(res => {
  660. // console.log(res);
  661. this.colleges = res[0]
  662. })
  663. }
  664. },
  665. onLoad() {
  666. this.avatarUrl =
  667. 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0';
  668. this.getdata()
  669. }
  670. }
  671. </script>
  672. <style lang="scss" scoped>
  673. .login_Wechat {
  674. width: 750rpx;
  675. height: 100vh;
  676. background-color: #ffffff;
  677. }
  678. ::v-deep .u-safe-bottom {
  679. display: none;
  680. }
  681. .collpopul {
  682. position: absolute;
  683. padding: 0 30rpx;
  684. background-color: #fff;
  685. top: 10%;
  686. box-shadow: 0rpx 10rpx 10rpx 5rpx rgba(0, 0, 0, .1);
  687. z-index: 100;
  688. width: 650rpx;
  689. height: 90rpx;
  690. left: 50%;
  691. transform: translate(-50%, 0);
  692. border-radius: 30rpx;
  693. display: flex;
  694. align-items: center;
  695. // animation: collpopul 1s cubic-bezier(0,0,0.25,1) forwards;
  696. .contxt {
  697. flex: 1;
  698. font-weight: 580;
  699. font-size: 30rpx;
  700. display: flex;
  701. align-items: center;
  702. image {
  703. padding-right: 10rpx;
  704. }
  705. }
  706. .goMore {
  707. // width: 120rpx;
  708. display: flex;
  709. // height: 35rpx;
  710. height: 100%;
  711. line-height: 30rpx;
  712. align-items: center;
  713. color: #F44265;
  714. font-size: 30rpx;
  715. font-weight: bold;
  716. }
  717. }
  718. @keyframes collpopul {
  719. 0% {
  720. // background: red;
  721. top: 0;
  722. }
  723. 100% {
  724. // background: red;
  725. top: 15%;
  726. }
  727. // 100%{
  728. // opacity: 0;
  729. // }
  730. }
  731. .typyInbtn {
  732. box-sizing: border-box;
  733. padding: 10rpx 60rpx;
  734. border-radius: 10rpx;
  735. color: #fff;
  736. background-color: #0081FE;
  737. }
  738. .typyInbtn2 {
  739. box-sizing: border-box;
  740. padding: 10rpx 20rpx;
  741. border-radius: 10rpx;
  742. display: flex;
  743. justify-content: center;
  744. align-items: center;
  745. background-color: #0081FE;
  746. color: #E7E7E7;
  747. margin-right: 20px;
  748. }
  749. .shade {
  750. position: absolute;
  751. top: 0;
  752. left: 0;
  753. width: 100%;
  754. height: 100%;
  755. // background-color: #0056a8;
  756. z-index: 12;
  757. }
  758. .uni-input {
  759. text-align: right;
  760. }
  761. .stuListSty {
  762. position: absolute;
  763. top: calc(100% + 15rpx);
  764. right: -20rpx;
  765. display: flex;
  766. flex-direction: column;
  767. justify-content: center;
  768. z-index: 12;
  769. background-color: #fff;
  770. border-radius: 20rpx;
  771. box-shadow: 0 0 20rpx 0 #ccc;
  772. padding: 30rpx;
  773. padding-top: 10rpx;
  774. .Usearch {
  775. margin: 20rpx 0;
  776. // background-color: #0056a8;
  777. width: 100%;
  778. display: flex;
  779. align-items: center;
  780. justify-content: flex-start;
  781. .UsearchBtn {
  782. width: 130rpx;
  783. flex-shrink: 0;
  784. display: flex;
  785. justify-content: center;
  786. align-items: center;
  787. // background-color: #0056a8;
  788. // color: #fff;
  789. }
  790. }
  791. }
  792. .list {
  793. position: relative;
  794. // top: calc(100% + 15rpx);
  795. // right: -20rpx;
  796. width: 550rpx;
  797. height: 600rpx;
  798. display: flex;
  799. flex-direction: column;
  800. background-color: #fff;
  801. // padding: 10rpx 15rpx;
  802. border-radius: 20rpx;
  803. // box-shadow: 0 0 20rpx 0 #ccc;
  804. z-index: 11;
  805. .listcon {
  806. width: 100%;
  807. padding: 20rpx 0;
  808. font-size: 28rpx;
  809. border-bottom: 1rpx #e7e7e7 solid;
  810. }
  811. }
  812. .dian {
  813. color: rgba(245, 69, 69, 1);
  814. }
  815. .celTit {
  816. color: rgba(0, 0, 0, 0.8);
  817. }
  818. .icooo {
  819. transform: translate(0, 5rpx);
  820. }
  821. .block {
  822. width: 750rpx;
  823. height: 30vh;
  824. display: flex;
  825. justify-content: center;
  826. align-items: center;
  827. }
  828. .footer {
  829. display: flex;
  830. justify-content: center;
  831. font-size: 28rpx;
  832. margin: auto;
  833. color: #666666;
  834. }
  835. .avatar-wrapper {
  836. width: 200rpx;
  837. height: 200rpx;
  838. padding: 0;
  839. image {
  840. width: 200rpx;
  841. height: 200rpx;
  842. }
  843. }
  844. .inp {
  845. display: flex;
  846. align-items: center;
  847. padding: 0rpx 50rpx;
  848. .nc {
  849. // width: 150rpx;
  850. text-align: left;
  851. }
  852. .weui-input {}
  853. }
  854. .mid {
  855. display: flex;
  856. justify-content: flex-start;
  857. width: 750rpx;
  858. padding: 0rpx 50rpx;
  859. font-size: 13px;
  860. margin-top: 80rpx;
  861. .quan {
  862. position: absolute;
  863. flex-shrink: 0;
  864. top: 0;
  865. left: -10rpx;
  866. width: 32rpx;
  867. height: 32rpx;
  868. border-radius: 50%;
  869. margin-top: 5rpx;
  870. margin-right: 10rpx;
  871. border: 1px #bdbdbd solid;
  872. display: flex;
  873. justify-content: center;
  874. align-items: center;
  875. .dui {
  876. width: 32rpx;
  877. height: 32rpx;
  878. }
  879. }
  880. text {
  881. color: #4a97f2;
  882. }
  883. }
  884. .btn {
  885. background-color: #0056a8;
  886. color: #ffffff;
  887. border-radius: 30px;
  888. margin: 30rpx 55rpx;
  889. // padding: 10rpx 0;
  890. display: flex;
  891. align-items: center;
  892. justify-content: center;
  893. margin-top: 30rpx;
  894. // padding: 0rpx 10rpx;
  895. font-size: 16px;
  896. }
  897. .popupBlock {
  898. position: absolute;
  899. left: 0;
  900. top: 0;
  901. width: 750rpx;
  902. height: 100vh;
  903. background-color: rgba(0, 0, 0, 0.6);
  904. display: flex;
  905. justify-content: center;
  906. align-items: center;
  907. z-index: 10;
  908. .pop {
  909. width: 690rpx;
  910. height: 936rpx;
  911. background-color: #ffffff;
  912. border-radius: 30rpx;
  913. padding: 30rpx;
  914. .poptit {
  915. text-align: center;
  916. height: 48rpx;
  917. line-height: 48rpx;
  918. color: rgba(0, 0, 0, 0.88);
  919. }
  920. .infoTxt {
  921. width: 100%;
  922. height: 448rpx;
  923. margin-top: 40rpx;
  924. margin-bottom: 40rpx;
  925. display: flex;
  926. flex-direction: column;
  927. justify-content: space-between;
  928. .txtcell {
  929. display: flex;
  930. justify-content: space-between;
  931. align-items: center;
  932. border-bottom: 1rpx rgba(231, 231, 231, 1) solid;
  933. padding-bottom: 10rpx;
  934. margin-bottom: 20px;
  935. .inpSty {
  936. right: 0;
  937. bottom: 0;
  938. text-align: right;
  939. }
  940. .pickerBlock {
  941. flex: 1;
  942. display: flex;
  943. justify-content: flex-end;
  944. color: rgba(0, 0, 0, 0.4);
  945. // .uni-input {
  946. // width: 100%;
  947. // height: 100%;
  948. // }
  949. }
  950. }
  951. }
  952. .logbtn2 {
  953. background-color: rgba(0, 86, 168, 1);
  954. width: 580rpx;
  955. height: 88rpx;
  956. border-radius: 60rpx;
  957. display: flex;
  958. justify-content: center;
  959. align-items: center;
  960. color: #fff;
  961. font-size: 36rpx;
  962. margin: 150rpx auto;
  963. margin-bottom: 30rpx;
  964. }
  965. .logbtn {
  966. width: 580rpx;
  967. height: 88rpx;
  968. border-radius: 60rpx;
  969. display: flex;
  970. justify-content: center;
  971. align-items: center;
  972. color: #fff;
  973. font-size: 36rpx;
  974. background-color: rgba(139, 190, 255, 1);
  975. margin: 150rpx auto;
  976. margin-bottom: 30rpx;
  977. }
  978. .logbri {
  979. width: 580rpx;
  980. margin: auto;
  981. text-align: center;
  982. font-size: 24rpx;
  983. color: rgba(48, 129, 232, 1);
  984. }
  985. }
  986. }
  987. </style>