提交 c46cd6a5 编写于 作者: M m0_74163447

增加图标、修改提示框

上级 6540c9a4
......@@ -45,7 +45,10 @@
</view>
<button class="save" @tap="savaInfo">保 存 修 改</button>
</view>
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog cancelText="取消" confirmText="确定" title="提示" content="确定修改你的信息吗?"
@confirm="dialogConfirm"></uni-popup-dialog>
</uni-popup>
</view>
</view>
</template>
......@@ -112,41 +115,70 @@
complete() {}
});
},
// avatarChoose() {
// let that = this;
// uni.chooseImage({
// count: 1,
// sizeType: ['original', 'compressed'],
// sourceType: ['album', 'camera'],
// success: function(res) {
// var tempFilePaths = res.tempFilePaths;
// pathToBase64(tempFilePaths[0]) //图像转base64工具
// .then(base64 => {
// that.avatar = base64;
// //将文件转化为base64并显示
// // that.avatarUpload(base64); //同时将头像上传至数据库进行存储
// }).catch(error => {
// console.error(error)
// })
// }
// });
// },
getUserInfo() {
uni.getUserProfile({
desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
console.log(res);
uni.showToast({
title: '已授权',
icon: 'none',
duration: 2000
})
}
dialogConfirm() {
let that = this;
let gender = that.selectSex[that.index1].name;
let school = that.school[that.index2].name;
let nickname = that.nickName;
let mobile = that.mobile;
let headimg = that.avatar;
let updata = {};
if (!nickname) {
uni.showToast({
title: '请填写昵称',
icon: 'none',
duration: 2000
});
return;
}
updata.nickname = nickname;
if (!headimg) {
headimg = that.avater;
}
updata.headimg = headimg;
updata.gender = gender;
updata.school = school;
if (that.isPoneAvailable(mobile)) {
updata.mobile = mobile;
} else {
uni.showToast({
title: '手机号码有误,请重填',
icon: 'none',
duration: 2000
});
return;
}
this.Upload(updata);
getApp().globalData.icon=updata.headimg;
getApp().globalData.name=updata.nickname;
getApp().globalData.moblie=updata.mobile;
getApp().globalData.gender=updata.gender;
getApp().globalData.school=updata.school;
uni.navigateBack({
delta: 1, //返回层数,2则上上页
})
this.$refs.alertDialog.close();
},
dialogClose() {
//console.log('点击关闭')
this.$refsalertDialog.close();
},
// getUserInfo() {
// uni.getUserProfile({
// desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
// success: (res) => {
// console.log(res);
// uni.showToast({
// title: '已授权',
// icon: 'none',
// duration: 2000
// })
// }
// })
// },
// getphonenumber(e) {
// if (e.detail.iv) {
// console.log(e.detail.iv) //传后台解密换取手机号
......@@ -158,59 +190,60 @@
// }
// },
savaInfo() {
uni.showModal({
title: '温馨提示', //提示标题
content: '确认修改你的个人信息吗', //提示内容
showCancel: true, //是否显示取消按钮
success: res => {
if (res.confirm) { //confirm为ture,代表用户点击确定
let that = this;
let gender = that.selectSex[that.index1].name;
let school = that.school[that.index2].name;
let nickname = that.nickName;
let mobile = that.mobile;
let headimg = that.avatar;
let updata = {};
if (!nickname) {
uni.showToast({
title: '请填写昵称',
icon: 'none',
duration: 2000
});
return;
}
updata.nickname = nickname;
if (!headimg) {
headimg = that.avater;
}
updata.headimg = headimg;
updata.gender = gender;
updata.school = school;
if (that.isPoneAvailable(mobile)) {
updata.mobile = mobile;
} else {
uni.showToast({
title: '手机号码有误,请重填',
icon: 'none',
duration: 2000
});
return;
}
this.Upload(updata);
getApp().globalData.icon=updata.headimg;
getApp().globalData.name=updata.nickname;
getApp().globalData.moblie=updata.mobile;
getApp().globalData.gender=updata.gender;
getApp().globalData.school=updata.school;
uni.navigateBack({
delta: 1, //返回层数,2则上上页
})
// that.updata(updata);
} else if (res.cancel) { //cancel为ture,代表用户点击取消
console.log('点击了取消按钮');
}
}
})
this.$refs.alertDialog.open();
// uni.showModal({
// title: '温馨提示', //提示标题
// content: '确认修改你的个人信息吗', //提示内容
// showCancel: true, //是否显示取消按钮
// success: res => {
// if (res.confirm) { //confirm为ture,代表用户点击确定
// let that = this;
// let gender = that.selectSex[that.index1].name;
// let school = that.school[that.index2].name;
// let nickname = that.nickName;
// let mobile = that.mobile;
// let headimg = that.avatar;
// let updata = {};
// if (!nickname) {
// uni.showToast({
// title: '请填写昵称',
// icon: 'none',
// duration: 2000
// });
// return;
// }
// updata.nickname = nickname;
// if (!headimg) {
// headimg = that.avater;
// }
// updata.headimg = headimg;
// updata.gender = gender;
// updata.school = school;
// if (that.isPoneAvailable(mobile)) {
// updata.mobile = mobile;
// } else {
// uni.showToast({
// title: '手机号码有误,请重填',
// icon: 'none',
// duration: 2000
// });
// return;
// }
// this.Upload(updata);
// getApp().globalData.icon=updata.headimg;
// getApp().globalData.name=updata.nickname;
// getApp().globalData.moblie=updata.mobile;
// getApp().globalData.gender=updata.gender;
// getApp().globalData.school=updata.school;
// uni.navigateBack({
// delta: 1, //返回层数,2则上上页
// })
// // that.updata(updata);
// } else if (res.cancel) { //cancel为ture,代表用户点击取消
// console.log('点击了取消按钮');
// }
// }
// })
},
......
......@@ -30,6 +30,10 @@
<view class="confirm">
<button class="confirm-btn" @click="confirmModification()">确认修改</button>
</view>
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog cancelText="取消" confirmText="确定" title="提示" content="确定修改你的密码吗?"
@confirm="dialogConfirm"></uni-popup-dialog>
</uni-popup>
</view>
</template>
......@@ -53,46 +57,75 @@
bindConfirmPassword(e) {
this.confirmPassword = e.detail.value;
},
// showPwd: function() {
// this.showPassword = !this.showPassword;
// },
dialogConfirm() {
let that = this;
let password = that.password;
let newPassword = that.newPassword;
let confirmPassword = that.confirmPassword;
let updata = {};
if (!that.isPasswordAvailable(newPassword)) {
uni.showToast({
title: '密码长度在8-20位!',
icon: 'none',
duration: 2000
});
return;
} else if (!that.isConfirmPasswordAvailable(newPassword, confirmPassword)) {
uni.showToast({
title: '两次密码不一致',
icon: 'none',
duration: 2000
});
return;
} else {
updata.password = password;
updata.newPassword = newPassword;
}
this.Upload(updata);
this.$refs.alertDialog.close();
},
dialogClose() {
//console.log('点击关闭')
this.$refsalertDialog.close();
},
confirmModification() {
uni.showModal({
title: '温馨提示', //提示标题
content: '确认修改密码吗', //提示内容
showCancel: true, //是否显示取消按钮
success: res => {
if (res.confirm) { //confirm为ture,代表用户点击确定
let that = this;
let password = that.password;
let newPassword = that.newPassword;
let confirmPassword = that.confirmPassword;
let updata = {};
if (!that.isPasswordAvailable(newPassword)) {
uni.showToast({
title: '密码长度在8-20位!',
icon: 'none',
duration: 2000
});
return;
} else if (!that.isConfirmPasswordAvailable(newPassword, confirmPassword)) {
uni.showToast({
title: '两次密码不一致',
icon: 'none',
duration: 2000
});
return;
} else {
updata.password = password;
updata.newPassword = newPassword;
}
this.Upload(updata);
} else if (res.cancel) { //cancel为ture,代表用户点击取消
console.log('点击了取消按钮');
}
}
})
this.$refs.alertDialog.open();
// uni.showModal({
// title: '温馨提示', //提示标题
// content: '确认修改密码吗', //提示内容
// showCancel: true, //是否显示取消按钮
// success: res => {
// if (res.confirm) { //confirm为ture,代表用户点击确定
// let that = this;
// let password = that.password;
// let newPassword = that.newPassword;
// let confirmPassword = that.confirmPassword;
// let updata = {};
// if (!that.isPasswordAvailable(newPassword)) {
// uni.showToast({
// title: '密码长度在8-20位!',
// icon: 'none',
// duration: 2000
// });
// return;
// } else if (!that.isConfirmPasswordAvailable(newPassword, confirmPassword)) {
// uni.showToast({
// title: '两次密码不一致',
// icon: 'none',
// duration: 2000
// });
// return;
// } else {
// updata.password = password;
// updata.newPassword = newPassword;
// }
// this.Upload(updata);
// } else if (res.cancel) { //cancel为ture,代表用户点击取消
// console.log('点击了取消按钮');
// }
// }
// })
},
isPasswordAvailable(newPassword) {
......
......@@ -24,7 +24,6 @@
<image class="duration-icon" :src="'/static/my/my-record/duration.png'"></image>
<view class="pace">
{{parseInt(item.pace/60).toString().padStart(2,0)}}'{{parseInt(item.pace%60).toString().padStart(2,0)}}''
<!-- {{runningrecord.pace}} -->
</view>
<image class="pace-icon" :src="'/static/my/my-record/pace.png'"></image>
<view class="date">
......@@ -134,7 +133,7 @@
onLoad() {
//console.log(this.formatSeconds(10));
plus.navigator.setStatusBarBackground('#EDEEF0');
//plus.navigator.setStatusBarBackground('#EDEEF0');
this.getData();
}
}
......@@ -197,9 +196,9 @@
height: 150rpx;
margin-top: 20rpx;
margin-left: 30rpx;
/* background-size:100% 100%;
background-image:url("/static/my/my-record/run.png");
background-repeat:no-repeat; */
background-size:100% 100%;
background-image:url("/static/my/my-record/run.png/");
background-repeat:no-repeat;
float: left;
}
......
......@@ -25,6 +25,10 @@
<view class="exit">
<button class="exit-btn" @click="confirmExit()">退出账号</button>
</view>
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog cancelText="取消" confirmText="确定" title="提示" content="确定退出你的账号吗?"
@confirm="dialogConfirm"></uni-popup-dialog>
</uni-popup>
</view>
</template>
......@@ -37,26 +41,40 @@
}
},
methods:{
dialogConfirm() {
uni.reLaunch({
url: '/pages/login/login',
animationType: 'pop-in',
animationDuration: 300
})
this.$refs.alertDialog.close();
},
dialogClose() {
//console.log('点击关闭')
this.$refsalertDialog.close();
},
confirmExit(){
uni.showModal({
title: '温馨提示', //提示标题
content: '确认退出你的账号吗', //提示内容
showCancel: true, //是否显示取消按钮
success: function (res) {
if (res.confirm) { //confirm为ture,代表用户点击确定
// uni.navigateTo({
// url: '/pages/login/login'
// })
uni.reLaunch({
url: '/pages/login/login',
animationType: 'pop-in',
animationDuration: 300
})
} else if (res.cancel) { //cancel为ture,代表用户点击取消
this.$refs.alertDialog.open();
// uni.showModal({
// title: '温馨提示', //提示标题
// content: '确认退出你的账号吗', //提示内容
// showCancel: true, //是否显示取消按钮
// success: function (res) {
// if (res.confirm) { //confirm为ture,代表用户点击确定
// // uni.navigateTo({
// // url: '/pages/login/login'
// // })
// uni.reLaunch({
// url: '/pages/login/login',
// animationType: 'pop-in',
// animationDuration: 300
// })
// } else if (res.cancel) { //cancel为ture,代表用户点击取消
}
}
})
// }
// }
// })
},
goBack(){
uni.navigateBack({
......
......@@ -121,7 +121,7 @@
},
onLoad() {
plus.navigator.setStatusBarBackground('#EDEEF0');
//plus.navigator.setStatusBarBackground('#EDEEF0');
this.getData();
}
}
......@@ -184,6 +184,9 @@
height: 150rpx;
margin-top: 20rpx;
margin-left: 30rpx;
background-size:100% 100%;
background-image:url("/static/my/my-record/walk.png/");
background-repeat:no-repeat;
float: left;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册