Browse Source

[首页积分][修改]:[首页积分商城入口修改详情页面的积分]

tags/湖南版5.1.4
meo 6 years ago
parent
commit
27ed4cbe9a
3 changed files with 31 additions and 10 deletions
  1. +29
    -7
      pages/integralmall/index.js
  2. +1
    -1
      pages/integralmall/index.wxml
  3. +1
    -2
      pages/main/index.js

+ 29
- 7
pages/integralmall/index.js View File

@@ -21,17 +21,13 @@ Page({
actUrl: imgurl.act.url, actUrl: imgurl.act.url,
loading: true, loading: true,
content: '数据正在加载中', content: '数据正在加载中',
reloadIf: false
reloadIf: false,
creditAmount: 0
}, },
onLoad: function (options) { onLoad: function (options) {
let that = this; let that = this;
console.log(options)
if (options &&options.credit){
that.setData({
credit: options.credit
})
}
var todayDate = new Date().getTime(); var todayDate = new Date().getTime();
that.getPoints();
that.setData({ that.setData({
optionsData: options, optionsData: options,
todayDate: todayDate todayDate: todayDate
@@ -58,6 +54,31 @@ Page({
}) })
} }
}, },
// 获得积分,渲染页面
getPoints(){
let that = this;
Http.get({
url: config.api.integralList,
data: {
pageNum: 1,
pageSize: 1,
}
}).then(res => {
wx.stopPullDownRefresh();
that.setData({
creditAmount: res.data.list[0].creditAmount
});
})
.catch(err => {
wx.stopPullDownRefresh();
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000,
mask: false
});
})
},
gotojifen(){ gotojifen(){
wx.navigateTo({ wx.navigateTo({
url: '/pages/integralmall/integraHistory/index', url: '/pages/integralmall/integraHistory/index',
@@ -168,5 +189,6 @@ Page({
onPullDownRefresh: function (e) { onPullDownRefresh: function (e) {
let that = this; let that = this;
that.getList(1); that.getList(1);
that.getPoints();
} }
}) })

+ 1
- 1
pages/integralmall/index.wxml View File

@@ -2,7 +2,7 @@
<view class='topbg'> <view class='topbg'>
<image bindtap='gotojifen' src='{{wangmeimeicredit}}' mode='widthFix'></image> <image bindtap='gotojifen' src='{{wangmeimeicredit}}' mode='widthFix'></image>
<text class='my'>我的积分</text> <text class='my'>我的积分</text>
<text class='score'>{{credit}}</text>
<text class='score'>{{creditAmount}}</text>
</view> </view>
<view class='no-data01' wx:if='{{lists.length==0}}'> <view class='no-data01' wx:if='{{lists.length==0}}'>
<image src='{{nodata}}'></image> <image src='{{nodata}}'></image>


+ 1
- 2
pages/main/index.js View File

@@ -111,9 +111,8 @@ Page({
}, },
//跳往积分商城 //跳往积分商城
gotouser:function(){ gotouser:function(){
let credit = this.data.credit;
wx.navigateTo({ wx.navigateTo({
url: `/pages/integralmall/index?credit=${credit}`
url: `/pages/integralmall/index`
}) })
}, },
//跳往砍价专场 //跳往砍价专场


Loading…
Cancel
Save