wx399182c36706169c-sheng.xi.../pages/pairtop_astro/pairtop_astro.js

70 lines
2.5 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var a, t;
a = getApp(), t = require("../../utils/util.js"), Page({
data: {
array: [ "白羊座3.21-4.19)", "金牛座4.20-5.20)", "双子座5.21-6.21)", "巨蟹座6.22-7.22)", "狮子座7.23-8.22)", "处女座8.23-9.22)", "天秤座9.23-10.23)", "天蝎座10.24-11.22)", "射手座11.23-12.21)", "摩羯座12.22-1.19)", "水瓶座1.20-2.18)", "双鱼座2.19-3.20)" ],
xz: [ "白羊", "金牛", "双子", "巨蟹", "狮子", "处女", "天秤", "天蝎", "射手", "摩羯", "水瓶", "双鱼" ],
maleid: 0,
smaleid: 0,
topNum: a.globalData.topNum
},
onLoad: function(a) {
var t = this, o = a.maleid;
if (o) {
for (var n = 0; n < t.data.topNum.length; n++) o == t.data.topNum[n] && (o = n);
t.setData({
maleid: o,
smaleid: o
});
}
t.startPair(t.data.maleid);
},
bindPickerChange: function(a) {
this.setData({
smaleid: a.detail.value
});
},
startPair: function(a) {
this.setData({
maleid: this.data.smaleid
}), this.showInfo(parseInt(this.data.maleid) + 1);
},
showInfo: function(a) {
var o = this;
t.getPairTopData(o, "xz", a, function() {
var a = o.data.infodata;
console.log("111", o.data.infodata), o.dealArr(a);
});
},
dealArr: function(a) {
for (var t = [], o = [], n = [], i = [], e = this, s = 0; s < a.length; s++) {
var r = a[s];
r.desc[0].v = r.desc[0].v.substring(0, 30) + "...", r.desc[1].v = r.desc[1].v.substring(0, 30) + "...",
"100" == r.exponent[0] ? t.push(r) : "90" == r.exponent[0] ? o.push(r) : "80" == r.exponent[0] ? n.push(r) : i.push(r);
}
setTimeout(function() {
var a = [ t, o, n, i ];
e.setData({
pairList: a
}), console.log("配对数据", e.data.pairList);
}, 300);
},
scrollTop: function() {
wx.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
onReady: function() {},
onShow: function() {},
onHide: function() {},
onUnload: function() {},
onPullDownRefresh: function() {},
onReachBottom: function() {},
onShareAppMessage: function(a) {
return "button" === a.from && console.log(a.target), {
title: "星座配对排行",
path: "/pages/pairtop_astro/pairtop_astro?maleid=" + this.data.maleid
};
}
});