Commit 7d5b41de by 李伟康

commit 修改样式&增加默认显示

1 parent 0358834c
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
> >
<view name="content"> <view name="content">
<template v-if="step == 1"> <template v-if="step == 1">
<template v-if="!check(true)">
<view <view
class="error-tip" class="error-tip"
v-if="errorTip" v-if="errorTip"
...@@ -21,6 +22,7 @@ ...@@ -21,6 +22,7 @@
class="pop-tips" class="pop-tips"
v-else v-else
>检测到“交车通知书”中未填写客户档案,请填写后再完成接待。</view> >检测到“交车通知书”中未填写客户档案,请填写后再完成接待。</view>
</template>
<view class="form"> <view class="form">
<template v-for="(i, index) in formObject"> <template v-for="(i, index) in formObject">
<view <view
...@@ -202,12 +204,12 @@ export default { ...@@ -202,12 +204,12 @@ export default {
this.receptionStatus = -1 this.receptionStatus = -1
this.$refs.formRef.close() this.$refs.formRef.close()
}, },
check () { check (all = false) {
let flag = true let flag = true
try { try {
Object.keys(this.formData).map(key => { Object.keys(this.formData).map(key => {
if (!this.formData[key]) throw false if (!this.formData[key]) throw false
if (key == 'phoneNumber' && this.formData[key] && !phoneRex.test(this.formData[key])) throw false if (!all && key == 'phoneNumber' && this.formData[key] && !phoneRex.test(this.formData[key])) throw false
}) })
} catch (error) { } catch (error) {
flag = error flag = error
......
...@@ -7,7 +7,10 @@ ...@@ -7,7 +7,10 @@
class="content" class="content"
:style="{background:background}" :style="{background:background}"
> >
<view class="title" v-if="title">{{title}}</view> <view
class="title"
v-if="title"
>{{title}}</view>
<template v-if="views.length && views.length > 1"> <template v-if="views.length && views.length > 1">
<tabs <tabs
:list="views" :list="views"
...@@ -44,7 +47,11 @@ export default { ...@@ -44,7 +47,11 @@ export default {
title: String, title: String,
madiaId: Number, madiaId: Number,
mediaBg: String, mediaBg: String,
background: String background: String,
defaultIndex: {
type: Number,
default: 0
}
}, },
name: 'MediaComponent', name: 'MediaComponent',
data () { data () {
...@@ -56,7 +63,7 @@ export default { ...@@ -56,7 +63,7 @@ export default {
watchStatus: { watchStatus: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
this.$refs?.tabs?.tabClick(0) this.$refs?.tabs?.tabClick(this.defaultIndex)
} }
}, },
}, },
...@@ -66,6 +73,7 @@ export default { ...@@ -66,6 +73,7 @@ export default {
}, },
}, },
mounted () { mounted () {
this.$refs?.tabs?.tabClick(this.defaultIndex)
}, },
methods: { methods: {
changeView (index) { changeView (index) {
......
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
:mediaBg="item.top_bg" :mediaBg="item.top_bg"
:madiaId="item.id" :madiaId="item.id"
:background="item.background" :background="item.background"
:defaultIndex="item.id == 4 ? 1 : 0"
/> />
</view> </view>
</template> </template>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!