chore(brand): 统一将品牌名从雄戈小酒更改为橙虎小酒

- 更新alisms插件配置中的签名值
- 修改shopro插件中所有SQL脚本的品牌名称引用
- 更新商城配置、商品分类、演示数据中的品牌名称
- 替换后台登录页面的品牌标识
- 更新汇付分账配置中的媒介名称
- 修改登录预览生成脚本中的品牌显示
```
这个提交包含在:
可乐加冰
2026-10-28 14:55:54 +08:00
父节点 8f7fae009e
当前提交 a8cdc763cb
共有 57 个文件被更改,包括 1265 次插入 和 2287 次删除

查看文件

@@ -1,163 +0,0 @@
<template>
<view>
<view class="video">
<video id="video" @play="handlePlayVideo" :title="detail.title" :src="$IMG_URL + detail.video"
controls></video>
</view>
<view class="content">
<view class="title">{{detail.title}}</view>
<view class="views">
<view class="left">
<view class="icon">
<image :src="$IMG_URL + '/assets/img/views_num.png'" mode=""></image>
<view class="num">{{detail.views}}</view>
</view>
<view class="icon">
<image :src="$IMG_URL + '/assets/img/play_num.png'" mode=""></image>
<view class="num">{{detail.play_num}}</view>
</view>
</view>
<view class="right">
{{detail.create_time}}
</view>
</view>
<view class="detail">
<view class="detail-title">
<image :src="$IMG_URL + '/assets/img/detail.png'" mode=""></image>
<view class="detail-text">视频详细介绍</view>
</view>
</view>
<view class="box" v-if="detail.content">
<u-parse :html="detail.content"></u-parse>
</view>
</view>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
detail: [],
isPlayNum: false
};
},
computed: {},
onLoad(o) {
this.getVideoDetail(o.id);
},
methods: {
// 获取视频详情
getVideoDetail(id) {
uni.showLoading({
title: '正在加载中...'
})
this.$http('video.detail', {
id
}).then(res => {
uni.hideLoading();
this.detail = res.data;
});
},
handlePlayVideo(e) {
// 统计播放量
if (!this.isPlayNum) {
this.$http('video.playNum', {
id: this.detail.id
}).then(res => {
this.isPlayNum = true;
this.$set(this.detail, 'play_num', parseInt(this.detail.play_num) + 1);
});
}
},
}
};
</script>
<style>
page {
background: #fff;
}
._image {
display: block;
width: 100%;
height: 360px;
margin-top: -360px;
opacity: 0;
}
#video {
width: 100%;
height: 570rpx;
}
.content {
margin: 20rpx;
}
.content .title {
font-size: 30rpx;
font-weight: bold;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
margin-bottom: 30rpx;
}
.content .views {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 50rpx;
}
.content .left {
display: flex;
align-items: center;
}
.content .left .icon {
display: flex;
align-items: center;
margin-right: 30rpx;
}
.content .left .icon image {
width: 42rpx;
height: 42rpx;
margin-right: 10rpx;
}
.content .left .icon {
color: #333;
font-size: 26rpx;
}
.content .right {
color: #a9a7a7;
font-size: 26rpx;
}
.detail {
margin: 30rpx 0;
}
.detail .detail-title {
display: flex;
align-items: center;
}
.detail .detail-title image {
width: 48rpx;
height: 48rpx;
margin-right: 10rpx;
}
.detail .detail-title .detail-text {
font-size: 32rpx;
font-weight: bold;
}
</style>

查看文件

@@ -1,169 +0,0 @@
<template>
<view>
<view v-if="list.length" class="box">
<view v-for="(item, index) of list" class="list" :key="index" @tap="$Router.push({ path: '/pages/app/video/detail', query: { id: item.id } })">
<view class="left">
<image :src="$IMG_URL + item.image" mode=""></image>
</view>
<view class="right">
<view class="title">{{item.title}}</view>
<view class="desc">{{item.desc}}</view>
<view class="bottom">
<view class="icon">
<image :src="$IMG_URL + '/assets/img/views_num.png'" mode=""></image>
<view class="num">{{item.views}}</view>
</view>
<view class="icon">
<image :src="$IMG_URL + '/assets/img/play_num.png'" mode=""></image>
<view class="num">{{item.play_num}}</view>
</view>
</view>
</view>
</view>
<view v-if="page < totalSize" class="loading">
<image :src="$IMG_URL + '/assets/img/loading-x.gif'" mode=""></image>
<view class="loading-text">正在加载中...</view>
</view>
</view>
<view v-else class="empty">
<u-empty text="暂无视频" mode="list"></u-empty>
</view>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
page: 1,
list: [],
totalSize: 1,
total: 0,
rows: 10
};
},
computed: {},
onLoad() {
this.getVideoList();
},
// 触底事件
onReachBottom() {
// 加载更多
if (this.page < this.totalSize) {
this.page += 1;
this.getVideoList();
}
},
methods: {
// 获取视频列表
getVideoList() {
this.$http('video.index', {
page: this.page
}).then(res => {
// 合并数据
this.list = [...this.list, ...res.data.list];
// 总页数
this.totalSize = res.data.totalSize;
// 总数据
this.total = res.data.total;
});
}
}
};
</script>
<style>
page {
background: #fff;
}
.empty {
margin-top: 80rpx;
}
.loading {
display: flex;
align-items: center;
justify-content: center;
}
.loading image {
width: 120rpx;
height: 120rpx;
}
.loading .loading-text {
font-size: 28rpx;
color: #333;
}
.box {
margin: 20rpx;
padding-bottom: 40rpx;
}
.box .list {
display: flex;
margin-bottom: 30rpx;
border-bottom: 2rpx solid #f5f3f3;
padding-bottom: 20rpx;
}
.box .list:last-child {
border: none;
}
.box .list .left {
margin-right: 20rpx;
}
.box .list .left image {
width: 310rpx;
height: 200rpx;
border-radius: 10rpx;
}
.box .list .right .title {
font-size: 26rpx;
font-weight: bold;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
margin-bottom: 10rpx;
}
.box .list .right .desc {
font-size: 24rpx;
color: #bfbfbf;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
margin-bottom: 10rpx;
height: 100rpx;
}
.box .list .bottom {
display: flex;
align-items: center;
}
.box .list .bottom .icon {
display: flex;
align-items: center;
margin-right: 30rpx;
}
.box .list .bottom .icon image {
width: 42rpx;
height: 42rpx;
margin-right: 10rpx;
}
.box .list .bottom .icon {
color: #333;
font-size: 26rpx;
}
</style>

查看文件

@@ -85,7 +85,6 @@ const TOOL_NAME_ALIAS = {
const EXTRA_ICON_MAP = {
'在线客服': 'uicon-server-man',
'开启直播': 'uicon-play-circle',
'我的预约': 'uicon-calendar'
};
@@ -122,7 +121,7 @@ export default {
Object.keys(apiMap).forEach(name => {
if (catalogNames.includes(name)) return;
if (name === '开启直播' && this.userInfo?.is_live != 1) return;
if (name === '开启直播') return;
const remote = apiMap[name];
merged.push({
name,
@@ -135,7 +134,7 @@ export default {
return merged.filter(item => {
if (isHiddenTool(item)) return false;
return item.name !== '开启直播' || this.userInfo?.is_live == 1;
return item.name !== '开启直播';
});
}
},
@@ -155,9 +154,6 @@ export default {
if (data.name === '我的预约' && !data.path) {
data.path = '/pages/user/rob-order';
}
if (data.name === '开启直播' && !data.path) {
data.path = '/pages/user/live';
}
if (!data.path) {
uni.showToast({ title: '功能暂未开放', icon: 'none' });
return;

查看文件

@@ -1,108 +0,0 @@
<template>
<view class="live-el u-m-p-20 u-m-b-10" v-if="showLive">
<view class="head">
<text class="head-title">{{ detail.name }}</text>
<view class="head-more u-flex u-col-center" @tap="$Router.push('/pages/app/live/list')">
<text class="u-m-r-10 more-text">更多直播</text>
<text class="iconfont icon-youjiantou-tianchong more-icon"></text>
</view>
</view>
<!-- 大图 -->
<view v-if="liveType == 1" v-for="live in liveList" :key="live.id"><shopro-live-card :type="1" :detail="live"></shopro-live-card></view>
<!-- 小图 -->
<view class="content-two" v-if="liveType == 2">
<view class="content-two__item" v-for="live in liveList" :key="live.id">
<shopro-live-card :type="2" :detail="live" :wh="345">
<block slot="liveGoods"><text></text></block>
</shopro-live-card>
</view>
</view>
</view>
</template>
<script>
/**
* 自定义之直播卡片
* @property {Object} detail - 直播信息
*/
export default {
components: {},
data() {
return {
liveList: [],
showLive: this.detail.ids,
liveType: this.detail.style
};
},
props: {
detail: {}
},
created() {
this.showLive && this.getLiveList();
},
computed: {},
methods: {
// 直播列表
getLiveList() {
let that = this;
that.$http('common.live', {
type: 'all',
ids: that.detail.ids
}).then(res => {
if (res.code === 1) {
that.liveList = res.data;
}
});
},
goRoom(live) {
wx.navigateTo({
url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${live.room_id}`
});
}
}
};
</script>
<style lang="scss">
.live-el {
background: #fff;
padding: 30rpx 20rpx;
.head {
display: flex;
justify-content: space-between;
align-items: center;
&-title {
font-size: 32rpx;
font-weight: bold;
color: rgba(51, 51, 51, 1);
}
&-more {
.more-text {
font-size: 22rpx;
font-weight: 500;
color: #333333;
}
.more-icon {
font-size: 24rpx;
color: #333333;
}
}
}
// 双图直播
.content-two {
width: 710rpx;
display: flex;
flex-wrap: wrap;
&__item {
margin-right: 20rpx;
margin-top: 20rpx;
width: 345rpx;
&:nth-child(2n) {
margin-right: 0;
}
}
}
}
</style>

查看文件

@@ -31,9 +31,6 @@
<sh-seckill v-if="item.type === 'seckill'" :detail="item.content"></sh-seckill>
<sh-groupon v-if="false && item.type === 'groupon'" :detail="item.content"></sh-groupon>
<sh-richtext v-if="item.type === 'rich-text'" :richId="item.content.id"></sh-richtext>
<!-- #ifdef MP-WEIXIN -->
<sh-live v-if="item.type === 'live' && HAS_LIVE" :detail="item.content"></sh-live>
<!-- #endif -->
</block>
</view>
<!-- 1+3 业务专区 -->
@@ -89,13 +86,6 @@
import ShoproProtocol from '@/components/shopro-protocol/shopro-protocol.vue'
import checkVersion from '@/pages/lq-upgrade/checkVersion.js'
// #ifdef MP-WEIXIN
import {
HAS_LIVE
} from '@/env';
import shLive from './components/sh-live.vue';
// #endif
import {
mapMutations,
mapActions,
@@ -119,16 +109,10 @@
privacyModal,
homeHead,
homeZoneGrid,
ShoproProtocol,
// #ifdef MP-WEIXIN
shLive
// #endif
ShoproProtocol
},
data() {
return {
// #ifdef MP-WEIXIN
HAS_LIVE: HAS_LIVE,
// #endif
isRefresh: true,
enable: false, //是否开启吸顶。

查看文件

@@ -8,7 +8,7 @@
<view class="brand-block">
<text class="brand-title u-ellipsis-1">{{ navTitle || '雄戈小酒' }}</text>
<text class="brand-title u-ellipsis-1">{{ navTitle || '橙虎小酒' }}</text>
<text class="brand-tagline u-ellipsis-1">臻选酱香 · 品质生活</text>
@@ -172,7 +172,7 @@ export default {
type: String,
default: '雄戈小酒'
default: '橙虎小酒'
}

查看文件

@@ -23,7 +23,7 @@
<sh-cell v-if="item.type === 'nav-list'" :list="item.content.list"></sh-cell>
<!-- 九宫格列表 -->
<view class="" style="width: 100%;padding-left: 20rpx;padding-right: 20rpx;box-sizing: border-box;">
<sh-grid v-if="item.type === 'grid-list'" :isLive="userData.is_live" :list="item.content.list"></sh-grid>
<sh-grid v-if="item.type === 'grid-list'" :list="item.content.list"></sh-grid>
</view>
<!-- 钱包 -->
<view class="" style="width: 100%;padding-left: 20rpx;padding-right: 20rpx;box-sizing: border-box;">

查看文件

@@ -49,10 +49,6 @@
<sh-wallet v-if="item.type === 'wallet-card'"></sh-wallet>
<!-- 订单卡片 -->
<sh-order-card v-if="item.type === 'order-card'"></sh-order-card>
<!-- 直播 -->
<!-- #ifdef MP-WEIXIN -->
<sh-live v-if="item.type === 'live' && HAS_LIVE" :detail="item.content"></sh-live>
<!-- #endif -->
</block>
</view>
<!-- 分类选项卡 -->
@@ -102,13 +98,6 @@
} from 'vuex';
import { filterHiddenTools } from '@/shopro/utils/hidden-tools';
// #ifdef MP-WEIXIN
import {
HAS_LIVE
} from '@/env';
import shLive from './components/sh-live.vue';
// #endif
// #ifdef H5
let listenMove = document.body; //禁止手机h5下拉刷新带动整个页面。
let handle = function(e) {
@@ -134,17 +123,11 @@
shSearch,
shCategoryTabs,
shoproLoading,
shPicAds,
// #ifdef MP-WEIXIN
shLive
// #endif
shPicAds
},
data() {
return {
pageData: false,
// #ifdef MP-WEIXIN
HAS_LIVE: HAS_LIVE,
// #endif
enable: false, //是否开启吸顶。
isScorll: false,
viewTemplate: [], //自定义模板数据

查看文件

@@ -1,216 +0,0 @@
<!-- 直播列表 -->
<template>
<view class="page_box">
<view class="head_box">
<view class="live-tab">
<view class="live-tab__item" v-for="tab in liveTab" :key="tab.title" @tap="selTab(tab.title)">
<view class="live-tab__item-name">{{ tab.name }}</view>
<text class="live-tab__item--link" :class="{ 'live-tab__item--active': tabCur === tab.title }"></text>
</view>
</view>
</view>
<view class="content_box">
<scroll-view enable-back-to-top scroll-y="true" @scrolltolower="loadMore" class="scroll-box">
<view class="u-waterfall" v-if="!isEmpty">
<view id="u-left-column" class="u-column">
<view class="u-flex u-row-center u-col-center u-m-b-20" v-for="live in leftList" :key="live.id">
<shopro-live-card :type="2" :detail="live"></shopro-live-card>
</view>
</view>
<view id="u-left-column" class="u-column">
<view class="u-flex u-row-center u-col-center u-m-b-20" v-for="live in rightList" :key="live.id">
<shopro-live-card :type="2" :detail="live"></shopro-live-card>
</view>
</view>
</view>
<!-- 更多 -->
<u-loadmore v-if="!isEmpty" height="80rpx" :status="loadStatus" color="#ccc" />
<!-- 置空页 -->
<u-empty :show="isEmpty" mode="list"></u-empty>
</scroll-view>
</view>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
tabCur: 'all',
isEmpty: false,
liveTab: [
{
title: 'all',
name: '全部'
},
{
title: 'notice',
name: '预告'
},
{
title: 'living',
name: '直播中'
},
{
title: 'lived',
name: '已结束'
}
],
liveList: [],
loadStatus: 'loadmore', //loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
currentPage: 1,
lastPage: 1,
// 瀑布流 300-220
addTime: 100, //排序间隙时间
leftHeight: 0,
rightHeight: 0,
leftList: [],
rightList: [],
tempList: []
};
},
computed: {},
onLoad() {
this.getLiveList();
},
onHide() {},
methods: {
// 瀑布流相关
async splitData() {
if (!this.tempList.length) return;
let item = this.tempList[0];
if (!item) return;
// 分左右
if (this.leftHeight < this.rightHeight) {
this.leftHeight += item.goods.length ? 300 : 220;
this.leftList.push(item);
} else if (this.leftHeight > this.rightHeight) {
this.rightHeight += item.goods.length ? 300 : 220;
this.rightList.push(item);
} else {
this.leftHeight += item.goods.length ? 300 : 220;
this.leftList.push(item);
}
// 移除临时列表的第一项,如果临时数组还有数据,继续循环
this.tempList.splice(0, 1);
if (this.tempList.length) {
setTimeout(() => {
this.splitData();
}, this.addTime);
}
},
clear() {
this.leftList = [];
this.rightList = [];
this.leftHeight = 0;
this.rightHeight = 0;
this.tempList = [];
},
// 切换tab
selTab(cur) {
if (this.tabCur !== cur) {
this.tabCur = cur;
this.liveList = [];
this.currentPage = 1;
this.lastPage = 1;
this.clear();
this.getLiveList();
}
},
// 加载更多
loadMore() {
if (this.currentPage < this.lastPage) {
this.currentPage += 1;
this.getLiveList();
}
},
// 直播列表
getLiveList() {
let that = this;
that.loadStatus = 'loading';
that.$http('common.live', {
type: that.tabCur,
page: that.currentPage
}).then(res => {
if (res.code === 1) {
that.liveList = [...that.liveList, ...res.data.data];
that.isEmpty = !that.liveList.length;
that.lastPage = res.data.last_page;
that.loadStatus = that.currentPage < res.data.last_page ? 'loadmore' : 'nomore';
that.tempList = res.data.data;
that.splitData();
}
});
}
}
};
</script>
<style lang="scss">
@mixin vue-flex($direction: row) {
/* #ifndef APP-NVUE */
display: flex;
flex-direction: $direction;
/* #endif */
}
.u-waterfall {
@include vue-flex;
flex-direction: row;
align-items: flex-start;
}
.u-column {
@include vue-flex;
flex: 1;
flex-direction: column;
height: auto;
}
// tab
.live-tab {
width: 100%;
height: 96rpx;
background: #fff;
display: flex;
&__item {
flex: 1;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
&__item-name {
font-size: 28rpx;
font-weight: bold;
color: rgba(51, 51, 51, 1);
flex: 1;
display: flex;
justify-content: center;
align-items: center;
}
&__item--link {
width: 68rpx;
height: 4rpx;
background: transparent;
border-radius: 2rpx;
}
&__item--active {
width: 68rpx;
height: 4rpx;
background: $brand-primary;
border-radius: 2rpx;
}
}
// 瀑布流 list
.scroll-box {
margin: 20rpx auto;
width: 730rpx;
}
</style>

查看文件

@@ -1,99 +0,0 @@
<template>
<view>
<template v-if="infoData.live == 1">
<video :src="infoData.liveUrl" :controls="false" autoplay
:style="{width: width + 'px',height:height + 'px'}">
</video>
<image style="width: 20px;height: 20px;position: fixed;top: 20px;left: 20px;" @click="backHome" src="../../static/live-back.png"></image>
</template>
<!-- <div class="live-box" v-else>
<image src="../../static/template_empty.png" style="width: 500rpx;" mode="widthFix"></image>
<text class="zwzb">暂无直播~</text>
</div> -->
<view class="empty-live" v-else>
<text style="color: lawngreen;
font-size: 40rpx;
font-weight: bold;">直播已结束</text>
<image src="../../static/live-icon.jpg" mode="" style="width: 140rpx;height: 140rpx;border-radius: 50%;margin-top: 100rpx;"></image>
<text style="color: #fff;margin-top: 10rpx;font-size: 24rpx;">雄戈小酒</text>
<view @click="backHome" style="position: absolute;bottom: 140rpx;width: 600rpx;height: 88rpx;background-color: #fff;border-radius: 60rpx;text-align: center;line-height: 88rpx;display: flex;align-items: center;justify-content: center;">
返回首页
</view>
</view>
<shopro-tabbar></shopro-tabbar>
</view>
</template>
<script>
export default {
data() {
return {
width: '',
height: '',
infoData: {}
}
},
methods: {
backHome() {
uni.switchTab({
url: '/pages/index/index'
})
},
getVideo(flag) {
const data = {}
if(flag) data.check = 1
uni.$http('common.getVideoUrl',data).then(res => {
if(flag) {
this.infoData.live = res.data.live
}else {
this.infoData = res.data
}
setTimeout(() => {
this.getVideo(true)
},5000)
}).catch(err => {
})
}
},
onShow() {
let info = uni.getSystemInfoSync()
this.width = info.windowWidth
this.height = info.windowHeight
this.getVideo()
}
}
</script>
<style scoped>
.live-box {
align-items: center;
padding-top: 200rpx;
}
.empty-live .title{
}
.empty-live{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #000;
align-items: center;
flex-direction: column;
padding-top: 100rpx;
}
.zwzb {
margin-top: 50rpx;
text-align: center;
color: #666;
font-size: 40rpx;
}
</style>

查看文件

@@ -119,7 +119,7 @@
</template>
<script>
const HOT_KEYWORDS = ['雄戈小酒', '礼盒装', '品鉴装', '酱香型', '单瓶装', '商务宴请'];
const HOT_KEYWORDS = ['橙虎小酒', '礼盒装', '品鉴装', '酱香型', '单瓶装', '商务宴请'];
export default {
data() {

查看文件

@@ -1,449 +0,0 @@
<template>
<div>
<view :style="{width: width + 'px',height:height + 'px'}" v-if="markact" class="mark">
<text class="mark-text">直播启动中...</text>
</view>
<view>
<view @click="returns" class="arrow-box">
<text class="jiesu">结束直播</text>
</view>
<live-pusher :beauty="beauty" :style="{width: width + 'px',height:height + 'px'}" id="livePusher" :url="url"
mode="FHD"></live-pusher>
<!-- 这是聊天室 -->
<!-- <view class="chat">
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
@scrolltolower="lower" @scroll="scroll">
<view class="chat-list" v-for="(it,i) in chatList" :key='i'>
<text class="chat-username">{{it.name}}:</text>
<text class="chat-usertext">{{it.text}}</text>
</view>
</scroll-view>
</view> -->
<!-- 这是功能按钮 -->
<view :style="{width: width + 'px'}" class="but">
<!-- <view @click="openMark(0)" class="meiyanbut">
<image class="but-img" src="../../static/zhiboshop.png"></image>
<text class="but-text">宝贝</text>
</view> -->
<view @click="openmeiyan" class="meiyanbut">
<image class="but-img" src="../../static/meiyan.png"></image>
<text v-if="beauty == 0" class="but-text">开启美颜</text>
<text v-if="beauty == 9" class="but-text">关闭美颜</text>
</view>
<view @click="switchCamera" class="meiyanbut">
<image class="but-img" src="../../static/qiehuan.png"></image>
<text class="but-text">切换摄像头</text>
</view>
</view>
<uni-popup ref="popup" type="bottom">
<!-- 这是商品弹窗 -->
<view class="shop-list-box" :style="{width: width + 'px'}" v-if="type == 0">
<text :style="{width: width + 'px'}" class="mark-title">直播商品</text>
<text @click="add()" class="add-shop">添加商品</text>
<scroll-view :style="{width: width + 'px'}" :scroll-top="scrollTop" scroll-y="true"
class="scroll-Ys" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll">
<view class="shop-list-list" v-for="(it,i) in shopArr" :key='i'>
<view>
<image class="shop-list-img" :src="it.img"></image>
</view>
<view>
<text class="shop-list-title">{{it.title}}</text>
<text class="shop-list-num">剩余{{it.num}}件</text>
<text class="shop-list-price">¥{{it.price}}</text>
</view>
<view class="shop-list-but-box">
<text class="shop-list-but">移除</text>
</view>
</view>
</scroll-view>
</view>
</uni-popup>
</view>
<!-- <u-modal :show="show" content='是否结束直播'></u-modal> -->
</div>
</template>
<script>
import uniPopup from "@/components/uni-popup/uni-popup.vue"
export default {
components: {
uniPopup
},
data() {
return {
show: false,
type: "",
width: '',
height: '',
url: '', //这是推流地址
enableCamera: false,
context: null,
markact: true,
arr: [],
shopArr: [{
img: '../../static/logo.png',
title: '测试商品',
price: '111',
num: '20',
},
{
img: '../../static/logo.png',
title: '测试商品',
price: '111',
num: '20',
},
{
img: '../../static/logo.png',
title: '测试商品',
price: '111',
num: '20',
},
{
img: '../../static/logo.png',
title: '测试商品',
price: '111',
num: '20',
},
{
img: '../../static/logo.png',
title: '测试商品',
price: '111',
num: '20',
}
],
chatList: [{
name: '用户01',
text: '哈哈哈哈哈'
},
{
name: '用户01',
text: '哈哈哈哈哈'
},
{
name: '用户01',
text: '哈哈哈哈哈'
},
{
name: '用户01',
text: '哈哈哈哈哈'
},
{
name: '用户01',
text: '哈哈哈哈哈'
},
{
name: '用户01',
text: '哈哈哈哈哈'
},
{
name: '用户01',
text: '哈哈哈哈哈'
},
{
name: '用户01',
text: '哈哈哈哈哈'
}
],
beauty: 0
};
},
onLoad() {
let info = uni.getSystemInfoSync()
this.width = info.windowWidth;
this.height = info.windowHeight;
uni.$http('common.getLiveAddr').then(res => {
this.url = res.data.liveUrl
})
},
onReady() {
this.context = uni.createLivePusherContext('livePusher', this);
setTimeout(() => {
this.startLive();
}, 1000)
},
methods: {
add() {
console.log('s')
},
// 0是宝贝弹窗,1是订单弹窗,2是工具弹窗,3是设置弹窗
openMark(type) {
this.type == type
this.$refs.popup.open()
},
openmeiyan() {
// this.$refs.popup.open()
if (this.beauty == 0) {
this.beauty = 9
} else {
this.beauty = 0
}
},
returns() {
let that = this
uni.showModal({
content: "是否结束直播",
cancelText: "取消",
confirmText: "结束",
success: (res) => {
if (res.confirm) {
that.stopLive()
}
}
})
// this.stopLive();
// uni.navigateBack({
// delta: 1
// })
},
EnableCamera() {
this.enableCamera = true;
},
startLive() {
let self = this;
this.context.start({
success: a => {
self.markact = false;
console.log('livePusher.start:' + JSON.stringify(a));
}
});
},
stopLive() {
uni.$http('common.endLive').then(res => {
uni.navigateBack()
})
// this.context.stop({
// success: a => {
// console.log(JSON.stringify(a));
// }
// });
},
switchCamera() {
this.context.switchCamera({
success: (a) => {
console.log("livePusher.switchCamera:" + JSON.stringify(a));
}
});
}
}
}
</script>
<style>
.add-shop {
font-size: 16px;
color: #333333;
position: absolute;
top: 20px;
left: 20px;
z-index: 10;
}
.shop-list-but-box {
position: absolute;
bottom: 10px;
right: 20px;
display: flex;
align-items: center;
justify-content: flex-end;
flex-direction: row;
}
.shop-list-but {
color: white;
border-radius: 2px;
font-size: 16px;
background-color: #D4237A;
padding: 10px 20px 10px 20px;
}
.mark-title {
padding-top: 20px;
padding-bottom: 20px;
text-align: center;
font-size: 20px;
}
.shop-list-img {
margin-right: 10px;
width: 100px;
height: 100px;
}
.shop-list-title {
font-size: 20px;
color: #333333;
}
.shop-list-num {
font-size: 16px;
color: #C0C0C0;
padding-top: 10px;
}
.shop-list-price {
font-size: 16px;
color: #D4237A;
padding-top: 10px;
}
.scroll-Ys {
background-color: white;
height: 300px;
width: 100%;
}
.shop-list-box {
position: relative;
background-color: white;
width: 100%;
height: 380px;
}
.shop-list-list {
position: relative;
padding-top: 5px;
padding-bottom: 5px;
display: flex;
align-items: flex-start;
flex-direction: row;
}
.chat-username {
font-size: 18px;
color: white;
}
.chat-usertext {
font-size: 16px;
color: white;
}
.chat-list {
margin-top: 5px;
display: flex;
align-items: center;
justify-content: flex-start;
flex-direction: row;
background-color: rgba(0, 0, 0, .5);
padding: 5px 10px 5px 10px;
border-radius: 3px;
}
.scroll-Y {
height: 150px;
width: 250px;
}
.chat {
position: fixed;
z-index: 10;
bottom: 80px;
}
.but-img {
width: 20px;
height: 20px;
}
.meiyanbut {
padding: 10px 20px 10px 20px;
margin-left: 20px;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.but-text {
padding-top: 3px;
font-size: 13px;
color: white;
}
.id {
font-size: 14px;
color: white;
}
.text-box {
font-size: 12px;
color: white;
}
.user-img {
margin-right: 5px;
width: 30px;
height: 30px;
border-radius: 50%;
}
.mark-text {
color: white;
font-size: 20px;
}
.mark {
position: fixed;
top: 0px;
background-color: #000000;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.but {
background-color: rgba(0, 0, 0, .4);
position: fixed;
bottom: 0px;
display: flex;
align-items: center;
flex-direction: row;
padding-bottom: 20px;
}
.tui {
width: 200px;
height: 200px;
}
.arrow-box {
position: fixed;
top: 60px;
left: 20px;
z-index: 10;
border-radius: 20px;
background-color: rgba(0, 0, 0, .4);
}
.arrow-boxs {
padding: 10px 20px 10px 20px;
display: flex;
align-items: center;
flex-direction: row;
position: fixed;
top: 60px;
left: 140px;
z-index: 10;
border-radius: 30px;
background-color: rgba(0, 0, 0, .4);
}
.jiesu {
padding: 10px 20px 10px 20px;
color: white;
font-size: 16px;
}
.arrow {
width: 15px;
height: 15px;
}
</style>

查看文件

@@ -1,441 +0,0 @@
<template>
<view>
<view :style="{width: width + 'px',height:height + 'px'}" v-if="showMarkact" class="mark">
<text class="mark-text">直播准备中...</text>
</view>
<live-pusher v-else :beauty="beauty" :whiteness="whiteness" :style="{width: width + 'px',height:height + 'px'}"
id="livePusher" :url="url" mode="FHD"></live-pusher>
<!-- 这是功能按钮 -->
<view :style="{width: width + 'px'}" class="but">
<view @click="handleBackUser" class="meiyanbut">
<image class="but-img" src="../../static/live-back.png"></image>
<text class="but-text">返回</text>
</view>
<view @click="handelBeauty" class="meiyanbut">
<template v-if="beauty == 0">
<image class="but-img" src="../../static/live-love.png"></image>
<text class="but-text">美颜</text>
</template>
<template v-else>
<image class="but-img" src="../../static/live-love-active.png"></image>
<text class="but-text live-text">美颜</text>
</template>
</view>
<view @click="handelOpenLive" class="meiyanbut">
<template v-if="!liveStatus">
<image class="but-img" src="../../static/live-open.png"></image>
<text class="but-text">开播</text>
</template>
<template v-else>
<image class="but-img" src="../../static/live-open-active.png"></image>
<text class="but-text live-text">开播</text>
</template>
</view>
<view @click="handelWhiteness" class="meiyanbut">
<template v-if="whiteness == 0">
<image class="but-img" src="../../static/live-white.png"></image>
<text class="but-text">美白</text>
</template>
<template v-else>
<image class="but-img" src="../../static/live-white-active.png"></image>
<text class="but-text live-text">美白</text>
</template>
</view>
<view @click="handelSwitchCamera" class="meiyanbut">
<template v-if="!camera">
<image class="but-img" src="../../static/live-video.png"></image>
<text class="but-text">切换摄像头</text>
</template>
<template v-else>
<image class="but-img" src="../../static/live-video-active.png"></image>
<text class="but-text live-text">切换摄像头</text>
</template>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
show: false,
type: "",
width: '',
height: '',
url: '', // 这是推流地址
camera: false,
context: null,
showMarkact: true,
liveStatus: false,
beauty: 0,
whiteness: 0
};
},
// 页面加载
onLoad() {
// 获取手机信息
let info = uni.getSystemInfoSync();
this.width = info.windowWidth;
this.height = info.windowHeight;
},
// 页面完成
onReady() {
this.context = uni.createLivePusherContext('livePusher', this);
// setTimeout(() => {
// this.startLive();
// }, 1000)
},
// 页面卸载
onUnload() {
if (this.liveStatus) {
this.handelStopLive();
}
},
methods: {
// 开启关闭直播
handelOpenLive() {
if (!this.liveStatus) {
uni.showModal({
title: '温馨提示',
content: '您是否要开启直播?',
cancelText: '取消',
confirmText: '开启',
success: res => {
if (res.confirm) {
this.handleOpenLive();
}
}
});
} else {
uni.showModal({
title: '温馨提示',
content: '你是否要关闭直播?',
cancelText: '取消',
confirmText: '关闭',
success: res => {
if (res.confirm) {
this.handelStopLive();
}
}
});
}
},
// 返回个人中心
handleBackUser() {
if (this.liveStatus) {
uni.showModal({
title: '温馨提示',
content: '您当前正在直播中是否要返回?',
cancelText: '取消',
confirmText: '返回',
success: res => {
if (res.confirm) {
// this.handelStopLive();
uni.switchTab({
url: '/pages/index/user'
})
}
}
});
} else {
uni.switchTab({
url: '/pages/index/user'
})
}
},
// 开启直播
handleOpenLive() {
uni.showLoading({
title: '直播开启中...',
mask: true,
})
uni.$http('common.getLiveAddr').then(res => {
this.liveStatus = true;
this.showMarkact = false;
this.url = res.data.liveUrl;
this.startLive();
}).finally(() => {
uni.hideLoading();
});
},
// 关闭直播
handelStopLive() {
uni.showLoading({
title: '直播关闭中...',
mask: true,
})
uni.$http('common.endLive').then(res => {
this.liveStatus = false;
this.showMarkact = true;
this.url = '';
this.stopLive();
}).finally(() => {
uni.hideLoading();
});
},
// 美颜
handelBeauty() {
if (this.liveStatus) {
this.beauty = this.beauty == 0 ? 9 : 0
}
},
// 美白
handelWhiteness() {
if (this.liveStatus) {
this.whiteness = this.whiteness == 0 ? 9 : 0
}
},
// 开启推流
startLive() {
let self = this;
self.context.start({
success: res => {
console.log('livePusher.start:' + JSON.stringify(res));
}
});
},
// 停止推流
stopLive: function() {
this.context.stop({
success: res => {
console.log(JSON.stringify(res));
}
});
},
// 切换摄像头
handelSwitchCamera() {
let self = this;
if (self.liveStatus) {
self.context.switchCamera({
success: res => {
console.log(res);
self.camera = true;
console.log("livePusher.switchCamera:" + JSON.stringify(res));
}
});
}
}
}
}
</script>
<style>
.live-text {
color: #f4ea29 !important;
}
.add-shop {
font-size: 16px;
color: #333333;
position: absolute;
top: 20px;
left: 20px;
z-index: 10;
}
.shop-list-but-box {
position: absolute;
bottom: 10px;
right: 20px;
display: flex;
align-items: center;
justify-content: flex-end;
flex-direction: row;
}
.shop-list-but {
color: white;
border-radius: 2px;
font-size: 16px;
background-color: #D4237A;
padding: 10px 20px 10px 20px;
}
.mark-title {
padding-top: 20px;
padding-bottom: 20px;
text-align: center;
font-size: 20px;
}
.shop-list-img {
margin-right: 10px;
width: 100px;
height: 100px;
}
.shop-list-title {
font-size: 20px;
color: #333333;
}
.shop-list-num {
font-size: 16px;
color: #C0C0C0;
padding-top: 10px;
}
.shop-list-price {
font-size: 16px;
color: #D4237A;
padding-top: 10px;
}
.scroll-Ys {
background-color: white;
height: 300px;
width: 100%;
}
.shop-list-box {
position: relative;
background-color: white;
width: 100%;
height: 380px;
}
.shop-list-list {
position: relative;
padding-top: 5px;
padding-bottom: 5px;
display: flex;
align-items: flex-start;
flex-direction: row;
}
.chat-username {
font-size: 18px;
color: white;
}
.chat-usertext {
font-size: 16px;
color: white;
}
.chat-list {
margin-top: 5px;
display: flex;
align-items: center;
justify-content: flex-start;
flex-direction: row;
background-color: rgba(0, 0, 0, .5);
padding: 5px 10px 5px 10px;
border-radius: 3px;
}
.scroll-Y {
height: 150px;
width: 250px;
}
.chat {
position: fixed;
z-index: 10;
bottom: 80px;
}
.but-img {
width: 20px;
height: 20px;
}
.meiyanbut {
padding: 30rpx;
margin-left: 20rpx;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.but-text {
padding-top: 3px;
font-size: 13px;
color: white;
}
.id {
font-size: 14px;
color: white;
}
.text-box {
font-size: 12px;
color: white;
}
.user-img {
margin-right: 5px;
width: 30px;
height: 30px;
border-radius: 50%;
}
.mark-text {
color: white;
font-size: 20px;
}
.mark {
position: fixed;
top: 0;
background-color: #000000;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.but {
background-color: rgba(0, 0, 0, .4);
position: fixed;
bottom: 0;
display: flex;
align-items: center;
flex-direction: row;
padding-bottom: 30rpx;
justify-content: center;
}
.tui {
width: 200px;
height: 200px;
}
.arrow-box {
position: fixed;
top: 60px;
left: 20px;
z-index: 10;
border-radius: 20px;
background-color: rgba(0, 0, 0, .4);
}
.arrow-boxs {
padding: 20rpx 20px 10px 20px;
display: flex;
align-items: center;
flex-direction: row;
position: fixed;
top: 60px;
left: 140px;
z-index: 10;
border-radius: 30px;
background-color: rgba(0, 0, 0, .4);
}
.jiesu {
padding: 10px 20px 10px 20px;
color: white;
font-size: 16px;
}
.arrow {
width: 15px;
height: 15px;
}
</style>