zhangwei
2024-09-06 b172667f354f7f00fe14809e66cbf12362fbc646
src/pages/enterprise/enterprise.vue
@@ -5,7 +5,7 @@
            <up-form-item label="营业执照" prop="businessLicense" required ref="item1">
               <fui-upload immediate :url="`${apiBaseUrl}/api/UpFile/UpBizLicense`" ref="uploadB" max='1'
                  background='#fff' @success="success" @error="error" @complete="complete" width="300"
                  height="150">
                  :sizeType='sizeType' height="150">
                  <image
                     :src="enterpriseInfo.businessLicense?enterpriseInfo.businessLicense:'/static/enterprise.png'"
                     mode="widthFix" style="width: 300rpx;height: 150rpx;"></image>
@@ -59,6 +59,7 @@
      onShow,
      onReady
   } from "@dcloudio/uni-app";
   let sizeType = ['compressed']
   let rules = {
      businessLicense: {
         required: true,
@@ -114,7 +115,24 @@
      $db
   } = getCurrentInstance().appContext.config.globalProperties
   onLoad(() => {
      let data = JSON.parse($db.get('userInfo')).userCompany
      const userToken = $db.get("userToken");
      if (!userToken) {
         uni.showToast({
            title: '请先登录!',
            icon: 'none',
            duration: 1000,
            complete: function() {
               setTimeout(function() {
                     uni.hideToast();
                     uni.navigateTo({
                        url: '/pages/login/index'
                     });
                  },
                  1000);
            }
         });
      }
      let data = $db.get('userInfo') ? JSON.parse($db.get('userInfo')).userCompany : null
      if (data) {
         enterpriseInfo.businessLicense = data.businessLicense
         enterpriseInfo.suppliername = data.suppliername //企业名称