|
@@ -272,6 +272,14 @@
|
|
|
</view>
|
|
</view>
|
|
|
</u-popup>
|
|
</u-popup>
|
|
|
|
|
|
|
|
|
|
+ <!-- 签到弹窗 -->
|
|
|
|
|
+ <u-popup :show="isShowSignPopup" round="20rpx" mode="center" bgColor="#ffffff" zIndex="10076" :closeable='true' @close='isShowSignPopup=false'>
|
|
|
|
|
+ <view class="sign-popup" style="padding: 40rpx; width: 500rpx; display: flex; flex-direction: column; align-items: center; border-radius: 20rpx; background: #fff;">
|
|
|
|
|
+ <view class="title" style="font-size: 36rpx; font-weight: bold; margin-bottom: 40rpx; color: #333;">观看直播签到</view>
|
|
|
|
|
+ <view class="button" style="width: 80%; height: 80rpx; line-height: 80rpx; text-align: center; background: #3C7DD7; color: #fff; border-radius: 40rpx; font-size: 30rpx;" @click="handleLiveSign">签到</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </u-popup>
|
|
|
|
|
+
|
|
|
<!-- 微信昵称授权弹窗 -->
|
|
<!-- 微信昵称授权弹窗 -->
|
|
|
<u-popup :show="userlogo" mode="bottom" round='12'>
|
|
<u-popup :show="userlogo" mode="bottom" round='12'>
|
|
|
<view class="userlogo column">
|
|
<view class="userlogo column">
|
|
@@ -359,8 +367,8 @@
|
|
|
sendliveGift,
|
|
sendliveGift,
|
|
|
getUserIntegralInfo, //福币
|
|
getUserIntegralInfo, //福币
|
|
|
loginByMp,
|
|
loginByMp,
|
|
|
- getUserLiveInfo
|
|
|
|
|
-
|
|
|
|
|
|
|
+ getUserLiveInfo,
|
|
|
|
|
+ liveSign
|
|
|
} from '@/api/living.js'
|
|
} from '@/api/living.js'
|
|
|
import {
|
|
import {
|
|
|
getUserInfo,
|
|
getUserInfo,
|
|
@@ -586,7 +594,9 @@
|
|
|
userInfo: '',
|
|
userInfo: '',
|
|
|
urlOption: {},
|
|
urlOption: {},
|
|
|
source: '', // app,app内嵌H5页面
|
|
source: '', // app,app内嵌H5页面
|
|
|
- liveUserId:null
|
|
|
|
|
|
|
+ liveUserId:null,
|
|
|
|
|
+ isShowSignPopup: false,
|
|
|
|
|
+ signNo: ''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
async onLoad(options) {
|
|
async onLoad(options) {
|
|
@@ -982,6 +992,33 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ handleLiveSign() {
|
|
|
|
|
+ if (!this.liveId || !this.signNo) return;
|
|
|
|
|
+ const userName = this.userData.nickname || this.userData.nickName || '未命名';
|
|
|
|
|
+ liveSign({
|
|
|
|
|
+ liveId: this.liveId,
|
|
|
|
|
+ userName: userName,
|
|
|
|
|
+ signNo: this.signNo
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '签到成功',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ this.isShowSignPopup = false;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: res.msg || '签到失败',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '网络错误,签到失败',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
// getUserLiveInfo(){
|
|
// getUserLiveInfo(){
|
|
|
// getUserLiveInfo().then((res) => {
|
|
// getUserLiveInfo().then((res) => {
|
|
|
// if (res.code == 200) {
|
|
// if (res.code == 200) {
|
|
@@ -3558,6 +3595,7 @@
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
const baseWsUrl = 'wss://liveapp.zkhj6.com/ws/app/webSocket'
|
|
const baseWsUrl = 'wss://liveapp.zkhj6.com/ws/app/webSocket'
|
|
|
|
|
+ // const baseWsUrl = 'ws://192.168.110.225:7114/ws/app/webSocket'//本地
|
|
|
let wsUrl =
|
|
let wsUrl =
|
|
|
`${baseWsUrl}?userId=${this.liveUserId}&liveId=${this.liveId}&userType=${this.userType}×tamp=${this.timestamp}&signature=${signature}`
|
|
`${baseWsUrl}?userId=${this.liveUserId}&liveId=${this.liveId}&userType=${this.userType}×tamp=${this.timestamp}&signature=${signature}`
|
|
|
if (this.qrFrom) {
|
|
if (this.qrFrom) {
|
|
@@ -3878,6 +3916,23 @@
|
|
|
} else {
|
|
} else {
|
|
|
this.isShowLottery = false
|
|
this.isShowLottery = false
|
|
|
}
|
|
}
|
|
|
|
|
+ } else if (socketMessage.cmd == 'sign') {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const signData = socketMessage.data ? JSON.parse(socketMessage.data) : {}
|
|
|
|
|
+ if (typeof signData === 'string') {
|
|
|
|
|
+ const innerData = JSON.parse(signData)
|
|
|
|
|
+ this.signNo = innerData.signNo || ''
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.signNo = signData.signNo || ''
|
|
|
|
|
+ }
|
|
|
|
|
+ if (socketMessage.status === 1) {
|
|
|
|
|
+ this.isShowSignPopup = true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.isShowSignPopup = false
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (err) {
|
|
|
|
|
+ console.error('解析签到数据失败:', err)
|
|
|
|
|
+ }
|
|
|
} else if (socketMessage.cmd == 'deleteMsg') {
|
|
} else if (socketMessage.cmd == 'deleteMsg') {
|
|
|
const index = this.talklist.findIndex(item => item.msgId == socketMessage.msg)
|
|
const index = this.talklist.findIndex(item => item.msgId == socketMessage.msg)
|
|
|
if (index !== -1) {
|
|
if (index !== -1) {
|