Procházet zdrojové kódy

活动分享页和活动预览页

庄逸洲 před 5 roky
rodič
revize
7bb3388752

+ 223 - 4
package-lock.json Zobrazit soubor

@@ -1876,6 +1876,14 @@
1876 1876
         }
1877 1877
       }
1878 1878
     },
1879
+    "can-promise": {
1880
+      "version": "0.0.1",
1881
+      "resolved": "https://registry.npmjs.org/can-promise/-/can-promise-0.0.1.tgz",
1882
+      "integrity": "sha512-gzVrHyyrvgt0YpDm7pn04MQt8gjh0ZAhN4ZDyCRtGl6YnuuK6b4aiUTD7G52r9l4YNmxfTtEscb92vxtAlL6XQ==",
1883
+      "requires": {
1884
+        "window-or-global": "^1.0.1"
1885
+      }
1886
+    },
1879 1887
     "caniuse-api": {
1880 1888
       "version": "1.6.1",
1881 1889
       "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-1.6.1.tgz",
@@ -3326,6 +3334,11 @@
3326 3334
         "randombytes": "^2.0.0"
3327 3335
       }
3328 3336
     },
3337
+    "dijkstrajs": {
3338
+      "version": "1.0.1",
3339
+      "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.1.tgz",
3340
+      "integrity": "sha1-082BIh4+pAdCz83lVtTpnpjdxxs="
3341
+    },
3329 3342
     "dir-glob": {
3330 3343
       "version": "2.2.2",
3331 3344
       "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz",
@@ -3537,7 +3550,6 @@
3537 3550
       "version": "1.4.1",
3538 3551
       "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
3539 3552
       "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
3540
-      "dev": true,
3541 3553
       "requires": {
3542 3554
         "once": "^1.4.0"
3543 3555
       }
@@ -7163,6 +7175,14 @@
7163 7175
         "pify": "^3.0.0"
7164 7176
       }
7165 7177
     },
7178
+    "map-age-cleaner": {
7179
+      "version": "0.1.3",
7180
+      "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz",
7181
+      "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==",
7182
+      "requires": {
7183
+        "p-defer": "^1.0.0"
7184
+      }
7185
+    },
7166 7186
     "map-cache": {
7167 7187
       "version": "0.2.2",
7168 7188
       "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
@@ -7536,6 +7556,11 @@
7536 7556
       "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=",
7537 7557
       "dev": true
7538 7558
     },
7559
+    "nice-try": {
7560
+      "version": "1.0.5",
7561
+      "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
7562
+      "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="
7563
+    },
7539 7564
     "no-case": {
7540 7565
       "version": "2.3.2",
7541 7566
       "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz",
@@ -8003,7 +8028,6 @@
8003 8028
       "version": "1.4.0",
8004 8029
       "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
8005 8030
       "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
8006
-      "dev": true,
8007 8031
       "requires": {
8008 8032
         "wrappy": "1"
8009 8033
       }
@@ -8166,11 +8190,21 @@
8166 8190
         "os-tmpdir": "^1.0.0"
8167 8191
       }
8168 8192
     },
8193
+    "p-defer": {
8194
+      "version": "1.0.0",
8195
+      "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz",
8196
+      "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww="
8197
+    },
8169 8198
     "p-finally": {
8170 8199
       "version": "1.0.0",
8171 8200
       "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
8172 8201
       "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4="
8173 8202
     },
8203
+    "p-is-promise": {
8204
+      "version": "2.1.0",
8205
+      "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz",
8206
+      "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg=="
8207
+    },
8174 8208
     "p-limit": {
8175 8209
       "version": "1.3.0",
8176 8210
       "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
@@ -8444,6 +8478,11 @@
8444 8478
       "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==",
8445 8479
       "dev": true
8446 8480
     },
8481
+    "pngjs": {
8482
+      "version": "3.4.0",
8483
+      "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz",
8484
+      "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w=="
8485
+    },
8447 8486
     "portfinder": {
8448 8487
       "version": "1.0.13",
8449 8488
       "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.13.tgz",
@@ -11226,6 +11265,182 @@
11226 11265
       "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=",
11227 11266
       "dev": true
11228 11267
     },
11268
+    "qrcode": {
11269
+      "version": "1.3.3",
11270
+      "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.3.3.tgz",
11271
+      "integrity": "sha512-SH7V13AcJusH3GT8bMNOGz4w0L+LjcpNOU/NiOgtBhT/5DoWeZE6D5ntMJnJ84AMkoaM4kjJJoHoh9g++8lWFg==",
11272
+      "requires": {
11273
+        "can-promise": "0.0.1",
11274
+        "dijkstrajs": "^1.0.1",
11275
+        "isarray": "^2.0.1",
11276
+        "pngjs": "^3.3.0",
11277
+        "yargs": "^12.0.5"
11278
+      },
11279
+      "dependencies": {
11280
+        "camelcase": {
11281
+          "version": "5.3.1",
11282
+          "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
11283
+          "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="
11284
+        },
11285
+        "cross-spawn": {
11286
+          "version": "6.0.5",
11287
+          "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
11288
+          "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
11289
+          "requires": {
11290
+            "nice-try": "^1.0.4",
11291
+            "path-key": "^2.0.1",
11292
+            "semver": "^5.5.0",
11293
+            "shebang-command": "^1.2.0",
11294
+            "which": "^1.2.9"
11295
+          }
11296
+        },
11297
+        "execa": {
11298
+          "version": "1.0.0",
11299
+          "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
11300
+          "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
11301
+          "requires": {
11302
+            "cross-spawn": "^6.0.0",
11303
+            "get-stream": "^4.0.0",
11304
+            "is-stream": "^1.1.0",
11305
+            "npm-run-path": "^2.0.0",
11306
+            "p-finally": "^1.0.0",
11307
+            "signal-exit": "^3.0.0",
11308
+            "strip-eof": "^1.0.0"
11309
+          }
11310
+        },
11311
+        "find-up": {
11312
+          "version": "3.0.0",
11313
+          "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
11314
+          "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
11315
+          "requires": {
11316
+            "locate-path": "^3.0.0"
11317
+          }
11318
+        },
11319
+        "get-stream": {
11320
+          "version": "4.1.0",
11321
+          "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
11322
+          "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
11323
+          "requires": {
11324
+            "pump": "^3.0.0"
11325
+          }
11326
+        },
11327
+        "invert-kv": {
11328
+          "version": "2.0.0",
11329
+          "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz",
11330
+          "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA=="
11331
+        },
11332
+        "isarray": {
11333
+          "version": "2.0.4",
11334
+          "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz",
11335
+          "integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA=="
11336
+        },
11337
+        "lcid": {
11338
+          "version": "2.0.0",
11339
+          "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz",
11340
+          "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==",
11341
+          "requires": {
11342
+            "invert-kv": "^2.0.0"
11343
+          }
11344
+        },
11345
+        "locate-path": {
11346
+          "version": "3.0.0",
11347
+          "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
11348
+          "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
11349
+          "requires": {
11350
+            "p-locate": "^3.0.0",
11351
+            "path-exists": "^3.0.0"
11352
+          }
11353
+        },
11354
+        "mem": {
11355
+          "version": "4.3.0",
11356
+          "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz",
11357
+          "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==",
11358
+          "requires": {
11359
+            "map-age-cleaner": "^0.1.1",
11360
+            "mimic-fn": "^2.0.0",
11361
+            "p-is-promise": "^2.0.0"
11362
+          }
11363
+        },
11364
+        "mimic-fn": {
11365
+          "version": "2.1.0",
11366
+          "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
11367
+          "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="
11368
+        },
11369
+        "os-locale": {
11370
+          "version": "3.1.0",
11371
+          "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz",
11372
+          "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==",
11373
+          "requires": {
11374
+            "execa": "^1.0.0",
11375
+            "lcid": "^2.0.0",
11376
+            "mem": "^4.0.0"
11377
+          }
11378
+        },
11379
+        "p-limit": {
11380
+          "version": "2.2.0",
11381
+          "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz",
11382
+          "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
11383
+          "requires": {
11384
+            "p-try": "^2.0.0"
11385
+          }
11386
+        },
11387
+        "p-locate": {
11388
+          "version": "3.0.0",
11389
+          "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
11390
+          "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
11391
+          "requires": {
11392
+            "p-limit": "^2.0.0"
11393
+          }
11394
+        },
11395
+        "p-try": {
11396
+          "version": "2.2.0",
11397
+          "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
11398
+          "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="
11399
+        },
11400
+        "pump": {
11401
+          "version": "3.0.0",
11402
+          "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
11403
+          "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
11404
+          "requires": {
11405
+            "end-of-stream": "^1.1.0",
11406
+            "once": "^1.3.1"
11407
+          }
11408
+        },
11409
+        "semver": {
11410
+          "version": "5.7.0",
11411
+          "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
11412
+          "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA=="
11413
+        },
11414
+        "yargs": {
11415
+          "version": "12.0.5",
11416
+          "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz",
11417
+          "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==",
11418
+          "requires": {
11419
+            "cliui": "^4.0.0",
11420
+            "decamelize": "^1.2.0",
11421
+            "find-up": "^3.0.0",
11422
+            "get-caller-file": "^1.0.1",
11423
+            "os-locale": "^3.0.0",
11424
+            "require-directory": "^2.1.1",
11425
+            "require-main-filename": "^1.0.1",
11426
+            "set-blocking": "^2.0.0",
11427
+            "string-width": "^2.0.0",
11428
+            "which-module": "^2.0.0",
11429
+            "y18n": "^3.2.1 || ^4.0.0",
11430
+            "yargs-parser": "^11.1.1"
11431
+          }
11432
+        },
11433
+        "yargs-parser": {
11434
+          "version": "11.1.1",
11435
+          "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz",
11436
+          "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==",
11437
+          "requires": {
11438
+            "camelcase": "^5.0.0",
11439
+            "decamelize": "^1.2.0"
11440
+          }
11441
+        }
11442
+      }
11443
+    },
11229 11444
     "qrcodejs2": {
11230 11445
       "version": "0.0.2",
11231 11446
       "resolved": "https://registry.npmjs.org/qrcodejs2/-/qrcodejs2-0.0.2.tgz",
@@ -14823,6 +15038,11 @@
14823 15038
         "string-width": "^1.0.2 || 2"
14824 15039
       }
14825 15040
     },
15041
+    "window-or-global": {
15042
+      "version": "1.0.1",
15043
+      "resolved": "https://registry.npmjs.org/window-or-global/-/window-or-global-1.0.1.tgz",
15044
+      "integrity": "sha1-2+RboqKRqrxW1iz2bEW3+jIpRt4="
15045
+    },
14826 15046
     "window-size": {
14827 15047
       "version": "0.1.0",
14828 15048
       "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz",
@@ -14889,8 +15109,7 @@
14889 15109
     "wrappy": {
14890 15110
       "version": "1.0.2",
14891 15111
       "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
14892
-      "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
14893
-      "dev": true
15112
+      "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
14894 15113
     },
14895 15114
     "write": {
14896 15115
       "version": "0.2.1",

+ 1 - 0
package.json Zobrazit soubor

@@ -54,6 +54,7 @@
54 54
     "normalize.css": "7.0.0",
55 55
     "nprogress": "0.2.0",
56 56
     "print-js": "^1.0.50",
57
+    "qrcode": "^1.3.3",
57 58
     "qrcodejs2": "0.0.2",
58 59
     "screenfull": "4.2.0",
59 60
     "serve-static": "1.13.2",

+ 10 - 0
src/api/activity/activity.js Zobrazit soubor

@@ -74,4 +74,14 @@ export function publishActivity(activity_id) {
74 74
       id: activity_id,
75 75
     }
76 76
   })
77
+}
78
+
79
+export function getActivityShareInfo(activity_id) {
80
+  return request({
81
+    url: "/api/activity/shareinfo",
82
+    method: "get",
83
+    params: {
84
+      id: activity_id,
85
+    }
86
+  })
77 87
 }

+ 5 - 0
src/router/index.js Zobrazit soubor

@@ -68,6 +68,11 @@ var _constant_router_map = [{
68 68
       noCache: true
69 69
     }
70 70
   }]
71
+},
72
+{
73
+  path: '/activity/preview',
74
+  component: () => import('@/scrm_pages/marketing_tool/activity_preview'),
75
+  hidden: true
71 76
 }
72 77
   // service
73 78
 ]

+ 11 - 11
src/router/modules/marketing_tool.js Zobrazit soubor

@@ -61,17 +61,17 @@ export default {
61 61
         noCache: true,
62 62
       }
63 63
     },
64
-    {
65
-      path: "/activity/preview",
66
-      hidden: true,
67
-      is_menu: false,
68
-      component: () => import("@/scrm_pages/marketing_tool/activity_preview"),
69
-      name: "activityPreview",
70
-      meta: {
71
-        title: "activityPreview",
72
-        noCache: true,
73
-      }
74
-    },
64
+    // {
65
+    //   path: "/activity/preview",
66
+    //   hidden: true,
67
+    //   is_menu: false,
68
+    //   component: () => import("@/scrm_pages/marketing_tool/activity_preview"),
69
+    //   name: "activityPreview",
70
+    //   meta: {
71
+    //     title: "activityPreview",
72
+    //     noCache: true,
73
+    //   }
74
+    // },
75 75
     {
76 76
       path: "/activity/signupusers",
77 77
       hidden: true,

+ 3 - 1
src/scrm_pages/marketing_tool/activity_detail.vue Zobrazit soubor

@@ -10,7 +10,9 @@
10 10
                 </div>
11 11
                 <div class="title-panel">
12 12
                     <p class="title">
13
-                        <router-link :to="activity_url">{{ title }}</router-link>
13
+                        <!-- <router-link v-if="activity != null && activity.status == 4" :to="activity_url" target="_blank">{{ title }}</router-link>
14
+                        <router-link v-else :to="activity_url">{{ title }}</router-link> -->
15
+                        <router-link :to="activity_url" target="_blank">{{ title }}</router-link>
14 16
                     </p>
15 17
                     <p class="date">活动日期:{{ activity_time }}</p>
16 18
                 </div>

+ 313 - 2
src/scrm_pages/marketing_tool/activity_preview.vue Zobrazit soubor

@@ -1,14 +1,325 @@
1 1
 <template>
2
-    <div></div>
2
+<div style="background-color: #f6f8f9;">
3
+    <div class="main">
4
+        <div class="border title-panel">
5
+            <img :src="activity.poster_photo"/>
6
+            <div class="text">
7
+                <p class="title">{{ activity.title }}</p>
8
+                <p class="subtitle">{{ activity.subtitle }}</p>
9
+            </div>
10
+        </div>
11
+        <div class="org-info border">
12
+            <div class="logo">
13
+                <img :src="org.logo" />
14
+            </div>
15
+            <div class="info">
16
+                <p class="name">{{ org.name }}</p>
17
+                <p class="address">{{ activity.address }}</p>
18
+            </div>
19
+            <div class="arrow">
20
+                <img src="@/assets/img/sa_52.png" />
21
+            </div>
22
+        </div>
23
+        <div class="simple-cell border">
24
+            <div class="icon">
25
+                <img src="@/assets/img/sa_21.png" />
26
+            </div>
27
+            <div class="text">
28
+                <p>{{ parseTime(activity.start_time, "{y}-{m}-{d} {h}:{i}") }}</p>
29
+            </div>
30
+            <div class="arrow-panel">
31
+                <img src="@/assets/img/sa_52.png" />
32
+            </div>
33
+        </div>
34
+        <div class="simple-cell border" v-if="activity.phone_number.length > 0">
35
+            <div class="icon">
36
+                <img src="@/assets/img/sa_24.png" />
37
+            </div>
38
+            <div class="text">
39
+                <p>{{ activity.phone_number }}</p>
40
+            </div>
41
+            <div class="arrow-panel">
42
+                <img src="@/assets/img/sa_52.png" />
43
+            </div>
44
+        </div>
45
+        <div class="simple-cell border" v-if="activity.limit_num > 0">
46
+            <div class="title">
47
+                <p>活动名额</p>
48
+            </div>
49
+            <div class="detail">
50
+                <p>{{ activity.limit_num + "人" }}</p>
51
+            </div>
52
+        </div>
53
+
54
+        <div class="large-text-cell border" v-if="sign_up_notice.length > 0">
55
+            <div class="title">
56
+                <img src="@/assets/img/sa_25.png" />
57
+                <span>报名须知</span>
58
+            </div>
59
+            <p class="content" v-html="sign_up_notice">
60
+            </p>
61
+        </div>
62
+
63
+        <div class="large-text-cell border" v-if="activity_paragraph.title.length > 0">
64
+            <div class="title">
65
+                <img src="@/assets/img/sa_26.png" />
66
+                <span>{{ activity_paragraph.title }}</span>
67
+            </div>
68
+            <p class="content" v-html="activity_paragraph.content">
69
+            </p>
70
+        </div>
71
+
72
+        <div class="signup-fake-btn">
73
+            立即报名
74
+        </div>
75
+    </div>
76
+</div> 
3 77
 </template>
4 78
 
5 79
 <script>
80
+import { fetchActivity } from "@/api/activity/activity"
81
+import { parseTime } from "@/utils"
82
+
6 83
 export default {
7 84
     name: "ActivityPreview",
85
+    data() {
86
+        return {
87
+            activity_id: 0,
88
+
89
+            activity: {
90
+                id: 0,
91
+                poster_photo: "",
92
+                title: "",
93
+                subtitle: "",
94
+                address: "",
95
+                limit_num: 0,
96
+                sign_up_deadline: 0,
97
+                start_time: 0,
98
+                phone_number: "",
99
+                sign_up_notice: "",
100
+            },
101
+            activity_paragraph: {
102
+                title: "",
103
+                content: "",
104
+            },
105
+            org: {
106
+                name: "",
107
+                logo: "",
108
+            }
109
+        }
110
+    },
111
+    computed: {
112
+        sign_up_notice: function() {
113
+            return this.activity.sign_up_notice.replace(/\n/g, "<br/>")
114
+        }
115
+    },
116
+    mounted() {
117
+        this.activity_id = this.$route.query.id
118
+
119
+        fetchActivity(this.activity_id).then(rs => {
120
+            var resp = rs.data
121
+            if (resp.state == 1) {
122
+                // console.log(resp.data)
123
+                var activity = resp.data.activity
124
+                this.activity.id = activity.id
125
+                this.activity.poster_photo = activity.poster_photo
126
+                this.activity.title = activity.title
127
+                this.activity.subtitle = activity.subtitle
128
+                this.activity.address = activity.address
129
+                this.activity.limit_num = activity.limit_num
130
+                this.activity.sign_up_deadline = activity.sign_up_deadline * 1000
131
+                this.activity.start_time = activity.start_time * 1000
132
+                this.activity.phone_number = activity.phone_number
133
+                this.activity.sign_up_notice = activity.sign_up_notice
134
+
135
+                var paragraph = resp.data.paragraph
136
+                this.activity_paragraph.title = paragraph.title
137
+                this.activity_paragraph.content = paragraph.content
138
+
139
+                this.org.name = resp.data.org.name
140
+                this.org.logo = resp.data.org.logo
141
+
142
+            } else {
143
+                this.$message.error(resp.msg)
144
+            }
145
+
146
+        }).catch(err => {
147
+            this.$message.error(err)
148
+        })
149
+    },
150
+    methods: {
151
+        parseTime,
152
+    }
8 153
 }
9 154
 </script>
10 155
 
11
-<style scoped>
156
+<style lang="scss" scoped>
157
+.main {
158
+    width: 750px;
159
+    margin: 0 auto;
160
+    padding: 14px 30px 0 30px;
161
+
162
+    .title-panel {
163
+        background-color: white;
164
+
165
+        img {
166
+            width: 100%;
167
+            height: auto;
168
+        }
169
+        .text {
170
+            padding: 12px 15px 16px 20px;
171
+
172
+            .title {
173
+                font-size: 18px;
174
+                color: #485b6d;
175
+                font-weight: bold;
176
+                line-height: 32px;
177
+            }
178
+            .subtitle {
179
+                margin-top: 4px;
180
+                color: #a6a6a6;
181
+                font-size: 14px;
182
+            }
183
+        }
184
+    }
185
+
186
+    .org-info {
187
+        padding: 26px 20px;
188
+        position: relative;
189
+        display: flex;
190
+        -webkit-box-align: center;
191
+        align-items: center;
192
+        margin-top: 15px;
193
+        background-color: white;
12 194
 
195
+        .logo {
196
+            img {
197
+                width: 40px;
198
+                height: 40px;
199
+                border-radius: 20px;
200
+                object-fit: cover;
201
+                object-position: center;
202
+            }
203
+        }
204
+
205
+        .info {
206
+            flex: 1;
207
+            padding-left: 23px;
208
+            color: #485b6d;
209
+
210
+            .name {
211
+                font-size: 16px;
212
+                line-height: 22px;
213
+            }
214
+            .address {
215
+                font-size: 14px;
216
+                line-height: 20px;
217
+            }
218
+        }
219
+        
220
+        .arrow {
221
+            width: 20px;
222
+            position: relative;
223
+            img {
224
+                width: 8px;
225
+                float: right;
226
+            }
227
+        }
228
+    }
229
+
230
+    .simple-cell {
231
+        background-color: white;
232
+        padding: 20px 20px;
233
+        margin-top: 15px;
234
+        position: relative;
235
+        display: flex;
236
+        -webkit-box-align: center;
237
+        align-items: center;
238
+
239
+        .icon {
240
+            img {
241
+                width: 20px;
242
+                height: auto;//20px;
243
+                vertical-align: middle;
244
+            }
245
+        }
246
+        .text {
247
+            flex: 1;
248
+            padding-left: 17px;
249
+            color: #485b6d;
250
+            line-height: 20px;
251
+        }
252
+        .arrow-panel {
253
+            width: 20px;
254
+            position: relative;
255
+
256
+            img {
257
+                width: 8px;
258
+                float: right;
259
+                vertical-align: middle;
260
+            }
261
+        }
262
+
263
+        .title {
264
+            p {
265
+                color: #485b6d;
266
+            }
267
+        }
268
+        .detail {
269
+            flex: 1;
270
+            padding-left: 23px;
271
+            color: #485b6d;
272
+
273
+            p {
274
+                color: #485b6d;
275
+                float: right;
276
+                text-align: right;
277
+            }
278
+        }
279
+    }
280
+
281
+    .large-text-cell {
282
+        background-color: white;
283
+        padding: 20px 20px;
284
+        position: relative;
285
+        -webkit-box-align: center;
286
+        align-items: center;
287
+        margin-top: 15px;
288
+
289
+        .title {
290
+            color: #485b6d;
291
+            line-height: 18px;
292
+            height: 18px;
293
+
294
+            img {
295
+                margin-right: 11px;
296
+                float: left;
297
+            }
298
+        }
299
+        .content {
300
+            color: #a8b3ba;
301
+            margin: 10px 0 0 0;
302
+            font-size: 14px;
303
+            line-height: 20px;
304
+        }
305
+    }
306
+
307
+    .signup-fake-btn {
308
+        background: #58a1ed;
309
+        color: #fff;
310
+        height: 50px;
311
+        line-height: 50px;
312
+        text-align: center;
313
+        width: 100%;
314
+        margin-top: 100px;
315
+        font-size: 16px;
316
+    }
317
+}
13 318
 </style>
14 319
 
320
+<style scoped>
321
+.border {
322
+    border: solid 1px #dee2e5;
323
+    border-radius: 4px;
324
+}
325
+</style>

+ 215 - 2
src/scrm_pages/marketing_tool/activity_share.vue Zobrazit soubor

@@ -1,14 +1,227 @@
1 1
 <template>
2
-    <div></div>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+            <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+        </div>
6
+        <div class="app-container" style="padding: 0 6px 20px; background-color: #f6f8f9;">
7
+            <div class="wx-share-panel">
8
+                <div class="text-panel">
9
+                    <p class="title">微信分享</p>
10
+                    <p class="desc">以微信方式推送给客户,该方式可以监测活动的展现及参与次数</p>
11
+                </div>
12
+                <div class="qrcode-panel">
13
+                    <div class="qrcode">
14
+                        <img :src="qr_img" :style="{ opacity: qr_img.length > 0 ? 1 : 0 }" />
15
+                    </div>
16
+                    <div class="btn">
17
+                        <el-button type="primary" @click="previewAction">新窗口预览</el-button>
18
+                    </div>
19
+                </div>
20
+            </div>
21
+            <div class="sms-share-panel">
22
+                <div class="text-panel">
23
+                    <p class="title">短信分享</p>
24
+                    <p class="desc">以短信方式推送给客户</p>
25
+                </div>
26
+                <div class="btn-panel">
27
+                    <el-button type="primary">短信推送</el-button>
28
+                </div>
29
+            </div>
30
+            <div class="link-share-panel">
31
+                <div>
32
+                    <p class="title">网页链接</p>
33
+                    <p class="desc">可以直接分享以下链接到相应媒体(邮件、QQ、微博等),或者嵌入到微信公众号菜单</p>
34
+                </div>
35
+                <div class="input-line">
36
+                    <div class="input">
37
+                        <el-input readonly v-model="short_url"></el-input>
38
+                    </div>
39
+                    <el-button type="primary" @click="copyAction">复制链接</el-button>
40
+                </div>
41
+            </div>
42
+        </div>
43
+    </div>
3 44
 </template>
4 45
 
5 46
 <script>
47
+import BreadCrumb from "@/scrm_pages/components/bread-crumb"
48
+import QRCode from "qrcode"
49
+import { getActivityShareInfo } from "@/api/activity/activity"
50
+
6 51
 export default {
7 52
     name: "ActivityShare",
53
+    components: {
54
+        BreadCrumb,
55
+    },
56
+    data() {
57
+        return {
58
+            crumbs: [
59
+                { path: false, name: "活动详情" },
60
+                { path: false, name: "活动分享" },
61
+            ],
62
+
63
+            activity_id: 0,
64
+            short_url: "",
65
+            qr_img: "",
66
+        }
67
+    },
68
+    mounted() {
69
+        this.activity_id = this.$route.query.id
70
+
71
+        getActivityShareInfo(this.activity_id).then(rs => {
72
+            var resp = rs.data
73
+            if (resp.state == 1) {
74
+                this.short_url = resp.data.url
75
+
76
+                var opts = {
77
+                    errorCorrectionLevel: "H",
78
+                    type: "image/png"
79
+                };
80
+                var that = this;
81
+                QRCode.toDataURL(this.short_url, opts, function(err, qr_url) {
82
+                    if (err) {
83
+                        console.log(err);
84
+                    } else {
85
+                        that.qr_img = qr_url;
86
+                    }
87
+                });
88
+
89
+            } else {
90
+                this.$message.error(resp.msg)
91
+            }
92
+        }).catch(err => {
93
+            this.$message.error(err)
94
+        })
95
+
96
+    },
97
+    methods: {
98
+        previewAction: function () {
99
+            // var new_page = this.$router.resolve({ 
100
+            //     path: '/activity/preview',
101
+            //     query: {
102
+            //         id: this.activity_id,
103
+            //     }   
104
+            // })
105
+            // window.open(new_page.href, '_blank');
106
+            window.open(this.short_url, "_blank")
107
+        },
108
+        copyAction: function() {
109
+            var input = document.createElement("input");
110
+            input.value = this.short_url;
111
+            document.body.appendChild(input);
112
+            input.select();
113
+            document.execCommand("Copy");
114
+            document.body.removeChild(input);
115
+
116
+            this.$message.success("已复制链接")
117
+        }
118
+    },
8 119
 }
9 120
 </script>
10 121
 
11
-<style scoped>
122
+<style lang="scss" scoped>
123
+.wx-share-panel {
124
+    box-shadow: 0 0 1px #dee2e5;
125
+    padding: 25px 35px;
126
+    display: flex;
127
+    background-color: white;
128
+
129
+    .text-panel {
130
+        flex: 1;
131
+
132
+        .title {
133
+            font-size: 16px;
134
+            color: #485b6d;
135
+            font-weight: bold;
136
+            height: 40px;
137
+            display: -webkit-box;
138
+            -webkit-box-orient: vertical;
139
+            -webkit-line-clamp: 2;
140
+            overflow: hidden;
141
+        }
142
+        .desc {
143
+            color: #7b8a97;
144
+            font-size: 14px;
145
+        }
146
+    }
147
+    .qrcode-panel {
148
+        text-align: right;
149
+
150
+        .qrcode {
151
+            text-align: center;
12 152
 
153
+            img {
154
+                width: 120px;
155
+                height: 120px;
156
+            }
157
+        }
158
+
159
+        .btn {
160
+            text-align: center;
161
+        }
162
+    }
163
+}
164
+
165
+.sms-share-panel {
166
+    box-shadow: 0 0 1px #dee2e5;
167
+    padding: 25px 35px;
168
+    display: flex;
169
+    margin-top: 20px;
170
+    background-color: white;
171
+
172
+    .text-panel {
173
+        flex: 1;
174
+
175
+        .title {
176
+            font-size: 16px;
177
+            color: #485b6d;
178
+            font-weight: bold;
179
+            height: 40px;
180
+            display: -webkit-box;
181
+            -webkit-box-orient: vertical;
182
+            -webkit-line-clamp: 2;
183
+            overflow: hidden;
184
+        }
185
+        .desc {
186
+            color: #7b8a97;
187
+            font-size: 14px;
188
+        }
189
+    }
190
+    .btn-panel {
191
+        text-align: right;
192
+        padding-right: 4px;
193
+    }
194
+}
195
+
196
+.link-share-panel {
197
+    box-shadow: 0 0 1px #dee2e5;
198
+    padding: 25px 35px;
199
+    // display: flex;
200
+    margin-top: 20px;
201
+    background-color: white;
202
+
203
+    .title {
204
+        font-size: 16px;
205
+        color: #485b6d;
206
+        font-weight: bold;
207
+        height: 40px;
208
+        display: -webkit-box;
209
+        -webkit-box-orient: vertical;
210
+        -webkit-line-clamp: 2;
211
+        overflow: hidden;
212
+    }
213
+    .desc {
214
+        color: #7b8a97;
215
+        font-size: 14px;
216
+    }
217
+    .input-line {
218
+        margin-top: 20px;
219
+
220
+        .input {
221
+            display: inline-block;
222
+            width: 400px;
223
+        }
224
+    }
225
+}
13 226
 </style>
14 227
 

+ 11 - 3
src/scrm_pages/marketing_tool/components/edit_activity_edit_form.vue Zobrazit soubor

@@ -95,7 +95,7 @@
95 95
             <div class="submit-button-panel">
96 96
                 <el-button style="padding: 10px 30px;" type="primary" @click="publishAction" :loading="publishing_activity" :disabled="saving_activity || saving_before_preview_activity">发 布</el-button>
97 97
                 <el-button style="color: #409eff; border-color: #409eff; padding: 10px 30px;" @click="saveAction" :loading="saving_activity" :disabled="publishing_activity || saving_before_preview_activity">保存草稿</el-button>
98
-                <el-button style="color: #409eff; border-color: #409eff; padding: 10px 30px;" :loading="saving_before_preview_activity" :disabled="publishing_activity || saving_activity">预 览</el-button>
98
+                <el-button style="color: #409eff; border-color: #409eff; padding: 10px 30px;" @click="previewAction" :loading="saving_before_preview_activity" :disabled="publishing_activity || saving_activity">预 览</el-button>
99 99
             </div>
100 100
         </div>
101 101
     </div>
@@ -234,8 +234,15 @@ export default {
234 234
         },
235 235
         previewAction: function() {
236 236
             this.saving_before_preview_activity = true
237
+            var t = this
237 238
             this.submitActivity(false, function() {
238
-                this.$router.push({ path: "/activity/preview", query: { id: this.activity.id } })
239
+                var new_page = t.$router.resolve({ 
240
+                    path: '/activity/preview',
241
+                    query: {
242
+                        id: t.activity.id,
243
+                    }   
244
+                })
245
+                window.open(new_page.href, '_blank');
239 246
             })
240 247
         },
241 248
         submitActivity: function(is_publish, successCallBack) {
@@ -274,6 +281,7 @@ export default {
274 281
                     this.saving_before_preview_activity = false
275 282
 
276 283
                 }).catch(err => {
284
+                    console.log('------  ' + err)
277 285
                     this.$message.error(err)
278 286
                     this.saving_activity = false
279 287
                     this.publishing_activity = false
@@ -281,12 +289,12 @@ export default {
281 289
                 })
282 290
 
283 291
             }).catch(err => {
292
+                console.log('asdada  ' + err)
284 293
                 this.$message.error(err)
285 294
                 this.saving_activity = false
286 295
                 this.publishing_activity = false
287 296
                 this.saving_before_preview_activity = false
288 297
             })
289
-            
290 298
         },
291 299
         validActivityInfo: function() {
292 300
             return new Promise((resolve, reject) => {

+ 1 - 1
src/xt_permission.js Zobrazit soubor

@@ -5,7 +5,7 @@ import 'nprogress/nprogress.css'// progress bar style
5 5
 
6 6
 NProgress.configure({ showSpinner: false })// NProgress Configuration
7 7
 
8
-const loginWhiteList = ['/token/verify', '/401', '/404'] // 登录验证白名单
8
+const loginWhiteList = ['/token/verify', '/401', '/404', "/activity/preview"] // 登录验证白名单
9 9
 const permissionWhiteList = loginWhiteList.concat(['/']) // 权限验证白名单
10 10
 
11 11
 router.beforeEach((to, from, next) => {