Browse Source

添加修改密码和修改中奖记录

master
liaoxinyu 2 years ago
parent
commit
e94b1d8504
  1. 103
      pages/recordsList/WinningRecord/WinningRecord.vue
  2. 107
      pages/ucenter/ucenter.vue
  3. BIN
      static/user/forgot.png

103
pages/recordsList/WinningRecord/WinningRecord.vue

@ -1,7 +1,7 @@
<template>
<view style="padding-top: 20rpx;">
<view class="nav_area"></view>
<view class="">
<!-- <view class="">
<view class="uni-list">
<view class="uni-list-cell" style="padding: 20rpx 40rpx 0px;display: flex;align-items:center;font-size: 14px;">
<image src="../../../static/home/stLine-calendar-l@2x.png" mode="" style="width: 48rpx;height: 48rpx;margin-right: 10px;"></image>
@ -12,26 +12,28 @@
</view>
</view>
</view>
</view>
<view style="padding: 20rpx 40rpx 0px;display: flex;font-size: 14px;color: #999;">
</view> -->
<!-- <view style="padding: 20rpx 40rpx 0px;display: flex;font-size: 14px;color: #999;">
今日中奖总金额
<view style="color: #E50000;">{{allToday}}<text style="color: #444;">{{' '+unit}}</text></view>
</view>
</view> -->
<view class="record-head" v-if="recordsList.length>0">
<view style="flex:0.15;">ID</view>
<view style="flex:0.37;">手机号码</view>
<view style="flex:0.2;">时间</view>
<view style="flex:0.28;text-align: right;">中奖金额</view>
<view style="width: 56rpx;text-align: center;">ID</view>
<view style="width: 200rpx;text-align: left;">手机号码</view>
<view style="width: 100rpx;">时间</view>
<view style="width: 120rpx;">中奖金额</view>
</view>
<view v-for="(item,index) in recordsList" :key="index" class="record-item">
<view style="flex:0.15;">{{ item.user_id }}</view>
<view style="flex:0.37;">{{ item.phone }}</view>
<view style="flex:0.2;">{{ item.datetime }}</view>
<view style="flex:0.28;text-align: right;color: #E50000;">{{ item['awards_amount'] }}<text style="color: #444;"></text></view>
<view style="margin-top: 30px;">
<view v-for="(item,index) in recordsList" :key="index" class="record-item">
<view style="flex:0.15;">{{ item.user_id }}</view>
<view style="flex:0.45;">{{ item.phone }}</view>
<view style="flex:0.3;font-size: 12px;">{{ item.datetime }}</view>
<view style="flex:0.23;text-align: right;color: #E50000;">{{ item['awards_amount'] }}<text style="color: #444;"></text></view>
</view>
</view>
<view class="" v-if="recordsList.length===0" style="color: #999;text-align: center;padding: 40rpx;">
<!-- <view class="" v-if="recordsList.length===0" style="color: #999;text-align: center;padding: 40rpx;">
- 暂无记录 -
</view>
</view> -->
</view>
</template>
@ -64,7 +66,9 @@
// },
],
page: 1,
noMore: true,
noMore: false,
total:10,
limit:10
}
},
onLoad(e) {
@ -77,36 +81,45 @@
var today = year + '-' + month + '-' + day;
this.date = today;
this.endDate = today;
this.userType = uni.getStorageSync('userType');
this.getZJ();
// this.getZJ();
},
onShow() {
this.getZJ();
},
methods: {
getZJ(){
this.noMore = true;
API.request('/adminStatistics/awardRecords', {
page: this.page,
limit: 10,
date: this.date
// date: this.date
}, res=>{
console.log(res);
this.allToday = res.data.sum_amount;
this.unit = res.data.unit;
let list = res.data.list;
this.recordsList = [...this.recordsList, ...res.data.list]
this.total = res.data.total;
if(this.page===1){
list.length>0 ? this.noMore=false : false;
this.recordsList = list;
}else{
if(res.data.list.length==0){
uni.showToast({
title: '没有更多了',
icon: 'none'
})
this.noMore = true;
}
this.recordsList = this.recordsList.concat(list)
setTimeout(()=>{
this.page++;
this.getZJ();
},200)
}
// let list = res.data.list;
// if(this.page===1){
// list.length>0 ? this.noMore=false : false;
// this.recordsList = list;
// }else{
// if(res.data.list.length==0){
// uni.showToast({
// title: '',
// icon: 'none'
// })
this.noMore = false;
// }
// this.recordsList = this.recordsList.concat(list)
// }
})
},
bindDateChange: function(e) {
@ -117,6 +130,13 @@
},
onReachBottom() {
if(this.limit * this.page >= this.total) {
return uni.showToast({
title: "没有更多了!",
icon: "none"
})
}
//
if(this.noMore) return;
this.page++;
this.getZJ();
@ -145,13 +165,24 @@
font-size: 14px;
}
.record-head{
padding: 20rpx 40rpx 0px;
position: fixed;
top: 44px;
/* #ifdef APP-PLUS */
top: 0px;
/* #endif */
height: 40px;
line-height: 40px;
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
// padding: 20rpx 0rpx 0px;
background-color: #fff;
box-shadow: 5px 0.3px 2px 0px #000000;
// display: flex;
// flex-direction: row;
justify-content: space-around;
// align-items: center;
font-size: 14px;
color: #CECECE;
color: #ccc;
}
.record-item{
padding: 20rpx 40rpx 0px;

107
pages/ucenter/ucenter.vue

@ -75,21 +75,42 @@
</uni-list-item>
</template>
<template v-if="userType=='background'">
<uni-list-item v-for="(item,i) in ucenterList[3]" :title="item.title" link :rightText="item.rightText" :key="item.title"
:clickable="true" :to="item.to" @click="ucenterListClick(item)" :show-extra-icon="true"
:extraIcon="{type:item.icon,color:'#999'}">
<template v-slot:footer>
<view class="icon_new" v-if="item.iconN">
<image :src="'../../static/user/icon_'+item.iconN+'.png'" mode=""></image>
</view>
<view v-if="item.showBadge" class="item-footer">
<text class="item-footer-text">{{item.rightText}}</text>
<view class="item-footer-badge"></view>
</view>
</template>
</uni-list-item>
<uni-list-item v-for="(item,i) in ucenterList[3]" :title="item.title" link :rightText="item.rightText" :key="item.title"
:clickable="true" :to="item.to" @click="ucenterListClick(item)" :show-extra-icon="true"
:extraIcon="{type:item.icon,color:'#999'}">
<template v-slot:footer>
<view class="icon_new" v-if="item.iconN">
<image :src="'../../static/user/icon_'+item.iconN+'.png'" mode=""></image>
</view>
<view v-if="item.showBadge" class="item-footer">
<text class="item-footer-text">{{item.rightText}}</text>
<view class="item-footer-badge"></view>
</view>
</template>
</uni-list-item>
<div style="height: 50px;line-height: 50px;background-color: #fff;" @click="forget">
<view style="float: left;margin-left: 14px;padding-top: 12px;"><image src="../../static/user/forgot.png" mode="" style="width: 55rpx;height: 55rpx;"></image></view>
<view style="float: left;font-size: 13px;">修改密码</view>
<view style="float: right;margin-right: 20px;"><uni-icons type="forward" size="12" color='#999'></uni-icons></view>
</div>
</template>
</uni-list>
<view class="showClear" v-if="showforget">
<view class="showClear_box">
<view class="grey">温馨提示</view>
<view>确定后 将修改您的密码</view>
<view class="">
<input type="text" placeholder="修改密码" v-model="password">
</view>
<view class="">
<input type="text" placeholder="确认修改密码" v-model="ConfirmPassword">
</view>
<view class="btn_box">
<view class="grey" @click="showforget=false">取消</view>
<view class="" @click="confirmforget">确定</view>
</view>
</view>
</view>
<view class="showClear" v-if="showClear">
<view class="showClear_box">
<view class="grey">温馨提示</view>
@ -325,7 +346,7 @@
"event": 'clearCache',
"icon": "download",
"iconN": "clear"
},
}
],
// [
// // #ifdef APP-PLUS
@ -390,6 +411,9 @@
showClear: false,
password: '',
showTransfer: false,
showforget:false,
ConfirmPassword:"",
documentHeight: document.documentElement.clientHeight,//
}
},
onLoad() {
@ -403,7 +427,16 @@
// })
//#endif
// window.onresize
window.onresize = () => {
return (() => {
if (this.documentHeight > document.documentElement.clientHeight) {
uni.hideTabBar();
} else {
uni.showTabBar();
}
})();
};
},
onShow() {
this.userType = uni.getStorageSync('userType');
@ -441,6 +474,50 @@
},
methods: {
forget(){
this.showforget = true
this.password = ""
},
confirmforget(){
// uni.navigateTo({
// url: "/pages/login/login"
// })
if(this.password.length<6){
uni.showToast({
title: '密码长度不能小于6位',
icon: 'none'
})
return;
}
if(!this.password){
uni.showToast({
title: '请输入修改密码',
icon: 'none'
})
return;
}
if(this.ConfirmPassword!=this.password){
uni.showToast({
title: '修改密码和确认密码不一致',
icon: 'none'
})
return;
}
API.request('/adminUser/updatePassword', {password:this.password}, res=>{
if(200==res.code){
uni.showToast({
title: '修改成功'
})
localStorage.removeItem("user_token")
setTimeout(()=>{
this.getAdminUserInfo();
},1000)
}
console.log(res);
})
},
toSettings() {
uni.navigateTo({
url: "/pages/ucenter/settings/settings"

BIN
static/user/forgot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1010 B

Loading…
Cancel
Save