|
@@ -2,10 +2,14 @@ const app = getApp();
|
|
|
|
|
|
Page({
|
|
|
cashdialog: null,
|
|
|
+ isOpenView: false,
|
|
|
pid: '',
|
|
|
pg: 1,
|
|
|
data: {
|
|
|
isShowNull: false
|
|
|
+ },
|
|
|
+ onReady: function(){
|
|
|
+
|
|
|
},
|
|
|
onLoad: function (options) {
|
|
|
|
|
@@ -15,35 +19,35 @@ Page({
|
|
|
let uid = arr[0];
|
|
|
this.pid = arr[1];
|
|
|
app.saveInviteUid(uid);
|
|
|
- }
|
|
|
-
|
|
|
- if (app.isLogin()){
|
|
|
- this.getHomeData(this);
|
|
|
+
|
|
|
+ this.isOpenView = true;
|
|
|
}else{
|
|
|
- var that = this;
|
|
|
- wx.login({
|
|
|
- success: function (res) {
|
|
|
- if (res.code) {
|
|
|
- app.request("passport.applet.bind", {
|
|
|
- code: res.code
|
|
|
- }, {
|
|
|
- success: function (data, res) {
|
|
|
- that.getHomeData(that);
|
|
|
+ this.isOpenView = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ var that = this;
|
|
|
+ wx.login({
|
|
|
+ success: function (res) {
|
|
|
+ if (res.code) {
|
|
|
+ app.request("passport.applet.bind", {
|
|
|
+ code: res.code
|
|
|
+ }, {
|
|
|
+ success: function (data, res) {
|
|
|
+ that.getHomeData(that);
|
|
|
+ if (that.isOpenView){
|
|
|
+ app.location('view/index?id=' + that.pid);
|
|
|
}
|
|
|
- })
|
|
|
- }
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- })
|
|
|
- }
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
|
|
|
* 获取首页数据
|
|
|
*/
|
|
|
getHomeData: function(that){
|
|
|
- if(that.pid != ''){
|
|
|
- app.location('view/index?id=' + that.pid);
|
|
|
- }
|
|
|
if (that.pg == 1) {
|
|
|
app.showLoading();
|
|
|
}
|
|
@@ -65,6 +69,9 @@ Page({
|
|
|
app.set(that, 'isShowNull', true);
|
|
|
}
|
|
|
app.hideLoading();
|
|
|
+ },
|
|
|
+ complete: function(res){
|
|
|
+ app.hideLoading();
|
|
|
}
|
|
|
});
|
|
|
},
|