123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- const app = getApp()
- const util = require("../../../utils/util");
- const api = require('../../../api/api.js');
- const user = require('../../../utils/user.js');
- // const update = require('../../../api/update.js');
- Page({
- data: {
- firstDate:'请选择',
- serviceTimes:'请选择',
- serviceFrequency:'请选择',
- currentDate:new Date().getTime(),
- showPicker:false,
- datePicker:false,
- columns:[],
- serviceTimesCol:['4','24'],
- serviceFrequencyCol:['一周一次','两周一次'],
- scheduleData:{
- mastUseCount:'',
- otherUseCount:'',
- unUseCount:'',
- monthData:[],
- },
- scheduleList:[
- {
- month:'2022年10月',
- amount:'2',
- list:[
- {
- date:'14日',
- tips:'我有档期'
- },
- {
- date:'21日',
- tips:'我有档期'
- }
- ]
- },
- {
- month:'2022年11月',
- amount:'4',
- list:[
- {
- date:'1日',
- tips:'我有档期'
- },
- {
- date:'7日',
- tips:'我有档期'
- },
- {
- date:'14日',
- tips:'其他姐妹'
- },
- {
- date:'21日',
- tips:'无档期'
- }
- ]
- },
- {
- month:'2022年12月',
- amount:'4',
- list:[
- {
- date:'1日',
- tips:'我有档期'
- },
- {
- date:'7日',
- tips:'我有档期'
- },
- {
- date:'14日',
- tips:'其他姐妹'
- },
- {
- date:'21日',
- tips:'无档期'
- }
- ]
- }
- ]
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
-
- },
- selectTimes(){
- },
-
- onDateInput(e){
- console.log(e);
- this.setData({
- currentDate:e.detail
- });
- },
- dateSelect(){
- this.setData({
- showPicker:true,
- datePicker:true
- })
- }
- ,
- dateCancel(){
- this.setData({
- showPicker:false
- })
- },
- dateConfirm(){
- this.setData({
- firstDate:util.formetdate(new Date(this.data.currentDate)),
- showPicker:false
- })
- },
- serviceTimesTap(){
- this.setData({
- showPicker:true,
- datePicker:false,
- columns:this.data.serviceTimesCol
- });
- },
- frequencySelect(){
- this.setData({
- showPicker:true,
- datePicker:false,
- columns:this.data.serviceFrequencyCol
- })
- },
- pickerCancel(){
- this.setData({
- showPicker:false,
- })
- },
- pickerConfirm(e){
- console.log(e);
- if(this.data.columns==this.data.serviceTimesCol){
- this.setData({
- serviceTimes:e.detail.value,
- showPicker:false,
- });
- }else{
- this.setData({
- serviceFrequency:e.detail.value,
- showPicker:false
- })
- }
-
- },
- caclSchedule(){
- if(this.data.serviceTimes=='请选择'){
- wx.showToast({
- title: '请选择服务次数',
- icon: 'none'
- });
- return false;
- }else if(this.data.firstDate=='请选择'){
- wx.showToast({
- title: '请选择首次时间',
- icon: 'none'
- });
- return false;
- }else if(this.data.serviceFrequency=='请选择'){
- wx.showToast({
- title: '请选择服务频率',
- icon: 'none'
- });
- return false;
- }else{
- wx.showLoading({
- title: '加载中...',
- });
- util.request(api.computerWorkerSchedule, {
- firstDate: this.data.firstDate,
- serviceTimes:this.data.serviceTimes,
- pinlv:this.data.serviceFrequency=='一周一次'?'7':'14'
-
- }, 'GET').then(res=> {
- wx.hideLoading();
- if (res.errno === 0) {
- console.log(res);
- this.setData({
- scheduleData:res.data
- });
- }
- }).catch(err=>{
- wx.hideLoading();
- });
- }
- },
- onReachBottom() {
- // if (this.data.totalPages > this.data.page) {
- // this.setData({
- // page: this.data.page + 1
- // });
- // this.getGoodsList();
- // } else {
- // wx.showToast({
- // title: '没有更多商品了',
- // icon: 'none',
- // duration: 2000
- // });
- // return false;
- // }
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
-
-
- },
-
- onHide: function () {
- },
- onUnload: function () {
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- },
-
- })
|