| | |
| | | <view class="work"> |
| | | <!-- 自定义顶部导航栏 --> |
| | | <!-- <navBarTop :title="'聊天室'"></navBarTop> --> |
| | | |
| | | |
| | | <view style="height:205rpx;"></view> |
| | | <view class="tab" style="position: fixed;top: 0;width: 100%;height: 205rpx;z-index: 100;"> |
| | | <u-navbar style="position: relative;left: -20rpx;" :is-fixed="false" :border-bottom="false" :is-back="false" title="好友" |
| | | :background="{ background: '#0BB9C8' }" title-color="#fff"> |
| | | <u-navbar style="position: relative;left: -20rpx;" :is-fixed="false" :border-bottom="false" :is-back="false" |
| | | title="好友" :background="{ background: '#0BB9C8' }" title-color="#fff"> |
| | | <image slot="right" src="/static/images/home/message.png" class="message-icon" mode="widthFix"></image> |
| | | </u-navbar> |
| | | <u-tabs :list="list" :is-scroll="false" :current="current" active-color="#14B9C8" inactive-color="#595959" |
| | |
| | | <div class="m-main"> |
| | | <!-- <view class="inTitle">{{Task}}</view> --> |
| | | <view class="inTmain"> |
| | | <contacts v-for="(item,index) in dataListQZ" :key="index" :Pdata="item" :fromW="indexs" |
| | | <contacts v-for="(item,index) in dataListTXL" :key="index" :Pdata="item" :fromW="indexs" |
| | | @refreshTask="refreshTask"></contacts> |
| | | </view> |
| | | </div> |
| | |
| | | <div class="m-main"> |
| | | <!-- <view class="inTitle">{{Task}}</view> --> |
| | | <view class="inTmain"> |
| | | <contacts v-for="(item,index) in dataListTXL" :key="index" :Pdata="item" :fromW="indexs" |
| | | <contacts v-for="(item,index) in dataListQZ" :key="index" :Pdata="item" :fromW="indexs" |
| | | @refreshTask="refreshTask"></contacts> |
| | | </view> |
| | | </div> |
| | |
| | | </view> |
| | | </swiper-item> |
| | | </swiper> |
| | | |
| | | |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | import axios from '../../static/lib/axios.js' |
| | | import contacts from '../../components/contacts/contacts.vue' |
| | | import navBarTop from '../../components/nav-bar-top/nav-bar-top.vue'; |
| | | export default{ |
| | | export default { |
| | | components: { |
| | | navBarTop,contacts |
| | | navBarTop, |
| | | contacts |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | name: '正在聊天' |
| | | }, |
| | | { |
| | | name: '群组' |
| | | name: '好友' |
| | | }, |
| | | { |
| | | name: '好友' |
| | | name: '群组' |
| | | } |
| | | ], |
| | | swiperHeight: 0, |
| | |
| | | show: true, |
| | | dataListP: [], |
| | | dataListQZ: [], |
| | | dataListTXL:[], |
| | | dataListTXL: [], |
| | | fromW: '', |
| | | onTop: false, //是否吸顶 |
| | | rect: '', //页面滚动距离 |
| | |
| | | userName: '', |
| | | } |
| | | }, |
| | | activated(){ |
| | | this.beginObj(); |
| | | this.getdataList(0); |
| | | }, |
| | | onReady() { |
| | | let that = this; |
| | | uni.getSystemInfo({ |
| | | success(e) { |
| | | console.log(e); |
| | | let { |
| | | windowWidth, |
| | | windowHeight, |
| | | safeArea |
| | | } = e; |
| | | const query = uni.createSelectorQuery().in(that); |
| | | query |
| | | .select('#swiperBox') |
| | | .boundingClientRect(data => { |
| | | that.swiperHeight = safeArea.bottom - data.top; |
| | | }) |
| | | .exec(); |
| | | } |
| | | }); |
| | | }, |
| | | activated() { |
| | | this.beginObj(); |
| | | this.getdataList(0); |
| | | }, |
| | | onReady() { |
| | | let that = this; |
| | | uni.getSystemInfo({ |
| | | success(e) { |
| | | console.log(e); |
| | | let { |
| | | windowWidth, |
| | | windowHeight, |
| | | safeArea |
| | | } = e; |
| | | const query = uni.createSelectorQuery().in(that); |
| | | query |
| | | .select('#swiperBox') |
| | | .boundingClientRect(data => { |
| | | that.swiperHeight = safeArea.bottom - data.top; |
| | | }) |
| | | .exec(); |
| | | } |
| | | }); |
| | | }, |
| | | methods: { |
| | | change(index) { |
| | | this.current = index; |
| | |
| | | }, |
| | | getdataList() { |
| | | var that = this; |
| | | if(this.current == 0){ |
| | | if (this.current == 0) { |
| | | uni.request({ |
| | | url:"http://223.82.109.183:2080/api/chat-records/getChatListPage", |
| | | method:"get", |
| | | data:{ |
| | | url: "http://223.82.109.183:2080/api/chat-records/getChatListPage", |
| | | method: "get", |
| | | data: { |
| | | senderId: WxStorage.get("ids") |
| | | }, |
| | | success:(res)=> { |
| | | success: (res) => { |
| | | var resdata = res.data.data; |
| | | for (var i = 0; i < resdata.length; i++) { |
| | | if(resdata[i].avatar == null || resdata[i].avatar == ""){ |
| | | if (resdata[i].avatar == null || resdata[i].avatar == "") { |
| | | resdata[i].avatar = "http://s16s652780.51mypc.cn/img/bg/img-logo.png"; |
| | | } |
| | | } |
| | |
| | | that.swiperHeight = resdata.length * 85; |
| | | } |
| | | }); |
| | | }else if(this.current == 1){ |
| | | } else if (this.current == 1) { |
| | | uni.request({ |
| | | url:"http://223.82.109.183:2080/api/chatgroup/selectList", |
| | | method:"POST", |
| | | data:{ |
| | | url: "http://223.82.109.183:2080/api/blade-user/page?current=1&size=9999", |
| | | method: "get", |
| | | data: { |
| | | senderId: WxStorage.get("ids") |
| | | }, |
| | | success:(res)=> { |
| | | var resdata = res.data.data; |
| | | for (var i = 0; i < resdata.length; i++) { |
| | | if(resdata[i].avatar == null || resdata[i].avatar == ""){ |
| | | resdata[i].avatar = "http://s16s652780.51mypc.cn/img/bg/qunz.png"; |
| | | } |
| | | } |
| | | that.dataListQZ = resdata; |
| | | that.swiperHeight = resdata.length * 85; |
| | | } |
| | | }) |
| | | }else if(this.current == 2){ |
| | | uni.request({ |
| | | url:"http://223.82.109.183:2080/api/blade-user/page?current=1&size=9999", |
| | | method:"get", |
| | | data:{ |
| | | senderId: WxStorage.get("ids") |
| | | }, |
| | | success:(res)=> { |
| | | success: (res) => { |
| | | var resdata = res.data.data.records; |
| | | for (var i = 0; i < resdata.length; i++) { |
| | | |
| | | if(resdata[i].avatar == null || resdata[i].avatar == ""){ |
| | | |
| | | if (resdata[i].avatar == null || resdata[i].avatar == "") { |
| | | resdata[i].avatar = "http://s16s652780.51mypc.cn/img/bg/img-logo.png"; |
| | | } |
| | | } |
| | | that.dataListTXL = resdata; |
| | | that.swiperHeight = resdata.length * 85; |
| | | } |
| | | }) |
| | | } else if (this.current == 2) { |
| | | |
| | | uni.request({ |
| | | url: "http://223.82.109.183:2080/api/chatgroup/selectList", |
| | | method: "POST", |
| | | data: { |
| | | senderId: WxStorage.get("ids") |
| | | }, |
| | | success: (res) => { |
| | | var resdata = res.data.data; |
| | | for (var i = 0; i < resdata.length; i++) { |
| | | if (resdata[i].avatar == null || resdata[i].avatar == "") { |
| | | resdata[i].avatar = "http://s16s652780.51mypc.cn/img/bg/qunz.png"; |
| | | } |
| | | } |
| | | that.dataListQZ = resdata; |
| | | that.swiperHeight = resdata.length * 85; |
| | | } |
| | | }) |
| | |
| | | refreshTask() { |
| | | this.getdataList(1); |
| | | }, |
| | | |
| | | |
| | | }, |
| | | mounted() { |
| | | this.beginObj(); |
| | | this.getdataList(0); |
| | | |
| | | |
| | | }, |
| | | onPageScroll(e) { |
| | | // console.log(e.scrollTop, 'pingmu') |
| | |
| | | onLoad: function(options) { |
| | | this.userName = options.login; |
| | | // if(options.txlType == 2){ |
| | | this.current = 2; |
| | | this.current = 2; |
| | | // } |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | |
| | | .main { |
| | | margin-top: 0.625rem; |
| | | |
| | | |
| | | .m-title { |
| | | width: 100%; |
| | | height: 2rem; |
| | |
| | | padding-bottom: 0.5rem; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | .m-main { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | .message-icon { |
| | | width: 32rpx; |
| | | height: auto; |
| | | margin-right: 27rpx; |
| | | } |
| | | |
| | | </style> |