瀏覽代碼

[积分商城][修改][所需积分排序]

tags/C.10.02
hurui 5 年之前
父節點
當前提交
96e12a526b
共有 2 個檔案被更改,包括 20 行新增13 行删除
  1. +18
    -11
      pages/integralmall/index.js
  2. +2
    -2
      pages/integralmall/index.wxml

+ 18
- 11
pages/integralmall/index.js 查看文件

@@ -18,6 +18,7 @@ Page({
barcode: imgurl.barcode.url, barcode: imgurl.barcode.url,
list: [], list: [],
lists: [], lists: [],
arrays:[],
myLists: [], myLists: [],
page: 1, // 设置加载的第几次,默认是第一次 page: 1, // 设置加载的第几次,默认是第一次
pageSize: 10, //返回数据的个数 pageSize: 10, //返回数据的个数
@@ -32,7 +33,6 @@ Page({
score: '0', score: '0',
sort:'', sort:'',
hidden:false, hidden:false,
creditPrice:''
}, },
qrcodeH: function () { qrcodeH: function () {
var that = this; var that = this;
@@ -189,10 +189,11 @@ Page({
}, },
//我可换购 //我可换购
canSort(){ canSort(){
}, },
//所需积分 //所需积分
need: function (e) {
need: function () {
console.log(this.data.hidden) console.log(this.data.hidden)
var that = this; var that = this;
var hid = this.data.hidden; var hid = this.data.hidden;
@@ -201,35 +202,32 @@ Page({
that.setData({ that.setData({
sort :imgurl.up.url sort :imgurl.up.url
}) })
this.getList(1)
that.getList(1, 'creditPrice', 'desc')
} }
else { else {
hid = true; hid = true;
that.setData({ that.setData({
sort: imgurl.down.url sort: imgurl.down.url
}) })
this.getList(1)
that.getList(1, 'creditPrice', 'asc')
} }
this.setData({ this.setData({
hidden: hid // 改变状态 hidden: hid // 改变状态
}) })
}, },
//sortColumn=shopNumber&sortOrder=desc
getList(pageNum) {
getList(pageNum, sortColumn, sortOrder) {
var that = this; var that = this;
let desc = 1
if (that.data.allow_load) { if (that.data.allow_load) {
that.setData({ that.setData({
loading: true, loading: true,
content: '小主,我在玩命加载中...' content: '小主,我在玩命加载中...'
}) })
var param = {};
var param = { var param = {
pageNum: pageNum, pageNum: pageNum,
pageSize: 10, pageSize: 10,
targetAd: 50, targetAd: 50,
// sortColumn:,
// sortOrder:
sortColumn: sortColumn,
sortOrder: sortOrder
}; };
var url = config.api.couponChannelList; var url = config.api.couponChannelList;
// 请求接口 // 请求接口
@@ -238,6 +236,8 @@ Page({
data: param, data: param,
}).then(res => { }).then(res => {
console.log(res) console.log(res)
console.log(this.data.creditAmount)
/** /**
* 加载完成 * 加载完成
*/ */
@@ -262,10 +262,17 @@ Page({
}) })
} }
var tmpArr = that.data.lists; var tmpArr = that.data.lists;
// tmpArr = [...tmpArr, ...res.data.list];
tmpArr.push.apply(tmpArr, res.data.list); tmpArr.push.apply(tmpArr, res.data.list);
that.setData({ that.setData({
lists: tmpArr lists: tmpArr
}) })
// tmpArr.map(file => {
// if (file.creditPrice <= that.data.creditAmount) {
// that.data.arrays.push(file);
// }
// })
// console.log(that.data.arrays)
wx.stopPullDownRefresh(); wx.stopPullDownRefresh();
}) })
.catch(err => { .catch(err => {


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

@@ -42,13 +42,13 @@
<view class='no-data-text'>暂无数据</view> <view class='no-data-text'>暂无数据</view>
</view> </view>
<view class='sort'> <view class='sort'>
<view bindtap='can'>我可换购</view>
<view bindtap='canSort'>我可换购</view>
<view class='need' bindtap='need'> <view class='need' bindtap='need'>
<text>所需积分</text> <text>所需积分</text>
<image wx:if="{{sort }}" src='{{sort}}' moda="aspectFill" ></image> <image wx:if="{{sort }}" src='{{sort}}' moda="aspectFill" ></image>
</view> </view>
</view> </view>
<view class='content' wx:if='{{lists.length>0}}'>
<view class='content' wx:if='{{lists.length>0}}' >
<view class='sepll-list' wx:for="{{lists}}" wx:key="{{index}}" data-couponId='{{item.couponId}}' data-id='{{item.id}}' bindtap='invite'> <view class='sepll-list' wx:for="{{lists}}" wx:key="{{index}}" data-couponId='{{item.couponId}}' data-id='{{item.id}}' bindtap='invite'>
<view class='spell-left'> <view class='spell-left'>
<image src='{{item.coverImg}}' mode="aspectFill"></image> <image src='{{item.coverImg}}' mode="aspectFill"></image>


Loading…
取消
儲存