Commit 01070a2a by tangjiale

更新代码

parent 756bca13
...@@ -3,10 +3,13 @@ ...@@ -3,10 +3,13 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-01-13 17:47:44 * @Date: 2022-01-13 17:47:44
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-08 10:39:10 * @LastEditTime: 2022-06-08 19:59:38
*/ */
// wx.setStorageSync('host', 'https://sdb.youchengzhang.cn/'); //正式环境 // wx.setStorageSync('host', 'https://sdb.youchengzhang.cn/'); //正式环境
wx.setStorageSync('host', 'https://test.xiaobentiyu.cn'); //测试环境 // wx.setStorageSync('host', 'https://test.xiaobentiyu.cn'); //测试环境
wx.setStorageSync('host', 'https://test.xiaobentiyu.cn/pxmobileapi'); //测试环境
//https://test.xiaobentiyu.cn/pxmobileapi
//https://test.xiaobentiyu.cn/pxmobileapi/doc.html#/home
//ai姿势识别 //ai姿势识别
const fetchWechat = require('fetch-wechat') const fetchWechat = require('fetch-wechat')
......
...@@ -25,7 +25,14 @@ ...@@ -25,7 +25,14 @@
"ai-gtt-sport/ai-gtt-sport", "ai-gtt-sport/ai-gtt-sport",
"ai-ydtt-sport/ai-ydtt-sport", "ai-ydtt-sport/ai-ydtt-sport",
"ai-ydp-sport/ai-ydp-sport", "ai-ydp-sport/ai-ydp-sport",
"share/share" "share/share",
"ywqz-sport/ywqz-sport",
"checkSkip/checkSkip",
"skip-edit/skip-edit",
"musicList/musicList",
"ordinDaka/ordinDaka",
"sportTime/sportTime",
"myData/myData"
] ]
}, },
{ {
...@@ -72,6 +79,9 @@ ...@@ -72,6 +79,9 @@
"van-picker": "@vant/weapp/picker/index", "van-picker": "@vant/weapp/picker/index",
"van-dialog": "@vant/weapp/dialog/index" "van-dialog": "@vant/weapp/dialog/index"
}, },
"requiredBackgroundModes": [
"audio"
],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff", "navigationBarBackgroundColor": "#fff",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com * @eMail: 932055106@qq.com
* @Date: 2022-06-06 16:45:35 * @Date: 2022-06-06 16:45:35
* @LastEditors: tangjiale * @LastEditors: tangjiale
* @LastEditTime: 2022-06-07 15:27:35 * @LastEditTime: 2022-06-08 17:22:18
*/ */
var API = require("../../utils/request"); var API = require("../../utils/request");
Page({ Page({
...@@ -13,6 +13,22 @@ Page({ ...@@ -13,6 +13,22 @@ Page({
*/ */
data: { data: {
skipType: 1, //1、定时跳,2、定数跳,3、自由跳
timeList: {
1: '00:30',
2: '1:00',
3: '2:00',
4: '3:00'
}, //定时跳map
numberList: {
1: '100次',
2: '200次',
3: '300次',
4: '500次',
5: '800次',
6: '1000次'
}, //定时跳map
selectContent: '', //当前模式
dataList:[] dataList:[]
}, },
...@@ -30,6 +46,103 @@ Page({ ...@@ -30,6 +46,103 @@ Page({
onReady: function () { onReady: function () {
}, },
//切换模式
checkSkipType(e) {
var that = this;
var type = e.currentTarget.dataset.type;
this.setData({
skipType: type
}, () => {
if (type == 1) {
that.setData({
selectType: 2,
selectContent: that.data.timeList[2]
})
} else if (type == 2) {
that.setData({
selectType: 2,
selectContent: that.data.numberList[2]
})
} else {
that.setData({
selectContent: '无限制'
})
}
})
},
//往前选择模式
lastType() {
var that = this;
if (that.data.skipType == 1) {
that.data.selectType--;
if (that.data.selectType == 0) {
that.setData({
selectType: 4
}, () => {
that.setData({
selectContent: that.data.timeList[that.data.selectType]
})
})
} else {
that.setData({
selectContent: that.data.timeList[that.data.selectType]
})
}
}
if (that.data.skipType == 2) {
that.data.selectType--;
if (that.data.selectType == 0) {
that.setData({
selectType: 6
}, () => {
that.setData({
selectContent: that.data.numberList[that.data.selectType]
})
})
} else {
that.setData({
selectContent: that.data.numberList[that.data.selectType]
})
}
}
},
//往后选择模式
nextType() {
var that = this;
if (that.data.skipType == 1) {
that.data.selectType++;
if (that.data.selectType == 5) {
that.setData({
selectType: 1
}, () => {
that.setData({
selectContent: that.data.timeList[that.data.selectType]
})
})
} else {
that.setData({
selectContent: that.data.timeList[that.data.selectType]
})
}
}
if (that.data.skipType == 2) {
that.data.selectType++;
if (that.data.selectType == 7) {
that.setData({
selectType: 1
}, () => {
that.setData({
selectContent: that.data.numberList[that.data.selectType]
})
})
} else {
that.setData({
selectContent: that.data.numberList[that.data.selectType]
})
}
}
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
...@@ -41,6 +154,11 @@ Page({ ...@@ -41,6 +154,11 @@ Page({
selected: 1 selected: 1
}) })
} }
this.setData({
skipType: 1, //1、定时跳,2、定数跳,3、自由跳
selectType: 2,
selectContent: this.data.timeList[2]
})
//获取所有体育运动项目 //获取所有体育运动项目
this.getAllProgect() this.getAllProgect()
}, },
...@@ -69,6 +187,16 @@ Page({ ...@@ -69,6 +187,16 @@ Page({
url: '/subPages/sport/detail/detail?id=' + project url: '/subPages/sport/detail/detail?id=' + project
}) })
}, },
//开始跳绳(选择跳绳模式)
checkSkip() {
var that = this;
var type = that.data.skipType;
var select = that.data.selectType;
console.log('当前选择', type, select)
wx.navigateTo({
url: '../../subPages/sport/checkSkip/checkSkip?type=' + type + '&select=' + select,
})
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
......
<view class="list"> <view class="list">
<view class="top-content {{skipType==1?'top-content-a':skipType==2?'top-content-b':skipType==3?'top-content-c':'top-content-a'}}">
<image class="time-skip" style="{{skipType==1 ? 'display:block' : ''}}" src="../../images/home/time_skip.png"></image>
<image class="time-skip" style="{{skipType==2 ? 'display:block' : ''}}" src="../../images/home/num_skip.png"></image>
<image class="time-skip" style="{{skipType==3 ? 'display:block' : ''}}" src="../../images/home/free_skip.png"></image>
<view class="skip-type">
<view class="skip-type-item border-l" data-type="1" bindtap="checkSkipType" style="{{skipType==1?'color:#ffffff;background:#FF811E':''}}"><text>计时跳</text></view>
<view class="skip-type-item border-z" data-type="2" bindtap="checkSkipType" style="{{skipType==2?'color:#ffffff;background:#FF811E':''}}"><text>计数跳</text></view>
<view class="skip-type-item border-r" data-type="3" bindtap="checkSkipType" style="{{skipType==3?'color:#ffffff;background:#FF811E':''}}"><text>自由跳</text></view>
</view>
<view class="start-skip-bg">
<view class="time-check">
<view class="last" wx:if="{{skipType != 3}}">
<image catchtap="lastType" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/icon_check_left.png"></image>
</view>
<view class="type">{{selectContent}}</view>
<view class="next" wx:if="{{skipType != 3}}">
<image catchtap="nextType" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/icon_check_right.png"></image>
</view>
</view>
<view class="start-skip" catchtap="checkSkip" id="start">开始跳绳</view>
</view>
</view>
<view class="li" bindtap="sport" data-item="{{item}}" wx:for="{{dataList}}" wx:key="index"> <view class="li" bindtap="sport" data-item="{{item}}" wx:for="{{dataList}}" wx:key="index">
<image class="sport-img" src="{{item.bigImg}}"></image> <image class="sport-img" src="{{item.bigImg}}"></image>
<!-- <image class="tc" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/bq-tcxm.png" wx:if="{{item.testProject == 1}}"></image> --> <!-- <image class="tc" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/bq-tcxm.png" wx:if="{{item.testProject == 1}}"></image> -->
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
position: relative; position: relative;
float: left; float: left;
width: 49%; width: 49%;
margin-right: 1%; margin-left: 2%;
margin-bottom: 40rpx; margin-bottom: 40rpx;
} }
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
position: relative; position: relative;
float: left; float: left;
width: 49%; width: 49%;
margin-left: 1%; margin-left: 0%;
margin-bottom: 40rpx; margin-bottom: 40rpx;
} }
...@@ -54,3 +54,165 @@ ...@@ -54,3 +54,165 @@
margin-right: 10rpx; margin-right: 10rpx;
margin-top: 4rpx; margin-top: 4rpx;
} }
/* -------------------------------- */
.top-title image {
width: 112rpx;
height: 68rpx;
}
.top-content {
position: relative;
width: 690rpx;
height: 382rpx;
margin: 16rpx auto 30rpx auto;
}
.time-skip {
position: absolute;
width: 690rpx;
height: 382rpx;
display: none;
}
.top-content-a {
/* background: url('https://cdn.xiaobentiyu.cn/sport_minapp_img/home/time_skip.png'); */
background-size: 690rpx 382rpx;
}
.top-content-b {
/* background: url('https://cdn.xiaobentiyu.cn/sport_minapp_img/home/num_skip.png'); */
background-size: 690rpx 382rpx;
}
.top-content-c {
/* background: url('https://cdn.xiaobentiyu.cn/sport_minapp_img/home/free_skip.png'); */
background-size: 690rpx 382rpx;
}
.top-bg {
position: absolute;
width: 690rpx;
height: 382rpx;
z-index: -1;
}
.skip-type {
display: flex;
flex-direction: row;
align-items: center;
background: #FFE6CC;
height: 120rpx;
border-radius: 24rpx;
}
.border-l {
border-radius: 24rpx 46rpx 46rpx 24rpx;
}
.border-z {
border-radius: 46rpx 46rpx 46rpx 46rpx;
}
.border-r {
border-radius: 46rpx 24rpx 24rpx 46rpx;
}
.skip-type-item text {
line-height: 80rpx;
}
.start-skip-bg {
position: absolute;
width: 690rpx;
height: 302rpx;
border-radius: 24rpx;
bottom: 0rpx;
background: #FF811E;
}
.time-check {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
margin-top: 40rpx;
margin-bottom: 30rpx;
}
.time-check image {
width: 76rpx;
height: 96rpx;
}
.time-check .type {
/* font-family: 'Number'; */
flex: 2;
display: flex;
flex-direction: row;
justify-content: center;
font-size: 72rpx;
font-weight: bold;
color: rgba(255, 255, 255, 0.9);
}
.time-check .type text {
font-size: 56rpx;
}
.last {
/* flex: 1; */
float: left;
margin-left: 40rpx;
}
.next {
/* flex: 1; */
float: right;
margin-right: 40rpx;
}
.last:active {
width: 76rpx;
height: 96rpx;
margin-top: -8rpx;
border-radius: 16rpx;
background-color: rgba(255, 255, 255, 0.08);
}
.next:active {
width: 76rpx;
height: 96rpx;
margin-top: -8rpx;
border-radius: 16rpx;
background-color: rgba(255, 255, 255, 0.08);
}
.skip-type-item {
position: relative;
z-index: 1;
flex: 1;
/* height: 80rpx; */
text-align: center;
height: 120rpx;
font-size: 34rpx;
font-weight: bold;
color: #FF811E;
}
.start-skip {
position: absolute;
left: 40rpx;
bottom: 30rpx;
width: 610rpx;
height: 96rpx;
line-height: 96rpx;
text-align: center;
margin: 0 auto;
background: #FFFFFF;
border-radius: 48rpx;
font-size: 34rpx;
font-weight: bold;
color: #FF811E;
}
.start-skip:active {
background-color: rgba(255, 255, 255, 0.8);
}
\ No newline at end of file
...@@ -27,13 +27,6 @@ ...@@ -27,13 +27,6 @@
"scene": null "scene": null
}, },
{ {
"name": "ai运动",
"pathName": "subPages/sport/ai-sport/ai-sport",
"query": "id=11",
"launchMode": "default",
"scene": null
},
{
"name": "", "name": "",
"pathName": "subPages/sport/ai-ywqz-sport/ai-ywqz-sport", "pathName": "subPages/sport/ai-ywqz-sport/ai-ywqz-sport",
"query": "sportTime=60", "query": "sportTime=60",
...@@ -44,8 +37,22 @@ ...@@ -44,8 +37,22 @@
"name": "ai运动分享", "name": "ai运动分享",
"pathName": "subPages/sport/share/share", "pathName": "subPages/sport/share/share",
"query": "id=10774553&share=0&showMedal=1&user=1&sportTime=00:02:00", "query": "id=10774553&share=0&showMedal=1&user=1&sportTime=00:02:00",
"scene": null, "launchMode": "default",
"launchMode": "default" "scene": null
},
{
"name": "",
"pathName": "subPages/sport/ywqz-sport/ywqz-sport",
"query": "sportType=1",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "subPages/sport/sportTime/sportTime",
"query": "type=1",
"launchMode": "default",
"scene": null
} }
] ]
} }
......
...@@ -68,6 +68,8 @@ Page({ ...@@ -68,6 +68,8 @@ Page({
}, },
onUnload(){ onUnload(){
var that = this; var that = this;
that.data.innerAudioContext.stop();
that.data.innerAudioContext2.stop();
that.data.innerAudioContext.destroy(); that.data.innerAudioContext.destroy();
that.data.innerAudioContext2.destroy(); that.data.innerAudioContext2.destroy();
......
var mode = 0;//跳绳模式
Page({
/**
* 页面的初始数据
*/
data: {
type:'',//当前跳绳模式
select:'',//当前选择模式下的模块
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log('接收到的参数',options)
this.setData({
type:options.type,
select:options.select
})
},
//ai跳绳
aiSport(){
wx.redirectTo({
url: '../ai-ts-sport/ai-ts-sport',
})
},
//普通跳绳
generalSport(){
var that = this;
if(that.data.type == 1){
wx.redirectTo({
url: '../ywqz-sport/ywqz-sport?sportType=1' + '&select=' + that.data.select,
})
}
if(that.data.type == 3){
wx.redirectTo({
url: '../ordinDaka/ordinDaka?sportType=1',
})
}
},
//智能跳绳
smartSport(){
var that = this;
if(that.data.type == 1){
console.log('计时跳')
if(that.data.select == 1){
mode = 0
}else if(that.data.select == 2){
mode = 2
}else if(that.data.select == 3){
mode = 3
}else if(that.data.select == 4){
mode = 4
}
wx.redirectTo({
// url: '../skip/skip/skip?mode=' + mode,
})
}else if(that.data.type == 2){
console.log('计数跳')
if(that.data.select == 1){
mode = 24
}else if(that.data.select == 2){
mode = 25
}else if(that.data.select == 3){
mode = 12
}else if(that.data.select == 4){
mode = 13
}else if(that.data.select == 5){
mode = 26
}else if(that.data.select == 6){
mode = 14
}
wx.redirectTo({
// url: '../skip/skip/skip?mode=' + mode,
})
}else if(that.data.type == 3){
console.log('自由模式')
wx.redirectTo({
// url: '../skip/skip/skip?mode=1',
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": ""
}
\ No newline at end of file
<!--packageA/checkSkip/checkSkip.wxml-->
<view class="check-skip-model">
<view class="check-skip-title">选择你的跳绳方式</view>
<view class="model-list">
<view class="model-item" bindtap="smartSport">
<image class="model-bg" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/ksts_bg_znts.png"></image>
<image class="model-img" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/ksts_icon_znts.png"></image>
<view class="model-content">
<view class="model-name model-zn">智能跳绳<image src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/bq_tj.png"></image>
</view>
<view class="model-msg">跳绳数据自动上传,智能计时计数更省心</view>
</view>
</view>
<view class="model-item" wx:if="{{type == 1 && select == 2}}" bindtap="aiSport">
<image class="model-bg" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/ksts_bg_aits.png"></image>
<image class="model-img" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/ksts_icon_aits.png"></image>
<view class="model-content">
<view class="model-name">AI跳绳</view>
<view class="model-msg">人工智能实时识别,但因环境或光线干扰数据会存在误差</view>
</view>
</view>
<view class="model-item" wx:if="{{type != 2 && select != 1}}" bindtap="generalSport">
<image class="model-bg" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/ksts_bg_ptts.png"></image>
<image class="model-img" src="https://cdn.xiaobentiyu.cn/sport_minapp_img/home/ksts_icon_ptts.png"></image>
<view class="model-content">
<view class="model-name">普通跳绳</view>
<view class="model-msg">仅提供计时功能,需要你手动录入</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
/* packageA/checkSkip/checkSkip.wxss */
.check-skip-title {
display: flex;
flex-direction: row;
justify-content: center;
width: 100%;
margin-top: 4rpx;
font-size: 44rpx;
line-height: 60rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.model-list {
width: 690rpx;
margin: 30rpx;
}
.model-item {
display: flex;
flex-direction: row;
align-items: center;
position: relative;
width: 100%;
height: 240rpx;
margin-bottom: 20rpx;
background: #FAF8F6;
border-radius: 24rpx;
}
.model-item:active{
background-color: rgba(0, 0, 0, 0.05);
}
.model-bg {
position: absolute;
top: 40rpx;
right: 40rpx;
width: 160rpx;
height: 160rpx;
}
.model-img {
width: 96rpx;
height: 96rpx;
margin-left: 40rpx;
}
.model-content {
display: flex;
flex-direction: column;
margin-left: 30rpx;
}
.model-name {
font-size: 34rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
}
.model-zn {
display: flex;
flex-direction: row;
align-items: center;
}
.model-zn image {
width: 84rpx;
height: 36rpx;
margin-left: 10rpx;
}
.model-msg {
max-width: 432rpx;
margin-top: 10rpx;
font-size: 24rpx;
line-height: 34rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.3);
}
\ No newline at end of file
...@@ -94,9 +94,13 @@ Page({ ...@@ -94,9 +94,13 @@ Page({
//返回首页 //返回首页
back(){ back(){
//跳转仰卧起坐普通模式页面
if(this.data.sportDetail.id == 2){
wx.navigateTo({ wx.navigateTo({
url: '/packageB/activity/daka/daka?sportType=2', url: '../ywqz-sport/ywqz-sport?sportType=2',
}) })
}
}, },
changeSelect(e){ changeSelect(e){
let {value} = e.detail let {value} = e.detail
......
// pages/skip/musicList/musicList.js
var API = require("../../../utils/request.js");
Page({
/**
* 页面的初始数据
*/
data: {
list:[],
currentCampus: 0,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options);
var that = this;
that.setData({
currentCampus:options.id
})
that.getBgMusic();
},
palyVoice(url) {
wx.playBackgroundAudio({
dataUrl: url,
success(e) { console.log(e); },
fail(e) { console.log(e); },
complete() { }
})
},
//获取背景音乐列表
getBgMusic() {
var that = this;
API.getData('/config/getBgMusic', {}, function (res) {
console.log(res);
that.setData({
list:res.data
})
}, function () {
});
},
chooseCampus: function(options) {
var that = this
var id = options.currentTarget.dataset.id;
var music = options.currentTarget.dataset.music;
console.log(id);
console.log(music);
that.palyVoice(music);
//设置当前样式
that.setData({
currentCampus:id
})
API.requestAll('/config/setSkipConfig', {
skipBackMusic:id
}, function (res) {
console.log('设置背景音乐',res);
}, function () {
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
this.setData({
is_start:false
});
wx.stopBackgroundAudio();
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
this.setData({
is_start:false
});
wx.stopBackgroundAudio();
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "选择音乐",
"navigationBarBackgroundColor": "#F5F5F5"
}
\ No newline at end of file
<view>
<view wx:for="{{list}}" wx:for-item="campus" bindtap="chooseCampus" class="item {{currentCampus==campus.id?'sel':''}}" data-id="{{campus.id}}" data-music="{{campus.musicUrl}}">
{{campus.musicName}}
<image class="icon" src="/images/sport/icon-sel.png"></image>
</view>
</view>
.item{
position: relative;
color: #353535;
width: 84%;
height: 100rpx;
line-height: 100rpx;
margin: 0 auto;
padding-left: 10%;
border-bottom: 1rpx solid #EEEEEE;
}
.item .icon{
display: none;
position: absolute;
width: 32rpx;
height: 32rpx;
left: 0rpx;
top: 36rpx;
}
.sel{
color: #FF9B4D;
}
.sel .icon{
display: block;
}
\ No newline at end of file
// packageB/user/myData/myData.js
var API = require("../../../utils/request.js");
var timeUtils = require("../../../utils/time.js");
var page = 1;
var size = 30;
Page({
/**
* 页面的初始数据
*/
data: {
projectId:1,
totalList:[],
startDay:null,
endDay:null,
sportRecordList:[],
sportMap:{1:'跳绳',2:'仰卧起坐',3:'踢毽子',4:'步数',5:'坐位体前屈',6:'50米跑',11:'开合跳',13:'深蹲',14:'俯卧撑',15:'高抬腿',16:'原地臀踢',17:'原地跑'}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var that= this;
that.setData({
projectId:options.projectId,
startDay:options.startDay || null,
endDay:options.endDay || null,
},()=>{
that.getRecord(options.projectId)
wx.setNavigationBarTitle({
title: that.data.sportMap[options.projectId] + '记录'
})
})
},
//获取当前选中的运动记录
getRecord(id){
var that = this;
if(that.data.startDay){
var postDate = {
projectId:id,
page:page,
size:size,
startDate:that.data.startDay,
endDate:that.data.endDay
}
}else{
var postDate = {
projectId:id,
page:page,
size:size,
}
}
API.getData('/project/record', postDate, (res) => {
console.log('我是当前选中的数据',res);
that.setData({
totalList:that.data.totalList.concat(res.data),
},()=>{
console.log('翻页合并后的数据',that.data.totalList);
var arr = []; //存放新数组
for (var i = 0; i < that.data.totalList.length; i++) {
//读取每条数据的日期
var recordDate = that.data.totalList[i].recordDate;
//当日期相同,只要传这个
var valDetailList = {
"id": that.data.totalList[i].id,
"count": that.data.totalList[i].count,
"projectId": that.data.totalList[i].projectId,
"isDevData":that.data.totalList[i].isDevData,
"sportValue": that.data.totalList[i].sportValue,
"sportValueType": that.data.totalList[i].sportValueType,
"recordDate":that.data.totalList[i].recordDate,
"createTime":that.data.totalList[i].createTime.slice(10),
"classId":that.data.totalList[i].classId,
"sportTime":timeUtils.forTimes(that.data.totalList[i].sportTime),
"calorie":that.data.totalList[i].calorie,
"speed":that.data.totalList[i].speed,
"sportValueTypeName":that.data.totalList[i].sportValueTypeName,
"listIcon":that.data.totalList[i].listIcon
}
//当日期没有相同的,就新建一个Item
var valItem = {
"recordDate": '',
"detailList": []
}
valItem.recordDate = recordDate;
valItem.detailList.push(valDetailList);
//第0个不需要比较
if (i == 0) {
arr.push(valItem);
}
//第1个就要开始找新数组arr相同的日期
else{
var index = -1;
for(var k =0;k<arr.length;k++){
if(recordDate == arr[k].recordDate){
index = k;
break;
}
}
if(index === -1){
arr.push(valItem);
}else{
arr[k].detailList.push(valDetailList);
}
}
}
console.log('我是合并后的数组',arr);
that.setData({
sportRecordList:arr
})
})
}, function () {
wx.hideLoading()
});
},
//查看详情
checkInfo(e){
console.log(e.currentTarget.dataset.info)
var id = e.currentTarget.dataset.info.id;
var sportTime = e.currentTarget.dataset.info.sportTime;
var projectId = e.currentTarget.dataset.info.projectId;
var isdevdata = e.currentTarget.dataset.info.isdevdata;
if(projectId == 1){
wx.navigateTo({
url: '../share/share?id=' + id + "&showMedal=1&sportTime=" + sportTime
})
}else if(projectId == 2){
wx.navigateTo({
url:'../share/share?id=' + id + '&share=0&isDev=' + isdevdata + '&showMedal=0&user=1&sportTime=' + sportTime
})
}else if(projectId == 3){
wx.navigateTo({
url:'../share/share?id=' + id + '&share=0&isDev=' + isdevdata + '&showMedal=0&user=1&sportTime=' + sportTime
})
}else if(projectId == 11){
wx.navigateTo({
url:'../share/share?id=' + id + '&share=0&isDev=' + isdevdata + '&showMedal=0&user=1&sportTime=' + sportTime
})
}else if(projectId == 14){
wx.navigateTo({
url:'../share/share?id=' + id + '&share=0&showMedal=1&user=1&sportTime=' + sportTime
})
}else if(projectId == 13){
wx.navigateTo({
url:'../share/sahre?id=' + id + '&share=0&showMedal=1&user=1&sportTime=' + sportTime
})
}else if(projectId == 15){
wx.navigateTo({
url:'../share/share?id=' + id + '&share=0&showMedal=1&user=1&sportTime=' + sportTime
})
}else if(projectId == 16){
wx.navigateTo({
url:'../share/share?id=' + id + '&share=0&showMedal=1&user=1&sportTime=' + sportTime
})
}else if(projectId == 17){
wx.navigateTo({
url:'../share/share?id=' + id + '&share=0&showMedal=1&user=1&sportTime=' + sportTime
})
}else{
// wx.navigateTo({
// url:'../../../packageB/activity/secondsMark/secondsMark?id=' + id
// })
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
var that = this;
console.log('触发上拉操作');
page = page + 1;
console.log('当前的上拉页码数',page);
that.getRecord(that.data.projectId)
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "记录"
}
\ No newline at end of file
<view class="todayList">
<view class="nodata" wx:if="{{sportRecordList.length == 0}}">
<image src="https://ttxs01-10066525.file.myqcloud.com/sport/miniapp/mobile/skip/nodata.png"></image>
</view>
<view class="all" wx:else>全部</view>
<view wx:for="{{sportRecordList}}">
<view class="sport-time">{{item.recordDate}}</view>
<view class="li" hover-class="after-click-content" wx:for="{{item.detailList}}" wx:for-item="items" data-info="{{items}}" bindtap="checkInfo">
<image class="more-img" src="/images/home/next.png"></image>
<view class="todayTime">{{items.createTime}}</view>
<view class="li">
<view class="left">
<image src="{{items.listIcon}}"></image>
</view>
<view class="right">
<view class="num">
<view class="sportType" wx:if="{{items.projectId == 1}}">跳绳</view>
<text class="sportType" wx:if="{{items.projectId == 2}}">仰卧起坐</text>
<text class="sportType" wx:if="{{items.projectId == 3}}">踢毽子</text>
<text class="sportType" wx:if="{{items.projectId == 4}}">步数</text>
<text class="sportType" wx:if="{{items.projectId == 5}}">坐位体前屈</text>
<text class="sportType" wx:if="{{items.projectId == 6}}">50米跑</text>
<text class="sportType" wx:if="{{items.projectId == 11}}">开合跳</text>
<text class="sportType" wx:if="{{items.projectId == 13}}">深蹲</text>
<text class="sportType" wx:if="{{items.projectId == 14}}">俯卧撑</text>
<text class="sportType" wx:if="{{items.projectId == 15}}">高抬腿</text>
<text class="sportType" wx:if="{{items.projectId == 16}}">原地臀踢</text>
<text class="sportType" wx:if="{{items.projectId == 17}}">原地跑</text>
<text class="isSmart" catchtap="buy" wx:if="{{items.isDevData == 1 && items.projectId == 1}}">智能跳绳</text>
</view>
<view class="info" wx:if="{{items.projectId == 1 || items.projectId == 2 || items.projectId == 3 || items.projectId == 4 || items.projectId == 5 || items.projectId == 6 || items.projectId == 11 || items.projectId == 13 || items.projectId == 14 || items.projectId == 15 || items.projectId == 16 || items.projectId == 17}}">
<view class="time" wx:if="{{items.projectId == 1 || items.projectId == 2 || items.projectId == 3 || items.projectId == 4 || items.projectId == 5 || items.projectId == 11 || items.projectId == 13 || items.projectId == 14 || items.projectId == 15 || items.projectId == 16}}">{{items.sportValue}} <text>个</text></view>
<view class="time" wx:elif="{{items.projectId == 17}}">{{items.sportValue}}<text>米</text></view>
<view class="time" wx:elif="{{items.projectId == 6}}">{{items.sportTime}}<text>秒</text></view>
<view class="time" wx:else>{{items.count}}<text>次</text></view>
<view>
<view class="time">{{items.sportTime}}</view>
<image src="/images/skip/time_black.png"></image>
</view>
<view>
<view class="qk">{{items.calorie}}</view>
<image src="/images/skip/calorie_black.png"></image>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
page{
background: #f5f5f5;
}
.top-wrap{
background: #fff;
}
.day{display: flex;}
.day view{
width: 160rpx;
height: 100%;
margin-right: 23rpx;
display: inline-block;
margin-left: 10px;
background-color: blue;
text-align: center;
font-size: 24rpx;
color: #333;
height: 70rpx;
line-height: 70rpx;
}
.data{
position: relative;
height: 330rpx;
display: flex;
}
.data .line{
position: absolute;
width: 2rpx;
height: 100%;
background: #FFFFFF;
left: 50%;
top: 10rpx;
opacity: 0.1;
transform: scaleX(0.5);
}
.data .item{
width: 180rpx;
height: 100%;
margin-right: 23rpx;
display: inline-block;
margin-left: 10px;
}
.item_list .item-set{
color: #3FCB7D;
}
.item_list .item .val{
text-align: center;
color: #FFFFFF;
font-size: 26rpx;
position: absolute;
}
.chart{
height: 338rpx;
width: 60rpx;
margin:0 auto;
border-radius: 60rpx 60rpx 0 0;
position: relative;
}
.chart view{
height: 400rpx;
width: 60rpx;
background: linear-gradient(180deg, #239E71 0%, #183247 100%);
margin:0 auto;
border-radius: 60rpx 60rpx 0 0;
position: absolute;
bottom: 18rpx;
left: 0;
}
.chart-set{
background: #29CC84 !important;
}
.card {
position: relative;
background-color: #fff;
padding-bottom: 30rpx;
padding-top: 0rpx;
border-radius: 24rpx 24rpx 0rpx 0rpx;
margin-top: -48rpx;
}
.data-wrap{
display: flex;
margin-top: 40rpx;
padding-top: 30rpx;
}
.data-wrap .item{
flex: 1;
font-family: "Number";
text-align: center
}
.data-wrap .item-time{
margin-top: 60rpx;
}
.data-wrap .key{
font-size: 22rpx;
color: #B2B2B2;
margin-top: 10rpx;
}
.card .number{
font-family: "Number";
width: 100%;
text-align: center;
font-size: 104rpx;
margin-top: 40rpx;
margin-bottom: 60rpx;
padding-top: 40rpx;
}
.data-wrap .val text{
font-size: 18rpx;
font-weight: normal;
}
.data-wrap .val{
font-size: 48rpx;
}
.data-item{
background: #fff;
margin-top: 20rpx;
}
.data-item .top{
width: 654rpx;
height: 100rpx;
line-height: 100rpx;
margin:0 auto;
border-bottom: 1rpx solid #dbdbdb;
}
.data-item .top .val{
float: left;
font-size: 36rpx;
}
.data-item .top .val text{
font-size:16rpx ;
}
.data-item .top .mode{
float: left;
width:120rpx;
height:36rpx;
background:rgba(237,255,244,1);
border:1rpx solid rgba(63,195,121,1);
border-radius:18rpx;
color:rgba(63,195,121,1);
text-align: center;
line-height: 36rpx;
font-size: 20rpx;
margin:32rpx 30rpx 0 30rpx;
}
.data-item .time{
float: right;
font-size: 26rpx;
}
.data-item .bottom{
display: flex;
height: 100rpx;
width: 654rpx;
margin:0 auto;
}
.t-l{
text-align: left;
}
.t-r{
text-align: right;
}
.center{
min-width: 400rpx;
}
.data-item .bottom .li{
flex: 1;
text-align: center;
}
.data-item .bottom .li .key{
font-size: 22rpx;
color: #656565;
}
.data-item .bottom .li .val{
font-size: 26rpx;
margin-top: 10rpx;
}
.last{
float:left;
font-size: 28rpx;
text-align: center;
padding: 10rpx 20rpx;
border-radius: 10rpx;
color: #FFFFFF;
background: #3FCB7D;
margin: 20rpx;
}
.next{
float:right;
font-size: 28rpx;
text-align: center;
padding: 10rpx 20rpx;
border-radius: 10rpx;
color: #FFFFFF;
background: #3FCB7D;
margin: 20rpx;
}
.top{
overflow: hidden;
background: #FFFFFF;
}
.on{
background: #f5f5f5;
color: #000000;
}
.scroll_box{
width: 100%;
height: 410rpx;
/* padding: 20rpx; */
white-space: nowrap;
}
.scroll_box scroll-view{
background: #183247;
height: 420rpx;
width: auto;
}
.item_list{
position: relative;
top: 0;
text-align: center;
/* width: 130rpx; */
height: 100%;
/* margin-right: 23rpx; */
display: inline-block;
margin-left: 10px;
font-size: 26rpx;
}
.item_list .item{
font-size: 22rpx;
height: 80rpx;
line-height: 80rpx;
color: #b2b2b2;
}
.item_list .item-set{
color: #FFFFFF;
font-weight: bold;
}
::-webkit-scrollbar{
width: 0;
height: 0;
color: transparent;
}
.todayList{
overflow: hidden;
width: 100%;
background: #FFFFFF;
}
.todayList .li{
position: relative;
width: 100%;
/* height: 210rpx; */
display: flex;
}
.todayList .li .left{
text-align: center;
margin-left: 30rpx;
margin-right: 18rpx;
}
.todayList .li .left image{
width: 100rpx;
height: 100rpx;
margin-top: 30rpx;
}
.todayList .li .right{
flex: 1;
border-bottom: 2rpx solid #EEEEEE;
margin-right: 30rpx;
padding-bottom: 14rpx;
}
.todayList .li .alone{
margin-left: 30rpx;
}
.right .type{
height: 30rpx;
margin-top: 30rpx;
font-size: 22rpx;
color: #B2B2B2;
}
.right .num{
font-family: "Number";
color: #353535;
font-size: 48rpx;
margin-top: 20rpx;
margin-bottom: 20rpx;
overflow: hidden;
}
.right .unit{
font-size: 20rpx;
color: #B2B2B2;
margin-left: 6rpx;
}
.right .isSmart{
display: block;
font-size: 22rpx;
background: rgba(1, 162, 255, 0.12);
color: #01A2FF;
padding: 6rpx;
margin-left: 20rpx;
border-radius: 6rpx;
margin-top: -2rpx;
float: left;
}
.right .info{
overflow: hidden;
margin-top: 12rpx;
}
.alone .info{
overflow: hidden;
margin-top: 12rpx;
margin-bottom: 12rpx;
}
.right .info image{
width: 28rpx;
height: 28rpx;
float: left;
margin-top: 8rpx;
margin-left: 8rpx;
}
.right .info .time{
font-family: "Number";
font-size: 36rpx;
float: left;
}
.right .info .qk{
font-family: "Number";
font-size: 36rpx;
float: left;
margin-left: 20rpx;
}
.todayTime{
position: absolute;
right: 60rpx;
top: 40rpx;
font-size: 22rpx;
color: #B2B2B2;
}
.todayList .nodata{
width: 100%;
text-align: center;
}
.todayList .nodata image{
width: 440rpx;
height: 328rpx;
margin-top: 60rpx;
}
.sportTime{
padding-left: 30rpx;
color: #888888;
font-size: 28rpx;
height: 80rpx;
line-height: 80rpx;
}
.top{
background: #183247;
color: #748490;
width: 100%;
height: 76rpx;
line-height: 76rpx;
display: flex;
border-bottom: 1rpx solid #465B6C;
}
.top .type{
flex:1;
text-align: center;
font-size: 28rpx;
line-height: 88rpx;
color: #888888;
}
.top .active{
color: #FFFFFF;
font-weight: bold;
}
.top .type .name{
width: 100%;
text-align: center;
}
.select{
width: 30rpx;
height: 4rpx;
border-radius: 12rpx;
background: #FFFFFF;
margin: 0 auto;
margin-top: -14rpx;
}
.total{
overflow: hidden;
background: #183247;
height: 420rpx;
width: auto;
}
.totla-number{
font-family: "Number";
width: 100%;
color: #FFFFFF;
font-size: 100rpx;
text-align: center;
padding-top: 40rpx;
}
.totla-number .unit{
font-size: 22rpx;
color: #FFFFFF;
}
.viewToatl{
width: 100%;
height: 420rpx;
}
.total-type{
width: 84%;
display: flex;
margin: 0 auto;
margin-top: 50rpx;
}
.total-type .type-item{
flex: 1;
text-align: center;
color: #FFFFFF;
}
.type-item .num{
font-family: "Number";
font-size: 40rpx;
font-weight: bold;
}
.type-item .content{
font-size: 22rpx;
color: #FFFFFF;
margin-top: 8rpx;
}
.type-item .left{
text-align: left;
}
.type-item .contents{
text-align: content;
}
.type-item .right{
text-align: right;
}
.selTime{
position: absolute;
width: 90%;
margin: 0 auto;
font-size: 28rpx;
color: #888888;
left: 5%;
top: 20rpx;
}
.time text{
color: #B2B2B2;
margin-right: 40rpx;
font-size: 22rpx;
}
.sportType{
color: #353535;
font-size: 28rpx;
font-weight: bold;
float: left;
}
.more{
position: absolute;
font-size: 24rpx;
right: 50rpx;
bottom: 32rpx;
}
.more-img{
position: absolute;
width: 24rpx;
height: 24rpx;
top: 42rpx;
right: 30rpx;
}
.sport-time{
font-size: 28rpx;
color: rgba(0, 0, 0, 0.5);
width: 690rpx;
margin: 0 auto;
padding-top: 20rpx;
}
.all{
width: 690rpx;
margin: 0 auto;
font-size: 30rpx;
font-weight: bold;
margin-top: 40rpx;
color: rgba(0, 0, 0, 0.9);
}
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class="daka">
<view class="{{num==='开始'?'go mix':'go '}}" wx:if="{{num && startFlag}}">{{num}}</view>
<view wx:if="{{!startFlag}}" class="daka-wrap">
<view class="edit" bindtap="goEdit" wx:if="{{isSz && isTs}}">设置</view>
<view class="edit-no" wx:else>设置</view>
<view class="time">{{showTime}}</view>
<view class="btn" bindtap="clickKs" wx:if="{{start}}">
<image src="/images/skip/icon_ks.png"></image>
开始
</view>
<view class="btn" bindtap="clickBc" wx:if="{{end}}">
<image src="/images/skip/icon_bc.png"></image>
保存
</view>
<view class="mask" wx:if="{{flag}}"></view>
<view class="layer" wx:if="{{flag}}">
<view class="title">运动数据统计</view>
<view class="content">为确保运动数据更准确,请如实输入个数</view>
<view class="input-wrap">
<input placeholder="{{placeholder}}" type="number" bindinput="getNum" maxlength="4" value="{{inputVal}}"></input>
</view>
<view class="btn" hover-class="after-click-btn" bindtap="submits">确定</view>
</view>
</view>
</view>
\ No newline at end of file
.go {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: #FF9B4D;
line-height: 800rpx;
text-align: center;
font-size: 300rpx;
color: #fff;
}
.mix {
font-size: 200rpx;
}
page {
background: #FF9B4D;
}
.daka-wrap {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: #FFFFFF;
}
.time {
font-family: "Number";
font-size: 120rpx;
text-align: center;
margin-top: 300rpx;
color: #353535;
}
.btn-wrap {
height: 165rpx;
padding: 0 30rpx;
margin-top: 20px;
}
.btn-wrap .btn {
width: 170rpx;
height: 170rpx;
border: 3rpx solid #6f7179;
border-radius: 50%;
}
.btn-wrap .btn view {
width: 160rpx;
height: 160rpx;
margin: 5rpx auto;
background: #6f7179;
border-radius: 50%;
font-size: 32rpx;
}
.btn-right view {
background: #4f6d64 !important;
}
.btn-right {
border: 3rpx solid #4f6d64
}
.btn-left {
line-height: 160rpx;
text-align: center;
color: #fff;
}
.btn-right text {
display: block;
text-align: center;
position: relative;
top: 32rpx;
color: #45b876
}
.keep .btn {
margin: 0 auto;
}
.keep .btn view {
background: #6f7179 !important;
}
.keep .btn text {
color: #fff !important;
}
.list {
height: 300px;
position: fixed;
bottom: 0;
border-top: 1rpx solid #fff;
padding-top: 1rpx;
}
.list .item {
height: 133rpx;
line-height: 133rpx;
padding: 0 0rpx;
color: #fff;
border-bottom: 1rpx solid #fff;
position: relative;
padding-bottom: 1rpx;
}
.list .item .inner {
position: absolute;
top: 0;
}
.list .item .content {
width: 100%;
box-sizing: border-box;
padding: 0 30rpx;
z-index: 200;
background: #52535e
}
.list .item .del {
right: 0;
text-align: center;
width: 260rpx;
background: #ff0000;
}
.list .item .updata {
right: 130rpx;
text-align: center;
width: 130rpx;
background: #41cf7e;
}
.mask {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: #000;
opacity: 0.3;
z-index: 200;
}
.layer {
position: absolute;
width: 90%;
top: 400rpx;
left: 5%;
z-index: 300;
border-radius: 10rpx;
background: #fff;
}
.layer .title {
height: 90rpx;
line-height: 90rpx;
background: #FFFFFF;
color: #353535;
padding: 0 30rpx;
text-align: center;
border-radius: 10rpx 10rpx 0 0;
font-weight: bold;
}
.layer .content{
color: #888888;
font-size: 28rpx;
text-align: center;
}
.layer .input-wrap {
margin: 40rpx auto 40rpx auto;
height: 88rpx;
width: 90%;
border: 2rpx solid #F3F3F3;
border-radius: 50rpx;
}
.layer input {
width: 100%;
height: 88rpx;
color: #888888;
text-align: center;
}
.layer .btn {
width: 90%;
height: 88rpx;
line-height: 88rpx;
background: #FF9B4D;
margin: 10rpx auto 30rpx auto;
text-align: center;
color: #fff;
border-radius: 50rpx;
}
.count{
position: fixed;
z-index: 9;
width: 100%;
top: 50rpx;
}
.mode-sel{
font-size: 26rpx;
color: #353535;
margin:0 auto;
float: left;
position:absolute;
left:50%;
top:50%;
transform:translateX(-50%) translateY(-50%);
background: #F8F8F8;
border:2rpx solid #E8E8E8;
padding: 10rpx 28rpx 10rpx 38rpx;
border-radius:30rpx;
font-weight:bold;
}
.jt {
width: 32rpx;
height: 32rpx;
position: relative;
top: 6rpx;
}
.btn {
position: relative;
width: 178rpx;
height: 178rpx;
border-radius: 50%;
line-height: 220rpx;
background: #FF9B4D;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.06);
color: #fff;
text-align: center;
margin: 160rpx auto 0 auto;
}
.btn image{
position: absolute;
left: 68rpx;
top:32rpx;
width: 48rpx;
height: 48rpx;
}
.edit{
position: absolute;
right: 40rpx;
top: 26rpx;
height: 40rpx;
font-size: 28rpx;
color: #353535;
}
.edit-no{
position: absolute;
right: 40rpx;
top: 26rpx;
height: 40rpx;
font-size: 28rpx;
color: #888888;
}
.edit image{
width: 40rpx;
height: 40rpx;
}
\ No newline at end of file
// pages/skip/edit/edit.js
var API = require("../../../utils/request.js");
Page({
/**
* 页面的初始数据
*/
data: {
beforeChecked:true,
afterChecked:true,
backgroundChecked:true,
backgroundCheckedCount:true,
music:'',
musicId:1
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
global.backgroundMusic = 0;
console.log('页面加载');
var that = this;
that.getSkipConfig();
that.getBgMusic();
},
//获取当前的设置
getSkipConfig() {
var that = this;
API.getData('/config/getSkipConfig', {}, function (res) {
console.log('当前的设置',res);
if(res.data == null){
return false;
}
if(res.data.startCountdown == 0){
that.setData({
beforeChecked:false
})
}else{
that.setData({
beforeChecked:true
})
}
if(res.data.endCountdown == 0){
that.setData({
afterChecked:false
})
}else{
that.setData({
afterChecked:true
})
}
if(res.data.skipJz == 0){
that.setData({
backgroundChecked:false
})
}else{
that.setData({
backgroundChecked:true
})
}
if(res.data.audioCountNum == 0){
that.setData({
backgroundCheckedCount:false
})
}else{
that.setData({
backgroundCheckedCount:true
})
}
}, function () {
});
},
//获取背景音乐列表
getBgMusic() {
var that = this;
wx.showLoading({
title: '加载中...',
})
API.getData('/config/getBgMusic', {}, function (res) {
var list = res.data;
API.getData('/config/getSkipConfig', {}, function (res) {
console.log('当前的音乐配置',res.data);
console.log('当前的音乐列表',list);
if(res.data == null){
that.setData({
startCountdown:1,
endCountdown:1,
skipJz:1,
music:list[0].musicName,
musicId:1
})
}else{
if(res.data.skipJz == 1 && res.data.skipBackMusic != null){
for(var i = 0; i < list.length; i++){
if(list[i].id == res.data.skipBackMusic){
console.log(list[i].musicName);
that.setData({
musicId:list[i].id,
music:list[i].musicName
})
}
}
}else if(res.data.skipJz == null && res.data.skipBackMusic != null){
for(var i = 0; i < list.length; i++){
if(list[i].id == res.data.skipBackMusic){
console.log(list[i].musicName);
that.setData({
musicId:list[i].id,
music:list[i].musicName
})
}
}
}else if(res.data.skipJz == 1 && res.data.skipBackMusic == null){
that.setData({
musicId:list[0].id,
music:list[0].musicName
})
}else if(res.data.skipJz == null && res.data.skipBackMusic == null){
that.setData({
musicId:list[0].id,
music:list[0].musicName
})
}else if(res.data.skipJz == 0 && res.data.skipBackMusic == null){
that.setData({
musicId:list[0].id,
music:list[0].musicName
})
}else if(res.data.skipJz == 0 && res.data.skipBackMusic != null){
for(var i = 0; i < list.length; i++){
if(list[i].id == res.data.skipBackMusic){
console.log(list[i].musicName);
that.setData({
musicId:list[i].id,
music:list[i].musicName
})
}
}
}
if(res.data.startCountdown == 0){
that.setData({
startCountdown:0
})
}else{
that.setData({
startCountdown:1
})
}
if(res.data.endCountdown == 0){
that.setData({
endCountdown:0
})
}else{
that.setData({
endCountdown:1
})
}
if(res.data.skipJz == 0){
that.setData({
skipJz:0
})
}else{
that.setData({
skipJz:1
})
}
}
wx.hideLoading();
})
}, function () {
});
},
//开始前
beforeChange: function(e) {
console.log('开始前-----', e.detail.value);
var num = 0;
if(e.detail.value == false){
num = 0
}else{
num = 1
}
API.requestAll('/config/setSkipConfig', {
startCountdown:num
}, function (res) {
console.log('设置背景音乐',res);
}, function () {
});
},
//开始后
afterChange: function(e) {
console.log('开始后-----', e.detail.value);
var num = 0;
if(e.detail.value == false){
num = 0
}else{
num = 1
}
API.requestAll('/config/setSkipConfig', {
endCountdown:num
}, function (res) {
console.log('设置背景音乐',res);
}, function () {
});
},
//背景音乐
backgroundChange: function(e){
var that = this;
console.log('背景音乐-----', e.detail.value);
that.setData({
backgroundChecked:e.detail.value
})
var num = 0;
if(e.detail.value == false){
num = 0
}else{
num = 1
}
API.requestAll('/config/setSkipConfig', {
skipJz:num
}, function (res) {
console.log('设置背景音乐',res);
}, function () {
});
},
//选择背景音乐
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
index: e.detail.value
})
var num = Number(e.detail.value) + 1;
console.log(num);
API.requestAll('/config/setSkipConfig', {
skipBackMusic:num
}, function (res) {
console.log('设置背景音乐',res);
}, function () {
});
},
//设置音乐
goSet(e){
console.log(e.currentTarget.dataset.id);
wx.navigateTo({
url: '../musicList/musicList?id=' + e.currentTarget.dataset.id,
})
},
//设置播报次数开关
backgroundCheckedCount(e){
console.log('播报次数开关',e.detail.value)
var num = 0;
if(e.detail.value == false){
num = 0
}else{
num = 1
}
API.requestAll('/config/setSkipConfig', {
audioCountNum:num
}, function (res) {
console.log('播报次数开关',res);
}, function () {
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
var that = this;
that.getBgMusic();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarBackgroundColor": "#F5F5F5",
"navigationBarTitleText": "跳绳设置"
}
\ No newline at end of file
<view class="item">
<view class="li">
<view class="name">开始前倒计时</view>
<switch class="switch" checked="{{beforeChecked}}" bindchange="beforeChange"/>
</view>
<view class="li">
<view class="name">结束前倒计时<text>(仅支持计时跳)</text></view>
<switch class="switch" checked="{{afterChecked}}" bindchange="afterChange"/>
</view>
</view>
<view class="item">
<view class="li">
<view class="name">背景音乐</view>
<switch class="switch" checked="{{backgroundChecked}}" bindchange="backgroundChange"/>
</view>
<view class="li" wx:if="{{backgroundChecked == true}}" data-id="{{musicId}}" bindtap="goSet">
<view class="picker">
{{music}}
</view>
<image class="next" src="/images/sport/next.png"></image>
</view>
<view class="li" wx:else>
<view class="picker no-next">
{{music}}
</view>
<image class="next" src="/images/sport/no-next.png"></image>
</view>
</view>
<view class="item">
<view class="li">
<view class="name">播报次数开关</view>
<switch class="switch" checked="{{backgroundCheckedCount}}" bindchange="backgroundCheckedCount"/>
</view>
</view>
<view class="edit-content">
BPM(Beats Per Minute 每一分钟节拍数量)跳在音乐的拍子上,有助于协调身体,降低疲劳
</view>
\ No newline at end of file
page{
background: #F5F5F5;
}
.item{
width: 94%;
margin: 0 auto;
margin-top: 20rpx;
background: #FFFFFF;
border-radius: 24rpx;
}
.item .li{
position: relative;
width: 90%;
height: 100rpx;
margin: 0 auto;
border-bottom: 1rpx solid #EEEEEE;
}
.item .li .name{
font-size: 32rpx;
font-weight: bold;
color: #353535;
line-height: 100rpx;
}
.item .li text{
font-size: 26rpx;
font-weight: 400;
color: #B2B2B2;
line-height: 100rpx;
margin-left: 10rpx;
}
.item .li:last-child{
border-bottom: 0rpx;
}
.item .li .switch{
position: absolute;
right: 0rpx;
top: 30rpx;
zoom: 0.8;
}
.item .li .picker{
color: #353535;
font-size: 28rpx;
width: 100%;
height: 100rpx;
line-height: 100rpx;
}
.item .li .no-next{
color: #D8D8D8;
font-size: 28rpx;
width: 100%;
height: 100rpx;
line-height: 100rpx;
}
.next{
position: absolute;
width: 32rpx;
height: 32rpx;
right: 10rpx;
top:34rpx;
}
/*科室排班表 */
.table{
display: inline-flex;
flex-direction: column;
border: 1rpx solid rgba(218, 217, 217, 1);
border-bottom: 0;
}
.scrollClass {
display: flex;
width: 100%;
white-space: nowrap;
margin-top: 23px;
height: 100%;
background-color: white;
}
.table_header {
display: inline-flex;
}
.th {
display: flex;
flex-direction: column;
width: 200rpx;
height: 90rpx;
background: rgba(241, 252, 255, 1);
border-right: 1rpx solid rgba(218, 217, 217, 1);
border-bottom: 1rpx solid rgba(218, 217, 217, 1);
justify-content: center;
align-items: center;
overflow-x: auto;
}
.cell_label{
font-size: 26rpx;
color: rgba(74, 74, 74, 1);
}
.cell_date_label{
font-size: 20rpx;
color: rgba(74, 74, 74, 1);
}
.table_main {
display: inline-flex;
flex-direction: row;
}
.right-item{
display: flex;
flex-direction: row;
}
.td {
display: flex;
flex-direction: column;
width: 200rpx;
/* height: 90rpx; */
background: white;
justify-content: center;
align-items: center;
border: 1rpx solid rgba(218, 217, 217, 1);
border-top: 0;
border-left:0;
}
.table_Text_class {
display: flex;
justify-content: center;
align-items: center;
height: 60rpx;
font-size: 30rpx;
color: rgba(55, 134, 244, 1);
width: 100%;
word-break: normal;
border-bottom: 1rpx solid rgba(218, 217, 217, 1);
}
.table_Text_last_class{
display: flex;
justify-content: center;
align-items: center;
height: 60rpx;
font-size: 30rpx;
color: rgba(55, 134, 244, 1);
width: 100%;
word-break: normal;
}
.edit-content{
width: 94%;
margin: 0 auto;
font-size: 24rpx;
color: #888888;
margin-top: 20rpx;
}
\ No newline at end of file
{
"usingComponents": {},
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTitleText": "运动记录"
}
\ No newline at end of file
<view>
<view class="top">
<view class="top-li">
<view class="type {{level == 1?'active':''}}" bindtap="selectLevel" data-lv="1" data-level="day">
<view class="name">日</view>
</view>
<view class="type {{level == 2?'active':''}}" bindtap="selectLevel" data-lv="2" data-level="week">
<view class="name">周</view>
</view>
<view class="type {{level == 3?'active':''}}" bindtap="selectLevel" data-lv="3" data-level="month">
<view class="name">月</view>
</view>
<view class="type {{level == 4?'active':''}}" bindtap="selectLevel" data-lv="4" data-level="total">
<view class="name">总</view>
</view>
</view>
</view>
<view class="scroll_box">
<scroll-view scroll-x scroll-into-view="{{toView}}" bindscrolltoupper="upper" wx:if="{{viewData}}">
<view class="item_list" style="width:{{width}}rpx" wx:for="{{sportTimeList}}" wx:for-index='idx' wx:for-item="items" bindtap="selectDay" data-info="{{items}}" data-idx="{{idx}}" data-day="{{items.recordDate}}" id="list{{idx}}">
<view class="{{items.select == 1?'item-set item baf':'item baf'}}">
<view wx:if="{{level == 3}}">
<view wx:if="{{items.nowMonth == 01}}">
{{items.nowYear}}年{{items.nowMonth}}月
</view>
<view wx:else>
{{items.nowMonth}}月
</view>
</view>
<view wx:else>
{{items.day}}
</view>
</view>
<view class="data">
<view class="{{items.select == 1?'line sel-line':'line'}}"></view>
<view class="sanjiao" wx:if="{{items.select == 1}}"></view>
<view class="item">
<view class="chart" wx:if="{{items.sportTime}}" >
<view class="{{items.select == 1?'chart-set ':'aa'}}" style="height:{{items.sportTime/maxSportTime*300}}rpx;"></view>
</view>
<!-- <view class="val" wx:if="{{items.sportTime && items.select}}">{{dayInfo.sportValue}}个</view> -->
</view>
</view>
</view>
</scroll-view>
<view class="total" wx:if="{{viewTotal}}">
<view class="totla-number">
<view>{{totalTime}}</view>
<view class="unit">分钟</view>
</view>
<view class="total-type">
<view class="type-item">
<view class="num left">{{joinDayNum || 0}}</view>
<view class="content left">累计(天)</view>
</view>
<view class="type-item">
<view class="num contents">{{totalNumber || 0}}</view>
<view class="content contents">完成(次)</view>
</view>
<view class="type-item">
<view class="num right">{{totalCalorie || 0}}</view>
<view class="content right">消耗(千卡)</view>
</view>
</view>
</view>
</view>
<view class="card" wx:if="{{sportType == 'day'}}">
<view class="selTime">{{startDayShow}},运动数据</view>
<view class="data-wrap pd80">
<view class="item">
<view class="val">{{totalTime || 0}}</view>
<view class="key">用时(分)</view>
</view>
<view class="item">
<view class="val">{{totalNumber || 0}}</view>
<view class="key">完成(次)</view>
</view>
<view class="item">
<view class="val">{{totalCalorie || 0}}</view>
<view class="key">消耗(千卡)</view>
</view>
</view>
</view>
<view class="card" wx:if="{{sportType == 'week'}}">
<view class="selTime">{{nowTime}},运动数据</view>
<view class="data-wrap">
<view class="item item-time">
<view class="val">{{totalTime || 0}}</view>
<view class="key">分钟</view>
</view>
</view>
<view class="data-wrap">
<view class="item">
<view class="val">{{joinDayNum || 0}}</view>
<view class="key">累计(天)</view>
</view>
<view class="item">
<view class="val">{{totalNumber || 0}}</view>
<view class="key">完成(次)</view>
</view>
<view class="item">
<view class="val">{{totalCalorie || 0}}</view>
<view class="key">消耗(千卡)</view>
</view>
</view>
</view>
<view class="card" wx:if="{{sportType == 'month'}}">
<view class="selTime">{{nowMonth}}月,运动数据</view>
<view class="data-wrap">
<view class="item item-time">
<view class="val">{{totalTime || 0}}</view>
<view class="key">分钟</view>
</view>
</view>
<view class="data-wrap">
<view class="item">
<view class="val">{{joinDayNum || 0}}</view>
<view class="key">累计(天)</view>
</view>
<view class="item">
<view class="val">{{totalNumber || 0}}</view>
<view class="key">完成(次)</view>
</view>
<view class="item">
<view class="val">{{totalCalorie || 0}}</view>
<view class="key">消耗(千卡)</view>
</view>
</view>
</view>
<view>
<view class="todayList">
<view class="nodata" wx:if="{{sportRecordList.length == 0}}">
<image src="https://ttxs01-10066525.file.myqcloud.com/sport/miniapp/mobile/skip/nodata.png"></image>
</view>
<view class="selTimeText" wx:else>
<view wx:if="{{sportType == 'day'}}">{{startDayShow}},运动记录</view>
<view wx:elif="{{sportType == 'week'}}">{{nowTime}},运动记录</view>
<view wx:elif="{{sportType == 'month'}}">{{nowMonth}}月,运动记录</view>
<view wx:else>总运动记录</view>
</view>
<view wx:for="{{sportRecordList}}" data-projectid="{{item.projectId}}" data-info="{{item.detailList}}" data-isdevdata="{{item.isDevData}}" data-id="{{item.id}}">
<view class="li" hover-class="after-click-content" wx:for="{{item.detailList}}" wx:for-item="items" data-info="{{items}}" bindtap="checkInfo">
<view class="more">查看详情</view>
<image class="more-img" src="/images/home/next.png"></image>
<!-- <view class="todayTime">{{items.createTime}}</view> -->
<view class="li">
<view class="left">
<image src="{{items.listIcon}}"></image>
</view>
<view class="right">
<view class="num">
<text class="sportType" wx:if="{{items.projectId == 1}}">跳绳</text>
<text class="sportType" wx:if="{{items.projectId == 2}}">仰卧起坐</text>
<text class="sportType" wx:if="{{items.projectId == 3}}">踢毽子</text>
<text class="sportType" wx:if="{{items.projectId == 4}}">步数</text>
<text class="sportType" wx:if="{{items.projectId == 5}}">坐位体前屈</text>
<text class="sportType" wx:if="{{items.projectId == 6}}">50米跑</text>
<text class="sportType" wx:if="{{items.projectId == 11}}">开合跳</text>
<text class="sportType" wx:if="{{items.projectId == 13}}">深蹲</text>
<text class="sportType" wx:if="{{items.projectId == 14}}">俯卧撑</text>
<text class="sportType" wx:if="{{items.projectId == 15}}">高抬腿</text>
<text class="sportType" wx:if="{{items.projectId == 16}}">原地臀踢</text>
<text class="sportType" wx:if="{{items.projectId == 17}}">原地跑</text>
<text class="isSmart" catchtap="buy" wx:if="{{items.isDevData == 1 && items.projectId == 1}}">智能跳绳</text>
</view>
<view class="info" wx:if="{{items.projectId == 1 || items.projectId == 2 || items.projectId == 3 || items.projectId == 4 || items.projectId == 5 || items.projectId == 6 || items.projectId == 11 || items.projectId == 13 || items.projectId == 14 || items.projectId == 15 || items.projectId == 16 || items.projectId == 17}}">
<view class="time" wx:if="{{items.projectId == 1 || items.projectId == 2 || items.projectId == 3 || items.projectId == 4 || items.projectId == 5 || items.projectId == 6 || items.projectId == 11 || items.projectId == 13 || items.projectId == 14 || items.projectId == 15 || items.projectId == 16 || items.projectId == 17}}">{{items.sportValue}} <text>{{items.sportValueTypeName || ''}}</text></view>
<view class="time" wx:else>{{items.count}}<text>次</text></view>
<view>
<view class="time">{{items.sportTime}}</view>
<image src="/images/skip/time_black.png"></image>
</view>
<view>
<view class="qk">{{items.calorie}}</view>
<image src="/images/skip/calorie_black.png"></image>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
page{
background: #f5f5f5;
}
.top-wrap{
background: #fff;
}
.day{display: flex;}
.day view{
width: 160rpx;
height: 100%;
margin-right: 23rpx;
display: inline-block;
margin-left: 10px;
background-color: blue;
text-align: center;
font-size: 24rpx;
color: #333;
height: 70rpx;
line-height: 70rpx;
}
.data{
position: relative;
height: 330rpx;
display: flex;
background: #F8F8F8 !important;
}
.data .line{
position: absolute;
width: 2rpx;
height: 100%;
border:1rpx dashed #E5E5E5;
left: calc(50% - 2rpx);
top: 10rpx;
transform: scaleX(0.5);
}
.data .sel-line{
position: absolute;
width: 0rpx;
height: 100%;
border:1rpx dashed #FF811E;
left: calc(50% - 2rpx);
top: 10rpx;
}
.data .item{
width: 180rpx;
height: 100%;
margin-right: 23rpx;
display: inline-block;
margin-left: 10px;
}
.item_list .item-set{
color: #3FCB7D;
}
.item_list .item .val{
text-align: center;
color: #FFFFFF;
font-size: 26rpx;
position: absolute;
}
.chart{
height: 338rpx;
width: 60rpx;
margin:0 auto;
border-radius: 60rpx 60rpx 0 0;
position: relative;
}
.chart view{
height: 400rpx;
width: 60rpx;
/* background: linear-gradient(180deg, #239E71 0%, #183247 100%); */
background: #FFE8D5;
margin:0 auto;
border-radius: 8rpx 8rpx 0rpx 0rpx;
position: absolute;
bottom: 18rpx;
left: 0;
}
.chart-set{
background: #FF811E !important;
}
.card {
position: relative;
background-color: #fff;
padding-bottom: 30rpx;
padding-top: 0rpx;
border-radius: 24rpx 24rpx 0rpx 0rpx;
margin-top: -48rpx;
}
.data-wrap{
display: flex;
margin-top: 40rpx;
padding-top: 30rpx;
}
.pd80{
padding-top: 80rpx;
}
.data-wrap .item{
flex: 1;
font-family: "Number";
text-align: center
}
.data-wrap .item-time{
margin-top: 60rpx;
}
.data-wrap .key{
font-size: 22rpx;
color: #B2B2B2;
margin-top: 10rpx;
}
.card .number{
font-family: "Number";
width: 100%;
text-align: center;
font-size: 104rpx;
margin-top: 40rpx;
margin-bottom: 60rpx;
padding-top: 40rpx;
}
.data-wrap .val text{
font-size: 18rpx;
font-weight: normal;
}
.data-wrap .val{
font-size: 48rpx;
}
.data-item{
background: #fff;
margin-top: 20rpx;
}
.data-item .top{
width: 654rpx;
height: 100rpx;
line-height: 100rpx;
margin:0 auto;
border-bottom: 1rpx solid #dbdbdb;
}
.data-item .top .val{
float: left;
font-size: 36rpx;
}
.data-item .top .val text{
font-size:16rpx ;
}
.data-item .top .mode{
float: left;
width:120rpx;
height:36rpx;
background:rgba(237,255,244,1);
border:1rpx solid rgba(63,195,121,1);
border-radius:18rpx;
color:rgba(63,195,121,1);
text-align: center;
line-height: 36rpx;
font-size: 20rpx;
margin:32rpx 30rpx 0 30rpx;
}
.data-item .time{
float: right;
font-size: 26rpx;
}
.data-item .bottom{
display: flex;
height: 100rpx;
width: 654rpx;
margin:0 auto;
}
.t-l{
text-align: left;
}
.t-r{
text-align: right;
}
.center{
min-width: 400rpx;
}
.data-item .bottom .li{
flex: 1;
text-align: center;
}
.data-item .bottom .li .key{
font-size: 22rpx;
color: #656565;
}
.data-item .bottom .li .val{
font-size: 26rpx;
margin-top: 10rpx;
}
.last{
float:left;
font-size: 28rpx;
text-align: center;
padding: 10rpx 20rpx;
border-radius: 10rpx;
color: #FFFFFF;
background: #3FCB7D;
margin: 20rpx;
}
.next{
float:right;
font-size: 28rpx;
text-align: center;
padding: 10rpx 20rpx;
border-radius: 10rpx;
color: #FFFFFF;
background: #3FCB7D;
margin: 20rpx;
}
.top{
overflow: hidden;
background: #FFFFFF;
}
.on{
background: #f5f5f5;
color: #000000;
}
.scroll_box{
width: 100%;
height: 410rpx;
/* padding: 20rpx; */
white-space: nowrap;
}
.scroll_box scroll-view{
background: #F8F8F8;
height: 420rpx;
width: auto;
}
.item_list{
position: relative;
top: 0;
text-align: center;
/* width: 130rpx; */
height: 100%;
/* margin-right: 23rpx; */
display: inline-block;
/* margin-left: 10px; */
font-size: 26rpx;
}
.item_list .item{
font-size: 22rpx;
line-height: 80rpx;
color: rgba(0, 0, 0, 0.5);
background: #F8F8F8;
}
.item_list .item-set{
font-weight: bold;
color: #FF811E;
}
::-webkit-scrollbar{
width: 0;
height: 0;
color: transparent;
}
.todayList{
position: relative;
width: 100%;
margin-top: 20rpx;
background: #FFFFFF;
}
.todayList .li{
position: relative;
width: 100%;
/* height: 210rpx; */
display: flex;
}
.todayList .li .left{
text-align: center;
margin-left: 30rpx;
margin-right: 18rpx;
}
.todayList .li .left image{
width: 100rpx;
height: 100rpx;
margin-top: 30rpx;
}
.todayList .li .right{
flex: 1;
border-bottom: 2rpx solid #EEEEEE;
margin-right: 30rpx;
padding-bottom: 14rpx;
}
.todayList .li .alone{
margin-left: 30rpx;
}
.right .type{
height: 30rpx;
margin-top: 30rpx;
font-size: 22rpx;
color: #B2B2B2;
}
.right .num{
font-family: "Number";
color: #353535;
font-size: 48rpx;
margin-top: 20rpx;
margin-bottom: 20rpx;
}
.right .unit{
font-size: 20rpx;
color: #B2B2B2;
margin-left: 6rpx;
}
.right .isSmart{
font-size: 22rpx;
background: #31BBFF;
border-radius: 12rpx;
color: #FFFFFF;
padding: 2rpx 10rpx;
padding-bottom: 10rpx;
margin-left: 20rpx;
}
.right .info{
overflow: hidden;
margin-top: 12rpx;
}
.alone .info{
overflow: hidden;
margin-top: 12rpx;
margin-bottom: 12rpx;
}
.right .info image{
width: 28rpx;
height: 28rpx;
float: left;
margin-top: 2rpx;
margin-left: 8rpx;
}
.right .info .time{
font-family: "Number";
font-size: 28rpx;
float: left;
}
.right .info .qk{
font-family: "Number";
font-size: 28rpx;
float: left;
margin-left: 20rpx;
}
.todayTime{
position: absolute;
right: 30rpx;
top: 40rpx;
font-size: 22rpx;
color: #B2B2B2;
}
.todayList .nodata{
width: 100%;
text-align: center;
}
.todayList .nodata image{
width: 440rpx;
height: 328rpx;
margin-top: 60rpx;
}
.sportTime{
padding-left: 30rpx;
color: #888888;
font-size: 28rpx;
height: 80rpx;
line-height: 80rpx;
}
.top{
background: #FFFFFF;
color: #748490;
width: 100%;
}
.top-li{
display: flex;
height: 78rpx;
line-height: 78rpx;
width: 702rpx;
margin: 0 auto;
background: #F5F5F5;
border-radius:16rpx;
padding: 0rpx 4rpx;
}
.top .type{
flex:1;
text-align: center;
font-size: 28rpx;
color: rgba(0, 0, 0, 0.9);
}
.top .active{
height: 70rpx;
font-weight: bold;
color: #FF811E;
background: #FFFFFF;
/* box-shadow: 0rpx 4rpx 8rpx 2rpx rgba(0, 0, 0, 0.08); */
border-radius: 16rpx;
margin-top: 5rpx;
line-height: 70rpx;
}
.top .type .name{
width: 100%;
text-align: center;
}
.select{
width: 30rpx;
height: 4rpx;
border-radius: 12rpx;
background: #FFFFFF;
margin: 0 auto;
margin-top: -14rpx;
}
.total{
overflow: hidden;
background: #FFFFFF;
height: 420rpx;
width: auto;
}
.totla-number{
font-family: "Number";
width: 100%;
font-weight: bold;
color: rgba(0, 0, 0, 0.9);
font-size: 100rpx;
text-align: center;
padding-top: 70rpx;
}
.totla-number .unit{
font-size: 22rpx;
color: rgba(0, 0, 0, 0.3);
}
.viewToatl{
width: 100%;
height: 420rpx;
}
.total-type{
width: 84%;
display: flex;
margin: 0 auto;
margin-top: 50rpx;
}
.total-type .type-item{
flex: 1;
text-align: center;
color: #FFFFFF;
}
.type-item .num{
font-family: "Number";
color: rgba(0, 0, 0, 0.9);
font-size: 44rpx;
font-weight: bold;
}
.type-item .content{
font-size: 22rpx;
color: #FFFFFF;
margin-top: 8rpx;
color: rgba(0, 0, 0, 0.3);
}
.type-item .left{
text-align: left;
}
.type-item .contents{
text-align: content;
}
.type-item .right{
text-align: right;
}
.selTime{
position: absolute;
width: 90%;
margin: 0 auto;
font-size: 28rpx;
color: #888888;
left: 5%;
top: 20rpx;
}
.time text{
color: #B2B2B2;
margin-left: 6rpx;
margin-right: 40rpx;
font-size: 22rpx;
}
.sportType{
color: #353535;
font-size: 28rpx;
font-weight: bold;
}
.more{
position: absolute;
font-size: 24rpx;
right: 50rpx;
top: 38rpx;
color: rgba(0, 0, 0, 0.5);
}
.more-img{
position: absolute;
width: 24rpx;
height: 24rpx;
right: 22rpx;
top: 44rpx;
}
.baf{
background: #FFFFFF !important;
}
.sanjiao{
position: absolute;
left: calc(50% - 8rpx);
top: 0rpx;
width:0rpx;
height:0rpx;
border:10rpx solid #000;
border-top-color: #FF811E;
border-bottom-color:transparent;
border-left-color:transparent;
border-right-color:transparent;
}
.selTimeText{
font-size: 28rpx;
width: 90%;
margin: 0 auto;
color: rgba(0, 0, 0, 0.5);
padding-top: 20rpx;
}
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class="count" wx:if="{{isTs}}">
<picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}" disabled="{{isPicker}}">
<view class="mode-sel">
{{array[index]}}
<image src="https://cdn.xiaobentiyu.cn/sport_minapp_img/jt3.png" class="jt"></image>
</view>
</picker>
<view class="edit" bindtap="goEdit" wx:if="{{isSz && isTs}}">设置</view>
<view class="edit-no" wx:else>设置</view>
</view>
<view class="daka">
<view class="{{num==='开始'?'go mix':'go '}}" wx:if="{{num && startFlag}}">{{num}}</view>
<view wx:if="{{!startFlag}}" class="daka-wrap">
<!-- <view class="time">00:{{time}}</view> -->
<view class="time">{{showTime}}</view>
<view class="btn" bindtap="clickKs" wx:if="{{start}}">
<image src="../../../images/sport/icon_ks.png"></image>
开始
</view>
<view class="btn" bindtap="clickBc" wx:if="{{end}}">
<image src="../../../images/sport/icon_bc.png"></image>
保存
</view>
<view class="mask" wx:if="{{flag}}"></view>
<view class="layer" wx:if="{{flag}}">
<view class="title">运动数据统计</view>
<view class="content">为确保运动数据更准确,请如实输入个数</view>
<view class="input-wrap">
<input placeholder="{{placeholder}}" type="number" bindinput="getNum" value="{{inputVal}}"></input>
</view>
<view class="btn" hover-class="after-click-btn" bindtap="submits">确定</view>
</view>
</view>
</view>
\ No newline at end of file
.go {
/* font-family: "Number"; */
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: #FF9B4D;
line-height: 800rpx;
text-align: center;
font-size: 300rpx;
color: #fff;
}
.mix {
font-size: 200rpx;
}
page {
background: #41cf7e;
}
.daka-wrap {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: #FFFFFF;
}
.time {
font-family: "Number";
font-size: 120rpx;
text-align: center;
margin-top: 300rpx;
color: #353535;
}
.btn-wrap {
height: 165rpx;
padding: 0 30rpx;
margin-top: 20px;
}
.btn-wrap .btn {
width: 170rpx;
height: 170rpx;
border: 3rpx solid #6f7179;
border-radius: 50%;
}
.btn-wrap .btn view {
width: 160rpx;
height: 160rpx;
margin: 5rpx auto;
background: #6f7179;
border-radius: 50%;
font-size: 32rpx;
}
.btn-right view {
background: #4f6d64 !important;
}
.btn-right {
border: 3rpx solid #4f6d64
}
.btn-left {
line-height: 160rpx;
text-align: center;
color: #fff;
}
.btn-right text {
display: block;
text-align: center;
position: relative;
top: 32rpx;
color: #45b876
}
.keep .btn {
margin: 0 auto;
}
.keep .btn view {
background: #6f7179 !important;
}
.keep .btn text {
color: #fff !important;
}
.list {
height: 300px;
position: fixed;
bottom: 0;
border-top: 1rpx solid #fff;
padding-top: 1rpx;
}
.list .item {
height: 133rpx;
line-height: 133rpx;
padding: 0 0rpx;
color: #fff;
border-bottom: 1rpx solid #fff;
position: relative;
padding-bottom: 1rpx;
}
.list .item .inner {
position: absolute;
top: 0;
}
.list .item .content {
width: 100%;
box-sizing: border-box;
padding: 0 30rpx;
z-index: 200;
background: #52535e
}
.list .item .del {
right: 0;
text-align: center;
width: 260rpx;
background: #ff0000;
}
.list .item .updata {
right: 130rpx;
text-align: center;
width: 130rpx;
background: #41cf7e;
}
.mask {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: #000;
opacity: 0.3;
z-index: 200;
}
.layer {
position: absolute;
width: 90%;
top: 400rpx;
left: 5%;
z-index: 300;
border-radius: 10rpx;
background: #fff;
}
.layer .title {
height: 90rpx;
line-height: 90rpx;
background: #FFFFFF;
color: #353535;
padding: 0 30rpx;
text-align: center;
border-radius: 10rpx 10rpx 0 0;
font-weight: bold;
}
.layer .content{
color: #888888;
font-size: 28rpx;
text-align: center;
}
.layer .input-wrap {
margin: 40rpx auto 40rpx auto;
height: 88rpx;
width: 90%;
border: 2rpx solid #F3F3F3;
border-radius: 50rpx;
}
.layer input {
width: 100%;
height: 88rpx;
color: #888888;
text-align: center;
}
.layer .btn {
width: 90%;
height: 88rpx;
line-height: 88rpx;
background: #FF9B4D;
margin: 10rpx auto 30rpx auto;
text-align: center;
color: #fff;
border-radius: 50rpx;
}
.count{
position: fixed;
z-index: 9;
width: 100%;
top: 50rpx;
overflow: hidden;
height: 60rpx;
}
.mode-sel{
font-size: 26rpx;
color: #353535;
margin:0 auto;
float: left;
position:absolute;
left:50%;
top:50%;
transform:translateX(-50%) translateY(-50%);
background: #F8F8F8;
border:2rpx solid #E8E8E8;
padding: 10rpx 28rpx 10rpx 38rpx;
border-radius:30rpx;
font-weight:bold;
}
.jt {
width: 32rpx;
height: 32rpx;
position: relative;
top: 6rpx;
}
.btn {
position: relative;
width: 178rpx;
height: 178rpx;
border-radius: 50%;
line-height: 220rpx;
background: #FF9B4D;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.06);
color: #fff;
text-align: center;
margin: 160rpx auto 0 auto;
}
.btn image{
position: absolute;
left: 68rpx;
top:32rpx;
width: 48rpx;
height: 48rpx;
}
.edit{
position: absolute;
right: 40rpx;
top: 14rpx;
height: 40rpx;
font-size: 28rpx;
color: #353535;
}
.edit-no{
position: absolute;
right: 40rpx;
top: 14rpx;
height: 40rpx;
font-size: 28rpx;
color: #888888;
}
.edit image{
width: 40rpx;
height: 40rpx;
}
\ No newline at end of file
var app = getApp(); var app = getApp();
var version = 'v2.0.5'
/** /**
* POST请求, * POST请求,
* URL:接口 * URL:接口
...@@ -7,41 +6,71 @@ var version = 'v2.0.5' ...@@ -7,41 +6,71 @@ var version = 'v2.0.5'
* doSuccess:成功的回调函数 * doSuccess:成功的回调函数
* doFail:失败的回调函数 * doFail:失败的回调函数
*/ */
function requestAll(url, postData, doSuccess) { function requestAll(url, postData, doSuccess, doFail) {
// postData.userId = parseInt(wx.getStorageSync('userId'));
wx.request({ wx.request({
//项目的真正接口,通过字符串拼接方式实现 //项目的真正接口,通过字符串拼接方式实现
url: wx.getStorageSync('host') + url, url: wx.getStorageSync('host') + url,
header: { header: {
"content-type": "application/json;charset=UTF-8", "content-type": "application/json;charset=UTF-8",
"version":version, // token: wx.getStorageSync('token'),
token:wx.getStorageSync('token'), "token": 'be3531e49c70444189d7511c7bb9602d',
version: wx.getStorageSync('version'),
pvmodel:wx.getStorageSync('model'),
pvversion: wx.getStorageSync('pvversion'),
route:"xiaobenSport"
}, },
data: postData, data: postData,
method: 'POST', method: 'POST',
success: function (res) { success: function (res) {
if (res.data.code == 200) { //console.log('发送请求',res)
if(res.data.code == 200){
doSuccess(res.data); doSuccess(res.data);
}else if(res.data.code == 401){ }else if(res.data.code == 401){
wx.reLaunch({ wx.reLaunch({
url:'/pages/authorize/authorize' url:'/packageB/login/index/index'
}); })
} else {
if (res.data.message){
if (res.data.message && res.data.message.indexOf('token') != -1){
wx.navigateTo({ url: '/pages/authorize/authorize' })
}else{
wx.showToast({ icon: 'none', title: res.data.message, duration: 2000 })
}
}else{ }else{
wx.showToast({ icon: 'none', title: '服务器开小差了', duration: 2000 }) doSuccess(res.data);
wx.showToast({
title: res.data.message,
duration: 2000,
icon: 'none'
});
} }
},
fail: function () {
doFail();
},
})
}
function request(url, postData, doSuccess,doFail) {
wx.request({
//项目的真正接口,通过字符串拼接方式实现
url: wx.getStorageSync('host') + url,
header: {
"content-type": "application/json;charset=UTF-8",
"token":'be3531e49c70444189d7511c7bb9602d'
// token: wx.getStorageSync('token'),
// version: wx.getStorageSync('version'),
// pvmodel:wx.getStorageSync('model'),
// pvversion: wx.getStorageSync('pvversion'),
// route:"xiaobenSport"
},
data: postData,
method: 'POST',
success: function (res) {
if (res.data.code == 200) {
doSuccess(res.data);
} else if (res.data.code == 401) {
wx.reLaunch({
url:'/packageB/login/index/index'
});
}else {
doSuccess(res.data);
} }
}, },
fail: function () { fail: function () {
wx.showToast({ icon: 'none', title: '服务器开小差了', duration: 2000 }) wx.showToast({ icon: 'none', title: '网络异常,请重试', duration: 2000 })
// doFail();
}, },
}) })
} }
...@@ -52,80 +81,118 @@ function getData(url, data, doSuccess, doFail) { ...@@ -52,80 +81,118 @@ function getData(url, data, doSuccess, doFail) {
url: wx.getStorageSync('host') + url, url: wx.getStorageSync('host') + url,
header: { header: {
"content-type": "application/json;charset=UTF-8", "content-type": "application/json;charset=UTF-8",
"version": version, "token":'be3531e49c70444189d7511c7bb9602d'
token: 'a299f858af9d4bcc9f21836e3967f85b', // token: wx.getStorageSync('token'),
// version: wx.getStorageSync('version'),
// pvmodel:wx.getStorageSync('model'),
// pvversion: wx.getStorageSync('pvversion'),
// route:"xiaobenSport"
}, },
data: data, data: data,
method: 'GET', method: 'GET',
success: function (res) { success: function (res) {
if (res.data.code == 200) { if (res.data.code == 200) {
doSuccess(res.data); doSuccess(res.data);
}else if(res.data.code == 401){ } else if (res.data.code == 401){
wx.reLaunch({ wx.reLaunch({
url:'/pages/authorize/authorize' url:'/packageB/login/index/index'
}); });
} else { }else {
if (res.data.message) { doSuccess(res.data);
if (res.data.message && res.data.message.indexOf('token') != -1) {
wx.navigateTo({ url: '/pages/authorize/authorize' })
} else {
wx.showToast({ icon: 'none', title: res.data.message, duration: 2000 })
}
} else {
// wx.showToast({ icon: 'none', title: '服务器开小差了', duration: 2000 })
}
} }
}, },
fail: function (res) { fail: function (res) {
wx.showToast({ icon: 'none', title: '服务器开小差了', duration: 2000 }) wx.showToast({ icon: 'none', title: '网络异常,请重试', duration: 2000 })
doFail();
}, },
}) })
} }
//GET请求,不需传参,直接URL调用,
function getDataAll(url, data, doSuccess, doFail) { function getDataAll(url, data, doSuccess, doFail) {
wx.request({ wx.request({
url: wx.getStorageSync('host') + url, url: wx.getStorageSync('host') + url,
header: { header: {
"content-type": "application/json;charset=UTF-8", "content-type": "application/json;charset=UTF-8",
"version": version, "token":'be3531e49c70444189d7511c7bb9602d'
token: wx.getStorageSync('token'), // token: wx.getStorageSync('token'),
// version: wx.getStorageSync('version'),
// pvmodel:wx.getStorageSync('model'),
// pvversion: wx.getStorageSync('pvversion'),
// route:"xiaobenSport"
}, },
data: data, data: data,
method: 'GET', method: 'GET',
success: function (res) { success: function (res) {
if (res.data.code == 200) { if(res.data.code == 200){
doSuccess(res.data); doSuccess(res.data);
}else if(res.data.code == 401){ }else if(res.data.code == 401){
wx.reLaunch({ wx.reLaunch({
url:'/pages/authorize/authorize' url:'/packageB/login/index/index'
}); })
} else { }else{
if (res.data.message) { doSuccess(res.data);
if (res.data.message && res.data.message.indexOf('token') != -1) {
wx.navigateTo({ url: '/pages/authorize/authorize' })
} else {
doFail(res);
wx.showToast({ icon: 'none', title: res.data.message, duration: 2000 })
} }
} else { },
fail: function (res) {
doFail(res.data);
},
})
}
function del(url, data, doSuccess, doFail) {
wx.request({
url: wx.getStorageSync('host') + url,
header: {
"content-type": "application/json;charset=UTF-8",
"token":'be3531e49c70444189d7511c7bb9602d'
// token: wx.getStorageSync('token'),
// version: wx.getStorageSync('version'),
// pvmodel:wx.getStorageSync('model'),
// pvversion: wx.getStorageSync('pvversion'),
// route:"xiaobenSport"
},
// data: {},
method: 'DELETE',
success: function (res) {
doSuccess(res);
},
fail: function (res) {
doFail(res); doFail(res);
wx.showToast({ icon: 'none', title: '服务器开小差了', duration: 2000 })
} },
} })
}
function put(url, data, doSuccess, doFail) {
wx.request({
url: wx.getStorageSync('host') + url,
header: {
"content-type": "application/json;charset=UTF-8",
"token":'be3531e49c70444189d7511c7bb9602d'
// token: wx.getStorageSync('token'),
// version: wx.getStorageSync('version'),
// pvmodel:wx.getStorageSync('model'),
// pvversion: wx.getStorageSync('pvversion'),
// route:"xiaobenSport"
},
data: data,
method: 'PUT',
success: function (res) {
doSuccess(res);
}, },
fail: function (res) { fail: function (res) {
wx.showToast({ icon: 'none', title: '服务器开小差了', duration: 2000 }) doFail(res);
}, },
}) })
} }
function log(val){ function log(val) {
console.log(val); console.log(val);
} }
module.exports.requestAll = requestAll; module.exports.request = request;
module.exports.getData = getData; module.exports.getData = getData;
module.exports.getDataAll = getDataAll module.exports.getDataAll = getDataAll;
module.exports.requestAll = requestAll;
module.exports.del = del;
module.exports.put = put;
module.exports.log = log; module.exports.log = log;
This diff is collapsed. Click to expand it.
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