reset.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823
  1. <template>
  2. <view class="container">
  3. <view class="back-btn cuIcon-back" @click="navBack"></view>
  4. <!-- 设置白色背景防止软键盘把下部绝对定位元素顶上来盖住输入框等 -->
  5. <view class="wrapper">
  6. <h2>重置密码</h2>
  7. <view style='width:100%;margin-top:50px;border-bottom:1px solid #E8E9ED;padding:10px;' class="flex">
  8. <view style='width:15%;border-right:1px solid #E8E9ED;'>+86</view>
  9. <view style='width:85%;'><input maxlength="11" @input='phoneinput' style='padding-left:10px;' v-model='phone' placeholder="请输入手机号码" type="text"></view>
  10. </view>
  11. <view style='width:100%;border-bottom:1px solid #E8E9ED;position:relative;padding:10px;' class="flex">
  12. <view style='width:85%;'><input v-model='verifyCode' placeholder="请输入验证码" type="text"></view>
  13. <button @click='getcode' :class='status&&!sendDisabled?"active":""' class='getcode'>{{sendText}}</button>
  14. </view>
  15. <view style='border-bottom:1px solid #E8E9ED;padding:10px;position:relative;'>
  16. <input class='password' style='height:30px;' v-model='password' placeholder="请输入新密码,6-16位字符" :type="type" value="" />
  17. <view @click='switchover' style='position:absolute;right:0;top:38%;z-index:10;cursor:pointer;' class="iconfont " :class='type=="password"?"icon-yanjing-biyan":"icon-yanjing-zhengyan"'></view>
  18. </view>
  19. <button :class='phone!=""&&verifyCode!=""&&password!=""?"active":""' @click='reset' class='verificationCode'>重置密码</button>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import {
  25. mapMutations
  26. } from 'vuex';
  27. import { openFSqlite, createFSQL, selectFSQL, addFSQL } from '../../util/f.js'
  28. import { queryData, upData, initData } from '../../util/dbUtil.js'
  29. export default {
  30. data() {
  31. return {
  32. inputContent: null,
  33. loginType: "wechat",
  34. phone: '',
  35. password: '',
  36. logining: false,
  37. isPhone: false,
  38. isApple: true,
  39. accessToken:'',
  40. params:{
  41. encryptedData:'',
  42. session_key:'',
  43. iv:'',
  44. },
  45. status:false,
  46. userInfo:{
  47. nickName:'',
  48. avatarUrl:'',
  49. gender:'',
  50. phone:''
  51. },
  52. consentStatus:false,
  53. type:'password',
  54. inputStatus:'none',
  55. verifyCode:null,
  56. sendText:'获取验证码',
  57. sendDisabled: false,
  58. system:'',
  59. platform:'',
  60. userData:undefined,
  61. canIUseProfile:false
  62. }
  63. },
  64. onShow() {
  65. // this.loginType = "wechat"
  66. this.$api.logout()
  67. },
  68. onLoad(options) {
  69. if( wx.getUserProfile ){
  70. console.log('--check getUserProfile--OK');
  71. this.canIUseProfile = true;
  72. }
  73. console.log("login on load")
  74. var that = this
  75. that.$api.request('user', 'sendIsApple', {
  76. }).then(res => {
  77. that.isApple = res.data
  78. })
  79. uni.getSystemInfo({
  80. success:(res) => {
  81. // console.log(res)
  82. this.system = res.system // ios
  83. this.platform = res.platform // 14.3
  84. }
  85. })
  86. },
  87. methods: {
  88. phoneinput(e){
  89. if(e.detail.value.length==11){
  90. this.status=true
  91. }
  92. },
  93. getcode(e){
  94. if(this.phone.length!=11){
  95. uni.showToast({
  96. title: '请输入正确的手机号',
  97. icon:'none',
  98. duration: 2000
  99. })
  100. return
  101. }
  102. if(/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.phone)){
  103. var that=this
  104. this.$api.doRequest('get','/commonUser/sendVerifyCode',{phone:this.phone}).then(res => {
  105. that.sendDisabled = true
  106. let sec = 60
  107. let interval = setInterval(() => {
  108. sec--;
  109. that.sendText = sec + 's后重发'
  110. if (sec <= 0) {
  111. that.sendDisabled = false
  112. that.sendText = "获取验证码"
  113. clearInterval(interval)
  114. }
  115. }, 1000)
  116. })
  117. .catch(res => {
  118. uni.showToast({
  119. title: res.errMsg,
  120. icon:'none',
  121. duration: 2000
  122. })
  123. });
  124. }else{
  125. uni.showToast({
  126. title: '请输入正确的手机号',
  127. icon:'none',
  128. duration: 2000
  129. })
  130. }
  131. },
  132. reset(){
  133. var that = this
  134. this.$api.doRequest('post','/commonUser/resetPassword',{phone:this.phone,password:this.password,verifyCode:this.verifyCode}).then(res => {
  135. // 获得数据
  136. if(res.data.code==200){
  137. var that=this
  138. uni.showLoading({
  139. title: '登录中',
  140. mask:true
  141. })
  142. this.$api.doRequest('get','/commonUser/login',{phone:this.phone,password:this.password}).then(req => {
  143. if(res.data.code==200){
  144. this.$api.doRequest('post','/auth/api/loginEnhanced',{companyName: "佳屹农",
  145. password: "y123456",
  146. username: "jyn"}).then(res1 => {
  147. uni.setStorageSync('pcUserInfo', res1.data.data)
  148. })
  149. uni.setStorageSync('userInfo', req.data.data)
  150. that.$store.commit('login', req.data.data)
  151. // that.liangxinLogin()
  152. uni.switchTab({
  153. url: '/pages/sale/information'
  154. });
  155. uni.hideLoading()
  156. }else{
  157. uni.showToast({
  158. title: res.data.message,
  159. icon:'none',
  160. duration: 2000
  161. })
  162. }
  163. })
  164. .catch(res => {
  165. uni.showToast({
  166. title: res.data.message,
  167. icon:'none',
  168. duration: 2000
  169. })
  170. });
  171. }else{
  172. uni.showToast({
  173. title: res.data.message,
  174. icon:'none',
  175. duration: 2000
  176. })
  177. }
  178. uni.showLoading({
  179. title: '登录中',
  180. mask:true
  181. })
  182. })
  183. .catch(res => {
  184. uni.showToast({
  185. title: res.data.message,
  186. icon:'none',
  187. duration: 2000
  188. })
  189. });
  190. },
  191. consent(){
  192. this.consentStatus=!this.consentStatus
  193. uni.setStorage({
  194. key: 'policyStorageKey',
  195. data: this.consentStatus
  196. });
  197. },
  198. switchover(){
  199. if(this.type=='password'){
  200. this.type='text'
  201. }else{
  202. this.type='password'
  203. }
  204. },
  205. gocode(){
  206. uni.navigateTo({
  207. url:'/pages/public/login'
  208. })
  209. },
  210. forgetpass(){
  211. uni.navigateTo({
  212. url:'/pages/public/reset'
  213. })
  214. },
  215. cancel() {
  216. this.inputShow = false
  217. this.inputStatus = 'none'
  218. this.isPhone = false
  219. },
  220. ...mapMutations(['login']),
  221. inputChange(e) {
  222. const key = e.currentTarget.dataset.key;
  223. this[key] = e.detail.value;
  224. },
  225. chooseLoginType(type) {
  226. this.loginType = type
  227. },
  228. navBack() {
  229. uni.navigateBack();
  230. },
  231. toRegist() {
  232. uni.redirectTo({
  233. url: '/pages/public/register'
  234. })
  235. },
  236. ///发起消息订阅
  237. requestSubscribe(){
  238. const that = this
  239. wx.requestSubscribeMessage({
  240. tmplIds: ['xL_uZEqJz4QP1FbnlzQWAiO2zVBn3Qeu8JwLVOU3hU0','8cVkckXi_8zfHeScXRHhjN6cgZFYYCWIMPDTiPWagXY','IE7WxBsv-fDvPWSrng-97lGWtvZf9rHuECBlhRLlWxI'],//
  241. success :(res)=>{
  242. console.log("订阅消息 成功 "+res);
  243. },
  244. fail :(errMsg) =>{
  245. console.log("订阅消息 失败 "+errMsg.errMsg);
  246. },
  247. complete:(errMsg)=>{
  248. console.log("订阅消息 完成 "+errMsg);
  249. }
  250. });
  251. },
  252. getPhoneNumber(e) {
  253. console.log(e)
  254. if (e.mp.detail.errMsg==="getPhoneNumber:ok") {
  255. this.isPhone = false
  256. this.params.iv = e.mp.detail.iv
  257. this.params.encryptedData = e.mp.detail.encryptedData
  258. this.params.session_key = this.accessToken
  259. console.log(this.params)
  260. this.getTokenAsync(this.params)
  261. }
  262. },
  263. // 请求后获取token
  264. async getTokenAsync(params) {
  265. let that = this
  266. this.$api.request('user', 'getPhoneNumber', params).then(res => {
  267. if(res.data.phoneNumber){
  268. that.userInfo.phone = res.data.phoneNumber
  269. }
  270. if(res.data.unionId){
  271. that.userInfo.unionId = res.data.unionId
  272. }
  273. that.userInfo.cid = uni.getStorageSync("clientId")
  274. console.log(that.userInfo)
  275. that.$api.request('user', 'syncUserInfo', that.userInfo).then(syncRes => {
  276. uni.setStorageSync('userInfo', that.userInfo)
  277. that.$store.commit('login', that.userInfo)
  278. that.$api.setUserInfo(that.userInfo)
  279. uni.hideLoading()
  280. // that.liangxinLogin()
  281. })
  282. if(res.data.phoneNumber){
  283. uni.switchTab({
  284. url: '/pages/sale/information'
  285. });
  286. }
  287. })
  288. },
  289. async toLogin() {
  290. this.verifyCode = ''
  291. const that = this
  292. if (that.phone.length !== 11) {
  293. that.$api.msg('请输入11位中国手机号')
  294. } else if (that.password.length < 8) {
  295. that.$api.msg('密码至少8位')
  296. } else {
  297. that.logining = true;
  298. //#ifdef MP-WEIXIN
  299. //若是小程序平台,则获取到openId。整个过程是静默完成的
  300. uni.login({
  301. provider: 'weixin',
  302. success: (wxres => {
  303. that.$api.request('user', 'login', {
  304. phone: that.phone,
  305. password: that.password,
  306. loginType: 1,
  307. raw: JSON.stringify(wxres)
  308. }, failres => {
  309. that.logining = false
  310. uni.showToast({
  311. title: failres.errmsg,
  312. icon: "none"
  313. });
  314. }).then(res => {
  315. that.logining = false
  316. that.$store.commit('login', res.data)
  317. uni.setStorageSync('userInfo', res.data)
  318. if (that.$api.prePage().lodaData) {
  319. that.$api.prePage().loadData()
  320. }
  321. uni.navigateBack()
  322. })
  323. })
  324. })
  325. //#endif
  326. //#ifdef APP-PLUS || H5
  327. //若是App登录,则不需要保存OpenId。可直接登录
  328. that.$api.request('user', 'login', {
  329. phone: that.phone,
  330. password: that.password,
  331. }, failres => {
  332. that.logining = false
  333. uni.showToast({
  334. title: failres.errmsg,
  335. icon: "none"
  336. });
  337. }).then(res => {
  338. that.logining = false
  339. that.$store.commit('login', res.data)
  340. uni.setStorageSync('userInfo', res.data)
  341. if (that.$api.prePage().lodaData) {
  342. that.$api.prePage().loadData()
  343. }
  344. uni.navigateBack()
  345. })
  346. //#endif
  347. }
  348. },
  349. miniWechatLogin(e) {
  350. const that = this
  351. //旧版本方式
  352. if( this.canIUseProfile == false ){
  353. console.log("旧版本方式")
  354. //获取授权信息
  355. if(e.detail.userInfo){
  356. console.log('用户允许了授权')
  357. console.log( e.detail.userInfo ); //1.拿到基本的微信信息!!
  358. uni.showLoading({
  359. title: '加载中',
  360. mask:true
  361. })
  362. that.logining = true
  363. let loginType = 1
  364. let userInfo = e.detail.userInfo
  365. uni.login({
  366. provider: 'weixin',
  367. success: (wxres => {
  368. that.logining = false
  369. that.$api.request('user', 'thirdPartLogin', {
  370. loginType: loginType,
  371. raw: JSON.stringify(wxres)
  372. }, failres => {
  373. that.$api.msg(failres.errmsg)
  374. uni.hideLoading()
  375. }).then(res => {
  376. that.accessToken = res.data.accessToken
  377. that.$api.setUserInfo(res.data)
  378. that.userInfo = res.data
  379. uni.getUserInfo({
  380. lang: 'zh_CN',
  381. provider: 'weixin',
  382. withCredentials:true,
  383. success: (e) => {
  384. that.params.iv = e.iv
  385. that.params.encryptedData = e.encryptedData
  386. that.params.session_key = that.accessToken
  387. console.log(this.params)
  388. that.getTokenAsync(this.params)
  389. uni.setStorageSync('userInfo', res.data)
  390. that.$store.commit('login', res.data)
  391. e.userInfo.nickname = e.userInfo.nickName
  392. if(e.userInfo.phone == undefined){
  393. e.userInfo.phone = ''
  394. }
  395. e.userInfo.cid = uni.getStorageSync("clientId")
  396. console.log(e.userInfo)
  397. that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
  398. //同步过后
  399. res.data.nickname = userInfo.nickName
  400. res.data.avatarUrl = userInfo.avatarUrl
  401. res.data.gender = userInfo.gender
  402. if(userInfo.phone){
  403. res.data.phone = userInfo.phone
  404. // that.liangxinLogin()
  405. }
  406. uni.setStorageSync('userInfo', res.data)
  407. that.$store.commit('login', res.data)
  408. that.$api.setUserInfo(res.data)
  409. uni.hideLoading()
  410. // uni.navigateBack()
  411. })
  412. },
  413. complete: (e) => {
  414. uni.hideLoading()
  415. if(!res.data.phone||res.data.phone==""||res.data.phone ==undefined){
  416. that.isPhone = true//显示自定义的获取手机权限提示框
  417. that.inputStatus = 'inline'
  418. that.inputContent = ''
  419. }
  420. else{
  421. uni.setStorageSync('PageCur', "sale");
  422. // uni.switchTab({
  423. // url: '/pages/sale/sale'
  424. // });
  425. uni.switchTab({
  426. url: '/pages/sale/information'
  427. });
  428. console.log("complete")
  429. }
  430. }
  431. })
  432. })
  433. }),
  434. })
  435. }
  436. //新版本方式
  437. }else{
  438. console.log("新版本方式")
  439. uni.showLoading({
  440. title: '加载中',
  441. mask:true
  442. })
  443. that.logining = true
  444. let loginType = 1
  445. wx.getUserProfile({
  446. desc : '用于完善用户资料',
  447. lang : 'zh_CN',
  448. success : function( proRes ){
  449. console.log('proRes.userInfo',proRes.userInfo)
  450. uni.login({
  451. provider: 'weixin',
  452. success: (wxres => {
  453. that.logining = false
  454. that.$api.request('user', 'thirdPartLogin', {
  455. loginType: loginType,
  456. raw: JSON.stringify(wxres)
  457. }, failres => {
  458. that.$api.msg(failres.errmsg)
  459. uni.hideLoading()
  460. }).then(res => {
  461. console.log('res+++++',res)
  462. that.accessToken = res.data.accessToken
  463. that.$api.setUserInfo(res.data)
  464. that.userInfo = res.data
  465. // that.params.iv = proRes.iv
  466. // that.params.encryptedData = proRes.encryptedData
  467. // that.params.session_key = that.accessToken
  468. // console.log(that.params)
  469. // that.getTokenAsync(that.params)
  470. uni.setStorageSync('userInfo', res.data)
  471. that.$store.commit('login', res.data)
  472. if(proRes.userInfo.phone == undefined){
  473. proRes.userInfo.phone = ''
  474. }
  475. res.data.cid = uni.getStorageSync("clientId")
  476. that.$api.request('user', 'syncUserInfo', res.data).then(syncRes => {
  477. //同步过后
  478. res.data.nickname = proRes.userInfo.nickName
  479. res.data.avatarUrl = proRes.userInfo.avatarUrl
  480. res.data.gender = proRes.userInfo.gender
  481. if(proRes.userInfo.phone){
  482. res.data.phone = proRes.userInfo.phone
  483. }
  484. uni.setStorageSync('userInfo', res.data)
  485. that.$store.commit('login', res.data)
  486. that.$api.setUserInfo(res.data)
  487. uni.hideLoading()
  488. if(!that.userInfo.phone||that.userInfo.phone==""||that.userInfo.phone ==undefined){
  489. that.isPhone = true//显示自定义的获取手机权限提示框
  490. that.inputStatus = 'inline'
  491. that.inputContent = ''
  492. }
  493. else{
  494. uni.setStorageSync('PageCur', "sale");
  495. // uni.switchTab({
  496. // url: '/pages/sale/sale'
  497. // });
  498. uni.reLaunch({
  499. url: '/pages/sale/information'
  500. });
  501. console.log("complete")
  502. // that.liangxinLogin()
  503. }
  504. })
  505. console.log( 'wx.getUserProfile=>用户允许了授权' );
  506. })
  507. })
  508. })
  509. },
  510. fail : function( res ){
  511. console.log('wx.getUserProfile=>用户拒绝了授权');
  512. console.log( res );
  513. }
  514. });
  515. }
  516. // 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问”
  517. // wx.getSetting({
  518. // withSubscriptions: true,//是否获取用户订阅消息的订阅状态,默认false不返回
  519. // success(res){
  520. // debugger
  521. // if(res.subscriptionsSetting.mainSwitch){
  522. // }else{
  523. // }
  524. // }
  525. // })
  526. // uni.showModal({
  527. // title: '温馨提示',
  528. // content: '为更好的与您沟通,小程序需要向您发送通知消息',
  529. // confirmText:"同意",
  530. // cancelText:"拒绝",
  531. // showCancel: false,
  532. // success: function (res) {
  533. // if (res.confirm) {
  534. // //调用订阅消息
  535. // that.requestSubscribe();
  536. // } else if (res.cancel) {
  537. // ///显示第二个弹说明一下
  538. // wx.showModal({
  539. // title: '温馨提示',
  540. // content: '拒绝后您将无法获取实时的交易、物流消息',
  541. // confirmText:"知道了",
  542. // showCancel:false,
  543. // success: function (res) {
  544. // uni.openSetting({ // 打开设置页
  545. // success(res) {
  546. // console.log(res.authSetting)
  547. // }
  548. // });
  549. // }
  550. // });
  551. // }
  552. // }
  553. // });
  554. },
  555. wechatLogin() {
  556. const that = this
  557. that.logining = true
  558. let loginType = 2
  559. uni.showLoading({
  560. title: '正在同步消息',
  561. mask:true
  562. })
  563. uni.login({
  564. provider: 'weixin',
  565. success: (wxres => {
  566. that.$api.request('user', 'thirdPartLogin', {
  567. loginType: loginType,
  568. raw: JSON.stringify(wxres)
  569. }, failres => {
  570. that.$api.msg(failres.errmsg)
  571. uni.hideLoading()
  572. }).then(res => {
  573. console.log("thirdPartLogin:"+res.data.phone)
  574. that.accessToken = res.data.accessToken
  575. that.logining = false
  576. uni.getUserInfo({
  577. lang: 'zh_CN',
  578. success: (e) => {
  579. uni.setStorageSync('userInfo', res.data)
  580. that.$store.commit('login', res.data)
  581. e.userInfo.nickname = e.userInfo.nickName
  582. e.userInfo.cid = uni.getStorageSync("clientId")
  583. console.log(e.userInfo)
  584. that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
  585. //同步过后
  586. res.data.nickname = e.userInfo.nickName
  587. res.data.avatarUrl = e.userInfo.avatarUrl
  588. res.data.gender = e.userInfo.gender
  589. if(res.data.phone){
  590. res.data.phone = e.userInfo.phone
  591. // that.liangxinLogin()
  592. }
  593. uni.setStorageSync('userInfo', res.data)
  594. that.$store.commit('login', res.data)
  595. })
  596. },
  597. complete: (e) => {
  598. uni.hideLoading()
  599. if(!res.data.phone||res.data.phone==""||res.data.phone ==undefined){
  600. that.isPhone = true//显示自定义的获取手机权限提示框
  601. that.inputStatus = 'inline'
  602. that.inputContent = ''
  603. }
  604. else{
  605. // uni.switchTab({
  606. // url: '/pages/sale/sale'
  607. // });
  608. uni.switchTab({
  609. url: '/pages/sale/information'
  610. });
  611. console.log("complete")
  612. }
  613. }
  614. })
  615. })
  616. })
  617. })
  618. },
  619. wechatH5Login() {
  620. const that = this
  621. let href = window.location.origin
  622. let page = that.$api.prePage()
  623. let prePath = '/pages/index/index'
  624. if (page) {
  625. prePath = page.__page__.path
  626. }
  627. window.location = 'https://open.weixin.qq.com/connect/oauth2/authorize?'
  628. + 'appid=' + that.$api.defConfig().h5Appid + '&redirect_uri=' + escape(href) + '&response_type=code&scope=snsapi_userinfo&state=' + escape(prePath) + '#wechat_redirect'
  629. },
  630. liangxinLogin(){
  631. const that = this
  632. var userInfoTmp = uni.getStorageSync("userInfo")
  633. console.log('userInfoTmp',userInfoTmp)
  634. that.$socket.login(userInfoTmp.phone, "123456", null, res=>{
  635. console.log('粮信登录',res)
  636. if (res.success) {
  637. that.$socket.showLoginDialog = false
  638. // 缓存用户
  639. that.userData = res.response.data
  640. console.log('userData',that.userData)
  641. that.$u.vuex("userData", that.userData);
  642. // 缓存通讯录
  643. that.$socket.listGuests(that.userData.user.operId, res => {
  644. // #ifdef APP-PLUS
  645. createFSQL(that.userData.user.operId).then();
  646. let contact = res.response.data;
  647. contact.forEach(c=>{
  648. c.members.forEach(m=>{
  649. m.name = c.name;
  650. addFSQL(m, that.userData.user.operId).then();
  651. })
  652. })
  653. // #endif
  654. that.$u.vuex('firendItem', res.response.data)
  655. });
  656. // 缓存消息列表
  657. that.$socket.queryOnlineMessage(that.userData.user.operId,q =>{
  658. let data = q.response.data;
  659. for(var i in data){
  660. initData(data[i].groupMsg.list, data[i].groupInfo.chatId);
  661. }
  662. })
  663. // 缓存链接
  664. that.$socket.getLinks(that.userData.user.operId, res=>{
  665. that.$u.vuex('linkItem',res.response.data)
  666. });
  667. // // 跳转到消息列表
  668. // that.$u.route({
  669. // url: 'pages/home/home',
  670. // type: 'switchTab'
  671. // });
  672. } else {
  673. uni.showModal({
  674. title:res.reason + ",请稍后再试",
  675. showCancel:false
  676. })
  677. }
  678. });
  679. }
  680. },
  681. }
  682. </script>
  683. <style lang='scss' scoped>
  684. .apple{
  685. background: #000;
  686. width: 35px;
  687. height: 35px;
  688. padding: 8px;
  689. border-radius: 50%;
  690. vertical-align: middle;
  691. }
  692. page {
  693. background: #fff;
  694. }
  695. .cuIcon-weixin{
  696. background: #39b54a;
  697. color: #fff;
  698. font-size: 18px;
  699. padding: 9px;
  700. border-radius: 50%;
  701. vertical-align: middle;
  702. margin-right:5px;
  703. }
  704. .container {
  705. padding-top: 85px;
  706. position: relative;
  707. width: 100vw;
  708. height: 100vh;
  709. overflow: hidden;
  710. background: url('~@/static/img/login/bg.png');
  711. background-size:100%;
  712. }
  713. .wrapper {
  714. position: relative;
  715. z-index: 90;
  716. padding-bottom: 40upx;
  717. height:100%;
  718. padding:0 30px;
  719. }
  720. .back-btn {
  721. position: absolute;
  722. left: 40upx;
  723. z-index: 9999;
  724. padding-top: var(--status-bar-height);
  725. top: 40upx;
  726. font-size: 40upx;
  727. color: $font-color-dark;
  728. }
  729. .verificationCode{
  730. margin-top:20px;
  731. background:#F5F6F9;
  732. color:#AFB3BF;
  733. }
  734. .verificationCode:after{
  735. border:none;
  736. }
  737. .verificationCode.active{
  738. background:#22C572;
  739. color:#fff;
  740. }
  741. .register{
  742. position:absolute;
  743. bottom:20px;
  744. left:50%;
  745. transform: translateX(-50%);
  746. color:#333333;
  747. height:50px;
  748. line-height:50px;
  749. border-radius:30px;border: 1px solid #444444;
  750. }
  751. .register:after{
  752. border:none;
  753. }
  754. .getcode{
  755. font-size:14px;
  756. position:absolute;
  757. right:0;
  758. top:50%;
  759. transform: translateY(-50%);
  760. color:#AFB3BF;
  761. background:#F5F6F9;
  762. height:30px;
  763. line-height:30px;
  764. }
  765. .password{
  766. border:none;
  767. outline: none;
  768. }
  769. .getcode:after{
  770. border:none;
  771. }
  772. .getcode.active{
  773. background:#22C572;
  774. color:#fff;
  775. }
  776. uni-navigator{
  777. display:inline-block;
  778. color:#22C572;
  779. }
  780. </style>