_id.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. <template>
  2. <div>
  3. <div class="wrapper pc" v-if="screenWidth > 960">
  4. <h1 class="title">{{city}}-{{job}}收入水平</h1>
  5. <div class="subtitle">{{city}}{{job}}平均工资:¥{{avg_salary}}/月,统计来自程序员客栈(proginn.com)</div>
  6. <div class="content">
  7. <div class="module-wrapper">
  8. <div class="module-title">开发者薪资范围分布</div>
  9. <div id="range-chart" class="range-chart"></div>
  10. </div>
  11. <div class="module-wrapper">
  12. <div class="average-title">平均工资:¥{{avg_salary}}元/月</div>
  13. <div
  14. class="average-subtitle"
  15. >最高为{{max_salary}}元/月,最低为{{min_salary}}元/月,其中,平均工资为{{avg_salary}}元/月</div>
  16. <img class="average-img" src="@/assets/img/salary/average_salary.png" alt />
  17. </div>
  18. <!-- <div class="module-wrapper">-->
  19. <!-- <div class="module-title">杭州其他岗位平均工资</div>-->
  20. <!-- <div id="industry-chart" class="industry-chart"></div>-->
  21. <!-- </div>-->
  22. <!-- <div class="module-wrapper">-->
  23. <!-- <div class="module-title">按工作经验统计</div>-->
  24. <!-- <div id="experience-chart" class="experience-chart"></div>-->
  25. <!-- </div>-->
  26. <!-- <div class="module-wrapper">-->
  27. <!-- <div class="module-title">按学历统计</div>-->
  28. <!-- <div id="education-chart" class="education-chart"></div>-->
  29. <!-- </div>-->
  30. <!-- <div class="module-wrapper">-->
  31. <!-- <div class="module-title">按各城市岗位需求统计</div>-->
  32. <!-- <div id="city-chart" class="city-chart"></div>-->
  33. <!-- </div>-->
  34. <div class="module-wrapper">
  35. <div class="module-title">全国城市{{job}}平均工资</div>
  36. <div class="module-list">
  37. <div class="module-item" v-for="citys in allCitySalary">
  38. <div class="module-label">{{citys.city}}</div>
  39. <div class="module-line"></div>
  40. <div class="module-salary">¥{{citys.salary}}元/月</div>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="module-wrapper">
  45. <div class="module-title">{{city}}其他岗位平均工资</div>
  46. <div class="module-list">
  47. <div class="module-item" v-for="jobs in jobList">
  48. <div class="module-label">{{jobs.job}}</div>
  49. <div class="module-line"></div>
  50. <div class="module-salary">¥{{jobs.salary}}元/月</div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="wrapper mobile" v-else-if="screenWidth > 0">
  57. <div class="title-wrapper">
  58. <div class="title">{{city}}-{{job}}收入水平</div>
  59. <div class="subtitle">杭州产品经理平均工资:¥66666/月,统计来自程序员客栈(proginn.com)</div>
  60. </div>
  61. <div class="module-wrapper">
  62. <div class="module-title">开发者薪资排行城市TOP10</div>
  63. <div id="range-chart" class="range-chart"></div>
  64. </div>
  65. <div class="module-wrapper">
  66. <div class="average-title">平均工资:¥13000元/月</div>
  67. <div class="average-subtitle">最高为16000元/月,最低为10000元/月,其中,人工智能行业的产品经理平均工资最高达54363元/月</div>
  68. <img class="average-img" src="@/assets/img/salary/average_salary.png" alt />
  69. </div>
  70. <!-- <div class="module-wrapper">-->
  71. <!-- <div class="module-title">杭州其他岗位平均工资</div>-->
  72. <!-- <div id="industry-chart" class="industry-chart"></div>-->
  73. <!-- </div>-->
  74. <!-- <div class="module-wrapper">-->
  75. <!-- <div class="module-title">按工作经验统计</div>-->
  76. <!-- <div id="experience-chart" class="experience-chart"></div>-->
  77. <!-- </div>-->
  78. <!-- <div class="module-wrapper">-->
  79. <!-- <div class="module-title">按学历统计</div>-->
  80. <!-- <div id="education-chart" class="education-chart"></div>-->
  81. <!-- </div>-->
  82. <!-- <div class="module-wrapper">-->
  83. <!-- <div class="module-title">按各城市岗位需求统计</div>-->
  84. <!-- <div id="city-chart" class="city-chart"></div>-->
  85. <!-- </div>-->
  86. <div class="module-wrapper">
  87. <div class="module-title">全国城市{{job}}平均工资</div>
  88. <div class="module-list">
  89. <div class="module-item" v-for="citys in allCitySalary">
  90. <div class="module-label">{{citys.city}}</div>
  91. <div class="module-line"></div>
  92. <div class="module-salary">¥{{citys.salary}}元/月</div>
  93. </div>
  94. </div>
  95. </div>
  96. <div class="module-wrapper">
  97. <div class="module-title">{{city}}其他岗位平均工资</div>
  98. <div class="module-list">
  99. <div class="module-item" v-for="jobs in jobList">
  100. <div class="module-label">{{jobs.job}}</div>
  101. <div class="module-line"></div>
  102. <div class="module-salary">¥{{jobs.salary}}元/月</div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </template>
  109. <script>
  110. export default {
  111. head() {
  112. return {
  113. title: `${this.city}${this.job}月薪工资待遇查询,${this.city}企业招聘${this.job}费用查询-程序员客栈`,
  114. meta: [
  115. {
  116. name: "keywords",
  117. content: `${this.city}${this.job}工资, ${this.city}${this.job}兼职工资, ${this.city}企业${this.job}招聘费用`
  118. },
  119. {
  120. name: "descrption",
  121. content: `程序员客栈提供${this.city}${this.job}工资查询,让${this.city}${this.job}程序员能了解自身兼职价值,帮助${this.city}有${this.job}招聘需求的企业利用合理的费用找到合适的人才!`
  122. }
  123. ]
  124. };
  125. },
  126. data() {
  127. return {
  128. screenWidth: 0,
  129. job: "",
  130. city: "",
  131. avg_salary: 0,
  132. max_salary: 0,
  133. min_salary: 0,
  134. jobList: [],
  135. experience: [],
  136. allCitySalary: [],
  137. salaryRange: []
  138. };
  139. },
  140. mounted() {
  141. this.screenWidth = window.screen.width;
  142. this.$nextTick(() => {
  143. this.getData();
  144. // this.getRangeChart();
  145. // this.getIndustryChart();
  146. // this.getExperienceChart();
  147. // this.getEducationChart()
  148. // this.getCityChart()
  149. });
  150. },
  151. methods: {
  152. async getData() {
  153. const path = window.location.pathname
  154. const cityJob = path.split('/')[2]
  155. this.city = cityJob.split('-')[0]
  156. this.job = cityJob.split('-')[1]
  157. let params = {
  158. job: this.job,
  159. city: this.city
  160. };
  161. let res = await this.$axios.$post("/api/salary/search_info", params);
  162. this.job = res.data.info.job;
  163. this.city = res.data.info.city;
  164. this.avg_salary = res.data.info.avg_salary;
  165. this.max_salary = res.data.info.max_salary;
  166. this.min_salary = res.data.info.min_salary;
  167. this.jobList = res.data.jobSort || [];
  168. this.experience = res.data.experience || [];
  169. this.allCitySalary = res.data.allCitySalary || [];
  170. this.salaryRange = res.data.salaryRange || [];
  171. for (let i = 0; i < this.jobList.length; i++) {
  172. this.jobList[i].salary = parseInt(this.jobList[i].salary);
  173. }
  174. for (let i = 0; i < this.experience.length; i++) {
  175. this.experience[i].salary = parseInt(this.experience[i].salary);
  176. }
  177. const sortJob = this.jobList;
  178. const sortExperience = this.experience;
  179. const allSalaryRange = this.salaryRange;
  180. const chart = new G2.Chart({
  181. container: "range-chart",
  182. forceFit: true,
  183. height: 300
  184. });
  185. chart.source(allSalaryRange, {
  186. percent: {
  187. formatter: function formatter(val) {
  188. val = val * 100 + "%";
  189. return val;
  190. }
  191. }
  192. });
  193. chart.coord("theta", {
  194. radius: 0.75
  195. });
  196. chart.tooltip({
  197. showTitle: false,
  198. itemTpl:
  199. '<li><span style="background-color:{color};" class="g2-tooltip-marker"></span>{name}: {value}</li>'
  200. });
  201. chart
  202. .intervalStack()
  203. .position("percent")
  204. .color("item")
  205. .label("percent", {
  206. formatter: function formatter(val, item) {
  207. return item.point.item + ": " + val;
  208. }
  209. })
  210. .tooltip("item*percent", function(item, percent) {
  211. percent = percent * 100 + "%";
  212. return {
  213. name: item,
  214. value: percent
  215. };
  216. })
  217. .style({
  218. lineWidth: 1,
  219. stroke: "#fff"
  220. });
  221. chart.render();
  222. // const chart1 = new G2.Chart({
  223. // container: "industry-chart",
  224. // forceFit: true,
  225. // height: 300
  226. // });
  227. // chart1.source(sortJob);
  228. // chart1.scale("salary", {
  229. // min: 0
  230. // });
  231. // chart1.scale("job", {
  232. // range: [0, 1]
  233. // });
  234. // chart1.tooltip({
  235. // crosshairs: {
  236. // type: "line"
  237. // }
  238. // });
  239. // chart1.line().position("job*salary");
  240. // chart1
  241. // .point()
  242. // .position("job*salary")
  243. // .size(4)
  244. // .shape("circle")
  245. // .style({
  246. // stroke: "#fff",
  247. // lineWidth: 1
  248. // });
  249. // chart1.render();
  250. // const chart2 = new G2.Chart({
  251. // container: "experience-chart",
  252. // forceFit: true,
  253. // height: 300
  254. // });
  255. // chart2.source(sortExperience);
  256. // chart2.scale("salary", {
  257. // min: 0
  258. // });
  259. // chart2.scale("experience", {
  260. // range: [0, 1]
  261. // });
  262. // chart2.tooltip({
  263. // crosshairs: {
  264. // type: "line"
  265. // }
  266. // });
  267. // chart2.line().position("experience*salary");
  268. // chart2
  269. // .point()
  270. // .position("experience*salary")
  271. // .size(4)
  272. // .shape("circle")
  273. // .style({
  274. // stroke: "#fff",
  275. // lineWidth: 1
  276. // });
  277. // chart2.render();
  278. }
  279. }
  280. };
  281. </script>
  282. <style lang="scss" scoped>
  283. .wrapper {
  284. overflow: hidden;
  285. }
  286. .main {
  287. margin: 0;
  288. width: 100%;
  289. }
  290. .pc {
  291. margin: 10px auto;
  292. padding-bottom: 36px;
  293. width: 1000px;
  294. background-color: #ffffff;
  295. .title {
  296. margin-top: 30px;
  297. margin-left: 18px;
  298. line-height: 28px;
  299. font-weight: 600;
  300. font-size: 20px;
  301. color: #333333;
  302. }
  303. .subtitle {
  304. margin-top: 7px;
  305. margin-left: 18px;
  306. line-height: 17px;
  307. font-size: 12px;
  308. color: #999999;
  309. }
  310. .content {
  311. margin-top: 51px;
  312. display: flex;
  313. justify-content: center;
  314. flex-wrap: wrap;
  315. }
  316. .module-wrapper {
  317. overflow: hidden;
  318. width: 480px;
  319. min-height: 366px;
  320. border: 1px solid #ebebeb;
  321. }
  322. .module-title {
  323. margin-top: 22px;
  324. margin-left: 31px;
  325. line-height: 25px;
  326. font-weight: 600;
  327. font-size: 18px;
  328. color: #000000;
  329. }
  330. .range-chart,
  331. .industry-chart,
  332. .experience-chart,
  333. .education-chart,
  334. .city-chart {
  335. margin-top: 38px;
  336. margin-left: -20px;
  337. }
  338. .average-title {
  339. margin-top: 51px;
  340. line-height: 28px;
  341. text-align: center;
  342. font-weight: 600;
  343. font-size: 20px;
  344. color: #000000;
  345. }
  346. .average-subtitle {
  347. margin: 9px auto 0;
  348. width: 422px;
  349. line-height: 18px;
  350. font-size: 13px;
  351. color: #666666;
  352. }
  353. .average-img {
  354. margin: 50px auto 0;
  355. display: block;
  356. width: 235px;
  357. height: 135px;
  358. }
  359. .module-list {
  360. margin-top: 24px;
  361. margin-bottom: 10px;
  362. }
  363. .module-item {
  364. display: flex;
  365. align-items: center;
  366. }
  367. .module-label {
  368. margin-left: 25px;
  369. line-height: 32px;
  370. font-weight: 500;
  371. font-size: 13px;
  372. color: #000000;
  373. }
  374. .module-line {
  375. flex: 1;
  376. margin-left: 13px;
  377. margin-right: 5px;
  378. border-bottom: 1px dashed #bcbcbc;
  379. }
  380. .module-salary {
  381. margin-right: 23px;
  382. line-height: 32px;
  383. font-size: 12px;
  384. color: #666666;
  385. }
  386. }
  387. .mobile {
  388. .title-wrapper {
  389. overflow: hidden;
  390. width: 100%;
  391. height: 2.38rem;
  392. background-color: #ffffff;
  393. }
  394. .title {
  395. margin-top: 0.54rem;
  396. margin-left: 0.3rem;
  397. line-height: 0.56rem;
  398. font-weight: 600;
  399. font-size: 0.4rem;
  400. color: #333333;
  401. }
  402. .subtitle {
  403. margin-top: 0.1rem;
  404. margin-left: 0.3rem;
  405. width: 7.04rem;
  406. line-height: 0.34rem;
  407. font-size: 0.24rem;
  408. color: #999999;
  409. }
  410. .module-wrapper {
  411. overflow: hidden;
  412. margin-top: 0.12rem;
  413. width: 100%;
  414. background-color: #ffffff;
  415. }
  416. .module-title {
  417. margin-top: 0.38rem;
  418. margin-left: 0.36rem;
  419. line-height: 0.44rem;
  420. font-weight: 600;
  421. font-size: 0.32rem;
  422. color: #000000;
  423. }
  424. .range-chart,
  425. .industry-chart,
  426. .experience-chart,
  427. .education-chart,
  428. .city-chart {
  429. margin-top: 0.38rem;
  430. margin-left: -0.4rem;
  431. }
  432. .average-title {
  433. margin-top: 0.38rem;
  434. margin-left: 0.36rem;
  435. line-height: 0.44rem;
  436. font-weight: 600;
  437. font-size: 0.32rem;
  438. color: #000000;
  439. }
  440. .average-subtitle {
  441. margin: 0.28rem auto 0;
  442. width: 6.76rem;
  443. line-height: 0.36rem;
  444. font-size: 0.24rem;
  445. color: #666666;
  446. }
  447. .average-img {
  448. margin: 0.94rem auto 0;
  449. display: block;
  450. width: 4.7rem;
  451. height: 2.7rem;
  452. }
  453. .module-list {
  454. margin-top: 0.34rem;
  455. margin-bottom: 0.4rem;
  456. }
  457. .module-item {
  458. display: flex;
  459. align-items: center;
  460. }
  461. .module-label {
  462. margin-left: 0.36rem;
  463. line-height: 0.64rem;
  464. font-weight: 500;
  465. font-size: 0.26rem;
  466. color: #000000;
  467. }
  468. .module-line {
  469. flex: 1;
  470. margin-left: 0.2rem;
  471. margin-right: 0.1rem;
  472. width: 4.44rem;
  473. border-bottom: 0.02rem dashed #bcbcbc;
  474. }
  475. .module-salary {
  476. margin-right: 0.3rem;
  477. line-height: 0.64rem;
  478. font-size: 0.24rem;
  479. color: #666666;
  480. }
  481. }
  482. </style>