|
@@ -72,6 +72,60 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ liangxinLogin(){
|
|
|
|
+ const that = this
|
|
|
|
+ var userInfoTmp = uni.getStorageSync("userInfo")
|
|
|
|
+ console.log('userInfoTmp',userInfoTmp)
|
|
|
|
+ that.$socket.login(userInfoTmp.phone, "123456", null, res=>{
|
|
|
|
+ console.log('粮信登录',res)
|
|
|
|
+ if (res.success) {
|
|
|
|
+ that.$socket.showLoginDialog = false
|
|
|
|
+ // 缓存用户
|
|
|
|
+ that.userData = res.response.data
|
|
|
|
+ console.log('userData',that.userData)
|
|
|
|
+ that.$u.vuex("userData", that.userData);
|
|
|
|
+ // 缓存通讯录
|
|
|
|
+ that.$socket.listGuests(that.userData.user.operId, res => {
|
|
|
|
+ // #ifdef APP-PLUS
|
|
|
|
+ createFSQL(that.userData.user.operId).then();
|
|
|
|
+ let contact = res.response.data;
|
|
|
|
+ contact.forEach(c=>{
|
|
|
|
+ c.members.forEach(m=>{
|
|
|
|
+ m.name = c.name;
|
|
|
|
+ addFSQL(m, that.userData.user.operId).then();
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ // #endif
|
|
|
|
+ that.$u.vuex('firendItem', res.response.data)
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // 缓存消息列表
|
|
|
|
+ that.$socket.queryOnlineMessage(that.userData.user.operId,q =>{
|
|
|
|
+ let data = q.response.data;
|
|
|
|
+ for(var i in data){
|
|
|
|
+ initData(data[i].groupMsg.list, data[i].groupInfo.chatId);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ // 缓存链接
|
|
|
|
+ that.$socket.getLinks(that.userData.user.operId, res=>{
|
|
|
|
+ that.$u.vuex('linkItem',res.response.data)
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // // 跳转到消息列表
|
|
|
|
+ // that.$u.route({
|
|
|
|
+ // url: 'pages/home/home',
|
|
|
|
+ // type: 'switchTab'
|
|
|
|
+ // });
|
|
|
|
+ } else {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title:res.reason + ",请稍后再试",
|
|
|
|
+ showCancel:false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
regain(){
|
|
regain(){
|
|
this.status=true
|
|
this.status=true
|
|
// console.log(e)150500
|
|
// console.log(e)150500
|
|
@@ -105,9 +159,19 @@
|
|
},
|
|
},
|
|
submit(e){
|
|
submit(e){
|
|
if(e.detail.value.length==6){
|
|
if(e.detail.value.length==6){
|
|
|
|
+ var that=this
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: '登录中',
|
|
|
|
+ mask:true
|
|
|
|
+ })
|
|
this.$api.doRequest('get','/commonUser/loginVerifyCode',{phone:this.phone,verifyCode:this.inputList}).then(res => {
|
|
this.$api.doRequest('get','/commonUser/loginVerifyCode',{phone:this.phone,verifyCode:this.inputList}).then(res => {
|
|
- // 获得数据
|
|
|
|
- console.log(res);
|
|
|
|
|
|
+ uni.setStorageSync('userInfo', res.data)
|
|
|
|
+ that.$store.commit('login', res.data)
|
|
|
|
+ that.liangxinLogin()
|
|
|
|
+ uni.switchTab({
|
|
|
|
+ url: '/pages/sale/information'
|
|
|
|
+ });
|
|
|
|
+ uni.hideLoading()
|
|
})
|
|
})
|
|
.catch(res => {
|
|
.catch(res => {
|
|
console.log(res);
|
|
console.log(res);
|