Commit e009b253 by tangjiale

更新代码

parent aa6ff24a
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 16:44:43
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-13 09:57:53
* @LastEditTime: 2022-06-13 14:10:54
*/
var app = getApp();
var API = require("../../utils/request.js");
......@@ -13,7 +13,13 @@ Page({
data: {
userInfo: {},
tabs:[]
tabs:[],
sportCalorie:'', //消耗千卡
sportTotalDay: '', //累计天数
sportTime: '', //总时长
todayInfo:[],//今日运动信息
todaySportTime:0,
},
onLoad: function (options) {
......@@ -26,6 +32,9 @@ Page({
selected: 2
})
}
this.getDataList()
this.sportStatTotal();
},
//跳转到运动记录页面
......@@ -39,4 +48,33 @@ Page({
url: '../../subPages/sport/sportTime/sportTime?type=2',
})
},
//获取运动日记录
getDataList(){
var that = this;
API.getData('/project/getDataList', {
dateType:"day",
page:1,
size:1
}, (res) => {
console.log('当天的运动记录',res)
that.setData({
todaySportTime:parseInt(res.data[0].sportTime/60),
todayInfo:res.data[0]
})
})
},
//获取运动时长 千卡 累计
sportStatTotal() {
var that = this;
API.getData('/project/getTotalData', {}, (res) => {
//console.log('获取总运动时长 千卡 累计',res);
that.setData({
sportCalorie: res.data.calorie,
sportTime: parseInt(res.data.sportTime / 60),
sportTotalDay: res.data.joinDayNum
})
}, function () {
wx.hideLoading()
});
},
})
\ No newline at end of file
......@@ -3,29 +3,52 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-13 08:57:51
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-13 08:58:38
* @LastEditTime: 2022-06-13 19:42:49
*/
var API = require("../../../utils/request.js");
Page({
/**
* 页面的初始数据
*/
data: {
courseDetail:{},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.makePhoneCall({
phoneNumber: '1340000' //仅为示例,并非真实的电话号码
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.queryCourseDetail(options.id)
},
//收藏/取消收藏
courseCollect(){
API.getData('/px/course/getMobileCourseList', {
id:that.data.page,
opType:1, //1:收藏,2:取消收藏
}, (res) => {
})
},
queryCourseDetail(){
let that = this
API.getData('/px/course/getMobileCourseInfo', {
id:that.data.page,
}, (res) => {
that.setData({courseDetail:res})
})
}
})
\ No newline at end of file
......@@ -3,9 +3,9 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-13 08:59:17
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-13 09:21:46
* @LastEditTime: 2022-06-13 19:52:21
*/
// subPages/course/pay/pay.js
var API = require("../../../utils/request.js");
Page({
/**
......@@ -13,8 +13,12 @@ Page({
*/
data: {
param:{
stuName:'',
stuName:'超人霍华德', //姓名
gender:1, //性别
phone:13975487978,
schId:2, //所在校区
courserId:17095, //课程id
releationShip:1, //关系
}
},
......@@ -38,39 +42,17 @@ Page({
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
callMan(){
wx.makePhoneCall({
phoneNumber: '13975487978' //仅为示例,并非真实的电话号码
})
},
payOrder(){
let that = this
API.requestAll('/px/order/addTyOrder', that.data.param,function (res) {
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
})
}
})
\ No newline at end of file
......@@ -3,4 +3,6 @@
<!-- 支付订单 -->
支付订单
<view class="" bindtap="payOrder">支付</view>
<view class="" bindtap="callMan">打电话</view>
</view>
\ No newline at end of file
......@@ -3,7 +3,7 @@
* @eMail: 932055106@qq.com
* @Date: 2022-06-06 15:52:31
* @LastEditors: tangjiale
* @LastEditTime: 2022-06-11 16:13:22
* @LastEditTime: 2022-06-13 19:32:55
*/
var API = require("../../../utils/request.js");
var postData = {};
......
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