|
@@ -256,45 +256,13 @@ Page({
|
|
|
}, 2800)
|
|
|
},
|
|
|
onLoad: function(options) {
|
|
|
- this.setData({
|
|
|
- isIos: app.globalData.isIOS
|
|
|
- })
|
|
|
- if (options.tabbarIndx) {
|
|
|
- this.updateData(options.tabbarIndx);
|
|
|
- }
|
|
|
- if (options.scene) {
|
|
|
- let optionsStr = decodeURIComponent(options.scene);
|
|
|
- let optionsArr = optionsStr.split('&');
|
|
|
- // 暂时这样写
|
|
|
- if (optionsArr[0].split("=")[0] === "type") {
|
|
|
- console.log('我是团购分享')
|
|
|
- options.type = optionsArr[0].split("=")[1];
|
|
|
- options.sid = optionsArr[1].split("=")[1];
|
|
|
- } else {
|
|
|
- options.readId = optionsArr[0];
|
|
|
- options.activity = optionsArr[1];
|
|
|
- }
|
|
|
- }
|
|
|
- if (options.readId) {
|
|
|
+ if (wx.getStorageSync('uid')) {
|
|
|
this.setData({
|
|
|
- workId: options.readId
|
|
|
+ isLogin: true
|
|
|
})
|
|
|
}
|
|
|
- /**
|
|
|
- * 活动统计
|
|
|
- */
|
|
|
- if (options.activity) {
|
|
|
- httpRequestApi.shareAddHotAmount(options.readId).success(res => {
|
|
|
- console.log(res)
|
|
|
- })
|
|
|
- }
|
|
|
- /**团购弹窗时间紧逻辑越写越乱功能越加越多 */
|
|
|
- this.setData({
|
|
|
- iphoneType: options.type || ''
|
|
|
- })
|
|
|
- console.log('onload', options);
|
|
|
- let shareUid = options.uid
|
|
|
- getOpenidNoLogin((res) => {
|
|
|
+ //网络原因,还没有拿到登陆数据,这里调用全局的callback
|
|
|
+ getApp().callBack = (res) => {
|
|
|
/**获取权限和订单信息 */
|
|
|
// 获取商品信息
|
|
|
httpRequestApi.getProductActivity().success(res => {
|
|
@@ -311,16 +279,6 @@ Page({
|
|
|
// 获取用户权限
|
|
|
this.getHelpAuth()
|
|
|
if (!res.data.data.grade) {
|
|
|
- /* // 没有年级的老用户
|
|
|
- if (res.data.data.nickName) {
|
|
|
- this.setData({
|
|
|
- isGradeShow: true,
|
|
|
- options,
|
|
|
- isLogin: true,
|
|
|
- oldUser: true
|
|
|
- })
|
|
|
- return;
|
|
|
- } */
|
|
|
this.setData({
|
|
|
isGradeShow: true,
|
|
|
options,
|
|
@@ -329,16 +287,11 @@ Page({
|
|
|
})
|
|
|
return
|
|
|
} else {
|
|
|
- if (res.data.data.nickName) {
|
|
|
- this.setData({
|
|
|
- isLogin: true
|
|
|
- }, () => {
|
|
|
- this.showPage();
|
|
|
- })
|
|
|
- } else {
|
|
|
- console.log('游客未登录有年纪')
|
|
|
+ this.setData({
|
|
|
+ isLogin: true
|
|
|
+ }, () => {
|
|
|
this.showPage();
|
|
|
- }
|
|
|
+ })
|
|
|
}
|
|
|
// 获取商品信息
|
|
|
httpRequestApi.getProductActivity().success(res => {
|
|
@@ -354,7 +307,45 @@ Page({
|
|
|
})
|
|
|
// 获取用户权限
|
|
|
this.getHelpAuth()
|
|
|
- }, () => {}, shareUid);
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ isIos: app.globalData.isIOS
|
|
|
+ })
|
|
|
+ if (options.scene) {
|
|
|
+ let optionsStr = decodeURIComponent(options.scene);
|
|
|
+ let optionsArr = optionsStr.split('&');
|
|
|
+ // 暂时这样写
|
|
|
+ if (optionsArr[0].split("=")[0] === "type") {
|
|
|
+ console.log('我是团购分享')
|
|
|
+ options.type = optionsArr[0].split("=")[1];
|
|
|
+ options.sid = optionsArr[1].split("=")[1];
|
|
|
+ } else {
|
|
|
+ options.readId = optionsArr[0];
|
|
|
+ options.activity = optionsArr[1];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (options.readId) {
|
|
|
+ this.setData({
|
|
|
+ workId: options.readId
|
|
|
+ })
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 活动统计
|
|
|
+ */
|
|
|
+ if (options.activity) {
|
|
|
+ httpRequestApi.shareAddHotAmount(options.readId).success(res => {
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ /**团购弹窗时间紧逻辑越写越乱功能越加越多 */
|
|
|
+ this.setData({
|
|
|
+ iphoneType: options.type || ''
|
|
|
+ })
|
|
|
+ console.log('onload', options);
|
|
|
+
|
|
|
+ if (options.tabbarIndx) {
|
|
|
+ this.updateData(options.tabbarIndx);
|
|
|
+ }
|
|
|
this.uid = wx.getStorageSync('uid');
|
|
|
if (options.sid) {
|
|
|
httpRequestApi.getUserRec(options.sid).success(res => {
|
|
@@ -941,26 +932,7 @@ Page({
|
|
|
this.showPage()
|
|
|
})
|
|
|
return;
|
|
|
- /* getOpenidNoLogin((res) => {
|
|
|
- console.log('getOpenidNoLogin', res)
|
|
|
- // 登录或注册完成 展示页面
|
|
|
- if (res.data.data.nickName) {
|
|
|
- this.setData({
|
|
|
- isLogin: true
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.setData({
|
|
|
- isLogin: false
|
|
|
- })
|
|
|
- }
|
|
|
- this.showPage()
|
|
|
- }, (error) => {
|
|
|
- console.log('获取失败')
|
|
|
- wx.setStorageSync('userSourseType', 'normal')
|
|
|
- this.setData({
|
|
|
- hide: !this.data.hide
|
|
|
- })
|
|
|
- }, grade); */
|
|
|
+
|
|
|
},
|
|
|
|
|
|
getFollowData: function() {
|