From 11ac3666423de5c03da72c388e38d869f04d9af7 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期二, 28 五月 2024 09:17:15 +0800
Subject: [PATCH] 1.APP重置密码100%
---
config/api.js | 8 ++
pages/grzx/mmsz.vue | 178 ++++++++++++++++++++++++++++++++++++++++++++
pages.json | 8 ++
pages/grzx/gzcl.vue | 6
style/global.css | 2
pages/xtsy/index.vue | 2
6 files changed, 199 insertions(+), 5 deletions(-)
diff --git a/config/api.js b/config/api.js
index 705058a..f5ba104 100644
--- a/config/api.js
+++ b/config/api.js
@@ -317,4 +317,12 @@
// 璁惧缁翠慨楠岃瘉鎻愪氦
export const RepairVerificationScanDeviceSave = (data) => http.post('/DeviceManager/RepairVerificationScanDeviceSave',
+ data)
+
+// 淇敼瀵嗙爜
+export const UpdateUserPassword = (data) => http.post('/Login/UpdateUserPassword' +
+ data)
+
+// 瀵嗙爜閲嶇疆
+export const ResettUserPassword = (data) => http.post('/Login/ResettUserPassword' +
data)
\ No newline at end of file
diff --git a/pages.json b/pages.json
index 619c12b..c16b66f 100644
--- a/pages.json
+++ b/pages.json
@@ -231,6 +231,14 @@
"enablePullDownRefresh": false
}
},
+ {
+ "path": "pages/grzx/mmsz",
+ "style": {
+ "navigationBarTitleText": "瀵嗙爜璁剧疆",
+ "navigationStyle": "custom",
+ "enablePullDownRefresh": false
+ }
+ },
{
diff --git a/pages/grzx/gzcl.vue b/pages/grzx/gzcl.vue
index 0612cbf..02b5539 100644
--- a/pages/grzx/gzcl.vue
+++ b/pages/grzx/gzcl.vue
@@ -63,7 +63,7 @@
<!-- <view class='inputClass' style="margin:10rpx auto 0;">
<u--input placeholder="璇烽�夋嫨" border="surround" v-model="startDate"></u--input>
</view> -->
- <!-- icon='calendar' -->
+ <!-- icon='calendar' -->
<u-button type="info" iconColor="#0659FF" size="" @click="calendarClick"
:text="calendarRange">
</u-button>
@@ -75,8 +75,8 @@
<view class="number">{{ parseFloat(form.report_qty)}}</view>
</view>
<view class="head_block_item flex_column">
- <view class="titleFont">鑹簾鎵i櫎</view>
- <view class="number">{{ parseFloat(form.userngbadmoney)}}</view>
+ <view class="titleFont">涓嶈壇鏁伴噺</view>
+ <view class="number">{{ parseFloat(form.userngbadqty)}}</view>
</view>
<view class="head_block_item flex_column">
<view class="titleFont">宸ヨ祫鏀跺叆(鍏�)</view>
diff --git a/pages/grzx/mmsz.vue b/pages/grzx/mmsz.vue
new file mode 100644
index 0000000..192cfb9
--- /dev/null
+++ b/pages/grzx/mmsz.vue
@@ -0,0 +1,178 @@
+<template>
+ <view class="">
+ <page-nav title="瀵嗙爜璁剧疆"></page-nav>
+
+
+ <view class="flex_column head titleFont" style="min-height: 1400rpx;">
+ <view class="flex_center marginTop20 marginLeft20">
+ <view style="margin-left: 36rpx;">鍘熷瘑鐮侊細</view>
+ <view class='inputClass'>
+ <u--input placeholder="璇疯緭鍏�" border="surround" v-model="oldPassword"></u--input>
+ </view>
+ </view>
+ <view class="flex_center marginTop20 marginLeft20">
+ <view style="margin-left: 36rpx;">鏂板瘑鐮侊細</view>
+ <view class='inputClass'>
+ <u--input placeholder="璇疯緭鍏�" border="surround" v-model="newPassword"></u--input>
+ </view>
+ </view>
+ <view class="flex_center marginTop20 marginLeft20">
+ <view>纭瀵嗙爜锛�</view>
+ <view class='inputClass'>
+ <u--input placeholder="璇疯緭鍏�" border="surround" v-model="newPasswordConfirm"></u--input>
+ </view>
+ </view>
+ </view>
+
+
+ <view class="footer">
+ <u-button :loading="isDisabledSubmitButtonReset" loadingText="閲嶇疆涓�..."
+ style='width: 50%;border-radius: 10rpx 0 0 10rpx;' type="success" @click="resetPassword" text="閲嶇疆瀵嗙爜"
+ size="large">
+ </u-button>
+ <u-button :loading="isDisabledSubmitButtonEdit" loadingText="淇敼涓�..."
+ style='width: 50%;border-radius:0 10rpx 10rpx 0' @click="editPassword" type="primary" text="淇敼瀵嗙爜"
+ size="large"></u-button>
+ </view>
+
+ </view>
+</template>
+
+
+<script>
+ import {
+ UpdateUserPassword,
+ ResettUserPassword
+ } from '../../config/api.js';
+
+ export default {
+ onLoad(option) {
+
+ },
+
+ onPullDownRefresh() {
+ setTimeout(() => {
+ this.init(() => {
+ uni.stopPullDownRefresh();
+ })
+ }, 1000);
+ },
+
+ data() {
+ return {
+ topRightMessageCount: '',
+
+ isDisabledSubmitButtonReset: false,
+
+ isDisabledSubmitButtonEdit: false,
+
+ oldPassword: '', //鍘熷瘑鐮�
+ newPassword: '', //鏂板瘑鐮�
+ newPasswordConfirm: '', //纭瀵嗙爜
+
+
+ }
+ },
+ created() {
+
+ },
+ mounted() {
+ this.init()
+
+ },
+ methods: {
+ init() {
+ uni.stopPullDownRefresh();
+ },
+
+ // 閲嶇疆瀵嗙爜
+ async resetPassword() {
+ const data = {
+ usercode: uni.getStorageSync("usercode"),
+ username: uni.getStorageSync("username"),
+ usertype: 'APP'
+ }
+ this.isDisabledSubmitButtonReset = true
+ const res = await ResettUserPassword(this.global.formatData(data))
+
+ if (res.code === '200') {
+ this.isDisabledSubmitButtonReset = false
+ this.$u.toast('瀵嗙爜閲嶇疆鎴愬姛锛�')
+
+ uni.setStorageSync("Token", '')
+ uni.setStorageSync("usercode", '')
+ uni.setStorageSync("username", '')
+ uni.setStorageSync("storg_code", '')
+ uni.setStorageSync("storg_name", '')
+
+ setTimeout(() => {
+ uni.redirectTo({
+ url: '../login/index'
+ });
+ }, 2000)
+
+ } else {
+ this.isDisabledSubmitButtonReset = false
+ this.$u.toast('瀵嗙爜閲嶇疆澶辫触锛�')
+ }
+
+ },
+ // 淇敼瀵嗙爜
+ async editPassword() {
+ if (!this.oldPassword) {
+ return this.$u.toast('璇疯緭鍏ュ師瀵嗙爜锛�')
+ }
+ if (!this.newPassword) {
+ return this.$u.toast('璇疯緭鍏ユ柊瀵嗙爜锛�')
+ }
+ if (!this.newPasswordConfirm) {
+ return this.$u.toast('璇疯緭鍏ョ‘璁ゅ瘑鐮侊紒')
+ }
+
+ if (this.newPassword.trim() !== this.newPasswordConfirm.trim()) {
+ return this.$u.toast('鏂板瘑鐮佷笌纭瀵嗙爜涓嶄竴鑷达紒')
+ }
+
+ const data = {
+ // usercode: uni.getStorageSync("usercode"),
+ // username: uni.getStorageSync("username"),
+ password: this.oldPassword.trim(),
+ newpassword: this.newPassword.trim()
+ }
+
+ this.isDisabledSubmitButtonEdit = true
+ const res = await UpdateUserPassword(this.global.formatData(data))
+
+ if (res.code === '200') {
+ this.isDisabledSubmitButtonEdit = false
+ this.$u.toast('瀵嗙爜淇敼鎴愬姛锛�')
+ uni.setStorageSync("Token", '')
+ uni.setStorageSync("usercode", '')
+ uni.setStorageSync("username", '')
+ uni.setStorageSync("storg_code", '')
+ uni.setStorageSync("storg_name", '')
+
+ setTimeout(() => {
+ uni.redirectTo({
+ url: '../login/index'
+ });
+ }, 2000)
+
+ } else {
+ this.isDisabledSubmitButtonEdit = false
+ this.$u.toast('瀵嗙爜淇敼澶辫触锛�')
+ }
+
+ }
+
+ }
+ }
+</script>
+
+<style lang="scss" scoped>
+ @import url('@/style/global.css');
+
+ ::v-deep .uicon-arrow-left>span {
+ display: block;
+ }
+</style>
\ No newline at end of file
diff --git a/pages/xtsy/index.vue b/pages/xtsy/index.vue
index 01439db..2947384 100644
--- a/pages/xtsy/index.vue
+++ b/pages/xtsy/index.vue
@@ -167,7 +167,7 @@
case '2100':
url = 'grzx/gzcl' //宸ヨ祫浜ч噺
break;
- case '2014':
+ case '2101':
url = 'grzx/mmsz' //瀵嗙爜璁剧疆
break;
case '2015':
diff --git a/style/global.css b/style/global.css
index 88eb53c..e3c8d51 100644
--- a/style/global.css
+++ b/style/global.css
@@ -158,7 +158,7 @@
/* padding-top: 20rpx; */
/* padding-bottom: 20rpx; */
display: flex;
- flex-direction: column;
+ /* flex-direction: column; */
width: 100%;
}
--
Gitblit v1.9.3