tab-params.vue
5.44 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<template>
<div>
<Form>
<FormItem>
<Select v-model="action_">
<Option v-for="item in actionList" :value="item.value" :label="item.label"></Option>
</Select>
</FormItem>
<FormItem>
<h5-url v-if="action_ === 'go.h5'" v-model="url_"></h5-url>
<pool-url v-else-if="action_ === 'go.pool'" v-model="url_"></pool-url>
<detail-url v-else-if="action_ === 'go.detail'" v-model="url_"></detail-url>
<list-url v-else-if="action_ === 'go.list'" v-model="url_"></list-url>
<calendar-url v-else-if="action_ === 'go.calendar'" v-model="url_"></calendar-url>
<hotlist-url v-else-if="action_ === 'go.hotlist'" v-model="url_"></hotlist-url>
</FormItem>
</Form>
</div>
</template>
<script>
import h5 from './banner-h5';
import pool from './banner-pool';
import detail from './banner-detail';
import list from './banner-list';
import calendar from './banner-calendar';
import hotlist from './banner-hotlist';
import util from '@/libs/util';
export default {
props: ['value','type'],
data() {
return {
url_: this.value.url,
action_: this.value.action,
islogin: this.value.islogin,
headerid: this.value.headerid,
actionList: this.initAction(),
// [
// {
// value: 'go.h5',
// label: 'H5网页',
// isShow: true,
// },
// {
// value: 'go.pool',
// label: '商品池',
// isShow: true,
// },
// {
// value: 'go.detail',
// label: '商品详情',
// isShow: true,
// },
// {
// value: 'go.list',
// label: '商品列表',
// },
// {
// value: 'go.calendar',
// label: '发售日历页',
// },
// {
// value: 'go.hotlist',
// label: '热卖列表页',
// },
// {
// value: 'go.bargainlist',
// label: '砍价列表页',
// },
// {
// value: 'go.identifyList',
// label: '鉴定服务',
// }
// ]
};
},
// updated() {
// this.loggerValue();
// },
methods: {
// loggerValue(){
// console.log('loggerValue===this.type')
// console.log(this.type)
// },
initAction() {
// console.log('loggerValue===this.value_')
// console.log(this.type)
let action = [];
if(this.type === 'H5'){
action = [
{
value: 'go.h5',
label: 'H5网页',
},
{
value: 'go.pool',
label: '商品池',
},
{
value: 'go.list',
label: '商品列表',
},
{
value: 'go.detail',
label: '商品详情',
},
]
}else {
action = [
{
value: 'go.h5',
label: 'H5网页',
},
{
value: 'go.pool',
label: '商品池',
},
{
value: 'go.detail',
label: '商品详情',
},
{
value: 'go.list',
label: '商品列表',
},
{
value: 'go.calendar',
label: '发售日历页',
},
{
value: 'go.hotlist',
label: '热卖列表页',
},
{
value: 'go.bargainlist',
label: '砍价列表页',
},
{
value: 'go.identifyList',
label: '鉴定服务',
}
]
}
return action;
},
updateStatus() {
// console.log('updateStatus');
const data = {url: this.url_, action: this.action_};
if (this.islogin) {
data.islogin = this.islogin;
}
if (this.headerid) {
data.headerid = this.headerid;
}
this.$emit('input', data);
}
},
watch: {
url_(newVal) {
// console.log('url_');
// console.log(newVal);
this.updateStatus();
},
action_(newVal) {
// console.log('action_');
// console.log(newVal);
if (newVal === 'go.detail') {
this.url_ = 'https://m.yohobuy.com/?pagename=productDetail';
} else if (newVal === 'go.pool') {
this.url_ = 'https://m.yohobuy.com/?pagename=productList';
} else if (newVal === 'go.list') {
this.url_ = '';
} else if (newVal === 'go.h5') {
this.url_ = '';
} else if (newVal === 'go.calendar') {
this.url_ = 'https://m.yohobuy.com/?pagename=saleCalendar';
} else if (newVal === 'go.hotlist') {
this.url_ = 'https://m.yohobuy.com/?pagename=hotSale';
} else if (newVal === 'go.bargainlist') { // 砍价列表
this.url_ = 'https://m.yohobuy.com/';
} else if('go.identifyList') {
this.url_ = 'https://m.yohobuy.com/?pagename=identifyList';
}
this.updateStatus();
}
},
components: {
h5Url: h5,
poolUrl: pool,
detailUrl: detail,
listUrl: list,
calendarUrl: calendar,
hotlistUrl: hotlist
}
};
</script>
<style>
</style>