var app = getApp(); const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} const Http = require("../../utils/HttpBasics"); const config = require("../../config/config.js"); Page({ /** * 页面的初始数据 */ data: { navigationBarHeight, num:1, showShade:true, }, addNum(){ let num = this.data.num if(this.data.num>=10){ wx.showToast({ title: '购买总数超库存', icon: 'none', duration: 2000, }) }else{ num = num + 1 this.setData({ num: num }) } }, dleNum(){ let num = this.data.num if (this.data.num <=1){ wx.showToast({ title: '购买总数不能为0', icon: 'none', duration: 2000, }) }else{ num = num - 1 this.setData({ num: num }) } }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })