当前位置: 首页 > news >正文

视频直播app开发网站什么样建网站

视频直播app开发网站,什么样建网站,东营网站优化,电商网站支付接口1、进入页面默认是竖屏当手机横着的时候页面也跟着横着 进入页面开启定时器调用相关api去触发横屏竖屏#xff0c;主要核心代码都在onShow()里面和onHide()里 template view classmonitoru-no-network/u-no-networkweb-view …1、进入页面默认是竖屏当手机横着的时候页面也跟着横着 进入页面开启定时器调用相关api去触发横屏竖屏主要核心代码都在onShow()里面和onHide()里 template view classmonitoru-no-network/u-no-networkweb-view :srcurl v-ifurl :webview-styleswebviewStyles/web-view /view /templatescriptlet watchScheen;import {getProjectHref} from /api/api.jsexport default {data() {return {url:,webviewStyles:{progress:{background:#FF3333,},},}},watch: {projectInfo(newVal,oldVal) {this.init();}},computed:{// 项目详情projectInfo(){return this.$store.state.projectInfo || {}},},onShow() {// 进入web-view页面// unlockOrientation 解锁// lockOrientation 锁定// portrait-primary, //可选字符串类型支持竖屏// portrait-secondary, //可选字符串类型支持反向竖屏// landscape-primary, //可选字符串类型支持横屏// landscape-secondary //可选字符串类型支持反向横屏// #ifdef APP-PLUSplus.screen.unlockOrientation(portrait-primary);/* 5环境屏幕旋转 */watchScheen setInterval((){// 屏幕方向数值 HOME键在右, 0 - 竖屏 90 - 横屏 HOME键在左, 180 - 反向竖屏 -90 - 反向横屏;let c plus.navigator.getOrientation();if(c 0){console.log(竖屏,c)plus.screen.lockOrientation(portrait-primary); //锁定竖屏plus.navigator.setStatusBarStyle(dark);plus.screen.unlockOrientation();uni.showTabBar()} else if(c 180){console.log(反向竖屏,c)plus.screen.lockOrientation(portrait-secondary); //锁定横屏plus.navigator.setStatusBarStyle(dark);plus.screen.unlockOrientation();uni.hideTabBar()} else if(c -90){console.log(反向横屏,c)plus.screen.lockOrientation(landscape-secondary); //锁定反向横屏plus.navigator.setStatusBarStyle(dark);plus.screen.unlockOrientation();uni.hideTabBar()} else {console.log(横屏,c)plus.screen.lockOrientation(landscape-primary); //锁定反向横屏plus.navigator.setStatusBarStyle(dark);plus.screen.unlockOrientation();uni.hideTabBar()}},200)// #endifuni.setNavigationBarTitle({title:监控})this.init()},onHide() {clearInterval(watchScheen)// #ifdef APP-PLUS/* 5环境锁定屏幕方向 */plus.screen.lockOrientation(portrait-primary); //锁定// #endif},methods:{init(){uni.showLoading({title:加载中...})getProjectHref({projectId:this.projectInfo.id,hyperLinkAddressType :2}).then(res{if(res){this.url this.$u.trim(res.hyperLinkAddress)console.log(this.url);// #ifdef APP-PLUSlet timer setInterval((){uni.setNavigationBarTitle({title:监控})},300)setTimeout((){uni.hideLoading()clearInterval(timer)timer nullvar currentWebview this.$mp.page.$getAppWebview() //获取当前页面的webview对象var wv currentWebview.children()[0]wv.setStyle({scalable:true,})},1000*3)// #endifuni.hideLoading()}else{this.url uni.hideLoading()this.utils.toast(此项目暂未配置超链接)}})}}} /scriptstyle langscss scopediframe {background-color: #111934;} /style 2、调用重力感应相关api还要在pages.json中添加如下配置 uniapp文档中screenOrientation地址 globalStyle: {backgroundColor: #F8F8F8,navigationBarBackgroundColor: #F8F8F8,navigationBarTextStyle: white, // 状态栏字体为白色只能为 white-白色black-黑色 二选一pageOrientation: auto //横屏配置全局屏幕旋转设置(仅 APP/微信/QQ小程序)支持 auto / portrait / landscape},app-plus: {screenOrientation: [portrait-primary, //可选字符串类型支持竖屏portrait-secondary, //可选字符串类型支持反向竖屏landscape-primary, //可选字符串类型支持横屏landscape-secondary //可选字符串类型支持反向横屏],background:#111934},因为我是开发app和小程序一起的所以小程序主要的配置实在page.json里面添加这些属性如果你开发不涉及到小程序就不用加只需要加globalStyle中的pageOrientation属性 3、App端配置找到manifest.json文件找到源码视图添加如下配置 //app-plus-screenOrientation /* ios横屏配置 */ screenOrientation : [portrait-primary, //可选字符串类型支持竖屏portrait-secondary, //可选字符串类型支持反向竖屏landscape-primary, //可选字符串类型支持横屏landscape-secondary //可选字符串类型支持反向横屏 ],打包部署测试后发现Android和ios都能正常旋转但是后面测试发现在ios16版本以上会出现会横屏但是旋转手机竖屏回不来只有ios16(苹果最新版)版本以上有这个问题在需要在配置中添加flexible: true,完美解决。 效果截图如下
http://www.huolong8.cn/news/237266/

相关文章:

  • 上海网站建设公司站霸网络app域名在哪里注册
  • 资源网站推荐网站关键词优化推荐贵阳方舟网络6
  • 个人网站免费模板下载wordpress怎样连接数据库
  • 江苏省建设网站一号通如何用网络营销推广
  • 长沙房产网站wordpress 微信连接数据库
  • 网站页面如何架构广告传媒有限公司简介
  • 贵州省建设厅的网站网站建设方案 百度文库
  • 佛山设计网站电脑编程学校哪家好
  • 阳山网站seowordpress 仿豆瓣
  • 学网站建设要什么怎样介绍自己做的网站
  • 金融机构网站建设费用响应式网站制作公司
  • 首次进入网站时给一个alert怎么做卫计网站建设工作总结
  • 一个公司多个网站做优化专业设计网站效果
  • 织梦 网站根目录企业信息公示系统年报
  • 网站建设的技术网站建站 优化推广
  • 网站建设 深圳信科公司买域名的钱最后给了谁
  • 上海市500强企业名单开封网站快速排名优化
  • 个人网站icp备案教程做游戏ppt下载网站有哪些内容
  • 企业建设网站对客户的好处2018新网站做外链
  • 简述网站建设的流程wordpress密码重置密码
  • 想在网站里添加超链接怎么做淘宝网站制作
  • 千岛湖建设集团办公网站郑州居家办公全员核酸
  • 济南微信网站建设西宁最好的建站公司
  • 杭州企业网站制作公司个人网页设计作品模板
  • 做医美设计的网站做网站竞争大吗
  • 台州企业建站系统wordpress代码 lt
  • 德阳市建设局网站地址杭州行业网站建设公司
  • 养殖推广网站怎么做工商注册咨询电话多少
  • 如何管理手机网站首页中卫网站建站设计
  • 制作网站哪家服务好甘肃兰州网站建设