浏览代码

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

tags/湖南版5.1.4
meo 6 年前
父节点
当前提交
27ed4cbe9a
共有 3 个文件被更改,包括 31 次插入10 次删除
  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 查看文件

@@ -21,17 +21,13 @@ Page({
actUrl: imgurl.act.url,
loading: true,
content: '数据正在加载中',
reloadIf: false
reloadIf: false,
creditAmount: 0
},
onLoad: function (options) {
let that = this;
console.log(options)
if (options &&options.credit){
that.setData({
credit: options.credit
})
}
var todayDate = new Date().getTime();
that.getPoints();
that.setData({
optionsData: options,
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(){
wx.navigateTo({
url: '/pages/integralmall/integraHistory/index',
@@ -168,5 +189,6 @@ Page({
onPullDownRefresh: function (e) {
let that = this;
that.getList(1);
that.getPoints();
}
})

+ 1
- 1
pages/integralmall/index.wxml 查看文件

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


+ 1
- 2
pages/main/index.js 查看文件

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


正在加载...
取消
保存