|
@@ -56,7 +56,7 @@ export default defineComponent({
|
|
|
async mounted() {
|
|
|
try {
|
|
|
// 获取手续费和分钟数
|
|
|
- let config = await request.get(
|
|
|
+ const config = await request.get(
|
|
|
'/api-website/sysConfig/queryByParamNameList',
|
|
|
{
|
|
|
params: {
|
|
@@ -65,11 +65,11 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
)
|
|
|
- let configData = config.data || []
|
|
|
+ const configData = config.data || []
|
|
|
configData.forEach((item: any) => {
|
|
|
if (item.paramName === 'practice_times_setting') {
|
|
|
- let mins = item.paramValue ? JSON.parse(item.paramValue) : []
|
|
|
- let tempArr = [] as any
|
|
|
+ const mins = item.paramValue ? JSON.parse(item.paramValue) : []
|
|
|
+ const tempArr = [] as any
|
|
|
mins.forEach((item: any) => {
|
|
|
tempArr.push({
|
|
|
...item,
|
|
@@ -89,7 +89,7 @@ export default defineComponent({
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- let teacher = await request.post('/api-website/teacher/querySubject')
|
|
|
+ const teacher = await request.post('/api-website/teacher/querySubject')
|
|
|
this.subjectList = teacher.data || []
|
|
|
|
|
|
// 获取课程设置
|
|
@@ -116,8 +116,8 @@ export default defineComponent({
|
|
|
sunday: sr.sunday ? JSON.parse(sr.sunday) : []
|
|
|
}
|
|
|
|
|
|
- let tempIds: any = []
|
|
|
- let tempPrices: any = []
|
|
|
+ const tempIds: any = []
|
|
|
+ const tempPrices: any = []
|
|
|
const subjectPrice = sr.subjectPrice || []
|
|
|
subjectPrice.forEach((item: any) => {
|
|
|
tempIds.push(item.subjectId)
|
|
@@ -148,7 +148,9 @@ export default defineComponent({
|
|
|
: '未设置'
|
|
|
}
|
|
|
}
|
|
|
- } catch {}
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
onSelect(item: any) {
|
|
@@ -171,7 +173,9 @@ export default defineComponent({
|
|
|
this.timeSetting.courseMinutes = Number(form.courseMinutes)
|
|
|
this.timeSetting.freeMinutes = Number(form.freeMinutes)
|
|
|
this.timerStatus = true
|
|
|
- } catch {}
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
},
|
|
|
onChoiceTimer(item: any, status: boolean) {
|
|
|
// console.log(item, 'item')
|
|
@@ -183,7 +187,7 @@ export default defineComponent({
|
|
|
const tempItem = item || []
|
|
|
this.form.subjectId = tempItem
|
|
|
this.form.subjectIdTemp = tempItem.join(',') || ''
|
|
|
- let subjectPriceList = [...this.form.subjectPrice]
|
|
|
+ const subjectPriceList = [...this.form.subjectPrice]
|
|
|
tempItem.forEach((item: any) => {
|
|
|
const index = subjectPriceList.findIndex(
|
|
|
(subject: any) => subject.subjectId === item
|
|
@@ -234,10 +238,12 @@ export default defineComponent({
|
|
|
setTimeout(() => {
|
|
|
postMessage({ api: 'back', content: {} })
|
|
|
}, 500)
|
|
|
- } catch {}
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
} else {
|
|
|
this.$nextTick(() => {
|
|
|
- let isError = document.getElementsByClassName('is-error')
|
|
|
+ const isError = document.getElementsByClassName('is-error')
|
|
|
isError[0].scrollIntoView({
|
|
|
block: 'center',
|
|
|
behavior: 'smooth'
|
|
@@ -323,6 +329,17 @@ export default defineComponent({
|
|
|
class="w-full"
|
|
|
placeholder="请选择单课时时长"
|
|
|
v-model={this.form.courseMinutes}
|
|
|
+ onChange={(item: any) => {
|
|
|
+ // 如果分钟数不同,则清空
|
|
|
+ this.timerObject = {}
|
|
|
+ this.form.setting = '未设置'
|
|
|
+ // 设置空余时间
|
|
|
+ this.minutes.forEach((mins: any) => {
|
|
|
+ if (mins.courseMinutes === item) {
|
|
|
+ this.form.freeMinutes = mins.freeMinutes
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }}
|
|
|
>
|
|
|
{this.minutes.map((item: any) => (
|
|
|
<ElOption
|