reset.vue 22 KB

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