|
|
@@ -14,6 +14,14 @@ var app = new Vue({
|
|
|
married: 0,
|
|
|
pageSize: 12,
|
|
|
type: 2,
|
|
|
+ lat: '',
|
|
|
+ lng: '',
|
|
|
+ },
|
|
|
+ // 匹配推荐用户参数
|
|
|
+ matchParams: {
|
|
|
+ page: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ type: 2,
|
|
|
},
|
|
|
hasFollow: 0,
|
|
|
// 数据列表
|
|
|
@@ -176,7 +184,7 @@ var app = new Vue({
|
|
|
// 获取列表数据
|
|
|
getMatchList: function () {
|
|
|
var _this = this;
|
|
|
- $.post('/api/member/getRecommendList', {page: 1, type: 2, pageSize: 20}, function (res) {
|
|
|
+ $.post('/api/member/getRecommendList', _this.matchParams, function (res) {
|
|
|
if (res.code == 'success') {
|
|
|
_this.matchList = res.data.data
|
|
|
|
|
|
@@ -277,11 +285,34 @@ var app = new Vue({
|
|
|
timestamp: params.timestamp, // 必填,生成签名的时间戳
|
|
|
nonceStr: params.nonceStr, // 必填,生成签名的随机串
|
|
|
signature: params.signature,// 必填,签名
|
|
|
- jsApiList: ['updateAppMessageShareData','updateTimelineShareData'] // 必填,需要使用的JS接口列表
|
|
|
+ jsApiList: ['updateAppMessageShareData','updateTimelineShareData','getLocation','openLocation'] // 必填,需要使用的JS接口列表
|
|
|
});
|
|
|
|
|
|
// 初始化处理
|
|
|
wx.ready(function () {
|
|
|
+
|
|
|
+ // 获取定位数据
|
|
|
+ wx.getLocation({
|
|
|
+ success: function (res) {
|
|
|
+ console.log(res)
|
|
|
+ $.post('/api/member/getLocationAddress',{type: 2,lat: res.latitude,lng: res.longitude},function(res){
|
|
|
+ if(res.code == 'success'){
|
|
|
+ var location = res.data.location;
|
|
|
+ var lat = typeof(location.location.lat)!='undefined'? location.location.lat : 0;
|
|
|
+ var lng = typeof(location.location.lng)!='undefined'? location.location.lng : 0;
|
|
|
+ if(lat && lng){
|
|
|
+ _this.matchParams.lng = lng
|
|
|
+ _this.matchParams.lat = lat
|
|
|
+ _this.getMatchList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },'json');
|
|
|
+ },
|
|
|
+ cancel: function (res) {
|
|
|
+ $.toast('用户拒绝了授权位置信息', 'text');
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
// 好友
|
|
|
wx.updateAppMessageShareData({
|
|
|
title: '每一位真诚走心的单身,都值得被推荐~', // 分享标题
|