Переглянути джерело

认证通v1.7.4版本提测

yuwenjun1997 2 роки тому
батько
коміт
c25c686346

+ 3 - 3
.env.development

@@ -7,8 +7,8 @@ LOCALHOSE = 'http://192.168.2.92:8888'
 # LOCALHOSE = 'http://192.168.1.102:8888'
 
 # 接口api地址
-BASE_URL = 'https://zplma-b.caimei365.com'
-# BASE_URL = 'http://192.168.2.68:8012'
+# BASE_URL = 'https://zplma-b.caimei365.com'
+BASE_URL = 'http://192.168.2.200:8012'
 # BASE_URL = 'http://192.168.2.67:8012'
 
 # 静态资源文件地址
@@ -25,4 +25,4 @@ HOST = '192.168.2.92'
 PORT = '8888'
 
 # HTTPS flag
-HTTPS = true
+HTTPS = false

+ 5 - 1
apis/module/auth.js

@@ -1,6 +1,6 @@
 export default ($axios) => {
   const authApis = {}
-  
+
   // 获取已认证机构列表
   authApis.getAuthClubList = (params = {}) =>
     $axios.get('/wx/auth/club/list', { params })
@@ -68,5 +68,9 @@ export default ($axios) => {
   authApis.fetchDetialBySnCode = (params = {}) =>
     $axios.get('/wx/auth/product/info', { params })
 
+  // 获取机构已认证设备
+  authApis.fetchClubAuthProductList = (params = {}) =>
+    $axios.get('/wx/auth/get/product/list', { params })
+
   return authApis
 }

BIN
assets/theme-images/common/h5-icon-club-logo-default.png


BIN
assets/theme-images/common/pc-icon-club-logo-default.png


+ 15 - 13
middleware/intercept.js

@@ -67,20 +67,22 @@ async function initTemplateEntry(context) {
       return
     }
 
-    // 默认模板
-    if (prefix === 'app') {
-      if (isFixedTemplate(authUserId)) {
-        showError(error, { statusCode: 500, message: '模板与供应商不匹配' })
-        return
+    if (dev !== 'development') {
+      // 默认模板
+      if (prefix === 'app') {
+        if (isFixedTemplate(authUserId)) {
+          showError(error, { statusCode: 500, message: '模板与供应商不匹配' })
+          return
+        }
       }
-    }
 
-    // 非默认模板
-    if (['ross', 'ldm'].includes(prefix)) {
-      // 供应商为指定模板
-      if (!isMatchTemplate(authUserId, prefix)) {
-        showError(error, { statusCode: 500, message: '模板与供应商不匹配' })
-        return
+      // 非默认模板
+      if (['ross', 'ldm'].includes(prefix)) {
+        // 供应商为指定模板
+        if (!isMatchTemplate(authUserId, prefix)) {
+          showError(error, { statusCode: 500, message: '模板与供应商不匹配' })
+          return
+        }
       }
     }
 
@@ -99,8 +101,8 @@ async function initTemplateEntry(context) {
 
 export default function (context) {
   const name = context.route.name
-  // console.log(name)
   if (isPublicEntry(name)) return // initPublicEntry(context)
   if (isTemplateEntry(name)) return initTemplateEntry(context)
+  console.log(123)
   context.error({ statusCode: 404, message: '页面不存在' })
 }

+ 1 - 0
pages/_template/_.vue

@@ -0,0 +1 @@
+<template></template>

+ 57 - 16
pages/_template/ross/center/club-detail.vue

@@ -5,64 +5,67 @@
       <div class="title">机构认证信息</div>
       <template v-if="!isAuth">
         <div class="tip">抱歉,您暂未认证机构</div>
-        <div class="btn">去认证</div>
+        <div class="btn" @click="toAuth">去认证</div>
       </template>
       <template v-else>
         <div class="row">
           <div class="col label">机构名称:</div>
-          <div class="col content">西班牙Ross</div>
+          <div class="col content">{{ clubInfo.authParty }}</div>
         </div>
         <div class="row">
           <div class="col label">联系电话:</div>
-          <div class="col content">15889586666</div>
+          <div class="col content">{{ clubInfo.mobile }}</div>
         </div>
         <div class="row">
           <div class="col label">运营联系人:</div>
-          <div class="col content">区苏苏</div>
+          <div class="col content">{{ clubInfo.linkMan }}</div>
         </div>
         <div class="row">
           <div class="col label">运营联系人手机号:</div>
-          <div class="col content">18877663232</div>
+          <div class="col content">{{ clubInfo.linkMobile }}</div>
         </div>
         <div class="row">
           <div class="col label">所在地区:</div>
-          <div class="col content">广东省深圳市福田区上步南路锦峰大厦A座</div>
+          <div class="col content">{{ clubInfo.area }}</div>
         </div>
         <div class="row">
           <div class="col label">所在位置:</div>
-          <div class="col content">广东省深圳市福田区上步南路锦峰大厦A座</div>
+          <div class="col content">{{ clubInfo.address }}</div>
         </div>
         <div class="row block">
           <div class="col label">logo:</div>
           <div class="col content">
-            <el-image src="https://picsum.photos/120/120"></el-image>
+            <el-image :src="clubInfo.logo" v-if="clubInfo.logo"></el-image>
           </div>
         </div>
         <div class="row block">
           <div class="col label">门头照:</div>
           <div class="col content">
-            <el-image src="https://picsum.photos/120/120"></el-image>
-            <el-image src="https://picsum.photos/120/120"></el-image>
-            <el-image src="https://picsum.photos/120/120"></el-image>
+            <template v-for="(image, index) in clubInfo.bannerList">
+              <el-image :src="image" :key="index"></el-image>
+            </template>
           </div>
         </div>
         <div class="row">
           <div class="col label">机构类型:</div>
-          <div class="col content">医美</div>
+          <div class="col content">{{ firstClubTypeName }}</div>
         </div>
         <div class="row">
           <div class="col label">医美类型:</div>
-          <div class="col content">诊所</div>
+          <div class="col content">{{ secondClubTypeName }}</div>
         </div>
         <div class="row block">
           <div class="col label">医疗许可证:</div>
           <div class="col content">
-            <el-image src="https://picsum.photos/120/120"></el-image>
+            <el-image
+              :src="clubInfo.medicalLicenseImage"
+              v-if="clubInfo.medicalLicenseImage"
+            ></el-image>
           </div>
         </div>
         <div class="row">
           <div class="col label">员工人数:</div>
-          <div class="col content">21</div>
+          <div class="col content">{{ clubInfo.empNum }}</div>
         </div>
       </template>
     </div>
@@ -70,13 +73,51 @@
 </template>
 
 <script>
+import { mapGetters } from 'vuex'
 export default {
   layout: 'app-ross',
   data() {
     return {
-      isAuth: true,
+      clubInfo: {},
     }
   },
+  computed: {
+    ...mapGetters(['userInfo', 'routePrefix']),
+    isAuth() {
+      return this.userInfo && this.userInfo.authId
+    },
+    firstClubTypeName() {
+      if (!this.clubInfo.firstClubType) return '其他'
+      return ['医美', '生美', '项目公司', '个人', '其他'][
+        this.clubInfo.firstClubType - 1
+      ]
+    },
+    secondClubTypeName() {
+      if (!this.clubInfo.secondClubType) return '其他'
+      return ['诊所', '门诊', '医院', '其他', '美容院', '养生馆', '其他'][
+        this.clubInfo.secondClubType - 1
+      ]
+    },
+  },
+  created() {
+    this.fetchClubDetail()
+  },
+  methods: {
+    async fetchClubDetail() {
+      try {
+        const authId = this.userInfo.authId
+        if (!authId) return
+        const res = await this.$http.api.getAuthClubDetail({ authId })
+        this.clubInfo = res.data
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 去认证
+    toAuth() {
+      this.$router.push(`${this.routePrefix}/form/club-register`)
+    },
+  },
 }
 </script>
 

+ 47 - 20
pages/_template/ross/center/device/detail.vue

@@ -5,48 +5,52 @@
       <div class="title">设备认证信息</div>
       <div class="row">
         <div class="col label">设备名称:</div>
-        <div class="col content">
-          RADIO4丽肤提意大利进口动态四极射频抗衰塑形
-        </div>
+        <div class="col content">{{ productInfo.productName }}</div>
       </div>
       <div class="row block">
         <div class="col label">设备图片:</div>
         <div class="col content">
-          <el-image src="https://picsum.photos/120/120"></el-image>
+          <el-image
+            v-if="productInfo.productImage"
+            :src="productInfo.productImage"
+            :preview-src-list="[productInfo.productImage]"
+          ></el-image>
+          <span v-else>暂无图片</span>
         </div>
       </div>
       <div class="row">
         <div class="col label">所属品牌:</div>
-        <div class="col content">华熙生物</div>
+        <div class="col content">{{ productInfo.brandName }}</div>
       </div>
       <div class="row">
         <div class="col label">购买渠道:</div>
-        <div class="col content">医院</div>
+        <div class="col content">{{ productInfo.purchaseWay || '暂无' }}</div>
       </div>
       <div class="row block">
         <div class="col label">发票:</div>
         <div class="col content">
-          <el-image src="https://picsum.photos/120/120"></el-image>
+          <el-image
+            v-if="productInfo.invoiceImage"
+            :src="productInfo.invoiceImage"
+            :preview-src-list="[productInfo.invoiceImage]"
+          ></el-image>
+          <span v-else>暂无图片</span>
         </div>
       </div>
       <div class="row">
         <div class="col label">设备SN码:</div>
-        <div class="col content">SN2626562612</div>
+        <div class="col content">{{ productInfo.snCode }}</div>
       </div>
       <div class="row">
         <div class="col label">设备参数:</div>
         <div class="col content params-list">
-          <div class="param">
-            <div class="param-name">NDHUIWM</div>
-            <div class="param-content">中胚层产品</div>
-          </div>
-          <div class="param">
-            <div class="param-name">NDHUIWM</div>
-            <div class="param-content">中胚层产品</div>
-          </div>
-          <div class="param">
-            <div class="param-name">NDHUIWM</div>
-            <div class="param-content">中胚层产品</div>
+          <div
+            class="param"
+            v-for="param in productInfo.paramList"
+            :key="param.productName"
+          >
+            <div class="param-name">{{ param.paramName }}</div>
+            <div class="param-content">{{ param.paramContent }}</div>
           </div>
         </div>
       </div>
@@ -59,9 +63,32 @@ export default {
   layout: 'app-ross',
   data() {
     return {
-      isAuth: false,
+      productInfo: {},
     }
   },
+  created() {
+    this.initData()
+  },
+  methods: {
+    initData() {
+      this.productId = this.$route.query.id
+      this.relationId = this.$route.query.relationId
+      this.getProductDetails()
+    },
+    // 获取认证机构信息
+    async getProductDetails() {
+      try {
+        const res = await this.$http.api.getProductDetails({
+          productId: this.productId,
+          relationId: this.relationId,
+        })
+        this.productInfo = { ...this.productInfo, ...res.data }
+        console.log('res', this.productInfo)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+  },
 }
 </script>
 

+ 46 - 18
pages/_template/ross/center/device/index.vue

@@ -4,25 +4,21 @@
       <div class="title">设备认证信息</div>
       <template v-if="!isAuth">
         <div class="tip">抱歉,您暂未认证设备</div>
-        <div class="btn">去认证</div>
+        <div class="btn" @click="toAuth">去认证</div>
       </template>
       <div class="device-list" v-else>
-        <div class="device" @click="toDetail">
+        <div
+          class="device"
+          @click="toDetail(product)"
+          v-for="product in list"
+          :key="product.productId"
+        >
           <div class="cover">
-            <img src="https://picsum.photos/120/120" alt="" />
+            <img :src="product.image" :alt="product.productName" />
           </div>
           <div class="content">
-            <div class="name">B-BEAUTY童颜皮肤管理(海宁店)</div>
-            <div class="sncode">SN码:SN********5666</div>
-          </div>
-        </div>
-        <div class="device">
-          <div class="cover">
-            <img src="https://picsum.photos/120/120" alt="" />
-          </div>
-          <div class="content">
-            <div class="name">B-BEAUTY童颜皮肤管理(海宁店)</div>
-            <div class="sncode">SN码:SN********5666</div>
+            <div class="name">{{ product.productName }}</div>
+            <div class="sncode">SN码:{{ product.snCode | formatSnCode }}</div>
           </div>
         </div>
       </div>
@@ -36,15 +32,47 @@ export default {
   layout: 'app-ross',
   data() {
     return {
-      isAuth: false,
+      list: [],
     }
   },
+  filters: {
+    formatSnCode(code) {
+      if (!code) return ''
+      return code.replace(/^(\w{2})\w+(\w{4})$/, '$1******$2')
+    },
+  },
   computed: {
-    ...mapGetters(['routePrefix']),
+    ...mapGetters(['routePrefix', 'userInfo', 'authUserId']),
+    isAuth() {
+      return this.userInfo && this.userInfo.authId
+    },
+  },
+  created() {
+    this.fetchProductList()
   },
   methods: {
-    toDetail() {
-      this.$router.push(`${this.routePrefix}/center/device/detail`)
+    // 产看详情
+    toDetail(row) {
+      const path = `${this.routePrefix}/center/device/detail?productId=${row.productId}&relationId=${row.relationId}`
+      this.$router.push(path)
+    },
+    // 获取已认证设备列表
+    async fetchProductList() {
+      try {
+        const authId = this.userInfo.authId
+        if (!authId) return
+        const res = await this.$http.api.fetchClubAuthProductList({
+          authId,
+          authUserId: this.authUserId,
+        })
+        this.list = res.data
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 去认证
+    toAuth() {
+      this.$router.push(`${this.routePrefix}/form/club-register`)
     },
   },
 }

+ 19 - 5
pages/_template/ross/center/index.vue

@@ -2,10 +2,20 @@
   <div class="page">
     <div class="page-top flex flex-col justify-center items-center">
       <div class="club-logo">
-        <img src="https://picsum.photos/120/120" alt="" />
+        <img :src="userInfo.logo" alt="" v-if="userInfo.logo" />
+        <img
+          src="~/assets/theme-images/common/pc-icon-club-logo-default.png"
+          v-else-if="isPc"
+        />
+        <img
+          src="~/assets/theme-images/common/h5-icon-club-logo-default.png"
+          v-else
+        />
+      </div>
+      <div class="club-mobile">{{ userInfo.mobile }}</div>
+      <div class="club-name" v-if="userInfo.authId">
+        机构:{{ userInfo.authParty }}
       </div>
-      <div class="club-mobile">15818799636</div>
-      <div class="club-name">机构:晨美国际美容</div>
     </div>
     <div class="page-content">
       <div class="section-title">我的认证</div>
@@ -29,7 +39,7 @@
       <template v-if="isPc">
         <div class="section-title">账户设置</div>
         <div class="section-content">
-          <div class="reset-pwd">修改密码</div>
+          <div class="reset-pwd" @click="onResetPassword">修改密码</div>
         </div>
       </template>
       <template v-else>
@@ -49,7 +59,7 @@ import { mapGetters } from 'vuex'
 export default {
   layout: 'app-ross',
   computed: {
-    ...mapGetters(['routePrefix', 'isPc']),
+    ...mapGetters(['routePrefix', 'isPc', 'userInfo']),
   },
   methods: {
     // 机构详情
@@ -60,6 +70,10 @@ export default {
     onToDeviceList() {
       this.$router.push(`${this.routePrefix}/center/device`)
     },
+    // 修改密码
+    onResetPassword() {
+      this.$router.push(`${this.routePrefix}/center/settings/password`)
+    },
   },
 }
 </script>

+ 78 - 5
pages/_template/ross/center/settings/password.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="page">
     <div class="page-content">
-      <el-form :model="formData" :rules="rules" label-position="top">
+      <el-form :model="formData" :rules="rules" label-position="top" ref="form">
         <el-form-item label="手机号" prop="mobile">
           <el-input
             placeholder="请输入手机号"
@@ -16,7 +16,7 @@
               maxlength="6"
               v-model="formData.verifyCode"
             ></el-input>
-            <div class="send">获取验证码</div>
+            <div class="send" @click="onSend">{{ sendCodeBtnText }}</div>
           </div>
         </el-form-item>
         <el-form-item label="新密码" prop="password">
@@ -35,15 +35,16 @@
         </el-form-item>
       </el-form>
       <div class="submit-button">
-        <div class="back btn">返回</div>
-        <div class="submit btn">提交</div>
+        <div class="back btn" @click="onBack">返回</div>
+        <div class="submit btn" @click="onSubmit">提交</div>
       </div>
     </div>
   </div>
 </template>
 
 <script>
-import { validPassword } from '~/utils/validator'
+import { isMobile, validPassword } from '~/utils/validator'
+import { mapGetters } from 'vuex'
 export default {
   layout: 'app-ross',
   data() {
@@ -64,6 +65,8 @@ export default {
     }
 
     return {
+      sendStatus: 0,
+      timer: null,
       formData: {
         mobile: '',
         verifyCode: '',
@@ -89,6 +92,76 @@ export default {
       },
     }
   },
+  computed: {
+    ...mapGetters(['authUserId', 'routePrefix']),
+    sendCodeBtnText() {
+      return this.sendStatus === 0
+        ? '发送验证码'
+        : `再次发送${this.sendStatus}s`
+    },
+  },
+  methods: {
+    // 返回
+    onBack(){
+      this.$router.back()
+    },
+    // 提交
+    async onSubmit() {
+      try {
+        await this.$refs.form.validate()
+        this.onResetPassword()
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 忘记密码
+    async onResetPassword() {
+      try {
+        await this.$http.api.clubUserReset({
+          mobile: this.formData.mobile,
+          verifyCode: this.formData.verifyCode,
+          password: this.formData.password,
+          authUserId: this.authUserId,
+        })
+        this.$toast('密码修改成功')
+        this.$emit('click', 'login')
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 发送短信验证码
+    async onSend() {
+      if (this.sendStatus > 0) return
+      // 验证手机号是否合法
+      if (!isMobile(this.formData.mobile)) {
+        this.$toast('请输入正确的手机号')
+        return
+      }
+      try {
+        // 发送验证码
+        await this.$http.api.clubUserCodeSend({
+          mobile: this.formData.mobile,
+          authUserId: this.authUserId,
+          type: this.formType === 'register' ? 1 : 2,
+        })
+        this.$toast('验证码已发送')
+        // 开启倒计时
+        this.countdown()
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    countdown() {
+      this.sendStatus = 30
+      this.timer = setInterval(() => {
+        if (this.sendStatus === 0) {
+          clearInterval(this.timer)
+          return
+        }
+        this.sendStatus--
+      }, 1000)
+    },
+  },
 }
 </script>