login_Wechat.vue 25 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070
  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. if (this.userData.tel.length != 11) return uni.showToast({
  577. title: '号码不足11位,请检查',
  578. icon: 'none'
  579. });
  580. this.userData.inpTxt = this.inpTxt
  581. this.userData.majorInpTxt = this.majorInpTxt
  582. this.userData.schName = this.stuName
  583. this.userData.jorName = this.majorName
  584. // return console.log(this.userData);
  585. let oId = uni.getStorageSync('oId')
  586. this.$request('/login', 'POST', this.userData).then(res => {
  587. console.log('注册成功', res);
  588. // 添加消息页面系统通知提示已加入会员
  589. this.addMessage()
  590. this.$request('/selectUser', 'POST', {
  591. oId: oId,
  592. }).then(res => {
  593. this.$store.dispatch('asyncUpdateUser', res[0][0])
  594. uni.switchTab({
  595. url: '/pages/index/index'
  596. })
  597. })
  598. })
  599. },
  600. // 添加消息页面系统通知提示加入会员
  601. addMessage() {
  602. let opid = uni.getStorageSync('oId')
  603. let data = {
  604. oid: opid,
  605. acid: '',
  606. type: 1,
  607. }
  608. this.$request('/insertMessage', "POST", data).then(res => {
  609. console.log(res);
  610. })
  611. },
  612. // 跳转其他登录方式
  613. goto() {
  614. uni.navigateTo({
  615. url: "/pages/login_two/login_two"
  616. })
  617. },
  618. // 勾选取消条约
  619. isDui() {
  620. this.isShow = !this.isShow
  621. },
  622. //获取用户信息(授权)
  623. getImg() {
  624. uni.getUserProfile({
  625. desc: "获取你的昵称、头像、地区及性别",
  626. success: (res) => {
  627. console.log("所有", res);
  628. this.avatarUrl = res.userInfo.avatarUrl; //获取微信头像
  629. },
  630. fail() {}
  631. })
  632. },
  633. getdata() {
  634. this.$request('/selectUserInfo', "POST", {
  635. openid: uni.getStorageSync('oId')
  636. }).then(res => {
  637. console.log('获取渲染数据', res[0][0]);
  638. let data = res[0][0]
  639. console.log(data);
  640. if (!data) {
  641. return
  642. } else {
  643. this.isLogin = true
  644. this.avatarUrl = data.avatar
  645. this.nickname = data.username
  646. }
  647. })
  648. // 获取学院
  649. this.$request('/selectColleges', "get", {}).then(res => {
  650. console.log(res);
  651. this.colleges = res[0]
  652. })
  653. }
  654. },
  655. onLoad() {
  656. this.avatarUrl =
  657. 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0';
  658. this.getdata()
  659. }
  660. }
  661. </script>
  662. <style lang="scss" scoped>
  663. .login_Wechat {
  664. width: 750rpx;
  665. height: 100vh;
  666. background-color: #ffffff;
  667. }
  668. ::v-deep .u-safe-bottom {
  669. display: none;
  670. }
  671. .collpopul {
  672. position: absolute;
  673. padding: 0 30rpx;
  674. background-color: #fff;
  675. top: 10%;
  676. box-shadow: 0rpx 10rpx 10rpx 5rpx rgba(0, 0, 0, .1);
  677. z-index: 100;
  678. width: 650rpx;
  679. height: 90rpx;
  680. left: 50%;
  681. transform: translate(-50%, 0);
  682. border-radius: 30rpx;
  683. display: flex;
  684. align-items: center;
  685. // animation: collpopul 1s cubic-bezier(0,0,0.25,1) forwards;
  686. .contxt {
  687. flex: 1;
  688. font-weight: 580;
  689. font-size: 30rpx;
  690. display: flex;
  691. align-items: center;
  692. image {
  693. padding-right: 10rpx;
  694. }
  695. }
  696. .goMore {
  697. // width: 120rpx;
  698. display: flex;
  699. // height: 35rpx;
  700. height: 100%;
  701. line-height: 30rpx;
  702. align-items: center;
  703. color: #F44265;
  704. font-size: 30rpx;
  705. font-weight: bold;
  706. }
  707. }
  708. @keyframes collpopul {
  709. 0% {
  710. // background: red;
  711. top: 0;
  712. }
  713. 100% {
  714. // background: red;
  715. top: 15%;
  716. }
  717. // 100%{
  718. // opacity: 0;
  719. // }
  720. }
  721. .typyInbtn {
  722. box-sizing: border-box;
  723. padding: 10rpx 60rpx;
  724. border-radius: 10rpx;
  725. color: #fff;
  726. background-color: #0081FE;
  727. }
  728. .typyInbtn2 {
  729. box-sizing: border-box;
  730. padding: 10rpx 20rpx;
  731. border-radius: 10rpx;
  732. display: flex;
  733. justify-content: center;
  734. align-items: center;
  735. background-color: #0081FE;
  736. color: #E7E7E7;
  737. margin-right: 20px;
  738. }
  739. .shade {
  740. position: absolute;
  741. top: 0;
  742. left: 0;
  743. width: 100%;
  744. height: 100%;
  745. // background-color: #0056a8;
  746. z-index: 12;
  747. }
  748. .uni-input {
  749. text-align: right;
  750. }
  751. .stuListSty {
  752. position: absolute;
  753. top: calc(100% + 15rpx);
  754. right: -20rpx;
  755. display: flex;
  756. flex-direction: column;
  757. justify-content: center;
  758. z-index: 12;
  759. background-color: #fff;
  760. border-radius: 20rpx;
  761. box-shadow: 0 0 20rpx 0 #ccc;
  762. padding: 30rpx;
  763. padding-top: 10rpx;
  764. .Usearch {
  765. margin: 20rpx 0;
  766. // background-color: #0056a8;
  767. width: 100%;
  768. display: flex;
  769. align-items: center;
  770. justify-content: flex-start;
  771. .UsearchBtn {
  772. width: 130rpx;
  773. flex-shrink: 0;
  774. display: flex;
  775. justify-content: center;
  776. align-items: center;
  777. // background-color: #0056a8;
  778. // color: #fff;
  779. }
  780. }
  781. }
  782. .list {
  783. position: relative;
  784. // top: calc(100% + 15rpx);
  785. // right: -20rpx;
  786. width: 550rpx;
  787. height: 600rpx;
  788. display: flex;
  789. flex-direction: column;
  790. background-color: #fff;
  791. // padding: 10rpx 15rpx;
  792. border-radius: 20rpx;
  793. // box-shadow: 0 0 20rpx 0 #ccc;
  794. z-index: 11;
  795. .listcon {
  796. width: 100%;
  797. padding: 20rpx 0;
  798. font-size: 28rpx;
  799. border-bottom: 1rpx #e7e7e7 solid;
  800. }
  801. }
  802. .dian {
  803. color: rgba(245, 69, 69, 1);
  804. }
  805. .celTit {
  806. color: rgba(0, 0, 0, 0.8);
  807. }
  808. .icooo {
  809. transform: translate(0, 5rpx);
  810. }
  811. .block {
  812. width: 750rpx;
  813. height: 30vh;
  814. display: flex;
  815. justify-content: center;
  816. align-items: center;
  817. }
  818. .footer {
  819. display: flex;
  820. justify-content: center;
  821. font-size: 28rpx;
  822. margin: auto;
  823. color: #666666;
  824. }
  825. .avatar-wrapper {
  826. width: 200rpx;
  827. height: 200rpx;
  828. padding: 0;
  829. image {
  830. width: 200rpx;
  831. height: 200rpx;
  832. }
  833. }
  834. .inp {
  835. display: flex;
  836. align-items: center;
  837. padding: 0rpx 50rpx;
  838. .nc {
  839. // width: 150rpx;
  840. text-align: left;
  841. }
  842. .weui-input {}
  843. }
  844. .mid {
  845. display: flex;
  846. justify-content: flex-start;
  847. width: 750rpx;
  848. padding: 0rpx 50rpx;
  849. font-size: 13px;
  850. margin-top: 80rpx;
  851. .quan {
  852. position: absolute;
  853. flex-shrink: 0;
  854. top: 0;
  855. left: -10rpx;
  856. width: 32rpx;
  857. height: 32rpx;
  858. border-radius: 50%;
  859. margin-top: 5rpx;
  860. margin-right: 10rpx;
  861. border: 1px #bdbdbd solid;
  862. display: flex;
  863. justify-content: center;
  864. align-items: center;
  865. .dui {
  866. width: 32rpx;
  867. height: 32rpx;
  868. }
  869. }
  870. text {
  871. color: #4a97f2;
  872. }
  873. }
  874. .btn {
  875. background-color: #0056a8;
  876. color: #ffffff;
  877. border-radius: 30px;
  878. margin: 30rpx 55rpx;
  879. // padding: 10rpx 0;
  880. display: flex;
  881. align-items: center;
  882. justify-content: center;
  883. margin-top: 30rpx;
  884. // padding: 0rpx 10rpx;
  885. font-size: 16px;
  886. }
  887. .popupBlock {
  888. position: absolute;
  889. left: 0;
  890. top: 0;
  891. width: 750rpx;
  892. height: 100vh;
  893. background-color: rgba(0, 0, 0, 0.6);
  894. display: flex;
  895. justify-content: center;
  896. align-items: center;
  897. z-index: 10;
  898. .pop {
  899. width: 690rpx;
  900. height: 936rpx;
  901. background-color: #ffffff;
  902. border-radius: 30rpx;
  903. padding: 30rpx;
  904. .poptit {
  905. text-align: center;
  906. height: 48rpx;
  907. line-height: 48rpx;
  908. color: rgba(0, 0, 0, 0.88);
  909. }
  910. .infoTxt {
  911. width: 100%;
  912. height: 448rpx;
  913. margin-top: 40rpx;
  914. margin-bottom: 40rpx;
  915. display: flex;
  916. flex-direction: column;
  917. justify-content: space-between;
  918. .txtcell {
  919. display: flex;
  920. justify-content: space-between;
  921. align-items: center;
  922. border-bottom: 1rpx rgba(231, 231, 231, 1) solid;
  923. padding-bottom: 10rpx;
  924. margin-bottom: 20px;
  925. .inpSty {
  926. right: 0;
  927. bottom: 0;
  928. text-align: right;
  929. }
  930. .pickerBlock {
  931. flex: 1;
  932. display: flex;
  933. justify-content: flex-end;
  934. color: rgba(0, 0, 0, 0.4);
  935. // .uni-input {
  936. // width: 100%;
  937. // height: 100%;
  938. // }
  939. }
  940. }
  941. }
  942. .logbtn2 {
  943. background-color: rgba(0, 86, 168, 1);
  944. width: 580rpx;
  945. height: 88rpx;
  946. border-radius: 60rpx;
  947. display: flex;
  948. justify-content: center;
  949. align-items: center;
  950. color: #fff;
  951. font-size: 36rpx;
  952. margin: 150rpx auto;
  953. margin-bottom: 30rpx;
  954. }
  955. .logbtn {
  956. width: 580rpx;
  957. height: 88rpx;
  958. border-radius: 60rpx;
  959. display: flex;
  960. justify-content: center;
  961. align-items: center;
  962. color: #fff;
  963. font-size: 36rpx;
  964. background-color: rgba(139, 190, 255, 1);
  965. margin: 150rpx auto;
  966. margin-bottom: 30rpx;
  967. }
  968. .logbri {
  969. width: 580rpx;
  970. margin: auto;
  971. text-align: center;
  972. font-size: 24rpx;
  973. color: rgba(48, 129, 232, 1);
  974. }
  975. }
  976. }
  977. </style>