Merge pull request 'xbx' (#237) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/237
This commit was merged in pull request #237.
This commit is contained in:
@@ -271,7 +271,39 @@
|
||||
onShow() {
|
||||
this.page = 1;
|
||||
if (this.page != 1) {
|
||||
}
|
||||
}
|
||||
console.log(this.imService.status)
|
||||
if(!this.imService.status && this.$store.state.hasLogin){
|
||||
const user = uni.getStorageSync('user_info');
|
||||
// console.log(user)
|
||||
this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar)
|
||||
this.imService.connectIM()
|
||||
|
||||
}else if(!this.imService.status){
|
||||
this.$u.api.getDefaultAvatar().then((res)=>{
|
||||
console.log(res)
|
||||
uni.setStorageSync("morenimg",res.data.avatar)
|
||||
this.imService.login(new Date().getTime(),"123",res.data.avatar)
|
||||
this.imService.connectIM()
|
||||
console.log("用户信息")
|
||||
})
|
||||
console.log("链接")
|
||||
}
|
||||
|
||||
// if(!this.imService.status && !this.imService.lianjie){
|
||||
// console.log("1212")
|
||||
// this.imService.lianjie = true
|
||||
// let that = this
|
||||
// setTimeout(function(){
|
||||
// that.imService.disconnect()
|
||||
// console.log("guanbi")
|
||||
// },1000)
|
||||
// setTimeout(function(){
|
||||
// console.log("lianjie")
|
||||
// that.imService.connectIM()
|
||||
// },2000)
|
||||
// }
|
||||
|
||||
// if (this.hasLogin) {
|
||||
// this.isNewmembervoucher();
|
||||
// }
|
||||
@@ -279,36 +311,37 @@
|
||||
async onLoad(){
|
||||
this.articleList = [];
|
||||
this.getArticlelist();
|
||||
this.getSwiper();
|
||||
// 优惠券
|
||||
if(this.$store.state.hasLogin){
|
||||
this.getSwiper();
|
||||
this.isNewmembervoucher();
|
||||
const user = uni.getStorageSync('user_info');
|
||||
// console.log(user)
|
||||
this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar)
|
||||
await this.imService.connectIM()
|
||||
|
||||
// 优惠券
|
||||
// if(this.$store.state.hasLogin){
|
||||
// const user = uni.getStorageSync('user_info');
|
||||
// // console.log(user)
|
||||
// this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar)
|
||||
// await this.imService.connectIM()
|
||||
|
||||
}else{
|
||||
await this.$u.api.getDefaultAvatar().then((res)=>{
|
||||
console.log(res)
|
||||
uni.setStorageSync("morenimg",res.data.avatar)
|
||||
this.imService.login(new Date().getTime(),"123",res.data.avatar)
|
||||
console.log("用户信息")
|
||||
})
|
||||
console.log("链接")
|
||||
await this.imService.connectIM()
|
||||
// }else{
|
||||
// await this.$u.api.getDefaultAvatar().then((res)=>{
|
||||
// console.log(res)
|
||||
// uni.setStorageSync("morenimg",res.data.avatar)
|
||||
// this.imService.login(new Date().getTime(),"123",res.data.avatar)
|
||||
// console.log("用户信息")
|
||||
// })
|
||||
// console.log("链接")
|
||||
// await this.imService.connectIM()
|
||||
|
||||
}
|
||||
console.log("1212")
|
||||
let that = this
|
||||
setTimeout(function(){
|
||||
that.imService.disconnect()
|
||||
console.log("guanbi")
|
||||
},1000)
|
||||
setTimeout(function(){
|
||||
console.log("lianjie")
|
||||
that.imService.connectIM()
|
||||
},2000)
|
||||
// }
|
||||
// console.log("1212")
|
||||
// let that = this
|
||||
// setTimeout(function(){
|
||||
// that.imService.disconnect()
|
||||
// console.log("guanbi")
|
||||
// },1000)
|
||||
// setTimeout(function(){
|
||||
// console.log("lianjie")
|
||||
// that.imService.connectIM()
|
||||
// },2000)
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.page = 1;
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
const token = uni.getStorageSync('token');
|
||||
let that = this
|
||||
uni.request({
|
||||
url:"https://dmmall.sdbairui.com/api/Specialci/getAtwillUserInfo",
|
||||
url:"http://mall.dmygkeji.com/api/Specialci/getAtwillUserInfo",
|
||||
data:{
|
||||
userId: 1
|
||||
},
|
||||
|
||||
@@ -370,7 +370,7 @@ export default {
|
||||
const token = uni.getStorageSync('token');
|
||||
console.log(token,that.id)
|
||||
uni.request({
|
||||
url:"https://dmmall.sdbairui.com/api/Specialci/goodsShelves",
|
||||
url:"http://mall.dmygkeji.com/api/Specialci/goodsShelves",
|
||||
data:{
|
||||
live_id:that.id
|
||||
},
|
||||
@@ -385,7 +385,7 @@ export default {
|
||||
})
|
||||
setInterval(function(){
|
||||
uni.request({
|
||||
url:"https://dmmall.sdbairui.com/api/Specialci/goodsShelves",
|
||||
url:"http://mall.dmygkeji.com/api/Specialci/goodsShelves",
|
||||
data:{
|
||||
live_id:that.id
|
||||
},
|
||||
@@ -403,7 +403,7 @@ export default {
|
||||
|
||||
},10 * 1000)
|
||||
uni.request({
|
||||
url:"https://dmmall.sdbairui.com/api/Specialci/livingUserInfo",
|
||||
url:"http://mall.dmygkeji.com/api/Specialci/livingUserInfo",
|
||||
data:{
|
||||
live_id:that.id
|
||||
},
|
||||
@@ -417,32 +417,13 @@ export default {
|
||||
// that.list= res.data.data
|
||||
}
|
||||
})
|
||||
//当前用户
|
||||
var currentUser = {}
|
||||
if(this.$store.state.hasLogin){
|
||||
const user = uni.getStorageSync('user_info');
|
||||
currentUser = {
|
||||
id : user.member.member_id,
|
||||
nickname : user.member.member_nickname,
|
||||
avatar: user.member.member_avatar
|
||||
};
|
||||
}else{
|
||||
const user = uni.getStorageSync('morenimg');
|
||||
currentUser = {
|
||||
id : new Date().getTime(),
|
||||
nickname : "123",
|
||||
avatar: user
|
||||
};
|
||||
}
|
||||
|
||||
var room = {
|
||||
id : a.rid + "",
|
||||
name : a.rid + ""
|
||||
};
|
||||
that.chatRoomService = getApp().globalData.im
|
||||
console.log(room,currentUser)
|
||||
//构造chatRoomService
|
||||
that.chatRoomService.subscribeRoomMessage(room,currentUser)
|
||||
that.chatRoomService.subscribeRoomMessage(room)
|
||||
//获取当前聊天室数据
|
||||
that.room = that.chatRoomService.room;
|
||||
that.chatRoomService.initialWhenOnlineUserChange(that.newpeople)
|
||||
@@ -520,7 +501,7 @@ export default {
|
||||
let that = this
|
||||
console.log(token)
|
||||
uni.request({
|
||||
url:"https://dmmall.sdbairui.com/api/member/attentionMember",
|
||||
url:"http://mall.dmygkeji.com/api/member/attentionMember",
|
||||
data:{
|
||||
member_id:that.info.user_id
|
||||
},
|
||||
@@ -531,7 +512,7 @@ export default {
|
||||
success(res){
|
||||
console.log(res)
|
||||
uni.request({
|
||||
url:"https://dmmall.sdbairui.com/api/Specialci/livingUserInfo",
|
||||
url:"http://mall.dmygkeji.com/api/Specialci/livingUserInfo",
|
||||
data:{
|
||||
live_id:that.id
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user