1
|
<template>
|
1
|
<template>
|
2
|
<Tabs size="small">
|
2
|
<Tabs size="small">
|
3
|
<TabPane label="基础配置">
|
3
|
<TabPane label="基础配置">
|
4
|
- <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="120">
|
4
|
+ <div class="base-conf">
|
|
|
5
|
+ <div class="base-left">
|
|
|
6
|
+ <Form :label-width="120">
|
5
|
<FormItem label="活动规则" required>
|
7
|
<FormItem label="活动规则" required>
|
6
|
- <Input type="textarea" :autosize="{minRows: 2,maxRows: 30}"
|
8
|
+ <Input type="textarea" v-model="conf.rule"
|
7
|
placeholder="请输入活动规则" :maxlength="2000"></Input>
|
9
|
placeholder="请输入活动规则" :maxlength="2000"></Input>
|
8
|
</FormItem>
|
10
|
</FormItem>
|
9
|
<FormItem label="分享链接" required>
|
11
|
<FormItem label="分享链接" required>
|
10
|
- <Input type="text"
|
12
|
+ <Input type="text" v-model="conf.share_url"
|
11
|
placeholder="活动分享链接"></Input>
|
13
|
placeholder="活动分享链接"></Input>
|
12
|
</FormItem>
|
14
|
</FormItem>
|
13
|
<FormItem label="提示文案(上)" required>
|
15
|
<FormItem label="提示文案(上)" required>
|
14
|
- <Input type="text"
|
16
|
+ <Input type="text" v-model="conf.btm_tip_one"
|
15
|
placeholder="提示文案(上)"></Input>
|
17
|
placeholder="提示文案(上)"></Input>
|
16
|
</FormItem>
|
18
|
</FormItem>
|
17
|
<FormItem label="提示文案(下)" required>
|
19
|
<FormItem label="提示文案(下)" required>
|
18
|
- <Input type="text"
|
20
|
+ <Input type="text" v-model="conf.btm_tip_two"
|
19
|
placeholder="提示文案(下)"></Input>
|
21
|
placeholder="提示文案(下)"></Input>
|
20
|
</FormItem>
|
22
|
</FormItem>
|
21
|
<FormItem label="跳转链接(左)" required>
|
23
|
<FormItem label="跳转链接(左)" required>
|
22
|
- <Input type="text"
|
24
|
+ <Input type="text" v-model="conf.jump_url_left"
|
23
|
placeholder="活动底部链接(左)"></Input>
|
25
|
placeholder="活动底部链接(左)"></Input>
|
24
|
</FormItem>
|
26
|
</FormItem>
|
25
|
<FormItem label="跳转链接(右)" required>
|
27
|
<FormItem label="跳转链接(右)" required>
|
26
|
- <Input type="text"
|
28
|
+ <Input type="text" v-model="conf.jump_url_right"
|
27
|
placeholder="活动底部链接(右)"></Input>
|
29
|
placeholder="活动底部链接(右)"></Input>
|
28
|
</FormItem>
|
30
|
</FormItem>
|
29
|
<FormItem label="活动最大参与次数" required>
|
31
|
<FormItem label="活动最大参与次数" required>
|
30
|
- <Input type="text"
|
32
|
+ <Input type="text" v-model="conf.act_total_times"
|
31
|
placeholder="活动最大参与次数"></Input>
|
33
|
placeholder="活动最大参与次数"></Input>
|
32
|
</FormItem>
|
34
|
</FormItem>
|
33
|
<FormItem label="每天最大抽奖次数" required>
|
35
|
<FormItem label="每天最大抽奖次数" required>
|
34
|
- <Input type="text"
|
36
|
+ <Input type="text" v-model="conf.day_limit_times"
|
35
|
placeholder="每天最大抽奖次数"></Input>
|
37
|
placeholder="每天最大抽奖次数"></Input>
|
36
|
</FormItem>
|
38
|
</FormItem>
|
37
|
- <FormItem>
|
|
|
38
|
- <Button type="primary" @click="handleSubmit('formValidate')">保存</Button>
|
|
|
39
|
- <Button type="warning" @click="handleSubmit('formValidate')">预览</Button>
|
39
|
+ </Form>
|
|
|
40
|
+ </div>
|
|
|
41
|
+ <div class="base-right">
|
|
|
42
|
+ <Form :label-width="120">
|
|
|
43
|
+ <FormItem label="主背景图" prop="prize_bg" required>
|
|
|
44
|
+ <img class="win-prize-bg" v-show="conf.main_bg" :src="conf.main_bg">
|
|
|
45
|
+ <Button v-show="!conf.main_bg">
|
|
|
46
|
+ <span ref="winPrizeBg">添加</span>
|
|
|
47
|
+ </Button>
|
|
|
48
|
+ </FormItem>
|
|
|
49
|
+ <FormItem label="转盘背景图" prop="prize_bg" required>
|
|
|
50
|
+ <img class="win-prize-bg" v-show="conf.wheel_bg" :src="conf.wheel_bg">
|
|
|
51
|
+ <Button v-show="!conf.wheel_bg">
|
|
|
52
|
+ <span ref="winPrizeBg">添加</span>
|
|
|
53
|
+ </Button>
|
40
|
</FormItem>
|
54
|
</FormItem>
|
41
|
</Form>
|
55
|
</Form>
|
|
|
56
|
+ </div>
|
|
|
57
|
+ <div class="bottom-btn">
|
|
|
58
|
+ <Button type="primary" @click="save" class="save">保存</Button>
|
|
|
59
|
+ <Button type="warning" @click="save" class="preview">预览</Button>
|
|
|
60
|
+ </div>
|
|
|
61
|
+ </div>
|
42
|
</TabPane>
|
62
|
</TabPane>
|
43
|
<TabPane label="奖品配置">
|
63
|
<TabPane label="奖品配置">
|
44
|
- <add-prize v-for="item in prizes" :key="item"></add-prize>
|
64
|
+ <add-prize></add-prize>
|
45
|
</TabPane>
|
65
|
</TabPane>
|
46
|
</Tabs>
|
66
|
</Tabs>
|
47
|
</template>
|
67
|
</template>
|
|
@@ -51,44 +71,112 @@ |
|
@@ -51,44 +71,112 @@ |
51
|
export default {
|
71
|
export default {
|
52
|
data () {
|
72
|
data () {
|
53
|
return {
|
73
|
return {
|
54
|
- formValidate: {
|
|
|
55
|
- name: '',
|
|
|
56
|
- mail: '',
|
|
|
57
|
- city: '',
|
|
|
58
|
- gender: '',
|
|
|
59
|
- interest: [],
|
|
|
60
|
- date: '',
|
|
|
61
|
- time: '',
|
|
|
62
|
- desc: ''
|
|
|
63
|
- },
|
|
|
64
|
- ruleValidate: {
|
|
|
65
|
-
|
|
|
66
|
- },
|
|
|
67
|
- prizes: [1]
|
74
|
+ actId: 0,
|
|
|
75
|
+ confId: 0,
|
|
|
76
|
+ prizes: [1],
|
|
|
77
|
+ conf: {
|
|
|
78
|
+ act_id: 0,
|
|
|
79
|
+ id: 0,
|
|
|
80
|
+ rule: '',
|
|
|
81
|
+ share_url: '',
|
|
|
82
|
+ day_limit_times: '',
|
|
|
83
|
+ act_total_times: '',
|
|
|
84
|
+ btm_tip_one: '',
|
|
|
85
|
+ btm_tip_two: '',
|
|
|
86
|
+ jump_url_left: '',
|
|
|
87
|
+ jump_url_right: '',
|
|
|
88
|
+ wheel_bg: '',
|
|
|
89
|
+ main_bg: '',
|
|
|
90
|
+ prize_btn_bg: '',
|
|
|
91
|
+ rule_btn_bg: '',
|
|
|
92
|
+ share_btn_bg: '',
|
|
|
93
|
+ day_over_limit_bg: '',
|
|
|
94
|
+ my_prize_btn: ''
|
|
|
95
|
+ }
|
68
|
}
|
96
|
}
|
69
|
},
|
97
|
},
|
70
|
methods: {
|
98
|
methods: {
|
71
|
- handleSubmit (name) {
|
|
|
72
|
- this.$refs[name].validate((valid) => {
|
|
|
73
|
- if (valid) {
|
|
|
74
|
- this.$Message.success('Success!');
|
99
|
+ bindUpload() {
|
|
|
100
|
+ window.qn_dynamic_el_upload(this.$refs.winPrizeBg, url => {
|
|
|
101
|
+ this.prize.prize_bg = url;
|
|
|
102
|
+ });
|
|
|
103
|
+ },
|
|
|
104
|
+ save() {
|
|
|
105
|
+ $.ajax({
|
|
|
106
|
+ method: 'post',
|
|
|
107
|
+ url: '/admin/wheelSurf/api/config/modify',
|
|
|
108
|
+ contentType: 'application/json',
|
|
|
109
|
+ data: JSON.stringify(Object.assign(this.conf, {act_id: this.actId}))
|
|
|
110
|
+ }).then(res => {
|
|
|
111
|
+ if (res.code === 200) {
|
|
|
112
|
+ this.$Message.success('奖品新增成功');
|
|
|
113
|
+ this.prizeList();
|
75
|
} else {
|
114
|
} else {
|
76
|
- this.$Message.error('Fail!');
|
115
|
+ this.$Message.error(res.msg);
|
77
|
}
|
116
|
}
|
78
|
- })
|
117
|
+ });
|
79
|
},
|
118
|
},
|
80
|
- handleReset (name) {
|
|
|
81
|
- this.$refs[name].resetFields();
|
119
|
+ getConf() {
|
|
|
120
|
+ $.ajax({
|
|
|
121
|
+ url: '/admin/wheelSurf/api/config/detail',
|
|
|
122
|
+ data: {act_id: this.actId}
|
|
|
123
|
+ }).then(res => {
|
|
|
124
|
+ if (res.code === 200 && res.data && res.data.id) {
|
|
|
125
|
+ this.conf = res.data;
|
|
|
126
|
+ } else {
|
|
|
127
|
+ this.$Message.error(res.msg);
|
|
|
128
|
+ }
|
|
|
129
|
+ });
|
82
|
}
|
130
|
}
|
83
|
},
|
131
|
},
|
|
|
132
|
+ mounted() {
|
|
|
133
|
+ this.actId = this.$route.query.actId;
|
|
|
134
|
+ this.bindUpload();
|
|
|
135
|
+ this.getConf();
|
|
|
136
|
+ },
|
84
|
components: {
|
137
|
components: {
|
85
|
AddPrize
|
138
|
AddPrize
|
86
|
- },
|
|
|
87
|
- mounted() {
|
|
|
88
|
}
|
139
|
}
|
89
|
}
|
140
|
}
|
90
|
</script>
|
141
|
</script>
|
91
|
<style lang="scss">
|
142
|
<style lang="scss">
|
|
|
143
|
+ .ivu-tabs {
|
|
|
144
|
+ height: 100%;
|
|
|
145
|
+ }
|
|
|
146
|
+
|
|
|
147
|
+ .bottom-btn {
|
|
|
148
|
+ position: absolute;
|
|
|
149
|
+ bottom: 0;
|
|
|
150
|
+ left: 0;
|
|
|
151
|
+ right: 0;
|
|
|
152
|
+ text-align: center;
|
|
|
153
|
+ }
|
|
|
154
|
+
|
|
|
155
|
+ .base-conf {
|
|
|
156
|
+ font-size: 0;
|
|
|
157
|
+ padding-bottom: 40px;
|
|
|
158
|
+
|
|
|
159
|
+ .base-left, .base-right {
|
|
|
160
|
+ display: inline-block;
|
|
|
161
|
+ width: 50%;
|
|
|
162
|
+ box-sizing: border-box;
|
|
|
163
|
+ }
|
|
|
164
|
+
|
|
|
165
|
+ .base-left {
|
|
|
166
|
+ padding-right: 20px;
|
|
|
167
|
+ }
|
|
|
168
|
+
|
|
|
169
|
+ .base-right {
|
|
|
170
|
+ font-size: 16px;
|
|
|
171
|
+ vertical-align: top;
|
|
|
172
|
+ }
|
|
|
173
|
+
|
|
|
174
|
+ .save {
|
|
|
175
|
+ margin-right: 20px;
|
|
|
176
|
+ }
|
|
|
177
|
+ }
|
|
|
178
|
+
|
|
|
179
|
+
|
92
|
</style>
|
180
|
</style>
|
93
|
|
181
|
|
94
|
|
182
|
|