shish 5 лет назад
Родитель
Сommit
93d511ad45
4 измененных файлов с 179 добавлено и 4 удалено
  1. 10 3
      ghsApp/src/admin/home/me.vue
  2. 157 0
      ghsApp/src/admin/shop/print.vue
  3. 10 0
      ghsApp/src/api/shop/index.js
  4. 2 1
      ghsApp/src/pages.json

+ 10 - 3
ghsApp/src/admin/home/me.vue

@@ -97,6 +97,7 @@
             >
               <div class="tui-title">充值记录</div>
             </tui-list-cell>
+
             <tui-list-cell
               @click="pageTo({ url: '/pagesStore/me/cashSet' })"
               class="line-cell"
@@ -105,12 +106,18 @@
             >
               <div class="tui-title">提现帐号</div>
             </tui-list-cell>
+
             <tui-list-cell @click="pageTo({ url: '/pagesStore/me/expressSet' })" class="line-cell" :hover="false" :arrow="true">
               <div class="tui-title">快递设置</div>
             </tui-list-cell>
-											<tui-list-cell @click="pageTo({ url: '/pagesOrder/print' })" class="line-cell" :hover="false" :arrow="true">
-												<div class="tui-title">蓝牙打印</div>
-											</tui-list-cell>
+
+            <tui-list-cell @click="pageTo({ url: '/admin/shop/print' })" class="line-cell" :hover="false" :arrow="true">
+              <div class="tui-title">云打印</div>
+            </tui-list-cell>
+
+            <tui-list-cell @click="pageTo({ url: '/pagesOrder/print' })" class="line-cell" :hover="false" :arrow="true">
+              <div class="tui-title">蓝牙打印</div>
+            </tui-list-cell>
 
           </view>
         </view>

+ 157 - 0
ghsApp/src/admin/shop/print.vue

@@ -0,0 +1,157 @@
+<template>
+  <div class="app-content">
+    <div v-show="showStaffArea">
+      <form @submit="formSubmit" @reset="formReset">
+        <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.printSn"
+              placeholder-class="phcolor"
+              class="tui-input"
+              name="printSn"
+              placeholder="请填写编号"
+              maxlength="50"
+              type="text"
+            />
+          </tui-list-cell>
+
+          <tui-list-cell class="line-cell" :hover="false">
+            <div class="tui-title">密钥(KEY)</div>
+            <input
+              v-model="form.printKey"
+              placeholder-class="phcolor"
+              class="tui-input"
+              name="printKey"
+              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>
+    <!-- <kd-entrance></kd-entrance> -->
+  </div>
+</template>
+
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+import AppAvatarModule from "@/components/module/app-avatar";
+const form = require("@/utils/formValidation.js");
+import { addCloudPrint,getPrint } from "@/api/shop";
+export default {
+  name: "shopPrint",
+  components: {
+    TuiListCell,
+    AppAvatarModule,
+  },
+  data() {
+    return {
+      form: {
+        printKey: "",
+        printSn: ""
+      },
+      roleList: [],
+      roleSelData: {},
+      showStaffArea: true,
+      miniCodeSrc: "",
+      memberData: {},
+    };
+  },
+  onLoad() {
+    //this.init()
+  },
+  onShow() {
+    uni.setNavigationBarTitle({
+      title: `云打印`,
+    });
+  },
+  methods: {
+    async init() {
+      try {
+        const { data } = await getPrint();
+        this.form.printKey = data.printKey;
+        this.form.printSn = data.printSn;
+        this.$forceUpdate();
+      } finally {}
+    },
+    confirmFn() {
+      addCloudPrint(this.form).then((res) => {
+        this.$msg("操作成功");
+        setTimeout(() => {
+          uni.navigateBack();
+        }, 1300)
+      });
+    },
+    formSubmit(e) {
+      // 表单验证
+      let rules = [
+        {
+          name: "printSn",
+          rule: ["required"],
+          msg: ["请填写编号"],
+        },
+        {
+          name: "printKey",
+          rule: ["required"],
+          msg: ["请填写密钥"],
+        },
+      ];
+      // 进行表单检查
+      let formData = e.detail.value;
+      let checkRes = form.validation(formData, rules);
+      // 验证通过!
+      if (!checkRes) {
+        this.confirmFn();
+      } else {
+        this.$msg(checkRes);
+      }
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.app-content {
+  min-height: calc(100vh - 20px);
+  padding-top: 20px;
+}
+.prompt-text {
+  color: $fontColor3;
+  padding-left: 30px;
+  margin-bottom: 30px;
+}
+.module-com {
+  margin-bottom: 20px;
+  .member-wrap {
+    .member-det {
+      font-size: 24px;
+      margin-left: 20px;
+    }
+  }
+  .remark-wrap {
+    align-items: flex-start;
+    .remark {
+      height: 240px;
+    }
+  }
+}
+// 按钮
+.confirm-btn {
+  width: calc(100% - 60px);
+  margin: 60px 30px 20px;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+</style>

+ 10 - 0
ghsApp/src/api/shop/index.js

@@ -44,4 +44,14 @@ export const downMemberCode = data => {
 //当前登陆的门店信息 shish 2021.3,27
 export const currentShop = data => {
 	return https.get('/shop/current-shop', data)
+}
+
+//添加云打印机
+export const addCloudPrint = data => {
+	return https.get('/shop-ext/add-print', data)
+}
+
+//获取云打印机信息
+export const getPrint = data => {
+	return https.get('/shop-ext/get-print', data)
 }

+ 2 - 1
ghsApp/src/pages.json

@@ -104,7 +104,8 @@
 			"root": "admin/shop",
 			"pages": [
 				{"path": "list","style": {"navigationBarTitleText": "店铺管理"}},
-				{"path": "add","style": {"navigationBarTitleText": ""}}
+				{"path": "add","style": {"navigationBarTitleText": ""}},
+				{"path": "print","style": {"navigationBarTitleText": "云打印"}}
 			]
 		},
 		{