123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- const Parse = getApp().Parse;
- const company = getApp().globalData.company;
- Page({
-
- data: {
-
- statusBarHeight: 0,
- screenHeight: 0,
- customHeight: 0,
- bottomNavHeight: 0,
- contentHeight: 0,
- navheight: 0,
- radio: '5000',
- },
-
- onLoad: function (options) {
- const systemInfo = wx.getSystemInfoSync();
- const statusBarHeight = systemInfo.statusBarHeight || 0;
- const screenHeight = systemInfo.screenHeight || 0;
- const custom = wx.getMenuButtonBoundingClientRect();
- const customHeight = custom.height + 10 + 2 || 0;
- const bottomNavHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom || 0;
- const navheight = (statusBarHeight + customHeight) * 750 / systemInfo.windowWidth;
- const contentHeight = (screenHeight - bottomNavHeight - statusBarHeight - customHeight) * 750 / systemInfo.windowWidth;
- this.setData({
- statusBarHeight,
- screenHeight,
- customHeight,
- bottomNavHeight,
- contentHeight,
- navheight
- });
- },
-
- onReady: function () {
- },
-
- onShow: function () {
- },
-
- onHide: function () {
- },
-
- onUnload: function () {
- },
-
- onPullDownRefresh: function () {
- },
-
- onReachBottom: function () {
- },
-
- onShareAppMessage: function () {
- },
-
- goback() {
-
-
-
-
-
-
-
- wx.navigateBack({
- delta: 1
- });
- },
- onChange(event) {
- this.setData({
- radio: event.detail,
- });
- console.log(this.data.radio);
- },
- async submit() {
- const currentUser2 = Parse.User.current();
- let userquery2 = new Parse.Query('_User');
- userquery2.equalTo('company', company);
- userquery2.equalTo('objectId', currentUser2.id);
- userquery2.notEqualTo('isDeleted', true)
- let user2 = await userquery2.first();
- user2.set('num', Number(this.data.radio))
- try {
- let saveDate2 = await user2.save();
- console.log(saveDate2);
- let pages = getCurrentPages();
- console.log(pages);
- let prevpage = pages[pages.length - 2];
- console.log(prevpage);
- await prevpage.updateCom2()
- wx.navigateBack({
- delta: 1
- });
- console.log("目标步数更改成功");
- } catch (error) {
- console.error("保存数据时出现错误:", error);
- }
- }
- })
|