Authored by htoooth

banner editor

@@ -12,16 +12,48 @@ @@ -12,16 +12,48 @@
12 <th> 12 <th>
13 <Form> 13 <Form>
14 <FormItem> 14 <FormItem>
15 - <Select> 15 + <Select v-model="i.url.action">
16 <Option value="go.h5">H5网页</Option> 16 <Option value="go.h5">H5网页</Option>
17 <Option value="go.ufo">商品列表页</Option> 17 <Option value="go.ufo">商品列表页</Option>
18 <Option value="go.pool">商品池</Option> 18 <Option value="go.pool">商品池</Option>
19 </Select> 19 </Select>
20 </FormItem> 20 </FormItem>
21 21
22 - <FormItem>  
23 - <Input/>  
24 - </FormItem> 22 + <template v-if="i.url.action === 'go.h5'">
  23 + <FormItem>
  24 + <Input v-model="i.url.title" placeholder="参数"/>
  25 +
  26 + </FormItem>
  27 + <FormItem>
  28 + <Input v-model="i.url.url" placeholder="参数"/>
  29 + </FormItem>
  30 + </template>
  31 +
  32 + <template v-if="i.url.action === 'go.ufo'">
  33 + <FormItem>
  34 + <Input v-model="i.url.productListTitle" placeholder="参数"/>
  35 + </FormItem>
  36 +
  37 + <FormItem>
  38 + <Input v-model="i.url.productPool" placeholder="参数"/>
  39 + </FormItem>
  40 +
  41 + <FormItem>
  42 + <Input v-model="i.url.url" placeholder="参数"/>
  43 + </FormItem>
  44 +
  45 + </template>
  46 +
  47 + <template v-if="i.url.action === 'go.pool'">
  48 + <FormItem>
  49 + <Input v-model="i.url.productId" placeholder="参数"/>
  50 + </FormItem>
  51 +
  52 + <FormItem>
  53 + <Input v-model="i.url.url" placeholder="参数"/>
  54 + </FormItem>
  55 + </template>
  56 +
25 </Form> 57 </Form>
26 </th> 58 </th>
27 59
@@ -87,12 +119,24 @@ export default { @@ -87,12 +119,24 @@ export default {
87 119
88 for (const i of keys) { 120 for (const i of keys) {
89 let a = m[i]; 121 let a = m[i];
  122 + let url = new URL(a.url.url);
  123 + let params = new URLSearchParams(url.search);
  124 +
  125 + a.url.url = `${url.origin}${url.pathname}`
90 126
91 - console.log(a); 127 + if (a.url.action === 'go.ufo' && params.get('pagename') === 'productDetail') {
  128 + a.url.action = 'go.pool'
  129 + }
  130 +
  131 + for (let p of params) {
  132 + a.url[p[0]] = p[1]
  133 + }
92 134
93 result.push(a) 135 result.push(a)
94 } 136 }
95 137
  138 + console.log(result);
  139 +
96 return result; 140 return result;
97 } 141 }
98 }, 142 },