login_Wechat.vue 26 KB

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