shish 3 лет назад
Родитель
Сommit
4afe6e2cde

+ 2 - 1
ghsApp/src/pages.json

@@ -60,7 +60,8 @@
 				{"path": "member/add","style": {"navigationBarTitleText": "添加客户"}},
 				{"path": "member/detail","style": {"navigationBarTitleText": "客户详情"}},
 				{"path": "member/bind","style": {"navigationBarTitleText": "绑定微信"}},
-				{"path": "member/addCustomer","style": {"navigationBarTitleText": "手动添加客户"}},
+				{"path": "member/addCustomer","style": {"navigationBarTitleText": "添加客户"}},
+				{"path": "member/addCustom","style": {"navigationBarTitleText": "添加虚拟客户"}},
 				{"path": "official/index","style": {"navigationBarTitleText": "销花宝"}},
 				{"path": "official/pay","style": {"navigationBarTitleText": "支付"}},
 				{"path": "official/apply","style": {"navigationBarTitleText": "填写店铺信息"}},

+ 144 - 0
ghsApp/src/pagesClient/member/addCustom.vue

@@ -0,0 +1,144 @@
+<template>
+  <div class="app-content">
+    <form @submit="formSubmit">
+      <view class="module-com">
+        <tui-list-cell class="line-cell" :hover="false" >
+          <div class="tui-title">花店名称</div>
+          <input v-model="form.name1" type="text" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="name1" placeholder="请输入名称" />
+        </tui-list-cell>
+      </view>
+
+      <div class="confirm-btn" style="text-align:center;">
+        <button class="admin-button-com big blue" style="width:85%;" formType="submit">确认</button>
+      </div>
+
+    </form>
+  </div>
+</template>
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+const form = require("@/utils/formValidation.js");
+import { createCumtomer } from '@/api/custom'
+export default {
+  name: "create-customer",
+  components: {
+    TuiListCell
+  },
+  data () {
+    return {
+      merchantData: {},
+      form: {
+        name1: "",
+        mobile1: "",
+        confirmMobile1: "",
+
+        name2: "",
+        mobile2: "",
+        confirmMobile2: "",
+
+        name3: "",
+        mobile3: "",
+        confirmMobile3: "",
+
+        name4: "",
+        mobile4: "",
+        confirmMobile4: "",
+
+        name5: "",
+        mobile5: "",
+        confirmMobile5: ""
+      }
+    };
+  },
+	computed:{
+	},
+  onLoad () {
+  },
+  onUnload(){
+  },
+	onShow() {
+	},
+  methods: {
+    formSubmit (e) {
+      let rules = [
+        { name: "name1", rule: ["required"], msg: ["请填写花店名称"] },
+      ];
+      let formData = this.form;
+      let checkRes = form.validation(formData, rules);
+
+      if (!checkRes) {
+        uni.showLoading({mask:true})
+        setTimeout(() => {
+          this.confirmFn()
+        })
+        uni.hideLoading()
+      } else {
+        this.$msg(checkRes);
+      }
+    },
+    confirmFn () {
+      let currentMiniOpenId = uni.getStorageSync('currentMiniOpenId')
+      uni.showLoading({mask:true})
+      createCumtomer({
+        virtual:1,
+        hdShopAdminId: this.option.hdShopAdminId,
+        ghsShopAdminId: this.option.ghsShopAdminId,
+        ...this.form,
+        style: this.option.style || 0,
+        from: this.option.from || 0,
+        miniOpenId:currentMiniOpenId
+      }).then(res => {
+        if(res.code == 1){
+          this.$msg(res.msg)
+          setTimeout(() => {
+            uni.navigateBack();
+          }, 2000)
+        }
+      });
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.app-content {
+  margin-bottom: 260upx;
+}
+.module-com {
+  margin-bottom: 20upx;
+  background-color:#fff;
+  .module-tit {
+    padding: 20upx 18upx;
+    font-size: 28upx;
+    font-weight: 600;
+    border-bottom: 1upx solid $borderColor;
+  }
+  .module-det {
+    padding: 0 30upx;
+  }
+}
+// 公共
+.line-cell {
+  .tui-title {
+    width: 210upx;
+    color: $fontColor2;
+  }
+  .tui-input {
+    width: calc(100% - 210upx);
+    font-size: 28upx;
+  }
+  .tui-placeholder {
+    color: #ccc;
+  }
+  .phcolor {
+    color: #ccc;
+  }
+}
+.btn-wrap {
+  width: 90%;
+  margin: 60upx auto;
+  .admin-button-com {
+    width: 100%;
+    margin: 0 auto;
+  }
+}
+</style>

+ 11 - 19
ghsApp/src/pagesClient/member/addCustomer.vue

@@ -1,5 +1,8 @@
 <template>
   <div class="app-content">
+    <view style="width:150upx;text-align:center;position:fixed;bottom:150upx;border-radius:80upx;background-color:#3385FF;color:white;z-index:999999;padding:50upx 0;right:30upx;font-size:28upx;" @click.stop="addCustom()">
+    虚拟客户
+    </view>
     <form @submit="formSubmit">
       <view class="module-com">
         <tui-list-cell class="line-cell" :hover="false" >
@@ -130,22 +133,20 @@ export default {
 	onShow() {
 	},
   methods: {
+    init(){
+
+    },
+    addCustom(){
+      this.$util.pageTo({url: "/pagesClient/member/addCustom",type:2});
+    },
     formSubmit (e) {
       let rules = [
         { name: "name1", rule: ["required"], msg: ["请填写花店1的名称"] },
         { name: "mobile1", rule: ["isMobile"], msg: ["请填写花店1的手机号"] },
         { name: "confirmMobile1", rule: ["isSame:mobile1"], msg: ["花店1的确认手机号有误"] },
-        //{ name: "name2", rule: ["required"], msg: ["请填写花店2的名称"] },
-        //{ name: "mobile2", rule: ["required"], msg: ["请填写花店2的手机号"] },
         { name: "confirmMobile2", rule: ["isSame:mobile2"], msg: ["花店2的确认手机号有误"] },
-        //{ name: "name3", rule: ["required"], msg: ["请填写花店3的名称"] },
-        //{ name: "mobile3", rule: ["required"], msg: ["请填写花店3的手机号"] },
         { name: "confirmMobile3", rule: ["isSame:mobile3"], msg: ["花店3的确认手机号有误"] },
-        //{ name: "name4", rule: ["required"], msg: ["请填写花店4的名称"] },
-        //{ name: "mobile4", rule: ["required"], msg: ["请填写花店4的手机号"] },
         { name: "confirmMobile4", rule: ["isSame:mobile4"], msg: ["请花店4的确认手机号有误"] },
-        //{ name: "name5", rule: ["required"], msg: ["请填写花店5的名称"] },
-        //{ name: "mobile5", rule: ["required"], msg: ["请填写花店5的手机号"] },
         { name: "confirmMobile5", rule: ["isSame:mobile5"], msg: ["花店5的确认手机号有误"] },
       ];
 
@@ -173,29 +174,20 @@ export default {
         from: this.option.from || 0,
         miniOpenId:currentMiniOpenId
       }).then(res => {
-        this.$msg(res.msg);
         if(res.code == 1){
+          this.$msg(res.msg)
           setTimeout(() => {
             uni.navigateBack();
           }, 2000)
         }
-        // this.$util.pageTo({
-        //   url: "/admin/home/member",
-        //   type: 2,
-        //   query: {
-        //     pagestatus: 3
-        //   }
-        // });
       });
     }
-  },
-  watch: {
   }
 };
 </script>
 <style lang="scss" scoped>
 .app-content {
-  margin-bottom: 170upx;
+  margin-bottom: 260upx;
 }
 .module-com {
   margin-bottom: 20upx;