Bläddra i källkod

Merge branch 'master' of https://matrix.niimei.com/szustar/szugift-fe

StephenArk30 6 år sedan
förälder
incheckning
34dd865ed5
1 ändrade filer med 63 tillägg och 30 borttagningar
  1. 63 30
      sourcecode/h5app/vue/src/views/share.vue

+ 63 - 30
sourcecode/h5app/vue/src/views/share.vue

@@ -1,17 +1,19 @@
 <template>
     <div class="note" :style="note">
-        <!--分享页面-->
-        <div class="card">
-            <h3><strong>提交成功!最后一步</strong></h3>
-            <van-row>保存邀请卡片(图片)至手机</van-row>
-            <van-row>转发图片至朋友圈并截图</van-row>
-            <van-row>将截图发送至<span style="color: #F4A460"> 深大欢欢 </span>公众号后台,才可获得本次活动的【匹配资格】和【抽奖机会】</van-row>
+        <div class="transparent" :style="transparent">
+            <!--分享页面-->
+            <div class="card">
+                <h3 style="color: white"><strong>提交成功!最后一步</strong></h3>
+                <van-row>保存邀请卡片(图片)至手机</van-row>
+                <van-row>转发图片至朋友圈并截图</van-row>
+                <van-row>将截图发送至<span style="color: #F4A460"> 深大欢欢 </span>公众号后台,才可获得本次活动的【匹配资格】和【抽奖机会】</van-row>
+            </div>
+            <div style="position: relative;">
+                <img :src="share" style="max-width: 80%; position: relative;"/>
+            </div>
+            <van-button size="large" type="primary" @click="Toshare">分享</van-button>
+            <van-button size="large" type="primary" @click="Toindex">返回首页</van-button>
         </div>
-        <div style="position: relative;">
-            <img :src="share" style="max-width: 80%; position: relative;"/>
-        </div>
-        <van-button size="large" type="primary" @click="Toindex">返回首页</van-button>
-        <van-button size="large" type="primary" @click="ToShare">返回首页</van-button>
 
     </div>
 </template>
@@ -21,7 +23,10 @@
     import {
         Row, Col,
         Button
-    } from 'vant'
+    } from 'vant';
+    import 'whatwg-fetch';
+    import { BasicFunction } from '../connector/basic-service';
+
     export default {
         name: "share",
         components: {
@@ -41,14 +46,15 @@
                 },
             },
         },
-        mounted: {
-
-        },
+        mounted: {},
         data() {
             return {
                 note: {
                     backgroundImage: "url(" + require("../assets/prize_background.jpg") + ")",
                 },
+                transparent: {
+                    backgroundColor: "rgba(50,50,50,0.7)",
+                },
                 active: 0,
                 share: require('../assets/post.png'),
             }
@@ -56,10 +62,14 @@
         methods: {
             Toindex() {
                 this.$router.push('index');
+            },
+            Toshare() {
+                alert("请点击右上角,即可分享");
+                Toast({
+                    message: "请点击右上角,即可分享"
+                })
             }
-
         },
-
         created: function () {
             if (!localStorage.getItem('frontend-userid')) {
                 this.$router.push('login');
@@ -74,6 +84,16 @@
                         imgUrl: 'http://gift.fogice.com/attachment/upload/2018-12-13_22-45-35_dbad3cb10afe017f8ef5158f96c9a7c6c622aa04db557384883f97fe38cae380.png', // 分享图标
                         success: function () {
                             // 设置成功
+                            Toast({
+                                message: "成功分享到朋友圈"
+                            });
+                            this.$router.push('index');
+                        },
+                        cancel: function () {
+                            Toast({
+                                message: "分享失败,您取消了分享!"
+                            });
+
                         }
                     });
                     wx.onMenuShareAppMessage({
@@ -85,23 +105,33 @@
                         dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
                         success: function () {
 // 用户点击了分享后执行的回调函数
+                            Toast({
+                                message: "成功分享给朋友"
+                            });
+                            this.$router.push('index');
+                        },
+                        cancel: function () {
+                            Toast({
+                                message: "分享失败,您取消了分享!"
+                            });
+
                         }
-                    });
-                })
-            });
+                    })
+                });
 
 
-            /*  wx.config({
-                  debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-                  appId: '', // 必填,公众号的唯一标识
-                  timestamp:, // 必填,生成签名的时间戳
-                  nonceStr: '', // 必填,生成签名的随机串
-                  signature: '',// 必填,签名
-                  jsApiList: [] // 必填,需要使用的JS接口列表
-              });*/
+                /*  wx.config({
+                      debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+                      appId: '', // 必填,公众号的唯一标识
+                      timestamp:, // 必填,生成签名的时间戳
+                      nonceStr: '', // 必填,生成签名的随机串
+                      signature: '',// 必填,签名
+                      jsApiList: [] // 必填,需要使用的JS接口列表
+                  });*/
 
+            },{});
         }
-    }
+    };
 </script>
 
 <style scoped>
@@ -113,7 +143,9 @@
     }
 
     .card {
-        margin: 20px 20px;
+        margin-bottom: 20px;
+        margin-left: 20px;
+        margin-right: 20px;
         padding: 15px;
         text-align: left;
     }
@@ -121,5 +153,6 @@
     .van-row {
 
         font-size: 0.3em;
+        color: white;
     }
 </style>