Kaynağa Gözat

feat:编辑资料回显资料

jianghaili 7 ay önce
ebeveyn
işleme
892c268e70

+ 25 - 18
my/renzheng/companyDev.vue

@@ -9,17 +9,9 @@
           公司融资状态是公司阶段的重要体现之一,使企业形象更加丰富和全面
         </view>
         <view class="check-box">
-          <view
-            class="check-item"
-            v-for="(item, index) in checkList"
-            :key="index"
-            @click="checkItem(index)"
-          >
-            <view
-              class="check-icon"
-              :class="{ 'check-icon-active': check == index }"
-            >
-            <u-icon name="checkmark" color="#fff" size="28" v-if="check == index"></u-icon>
+          <view class="check-item" v-for="(item, index) in checkList" :key="index" @click="checkItem(item)">
+            <view class="check-icon" :class="{ 'check-icon-active': check == item }">
+              <u-icon name="checkmark" color="#fff" size="28" v-if="check == item"></u-icon>
             </view>
             <view class="check-txt">{{ item }}</view>
           </view>
@@ -46,13 +38,18 @@ export default {
         "不需要融资",
       ],
       check: null,
-	    companyData:{}
+      companyData: {}
     };
   },
   components: {
     navBar,
   },
   onLoad(options) {
+    if (options.update == 'true') {
+      let companyInfo = uni.getStorageSync('companyInfo');
+      this.check=companyInfo.companyDevelop;
+
+    }
     if (options.companyData) {
       this.companyData = JSON.parse(options.companyData);
     }
@@ -61,12 +58,14 @@ export default {
     checkItem(index) {
       this.check = index;
     },
-    goJobPostingSecond(){
-		const companyData = this.companyData
-		companyData.companyDevelop=this.checkList[this.check]
-		console.log(companyData);
-        uni.navigateTo({ url: "/my/renzheng/companyFund?companyData=" +
-          encodeURIComponent(JSON.stringify(companyData))})
+    goJobPostingSecond() {
+      const companyData = this.companyData
+      companyData.companyDevelop = this.check
+      console.log(companyData);
+      uni.navigateTo({
+        url: "/my/renzheng/companyFund?companyData=" +
+          encodeURIComponent(JSON.stringify(companyData))+'&update=true'
+      })
     }
   },
 };
@@ -95,6 +94,7 @@ export default {
       flex-direction: column;
       align-items: center;
       justify-content: center;
+
       .progress-num {
         color: #016bf6;
         font-family: DM Sans;
@@ -103,11 +103,13 @@ export default {
         width: 100%;
         padding-bottom: 20rpx;
         box-sizing: border-box;
+
         text {
           font-size: 48rpx;
           font-weight: 700;
         }
       }
+
       .title {
         color: #333;
         width: 100%;
@@ -128,8 +130,10 @@ export default {
         padding: 20rpx 0;
         box-sizing: border-box;
       }
+
       .check-box {
         width: 100%;
+
         .check-item {
           padding: 24rpx 32rpx;
           box-sizing: border-box;
@@ -139,6 +143,7 @@ export default {
           align-items: center;
           gap: 32rpx;
           margin-bottom: 20rpx;
+
           .check-icon {
             width: 48rpx;
             height: 48rpx;
@@ -148,10 +153,12 @@ export default {
             justify-content: center;
             align-items: center;
           }
+
           .check-icon-active {
             background-color: #016bf6;
             border-color: #016bf6;
           }
+
           .check-txt {
             color: rgba(23, 23, 37, 1);
             font-family: DM Sans;

+ 42 - 30
my/renzheng/companyFund.vue

@@ -7,34 +7,20 @@
         <view class="title">
           <view>公司福利</view>
           <view class="check-num">
-            <text>{{ selectedCount }}</text
-            >/{{ totalCount }}
+            <text>{{ selectedCount }}</text>/{{ totalCount }}
           </view>
         </view>
         <view class="desc"> 选择公司提供的福利信息,以吸引更多求职者 </view>
 
         <!-- 福利分类 -->
-        <view
-          class="welfare-category"
-          v-for="(category, categoryIndex) in welfareList"
-          :key="categoryIndex"
-        >
+        <view class="welfare-category" v-for="(category, categoryIndex) in welfareList" :key="categoryIndex">
           <view class="category-title">{{ category.title }}</view>
           <view class="check-box">
-            <view
-              class="check-item"
-              v-for="(item, index) in category.items"
-              :key="index"
-              @click="checkItem(categoryIndex, index)"
-            >
+            <view class="check-item" v-for="(item, index) in category.items" :key="index"
+              @click="checkItem(categoryIndex, index)">
               <view class="check-txt">{{ item.name }}</view>
               <view class="check-icon" :class="{ 'check-icon-active': item.selected }">
-                <u-icon
-                  name="checkmark"
-                  color="#fff"
-                  size="18"
-                  v-if="item.selected"
-                ></u-icon>
+                <u-icon name="checkmark" color="#fff" size="18" v-if="item.selected"></u-icon>
                 <u-icon name="plus" color="#666" size="28" v-else></u-icon>
               </view>
             </view>
@@ -46,12 +32,8 @@
     <!-- 已选福利 -->
     <view class="check-list" v-if="selectedWelfare.length > 0">
       已选:
-      <view
-        class="check-list-item"
-        v-for="(item, index) in selectedWelfare"
-        :key="index"
-        @click="removeSelected(item.categoryIndex, item.itemIndex)"
-      >
+      <view class="check-list-item" v-for="(item, index) in selectedWelfare" :key="index"
+        @click="removeSelected(item.categoryIndex, item.itemIndex)">
         {{ item.name }}
         <text class="remove-icon">×</text>
       </view>
@@ -109,7 +91,7 @@ export default {
       ],
       selectedCount: 0,
       totalCount: 20,
-	    companyData:{}
+      companyData: {}
     };
   },
   components: {
@@ -137,6 +119,33 @@ export default {
     if (options.companyData) {
       this.companyData = JSON.parse(options.companyData);
     }
+    if (options.update == 'true') {
+      let companyInfo = uni.getStorageSync('companyInfo');
+      // 这里需要把我传过来的值显示出来
+      if (companyInfo && companyInfo.welfare) {
+        // 处理福利字符串
+        let welfareString = companyInfo.welfare;
+
+        // 将中文逗号替换为英文逗号,并去除首尾空格
+        welfareString = welfareString.replace(/,/g, ',').trim();
+
+        // 分割字符串为数组
+        const savedWelfareList = welfareString.split(',').map(item => item.trim()).filter(item => item);
+        console.log('需要选中的福利:', savedWelfareList);
+
+        // 直接遍历福利列表,设置选中状态
+        this.welfareList.forEach(category => {
+          category.items.forEach(item => {
+            // 如果当前福利名称在保存的列表中,则设置为选中
+            item.selected = savedWelfareList.includes(item.name);
+          });
+        });
+
+        // 更新选中数量
+        this.updateSelectedCount();
+      }
+
+    }
   },
   methods: {
     // 选择/取消选择福利项目
@@ -173,18 +182,18 @@ export default {
         });
         return;
       }
-	  const companyData = this.companyData
+      const companyData = this.companyData
       // 获取选中的福利列表
       const selectedBenefits = this.selectedWelfare.map((item) => item.name);
       // console.log("选中的福利:", selectedBenefits);
-	  companyData.welfare=selectedBenefits.join(',')
+      companyData.welfare = selectedBenefits.join(',')
       // 跳转到下一页,传递选中的福利数据
       uni.navigateTo({
         url:
           "/my/renzheng/peopleDev?companyData=" +
-          encodeURIComponent(JSON.stringify(companyData)),
+          encodeURIComponent(JSON.stringify(companyData))+'&update=true',
       });
-	  console.log(companyData);
+      console.log(companyData);
     },
   },
   mounted() {
@@ -230,6 +239,7 @@ export default {
         width: 100%;
         padding-bottom: 20rpx;
         box-sizing: border-box;
+
         text {
           font-size: 48rpx;
           font-weight: 700;
@@ -253,6 +263,7 @@ export default {
           font-weight: 700;
           line-height: 60rpx;
           color: #999;
+
           text {
             color: #016bf6;
           }
@@ -301,6 +312,7 @@ export default {
             align-items: center;
             justify-content: space-between;
             gap: 20rpx;
+
             .check-icon {
               width: 32rpx;
               height: 32rpx;

+ 110 - 79
my/renzheng/companyImg.vue

@@ -81,22 +81,82 @@ export default {
       maxCount: 20, // 最大上传数量
       uploading: false, // 是否正在上传
       uploadProgress: 0, // 上传进度
-      companyData: {}
+      companyData: {},
+      isUpdateMode: false // 新增:标记是否为编辑模式
     };
   },
   components: {
     navBar,
   },
   onLoad(options) {
+    // 判断是否为编辑模式
+    if (options.update == 'true') {
+      this.isUpdateMode = true;
+      this.loadSavedPhotos();
+    }
+    
     if (options.companyData) {
       this.companyData = JSON.parse(options.companyData);
+      // 如果companyData中有照片数据,也显示出来
+      if (this.companyData.photos) {
+        this.loadCompanyDataPhotos();
+      }
     }
   },
   methods: {
+    // 加载已保存的照片数据(从缓存)
+    loadSavedPhotos() {
+      try {
+        let companyInfo = uni.getStorageSync('companyInfo');
+        console.log('从缓存获取的公司信息:', companyInfo);
+        
+        if (companyInfo?.photos) {
+          // 处理字符串并转换为对象数组
+          this.parsePhotoString(companyInfo.photos);
+          console.log('已加载保存的照片:', this.imageList);
+        } else {
+          console.log('缓存中没有照片数据');
+        }
+      } catch (error) {
+        console.error('加载照片数据失败:', error);
+      }
+    },
+    
+    // 加载companyData中的照片数据
+    loadCompanyDataPhotos() {
+      this.parsePhotoString(this.companyData.photos);
+    },
+    
+    // 解析照片字符串为对象数组
+    parsePhotoString(photoString) {
+      if (!photoString) return;
+      
+      // 处理字符串:替换中文逗号,分割,过滤空值
+      const photoUrls = photoString
+        .replace(/,/g, ',')
+        .split(',')
+        .map(url => url.trim())
+        .filter(url => url);
+      
+      // 转换为对象数组格式
+      this.imageList = photoUrls.map(url => ({
+        url: url
+      }));
+    },
+    
     // 选择图片
     async chooseImage() {
       const that = this;
       const remainingCount = this.maxCount - this.imageList.length;
+      
+      if (remainingCount <= 0) {
+        uni.showToast({
+          title: `最多只能上传${this.maxCount}张图片`,
+          icon: 'none'
+        });
+        return;
+      }
+      
       // 1. 检查权限状态
       const hasPermission = await this.$queue.checkPermission(
         'camera',
@@ -135,44 +195,17 @@ export default {
       that.uploading = true;
       that.uploadProgress = 0;
 
-      // 模拟上传进度
-      // const progressTimer = setInterval(() => {
-      //   that.uploadProgress += 10;
-      //   if (that.uploadProgress >= 90) {
-      //     clearInterval(progressTimer);
-      //   }
-      // }, 100);
-
-      // 模拟批量上传成功
-      // setTimeout(() => {
-      //   clearInterval(progressTimer);
-      //   that.uploadProgress = 100;
-
-      //   // 将新图片添加到列表
-      //   const newImages = filePaths.map(filePath => ({
-      //     url: filePath,
-      //     // 实际开发中这里应该是服务器返回的URL
-      //   }));
-
-      //   that.imageList = [...that.imageList, ...newImages];
-
-      //   setTimeout(() => {
-      //     that.uploading = false;
-      //     uni.showToast({
-      //       title: `成功上传${newImages.length}张图片`,
-      //       icon: "success",
-      //     });
-      //   }, 500);
-      // }, 1500);
-
-      // 实际开发中应该使用下面的代码:
       let uploadedCount = 0;
       const totalCount = filePaths.length;
+      const newImages = [];
 
       filePaths.forEach((filePath, index) => {
         this.$queue.uploadFile(filePath, (path) => {
           if (path) {
             uploadedCount++;
+            newImages.push({
+              url: path
+            });
             that.imageList.push({
               url: path
             });
@@ -183,6 +216,12 @@ export default {
             // 所有图片上传完成
             if (uploadedCount === totalCount) {
               that.uploading = false;
+              
+              // 如果是编辑模式,同时更新缓存
+              if (that.isUpdateMode) {
+                that.updateCachePhotos();
+              }
+              
               uni.showToast({
                 title: `成功上传${uploadedCount}张图片`,
                 icon: 'success'
@@ -191,7 +230,7 @@ export default {
           }
           else {
             uploadedCount++;
-            console.log(`第${index + 1}张图片上传失败:`, error);
+            console.log(`第${index + 1}张图片上传失败`);
             if (uploadedCount === totalCount) {
               that.uploading = false;
               uni.showToast({
@@ -200,50 +239,25 @@ export default {
               });
             }
           }
-        })
-        // uni.uploadFile({
-        //   url: '你的上传接口地址',
-        //   filePath: filePath,
-        //   name: 'file',
-        //   formData: {
-        //     'type': 'company_photo'
-        //   },
-        //   success: (uploadRes) => {
-        //     uploadedCount++;
-        //     const data = JSON.parse(uploadRes.data);
-        //     if (data.code === 200) {
-        //       that.imageList.push({
-        //         url: data.data.url
-        //       });
-        //     }
-
-        //     // 更新进度
-        //     that.uploadProgress = Math.floor((uploadedCount / totalCount) * 100);
-
-        //     // 所有图片上传完成
-        //     if (uploadedCount === totalCount) {
-        //       that.uploading = false;
-        //       uni.showToast({
-        //         title: `成功上传${uploadedCount}张图片`,
-        //         icon: 'success'
-        //       });
-        //     }
-        //   },
-        //   fail: (error) => {
-        //     uploadedCount++;
-        //     console.log(`第${index + 1}张图片上传失败:`, error);
-
-        //     if (uploadedCount === totalCount) {
-        //       that.uploading = false;
-        //       uni.showToast({
-        //         title: '部分图片上传失败',
-        //         icon: 'none'
-        //       });
-        //     }
-        //   }
-        // });
+        });
       });
     },
+    
+    // 更新缓存中的照片
+    updateCachePhotos() {
+      try {
+        let companyInfo = uni.getStorageSync('companyInfo');
+        if (companyInfo) {
+          // 获取所有图片URL
+          const photoUrls = this.imageList.map(item => item.url);
+          companyInfo.photos = photoUrls.join(',');
+          uni.setStorageSync('companyInfo', companyInfo);
+          console.log('已更新缓存中的照片数据');
+        }
+      } catch (error) {
+        console.error('更新缓存照片失败:', error);
+      }
+    },
 
     // 预览图片
     previewImage(index) {
@@ -265,6 +279,12 @@ export default {
         success: (res) => {
           if (res.confirm) {
             that.imageList.splice(index, 1);
+            
+            // 如果是编辑模式,同时更新缓存
+            if (that.isUpdateMode) {
+              that.updateCachePhotos();
+            }
+            
             uni.showToast({
               title: "删除成功",
               icon: "success",
@@ -284,12 +304,22 @@ export default {
         return;
       }
 
-      // 跳转到下一页,传递图片数据
+      // 获取所有图片URL
       const imageUrls = this.imageList.map(item => item.url);
-      const companyData = this.companyData
-      companyData.photos = imageUrls.join(',')
+      const companyData = {
+        ...this.companyData,
+        photos: imageUrls.join(',')
+      };
+      
+      // 如果是编辑模式,同时更新缓存
+      if (this.isUpdateMode) {
+        this.updateCachePhotos();
+      }
+      
       uni.navigateTo({
-        url: "/my/renzheng/mainWorkIntro?companyData=" + encodeURIComponent(JSON.stringify(companyData)),
+        url: "/my/renzheng/mainWorkIntro?companyData=" + 
+          encodeURIComponent(JSON.stringify(companyData)) +
+          (this.isUpdateMode ? "&update=true" : "")
       });
     },
   },
@@ -297,6 +327,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+/* 样式保持不变 */
 .switch-roles {
   background-color: #fff;
   position: absolute;

+ 6 - 1
my/renzheng/companyLogo.vue

@@ -76,6 +76,11 @@ export default {
     navBar,
   },
   onLoad(options) {
+    if (options.update == 'true') {
+      let companyInfo = uni.getStorageSync('companyInfo');
+      this.logoImage = companyInfo.companyLogo;
+
+    }
     if (options.companyData) {
       this.companyData = JSON.parse(options.companyData);
       console.log(this.companyData);
@@ -275,7 +280,7 @@ export default {
       const companyData = this.companyData
       companyData.companyLogo = this.logoImage
       uni.navigateTo({
-        url: "/my/renzheng/companyImg?companyData=" + encodeURIComponent(JSON.stringify(companyData)),
+        url: `/my/renzheng/companyImg?companyData=${encodeURIComponent(JSON.stringify(companyData))}&update=${true}`,
       });
     },
   },

+ 31 - 34
my/renzheng/companyMsg.vue

@@ -29,25 +29,15 @@
 
         <view class="check-title-big">休息时间(可选)</view>
         <view class="check-box">
-          <view
-            class="check-item"
-            :class="{ 'is-check': check == index }"
-            v-for="(item, index) in peopleList"
-            :key="index"
-            @click="checkPeople(index)"
-          >
+          <view class="check-item" :class="{ 'is-check': check == item }" v-for="(item, index) in peopleList"
+            :key="index" @click="checkPeople(item)">
             {{ item }}
           </view>
         </view>
         <view class="check-title-big">加班情况(可选)</view>
         <view class="check-box grid-three">
-          <view
-            class="check-item"
-            :class="{ 'is-check': work == index }"
-            v-for="(item, index) in workList"
-            :key="index"
-            @click="checkWork(index)"
-          >
+          <view class="check-item" :class="{ 'is-check': work == item }" v-for="(item, index) in workList" :key="index"
+            @click="checkWork(item)">
             {{ item }}
           </view>
         </view>
@@ -57,20 +47,10 @@
     <view class="submit-btn" @click="goJobPostingSecond">下一步</view>
 
     <!-- 开始时间选择器 -->
-    <u-picker
-      mode="time"
-      v-model="showStartTime"
-      @confirm="onStartTimeConfirm"
-      :params="timeParams"
-    ></u-picker>
+    <u-picker mode="time" v-model="showStartTime" @confirm="onStartTimeConfirm" :params="timeParams"></u-picker>
 
     <!-- 结束时间选择器 -->
-    <u-picker
-      mode="time"
-      v-model="showEndTime"
-      @confirm="onEndTimeConfirm"
-      :params="timeParams"
-    ></u-picker>
+    <u-picker mode="time" v-model="showEndTime" @confirm="onEndTimeConfirm" :params="timeParams"></u-picker>
   </view>
 </template>
 <script>
@@ -80,8 +60,8 @@ export default {
     return {
       peopleList: ["单休", "双休"],
       workList: ["不加班", "偶尔加班", "弹性工作"],
-      check: 0,
-      work: 0,
+      check:'单休',
+      work: '不加班',
       text: "",
       showStartTime: false,
       showEndTime: false,
@@ -109,6 +89,15 @@ export default {
     navBar,
   },
   onLoad(options) {
+    if (options.update == 'true') {
+      let companyInfo = uni.getStorageSync('companyInfo');
+      let timeRange = companyInfo.workTime;
+      const times = timeRange.split("-");
+      this.startTime = times[0]
+      this.endTime = times[1]
+      this.check = companyInfo.workRestTime;
+      this.work=companyInfo.workOverTime;
+    }
     if (options.text) {
       this.text = options.text;
     }
@@ -155,14 +144,16 @@ export default {
       // 将选择的时间数据传递到下一页或保存
       const companyData = {
         workTime: `${this.startTime}-${this.endTime}`,
-        workRestTime: this.peopleList[this.check],
-		    workOverTime:this.workList[this.work]
+        // workRestTime: this.peopleList[this.check],
+        workRestTime: this.check,
+
+        workOverTime: this.work
       };
-	  
+
       uni.navigateTo({
         url:
           "/my/renzheng/companyDev?companyData=" +
-          encodeURIComponent(JSON.stringify(companyData)),
+          encodeURIComponent(JSON.stringify(companyData))+'&update=true',
       });
     },
 
@@ -203,6 +194,7 @@ export default {
       flex-direction: column;
       align-items: center;
       justify-content: center;
+
       .progress-num {
         color: #016bf6;
         font-family: DM Sans;
@@ -211,11 +203,13 @@ export default {
         width: 100%;
         padding-bottom: 20rpx;
         box-sizing: border-box;
+
         text {
-            font-size: 48rpx;
-            font-weight: 700;
+          font-size: 48rpx;
+          font-weight: 700;
         }
       }
+
       .title {
         color: #333;
         width: 100%;
@@ -243,10 +237,12 @@ export default {
         align-items: center;
         justify-content: space-between;
         margin-bottom: 20rpx;
+
         .time-item-box {
           text-align: center;
           min-width: 40%;
         }
+
         .time-item {
           flex: 1;
           border-radius: 100rpx;
@@ -337,6 +333,7 @@ export default {
           color: #016bf6;
         }
       }
+
       .grid-three {
         grid-template-columns: repeat(3, 1fr) !important;
       }

+ 86 - 96
my/renzheng/editCompany.vue

@@ -5,60 +5,50 @@
       <view class="ms-title">编辑公司及品牌信息</view>
       <view class="ms-item">
         <view class="ms-item-title" @click="checkBaseMsg">
-          <view class="ms-title-txt">基本信息{{filledInCount[0]}}/5</view>
+          <view class="ms-title-txt">基本信息{{ filledInCount[0] }}/5</view>
           <view class="ms-title-icon">
-            <image
-              src="@/static/images/my/my/top-up.svg"
-              mode="scaleToFill"
-              class="top"
-              v-if="baseMsg"
-            />
-            <image
-              src="@/static/images/my/my/right.svg"
-              mode="scaleToFill"
-              class="right"
-              v-else
-            />
+            <image src="@/static/images/my/my/top-up.svg" mode="scaleToFill" class="top" v-if="baseMsg" />
+            <image src="@/static/images/my/my/right.svg" mode="scaleToFill" class="right" v-else />
           </view>
         </view>
         <view class="ms-item-content" v-if="baseMsg" @click="goCompanyMsg">
           <view class="name-content-item">
             <view class="name-item">品牌logo</view>
             <view class="value-item">
-			  <text v-if="!companyinfo.companyLogo">未添加</text>
-              <image :src="companyinfo.companyLogo" mode="scaleToFill" v-else/>
+              <text v-if="!companyinfo.companyLogo">未添加</text>
+              <image :src="companyinfo.companyLogo" mode="scaleToFill" v-else />
               <u-icon name="arrow-right" color="#999" size="20"></u-icon>
             </view>
           </view>
           <view class="name-content-item">
             <view class="name-item">公司名称</view>
             <view class="value-item">
-			  <text v-if="!companyinfo.companyName">未添加</text>
-              <text v-else>{{companyinfo.companyName}}</text>
+              <text v-if="!companyinfo.companyName">未添加</text>
+              <text v-else>{{ companyinfo.companyName }}</text>
               <u-icon name="arrow-right" color="#999" size="20"></u-icon>
             </view>
           </view>
-          <view class="name-content-item" >
+          <view class="name-content-item">
             <view class="name-item">公司全称</view>
             <view class="value-item">
               <text v-if="!companyinfo.companyAllName">未添加</text>
-              <text v-else>{{companyinfo.companyAllName}}</text>
+              <text v-else>{{ companyinfo.companyAllName }}</text>
               <u-icon name="arrow-right" color="#999" size="20"></u-icon>
             </view>
           </view>
           <view class="name-content-item">
             <view class="name-item">融资阶段</view>
             <view class="value-item">
-			  <text v-if="!companyinfo.companyDevelop">未添加</text>
-			  <text v-else>{{companyinfo.companyDevelop}}</text>
+              <text v-if="!companyinfo.companyDevelop">未添加</text>
+              <text v-else>{{ companyinfo.companyDevelop }}</text>
               <u-icon name="arrow-right" color="#999" size="20"></u-icon>
             </view>
           </view>
           <view class="name-content-item">
             <view class="name-item">人员规模</view>
             <view class="value-item">
-              <text v-if="!companyinfo.companyPeople||companyinfo.companyPeople==='0'">未添加</text>
-              <text v-else>{{companyinfo.companyPeople}}</text>
+              <text v-if="!companyinfo.companyPeople || companyinfo.companyPeople === '0'">未添加</text>
+              <text v-else>{{ companyinfo.companyPeople }}</text>
               <u-icon name="arrow-right" color="#999" size="20"></u-icon>
             </view>
           </view>
@@ -66,37 +56,26 @@
       </view>
       <view class="ms-item">
         <view class="ms-item-title" @click="checkCompanyFund">
-          <view class="ms-title-txt">公司福利 {{filledInCount[1]}}/2</view>
+          <view class="ms-title-txt">公司福利 {{ filledInCount[1] }}/2</view>
           <view class="ms-title-icon">
-            <image
-              src="@/static/images/my/my/top-up.svg"
-              mode="scaleToFill"
-              class="top"
-              v-if="companyFund"
-            />
-            <image
-              src="@/static/images/my/my/right.svg"
-              mode="scaleToFill"
-              class="right"
-              v-else
-            />
+            <image src="@/static/images/my/my/top-up.svg" mode="scaleToFill" class="top" v-if="companyFund" />
+            <image src="@/static/images/my/my/right.svg" mode="scaleToFill" class="right" v-else />
           </view>
         </view>
         <view class="ms-item-content" v-if="companyFund" @click="goCompanyMsg">
           <view class="name-content-item">
             <view class="name-item">标准工作时间</view>
             <view class="value-item">
-             <text v-if="!companyinfo.workTime">未添加</text>
-             <text v-else>{{companyinfo.workTime}}</text>
+              <text v-if="!companyinfo.workTime">未添加</text>
+              <text v-else>{{ companyinfo.workTime }}</text>
               <u-icon name="arrow-right" color="#999" size="20"></u-icon>
             </view>
           </view>
           <view class="name-content-item">
             <view class="name-item">福利待遇</view>
-            <view class="value-item"
-              >
-			  <text v-if="!companyinfo.welfare">未添加</text>
-			  <text v-else>已添加{{companyinfo.welfare.split(',').length}}项</text>
+            <view class="value-item">
+              <text v-if="!companyinfo.welfare">未添加</text>
+              <text v-else>已添加{{ companyinfo.welfare.split(',').length }}项</text>
               <u-icon name="arrow-right" color="#999" size="20"></u-icon>
             </view>
           </view>
@@ -110,7 +89,7 @@
             <text v-else>已添加</text>
           </view>
         </view>
-       <!-- <view class="ms-item-content" v-if="companyDetail">
+        <!-- <view class="ms-item-content" v-if="companyDetail">
           <view class="name-content-item">
             <view class="name-item">标准工作时间</view>
             <view class="value-item">
@@ -132,7 +111,7 @@
           <view class="ms-title-txt">主营业务</view>
           <view class="ms-title-icon">
             <text v-if="!companyinfo.companyScope">未添加</text>
-            <text v-else>已添加{{companyinfo.companyScope.split(',').length}}项</text>
+            <text v-else>已添加{{ companyinfo.companyScope.split(',').length }}项</text>
           </view>
         </view>
         <!-- <view class="ms-item-content" v-if="mainWork">
@@ -156,8 +135,8 @@
         <view class="ms-item-title" @click="goCompanyMsg">
           <view class="ms-title-txt">公司相册</view>
           <view class="ms-title-icon">
-           <text v-if="!companyinfo.photos">未添加</text>
-           <text v-else>已添加{{companyinfo.photos.split(',').length}}张</text>
+            <text v-if="!companyinfo.photos">未添加</text>
+            <text v-else>已添加{{ companyinfo.photos.split(',').length }}张</text>
           </view>
         </view>
         <!-- <view class="ms-item-content" v-if="companyImg">
@@ -181,11 +160,11 @@
         <view class="ms-item-title" @click="goCompanyMsg">
           <view class="ms-title-txt">人才发展</view>
           <view class="ms-title-icon">
-           <text v-if="!companyinfo.companyPeopleDevelop">未添加</text>
-           <text v-else>已添加{{companyinfo.companyPeopleDevelop.split(',').length}}项</text>
+            <text v-if="!companyinfo.companyPeopleDevelop">未添加</text>
+            <text v-else>已添加{{ companyinfo.companyPeopleDevelop.split(',').length }}项</text>
           </view>
         </view>
-       <!-- <view class="ms-item-content" v-if="peopleDev">
+        <!-- <view class="ms-item-content" v-if="peopleDev">
           <view class="name-content-item">
             <view class="name-item">标准工作时间</view>
             <view class="value-item">
@@ -217,29 +196,29 @@ export default {
       mainWork: false,
       companyImg: false,
       peopleDev: false,
-	  companyinfo:{}
+      companyinfo: {}
     };
   },
   components: {
     navBar,
   },
   onLoad() {
-  	this.getcompanystatus()
+    this.getcompanystatus()
   },
   computed: {
-  	filledInCount() {
-  		let arr = [0,0]
-		if(this.companyinfo.companyLogo) arr[0]+=1
-		if(this.companyinfo.companyName) arr[0]+=1
-		if(this.companyinfo.companyAllName) arr[0]+=1
-		if(this.companyinfo.companyDevelop) arr[0]+=1
-		if(this.companyinfo.companyPeople&&this.companyinfo.companyPeople!=='0') arr[0]+=1
-		
-		if(this.companyinfo.workTime) arr[1]+=1
-		if(this.companyinfo.welfare) arr[1]+=1
-		
-		return arr 
-  	}
+    filledInCount() {
+      let arr = [0, 0]
+      if (this.companyinfo.companyLogo) arr[0] += 1
+      if (this.companyinfo.companyName) arr[0] += 1
+      if (this.companyinfo.companyAllName) arr[0] += 1
+      if (this.companyinfo.companyDevelop) arr[0] += 1
+      if (this.companyinfo.companyPeople && this.companyinfo.companyPeople !== '0') arr[0] += 1
+
+      if (this.companyinfo.workTime) arr[1] += 1
+      if (this.companyinfo.welfare) arr[1] += 1
+
+      return arr
+    }
   },
   methods: {
     checkBaseMsg() {
@@ -260,32 +239,33 @@ export default {
     checkPeopleDev() {
       this.peopleDev = !this.peopleDev;
     },
-    goCompanyMsg(){
-        uni.navigateTo({ url: '/my/renzheng/companyMsg' })
+    goCompanyMsg() {
+      uni.setStorageSync('companyInfo', this.companyinfo);
+      uni.navigateTo({ url: `/my/renzheng/companyMsg?update=${true}` })
+    },
+    // 查询用户企业状态
+    getcompanystatus() {
+      this.$Request.get("/app/company/selectCompanyByUserId", "")
+        .then((res) => {
+          if (res.code != 0) {
+            uni.showToast({
+              title: res.msg || "查询状态失败",
+              icon: "none"
+            });
+            return;
+          }
+          this.companyinfo = res.data || {};
+          this.$queue.setData('companyId', res.data.companyId);
+          console.log("查询用户企业状态", this.companyinfo)
+        })
+        .catch((err) => {
+          console.error("查询失败:", err);
+          uni.showToast({
+            title: "网络异常",
+            icon: "none"
+          });
+        });
     },
-	// 查询用户企业状态
-	getcompanystatus() {
-		this.$Request.get("/app/company/selectCompanyByUserId", "")
-			.then((res) => {
-				if (res.code != 0) {
-					uni.showToast({
-						title: res.msg || "查询状态失败",
-						icon: "none"
-					});
-					return;
-				}
-				this.companyinfo = res.data || {};
-        this.$queue.setData('companyId', res.data.companyId);
-				console.log("查询用户企业状态", this.companyinfo)
-			})
-			.catch((err) => {
-				console.error("查询失败:", err);
-				uni.showToast({
-					title: "网络异常",
-					icon: "none"
-				});
-			});
-	},
   },
 };
 </script>
@@ -299,6 +279,7 @@ export default {
   display: flex;
   flex-direction: column;
   overflow: hidden;
+
   .ms-content {
     flex: 1;
     width: 100%;
@@ -306,6 +287,7 @@ export default {
     box-sizing: border-box;
     overflow: hidden;
     overflow-y: auto;
+
     .ms-title {
       color: rgba(51, 51, 51, 1);
       font-family: DM Sans;
@@ -313,6 +295,7 @@ export default {
       font-weight: 700;
       line-height: 60rpx;
     }
+
     .ms-item {
       .ms-item-title {
         color: rgba(31, 44, 55, 1);
@@ -326,19 +309,22 @@ export default {
         align-items: center;
         margin-top: 20rpx;
         margin-bottom: 16rpx;
-        .ms-title-txt {
-        }
+
+        .ms-title-txt {}
+
         .ms-title-icon {
           color: rgba(153, 153, 153, 1);
           font-family: DM Sans;
           font-size: 24rpx;
           font-weight: 400;
           line-height: 32rpx;
+
           .top {
             width: 28rpx;
             height: 18rpx;
             margin-left: 8rpx;
           }
+
           .right {
             width: 18rpx;
             height: 28rpx;
@@ -346,18 +332,21 @@ export default {
           }
         }
       }
+
       .ms-item-content {
         box-sizing: border-box;
         border: 1rpx solid rgba(227, 231, 236, 1);
         border-radius: 12rpx;
         background: rgba(255, 255, 255, 1);
         padding: 36rpx;
+
         .name-content-item {
           display: flex;
           justify-content: space-between;
           align-items: center;
           padding: 9rpx 0;
           box-sizing: border-box;
+
           .name-item {
             color: rgba(153, 153, 153, 1);
             font-family: DM Sans;
@@ -365,6 +354,7 @@ export default {
             font-weight: 400;
             line-height: 32rpx;
           }
+
           .value-item {
             display: flex;
             justify-content: center;
@@ -375,19 +365,19 @@ export default {
             font-weight: 400;
             line-height: 32rpx;
             letter-spacing: 0%;
+
             text {
               margin-right: 8rpx;
             }
+
             image {
               width: 50rpx;
               height: 50rpx;
               border-radius: 50%;
               margin-right: 8rpx;
-              background: linear-gradient(
-                90deg,
-                rgba(13, 39, 247, 1),
-                rgba(19, 193, 234, 1) 100%
-              );
+              background: linear-gradient(90deg,
+                  rgba(13, 39, 247, 1),
+                  rgba(19, 193, 234, 1) 100%);
             }
           }
         }

+ 7 - 2
my/renzheng/editCompanyDesc.vue

@@ -42,6 +42,11 @@ export default {
     navBar,
   },
   onLoad(options) {
+    if (options.update == 'true') {
+      let companyInfo = uni.getStorageSync('companyInfo');
+      this.text=companyInfo.companyContent
+
+    }
     if (options.companyData) {
       this.companyData = JSON.parse(options.companyData);
     }
@@ -64,8 +69,8 @@ export default {
 		  return;
 		}
 		companyData.companyContent=this.text
-        uni.navigateTo({ url: "/my/renzheng/companyLogo?companyData=" +
-          encodeURIComponent(JSON.stringify(companyData)) })
+        uni.navigateTo({ url: `/my/renzheng/companyLogo?companyData=${encodeURIComponent(JSON.stringify(companyData))}&update=${true}`
+           })
     }
   },
 };

+ 144 - 56
my/renzheng/mainWorkIntro.vue

@@ -66,20 +66,15 @@
       @cancel="cancelAddTag"
     >
       <view class="dialog-content">
-        <!-- <input
-          class="tag-input"
-          v-model="tempTag"
-          placeholder="请输入标签内容"
-          placeholder-class="input-placeholder"
-          maxlength="20"
-          @confirm="confirmAddTag"
-        /> -->
         <u-input
           v-model="tempTag"
           type="text"
           :border="true"
           :clearable="true"
           input-align="left"
+          placeholder="请输入标签内容"
+          maxlength="20"
+          @confirm="confirmAddTag"
         />
         <view class="input-tips">最多输入20个字符</view>
       </view>
@@ -114,19 +109,95 @@ export default {
       showDialog: false,
       // 临时标签输入
       tempTag: "",
-	  companyData:{}
+      companyData: {},
+      isUpdateMode: false // 新增:标记是否为编辑模式
     };
   },
   components: {
     navBar,
   },
   onLoad(options) {
+    // 判断是否为编辑模式
+    if (options.update == 'true') {
+      this.isUpdateMode = true;
+      this.loadSavedCompanyScope();
+    }
+    
     if (options.companyData) {
       this.companyData = JSON.parse(options.companyData);
-	  console.log(this.companyData);
+      console.log('接收到的companyData:', this.companyData);
+      
+      // 如果companyData中有业务范围数据,处理显示
+      if (this.companyData.companyScope) {
+        this.processCompanyScope(this.companyData.companyScope);
+      }
     }
   },
   methods: {
+    // 加载已保存的业务范围数据(从缓存)
+    loadSavedCompanyScope() {
+      try {
+        let companyInfo = uni.getStorageSync('companyInfo');
+        console.log('从缓存获取的公司信息:', companyInfo);
+        
+        if (companyInfo?.companyScope) {
+          this.processCompanyScope(companyInfo.companyScope);
+          console.log('已加载保存的业务范围数据');
+        } else {
+          console.log('缓存中没有业务范围数据');
+        }
+      } catch (error) {
+        console.error('加载业务范围数据失败:', error);
+      }
+    },
+    
+    // 处理业务范围数据
+    processCompanyScope(scopeString) {
+      if (!scopeString) return;
+      
+      // 处理字符串:替换中文逗号,分割,过滤空值
+      const scopeItems = scopeString
+        .replace(/,/g, ',')
+        .split(',')
+        .map(item => item.trim())
+        .filter(item => item);
+      
+      console.log('解析后的业务范围:', scopeItems);
+      
+      // 清空当前选择
+      this.selectedProducts = [];
+      this.customTags = [];
+      this.selectedCustomTags = [];
+      
+      // 分离标准产品和自定义标签
+      scopeItems.forEach(item => {
+        if (this.productList.includes(item)) {
+          // 是标准产品
+          this.selectedProducts.push(item);
+        } else {
+          // 是自定义标签
+          this.customTags.push(item);
+          this.selectedCustomTags.push(item); // 自定义标签默认都是选中的
+        }
+      });
+    },
+    
+    // 更新缓存中的业务范围
+    updateCacheCompanyScope() {
+      try {
+        let companyInfo = uni.getStorageSync('companyInfo');
+        if (companyInfo) {
+          // 获取所有选中的标签
+          const allSelectedTags = [...this.selectedProducts, ...this.selectedCustomTags];
+          companyInfo.companyScope = allSelectedTags.join(',');
+          uni.setStorageSync('companyInfo', companyInfo);
+          console.log('已更新缓存中的业务范围数据:', companyInfo.companyScope);
+        }
+      } catch (error) {
+        console.error('更新缓存业务范围失败:', error);
+      }
+    },
+    
     // 切换产品选择
     toggleProduct(product) {
       const index = this.selectedProducts.indexOf(product);
@@ -141,11 +212,6 @@ export default {
     showAddDialog() {
       this.tempTag = "";
       this.showDialog = true;
-      // 延迟聚焦输入框
-      setTimeout(() => {
-        const input = this.$el.querySelector(".tag-input");
-        if (input) input.focus();
-      }, 300);
     },
 
     // 确认添加标签
@@ -166,7 +232,18 @@ export default {
         return;
       }
 
-      this.customTags.push(this.tempTag.trim());
+      // 检查是否与标准产品重复
+      if (this.productList.includes(this.tempTag.trim())) {
+        uni.showToast({
+          title: "该标签已存在于主营产品列表中",
+          icon: "none",
+        });
+        return;
+      }
+
+      const newTag = this.tempTag.trim();
+      this.customTags.push(newTag);
+      this.selectedCustomTags.push(newTag); // 新增的自定义标签默认选中
       this.showDialog = false;
       this.tempTag = "";
     },
@@ -212,36 +289,54 @@ export default {
       }
 
       console.log("选中的业务标签:", allSelectedTags);
-	  
-	  const companyData = this.companyData
-	  companyData.companyScope = allSelectedTags.join(',')
-	  // 提交公司信息
-	  const data = { ...{companyId:this.$queue.getData('companyId'),...companyData}}
-	  this.$Request.postJson('/app/company/updateCompany', data).then(res => {
-		console.log(res)
-		if (res.code == 0) {
-			uni.showToast({
-				title: '提交成功',
-				duration: 1500,
-				
-			})
-			setTimeout(()=>{
-				uni.switchTab({
-					url: '/pages/my/index'
-				})
-			},1500)
-			
-		} else {
-		this.$queue.showToast(res.msg);
-	  }
-	  });
-      return;
-
-      // 跳转到下一页,传递选中的业务标签
-      uni.navigateTo({
-        url:
-          "/my/renzheng/editCompanyDesc?businessTags=" +
-          encodeURIComponent(JSON.stringify(allSelectedTags)),
+      
+      const companyData = {
+        ...this.companyData,
+        companyScope: allSelectedTags.join(',')
+      };
+      
+      // 如果是编辑模式,同时更新缓存
+      if (this.isUpdateMode) {
+        this.updateCacheCompanyScope();
+      }
+      
+      // 提交公司信息
+      const data = { 
+        ...{companyId: this.$queue.getData('companyId')},
+        ...companyData
+      };
+      
+      this.$Request.postJson('/app/company/updateCompany', data).then(res => {
+        console.log(res);
+        if (res.code == 0) {
+          // 提交成功后,如果是编辑模式,更新缓存中的完整数据
+          if (this.isUpdateMode) {
+            try {
+              let companyInfo = uni.getStorageSync('companyInfo');
+              if (companyInfo) {
+                // 更新所有字段
+                Object.assign(companyInfo, companyData);
+                uni.setStorageSync('companyInfo', companyInfo);
+                console.log('已更新完整缓存数据');
+              }
+            } catch (error) {
+              console.error('更新完整缓存失败:', error);
+            }
+          }
+          
+          uni.showToast({
+            title: '提交成功',
+            duration: 1500,
+          });
+          
+          setTimeout(() => {
+            uni.switchTab({
+              url: '/pages/my/index'
+            });
+          }, 1500);
+        } else {
+          this.$queue.showToast(res.msg);
+        }
       });
     },
   },
@@ -433,19 +528,12 @@ export default {
 .dialog-content {
   padding: 40rpx;
   box-sizing: border-box;
-  .tag-input {
-    width: 100%;
-    padding: 20rpx;
-    border: 1rpx solid #ddd;
-    border-radius: 8rpx;
-    font-size: 28rpx;
-    margin-bottom: 20rpx;
-  }
-
+  
   .input-tips {
     color: #999;
     font-size: 24rpx;
     text-align: right;
+    margin-top: 10rpx;
   }
 }
 
@@ -456,4 +544,4 @@ export default {
   font-size: 16rpx;
   font-weight: 400;
 }
-</style>
+</style>

+ 107 - 47
my/renzheng/peopleDev.vue

@@ -8,46 +8,27 @@
           <view>人才发展</view>
         </view>
         <view class="desc">
-          介绍公司可提供的员工培养&晋升制度,良好的职业成长空间对人才更有吸引力</view
-        >
+          介绍公司可提供的员工培养&晋升制度,良好的职业成长空间对人才更有吸引力</view>
         <view class="content-index">
           <view class="content-item">
             <view class="content-item-title">晋升制度</view>
             <view class="check-box">
-              <view
-                class="check-item"
-                :class="{ 'check-active': selectedUp.includes(index) }"
-                v-for="(item, index) in upList"
-                :key="index"
-                @click="checkUp(index)"
-                >{{ item }}</view
-              >
+              <view class="check-item" :class="{ 'check-active': selectedUp.includes(index) }"
+                v-for="(item, index) in upList" :key="index" @click="checkUp(index)">{{ item }}</view>
             </view>
           </view>
           <view class="content-item">
             <view class="content-item-title">人才激励</view>
             <view class="check-box">
-              <view
-                class="check-item"
-                :class="{ 'check-active': selectedPeople.includes(index) }"
-                v-for="(item, index) in peopleList"
-                :key="index"
-                @click="checkPeople(index)"
-                >{{ item }}</view
-              >
+              <view class="check-item" :class="{ 'check-active': selectedPeople.includes(index) }"
+                v-for="(item, index) in peopleList" :key="index" @click="checkPeople(index)">{{ item }}</view>
             </view>
           </view>
           <view class="content-item">
             <view class="content-item-title">能力培养</view>
             <view class="check-box">
-              <view
-                class="check-item"
-                :class="{ 'check-active': selectedPower.includes(index) }"
-                v-for="(item, index) in powerList"
-                :key="index"
-                @click="checkPower(index)"
-                >{{ item }}</view
-              >
+              <view class="check-item" :class="{ 'check-active': selectedPower.includes(index) }"
+                v-for="(item, index) in powerList" :key="index" @click="checkPower(index)">{{ item }}</view>
             </view>
           </view>
         </view>
@@ -65,7 +46,7 @@ export default {
     return {
       upList: ["考核晋升", "定期晋升", "完善的晋升机制"],
       selectedUp: [], // 改为数组存储多个选择
-      
+
       peopleList: [
         "定期普调",
         "定期绩效调薪",
@@ -78,7 +59,7 @@ export default {
         "人才补贴",
       ],
       selectedPeople: [], // 改为数组存储多个选择
-      
+
       powerList: [
         "老员工带新",
         "导师一对一",
@@ -92,23 +73,79 @@ export default {
         "校招培养",
       ],
       selectedPower: [], // 改为数组存储多个选择
-      
-      companyData:{},
-      companyPeopleDevelop:[]
+
+      companyData: {},
+      companyPeopleDevelop: [],
+      isUpdateMode: false // 新增:标记是否为编辑模式
     };
   },
   components: {
     navBar,
   },
   onLoad(options) {
+    // 判断是否为编辑模式
+    if (options.update == 'true') {
+      this.isUpdateMode = true;
+      this.loadSavedPeopleDevelop();
+    }
+    
     if (options.companyData) {
       this.companyData = JSON.parse(options.companyData);
-      
       // 如果之前有保存的数据,恢复选择状态
       this.restoreSelections();
     }
   },
   methods: {
+    // 加载已保存的人才发展数据(从缓存)
+    loadSavedPeopleDevelop() {
+      try {
+        let companyInfo = uni.getStorageSync('companyInfo');
+        
+        if (companyInfo?.companyPeopleDevelop) {
+          // 处理字符串并分割为数组
+          const savedPeopleDevelop = companyInfo.companyPeopleDevelop
+            .replace(/,/g, ',')  // 替换中文逗号
+            .split(',')           // 分割
+            .map(item => item.trim())  // 去除空格
+            .filter(item => item);     // 过滤空值
+          
+          console.log('加载的人才发展数据:', savedPeopleDevelop);
+          
+          // 清空之前的选中
+          this.selectedUp = [];
+          this.selectedPeople = [];
+          this.selectedPower = [];
+          
+          // 恢复晋升制度选择
+          this.upList.forEach((item, index) => {
+            if (savedPeopleDevelop.includes(item)) {
+              this.selectedUp.push(index);
+            }
+          });
+          
+          // 恢复人才激励选择
+          this.peopleList.forEach((item, index) => {
+            if (savedPeopleDevelop.includes(item)) {
+              this.selectedPeople.push(index);
+            }
+          });
+          
+          // 恢复能力培养选择
+          this.powerList.forEach((item, index) => {
+            if (savedPeopleDevelop.includes(item)) {
+              this.selectedPower.push(index);
+            }
+          });
+          
+          console.log('人才发展数据已加载完成');
+        } else {
+          console.log('缓存中没有人才发展数据');
+        }
+      } catch (error) {
+        console.error('加载人才发展数据失败:', error);
+      }
+    },
+
     // 晋升制度多选
     checkUp(index) {
       const idx = this.selectedUp.indexOf(index);
@@ -120,7 +157,7 @@ export default {
         this.selectedUp.push(index);
       }
     },
-    
+
     // 人才激励多选
     checkPeople(index) {
       const idx = this.selectedPeople.indexOf(index);
@@ -130,7 +167,7 @@ export default {
         this.selectedPeople.push(index);
       }
     },
-    
+
     // 能力培养多选
     checkPower(index) {
       const idx = this.selectedPower.indexOf(index);
@@ -140,26 +177,26 @@ export default {
         this.selectedPower.push(index);
       }
     },
-    
+
     // 恢复之前的选择(编辑时使用)
     restoreSelections() {
       if (this.companyData.companyPeopleDevelop) {
         const savedData = this.companyData.companyPeopleDevelop.split(',');
-        
+
         // 恢复晋升制度选择
         this.upList.forEach((item, index) => {
           if (savedData.includes(item)) {
             this.selectedUp.push(index);
           }
         });
-        
+
         // 恢复人才激励选择
         this.peopleList.forEach((item, index) => {
           if (savedData.includes(item)) {
             this.selectedPeople.push(index);
           }
         });
-        
+
         // 恢复能力培养选择
         this.powerList.forEach((item, index) => {
           if (savedData.includes(item)) {
@@ -168,32 +205,32 @@ export default {
         });
       }
     },
-    
+
     goJobPostingSecond() {
       // 清空之前的数组
       this.companyPeopleDevelop = [];
-      
+
       // 添加选中的晋升制度
       this.selectedUp.forEach(index => {
         if (this.upList[index]) {
           this.companyPeopleDevelop.push(this.upList[index]);
         }
       });
-      
+
       // 添加选中的人才激励
       this.selectedPeople.forEach(index => {
         if (this.peopleList[index]) {
           this.companyPeopleDevelop.push(this.peopleList[index]);
         }
       });
-      
+
       // 添加选中的能力培养
       this.selectedPower.forEach(index => {
         if (this.powerList[index]) {
           this.companyPeopleDevelop.push(this.powerList[index]);
         }
       });
-      
+
       // 验证是否至少选择了一项
       if (this.companyPeopleDevelop.length === 0) {
         uni.showToast({
@@ -202,17 +239,32 @@ export default {
         });
         return;
       }
-      
+
       // 保存到 companyData
       const companyData = {
         ...this.companyData,
         companyPeopleDevelop: this.companyPeopleDevelop.join(',')
       };
-      
+
+      // 如果是编辑模式,同时更新缓存
+      if (this.isUpdateMode) {
+        try {
+          let companyInfo = uni.getStorageSync('companyInfo');
+          if (companyInfo) {
+            companyInfo.companyPeopleDevelop = companyData.companyPeopleDevelop;
+            uni.setStorageSync('companyInfo', companyInfo);
+            console.log('已更新缓存中的人才发展数据');
+          }
+        } catch (error) {
+          console.error('更新缓存失败:', error);
+        }
+      }
+
       // 跳转到下一步
-      uni.navigateTo({ 
+      uni.navigateTo({
         url: "/my/renzheng/editCompanyDesc?companyData=" +
-          encodeURIComponent(JSON.stringify(companyData)) 
+          encodeURIComponent(JSON.stringify(companyData)) +
+          (this.isUpdateMode ? "&update=true" : "")
       });
     }
   },
@@ -220,6 +272,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+/* 样式保持不变 */
 .switch-roles {
   background-color: #fff;
   position: absolute;
@@ -252,6 +305,7 @@ export default {
         width: 100%;
         padding-bottom: 20rpx;
         box-sizing: border-box;
+
         text {
           font-size: 48rpx;
           font-weight: 700;
@@ -283,10 +337,13 @@ export default {
         box-sizing: border-box;
         margin-bottom: 20rpx;
       }
+
       .content-index {
         width: 100%;
+
         .content-item {
           margin-bottom: 40rpx;
+
           .content-item-title {
             color: rgba(34, 37, 42, 1);
             font-family: DM Sans;
@@ -296,11 +353,13 @@ export default {
             padding-bottom: 12rpx;
             box-sizing: border-box;
           }
+
           .check-box {
             display: flex;
             gap: 12rpx;
             flex-wrap: wrap;
             align-items: center;
+
             .check-item {
               flex-shrink: 0;
               padding: 8rpx;
@@ -315,6 +374,7 @@ export default {
               cursor: pointer;
               transition: all 0.3s;
             }
+
             .check-active {
               box-sizing: border-box;
               border: 1rpx solid #016bf6;