直播
144
api/live.js
Normal file
@ -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}`);
|
||||
}
|
168
components/gb-popup/gb-popup.vue
Normal file
@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<view class="men-ban box " v-if ='isShow' @touchmove.stop.prevent="">
|
||||
<view class="box_next">
|
||||
<view class="box_next_title">
|
||||
<text class="box_next_title_z">{{title}}</text>
|
||||
</view>
|
||||
<slot></slot>
|
||||
<view class="box_next_but_d" v-if="isBut">
|
||||
<view @click='show' class="box_next_but_d_but">
|
||||
<text class="box_next_but_d_but_text">{{nName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box_next_but_s" v-else>
|
||||
<view class="box_next_but_s_lbut" @click="lEvent">
|
||||
<text class="box_next_but_d_but_text">{{lName}}</text>
|
||||
</view>
|
||||
<view @click="rEvent" class="box_next_but_s_rbut" hover-class="zcolor-while1">
|
||||
<text class="box_next_but_d_but_text">{{rName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: "温馨提示"
|
||||
},
|
||||
isShow: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
nName: String,
|
||||
lName: String,
|
||||
rName: String,
|
||||
isBut: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
show() {
|
||||
|
||||
this.$emit('show');
|
||||
},
|
||||
lEvent() {
|
||||
this.$emit('lEvent');
|
||||
},
|
||||
rEvent() {
|
||||
this.$emit('rEvent');
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.men-ban {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 999999;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
.box {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
.box_next {
|
||||
background-color: #ffffff;
|
||||
width: 550rpx;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
|
||||
.box_next_title {
|
||||
padding: 30rpx 30rpx 0 30rpx;
|
||||
}
|
||||
|
||||
.box_next_title_z {
|
||||
font-size: 31rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.box_next_but_d {
|
||||
width: 550rpx;
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 130rpx;
|
||||
}
|
||||
|
||||
.box_next_but_d_but {
|
||||
width: 500rpx;
|
||||
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 80rpx;
|
||||
border-radius: 50rpx;
|
||||
background-color: #fee610;
|
||||
}
|
||||
|
||||
.box_next_but_d_but_text {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.box_next_but_s {
|
||||
width: 550rpx;
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
|
||||
flex-direction: row;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
height: 130rpx;
|
||||
}
|
||||
|
||||
.box_next_but_s_lbut {
|
||||
width: 200rpx;
|
||||
background-color: #f1f1f1;
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 80rpx;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
|
||||
.box_next_but_s_rbut {
|
||||
width: 200rpx;
|
||||
background-color: #fee610;
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 80rpx;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
</style>
|
2085
components/sd-live-page/histroy.nvue
Normal file
2088
components/sd-live-page/livepage.nvue
Normal file
BIN
static/img/X.png
Normal file
After Width: | Height: | Size: 897 B |
BIN
static/img/close.png
Normal file
After Width: | Height: | Size: 1006 B |
BIN
static/img/colse1.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
static/img/gn.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
static/img/jb.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
static/img/li.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
static/img/shanpin.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
static/img/zhi.png
Normal file
After Width: | Height: | Size: 148 KiB |
@ -28,9 +28,6 @@ function baseRequest(url, method, data, {
|
||||
}) {
|
||||
let Url = HTTP_REQUEST_URL,
|
||||
header = HEADER;
|
||||
|
||||
|
||||
|
||||
if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token;
|
||||
|
||||
return new Promise((reslove, reject) => {
|
||||
@ -50,7 +47,10 @@ function baseRequest(url, method, data, {
|
||||
else if ([410000, 410001, 410002, 40000].indexOf(res.data.status) !== -1) {
|
||||
|
||||
reject(res.data);
|
||||
} else if (res.data.status == 501) {
|
||||
} 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'
|
||||
})
|
||||
|
@ -8,7 +8,7 @@
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
import {
|
||||
HTTP_REQUEST_URL,
|
||||
|
||||
HTTP_REQUEST_URL_FOUR,
|
||||
HEADER,
|
||||
TOKENNAME
|
||||
@ -44,9 +44,9 @@ function baseRequest(url, method, data, {
|
||||
data: data || {},
|
||||
success: (res) => {
|
||||
// #ifdef APP-PLUS
|
||||
// console.log('app', Url + '/api/' + url, res.data);
|
||||
console.log('app', Url + '/api/' + url,res);
|
||||
// #endif
|
||||
// console.log(res.data.code)
|
||||
|
||||
if (noVerify)
|
||||
reslove(res.data, res);
|
||||
else if (res.data.status == 200)
|
||||
@ -54,7 +54,10 @@ function baseRequest(url, method, data, {
|
||||
else if ([410000, 410001, 410002, 40000].indexOf(res.data.status) !== -1) {
|
||||
|
||||
reject(res.data);
|
||||
} else if (res.data.status == 501) {
|
||||
} 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'
|
||||
})
|
||||
|
75
utils/requestc.js
Normal file
@ -0,0 +1,75 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
import {
|
||||
HTTP_REQUEST_URL,
|
||||
HEADER,
|
||||
TOKENNAME
|
||||
} from '@/config/live.js';
|
||||
|
||||
import store from '../store';
|
||||
/**
|
||||
* 发送请求
|
||||
*/
|
||||
function baseRequest(url, method, data, {
|
||||
noAuth = false,
|
||||
noVerify = false
|
||||
}) {
|
||||
let Url = HTTP_REQUEST_URL,
|
||||
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
|
||||
// console.log('app', Url + '/api/' + url, method);
|
||||
// #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;
|