Procházet zdrojové kódy

solve img download

StephenArk30 před 6 roky
rodič
revize
c9aa516281

+ 1 - 1
sourcecode/h5app/vue/src/components/IndexPresent.vue

@@ -33,7 +33,7 @@
         props: {
         props: {
             presentImg: {
             presentImg: {
                 type: String,
                 type: String,
-                default: require('../assets/image_load_fail.jpg')
+                default: "http://pjczv6ygf.bkt.clouddn.com/image_load_fail.jpg"
             },
             },
             presentName: {
             presentName: {
                 type: String,
                 type: String,

+ 2 - 2
sourcecode/h5app/vue/src/components/TabBar.vue

@@ -35,9 +35,9 @@
             return {
             return {
                 active: this.activeI,
                 active: this.activeI,
                 icon: {
                 icon: {
-                    index_normal: require('../assets/index_icon_active.png'),
+                    index_normal: "http://pjczv6ygf.bkt.clouddn.com/bar-icon/index_icon_active.png",
                     index_active: require('../assets/index_icon_active.png'),
                     index_active: require('../assets/index_icon_active.png'),
-                    me_normal: require('../assets/me_icon_active.png'),
+                    me_normal: "http://pjczv6ygf.bkt.clouddn.com/bar-icon/me_icon_active.png",
                     me_active: require('../assets/me_icon_active.png')
                     me_active: require('../assets/me_icon_active.png')
                 },
                 },
             }
             }

+ 6 - 0
sourcecode/h5app/vue/src/components/addPresentButton.vue

@@ -13,6 +13,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
+    import {Toast} from 'vant';
     export default {
     export default {
         name: "add-present-button",
         name: "add-present-button",
         props: {
         props: {
@@ -27,6 +28,11 @@
         },
         },
         methods: {
         methods: {
             toAddPresent() {
             toAddPresent() {
+                Toast.loading({
+                    mask: true,
+                    message: '加载中...',
+                    duration: 500
+                });
                 if (this.disabled) this.$router.push('verify');
                 if (this.disabled) this.$router.push('verify');
             }
             }
         }
         }

+ 1 - 1
sourcecode/h5app/vue/src/components/giftCard.vue

@@ -60,7 +60,7 @@
         props: {
         props: {
             presentImg: {
             presentImg: {
                 type: String,
                 type: String,
-                default: require('../assets/image_load_fail.jpg')
+                default: "http://pjczv6ygf.bkt.clouddn.com/image_load_fail.jpg"
             },
             },
             presentName: {
             presentName: {
                 type: String,
                 type: String,

+ 1 - 1
sourcecode/h5app/vue/src/views/giftDetail.vue

@@ -35,7 +35,7 @@
             <p v-if="reason.length !== 0">原因:{{reason}}</p>
             <p v-if="reason.length !== 0">原因:{{reason}}</p>
         </div>
         </div>
         <div style="height: 100px; width: 100%"></div>
         <div style="height: 100px; width: 100%"></div>
-        <img src="../assets/gift_card_background.png"
+        <img src="http://pjczv6ygf.bkt.clouddn.com/present_card_bottom.png"
              style="position: fixed; bottom: 100px; max-width: 100%; z-index: -1"
              style="position: fixed; bottom: 100px; max-width: 100%; z-index: -1"
         />
         />
         <div
         <div

+ 15 - 6
sourcecode/h5app/vue/src/views/index.vue

@@ -59,7 +59,7 @@
     import {
     import {
         Button, Row, Col,
         Button, Row, Col,
         Swipe, SwipeItem,
         Swipe, SwipeItem,
-        NoticeBar
+        NoticeBar, Toast
     } from "vant";
     } from "vant";
     import AddPresentButton from "../components/addPresentButton";
     import AddPresentButton from "../components/addPresentButton";
     import {BasicFunction} from '../connector/basic-service';
     import {BasicFunction} from '../connector/basic-service';
@@ -88,10 +88,10 @@
                 presents: {},
                 presents: {},
                 hasPresent: false,
                 hasPresent: false,
                 dec_icons: [
                 dec_icons: [
-                    require('../assets/declare_icons/1.png'),
-                    require('../assets/declare_icons/2.png'),
-                    require('../assets/declare_icons/3.png'),
-                    require('../assets/declare_icons/4.png'),
+                    "http://pjczv6ygf.bkt.clouddn.com/dec-icon/1.png",
+                    "http://pjczv6ygf.bkt.clouddn.com/dec-icon/2.png",
+                    "http://pjczv6ygf.bkt.clouddn.com/dec-icon/3.png",
+                    "http://pjczv6ygf.bkt.clouddn.com/dec-icon/4.png",
                 ],
                 ],
                 dec_words: [
                 dec_words: [
                     '填写资料',
                     '填写资料',
@@ -103,9 +103,18 @@
         },
         },
         methods: {
         methods: {
             toShare() {
             toShare() {
+                Toast.loading({
+                    mask: true,
+                    message: '加载中...',
+                    duration: 1000
+                });
                 this.$router.push('share')
                 this.$router.push('share')
             },
             },
             toDetail(i) {
             toDetail(i) {
+                Toast.loading({
+                    mask: true,
+                    message: '加载中...'
+                });
                 let present = this.presents[i];
                 let present = this.presents[i];
                 this.$router.push({
                 this.$router.push({
                     path: 'giftDetail', query: {present: present}
                     path: 'giftDetail', query: {present: present}
@@ -165,7 +174,7 @@
     .dec {
     .dec {
         float: left;
         float: left;
         width: 25%;
         width: 25%;
-        margin-bottom: 50px;
+        margin-bottom: 70px;
     }
     }
 
 
     .dec img {
     .dec img {

+ 5 - 1
sourcecode/h5app/vue/src/views/login.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
     <div>
     <div>
-        <img src="../assets/login_background.png"
+        <img src="http://pjczv6ygf.bkt.clouddn.com/login_background.png"
              style="max-width: 100%"
              style="max-width: 100%"
         />
         />
         <h1>正在自动登录,请稍后</h1>
         <h1>正在自动登录,请稍后</h1>
@@ -14,6 +14,10 @@
 
 
     export default {
     export default {
         created: function () {
         created: function () {
+            Toast.loading({
+                mask: true,
+                message: '加载中...'
+            });
             if (localStorage.getItem('frontend-userid')) {
             if (localStorage.getItem('frontend-userid')) {
                 this.$router.push('index');
                 this.$router.push('index');
                 return;
                 return;

+ 89 - 69
sourcecode/h5app/vue/src/views/share.vue

@@ -9,11 +9,12 @@
                 <van-row>3.将截图发送至<span style="color: #F4A460"> 深大换换 </span>公众号后台,才可获得本次活动的【匹配资格】和【抽奖机会】</van-row>
                 <van-row>3.将截图发送至<span style="color: #F4A460"> 深大换换 </span>公众号后台,才可获得本次活动的【匹配资格】和【抽奖机会】</van-row>
             </div>
             </div>
             <div style="position: relative;">
             <div style="position: relative;">
-                <img :src="share" style="max-width: 80%; position: relative;"/>
+                <img :src="share[i]" style="max-width: 80%; position: relative;"/>
             </div>
             </div>
-            <van-button size="large" type="primary" @click="Toshare"></van-button>
+            <a :href="share[i]" download="post">
+                <van-button size="large" type="primary">保存</van-button>
+            </a>
             <van-button size="large" type="primary" @click="Toindex">返回首页</van-button>
             <van-button size="large" type="primary" @click="Toindex">返回首页</van-button>
-            <a href="assets/post.png"> 保存 </a>
         </div>
         </div>
 
 
     </div>
     </div>
@@ -23,29 +24,29 @@
     //  import wx from 'weixin-js-sdk';
     //  import wx from 'weixin-js-sdk';
     import {
     import {
         Row, Col,
         Row, Col,
-        Button
+        Button, Toast
     } from 'vant';
     } from 'vant';
     import 'whatwg-fetch';
     import 'whatwg-fetch';
-    import { BasicFunction } from '../connector/basic-service';
+    // import { BasicFunction } from '../connector/basic-service';
 
 
     export default {
     export default {
         name: "share",
         name: "share",
         components: {
         components: {
             [Button.name]: Button,
             [Button.name]: Button,
             [Row.name]: Row, [Col.name]: Col,
             [Row.name]: Row, [Col.name]: Col,
-            'wx': {
-                render(createElement) {
-                    return createElement(
-                        'script',
-                        {
-                            attrs: {
-                                type: 'text/javascript',
-                                src: 'http://res2.wx.qq.com/open/js/jweixin-1.4.0.js',
-                            },
-                        },
-                    );
-                },
-            },
+            // 'wx': {
+            //     render(createElement) {
+            //         return createElement(
+            //             'script',
+            //             {
+            //                 attrs: {
+            //                     type: 'text/javascript',
+            //                     src: 'http://res2.wx.qq.com/open/js/jweixin-1.4.0.js',
+            //                 },
+            //             },
+            //         );
+            //     },
+            // },
         },
         },
         mounted: {},
         mounted: {},
         data() {
         data() {
@@ -57,71 +58,90 @@
                     backgroundColor: "rgba(50,50,50,0.7)",
                     backgroundColor: "rgba(50,50,50,0.7)",
                 },
                 },
                 active: 0,
                 active: 0,
-                share: require('../assets/post.png'),
+                share: [
+                    require('../assets/posts/1.png'),
+                    require('../assets/posts/2.png'),
+                    require('../assets/posts/3.png'),
+                    require('../assets/posts/4.png'),
+                ],
+                i: 0
             }
             }
         },
         },
         methods: {
         methods: {
             Toindex() {
             Toindex() {
                 this.$router.push('index');
                 this.$router.push('index');
             },
             },
-            Toshare() {
-                alert("请点击右上角,即可分享");
-                Toast({
-                    message: "请点击右上角,即可分享"
-                })
-            }
+            // Toshare() {
+            //     alert("请点击右上角,即可分享");
+            //     Toast({
+            //         message: "请点击右上角,即可分享"
+            //     })
+            // }
         },
         },
         created: function () {
         created: function () {
             if (!localStorage.getItem('frontend-userid')) {
             if (!localStorage.getItem('frontend-userid')) {
                 this.$router.push('login');
                 this.$router.push('login');
                 return;
                 return;
             }
             }
+            this.i = Math.ceil(Math.random() * 4) - 1;
+            console.log(this.i);
 
 
-            BasicFunction.getSigned(['onMenuShareTimeline', 'onMenuShareAppMessage',], function () {
-                wx.ready(function () {      //需在用户可能点击分享按钮前就先调用
-                    wx.onMenuShareTimeline({
-                        title: '用一份礼物,邂逅一段故事', // 分享标题
-                        link: 'https://gift.fogice.com/?res=timeline', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
-                        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({
-                        title: '用一份礼物,邂逅一段故事', // 分享标题
-                        desc: '嘿~我送出了一份圣诞礼物  要和我来交换吗', // 分享描述
-                        link: 'https://gift.fogice.com/?res=appmessage', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
-                        imgUrl: 'http://gift.fogice.com/attachment/upload/2018-12-13_22-45-35_dbad3cb10afe017f8ef5158f96c9a7c6c622aa04db557384883f97fe38cae380.png', // 分享图标
-                        type: '', // 分享类型,music、video或link,不填默认为link
-                        dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
-                        success: function () {
-// 用户点击了分享后执行的回调函数
-                            Toast({
-                                message: "成功分享给朋友"
-                            });
-                            this.$router.push('index');
-                        },
-                        cancel: function () {
-                            Toast({
-                                message: "分享失败,您取消了分享!"
-                            });
-
-                        }
-                    })
-                });
-            },{});
+//             BasicFunction.getSigned(['onMenuShareTimeline', 'onMenuShareAppMessage',], function () {
+//                 wx.ready(function () {      //需在用户可能点击分享按钮前就先调用
+//                     wx.onMenuShareTimeline({
+//                         title: '用一份礼物,邂逅一段故事', // 分享标题
+//                         link: 'https://gift.fogice.com/?res=timeline', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+//                         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({
+//                         title: '用一份礼物,邂逅一段故事', // 分享标题
+//                         desc: '嘿~我送出了一份圣诞礼物  要和我来交换吗', // 分享描述
+//                         link: 'https://gift.fogice.com/?res=appmessage', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+//                         imgUrl: 'http://gift.fogice.com/attachment/upload/2018-12-13_22-45-35_dbad3cb10afe017f8ef5158f96c9a7c6c622aa04db557384883f97fe38cae380.png', // 分享图标
+//                         type: '', // 分享类型,music、video或link,不填默认为link
+//                         dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
+//                         success: function () {
+// // 用户点击了分享后执行的回调函数
+//                             Toast({
+//                                 message: "成功分享给朋友"
+//                             });
+//                             this.$router.push('index');
+//                         },
+//                         cancel: function () {
+//                             Toast({
+//                                 message: "分享失败,您取消了分享!"
+//                             });
+//
+//                         }
+//                     })
+//                 });
+//             },{});
         }
         }
-    };
+    }
+
+    function down(selector, name) {
+        // 生成一个a元素
+        let a = document.createElement('a');
+        // 将a的download属性设置为我们想要下载的图片名称
+        a.download = name || 'pic';
+        // 将生成的URL设置为a.href属性
+        a.href = './boy.png';
+        // 触发a的单击事件
+        a.click();
+    }
 </script>
 </script>
 
 
 <style scoped>
 <style scoped>