技师等级
This commit is contained in:
parent
f585c99095
commit
2a408b2706
|
@ -0,0 +1,220 @@
|
||||||
|
<!--
|
||||||
|
* @Description: 时间选择
|
||||||
|
* @Author: hjh
|
||||||
|
* @Date: 2019-08-17 23:19:32
|
||||||
|
* @LastEditors: hjh
|
||||||
|
* @LastEditTime: 2019-08-19 09:27:18
|
||||||
|
* @Sign: 扬眉剑出鞘
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<picker class="time-picker" mode="multiSelector" @change="bindStartMultiPickerChange" @columnchange="bindMultiPickerColumnChange" :value="multiIndex" :range="multiArray">
|
||||||
|
<slot name="pCon"></slot>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
sTime: {
|
||||||
|
//开始小时
|
||||||
|
type: [Number, String],
|
||||||
|
default: '0'
|
||||||
|
},
|
||||||
|
cTime: {
|
||||||
|
//结束小时
|
||||||
|
type: [Number, String],
|
||||||
|
default: '23'
|
||||||
|
},
|
||||||
|
timeNum: {
|
||||||
|
//延迟小时
|
||||||
|
type: [Number, String],
|
||||||
|
default: '0'
|
||||||
|
},
|
||||||
|
interval: {
|
||||||
|
//分钟间隔
|
||||||
|
type: [Number, String],
|
||||||
|
default: '1'
|
||||||
|
},
|
||||||
|
sDay: {
|
||||||
|
//开始天数
|
||||||
|
type: [Number, String],
|
||||||
|
default: '0'
|
||||||
|
},
|
||||||
|
dayNum: {
|
||||||
|
//预约天数
|
||||||
|
type: [Number, String],
|
||||||
|
default: '7'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
sDayNum: 0,
|
||||||
|
multiArray: [[0, 10, 20]],
|
||||||
|
multiIndex: [0],
|
||||||
|
multiSelector: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
beforeMount() {
|
||||||
|
this.pickerTap();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
timeFormat: function(num) {
|
||||||
|
if (num < 10 && (num + '').length == 1) {
|
||||||
|
return '0' + num;
|
||||||
|
}
|
||||||
|
return num;
|
||||||
|
},
|
||||||
|
pickerTap: function() {
|
||||||
|
let date = new Date();
|
||||||
|
let monthDay = [];
|
||||||
|
let hours = [];
|
||||||
|
let minute = [];
|
||||||
|
this.sDayNum = this.sDay;
|
||||||
|
|
||||||
|
// 时
|
||||||
|
let date1 = new Date(date);
|
||||||
|
let sT = +this.sTime;
|
||||||
|
let eT = +this.cTime;
|
||||||
|
|
||||||
|
if (sT <= eT) {
|
||||||
|
let h = date1.getHours() < sT ? sT : date1.getHours();
|
||||||
|
h = h + parseInt(this.timeNum);
|
||||||
|
if (h > eT || this.sDayNum > 0) {
|
||||||
|
this.sDayNum = this.sDayNum <= 0 ? parseInt(this.sDay) + 1 : parseInt(this.sDay);
|
||||||
|
for (let i = sT; i <= eT; i++) {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = h; i <= eT; i++) {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let h = date1.getHours() < sT ? sT : date1.getHours();
|
||||||
|
h = h + parseInt(this.timeNum);
|
||||||
|
if ((h > eT && h < sT) || h > 23 || this.sDayNum > 0) {
|
||||||
|
this.sDayNum = this.sDayNum <= 0 ? parseInt(this.sDay) + 1 : parseInt(this.sDay);
|
||||||
|
for (let i = 0; i <= 23; i++) {
|
||||||
|
if (i < sT && i > eT) {
|
||||||
|
} else {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = h; i <= 23; i++) {
|
||||||
|
if (i < sT && i > eT) {
|
||||||
|
} else {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let inter = +this.interval < 60 ? +this.interval : 59;
|
||||||
|
// 分
|
||||||
|
for (let i = 0; i < 60; i += inter) {
|
||||||
|
minute.push(i < 10 ? '0' + i + '分' : i + '分');
|
||||||
|
}
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
multiArray: this.multiArray,
|
||||||
|
multiIndex: this.multiIndex
|
||||||
|
};
|
||||||
|
|
||||||
|
data.multiArray[0] = monthDay;
|
||||||
|
data.multiArray[1] = hours;
|
||||||
|
data.multiArray[2] = minute;
|
||||||
|
this.multiArray = data.multiArray;
|
||||||
|
this.multiIndex = data.multiIndex;
|
||||||
|
},
|
||||||
|
bindMultiPickerColumnChange(e) {
|
||||||
|
this.multiIndex.splice(e.detail.column,1,e.detail.value)
|
||||||
|
let hours = [];
|
||||||
|
if (e.detail.column == 0 && e.detail.value == 0 && +this.sDayNum == 0) {
|
||||||
|
let date = new Date();
|
||||||
|
// 时
|
||||||
|
let date1 = new Date(date);
|
||||||
|
let sT = +this.sTime;
|
||||||
|
let eT = +this.cTime;
|
||||||
|
|
||||||
|
if (sT <= eT) {
|
||||||
|
let h = date1.getHours() < sT ? sT : date1.getHours();
|
||||||
|
h = h + parseInt(this.timeNum);
|
||||||
|
if (h > eT || this.sDayNum > 0) {
|
||||||
|
this.sDayNum = this.sDayNum <= 0 ? parseInt(this.sDay) + 1 : parseInt(this.sDay);
|
||||||
|
for (let i = sT; i <= eT; i++) {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = h; i <= eT; i++) {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let h = date1.getHours() < sT ? sT : date1.getHours();
|
||||||
|
h = h + parseInt(this.timeNum);
|
||||||
|
if ((h > eT && h < sT) || h > 23 || this.sDayNum > 0) {
|
||||||
|
this.sDayNum = this.sDayNum <= 0 ? parseInt(this.sDay) + 1 : parseInt(this.sDay);
|
||||||
|
for (let i = 0; i <= 23; i++) {
|
||||||
|
if (i < sT && i > eT) {
|
||||||
|
} else {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = h; i <= 23; i++) {
|
||||||
|
if (i < sT && i > eT) {
|
||||||
|
} else {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.multiArray.splice(1,1,hours)
|
||||||
|
|
||||||
|
} else if (e.detail.column == 0 && e.detail.value != 0) {
|
||||||
|
let sT = +this.sTime;
|
||||||
|
let eT = +this.cTime;
|
||||||
|
|
||||||
|
if (sT <= eT) {
|
||||||
|
for (let i = sT; i <= eT; i++) {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = 0; i <= 23; i++) {
|
||||||
|
if (i < sT && i > eT) {
|
||||||
|
} else {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.multiArray.splice(1,1,hours)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
bindStartMultiPickerChange(e) {
|
||||||
|
console.log(e);
|
||||||
|
this.multiIndex = e.detail.value;
|
||||||
|
let da = this.multiArray;
|
||||||
|
let di = e.detail.value;
|
||||||
|
|
||||||
|
let caseDate = da[1][di[1]].replace('时', ':') + this.timeFormat(da[2][di[2]].replace('分', ''));
|
||||||
|
|
||||||
|
let appointTime = new Date(caseDate.replace(/-/g,'/')).getTime() / 1000;
|
||||||
|
if (appointTime < new Date().getTime() / 1000) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '不能选择过去时间',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.$emit('changeTime', caseDate, appointTime * 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
|
||||||
|
</style>
|
|
@ -0,0 +1,228 @@
|
||||||
|
<!--
|
||||||
|
* @Description: 时间选择
|
||||||
|
* @Author: hjh
|
||||||
|
* @Date: 2019-08-17 23:19:32
|
||||||
|
* @LastEditors: hjh
|
||||||
|
* @LastEditTime: 2019-08-19 09:27:18
|
||||||
|
* @Sign: 扬眉剑出鞘
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<picker class="time-picker" mode="multiSelector" @change="bindStartMultiPickerChange" @columnchange="bindMultiPickerColumnChange" :value="multiIndex" :range="multiArray">
|
||||||
|
<slot name="pCon"></slot>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
sTime: {
|
||||||
|
//开始小时
|
||||||
|
type: [Number, String],
|
||||||
|
default: '0'
|
||||||
|
},
|
||||||
|
cTime: {
|
||||||
|
//结束小时
|
||||||
|
type: [Number, String],
|
||||||
|
default: '23'
|
||||||
|
},
|
||||||
|
timeNum: {
|
||||||
|
//延迟小时
|
||||||
|
type: [Number, String],
|
||||||
|
default: '0'
|
||||||
|
},
|
||||||
|
interval: {
|
||||||
|
//分钟间隔
|
||||||
|
type: [Number, String],
|
||||||
|
default: '1'
|
||||||
|
},
|
||||||
|
sDay: {
|
||||||
|
//开始天数
|
||||||
|
type: [Number, String],
|
||||||
|
default: '0'
|
||||||
|
},
|
||||||
|
dayNum: {
|
||||||
|
//预约天数
|
||||||
|
type: [Number, String],
|
||||||
|
default: '7'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
sDayNum: 0,
|
||||||
|
multiArray: [[0, 10, 20]],
|
||||||
|
multiIndex: [0, 0, 0],
|
||||||
|
multiSelector: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
beforeMount() {
|
||||||
|
this.pickerTap();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
timeFormat: function(num) {
|
||||||
|
if (num < 10 && (num + '').length == 1) {
|
||||||
|
return '0' + num;
|
||||||
|
}
|
||||||
|
return num;
|
||||||
|
},
|
||||||
|
pickerTap: function() {
|
||||||
|
let date = new Date();
|
||||||
|
date.setDate(date.getDate() + 1);
|
||||||
|
let monthDay = [];
|
||||||
|
let hours = [];
|
||||||
|
let minute = [];
|
||||||
|
this.sDayNum = this.sDay;
|
||||||
|
|
||||||
|
// 时
|
||||||
|
let date1 = new Date(date);
|
||||||
|
let sT = +this.sTime;
|
||||||
|
let eT = +this.cTime;
|
||||||
|
|
||||||
|
if (sT <= eT) {
|
||||||
|
let h = sT;
|
||||||
|
// h = h + parseInt(this.timeNum);
|
||||||
|
if (h > eT || this.sDayNum > 0) {
|
||||||
|
this.sDayNum = this.sDayNum <= 0 ? parseInt(this.sDay) + 1 : parseInt(this.sDay);
|
||||||
|
for (let i = sT; i <= eT; i++) {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = h; i <= eT; i++) {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let h = sT;
|
||||||
|
// h = h + parseInt(this.timeNum);
|
||||||
|
if ((h > eT && h < sT) || h > 23 || this.sDayNum > 0) {
|
||||||
|
this.sDayNum = this.sDayNum <= 0 ? parseInt(this.sDay) + 1 : parseInt(this.sDay);
|
||||||
|
for (let i = 0; i <= 23; i++) {
|
||||||
|
if (i < sT && i > eT) {
|
||||||
|
} else {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = h; i <= 23; i++) {
|
||||||
|
if (i < sT && i > eT) {
|
||||||
|
} else {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 月-日
|
||||||
|
// for (let i = +this.sDayNum; i <= parseInt(this.sDayNum) + parseInt(this.dayNum); i++) {
|
||||||
|
// let date1 = new Date(date);
|
||||||
|
// date1.setDate(date.getDate() + i);
|
||||||
|
// let md = date1.getFullYear() + '-' + this.timeFormat(date1.getMonth() + 1) + '-' + this.timeFormat(date1.getDate());
|
||||||
|
// monthDay.push(md);
|
||||||
|
// }
|
||||||
|
let inter = +this.interval < 60 ? +this.interval : 59;
|
||||||
|
// 分
|
||||||
|
for (let i = 0; i < 60; i += inter) {
|
||||||
|
minute.push(i < 10 ? '0' + i + '分' : i + '分');
|
||||||
|
}
|
||||||
|
let data = {
|
||||||
|
multiArray: this.multiArray,
|
||||||
|
multiIndex: this.multiIndex
|
||||||
|
};
|
||||||
|
|
||||||
|
data.multiArray[0] = monthDay;
|
||||||
|
data.multiArray[1] = hours;
|
||||||
|
data.multiArray[2] = minute;
|
||||||
|
this.multiArray = data.multiArray;
|
||||||
|
this.multiIndex = data.multiIndex;
|
||||||
|
},
|
||||||
|
bindMultiPickerColumnChange(e) {
|
||||||
|
this.multiIndex.splice(e.detail.column,1,e.detail.value)
|
||||||
|
let hours = [];
|
||||||
|
if (e.detail.column == 0 && e.detail.value == 0 && +this.sDayNum == 0) {
|
||||||
|
let date = new Date();
|
||||||
|
// 时
|
||||||
|
let date1 = new Date(date);
|
||||||
|
let sT = +this.sTime;
|
||||||
|
let eT = +this.cTime;
|
||||||
|
|
||||||
|
if (sT <= eT) {
|
||||||
|
let h = date1.getHours() < sT ? sT : date1.getHours();
|
||||||
|
h = h + parseInt(this.timeNum);
|
||||||
|
if (h > eT || this.sDayNum > 0) {
|
||||||
|
this.sDayNum = this.sDayNum <= 0 ? parseInt(this.sDay) + 1 : parseInt(this.sDay);
|
||||||
|
for (let i = sT; i <= eT; i++) {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = h; i <= eT; i++) {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let h = date1.getHours() < sT ? sT : date1.getHours();
|
||||||
|
h = h + parseInt(this.timeNum);
|
||||||
|
if ((h > eT && h < sT) || h > 23 || this.sDayNum > 0) {
|
||||||
|
this.sDayNum = this.sDayNum <= 0 ? parseInt(this.sDay) + 1 : parseInt(this.sDay);
|
||||||
|
for (let i = 0; i <= 23; i++) {
|
||||||
|
if (i < sT && i > eT) {
|
||||||
|
} else {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = h; i <= 23; i++) {
|
||||||
|
if (i < sT && i > eT) {
|
||||||
|
} else {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.multiArray.splice(1,1,hours)
|
||||||
|
|
||||||
|
} else if (e.detail.column == 0 && e.detail.value != 0) {
|
||||||
|
let sT = +this.sTime;
|
||||||
|
let eT = +this.cTime;
|
||||||
|
|
||||||
|
if (sT <= eT) {
|
||||||
|
for (let i = sT; i <= eT; i++) {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = 0; i <= 23; i++) {
|
||||||
|
if (i < sT && i > eT) {
|
||||||
|
} else {
|
||||||
|
hours.push(this.timeFormat(i) + '时');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.multiArray.splice(1,1,hours)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
bindStartMultiPickerChange(e) {
|
||||||
|
console.log(e);
|
||||||
|
this.multiIndex = e.detail.value;
|
||||||
|
let da = this.multiArray;
|
||||||
|
let di = e.detail.value;
|
||||||
|
|
||||||
|
let caseDate =da[1][di[1]].replace('时', ':') + this.timeFormat(da[2][di[2]].replace('分', ''));
|
||||||
|
|
||||||
|
let appointTime = new Date(caseDate.replace(/-/g,'/')).getTime() / 1000;
|
||||||
|
if (appointTime < new Date().getTime() / 1000) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '不能选择过去时间',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.$emit('changeTime', caseDate, appointTime * 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -0,0 +1,69 @@
|
||||||
|
<!--
|
||||||
|
* @Description:
|
||||||
|
* @Author: hjh
|
||||||
|
* @Date: 2019-08-16 11:17:37
|
||||||
|
* @LastEditors: hjh
|
||||||
|
* @LastEditTime: 2019-08-22 18:16:24
|
||||||
|
* @Sign: 扬眉剑出鞘
|
||||||
|
-->
|
||||||
|
|
||||||
|
### hTimePicker
|
||||||
|
|
||||||
|
预约时间的选择,支持营业时间的判断
|
||||||
|
|
||||||
|
**使用方式:**
|
||||||
|
|
||||||
|
在 `script` 中引用组件
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import hTimePicker from "@/components/h-timePicker/h-timePicker.vue";
|
||||||
|
export default {
|
||||||
|
components: { hTimePicker }
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
在 `template` 中使用组件
|
||||||
|
|
||||||
|
```html
|
||||||
|
<hTimePicker sTime="15" cTime="15" interval="1" @changeTime="changeTime">
|
||||||
|
<view slot="pCon" class="changeTime">
|
||||||
|
点击选择时间
|
||||||
|
</view>
|
||||||
|
</hTimePicker>
|
||||||
|
```
|
||||||
|
|
||||||
|
**属性说明:**
|
||||||
|
|
||||||
|
|属性名|类型|默认值 |说明|
|
||||||
|
|---|----|---|---|
|
||||||
|
|sTime|String|0|小时开始|
|
||||||
|
|cTime|String|23|小时结束|
|
||||||
|
|timeNum|String|1|当天预约时的延迟小时|
|
||||||
|
|interval|String|1|分钟的间隔|
|
||||||
|
|sDay|String|0|预约日期从几天后开始,0就是今天,1就是明天|
|
||||||
|
|dayNum|String|7|可以预约的天数|
|
||||||
|
|
||||||
|
**事件说明:**
|
||||||
|
|
||||||
|
|事件称名|说明|返回参数|
|
||||||
|
|---|----|---|
|
||||||
|
|changeTime|改变时间的事件|第一个参数是格式化时间,第二个是时间戳|
|
||||||
|
|
||||||
|
|
||||||
|
### 更新日志
|
||||||
|
|
||||||
|
**1.0.0**
|
||||||
|
|
||||||
|
- 初始项目
|
||||||
|
|
||||||
|
**1.0.1**
|
||||||
|
|
||||||
|
- 修复H5下不滚动,确定无效问题
|
||||||
|
|
||||||
|
|
||||||
|
**1.0.2**
|
||||||
|
|
||||||
|
- 修复选择时间后再次打开显示不正确的问题
|
||||||
|
**1.0.3**
|
||||||
|
|
||||||
|
- 可延迟预约时间的选择
|
|
@ -41,17 +41,18 @@
|
||||||
<view v-else>
|
<view v-else>
|
||||||
备注: 本期等级是根据技师上个周期的业绩最终计算得出
|
备注: 本期等级是根据技师上个周期的业绩最终计算得出
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="progress-bar">
|
<view v-if="grade">
|
||||||
<text class="u-demo-block__title">上周期等级</text>
|
本周期到达等级:【{{grade}}】
|
||||||
<view class="u-demo-block__content">
|
</view>
|
||||||
<u-line-progress
|
<u-line-progress active-color="#46a396" :show-percent="false" :height="38" inactive-color="#098f7a"
|
||||||
height="15"
|
:percent="lineProgressData" :striped-active="true"></u-line-progress>
|
||||||
:showText="false"
|
|
||||||
:percentage="percentage3"
|
<view v-if="!maxStatus && longUpgradeDescriptionSet.differenceOutstandingAchievement" class="dengji-text">
|
||||||
>
|
还差{{ longUpgradeDescriptionSet.differenceDurationOnline }}小时,{{ longUpgradeDescriptionSet.differenceOutstandingAchievement }}业绩,{{ longUpgradeDescriptionSet.differenceIntegral }}积分;可以升级{{ longUpgradeDescriptionSet.differenceGrade }}
|
||||||
</u-line-progress>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="memo">备注: 本期等级是根据技师上个周期的业绩最终计算得出</view>
|
<view v-if="maxStatus" class=" dengji-text">
|
||||||
|
您已达到最高等级
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -112,25 +113,75 @@
|
||||||
ultimately: "",
|
ultimately: "",
|
||||||
lastGrade: "",
|
lastGrade: "",
|
||||||
grade: "",
|
grade: "",
|
||||||
maxStatus: "",
|
// maxStatus: "",
|
||||||
differenceDurationOnline: "",
|
differenceDurationOnline: "",
|
||||||
differenceOutstandingAchievement: "",
|
differenceOutstandingAchievement: "",
|
||||||
differenceIntegral: "",
|
differenceIntegral: "",
|
||||||
differenceGrade: "",
|
differenceGrade: "",
|
||||||
|
currentWholeIncome: null, //App首页当期总收益
|
||||||
|
totalIncomeRange: null, //App首页当前阶段收益总数
|
||||||
|
currentRealIncome: null, //App首页当期实际收益(已扣除各项)
|
||||||
|
currentIntegral: null, //App首页当期积分
|
||||||
|
currentOrdersNum: null, //App首页当期订单数量
|
||||||
|
currentRenewalNum: null, //App首页当期加钟率
|
||||||
|
currentRechargeNum: null, //App首页当期充值率
|
||||||
|
upgradeDescriptionStatus: false, // App首页升级描述
|
||||||
|
currentGrade: null, //App首页当前等级
|
||||||
|
lineProgressData: 0,
|
||||||
|
maxStatus: null,
|
||||||
|
longUpgradeDescriptionSet:{}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.ultimately = e.ultimately;
|
this.ultimately = e.ultimately;
|
||||||
this.lastGrade = e.lastGrade;
|
this.lastGrade = e.lastGrade;
|
||||||
this.grade = e.grade;
|
this.grade = e.grade;
|
||||||
this.maxStatus = e.maxStatus;
|
// this.maxStatus = e.maxStatus;
|
||||||
this.differenceDurationOnline = e.differenceDurationOnline;
|
this.differenceDurationOnline = e.differenceDurationOnline;
|
||||||
this.differenceOutstandingAchievement = e.differenceOutstandingAchievement;
|
this.differenceOutstandingAchievement = e.differenceOutstandingAchievement;
|
||||||
this.differenceIntegral = e.differenceIntegral;
|
this.differenceIntegral = e.differenceIntegral;
|
||||||
this.differenceGrade = e.differenceGrade;
|
this.differenceGrade = e.differenceGrade;
|
||||||
this.getArtificerLevels();
|
this.getArtificerLevels();
|
||||||
|
this.getHomeListData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//获取App首页数据
|
||||||
|
getHomeListData() {
|
||||||
|
let artificerId = uni.getStorageSync("artificerId");
|
||||||
|
|
||||||
|
console.log('artificerId------->',artificerId);
|
||||||
|
if (artificerId) {
|
||||||
|
this.$Request.getXZX("/app/artificer/integral/home/?artificerId=" + artificerId,).then((res) => {
|
||||||
|
if (res && res.data) {
|
||||||
|
this.longUpgradeDescriptionSet = {
|
||||||
|
differenceOutstandingAchievement: res?.data?.differenceOutstandingAchievement,
|
||||||
|
differenceIntegral: res?.data?.differenceIntegral,
|
||||||
|
differenceClockRate: res?.data?.differenceClockRate + "%",
|
||||||
|
differenceDurationOnline: res?.data?.differenceDurationOnline,
|
||||||
|
currentLevel: res?.data?.currentLevel,
|
||||||
|
differenceGrade: res?.data?.differenceGrade,
|
||||||
|
};
|
||||||
|
this.upgradeDescriptionStatus = res?.data?.ultimately;
|
||||||
|
this.currentGrade = res?.data?.lastGrade;
|
||||||
|
uni.setStorageSync("currentRealIncome", res?.data?.earnings);
|
||||||
|
this.totalIncomeRange = res?.data?.suffix;
|
||||||
|
if (this.currentWholeIncome < 4000) {
|
||||||
|
this.totalIncomeRange = 4000;
|
||||||
|
} else if (this.currentWholeIncome < 6000 && this.currentWholeIncome > 4000) {
|
||||||
|
this.totalIncomeRange = 6000;
|
||||||
|
} else if (this.currentWholeIncome < 8000 && this.currentWholeIncome > 6000) {
|
||||||
|
this.totalIncomeRange = 8000;
|
||||||
|
} else if (this.currentWholeIncome < 10000 && this.currentWholeIncome > 8000) {
|
||||||
|
this.totalIncomeRange = 10000;
|
||||||
|
} else {
|
||||||
|
this.totalIncomeRange = 4000;
|
||||||
|
}
|
||||||
|
this.currentWholeIncome = 2000;
|
||||||
|
this.lineProgressData = this.currentWholeIncome / this.totalIncomeRange * 100;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
fanhui(){
|
fanhui(){
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url:'/pages/index/index'
|
url:'/pages/index/index'
|
||||||
|
@ -274,7 +325,7 @@
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
}
|
}
|
||||||
.header-right-text{
|
.header-right-text{
|
||||||
margin-top: 10px;
|
margin-top: 25px;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,33 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="timeView">
|
<view class="timeView">
|
||||||
<!-- <times @change="getTime" :timeInterval="0.5" :appointTime="msList"
|
<view class="timeView-top">
|
||||||
:isMultiple="true" :disableTimeSlot = "disableTimeSlot"></times> -->
|
<span class="dx_title">是否接单 <!-- <text class="switchTxt">{{switchTxt=='true'?'接单':'不接单'}}</text> --></span>
|
||||||
<its-calendar :sta_num="0" :end_num="24" :int_num="msTimeDate" @getTime="TimeData" @getDate="SelData">
|
<switch :checked='isTrue' style="transform:scale(0.7)" @change="switch1Change"/>
|
||||||
</its-calendar>
|
</view>
|
||||||
|
<view class="selectTimt">
|
||||||
|
<view class="dx_title">选择接单时问</view>
|
||||||
|
<view class="selectTimt-bottom">
|
||||||
|
<picker class="selectTimt-time" range="halfHours" mode="time" :value="starTime" step="30" start="00:30" end="23:30" @change="bindTimeChange">
|
||||||
|
<view class="selectTimt-time-title">开始时间</view>
|
||||||
|
<view class="uni-input">{{starTime}}</view>
|
||||||
|
</picker>
|
||||||
|
<picker class="selectTimt-time" mode="time" :value="endTime" start="00:00" end="23:59" @change="bindTimeChangeEndTime">
|
||||||
|
<view class="selectTimt-time-title">结束时间</view>
|
||||||
|
<view class="uni-input">
|
||||||
|
<span style="margin-right: 5px;">次日</span>
|
||||||
|
<span>{{endTime}}</span>
|
||||||
|
</view>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<times selectedTabColor="#28BA92" selectedItemColor="#28BA92" @change="getTime" :timeInterval="0.5" :appointTime="msList"
|
||||||
|
:isMultiple="true" :disableTimeSlot = "disableTimeSlot"></times>
|
||||||
|
<!-- <its-calendar :sta_num="0" :end_num="24" :int_num="msTimeDate" @getTime="TimeData" @getDate="SelData">
|
||||||
|
</its-calendar> -->
|
||||||
<view class="dx_view margin-bottom-sm" v-if="msList.length > 0">
|
<view class="dx_view margin-bottom-sm" v-if="msList.length > 0">
|
||||||
<view class="dx_title">忙时时间</view>
|
<view class="dx_title">不可接单时间</view>
|
||||||
<view class="flex align-center flex-wrap ">
|
<view class="flex align-center flex-wrap ">
|
||||||
<view v-for="(item,index) in msList" :key="index" class="btn flex align-center margin-top">
|
<view v-for="(item,index) in msList" :key="index" class="btn flex align-center margin-top">
|
||||||
<view>{{item}}</view>
|
<view>{{item}}</view>
|
||||||
|
@ -14,12 +35,18 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="sub" @click="sub()" >保存选择</view>
|
<view class="sub" @click="sub()" v-if="switchTxt==true">保存选择1</view>
|
||||||
|
<view class="sub" @click="sub()" v-if="switchTxt==false">保存选择2</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
currentTime,
|
||||||
|
initData,
|
||||||
|
tomorrow
|
||||||
|
} from '../../utils/date.js'
|
||||||
import times from '@/components/pretty-times/pretty-times.vue'
|
import times from '@/components/pretty-times/pretty-times.vue'
|
||||||
import itsCalendar from '@/components/its-calendar/its-calendar.vue';
|
import itsCalendar from '@/components/its-calendar/its-calendar.vue';
|
||||||
export default {
|
export default {
|
||||||
|
@ -29,6 +56,10 @@
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
isTrue: true,
|
||||||
|
starTime:'00:00',
|
||||||
|
endTime: '00:00',
|
||||||
|
endTimes:'23:30',
|
||||||
appointTime:[],
|
appointTime:[],
|
||||||
disableTimeSlot:[],
|
disableTimeSlot:[],
|
||||||
msTimeDate: 0,
|
msTimeDate: 0,
|
||||||
|
@ -36,6 +67,9 @@
|
||||||
msList: [],
|
msList: [],
|
||||||
startTime: '',
|
startTime: '',
|
||||||
yearsDate: '',
|
yearsDate: '',
|
||||||
|
switchTxt:'',
|
||||||
|
timeCurrent:'',
|
||||||
|
tomorrowTime:''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
@ -44,6 +78,12 @@
|
||||||
} else {
|
} else {
|
||||||
this.msTimeDate = 60;
|
this.msTimeDate = 60;
|
||||||
}
|
}
|
||||||
|
if(this.timeCurrent==''){
|
||||||
|
this.timeCurrent=tomorrow().tomorrow+' '+this.endTime;
|
||||||
|
}
|
||||||
|
// this.starTime=currentTime().times;
|
||||||
|
this.tomorrowTime=currentTime().date+' '+currentTime().times;
|
||||||
|
|
||||||
var date = new Date();
|
var date = new Date();
|
||||||
var year = date.getFullYear();
|
var year = date.getFullYear();
|
||||||
let month = (parseInt(date.getMonth()) + 1) > 9 ? (parseInt(date.getMonth()) + 1) : "0" + (parseInt(
|
let month = (parseInt(date.getMonth()) + 1) > 9 ? (parseInt(date.getMonth()) + 1) : "0" + (parseInt(
|
||||||
|
@ -55,61 +95,89 @@
|
||||||
this.getMsTime(Time);
|
this.getMsTime(Time);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getTime(time){
|
bindTimeChange: function(e) {// 当天接单开始时间
|
||||||
// this.appointTime=time
|
this.starTime = e.detail.value;
|
||||||
this.msList=time
|
this.tomorrowTime=currentTime().date+' '+this.starTime;
|
||||||
console.log(time, '时间')
|
|
||||||
},
|
},
|
||||||
sub() {
|
bindTimeChangeEndTime(e){//次日接单结束时间
|
||||||
// if (this.msList.length == 0) {
|
this.endTime = e.detail.value;
|
||||||
if(this.yearsDate === ''){
|
this.timeCurrent=tomorrow().tomorrow+' '+this.endTime;
|
||||||
this.$queue.showToast('请先添加待选时间!');
|
},
|
||||||
return;
|
switch1Change: function (e) {
|
||||||
|
this.switchTxt=e.detail.value
|
||||||
|
var time=''
|
||||||
|
if(this.switchTxt==true){
|
||||||
|
time='1'
|
||||||
|
}else{
|
||||||
|
time='2'
|
||||||
}
|
}
|
||||||
uni.showModal({
|
this.sfJdan(time)
|
||||||
title: '温馨提示',
|
|
||||||
content: '是否将待选区的时间设置为忙时?',
|
},
|
||||||
showCancel: true,
|
sfJdan(time){//是否接单
|
||||||
cancelText: '取消',
|
var data={
|
||||||
confirmText: '确认',
|
flag:time,
|
||||||
success: res => {
|
artificerId:uni.getStorageSync('artificerId')
|
||||||
if (res.confirm) {
|
}
|
||||||
this.saveMangShi();
|
this.$Request.postT('/app/artificerTime/setArtificerAccept',data).then(res => {
|
||||||
}
|
if (res.code == 0) {
|
||||||
|
this.$queue.showToast('设置成功!')
|
||||||
|
this.getMsTime(currentTime().date)
|
||||||
|
} else {
|
||||||
|
this.$queue.showToast(res.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getTime(time){
|
||||||
|
|
||||||
|
this.msList=time;
|
||||||
|
|
||||||
|
},
|
||||||
|
sub() {
|
||||||
|
this.saveMangShi();
|
||||||
|
// if (this.msList.length == 0) {
|
||||||
|
// if(this.yearsDate === ''){
|
||||||
|
// this.$queue.showToast('请先添加待选时间!');
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// uni.showModal({
|
||||||
|
// title: '温馨提示',
|
||||||
|
// content: '是否将待选区的时间设置为忙时?',
|
||||||
|
// showCancel: true,
|
||||||
|
// cancelText: '取消',
|
||||||
|
// confirmText: '确认',
|
||||||
|
// success: res => {
|
||||||
|
// if (res.confirm) {
|
||||||
|
// this.saveMangShi();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
},
|
||||||
//删除规格
|
//删除规格
|
||||||
bindupdata(index1, item) {
|
bindupdata(index1, item) {
|
||||||
console.log("111",index1,item)
|
|
||||||
let over = false;
|
let over = false;
|
||||||
for (var i = 0; i < this.newmsList.length; i++) {
|
for (var i = 0; i < this.newmsList.length; i++) {
|
||||||
console.log("222",this.newmsList[i])
|
|
||||||
if (this.newmsList[i].artificerTime === item) {
|
if (this.newmsList[i].artificerTime === item) {
|
||||||
console.log("3333")
|
|
||||||
if (this.newmsList[i].classify == 1) {
|
if (this.newmsList[i].classify == 1) {
|
||||||
console.log("44444")
|
|
||||||
over = true;
|
over = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!over) {
|
if (!over) {
|
||||||
if(this.msList.length>1){
|
this.msList.splice(index1, 1)
|
||||||
console.log("55555",this.msList)
|
|
||||||
this.msList.splice(index1, 1)
|
|
||||||
}else{
|
|
||||||
this.msList=[]
|
|
||||||
console.log("6666",this.msList)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.log("6666")
|
|
||||||
this.$queue.showToast('当前时间已被用户下单,禁止删除!')
|
this.$queue.showToast('当前时间已被用户下单,禁止删除!')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
saveMangShi() {
|
saveMangShi() {
|
||||||
this.$Request.postT('/app/artificerTime/updateArtificerTime?artificerDate=' + this.yearsDate + '×=' +
|
// artificerId:uni.getStorageSync('artificerId')
|
||||||
this.msList.join(",") + '&artificerId=' + uni.getStorageSync('artificerId')).then(res => {
|
var data={
|
||||||
|
idleTime:this.tomorrowTime+','+this.timeCurrent,
|
||||||
|
busyTime:this.msList.toString(),
|
||||||
|
artificerId:uni.getStorageSync('artificerId')
|
||||||
|
}
|
||||||
|
this.$Request.postT('/app/artificerTime/setArtificerTime',data).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.$queue.showToast('设置成功!')
|
this.$queue.showToast('设置成功!')
|
||||||
} else {
|
} else {
|
||||||
|
@ -119,15 +187,23 @@
|
||||||
},
|
},
|
||||||
getMsTime(artificerDate) {
|
getMsTime(artificerDate) {
|
||||||
this.yearsDate = artificerDate;
|
this.yearsDate = artificerDate;
|
||||||
this.$Request.getT('/app/artificerTime/selectArtificerTimeByArtificerId?artificerId=' + uni.getStorageSync(
|
this.$Request.getT('/app/artificerTime/selectArtificerTimeByArtificerId?artificerId=' + uni.getStorageSync('artificerId') + '&artificerDate=' + artificerDate).then(res => {
|
||||||
'artificerId') + '&artificerDate=' + artificerDate).then(res => {
|
|
||||||
if (res && res.code == 0 && res.data) {
|
if (res && res.code == 0 && res.data) {
|
||||||
this.msList = [];
|
if (res.data) {
|
||||||
this.newmsList = res.data;
|
if (res.data.acceptOrders == 1) {
|
||||||
this.msList = res.data.map((item)=> item.artificerTime);
|
this.isTrue = true
|
||||||
console.log('getMsTime',this.msList);
|
} else if (res.data.acceptOrders == 2) {
|
||||||
uni.$emit("sendChildMsList",this.msList);
|
this.isTrue = false
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// this.msList = [];
|
||||||
|
// this.newmsList = res.data;
|
||||||
|
// this.msList = res.data.map((item)=> item.artificerTime);
|
||||||
|
// console.log('getMsTime',this.msList);
|
||||||
|
// uni.$emit("sendChildMsList",this.msList);
|
||||||
|
}else {
|
||||||
|
this.isTrue = false
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
SelData(e) {
|
SelData(e) {
|
||||||
|
@ -162,7 +238,56 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss" scoped>
|
||||||
|
.selectTimt-time-title{
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
/deep/.uni-input{
|
||||||
|
text-align: center;
|
||||||
|
color: #28BA92;
|
||||||
|
}
|
||||||
|
.selectTimt-time{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.selectTimt-bottom{
|
||||||
|
margin-top:10px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.selectTimt{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px 5px;
|
||||||
|
background: #fff;
|
||||||
|
margin: 10px auto;
|
||||||
|
}
|
||||||
|
.dx_title{
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.switchTxt{
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 400;
|
||||||
|
margin-left: 5px;
|
||||||
|
color: #28BA92;
|
||||||
|
}
|
||||||
|
.timeView-top{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px 5px;
|
||||||
|
background: #fff;
|
||||||
|
margin: 10px auto;
|
||||||
|
}
|
||||||
page {
|
page {
|
||||||
background: #f7f7f7;
|
background: #f7f7f7;
|
||||||
}
|
}
|
||||||
|
@ -184,7 +309,6 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 750rpx;
|
width: 750rpx;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
margin: 0rpx 20rpx;
|
|
||||||
|
|
||||||
.timeview_item {
|
.timeview_item {
|
||||||
background: #F7F7F7;
|
background: #F7F7F7;
|
||||||
|
|
Loading…
Reference in New Issue