reset.vue 22 KB

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