zoukankan      html  css  js  c++  java
  • php搜索附近人及显示男生女生分开

    // 滚动切换标签样式
    switchTab: function (e) {
    this.setData({
    currentTab: e.detail.current
    });
    this.checkCor();
    0 == e.detail.current ? this.setData({
    people: this.data.peopless
    }) : 1 == e.detail.current ? this.setData({
    people: this.data.people1
    }) : this.setData({
    people: this.data.people2
    })
    },
    // tab选项卡切换
    tabtoggle(e) {
    var cur = e.target.dataset.current;
    var currentTab = this.data.currentTab
    if (currentTab == cur) { return false; }
    else {
    this.setData({
    currentTab: cur
    })
    0 == cur ? this.setData({
    people: this.data.peopless
    }) : 1 == cur ? this.setData({
    people: this.data.people1
    }) : this.setData({
    people: this.data.people2
    })
    }
    },
     
     
     
    getFujin:function(la1, lo1){
    var that = this;
    app.util.request({
    'url': 'entry/wxapp/Fujin',
    data:{
    lat:la1,//自己的经纬度
    lo:lo1
    },
    success: function (res) {
    console.log(res.data.data);
    var people = res.data.data;
    var people1 = [], people2 = [], len = people.length; // 1 男 2 女
    for (var j = 0; j < people.length; j++) {
    that.distance(la1, lo1, people[j].latitude, people[j].longitude)
    people[j].juli = that.data.s.toFixed(2);
    }
    for (var i = 0; i < len;i++){
    if (people[i].x_sex == "0"){
    people1.push(people[i]);
    }else{
    people2.push(people[i]);
    }
    }
    console.log(people1);
    console.log(people2);
    that.setData({
    people: res.data.data,
    peopless: res.data.data,
    people1: people1,
    people2: people2,
    })
     
    },
    fail: function (err) {
    console.log(err)
    },
    });
    },
  • 相关阅读:
    Javascript图片预加载详解
    Canvas入门(3):图像处理和绘制文字
    CSS强制英文、中文换行与不换行 强制英文换行
    数组分隔成两个一组
    scrollview嵌套tableview
    审核被拒:1. 1 Safety: Objectionable Content ;3. 1.1 Business: Payments
    流程控制-用布尔值
    xcode代码提示没了
    sourceTree回退撤销commit
    iOS使用mask切割不规则图案
  • 原文地址:https://www.cnblogs.com/isuansuan/p/9990452.html
Copyright © 2011-2022 走看看