workhistory.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. <template>
  2. <view class="page-box">
  3. <navBar title="工作信息" color="#000" />
  4. <view class="page-content">
  5. <view class="box" v-if="resumesClassify == 1">
  6. <view class="flex align-center justify-between">
  7. <view class="text-bold" style="width: 150rpx">公司名称</view>
  8. <view class="flex align-center">
  9. <u-input
  10. v-model="resumesTitle"
  11. placeholder="请输入公司名称"
  12. placeholder-style="color:#999999;"
  13. />
  14. <view class="margin-left-sm">
  15. <image
  16. src="../../static/images/my/right_icon.png"
  17. style="width: 12upx; height: 21upx"
  18. ></image>
  19. </view>
  20. </view>
  21. </view>
  22. <view
  23. class="margin-tb"
  24. style="width: 100%; height: 1rpx; background: #f2f2f2"
  25. ></view>
  26. <!-- <view class="flex align-center justify-between">
  27. <view class=" text-bold" style="width: 150rpx;">项目名称</view>
  28. <view class="flex align-center">
  29. <u-input v-model="resumesProject" placeholder="请输入项目名称" placeholder-style="color:#999999;" />
  30. <view class="margin-left-sm">
  31. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="margin-tb" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view> -->
  36. <view class="flex align-center justify-between">
  37. <view class="text-bold" style="width: 150rpx">担任岗位</view>
  38. <view class="text-right flex align-center">
  39. <u-input
  40. v-model="resumesPost"
  41. placeholder="请输入岗位名称"
  42. placeholder-style="color:#999999;;"
  43. />
  44. <view class="margin-left-sm">
  45. <image
  46. src="../../static/images/my/right_icon.png"
  47. style="width: 12upx; height: 21upx"
  48. ></image>
  49. </view>
  50. </view>
  51. </view>
  52. <view
  53. class="margin-tb"
  54. style="width: 100%; height: 1rpx; background: #f2f2f2"
  55. ></view>
  56. <view class="flex align-center justify-between">
  57. <view class="text-bold" style="width: 150rpx">在职时间</view>
  58. <view class="text-right flex align-center">
  59. <view :style="resumesTime1 ? '' : 'color: gray;'" @click="show = true">{{
  60. resumesTime1 ? resumesTime1 : "请选择开始时间"
  61. }}</view>
  62. <span style="padding: 0 10rpx 0 10rpx">至</span>
  63. <view :style="resumesTime2 ? '' : 'color: gray;'" @click="show2 = true">{{
  64. resumesTime2 ? resumesTime2 : "请选择结束时间"
  65. }}</view>
  66. <view class="margin-left-sm">
  67. <image
  68. src="../../static/images/my/right_icon.png"
  69. style="width: 12upx; height: 21upx"
  70. ></image>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="box" v-if="resumesClassify == 2">
  76. <view class="flex align-center justify-between">
  77. <view class="text-bold" style="width: 150rpx">项目名称</view>
  78. <view class="flex align-center">
  79. <u-input
  80. v-model="resumesTitle"
  81. placeholder="请输入项目名称"
  82. placeholder-style="color:#999999;"
  83. />
  84. <view class="margin-left-sm">
  85. <image
  86. src="../../static/images/my/right_icon.png"
  87. style="width: 12upx; height: 21upx"
  88. ></image>
  89. </view>
  90. </view>
  91. </view>
  92. <view
  93. class="margin-tb"
  94. style="width: 100%; height: 1rpx; background: #f2f2f2"
  95. ></view>
  96. <view class="flex align-center justify-between">
  97. <view class="text-bold" style="width: 150rpx">担任岗位</view>
  98. <view class="text-right flex align-center">
  99. <u-input
  100. v-model="resumesPost"
  101. placeholder="请输入担任岗位"
  102. placeholder-style="color:#999999;;"
  103. />
  104. <view class="margin-left-sm">
  105. <image
  106. src="../../static/images/my/right_icon.png"
  107. style="width: 12upx; height: 21upx"
  108. ></image>
  109. </view>
  110. </view>
  111. </view>
  112. <view
  113. class="margin-tb"
  114. style="width: 100%; height: 1rpx; background: #f2f2f2"
  115. ></view>
  116. <view class="flex align-center justify-between">
  117. <view class="text-bold" style="width: 150rpx">项目时间</view>
  118. <view class="text-right flex align-center">
  119. <view :style="resumesTime1 ? '' : 'color: gray;'" @click="show = true">{{
  120. resumesTime1 ? resumesTime1 : "请选择开始时间"
  121. }}</view>
  122. <span style="padding: 0 10rpx 0 10rpx">至</span>
  123. <view :style="resumesTime2 ? '' : 'color: gray;'" @click="show2 = true">{{
  124. resumesTime2 ? resumesTime2 : "请选择结束时间"
  125. }}</view>
  126. <view class="margin-left-sm">
  127. <image
  128. src="../../static/images/my/right_icon.png"
  129. style="width: 12upx; height: 21upx"
  130. ></image>
  131. </view>
  132. </view>
  133. </view>
  134. </view>
  135. <view class="box">
  136. <view class="text-bold">工作内容</view>
  137. <view class="padding-tb-sm">
  138. <u-input
  139. v-model="resumesContent"
  140. type="textarea"
  141. height="300"
  142. placeholder="添加工作经历,向企业全面展示你的能力"
  143. inputAlign="text-alight:left"
  144. />
  145. </view>
  146. </view>
  147. <view class="btn" @click="submit">保存</view>
  148. <u-picker v-model="show" mode="time" @confirm="Dataconfirm"></u-picker>
  149. <u-picker v-model="show2" mode="time" @confirm="Dataconfirm2"></u-picker>
  150. </view>
  151. </view>
  152. </template>
  153. <script>
  154. import navBar from "@/components/nav-bar/index.vue";
  155. export default {
  156. data() {
  157. return {
  158. show2: false,
  159. resumesTitle: "",
  160. resumesProject: "", //项目名称
  161. resumesPost: "",
  162. resumesTime: "",
  163. resumesTime1: "",
  164. resumesTime2: "",
  165. resumesContent: "",
  166. resumesCompanyList: [],
  167. resumesWorkList: [],
  168. show: false,
  169. resumesClassify: "",
  170. index: "",
  171. };
  172. },
  173. components: {
  174. navBar,
  175. },
  176. onLoad(option) {
  177. if (option.state) {
  178. this.resumesClassify = option.state;
  179. if (option.state == 2) {
  180. uni.setNavigationBarTitle({
  181. title: "项目经验",
  182. });
  183. if (uni.getStorageSync("resumesWorkList")) {
  184. //项目经验
  185. this.resumesWorkList = uni.getStorageSync("resumesWorkList");
  186. if (option.index != 1) {
  187. this.index = option.index;
  188. let obj = JSON.parse(option.list);
  189. this.resumesTitle = obj.resumesTitle;
  190. this.resumesProject = obj.resumesProject;
  191. this.resumesPost = obj.resumesPost;
  192. this.resumesContent = obj.resumesContent;
  193. let time = obj.resumesTime.split(" - ");
  194. this.resumesTime1 = time[0];
  195. this.resumesTime2 = time[1];
  196. this.$forceUpdate();
  197. }
  198. }
  199. } else {
  200. if (uni.getStorageSync("resumesCompanyList")) {
  201. //工作经验
  202. this.resumesCompanyList = uni.getStorageSync("resumesCompanyList");
  203. if (option.index) {
  204. this.index = option.index;
  205. let obj = JSON.parse(option.list);
  206. this.resumesTitle = obj.resumesTitle;
  207. this.resumesProject = obj.resumesProject;
  208. this.resumesPost = obj.resumesPost;
  209. this.resumesContent = obj.resumesContent;
  210. let time = obj.resumesTime.split(" - ");
  211. this.resumesTime1 = time[0];
  212. this.resumesTime2 = time[1];
  213. this.$forceUpdate();
  214. }
  215. }
  216. }
  217. }
  218. },
  219. onShow() {},
  220. methods: {
  221. Dataconfirm2(e) {
  222. this.resumesTime2 = e.year + "-" + e.month + "-" + e.day;
  223. },
  224. Dataconfirm(e) {
  225. this.resumesTime1 = e.year + "-" + e.month + "-" + e.day;
  226. },
  227. submit() {
  228. this.resumesTime = this.resumesTime1 + " - " + this.resumesTime2;
  229. if (this.resumesClassify == 1 && !this.resumesTitle) {
  230. uni.showToast({
  231. title: "请输入公司名称",
  232. icon: "none",
  233. duration: 1000,
  234. });
  235. return;
  236. }
  237. // if (!this.resumesProject) {
  238. // uni.showToast({
  239. // title: '请输入项目名称',
  240. // icon: 'none',
  241. // duration: 1000
  242. // })
  243. // return
  244. // }
  245. if (!this.resumesPost) {
  246. uni.showToast({
  247. title: "请输入岗位名称 ",
  248. icon: "none",
  249. duration: 1000,
  250. });
  251. return;
  252. }
  253. if (!this.resumesTime1) {
  254. uni.showToast({
  255. title: "请选择开始时间",
  256. icon: "none",
  257. duration: 1000,
  258. });
  259. return;
  260. }
  261. if (!this.resumesTime2) {
  262. uni.showToast({
  263. title: "请选择结束时间",
  264. icon: "none",
  265. duration: 1000,
  266. });
  267. return;
  268. }
  269. if (!this.resumesContent) {
  270. uni.showToast({
  271. title: "添加工作经历向企业全面展示你的能力",
  272. icon: "none",
  273. duration: 1000,
  274. });
  275. return;
  276. }
  277. if (this.resumesClassify == "1") {
  278. let data = {
  279. resumesTitle: this.resumesTitle,
  280. resumesPost: this.resumesPost,
  281. resumesTime: this.resumesTime,
  282. resumesContent: this.resumesContent,
  283. resumesClassify: this.resumesClassify,
  284. resumesProject: this.resumesProject,
  285. };
  286. if (this.index && this.index != "") {
  287. this.resumesCompanyList[this.index] = data;
  288. } else {
  289. this.resumesCompanyList.push(data);
  290. }
  291. uni.setStorageSync("resumesCompanyList", this.resumesCompanyList);
  292. } else if (this.resumesClassify == "2") {
  293. let data = {
  294. resumesTitle: this.resumesTitle,
  295. resumesPost: this.resumesPost,
  296. resumesTime: this.resumesTime,
  297. resumesContent: this.resumesContent,
  298. resumesClassify: this.resumesClassify,
  299. resumesProject: this.resumesProject,
  300. };
  301. if (this.index && this.index != "") {
  302. this.resumesWorkList[this.index] = data;
  303. } else {
  304. this.resumesWorkList.push(data);
  305. }
  306. uni.setStorageSync("resumesWorkList", this.resumesWorkList);
  307. }
  308. this.index = "";
  309. this.resumesTitle = "";
  310. this.resumesProject = "";
  311. this.resumesPost = "";
  312. this.resumesContent = "";
  313. this.resumesTime1 = "";
  314. this.resumesTime2 = "";
  315. uni.navigateBack();
  316. },
  317. },
  318. };
  319. </script>
  320. <style lang="less" scoped>
  321. page {
  322. background: #f2f2f7;
  323. }
  324. .page-box {
  325. position: absolute;
  326. left: 0;
  327. bottom: 0;
  328. right: 0;
  329. top: 0;
  330. overflow: hidden;
  331. display: flex;
  332. flex-direction: column;
  333. .page-content {
  334. flex: 1;
  335. overflow: hidden;
  336. overflow-y: auto;
  337. }
  338. }
  339. .box {
  340. background: #ffffff;
  341. border-radius: 24upx;
  342. margin: 30upx;
  343. padding: 30upx;
  344. }
  345. .btn {
  346. background: #016bf6;
  347. border-radius: 10upx;
  348. text-align: center;
  349. // margin-top: 30upx;
  350. padding: 30upx 0upx;
  351. color: #ffffff;
  352. // font-weight: bold;
  353. // letter-spacing: 2rpx;
  354. margin: 30upx;
  355. }
  356. </style>