wxd hai 8 meses
pai
achega
23d3881bfd

+ 9 - 0
api/personRegistered.js

@@ -9,3 +9,12 @@ export function businessLicenseIdentification(params) {
     params,
   });
 }
+
+//获取地区树形结构
+export function getRegiong(parmas) {
+  return request({
+    url: "/api/register/getRegiongls",
+    method: "get",
+    parmas,
+  });
+}

+ 279 - 0
components/companiesRegistered/authorizer.vue

@@ -0,0 +1,279 @@
+<!-- @format -->
+
+<template>
+  <view class="container">
+    <view style="color: #3c9cff" class="informationTitle"
+      >填写被授权人信息</view
+    >
+
+    <view class="cardImage">
+      <view class="updateContent">
+        <view style="margin: 0 auto">
+          <u-upload
+            name="1"
+            :fileList="fileList1"
+            @afterRead="afterRead"
+            @delete="deletePic"
+            :maxCount="1"
+            width="280"
+            height="180"
+          >
+            <view class="uploadTipcContent">
+              <view>
+                <view style="display: flex; justify-content: center">
+                  <u-icon
+                    name="arrow-upward"
+                    color="#2979ff"
+                    size="28"
+                  ></u-icon>
+                </view>
+                <u-button
+                  :customStyle="{ color: '#3c9cff', fontSize: '26rpx' }"
+                  type="text"
+                  size="small"
+                  >点击上传</u-button
+                >
+              </view>
+              <view class="topic"> 请上传被授权人身份证正面照片 </view>
+            </view>
+          </u-upload>
+        </view>
+      </view>
+
+      <view class="updateContent">
+        <view style="margin: 0 auto">
+          <u-upload
+            name="2"
+            :fileList="fileList2"
+            @afterRead="afterRead"
+            @delete="deletePic"
+            :maxCount="1"
+            width="280"
+            height="180"
+          >
+            <view class="uploadTipcContent">
+              <view>
+                <view style="display: flex; justify-content: center">
+                  <u-icon
+                    name="arrow-upward"
+                    color="#2979ff"
+                    size="28"
+                  ></u-icon>
+                </view>
+                <u-button
+                  :customStyle="{ color: '#3c9cff', fontSize: '26rpx' }"
+                  type="text"
+                  size="small"
+                  >点击上传</u-button
+                >
+              </view>
+              <view class="topic"> 请上传被授权人身份证背面照片 </view>
+            </view>
+          </u-upload>
+        </view>
+      </view>
+    </view>
+
+    <view class="informationContent">
+      <view class="contentItems">
+        <u-form>
+          <view class="content">
+            <view class="title">被委托人身份证号码 </view>
+            <view class="message">{{ formdData.companiesOrcResult.type }}</view>
+          </view>
+          <view class="content">
+            <view class="title">被委托人姓名 </view>
+            <view class="message">{{
+              formdData.companiesOrcResult.regNum
+            }}</view>
+          </view>
+          <view class="content">
+            <view class="title">识别结果</view>
+            <view class="message">{{ formdData.companiesOrcResult.name }}</view>
+          </view>
+
+          <view class="content">
+            <view class="title">用户名</view>
+            <view class="message">{{
+              formdData.companiesOrcResult.address
+            }}</view>
+          </view>
+          <view class="content">
+            <view class="title">单位联系电话</view>
+            <view class="message">{{
+              formdData.companiesOrcResult.person
+            }}</view>
+          </view>
+
+          <view class="content">
+            <view class="title">联系人手机号</view>
+            <view class="message">{{
+              formdData.companiesOrcResult.postalAddress
+            }}</view>
+          </view>
+          <view class="content">
+            <view class="title">短信验证码</view>
+            <view class="message">{{
+              formdData.companiesOrcResult.postalAddress
+            }}</view>
+          </view>
+        </u-form>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+import { businessLicenseIdentification } from "@/api/personRegistered";
+
+export default {
+  data() {
+    return {
+      fileList1: [],
+      fileList2: [],
+    };
+  },
+  props: {
+    formdData: {
+      type: Object,
+      default: () => ({}),
+    },
+  },
+
+  methods: {
+    //处理身份证ocr识别
+    async handleCardOrc() {
+      uni.showLoading({
+        title: "智能识别中...",
+      });
+      try {
+        let {
+          data: { orcResult },
+        } = await businessLicenseIdentification({});
+        setTimeout(() => {
+          uni.hideLoading();
+        }, 2000);
+      } catch (error) {
+        uni.showLoading({
+          title: "识别错误",
+        });
+        setTimeout(() => {
+          uni.hideLoading();
+        }, 2000);
+      } finally {
+      }
+    },
+    deletePic(event) {
+      this[`fileList${event.name}`].splice(event.index, 1);
+    },
+    // 新增图片
+    async afterRead(event) {
+      // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
+      let lists = [].concat(event.file);
+      let fileListLen = this[`fileList${event.name}`].length;
+      lists.map((item) => {
+        this[`fileList${event.name}`].push({
+          ...item,
+          status: "uploading",
+          message: "上传中",
+        });
+      });
+      for (let i = 0; i < lists.length; i++) {
+        const result = await this.uploadFilePromise(lists[i].url);
+        let item = this[`fileList${event.name}`][fileListLen];
+        this[`fileList${event.name}`].splice(
+          fileListLen,
+          1,
+          Object.assign(item, {
+            status: "success",
+            message: "",
+            url: JSON.parse(result.data).fileName,
+          })
+        );
+        fileListLen++;
+      }
+
+      this.fileList1.length && this.fileList2.length && this.handleCardOrc();
+    },
+
+    //上传
+    uploadFilePromise(url) {
+      return new Promise((resolve, reject) => {
+        let a = uni.uploadFile({
+          url: `${this.$baseUrl}/api/common/upload`, // 仅为示例,非真实的接口地址
+          filePath: url,
+          name: "file",
+          success: (res) => {
+            setTimeout(() => {
+              resolve(res);
+            }, 1000);
+          },
+        });
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss">
+.topic {
+  color: #909399;
+  font-size: 24rpx;
+  width: 400rpx;
+  margin: 20rpx auto 0;
+  font-family: "宋体";
+}
+.uploadTipcContent {
+  width: 555rpx;
+  height: 260rpx;
+  padding: 30rpx;
+  border: 1px dotted#909399;
+}
+.updateContent {
+  display: flex;
+  background: #fff;
+  padding: 30rpx;
+}
+.informationTitle {
+  margin-bottom: 30rpx;
+  font-size: 30;
+}
+
+.contentItems {
+  width: 100%;
+  border-radius: 6px;
+  background: #fff;
+  margin: 0rpx auto 30rpx;
+  padding: 20rpx 30rpx 20rpx;
+
+  .content {
+    border-bottom: 1px solid rgb(242, 242, 242);
+    padding: 30rpx 0;
+    display: flex;
+    justify-content: space-between;
+  }
+
+  .content:last-child {
+    border-bottom: none;
+  }
+
+  .title {
+    font-size: 30rpx;
+    color: black;
+    letter-spacing: 3rpx;
+  }
+
+  .message {
+    text-align: right;
+    width: 380rpx;
+    font-size: 30rpx;
+    color: rgb(146, 146, 146);
+    white-space: nowrap;
+    /* 禁止文本换行 */
+    overflow: hidden;
+    /* 隐藏超出容器的文本 */
+    text-overflow: ellipsis;
+    /* 使用省略号表示被截断的文本 */
+  }
+}
+</style>

+ 193 - 0
components/companiesRegistered/companiesInformation.vue

@@ -0,0 +1,193 @@
+<!-- @format -->
+
+<template>
+  <view class="container">
+    <view style="color: #3c9cff" class="informationTitle">企业信息</view>
+    <view class="informationContent">
+      <view class="contentItems">
+        <u-form>
+          <view class="content">
+            <view class="title">单位类别 </view>
+            <view class="message">{{ formdData.companiesOrcResult.type }}</view>
+          </view>
+          <view class="content">
+            <view class="title">统一社会信用代码 </view>
+            <view class="message">{{
+              formdData.companiesOrcResult.regNum
+            }}</view>
+          </view>
+          <view class="content">
+            <view class="title">单位名称</view>
+            <view class="message">{{ formdData.companiesOrcResult.name }}</view>
+          </view>
+          <!-- <view class="content">
+          <view class="title">登录用户名</view>
+          <view class="message">{{ formdData.companiesOrcResult.regNum }}</view>
+        </view> -->
+          <view
+            class="content"
+            style="
+              width: 100%;
+              display: flex;
+              align-items: center;
+              justify-content: space-between;
+            "
+          >
+            <view class="title">单位所属区域 </view>
+            <view>
+              <vvSelectArea
+                :list="areas"
+                v-model="formdData.companiesOrcResult.region"
+                placeholder="请选择所在区域"
+              ></vvSelectArea>
+            </view>
+          </view>
+
+          <view class="content">
+            <view class="title">单位注册地址</view>
+            <view class="message">{{
+              formdData.companiesOrcResult.address
+            }}</view>
+          </view>
+          <view class="content">
+            <view class="title">法人代表/负责人</view>
+            <view class="message">{{
+              formdData.companiesOrcResult.person
+            }}</view>
+          </view>
+          <view
+            class="content"
+            style="
+              display: flex;
+              align-items: center;
+              justify-content: space-between;
+            "
+          >
+            <view class="title">单位地理位置</view>
+            <u-icon
+              v-if="!formdData.companiesOrcResult.location"
+              @click="handleGetMap"
+              name="map-fill"
+              color="#2979ff"
+              size="28"
+            ></u-icon>
+            <view v-else @click="handleGetMap" class="message">
+              {{ formdData.companiesOrcResult.location }}
+            </view>
+          </view>
+          <view class="content">
+            <view class="title">单位通讯地址</view>
+            <view class="message">{{
+              formdData.companiesOrcResult.postalAddress
+            }}</view>
+          </view>
+        </u-form>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+import vvSelectArea from "@/components/vv-select-area/vv-select-area";
+import { getRegiong } from "@/api/personRegistered";
+export default {
+  components: {
+    vvSelectArea,
+  },
+  async created() {
+    try {
+      let { data } = await getRegiong();
+      this.areas = data;
+    } catch (error) {}
+  },
+  data() {
+    return {
+      show: true,
+      areas: [], // 地址list
+    };
+  },
+  props: {
+    formdData: {
+      type: Object,
+      default: () => ({}),
+    },
+  },
+
+  methods: {
+    //获取位置
+    handleGetMap() {
+      uni.authorize({
+        scope: "scope.userLocation",
+        success: (res) => {
+          uni.chooseLocation({
+            success: (res) => {
+              this.$emit(
+                "update:formdData",
+                Object.assign({
+                  ...this.formdData,
+                  companiesOrcResult: {
+                    ...this.formdData.companiesOrcResult,
+                    location: `${res.latitude},${res.longitude}`,
+                    postalAddress: res.address,
+                  },
+                })
+              );
+
+              // console.log("位置名称:" + res.name);
+              // console.log("详细地址:" + res.address);
+              // console.log("纬度:" + res.latitude);
+              // console.log("经度:" + res.longitude);
+            },
+          });
+        },
+        fail(err) {},
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss">
+.informationTitle {
+  margin-bottom: 30rpx;
+  font-size: 30;
+}
+
+.contentItems {
+  width: 100%;
+  border-radius: 6px;
+  background: #fff;
+  margin: 0rpx auto 30rpx;
+  padding: 20rpx 30rpx 20rpx;
+
+  .content {
+    border-bottom: 1px solid rgb(242, 242, 242);
+    padding: 30rpx 0;
+    display: flex;
+    justify-content: space-between;
+  }
+
+  .content:last-child {
+    border-bottom: none;
+  }
+
+  .title {
+    font-size: 30rpx;
+    color: black;
+    letter-spacing: 3rpx;
+  }
+
+  .message {
+    text-align: right;
+    width: 380rpx;
+    font-size: 30rpx;
+    color: rgb(146, 146, 146);
+    white-space: nowrap;
+    /* 禁止文本换行 */
+    overflow: hidden;
+    /* 隐藏超出容器的文本 */
+    text-overflow: ellipsis;
+    /* 使用省略号表示被截断的文本 */
+  }
+}
+</style>

+ 2 - 2
components/companiesRegistered/uploadLicense.vue

@@ -10,8 +10,8 @@
           @afterRead="afterRead"
           @delete="deletePic"
           :maxCount="1"
-          width="250"
-          height="150"
+          width="280"
+          height="180"
         >
           <view class="uploadTipcContent">
             <view>

+ 233 - 0
components/vv-select-area/vv-select-area.vue

@@ -0,0 +1,233 @@
+<!-- @format -->
+
+<template>
+  <!-- v-model -->
+
+  <!-- 使用组件 -->
+  <!-- <vvSelect placeholder="请选择所属类别" :list="categorys" label="name" valueKey="id" @change="pickerChange"></vvSelect> -->
+  <picker
+    mode="multiSelector"
+    @change="bindMultiPickerChange"
+    @columnchange="bindMultiPickerColumnChange"
+    range-key="name"
+    :value="multiIndex"
+    :disabled="disabled"
+    :range="multiArray"
+  >
+    <view class="vv-input__body text-right">
+      <view class="vv-input__control">
+        <text v-if="checkLabels" :class="{ disabled: disabled }">{{
+          checkLabels
+        }}</text>
+        <text class="vv-input__placeholder" v-else>{{ placeholder }}</text>
+      </view>
+
+      <!-- <uni-icons type="arrowright" size="14" color="#808080"></uni-icons> -->
+    </view>
+  </picker>
+</template>
+
+<script>
+/**
+ * vv-select 选择
+ * @description picker再封装
+ * @property {String} valueKey 绑定的key
+ * @property {String} label 绑定的label
+ * @property {Array} list 数据
+ * @property {Array} level 层级 默认3级 即:省-市-区
+ * @property {Boolean} disabled 是否禁用
+ * @event {Function} change
+ */
+
+export default {
+  name: "vv-select-area",
+  props: {
+    value: {
+      type: [Array],
+    },
+    placeholder: {
+      type: String,
+      default: "请选择",
+    },
+    list: {
+      type: [Array],
+    },
+    level: {
+      type: Number,
+      default: 3,
+    },
+    disabled: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  data() {
+    return {
+      city: [],
+      multiArray: [],
+      multiIndex: [],
+      checkLabels: "",
+      checkValues: [],
+    };
+  },
+  watch: {
+    value: {
+      handler: function (newVal) {
+        if (this.list.length > 0 && this.value.length > 0) {
+          this.init();
+        }
+      },
+      immediate: true,
+    },
+    list: {
+      handler: function (newVal) {
+        if (this.list.length > 0) {
+          this.init();
+        }
+      },
+      immediate: true,
+    },
+  },
+  created() {},
+  methods: {
+    init: function () {
+      this.city = [...this.list];
+      this.multiArray[0] = this.city;
+      this.setMultiData(0, 0); // 默认值
+      if (this.value && this.value.length > 0) {
+        // 有初始值
+        this.setCheck(this.value);
+      }
+    },
+    setCheck: function (codes) {
+      if (codes.length == 0) return false;
+      let indexs = [];
+      let _labes = [];
+      for (let i = 0, l = codes.length; i < l; i++) {
+        let index = this.multiArray[i].findIndex((item) => {
+          return item.id == codes[i];
+        });
+        indexs.push(index);
+        let item = this.multiArray[i].find((item) => {
+          return item.id == codes[i];
+        });
+        _labes.push(item.name);
+        this.setMultiData(i, index);
+      }
+      this.multiIndex = indexs;
+      this.checkValues = codes;
+      this.checkLabels = _labes.join("-");
+    },
+    setMultiData: function (column, index) {
+      var data = {
+        multiArray: this.multiArray,
+        multiIndex: this.multiIndex,
+      };
+      data.multiIndex[column] = index; //
+
+      switch (column) {
+        case 0: //拖动第1列
+          if (this.city[index].children) {
+            data.multiArray[1] = this.city[index].children;
+            if (data.multiArray[1][0] && data.multiArray[1][0].children) {
+              data.multiArray[2] = data.multiArray[1][0].children;
+
+              if (this.level > 3) {
+                if (data.multiArray[2][0] && data.multiArray[2][0].children) {
+                  data.multiArray[3] = data.multiArray[2][0].children;
+                } else {
+                  data.multiArray[3] = [];
+                }
+              }
+            } else {
+              data.multiArray[2] = [];
+              if (this.level > 3) {
+                data.multiArray[3] = [];
+              }
+            }
+          } else {
+            data.multiArray[1] = [];
+            data.multiArray[2] = [];
+            if (this.level > 3) {
+              data.multiArray[3] = [];
+            }
+          }
+
+          this.multiIndex.splice(1, 1, 0);
+          this.multiIndex.splice(2, 1, 0);
+          if (this.level > 3) {
+            this.multiIndex.splice(3, 1, 0);
+          }
+          break;
+        case 1: //拖动第2列
+          if (data.multiArray[1][index] && data.multiArray[1][index].children) {
+            data.multiArray[2] = data.multiArray[1][index].children;
+            if (this.level > 3) {
+              if (data.multiArray[2][0] && data.multiArray[2][0].children) {
+                data.multiArray[3] = data.multiArray[2][0].children;
+              } else {
+                data.multiArray[3] = [];
+              }
+            }
+          } else {
+            data.multiArray[2] = [];
+            if (this.level > 3) {
+              data.multiArray[3] = [];
+            }
+          }
+          this.multiIndex.splice(2, 1, 0);
+          if (this.level > 3) {
+            this.multiIndex.splice(3, 1, 0);
+          }
+          break;
+        case 2: //拖动第3列
+          if (this.level < 4) {
+            break;
+          }
+          if (data.multiArray[2][index] && data.multiArray[2][index].children) {
+            data.multiArray[3] = data.multiArray[2][index].children;
+          } else {
+            data.multiArray[3] = [];
+          }
+          this.multiIndex.splice(3, 1, 0);
+          break;
+      }
+
+      this.multiArray = data.multiArray;
+      this.multiIndex = data.multiIndex;
+      this.$forceUpdate();
+    },
+
+    bindMultiPickerColumnChange: function (e) {
+      this.setMultiData(e.detail.column, e.detail.value);
+    },
+    bindMultiPickerChange: function (e) {
+      let _labes = [];
+      let _values = [];
+      for (let i = 0, l = this.multiArray.length; i < l; i++) {
+        let item = this.multiArray[i];
+        let index = this.multiIndex[i];
+        if (item.length === 0) {
+          break;
+        }
+        _labes.push(item[index].name);
+        _values.push(item[index].id);
+      }
+      console.log(_labes, _values);
+      // console.log(
+      //   this.multiArray[0][e.detail.value[0]],
+      //   this.multiArray[1][e.detail.value[1]]
+      // ); // {value: "431000", label: "郴州市", level: 2}
+      // this.multiIndex = e.detail.value;
+      // this.$apply();
+      this.checkLabels = _labes.join("-");
+      this.checkValues = _values;
+      // 返回这个值到父级
+      this.$emit("change", _values);
+      this.$emit("input", _values);
+      this.$emit("on-change", _values);
+    },
+  },
+};
+</script>
+<style lang="scss" scoped></style>

+ 129 - 0
components/vv-select/vv-select.vue

@@ -0,0 +1,129 @@
+<template>
+	<!-- v-model -->
+	
+	<!-- 使用组件 -->
+	<!-- <vvSelect placeholder="请选择所属类别" :list="categorys" label="name" valueKey="id" @change="pickerChange"></vvSelect> -->
+	
+	<picker :ref="refName" @change="bindPickerChange"
+		:value="index"
+		:range="list"
+    :disabled="disabled"
+		:range-key="label">
+		<slot />
+		<view v-if="isText" class="text-ellipsis">{{checkLabel ? checkLabel : placeholder}}</view>
+		<view v-else class="vv-input__body text-right">
+			<view class="vv-input__control">
+				<text v-if="checkLabel" :class="{'disabled': disabled}">{{checkLabel}}</text>
+				<text class="vv-input__placeholder" v-else>{{placeholder}}</text>
+			</view>
+			
+			<!-- <uni-icons type="arrowright" size="14" color="#808080"></uni-icons> -->
+		</view>
+	</picker>
+</template>
+
+<script>
+
+	/**
+	 * vv-select 选择
+	 * @description picker再封装
+	 * @property {String} valueKey 绑定的key
+	 * @property {String} label 绑定的label
+	 * @property {Array} list 数据
+	 * @property {Boolean} disabled 是否禁用
+	 * @event {Function} change 
+	 */
+
+	export default {
+		name: 'vv-select',
+		props: {
+			refName: {
+				type: String,
+				default: 'vvSelect'
+			},
+			value: {
+				type: [String,Number]
+			},
+			placeholder: {
+				type: String,
+				default: '请选择'
+			},
+			valueKey: {
+				type: String,
+				default: 'id'
+			},
+			label: {
+				type: String,
+				default: 'name'
+			},
+			list: {
+				type: Array,
+				default () {
+					return []
+				}
+			},
+			isText: {
+				type: Boolean,
+				default: false
+			},
+      disabled: {
+				type: Boolean,
+				default: false
+			},
+		},
+		data() {
+			return {
+				index: 0,
+				checkLabel: ''
+			}
+		},
+		watch: {
+			value: {
+				handler: function(newVal) {
+					if(this.value) {
+						this.checkItemByKey(this.value)
+					} else {
+						this.$emit('change','')
+					}
+					
+				},
+				// immediate: true,
+				// deep:true//对象内部的属性监听,也叫深度监听
+			}
+		},
+		created() {
+			// 首次选中
+		},
+		methods: {
+			checkItemByKey: function(key) {
+				// var index = this.list.findIndex((item,i)=> {return item[this.valueKey] == key});
+				// // 首次找索引
+				// index >= 0 && this.checkItemByIndex(index);
+				
+				var checkItem = this.list.find((item,i)=> {return item[this.valueKey] == key});
+				console.log(checkItem)
+				if(!checkItem) return;
+				this.checkLabel = checkItem[this.label]; // 值
+				this.$emit('change',checkItem[this.valueKey])
+				
+			},
+			checkItemByIndex: function(index) {
+				this.index = index;
+				var checkItem = this.list.find((item,i)=> {return i == this.index});
+				this.checkLabel = checkItem[this.label]; // 值
+				// 返回这个值到父级
+				// this.$emit('change',checkItem[this.valueKey])
+				this.$emit('input',checkItem[this.valueKey])
+				// this.$emit('on-change',checkItem[this.valueKey])
+			},
+			bindPickerChange: function(e) {
+				this.checkItemByIndex(e.target.value);
+			}
+		}
+	}
+</script>
+<style lang="scss" scoped>
+	// .disabled {
+ //    color: #808080;
+ //  }
+</style>

+ 6 - 1
manifest.json

@@ -51,7 +51,12 @@
 		"optimization": {
 			"subPackages": true
 		},
-		"usingComponents": true
+		"usingComponents": true,
+		"permission": {
+			"scope.userLocation": {
+				"desc": "您的位置信息将用于小程序位置接口的效果展示"
+			}
+		}
 	},
 	"vueVersion": "2",
 	"h5": {

+ 68 - 7
pages/companiesRegistered/index.vue

@@ -16,6 +16,16 @@
         v-if="componentsKey[current] == 'uploadLicense'"
         :is="'uploadLicense'"
       ></component>
+      <component
+        :formdData.sync="formdData"
+        v-if="componentsKey[current] == 'companiesInformation'"
+        :is="'companiesInformation'"
+      ></component>
+      <component
+        :formdData.sync="formdData"
+        v-if="componentsKey[current] == 'authorizer'"
+        :is="'authorizer'"
+      ></component>
     </view>
     <view class="btn">
       <u-button
@@ -40,9 +50,14 @@
 <script>
 import { businessLicenseIdentification } from "@/api/personRegistered";
 import uploadLicense from "@/components/companiesRegistered/uploadLicense";
+import companiesInformation from "@/components/companiesRegistered/companiesInformation";
+import authorizer from "@/components/companiesRegistered/authorizer";
+
 export default {
   components: {
     uploadLicense,
+    companiesInformation,
+    authorizer,
   },
   data() {
     return {
@@ -50,31 +65,77 @@ export default {
         //企业营业照
         imageUrl: null,
         //营业识别数据
-        companiesData: {},
+        companiesOrcResult: {
+          region: "", //单位区域
+          location: "", //地理位置
+          postalAddress: "", //详细地址
+        },
       },
       componentsKey: {
         0: "uploadLicense",
+        1: "companiesInformation",
+        2: "authorizer",
       },
-      current: 0,
+      current: 2,
     };
   },
   methods: {
-    //下一步
-    async handleNext() {
+    //ocr识别
+    async handleOcr() {
       uni.showLoading({
         title: "智能识别中...",
       });
       try {
-        let res = await businessLicenseIdentification({
+        let {
+          data: { orcResult },
+        } = await businessLicenseIdentification({
           filePath: this.formdData.imageUrl,
         });
+
+        Object.keys(orcResult).forEach((key) => {
+          this.formdData.companiesOrcResult[key] = orcResult[key];
+        });
+
+        setTimeout(() => {
+          uni.hideLoading();
+          this.current++;
+        }, 2000);
       } catch (error) {
+        uni.showLoading({
+          title: "识别错误",
+        });
+        setTimeout(() => {
+          uni.hideLoading();
+        }, 2000);
       } finally {
-        uni.hideLoading();
       }
-
+    },
+    //确认企业信息
+    handleConrim() {
+      // if (
+      //   !this.formdData.companiesOrcResult.region ||
+      //   !this.formdData.companiesOrcResult.location
+      // ) {
+      //   uni.showToast({
+      //     title: "位置区域不能为空",
+      //     //将值设置为 success 或者直接不用写icon这个参数
+      //     icon: "none",
+      //     //显示持续时间为 2秒
+      //     duration: 2000,
+      //   });
+      // } else {
+      //   this.current++;
+      // }
       this.current++;
     },
+    //下一步
+    handleNext() {
+      if (this.componentsKey[this.current] == "uploadLicense") {
+        this.handleOcr();
+      } else if (this.componentsKey[this.current] == "companiesInformation") {
+        this.handleConrim();
+      }
+    },
     //上一步
     handlePre() {
       this.current--;

+ 1 - 0
pages/verification/list.vue

@@ -21,6 +21,7 @@
           style="width: 95%; margin: 30rpx auto"
         ></u-search>
       </view>
+
       <view class="contentItems" @click="handleVerDetails" v-for="item of 2">
         <view class="content">
           <view class="title">申请单编号 </view>

+ 1 - 1
store/modules/user.js

@@ -82,7 +82,7 @@ const user = {
             // }
             // commit("SET_NAME", username);
             // commit("SET_AVATAR", avatar);
-
+            uni.setStorageSync("userInfo", JSON.stringify(user));
             resolve(user);
           })
           .catch((error) => {