diff --git a/jiuyi2/api/news.js b/jiuyi2/api/news.js
index f3235eaf..24f8a137 100644
--- a/jiuyi2/api/news.js
+++ b/jiuyi2/api/news.js
@@ -134,15 +134,25 @@ export const news = {
},
// 红包详情
- getRedbag(param) {
+ getRedPacketInfo(param) {
return util.request({
- url: `/home/getRedbag`,
- method: 'POST',
- query: param.data
-
+ url: `/user/getRedPacketInfo`,
+ method: 'GET',
+ query: param.query,
+ load: 1,
})
},
-
+
+ // 领红包
+ getRedPacket(param) {
+ return util.request({
+ url: `/user/getRedPacket`,
+ method: 'POST',
+ data: param.data,
+ query: param.query,
+ })
+ },
+
// 红包记录
grabredLog(param) {
return util.request({
diff --git a/jiuyi2/common/js/util.js b/jiuyi2/common/js/util.js
index 89dbe01c..ac9341b4 100644
--- a/jiuyi2/common/js/util.js
+++ b/jiuyi2/common/js/util.js
@@ -238,6 +238,7 @@ const util = {
},
// 请求失败返回
fail: res => {
+ console.log('request fail', url, res, params.data ? params.data : '')
// 关闭加载效果
if (params.load) {
uni.hideLoading()
diff --git a/jiuyi2/pages/index/index.nvue b/jiuyi2/pages/index/index.nvue
index fde325d7..12ccc7ae 100644
--- a/jiuyi2/pages/index/index.nvue
+++ b/jiuyi2/pages/index/index.nvue
@@ -289,6 +289,8 @@
console.log('getRecList then rs', rs)
// 设置列表
setList(rs, recList)
+ }).catch(rs => {
+ console.log('getRecList', rs)
})
}
@@ -321,8 +323,7 @@
const pages = getCurrentPages()
// 判断是否当前页
if (pages[pages.length - 1].route != 'pages/index/index') {
- proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]].playState.value =
- false
+ proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]].playState.value = false
proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]].pause()
}
}, 500)
diff --git a/jiuyi2/pages/news/chat/chat.vue b/jiuyi2/pages/news/chat/chat.vue
index 62af4714..60ec845e 100644
--- a/jiuyi2/pages/news/chat/chat.vue
+++ b/jiuyi2/pages/news/chat/chat.vue
@@ -73,8 +73,6 @@
const top = ref(0)
// 工具条的高度
const toolHeight = ref(0)
- // 页码
- const page = ref(1)
// 当前操作的元素
const messageItem = ref({})
// 工具栏状态 voice录音 input输入框 emoji表情 plus加号菜单
@@ -83,6 +81,8 @@
const videoUrl = ref('')
// 视频上下文
const videoContext = ref(null)
+ // 红包对象
+ const redPacket = reactive({})
onLoad(option => {
// 标题
@@ -187,7 +187,6 @@
let request = api.news.getUserMsgHistory
// 如果是群聊 获取群聊聊天记录
if (msg.type == 'GROUP') request = api.news.getGroupMsgHistory
- console.log('getHistory')
// 获取历史记录
request({
@@ -216,9 +215,9 @@
return item
}))
}
+ console.log('getHostory', list.data)
// 总数
list.total = result.total
- console.log('list', list.data)
nextTick(() => {
param.callback && param.callback()
})
@@ -322,36 +321,20 @@
}
/**
- * 打开红包
+ * 打开红包详情
* @param {Object} ev
*/
function handleRedPacket(ev) {
messageItem.value = ev
- api.news.getRedbag({
- data: {
+ api.news.getRedPacketInfo({
+ query: {
// 红包id
- bagId: ev.payload.data.id
+ redPacketId: ev.callbackData.callback_json[0].businessId
}
}).then(rs => {
- console.log('getRedbag', rs)
if (rs.code == 200) {
- const result = rs.data
- messageItem.value.payload.data = {
- ...result,
- businessID: 'redPacket',
- }
-
- // 同步修改消息
- let message = {
- ...messageItem.value
- }
- message.payload.data = JSON.stringify(msg.payload.data)
-
- uni.$chat.modifyMessage(message).then(rs => {
- console.log('modifyMessage success', rs)
- }).catch(rs => {
- console.log('modifyMessage catch', rs)
- })
+ proxy.$refs.RedPacketRef.open()
+ Object.assign(redPacket, rs.data)
return
}
util.alert({
@@ -359,22 +342,30 @@
showCancel: false,
})
})
- proxy.$refs.RedPacket.open()
}
// 领取红包
function handleOpenReadPacket() {
- //
- if (messageItem.value.payload.data.status != 0) return
+ // 如果不能领取
+ if (redPacket.redStatus == false) return
+ // 红包过期
+ // if (redPacket.isStale == 1) return
- api.news.grabred({
- data: {
+
+ // 抢红包
+ api.news.getRedPacket({
+ query: {
// 红包id
- id: messageItem.value.payload.data.id
+ redPacketId: redPacket.id,
+ // 领取人id
+ userId: userinfo.value.id,
}
}).then(rs => {
if (rs.code == 200) {
- handleRedPacket(messageItem.value)
+ // 修改领取状态
+ redPacket.redStatus = false
+ // 获取金额
+ redPacket.amount = rs.data
return
}
util.alert({
@@ -518,36 +509,40 @@
-
+
-
+
-
+
- {{messageItem.nick}}的红包
+ {{redPacket.fromName}}的红包
- {{ messageItem.payload.data.name }}
+ {{ redPacket.blessing }}
+
+ 红包已过期
+ 来晚啦,红包已被抢完
-
+
+
已领取
- {{messageItem.payload.data.randomAmount}}
- 积分
- 余额
+ {{redPacket.amount}}
+ 余额
+ 积分
- 已
+ 已
开
-
+
diff --git a/jiuyi2/pages/news/chat/components/news-temp/index.vue b/jiuyi2/pages/news/chat/components/news-temp/index.vue
index f3250247..2143df0e 100644
--- a/jiuyi2/pages/news/chat/components/news-temp/index.vue
+++ b/jiuyi2/pages/news/chat/components/news-temp/index.vue
@@ -139,11 +139,11 @@
-
- {{ formatData.name }}
+ {{ formatData.data.blessing }}
diff --git a/jiuyi2/readme.md b/jiuyi2/readme.md
index 66d50349..94139315 100644
--- a/jiuyi2/readme.md
+++ b/jiuyi2/readme.md
@@ -299,6 +299,7 @@ call_type 通话类型 2为视频,1是音频
销量 分享到消息内的好友
投流推广
+推流收藏夹视频 商家视频显示出让佣金
设置最低、最多投流数量
我的收藏的点击视频详情展示 图表 投流列表
个人中心增加投流历史 按钮里面展示投流的总数据 (投流数据是每次投流 都是一条数据 还要显示xx用户看了这个视频 用户昵称只显示 一个字儿 只展示星号 两到三个字 展示第一个字儿和* 四个字及以上 1****9)
@@ -350,10 +351,8 @@ call_type 通话类型 2为视频,1是音频
长按二倍速
-
选择视频截帧
-
type
0 非好友
1 好友
diff --git a/jiuyi2/vite.config.js b/jiuyi2/vite.config.js
index 5ea0f893..df0bd00d 100644
--- a/jiuyi2/vite.config.js
+++ b/jiuyi2/vite.config.js
@@ -11,38 +11,38 @@ export default defineConfig({
proxy: {
"/system": {
// target: "http://192.168.0.189:8080",
- target: "http://192.168.0.102:8080",
- // target: "http://192.168.0.129:8080",
+ // target: "http://192.168.0.102:8080",
+ target: "http://192.168.0.129:8080",
changeOrigin: true,
},
"/shopify": {
// target: "http://192.168.0.189:8080",
- target: "http://192.168.0.102:8080",
- // target: "http://192.168.0.129:8080",
+ // target: "http://192.168.0.102:8080",
+ target: "http://192.168.0.129:8080",
changeOrigin: true,
},
"/user": {
// target: "http://192.168.0.189:8080",
- target: "http://192.168.0.102:8080",
- // target: "http://192.168.0.129:8080",
+ // target: "http://192.168.0.102:8080",
+ target: "http://192.168.0.129:8080",
changeOrigin: true,
},
"/coreplay": {
// target: "http://192.168.0.189:8080",
- target: "http://192.168.0.102:8080",
- // target: "http://192.168.0.129:8080",
+ // target: "http://192.168.0.102:8080",
+ target: "http://192.168.0.129:8080",
changeOrigin: true,
},
"/file": {
// target: "http://192.168.0.189:8080",
- target: "http://192.168.0.102:8080",
- // target: "http://192.168.0.129:8080",
+ // target: "http://192.168.0.102:8080",
+ target: "http://192.168.0.129:8080",
changeOrigin: true,
},
"/video": {
// target: "http://192.168.0.189:8080",
- target: "http://192.168.0.102:8080",
- // target: "http://192.168.0.129:8080",
+ // target: "http://192.168.0.102:8080",
+ target: "http://192.168.0.129:8080",
changeOrigin: true,
},
}