shish 3 years ago
parent
commit
44dfb27aa4

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

@@ -2,7 +2,7 @@
   <view class="me-content_box app-content">
   <view class="me-content_box app-content">
     <image :src="`${constant.imgUrl}/ghs/me/bg.png`" class="me-content_bg" ></image>
     <image :src="`${constant.imgUrl}/ghs/me/bg.png`" class="me-content_bg" ></image>
     <template>
     <template>
-      <view class="me-user_box">
+      <view class="me-user_box" @click="goAdmin()">
         <view class="user-info_item">
         <view class="user-info_item">
           <view v-if="shopInfo.shopAdminId > 0"> <view class="name"> {{ shopInfo.adminName }} </view> <view class="mobile"> ID:{{ shopInfo.shopAdminId }} </view> </view>
           <view v-if="shopInfo.shopAdminId > 0"> <view class="name"> {{ shopInfo.adminName }} </view> <view class="mobile"> ID:{{ shopInfo.shopAdminId }} </view> </view>
         </view>
         </view>
@@ -226,6 +226,9 @@ export default {
     // #endif
     // #endif
   },
   },
   methods: {
   methods: {
+    goAdmin(){
+      this.$util.pageTo({ url: '/admin/staff/admin'})
+    },
     getHzg(){
     getHzg(){
       // #ifdef APP-PLUS
       // #ifdef APP-PLUS
       let that = this
       let that = this
@@ -379,8 +382,7 @@ export default {
         that.$msg(res.msg)
         that.$msg(res.msg)
       })
       })
 
 
-    },
-    _list () { },
+    }
   },
   },
 };
 };
 </script>
 </script>

+ 108 - 0
ghsApp/src/admin/staff/admin.vue

@@ -0,0 +1,108 @@
+<template>
+  <view class="app-content">
+    <view>
+      <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.name" type="text" placeholder-class="phcolor" @focus="form.name=''" placeholder-style="color:#CCCCCC" class="tui-input" name="name" placeholder="请填写名称" />
+          </tui-list-cell>
+
+          <tui-list-cell class="line-cell" :hover="false">
+              <div class="tui-title">微信ID</div>
+              <input v-model="form.ghsOpenId" type="text" placeholder-class="phcolor" @focus="form.ghsOpenId=''" style="font-size:22upx;"
+              placeholder-style="color:#CCCCCC" class="tui-input" name="ghsOpenId" placeholder="请填写微信ID" />
+          </tui-list-cell>
+
+        </div>
+        <div class="confirm-btn">
+          <button class="admin-button-com big blue" formType="submit">提交</button>
+        </div>
+      </form>
+    </view>
+  </view>
+</template>
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+const form = require("@/utils/formValidation.js");
+import { updateAdmin,getInfo } from "@/api/admin";
+export default {
+  name: "admin",
+  components: {
+    TuiListCell
+  },
+  data() {
+    return {
+      form: {
+        name: "",
+        ghsOpenId: ""
+      }
+    };
+  },
+  onLoad() {},
+  onShow() {
+  },
+  methods: {
+    init() {
+        getInfo().then(res=>{
+          if(res.code == 1){
+            this.form.name = res.data.info.name ? res.data.info.name : ''
+            this.form.ghsOpenId = res.data.info.ghsOpenId ? res.data.info.ghsOpenId : ''
+          }
+        })
+    },
+    formSubmit(e) {
+      let rules = [
+        { name: "name", rule: ["required"], msg: ["请填写名称"] }
+      ]
+      let formData = e.detail.value;
+      let checkRes = form.validation(formData, rules);
+      if (!checkRes) {
+        this.form.id = this.option.id;
+        updateAdmin(this.form).then(res => {
+            this.$msg('修改成功');
+            setTimeout(() => {
+              uni.navigateBack()
+            },1000)
+        })
+      } else {
+        this.$msg(checkRes)
+      }
+    }
+  }
+};
+</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>

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

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

+ 1 - 0
ghsApp/src/pages.json

@@ -170,6 +170,7 @@
 				{"path": "list","style": {"navigationBarTitleText": "员工管理"}},
 				{"path": "list","style": {"navigationBarTitleText": "员工管理"}},
 				{"path": "add","style": {"navigationBarTitleText": "添加员工"}},
 				{"path": "add","style": {"navigationBarTitleText": "添加员工"}},
 				{"path": "detail","style": {"navigationBarTitleText": "详情"}},
 				{"path": "detail","style": {"navigationBarTitleText": "详情"}},
+				{"path": "admin","style": {"navigationBarTitleText": "个人资料"}},
 				{"path": "sel-member","style": {"navigationBarTitleText": "客户列表"}},
 				{"path": "sel-member","style": {"navigationBarTitleText": "客户列表"}},
 				{"path": "achieve","style": {"navigationBarTitleText": "员工业绩"}},
 				{"path": "achieve","style": {"navigationBarTitleText": "员工业绩"}},
 				{ "path": "miniAutoLogin", "style": { "navigationBarTitleText": "绑定帐号" } }
 				{ "path": "miniAutoLogin", "style": { "navigationBarTitleText": "绑定帐号" } }

+ 4 - 1
hdApp/src/admin/home/me.vue

@@ -2,7 +2,7 @@
   <view class="me-content_box app-content">
   <view class="me-content_box app-content">
     <image :src="`${constant.imgUrl}/ghs/me/bg.png`" class="me-content_bg" ></image>
     <image :src="`${constant.imgUrl}/ghs/me/bg.png`" class="me-content_bg" ></image>
     <template>
     <template>
-      <view class="me-user_box">
+      <view class="me-user_box" @click="goAdmin()">
         <view class="user-info_item">
         <view class="user-info_item">
           <view v-if="shopInfo.shopAdminId > 0"> <view class="name"> {{ shopInfo.adminName||'' }} </view> <view class="mobile"> ID:{{ shopInfo.shopAdminId }} </view> </view>
           <view v-if="shopInfo.shopAdminId > 0"> <view class="name"> {{ shopInfo.adminName||'' }} </view> <view class="mobile"> ID:{{ shopInfo.shopAdminId }} </view> </view>
         </view>
         </view>
@@ -168,6 +168,9 @@ export default {
     // #endif
     // #endif
   },
   },
   methods: {
   methods: {
+    goAdmin(){
+      this.$util.pageTo({ url: '/admin/staff/admin'})
+    },
     init(){
     init(){
 
 
     },
     },

+ 108 - 0
hdApp/src/admin/staff/admin.vue

@@ -0,0 +1,108 @@
+<template>
+  <view class="app-content">
+    <view>
+      <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.name" type="text" placeholder-class="phcolor" @focus="form.name=''" placeholder-style="color:#CCCCCC" class="tui-input" name="name" placeholder="请填写名称" />
+          </tui-list-cell>
+
+          <tui-list-cell class="line-cell" :hover="false">
+              <div class="tui-title">微信ID</div>
+              <input v-model="form.openId" type="text" placeholder-class="phcolor" @focus="form.openId=''" style="font-size:22upx;"
+              placeholder-style="color:#CCCCCC" class="tui-input" name="openId" placeholder="请填写微信ID" />
+          </tui-list-cell>
+
+        </div>
+        <div class="confirm-btn">
+          <button class="admin-button-com big blue" formType="submit">提交</button>
+        </div>
+      </form>
+    </view>
+  </view>
+</template>
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+const form = require("@/utils/formValidation.js");
+import { updateAdmin,getInfo } from "@/api/admin";
+export default {
+  name: "admin",
+  components: {
+    TuiListCell
+  },
+  data() {
+    return {
+      form: {
+        name: "",
+        openId: ""
+      }
+    };
+  },
+  onLoad() {},
+  onShow() {
+  },
+  methods: {
+    init() {
+        getInfo().then(res=>{
+          if(res.code == 1){
+            this.form.name = res.data.info.name ? res.data.info.name : ''
+            this.form.openId = res.data.info.openId ? res.data.info.openId : ''
+          }
+        })
+    },
+    formSubmit(e) {
+      let rules = [
+        { name: "name", rule: ["required"], msg: ["请填写名称"] }
+      ]
+      let formData = e.detail.value;
+      let checkRes = form.validation(formData, rules);
+      if (!checkRes) {
+        this.form.id = this.option.id;
+        updateAdmin(this.form).then(res => {
+            this.$msg('修改成功');
+            setTimeout(() => {
+              uni.navigateBack()
+            },1000)
+        })
+      } else {
+        this.$msg(checkRes)
+      }
+    }
+  }
+};
+</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>

+ 8 - 0
hdApp/src/api/admin/index.js

@@ -1,5 +1,13 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 import https from '@/plugins/luch-request_0.0.7/request'
 
 
+export const getInfo = data => {
+	return https.get("/admin/info", data);
+};
+
+export const updateAdmin = data => {
+	return https.post('/admin/update-admin', data)
+}
+
 export const updateMiniOpenId = data => {
 export const updateMiniOpenId = data => {
 	return https.get("/admin/update-mini-open-id", data);
 	return https.get("/admin/update-mini-open-id", data);
 };
 };

+ 1 - 0
hdApp/src/pages.json

@@ -200,6 +200,7 @@
 				{ "path": "list", "style": { "navigationBarTitleText": "员工管理" } },
 				{ "path": "list", "style": { "navigationBarTitleText": "员工管理" } },
 				{ "path": "add", "style": { "navigationBarTitleText": "添加员工" } },
 				{ "path": "add", "style": { "navigationBarTitleText": "添加员工" } },
 				{ "path": "detail", "style": { "navigationBarTitleText": "员工详情" } },
 				{ "path": "detail", "style": { "navigationBarTitleText": "员工详情" } },
+				{ "path": "admin","style": {"navigationBarTitleText": "个人资料"}},
 				{ "path": "sel-member", "style": { "navigationBarTitleText": "客户列表" } },
 				{ "path": "sel-member", "style": { "navigationBarTitleText": "客户列表" } },
 				{ "path": "achieve", "style": { "navigationBarTitleText": "员工业绩" } },
 				{ "path": "achieve", "style": { "navigationBarTitleText": "员工业绩" } },
 				{ "path": "miniAutoLogin", "style": { "navigationBarTitleText": "绑定帐号" } }
 				{ "path": "miniAutoLogin", "style": { "navigationBarTitleText": "绑定帐号" } }