直播修改

This commit is contained in:
jia 2023-10-31 20:41:15 +08:00
parent 48494458d2
commit 12a0c23dbd
10 changed files with 330 additions and 124 deletions

View File

@ -88,7 +88,7 @@ export function getfocuslst(data) {
//关注我的人
export function getfanslst(data) {
return requesta.post('community/fans/lst',data);
return requesta.get('community/fans/lst',data);
}
//用户送礼
@ -121,6 +121,13 @@ export function sendGift(data) {
return request.post('zhibo/sendGift',data);
}
//获取主播关注人数
export function fansNum(data) {
return requesta.get('zhibo/fansNum',data);
}
/**
* 充值金额选择
*/

View File

@ -12,8 +12,9 @@
style="color: #fff;font-size: 25rpx;">{{room.live_name.length>6?room.live_name.substring(0, 6)+'...': room.live_name}}</text>
</view>
<view class="room-user-money">
<text style="color: #fff;font-size: 25rpx;">4000</text>
<text style="color: #fff;font-size: 25rpx;">{{count}}</text>
</view>
</view>
<view class="room-guanzhu" @click="interest">
<text class="guanzhu" v-if="!follow">关注</text>
@ -41,7 +42,7 @@
</view>
</view>
</view>
<view class="top-left" v-if="isshow">
<view class="top-left-a" @click="switchCamera">
<image class="left-img" src="/static/img/qiehuan.png" mode=""></image>
@ -51,7 +52,7 @@
<mh-msgList ref="msgList" :msgList="msgList"></mh-msgList>
</view>
<!-- 底部操作 -->
</view>
<view class="inpit-box-bg" v-if="focus">
<view class="inpit-box-body">
@ -77,7 +78,7 @@
<image class="ico-box-img" src="@/static/img/shanpin.png" mode="aspectFit"></image>
</view>
<view class="ico-box" @click="send_lick">
<image class="ico-box-img" src="@/static/img/gn.png"></image>
<image class="ico-box-img" src="@/static/img/jl.png"></image>
</view>
</view>
</view>
@ -241,7 +242,46 @@
{{join.message}}
</text>
</view>
<uni-popup ref="giftrecord" :type="type" :custom="true" @change="change">
<view class="uni-record" >
<view class="uni-record-top">
<view class="uni-record-top-img" @click="closezb">
<image class="uni-record-top-img" src="@/static/img/you.png" mode=""></image>
</view>
<view class="uni-record-top-text">
<text class="uni-record-top-text">礼物记录</text>
</view>
</view>
<scroll-view scroll-y :style="{'height':380+'px','overflow':'hidden'}">
<view class="uni-record-content" v-for="(item,m) in recordlist" :key="m">
<view class="record-content-one">
<view class="content-onea">
<text class="content-onea">{{item.create_time}}</text>
</view>
<view class="content-oneb">
<image src="@/static/img/jb.png" class="content-oneb-img" mode="aspectFit">
</image>
<text class="content-oneb-txt" v-if='!isshow'>-{{item.amount}}</text>
<text class="content-oneb-txt" v-else>+{{item.amount}}</text>
</view>
</view>
<view class="record-content-two">
<view class="content-twoa">
<image class="content-twoa-img" src="@/static/missing-face.png" mode="aspectFit">
</image>
<text class="content-twoa-txt">{{item.nickname}}</text>
</view>
<view class="content-twob">
<text class="content-twob-txt"
v-if='!isshow'>给主播赠送{{item.gift_id}}个{{item.gift_name}}</text>
<text class="content-twob-txt" v-else>主播收到{{item.gift_id}}个{{item.gift_name}}</text>
</view>
</view>
</view>
</scroll-view>
</view>
</uni-popup>
<gb-popup :isShow="isShow1" rName="确定" :isBut="false" lName="取消" @lEvent="show1" @rEvent="copyData"
title="请输入礼物数量">
<view style="padding: 30rpx;">
@ -265,7 +305,9 @@
getuser,
getRechargeApi,
sendGift,
getAjuser
getAjuser,
getfanslst,
fansNum
} from '@/api/live.js'
import {
VUE_APP_WS_URL_ONE
@ -290,7 +332,7 @@
},
heightG: {
type: String,
default: '760'
default: '750'
},
},
components: {
@ -323,6 +365,7 @@
message_arr: [
],
recordlist:[],
msgList: [{
userName: "系统通知",
content: "倡导绿色直播,严禁发布涉黄涉毒涉赌,严禁发布涉政、违法及低俗违规内容。健康直播,文明互动",
@ -349,6 +392,7 @@
gifsobj: {},
gift_num: '',
isShow1: false,
count:0
}
/*定义IM消息类型
1进群通知
@ -362,7 +406,6 @@
this.userinfo = JSON.parse(uni.getStorageSync('USER_INFO'))
this.getjuser()
this.get_live_room(); //调用直播间信息
this.rewardList()
this.giftList()
@ -370,6 +413,9 @@
this.getuser()
this.getRecharg()
// console.log(this.room)
},
onReady() {
this.windowWidth = uni.getSystemInfoSync().screenWidth //获取屏幕宽度
@ -410,6 +456,26 @@
})
},
methods: {
//全局
quanju() {
this.focus = false;
},
//关注我的人
getfanslst() {
getfanslst().then((res) => {
if (res.status = 200) {
// console.log(res,'aaaaaaaaaa')
this.count = res.data.count
}
})
},
//获取主播关注人数
fansNum(id){
fansNum({master_id:id}).then((res=>{
// console.log(res,'SSSSSSS')
this.count=res.data.fan_num
}))
},
//关注
getjuser() {
getAjuser(this.room.app_user_id).then((res) => {
@ -423,7 +489,7 @@
//获取充值数据
getRecharg() {
getRechargeApi().then((res) => {
console.log(res.data.recharge_quota, '11111111')
this.Recharglist = res.data.recharge_quota
this.Recharglist.push({
data: {},
@ -435,7 +501,7 @@
//获取余额
getuser() {
getuser().then((res) => {
console.log(res.data.now_money)
this.now_money = res.data.now_money
})
},
@ -452,7 +518,7 @@
//礼物列表
rewardList() {
rewardList().then((res) => {
console.log(res, '11111111')
this.recordlist = res.data.list
})
},
//送礼
@ -466,13 +532,15 @@
live_stream_id: this.room.live_stream_id,
gift_num: gif.gift_num,
}
console.log(data)
sendGift(data).then((res) => {
if (res.code == 1) {
this.getuser()
this.rewardList()
this.$refs.share.close()
uni.hideModal()
this.getuser()
} else {
uni.showModal({
title: '提示',
@ -938,6 +1006,8 @@
// console.log(this.room.app_user_id, uni.getStorageSync('user_id'), '房间id 以及当前用户id')
if (res.data.app_user_id == uni.getStorageSync('Uid')) {
this.isshow = true
}else{
this.fansNum(res.data.app_user_id)
}
}
this.connectSocketInit()
@ -984,10 +1054,14 @@
this.type = 'bottom'
t.togglePopup('bottom', 'share');
},
//关闭
closezb() {
this.$refs['giftrecord'].close()
},
send_lick: function() {
this.sendGift()
// this.sendGift()
this.$refs['giftrecord'].open()
},
//礼物弹窗
@ -1092,13 +1166,109 @@
width: 100%;
/* 设置容器的宽度 */
}
.uni-record {
border-radius: 0;
flex: 1;
background-color: #F4F4F4 !important;
}
.uni-record-content {
height: 177rpx;
background: #FFFFFF;
padding: 0rpx 28rpx;
border-radius: 21rpx 21rpx;
margin-bottom: 21rpx;
}
.uni-record {
}
.uni-record-top {
margin-top: 60rpx;
flex-direction: row;
margin-bottom: 30rpx;
}
.uni-record-top-img {
width: 59rpx;
height: 58rpx;
}
.uni-record-top-text {
font-size: 33rpx;
color: #000000;
margin-top: 5rpx;
}
.record-content-one {
flex-direction: row;
justify-content: space-between;
margin-top: 30rpx;
padding-bottom: 14rpx;
border-bottom: 1rpx solid #333333;
}
.content-onea {
font-size: 26rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
}
.content-oneb {
flex-direction: row;
}
.content-oneb-img {
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
}
.content-oneb-txt {
font-size: 30rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
}
.record-content-two {
flex-direction: row;
justify-content: space-between;
padding-top: 25rpx;
}
.content-twoa {
flex-direction: row;
}
.content-twob-txt {
font-size: 30rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
margin-top: 20rpx;
}
.content-twoa-txt {
font-size: 26rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
margin-top: 20rpx;
margin-left: 20rpx;
}
.content-twoa-img {
width: 56rpx;
height: 56rpx;
}
.dobox {
position: absolute;
bottom: 0rpx;
width: 750rpx;
background-color: #F8F8F8;
}
.inpit-box {
@ -1879,12 +2049,15 @@
height: 30rpx;
}
.gift-alert {
width: 430rpx;
// width: 480rpx;
flex-direction: row;
justify-content: space-between;
justify-content: space-around;
// background-color: green;
// animation: slideRight 1s linear forwards;
animation: slideRight 1s linear forwards;
z-index: 9999;
position: absolute;
}
.gift-alerta {
@ -1956,13 +2129,12 @@
height: 60upx;
}
.send-boj-user-header {
width: 63upx;
height: 63upx;
border-radius: 50%;
margin-top: 0rpx;
margin-left: -7rpx;
margin-top: 3rpx;
}

View File

@ -211,12 +211,14 @@
},
type: 4,
},
{
name: '里海直播',
icon: '/static/applet/live.png',
data: {
id: "__UNI__0E46DAD",
url:'https://lihai001.oss-cn-chengdu.aliyuncs.com/app/__UNI__0E46DAD.wgt',
},
type: 4,

View File

@ -43,21 +43,20 @@
</scroll-view>
<scroll-view scroll-top="0" scroll-y="true" class="goods_body_scroll" v-if="isindex==1">
<view v-for="(pp,index) in roomList" :key="index">
<view class="roomsbox-a" v-for="(kk,i) in pp" :key="i">
<view v-for="(pp,index) in dataList" :key="index">
<view class="roomsbox-a">
<view class="roomsbox-title">
{{i}}
{{pp.date}}
</view>
<view class="roomsbox">
<view class="roomblock" style="border: 1px solid #e1d9d4;" v-for="(room,j) in kk"
<view class="roomblock" style="border: 1px solid #e1d9d4;" v-for="(room,j) in pp.records"
:key="j" @click="hsitroyjump(room)">
<image :src="room.cover" mode="aspectFill" v-if="room.cover"></image>
<image src="/static/lw/6.gif" mode="aspectFill" v-else></image>
<view class="livetitle">{{room.live_name}}</view>
<view class="roomstatus-d" v-if="room.status==1" style="background-color: #09BB07;">
</view>
<view class="roomstatus-d" v-if="room.status==2"
style="background-color: #fa2306;">
<view class="roomstatus-d" v-else style="background-color: #fa2306;">
</view>
<view class="roomstatus-d" v-if="room.status==3" style="background-color: #e1d9d4;">
</view>
@ -73,7 +72,10 @@
</view>
</scroll-view>
<view class="noshuju" v-if="roomList.length==0">
<view class="noshuju" v-if="roomList.length==0&&isindex==0">
<emptyPage title="暂无房间信息"></emptyPage>
</view>
<view class="noshuju" v-if="dataList.length==0&&isindex==1">
<emptyPage title="暂无房间信息"></emptyPage>
</view>
</view>
@ -110,6 +112,7 @@
],
roomList: [],
dataList:[],
user: [],
index: 0,
isGetLoginInfo: true,
@ -123,6 +126,7 @@
},
mounted() {
this.getRoomList()
this.getbackList()
},
onShow() {},
onReachBottom() {
@ -132,6 +136,7 @@
onPullDownRefresh: function() {
console.log('下拉刷新')
this.getRoomList()
this.getbackList()
},
methods: {
@ -147,6 +152,7 @@
search() {
this.page = 1
this.roomList=[]
this.dataList=[]
if (this.isindex == 0) {
this.getRoomList()
} else {
@ -159,6 +165,7 @@
this.page = 1
this.keyword=''
this.roomList=[]
this.dataList=[]
if (i == 0) {
this.getRoomList()
} else {
@ -173,21 +180,36 @@
keyword: this.keyword
}).then(res => {
if (res.data.code = 1) {
uni.hideLoading()
const groupedArray = res.data.lists.reduce((acc, obj) => {
const date = obj.date;
if (!acc[date]) {
acc[date] = [];
}
acc[date].push(obj);
return acc;
}, {});
if (res.data.lists.length > 0) {
//
let result = [];
//
for (let i = 0; i < res.data.lists.length; i++) {
let record = res.data.lists[i];
let date = record.date;
//
let group = result.find((item) => item.date === date);
//
if (!group) {
group = {
date: date,
records: []
};
result.push(group);
}
//
group.records.push(record);
}
this.dataList = result
this.roomList.push(groupedArray)
//
// console.log(this.roomList);
// this.page = this.page + 1
}
})
},
@ -203,7 +225,7 @@
app_name: 'shop',
keyword: this.keyword
}).then(res => {
console.log(res)
if (res.data.code = 1) {
uni.hideLoading()
if (res.data.lists.length > 0) {
@ -215,6 +237,10 @@
this.page = this.page + 1
}
}else{
uni.showModal({
title:res.msg
})
}
})
},

View File

@ -27,7 +27,7 @@
<!-- {{item}} {{i}} -->
</view>
<sd-float-page :room='room' :msgList='msgList'
<sd-float-page :room='room' :msgList='msgList' :heightG='boxStyle.height'
:style="'width: '+ windowWidth +'px; height: '+ boxStyle.height +'px;position: absolute;' "></sd-float-page>
</view>
@ -337,7 +337,6 @@
this.page = that.page + 1
}
console.log(this.dataList, this.dataList[this.k].id, 222222)
},
onpullingdown() {
this.refreshing = true

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
static/img/jl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
static/img/you.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB