|
|
@@ -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>
|