From 3022fdb1f9828f441a18bf61fd965375ae5a5ca7 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期三, 10 十二月 2025 17:52:36 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 admin/src/components/business/ResetPwdShopWindow.vue |   91 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 91 insertions(+), 0 deletions(-)

diff --git a/admin/src/components/business/ResetPwdShopWindow.vue b/admin/src/components/business/ResetPwdShopWindow.vue
new file mode 100644
index 0000000..f216366
--- /dev/null
+++ b/admin/src/components/business/ResetPwdShopWindow.vue
@@ -0,0 +1,91 @@
+<template>
+  <GlobalWindow
+    :visible.sync="visible"
+    :confirm-working="isWorking"
+    width="576px"
+    title="閲嶇疆瀵嗙爜"
+    @confirm="confirm"
+  >
+    <p class="tip" v-if="user != null">涓虹粡閿�鍟� <em>{{shop.realname}}</em> 閲嶇疆瀵嗙爜</p>
+    <el-form :model="form" ref="form" :rules="rules">
+      <el-form-item label="鏂板瘑鐮�" prop="password" required>
+        <el-input v-model="form.password" type="password" placeholder="璇疯緭鍏ユ柊瀵嗙爜" maxlength="30" show-password></el-input>
+      </el-form-item>
+    </el-form>
+  </GlobalWindow>
+</template>
+
+<script>
+import GlobalWindow from '@/components/common/GlobalWindow'
+import { resetPwd } from '@/api/business/shop'
+export default {
+  name: 'ResetPwdWindow',
+  components: { GlobalWindow },
+  data () {
+    return {
+      isWorking: false,
+      visible: false,
+      shop: null,
+      form: {
+        password: ''
+      },
+      rules: {
+        password: [
+          { required: true, message: '璇疯緭鍏ュ瘑鐮�' }
+        ]
+      }
+    }
+  },
+  methods: {
+    open (shop) {
+      this.shop = shop
+      this.visible = true
+      this.$nextTick(() => {
+        this.$refs.form.resetFields()
+      })
+    },
+    // 纭閲嶇疆瀵嗙爜
+    confirm () {
+      if (this.isWorking) {
+        return
+      }
+      this.$refs.form.validate((valid) => {
+        if (!valid) {
+          return
+        }
+        this.isWorking = true
+        resetPwd({
+          id: this.user.id,
+          password: this.form.password
+        })
+          .then(() => {
+            this.$tip.apiSuccess('瀵嗙爜閲嶇疆鎴愬姛')
+            this.visible = false
+            this.$emit('success')
+          })
+          .catch(e => {
+            this.$tip.apiFailed(e)
+          })
+          .finally(() => {
+            this.isWorking = false
+          })
+      })
+    }
+  }
+}
+</script>
+
+<style scoped lang="scss">
+@import "@/assets/style/variables.scss";
+// 瑙掕壊閰嶇疆
+.global-window {
+  .tip {
+    margin-bottom: 12px;
+    em {
+      font-style: normal;
+      color: $primary-color;
+      font-weight: bold;
+    }
+  }
+}
+</style>

--
Gitblit v1.9.3