Commit 1b60b956 by tangjiale

区分 横屏运动,因为小程序不能动态改横竖屏配置

parent 2190ab02
...@@ -10,14 +10,18 @@ ...@@ -10,14 +10,18 @@
"root": "subPages/organ", "root": "subPages/organ",
"name": "organ", "name": "organ",
"pages": [] "pages": []
},{ },
{
"root": "subPages/sport", "root": "subPages/sport",
"name": "sport", "name": "sport",
"pages": [ "pages": [
"detail/detail", "detail/detail",
"ai-sport/ai-sport" "ai-sport/ai-sport",
"ai-ywqz-sport/ai-ywqz-sport",
"ai-fwc-sport/ai-fwc-sport"
] ]
},{ },
{
"root": "subPages/login", "root": "subPages/login",
"name": "login", "name": "login",
"pages": [ "pages": [
......
{
"usingComponents": {},
"navigationStyle": "custom",
"pageOrientation":"landscape"
}
\ No newline at end of file
<camera device-position="{{!cameraFront?'back':'front'}}" flash="off" binderror="error" frame-size="medium" class="camera" id="camera">
<canvas type="2d" id="myCanvas" class="canvas"></canvas>
</camera>
<view wx:if="{{aiState == 1 || aiState == 6}}">
<image class="help-img" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/jumping-jacks.png"></image>
<view class="help">
<view class="title">互动小提示</view>
<view class="content">手机竖屏固定放置,调整屏幕角度,训练者全身及双脚出现至屏幕内,识别更精准。</view>
</view>
</view>
<!-- 识别成功,读秒 -->
<view class="countdown" wx:if="{{aiState == 2}}">
<view class="second">{{downTime}}</view>
</view>
<!-- 进行中 -->
<view wx:if="{{aiState == 3}}">
<view class="time">{{downTimeStg}}</view>
<view class="number" style="{{levelfontsize}}">{{aiCount}}</view>
</view>
<!-- 成绩提交失败 -->
<view class="tips" wx:if="{{aiState == 4}}">
<view class="tips-type error-type">
抱歉,由于角度、光线等客观环境影响,AI识别失败!结束训练/重新开始训练
</view>
<view class="handle">
<!-- <view class="no-tips">不再提示</view> -->
<view class="know" bindtap="errknow">知道了</view>
</view>
</view>
<!-- 识别中 -->
<view class="switch" bindtap="switch" wx:if="{{aiState == 1}}">
<image src="https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/icon-flip.png"></image>
<view class="text">{{cameraFront?'切换家长拍模式':'切换自拍模式'}}</view>
</view>
<view class="exit" bindtap="exit">
<image src="https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/icon-exit.png"></image>
<view class="text">退出</view>
</view>
<audio src="{{src}}" id="myAudio" ></audio>
var app = getApp() var app = getApp()
var API = require("../../../utils/request.js");
var COS = require('../../../utils/cos-wx-sdk-v5');
var poseDetection = require('@tensorflow-models/pose-detection'); var poseDetection = require('@tensorflow-models/pose-detection');
var flagTimer = null; var flagTimer = null;
......
{ {
"usingComponents": {}, "usingComponents": {},
"disableScroll": true, "disableScroll": true
"pageOrientation":"auto"
} }
\ No newline at end of file
{
"usingComponents": {},
"navigationStyle": "custom",
"pageOrientation":"landscape"
}
\ No newline at end of file
<camera device-position="{{!cameraFront?'back':'front'}}" flash="off" binderror="error" frame-size="medium" class="camera" id="camera">
<canvas type="2d" id="myCanvas" class="canvas"></canvas>
</camera>
<view wx:if="{{aiState == 1 || aiState == 6}}">
<image class="help-img" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/jumping-jacks.png"></image>
<view class="help">
<view class="title">互动小提示</view>
<view class="content">手机竖屏固定放置,调整屏幕角度,训练者全身及双脚出现至屏幕内,识别更精准。</view>
</view>
</view>
<!-- 识别成功,读秒 -->
<view class="countdown" wx:if="{{aiState == 2}}">
<view class="second">{{downTime}}</view>
</view>
<!-- 进行中 -->
<view wx:if="{{aiState == 3}}">
<view class="time">{{downTimeStg}}</view>
<view class="number" style="{{levelfontsize}}">{{aiCount}}</view>
</view>
<!-- 成绩提交失败 -->
<view class="tips" wx:if="{{aiState == 4}}">
<view class="tips-type error-type">
抱歉,由于角度、光线等客观环境影响,AI识别失败!结束训练/重新开始训练
</view>
<view class="handle">
<!-- <view class="no-tips">不再提示</view> -->
<view class="know" bindtap="errknow">知道了</view>
</view>
</view>
<!-- 识别中 -->
<view class="switch" bindtap="switch" wx:if="{{aiState == 1}}">
<image src="https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/icon-flip.png"></image>
<view class="text">{{cameraFront?'切换家长拍模式':'切换自拍模式'}}</view>
</view>
<view class="exit" bindtap="exit">
<image src="https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/icon-exit.png"></image>
<view class="text">退出</view>
</view>
<audio src="{{src}}" id="myAudio" ></audio>
...@@ -110,10 +110,19 @@ Page({ ...@@ -110,10 +110,19 @@ Page({
//运动时常 //运动时常
let time = this.data.timeList[this.data.popupActive].value let time = this.data.timeList[this.data.popupActive].value
if(this.data.sportDetail.id == 2){ //仰卧起坐
wx.navigateTo({
url:'../../../subPages/sport/ai-ywqz-sport/ai-ywqz-sport?sportTime=' + time,
})
}else if(this.data.sportDetail.id == 14){ //俯卧撑
wx.navigateTo({
url:'../../../subPages/sport/ai-fwc-sport/ai-fwc-sport?sportTime=' + time,
})
}else{
wx.navigateTo({ wx.navigateTo({
// url: '../../..//ai/index/index?sportTime=' + time,
url:'../../../subPages/sport/ai-sport/ai-sport?sportTime=' + time, url:'../../../subPages/sport/ai-sport/ai-sport?sportTime=' + time,
}) })
}
}, },
//隐藏显示 //隐藏显示
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment