// pages/order/show/index.js let app = getApp(); import commonApi from "../../../utils/https/common" import util from "../../../utils/util" Page({ /** * 页面的初始数据 */ data: { times:[], product:null, dateindex:-1, timeindex:-1 }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { let product = app.globalData.product,start_date = util.formatDate(new Date()); this.setData({ product:product }) let end_date = util.formatDate(new Date(new Date(start_date.replace(/-/g,'/')).getTime() + 30 * 24 * 60 * 60 * 1000)); commonApi.user_post("show/get_show_sku_seats_price_by_date",{ sku_id:product.sku[0].id, start_date:start_date, end_date:end_date }).then(res=>{ let dateindex = -1,timeindex=-1; for(let i=0;i