银花优选微信小程序修改后的最新版本代码
This commit is contained in:
262
pages/zhuanhuan/index.js
Normal file
262
pages/zhuanhuan/index.js
Normal file
@@ -0,0 +1,262 @@
|
||||
var app = getApp()
|
||||
var that=null
|
||||
var sopenFrame=null
|
||||
Page( {
|
||||
data: {
|
||||
loadingHidden:false,
|
||||
umoney:0.00,
|
||||
umoney0:0.00,
|
||||
sxfmoney:0.00,
|
||||
title:"您的余额",
|
||||
savedisable:"",
|
||||
savebutton:"确认",
|
||||
mybalance:[],
|
||||
Start: 0,
|
||||
t:0
|
||||
},
|
||||
|
||||
onLoad: function(options) {
|
||||
that = this
|
||||
if(options.t){
|
||||
that.setData({
|
||||
t:options.t
|
||||
});
|
||||
}
|
||||
if(that.data.t==1){
|
||||
wx.setNavigationBarTitle({
|
||||
title: "兑换积分划转流量积分"
|
||||
})
|
||||
that.setData({
|
||||
title:"您的积分"
|
||||
});
|
||||
}else if(that.data.t==2){
|
||||
wx.setNavigationBarTitle({
|
||||
title: "流量积分划转KSD"
|
||||
})
|
||||
that.setData({
|
||||
title:"您的积分"
|
||||
});
|
||||
}else if(that.data.t==3){
|
||||
wx.setNavigationBarTitle({
|
||||
title: "KSD划转流量积分"
|
||||
})
|
||||
that.setData({
|
||||
title:"您的KSD"
|
||||
});
|
||||
}else{
|
||||
wx.setNavigationBarTitle({
|
||||
title: "余额划转兑换积分"
|
||||
})
|
||||
}
|
||||
|
||||
that.rdata()
|
||||
|
||||
that.clearCache();//清本页缓存
|
||||
|
||||
that.getlist(0);
|
||||
},rdata: function() {
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var LoginId = wx.getStorageSync("LoginId")
|
||||
var userInfodata = wx.getStorageSync("userInfo")
|
||||
if(userId&&LoginId&&userInfodata){
|
||||
var userdata = JSON.parse(userInfodata)
|
||||
that.setData({
|
||||
phone:userdata.Phone
|
||||
})
|
||||
var umoney = userdata.xjjye
|
||||
var sxfmoney=0
|
||||
if(that.data.t==1){
|
||||
umoney = userdata.mfye
|
||||
}
|
||||
var TXEnable = userdata.ZHEnable;
|
||||
|
||||
if(TXEnable=="1"){
|
||||
that.setData({
|
||||
savebutton:"暂时不能划转",
|
||||
savedisable:"disabled"
|
||||
})
|
||||
}
|
||||
that.setData({
|
||||
umoney:umoney,
|
||||
sxfmoney:sxfmoney,
|
||||
loadingHidden:true
|
||||
})
|
||||
|
||||
//that.getje0()
|
||||
|
||||
}
|
||||
}, // 下拉刷新
|
||||
onPullDownRefresh: function () {
|
||||
//在当前页面显示导航条加载动画
|
||||
wx.showNavigationBarLoading();
|
||||
//显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框
|
||||
wx.showLoading({
|
||||
title: '刷新中...',
|
||||
})
|
||||
that.clearCache();
|
||||
that.getlist(1);//第一次加载数据
|
||||
},
|
||||
|
||||
// 页面上拉触底事件(上拉加载更多)
|
||||
onReachBottom: function () {
|
||||
that.setData({
|
||||
loadingHidden:false
|
||||
});
|
||||
that.getlist(2);//后台获取新数据并追加渲染
|
||||
},
|
||||
|
||||
// 清缓存
|
||||
clearCache:function(){
|
||||
that.setData({
|
||||
loadingHidden:false,
|
||||
Start: 0,
|
||||
mybalance:[]
|
||||
});
|
||||
},getlist: function(gp) {
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var LoginId = wx.getStorageSync("LoginId")
|
||||
wx.request({
|
||||
url: app.globalData.apiurl + "/xapiajax.ashx",
|
||||
data: {
|
||||
action:"getzhuanhuanlist",
|
||||
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;
|
||||
tmpArr.push.apply(tmpArr,res.data.data);
|
||||
that.setData({
|
||||
mybalance: tmpArr,
|
||||
Start: that.data.Start+res.data.data.length,
|
||||
loadingHidden:true
|
||||
})
|
||||
|
||||
}
|
||||
if(gp==1){
|
||||
//隐藏loading 提示框
|
||||
wx.hideLoading();
|
||||
//隐藏导航条加载动画
|
||||
wx.hideNavigationBarLoading();
|
||||
//停止下拉刷新
|
||||
wx.stopPullDownRefresh();
|
||||
}
|
||||
}
|
||||
})
|
||||
},getje0:function(e) {
|
||||
var money0=0.00;
|
||||
if(e.detail.value!=""){
|
||||
money0=app.changeTwoDecimal_f(parseFloat(e.detail.value)*that.data.sxfmoney);
|
||||
//money0=app.changeTwoDecimal_f(parseFloat(e.detail.value)-parseFloat(e.detail.value)*that.data.sxfmoney/100);
|
||||
}
|
||||
that.setData({
|
||||
money0:money0
|
||||
})
|
||||
|
||||
},withdrawal:function(e) {
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var LoginId = wx.getStorageSync("LoginId")
|
||||
var userInfodata = wx.getStorageSync("userInfo")
|
||||
if(userId&&LoginId&&userInfodata){
|
||||
var userInfo = JSON.parse(userInfodata)
|
||||
|
||||
var txje = e.detail.value.txje
|
||||
var pwd = e.detail.value.txpwd
|
||||
var b=true
|
||||
|
||||
if(b){
|
||||
if(txje==null || txje==""){
|
||||
b=false
|
||||
wx.showToast({
|
||||
title: "兑换数量不能为空!",
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
}
|
||||
if(b){
|
||||
if(pwd==null || pwd==""){
|
||||
b=false
|
||||
wx.showToast({
|
||||
title: "安全密码不能为空!",
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(b){
|
||||
|
||||
if(b){
|
||||
if(that.data.savebutton=="请稍候..."){
|
||||
b=false
|
||||
wx.showToast({
|
||||
title: "请稍候...",
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
}
|
||||
if(b){
|
||||
that.setData({
|
||||
savebutton:"请稍候..."
|
||||
})
|
||||
wx.request({
|
||||
url: app.globalData.apiurl + "/xapiajax.ashx",
|
||||
data: {
|
||||
action:"zhuanhuan",
|
||||
userId:(!userId?"":userId),
|
||||
LoginId:(!LoginId?"":LoginId),
|
||||
t:that.data.t,
|
||||
pwd:pwd,
|
||||
je:txje
|
||||
},
|
||||
method:"POST",
|
||||
dataType:"json",
|
||||
header: {
|
||||
"content-type": "application/x-www-form-urlencoded" // 默认值
|
||||
},
|
||||
success (res) {
|
||||
if(res.data.status==1){
|
||||
wx.setStorageSync('userInfo', JSON.stringify(res.data.userInfo))
|
||||
app.globalData.IFRefreshindex=1;
|
||||
app.globalData.IFRefreshmy=1;
|
||||
app.globalData.IFRefreshmybalance=1;
|
||||
wx.showModal({
|
||||
title: "操作提示",
|
||||
content: res.data.msg,
|
||||
showCancel:false,
|
||||
success (res0) {
|
||||
if (res0.confirm) {
|
||||
|
||||
wx.navigateBack({})
|
||||
}
|
||||
}
|
||||
})
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
that.setData({
|
||||
savebutton:"确认"
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
3
pages/zhuanhuan/index.json
Normal file
3
pages/zhuanhuan/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "兑换券划转绿色积分"
|
||||
}
|
||||
59
pages/zhuanhuan/index.wxml
Normal file
59
pages/zhuanhuan/index.wxml
Normal file
@@ -0,0 +1,59 @@
|
||||
<view class="container">
|
||||
|
||||
<view class="mydata-box">
|
||||
|
||||
<view class="frombody">
|
||||
<form bindsubmit='withdrawal'>
|
||||
|
||||
<view class="umoney">
|
||||
<text>{{title}}:</text>¥{{umoney}}
|
||||
</view>
|
||||
<view>
|
||||
<text>划转数量:</text><input name="txje" type="text" bindinput='getje0' placeholder="请填写您要划转的数量" value="" />
|
||||
</view>
|
||||
<view wx:if="{{sxfmoney>0}}">
|
||||
<text>实际到账:</text><input name="txje0" type="text" disabled="disabled" placeholder="" value="{{money0}}" />
|
||||
|
||||
</view>
|
||||
<view>
|
||||
<text>安全密码:</text><input name="txpwd" type="text" value="" placeholder="请填写您的安全密码" type="password" />
|
||||
</view>
|
||||
<view class="button">
|
||||
<button form-type="submit" class="{{savedisable}}">{{savebutton}}</button>
|
||||
|
||||
</view>
|
||||
|
||||
</form>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="mybalance-box">
|
||||
<view class="text">
|
||||
<view class="line_flag"></view>
|
||||
<text>划转记录</text>
|
||||
</view>
|
||||
<view class="mybalance-item" wx:for="{{mybalance}}" wx:for-index="index">
|
||||
<view class="Total">
|
||||
<view><text>划转数量:</text>{{item.b0}}</view>
|
||||
<view class="right"><text>实际到账:</text>{{item.b1}}</view>
|
||||
</view>
|
||||
|
||||
<view class="Total0">
|
||||
<view><text>时间:</text>{{item.addtime}}</view>
|
||||
</view>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<loading hidden="{{loadingHidden}}">
|
||||
加载中...
|
||||
</loading>
|
||||
86
pages/zhuanhuan/index.wxss
Normal file
86
pages/zhuanhuan/index.wxss
Normal file
@@ -0,0 +1,86 @@
|
||||
page{
|
||||
background: #ccc;
|
||||
}
|
||||
.container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
}
|
||||
.mydata-box{display: flex;flex-direction: column;align-items: center;justify-content: center;width:100%; padding: 0 0.8em; box-sizing: border-box; }
|
||||
|
||||
.mydata-box .frombody{margin-top: 1em; padding:0.5em 1em;width:100%; display: flex; border-radius:0.5em; flex-direction: column; align-items: center; background-color:#fff;box-sizing: border-box;}
|
||||
.mydata-box .frombody view{position: relative;float:left; width:100%;display: flex;flex-direction:row;border-bottom:1px solid #f1f1f1;padding:0.5em 0; box-sizing: border-box; line-height: 2.5em; }
|
||||
.mydata-box .frombody view view{display: block; width: auto;padding:0; border-bottom:0;line-height: 2.5em;}
|
||||
.mydata-box .frombody view text{float:left; display: block; padding:0; width:6em; height:2.5em; line-height: 2.5em;}
|
||||
.mydata-box .frombody view input{float:left; width:14em;height:2.5em; line-height: 2.5em;}
|
||||
.mydata-box .frombody view input.code{width:9em;}
|
||||
.mydata-box .frombody view.umoney{color:#ff4d00;}
|
||||
.mydata-box .frombody view.umoney text{color:#000;}
|
||||
.mydata-box .frombody view.getumoney view.sjdzmoney{float:left; flex-grow: 1;}
|
||||
.mydata-box .frombody view.getumoney view.sjdzmoney input{float:left; width:100%;}
|
||||
.mydata-box .frombody view.getumoney text.getfull{float: right; display: block; width:auto; color:#000;}
|
||||
.mydata-box .frombody view.getumoney0 text.sjdzmoney{float:left; flex-grow: 1;}
|
||||
.mydata-box .frombody view.getumoney0 text.getfull{float: right; display: block; width:auto; color:#000;}
|
||||
.mydata-box .frombody view.txzh{display:block;}
|
||||
.mydata-box .frombody view.txzh text{float:left; display:block;width:25%;height:4.5em; line-height: 4.5em;}
|
||||
.mydata-box .frombody view.txzh text.msg{float:left; display:block;width:75%;height:auto; line-height:1.5em;color: #939393;}
|
||||
.mydata-box .frombody view.area input{width:12.8em;}
|
||||
.mydata-box .frombody view.area image{position: absolute; top:1.1em; right:0; width:1.2em;height:1.2em;}
|
||||
.mydata-box .frombody view.button{border: 0;}
|
||||
.mydata-box .frombody view.button button{width:100%;height:2.5em; line-height: 2.5em; background:linear-gradient(to right,#00B050,#00B050); color:#fff; border-radius:0.5em;}
|
||||
.mydata-box .frombody view.button button.disabled{background:linear-gradient(to left,#939393,#eeeeee);color:#111;}
|
||||
.mydata-box .frombody view .picker_hx{color:#939393;line-height:2.5em;}
|
||||
.mydata-box .frombody view .picker_hx view{ float:left; position: relative; display: block; border:0;min-width:14em; padding:0 1em; box-sizing: border-box;border:1px solid #dfdfdf;border-radius:0.3em;height:2.5em;line-height:2.5em;}
|
||||
.mydata-box .frombody view .picker_hx image{position: absolute; top:0.6em;right:0.6em; width:1.2em;height:1.2em;}
|
||||
.mydata-box .frombody view.pay_box{display: flex; flex-direction: row; align-items: center; justify-content: center;width:100%; margin-top: 0em; padding:1em; box-sizing: border-box; background-color:#fff; font-size: 14px;}
|
||||
.mydata-box .frombody view.pay_box text{display: block; float:left; width:25%; height:2.5em;}
|
||||
.mydata-box .frombody view.pay_box text.pay_type{width:25%;line-height:2em;}
|
||||
.mydata-box .frombody view.pay_box view.paytype_box{
|
||||
float:left;width:75%; padding:0 0.5em; margin-right:0.5em; display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box;border-radius:0.5em;
|
||||
}
|
||||
.mydata-box .frombody view.pay_box view.paytype_box view{float:left;width: 100%; padding:0 0.5em; margin-right:0.5em; display: flex; align-items: center; justify-content:start;line-height:2em; border:1px solid #f1f1f1; box-sizing: border-box;border-radius:0.5em; text-align: left;}
|
||||
.mydata-box .frombody view.pay_box view.paytype_box view.weixinlq{margin-top: 1em;}
|
||||
.mydata-box .frombody view.pay_box view.paytype_box view.hover{border:1px solid #ff4d00;}
|
||||
.mydata-box .frombody view.pay_box view.paytype_box view image{width:1.4em;height:1.4em; margin-right: 0.5em;}
|
||||
.text{
|
||||
margin-bottom: 0.8em;
|
||||
height: 2.5em;
|
||||
line-height: 2.5em;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
border-bottom:1px solid #f1f1f1;
|
||||
}
|
||||
.text .line_flag{
|
||||
margin-top: 0em;
|
||||
margin-left: 0.8em;
|
||||
margin-right: 0.5em;
|
||||
width:0.5em;
|
||||
height: 1.5em;
|
||||
line-height: 1.5em;
|
||||
background-color: #00B050;
|
||||
border-radius:0.2em;
|
||||
}
|
||||
|
||||
.text .line_more{
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
align-self: center;
|
||||
color:#ff0000
|
||||
}
|
||||
.mybalance-box{display: flex;flex-direction: column;align-items: center;justify-content: center;width:100%; padding:0 0.8em; box-sizing: border-box;}
|
||||
.mybalance-item{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; background-color:#fff;border-radius:0.5em;}
|
||||
.mybalance-item view{width:100%;display: flex;flex-direction: row; align-items: center;justify-content:left;color: #939393;}
|
||||
.mybalance-item view text{color: #000;}
|
||||
.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:#ff4d00; box-sizing: border-box; overflow: hidden;}
|
||||
.mybalance-item view.Total view.right{float:right;}
|
||||
.mybalance-item view.Total view text{float: left; display: block;width:auto;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:#939393; box-sizing: border-box; overflow: hidden;}
|
||||
.mybalance-item view.Total0 view.right{float:right;width:auto;color:#939393;}
|
||||
.mybalance-item view.Total0 view.right text{color:#000;}
|
||||
Reference in New Issue
Block a user