login_Wechat.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083
  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. console.log('aaaaaaaa',aaa);
  430. if (aaa.cid !== null) {
  431. // console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
  432. this.inpTxt = aaa.cid
  433. }
  434. if (aaa.sid !== null) {
  435. this.majorInpTxt = aaa.sid
  436. }
  437. if (aaa.department === '') {
  438. this.stuName = ''
  439. } else {
  440. this.stuName = aaa.department
  441. }
  442. if (aaa.class_name === '') {
  443. this.majorName = ''
  444. } else {
  445. this.majorName = aaa.class_name
  446. }
  447. this.uname = aaa.name
  448. } else {
  449. uni.showToast({
  450. title: '学号/工号暂无查询结果',
  451. icon: 'none',
  452. duration: 1000
  453. })
  454. }
  455. })
  456. },
  457. // 选择用户名称
  458. inpvalue(e) {
  459. this.nickname = e.detail.value
  460. },
  461. rankChange(e) {
  462. // console.log('picker发送选择改变,携带值为', e.detail)
  463. this.userData.rankl = this.rankList[e.detail.value]
  464. },
  465. // 上传图片
  466. onChooseAvatar(e) {
  467. // 获取上传的图片
  468. const {
  469. avatarUrl
  470. } = e.detail
  471. // this.avatarUrl = avatarUrl
  472. // console.log(avatarUrl)
  473. let that = this
  474. const uploadTask = uni.uploadFile({
  475. // url: 'http://127.0.0.1:7334/img', // post请求地址
  476. url: 'https://awsupload.cocorobo.cn/img', // post请求地址
  477. // url: 'https://cxcy.ssti.net.cn/api/UploadFirmFile', // post请求地址
  478. // filePath: tempFilePaths,
  479. filePath: avatarUrl,
  480. name: 'file', // 待确认
  481. header: {
  482. // 不要写这个不然报错
  483. // 'Content-Type': 'multipart/form-data',
  484. },
  485. success: function(res) {
  486. let img = JSON.parse(res.data)
  487. console.log('上传图片', img);
  488. that.avatarUrl = img.fileUrl
  489. },
  490. fail: function(uploadFileFail) {
  491. console.log('Error:', uploadFileFail.data);
  492. },
  493. complete: () => {
  494. // 接口调用结束的回调函数(调用成功、失败都会执行)
  495. // console.log('Complete:');
  496. }
  497. });
  498. // this.avatarUrl = avatarUrl
  499. },
  500. // 手机号一键登录
  501. gotoIndex2() {
  502. uni.getProvider({
  503. service: 'oauth',
  504. success: function(res) {
  505. console.log(res.provider) // ['qq', 'univerify']
  506. }
  507. });
  508. return
  509. uni.preLogin({
  510. provider: 'univerify',
  511. success() { //预登录成功
  512. // 显示一键登录选项
  513. },
  514. fail(res) { // 预登录失败
  515. // 不显示一键登录选项(或置灰)
  516. // 根据错误信息判断失败原因,如有需要可将错误提交给统计服务器
  517. console.log(res.errCode)
  518. console.log(res.errMsg)
  519. }
  520. })
  521. },
  522. // 登录
  523. gotoIndex() {
  524. if (this.avatarUrl ==
  525. 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
  526. ) {
  527. uni.showToast({
  528. title: '请选择头像',
  529. icon: 'error',
  530. duration: 1000
  531. });
  532. return
  533. }
  534. if (!this.isShow) return uni.showToast({
  535. title: '请勾选条约',
  536. icon: 'error',
  537. duration: 1000
  538. });
  539. let oId = uni.getStorageSync('oId')
  540. // 判断是否登录过
  541. if (this.isLogin) {
  542. // console.log('已注册过直接登录', res[0][0]);
  543. // 修改昵称头像
  544. this.$request('/updateUser', "POST", {
  545. openid: oId,
  546. Nme: this.nickname,
  547. avatar: this.avatarUrl
  548. }).then(res => {
  549. // console.log('updateUser', res);
  550. this.$request('/selectUser', 'POST', {
  551. oId: oId,
  552. }).then(res => {
  553. console.log('已注册过直接登录', res[0]);
  554. this.$store.dispatch('asyncUpdateUser', res[0][0])
  555. this.popmsg = true
  556. setTimeout(() => {
  557. uni.switchTab({
  558. url: '/pages/index/index'
  559. })
  560. }, 1000)
  561. })
  562. })
  563. } else {
  564. console.log('还未注册过,开始注册');
  565. this.userData.openid = oId
  566. this.userData.username = this.nickname
  567. this.userData.avatar = this.avatarUrl
  568. return this.popupShow = true
  569. }
  570. },
  571. register() {
  572. // username: '',
  573. // tel: '',
  574. // sch: '请选择',
  575. // spe: '请选择',
  576. if (!this.uname) return uni.showToast({
  577. title: '请输入姓名',
  578. icon: 'none'
  579. });
  580. if (!this.userData.tel) return uni.showToast({
  581. title: '请输入联系方式',
  582. icon: 'none'
  583. });
  584. if (!this.stuName) return uni.showToast({
  585. title: '请输入院校全称',
  586. icon: 'none'
  587. });
  588. if (this.userData.tel.length != 11) return uni.showToast({
  589. title: '号码不足11位,请检查',
  590. icon: 'none'
  591. });
  592. this.userData.inpTxt = this.inpTxt
  593. this.userData.majorInpTxt = this.majorInpTxt
  594. this.userData.username = encodeURIComponent(this.uname)
  595. this.userData.schName = encodeURIComponent(this.stuName)
  596. this.userData.jorName = encodeURIComponent(this.majorName)
  597. // return console.log(this.userData);
  598. let oId = uni.getStorageSync('oId')
  599. this.$request('/login', 'POST', this.userData).then(res => {
  600. console.log('注册成功', res);
  601. // 添加消息页面系统通知提示已加入会员
  602. this.addMessage()
  603. this.$request('/selectUser', 'POST', {
  604. oId: oId,
  605. }).then(res => {
  606. this.$store.dispatch('asyncUpdateUser', res[0][0])
  607. uni.switchTab({
  608. url: '/pages/index/index'
  609. })
  610. })
  611. })
  612. },
  613. // 添加消息页面系统通知提示加入会员
  614. addMessage() {
  615. let opid = uni.getStorageSync('oId')
  616. let data = {
  617. oid: opid,
  618. acid: '',
  619. type: 1,
  620. }
  621. this.$request('/insertMessage', "POST", data).then(res => {
  622. console.log(res);
  623. })
  624. },
  625. // 跳转其他登录方式
  626. goto() {
  627. uni.navigateTo({
  628. url: "/pages/login_two/login_two"
  629. })
  630. },
  631. // 勾选取消条约
  632. isDui() {
  633. this.isShow = !this.isShow
  634. },
  635. //获取用户信息(授权)
  636. getImg() {
  637. uni.getUserProfile({
  638. desc: "获取你的昵称、头像、地区及性别",
  639. success: (res) => {
  640. // console.log("所有", res);
  641. this.avatarUrl = res.userInfo.avatarUrl; //获取微信头像
  642. },
  643. fail() {}
  644. })
  645. },
  646. getdata() {
  647. this.$request('/selectUserInfo', "POST", {
  648. openid: uni.getStorageSync('oId')
  649. }).then(res => {
  650. // console.log('获取渲染数据', res[0][0]);
  651. let data = res[0][0]
  652. // console.log(data);
  653. if (!data) {
  654. return
  655. } else {
  656. this.isLogin = true
  657. this.avatarUrl = data.avatar
  658. this.nickname = data.username
  659. }
  660. })
  661. // 获取学院
  662. this.$request('/selectColleges', "get", {}).then(res => {
  663. // console.log(res);
  664. this.colleges = res[0]
  665. })
  666. }
  667. },
  668. onLoad() {
  669. this.avatarUrl =
  670. 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0';
  671. this.getdata()
  672. }
  673. }
  674. </script>
  675. <style lang="scss" scoped>
  676. .login_Wechat {
  677. width: 750rpx;
  678. height: 100vh;
  679. background-color: #ffffff;
  680. }
  681. ::v-deep .u-safe-bottom {
  682. display: none;
  683. }
  684. .collpopul {
  685. position: absolute;
  686. padding: 0 30rpx;
  687. background-color: #fff;
  688. top: 10%;
  689. box-shadow: 0rpx 10rpx 10rpx 5rpx rgba(0, 0, 0, .1);
  690. z-index: 100;
  691. width: 650rpx;
  692. height: 90rpx;
  693. left: 50%;
  694. transform: translate(-50%, 0);
  695. border-radius: 30rpx;
  696. display: flex;
  697. align-items: center;
  698. // animation: collpopul 1s cubic-bezier(0,0,0.25,1) forwards;
  699. .contxt {
  700. flex: 1;
  701. font-weight: 580;
  702. font-size: 30rpx;
  703. display: flex;
  704. align-items: center;
  705. image {
  706. padding-right: 10rpx;
  707. }
  708. }
  709. .goMore {
  710. // width: 120rpx;
  711. display: flex;
  712. // height: 35rpx;
  713. height: 100%;
  714. line-height: 30rpx;
  715. align-items: center;
  716. color: #F44265;
  717. font-size: 30rpx;
  718. font-weight: bold;
  719. }
  720. }
  721. @keyframes collpopul {
  722. 0% {
  723. // background: red;
  724. top: 0;
  725. }
  726. 100% {
  727. // background: red;
  728. top: 15%;
  729. }
  730. // 100%{
  731. // opacity: 0;
  732. // }
  733. }
  734. .typyInbtn {
  735. box-sizing: border-box;
  736. padding: 10rpx 60rpx;
  737. border-radius: 10rpx;
  738. color: #fff;
  739. background-color: #0081FE;
  740. }
  741. .typyInbtn2 {
  742. box-sizing: border-box;
  743. padding: 10rpx 20rpx;
  744. border-radius: 10rpx;
  745. display: flex;
  746. justify-content: center;
  747. align-items: center;
  748. background-color: #0081FE;
  749. color: #E7E7E7;
  750. margin-right: 20px;
  751. }
  752. .shade {
  753. position: absolute;
  754. top: 0;
  755. left: 0;
  756. width: 100%;
  757. height: 100%;
  758. // background-color: #0056a8;
  759. z-index: 12;
  760. }
  761. .uni-input {
  762. text-align: right;
  763. }
  764. .stuListSty {
  765. position: absolute;
  766. top: calc(100% + 15rpx);
  767. right: -20rpx;
  768. display: flex;
  769. flex-direction: column;
  770. justify-content: center;
  771. z-index: 12;
  772. background-color: #fff;
  773. border-radius: 20rpx;
  774. box-shadow: 0 0 20rpx 0 #ccc;
  775. padding: 30rpx;
  776. padding-top: 10rpx;
  777. .Usearch {
  778. margin: 20rpx 0;
  779. // background-color: #0056a8;
  780. width: 100%;
  781. display: flex;
  782. align-items: center;
  783. justify-content: flex-start;
  784. .UsearchBtn {
  785. width: 130rpx;
  786. flex-shrink: 0;
  787. display: flex;
  788. justify-content: center;
  789. align-items: center;
  790. // background-color: #0056a8;
  791. // color: #fff;
  792. }
  793. }
  794. }
  795. .list {
  796. position: relative;
  797. // top: calc(100% + 15rpx);
  798. // right: -20rpx;
  799. width: 550rpx;
  800. height: 600rpx;
  801. display: flex;
  802. flex-direction: column;
  803. background-color: #fff;
  804. // padding: 10rpx 15rpx;
  805. border-radius: 20rpx;
  806. // box-shadow: 0 0 20rpx 0 #ccc;
  807. z-index: 11;
  808. .listcon {
  809. width: 100%;
  810. padding: 20rpx 0;
  811. font-size: 28rpx;
  812. border-bottom: 1rpx #e7e7e7 solid;
  813. }
  814. }
  815. .dian {
  816. color: rgba(245, 69, 69, 1);
  817. }
  818. .celTit {
  819. color: rgba(0, 0, 0, 0.8);
  820. }
  821. .icooo {
  822. transform: translate(0, 5rpx);
  823. }
  824. .block {
  825. width: 750rpx;
  826. height: 30vh;
  827. display: flex;
  828. justify-content: center;
  829. align-items: center;
  830. }
  831. .footer {
  832. display: flex;
  833. justify-content: center;
  834. font-size: 28rpx;
  835. margin: auto;
  836. color: #666666;
  837. }
  838. .avatar-wrapper {
  839. width: 200rpx;
  840. height: 200rpx;
  841. padding: 0;
  842. image {
  843. width: 200rpx;
  844. height: 200rpx;
  845. }
  846. }
  847. .inp {
  848. display: flex;
  849. align-items: center;
  850. padding: 0rpx 50rpx;
  851. .nc {
  852. // width: 150rpx;
  853. text-align: left;
  854. }
  855. .weui-input {}
  856. }
  857. .mid {
  858. display: flex;
  859. justify-content: flex-start;
  860. width: 750rpx;
  861. padding: 0rpx 50rpx;
  862. font-size: 13px;
  863. margin-top: 80rpx;
  864. .quan {
  865. position: absolute;
  866. flex-shrink: 0;
  867. top: 0;
  868. left: -10rpx;
  869. width: 32rpx;
  870. height: 32rpx;
  871. border-radius: 50%;
  872. margin-top: 5rpx;
  873. margin-right: 10rpx;
  874. border: 1px #bdbdbd solid;
  875. display: flex;
  876. justify-content: center;
  877. align-items: center;
  878. .dui {
  879. width: 32rpx;
  880. height: 32rpx;
  881. }
  882. }
  883. text {
  884. color: #4a97f2;
  885. }
  886. }
  887. .btn {
  888. background-color: #0056a8;
  889. color: #ffffff;
  890. border-radius: 30px;
  891. margin: 30rpx 55rpx;
  892. // padding: 10rpx 0;
  893. display: flex;
  894. align-items: center;
  895. justify-content: center;
  896. margin-top: 30rpx;
  897. // padding: 0rpx 10rpx;
  898. font-size: 16px;
  899. }
  900. .popupBlock {
  901. position: absolute;
  902. left: 0;
  903. top: 0;
  904. width: 750rpx;
  905. height: 100vh;
  906. background-color: rgba(0, 0, 0, 0.6);
  907. display: flex;
  908. justify-content: center;
  909. align-items: center;
  910. z-index: 10;
  911. .pop {
  912. width: 690rpx;
  913. height: 936rpx;
  914. background-color: #ffffff;
  915. border-radius: 30rpx;
  916. padding: 30rpx;
  917. .poptit {
  918. text-align: center;
  919. height: 48rpx;
  920. line-height: 48rpx;
  921. color: rgba(0, 0, 0, 0.88);
  922. }
  923. .infoTxt {
  924. width: 100%;
  925. height: 448rpx;
  926. margin-top: 40rpx;
  927. margin-bottom: 40rpx;
  928. display: flex;
  929. flex-direction: column;
  930. justify-content: space-between;
  931. .txtcell {
  932. display: flex;
  933. justify-content: space-between;
  934. align-items: center;
  935. border-bottom: 1rpx rgba(231, 231, 231, 1) solid;
  936. padding-bottom: 10rpx;
  937. margin-bottom: 20px;
  938. .inpSty {
  939. right: 0;
  940. bottom: 0;
  941. text-align: right;
  942. }
  943. .pickerBlock {
  944. flex: 1;
  945. display: flex;
  946. justify-content: flex-end;
  947. color: rgba(0, 0, 0, 0.4);
  948. // .uni-input {
  949. // width: 100%;
  950. // height: 100%;
  951. // }
  952. }
  953. }
  954. }
  955. .logbtn2 {
  956. background-color: rgba(0, 86, 168, 1);
  957. width: 580rpx;
  958. height: 88rpx;
  959. border-radius: 60rpx;
  960. display: flex;
  961. justify-content: center;
  962. align-items: center;
  963. color: #fff;
  964. font-size: 36rpx;
  965. margin: 150rpx auto;
  966. margin-bottom: 30rpx;
  967. }
  968. .logbtn {
  969. width: 580rpx;
  970. height: 88rpx;
  971. border-radius: 60rpx;
  972. display: flex;
  973. justify-content: center;
  974. align-items: center;
  975. color: #fff;
  976. font-size: 36rpx;
  977. background-color: rgba(139, 190, 255, 1);
  978. margin: 150rpx auto;
  979. margin-bottom: 30rpx;
  980. }
  981. .logbri {
  982. width: 580rpx;
  983. margin: auto;
  984. text-align: center;
  985. font-size: 24rpx;
  986. color: rgba(48, 129, 232, 1);
  987. }
  988. }
  989. }
  990. </style>