Explorar o código

Wesmiler 时光单身NN2019120501项目迁移

wesmiler %!s(int64=5) %!d(string=hai) anos
pai
achega
51955c756a

+ 9 - 9
public/themes/default/weixin/public/assets/js/market-invite.js

@@ -28,8 +28,10 @@ var app = new Vue({
     },
     created: function () {
         var _this = this;
+        var sid = getParam('sid')
+        sid = typeof(sid) != 'undefined'? sid : 0;
         _this.getSiteInfo();
-        _this.getInfo(0);
+        _this.getInfo(sid);
     },
     methods: {
         // 获取用户信息
@@ -44,12 +46,10 @@ var app = new Vue({
             }, "json");
         },
         // 获取用户信息
-        getInfo: function (type) {
+        getInfo: function (sid) {
             var _this = this;
-            if(!type){
-                $.showLoading("数据加载中...");
-            }
-            $.post('/api/market/getInfo', {type: 2}, function (res) {
+            $.showLoading("数据加载中...");
+            $.post('/api/market/getInfo', {type: 2, id: sid}, function (res) {
                 $.hideLoading();
                 if (res.code == 'success') {
                     _this.memberInfo = res.data
@@ -100,7 +100,7 @@ var app = new Vue({
         // 初始化分享
         initShare: function(){
             var _this = this;
-            var url = 'http://'+document.domain+'/weixin/match/index?sid='+_this.memberInfo.id;
+            var url = location.href;
             var logo = 'http://'+document.domain+'/themes/default/weixin/public/assets/img/logo.jpg';
             $.post('/api/index/getJssdkParams', {url: url}, function (res) {
                 var params = res.data;
@@ -122,7 +122,7 @@ var app = new Vue({
                         title: '拾光单身活动', // 分享标题
                         // desc: '邀请你认识Ta', // 分享描述
                         desc: '汇聚南宁8090后优质单身青年,本硕博及海占比78%,脱单来这里就够了!', // 分享描述
-                        link: url, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+                        link: url+'?sid='+_this.memberInfo.id, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                         imgUrl: logo, // 分享图标
                         success: function () {
                         }
@@ -131,7 +131,7 @@ var app = new Vue({
                     wx.updateTimelineShareData({
                         title: '汇聚南宁8090后优质单身青年,本硕博及海占比78%,脱单来这里就够了!', // 分享标题
 
-                        link: url, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+                        link: url+'?sid='+_this.memberInfo.id, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                         //desc: '邀请你一起参加这个有趣的活动,每期都有脱单的哦!', // 分享描述
                         imgUrl: logo, // 分享图标
                         success: function () {