first commit

This commit is contained in:
wangxiaowei
2025-10-22 22:56:36 +08:00
commit 90c54df48b
302 changed files with 54312 additions and 0 deletions

View File

@ -0,0 +1,141 @@
<template>
<view class="live-menu">
<Popup :show="isPopup" :width="width" :height="height" :backgroundColor="backgroundColor" :boxShadow="boxShadow" :padding="0" @hidePopup="hidePopupFunc">
<view class="d-c-c d-c ww100 list-item" v-if="loading">
<button type="default" class="ww100 d-c-c" @tap="gotoLive">
<text class="iconfont"></text>
<text>直播</text>
</button>
<button type="default" class="ww100 mt20" @tap="addVideo">
<text class="iconfont"></text>
<text>发布短视频</text>
</button>
</view>
<view class="close-btns" @tap="hidePopupFunc(true)"><text class="icon iconfont icon-guanbi"></text></view>
</Popup>
</view>
</template>
<script>
import Popup from '@/components/uni-popup.vue';
export default {
components: {
Popup
},
data() {
return {
/*是否加载完成*/
loading:false,
/*是否显示*/
isPopup: false,
/*展示类别*/
type: 0,
/*宽度*/
width: 400,
/*高度*/
height: 400,
/*背景颜色*/
backgroundColor: 'none',
/*阴影*/
boxShadow: 'none',
/*是否是主播*/
is_agent:false,
/*个人信息*/
userInfo:{}
};
},
props: ['open'],
watch:{
open:function(n,o){
if(n!=o){
this.isPopup=n;
this.getData();
}
}
},
created() {
},
mounted() {
},
methods: {
/*获取数据*/
getData() {
let self = this;
self._get('user.index/detail', {}, function(res) {
self.is_agent = res.data.agent.is_agent;
self.userInfo = res.data.userInfo;
uni.hideLoading();
self.loading=true;
});
},
/*获取弹出层内容*/
setData() {
this.isPopup = true;
},
/*关闭弹窗*/
hidePopupFunc(e) {
this.$emit('close');
},
/*发布短视频*/
addVideo(){
this.hidePopupFunc();
let url='pages/user/my-video/add/add';
this.gotoPage(url);
},
/*直播*/
gotoLive(){
let self=this, url='';
if(self.userInfo.is_realname == 1){
self.hidePopupFunc();
url='pages/user/my-live/live/live';
self.gotoPage(url);
}else{
uni.showModal({
title: '提示',
content: '你还没有实名认证,前往实名认证',
success: function (res) {
if (res.confirm) {
url = '/pages/user/authentication/authentication';
self.gotoPage(url);
} else if (res.cancel) {
self.hidePopupFunc();
}
}
});
}
}
}
};
</script>
<style lang="scss">
.live-menu .list-item button{
height: 100rpx;
line-height: 100rpx;
}
.live-menu .close-btns {
margin: 50rpx auto 0;
width: 60rpx;
height: 60rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
background: none;
border: 2px solid #ffffff;
}
.live-menu .close-btns .iconfont {
color: #ffffff;
}
</style>

View File

@ -0,0 +1,145 @@
<template>
<view class="" v-if="detail.is_auto!=0 && hasTab" @click.stop>
<view class="foot-bottom"></view>
<view class="foot-tavbar-container d-a-c" :style="'background:'+detail.backgroundColor || '' + ';' "
v-if="detail.list!=''">
<view class="item d-c-c" :class="{'active':item.link_url == getRoute()}" v-for="(item, index) in detail.list"
:key="index" @click="tabBarFunc(item)">
<view style="height: 0;width: 0;opacity: 0;">{{getRoute()}}</view>
<view class="inner d-c-c d-c">
<image v-if="detail.type!=2" :src="item.link_url == getRoute()?item.selectedIconPath:item.iconPath"
mode="aspectFill">
</image>
<text v-if="detail.type!=1"
:style="item.link_url == getRoute()?'color:'+detail.textHoverColor+';':'color:'+detail.textColor+';'"
class="text-name">{{ item.text}}</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
/*当前选中*/
activeTabber: '首页',
/*打开直播菜单*/
open_liveMenu: false,
/*底部菜单*/
detail: {},
/*是否微信小程序*/
platform: 'wx',
hasTab: false
};
},
watch: {
},
created() {
let pages = getCurrentPages();
if (pages.length) {
let currentPage = pages[pages.length - 1];
if (currentPage.route == 'pages/index/index') {
this.$store.commit('changefootTab', '首页');
}
}
this.platform = this.getPlatform();
this.detail = uni.getStorageSync('TabBar');
this.getData();
},
methods: {
hasmenu() {
let self = this;
let curRoute = self.getRoute();
let res = self.detail.list.some(item => {
if (item.link_url == curRoute) {
return true
}
})
self.hasTab = res;
if (uni.getStorageSync('TabBar').is_auto && uni.getStorageSync('TabBar').is_auto != 0) {
uni.hideTabBar()
}
},
getRoute() {
let self = this;
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
let curRoute = '/' + routes[routes.length - 1].route //获取当前页面路由
if (curRoute == '/pages/diy-page/diy-page' || curRoute == '/pages/article/detail/detail') {
if (routes[routes.length - 1]['$page']) {
curRoute = routes[routes.length - 1]['$page'].fullPath
}
}
return curRoute
},
/*点击菜单*/
tabBarFunc(e) {
if (this.footTabberData.active == e.text) {
return
}
this.$store.commit('changefootTab', e.text);
this.gotoPage(e.link_url);
},
/*获取首页分类*/
getData() {
let self = this;
self._get('index/nav', {}, function(res) {
self.detail = res.data.vars.data;
uni.setStorageSync('TabBar', res.data.vars.data);
self.hasmenu();
});
},
}
};
</script>
<style lang="scss">
.foot-bottom {
width: 100%;
height: 98rpx;
padding-bottom: env(safe-area-inset-bottom);
}
.foot-tavbar-container {
box-shadow: 0 0 6rpx 0 rgba(0, 0, 0, 0.3);
position: fixed;
right: 0;
bottom: 0;
left: 0;
height: 98rpx;
background: #FFFFFF;
z-index: 90;
padding-bottom: env(safe-area-inset-bottom);
}
.foot-tavbar-container .item {
flex: 1;
height: 98rpx;
}
.foot-tavbar-container .item.add-btn .inner {
margin-bottom: 70rpx;
width: 100rpx;
height: 100rpx;
border-radius: 50%;
background: $dominant-color;
box-shadow: 0 0 10rpx 0 rgba(232, 38, 100, .6);
}
.foot-tavbar-container image {
width: 50rpx;
height: 50rpx;
}
.foot-tavbar-container .text-name {
font-size: 24rpx;
color: #666666;
}
.foot-tavbar-container .item.active .text-name {
color: #f8c341;
}
</style>