banner-params.vue
1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<template>
<div>
<Form>
<FormItem>
<Select v-model="action_">
<Option value="go.h5">H5网页</Option>
<Option value="go.ufo">商品列表页</Option>
<Option value="go.pool">商品池</Option>
</Select>
</FormItem>
<FormItem>
<h5-url v-if="action_ === 'go.h5'" v-model="url_"></h5-url>
<ufo-url v-else-if="action_ === 'go.ufo'" v-model="url_"></ufo-url>
<pool-url v-else-if="action_ === 'go.pool'" v-model="url_"></pool-url>
</FormItem>
</Form>
</div>
</template>
<script>
import h5 from './banner-h5'
import ufo from './banner-ufo'
import pool from './banner-pool'
export default {
props: ['value'],
data() {
return {
url_: this.value.url,
action_: this.value.action
}
},
methods: {
},
watch: {
url_(newVal) {
this.$emit('input', {url: this.url_, action: this.action_})
},
action_(newVal) {
if (newVal === 'go.pool') {
this.url_ = 'https://m.yohobuy.com/?pagename=productDetail'
} else if (newVal === 'go.ufo') {
this.url_ = 'https://m.yohobuy.com/?pagename=productList'
} else if (newVal === 'go.h5' ){
this.url_ = ''
}
this.$emit('input', {url: this.url_, action: this.action_})
}
},
components: {
h5Url: h5,
ufoUrl: ufo,
poolUrl: pool
}
}
</script>
<style>
</style>