银花优选微信小程序修改后的最新版本代码
This commit is contained in:
219
pages/kttgy/index.js
Normal file
219
pages/kttgy/index.js
Normal file
@@ -0,0 +1,219 @@
|
||||
var app = getApp()
|
||||
var that=null
|
||||
var sopenFrame=null
|
||||
Page( {
|
||||
data: {
|
||||
loadingHidden:false,
|
||||
t:0,
|
||||
mybalance:[],
|
||||
Start: 0,
|
||||
savebutton:"",
|
||||
qybutton:"确定",
|
||||
isShowConfirm:false,
|
||||
username:"",
|
||||
pwd:""
|
||||
|
||||
},
|
||||
|
||||
onLoad: function(options) {
|
||||
that = this
|
||||
if(options.t){
|
||||
that.setData({
|
||||
t:options.t
|
||||
});
|
||||
}
|
||||
var title="开通推广员"
|
||||
if(that.data.t==1){
|
||||
title="激活商家"
|
||||
}
|
||||
wx.setNavigationBarTitle({
|
||||
title: title
|
||||
})
|
||||
that.setData({
|
||||
savebutton:title
|
||||
});
|
||||
that.rdata()
|
||||
that.clearCache();//清本页缓存
|
||||
that.getlist(0);
|
||||
},rdata: function() {
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var LoginId = wx.getStorageSync("LoginId")
|
||||
|
||||
}, // 下拉刷新
|
||||
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:"getkttgylist",
|
||||
t:that.data.t,
|
||||
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
|
||||
})
|
||||
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
if(gp==1){
|
||||
//隐藏loading 提示框
|
||||
wx.hideLoading();
|
||||
//隐藏导航条加载动画
|
||||
wx.hideNavigationBarLoading();
|
||||
//停止下拉刷新
|
||||
wx.stopPullDownRefresh();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
,onsubmit:function(e) {
|
||||
|
||||
var username=e.detail.value.username.replace(/\s+/g, "");
|
||||
|
||||
var b=true
|
||||
if(b){
|
||||
if(username==""){
|
||||
b=false
|
||||
wx.showToast({
|
||||
title: "会员账号不能为空!",
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
}
|
||||
if(b){
|
||||
that.setData({
|
||||
username:username,
|
||||
isShowConfirm:true
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
},cancelsubmit:function() {
|
||||
that.setData({
|
||||
isShowConfirm:false
|
||||
})
|
||||
},
|
||||
//输入框中的值
|
||||
setValue: function (e) {
|
||||
this.setData({
|
||||
pwd: e.detail.value
|
||||
})
|
||||
},
|
||||
onsmlog: function (e) {
|
||||
var id=e.currentTarget.dataset.id;
|
||||
wx.navigateTo({
|
||||
url: "../mybusiness_smlog/index?t0=" + (that.data.t==1?1:2) + "&MemberId=" + id
|
||||
})
|
||||
},confirmsubmit:function(e) {
|
||||
var username=that.data.username.replace(/\s+/g, "");
|
||||
var pwd =that.data.pwd.replace(/\s+/g, "");
|
||||
var userId = wx.getStorageSync("userId")
|
||||
var LoginId = wx.getStorageSync("LoginId")
|
||||
var b=true
|
||||
|
||||
if(b){
|
||||
if(pwd==""){
|
||||
b=false
|
||||
wx.showToast({
|
||||
title: "安全密码不能为空!",
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
}
|
||||
if(b){
|
||||
that.setData({
|
||||
qybutton:"请稍候..."
|
||||
})
|
||||
wx.request({
|
||||
url: app.globalData.apiurl + "/xapiajax.ashx",
|
||||
data: {
|
||||
action:"kttgy",
|
||||
userId:(!userId?"":userId),
|
||||
LoginId:(!LoginId?"":LoginId),
|
||||
t:that.data.t,
|
||||
username:username,
|
||||
pwd:pwd
|
||||
},
|
||||
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.IFRefreshmy=1
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: "success",
|
||||
duration: 3000
|
||||
})
|
||||
that.clearCache();//清本页缓存
|
||||
that.getlist(0);
|
||||
that.cancelsubmit();
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.data.msg,
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
that.setData({
|
||||
qybutton:"确定"
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
3
pages/kttgy/index.json
Normal file
3
pages/kttgy/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
69
pages/kttgy/index.wxml
Normal file
69
pages/kttgy/index.wxml
Normal file
@@ -0,0 +1,69 @@
|
||||
<view class="container">
|
||||
|
||||
<view class="mydata-box">
|
||||
|
||||
<view class="frombody">
|
||||
<form bindsubmit='onsubmit'>
|
||||
<view>
|
||||
<input name="username" type="text" placeholder="请填写会员账号" />
|
||||
</view>
|
||||
|
||||
<view class="button">
|
||||
<button form-type="submit">{{savebutton}}</button>
|
||||
|
||||
</view>
|
||||
|
||||
</form>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="mybalance-box">
|
||||
<view class="text">
|
||||
<view class="line_flag"></view>
|
||||
<text>{{t==1?"激活":"开通"}}记录</text>
|
||||
</view>
|
||||
<view class="mybalance-item" wx:for="{{mybalance}}" wx:for-index="index">
|
||||
<view class="Total">
|
||||
<view><text>账号:</text>{{item.UserName}}</view>
|
||||
<view class="right">{{item.sjname}}</view>
|
||||
</view>
|
||||
|
||||
<view class="Total0">
|
||||
<view class="alink" bindtap="onsmlog" data-id="{{item.UserId}}"><text>扫码总额:</text>{{item.smzemoney}}</view>
|
||||
<view class="right"><text>今日金额:</text>{{item.jrmoney}}</view>
|
||||
</view>
|
||||
<view class="Total0">
|
||||
<view><text>昨日金额:</text>{{item.zrmoney}}</view>
|
||||
<view class="right"><text style="color:#848484">{{item.addtime}}</text></view>
|
||||
</view>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class='toast-box' wx:if="{{isShowConfirm}}">
|
||||
<view class='toastbg'></view>
|
||||
<view class='showToast'>
|
||||
<view class='toast-main'>
|
||||
<view class='toast-input'>
|
||||
<input type='password' bindinput='setValue' placeholder="请填写安全密码"></input>
|
||||
</view>
|
||||
</view>
|
||||
<view class='toast-button'>
|
||||
<view class='button1'>
|
||||
<view catchtap='cancelsubmit'>取消</view>
|
||||
</view>
|
||||
<view class='button2'>
|
||||
<view catchtap='confirmsubmit'>{{qybutton}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<loading hidden="{{loadingHidden}}">
|
||||
加载中...
|
||||
</loading>
|
||||
137
pages/kttgy/index.wxss
Normal file
137
pages/kttgy/index.wxss
Normal file
@@ -0,0 +1,137 @@
|
||||
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%;}
|
||||
|
||||
.mydata-box .frombody{ padding:0.5em 1em;width:100%; display: flex;flex-direction: column; align-items: center; background-color:#fff;box-sizing: border-box;}
|
||||
.mydata-box .frombody view{position: relative; width:100%;display: flex;flex-direction:row;padding:0.5em 0; box-sizing: border-box; text-align: center; }
|
||||
.mydata-box .frombody view text{padding:0;height:2.5em; line-height: 2.5em;}
|
||||
.mydata-box .frombody view input{width:14em;height:2.5em; line-height: 2.5em; background-color:#f5f5f5;border:1px solid #dfdfdf;border-radius:0.5em;padding: 0 0.2em;text-align:left; }
|
||||
.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:7em;height:2.5em; line-height: 2.5em; background:linear-gradient(to right,#00B050,#00B050); color:#fff; border-radius:0.5em;font-size: 1em;}
|
||||
.Hidden_box{ position: fixed;display: flex;align-items: center; justify-content: center; top:0; left:0; width:100%;height:100vh; background:rgba(0, 0, 0, 0.5);z-index: 2;}
|
||||
|
||||
.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: #848484;}
|
||||
.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; box-sizing: border-box; overflow: hidden;}
|
||||
.mybalance-item view.Total view.right{float:right;color:#848484}
|
||||
.mybalance-item view.Total view text{float: left; display: block;width:auto;color: #000;}
|
||||
.mybalance-item view.Total0{float: left; display: block;color:#ff4d00;}
|
||||
.mybalance-item view.Total0 view{float: left; display: block;width:auto; margin:0; padding:0;color:#ff4d00; box-sizing: border-box; overflow: hidden;}
|
||||
.mybalance-item view.Total0 view.right{float:right;width:auto;color:#ff4d00;}
|
||||
.mybalance-item view.Total0 view.right text{color:#000;}
|
||||
.mybalance-item view.Total0 view.alink{color:#00B050;}
|
||||
.mybalance-item view.Total0 view.alink text{color:#00B050;}
|
||||
/* 弹出窗 */
|
||||
.toast-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 1;
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
}
|
||||
.toastbg {
|
||||
opacity: 0.5;
|
||||
background-color: black;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.showToast {
|
||||
position: absolute;
|
||||
opacity: 1;
|
||||
width: 80%;
|
||||
margin-left: 10%;
|
||||
margin-top: 70%;
|
||||
}
|
||||
.toast-main {
|
||||
padding-top: 2vh;
|
||||
padding-bottom: 2vh;
|
||||
background-color: white;
|
||||
text-align: center;
|
||||
border-top-left-radius: 16rpx;
|
||||
border-top-right-radius: 16rpx;
|
||||
}
|
||||
.toast-input {
|
||||
margin-left: 5%;
|
||||
margin-right: 5%;
|
||||
margin-top:10%;
|
||||
margin-bottom:10%;
|
||||
background-color: rgb(240, 240, 240);
|
||||
padding-left: 2vh;
|
||||
padding-right: 2vh;
|
||||
padding-top: 1vh;
|
||||
padding-bottom: 1vh;
|
||||
border-radius:0.5em;
|
||||
}
|
||||
.toast-input input{
|
||||
background-color: rgb(240, 240, 240);
|
||||
|
||||
}
|
||||
.toast-button {
|
||||
display: flex;
|
||||
background-color: white;
|
||||
height:50px;
|
||||
width:100%;
|
||||
border-radius: 0px;
|
||||
border-bottom-left-radius: 16rpx;
|
||||
border-bottom-right-radius: 16rpx;
|
||||
border-top:1px solid rgb(211, 211, 211);
|
||||
}
|
||||
.button1 {
|
||||
width: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 0px;
|
||||
border-bottom-left-radius: 16rpx;
|
||||
}
|
||||
.button2 {
|
||||
width: 50%;
|
||||
border-left:1px solid rgb(211, 211, 211);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color:#40A4D6;
|
||||
}
|
||||
Reference in New Issue
Block a user