fuwei 5 سال پیش
والد
کامیت
4e864905c6

+ 1 - 1
ghs/src/api/official/index.js

@@ -32,7 +32,7 @@ export const merchantDet = data => {
  * 申请试用 w
  */
 export const applyRegister = data => {
-	return https.get('/apply/register', data)
+	return https.post('/apply/register', data)
 }
 
 // 获取验证码 w

+ 14 - 1
ghs/src/components/app-bind-info.vue

@@ -1,7 +1,7 @@
 <template>
     <view>
         <tui-list-cell class="line-cell" :hover="false">
-            <div class="tui-title required" style="width:120rpx;">微信昵称</div>
+            <div class="tui-title required" style="width:120rpx;">{{nameTetx}}</div>
             <view 
                 v-if="!$util.isEmpty(form.nickName)"
                 style="width:400rpx;">{{form.nickName}}
@@ -44,6 +44,12 @@
     import { getWxInfo, getWxPhone } from "@/api/mini";
     export default {
         name:'AppBindInfo',
+        props:{
+            nameTetx:{
+                type:String,
+                default:'微信昵称'
+            }
+        },
         components:{
             TuiListCell
         },
@@ -65,6 +71,7 @@
                         subRes => {
                         this.form.adminId = subRes.data.id;
                         this.form.nickName = subRes.data.nickName;
+                        this.$emit('bindInfo',this.form)
                         uni.showToast({
                             icon: "success"
                         });
@@ -84,6 +91,7 @@
                 encryptedData: e.detail.encryptedData
                 }).then(res => {
                 this.form.mobile = res.data.mobile;
+                this.$emit('bindInfo',this.form)
                 uni.showToast({
                     icon: "success"
                 });
@@ -102,4 +110,9 @@
         font-size: 28px;
         font-weight: 400;
     }
+    .tui-title {
+        color: #666666;
+        font-size: 28upx;
+        font-weight: 400;
+    } 
 </style>

+ 4 - 1
ghs/src/mixins/globalMixins.js

@@ -50,7 +50,10 @@ export default {
 						} else if(res.data.admin.identity == '1'){
 							this.$util.pageTo({
 								url: "/pagesClient/official/latest-shop",
-								type: 2
+								type: 2,
+								query:{
+									...this.option	
+								}
 							});
 						//未知身份
 						}else{

+ 6 - 0
ghs/src/pages.json

@@ -72,6 +72,12 @@
 						"navigationBarTitleText": "客户详情"
 					}
 				},
+				{
+					"path": "member/bind",
+					"style": {
+						"navigationBarTitleText": "绑定微信"
+					}
+				},
 				{
 					"path": "official/index",
 					"style": {

+ 63 - 0
ghs/src/pagesClient/member/bind.vue

@@ -0,0 +1,63 @@
+<template>
+    <view class="app-content">
+        <view  class="bind-des_box">
+            <view>
+                花极客
+            </view>
+            <view>
+                您好,我在整理客户信息,帮忙填下以下内容
+            </view>
+        </view>
+        
+        <AppBindInfo
+            @bindInfo="bindInfo"
+            nameTetx="店长姓名"></AppBindInfo>
+        <view class="btn-wrap">
+             <button class="admin-button-com blue big">确认</button>
+        </view>
+    </view>
+</template>
+
+<script>
+    import AppBindInfo from "@/components/app-bind-info";
+    export default {
+        name:'MenberBind',
+        components:{
+            AppBindInfo
+        },
+        methods:{
+            // 绑定信息
+            bindInfo(val){
+                console.log(val)
+            }
+        }
+    }
+</script>
+
+<style lang="scss" scoped>
+    .app-content {
+        padding-top: 20upx;
+        & .btn-wrap {
+            padding: 60upx 30upx;
+            & .admin-button-com {
+                width: 100%;
+            }
+        }
+    }
+    .bind-des_box {
+        margin-bottom: 20upx;
+        padding: 30upx;
+        background-color: #FFFFFF;
+        & > view:nth-child(1) {
+            color: #333333;
+            font-size: 28upx;
+            font-weight: 600;
+            margin-bottom: 19upx;
+        }
+        & > view:nth-child(2) {
+            color: #666666;
+            font-size: 28upx;
+            font-weight: 400;
+        }
+    }
+</style>

+ 3 - 3
ghs/src/pagesClient/member/detail.vue

@@ -8,10 +8,10 @@
                 <AppAvatarModule class="avatar" :src="userInfo.avatar" :width="100"></AppAvatarModule>
                 <view class="dec-bx">
                   <view>
-                      {{userInfo.shopName}}
+                      {{userInfo.name}}
                   </view>
                   <view>
-                      No.{{userInfo.retailShopId}}
+                      No.{{userInfo.sn}}
                   </view>
                 </view>
             </view>
@@ -58,7 +58,7 @@
             <view>
               <view
                 @click="pageTo({
-                  url:'/admin/shopAdmin/bind'
+                  url:'/pagesClient/member/bind'
                 })" 
                 class="invite-bt white">
                 关联微信

+ 89 - 129
ghs/src/pagesClient/official/apply.vue

@@ -40,7 +40,7 @@
         <tui-list-cell class="line-cell" :hover="false">
           <div class="tui-title">店长姓名</div>
           <input
-            v-model="form.name"
+            v-model="form.adminName"
             placeholder-class="phcolor"
             placeholder-style="color:#CCCCCC"
             class="tui-input"
@@ -48,61 +48,66 @@
             placeholder="请输入店长姓名"
           />
         </tui-list-cell>
-        <tui-list-cell class="line-cell code-wrap" :hover="false">
-          <div class="tui-title">我的昵称</div>
-          <div class="tui-code" style="width:260rpx;">{{nickName}}</div>
-          <button
-            class="admin-button-com blue mini-btn"
-            open-type="getUserInfo"
-            @getuserinfo="getWxAvatar"
-          >帮我填</button>
-        </tui-list-cell>
-        <tui-list-cell class="line-cell code-wrap" :hover="false">
-          <div class="tui-title">我的手机号</div>
-          <div class="tui-code" style="width:260rpx;">{{form.mobile}}</div>
-          <button
-            class="admin-button-com blue mini-btn"
-            open-type="getPhoneNumber"
-            @getphonenumber="getWxMobile"
-          >帮我填</button>
-        </tui-list-cell>
+        <AppBindInfo
+            @bindInfo="bindInfo"
+            nameTetx="我的昵称">
+        </AppBindInfo>
       </div>
       <!-- 手机号 -->
       <div class="module-com">
-          <tui-list-cell class="line-cell code-wrap" :hover="false">
-            <div class="tui-title">主营业务</div>
+          <!-- <tui-list-cell 
+            class="line-cell code-wrap" :hover="false">
+            <div class="tui-title">商家类型</div>
             <div>
               <button class="admin-button-com blue mini-btn">
                 零售
               </button>
               <button style="margin-left:10px;" class="admin-button-com default mini-btn">
+                供货商
+              </button>
+            </div>
+          </tui-list-cell> -->
+          <tui-list-cell 
+            v-if="option.style == 1"
+            class="line-cell code-wrap" :hover="false">
+            <div class="tui-title">主营业务</div>
+            <div>
+              <button 
+                @click="changeMain(1)"
+                :class="['admin-button-com','mini-btn',form.main==1?'blue':'default']">
+                零售
+              </button>
+              <button
+                @click="changeMain(2)" 
+                style="margin-left:10px;" :class="['admin-button-com','mini-btn',form.main==2?'blue':'default']">
                 培训
               </button>
             </div>
           </tui-list-cell>
           <tui-list-cell class="line-cell" :hover="false">
               <div class="tui-title">营业执照编号</div>
-              <app-uploader ref="appUploader" :imgList.sync="form.shopImg" :isMain="true" :num="4" />
-              <!-- <input
-                v-model="form.name"
+              <input
+                v-model="form.licenseNo"
                 placeholder-class="phcolor"
                 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">营业执照图片</div>
-              <input
+          <tui-list-cell class="line-cell" :hover="false">
+              <div class="tui-title">营业执照片</div>
+              <app-uploader @resultData="resultData" ref="appUploader" :num="1" />
+              <!-- <input
                 v-model="form.name"
                 placeholder-class="phcolor"
                 placeholder-style="color:#CCCCCC"
                 class="tui-input"
                 name="name"
                 placeholder="请输入营业执照编号"
-              />
+              /> -->
          </tui-list-cell>
+         
       </div>
       <!-- 推荐人 -->
       <div class="module-com recommend-wrap" v-if="!$util.isEmpty(merchantData)">
@@ -138,6 +143,7 @@ import SimpleAddress from "@/components/plugin/simple-address";
 import AppAvatarModule from "@/components/module/app-avatar";
 import { getWxInfo, getWxPhone } from "@/api/mini";
 import AppUploader from "@/components/app-uploader";
+import AppBindInfo from "@/components/app-bind-info";
 const form = require("@/utils/formValidation.js");
 // api
 import {
@@ -154,7 +160,8 @@ export default {
     AppAreaSel,
     SimpleAddress,
     AppAvatarModule,
-    AppUploader
+    AppUploader,
+    AppBindInfo
   },
   data() {
     return {
@@ -166,10 +173,15 @@ export default {
         city: "",
         dist: "",
         address: "",
-        floor: "",
+        adminName:'',
+        nickName:'',
+        main: 1,
+        licenseNo: "",
+         license: "",
+        // floor: "",
         longitude: "",
         latitude: "",
-        adminId: ""
+        
       },
       showRegion: false,
       // 省市联动
@@ -183,6 +195,7 @@ export default {
     };
   },
   onLoad() {
+    // form 来源  introMerchantId 推荐ID  style  供货商 | 零售
     // if (!this.$util.isLogin()) {
     // 	// getShopUser()
     // 	return false
@@ -190,14 +203,23 @@ export default {
     // this.init()
   },
   methods: {
+    //图片地址
+    resultData(val){
+      this.form.license = val.smallUrl
+    },
+    changeMain(val){
+      this.form.main = val
+    },
+    bindInfo(val){
+      this.form.nickName = val.nickName;
+      this.form.mobile = val.mobile
+    },
     init() {
       this.$util.getCheckLogin().then(res => {
         if (res) {
-          let id = uni.getStorageSync("introMerchantId");
-          if (id > 0) {
-            this._getMerchantDet();
-          }
-          // this._regionTree();
+            if(this.option.introMerchantId) {
+              this._getMerchantDet();
+            }
         }
       });
     },
@@ -207,21 +229,22 @@ export default {
     //   });
     // },
     _getMerchantDet() {
-      let id = uni.getStorageSync("introMerchantId");
-      getIntroduce({ id: id }).then(res => {
+      // let id = uni.getStorageSync("introMerchantId");
+      getIntroduce({ id: this.option.introMerchantId || 0 }).then(res => {
         this.merchantData = res.data;
       });
     },
     // ==============
     confirmFn() {
-      let id = uni.getStorageSync("introMerchantId");
+      // let id = uni.getStorageSync("introMerchantId");
       applyRegister({
-        introMerchantId: id || 0,
-        ...this.form
+        introSjId: this.option.introMerchantId || 0,
+        ...this.form,
+        style: this.option.style || 0,
+        from: this.option.from || 0
       }).then(res => {
-        uni.setStorageSync("officialApply", res.data);
         this.$util.pageTo({
-          url: "/pagesClient/official/callback",
+          url: "/pagesClient/official/result",
           type: 2,
           query: {
             pagestatus: 3
@@ -229,76 +252,6 @@ export default {
         });
       });
     },
-    // 验证码
-    getCode() {
-      if (!this.form.mobile || !this.$util.checkMobile(this.form.mobile)) {
-        this.$msg("请输入正确的手机号!");
-        return false;
-      }
-      this.isSend = 1;
-      sendSmsW({
-        type: 1,
-        mobile: this.form.mobile
-      })
-        .then(res => {
-          this.beginCountDown();
-          this.$msg("发送成功!");
-        })
-        .catch(() => {
-          this.isSend = 0;
-          this.$msg("发送失败!");
-        });
-    },
-    // 获取微信手机号
-    getWxMobile(e) {
-      console.log(e);
-      if (e.detail.errMsg === "getPhoneNumber:ok") {
-        getWxPhone({
-          iv: e.detail.iv,
-          encryptedData: e.detail.encryptedData
-        }).then(res => {
-          this.form.mobile = res.data.mobile;
-          uni.showToast({
-            icon: "success"
-          });
-        });
-      } else {
-        this.$msg("获取信息失败!");
-      }
-    },
-    // 获取微信信息
-    getWxAvatar() {
-      uni.getUserInfo({
-        provider: "weixin",
-        success: res => {
-          console.log("res", res);
-          getWxInfo({ iv: res.iv, encryptedData: res.encryptedData }).then(
-            subRes => {
-              this.form.adminId = subRes.data.id;
-              this.nickName = subRes.data.nickName;
-              uni.showToast({
-                icon: "success"
-              });
-            }
-          );
-        },
-        fail: () => {
-          // this.loading = false
-        }
-      });
-    },
-    // 倒计时
-    beginCountDown() {
-      this.countDown = 119;
-      this.timer = setInterval(() => {
-        if (this.countDown === 0) {
-          clearInterval(this.timer);
-          this.isSend = 0;
-          return;
-        }
-        this.countDown -= 1;
-      }, 1000);
-    },
     // 选择地址
     selRegionFn() {
       if (!this.form.city) {
@@ -324,6 +277,7 @@ export default {
       this.form.address = e.address;
       this.form.latitude = e.location.lat;
       this.form.longitude = e.location.lng;
+      this.form.dist = e.district
     },
     // -----
     // 省市联动
@@ -341,7 +295,7 @@ export default {
       // 表单规则
       let rules = [
         {
-          name: "adminId",
+          name: "name",
           rule: ["required"],
           msg: ["请填写昵称"]
         }
@@ -349,22 +303,28 @@ export default {
       // 进行表单检查
       let formData = this.form;
       let checkRes = form.validation(formData, rules);
-      this.$util.pageTo({
-          url: "/pagesClient/official/callback",
-          type: 2,
-          query: {
-            pagestatus: 1
-          }
-        });
+      // this.$util.pageTo({
+      //     url: "/pagesClient/official/callback",
+      //     type: 2,
+      //     query: {
+      //       pagestatus: 1
+      //     }
+      //   });
       // 验证通过!
-      // if (!checkRes) {
-      //   setTimeout(() => {
-        //   this.confirmFn();
-        // });
-      // } else {
-      //   this.$msg(checkRes);
-      // }
+      if (!checkRes) {
+        setTimeout(() => {
+          this.confirmFn();
+        });
+      } else {
+        this.$msg(checkRes);
+      }
     }
+  },
+  watch:{
+    // imageList(val){
+    //   this.form.
+    //   console.log(val)
+    // }
   }
 };
 </script>

+ 5 - 5
ghs/src/pagesClient/official/index.vue

@@ -152,11 +152,11 @@ export default {
         uni.removeStorageSync("renewOption");
       }
       //花店分享的页面有邀人,打开页面保存邀请人
-      let introMerchantId = 0;
-      if (typeof this.option.introMerchantId != "undefined") {
-        introMerchantId = this.option.introMerchantId;
-      }
-      uni.setStorageSync("introMerchantId", introMerchantId);
+      // let introMerchantId = 0;
+      // if (typeof this.option.introMerchantId != "undefined") {
+      //   introMerchantId = this.option.introMerchantId;
+      // }
+      // uni.setStorageSync("introMerchantId", introMerchantId);
     },
     _getDet() {
       applyStatus().then(res => {