瀏覽代碼

v1.7版本接口调试

yuwenjun1997 2 年之前
父節點
當前提交
9bf9189408

+ 6 - 2
apis/index.js

@@ -82,7 +82,7 @@ export default ($axios) => {
   const checkAccountType = (params = {}) =>
   const checkAccountType = (params = {}) =>
     $axios.get('/wx/sdk/account/type', { params })
     $axios.get('/wx/sdk/account/type', { params })
   // 判断用户手机号是否绑定了机构信息
   // 判断用户手机号是否绑定了机构信息
-  const checkouMobileBindClub = (params = {}) =>
+  const fetchClubAuthInfo = (params = {}) =>
     $axios.get('/wx/user/info', { params })
     $axios.get('/wx/user/info', { params })
   // 获取品牌列表
   // 获取品牌列表
   const fetchBrandList = (params = {}) =>
   const fetchBrandList = (params = {}) =>
@@ -105,6 +105,9 @@ export default ($axios) => {
   // 机构账号验证码
   // 机构账号验证码
   const clubUserCodeSend = (data = {}) =>
   const clubUserCodeSend = (data = {}) =>
     $axios.post('/wx/user/login/code/send', data)
     $axios.post('/wx/user/login/code/send', data)
+  // 查询机构认证信息
+  const fetchClubAuthInfoData = (params = {}) =>
+    $axios.get('/auth/form/data', { params })
   // 高德地图api : 将坐标转化为高德地图坐标
   // 高德地图api : 将坐标转化为高德地图坐标
   const assistant = (params = {}) =>
   const assistant = (params = {}) =>
     fetch(
     fetch(
@@ -138,7 +141,7 @@ export default ($axios) => {
     fetchDoctorDetail,
     fetchDoctorDetail,
     checkAccountType,
     checkAccountType,
     assistant,
     assistant,
-    checkouMobileBindClub,
+    fetchClubAuthInfo,
     fetchBrandList,
     fetchBrandList,
     fetchProductSelectList,
     fetchProductSelectList,
     clubUserRegisterAll,
     clubUserRegisterAll,
@@ -146,5 +149,6 @@ export default ($axios) => {
     clubUserReset,
     clubUserReset,
     clubUserLogin,
     clubUserLogin,
     clubUserCodeSend,
     clubUserCodeSend,
+    fetchClubAuthInfoData,
   }
   }
 }
 }

+ 109 - 62
pages/_template/app/form/club-register.vue

@@ -8,42 +8,48 @@
       ></div>
       ></div>
     </div>
     </div>
     <div class="page-content">
     <div class="page-content">
-      <!-- 进步条 -->
-      <SimpleStep :list="stepList" :active="step" />
-
-      <div class="step-list py-4">
-        <keep-alive>
+      <template>
+        <!-- 进步条 -->
+        <SimpleStep :list="stepList" :active="step" v-if="showStepBar" />
+        <div class="step-list py-4">
           <!-- 账号注册表单 -->
           <!-- 账号注册表单 -->
-          <template
-            ><FormClubRegister
+          <keep-alive>
+            <FormClubRegister
               v-if="step === 1"
               v-if="step === 1"
               ref="userForm"
               ref="userForm"
               @step="onUserFormStep"
               @step="onUserFormStep"
-          /></template>
+            />
+          </keep-alive>
           <!-- 机构认证表单 -->
           <!-- 机构认证表单 -->
-          <template
-            ><FormClubInfo
-              v-if="step === 2"
+          <keep-alive>
+            <FormClubInfo
+              v-if="step === 2 && registerType.indexOf(2) !== -1"
               ref="clubInfoForm"
               ref="clubInfoForm"
               @step="onClubInfoFormStep"
               @step="onClubInfoFormStep"
-          /></template>
+            />
+          </keep-alive>
           <!-- 设备认证表单 -->
           <!-- 设备认证表单 -->
-          <template
-            ><FormClubDevice
+          <keep-alive>
+            <FormClubDevice
               v-if="step === 3"
               v-if="step === 3"
               ref="clubDeviceForm"
               ref="clubDeviceForm"
               @step="onclubDeviceFormStep"
               @step="onclubDeviceFormStep"
-          /></template>
-        </keep-alive>
-      </div>
-      <!-- 机构已认证 || 机构认证中 -->
-      <!-- <template>
+            />
+          </keep-alive>
+        </div>
+      </template>
+      <!-- 机构已认证 || 机构认证中 || 机构认证失败 -->
+      <template v-if="step === 2 && registerType.indexOf(2) === -1">
         <div class="message">
         <div class="message">
-          <div class="status-icon success"></div>
-          <div class="status">机构已认证</div>
+          <div class="status-icon" :class="autidStatusClass"></div>
+          <div class="status">
+            <span v-if="autidStatus === 0">机构认证失败</span>
+            <span v-if="autidStatus === 1">机构认证成功</span>
+            <span v-if="autidStatus === 2">机构认证中</span>
+          </div>
           <div class="tip">提示:可点击认证记录看查看详情</div>
           <div class="tip">提示:可点击认证记录看查看详情</div>
         </div>
         </div>
-      </template> -->
+      </template>
 
 
       <!-- 操作 -->
       <!-- 操作 -->
       <div class="control flex flex-col items-center">
       <div class="control flex flex-col items-center">
@@ -56,7 +62,7 @@
         <div
         <div
           class="button prev flex justify-center items-center"
           class="button prev flex justify-center items-center"
           @click="onPrevStep"
           @click="onPrevStep"
-          v-if="step > 1"
+          v-if="showPreButton"
         >
         >
           上一步
           上一步
         </div>
         </div>
@@ -80,15 +86,7 @@ export default {
     FormClubInfo,
     FormClubInfo,
     FormClubDevice,
     FormClubDevice,
   },
   },
-  computed: {
-    ...mapGetters([
-      'supplierInfo',
-      'authUserId',
-      'routePrefix',
-      'accessToken',
-      'userInfo',
-    ]),
-  },
+
   data() {
   data() {
     return {
     return {
       registerType: [3],
       registerType: [3],
@@ -103,23 +101,69 @@ export default {
           label: '机构认证',
           label: '机构认证',
           id: 2,
           id: 2,
           recordRoute: '/record/club/detail',
           recordRoute: '/record/club/detail',
+          auditStatus: '',
         },
         },
         {
         {
           label: '设备认证',
           label: '设备认证',
           id: 3,
           id: 3,
           recordRoute: '/record/device',
           recordRoute: '/record/device',
+          auditStatus: '',
         },
         },
       ],
       ],
+
+      // 机构用户信息
       clubUserInfo: {},
       clubUserInfo: {},
+      // 机构授权信息
       authInfo: {},
       authInfo: {},
-      productInfo: {},
+      // 机构认证设备列表信息
+      productInfo: [],
 
 
+      // 机构授权id
       authId: '',
       authId: '',
+      // 机构用户id
       clubUserId: '',
       clubUserId: '',
 
 
-      tipObj: {},
+      autidStatus: 0,
     }
     }
   },
   },
+
+  computed: {
+    ...mapGetters([
+      'supplierInfo',
+      'authUserId',
+      'routePrefix',
+      'accessToken',
+      'userInfo',
+    ]),
+
+    autidStatusClass() {
+      if (this.autidStatus === 0) return 'danger'
+      if (this.autidStatus === 1) return 'success'
+      if (this.autidStatus === 2) return 'warning'
+    },
+
+    showStepBar() {
+      if (this.step === 2) {
+        if (this.registerType.indexOf(2) > -1) {
+          return true
+        } else {
+          return false
+        }
+      }
+      return true
+    },
+
+    showPreButton() {
+      if (this.step === 2) {
+        if (this.registerType.indexOf(1) > -1) {
+          return true
+        } else {
+          return false
+        }
+      }
+      return true
+    },
+  },
   created() {
   created() {
     this.initForm()
     this.initForm()
   },
   },
@@ -130,26 +174,23 @@ export default {
         2: this.$refs.clubInfoForm?.validate(),
         2: this.$refs.clubInfoForm?.validate(),
         3: this.$refs.clubDeviceForm?.validate(),
         3: this.$refs.clubDeviceForm?.validate(),
       }
       }
-
-      if (this.registerType.indexOf(this.step) > -1) {
-        try {
-          await validateAction[this.step]
-        } catch (error) {
-          console.log(error)
-          return error
+      try {
+        // 表单校验
+        await validateAction[this.step]
+        // 提交
+        if (this.step === 3) {
+          this.onSubmit()
         }
         }
-      }
-      if (this.step === 3) {
-        this.onSubmit()
-      }
-      if (this.step < 3) {
-        this.step++
+        // 下一步
+        if (this.step < 3) {
+          this.step++
+        }
+      } catch (error) {
+        console.log(error)
       }
       }
     },
     },
     onPrevStep() {
     onPrevStep() {
-      if (this.step > 1) {
-        this.step--
-      }
+      this.step > 1 && this.step--
     },
     },
 
 
     async onSubmit() {
     async onSubmit() {
@@ -168,8 +209,10 @@ export default {
       try {
       try {
         const res = await this.$http.api.clubUserRegisterAll(params)
         const res = await this.$http.api.clubUserRegisterAll(params)
         console.log(res)
         console.log(res)
+        this.$router.push(`${this.routePrefix}/record/message`)
       } catch (error) {
       } catch (error) {
         console.log(error)
         console.log(error)
+        this.$toast(error.msg)
       }
       }
     },
     },
 
 
@@ -189,8 +232,12 @@ export default {
     },
     },
 
 
     toRecord() {
     toRecord() {
-      const step = this.stepList.find((item) => item.id === this.step)
-      this.$router.push(`${this.routePrefix + step.recordRoute}`)
+      if (!this.accessToken) {
+        this.$toast('请登录后查看')
+        this.$router.push(`${this.routePrefix}`)
+        return
+      }
+      this.$router.push(`${this.routePrefix}/record/club/detail`)
     },
     },
 
 
     // 初始化表单
     // 初始化表单
@@ -201,22 +248,29 @@ export default {
       } else {
       } else {
         this.step = 2
         this.step = 2
         this.stepList = this.stepList.filter((item) => item.id !== 1)
         this.stepList = this.stepList.filter((item) => item.id !== 1)
-        await this.checkouClubInfo()
+        await this.initClubInfo()
       }
       }
     },
     },
 
 
     // 判断用户手机号是否绑定机构
     // 判断用户手机号是否绑定机构
-    async checkouClubInfo() {
+    async initClubInfo() {
       try {
       try {
-        const res = await this.$http.api.checkouMobileBindClub({
+        const res = await this.$http.api.fetchClubAuthInfo({
           authUserId: this.authUserId,
           authUserId: this.authUserId,
           mobile: this.userInfo.mobile,
           mobile: this.userInfo.mobile,
         })
         })
+
+        // 机构是否绑定用户
         if (!res.data.clubUser) {
         if (!res.data.clubUser) {
           this.registerType.push(1)
           this.registerType.push(1)
         }
         }
+
+        // 机构是否认证
         if (!res.data.auth) {
         if (!res.data.auth) {
           this.registerType.push(2)
           this.registerType.push(2)
+        } else {
+          this.autidStatus = res.data.auth.auditStatus
+          this.authId = res.data.auth.authId
         }
         }
         return Promise.resolve(res)
         return Promise.resolve(res)
       } catch (error) {
       } catch (error) {
@@ -224,13 +278,6 @@ export default {
         return Promise.reject(error)
         return Promise.reject(error)
       }
       }
     },
     },
-
-    hasClubInfo() {
-      return false
-    },
-
-    // 机构注册提示
-    generateRegisterTip() {},
   },
   },
 }
 }
 </script>
 </script>

+ 1 - 1
pages/_template/app/form/components/form-club-register.vue

@@ -137,7 +137,7 @@ export default {
     async checkouMobileBindClub() {
     async checkouMobileBindClub() {
       if (!isMobile(this.formData.mobile)) return
       if (!isMobile(this.formData.mobile)) return
       try {
       try {
-        const res = await this.$http.api.checkouMobileBindClub({
+        const res = await this.$http.api.fetchClubAuthInfo({
           authUserId: this.authUserId,
           authUserId: this.authUserId,
           mobile: this.formData.mobile,
           mobile: this.formData.mobile,
         })
         })

+ 2 - 2
pages/_template/app/index.vue

@@ -62,7 +62,7 @@ export default {
       this.list = [
       this.list = [
         {
         {
           id: 0,
           id: 0,
-          name: '申请入口',
+          name: '正品授权申请入口',
           image: `${this.themeName}-icon-edit.png`,
           image: `${this.themeName}-icon-edit.png`,
           hover: `icon-edit-active.png`,
           hover: `icon-edit-active.png`,
           path: '/form/club-register',
           path: '/form/club-register',
@@ -70,7 +70,7 @@ export default {
         },
         },
         {
         {
           id: 1,
           id: 1,
-          name: '授权认证',
+          name: '正品授权',
           image: `${this.themeName}-icon-approve.png`,
           image: `${this.themeName}-icon-approve.png`,
           hover: `icon-approve-active.png`,
           hover: `icon-approve-active.png`,
           path: '/approve',
           path: '/approve',

+ 63 - 21
pages/_template/app/record/club/detail.vue

@@ -9,57 +9,77 @@
         <div class="page-title">机构认证</div>
         <div class="page-title">机构认证</div>
         <div class="row">
         <div class="row">
           <div class="col">机构名称:</div>
           <div class="col">机构名称:</div>
-          <div class="col">机构名称</div>
+          <div class="col">{{ clubInfo.authParty }}</div>
         </div>
         </div>
         <div class="row">
         <div class="row">
           <div class="col">联系电话:</div>
           <div class="col">联系电话:</div>
-          <div class="col">15889586666</div>
+          <div class="col">{{ clubInfo.mobile }}</div>
         </div>
         </div>
         <div class="row">
         <div class="row">
           <div class="col">所在地区:</div>
           <div class="col">所在地区:</div>
-          <div class="col">广东省深圳市福田区上步南路锦峰大厦A座</div>
+          <div class="col">{{ clubInfo.area }}</div>
         </div>
         </div>
         <div class="row">
         <div class="row">
           <div class="col">所在位置:</div>
           <div class="col">所在位置:</div>
-          <div class="col">广东省深圳市福田区上步南路锦峰大厦A座</div>
+          <div class="col">{{ clubInfo.address }}</div>
         </div>
         </div>
         <div class="row">
         <div class="row">
           <div class="col max-width">logo:</div>
           <div class="col max-width">logo:</div>
           <div class="col">
           <div class="col">
             <el-image
             <el-image
-              src="https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpe"
+              :src="clubInfo.logo"
+              :preview-src-list="[clubInfo.logo]"
             ></el-image>
             ></el-image>
           </div>
           </div>
         </div>
         </div>
         <div class="row">
         <div class="row">
-          <div class="col max-width">logo:</div>
+          <div class="col max-width">门头照:</div>
           <div class="col">
           <div class="col">
-            <el-image
-              src="https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpe"
-            ></el-image>
-            <el-image
-              src="https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpe"
-            ></el-image>
-            <el-image
-              src="https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpe"
-            ></el-image>
+            <template v-for="(image, index) in clubInfo.bannerList">
+              <el-image
+                :key="index"
+                :src="image"
+                :preview-src-list="clubInfo.bannerList"
+              />
+            </template>
           </div>
           </div>
         </div>
         </div>
         <div class="row">
         <div class="row">
           <div class="col">机构类型:</div>
           <div class="col">机构类型:</div>
-          <div class="col">医美</div>
+          <div class="col">
+            {{
+              ['医美', '生美', '项目公司', '个人', '其他'][
+                clubInfo.firstClubType - 1
+              ]
+            }}
+          </div>
         </div>
         </div>
-        <div class="row">
+        <div
+          class="row"
+          v-if="clubInfo.firstClubType === 1 || clubInfo.firstClubType === 2"
+        >
           <div class="col">医美类型:</div>
           <div class="col">医美类型:</div>
-          <div class="col">诊所</div>
+          <div class="col">
+            {{
+              ['诊所', '门诊', '医院', '其他', '美容院', '养生馆', '其他'][
+                clubInfo.secondClubType - 1
+              ]
+            }}
+          </div>
         </div>
         </div>
         <div class="row">
         <div class="row">
           <div class="col">员工人数:</div>
           <div class="col">员工人数:</div>
-          <div class="col">12</div>
+          <div class="col">{{ clubInfo.empNum }}</div>
         </div>
         </div>
         <div class="row">
         <div class="row">
           <div class="col">状态:</div>
           <div class="col">状态:</div>
-          <div class="col">认证中</div>
+          <div class="col">
+            <div>
+              <span v-if="clubInfo.auditStatus === 1">认证成功</span>
+              <span v-else-if="clubInfo.auditStatus === 2">认证中</span>
+              <span v-else>认证失败</span>
+            </div>
+          </div>
         </div>
         </div>
 
 
         <div class="control flex flex-col items-center">
         <div class="control flex flex-col items-center">
@@ -92,10 +112,32 @@ export default {
   components: {
   components: {
     SimpleEmpty,
     SimpleEmpty,
   },
   },
+  data() {
+    return {
+      clubInfo: {},
+    }
+  },
   computed: {
   computed: {
-    ...mapGetters(['supplierInfo', 'authUserId', 'routePrefix']),
+    ...mapGetters(['supplierInfo', 'routePrefix', 'clubUserId']),
+  },
+  created() {
+    this.fetchAuthDetail()
   },
   },
   methods: {
   methods: {
+    // 获取认证机构信息
+    async fetchAuthDetail() {
+      try {
+        const result = await this.$http.api.fetchClubAuthInfo({
+          clubUserId: this.clubUserId,
+        })
+        const res = await this.$http.api.fetchClubAuthInfoData({
+          authId: result.data.auth.authId,
+        })
+        this.clubInfo = res.data
+        console.log(res)
+      } catch (error) {}
+    },
+
     onToDeviceList() {
     onToDeviceList() {
       this.$router.push(`${this.routePrefix}/record/device`)
       this.$router.push(`${this.routePrefix}/record/device`)
     },
     },

+ 17 - 3
pages/_template/app/record/club/edit.vue

@@ -72,10 +72,19 @@
           />
           />
         </el-form-item>
         </el-form-item>
 
 
-        <el-form-item label="医美类型:">
+        <el-form-item label="医美类型:" v-if="formData.clubType === 1">
           <br />
           <br />
           <SimpleRadio
           <SimpleRadio
-            :list="medicalTypeList"
+            :list="medicalTypeList1"
+            type="rect"
+            v-model="formData.medicalType"
+          />
+        </el-form-item>
+
+        <el-form-item label="生美类型:" v-if="formData.clubType === 2">
+          <br />
+          <SimpleRadio
+            :list="medicalTypeList2"
             type="rect"
             type="rect"
             v-model="formData.medicalType"
             v-model="formData.medicalType"
           />
           />
@@ -124,12 +133,17 @@ export default {
         { value: 4, name: '个人' },
         { value: 4, name: '个人' },
         { value: 5, name: '其他' },
         { value: 5, name: '其他' },
       ],
       ],
-      medicalTypeList: [
+      medicalTypeList1: [
         { value: 1, name: '诊所' },
         { value: 1, name: '诊所' },
         { value: 2, name: '门诊' },
         { value: 2, name: '门诊' },
         { value: 3, name: '医院' },
         { value: 3, name: '医院' },
         { value: 4, name: '其他' },
         { value: 4, name: '其他' },
       ],
       ],
+      medicalTypeList2: [
+        { value: 5, name: '美容院' },
+        { value: 6, name: '养生馆' },
+        { value: 7, name: '其他' },
+      ],
       formData: {
       formData: {
         clubType: 1,
         clubType: 1,
         medicalType: 1,
         medicalType: 1,

+ 1 - 1
pages/_template/app/record/device/index.vue

@@ -5,7 +5,7 @@
       <div class="name mt-2" v-text="supplierInfo.shopName + '认证记录'"></div>
       <div class="name mt-2" v-text="supplierInfo.shopName + '认证记录'"></div>
     </div>
     </div>
     <div class="page-content">
     <div class="page-content">
-      <template v-if="false">
+      <template v-if="true">
         <div class="page-title">设备认证</div>
         <div class="page-title">设备认证</div>
         <div class="device-list">
         <div class="device-list">
           <div class="device" @click="toEdit">
           <div class="device" @click="toEdit">

+ 1 - 0
store/getters.js

@@ -12,6 +12,7 @@ export default {
   accessToken: (state) => state.user.accessToken,
   accessToken: (state) => state.user.accessToken,
   appId: (state) => state.user.appId,
   appId: (state) => state.user.appId,
   accountType: (state) => state.user.accountType,
   accountType: (state) => state.user.accountType,
+  clubUserId: (state) => state.user.clubUserId,
   // 供应商相关
   // 供应商相关
   supplierInfo: (state) => state.supplier.supplierInfo,
   supplierInfo: (state) => state.supplier.supplierInfo,
 }
 }

+ 2 - 0
store/user.js

@@ -4,12 +4,14 @@ const state = () => ({
   accessToken: '',
   accessToken: '',
   appId: '',
   appId: '',
   accountType: '',
   accountType: '',
+  clubUserId: ''
 })
 })
 
 
 const mutations = {
 const mutations = {
   // 设置用户信息
   // 设置用户信息
   SET_USER_INFO(state, data) {
   SET_USER_INFO(state, data) {
     state.userInfo = data
     state.userInfo = data
+    state.clubUserId = data.clubUserId
     state.accessToken = data.accessToken
     state.accessToken = data.accessToken
   },
   },
   // 设置appId
   // 设置appId