diff --git a/api/live.js b/api/live.js new file mode 100644 index 0000000..a1d1b84 --- /dev/null +++ b/api/live.js @@ -0,0 +1,144 @@ +import request from "@/utils/requestc.js"; +import requesta from "@/utils/request.js"; +/** + * 直播列表 + */ +export function live(data) { + return request.get("zhibo/live" ,data); +} + +/** + * 直播详情 + */ +export function liveDetail(data) { + return request.get("zhibo/liveDetail" ,data); +} + + +/** + * 获取直播详情接口 + */ + + +/** + * 创建直播间 + */ +export function createPushLive(data) { + return request.post("zhibo/createPushLive", data); +} + + +/** + * 关闭直播间 + */ +export function stopPushLive(data) { + return request.post("zhibo/stopPushLive", data); +} + + +/** + * 绑定用户client客户 + */ +export function bindUser(data) { + return request.post("zhibo/bindUser", data); +} + + + +/** + * 加入直播间聊天室 + */ +export function joinChatRoom(data) { + return request.post("zhibo/joinChatRoom", data); +} + + +/** + * 直播间聊天室发言 + */ +export function sendGroupMessage(data) { + return request.post("zhibo/sendGroupMessage", data); +} + + + +//商品列表 +export function good(data) { + return requesta.get("product/spu/lst", data); +} + +/** + * 获取用户信息 + * + */ +export function getUserInfo() { + return request.get('user'); +} + + +//关注 +export function getfans(id,data) { + return requesta.post('community/fans/'+id,data); +} + +//我关注的人 +export function getfocuslst(data) { + return requesta.post('community/focus/lst',data); +} + +//关注我的人 +export function getfanslst(data) { + return requesta.post('community/fans/lst',data); +} + +//用户送礼 +export function reward(data) { + return request.post('zhibo/reward',data); +} +//获取礼物 +export function rewardList(data) { + return requesta.get('zhibo/rewardList',data); +} + +//获取礼物 +export function giftList(data) { + return request.get('zhibo/giftList',data); +} + +//获取房间人数 +export function liveAudience(data) { + return request.get('zhibo/liveAudience',data); +} + +//获取用户余额 +export function getuser(data) { + return requesta.get('user',data); +} + + +//送礼 +export function sendGift(data) { + return request.post('zhibo/sendGift',data); +} + +/** + * 充值金额选择 + */ +export function getRechargeApi() { + return requesta.get("common/recharge_quota"); +} + +//历史直播记录 + +export function playbackList(data) { + return request.get("zhibo/playbackList",data); +} + +//获取直播回放详情 +export function playbackDetail(data) { + return request.get("zhibo/playbackDetail",data); +} +//获取观众关注主播状态 +export function getAjuser(id) { + return requesta.get(`community/user/info/${id}`); +} \ No newline at end of file diff --git a/components/gb-popup/gb-popup.vue b/components/gb-popup/gb-popup.vue new file mode 100644 index 0000000..fe710e0 --- /dev/null +++ b/components/gb-popup/gb-popup.vue @@ -0,0 +1,169 @@ + + + + + {{title}} + + + + + {{nName}} + + + + + {{lName}} + + + {{rName}} + + + + + + + + + + \ No newline at end of file diff --git a/components/mh-msgList/mh-msgList.vue b/components/mh-msgList/mh-msgList.vue new file mode 100644 index 0000000..859ef21 --- /dev/null +++ b/components/mh-msgList/mh-msgList.vue @@ -0,0 +1,183 @@ + + + + + + + + + {{i}} + {{i}} + {{i}} + + + + + + + + + + + + {{i}} + {{i}} + {{i}} + + + + + + + + + \ No newline at end of file diff --git a/components/sd-live-page/histroy.nvue b/components/sd-live-page/histroy.nvue new file mode 100644 index 0000000..ca19d54 --- /dev/null +++ b/components/sd-live-page/histroy.nvue @@ -0,0 +1,2085 @@ + + + + + + + + + + {{room.live_name.length>6?room.live_name.substring(0, 6)+'...': room.live_name}} + + + 4000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 礼物 + + + + {{now_money}} + + + + + + + + + + + + + + + + {{litem.gift_name}} + + + + + {{litem.gift_price}} + + + 赠送 + + + + + + + + + + + + + + {{roomDetail.live_name}} + + + + + + + + + + + + {{litem.app_goods_name}} + + + ¥ + {{litem.app_goods_price.split('.')[0]}}. + {{litem.app_goods_price.split('.')[1]}} + + 去抢购 + + + + + + + + + + + + + + + 我的金币 + + + + + + + + 金币充值 + + + + + + + + 最低可充值1元 + + + {{item.data.give}}金币 + {{item.data.price}}元 + + + + + + 立即充值 + + + + + + + + + + + + + + + + {{gift.app_user_name}} + 送{{room.app_user_name}}{{gift.gift_name}} + + + + + + + + {{gift.gift_num}} + + + + + + + + + 2 + + + {{join.message}} + + + + + + + + + + + + + + \ No newline at end of file diff --git a/components/sd-live-page/livepage.nvue b/components/sd-live-page/livepage.nvue new file mode 100644 index 0000000..b819c2d --- /dev/null +++ b/components/sd-live-page/livepage.nvue @@ -0,0 +1,2110 @@ + + + + + + + + + + {{room.live_name.length>6?room.live_name.substring(0, 6)+'...': room.live_name}} + + + 4000 + + + + 关注 + 已关注 + + + + + + + + + + + + + + {{users.length}} + + + + + + + + + + + + + + + + + + + + + + + + 发送 + + + + + + + 说点什么.. + + + + + + + + + + + + + + + + + + + + + + + + + + 礼物 + + + + {{now_money}} + + + + + + + + + + + + + + + + {{litem.gift_name}} + + + + + {{litem.gift_price}} + + + 赠送 + + + + + + + + + + + + + + {{roomDetail.live_name}} + + + + + + + + + + + + {{litem.app_goods_name}} + + + ¥ + {{litem.app_goods_price.split('.')[0]}}. + {{litem.app_goods_price.split('.')[1]}} + + 去抢购 + + + + + + + + + + + + + + + 我的金币 + + + + + + + + 金币充值 + + + + + + + + 最低可充值1元 + + + {{item.data.give}}金币 + {{item.data.price}}元 + + + + + + 立即充值 + + + + + + + + + + + + + + + + {{gift.app_user_name}} + 送{{room.app_user_name}}{{gift.gift_name}} + + + + + + + + {{gift.gift_num}} + + + + + + + + + 2 + + + {{join.message}} + + + + + + + + + + + + + + \ No newline at end of file diff --git a/components/unipopup/live-uni-popup.vue b/components/unipopup/live-uni-popup.vue new file mode 100644 index 0000000..134c831 --- /dev/null +++ b/components/unipopup/live-uni-popup.vue @@ -0,0 +1,241 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/components/unipopup/uni-popup.vue b/components/unipopup/uni-popup.vue new file mode 100644 index 0000000..7408094 --- /dev/null +++ b/components/unipopup/uni-popup.vue @@ -0,0 +1,241 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/app.js b/config/app.js index 72b12bf..9bfd4f2 100644 --- a/config/app.js +++ b/config/app.js @@ -7,6 +7,7 @@ let httpApi let httpApiTwo let httpApiThree let httpApiFour +let httpApiFive // 在打包之前请检查当前环境是否正确 const env = 'dev'; // 开发 @@ -31,6 +32,7 @@ switch (env) { httpApiTwo = "https://nk.lihaink.cn" httpApiThree = 'http://ceshi-oa.lihaink.cn' httpApiFour = 'https://ceshi-worker-task.lihaink.cn' + httpApiFive = 'https://ceshi-zhibo.lihaink.cn' } @@ -39,6 +41,7 @@ switch (env) { // 聊天接口修改此字符 小程序聊天要求wss 例如:wss://mer.crmeb.net // let wsApi = 'ws://192.168.3.20:8324' let wsApi = 'wss://shop.lihaink.cn' +let wsApi_one = 'wss://ceshi-zhibo.lihaink.cn/chat_room' module.exports = { // 请求域名 格式: https://您的域名 // #ifdef MP || APP-PLUS @@ -47,19 +50,23 @@ module.exports = { HTTP_REQUEST_URL_TWO: httpApiTwo, HTTP_REQUEST_URL_THREE: httpApiThree, HTTP_REQUEST_URL_FOUR: httpApiFour, + HTTP_REQUEST_URL_FIVE: httpApiFive, VUE_APP_WS_URL: `${wsApi}?type=user`, + VUE_APP_WS_URL_ONE:wsApi_one, // #endif // #ifdef H5 //H5接口是浏览器地址 HTTP_REQUEST_URL: process.env.NODE_ENV == 'development'? httpApi : window.location.protocol + "//" + window.location.host, HTTP_REQUEST_URL_TWO: httpApiTwo, + HTTP_REQUEST_URL_FIVE: httpApiFive, HTTP_REQUEST_URL_FOUR: window.location.host == 'shop.lihaink.cn' ?'https://worker-task.lihaink.cn':window.location.host == 'test.shop.lihaink.cn'?'https://preview-worker-task.lihaink.cn':'https://ceshi-worker-task.lihaink.cn', // 聊天长连接地址 VUE_APP_WS_URL: wsApi ? `${wsApi}?type=user` : VUE_APP_WS_URL, // #endif openPlantGrass: openPlantGrass, + HEADER: { 'content-type': 'application/json', //#ifdef H5 diff --git a/pages.json b/pages.json index ad43be1..c4e8e9f 100644 --- a/pages.json +++ b/pages.json @@ -64,6 +64,27 @@ "navigationBarTitleText": "购物车" } }, + { + "path": "pages/room/index", + "style": { + "navigationBarTitleText": "直播列表", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/room/spectator", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "直播间" + } + } + ,{ + "path": "pages/room/histroyroom", + "style": { + "navigationBarTitleText": "历史直播间", + "navigationStyle": "custom" + } + }, { "path": "pages/plant_grass/index", "style": { diff --git a/pages/gather/gather.vue b/pages/gather/gather.vue index 1b682ec..9d9670e 100644 --- a/pages/gather/gather.vue +++ b/pages/gather/gather.vue @@ -210,6 +210,16 @@ url: 'https://ceshi-worker-task.lihaink.cn/uploads/files/20231019/20231019151519e8f484737.wgt', }, 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, + } // { // name: '大屏控制', diff --git a/pages/index/index.vue b/pages/index/index.vue index cd1760d..15d39e5 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -38,6 +38,9 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/room/index.vue b/pages/room/index.vue new file mode 100644 index 0000000..728e433 --- /dev/null +++ b/pages/room/index.vue @@ -0,0 +1,482 @@ + + + + + + + + + 搜索 + + + + + + {{item.name}} + + + + + + + + + + + + + {{room.live_name}} + + + + + + 直播中 + + 已停播 + + + + + + + + + + + {{i}} + + + + + + {{room.live_name}} + + + + + + + 直播中 + + 已停播 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/room/spectator.nvue b/pages/room/spectator.nvue new file mode 100644 index 0000000..1ce042d --- /dev/null +++ b/pages/room/spectator.nvue @@ -0,0 +1,359 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/applet/live.png b/static/applet/live.png new file mode 100644 index 0000000..c49bea1 Binary files /dev/null and b/static/applet/live.png differ diff --git a/static/img/X.png b/static/img/X.png new file mode 100644 index 0000000..74f2523 Binary files /dev/null and b/static/img/X.png differ diff --git a/static/img/close.png b/static/img/close.png new file mode 100644 index 0000000..74ea90c Binary files /dev/null and b/static/img/close.png differ diff --git a/static/img/colse1.png b/static/img/colse1.png new file mode 100644 index 0000000..4c0e6c1 Binary files /dev/null and b/static/img/colse1.png differ diff --git a/static/img/gn.png b/static/img/gn.png new file mode 100644 index 0000000..c0bc715 Binary files /dev/null and b/static/img/gn.png differ diff --git a/static/img/jb.png b/static/img/jb.png new file mode 100644 index 0000000..2edce60 Binary files /dev/null and b/static/img/jb.png differ diff --git a/static/img/li.png b/static/img/li.png new file mode 100644 index 0000000..9e57558 Binary files /dev/null and b/static/img/li.png differ diff --git a/static/img/shanpin.png b/static/img/shanpin.png new file mode 100644 index 0000000..d4437e6 Binary files /dev/null and b/static/img/shanpin.png differ diff --git a/static/img/zhi.png b/static/img/zhi.png new file mode 100644 index 0000000..c9e7420 Binary files /dev/null and b/static/img/zhi.png differ diff --git a/utils/requestc.js b/utils/requestc.js new file mode 100644 index 0000000..20f5b52 --- /dev/null +++ b/utils/requestc.js @@ -0,0 +1,71 @@ +// +---------------------------------------------------------------------- +// | CRMEB [ CRMEB赋能开发者,助力企业发展 ] +// +---------------------------------------------------------------------- +// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved. +// +---------------------------------------------------------------------- +// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 +// +---------------------------------------------------------------------- +// | Author: CRMEB Team +// +---------------------------------------------------------------------- +import { + HTTP_REQUEST_URL_FIVE, + HEADER, + TOKENNAME +} from '@/config/app.js'; + +import store from '../store'; +/** + * 发送请求 + */ +function baseRequest(url, method, data, { + noAuth = false, + noVerify = false +}) { + let Url = HTTP_REQUEST_URL_FIVE, + header = HEADER; + if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token; + + return new Promise((reslove, reject) => { + uni.request({ + url: Url + '/api/' + url, + method: method || 'GET', + header: header, + data: data || {}, + success: (res) => { + // #ifdef APP-PLUS + + // #endif + if (noVerify) + reslove(res.data, res); + else if (res.data.status == 200) + reslove(res.data, res); + else if ([410000, 410001, 410002, 40000].indexOf(res.data.status) !== -1) { + + reject(res.data); + } else if (res.data.code==0||res.data.code==1) { + reslove(res.data, res); + }else if (res.data.status == 501) { + uni.reLaunch({ + url: '/pages/error/index' + }) + reject(res.data); + } else + reject(res.data.message || '系统错误'); + }, + fail: (message) => { + console.log(url, method, data) + reject('请求失败',message); + } + }) + }); +} + +const request = {}; + +['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach((method) => { + request[method] = (api, data, opt) => baseRequest(api, method, data, opt || {}) +}); + + + +export default request; \ No newline at end of file