Your Name 2 年前
父节点
当前提交
73639ba47f
共有 8 个文件被更改,包括 144 次插入26 次删除
  1. 1
    0
      package.json
  2. 25
    0
      src/i18n/en.js
  3. 13
    0
      src/i18n/index.js
  4. 25
    0
      src/i18n/zh.js
  5. 2
    0
      src/main.js
  6. 24
    2
      src/pages/pg1/index.vue
  7. 4
    22
      src/store/index.js
  8. 50
    2
      yarn.lock

+ 1
- 0
package.json 查看文件

@@ -14,6 +14,7 @@
14 14
     "v-viewer": "^3.0.10",
15 15
     "viewerjs": "1.9.0",
16 16
     "vue": "^3.2.37",
17
+    "vue-i18n": "9",
17 18
     "vue-router": "4"
18 19
   },
19 20
   "devDependencies": {

+ 25
- 0
src/i18n/en.js 查看文件

@@ -0,0 +1,25 @@
1
+
2
+export default {
3
+  section1: {
4
+    p1: 'From 2014 to date,',
5
+    p2: 'A small purple flower has been lit up in 14 countries around the world.',
6
+  },
7
+  section2: {
8
+    p1: 'Violet Orychopragmus has become the language of peace, sending a call for peace to the world from Nanjing. In China, Finland, Turkey, Germany, the United Kingdom, Switzerland, the United States, Canada, Japan, Korea, Malaysia, Australia, New Zealand and Singapore, the violet orychopragmus has been lit up in these countries to sow the seeds of peace.',
9
+    p2: 'Nearly 200,000 violet pins were worn by people.'
10
+  },
11
+  section3: {
12
+    p1: 'In 2014, NJTV made violet pins out of the plant violet orychopragmus and distributed them to the public. 200,000 people have joined the Violet Orychopragmus Campaign over the past nine years, wearing the pins near their hearts.',
13
+    P2: 'In the hearts of 200 million people, the vision of peace was sown and spread.'
14
+  },
15
+  section4: {
16
+    P1: 'In 2014, we came to you for the first time under the name Violet Orychopragmus. We sowed the seeds of peace by visiting burial sites, launching the memorial website of Purple Mourning for the public and distributing the violet pins.',
17
+    P2: 'In 2015, we solicited and collected more than 3,000 family stories through the Family Lineage 1937 campaign.',
18
+    P3: 'In 2016, 2 million people planted violet orychopragmus online, applied violet orychopragmus avatars, and hand-wrote family history stories.',
19
+    P4: 'In 2017, 5 burial sites and 12.13 km relay ride were held to allow the concept of peace to take root and spread in this city that has experienced trauma and ordeal.',
20
+    P5: 'In 2018, the online violet orychopragmus campaign was carried out in more than ten cities around the world. And the image of violet orychopragmus can be seen in every corner of the world.',
21
+    P6: 'In 2019, the number of viewers of #Violet Orychopragmus has exceeded 150 million, and more people are joining this warm, meaningful and sentimental event.',
22
+    P7: 'In 2020, the number of violet orychopragmus campaign related videos were played 30 million times on Douyin.',
23
+    P8: 'In 2021, more than 2,000 posters were made to carry children\'s memories of history and prayers for peace.'
24
+  }
25
+}

+ 13
- 0
src/i18n/index.js 查看文件

@@ -0,0 +1,13 @@
1
+
2
+import { createI18n } from 'vue-i18n';
3
+import zh from './zh';
4
+import en from './en';
5
+
6
+const i18n = createI18n({
7
+  legacy: false,
8
+  globalInjection: true,
9
+  locale: 'zh',
10
+  messages: {zh, en}
11
+})
12
+
13
+export default i18n;

+ 25
- 0
src/i18n/zh.js 查看文件

@@ -0,0 +1,25 @@
1
+
2
+export default {
3
+  section1: {
4
+    p1: '2014年至今,',
5
+    p2: '一朵紫色小花在全球14个国家被点亮;',
6
+  },
7
+  section2: {
8
+    p1: '紫金草已成为和平的语言,从南京向世界传递出和平的呼唤。中国、芬兰、土耳其、德国、英国、瑞士、美国、加拿大、日本、韩国、马拉西亚、澳大利亚、新西兰、新加坡,紫金草在14个国家被点亮,播撒和平的种子。',
9
+    p2: '近20万枚紫金草徽章佩戴在了人们的心口;'
10
+  },
11
+  section3: {
12
+    p1: '2014年,南京广电集团以“紫金草”为原型,制作紫金草徽章发放给市民。9年来,20万人加入“紫金草行动”,把紫金草徽章佩戴在离心脏最近的地方。',
13
+    P2: '在2亿人心中,和平的愿景被播撒。'
14
+  },
15
+  section4: {
16
+    P1: '2014年,我们第一次以“紫金草”的名字,来到大家身边。我们寻访丛葬地,开设“紫色的哀思”公祭网页,发放紫金草徽章,播撒和平的种子',
17
+    P2: '2015年,“家脉1937”家史故事征集,3000多个家史故事讲述历史',
18
+    P3: '2016年,200万人线上种植紫金草、更换紫金草头像、手写家史故事',
19
+    P4: '2017年,5处丛葬地,12.13公里接力骑行,让和平理念在这座经历过伤痛的城市扎根、传播',
20
+    P5: '2018年,线上紫金草活动在全球十多个城市开展,世界个各个角落,都有紫金草的身影。',
21
+    P6: '2019年,#紫金草#话题阅读数突破1.5亿,越来越多的人一起做这件有温暖、有意义、有情怀的事。',
22
+    P7: '2020年,紫金草行动抖音话题播放量超3000万',
23
+    P8: '2021年,2000多幅公益海报,承载着孩子们对历史的铭记,对和平的祈愿。'
24
+  }
25
+}

+ 2
- 0
src/main.js 查看文件

@@ -6,6 +6,7 @@ import App from './App.vue'
6 6
 import store from './store'
7 7
 import wxsdk from './utils/wx'
8 8
 import router from './router'
9
+import i18n from './i18n'
9 10
 
10 11
 // const { share } = wxsdk(location.href)
11 12
 
@@ -13,6 +14,7 @@ const app = createApp(App);
13 14
 app.use(VueViewer);
14 15
 app.use(store);
15 16
 app.use(router);
17
+app.use(i18n);
16 18
 app.mount('#app');
17 19
 
18 20
 // share();

+ 24
- 2
src/pages/pg1/index.vue 查看文件

@@ -1,10 +1,10 @@
1 1
 <template>
2 2
   <div class="pg pg1" parallax>
3
-    <div class="logo" parallax-offset="200" parallax-out='0' parallax-in='100'>
3
+    <div class="logo" parallax-offset="200" parallax-out='0' parallax-in='100' @click="onClick">
4 4
       <img src="/images/pg1/紫金草行动logo.png" alt="">
5 5
     </div>
6 6
     <div class="content">
7
-      <p>2014年至今</p>
7
+      <p>{{t('section1.p1')}}</p>
8 8
       <p>一朵紫色小花</p>
9 9
       <p>在全球<strong>14个国家</strong>被点亮</p>
10 10
       <p><strong>近20万枚</strong>紫金草徽章</p>
@@ -21,6 +21,28 @@
21 21
   </div>
22 22
 </template>
23 23
 
24
+<script setup>
25
+// import { useModel } from '@zjxpcyc/vue-tiny-store';
26
+import { useI18n } from 'vue-i18n';
27
+
28
+// const [locale] = useModel('i18n');
29
+
30
+const { t, locale } = useI18n();
31
+
32
+let i = 0;
33
+
34
+const onClick = () => {
35
+  if (i % 2 === 1) {
36
+    locale.value = 'en';
37
+  } else {
38
+    locale.value = 'zh';
39
+  }
40
+
41
+  i += 1;
42
+}
43
+
44
+</script>
45
+
24 46
 
25 47
 <style lang="less" scoped>
26 48
 .pg1 {

+ 4
- 22
src/store/index.js 查看文件

@@ -1,32 +1,14 @@
1 1
 import { ref } from 'vue';
2 2
 import createStore from '@zjxpcyc/vue-tiny-store';
3 3
 
4
-const usePoem = () => {
5
-  const content = ref()
6
-
7
-  const update = (val) => {
8
-    content.value = val;
9
-  }
10
-
11
-  return [
12
-    content,
13
-    update,
14
-  ]
15
-};
16
-
17
-const useQRCode = () => {
18
-  const content = ref()
19
-
20
-  const update = (val) => {
21
-    content.value = val;
22
-  }
4
+const useFoo = () => {
5
+  const foo = ref('');
23 6
 
24 7
   return [
25
-    content,
26
-    update,
8
+    foo
27 9
   ]
28 10
 };
29 11
 
30
-const store = createStore({ poem: usePoem, qrcode: useQRCode });
12
+const store = createStore({ foo: useFoo });
31 13
 
32 14
 export default store;

+ 50
- 2
yarn.lock 查看文件

@@ -17,6 +17,44 @@
17 17
   resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.15.15.tgz#32c65517a09320b62530867345222fde7794fbe1"
18 18
   integrity sha512-lhz6UNPMDXUhtXSulw8XlFAtSYO26WmHQnCi2Lg2p+/TMiJKNLtZCYUxV4wG6rZMzXmr8InGpNwk+DLT2Hm0PA==
19 19
 
20
+"@intlify/core-base@9.2.2":
21
+  version "9.2.2"
22
+  resolved "https://registry.yarnpkg.com/@intlify/core-base/-/core-base-9.2.2.tgz#5353369b05cc9fe35cab95fe20afeb8a4481f939"
23
+  integrity sha512-JjUpQtNfn+joMbrXvpR4hTF8iJQ2sEFzzK3KIESOx+f+uwIjgw20igOyaIdhfsVVBCds8ZM64MoeNSx+PHQMkA==
24
+  dependencies:
25
+    "@intlify/devtools-if" "9.2.2"
26
+    "@intlify/message-compiler" "9.2.2"
27
+    "@intlify/shared" "9.2.2"
28
+    "@intlify/vue-devtools" "9.2.2"
29
+
30
+"@intlify/devtools-if@9.2.2":
31
+  version "9.2.2"
32
+  resolved "https://registry.yarnpkg.com/@intlify/devtools-if/-/devtools-if-9.2.2.tgz#b13d9ac4b4e2fe6d2e7daa556517a8061fe8bd39"
33
+  integrity sha512-4ttr/FNO29w+kBbU7HZ/U0Lzuh2cRDhP8UlWOtV9ERcjHzuyXVZmjyleESK6eVP60tGC9QtQW9yZE+JeRhDHkg==
34
+  dependencies:
35
+    "@intlify/shared" "9.2.2"
36
+
37
+"@intlify/message-compiler@9.2.2":
38
+  version "9.2.2"
39
+  resolved "https://registry.yarnpkg.com/@intlify/message-compiler/-/message-compiler-9.2.2.tgz#e42ab6939b8ae5b3d21faf6a44045667a18bba1c"
40
+  integrity sha512-IUrQW7byAKN2fMBe8z6sK6riG1pue95e5jfokn8hA5Q3Bqy4MBJ5lJAofUsawQJYHeoPJ7svMDyBaVJ4d0GTtA==
41
+  dependencies:
42
+    "@intlify/shared" "9.2.2"
43
+    source-map "0.6.1"
44
+
45
+"@intlify/shared@9.2.2":
46
+  version "9.2.2"
47
+  resolved "https://registry.yarnpkg.com/@intlify/shared/-/shared-9.2.2.tgz#5011be9ca2b4ab86f8660739286e2707f9abb4a5"
48
+  integrity sha512-wRwTpsslgZS5HNyM7uDQYZtxnbI12aGiBZURX3BTR9RFIKKRWpllTsgzHWvj3HKm3Y2Sh5LPC1r0PDCKEhVn9Q==
49
+
50
+"@intlify/vue-devtools@9.2.2":
51
+  version "9.2.2"
52
+  resolved "https://registry.yarnpkg.com/@intlify/vue-devtools/-/vue-devtools-9.2.2.tgz#b95701556daf7ebb3a2d45aa3ae9e6415aed8317"
53
+  integrity sha512-+dUyqyCHWHb/UcvY1MlIpO87munedm3Gn6E9WWYdWrMuYLcoIoOEVDWSS8xSwtlPU+kA+MEQTP6Q1iI/ocusJg==
54
+  dependencies:
55
+    "@intlify/core-base" "9.2.2"
56
+    "@intlify/shared" "9.2.2"
57
+
20 58
 "@vitejs/plugin-vue@^3.0.3":
21 59
   version "3.2.0"
22 60
   resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-3.2.0.tgz#a1484089dd85d6528f435743f84cdd0d215bbb54"
@@ -64,7 +102,7 @@
64 102
     "@vue/compiler-dom" "3.2.45"
65 103
     "@vue/shared" "3.2.45"
66 104
 
67
-"@vue/devtools-api@^6.4.5":
105
+"@vue/devtools-api@^6.2.1", "@vue/devtools-api@^6.4.5":
68 106
   version "6.4.5"
69 107
   resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.4.5.tgz#d54e844c1adbb1e677c81c665ecef1a2b4bb8380"
70 108
   integrity sha512-JD5fcdIuFxU4fQyXUu3w2KpAJHzTVdN+p4iOX2lMWSHMOoQdMAcpFLZzm9Z/2nmsoZ1a96QEhZ26e50xLBsgOQ==
@@ -478,7 +516,7 @@ source-map-js@^1.0.2:
478 516
   resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
479 517
   integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
480 518
 
481
-source-map@^0.6.1, source-map@~0.6.0:
519
+source-map@0.6.1, source-map@^0.6.1, source-map@~0.6.0:
482 520
   version "0.6.1"
483 521
   resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
484 522
   integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
@@ -542,6 +580,16 @@ vite@^3.0.7:
542 580
   optionalDependencies:
543 581
     fsevents "~2.3.2"
544 582
 
583
+vue-i18n@9:
584
+  version "9.2.2"
585
+  resolved "https://registry.yarnpkg.com/vue-i18n/-/vue-i18n-9.2.2.tgz#aeb49d9424923c77e0d6441e3f21dafcecd0e666"
586
+  integrity sha512-yswpwtj89rTBhegUAv9Mu37LNznyu3NpyLQmozF3i1hYOhwpG8RjcjIFIIfnu+2MDZJGSZPXaKWvnQA71Yv9TQ==
587
+  dependencies:
588
+    "@intlify/core-base" "9.2.2"
589
+    "@intlify/shared" "9.2.2"
590
+    "@intlify/vue-devtools" "9.2.2"
591
+    "@vue/devtools-api" "^6.2.1"
592
+
545 593
 vue-router@4:
546 594
   version "4.1.6"
547 595
   resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.1.6.tgz#b70303737e12b4814578d21d68d21618469375a1"