index.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <template>
  2. <div :class="mobile ? 'mobileMain' : ''" :style="{
  3. marginTop: mainMarginTop,
  4. marginBottom: mobile ? '0px' : '30px !important'
  5. }">
  6. <div class="requirements-container" v-if="!mobile">
  7. <div class="requirements-title">发布需求</div>
  8. <div class="requirements-step-container">
  9. <div class="requirements-step">
  10. <div class="requirements-step-status">
  11. <div class="requirements-step-icon" :class="FirstStepStatus">
  12. <div class="requirements-step-tips">
  13. 选择需求类型
  14. </div>
  15. </div>
  16. </div>
  17. <div class="requirements-step-line" :class="FirstStepStatus"></div>
  18. </div>
  19. <div class="requirements-step">
  20. <div class="requirements-step-status">
  21. <div class="requirements-step-icon" :class="secondStepStatus">
  22. <div class="requirements-step-tips">
  23. 填写需求描述
  24. </div>
  25. </div>
  26. </div>
  27. <div class="requirements-step-line" :class="secondStepStatus"></div>
  28. </div>
  29. <div class="requirements-step">
  30. <div class="requirements-step-status">
  31. <div class="requirements-step-icon" :class="thirdStepStatus">
  32. <div class="requirements-step-tips">
  33. 发布成功
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. <FormFirstStep v-if="isFirstFormShow" v-on:formSubmit="formSubmit" v-on:formChange="formChange"></FormFirstStep>
  40. <FormXuQiu v-if="isFormXuqiuShow" v-on:formChange="formChange" v-on:formSubmit="formSubmit"></FormXuQiu>
  41. <FormZhengBao v-if="isFormZhengBaoShow" v-on:formChange="formChange" v-on:formSubmit="formSubmit"></FormZhengBao>
  42. <FormYunDuan v-if="isFormYunDuanShow" v-on:formChange="formChange" v-on:formSubmit="formSubmit"></FormYunDuan>
  43. <StepEnd v-if="isStepEndShow"></StepEnd>
  44. <FormRecomment ref="FormRecomment" :projectid="projectid"></FormRecomment>
  45. </div>
  46. </div>
  47. </template>
  48. <script>
  49. import {
  50. mapState
  51. } from "vuex";
  52. import qs from "qs";
  53. import FormFirstStep from "./components/FormFirstStep.vue";
  54. // 发布需求梳理表单
  55. import FormXuQiu from "./components/Form_xuqiu.vue";
  56. // 发布整包表单
  57. import FormZhengBao from "./components/Form_zhengbao";
  58. // 发布云端项目
  59. import FormYunDuan from "./components/Form_yunduan";
  60. import FormRecomment from "./components/Form_recommend.vue";
  61. // 发布成功页
  62. import StepEnd from "./components/StepEnd.vue";
  63. export default {
  64. name: "SeoLearnList",
  65. components: {
  66. FormFirstStep,
  67. FormXuQiu,
  68. FormZhengBao,
  69. FormYunDuan,
  70. StepEnd,
  71. FormRecomment
  72. },
  73. data() {
  74. return {
  75. baseUrl: "",
  76. mobile: false,
  77. // firstLoad: true,
  78. isWeixinApp: true,
  79. // 0 默认 1云端工作 2 项目整包 3 需求梳理
  80. type: 0,
  81. // 当前激活的状态
  82. active: 0,
  83. // wait process finish
  84. activeStatus: "wait",
  85. projectid: "",
  86. };
  87. },
  88. head() {
  89. const {
  90. title = "项目外包_方案定制_专业服务众包平台-【程序员客栈项目开发】-程序员客栈",
  91. keyword = "众包,众包平台,众包网站,软件外包,软件众包平台,项目外包,兼职,兼职平台,软件开发,APP开发,小程序开发,微信小程序开发,网站建设,游戏开发,微信开发,移动应用开发,行业解决方案,创意设计,LOGO设计,动画动漫,影视制作,工业设计,技术服务,短期驻场,IT运维,测试服务,入驻赚钱,外包线索",
  92. description = "程序员客栈项目开发服务,为科技企业提供技术新⼈⼒解决⽅案,为程序员提供各式⼯作成⻓机会。",
  93. h1 = "",
  94. canonical = "",
  95. metaLocation
  96. } = this.head || {};
  97. let obj = {
  98. title: title,
  99. meta: [{
  100. name: "keywords",
  101. content: keyword
  102. },
  103. {
  104. name: "description",
  105. content: description
  106. },
  107. {
  108. name: "h1",
  109. content: h1
  110. }
  111. ],
  112. link: [{
  113. rel: "canonical",
  114. href: canonical
  115. }]
  116. };
  117. if (metaLocation) {
  118. obj.meta.push({
  119. name: "location",
  120. content: metaLocation
  121. });
  122. }
  123. return obj;
  124. },
  125. computed: {
  126. ...mapState(["deviceType"]),
  127. showWxHeader() {
  128. return (
  129. !this.deviceType.app &&
  130. !this.isWeixinApp &&
  131. (this.deviceType.android || this.deviceType.ios)
  132. );
  133. },
  134. mainMarginTop() {
  135. if (this.mobile && this.showWxHeader) {
  136. return "64px !important";
  137. } else if (this.mobile) {
  138. return "0px !important";
  139. } else {
  140. return "20px !important";
  141. }
  142. },
  143. FirstStepStatus: function () {
  144. let status = "";
  145. switch (this.active) {
  146. case 1:
  147. status = this.activeStatus;
  148. break;
  149. case 2:
  150. status = "success";
  151. break;
  152. case 3:
  153. status = "success";
  154. break;
  155. default:
  156. status = "wait";
  157. }
  158. return status;
  159. },
  160. secondStepStatus: function () {
  161. let status = "";
  162. switch (this.active) {
  163. case 1:
  164. status = "wait";
  165. break;
  166. case 2:
  167. status = this.activeStatus;
  168. break;
  169. case 3:
  170. status = "success";
  171. break;
  172. default:
  173. status = "wait";
  174. }
  175. return status;
  176. },
  177. thirdStepStatus: function () {
  178. let status = "";
  179. switch (this.active) {
  180. case 1:
  181. status = "wait";
  182. break;
  183. case 2:
  184. status = "wait";
  185. break;
  186. case 3:
  187. status = "success";
  188. break;
  189. default:
  190. status = "wait";
  191. }
  192. return status;
  193. },
  194. isFirstFormShow: function () {
  195. return this.active == 1;
  196. },
  197. isFormXuqiuShow: function () {
  198. return this.active == 2 && this.type == 3;
  199. },
  200. isFormZhengBaoShow: function () {
  201. return this.active == 2 && this.type == 2;
  202. },
  203. isFormYunDuanShow: function () {
  204. return this.active == 2 && this.type == 1;
  205. },
  206. isStepEndShow: function () {
  207. return this.active == 3;
  208. }
  209. },
  210. watch: {
  211. "$route.query": function (val) {
  212. if (val.step) {
  213. this.active = Number(val.step);
  214. } else {
  215. this.active = 1;
  216. }
  217. if (val.type) {
  218. this.type = Number(val.type);
  219. } else {
  220. this.type = 0;
  221. }
  222. if (val.type == 1 && val.step == 3 && val.projectid) {
  223. this.projectid = val.projectid
  224. this.$nextTick(() => {
  225. this.$refs['FormRecomment'].show()
  226. })
  227. }
  228. this.activeStatus = "wait";
  229. }
  230. },
  231. mounted() {
  232. let query = this.$route.query;
  233. if (query.step) {
  234. this.active = Number(query.step);
  235. } else {
  236. this.active = 1;
  237. }
  238. if (query.type) {
  239. this.type = Number(query.type);
  240. } else {
  241. this.type = 0;
  242. }
  243. if (query.type == 1 && query.step == 3 && query.projectid) {
  244. this.projectid = query.projectid
  245. this.$nextTick(() => {
  246. if(query.show)
  247. {
  248. this.$refs['FormRecomment'].show();
  249. }
  250. else
  251. {
  252. this.$refs['FormRecomment'].hide();
  253. }
  254. })
  255. }
  256. this.baseUrl = this.$store.state.domainConfig.siteUrl;
  257. this.isWeixinApp = navigator.userAgent.indexOf("miniProgram") > -1;
  258. },
  259. methods: {
  260. formSubmit(step, data) {
  261. this.checkLogin(true);
  262. let query = {};
  263. query["show"]=false;
  264. if (step == 1) {
  265. this.type = data;
  266. query["type"] = this.type;
  267. }
  268. if (step == 2 && this.type == 1) {
  269. query["projectid"] = data;
  270. query["type"] = this.type;
  271. }
  272. if(step==3)
  273. {
  274. query["show"]=true;
  275. }
  276. // 进入下一步
  277. step++;
  278. this.active = step;
  279. query["step"] = this.active;
  280. this.activeStatus = "process";
  281. this.$nextTick(() => {
  282. this.$router.push({
  283. path: "/frontend/requirements",
  284. query: query
  285. });
  286. });
  287. },
  288. formChange(step, type) {
  289. this.active = step;
  290. this.activeStatus = type;
  291. }
  292. }
  293. };
  294. </script>
  295. <style lang="scss">
  296. @import "@/assets/css/requirements/index.scss";
  297. </style>