From 821a7b39e3a4a8dbffc3b96b85515beef9d2caf6 Mon Sep 17 00:00:00 2001 From: yvan.ni <765199919@qq.com> Date: Sat, 2 Nov 2019 18:12:27 +0800 Subject: [PATCH] 购买等级卡流程, 明细的修改 --- pages/user/Detailed/Detailed.js | 45 ++++++++++++++++++++------------------------- pages/user/Detailed/Detailed.json | 2 +- pages/user/Detailed/Detailed.wxml | 2 +- pages/user/plus/plus.js | 14 ++++++++++++++ 4 files changed, 36 insertions(+), 27 deletions(-) diff --git a/pages/user/Detailed/Detailed.js b/pages/user/Detailed/Detailed.js index 4b90a4b..5d0b43c 100644 --- a/pages/user/Detailed/Detailed.js +++ b/pages/user/Detailed/Detailed.js @@ -1,21 +1,13 @@ -var e = function(e) { - return e && e.__esModule ? e : { - default: e - }; - }(require("../../../utils/LoadMore.js")), - t = getApp(), +var t = getApp(), r = t.globalData, a = t.request, o = t.globalData.setting, os = o, i = require("../../../utils/util.js"), ut = i, - s = require("../../../utils/common.js"), - n = new e.default(); -Page({ - - + s = require("../../../utils/common.js"); +Page({ /** * 页面的初始数据 */ @@ -36,8 +28,7 @@ Page({ }, selectDetailed: function() { - var th = this, - e = th; + var th = this, e = th; getApp().request.promiseGet("/api/weshop/plus/vip/mem/referee/page", { data: { storeId: o.stoid, @@ -46,20 +37,24 @@ Page({ pageSize: th.data.pageSize } }).then(res => { - th.data.page++;//当前页数+1 - var arr1 = th.data.arrayDetailed;//获取明细数组 - var arr2 = res.data.data.pageData;//获取当前查询数据 - var arr3 = [...arr1, ...arr2];//把当前查询数组拼接到原本数组后面 + + th.setData({isDetailed:1}) + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0) { + th.data.page++;//当前页数+1 + var arr1 = th.data.arrayDetailed;//获取明细数组 + var arr2 = res.data.data.pageData;//获取当前查询数据 + var arr3 = [...arr1, ...arr2];//把当前查询数组拼接到原本数组后面 - var ismore = 0; - if (arr3.length == res.data.data.total) ismore = 1 //数据已加载完判断 + var ismore = 0; + if (arr3.length == res.data.data.total) ismore = 1 //数据已加载完判断 - th.setData({ - arrayDetailed: arr3, - total: res.data.data.total, - ismore: ismore, - isDetailed: 1 - }) + th.setData({ + arrayDetailed: arr3, + total: res.data.data.total, + ismore: ismore, + isDetailed: 1 + }) + } }), wx.stopPullDownRefresh(); diff --git a/pages/user/Detailed/Detailed.json b/pages/user/Detailed/Detailed.json index cf71c5e..f681560 100644 --- a/pages/user/Detailed/Detailed.json +++ b/pages/user/Detailed/Detailed.json @@ -1,5 +1,5 @@ { - "navigationBarTitleText": "邀请明细", + "navigationBarTitleText": "邀请明细", "usingComponents": { "warn": "/components/long_warn/long_warn" } diff --git a/pages/user/Detailed/Detailed.wxml b/pages/user/Detailed/Detailed.wxml index b2e65ec..53a1d39 100644 --- a/pages/user/Detailed/Detailed.wxml +++ b/pages/user/Detailed/Detailed.wxml @@ -13,7 +13,7 @@ - + diff --git a/pages/user/plus/plus.js b/pages/user/plus/plus.js index 5fcf679..6879964 100644 --- a/pages/user/plus/plus.js +++ b/pages/user/plus/plus.js @@ -125,6 +125,20 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + var th=this,app_d=getApp().globalData; + getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + app_d.user_id, { + success: function (e) { + var userInfo = e.data.data; + if(userInfo['card_field']){ + getApp().confirmBox("您已经是plus会员"); + setTimeout(function () { + var u_url = "/pages/user/cardinfo/cardinfo"; + wx.reLaunch({url: u_url}) + },1500) + } + }, + }); + this.getPlusCardType(); }, -- libgit2 0.21.4