shish 4 vuotta sitten
vanhempi
commit
00b1005795

+ 107 - 0
ghsApp/src/admin/shop/password.vue

@@ -0,0 +1,107 @@
+<template>
+  <div class="app-content">
+    <div>
+      <form @submit="formSubmit">
+        <div class="module-com input-line-wrap">
+          <tui-list-cell class="line-cell" :hover="false">
+            <div class="tui-title">密码:</div>
+            <input v-model="form.password" @focus="form.password=''" placeholder-class="phcolor" class="tui-input" name="password" placeholder="填写新密码" maxlength="50" type="password" />
+          </tui-list-cell>
+        </div>
+        <div class="confirm-btn">
+          <button class="admin-button-com big blue" formType="submit">
+            提交
+          </button>
+        </div>
+      </form>
+    </div>
+  </div>
+</template>
+
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+import AppAvatarModule from "@/components/module/app-avatar";
+const form = require("@/utils/formValidation.js");
+import { modifyPassword } from "@/api/admin";
+export default {
+  name: "shopPassword",
+  components: {
+    TuiListCell,
+    AppAvatarModule,
+  },
+  data() {
+    return {
+      form: {
+        password: ""
+      }
+    };
+  },
+  onLoad() {
+  },
+  onShow() {
+    uni.setNavigationBarTitle({
+      title: `密码设置`,
+    });
+  },
+  methods: {
+    async init() {
+
+    },
+    confirmFn() {
+      modifyPassword(this.form).then((res) => {
+        this.$msg(res.msg);
+        if(res.code == 1){
+          setTimeout(() => {
+            uni.navigateBack();
+          }, 1000)
+        }
+      });
+    },
+    formSubmit(e) {
+      let rules = [
+        {
+          name: "password",
+          rule: ["required"],
+          msg: ["请填写密码"],
+        }
+      ]
+      this.confirmFn();
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.app-content {
+  min-height: calc(100vh - 20upx);
+  padding-top: 20upx;
+}
+.prompt-text {
+  color: $fontColor3;
+  padding-left: 30upx;
+  margin-bottom: 30upx;
+}
+.module-com {
+  margin-bottom: 20upx;
+  .member-wrap {
+    .member-det {
+      font-size: 24upx;
+      margin-left: 20upx;
+    }
+  }
+  .remark-wrap {
+    align-items: flex-start;
+    .remark {
+      height: 240upx;
+    }
+  }
+}
+// 按钮
+.confirm-btn {
+  width: calc(100% - 60upx);
+  margin: 60upx 30upx 20upx;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+</style>

+ 122 - 0
ghsApp/src/admin/shop/trumpet.vue

@@ -0,0 +1,122 @@
+<template>
+  <div class="app-content">
+    <div>
+      <form @submit="formSubmit">
+        <div class="module-com input-line-wrap">
+
+          <tui-list-cell class="line-cell" :hover="false">
+            <div class="tui-title">编号(SN):</div>
+            <input
+              v-model="form.lbSn"
+              placeholder-class="phcolor"
+              class="tui-input"
+              name="lbSn"
+              placeholder="请填写编号"
+              maxlength="50"
+              type="number"
+            />
+          </tui-list-cell>
+
+        </div>
+
+        <div class="confirm-btn">
+          <button class="admin-button-com big blue" formType="submit">
+            提交
+          </button>
+        </div>
+      </form>
+    </div>
+  </div>
+</template>
+
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+import AppAvatarModule from "@/components/module/app-avatar";
+const form = require("@/utils/formValidation.js");
+import { getLb,addCloudLb } from "@/api/shop";
+export default {
+  name: "shopLb",
+  components: {
+    TuiListCell,
+    AppAvatarModule,
+  },
+  data() {
+    return {
+      form: {
+        lbSn: ""
+      }
+    };
+  },
+  onLoad() {
+  },
+  onShow() {
+    uni.setNavigationBarTitle({
+      title: `云喇叭设置`,
+    });
+  },
+  methods: {
+    async init() {
+      try {
+        const { data } = await getLb();
+        this.form.lbSn = data.lbSn;
+        this.$forceUpdate();
+      } finally {}
+    },
+    confirmFn() {
+      addCloudLb(this.form).then((res) => {
+        this.$msg(res.msg);
+        if(res.code == 1){
+          setTimeout(() => {
+            uni.navigateBack();
+          }, 1000)
+        }
+      });
+    },
+    formSubmit(e) {
+      let rules = [
+        {
+          name: "lbSn",
+          rule: ["required"],
+          msg: ["请填写编号"],
+        }
+      ]
+      this.confirmFn();
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.app-content {
+  min-height: calc(100vh - 20upx);
+  padding-top: 20upx;
+}
+.prompt-text {
+  color: $fontColor3;
+  padding-left: 30upx;
+  margin-bottom: 30upx;
+}
+.module-com {
+  margin-bottom: 20upx;
+  .member-wrap {
+    .member-det {
+      font-size: 24upx;
+      margin-left: 20upx;
+    }
+  }
+  .remark-wrap {
+    align-items: flex-start;
+    .remark {
+      height: 240upx;
+    }
+  }
+}
+// 按钮
+.confirm-btn {
+  width: calc(100% - 60upx);
+  margin: 60upx 30upx 20upx;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+</style>

+ 5 - 0
ghsApp/src/api/admin/index.js

@@ -0,0 +1,5 @@
+import https from "@/plugins/luch-request_0.0.7/request";
+
+export const modifyPassword = data => {
+	return https.get("/admin/modify-password", data);
+};

+ 47 - 0
ghsApp/src/common/success.vue

@@ -0,0 +1,47 @@
+<template>
+  <appResult :title="title">
+	<button class="admin-button-com big blue" style="width:80%;margin-top:50upx;" @click="goBackHome">返回首页</button>
+  </appResult>
+</template>
+<script>
+import appResult from "@/components/app-result";
+export default {
+  name: "commonSuccess",
+  components: {
+    appResult
+  },
+	data() {
+		return {
+			title:'操作成功',
+		};
+	},
+	onShow(){
+
+	},
+	onLoad(e){
+        let titleType = e.titleType || 1
+        if(titleType == 1){
+            this.title = '操作成功'
+        }
+        if(titleType == 2){
+            this.title = '结账成功'
+        }
+        if(titleType == 3){
+            this.title = '收款成功'
+        }
+	},
+	onUnload(){
+	},
+	methods: {
+        goBackHome() {
+            this.$util.pageTo({ url: "/admin/home/workbench", type: 3, query: { tabIndex: 0 }})
+        }
+  },
+};
+</script>
+<style lang="scss" scoped>
+.admin-button-com {
+	margin-bottom: 20upx;
+	width: 100%;
+}
+</style>