123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <template>
- <view class="content">
- <view class="messageBg">
- <!-- 新密码 -->
- <view class="message line">
- <view class="leftTitle">新密码:</view>
- <input password="tue" type="text" class="passWord" placeholder="请输入新密码" v-model="newPW" @confirm="newPWDone" />
- </view>
- <!-- 确认密码 -->
- <view class="message">
- <view class="leftTitle">确认密码:</view>
- <input password="tue" type="text" class="passWord" placeholder="请再次输入新密码" v-model="surePW" @confirm="surePWDone" />
- </view>
- </view>
- <!-- 修改 -->
- <view class="sureBtn" @click="changePW">确定修改</view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- newPW: '',
- surePW: '',
- }
- },
- methods: {
- newPWDone(e) {
- this.newPW = e.target.value;
- console.log(this.newPW);
- },
- surePWDone(e) {
- this.surePW = e.target.value;
- console.log(this.surePW);
- },
- changePW() {
- if (!this.newPW) {
- uni.showToast({
- title: '密码不能为空',
- duration: 2000,
- icon: 'none'
- })
- return
- }
- if ((this.surePW != this.newPW)) {
- uni.showToast({
- title: '请确认密码',
- duration: 2000,
- icon: 'none'
- })
- this.surePW = '';
- return
- }
- uni.showLoading({
- title: '加载中'
- })
- this.$http('accompany/SuperAccounts/updatePwd', {
- pwd: this.surePW,
- }, 'POST').then(res => {
- uni.hideLoading()
-
-
- uni.showToast({
- title: '修改成功',
- })
- setTimeout(function(){
- uni.navigateBack({
-
- })
- },1000)
- })
- }
- }
- }
- </script>
- <style>
- .content {
- background-color: #F4F5F7;
- min-height: 100vh;
- padding: 20rpx 24rpx;
- }
- /* #ifdef H5 */
- .content {
- background-color: #F4F5F7;
- min-height: calc(100vh - 44px);
- padding: 20rpx 24rpx;
- }
- /* #endif */
- .messageBg,
- .sureBtn {
- background-color: #FFFFFF;
- border-radius: 10rpx;
- margin: 20rpx 0rpx;
- }
- .message {
- display: flex;
- justify-content: flex-start;
- line-height: 98rpx;
- align-items: center;
- }
- .line {
- border-bottom: 1rpx solid #EEEEEE;
- }
- .leftTitle {
- font-size: 28rpx;
- color: #3C3C3C;
- margin-left: 20rpx;
- width: 140rpx;
- }
- .passWord {
- flex-grow: 1;
- font-size: 28rpx;
- color: #999999;
- margin-left: 52rpx;
- margin-right: 20rpx;
- }
- .sureBtn {
- line-height: 98rpx;
- text-align: center;
- color: #FFFFFF;
- background-color: #FF8700;
- }
- </style>
|