Browse Source

v1.7版本接口调试

yuwenjun1997 2 years ago
parent
commit
7f73cb2c8c

+ 1 - 1
.env.development

@@ -17,7 +17,7 @@ STATIC_URL = 'https://static.caimei365.com/www/authentic'
 CIMEI_LOCAL = 'https://www-b.caimei365.com'
 
 # 项目运行地址
-HOST = '192.168.2.56'
+HOST = '192.168.2.92'
 
 # 项目端口号
 PORT = '8888'

+ 9 - 9
apis/index.js

@@ -63,12 +63,12 @@ export default ($axios) => {
   const checkToken = (data = {}) =>
     $axios.post('/wx/user/login/token/check', data)
   // 下载文件
-  const downFile = (params = {}) => $axios.get('/download/file', { params })
+  const downFile = (params = {}) => $axios.get('/wx/download/file', { params })
   // 获取城市列表
   const fetchCityList = (params = {}) =>
-    $axios.get('/address/select', { params })
+    $axios.get('/wx/address/select', { params })
   // 获取城市列表
-  const fetchAllCityList = () => $axios.get('/address/select/all')
+  const fetchAllCityList = () => $axios.get('/wx/address/select/all')
   // 获取供应商信息
   const fetchSupplierInfo = (params = {}) =>
     $axios.get('/wx/auth/shop/info', { params })
@@ -86,10 +86,10 @@ export default ($axios) => {
     $axios.get('/wx/user/info', { params })
   // 获取品牌列表
   const fetchBrandList = (params = {}) =>
-    $axios.get('/shop/brand/list', { params })
+    $axios.get('/wx/auth/brand/list', { params })
   // 获取设备分类列表
   const fetchProductSelectList = (params = {}) =>
-    $axios.get('/auth/product/type/select', { params })
+    $axios.get('/wx/auth/product/type/select', { params })
   // 机构注册(全部信息注册)
   const clubUserRegisterAll = (data = {}) =>
     $axios.post('/wx/user/register/all', data)
@@ -107,15 +107,15 @@ export default ($axios) => {
     $axios.post('/wx/user/login/code/send', data)
   // 查询机构认证信息
   const fetchClubAuthInfoData = (params = {}) =>
-    $axios.get('/auth/form/data', { params })
+    $axios.get('/wx/auth/form/data', { params })
   // 查询机构认证信息
-  const authClubSave = (data = {}) => $axios.post('/auth/save', data)
+  const authClubSave = (data = {}) => $axios.post('/wx/auth/save', data)
   // 查询授权商品列表
   const getClubAuthProductList = (params = {}) =>
-    $axios.get('/auth/product/list', { params })
+    $axios.get('/wx/auth/product/list', { params })
   // 查询授权商品列表
   const getProductDetails = (params = {}) =>
-    $axios.get('/auth/product/form/data', { params })
+    $axios.get('/wx/auth/product/form/data', { params })
   // 高德地图api : 将坐标转化为高德地图坐标
   const assistant = (params = {}) =>
     fetch(

+ 1 - 1
components/SimpleRadio/index.vue

@@ -34,7 +34,7 @@ export default {
     },
     type: {
       type: String,
-      default: 'rect',
+      default: 'defalut',
     },
   },
   methods: {

+ 1 - 1
components/SimpleUploadImage/index.vue

@@ -79,7 +79,7 @@ export default {
       return this.imageList.length < this.limit
     },
     action() {
-      return process.env.BASE_URL + '/upload/image'
+      return process.env.BASE_URL + '/wx/upload/image'
     },
     headers() {
       return {

+ 40 - 29
pages/_template/app/form/club-register.vue

@@ -163,6 +163,7 @@ export default {
     },
 
     showPreButton() {
+      if(this.step === 1) return false
       if (this.step === 2) {
         if (this.registerType.indexOf(1) > -1) {
           return true
@@ -175,7 +176,7 @@ export default {
   },
   created() {
     this.authId = this.$route.query.authId || ''
-    this.initForm()
+    this.initPageForm()
   },
   methods: {
     onConfirm() {
@@ -254,47 +255,57 @@ export default {
       this.$router.push(`${this.routePrefix}/record/club/detail`)
     },
 
-    /***
-     * 已登录
-     *  1 机构 + 设备
-     *  2 设备
-     *
-     * 未登录
-     *  1 注册 + 机构 + 设备
-     *  2 注册 + 设备
-     */
-
-    // 初始化表单
-    async initForm() {
+    // 初始化从页面进入的表单
+    async initFormWithLink() {
+      const authId = this.$route.query.authId
       if (this.accessToken) {
+        // 已登录
         this.step = 2
-        await this.initClubInfo()
         this.stepList = this.stepList.filter((item) => item.id !== 1)
-      } else {
-        this.registerType.push(1)
-        await this.initClubInfo()
       }
+
+      await this.initClubInfo({
+        authUserId: this.authUserId,
+        authId: authId,
+      })
     },
 
-    // 判断用户手机号是否绑定机构
-    async initClubInfo() {
-      try {
-        const res = await this.$http.api.fetchClubAuthInfo({
+    // 初始化从正常页面进入的表单
+    async initFormWithNormal() {
+      if (this.accessToken) {
+        // 已登录
+        this.step = 2
+        this.stepList = this.stepList.filter((item) => item.id !== 1)
+        await this.initClubInfo({
           authUserId: this.authUserId,
           mobile: this.userInfo.mobile,
         })
+      } else {
+        // 未登录
+        this.registerType.push(1, 2)
+      }
+    },
 
-        // 机构是否绑定用户
-        if (!res.data.clubUser) {
-          this.registerType.push(1)
-        }
+    // 初始化表单
+    initPageForm() {
+      const linkType = this.$route.query.type || 'normal'
+      const taskMap = {
+        link: this.initFormWithLink,
+        normal: this.initFormWithNormal,
+      }
+      taskMap[linkType]()
+    },
 
-        // 机构是否认证
-        if (!res.data.auth) {
-          this.registerType.push(2)
-        } else {
+    // 判断用户手机号是否绑定机构
+    async initClubInfo(data) {
+      try {
+        const res = await this.$http.api.fetchClubAuthInfo(data)
+
+        if (res.data.auth) {
           this.autidStatus = res.data.auth.auditStatus
           this.authId = res.data.auth.authId
+        } else {
+          this.registerType.push(2)
         }
         return Promise.resolve(res)
       } catch (error) {

+ 28 - 6
pages/_template/app/form/components/form-club-info.vue

@@ -95,30 +95,33 @@
       </el-form-item>
 
       <el-form-item label="机构类型:">
-        <el-radio-group v-model="formData.firstClubType">
+        <!-- <el-radio-group v-model="formData.firstClubType">
           <el-radio :label="1">医美</el-radio>
           <el-radio :label="2">生美</el-radio>
           <el-radio :label="3">项目公司</el-radio>
           <el-radio :label="4">个人</el-radio>
           <el-radio :label="5">其他</el-radio>
-        </el-radio-group>
+        </el-radio-group> -->
+        <SimpleRadio v-model="formData.firstClubType" :list="clubTypeList"/>
       </el-form-item>
 
       <el-form-item v-if="formData.firstClubType === 1" label="医美类型:">
-        <el-radio-group v-model="formData.secondClubType">
+        <!-- <el-radio-group v-model="formData.secondClubType">
           <el-radio :label="1">诊所</el-radio>
           <el-radio :label="2">门诊</el-radio>
           <el-radio :label="3">医院</el-radio>
           <el-radio :label="4">其他</el-radio>
-        </el-radio-group>
+        </el-radio-group> -->
+        <SimpleRadio v-model="formData.secondClubType" :list="medicalTypeList1" type="rect"/>
       </el-form-item>
 
       <el-form-item v-if="formData.firstClubType === 2" label="生美类型:">
-        <el-radio-group v-model="formData.secondClubType">
+        <!-- <el-radio-group v-model="formData.secondClubType">
           <el-radio :label="5">美容院</el-radio>
           <el-radio :label="6">养生馆</el-radio>
           <el-radio :label="7">其他</el-radio>
-        </el-radio-group>
+        </el-radio-group> -->
+        <SimpleRadio v-model="formData.secondClubType" :list="medicalTypeList2" type="rect"/>
       </el-form-item>
 
       <el-form-item label="医疗许可证:" prop="medicalLicenseImage">
@@ -228,6 +231,25 @@ export default {
     }
 
     return {
+      clubTypeList: [
+        { value: 1, name: '医美' },
+        { value: 2, name: '生美' },
+        { value: 3, name: '项目公司' },
+        { value: 4, name: '个人' },
+        { value: 5, name: '其他' }
+      ],
+      medicalTypeList1: [
+        { value: 1, name: '诊所' },
+        { value: 2, name: '门诊' },
+        { value: 3, name: '医院' },
+        { value: 4, name: '其他' }
+      ],
+      medicalTypeList2: [
+        { value: 5, name: '美容院' },
+        { value: 6, name: '养生馆' },
+        { value: 7, name: '其他' }
+      ],
+      active: true,
       lnglat: null,
       mapVisiable: false,
       formData: {

+ 236 - 0
pages/_template/app/form/link-register.vue

@@ -0,0 +1,236 @@
+<template>
+  <div class="page">
+    <div class="page-content link-register flex justify-center items-center">
+      <div class="link-register-section flex justify-center items-center">
+        <div class="content">
+          <div class="logo"><img :src="supplierInfo.logo" alt="" /></div>
+          <div class="message">
+            完成账号注册与设备认证信息后,将获得<span>ROSS</span>授权牌匾制作及寄送
+          </div>
+          <div class="control">
+            <div class="button" @click="toRegister">点击进入</div>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <SimpleDialog
+      v-model="active"
+      @confirm="onConfirm"
+      :cancel="false"
+      description="抱歉,该手机号已注册,您可以登录后再来进行正品授权申请!"
+      :center="true"
+    />
+  </div>
+</template>
+
+<script>
+import { mapGetters } from 'vuex'
+export default {
+  layout: 'app',
+  data() {
+    return {
+      authId: '',
+      clubUser: null,
+      active: false,
+    }
+  },
+  computed: {
+    ...mapGetters([
+      'supplierInfo',
+      'authUserId',
+      'routePrefix',
+      'accessToken',
+      'userInfo',
+    ]),
+  },
+
+  created() {
+    this.authId = this.$route.query.authId
+    if(this.accessToken) this.checkouMobileBindClub()
+  },
+
+  methods: {
+    onConfirm() {
+      this.$router.push(`${this.routePrefix}`)
+    },
+
+    // 判断用户手机号是否绑定机构
+    async checkouMobileBindClub() {
+      try {
+        const res = await this.$http.api.fetchClubAuthInfo({
+          authUserId: this.authUserId,
+          mobile: this.userInfo.mobile,
+        })
+        this.clubUser = res.data.clubUser
+      } catch (error) {
+        console.log(error)
+      }
+    },
+
+    toRegister() {
+      //  已登录
+      // 	  用户未绑定机构
+      // 		  填写设备信息提交认证即可
+      // 	  用户已绑定机构(提示:该用户已绑定机构)
+      //  未登录
+      // 	  填写用户信息
+      // 		  手机号已绑定机构(提示:该手机号已绑定机构)
+      // 		  手机号未绑定机构
+      // 			  下一步:填写设备信息提交认证即可
+      const link = `${this.routePrefix}/form/club-register?type=link&authId=${this.authId}`
+      if (this.accessToken) {
+        if (this.clubUser) {
+          this.active = true
+        } else {
+          this.$router.push(link)
+        }
+      } else {
+        this.$router.push(link)
+      }
+    },
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+@media screen and (min-width: 768px) {
+  .page-content {
+    position: fixed;
+    top: 0;
+    left: 0;
+    z-index: 10000;
+    width: 100vw;
+    height: 100vh;
+    background: url(https://static.caimei365.com/www/authentic/pc/link-register-bg.png)
+      no-repeat center;
+
+    .link-register-section {
+      width: 1200px;
+      height: 530px;
+      background: url(https://static.caimei365.com/www/authentic/pc/link-register-section-bg.png)
+        no-repeat center;
+      .content {
+        width: 1030px;
+        height: 400px;
+        background: #fff;
+        background-image: url(https://static.caimei365.com/www/authentic/pc/link-register-icon.png);
+        background-repeat: no-repeat;
+        background-position: 580px center;
+        box-sizing: border-box;
+        padding-left: 70px;
+
+        .logo {
+          height: 40px;
+          width: auto;
+          margin-top: 48px;
+
+          img {
+            display: block;
+            height: 40px;
+          }
+        }
+
+        .message {
+          width: 360px;
+          font-size: 20px;
+          line-height: 36px;
+          color: #282828;
+          margin: 40px 0 76px;
+
+          span {
+            font-weight: bold;
+          }
+        }
+
+        .control {
+          .button {
+            width: 295px;
+            height: 50px;
+            background: #409eff;
+            border-radius: 4px;
+            text-align: center;
+            font-size: 18px;
+            line-height: 50px;
+            color: #fff;
+            cursor: pointer;
+          }
+        }
+      }
+    }
+  }
+}
+
+@media screen and (max-width: 768px) {
+  .page-content {
+    position: fixed;
+    top: 0;
+    left: 0;
+    z-index: 10000;
+    width: 100vw;
+    height: 100vh;
+    background: url(https://static.caimei365.com/www/authentic/h5/link-register-bg.png)
+      no-repeat center;
+
+    .link-register-section {
+      width: 100vw;
+      height: 119.5vw;
+      background: url(https://static.caimei365.com/www/authentic/h5/link-register-section-bg.png)
+        no-repeat center;
+      .content {
+        width: 88.6vw;
+        height: 106.6vw;
+        background: #fff;
+        background-image: url(https://static.caimei365.com/www/authentic/h5/link-register-icon.png);
+        background-repeat: no-repeat;
+        background-position: center 32vw;
+        background-size: 62vw auto;
+        box-sizing: border-box;
+        padding-left: 8vw;
+        position: relative;
+
+        .logo {
+          height: 8vw;
+          width: auto;
+          margin-top: 6.4vw;
+
+          img {
+            display: block;
+            height: 8vw;
+          }
+        }
+
+        .message {
+          width: 72vw;
+          font-size: 4vw;
+          line-height: 7.2vw;
+          color: #282828;
+          margin-top: 4vw;
+
+          span {
+            font-weight: bold;
+          }
+        }
+
+        .control {
+          position: absolute;
+          bottom: 7.2vw;
+          left: 50%;
+          transform: translateX(-50%);
+          .button {
+            width: 62vw;
+            height: 8.8vw;
+            background: #409eff;
+            border-radius: 0.4vw;
+            text-align: center;
+            font-size: 3.6vw;
+            line-height: 8.8vw;
+            color: #fff;
+            cursor: pointer;
+          }
+        }
+      }
+    }
+  }
+}
+</style>

+ 7 - 2
pages/_template/app/record/message.vue

@@ -16,11 +16,16 @@ import { mapGetters } from 'vuex'
 export default {
   layout: 'app',
   computed: {
-    ...mapGetters(['supplierInfo', 'authUserId', 'routePrefix']),
+    ...mapGetters(['supplierInfo', 'authUserId', 'routePrefix', 'accessToken']),
   },
   methods: {
     toClubRecord() {
-      this.$router.push(`${this.routePrefix}/record/club/detail`)
+      if(this.accessToken){
+        this.$router.push(`${this.routePrefix}/record/club/detail`)
+      }else{
+        this.$toast('请登录后查看')
+        this.$router.push(this.routePrefix)
+      }
     },
   },
 }