stanley-king 7 年之前
父節點
當前提交
d88f878809

File diff suppressed because it is too large
+ 1 - 1
dist/index.html


File diff suppressed because it is too large
+ 0 - 2
dist/mshop/js/app.13586d11078125a32d69.js


File diff suppressed because it is too large
+ 0 - 1
dist/mshop/js/app.13586d11078125a32d69.js.map


File diff suppressed because it is too large
+ 2 - 0
dist/mshop/js/app.52155aa8d3de682d513d.js


File diff suppressed because it is too large
+ 1 - 0
dist/mshop/js/app.52155aa8d3de682d513d.js.map


File diff suppressed because it is too large
+ 0 - 2
dist/mshop/js/manifest.076588a90e6cbb323f63.js


File diff suppressed because it is too large
+ 2 - 0
dist/mshop/js/manifest.51495cfb7a9ca69efc47.js


File diff suppressed because it is too large
+ 1 - 1
dist/mshop/js/manifest.076588a90e6cbb323f63.js.map


File diff suppressed because it is too large
+ 5 - 5
dist/mshop/js/vendor.1350aab6fa173b3cd97f.js


File diff suppressed because it is too large
+ 1 - 1
dist/mshop/js/vendor.1350aab6fa173b3cd97f.js.map


+ 4 - 2
src/components/goods/goods_detail.vue

@@ -122,7 +122,9 @@
     import Proxy from '../blocks/util/proxy.js'
     import WebView from '../blocks/webview.vue'
     import WechatShare from '../../wechat/WechatShare'
-    export default {
+
+    export default
+    {
         created(){
             this.$store.commit('updateLoadingStatus', {isLoading: true});
             let goods_id = this.$route.query["goods_id"];
@@ -145,7 +147,7 @@
                     link: "http://" + window.location.host + '/mobile/index.php?act=mshop&op=goods&goods_id='+goods_id,
                     img_url: this.getOneSummary['goods_image_url']
                 };
-                let WxShare = new WechatShare(shareMsg)
+                let WxShare = new WechatShare(shareMsg,Api.sign_url(location.href))
             },(err) => {
                 this.$vux.toast.show({
                 type: 'text',

+ 3 - 1
src/components/main/main.vue

@@ -30,6 +30,8 @@
 <script>
     import {Tabbar, TabbarItem} from 'vux'
     import WechatShare from '../../wechat/WechatShare'
+    import Api from '../../lib/api'
+
     export default {
         created(){
             let shareMsg = {
@@ -38,7 +40,7 @@
                 link: "http://" + window.location.host + '/mobile/index.php?act=mshop&op=index',
                 img_url: 'http://p.lrlz.com/data/resource/mobile/defimg/panda.jpeg'
             };
-            let WxShare = new WechatShare(shareMsg);
+            let WxShare = new WechatShare(shareMsg,Api.sign_url(window.location.href));
         },
         data () {
             return {

+ 1 - 1
src/components/special/special_list.vue

@@ -27,7 +27,7 @@
                 };
 
             }
-            let WxShare = new WechatShare(shareMsg);
+            let WxShare = new WechatShare(shareMsg,Api.sign_url(window.location.href));
         },
         data(){
             return {

+ 18 - 1
src/lib/api.js

@@ -1,5 +1,9 @@
 let envHost = process.env.API_ROOT;
-class Api {
+
+var enter_url = "";
+
+class Api
+{
     static host() {
         return envHost;
     }
@@ -122,6 +126,19 @@ class Api {
         return this.host() + `/mobile/index.php?act=member_order&op=pay_info&curpage=1&pay_sn=${pay_sn}&client_type=ajax`;
     }
 
+    static init_url(href)
+    {
+        enter_url = herf;
+    }
+
+    static sign_url(href)
+    {
+        if(isMobile.iOS()) {
+            return enter_url;
+        } else {
+            return href;
+        }
+    }
 }
 
 export default Api

+ 21 - 0
src/lib/device.js

@@ -0,0 +1,21 @@
+
+var isMobile = {
+    Android: function() {
+        return navigator.userAgent.match(/Android/i);
+    },
+    BlackBerry: function() {
+        return navigator.userAgent.match(/BlackBerry/i);
+    },
+    iOS: function() {
+        return navigator.userAgent.match(/iPhone|iPad|iPod/i);
+    },
+    Opera: function() {
+        return navigator.userAgent.match(/Opera Mini/i);
+    },
+    Windows: function() {
+        return navigator.userAgent.match(/IEMobile/i);
+    },
+    any: function() {
+        return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
+    }
+};

+ 5 - 3
src/main.js

@@ -10,10 +10,10 @@ import  {ConfirmPlugin} from 'vux'
 import VueVideoPlayer from 'vue-video-player'
 import  {ToastPlugin} from 'vux'
 import routes from './router/routes'
-import WechatShare from './wechat/WechatShare'
 import {base64} from 'vux'
 import CommonUtil from './components/util/commonUtil.js'
 import Actions from './lib/Actions'
+import Api from './lib/api'
 
 Vue.use(VueRouter);
 Vue.use(VueResource);
@@ -22,7 +22,6 @@ Vue.use(VueVideoPlayer);
 Vue.use(ToastPlugin);
 Vue.use(ConfirmPlugin);
 
-
 const store = new Vuex.Store({
     state: {
         isLoading: false,
@@ -41,7 +40,7 @@ const store = new Vuex.Store({
             name:'',
             mobile:'',
             address:''
-        }
+        },
     },
     mutations: {
         updateLoadingStatus (state, payload) {
@@ -70,6 +69,9 @@ const store = new Vuex.Store({
         }
     }
 });
+
+Api.init_url(window.location.href);
+
 //超时处理
 Vue.http.interceptors.push((request, next) => {
     let timeout;

+ 4 - 3
src/wechat/WechatShare.js

@@ -7,10 +7,10 @@ Vue.use(WechatPlugin);
 
 class WechatShare
 {
-    constructor(data)
+    constructor(data,surl)
     {
-        // let sign_url = window.location.href + "#";
-        let sign_url = encodeURIComponent(location.href.split('#')[0]);
+        //let sign_url = encodeURIComponent(window.location.href.split('#')[0]);
+        let sign_url = encodeURIComponent(surl.split('#')[0]);
         let host = window.location.protocol + '//' + window.location.host;
         let url = host + "/mobile/index.php?act=mshop&op=signurl&client_type=ajax&sign_url="+sign_url+"&callback=";
 
@@ -26,6 +26,7 @@ class WechatShare
                 nonceStr = sign.noncestr,
                 signature = sign.signature,
                 appid = sign.appid;
+
             Vue.wechat.config({
                 debug: false,
                 appId: appid,