银花优选微信小程序修改后的最新版本代码
This commit is contained in:
110
pages/zzjf_qwlog/index.js
Normal file
110
pages/zzjf_qwlog/index.js
Normal file
@@ -0,0 +1,110 @@
|
||||
var app = getApp()
|
||||
var that=null
|
||||
var sopenFrame=null
|
||||
var wait=120
|
||||
Page( {
|
||||
data: {
|
||||
loadingHidden:false,
|
||||
nodataHidden:true,
|
||||
mybalance:[],
|
||||
ifrdata:0,
|
||||
Start: 0
|
||||
},
|
||||
|
||||
onLoad: function(options) {
|
||||
that = this
|
||||
that.clearCache();//清本页缓存
|
||||
that.getlist(0);
|
||||
}, // 下拉刷新
|
||||
onPullDownRefresh: function () {
|
||||
//在当前页面显示导航条加载动画
|
||||
wx.showNavigationBarLoading();
|
||||
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
|
||||
wx.showLoading({
|
||||
title: '刷新中...',
|
||||
})
|
||||
that.clearCache();
|
||||
that.getlist(1);//第一次加载数据
|
||||
},
|
||||
|
||||
// 页面上拉触底事件(上拉加载更多)
|
||||
onReachBottom: function () {
|
||||
if(that.data.loadingHidden){
|
||||
that.setData({
|
||||
loadingHidden:false
|
||||
});
|
||||
that.getlist(2);//后台获取新数据并追加渲染
|
||||
}else{
|
||||
wx.hideLoading();
|
||||
}
|
||||
},
|
||||
|
||||
// 清缓存
|
||||
clearCache:function(){
|
||||
that.setData({
|
||||
loadingHidden:false,
|
||||
Start: 0,
|
||||
mybalance:[]
|
||||
});
|
||||
},getlist: function(gp) {
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var LoginId = wx.getStorageSync("LoginId")
|
||||
that.setData({
|
||||
ifrdata:1
|
||||
})
|
||||
wx.request({
|
||||
url: app.globalData.apiurl + "/xapiajax.ashx?timestamp=" + (new Date().getTime() / 1000),
|
||||
data: {
|
||||
action:"getqwzzjf_log",
|
||||
Start:that.data.Start,
|
||||
userId:(userId==null?"":userId),
|
||||
LoginId:(LoginId==null?"":LoginId)
|
||||
},
|
||||
method:"GET",
|
||||
dataType:"json",
|
||||
header: {
|
||||
"content-type": "application/json" // 默认值
|
||||
},
|
||||
success (res) {
|
||||
|
||||
if(res.data.status==1){
|
||||
var tmpArr = null;
|
||||
tmpArr = that.data.mybalance;
|
||||
if(res.data.data.length>0){
|
||||
tmpArr.push.apply(tmpArr,res.data.data);
|
||||
}
|
||||
that.setData({
|
||||
mybalance: tmpArr,
|
||||
Start: that.data.Start+res.data.data.length,
|
||||
loadingHidden:true
|
||||
})
|
||||
if(gp==0||gp==1){
|
||||
if(res.data.data.length==0){
|
||||
that.setData({
|
||||
nodataHidden:false
|
||||
})
|
||||
}else{
|
||||
that.setData({
|
||||
nodataHidden:true
|
||||
})
|
||||
}
|
||||
}
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
if(gp==1){
|
||||
//隐藏loading 提示框
|
||||
wx.hideLoading();
|
||||
//隐藏导航条加载动画
|
||||
wx.hideNavigationBarLoading();
|
||||
//停止下拉刷新
|
||||
wx.stopPullDownRefresh();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
3
pages/zzjf_qwlog/index.json
Normal file
3
pages/zzjf_qwlog/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "全网记录"
|
||||
}
|
||||
19
pages/zzjf_qwlog/index.wxml
Normal file
19
pages/zzjf_qwlog/index.wxml
Normal file
@@ -0,0 +1,19 @@
|
||||
<view class="container">
|
||||
<view class="mybalance-item" wx:for="{{mybalance}}" wx:for-index="index">
|
||||
<view class="Total">
|
||||
<view><text>数量:{{item.sl}}</text></view>
|
||||
<view class="right">价格:{{item.jg}}</view>
|
||||
</view>
|
||||
<view class="Total0">
|
||||
<view>时间:{{item.addtime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="nodata" hidden="{{nodataHidden}}">
|
||||
<image src="../../images/order-null.png"/>
|
||||
<view>暂无数据</view>
|
||||
</view>
|
||||
|
||||
<loading hidden="{{loadingHidden}}">
|
||||
加载中...
|
||||
</loading>
|
||||
105
pages/zzjf_qwlog/index.wxss
Normal file
105
pages/zzjf_qwlog/index.wxss
Normal file
@@ -0,0 +1,105 @@
|
||||
page{
|
||||
background: #ccc;
|
||||
}
|
||||
.container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
padding: 0.8em;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.mybalance-item {
|
||||
float: left;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
padding: 0.8em;
|
||||
margin: 0.8em 0;
|
||||
margin-top: 0;
|
||||
line-height: 2em;
|
||||
border-radius: 0.4em;
|
||||
background-color: #fff;
|
||||
border: solid 1px #dfdfdf;
|
||||
}
|
||||
.mybalance-item view {
|
||||
float: left;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: left;
|
||||
color: #000;
|
||||
font-size: 0.96em;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.mybalance-item view text{color: #fff;}
|
||||
.mybalance-item view text.Totalprice{ margin-left: 1em;}
|
||||
.mybalance-item view.Total{float: left; display: block;}
|
||||
.mybalance-item view.Total view {
|
||||
float: left;
|
||||
display: block;
|
||||
width: auto;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: #848484;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.mybalance-item view.Total view text {
|
||||
float: left;
|
||||
display: block;
|
||||
width: auto;
|
||||
color: #000;
|
||||
}
|
||||
.mybalance-item view.Total view.right {
|
||||
float: right;
|
||||
color: #848484;
|
||||
}
|
||||
.mybalance-item view.Total view.right span {
|
||||
color: #000;
|
||||
}
|
||||
.mybalance-item view.Total0{float: left; display: block;}
|
||||
.mybalance-item view.Total0 view{float: left; display: block;width:auto; margin:0; padding:0;color:#848484; box-sizing: border-box; overflow: hidden;}
|
||||
.mybalance-item view.Total0 view text{
|
||||
color: #000;
|
||||
}
|
||||
.mybalance-item view.Total0 view.right {
|
||||
float: right;
|
||||
width: auto;
|
||||
color: #848484;
|
||||
}
|
||||
.mybalance-item view.Total0 view.right text{color:#000;}
|
||||
.mybalance-item view.Total0 view.right .mybtn{border-radius:0.4em; height:1.8em; line-height:1.8em; padding:0 0.4em; color:#fff;}
|
||||
.mybalance-item view.button_box {
|
||||
float: left;
|
||||
display: block;
|
||||
}
|
||||
.mybalance-item view.button_box .mybtn {
|
||||
float: left;
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 50%;
|
||||
height: 2.5em;
|
||||
line-height: 2.5em;
|
||||
background: linear-gradient(to right,#fec811,#fec811);
|
||||
color: #000;
|
||||
border-radius: 0.5em 0 0 0.5em;
|
||||
}
|
||||
.mybalance-item view.button_box .mybtn.kddjbtn {
|
||||
background: linear-gradient(to right,#ff9615,#ff9615);
|
||||
border-radius: 0 0.5em 0.5em 0;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.nodata{padding-top:1em; text-align: center; line-height: 1.5em; color:#939393;}
|
||||
.nodata image {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
Reference in New Issue
Block a user