Commit 756bca13 by tangjiale

更新代码

parent 0ddeb16d
......@@ -16,9 +16,16 @@
"name": "sport",
"pages": [
"detail/detail",
"ai-sport/ai-sport",
"ai-ywqz-sport/ai-ywqz-sport",
"ai-fwc-sport/ai-fwc-sport"
"ai-fwc-sport/ai-fwc-sport",
"ai-ts-sport/ai-ts-sport",
"ai-tjz-sport/ai-tjz-sport",
"ai-kht-sport/ai-kht-sport",
"ai-sd-sport/ai-sd-sport",
"ai-gtt-sport/ai-gtt-sport",
"ai-ydtt-sport/ai-ydtt-sport",
"ai-ydp-sport/ai-ydp-sport",
"share/share"
]
},
{
......
......@@ -397,3 +397,37 @@ page{
font-weight: bold;
margin-bottom: 14px;
}
.ywqz-help-img{
position:absolute;
bottom: 40px;
left: 50%;
transform: translateX(-50%);
width: 490px;
height: 252px;
z-index: 98;
}
.ywqz-help{
position: absolute;
top: 50%;
left: 20px;
transform: translateY(-50%);
width: 192px;
height: 140px;
background: #000000;
opacity: 0.74;
border-radius: 12px;
color: #FFFFFF;
text-align: center;
font-size: 14px;
z-index: 99;
}
.side-help-img{
position:absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 596rpx;
height: 988rpx;
z-index: 98;
}
\ No newline at end of file
......@@ -2,6 +2,8 @@
width: 690rpx;
overflow: hidden;
margin: 0 auto;
min-height: 100vh;
padding-bottom: 80rpx;
}
.list .li:nth-child(2n-1){
......
......@@ -30,6 +30,20 @@
"name": "ai运动",
"pathName": "subPages/sport/ai-sport/ai-sport",
"query": "id=11",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "subPages/sport/ai-ywqz-sport/ai-ywqz-sport",
"query": "sportTime=60",
"launchMode": "default",
"scene": null
},
{
"name": "ai运动分享",
"pathName": "subPages/sport/share/share",
"query": "id=10774553&share=0&showMedal=1&user=1&sportTime=00:02:00",
"scene": null,
"launchMode": "default"
}
......
......@@ -6,7 +6,7 @@ var time = 0;
var iosNum = 0;//ios不能重复播放同一地址音频,后加一位数,加时间戳不行
Page({
mixins: [require('../ai-mixins/ai-fwc-mixins.js')],
behaviors: [require('../ai-mixins/ai-fwc-mixins.js')],
data: {
fps:20,//控制频率
......
......@@ -2,8 +2,8 @@
<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">
<image class="ywqz-help-img" src="{{showImageUrl}}"></image>
<view class="ywqz-help">
<view class="title">互动小提示</view>
<view class="content">手机竖屏固定放置,调整屏幕角度,训练者全身及双脚出现至屏幕内,识别更精准。</view>
</view>
......
@font-face {
font-family: 'Number';
src: url('data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAAACB8ABEAAAAAXXQAACAcAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE0cGh4bqmQcMAZWAIJKCBwJFAr8dO8IC4FKAAE2AiQDgw4EIAWEKweBeAxDG5NUNWxbGhO7HYCq/2nriGpSGaOiTg5G1uz//5LcISp7wT4uMYeihK2cJ3YaHd7lHRcbJjvh2B8qIyJoolRTwy8o3lSiOtqso1nxphLVkcuHv++KLihRKLbPzGt2Q9mBtnFiW+iQ9EDgKLNH+p9cZ5be0l5cU4WLOCqpA+ZngDusaKrTf8Krer+CTlc1ZiX30tXJaCHWIbnzZA00TgCWcgXRj09g4HQDtM2YucKomIKF0dASZYKKHejCwGQJy0IXSS10e+POLFw2WMt8D6eVI83Ipcqtbbe91b7WV986fRoWgAJoUBAPPf6Urka6Kqm4wZ5ZoANG3xMlYfq2nIiSqExX2Qr3zTjChcEuNOvtZ7/1/e77jBRQEC55UCfKiXw5EVku/KjCFXzAfjB8UDd8LsOwPHy/12ZzZuemyAiXuMUR4bJv/kqfbPnDnU9RbZtCbfOU+hVdoSTCxFFldSAkQq6QVCcRwiGZb65PO/Pmw+7dFQC2wELelnhchUKhsjPJbCaT5FPuvc0xZvcIJ5uP2SIoYAfk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BnH0FPo9rJrwLzsXZGfQFvQ99DuvX6+GvIF1huBHWMv9/nDhLwHXWOrM+uA8sD0uCl2Pa95fWIreFf8J/4M/mI4tp3WJ637jWAjYHexy65LeCLgIKx/SuvxBa+dwxVrSCGgOLws9spLXQGI5eMAAADBZi4AAWk97oEMGBBNvVxsBVgmBgdYIhgIMJDRWJEjoMqp8wkEHZumm70ixocT3YLhewBIFjfoIhgo0JDV1wMqGDU+WEgbLU9NFmgtPPn05/yXSDYbHKFsQED2BooIRrMBJDcY5xGTXcyrg4FP7TlXuj6E/rwzi2dsjEA0ZDxRsm/4gs9e2q2ftMTp0ITVygEPouVDOLJtTmYKGvy+YSUSPv1iZ9nkbYi+T45IZ7G1kt8DVeytQYApwPO978eQEDB/MVDEL9hz3oW9wa+PcqZd/qV+G5YUSlrmqtaq1TbfRelLQjuKJtlopwlHCA83Yb8sll9zItDnjtATSY7na5WcPcznrXXfb2uyuhNN0wLVY7e/q18KcAeuMYRRWFbDtOZEuKZnAd4JCJVKaQUlgmIfC6/meQa2pp6+jq6RsYGvnL3/7xr//8b2xiamZuYWllbWNrZ+/g6OTs4urm7uHp5e1DzEAMwmAMIUZaYMbEMXXr3n40ho2uV/9ORTkPBi0rEDBNIoDmn2L/vzwZ3WE5/FGNdUKNo4Ze3MOM3eUc1vWOozsA') format('woff2');
}
page{
background: #D1D1D1;
}
.canvas {
position: absolute;
width: 100%;
height: 100%;
z-index: 100;
}
/* 自定义导航条样式 */
.nav{
width: 100%;
overflow: hidden;
position: relative;
top: 0;
left: 0;
z-index: 10;
}
.nav-title{
width: 100%;
height: 90rpx;
line-height: 90rpx;
text-align: center;
position: absolute;
bottom: 0;
left: 0;
z-index: 10;
font-size:26rpx;
color: #FFFFFF;
}
.nav .back{
width: 44rpx;
height: 44rpx;
position: absolute;
bottom: 0;
left: 0;
padding: 24rpx 30rpx;
}
.bg-white{
background-color: transparent;
}
.bg-gray{
background-color: #f7f7f7;
}
.overflow{
overflow: auto;
}
.hidden{
overflow: hidden;
}
.user-info image{
width: 64rpx;
height: 64rpx;
}
.tips{
position:absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 80%;
padding-bottom: 50rpx;
text-align: justify;
/* height: 242px; */
background: #FFFFFF;
box-shadow: 0px 2px 20px rgba(0, 0, 0, 0.08);
border-radius: 12px;
padding:15px;
z-index: 99;
}
.errors{
height: 110px;
}
.error-type{
width: 90%;
margin: 0 auto;
margin-top: 10px;
}
.tips-type{
overflow: hidden;
}
.correct{
float: left;
width: 154px;
height: 140px;
margin-right: 1px;
}
.correct .img{
width: 100%;
height: 100px;
background: #F8F8F8;
}
.correct .img image{
width: 100%;
height: 100px;
background: #F8F8F8;
}
.error .img image{
width: 100%;
height: 100px;
background: #F8F8F8;
}
.correct .text{
font-size: 12px;
color: #353535;
text-align: center;
line-height: 40px;
}
.no-tips{
float: left;
font-size: 14px;
color: #888888;
padding-top: 10px;
padding-left: 20px;
}
.know{
float: left;
width: 320rpx;
height: 40px;
line-height: 40px;
color: #FFFFFF;
border-radius: 22px;
text-align: center;
background: #FF9B4D;
margin-left: 160rpx;
font-size: 17px;
font-weight: bold;
margin-top: 14px;
}
.error{
float: left;
width: 100px;
height: 140px;
margin-right: 1px;
}
.error .img{
width: 100%;
height: 100px;
background: #F8F8F8;
}
.error .text{
font-size: 12px;
color: #353535;
text-align: center;
line-height: 40px;
}
.handle{
width: 100%;
height: 40px;
}
.switch{
position: absolute;
height: 44px;
padding-right: 10px;
line-height: 44px;
background: #000000;
opacity: 0.74;
border-radius: 12px;
left: 20px;
bottom: 15px;
color: #FFFFFF;
z-index: 99;
}
.switch .text{
padding-left: 40px;
}
.switch image{
position: absolute;
top: 10px;
left: 6px;
width: 32px;
height: 26px;
}
.exit{
position: absolute;
height: 44px;
padding-right: 10px;
line-height: 44px;
background: #000000;
opacity: 0.74;
border-radius: 12px;
right: 20px;
bottom: 15px;
color: #FFFFFF;
z-index: 99;
}
.exit .text{
padding-left: 40px;
}
.exit image{
position: absolute;
top: 8px;
left: 6px;
width: 32px;
height: 26px;
}
.help{
position: absolute;
left: 20px;
width: 192px;
background: #000000;
opacity: 0.74;
border-radius: 12px;
color: #FFFFFF;
text-align: center;
font-size: 14px;
z-index: 99;
padding-bottom: 40rpx;
bottom: 160rpx;
}
.help .title{
margin-top: 15px;
}
.help .content{
width: 86%;
margin: 0 auto;
text-align: left;
margin-top: 12px;
}
.help-img{
position:absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 432rpx;
height: 988rpx;
z-index: 98;
}
.countdown{
position:absolute;
width: 100%;
height: 100%;
background: #FF9B4D;
z-index: 100;
}
.countdown .second{
position:absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #FFFFFF;
font-size: 160rpx;
font-family: 'Number';
z-index: 101;
}
.time{
position: absolute;
width: 220rpx;
height: 48px;
font-size: 34px;
line-height: 48px;
color: #FFFFFF;
background: #000000;
opacity: 0.74;
border-radius: 12px;
font-family: 'Number';
left: 20px;
top: 140rpx;
text-align: center;
z-index: 99;
}
.number{
position: absolute;
width: 220rpx;
height: 48px;
font-size: 34px;
line-height: 48px;
color: #FFFFFF;
background: #000000;
opacity: 0.74;
border-radius: 12px;
font-family: 'Number';
right: 20px;
top: 140rpx;
text-align: center;
z-index: 99;
}
.grade{
overflow: hidden;
position:absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 487px;
height: 242px;
background: #FFFFFF;
box-shadow: 0px 2px 20px rgba(0, 0, 0, 0.08);
border-radius: 12px;
z-index: 100;
}
.grade .num{
text-align: center;
font-size: 42px;
font-family: 'Number';
margin-top: 40px;
}
.grade text{
font-size: 12px;
color: #888888;
}
.eggs{
font-size: 14px;
color: #353535;
text-align: center;
width: 334px;
margin: 0 auto;
margin-top: 24px;
}
.btns{
width: 92%;
margin: 0 auto;
margin-top: 26px;
}
.btns-left{
background: #F5F5F5;
border-radius: 22px;
float: left;
width: 48%;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 17px;
font-weight: bold;
color: #FF9B4D;
}
.btns-right{
background: #FF9B4D;
border-radius: 22px;
float: right;
width: 48%;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 17px;
font-weight: bold;
color: #FFFFFF;
}
.camera{
width: 100%;
height: 100%;
position: absolute;
z-index:9
}
.tips-type-tips{
text-align: center;
font-size: 17px;
font-weight: bold;
margin-bottom: 14px;
}
@import "../../../css/ai-common.wxss";
\ No newline at end of file
......@@ -7,35 +7,10 @@ var flagTimer = null;
var time = 0;
var iosNum = 0;//ios不能重复播放同一地址音频,后加一位数,加时间戳不行
const aiSportType = app._aiSportType || '1'
var ts = require('../ai-mixins/ai-ts-mixins.js') //跳绳
var ywqz = require('../ai-mixins/ai-ywqz-mixins.js') //仰卧起坐
var tjz = require('../ai-mixins/ai-tjz-mixins.js') //踢毽子
var kht = require('../ai-mixins/ai-kht-mixins.js') //开合跳
var sd = require('../ai-mixins/ai-sd-mixins.js') //深蹲
var fwc = require('../ai-mixins/ai-fwc-mixins.js') //俯卧撑
var gtt = require('../ai-mixins/ai-gtt-mixins.js') //高抬腿
var ydtt = require('../ai-mixins/ai-ydtt-mixins.js') //原地踢腿
var ydp = require('../ai-mixins/ai-ydp-mixins.js') //原地跑
var gtjz = require('../ai-mixins/ai-ts-mixins.js') //拐踢毽子
const sportObj = {
1:ts, //跳绳
2:ywqz, //仰卧起坐
3:tjz, //踢毽子
11:kht, //开合跳
13:sd, //深蹲
14:fwc, //俯卧撑
15:gtt, //高抬腿
16:ydtt, //原地踢腿
17:ydp, //原地跑
}
console.log('aiSportType',aiSportType)
Page({
// mixins: [sportObj[aiSportType]],
behaviors: [sportObj[aiSportType]],
name:'ai-sport',
behaviors: [require('../ai-mixins/ai-gtt-mixins.js')],
data: {
fps:20,//控制频率
......
<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="side-help-img" wx:if="{{showImageUrl}}" src="{{showImageUrl}}"></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>
@import "../../../css/ai-common.wxss";
\ No newline at end of file
var app = getApp()
var poseDetection = require('@tensorflow-models/pose-detection');
var API = require("../../../utils/request");
//引入混合模式
var flagTimer = null;
var time = 0;
var iosNum = 0;//ios不能重复播放同一地址音频,后加一位数,加时间戳不行
Page({
// mixins: [sportObj[aiSportType]],
behaviors: [require('../ai-mixins/ai-kht-mixins.js')],
data: {
fps:20,//控制频率
//当前状态 0 提示 1 识别中 2 识别成功,读秒 3 进行中
// 4 成绩提交失败 5 等待成绩上传 6 开始前播报
aiState:6,
downTime:5, //开始倒计时
downTimeStg:'00:00',
uuid:'',//唯一标识
prepare:'',
aiCount:0, //当前个数
waitTimer:'', //等待结果定时器
beforeTimer:'', //开始前定时器
startTimer:'', //进行中定时器
startTips:'', //开始前语音 提醒
phoneType:'', //ios android
showCamera:true,
cameraFront:true, //镜头是否前置
src: '',//实时播报的路径
videoSrc:'',
fileCosFilePath:'',//截取视频
needUploadFilePath:'',
levelfontsize:'',
sportTime:60, //运动时长
skipType:1, //当前跳绳模式 0两者都行 1 双脚 2 单双脚交替
},
onLoad: function (options) {
var that = this;
iosNum = 0;
time = 0;
//运动时长(秒)
if(options.sportTime){
// 30/60/120/180
this.setData({sportTime:options.sportTime,skipType:options.type})
}
// 音频/语音交互相关
this.ctx = wx.createCanvasContext('myCanvas');
that.ctxs = wx.createCameraContext();
this.setData({
innerAudioContext: wx.createInnerAudioContext(), //本地音乐组件
innerAudioContext2: wx.createInnerAudioContext() //倒计时播音组件
},()=>{
that.data.innerAudioContext.obeyMuteSwitch = false;
that.data.innerAudioContext2.obeyMuteSwitch = false;
that.loadMoveNet();
})
//初始化设备
this.initDevice()
},
onUnload(){
var that = this;
that.data.innerAudioContext.destroy();
that.data.innerAudioContext2.destroy();
clearInterval(flagTimer);
clearTimeout(that.data.prepare);
clearTimeout(that.data.waitTimer);
clearInterval(that.data.beforeTimer);
clearTimeout(that.data.startTimer);
},
loadMoveNet(){
var that = this;
if (app.globalData.movenet){
that.data.startTips = setTimeout(function () {
//开始识别
that.setData({
aiState:1
},()=>{
console.log('开始识别运动姿势')
})
},that.data.sportTime * 100 + 500)
that.canvasInit();
that.cameraFrame();
}else{
wx.showLoading({
mask:true,
title: '初始化中...',
})
var modelUrl = wx.getStorageSync('aiModelUrl'),
detectorConfig = {
modelType: poseDetection.movenet.modelType.SINGLEPOSE_LIGHTNING,
modelUrl: modelUrl
};
poseDetection.createDetector(poseDetection.SupportedModels.MoveNet, detectorConfig).then(function (detector) {
wx.hideLoading();
that.palyLocal('/images/ai/clues.mp3');
that.data.startTips = setTimeout(function () {
//开始识别
that.setData({
aiState:1
},()=>{
console.log('开始识别运动姿势')
})
},that.data.sportTime * 100 + 500)
app.globalData.movenet = detector;
that.canvasInit();
that.cameraFrame();
}).catch(function (err) {
console.log(err)
wx.showToast({
icon:'error',
title: '初始化失败',
success:function(){
wx.navigateBack({
delta: 1
})
},
})
})
}
},
canvasInit() { // 获取canvas
var that = this
wx.createSelectorQuery().select('#myCanvas')
.fields({ node: true, size: true })
.exec(function (res) {
var canvas = res[0].node
var ctx = canvas.getContext('2d')
var dpr = wx.getSystemInfoSync().pixelRatio
canvas.width = 480 * dpr
canvas.height = 640 * dpr
ctx.scale(dpr, dpr)
that.ctx = ctx
that.canvas = canvas
that.res0 = res[0]
})
},
cameraFrame() { // 视频流
var that = this,
store = [],
startTime = new Date(),
camera = wx.createCameraContext()
that.listener = camera.onCameraFrame(function (frame) {
//console.log(app.globalData.movenet)
if (frame && app.globalData.movenet) { //帧率控制
store.push(frame)
}
})
console.log('识别')
that.listener.start({
success: function () {
console.log('当前的识别频率',that.data.fps)
//flagTimer && clearInterval(flagTimer)
flagTimer = setInterval(function () { //帧率控制
if (store.length == 0) return;
var object = {
data: new Uint8Array(store[store.length - 1].data),
height: Number(store[store.length - 1].height),
width: Number(store[store.length - 1].width)
}
that.actionSend(object,app)
store = []
that.setData({
resultFps: that.data.resultFps + 1,
fpstime: parseInt((that.data.resultFps + 1) * 1000 / (new Date().getTime() - startTime))
})
}, 1000 / that.data.fps)
},
})
},
//播放本地音乐组件
palyLocal(url) {
var that = this;
this.data.innerAudioContext.autoplay = true;
this.data.innerAudioContext.volume = 1;
if(that.data.phoneType == 'ios'){
this.data.innerAudioContext.src = url + '?' + Date.now();
}else{
this.data.innerAudioContext.src = url;
}
this.data.innerAudioContext.onPlay(() => {
console.log('开始播放')
})
this.data.innerAudioContext.onEnded(() => {
console.log('播放结束')
//this.data.innerAudioContext.destroy()
})
},
//播放本地音乐组件
palyLocal2(url) {
var that = this;
that.data.innerAudioContext2.autoplay = true;
that.data.innerAudioContext2.volume = 0.4;
that.data.innerAudioContext2.src = url;
that.data.innerAudioContext2.onPlay(() => {
console.log('开始播放22222222')
})
that.data.innerAudioContext2.onEnded(() => {
console.log('播放结束222222')
iosNum = iosNum + 1;
setTimeout(function(){
that.palyLocal2('https://cdn.xiaobentiyu.cn/mp3/2-LoopMelody(BPM130).mp3?a='+iosNum);
},200)
})
that.data.innerAudioContext2.onError((err) => {
console.log('err',err)
})
},
//执行开始
start(){
var that = this;
var downTime = this.data.downTime;
that.palyLocal('/packageC/images/skip.mp3');
that.data.prepare = setTimeout(()=>{
that.setData({
aiState:2
})
that.palyLocal('/images/ai/N5.mp3');
that.data.beforeTimer = setInterval(()=>{
downTime = downTime -1;
this.setData({ downTime: downTime });
if(downTime ===4){
that.palyLocal('/images/ai/N4.mp3');
}else if(downTime ===3){
that.palyLocal('/images/ai/N3.mp3');
}else if(downTime ===2){
that.palyLocal('/images/ai/N2.mp3');
}else if(downTime ===1){
that.palyLocal('/images/ai/N1.mp3');
}else if (downTime === 0) {
clearInterval(that.data.beforeTimer);
that.setData({ downTime: '开始' });
that.palyLocal('/images/ai/V_START.mp3')
setTimeout(function () {
that.setData({
aiState:3
})
that.startTime();
}, 1000);
}
},1000);
},1200)
},
//开始运动
startTime(){
//console.log('开始运动1111111',time)
var that = this;
//time = that.data.time;
time = time + 1;
var downTimeStg = that.formatSeconds(time);
that.setData({
downTimeStg:downTimeStg
},()=>{
that.palyLocal2('https://cdn.xiaobentiyu.cn/mp3/2-LoopMelody(BPM130).mp3');
})
if(time == 1){
//console.log('开始1')
}
if(time == that.data.sportTime - 5){
that.palyLocal('/images/ai/N5.mp3');
}
if(time == that.data.sportTime - 4){
that.palyLocal('/images/ai/N4.mp3');
}
if(time == that.data.sportTime - 3){
that.palyLocal('/images/ai/N3.mp3');
}
if(time == that.data.sportTime - 2){
that.palyLocal('/images/ai/N2.mp3');
}
if(time == that.data.sportTime - 1){
that.palyLocal('/images/ai/N1.mp3');
}
if(time == 10){
//console.log('开始2')
}
if((that.data.sportTime == 30 && time == 8) || (that.data.sportTime != 30 && time == 20)){
// that.startRecord();
}
if((that.data.sportTime == 30 && time == 18) || (that.data.sportTime != 30 && time == 32)){
}
// 时间已过半语音 暂时只支持60秒模式
if(that.data.sportTime == 60 && time == 30){
console.log('开始4')
that.palyLocal('/images/ai/30.mp3');
}
if(time == 40){
//console.log('开始5')
}
if(that.data.sportTime == 60 && time == 50){
//console.log('开始6')
that.palyLocal('/images/ai/50.mp3');
}
if(time == that.data.sportTime){
that.palyLocal('/images/ai/stop.mp3');
console.log('销毁定时器')
wx.showLoading({
title: '统计中...',
})
that.data.innerAudioContext2.destroy();
that.data.waitTimer = setTimeout(function(){
wx.hideLoading();
that.setData({
aiState:5
},()=>{
that.save();
})
},1500)
}
that.data.startTimer = setTimeout(function () {
if(time < that.data.sportTime){
that.startTime();
}
},1000)
},
//秒转换格式mm:ss
formatSeconds(value) {
let result = parseInt(value)
let h = Math.floor(result / 3600) < 10 ? Math.floor(result / 3600) : Math.floor(result / 3600);
let m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result / 60 % 60));
let s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60));
var time = m + ":" + s
return time;
},
//错误知道了
errknow(){
wx.navigateBack({ changed: true});
},
//切换摄像头
switch(){
this.setData({cameraFront:!this.data.cameraFront})
},
//退出页面
exit(){
var that = this;
wx.showModal({
title: '提示',
content: '已开启AI运动模式,确定退出模式?',
cancelText:"继续训练",//默认是“取消”
confirmText:"退出模式",//默认是“确定”
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
clearTimeout(that.data.waitTimer);
clearInterval(that.data.beforeTimer);
clearTimeout(that.data.startTimer);
wx.navigateBack({
changed: true
});
} else {//这里是点击了取消以后
console.log('用户点击取消')
}
}
})
},
initDevice(){
let that = this
wx.getSystemInfo({
success: function (res) {
console.log('当前的系统',res)
if (res.platform == "devtools") {
that.setData({
phoneType: 'ios'
})
} else if (res.platform == "ios") {
that.setData({
phoneType: 'ios'
})
} else if (res.platform == "android") {
that.setData({
phoneType: 'android'
})
}
}
})
wx.getSetting({
success(res) {
if (!res.authSetting['scope.camera']){
wx.showModal({
title: '提示',
content: '请点击右上角设置授权摄像头',
showCancel: false,//是否显示取消按钮
confirmText:"知道了",//默认是“确定”
success: function (res) {
if (res.cancel) {
//点击取消,默认隐藏弹框
} else {
wx.navigateBack({
delta: 1
})
}
}
})
}else{
console.log('正常授权')
}
}
})
wx.openSetting({
success (res) {
if(res.authSetting['scope.camera']){
that.setData({
showCamera:true
})
}
}
})
}
})
\ No newline at end of file
{
"usingComponents": {},
"disableScroll": true
}
\ No newline at end of file
@import "../../../css/ai-common.wxss";
\ No newline at end of file
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-05-11 09:53:47
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-08 11:01:27
* @LastEditTime: 2022-06-08 14:56:37
*/
var API = require("../../../utils/request");
......@@ -132,9 +132,9 @@ module.exports = Behavior({
clearTimeout(that.data.waitTimer);
var uid = res.data.id;
if(res.code == 200){
// wx.redirectTo({
// url: '../../../packageA/pushUp/share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
// })
wx.redirectTo({
url: '../share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
})
}else{
that.setData({
aiState:4
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-05-11 09:53:47
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-08 11:01:55
* @LastEditTime: 2022-06-08 14:57:10
*/
// 拐踢毽子计算配置
......@@ -176,7 +176,7 @@ module.exports = Behavior({
var uid = res.data.id;
if(res.code == 200){
wx.redirectTo({
// url: '../../packageA/sitUp/share/share?share=0' + '&id=' + uid + '&showMedal=1',
url: '../share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
})
}else{
that.setData({
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-05-11 09:53:47
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-08 11:03:40
* @LastEditTime: 2022-06-08 14:57:19
*/
var API = require("../../../utils/request");
......@@ -161,9 +161,9 @@ module.exports = Behavior({
clearTimeout(that.data.waitTimer);
var uid = res.data.id;
if(res.code == 200){
// wx.redirectTo({
// url:'../../../packageA/highLegLifts/share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
// })
wx.redirectTo({
url: '../share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
})
}else{
that.setData({
aiState:4
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-05-11 09:53:47
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-08 11:13:58
* @LastEditTime: 2022-06-08 15:07:12
*/
var API = require("../../../utils/request");
......@@ -25,7 +25,6 @@ module.exports = Behavior({
},
methods:{
actionSend(object,app){ // 识别点
console.log('什么鬼啊------------')
var that = this;
//console.log('app.globalData.movenet',app.globalData.movenet)
app.globalData.movenet.estimatePoses(object).then(function (res) {
......@@ -69,7 +68,6 @@ module.exports = Behavior({
}
//通过角度判断个数
if(that.data.aiState == 3){
console.log('当前参数帧数',that.data.showTime,angle_foot)
if(angle_foot >= 20 && angle_hand > 120){
if(dir == 0){
count = count + 0.5;
......@@ -132,9 +130,9 @@ module.exports = Behavior({
clearTimeout(that.data.waitTimer);
var uid = res.data.id;
if(res.code == 200){
// wx.redirectTo({
// url: '../../../packageA/sitUp/share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
// })
wx.redirectTo({
url: '../share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
})
}else{
that.setData({
aiState:4
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-05-11 09:53:47
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-08 11:03:58
* @LastEditTime: 2022-06-08 14:57:38
*/
var API = require("../../../utils/request");
......@@ -131,9 +131,9 @@ module.exports = Behavior({
clearTimeout(that.data.waitTimer);
var uid = res.data.id;
if(res.code == 200){
// wx.redirectTo({
// url: '../../../packageA/deepSquat/share/sahre?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
// })
wx.redirectTo({
url: '../share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
})
}else{
that.setData({
aiState:4
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-05-11 09:53:47
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-08 11:04:17
* @LastEditTime: 2022-06-08 14:57:46
*/
var API = require("../../../utils/request");
......@@ -164,9 +164,9 @@ module.exports = Behavior({
clearTimeout(that.data.waitTimer);
var uid = res.data.id;
if(res.code == 200){
// wx.redirectTo({
// url:'../../../packageA/shuttlecock/share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
// })
wx.redirectTo({
url: '../share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
})
}else{
that.setData({
aiState:4
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-05-11 09:53:47
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-08 11:04:30
* @LastEditTime: 2022-06-08 14:57:52
*/
var API = require("../../../utils/request");
// 拐踢毽子计算配置
......@@ -185,7 +185,7 @@ module.exports = Behavior({
var uid = res.data.id;
if(res.code == 200){
wx.redirectTo({
// url: '../../../packageA/aiSkip/share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
url: '../share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
})
}else{
wx.showModal({
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-05-11 09:53:47
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-08 11:04:44
* @LastEditTime: 2022-06-08 14:58:10
*/
var API = require("../../../utils/request");
......@@ -165,9 +165,9 @@ module.exports = Behavior({
clearTimeout(that.data.waitTimer);
var uid = res.data.id;
if(res.code == 200){
// wx.redirectTo({
// url: '../../packageA/sitUp/share/share?share=0' + '&id=' + uid + '&showMedal=1',
// })
wx.redirectTo({
url: '../share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
})
}else{
that.setData({
aiState:4
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-05-11 09:53:47
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-08 11:04:59
* @LastEditTime: 2022-06-08 14:58:23
*/
var API = require("../../../utils/request");
......@@ -164,9 +164,9 @@ module.exports = Behavior({
clearTimeout(that.data.waitTimer);
var uid = res.data.id;
if(res.code == 200){
// wx.redirectTo({
// url:'../../../packageA/hipKicked/share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
// })
wx.redirectTo({
url: '../share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
})
}else{
that.setData({
aiState:4
......
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-05-11 09:53:47
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-08 11:05:18
* @LastEditTime: 2022-06-08 14:58:32
*/
var API = require("../../../utils/request");
......@@ -71,9 +71,9 @@ module.exports = Behavior({
clearTimeout(that.data.waitTimer);
var uid = res.data.id;
if(res.code == 200){
// wx.redirectTo({
// url: '../../../packageA/sitUp/share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
// })
wx.redirectTo({
url: '../share/share?share=0' + '&id=' + uid + '&showMedal=1&sportTime='+that.formatSeconds(that.data.sportTime),
})
}else{
that.setData({
aiState:4
......
var app = getApp()
var poseDetection = require('@tensorflow-models/pose-detection');
//引入混合模式
var flagTimer = null;
var time = 0;
var iosNum = 0;//ios不能重复播放同一地址音频,后加一位数,加时间戳不行
Page({
// mixins: [sportObj[aiSportType]],
behaviors: [require('../ai-mixins/ai-sd-mixins.js')],
data: {
fps:20,//控制频率
//当前状态 0 提示 1 识别中 2 识别成功,读秒 3 进行中
// 4 成绩提交失败 5 等待成绩上传 6 开始前播报
aiState:6,
downTime:5, //开始倒计时
downTimeStg:'00:00',
uuid:'',//唯一标识
prepare:'',
aiCount:0, //当前个数
waitTimer:'', //等待结果定时器
beforeTimer:'', //开始前定时器
startTimer:'', //进行中定时器
startTips:'', //开始前语音 提醒
phoneType:'', //ios android
showCamera:true,
cameraFront:true, //镜头是否前置
src: '',//实时播报的路径
videoSrc:'',
fileCosFilePath:'',//截取视频
needUploadFilePath:'',
levelfontsize:'',
sportTime:60, //运动时长
skipType:1, //当前跳绳模式 0两者都行 1 双脚 2 单双脚交替
},
onLoad: function (options) {
var that = this;
iosNum = 0;
time = 0;
//运动时长(秒)
if(options.sportTime){
// 30/60/120/180
this.setData({sportTime:options.sportTime,skipType:options.type})
}
// 音频/语音交互相关
this.ctx = wx.createCanvasContext('myCanvas');
that.ctxs = wx.createCameraContext();
this.setData({
innerAudioContext: wx.createInnerAudioContext(), //本地音乐组件
innerAudioContext2: wx.createInnerAudioContext() //倒计时播音组件
},()=>{
that.data.innerAudioContext.obeyMuteSwitch = false;
that.data.innerAudioContext2.obeyMuteSwitch = false;
that.loadMoveNet();
})
//初始化设备
this.initDevice()
},
onUnload(){
var that = this;
that.data.innerAudioContext.destroy();
that.data.innerAudioContext2.destroy();
clearInterval(flagTimer);
clearTimeout(that.data.prepare);
clearTimeout(that.data.waitTimer);
clearInterval(that.data.beforeTimer);
clearTimeout(that.data.startTimer);
},
loadMoveNet(){
var that = this;
if (app.globalData.movenet){
that.data.startTips = setTimeout(function () {
//开始识别
that.setData({
aiState:1
},()=>{
console.log('开始识别运动姿势')
})
},that.data.sportTime * 100 + 500)
that.canvasInit();
that.cameraFrame();
}else{
wx.showLoading({
mask:true,
title: '初始化中...',
})
var modelUrl = wx.getStorageSync('aiModelUrl'),
detectorConfig = {
modelType: poseDetection.movenet.modelType.SINGLEPOSE_LIGHTNING,
modelUrl: modelUrl
};
poseDetection.createDetector(poseDetection.SupportedModels.MoveNet, detectorConfig).then(function (detector) {
wx.hideLoading();
that.palyLocal('/images/ai/clues.mp3');
that.data.startTips = setTimeout(function () {
//开始识别
that.setData({
aiState:1
},()=>{
console.log('开始识别运动姿势')
})
},that.data.sportTime * 100 + 500)
app.globalData.movenet = detector;
that.canvasInit();
that.cameraFrame();
}).catch(function (err) {
console.log(err)
wx.showToast({
icon:'error',
title: '初始化失败',
success:function(){
wx.navigateBack({
delta: 1
})
},
})
})
}
},
canvasInit() { // 获取canvas
var that = this
wx.createSelectorQuery().select('#myCanvas')
.fields({ node: true, size: true })
.exec(function (res) {
var canvas = res[0].node
var ctx = canvas.getContext('2d')
var dpr = wx.getSystemInfoSync().pixelRatio
canvas.width = 480 * dpr
canvas.height = 640 * dpr
ctx.scale(dpr, dpr)
that.ctx = ctx
that.canvas = canvas
that.res0 = res[0]
})
},
cameraFrame() { // 视频流
var that = this,
store = [],
startTime = new Date(),
camera = wx.createCameraContext()
that.listener = camera.onCameraFrame(function (frame) {
//console.log(app.globalData.movenet)
if (frame && app.globalData.movenet) { //帧率控制
store.push(frame)
}
})
console.log('识别')
that.listener.start({
success: function () {
console.log('当前的识别频率',that.data.fps)
//flagTimer && clearInterval(flagTimer)
flagTimer = setInterval(function () { //帧率控制
if (store.length == 0) return;
var object = {
data: new Uint8Array(store[store.length - 1].data),
height: Number(store[store.length - 1].height),
width: Number(store[store.length - 1].width)
}
that.actionSend(object,app)
store = []
that.setData({
resultFps: that.data.resultFps + 1,
fpstime: parseInt((that.data.resultFps + 1) * 1000 / (new Date().getTime() - startTime))
})
}, 1000 / that.data.fps)
},
})
},
//播放本地音乐组件
palyLocal(url) {
var that = this;
this.data.innerAudioContext.autoplay = true;
this.data.innerAudioContext.volume = 1;
if(that.data.phoneType == 'ios'){
this.data.innerAudioContext.src = url + '?' + Date.now();
}else{
this.data.innerAudioContext.src = url;
}
this.data.innerAudioContext.onPlay(() => {
console.log('开始播放')
})
this.data.innerAudioContext.onEnded(() => {
console.log('播放结束')
//this.data.innerAudioContext.destroy()
})
},
//播放本地音乐组件
//播放本地音乐组件
palyLocal2(url) {
var that = this;
that.data.innerAudioContext2.autoplay = true;
that.data.innerAudioContext2.volume = 0.4;
that.data.innerAudioContext2.src = url;
that.data.innerAudioContext2.onPlay(() => {
console.log('开始播放22222222')
})
that.data.innerAudioContext2.onEnded(() => {
console.log('播放结束222222')
iosNum = iosNum + 1;
setTimeout(function(){
that.palyLocal2('https://cdn.xiaobentiyu.cn/mp3/2-LoopMelody(BPM130).mp3?a='+iosNum);
},200)
})
that.data.innerAudioContext2.onError((err) => {
console.log('err',err)
})
},
//执行开始
start(){
var that = this;
var downTime = this.data.downTime;
that.palyLocal('/packageC/images/skip.mp3');
that.data.prepare = setTimeout(()=>{
that.setData({
aiState:2
})
that.palyLocal('/images/ai/N5.mp3');
that.data.beforeTimer = setInterval(()=>{
downTime = downTime -1;
this.setData({ downTime: downTime });
if(downTime ===4){
that.palyLocal('/images/ai/N4.mp3');
}else if(downTime ===3){
that.palyLocal('/images/ai/N3.mp3');
}else if(downTime ===2){
that.palyLocal('/images/ai/N2.mp3');
}else if(downTime ===1){
that.palyLocal('/images/ai/N1.mp3');
}else if (downTime === 0) {
clearInterval(that.data.beforeTimer);
that.setData({ downTime: '开始' });
that.palyLocal('/images/ai/V_START.mp3')
setTimeout(function () {
that.setData({
aiState:3
})
that.startTime();
}, 1000);
}
},1000);
},1200)
},
//开始运动
startTime(){
//console.log('开始运动1111111',time)
var that = this;
//time = that.data.time;
time = time + 1;
var downTimeStg = that.formatSeconds(time);
that.setData({
downTimeStg:downTimeStg
},()=>{
that.palyLocal2('https://cdn.xiaobentiyu.cn/mp3/2-LoopMelody(BPM130).mp3');
})
if(time == 1){
//console.log('开始1')
}
if(time == that.data.sportTime - 5){
that.palyLocal('/images/ai/N5.mp3');
}
if(time == that.data.sportTime - 4){
that.palyLocal('/images/ai/N4.mp3');
}
if(time == that.data.sportTime - 3){
that.palyLocal('/images/ai/N3.mp3');
}
if(time == that.data.sportTime - 2){
that.palyLocal('/images/ai/N2.mp3');
}
if(time == that.data.sportTime - 1){
that.palyLocal('/images/ai/N1.mp3');
}
if(time == 10){
//console.log('开始2')
}
if((that.data.sportTime == 30 && time == 8) || (that.data.sportTime != 30 && time == 20)){
// that.startRecord();
}
if((that.data.sportTime == 30 && time == 18) || (that.data.sportTime != 30 && time == 32)){
}
// 时间已过半语音 暂时只支持60秒模式
if(that.data.sportTime == 60 && time == 30){
console.log('开始4')
that.palyLocal('/images/ai/30.mp3');
}
if(time == 40){
//console.log('开始5')
}
if(that.data.sportTime == 60 && time == 50){
//console.log('开始6')
that.palyLocal('/images/ai/50.mp3');
}
if(time == that.data.sportTime){
that.palyLocal('/images/ai/stop.mp3');
console.log('销毁定时器')
wx.showLoading({
title: '统计中...',
})
that.data.innerAudioContext2.destroy();
that.data.waitTimer = setTimeout(function(){
wx.hideLoading();
that.setData({
aiState:5
},()=>{
that.save();
})
},1500)
}
that.data.startTimer = setTimeout(function () {
if(time < that.data.sportTime){
that.startTime();
}
},1000)
},
//秒转换格式mm:ss
formatSeconds(value) {
let result = parseInt(value)
let h = Math.floor(result / 3600) < 10 ? Math.floor(result / 3600) : Math.floor(result / 3600);
let m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result / 60 % 60));
let s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60));
var time = m + ":" + s
return time;
},
//错误知道了
errknow(){
wx.navigateBack({ changed: true});
},
//切换摄像头
switch(){
this.setData({cameraFront:!this.data.cameraFront})
},
//退出页面
exit(){
var that = this;
wx.showModal({
title: '提示',
content: '已开启AI运动模式,确定退出模式?',
cancelText:"继续训练",//默认是“取消”
confirmText:"退出模式",//默认是“确定”
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
clearTimeout(that.data.waitTimer);
clearInterval(that.data.beforeTimer);
clearTimeout(that.data.startTimer);
wx.navigateBack({
changed: true
});
} else {//这里是点击了取消以后
console.log('用户点击取消')
}
}
})
},
initDevice(){
let that = this
wx.getSystemInfo({
success: function (res) {
console.log('当前的系统',res)
if (res.platform == "devtools") {
that.setData({
phoneType: 'ios'
})
} else if (res.platform == "ios") {
that.setData({
phoneType: 'ios'
})
} else if (res.platform == "android") {
that.setData({
phoneType: 'android'
})
}
}
})
wx.getSetting({
success(res) {
if (!res.authSetting['scope.camera']){
wx.showModal({
title: '提示',
content: '请点击右上角设置授权摄像头',
showCancel: false,//是否显示取消按钮
confirmText:"知道了",//默认是“确定”
success: function (res) {
if (res.cancel) {
//点击取消,默认隐藏弹框
} else {
wx.navigateBack({
delta: 1
})
}
}
})
}else{
console.log('正常授权')
}
}
})
wx.openSetting({
success (res) {
if(res.authSetting['scope.camera']){
that.setData({
showCamera:true
})
}
}
})
}
})
\ No newline at end of file
{
"usingComponents": {},
"disableScroll": true
}
\ 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="side-help-img" wx:if="{{showImageUrl}}" src="{{showImageUrl}}"></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>
@import "../../../css/ai-common.wxss";
\ No newline at end of file
var app = getApp()
var poseDetection = require('@tensorflow-models/pose-detection');
//引入混合模式
var flagTimer = null;
var time = 0;
var iosNum = 0;//ios不能重复播放同一地址音频,后加一位数,加时间戳不行
Page({
// mixins: [sportObj[aiSportType]],
behaviors: [require('../ai-mixins/ai-tjz-mixins.js')],
data: {
fps:20,//控制频率
//当前状态 0 提示 1 识别中 2 识别成功,读秒 3 进行中
// 4 成绩提交失败 5 等待成绩上传 6 开始前播报
aiState:6,
downTime:5, //开始倒计时
downTimeStg:'00:00',
uuid:'',//唯一标识
prepare:'',
aiCount:0, //当前个数
waitTimer:'', //等待结果定时器
beforeTimer:'', //开始前定时器
startTimer:'', //进行中定时器
startTips:'', //开始前语音 提醒
phoneType:'', //ios android
showCamera:true,
cameraFront:true, //镜头是否前置
src: '',//实时播报的路径
videoSrc:'',
fileCosFilePath:'',//截取视频
needUploadFilePath:'',
levelfontsize:'',
sportTime:60, //运动时长
skipType:1, //当前跳绳模式 0两者都行 1 双脚 2 单双脚交替
},
onLoad: function (options) {
var that = this;
iosNum = 0;
time = 0;
//运动时长(秒)
if(options.sportTime){
// 30/60/120/180
this.setData({sportTime:options.sportTime,skipType:options.type})
}
// 音频/语音交互相关
this.ctx = wx.createCanvasContext('myCanvas');
that.ctxs = wx.createCameraContext();
this.setData({
innerAudioContext: wx.createInnerAudioContext(), //本地音乐组件
innerAudioContext2: wx.createInnerAudioContext() //倒计时播音组件
},()=>{
that.data.innerAudioContext.obeyMuteSwitch = false;
that.data.innerAudioContext2.obeyMuteSwitch = false;
that.loadMoveNet();
})
//初始化设备
this.initDevice()
},
onUnload(){
var that = this;
that.data.innerAudioContext.destroy();
that.data.innerAudioContext2.destroy();
clearInterval(flagTimer);
clearTimeout(that.data.prepare);
clearTimeout(that.data.waitTimer);
clearInterval(that.data.beforeTimer);
clearTimeout(that.data.startTimer);
},
loadMoveNet(){
var that = this;
if (app.globalData.movenet){
that.data.startTips = setTimeout(function () {
//开始识别
that.setData({
aiState:1
},()=>{
console.log('开始识别运动姿势')
})
},that.data.sportTime * 100 + 500)
that.canvasInit();
that.cameraFrame();
}else{
wx.showLoading({
mask:true,
title: '初始化中...',
})
var modelUrl = wx.getStorageSync('aiModelUrl'),
detectorConfig = {
modelType: poseDetection.movenet.modelType.SINGLEPOSE_LIGHTNING,
modelUrl: modelUrl
};
poseDetection.createDetector(poseDetection.SupportedModels.MoveNet, detectorConfig).then(function (detector) {
wx.hideLoading();
that.palyLocal('/images/ai/clues.mp3');
that.data.startTips = setTimeout(function () {
//开始识别
that.setData({
aiState:1
},()=>{
console.log('开始识别运动姿势')
})
},that.data.sportTime * 100 + 500)
app.globalData.movenet = detector;
that.canvasInit();
that.cameraFrame();
}).catch(function (err) {
console.log(err)
wx.showToast({
icon:'error',
title: '初始化失败',
success:function(){
wx.navigateBack({
delta: 1
})
},
})
})
}
},
canvasInit() { // 获取canvas
var that = this
wx.createSelectorQuery().select('#myCanvas')
.fields({ node: true, size: true })
.exec(function (res) {
var canvas = res[0].node
var ctx = canvas.getContext('2d')
var dpr = wx.getSystemInfoSync().pixelRatio
canvas.width = 480 * dpr
canvas.height = 640 * dpr
ctx.scale(dpr, dpr)
that.ctx = ctx
that.canvas = canvas
that.res0 = res[0]
})
},
cameraFrame() { // 视频流
var that = this,
store = [],
startTime = new Date(),
camera = wx.createCameraContext()
that.listener = camera.onCameraFrame(function (frame) {
//console.log(app.globalData.movenet)
if (frame && app.globalData.movenet) { //帧率控制
store.push(frame)
}
})
console.log('识别')
that.listener.start({
success: function () {
console.log('当前的识别频率',that.data.fps)
//flagTimer && clearInterval(flagTimer)
flagTimer = setInterval(function () { //帧率控制
if (store.length == 0) return;
var object = {
data: new Uint8Array(store[store.length - 1].data),
height: Number(store[store.length - 1].height),
width: Number(store[store.length - 1].width)
}
that.actionSend(object,app)
store = []
that.setData({
resultFps: that.data.resultFps + 1,
fpstime: parseInt((that.data.resultFps + 1) * 1000 / (new Date().getTime() - startTime))
})
}, 1000 / that.data.fps)
},
})
},
//播放本地音乐组件
palyLocal(url) {
var that = this;
this.data.innerAudioContext.autoplay = true;
this.data.innerAudioContext.volume = 1;
if(that.data.phoneType == 'ios'){
this.data.innerAudioContext.src = url + '?' + Date.now();
}else{
this.data.innerAudioContext.src = url;
}
this.data.innerAudioContext.onPlay(() => {
console.log('开始播放')
})
this.data.innerAudioContext.onEnded(() => {
console.log('播放结束')
//this.data.innerAudioContext.destroy()
})
},
//播放本地音乐组件
//播放本地音乐组件
palyLocal2(url) {
var that = this;
that.data.innerAudioContext2.autoplay = true;
that.data.innerAudioContext2.volume = 0.4;
that.data.innerAudioContext2.src = url;
that.data.innerAudioContext2.onPlay(() => {
console.log('开始播放22222222')
})
that.data.innerAudioContext2.onEnded(() => {
console.log('播放结束222222')
iosNum = iosNum + 1;
setTimeout(function(){
that.palyLocal2('https://cdn.xiaobentiyu.cn/mp3/2-LoopMelody(BPM130).mp3?a='+iosNum);
},200)
})
that.data.innerAudioContext2.onError((err) => {
console.log('err',err)
})
},
//执行开始
start(){
var that = this;
var downTime = this.data.downTime;
that.palyLocal('/packageC/images/skip.mp3');
that.data.prepare = setTimeout(()=>{
that.setData({
aiState:2
})
that.palyLocal('/images/ai/N5.mp3');
that.data.beforeTimer = setInterval(()=>{
downTime = downTime -1;
this.setData({ downTime: downTime });
if(downTime ===4){
that.palyLocal('/images/ai/N4.mp3');
}else if(downTime ===3){
that.palyLocal('/images/ai/N3.mp3');
}else if(downTime ===2){
that.palyLocal('/images/ai/N2.mp3');
}else if(downTime ===1){
that.palyLocal('/images/ai/N1.mp3');
}else if (downTime === 0) {
clearInterval(that.data.beforeTimer);
that.setData({ downTime: '开始' });
that.palyLocal('/images/ai/V_START.mp3')
setTimeout(function () {
that.setData({
aiState:3
})
that.startTime();
}, 1000);
}
},1000);
},1200)
},
//开始运动
startTime(){
//console.log('开始运动1111111',time)
var that = this;
//time = that.data.time;
time = time + 1;
var downTimeStg = that.formatSeconds(time);
that.setData({
downTimeStg:downTimeStg
},()=>{
that.palyLocal2('https://cdn.xiaobentiyu.cn/mp3/2-LoopMelody(BPM130).mp3');
})
if(time == 1){
//console.log('开始1')
}
if(time == that.data.sportTime - 5){
that.palyLocal('/images/ai/N5.mp3');
}
if(time == that.data.sportTime - 4){
that.palyLocal('/images/ai/N4.mp3');
}
if(time == that.data.sportTime - 3){
that.palyLocal('/images/ai/N3.mp3');
}
if(time == that.data.sportTime - 2){
that.palyLocal('/images/ai/N2.mp3');
}
if(time == that.data.sportTime - 1){
that.palyLocal('/images/ai/N1.mp3');
}
if(time == 10){
//console.log('开始2')
}
if((that.data.sportTime == 30 && time == 8) || (that.data.sportTime != 30 && time == 20)){
// that.startRecord();
}
if((that.data.sportTime == 30 && time == 18) || (that.data.sportTime != 30 && time == 32)){
}
// 时间已过半语音 暂时只支持60秒模式
if(that.data.sportTime == 60 && time == 30){
console.log('开始4')
that.palyLocal('/images/ai/30.mp3');
}
if(time == 40){
//console.log('开始5')
}
if(that.data.sportTime == 60 && time == 50){
//console.log('开始6')
that.palyLocal('/images/ai/50.mp3');
}
if(time == that.data.sportTime){
that.palyLocal('/images/ai/stop.mp3');
console.log('销毁定时器')
wx.showLoading({
title: '统计中...',
})
that.data.innerAudioContext2.destroy();
that.data.waitTimer = setTimeout(function(){
wx.hideLoading();
that.setData({
aiState:5
},()=>{
that.save();
})
},1500)
}
that.data.startTimer = setTimeout(function () {
if(time < that.data.sportTime){
that.startTime();
}
},1000)
},
//秒转换格式mm:ss
formatSeconds(value) {
let result = parseInt(value)
let h = Math.floor(result / 3600) < 10 ? Math.floor(result / 3600) : Math.floor(result / 3600);
let m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result / 60 % 60));
let s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60));
var time = m + ":" + s
return time;
},
//错误知道了
errknow(){
wx.navigateBack({ changed: true});
},
//切换摄像头
switch(){
this.setData({cameraFront:!this.data.cameraFront})
},
//退出页面
exit(){
var that = this;
wx.showModal({
title: '提示',
content: '已开启AI运动模式,确定退出模式?',
cancelText:"继续训练",//默认是“取消”
confirmText:"退出模式",//默认是“确定”
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
clearTimeout(that.data.waitTimer);
clearInterval(that.data.beforeTimer);
clearTimeout(that.data.startTimer);
wx.navigateBack({
changed: true
});
} else {//这里是点击了取消以后
console.log('用户点击取消')
}
}
})
},
initDevice(){
let that = this
wx.getSystemInfo({
success: function (res) {
console.log('当前的系统',res)
if (res.platform == "devtools") {
that.setData({
phoneType: 'ios'
})
} else if (res.platform == "ios") {
that.setData({
phoneType: 'ios'
})
} else if (res.platform == "android") {
that.setData({
phoneType: 'android'
})
}
}
})
wx.getSetting({
success(res) {
if (!res.authSetting['scope.camera']){
wx.showModal({
title: '提示',
content: '请点击右上角设置授权摄像头',
showCancel: false,//是否显示取消按钮
confirmText:"知道了",//默认是“确定”
success: function (res) {
if (res.cancel) {
//点击取消,默认隐藏弹框
} else {
wx.navigateBack({
delta: 1
})
}
}
})
}else{
console.log('正常授权')
}
}
})
wx.openSetting({
success (res) {
if(res.authSetting['scope.camera']){
that.setData({
showCamera:true
})
}
}
})
}
})
\ No newline at end of file
{
"usingComponents": {},
"disableScroll": true
}
\ 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" wx:if="{{showImageUrl}}" src="{{showImageUrl}}"></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>
@import "../../../css/ai-common.wxss";
\ No newline at end of file
var app = getApp()
var poseDetection = require('@tensorflow-models/pose-detection');
//引入混合模式
var flagTimer = null;
var time = 0;
var iosNum = 0;//ios不能重复播放同一地址音频,后加一位数,加时间戳不行
Page({
behaviors: [require('../ai-mixins/ai-ts-mixins.js')],
name:'ai-sport',
data: {
fps:20,//控制频率
//当前状态 0 提示 1 识别中 2 识别成功,读秒 3 进行中
// 4 成绩提交失败 5 等待成绩上传 6 开始前播报
aiState:6,
downTime:5, //开始倒计时
downTimeStg:'00:00',
uuid:'',//唯一标识
prepare:'',
aiCount:0, //当前个数
waitTimer:'', //等待结果定时器
beforeTimer:'', //开始前定时器
startTimer:'', //进行中定时器
startTips:'', //开始前语音 提醒
phoneType:'', //ios android
showCamera:true,
cameraFront:true, //镜头是否前置
src: '',//实时播报的路径
videoSrc:'',
fileCosFilePath:'',//截取视频
needUploadFilePath:'',
levelfontsize:'',
sportTime:60, //运动时长
skipType:1, //当前跳绳模式 0两者都行 1 双脚 2 单双脚交替
},
onLoad: function (options) {
var that = this;
iosNum = 0;
time = 0;
//运动时长(秒)
if(options.sportTime){
// 30/60/120/180
this.setData({sportTime:options.sportTime,skipType:options.type})
}
// 音频/语音交互相关
this.ctx = wx.createCanvasContext('myCanvas');
that.ctxs = wx.createCameraContext();
this.setData({
innerAudioContext: wx.createInnerAudioContext(), //本地音乐组件
innerAudioContext2: wx.createInnerAudioContext() //倒计时播音组件
},()=>{
that.data.innerAudioContext.obeyMuteSwitch = false;
that.data.innerAudioContext2.obeyMuteSwitch = false;
that.loadMoveNet();
})
//初始化设备
this.initDevice()
},
onUnload(){
var that = this;
that.data.innerAudioContext.destroy();
that.data.innerAudioContext2.destroy();
clearInterval(flagTimer);
clearTimeout(that.data.prepare);
clearTimeout(that.data.waitTimer);
clearInterval(that.data.beforeTimer);
clearTimeout(that.data.startTimer);
},
loadMoveNet(){
var that = this;
if (app.globalData.movenet){
that.data.startTips = setTimeout(function () {
//开始识别
that.setData({
aiState:1
},()=>{
console.log('开始识别运动姿势')
})
},that.data.sportTime * 100 + 500)
that.canvasInit();
that.cameraFrame();
}else{
wx.showLoading({
mask:true,
title: '初始化中...',
})
var modelUrl = wx.getStorageSync('aiModelUrl'),
detectorConfig = {
modelType: poseDetection.movenet.modelType.SINGLEPOSE_LIGHTNING,
modelUrl: modelUrl
};
poseDetection.createDetector(poseDetection.SupportedModels.MoveNet, detectorConfig).then(function (detector) {
wx.hideLoading();
that.palyLocal('/images/ai/clues.mp3');
that.data.startTips = setTimeout(function () {
//开始识别
that.setData({
aiState:1
},()=>{
console.log('开始识别运动姿势')
})
},that.data.sportTime * 100 + 500)
app.globalData.movenet = detector;
that.canvasInit();
that.cameraFrame();
}).catch(function (err) {
console.log(err)
wx.showToast({
icon:'error',
title: '初始化失败',
success:function(){
wx.navigateBack({
delta: 1
})
},
})
})
}
},
canvasInit() { // 获取canvas
var that = this
wx.createSelectorQuery().select('#myCanvas')
.fields({ node: true, size: true })
.exec(function (res) {
var canvas = res[0].node
var ctx = canvas.getContext('2d')
var dpr = wx.getSystemInfoSync().pixelRatio
canvas.width = 480 * dpr
canvas.height = 640 * dpr
ctx.scale(dpr, dpr)
that.ctx = ctx
that.canvas = canvas
that.res0 = res[0]
})
},
cameraFrame() { // 视频流
var that = this,
store = [],
startTime = new Date(),
camera = wx.createCameraContext()
that.listener = camera.onCameraFrame(function (frame) {
//console.log(app.globalData.movenet)
if (frame && app.globalData.movenet) { //帧率控制
store.push(frame)
}
})
console.log('识别')
that.listener.start({
success: function () {
console.log('当前的识别频率',that.data.fps)
//flagTimer && clearInterval(flagTimer)
flagTimer = setInterval(function () { //帧率控制
if (store.length == 0) return;
var object = {
data: new Uint8Array(store[store.length - 1].data),
height: Number(store[store.length - 1].height),
width: Number(store[store.length - 1].width)
}
that.actionSend(object,app)
store = []
that.setData({
resultFps: that.data.resultFps + 1,
fpstime: parseInt((that.data.resultFps + 1) * 1000 / (new Date().getTime() - startTime))
})
}, 1000 / that.data.fps)
},
})
},
//播放本地音乐组件
palyLocal(url) {
var that = this;
this.data.innerAudioContext.autoplay = true;
this.data.innerAudioContext.volume = 1;
if(that.data.phoneType == 'ios'){
this.data.innerAudioContext.src = url + '?' + Date.now();
}else{
this.data.innerAudioContext.src = url;
}
this.data.innerAudioContext.onPlay(() => {
console.log('开始播放')
})
this.data.innerAudioContext.onEnded(() => {
console.log('播放结束')
//this.data.innerAudioContext.destroy()
})
},
//播放本地音乐组件
//播放本地音乐组件
palyLocal2(url) {
var that = this;
that.data.innerAudioContext2.autoplay = true;
that.data.innerAudioContext2.volume = 0.4;
that.data.innerAudioContext2.src = url;
that.data.innerAudioContext2.onPlay(() => {
console.log('开始播放22222222')
})
that.data.innerAudioContext2.onEnded(() => {
console.log('播放结束222222')
iosNum = iosNum + 1;
setTimeout(function(){
that.palyLocal2('https://cdn.xiaobentiyu.cn/mp3/2-LoopMelody(BPM130).mp3?a='+iosNum);
},200)
})
that.data.innerAudioContext2.onError((err) => {
console.log('err',err)
})
},
//执行开始
start(){
var that = this;
var downTime = this.data.downTime;
that.palyLocal('/packageC/images/skip.mp3');
that.data.prepare = setTimeout(()=>{
that.setData({
aiState:2
})
that.palyLocal('/images/ai/N5.mp3');
that.data.beforeTimer = setInterval(()=>{
downTime = downTime -1;
this.setData({ downTime: downTime });
if(downTime ===4){
that.palyLocal('/images/ai/N4.mp3');
}else if(downTime ===3){
that.palyLocal('/images/ai/N3.mp3');
}else if(downTime ===2){
that.palyLocal('/images/ai/N2.mp3');
}else if(downTime ===1){
that.palyLocal('/images/ai/N1.mp3');
}else if (downTime === 0) {
clearInterval(that.data.beforeTimer);
that.setData({ downTime: '开始' });
that.palyLocal('/images/ai/V_START.mp3')
setTimeout(function () {
that.setData({
aiState:3
})
that.startTime();
}, 1000);
}
},1000);
},1200)
},
//开始运动
startTime(){
//console.log('开始运动1111111',time)
var that = this;
//time = that.data.time;
time = time + 1;
var downTimeStg = that.formatSeconds(time);
that.setData({
downTimeStg:downTimeStg
},()=>{
that.palyLocal2('https://cdn.xiaobentiyu.cn/mp3/2-LoopMelody(BPM130).mp3');
})
if(time == 1){
//console.log('开始1')
}
if(time == that.data.sportTime - 5){
that.palyLocal('/images/ai/N5.mp3');
}
if(time == that.data.sportTime - 4){
that.palyLocal('/images/ai/N4.mp3');
}
if(time == that.data.sportTime - 3){
that.palyLocal('/images/ai/N3.mp3');
}
if(time == that.data.sportTime - 2){
that.palyLocal('/images/ai/N2.mp3');
}
if(time == that.data.sportTime - 1){
that.palyLocal('/images/ai/N1.mp3');
}
if(time == 10){
//console.log('开始2')
}
if((that.data.sportTime == 30 && time == 8) || (that.data.sportTime != 30 && time == 20)){
// that.startRecord();
}
if((that.data.sportTime == 30 && time == 18) || (that.data.sportTime != 30 && time == 32)){
}
// 时间已过半语音 暂时只支持60秒模式
if(that.data.sportTime == 60 && time == 30){
console.log('开始4')
that.palyLocal('/images/ai/30.mp3');
}
if(time == 40){
//console.log('开始5')
}
if(that.data.sportTime == 60 && time == 50){
//console.log('开始6')
that.palyLocal('/images/ai/50.mp3');
}
if(time == that.data.sportTime){
that.palyLocal('/images/ai/stop.mp3');
console.log('销毁定时器')
wx.showLoading({
title: '统计中...',
})
that.data.innerAudioContext2.destroy();
that.data.waitTimer = setTimeout(function(){
wx.hideLoading();
that.setData({
aiState:5
},()=>{
that.save();
})
},1500)
}
that.data.startTimer = setTimeout(function () {
if(time < that.data.sportTime){
that.startTime();
}
},1000)
},
//秒转换格式mm:ss
formatSeconds(value) {
let result = parseInt(value)
let h = Math.floor(result / 3600) < 10 ? Math.floor(result / 3600) : Math.floor(result / 3600);
let m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result / 60 % 60));
let s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60));
var time = m + ":" + s
return time;
},
//错误知道了
errknow(){
wx.navigateBack({ changed: true});
},
//切换摄像头
switch(){
this.setData({cameraFront:!this.data.cameraFront})
},
//退出页面
exit(){
var that = this;
wx.showModal({
title: '提示',
content: '已开启AI运动模式,确定退出模式?',
cancelText:"继续训练",//默认是“取消”
confirmText:"退出模式",//默认是“确定”
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
clearTimeout(that.data.waitTimer);
clearInterval(that.data.beforeTimer);
clearTimeout(that.data.startTimer);
wx.navigateBack({
changed: true
});
} else {//这里是点击了取消以后
console.log('用户点击取消')
}
}
})
},
initDevice(){
let that = this
wx.getSystemInfo({
success: function (res) {
console.log('当前的系统',res)
if (res.platform == "devtools") {
that.setData({
phoneType: 'ios'
})
} else if (res.platform == "ios") {
that.setData({
phoneType: 'ios'
})
} else if (res.platform == "android") {
that.setData({
phoneType: 'android'
})
}
}
})
wx.getSetting({
success(res) {
if (!res.authSetting['scope.camera']){
wx.showModal({
title: '提示',
content: '请点击右上角设置授权摄像头',
showCancel: false,//是否显示取消按钮
confirmText:"知道了",//默认是“确定”
success: function (res) {
if (res.cancel) {
//点击取消,默认隐藏弹框
} else {
wx.navigateBack({
delta: 1
})
}
}
})
}else{
console.log('正常授权')
}
}
})
wx.openSetting({
success (res) {
if(res.authSetting['scope.camera']){
that.setData({
showCamera:true
})
}
}
})
}
})
\ No newline at end of file
{
"usingComponents": {},
"disableScroll": true
}
\ 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" wx:if="{{showImageUrl}}" src="{{showImageUrl}}"></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>
@import "../../../css/ai-common.wxss";
\ No newline at end of file
var app = getApp()
var poseDetection = require('@tensorflow-models/pose-detection');
//引入混合模式
var flagTimer = null;
var time = 0;
var iosNum = 0;//ios不能重复播放同一地址音频,后加一位数,加时间戳不行
Page({
// mixins: [sportObj[aiSportType]],
behaviors: [require('../ai-mixins/ai-ydp-mixins.js')],
data: {
fps:20,//控制频率
//当前状态 0 提示 1 识别中 2 识别成功,读秒 3 进行中
// 4 成绩提交失败 5 等待成绩上传 6 开始前播报
aiState:6,
downTime:5, //开始倒计时
downTimeStg:'00:00',
uuid:'',//唯一标识
prepare:'',
aiCount:0, //当前个数
waitTimer:'', //等待结果定时器
beforeTimer:'', //开始前定时器
startTimer:'', //进行中定时器
startTips:'', //开始前语音 提醒
phoneType:'', //ios android
showCamera:true,
cameraFront:true, //镜头是否前置
src: '',//实时播报的路径
videoSrc:'',
fileCosFilePath:'',//截取视频
needUploadFilePath:'',
levelfontsize:'',
sportTime:60, //运动时长
skipType:1, //当前跳绳模式 0两者都行 1 双脚 2 单双脚交替
},
onLoad: function (options) {
var that = this;
iosNum = 0;
time = 0;
//运动时长(秒)
if(options.sportTime){
// 30/60/120/180
this.setData({sportTime:options.sportTime,skipType:options.type})
}
// 音频/语音交互相关
this.ctx = wx.createCanvasContext('myCanvas');
that.ctxs = wx.createCameraContext();
this.setData({
innerAudioContext: wx.createInnerAudioContext(), //本地音乐组件
innerAudioContext2: wx.createInnerAudioContext() //倒计时播音组件
},()=>{
that.data.innerAudioContext.obeyMuteSwitch = false;
that.data.innerAudioContext2.obeyMuteSwitch = false;
that.loadMoveNet();
})
//初始化设备
this.initDevice()
},
onUnload(){
var that = this;
that.data.innerAudioContext.destroy();
that.data.innerAudioContext2.destroy();
clearInterval(flagTimer);
clearTimeout(that.data.prepare);
clearTimeout(that.data.waitTimer);
clearInterval(that.data.beforeTimer);
clearTimeout(that.data.startTimer);
},
loadMoveNet(){
var that = this;
if (app.globalData.movenet){
that.data.startTips = setTimeout(function () {
//开始识别
that.setData({
aiState:1
},()=>{
console.log('开始识别运动姿势')
})
},that.data.sportTime * 100 + 500)
that.canvasInit();
that.cameraFrame();
}else{
wx.showLoading({
mask:true,
title: '初始化中...',
})
var modelUrl = wx.getStorageSync('aiModelUrl'),
detectorConfig = {
modelType: poseDetection.movenet.modelType.SINGLEPOSE_LIGHTNING,
modelUrl: modelUrl
};
poseDetection.createDetector(poseDetection.SupportedModels.MoveNet, detectorConfig).then(function (detector) {
wx.hideLoading();
that.palyLocal('/images/ai/clues.mp3');
that.data.startTips = setTimeout(function () {
//开始识别
that.setData({
aiState:1
},()=>{
console.log('开始识别运动姿势')
})
},that.data.sportTime * 100 + 500)
app.globalData.movenet = detector;
that.canvasInit();
that.cameraFrame();
}).catch(function (err) {
console.log(err)
wx.showToast({
icon:'error',
title: '初始化失败',
success:function(){
wx.navigateBack({
delta: 1
})
},
})
})
}
},
canvasInit() { // 获取canvas
var that = this
wx.createSelectorQuery().select('#myCanvas')
.fields({ node: true, size: true })
.exec(function (res) {
var canvas = res[0].node
var ctx = canvas.getContext('2d')
var dpr = wx.getSystemInfoSync().pixelRatio
canvas.width = 480 * dpr
canvas.height = 640 * dpr
ctx.scale(dpr, dpr)
that.ctx = ctx
that.canvas = canvas
that.res0 = res[0]
})
},
cameraFrame() { // 视频流
var that = this,
store = [],
startTime = new Date(),
camera = wx.createCameraContext()
that.listener = camera.onCameraFrame(function (frame) {
//console.log(app.globalData.movenet)
if (frame && app.globalData.movenet) { //帧率控制
store.push(frame)
}
})
console.log('识别')
that.listener.start({
success: function () {
console.log('当前的识别频率',that.data.fps)
//flagTimer && clearInterval(flagTimer)
flagTimer = setInterval(function () { //帧率控制
if (store.length == 0) return;
var object = {
data: new Uint8Array(store[store.length - 1].data),
height: Number(store[store.length - 1].height),
width: Number(store[store.length - 1].width)
}
that.actionSend(object,app)
store = []
that.setData({
resultFps: that.data.resultFps + 1,
fpstime: parseInt((that.data.resultFps + 1) * 1000 / (new Date().getTime() - startTime))
})
}, 1000 / that.data.fps)
},
})
},
//播放本地音乐组件
palyLocal(url) {
var that = this;
this.data.innerAudioContext.autoplay = true;
this.data.innerAudioContext.volume = 1;
if(that.data.phoneType == 'ios'){
this.data.innerAudioContext.src = url + '?' + Date.now();
}else{
this.data.innerAudioContext.src = url;
}
this.data.innerAudioContext.onPlay(() => {
console.log('开始播放')
})
this.data.innerAudioContext.onEnded(() => {
console.log('播放结束')
//this.data.innerAudioContext.destroy()
})
},
//播放本地音乐组件
//播放本地音乐组件
palyLocal2(url) {
var that = this;
that.data.innerAudioContext2.autoplay = true;
that.data.innerAudioContext2.volume = 0.4;
that.data.innerAudioContext2.src = url;
that.data.innerAudioContext2.onPlay(() => {
console.log('开始播放22222222')
})
that.data.innerAudioContext2.onEnded(() => {
console.log('播放结束222222')
iosNum = iosNum + 1;
setTimeout(function(){
that.palyLocal2('https://cdn.xiaobentiyu.cn/mp3/2-LoopMelody(BPM130).mp3?a='+iosNum);
},200)
})
that.data.innerAudioContext2.onError((err) => {
console.log('err',err)
})
},
//执行开始
start(){
var that = this;
var downTime = this.data.downTime;
that.palyLocal('/packageC/images/skip.mp3');
that.data.prepare = setTimeout(()=>{
that.setData({
aiState:2
})
that.palyLocal('/images/ai/N5.mp3');
that.data.beforeTimer = setInterval(()=>{
downTime = downTime -1;
this.setData({ downTime: downTime });
if(downTime ===4){
that.palyLocal('/images/ai/N4.mp3');
}else if(downTime ===3){
that.palyLocal('/images/ai/N3.mp3');
}else if(downTime ===2){
that.palyLocal('/images/ai/N2.mp3');
}else if(downTime ===1){
that.palyLocal('/images/ai/N1.mp3');
}else if (downTime === 0) {
clearInterval(that.data.beforeTimer);
that.setData({ downTime: '开始' });
that.palyLocal('/images/ai/V_START.mp3')
setTimeout(function () {
that.setData({
aiState:3
})
that.startTime();
}, 1000);
}
},1000);
},1200)
},
//开始运动
startTime(){
//console.log('开始运动1111111',time)
var that = this;
//time = that.data.time;
time = time + 1;
var downTimeStg = that.formatSeconds(time);
that.setData({
downTimeStg:downTimeStg
},()=>{
that.palyLocal2('https://cdn.xiaobentiyu.cn/mp3/2-LoopMelody(BPM130).mp3');
})
if(time == 1){
//console.log('开始1')
}
if(time == that.data.sportTime - 5){
that.palyLocal('/images/ai/N5.mp3');
}
if(time == that.data.sportTime - 4){
that.palyLocal('/images/ai/N4.mp3');
}
if(time == that.data.sportTime - 3){
that.palyLocal('/images/ai/N3.mp3');
}
if(time == that.data.sportTime - 2){
that.palyLocal('/images/ai/N2.mp3');
}
if(time == that.data.sportTime - 1){
that.palyLocal('/images/ai/N1.mp3');
}
if(time == 10){
//console.log('开始2')
}
if((that.data.sportTime == 30 && time == 8) || (that.data.sportTime != 30 && time == 20)){
// that.startRecord();
}
if((that.data.sportTime == 30 && time == 18) || (that.data.sportTime != 30 && time == 32)){
}
// 时间已过半语音 暂时只支持60秒模式
if(that.data.sportTime == 60 && time == 30){
console.log('开始4')
that.palyLocal('/images/ai/30.mp3');
}
if(time == 40){
//console.log('开始5')
}
if(that.data.sportTime == 60 && time == 50){
//console.log('开始6')
that.palyLocal('/images/ai/50.mp3');
}
if(time == that.data.sportTime){
that.palyLocal('/images/ai/stop.mp3');
console.log('销毁定时器')
wx.showLoading({
title: '统计中...',
})
that.data.innerAudioContext2.destroy();
that.data.waitTimer = setTimeout(function(){
wx.hideLoading();
that.setData({
aiState:5
},()=>{
that.save();
})
},1500)
}
that.data.startTimer = setTimeout(function () {
if(time < that.data.sportTime){
that.startTime();
}
},1000)
},
//秒转换格式mm:ss
formatSeconds(value) {
let result = parseInt(value)
let h = Math.floor(result / 3600) < 10 ? Math.floor(result / 3600) : Math.floor(result / 3600);
let m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result / 60 % 60));
let s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60));
var time = m + ":" + s
return time;
},
//错误知道了
errknow(){
wx.navigateBack({ changed: true});
},
//切换摄像头
switch(){
this.setData({cameraFront:!this.data.cameraFront})
},
//退出页面
exit(){
var that = this;
wx.showModal({
title: '提示',
content: '已开启AI运动模式,确定退出模式?',
cancelText:"继续训练",//默认是“取消”
confirmText:"退出模式",//默认是“确定”
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
clearTimeout(that.data.waitTimer);
clearInterval(that.data.beforeTimer);
clearTimeout(that.data.startTimer);
wx.navigateBack({
changed: true
});
} else {//这里是点击了取消以后
console.log('用户点击取消')
}
}
})
},
initDevice(){
let that = this
wx.getSystemInfo({
success: function (res) {
console.log('当前的系统',res)
if (res.platform == "devtools") {
that.setData({
phoneType: 'ios'
})
} else if (res.platform == "ios") {
that.setData({
phoneType: 'ios'
})
} else if (res.platform == "android") {
that.setData({
phoneType: 'android'
})
}
}
})
wx.getSetting({
success(res) {
if (!res.authSetting['scope.camera']){
wx.showModal({
title: '提示',
content: '请点击右上角设置授权摄像头',
showCancel: false,//是否显示取消按钮
confirmText:"知道了",//默认是“确定”
success: function (res) {
if (res.cancel) {
//点击取消,默认隐藏弹框
} else {
wx.navigateBack({
delta: 1
})
}
}
})
}else{
console.log('正常授权')
}
}
})
wx.openSetting({
success (res) {
if(res.authSetting['scope.camera']){
that.setData({
showCamera:true
})
}
}
})
}
})
\ No newline at end of file
{
"usingComponents": {},
"disableScroll": true
}
\ 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="side-help-img" wx:if="{{showImageUrl}}" src="{{showImageUrl}}"></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>
@import "../../../css/ai-common.wxss";
\ No newline at end of file
var app = getApp()
var poseDetection = require('@tensorflow-models/pose-detection');
//引入混合模式
var flagTimer = null;
var time = 0;
var iosNum = 0;//ios不能重复播放同一地址音频,后加一位数,加时间戳不行
Page({
// mixins: [sportObj[aiSportType]],
behaviors: [require('../ai-mixins/ai-ydtt-mixins.js')],
data: {
fps:20,//控制频率
//当前状态 0 提示 1 识别中 2 识别成功,读秒 3 进行中
// 4 成绩提交失败 5 等待成绩上传 6 开始前播报
aiState:6,
downTime:5, //开始倒计时
downTimeStg:'00:00',
uuid:'',//唯一标识
prepare:'',
aiCount:0, //当前个数
waitTimer:'', //等待结果定时器
beforeTimer:'', //开始前定时器
startTimer:'', //进行中定时器
startTips:'', //开始前语音 提醒
phoneType:'', //ios android
showCamera:true,
cameraFront:true, //镜头是否前置
src: '',//实时播报的路径
videoSrc:'',
fileCosFilePath:'',//截取视频
needUploadFilePath:'',
levelfontsize:'',
sportTime:60, //运动时长
skipType:1, //当前跳绳模式 0两者都行 1 双脚 2 单双脚交替
},
onLoad: function (options) {
var that = this;
iosNum = 0;
time = 0;
//运动时长(秒)
if(options.sportTime){
// 30/60/120/180
this.setData({sportTime:options.sportTime,skipType:options.type})
}
// 音频/语音交互相关
this.ctx = wx.createCanvasContext('myCanvas');
that.ctxs = wx.createCameraContext();
this.setData({
innerAudioContext: wx.createInnerAudioContext(), //本地音乐组件
innerAudioContext2: wx.createInnerAudioContext() //倒计时播音组件
},()=>{
that.data.innerAudioContext.obeyMuteSwitch = false;
that.data.innerAudioContext2.obeyMuteSwitch = false;
that.loadMoveNet();
})
//初始化设备
this.initDevice()
},
onUnload(){
var that = this;
that.data.innerAudioContext.destroy();
that.data.innerAudioContext2.destroy();
clearInterval(flagTimer);
clearTimeout(that.data.prepare);
clearTimeout(that.data.waitTimer);
clearInterval(that.data.beforeTimer);
clearTimeout(that.data.startTimer);
},
loadMoveNet(){
var that = this;
if (app.globalData.movenet){
that.data.startTips = setTimeout(function () {
//开始识别
that.setData({
aiState:1
},()=>{
console.log('开始识别运动姿势')
})
},that.data.sportTime * 100 + 500)
that.canvasInit();
that.cameraFrame();
}else{
wx.showLoading({
mask:true,
title: '初始化中...',
})
var modelUrl = wx.getStorageSync('aiModelUrl'),
detectorConfig = {
modelType: poseDetection.movenet.modelType.SINGLEPOSE_LIGHTNING,
modelUrl: modelUrl
};
poseDetection.createDetector(poseDetection.SupportedModels.MoveNet, detectorConfig).then(function (detector) {
wx.hideLoading();
that.palyLocal('/images/ai/clues.mp3');
that.data.startTips = setTimeout(function () {
//开始识别
that.setData({
aiState:1
},()=>{
console.log('开始识别运动姿势')
})
},that.data.sportTime * 100 + 500)
app.globalData.movenet = detector;
that.canvasInit();
that.cameraFrame();
}).catch(function (err) {
console.log(err)
wx.showToast({
icon:'error',
title: '初始化失败',
success:function(){
wx.navigateBack({
delta: 1
})
},
})
})
}
},
canvasInit() { // 获取canvas
var that = this
wx.createSelectorQuery().select('#myCanvas')
.fields({ node: true, size: true })
.exec(function (res) {
var canvas = res[0].node
var ctx = canvas.getContext('2d')
var dpr = wx.getSystemInfoSync().pixelRatio
canvas.width = 480 * dpr
canvas.height = 640 * dpr
ctx.scale(dpr, dpr)
that.ctx = ctx
that.canvas = canvas
that.res0 = res[0]
})
},
cameraFrame() { // 视频流
var that = this,
store = [],
startTime = new Date(),
camera = wx.createCameraContext()
that.listener = camera.onCameraFrame(function (frame) {
//console.log(app.globalData.movenet)
if (frame && app.globalData.movenet) { //帧率控制
store.push(frame)
}
})
console.log('识别')
that.listener.start({
success: function () {
console.log('当前的识别频率',that.data.fps)
//flagTimer && clearInterval(flagTimer)
flagTimer = setInterval(function () { //帧率控制
if (store.length == 0) return;
var object = {
data: new Uint8Array(store[store.length - 1].data),
height: Number(store[store.length - 1].height),
width: Number(store[store.length - 1].width)
}
that.actionSend(object,app)
store = []
that.setData({
resultFps: that.data.resultFps + 1,
fpstime: parseInt((that.data.resultFps + 1) * 1000 / (new Date().getTime() - startTime))
})
}, 1000 / that.data.fps)
},
})
},
//播放本地音乐组件
palyLocal(url) {
var that = this;
this.data.innerAudioContext.autoplay = true;
this.data.innerAudioContext.volume = 1;
if(that.data.phoneType == 'ios'){
this.data.innerAudioContext.src = url + '?' + Date.now();
}else{
this.data.innerAudioContext.src = url;
}
this.data.innerAudioContext.onPlay(() => {
console.log('开始播放')
})
this.data.innerAudioContext.onEnded(() => {
console.log('播放结束')
//this.data.innerAudioContext.destroy()
})
},
//播放本地音乐组件
//播放本地音乐组件
palyLocal2(url) {
var that = this;
that.data.innerAudioContext2.autoplay = true;
that.data.innerAudioContext2.volume = 0.4;
that.data.innerAudioContext2.src = url;
that.data.innerAudioContext2.onPlay(() => {
console.log('开始播放22222222')
})
that.data.innerAudioContext2.onEnded(() => {
console.log('播放结束222222')
iosNum = iosNum + 1;
setTimeout(function(){
that.palyLocal2('https://cdn.xiaobentiyu.cn/mp3/2-LoopMelody(BPM130).mp3?a='+iosNum);
},200)
})
that.data.innerAudioContext2.onError((err) => {
console.log('err',err)
})
},
//执行开始
start(){
var that = this;
var downTime = this.data.downTime;
that.palyLocal('/packageC/images/skip.mp3');
that.data.prepare = setTimeout(()=>{
that.setData({
aiState:2
})
that.palyLocal('/images/ai/N5.mp3');
that.data.beforeTimer = setInterval(()=>{
downTime = downTime -1;
this.setData({ downTime: downTime });
if(downTime ===4){
that.palyLocal('/images/ai/N4.mp3');
}else if(downTime ===3){
that.palyLocal('/images/ai/N3.mp3');
}else if(downTime ===2){
that.palyLocal('/images/ai/N2.mp3');
}else if(downTime ===1){
that.palyLocal('/images/ai/N1.mp3');
}else if (downTime === 0) {
clearInterval(that.data.beforeTimer);
that.setData({ downTime: '开始' });
that.palyLocal('/images/ai/V_START.mp3')
setTimeout(function () {
that.setData({
aiState:3
})
that.startTime();
}, 1000);
}
},1000);
},1200)
},
//开始运动
startTime(){
//console.log('开始运动1111111',time)
var that = this;
//time = that.data.time;
time = time + 1;
var downTimeStg = that.formatSeconds(time);
that.setData({
downTimeStg:downTimeStg
},()=>{
that.palyLocal2('https://cdn.xiaobentiyu.cn/mp3/2-LoopMelody(BPM130).mp3');
})
if(time == 1){
//console.log('开始1')
}
if(time == that.data.sportTime - 5){
that.palyLocal('/images/ai/N5.mp3');
}
if(time == that.data.sportTime - 4){
that.palyLocal('/images/ai/N4.mp3');
}
if(time == that.data.sportTime - 3){
that.palyLocal('/images/ai/N3.mp3');
}
if(time == that.data.sportTime - 2){
that.palyLocal('/images/ai/N2.mp3');
}
if(time == that.data.sportTime - 1){
that.palyLocal('/images/ai/N1.mp3');
}
if(time == 10){
//console.log('开始2')
}
if((that.data.sportTime == 30 && time == 8) || (that.data.sportTime != 30 && time == 20)){
// that.startRecord();
}
if((that.data.sportTime == 30 && time == 18) || (that.data.sportTime != 30 && time == 32)){
}
// 时间已过半语音 暂时只支持60秒模式
if(that.data.sportTime == 60 && time == 30){
console.log('开始4')
that.palyLocal('/images/ai/30.mp3');
}
if(time == 40){
//console.log('开始5')
}
if(that.data.sportTime == 60 && time == 50){
//console.log('开始6')
that.palyLocal('/images/ai/50.mp3');
}
if(time == that.data.sportTime){
that.palyLocal('/images/ai/stop.mp3');
console.log('销毁定时器')
wx.showLoading({
title: '统计中...',
})
that.data.innerAudioContext2.destroy();
that.data.waitTimer = setTimeout(function(){
wx.hideLoading();
that.setData({
aiState:5
},()=>{
that.save();
})
},1500)
}
that.data.startTimer = setTimeout(function () {
if(time < that.data.sportTime){
that.startTime();
}
},1000)
},
//秒转换格式mm:ss
formatSeconds(value) {
let result = parseInt(value)
let h = Math.floor(result / 3600) < 10 ? Math.floor(result / 3600) : Math.floor(result / 3600);
let m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result / 60 % 60));
let s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60));
var time = m + ":" + s
return time;
},
//错误知道了
errknow(){
wx.navigateBack({ changed: true});
},
//切换摄像头
switch(){
this.setData({cameraFront:!this.data.cameraFront})
},
//退出页面
exit(){
var that = this;
wx.showModal({
title: '提示',
content: '已开启AI运动模式,确定退出模式?',
cancelText:"继续训练",//默认是“取消”
confirmText:"退出模式",//默认是“确定”
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
clearTimeout(that.data.waitTimer);
clearInterval(that.data.beforeTimer);
clearTimeout(that.data.startTimer);
wx.navigateBack({
changed: true
});
} else {//这里是点击了取消以后
console.log('用户点击取消')
}
}
})
},
initDevice(){
let that = this
wx.getSystemInfo({
success: function (res) {
console.log('当前的系统',res)
if (res.platform == "devtools") {
that.setData({
phoneType: 'ios'
})
} else if (res.platform == "ios") {
that.setData({
phoneType: 'ios'
})
} else if (res.platform == "android") {
that.setData({
phoneType: 'android'
})
}
}
})
wx.getSetting({
success(res) {
if (!res.authSetting['scope.camera']){
wx.showModal({
title: '提示',
content: '请点击右上角设置授权摄像头',
showCancel: false,//是否显示取消按钮
confirmText:"知道了",//默认是“确定”
success: function (res) {
if (res.cancel) {
//点击取消,默认隐藏弹框
} else {
wx.navigateBack({
delta: 1
})
}
}
})
}else{
console.log('正常授权')
}
}
})
wx.openSetting({
success (res) {
if(res.authSetting['scope.camera']){
that.setData({
showCamera:true
})
}
}
})
}
})
\ No newline at end of file
{
"usingComponents": {},
"disableScroll": true
}
\ 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="side-help-img" wx:if="{{showImageUrl}}" src="{{showImageUrl}}"></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>
@import "../../../css/ai-common.wxss";
\ No newline at end of file
......@@ -6,7 +6,7 @@ var time = 0;
var iosNum = 0;//ios不能重复播放同一地址音频,后加一位数,加时间戳不行
Page({
mixins: [require('../ai-mixins/ai-ywqz-mixins.js')],
behaviors: [require('../ai-mixins/ai-ywqz-mixins.js')],
data: {
fps:20,//控制频率
......
......@@ -2,7 +2,7 @@
<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>
<image class="ywqz-help-img" src="{{showImageUrl}}"></image>
<view class="help">
<view class="title">互动小提示</view>
<view class="content">手机竖屏固定放置,调整屏幕角度,训练者全身及双脚出现至屏幕内,识别更精准。</view>
......
@font-face {
font-family: 'Number';
src: url('data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAAACB8ABEAAAAAXXQAACAcAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE0cGh4bqmQcMAZWAIJKCBwJFAr8dO8IC4FKAAE2AiQDgw4EIAWEKweBeAxDG5NUNWxbGhO7HYCq/2nriGpSGaOiTg5G1uz//5LcISp7wT4uMYeihK2cJ3YaHd7lHRcbJjvh2B8qIyJoolRTwy8o3lSiOtqso1nxphLVkcuHv++KLihRKLbPzGt2Q9mBtnFiW+iQ9EDgKLNH+p9cZ5be0l5cU4WLOCqpA+ZngDusaKrTf8Krer+CTlc1ZiX30tXJaCHWIbnzZA00TgCWcgXRj09g4HQDtM2YucKomIKF0dASZYKKHejCwGQJy0IXSS10e+POLFw2WMt8D6eVI83Ipcqtbbe91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ytqqz2TRNXGGHgYmld6oSwU6BXR/aGotufoVxbAotakXIRzNUlGRW/6/ryjXse7XmpEl9T3ipiDDE5cLCds1jqwqyEMzDfdSLZDf26blrq4vn8L3Uh6CCT4pzYd7O6zviFiAABKzzf1qDoi1/LVvDDb1T3ufJ29zsKWj7P29jTgdggQEACDCn/w8wXLRFa6MNCPPDDGOXkAnzhcEhqA3asnwx/YUY+yWufQFGx6ke/JP/8QxO5eYFxsARcvsKrQrwTfBBnH0FPo9rJrwLzsXZGfQFvQ99DuvX6+GvIF1huBHWMv9/nDhLwHXWOrM+uA8sD0uCl2Pa95fWIreFf8J/4M/mI4tp3WJ637jWAjYHexy65LeCLgIKx/SuvxBa+dwxVrSCGgOLws9spLXQGI5eMAAADBZi4AAWk97oEMGBBNvVxsBVgmBgdYIhgIMJDRWJEjoMqp8wkEHZumm70ixocT3YLhewBIFjfoIhgo0JDV1wMqGDU+WEgbLU9NFmgtPPn05/yXSDYbHKFsQED2BooIRrMBJDcY5xGTXcyrg4FP7TlXuj6E/rwzi2dsjEA0ZDxRsm/4gs9e2q2ftMTp0ITVygEPouVDOLJtTmYKGvy+YSUSPv1iZ9nkbYi+T45IZ7G1kt8DVeytQYApwPO978eQEDB/MVDEL9hz3oW9wa+PcqZd/qV+G5YUSlrmqtaq1TbfRelLQjuKJtlopwlHCA83Yb8sll9zItDnjtATSY7na5WcPcznrXXfb2uyuhNN0wLVY7e/q18KcAeuMYRRWFbDtOZEuKZnAd4JCJVKaQUlgmIfC6/meQa2pp6+jq6RsYGvnL3/7xr//8b2xiamZuYWllbWNrZ+/g6OTs4urm7uHp5e1DzEAMwmAMIUZaYMbEMXXr3n40ho2uV/9ORTkPBi0rEDBNIoDmn2L/vzwZ3WE5/FGNdUKNo4Ze3MOM3eUc1vWOozsA') format('woff2');
}
page{
background: #D1D1D1;
}
.canvas {
position: absolute;
width: 100%;
height: 100%;
z-index: 100;
}
/* 自定义导航条样式 */
.nav{
width: 100%;
overflow: hidden;
position: relative;
top: 0;
left: 0;
z-index: 10;
}
.nav-title{
width: 100%;
height: 90rpx;
line-height: 90rpx;
text-align: center;
position: absolute;
bottom: 0;
left: 0;
z-index: 10;
font-size:26rpx;
color: #FFFFFF;
}
.nav .back{
width: 44rpx;
height: 44rpx;
position: absolute;
bottom: 0;
left: 0;
padding: 24rpx 30rpx;
}
.bg-white{
background-color: transparent;
}
.bg-gray{
background-color: #f7f7f7;
}
.overflow{
overflow: auto;
}
.hidden{
overflow: hidden;
}
.user-info image{
width: 64rpx;
height: 64rpx;
}
.tips{
position:absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 80%;
padding-bottom: 50rpx;
text-align: justify;
/* height: 242px; */
background: #FFFFFF;
box-shadow: 0px 2px 20px rgba(0, 0, 0, 0.08);
border-radius: 12px;
padding:15px;
z-index: 99;
}
.errors{
height: 110px;
}
.error-type{
width: 90%;
margin: 0 auto;
margin-top: 10px;
}
.tips-type{
overflow: hidden;
}
.correct{
float: left;
width: 154px;
height: 140px;
margin-right: 1px;
}
.correct .img{
width: 100%;
height: 100px;
background: #F8F8F8;
}
.correct .img image{
width: 100%;
height: 100px;
background: #F8F8F8;
}
.error .img image{
width: 100%;
height: 100px;
background: #F8F8F8;
}
.correct .text{
font-size: 12px;
color: #353535;
text-align: center;
line-height: 40px;
}
.no-tips{
float: left;
font-size: 14px;
color: #888888;
padding-top: 10px;
padding-left: 20px;
}
.know{
float: left;
width: 320rpx;
height: 40px;
line-height: 40px;
color: #FFFFFF;
border-radius: 22px;
text-align: center;
background: #FF9B4D;
margin-left: 160rpx;
font-size: 17px;
font-weight: bold;
margin-top: 14px;
}
.error{
float: left;
width: 100px;
height: 140px;
margin-right: 1px;
}
.error .img{
width: 100%;
height: 100px;
background: #F8F8F8;
}
.error .text{
font-size: 12px;
color: #353535;
text-align: center;
line-height: 40px;
}
.handle{
width: 100%;
height: 40px;
}
.switch{
position: absolute;
height: 44px;
padding-right: 10px;
line-height: 44px;
background: #000000;
opacity: 0.74;
border-radius: 12px;
left: 20px;
bottom: 15px;
color: #FFFFFF;
z-index: 99;
}
.switch .text{
padding-left: 40px;
}
.switch image{
position: absolute;
top: 10px;
left: 6px;
width: 32px;
height: 26px;
}
.exit{
position: absolute;
height: 44px;
padding-right: 10px;
line-height: 44px;
background: #000000;
opacity: 0.74;
border-radius: 12px;
right: 20px;
bottom: 15px;
color: #FFFFFF;
z-index: 99;
}
.exit .text{
padding-left: 40px;
}
.exit image{
position: absolute;
top: 8px;
left: 6px;
width: 32px;
height: 26px;
}
.help{
position: absolute;
left: 20px;
width: 192px;
background: #000000;
opacity: 0.74;
border-radius: 12px;
color: #FFFFFF;
text-align: center;
font-size: 14px;
z-index: 99;
padding-bottom: 40rpx;
bottom: 160rpx;
}
.help .title{
margin-top: 15px;
}
.help .content{
width: 86%;
margin: 0 auto;
text-align: left;
margin-top: 12px;
}
.help-img{
position:absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 432rpx;
height: 988rpx;
z-index: 98;
}
.countdown{
position:absolute;
width: 100%;
height: 100%;
background: #FF9B4D;
z-index: 100;
}
.countdown .second{
position:absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #FFFFFF;
font-size: 160rpx;
font-family: 'Number';
z-index: 101;
}
.time{
position: absolute;
width: 220rpx;
height: 48px;
font-size: 34px;
line-height: 48px;
color: #FFFFFF;
background: #000000;
opacity: 0.74;
border-radius: 12px;
font-family: 'Number';
left: 20px;
top: 140rpx;
text-align: center;
z-index: 99;
}
.number{
position: absolute;
width: 220rpx;
height: 48px;
font-size: 34px;
line-height: 48px;
color: #FFFFFF;
background: #000000;
opacity: 0.74;
border-radius: 12px;
font-family: 'Number';
right: 20px;
top: 140rpx;
text-align: center;
z-index: 99;
}
.grade{
overflow: hidden;
position:absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 487px;
height: 242px;
background: #FFFFFF;
box-shadow: 0px 2px 20px rgba(0, 0, 0, 0.08);
border-radius: 12px;
z-index: 100;
}
.grade .num{
text-align: center;
font-size: 42px;
font-family: 'Number';
margin-top: 40px;
}
.grade text{
font-size: 12px;
color: #888888;
}
.eggs{
font-size: 14px;
color: #353535;
text-align: center;
width: 334px;
margin: 0 auto;
margin-top: 24px;
}
.btns{
width: 92%;
margin: 0 auto;
margin-top: 26px;
}
.btns-left{
background: #F5F5F5;
border-radius: 22px;
float: left;
width: 48%;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 17px;
font-weight: bold;
color: #FF9B4D;
}
.btns-right{
background: #FF9B4D;
border-radius: 22px;
float: right;
width: 48%;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 17px;
font-weight: bold;
color: #FFFFFF;
}
.camera{
width: 100%;
height: 100%;
position: absolute;
z-index:9
}
.tips-type-tips{
text-align: center;
font-size: 17px;
font-weight: bold;
margin-bottom: 14px;
}
@import "../../../css/ai-common.wxss";
\ No newline at end of file
......@@ -110,17 +110,21 @@ Page({
//运动时常
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{
const sportName = {
1:'ts', //跳绳
2:'ywqz', //仰卧起坐
3:'tjz', //踢毽子
11:'kht', //开合跳
13:'sd', //深蹲
14:'fwc', //俯卧撑
15:'gtt', //高抬腿
16:'ydtt', //原地踢腿
17:'ydp', //原地跑
}
// TODU 由于原生小程序受限,无法动态配置mixins和behaviors来做逻辑混淆,所以AI页面只能逐一列出
if([1,2,3,11,13,14,15,16,17].includes(this.data.sportDetail.id)){
wx.navigateTo({
url:'../../../subPages/sport/ai-sport/ai-sport?sportTime=' + time,
url:`../../../subPages/sport/ai-${sportName[this.data.sportDetail.id]}-sport/ai-${sportName[this.data.sportDetail.id]}-sport?sportTime=${time}`,
})
}
},
......
// packageA/sitUp/share/share.js
var API = require("../../../utils/request.js");
Page({
/**
* 页面的初始数据
*/
data: {
sportTime:'', //mm:ss
share:1,//是否是分享页 1 分享页
sportTime:'', // mm:ss
bg:'',//背景图
bgcolor:'',
sportInfo:[],//运动详情
lv:1,
id:0,
content:'恭喜你',
perserve:false,//是否有累计挑战
nowMedal:[],
ai:"",
showMedal:0,//是否查询勋章
text:'',
projectMap:{1:'跳绳',2:'仰卧起坐',3:'踢毽子',11:'开合跳',13:'深蹲',14:'俯卧撑',15:'高抬腿',16:'原地臀踢',17:'原地跑'},
title:'',
user:0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('当前接收到的参数',options)
var that = this;
that.setData({
// id:10772914,
// share:0,
sportTime:options.sportTime || '',
ai:options.isDev,
id:options.id,
share:options.share,
showMedal:options.showMedal,
user:options.user || 0
},()=>{
console.log('获取运动详情')
that.getSportDetail(that.data.id)
if(options.showMedal == 1){
// that.getSportMedalByRecordId(that.data.id)
}
})
},
//关闭勋章
czyhClose(){
this.setData({
perserve:false
})
},
//获取当前运动详情是否显示勋章
getSportMedalByRecordId(uid){
var that = this;
API.getDataAll('/medal/getSportMedalByRecordId', {
sportDetailId:uid
}, (res) => {
console.log("当前的运动是否有勋章",res);
if(res.code == 200){
if(res.data.length > 0){
if(res.data[0].done == 1){
that.setData({
nowMedal:res.data[0],
perserve:true,//持之以恒是否显示
})
}else{
console.log('当前运动未获得勋章');
}
}
}
})
},
//获取运动详情
getSportDetail(sid){
var that = this;
API.getDataAll('/project/record/detail/' + sid, {}, (res) => {
console.log('我是运动详情:',res.data);
that.setData({
sportInfo:res.data,
lv:res.data.scoreLevel,
title:that.data.projectMap[res.data.projectId]
},()=>{
wx.setNavigationBarTitle({
title: that.data.projectMap[res.data.projectId]
})
})
if(that.data.share == 1){
console.log('当前是分享进来的')
that.setData({
content: res.data.peopleName + '在“小奔运动”'
})
}
if(res.data.scoreLevel == 1){
console.log('我是优秀')
that.setData({
bg:'https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/yx-medal.png', // 优秀 good 良好 well 达标 standard
bgcolor:'#2D97E8', // 优秀 2D97E8 良好 0099B0 达标 0099B0
text:'成绩达到“国家标准”'
})
wx.setNavigationBarColor({
frontColor: '#ffffff', // 必写项
backgroundColor: '#2D97E8', // 优秀 2D97E8 良好 0099B0 达标 0099B0 不及格 264653
animation: {
// 可选项,加上这项会有个显示的动画效果
duration: 2000,
timingFunc: 'easeIn'
}
})
}else if(res.data.scoreLevel == 2){
console.log('我是良好')
that.setData({
bg:'https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/lh-medal.png', // 优秀 good 良好 well 达标 standard
bgcolor:'#0099B0', // 优秀 2D97E8 良好 0099B0 达标 0099B0
text:'成绩达到“国家标准”',
})
wx.setNavigationBarColor({
frontColor: '#ffffff', // 必写项
backgroundColor: '#0099B0', // 优秀 2D97E8 良好 0099B0 达标 0099B0 不及格 264653
animation: {
// 可选项,加上这项会有个显示的动画效果
duration: 2000,
timingFunc: 'easeIn'
}
})
}else if(res.data.scoreLevel == 3){
console.log('我是及格')
that.setData({
bg:'https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/jg-medal.png', // 优秀 good 良好 well 达标 standard
bgcolor:'#0099B0', // 优秀 2D97E8 良好 0099B0 达标 0099B0
text:'成绩达到“国家标准”',
})
wx.setNavigationBarColor({
frontColor: '#ffffff', // 必写项
backgroundColor: '#0099B0', // 优秀 2D97E8 良好 0099B0 达标 0099B0 不及格 264653
animation: {
// 可选项,加上这项会有个显示的动画效果
duration: 2000,
timingFunc: 'easeIn'
}
})
}else if(res.data.scoreLevel == 4){
console.log('我是不及格')
that.setData({
bg:'https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/bjg-medal.png', // 优秀 good 良好 well 达标 standard
bgcolor:'#264653', // 优秀 2D97E8 良好 0099B0 达标 0099B0
})
wx.setNavigationBarColor({
frontColor: '#ffffff', // 必写项
backgroundColor: '#264653', // 优秀 2D97E8 良好 0099B0 达标 0099B0 不及格 264653
animation: {
// 可选项,加上这项会有个显示的动画效果
duration: 2000,
timingFunc: 'easeIn'
}
})
}else{
that.setData({
bg:'https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/dz-medal.png', // 优秀 good 良好 well 达标 standard
bgcolor:'#2D97E8', // 优秀 2D97E8 良好 0099B0 达标 0099B0
text:'“运动不是一蹴而就 ,是持之以恒”',
})
wx.setNavigationBarColor({
frontColor: '#ffffff', // 必写项
backgroundColor: '#2D97E8', // 优秀 2D97E8 良好 0099B0 达标 0099B0 不及格 264653
animation: {
// 可选项,加上这项会有个显示的动画效果
duration: 2000,
timingFunc: 'easeIn'
}
})
}
})
},
//再来一次
again(){
// wx.redirectTo({
// url: '/packageA/sitUp. /entrance/entrance'
// })
wx.navigateBack({
delta: 1,
})
},
//我也要运动
sport(){
wx.switchTab({
url: '/pages/sport/sport',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
var that = this;
var name = that.data.sportInfo.peopleName;
var ai = that.data.sportInfo.sourceType == 21 ? 'AI' : '';
var project = that.data.projectMap[that.data.sportInfo.projectId];
var sportShareImg = {
1:'https://cdn.xiaobentiyu.cn/sport_minapp_img/ai/ai-rope-skipping.png', //跳绳
2:'https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/sit-fx.png', //仰卧起坐
3:'https://cdn.xiaobentiyu.cn/sport_minapp_img/ai/ai-shuttlecock-fx.png', //踢毽子
11:'https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/jumping-jacks-fx.png', //开合跳
13:'https://cdn.xiaobentiyu.cn/sport_minapp_img/ai/ai-squat-fx.png', //深蹲
14:'https://cdn.xiaobentiyu.cn/sport_minapp_img/ai/ai-push-ups-fx.png', //俯卧撑
15:'https://cdn.xiaobentiyu.cn/sport_minapp_img/ai/ai-highLegLifts-fx.png', //高抬腿
16:'https://cdn.xiaobentiyu.cn/sport_minapp_img/ai/ai-hipKicked-fx.png', //原地踢腿
17:'https://cdn.xiaobentiyu.cn/sport_minapp_img/ai/ai-situRun-fx.png', //原地跑
}
var imageUrl = sportShareImg[that.data.sportInfo.projectId] || ''
return{
title:name + '在“小奔运动”小程序中完成了一次' + ai + project +'训练,邀请您也一起参与!',
path:'packageA/sitUp/share/share?id=' + that.data.id + '&share=1&showMedal=0&sportTime='+that.data.sportTime,
imageUrl:imageUrl
}
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": ""
}
\ No newline at end of file
<!-- 及格以上 -->
<view class="top" style="background: {{bgcolor}};" wx:if="{{lv != 4}}">
<view class="lv">
<image src="{{bg}}"></image>
<view wx:if="{{sportInfo.score == null}}">
</view>
<view wx:else>
<view class="score">{{sportInfo.score || 0}}</view>
<view class="score-unit">分</view>
</view>
<view class="user">
<image src="{{sportInfo.imgSrc}}"></image>
<view class="name">{{sportInfo.peopleName}}</view>
</view>
<view class="text">{{text}}</view>
</view>
</view>
<!-- 不及格 -->
<view class="top" style="background: {{bgcolor}};" wx:else>
<view class="lv">
<image src="{{bg}}"></image>
<view class="bjg-score">{{sportInfo.score || 0}}</view>
<view class="bjg-score-unit">分</view>
<view class="user">
<image src="{{sportInfo.imgSrc}}"></image>
<view class="name">{{sportInfo.peopleName}}</view>
</view>
<view class="text">成绩未达到“国家标准”,继续加油</view>
</view>
</view>
<!-- 累计挑战 -->
<view class="challenge-medal" wx:if="{{perserve}}">
<view class="challenge-mask"></view>
<view class="my-medal">
<image class="medal-close" catchtap="czyhClose" src="../../../images/index/medal-close.png"></image>
<view class="medal-title">恭喜你,已获得</view>
<image class="medal" src="{{nowMedal.hasgetImg}}"></image>
<view class="medal-name">{{nowMedal.name}}</view>
<view class="medal-content">{{nowMedal.content}}</view>
<button class="medal-btn" open-type="share" data-item="{{nowMedal}}" id="2">炫耀勋章</button>
<view class="medal-number">已有{{nowMedal.ownerNum}}人获得</view>
</view>
</view>
<view class="results">
<view class="one-content">{{content}}</view>
<view class="two-content">完成一次【{{projectMap[sportInfo.projectId]}}】{{sportInfo.sourceType == 21 ? 'AI' : ''}}体育训练</view>
<view class="results-list">
<view class="results-li">
<image src="https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/icon-time.png"></image>
<view class="content">{{sportTime?sportTime:'01:00'}}</view>
<view class="title">用时</view>
</view>
<view class="results-li">
<image src="https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/icon-number.png"></image>
<view class="content">{{sportInfo.sportValue || 00}}</view>
<view class="title">个数</view>
</view>
<view class="results-li">
<image src="https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/icon-calorie.png"></image>
<view class="content">{{sportInfo.calorie || 00}}</view>
<view class="title">千卡</view>
</view>
</view>
<view class="time">{{sportInfo.createTime}} 完成</view>
<view class="share-content" wx:if="{{share == 1}}">
<view class="line"></view>
<view class="share-text">
<view class="share-yq">邀请你也一起来运动</view>
<view class="share-sm">扫码关注“小奔运动”公众号,了解更多</view>
</view>
<image class="share-img" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/sitUp/gzh-ewm.png"></image>
</view>
</view>
<view class="foot" wx:if="{{share == 0}}">
<button open-type="share" class="share" id="1">分享成果,邀请小伙伴</button>
<view class="again" bindtap="again" wx:if="{{user == 0}}">再来一次训练</view>
</view>
<view class="foot" wx:else>
<view class="sport" bindtap="sport">我也要运动</view>
</view>
\ No newline at end of file
@font-face {
font-family: 'Number';
src: url('data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAAACB8ABEAAAAAXXQAACAcAAEAAAAAAAAAAAAAAAAAAAAA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opwlHCA83Yb8sll9zItDnjtATSY7na5WcPcznrXXfb2uyuhNN0wLVY7e/q18KcAeuMYRRWFbDtOZEuKZnAd4JCJVKaQUlgmIfC6/meQa2pp6+jq6RsYGvnL3/7xr//8b2xiamZuYWllbWNrZ+/g6OTs4urm7uHp5e1DzEAMwmAMIUZaYMbEMXXr3n40ho2uV/9ORTkPBi0rEDBNIoDmn2L/vzwZ3WE5/FGNdUKNo4Ze3MOM3eUc1vWOozsA') format('woff2');
}
page{
background: #F5F5F5;
}
.top{
width: 100%;
height: 480rpx;
}
.lv{
position: relative;
width: 100%;
height: 400rpx;
text-align: center;
}
.lv image{
width: 100%;
height: 400rpx;
}
.score{
position: absolute;
font-family: 'Number';
font-size: 56rpx;
font-weight: bold;
color: #FFFFFF;
top: 50%;
left: 50%;
transform: translate(-50%);
z-index: 99;
margin-top: 8rpx;
}
.bjg-score{
position: absolute;
font-family: 'Number';
font-size: 96rpx;
font-weight: bold;
color: #FFFFFF;
top: 50%;
left: 50%;
transform: translate(-50%);
z-index: 99;
margin-top: -82rpx;
}
.bjg-score-unit{
position: absolute;
font-size: 24rpx;
color: #FFFFFF;
top: 50%;
left: 50%;
transform: translate(-50%);
z-index: 99;
margin-top: -60rpx;
margin-left: 62rpx;
}
.score-unit{
position: absolute;
font-size: 16rpx;
font-weight: bold;
color: #FFFFFF;
top: 50%;
left: 50%;
transform: translate(-50%);
z-index: 99;
margin-top: 36rpx;
margin-left: 60rpx;
}
.user{
position: absolute;
top: 8rpx;
left: 20rpx;
}
.user image{
float: left;
width: 60rpx;
height: 60rpx;
border-radius: 50%;
}
.user .name{
float: left;
font-weight: bold;
font-size: 34rpx;
color: #FFFFFF;
margin-top: 8rpx;
margin-left: 10rpx;
}
.text{
position: absolute;
top: 330rpx;
left: 50%;
transform: translateX(-50%);
color: #FFFFFF;
font-size: 28rpx;
width: 600rpx;
}
.results{
overflow: hidden;
width: 90%;
margin: 0 auto;
background: #FFFFFF;
border-radius: 24rpx;
margin-top: -80rpx;
padding-bottom: 26rpx;
}
.one-content{
font-size: 34rpx;
font-weight: bold;
color: #353535;
text-align: center;
margin-top: 40rpx;
}
.two-content{
font-size: 34rpx;
font-weight: bold;
color: #353535;
text-align: center;
margin-top: 10rpx;
}
.results-list{
display: flex;
width: 90%;
height: 214rpx;
margin: 0 auto;
border-radius: 16rpx;
background: #F8F8F8;
margin-top: 40rpx;
}
.results-li{
flex:1;
text-align: center;
}
.results-li image{
width: 40rpx;
height: 40rpx;
margin-top: 36rpx;
}
.results-li .content{
font-family: 'Number';
font-size: 48rpx;
}
.results-li .title{
font-family: 'Number';
font-size: 22rpx;
color: #888888;
}
.time{
font-size: 22rpx;
text-align: center;
color: #888888;
margin-top: 24rpx;
}
.foot{
position: fixed;
width: 100%;
bottom: 0rpx;
}
.again{
position: fixed;
left: 5%;
bottom: 40rpx;
background: #FFFFFF;
width: 90%;
height: 88rpx;
line-height: 88rpx;
text-align: center;
color: #FF9B4D;
font-weight: bold;
border-radius: 48rpx;
}
.share{
position: fixed;
left: 5%;
bottom: 160rpx;
background: #FF9B4D;
width: 90%;
height: 88rpx;
line-height: 88rpx;
text-align: center;
color: #FFFFFF;
font-weight: bold;
border-radius: 48rpx;
}
.share-content{
overflow: hidden;
width: 90%;
margin: 0 auto;
}
.line{
width: 100%;
height: 0rpx;
border-top: 1rpx solid #EEEEEE;
margin-top: 24rpx;
}
.share-text{
float: left;
}
.share-yq{
margin-top: 50rpx;
font-weight: bold;
font-size: 28rpx;
}
.share-sm{
font-size: 24rpx;
color: #888888;
}
.share-img{
float: right;
width: 128rpx;
height: 128rpx;
margin-top: 24rpx;
}
.sport{
position: fixed;
left: 5%;
bottom: 40rpx;
background: #FF9B4D;
width: 90%;
height: 88rpx;
line-height: 88rpx;
text-align: center;
color: #FFFFFF;
font-weight: bold;
border-radius: 48rpx;
}
.challenge-mask{
position: fixed;
width: 100%;
height: 100%;
top: 0rpx;
left: 0rpx;
background: #000000;
opacity: 0.7;
z-index: 100;
}
.medal-close{
position: absolute;
width: 68rpx;
height: 68rpx;
right: 20rpx;
top: 20rpx;
}
.my-medal{
position: absolute;
overflow: hidden;
width: 80%;
left: 10%;
top: 50%;
margin-top: -330rpx;
z-index: 101;
text-align: center;
background: #FFFFFF;
border-radius: 24rpx;
}
.my-medal .medal{
width: 256rpx;
height: 256rpx;
margin-top: 30rpx;
}
.medal-title{
font-size: 40rpx;
font-weight: bold;
color: #353535;
margin-top: 70rpx;
}
.medal-name{
font-size: 34rpx;
font-weight: bold;
color: #353535;
margin-top: 10rpx;
}
.medal-content{
font-size: 28rpx;
color: #888888;
margin-top: 8rpx;
}
.medal-number{
color: #353535;
font-size: 28rpx;
margin-top: 20rpx;
margin-bottom: 40rpx;
}
.medal-btn{
width: 80%;
height: 96rpx;
margin: 0 auto;
line-height: 96rpx;
border-radius: 50rpx;
color: #FFFFFF;
background: #FF9B4D;
margin-top: 60rpx;
}
\ No newline at end of file
......@@ -7,7 +7,7 @@ var version = 'v2.0.5'
* doSuccess:成功的回调函数
* doFail:失败的回调函数
*/
function request(url, postData, doSuccess) {
function requestAll(url, postData, doSuccess) {
// postData.userId = parseInt(wx.getStorageSync('userId'));
wx.request({
//项目的真正接口,通过字符串拼接方式实现
......@@ -83,7 +83,7 @@ function getData(url, data, doSuccess, doFail) {
})
}
//GET请求,不需传参,直接URL调用,
function getDataFail(url, data, doSuccess, doFail) {
function getDataAll(url, data, doSuccess, doFail) {
wx.request({
url: wx.getStorageSync('host') + url,
header: {
......@@ -125,7 +125,7 @@ function log(val){
}
module.exports.request = request;
module.exports.requestAll = requestAll;
module.exports.getData = getData;
module.exports.getDataFail = getDataFail
module.exports.getDataAll = getDataAll
module.exports.log = log;
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