commit
Showing
3 changed files
with
125 additions
and
1 deletions
src/page/chouJiang.vue
0 → 100644
| 1 | <template xmlns:el-col="http://www.w3.org/1999/html"> | ||
| 2 | <div> | ||
| 3 | <json-viewer | ||
| 4 | :value="jsonData" | ||
| 5 | :expand-depth=10 | ||
| 6 | copyable></json-viewer> | ||
| 7 | </div> | ||
| 8 | </template> | ||
| 9 | |||
| 10 | <script> | ||
| 11 | export default { | ||
| 12 | data() { | ||
| 13 | return { | ||
| 14 | actid: this.$route.query.actid, | ||
| 15 | keyword: this.$route.query.keyword, | ||
| 16 | phone: this.$route.query.phone, | ||
| 17 | code: this.$route.query.code, | ||
| 18 | type: this.$route.query.type, | ||
| 19 | jsonData: '' | ||
| 20 | } | ||
| 21 | }, | ||
| 22 | mounted() { | ||
| 23 | this.activity() | ||
| 24 | }, | ||
| 25 | methods: { | ||
| 26 | activity() { | ||
| 27 | const loading = this.$loading({ | ||
| 28 | lock: true, | ||
| 29 | text: '加载中...', | ||
| 30 | spinner: 'el-icon-loading', | ||
| 31 | background: 'rgba(0, 0, 0, 0.7)' | ||
| 32 | }); | ||
| 33 | let config = { | ||
| 34 | headers: { | ||
| 35 | 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 36 | } | ||
| 37 | } | ||
| 38 | this.$http.get('/tool2/chouJiang?'+this.$qs.stringify({ | ||
| 39 | actid: this.actid, | ||
| 40 | keyword: this.keyword, | ||
| 41 | phone: this.phone, | ||
| 42 | code: this.code, | ||
| 43 | type: this.type | ||
| 44 | }),config).then((res)=>{ | ||
| 45 | console.log(res.data) | ||
| 46 | this.jsonData=res.data | ||
| 47 | loading.close(); | ||
| 48 | }).catch(error=>{ | ||
| 49 | console.log(error); | ||
| 50 | loading.close(); | ||
| 51 | this.$message({ | ||
| 52 | showClose: true, | ||
| 53 | message: '服务器处理失败,请核对参数!', | ||
| 54 | type: 'error' | ||
| 55 | }); | ||
| 56 | }) | ||
| 57 | } | ||
| 58 | } | ||
| 59 | } | ||
| 60 | </script> |
| ... | @@ -129,6 +129,42 @@ | ... | @@ -129,6 +129,42 @@ |
| 129 | </el-card> | 129 | </el-card> |
| 130 | </el-form> | 130 | </el-form> |
| 131 | </el-col> | 131 | </el-col> |
| 132 | <el-col :span="8"> | ||
| 133 | <el-form ref="chouJiang" :model="chouJiang" label-width="0px"> | ||
| 134 | <el-card class="darkred" shadow="always"> | ||
| 135 | <div slot="header" class="clearfix"> | ||
| 136 | <span>AI2.0抽奖</span> | ||
| 137 | </div> | ||
| 138 | <div class="text item"> | ||
| 139 | <el-form-item> | ||
| 140 | <el-input placeholder="请输入活动ID" v-model="chouJiang.actid" clearable></el-input> | ||
| 141 | </el-form-item> | ||
| 142 | <el-form-item> | ||
| 143 | <el-input placeholder="请输入吼礼关键词,普通抽奖不需要输入" v-model="chouJiang.keyword" clearable></el-input> | ||
| 144 | </el-form-item> | ||
| 145 | <el-form-item> | ||
| 146 | <el-input placeholder="请输入手机号" v-model="chouJiang.phone" clearable></el-input> | ||
| 147 | </el-form-item> | ||
| 148 | <el-form-item> | ||
| 149 | <el-input placeholder="请输入手机登录验证码" v-model="chouJiang.code" clearable></el-input> | ||
| 150 | </el-form-item> | ||
| 151 | <el-form-item> | ||
| 152 | <el-select v-model="chouJiang.type" placeholder="请选择抽奖接口"> | ||
| 153 | <el-option | ||
| 154 | v-for="item in chouJiangOptions" | ||
| 155 | :key="item.value" | ||
| 156 | :label="item.label" | ||
| 157 | :value="item.value"> | ||
| 158 | </el-option> | ||
| 159 | </el-select> | ||
| 160 | </el-form-item> | ||
| 161 | <el-form-item> | ||
| 162 | <el-button round @click="chouJiangSubmit">抽奖</el-button> | ||
| 163 | </el-form-item> | ||
| 164 | </div> | ||
| 165 | </el-card> | ||
| 166 | </el-form> | ||
| 167 | </el-col> | ||
| 132 | </el-row> | 168 | </el-row> |
| 133 | </div> | 169 | </div> |
| 134 | </template> | 170 | </template> |
| ... | @@ -252,6 +288,20 @@ | ... | @@ -252,6 +288,20 @@ |
| 252 | }, { | 288 | }, { |
| 253 | value: 'recommend', | 289 | value: 'recommend', |
| 254 | label: 'recommend' | 290 | label: 'recommend' |
| 291 | }], | ||
| 292 | chouJiang: { | ||
| 293 | actid: '', | ||
| 294 | keyword: '', | ||
| 295 | phone: '', | ||
| 296 | code: '', | ||
| 297 | type: [] | ||
| 298 | }, | ||
| 299 | chouJiangOptions: [{ | ||
| 300 | value: '1', | ||
| 301 | label: '普通抽奖接口' | ||
| 302 | },{ | ||
| 303 | value: '2', | ||
| 304 | label: '吼礼抽奖接口' | ||
| 255 | }] | 305 | }] |
| 256 | } | 306 | } |
| 257 | }, | 307 | }, |
| ... | @@ -407,7 +457,12 @@ | ... | @@ -407,7 +457,12 @@ |
| 407 | type: 'error' | 457 | type: 'error' |
| 408 | }); | 458 | }); |
| 409 | }) | 459 | }) |
| 410 | } | 460 | }, |
| 461 | chouJiangSubmit() { | ||
| 462 | const {href} = this.$router.resolve({ name:'chouJiang', query: | ||
| 463 | {actid: this.chouJiang.actid, keyword: this.chouJiang.keyword, phone: this.chouJiang.phone, code: this.chouJiang.code, type: this.chouJiang.type.toString()}}) | ||
| 464 | window.open(href, '_blank') | ||
| 465 | }, | ||
| 411 | } | 466 | } |
| 412 | } | 467 | } |
| 413 | </script> | 468 | </script> | ... | ... |
| ... | @@ -21,6 +21,7 @@ import selectActStart from '@/page/selectActStart' | ... | @@ -21,6 +21,7 @@ import selectActStart from '@/page/selectActStart' |
| 21 | import androidCode from '@/page/androidCode' | 21 | import androidCode from '@/page/androidCode' |
| 22 | import queryTjAccount from '@/page/queryTjAccount' | 22 | import queryTjAccount from '@/page/queryTjAccount' |
| 23 | import testHouLi from '@/page/testHouLi' | 23 | import testHouLi from '@/page/testHouLi' |
| 24 | import chouJiang from '@/page/chouJiang' | ||
| 24 | 25 | ||
| 25 | Vue.use(Router) | 26 | Vue.use(Router) |
| 26 | 27 | ||
| ... | @@ -199,6 +200,14 @@ export default new Router({ | ... | @@ -199,6 +200,14 @@ export default new Router({ |
| 199 | meta: { | 200 | meta: { |
| 200 | title: '测试工具平台' | 201 | title: '测试工具平台' |
| 201 | } | 202 | } |
| 203 | }, | ||
| 204 | { | ||
| 205 | path: '/chouJiang', | ||
| 206 | component: chouJiang, | ||
| 207 | name: 'chouJiang', | ||
| 208 | meta: { | ||
| 209 | title: '测试工具平台' | ||
| 210 | } | ||
| 202 | } | 211 | } |
| 203 | ] | 212 | ] |
| 204 | }) | 213 | }) | ... | ... |
-
Please register or sign in to post a comment