lisenzhou 2 år sedan
förälder
incheckning
4b09e45156

Binär
public/images/share.jpg Visa fil


Binär
public/images/share1.jpg Visa fil


Binär
public/images/电视台二维码.png Visa fil


+ 3
- 3
src/pages/pg4/Share.vue Visa fil

@@ -4,9 +4,9 @@
4 4
       <img src="/images/pg4/btn_share.png" alt="" @click="emit('share')">
5 5
       <img src="/images/pg4/btn_badge.png" alt="" @click="emit('badge')">
6 6
     </div>
7
-    <div class="share-txt txt">
7
+    <!-- <div class="share-txt txt">
8 8
       目前总种植数量: 35896690
9
-    </div>
9
+    </div> -->
10 10
   </div>
11 11
 </template>
12 12
 
@@ -16,7 +16,7 @@
16 16
 
17 17
 <style lang="less" scoped>
18 18
 .share-wrapper {
19
-  background-image: linear-gradient(transparent, #EDEEF0 40%, #EDEEF0);
19
+  // background-image: linear-gradient(transparent, #EDEEF0 40%, #EDEEF0);
20 20
   box-sizing: border-box;
21 21
   padding: 10px 1em;
22 22
   width: 100%;

+ 19
- 10
src/pages/pg4/plant.vue Visa fil

@@ -1,5 +1,6 @@
1 1
 <template>
2 2
   <div class="page pg-bg pgplant">
3
+    <Rule />
3 4
     <GoBack class="goback abs" @click.stop="router.go(-1)" />
4 5
     <div class="content">
5 6
       <div class="content-item" v-for="(item, inx) in list" :key="inx">
@@ -27,7 +28,13 @@
27 28
         </div>
28 29
       </div>
29 30
     </div>
30
-
31
+    <Share
32
+      v-if="planted"
33
+      class="share"
34
+      @share="onShare"
35
+      @badge="badgeShow = true"
36
+    />
37
+    <Badge :show="badgeShow" @cancel="badgeShow = false" />
31 38
     <div class="footer txt">目前总种植数量:{{ user?.num }}</div>
32 39
   </div>
33 40
 </template>
@@ -37,23 +44,18 @@ import { onMounted, ref, watch } from "vue";
37 44
 import GoBack from "@/components/GoBack.vue";
38 45
 import { useRouter } from "vue-router";
39 46
 import { useModel } from "@zjxpcyc/vue-tiny-store";
40
-// import animate from "@/utils/animate"
47
+import Share from "./Share.vue";
48
+import Badge from "./Badge.vue";
49
+import Rule from "./Rule.vue";
41 50
 
42 51
 const { user, contries, updateContries } = useModel("user");
43 52
 
44 53
 const router = useRouter();
45 54
 const choise = ref([]);
46
-const countryRef = ref();
47
-const flowerShow = ref();
48
-const planted = ref(false);
55
+const planted = ref(true);
49 56
 const badgeShow = ref(false);
50 57
 
51
-let timer = "timer";
52
-
53 58
 const animate = (plus, e) => {
54
-  // var _this = this;
55
-  console.log(e, "==");
56
-
57 59
   var n = 1;
58 60
   var $i = $("<b/>").text("+" + n);
59 61
   var x = e.pageX,
@@ -88,7 +90,14 @@ const isChoise = (name) => {
88 90
   //   console.log(name, "==--");
89 91
   return choise.value?.filter((x) => x === name)?.length > 0;
90 92
 };
93
+const onPlanted = () => {
94
+  planted.value = true;
95
+  flowerShow.value = false;
96
+};
91 97
 
98
+const onShare = () => {
99
+  router.push("/share");
100
+};
92 101
 const click = (item, e) => {
93 102
   const arr = choise.value;
94 103
   updateContries(item.name);

+ 1
- 1
src/pages/pg4/video.vue Visa fil

@@ -37,7 +37,7 @@
37 37
   };
38 38
 
39 39
   const onNext = () => {
40
-    router.push("/pg4/next");
40
+    router.push("/pg4/plant");
41 41
   };
42 42
 
43 43
 </script>

+ 19
- 13
src/pages/share/index.vue Visa fil

@@ -1,29 +1,35 @@
1 1
 <template>
2 2
   <div class="share-pg">
3 3
     <div class="will-copy" ref="src">
4
-      <img class="copy-img" src="/images/share.jpg" alt="">
4
+      <img class="copy-img" src="/images/share.jpg" alt="" />
5 5
       <div class="content txt">
6
-        <div class="name">昵称</div>
7
-        <div style="line-height: 1.6em">您是第123225位“紫金草行动”参与者。播撒紫金草种子,让和平之花开满全城。</div>
6
+        <div class="name">{{ user.nickname || "朋友" }}</div>
7
+        <div style="line-height: 1.6em">
8
+          您是第{{user.num}}位“紫金草行动”参与者。播撒紫金草种子,让和平之花开满全城。
9
+        </div>
8 10
       </div>
9 11
     </div>
10
-    <img class="img-target" :src="imgData" v-if="imgData" alt="">
12
+    <img class="img-target" :src="imgData" v-if="imgData" alt="" />
11 13
   </div>
12 14
 </template>
13 15
 
14 16
 <script setup>
15
-  import { onMounted, ref } from 'vue';
16
-  import html2canvas from 'html2canvas';
17
+import { onMounted,watch, ref } from "vue";
18
+import html2canvas from "html2canvas";
19
+import { useModel } from "@zjxpcyc/vue-tiny-store";
17 20
 
18
-  const imgData = ref();
19
-  const src = ref();
21
+const { user } = useModel("user");
22
+const imgData = ref();
23
+const src = ref();
20 24
 
21
-  onMounted(() => {
25
+
26
+onMounted(() => {
27
+  setTimeout(()=>{
22 28
     html2canvas(src.value).then((canvas) => {
23
-      imgData.value = canvas.toDataURL('image/jpg', .8);
24
-    });
29
+    imgData.value = canvas.toDataURL("image/jpg", 0.8);
25 30
   });
26
-
31
+  },1000)
32
+});
27 33
 </script>
28 34
 
29 35
 <style lang="less" scoped>
@@ -63,4 +69,4 @@
63 69
     left: 0;
64 70
   }
65 71
 }
66
-</style>
72
+</style>

+ 1
- 1
src/store/index.js Visa fil

@@ -34,7 +34,7 @@ const useAudio = () => {
34 34
 
35 35
 
36 36
 const useUser = () => {
37
-  const user = ref({num:66699});
37
+  const user = ref({});
38 38
 
39 39
   const setUser = v => user.value = v;
40 40