reset.vue 23 KB

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