editCompany.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <template>
  2. <view class="ms-detail">
  3. <nav-bar title="编辑公司信息"></nav-bar>
  4. <view class="ms-content">
  5. <view class="ms-title">编辑公司及品牌信息</view>
  6. <view class="ms-item">
  7. <view class="ms-item-title" @click="checkBaseMsg">
  8. <view class="ms-title-txt">基本信息{{ filledInCount[0] }}/5</view>
  9. <view class="ms-title-icon">
  10. <image src="@/static/images/my/my/top-up.svg" mode="scaleToFill" class="top" v-if="baseMsg" />
  11. <image src="@/static/images/my/my/right.svg" mode="scaleToFill" class="right" v-else />
  12. </view>
  13. </view>
  14. <view class="ms-item-content" v-if="baseMsg" @click="goCompanyMsg(1)">
  15. <view class="name-content-item">
  16. <view class="name-item">品牌logo</view>
  17. <view class="value-item">
  18. <text v-if="!companyinfo.companyLogo">未添加</text>
  19. <image :src="companyinfo.companyLogo" mode="aspectFill" v-else />
  20. <u-icon name="arrow-right" color="#999" size="20"></u-icon>
  21. </view>
  22. </view>
  23. <view class="name-content-item">
  24. <view class="name-item">公司名称</view>
  25. <view class="value-item">
  26. <text v-if="!companyinfo.companyName">未添加</text>
  27. <text v-else>{{ companyinfo.companyName }}</text>
  28. <u-icon name="arrow-right" color="#999" size="20"></u-icon>
  29. </view>
  30. </view>
  31. <view class="name-content-item">
  32. <view class="name-item">公司全称</view>
  33. <view class="value-item">
  34. <text v-if="!companyinfo.companyAllName">未添加</text>
  35. <text v-else>{{ companyinfo.companyAllName }}</text>
  36. <u-icon name="arrow-right" color="#999" size="20"></u-icon>
  37. </view>
  38. </view>
  39. <view class="name-content-item">
  40. <view class="name-item">融资阶段</view>
  41. <view class="value-item">
  42. <text v-if="!companyinfo.companyDevelop">未添加</text>
  43. <text v-else>{{ companyinfo.companyDevelop }}</text>
  44. <u-icon name="arrow-right" color="#999" size="20"></u-icon>
  45. </view>
  46. </view>
  47. <view class="name-content-item">
  48. <view class="name-item">人员规模</view>
  49. <view class="value-item">
  50. <text v-if="!companyinfo.companyPeople || companyinfo.companyPeople === '0'">未添加</text>
  51. <text v-else>{{ companyinfo.companyPeople }}</text>
  52. <u-icon name="arrow-right" color="#999" size="20"></u-icon>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="ms-item">
  58. <view class="ms-item-title" @click="checkCompanyFund">
  59. <view class="ms-title-txt">公司福利 {{ filledInCount[1] }}/2</view>
  60. <view class="ms-title-icon">
  61. <image src="@/static/images/my/my/top-up.svg" mode="scaleToFill" class="top" v-if="companyFund" />
  62. <image src="@/static/images/my/my/right.svg" mode="scaleToFill" class="right" v-else />
  63. </view>
  64. </view>
  65. <view class="ms-item-content" v-if="companyFund" @click="goCompanyMsg(2)">
  66. <view class="name-content-item">
  67. <view class="name-item">标准工作时间</view>
  68. <view class="value-item">
  69. <text v-if="!companyinfo.workTime">未添加</text>
  70. <text v-else>{{ companyinfo.workTime }}</text>
  71. <u-icon name="arrow-right" color="#999" size="20"></u-icon>
  72. </view>
  73. </view>
  74. <view class="name-content-item">
  75. <view class="name-item">福利待遇</view>
  76. <view class="value-item">
  77. <text v-if="!companyinfo.welfare">未添加</text>
  78. <text v-else>已添加{{ companyinfo.welfare.split(',').length }}项</text>
  79. <u-icon name="arrow-right" color="#999" size="20"></u-icon>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. <view class="ms-item" @click="goCompanyMsg(3)">
  85. <view class="ms-item-title">
  86. <view class="ms-title-txt">公司介绍</view>
  87. <view class="ms-title-icon">
  88. <text v-if="!companyinfo.companyContent">未添加</text>
  89. <text v-else>已添加</text>
  90. </view>
  91. </view>
  92. </view>
  93. <view class="ms-item">
  94. <view class="ms-item-title" @click="goCompanyMsg(4)">
  95. <view class="ms-title-txt">主营业务</view>
  96. <view class="ms-title-icon">
  97. <text v-if="!companyinfo.companyScope">未添加</text>
  98. <text v-else>已添加{{ companyinfo.companyScope.split(',').length }}项</text>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="ms-item">
  103. <view class="ms-item-title" @click="goCompanyMsg(5)">
  104. <view class="ms-title-txt">公司相册</view>
  105. <view class="ms-title-icon">
  106. <text v-if="!companyinfo.photos">未添加</text>
  107. <text v-else>已添加{{ companyinfo.photos.split(',').length }}张</text>
  108. </view>
  109. </view>
  110. </view>
  111. <view class="ms-item">
  112. <view class="ms-item-title" @click="goCompanyMsg(6)">
  113. <view class="ms-title-txt">人才发展</view>
  114. <view class="ms-title-icon">
  115. <text v-if="!companyinfo.companyPeopleDevelop">未添加</text>
  116. <text v-else>已添加{{ companyinfo.companyPeopleDevelop.split(',').length }}项</text>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </template>
  123. <script>
  124. import navBar from "@/components/nav-bar/index.vue";
  125. export default {
  126. data() {
  127. return {
  128. baseMsg: false,
  129. companyFund: false,
  130. companyDetail: false,
  131. mainWork: false,
  132. companyImg: false,
  133. peopleDev: false,
  134. companyinfo: {},
  135. isNo: false,//没进入公司,不允许修改公司信息
  136. };
  137. },
  138. components: {
  139. navBar,
  140. },
  141. onLoad() {
  142. this.getcompanystatus()
  143. uni.$on('updateCompanyInfo', this.getcompanystatus)
  144. },
  145. onUnload() {
  146. uni.$off('updateCompanyInfo', this.getcompanystatus)
  147. },
  148. computed: {
  149. filledInCount() {
  150. let arr = [0, 0]
  151. if (this.companyinfo.companyLogo) arr[0] += 1
  152. if (this.companyinfo.companyName) arr[0] += 1
  153. if (this.companyinfo.companyAllName) arr[0] += 1
  154. if (this.companyinfo.companyDevelop) arr[0] += 1
  155. if (this.companyinfo.companyPeople && this.companyinfo.companyPeople !== '0') arr[0] += 1
  156. if (this.companyinfo.workTime) arr[1] += 1
  157. if (this.companyinfo.welfare) arr[1] += 1
  158. return arr
  159. }
  160. },
  161. methods: {
  162. checkBaseMsg() {
  163. this.baseMsg = !this.baseMsg;
  164. },
  165. checkCompanyFund() {
  166. this.companyFund = !this.companyFund;
  167. },
  168. checkCompanyDetail() {
  169. this.companyDetail = !this.companyDetail;
  170. },
  171. checkMainWork() {
  172. this.mainWork = !this.mainWork;
  173. },
  174. checkCompanyImg() {
  175. this.companyImg = !this.companyImg;
  176. },
  177. checkPeopleDev() {
  178. this.peopleDev = !this.peopleDev;
  179. },
  180. goCompanyMsg(type) {
  181. uni.setStorageSync('companyInfo', this.companyinfo);
  182. if (this.isNo) {
  183. uni.showToast({title:'暂无公司信息!',icon:'none'})
  184. return;
  185. }
  186. const pageMap = {
  187. // 1: '/my/renzheng/companyLogo', // 品牌logo
  188. // 2: '/my/renzheng/companyDev', // 融资阶段
  189. // 3: '/my/renzheng/companyMsg', // 标准工作时间
  190. // 4: '/my/renzheng/companyFund', // 福利待遇
  191. // 5: '/my/renzheng/editCompanyDesc', // 公司介绍
  192. // 6: '/my/renzheng/mainWorkIntro', // 主营业务
  193. // 7: '/my/renzheng/companyImg', // 公司相册
  194. // 8: '/my/renzheng/peopleDev' // 人才发展
  195. 1: '/my/renzheng/companyBaseInfo', // 公司基本信息
  196. 2: '/my/renzheng/companyWelfare', // 公司福利
  197. 3: '/my/renzheng/editCompanyDesc', // 公司介绍
  198. 4: '/my/renzheng/mainWorkIntro', // 公司业务
  199. 5: '/my/renzheng/companyImg', // 公司照片
  200. 6: '/my/renzheng/peopleDev', // 人才发展
  201. }
  202. const url = pageMap[type]
  203. uni.navigateTo({ url })
  204. },
  205. // 查询用户企业状态
  206. getcompanystatus() {
  207. this.$Request.get("/app/company/selectCompanyByUserId", "")
  208. .then((res) => {
  209. if (res.code != 0) {
  210. this.isNo = true;
  211. uni.showToast({
  212. title: res.msg || "查询状态失败",
  213. icon: "none"
  214. });
  215. return;
  216. }
  217. this.companyinfo = res.data || {};
  218. this.$queue.setData('companyId', res.data.companyId);
  219. console.log("查询用户企业状态", this.companyinfo)
  220. })
  221. .catch((err) => {
  222. console.error("查询失败:", err);
  223. uni.showToast({
  224. title: "网络异常",
  225. icon: "none"
  226. });
  227. });
  228. },
  229. },
  230. };
  231. </script>
  232. <style scoped lang="scss">
  233. .ms-detail {
  234. position: absolute;
  235. left: 0;
  236. right: 0;
  237. bottom: 0;
  238. top: 0;
  239. display: flex;
  240. flex-direction: column;
  241. overflow: hidden;
  242. .ms-content {
  243. flex: 1;
  244. width: 100%;
  245. padding: 36rpx 40rpx;
  246. box-sizing: border-box;
  247. overflow: hidden;
  248. overflow-y: auto;
  249. .ms-title {
  250. color: rgba(51, 51, 51, 1);
  251. font-family: DM Sans;
  252. font-size: 36rpx;
  253. font-weight: 700;
  254. line-height: 60rpx;
  255. margin-bottom: 20rpx;
  256. }
  257. .ms-item {
  258. margin-bottom: 20rpx;
  259. .ms-item-title {
  260. color: rgba(31, 44, 55, 1);
  261. font-family: DM Sans;
  262. font-size: 28rpx;
  263. font-weight: 500;
  264. line-height: 44rpx;
  265. text-align: left;
  266. display: flex;
  267. justify-content: space-between;
  268. align-items: center;
  269. .ms-title-icon {
  270. color: rgba(153, 153, 153, 1);
  271. font-family: DM Sans;
  272. font-size: 24rpx;
  273. font-weight: 400;
  274. line-height: 32rpx;
  275. margin-right: 36rpx;
  276. .top {
  277. width: 28rpx;
  278. height: 18rpx;
  279. margin-left: 8rpx;
  280. }
  281. .right {
  282. width: 18rpx;
  283. height: 28rpx;
  284. margin-left: 8rpx;
  285. }
  286. }
  287. }
  288. .ms-item-content {
  289. box-sizing: border-box;
  290. border: 1rpx solid rgba(227, 231, 236, 1);
  291. border-radius: 12rpx;
  292. background: rgba(255, 255, 255, 1);
  293. padding: 36rpx;
  294. margin-top: 16rpx;
  295. .name-content-item {
  296. display: flex;
  297. justify-content: space-between;
  298. align-items: center;
  299. box-sizing: border-box;
  300. margin-bottom: 12rpx;
  301. padding: 9rpx 0;
  302. &:last-child {
  303. margin-bottom: 0;
  304. }
  305. .name-item {
  306. color: rgba(153, 153, 153, 1);
  307. font-family: DM Sans;
  308. font-size: 24rpx;
  309. font-weight: 400;
  310. line-height: 32rpx;
  311. }
  312. .value-item {
  313. display: flex;
  314. justify-content: center;
  315. align-items: center;
  316. color: rgba(153, 153, 153, 1);
  317. font-family: DM Sans;
  318. font-size: 24rpx;
  319. font-weight: 400;
  320. line-height: 32rpx;
  321. letter-spacing: 0%;
  322. text {
  323. margin-right: 8rpx;
  324. }
  325. image {
  326. width: 50rpx;
  327. height: 50rpx;
  328. border-radius: 50%;
  329. margin-right: 8rpx;
  330. background: linear-gradient(90deg,
  331. rgba(13, 39, 247, 1),
  332. rgba(19, 193, 234, 1) 100%);
  333. }
  334. }
  335. }
  336. }
  337. }
  338. }
  339. }
  340. </style>