|
@@ -42,46 +42,10 @@
|
|
|
</li>
|
|
|
</ul>
|
|
|
<ul class="mui-table-view mui-grid-view mui-grid-9">
|
|
|
- <li class="mui-table-view-cell mui-media">
|
|
|
- <a href="#" class="mui-active">
|
|
|
- <span>11</span>
|
|
|
- <div class="mui-media-body">正常用药</div>
|
|
|
- </a>
|
|
|
- </li>
|
|
|
- <li class="mui-table-view-cell mui-media">
|
|
|
- <a href="#">
|
|
|
- <span>12</span>
|
|
|
- <div class="mui-media-body">正常用药</div>
|
|
|
- </a>
|
|
|
- </li>
|
|
|
- <li class="mui-table-view-cell mui-media">
|
|
|
- <a href="#">
|
|
|
- <span>13</span>
|
|
|
- <div class="mui-media-body">正常用药</div>
|
|
|
- </a>
|
|
|
- </li>
|
|
|
- <li class="mui-table-view-cell mui-media">
|
|
|
- <a href="#">
|
|
|
- <span>14</span>
|
|
|
- <div class="mui-media-body">正常用药</div>
|
|
|
- </a>
|
|
|
- </li>
|
|
|
- <li class="mui-table-view-cell mui-media">
|
|
|
- <a href="#">
|
|
|
- <span>15</span>
|
|
|
- <div class="mui-media-body">正常用药</div>
|
|
|
- </a>
|
|
|
- </li>
|
|
|
- <li class="mui-table-view-cell mui-media">
|
|
|
- <a href="#">
|
|
|
- <span>16</span>
|
|
|
- <div class="mui-media-body">正常用药</div>
|
|
|
- </a>
|
|
|
- </li>
|
|
|
- <li class="mui-table-view-cell mui-media">
|
|
|
- <a href="#">
|
|
|
- <span>17</span>
|
|
|
- <div class="mui-media-body color999">停药</div>
|
|
|
+ <li v-for="(item,index) in weekDayList" class="mui-table-view-cell mui-media">
|
|
|
+ <a :class="today==item?'mui-active':''">
|
|
|
+ <span v-text="getDay(item)"></span>
|
|
|
+ <div :class="'mui-media-body '+(titleStr(item)=='停药'?'color999':'')" v-text="titleStr(item)"></div>
|
|
|
</a>
|
|
|
</li>
|
|
|
</ul>
|
|
@@ -133,7 +97,11 @@
|
|
|
} from 'vuex'
|
|
|
import {
|
|
|
getWeekTime,
|
|
|
- getDiffDate
|
|
|
+ getDiffDate,
|
|
|
+ currentTimeStamp,
|
|
|
+ parseUnixTime,
|
|
|
+ unixTimeStamp,
|
|
|
+ inDateBetwen
|
|
|
} from '$project/utils'
|
|
|
export default {
|
|
|
name: 'MasterDrug',
|
|
@@ -158,6 +126,8 @@
|
|
|
timeList: [],
|
|
|
allList: [],
|
|
|
|
|
|
+ monthList: []
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
created() {},
|
|
@@ -254,13 +224,33 @@
|
|
|
API_Drug.medicationCalendar().then(response => {
|
|
|
this.isLoading = false;
|
|
|
|
|
|
- //this.list = response.list;
|
|
|
+ this.monthList = response.list;
|
|
|
|
|
|
}).catch(error => {
|
|
|
this.isLoading = false;
|
|
|
mui.toast(error);
|
|
|
})
|
|
|
},
|
|
|
+ //获取日
|
|
|
+ getDay(date) {
|
|
|
+ return parseUnixTime(unixTimeStamp(date), '{d}');
|
|
|
+ },
|
|
|
+ //显示title
|
|
|
+ titleStr(date) {
|
|
|
+ var monthList = this.monthList;
|
|
|
+ if (monthList.length) {
|
|
|
+ for (var i = 0; i < monthList.length; i++) {
|
|
|
+ if (monthList[i]['name'] == date) {
|
|
|
+ return '正常用药';
|
|
|
+ } else if (inDateBetwen(date, monthList[0]['name'], monthList[monthList.length - 1]['name'])) {
|
|
|
+ return '停药';
|
|
|
+ } else {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return '';
|
|
|
+ },
|
|
|
asynCallBack() {
|
|
|
|
|
|
},
|
|
@@ -288,6 +278,16 @@
|
|
|
console.log(newValue)
|
|
|
}
|
|
|
},
|
|
|
+ today: {
|
|
|
+ // getter
|
|
|
+ get: function() {
|
|
|
+ return parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}');
|
|
|
+ },
|
|
|
+ // setter
|
|
|
+ set: function(newValue) {
|
|
|
+ console.log(newValue)
|
|
|
+ }
|
|
|
+ },
|
|
|
...mapGetters({
|
|
|
openId: 'wx_openid',
|
|
|
token: 'token',
|