一個在微信小程序中創建表格的demo
?
效果圖
?
最后做出來大概就是這個樣子的,先看下設計圖:(畫的真好看)
設計圖
然后再看下數據返回的格式:
數據返回格式
這數據...o.0...
分析數據得知,后臺返回的數據遠比設計圖上描繪的復雜,內容是不固定的,而且需要顯示一周的排班
個人思路:用scroll-view來做,整個表格按 -行- 分為4大塊:排班、上午、下午、晚上。
? ? ①先將從今天開始往后7天的日期放到數組中,作為第一大塊的數據源
? ? ②循環遍歷數據,找出所有排班在上午的時間,然后分別放到7個數組中(因為可能有多個數據,還是需要用數組存放)
? ? ③同理得出下午和晚上的數據
?
1、第一步:更改數據格式,將數據處理之后變為如下形式:
第一大塊:weekArray:
? ? ? ? 存放從今天開始 -> 7天后的數據在數組中
第二、三、四大塊:sch_listData:
數據更改后
?
為什么要把數據變成這樣呢?總感覺這樣的方法有點傻,但又想不到別的辦法,所以先這樣吧,麻煩是麻煩了點,幸好最后的效果還不錯。
wxml:
<!-- 科室排班表 --><scroll-view scroll-x="true" class='scrollClass'><view class='table'><view class='table_header'><view class="th" style='width:130rpx;background-color:white'><view class='centerclass cell_label'>排班</view></view><block wx:for="{{dateArray}}"><view class='th'><view class="cell_label centerclass">{{item.weekName}}</view><view class="cell_date_label centerclass">{{item.date_text}}</view></view></block></view><block wx:for="{{sch_listData}}"><view class='table_main'><!--上午下午晚上 --><view class='td' style='width:130rpx;background-color:white;'><view class="cell_label centerclass">{{item.time_title}}</view></view><!-- 周一 --><view class='td'><block wx:for="{{item.Mon_text}}" wx:for-item="trade" wx:for-index="ind"><view class='{{item.Mon_text.length-1==ind? "table_Text_last_class":"table_Text_class"}}' bindtap='clickDoctor' data-docname='{{trade.docName}}' data-timeperiod='{{trade.timePeriod}}'data-dayOfWeek='{{trade.dayOfWeek}}'>{{trade.docName}}</view></block></view><!--周二 --><view class='td'><block wx:for="{{item.Tues_text}}" wx:for-item="trade" wx:for-index="ind"><view class='{{item.Tues_text.length-1==ind? "table_Text_last_class":"table_Text_class"}}' bindtap='clickDoctor' data-docname='{{trade.docName}}' data-timeperiod='{{trade.timePeriod}}'data-dayOfWeek='{{trade.dayOfWeek}}'>{{trade.docName}}</view></block></view><!--周三 --><view class='td'><block wx:for="{{item.Wed_text}}" wx:for-item="trade" wx:for-index="ind"><view class='{{item.Wed_text.length-1==ind? "table_Text_last_class":"table_Text_class"}}' bindtap='clickDoctor' data-docname='{{trade.docName}}' data-timeperiod='{{trade.timePeriod}}'data-dayOfWeek='{{trade.dayOfWeek}}'>{{trade.docName}}</view></block></view><!--周四 --><view class='td'><block wx:for="{{item.Thur_text}}" wx:for-item="trade" wx:for-index="ind"><view class='{{item.Thur_text.length-1==ind? "table_Text_last_class":"table_Text_class"}}' bindtap='clickDoctor' data-docname='{{trade.docName}}' data-timeperiod='{{trade.timePeriod}}'data-dayOfWeek='{{trade.dayOfWeek}}'>{{trade.docName}}</view></block></view><!--周五 --><view class='td'><block wx:for="{{item.Fri_text}}" wx:for-item="trade" wx:for-index="ind"><view class='{{item.Fri_text.length-1==ind? "table_Text_last_class":"table_Text_class"}}' bindtap='clickDoctor' data-docname='{{trade.docName}}' data-timeperiod='{{trade.timePeriod}}'data-dayOfWeek='{{trade.dayOfWeek}}'>{{trade.docName}}</view></block></view><!--周六 --><view class='td'><block wx:for="{{item.Sat_text}}" wx:for-item="trade" wx:for-index="ind"><view class='{{item.Sat_text.length-1==ind? "table_Text_last_class":"table_Text_class"}}' bindtap='clickDoctor' data-docname='{{trade.docName}}' data-timeperiod='{{trade.timePeriod}}'data-dayOfWeek='{{trade.dayOfWeek}}'>{{trade.docName}}</view></block></view><!-- 周日 --><view class='td'><block wx:for="{{item.Sun_text}}" wx:for-item="trade" wx:for-index="ind"><view class='{{item.Sun_text.length-1==ind? "table_Text_last_class":"table_Text_class"}}' bindtap='clickDoctor' data-docname='{{trade.docName}}' data-timeperiod='{{trade.timePeriod}}'data-dayOfWeek='{{trade.dayOfWeek}}'>{{trade.docName}}</view></block></view></view></block></view>
</scroll-view>
?
wxss:
?
/*科室排班表 */
.table{display: inline-flex;flex-direction: column;border: 1rpx solid rgba(218, 217, 217, 1);border-bottom: 0;
}.scrollClass {display: flex;width: 100%;white-space: nowrap;margin-top: 23px;height: 100%;background-color: white;
}.table_header {display: inline-flex;
}.th {display: flex;flex-direction: column;width: 200rpx;height: 90rpx;background: rgba(241, 252, 255, 1);border-right: 1rpx solid rgba(218, 217, 217, 1); border-bottom: 1rpx solid rgba(218, 217, 217, 1); justify-content: center;align-items: center;overflow-x: auto;
}
.cell_label{font-size: 26rpx;color: rgba(74, 74, 74, 1);
}
.cell_date_label{font-size: 20rpx;color: rgba(74, 74, 74, 1);
}
.table_main {display: inline-flex;flex-direction: row;
}
.right-item{display: flex;flex-direction: row;
}
.td {display: flex;flex-direction: column;width: 200rpx;/* height: 90rpx; */background: white;justify-content: center;align-items: center;border: 1rpx solid rgba(218, 217, 217, 1);border-top: 0;border-left:0;
}.table_Text_class {display: flex;justify-content: center;align-items: center;height: 60rpx;font-size: 30rpx;color: rgba(55, 134, 244, 1);width: 100%;word-break: normal;border-bottom: 1rpx solid rgba(218, 217, 217, 1);
}
.table_Text_last_class{display: flex;justify-content: center;align-items: center;height: 60rpx;font-size: 30rpx;color: rgba(55, 134, 244, 1);width: 100%;word-break: normal;
}
js:
?
var weeksArray = [];var GetDepartment_info = function (that) {var urlStr = 'http://123.56.180.48:9080/jklApi/rest/' + 'goldDepartment/getHomePageData/' + '8a819ee651431b2701514386fa050008';console.log('科室詳情的url:' + urlStr);wx.request({url: urlStr,method: "GET",header: {'content-type': 'application/x-www-form-urlencoded','mhealthkey': '1'},success: function (res) {console.log("科室詳情:" + JSON.stringify(res));var sList = res.data.data.scheduleInfo;var sch_listData = dealData(sList);that.setData({sch_listData: sch_listData,});},fail: function (e) {that.setData({loadingHidden: true,})}})
}Page({/*** 頁面的初始數據*/data: {sch_listData: [],dateArray: [],},/*** 生命周期函數--監聽頁面加載*/onLoad: function (options) {var scheduleList = [{"scheduleId": "8aaf510c5e3de339015e3de932660000","resourceName": "專科門診","dayOfWeek": "1","timePeriod": "A","docName": "醫生C","doctorId": "8a2256334b021c33014b06124fd60181","ifOpenYuYueService": "0"},{"scheduleId": "8aaf510c60c6700b0160de3031f40598","resourceName": "普通門診","dayOfWeek": "1","timePeriod": "A","docName": "測試李醫生","doctorId": "8a2256334c265f88014c26d521fc0103","ifOpenYuYueService": "0"},{"scheduleId": "ff80808162a3453f0162a3f036440000","resourceName": "普通門診","dayOfWeek": "1","timePeriod": "A","docName": "趙醫生","doctorId": "8aaf510c53f56ee0015432b3ee760e22","ifOpenYuYueService": "0"},{"scheduleId": "ff8080815e36ffb0015e375d3d850006","resourceName": "專家門診","dayOfWeek": "1","timePeriod": "B","docName": "測試李醫生","doctorId": "8a2256334c265f88014c26d521fc0103","ifOpenYuYueService": "0"},{"scheduleId": "8aaf510c5e0ddfd6015e2d4e85290288","resourceName": "特需門診","dayOfWeek": "1","timePeriod": "B","docName": "醫生A","doctorId": "8a2256334888ffb301488b90a3fe005f","ifOpenYuYueService": "0"},{"scheduleId": "02f18a9c0a374b4184f35b40a9dde3f0","resourceName": "專家門診","dayOfWeek": "1","timePeriod": "B","docName": "醫生C","doctorId": "8a2256334b021c33014b06124fd60181","ifOpenYuYueService": "0"},{"scheduleId": "ff80808160ea422a0160ea4f6fb10001","resourceName": "普通門診","dayOfWeek": "1","timePeriod": "C","docName": "測試李醫生","doctorId": "8a2256334c265f88014c26d521fc0103","ifOpenYuYueService": "0"},{"scheduleId": "ff80808160e90a3e0160e93c9f6e001e","resourceName": "普通門診","dayOfWeek": "1","timePeriod": "C","docName": "醫生C","doctorId": "8a2256334b021c33014b06124fd60181","ifOpenYuYueService": "0"},{"scheduleId": "e34f2c6fbb134e408d67ee212b66173d","resourceName": "專科門診","dayOfWeek": "2","timePeriod": "A","docName": "測試李醫生","doctorId": "8a2256334c265f88014c26d521fc0103","ifOpenYuYueService": "0"},{"scheduleId": "72dd38ee6dad423884ba5075ca067365","resourceName": "其他門診","dayOfWeek": "2","timePeriod": "A","docName": "醫生C","doctorId": "8a2256334b021c33014b06124fd60181","ifOpenYuYueService": "0"},{"scheduleId": "ff8080815e3c5c70015e3dc12bd20002","resourceName": "普通門診","dayOfWeek": "2","timePeriod": "B","docName": "醫生C","doctorId": "8a2256334b021c33014b06124fd60181","ifOpenYuYueService": "0"},{"scheduleId": "ff8080815de9c956015dea16c0fd004e","resourceName": "特需門診","dayOfWeek": "2","timePeriod": "B","docName": "醫生A","doctorId": "8a2256334888ffb301488b90a3fe005f","ifOpenYuYueService": "0"},{"scheduleId": "8aaf510c6290b5390162913c56de00fc","resourceName": "普通門診","dayOfWeek": "2","timePeriod": "C","docName": "測試李醫生","doctorId": "8a2256334c265f88014c26d521fc0103","ifOpenYuYueService": "0"},{"scheduleId": "ff8080816121c47e0161224a13d20006","resourceName": "普通門診","dayOfWeek": "2","timePeriod": "C","docName": "醫生C","doctorId": "8a2256334b021c33014b06124fd60181","ifOpenYuYueService": "0"},{"scheduleId": "0ab98c9b1c874162b7b0c3797ff74759","resourceName": "特需門診","dayOfWeek": "3","timePeriod": "A","docName": "醫生C","doctorId": "8a2256334b021c33014b06124fd60181","ifOpenYuYueService": "0"},{"scheduleId": "402881b05de9c5c4015dea11d62d000d","resourceName": "普通門診","dayOfWeek": "3","timePeriod": "A","docName": "測試李醫生","doctorId": "8a2256334c265f88014c26d521fc0103","ifOpenYuYueService": "0"},{"scheduleId": "ff8080815e3782fc015e37a3b23e0006","resourceName": "普通門診","dayOfWeek": "3","timePeriod": "B","docName": "測試李醫生","doctorId": "8a2256334c265f88014c26d521fc0103","ifOpenYuYueService": "0"},{"scheduleId": "5d253a9c81004bc4827cc06c4ff55182","resourceName": "普通門診","dayOfWeek": "3","timePeriod": "B","docName": "醫生C","doctorId": "8a2256334b021c33014b06124fd60181","ifOpenYuYueService": "0"},{"scheduleId": "8aaf510c62745ce401627479421d0001","resourceName": "特需門診","dayOfWeek": "3","timePeriod": "C","docName": "醫生C","doctorId": "8a2256334b021c33014b06124fd60181","ifOpenYuYueService": "0"},{"scheduleId": "ad566119a9804d63885b3f6e7f52b1eb","resourceName": "專家門診","dayOfWeek": "4","timePeriod": "A","docName": "醫生C","doctorId": "8a2256334b021c33014b06124fd60181","ifOpenYuYueService": "0"},{"scheduleId": "b79212dbeed74df380e0436f24af2a29","resourceName": "其他門診","dayOfWeek": "4","timePeriod": "A","docName": "測試李醫生","doctorId": "8a2256334c265f88014c26d521fc0103","ifOpenYuYueService": "0"},{"scheduleId": "81d4a516809140f08d9ce2fc3cc37836","resourceName": "特需門診","dayOfWeek": "4","timePeriod": "B","docName": "醫生C","doctorId": "8a2256334b021c33014b06124fd60181","ifOpenYuYueService": "0"},{"scheduleId": "6c6cdaf06adc4f9f9e32446daa84d143","resourceName": "特需門診","dayOfWeek": "4","timePeriod": "B","docName": "測試李醫生","doctorId": "8a2256334c265f88014c26d521fc0103","ifOpenYuYueService": "0"},{"scheduleId": "8aaf510c5dfab03a015e08caafa8004f","resourceName": "特需門診","dayOfWeek": "5","timePeriod": "A","docName": "醫生A","doctorId": "8a2256334888ffb301488b90a3fe005f","ifOpenYuYueService": "0"},{"scheduleId": "47f8bbc4be8c4e21af23cb89c74ad796","resourceName": "專科門診","dayOfWeek": "5","timePeriod": "A","docName": "醫生C","doctorId": "8a2256334b021c33014b06124fd60181","ifOpenYuYueService": "0"},{"scheduleId": "8aaf510c5e3370ed015e33d3d8810033","resourceName": "專家門診","dayOfWeek": "5","timePeriod": "A","docName": "測試李醫生","doctorId": "8a2256334c265f88014c26d521fc0103","ifOpenYuYueService": "0"},{"scheduleId": "8aaf510c5dfab03a015e08cadcd10054","resourceName": "特需門診","dayOfWeek": "5","timePeriod": "B","docName": "醫生A","doctorId": "8a2256334888ffb301488b90a3fe005f","ifOpenYuYueService": "0"},{"scheduleId": "6f2e45a9d60c479eadfe4406ff7ac8b0","resourceName": "會診中心","dayOfWeek": "5","timePeriod": "B","docName": "測試李醫生","doctorId": "8a2256334c265f88014c26d521fc0103","ifOpenYuYueService": "0"},{"scheduleId": "8aaf510c5eae93dc015eb78056a60001","resourceName": "普通門診","dayOfWeek": "5","timePeriod": "B","docName": "醫生C","doctorId": "8a2256334b021c33014b06124fd60181","ifOpenYuYueService": "0"},{"scheduleId": "9ee899faebbc4cf68139aca8631b7892","resourceName": "夜間會診","dayOfWeek": "5","timePeriod": "C","docName": "測試李醫生","doctorId": "8a2256334c265f88014c26d521fc0103","ifOpenYuYueService": "0"},{"scheduleId": "8aaf510c5ebe5987015ec1e393840158","resourceName": "普通門診","dayOfWeek": "6","timePeriod": "A","docName": "醫生C","doctorId": "8a2256334b021c33014b06124fd60181","ifOpenYuYueService": "0"},{"scheduleId": "8f8522911a484a0d9ca14ab109957fef","resourceName": "普通門診","dayOfWeek": "6","timePeriod": "A","docName": "測試李醫生","doctorId": "8a2256334c265f88014c26d521fc0103","ifOpenYuYueService": "0"},{"scheduleId": "fbc1c442ca3f11e4b00300163e004c9f","resourceName": "特需門診","dayOfWeek": "6","timePeriod": "A","docName": "醫生A","doctorId": "8a2256334888ffb301488b90a3fe005f","ifOpenYuYueService": "0"},{"scheduleId": "8aaf510c6253714201626153a8fb074a","resourceName": "預約掛號","dayOfWeek": "6","timePeriod": "B","docName": "測試李醫生","doctorId": "8a2256334c265f88014c26d521fc0103","ifOpenYuYueService": "0"},{"scheduleId": "f777b64a9b224520920c34de26662934","resourceName": "其他門診","dayOfWeek": "6","timePeriod": "B","docName": "醫生A","doctorId": "8a2256334888ffb301488b90a3fe005f","ifOpenYuYueService": "0"},{"scheduleId": "8aaf510c5e0a27d6015e0a3043920009","resourceName": "特需門診","dayOfWeek": "6","timePeriod": "C","docName": "醫生A","doctorId": "8a2256334888ffb301488b90a3fe005f","ifOpenYuYueService": "0"},{"scheduleId": "699b23a064b0462890343c3f3fd2749b","resourceName": "專科門診","dayOfWeek": "7","timePeriod": "B","docName": "醫生A","doctorId": "8a2256334888ffb301488b90a3fe005f","ifOpenYuYueService": "0"}];for (var j = 0; j < scheduleList.length; j++) {console.log('----' + scheduleList[j].docName);}var daysArray = getSevenDays();var sch_listData = dealData(scheduleList);this.setData({dateArray: daysArray,sch_listData: sch_listData,});},/*** 生命周期函數--監聽頁面初次渲染完成*/onReady: function () {},/*** 生命周期函數--監聽頁面顯示*/onShow: function () {// var that = this;// GetDepartment_info(that);},/*** 生命周期函數--監聽頁面隱藏*/onHide: function () {},/*** 生命周期函數--監聽頁面卸載*/onUnload: function () {},/*** 頁面相關事件處理函數--監聽用戶下拉動作*/onPullDownRefresh: function () {},/*** 頁面上拉觸底事件的處理函數*/onReachBottom: function () {},/*** 用戶點擊右上角分享*/onShareAppMessage: function () {},clickDoctor: function (e) {var $dict = e.currentTarget.dataset;var tag = $dict.dayofweek;//周幾var appdate = '';for (var k = 0; k < weeksArray.length; k++) {if (weeksArray[k].weekNum == tag - 1) {appdate = weeksArray[k].date_text;}}var dd = new Date();appdate = dd.getFullYear() + '/' + appdate;var str = '';var timeStr = $dict.timeperiod;if (timeStr=="A"){timeStr = '上午';} else if (timeStr=="B"){timeStr = '下午';}else{timeStr = '晚上';}str = appdate + ' ' + timeStr + ' '+$dict.docname;wx.showModal({title: '提示',content: str,success: function (res) {if (res.confirm) {console.log('用戶點擊確定')}}})},})var getSevenDays = function () {var daysArray = [];var dayDict = {};var weekStr = '';var weekNum = '';for (var i = 0; i < 7; i++) {var date = new Date(); //當前日期var newDate = new Date();newDate.setDate(date.getDate() + i);var m = (newDate.getMonth() + 1) < 10 ? "0" + (newDate.getMonth() + 1) : (newDate.getMonth() + 1);var d = newDate.getDate() < 10 ? "0" + newDate.getDate() : newDate.getDate();var time = newDate.getFullYear() + "-" + m + "-" + d;var dayStr = m + "/" + d;if (getWeekByDay(time) == '周一') {weekNum = 0;} else if (getWeekByDay(time) == '周二') {weekNum = 1;} else if (getWeekByDay(time) == '周三') {weekNum = 2;} else if (getWeekByDay(time) == '周四') {weekNum = 3;} else if (getWeekByDay(time) == '周五') {weekNum = 4;} else if (getWeekByDay(time) == '周六') {weekNum = 5;} else if (getWeekByDay(time) == '周日') {weekNum = 6;}dayDict = { "date_text": dayStr, "weekName": getWeekByDay(time), "weekNum": weekNum };console.log("date_text:" + dayStr + "weekName:" + getWeekByDay(time) + "weekNum:" + weekNum)daysArray.push(dayDict);}weeksArray = daysArray;return daysArray;
}var getWeekByDay = function (dayValue) {var day = new Date(Date.parse(dayValue.replace(/-/g, '/'))); //將日期值格式化 var today = new Array("周日", "周一", "周二", "周三", "周四", "周五", "周六"); //創建星期數組 return today[day.getDay()]; //返一個星期中的某一天,其中0為星期日
}var dealData = function (scheduleInfoList) {var tag = weeksArray[0].weekNum;console.log('tag:' + tag);var ar = [1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7];var A_Mon_text_ar = [];var A_Tues_text_ar = [];var A_Wed_text_ar = [];var A_Thur_text_ar = [];var A_Fri_text_ar = [];var A_Sat_text_ar = [];var A_Sun_text_ar = [];var B_Mon_text_ar = [];var B_Tues_text_ar = [];var B_Wed_text_ar = [];var B_Thur_text_ar = [];var B_Fri_text_ar = [];var B_Sat_text_ar = [];var B_Sun_text_ar = [];var C_Mon_text_ar = [];var C_Tues_text_ar = [];var C_Wed_text_ar = [];var C_Thur_text_ar = [];var C_Fri_text_ar = [];var C_Sat_text_ar = [];var C_Sun_text_ar = [];for (var i = 0; i < scheduleInfoList.length; i++) {// console.log(scheduleInfoList[i].scheduleId + "222222");if (scheduleInfoList[i].timePeriod == 'A') {if (scheduleInfoList[i].dayOfWeek == ar[tag]) {A_Mon_text_ar = A_Mon_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 1]) {A_Tues_text_ar = A_Tues_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 2]) {A_Wed_text_ar = A_Wed_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 3]) {A_Thur_text_ar = A_Thur_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 4]) {A_Fri_text_ar = A_Fri_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 5]) {A_Sat_text_ar = A_Sat_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 6]) {A_Sun_text_ar = A_Sun_text_ar.concat(scheduleInfoList[i]);}}else if (scheduleInfoList[i].timePeriod == 'B') {if (scheduleInfoList[i].dayOfWeek == ar[tag]) {B_Mon_text_ar = B_Mon_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 1]) {B_Tues_text_ar = B_Tues_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 2]) {B_Wed_text_ar = B_Wed_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 3]) {B_Thur_text_ar = B_Thur_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 4]) {B_Fri_text_ar = B_Fri_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 5]) {B_Sat_text_ar = B_Sat_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 6]) {B_Sun_text_ar = B_Sun_text_ar.concat(scheduleInfoList[i]);}} else {if (scheduleInfoList[i].dayOfWeek == ar[tag]) {C_Mon_text_ar = C_Mon_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 1]) {C_Tues_text_ar = C_Tues_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 2]) {C_Wed_text_ar = C_Wed_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 3]) {C_Thur_text_ar = C_Thur_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 4]) {C_Fri_text_ar = C_Fri_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 5]) {C_Sat_text_ar = C_Sat_text_ar.concat(scheduleInfoList[i]);} else if (scheduleInfoList[i].dayOfWeek == ar[tag + 6]) {C_Sun_text_ar = C_Sun_text_ar.concat(scheduleInfoList[i]);}}}var sch_listData = [{ "time_title": "上午", "Mon_text": A_Mon_text_ar, "Tues_text": A_Tues_text_ar, "Wed_text": A_Wed_text_ar, "Thur_text": A_Thur_text_ar, "Fri_text": A_Fri_text_ar, "Sat_text": A_Sat_text_ar, "Sun_text": A_Sun_text_ar },{ "time_title": "下午", "Mon_text": B_Mon_text_ar, "Tues_text": B_Tues_text_ar, "Wed_text": B_Wed_text_ar, "Thur_text": B_Thur_text_ar, "Fri_text": B_Fri_text_ar, "Sat_text": B_Sat_text_ar, "Sun_text": B_Sun_text_ar },{ "time_title": "晚上", "Mon_text": C_Mon_text_ar, "Tues_text": C_Tues_text_ar, "Wed_text": C_Wed_text_ar, "Thur_text": C_Thur_text_ar, "Fri_text": C_Fri_text_ar, "Sat_text": C_Sat_text_ar, "Sun_text": C_Sun_text_ar }]return sch_listData;
}
代碼傳圖片太麻煩了,有需要的朋友去Git下載吧,
GitHub地址
?
小程序菜鳥,如果小小的踩坑經驗能幫到你,記得給點小鼓勵,謝謝支持~
如果你感覺有收獲,歡迎給我打賞 ———— 以激勵我輸出更多優質內容
?
總結
以上是生活随笔為你收集整理的微信小程序:好看的表格样式的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。