数字化园区前端项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Service.vue 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <!-- 招商服务 -->
  2. <template>
  3. <div class="service" id="anchor-service">
  4. <div class="title">招商服务</div>
  5. <section class="service_box">
  6. <div class="left">
  7. <div
  8. v-for="(item, index) in serviceTabs"
  9. :class="['tab_box', 'pointer', activeTab === index ? 'active' : '']"
  10. :key="item.name"
  11. @click="changeTab(index)"
  12. >
  13. <div class="tab_title">{{ item.name }}</div>
  14. <ul class="tab_ul">
  15. <li v-for="item1 in item.children" :key="item1">{{ item1 }}</li>
  16. </ul>
  17. </div>
  18. <div class="enter pointer" @click="showDialog">
  19. <div class="left">
  20. <span class="enter_title">我是企业</span>
  21. <span class="enter_btn">
  22. <span>我要入驻</span>
  23. <i class="el-icon-right"></i>
  24. </span>
  25. </div>
  26. <img src="@assets/image/index/icon_company_big.png" alt="企业" />
  27. </div>
  28. </div>
  29. <div
  30. :class="['right', lists && lists.length > 0 ? '' : 'no_data_padding']"
  31. v-loading="serviceLoading"
  32. >
  33. <ul class="product_ul" v-if="lists && lists.length > 0">
  34. <li
  35. class="pointer"
  36. v-for="item in lists"
  37. :key="
  38. activeTab === 0 ? item.parkServiceProductId : item.propertyManagementId
  39. "
  40. @click="
  41. goDetail(
  42. activeTab === 0
  43. ? item.parkServiceProductId
  44. : item.propertyManagementId
  45. )
  46. "
  47. >
  48. <img
  49. :src="
  50. activeTab === 0
  51. ? formatImg(item.productMasterImg[0])
  52. : formatImg(item.imgList[0])
  53. "
  54. alt="产品图片"
  55. />
  56. <div class="product_info">
  57. <span class="product_title">
  58. {{ activeTab === 0 ? item.productName : item.name }}
  59. </span>
  60. <span class="product_content">
  61. {{ activeTab === 0 ? item.productDescription : item.introduce }}
  62. </span>
  63. <span class="product_price">
  64. <span>
  65. 价格:
  66. <span class="price">
  67. {{ item.showPrice || "0" }}
  68. </span>
  69. </span>
  70. <span class="more"><i class="el-icon-right"></i></span>
  71. </span>
  72. </div>
  73. </li>
  74. </ul>
  75. <div
  76. v-else
  77. :class="['have_no_product', activeTab === 0 ? 'product_bg' : 'service_bg']"
  78. >
  79. <div class="service_text">
  80. <span>{{ serviceText[activeTab].title }}</span>
  81. <span>
  82. {{ serviceText[activeTab].subtitle }}
  83. </span>
  84. </div>
  85. <div class="pointer service_btn" @click="linkCustomerService">
  86. <span>{{ serviceText[activeTab].buttonText }}</span>
  87. <i class="el-icon-right"></i>
  88. </div>
  89. </div>
  90. </div>
  91. </section>
  92. <apply-for-admission ref="applyForAdmission"></apply-for-admission>
  93. </div>
  94. </template>
  95. <script>
  96. //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  97. //例如:import 《组件名称》 from '《组件路径》';
  98. import { getParkServiceProduct, getPropertyManage } from "@api/index";
  99. import { formatImg, routerOpenInNewWindow } from "@/utils/common.js";
  100. import ApplyForAdmission from "./ApplyForAdmission.vue";
  101. import { linkCustomerService } from "@mixin/customerService";
  102. export default {
  103. //import引入的组件需要注入到对象中才能使用
  104. components: { ApplyForAdmission },
  105. mixins: [linkCustomerService],
  106. data() {
  107. //这里存放数据
  108. return {
  109. serviceTabs: [
  110. {
  111. name: "产业招商",
  112. children: [
  113. "智能制造",
  114. "集成电路",
  115. "汽车装配",
  116. "生物医药",
  117. "智能家居",
  118. "新材料",
  119. ],
  120. },
  121. {
  122. name: "招商载体",
  123. children: [
  124. "街坊花园式工业园区",
  125. "城镇居住片区",
  126. "产业集聚片区",
  127. "生态乡野片区",
  128. ],
  129. },
  130. ],
  131. activeTab: 0,
  132. queryParams: {
  133. page: 1,
  134. pageSize: 3,
  135. },
  136. lists: [],
  137. tempList1: [],
  138. tempList2: [],
  139. serviceLoading: false,
  140. serviceText: [
  141. {
  142. title: "园区税收优惠政策",
  143. subtitle: "享园区高额奖励扶持返税",
  144. buttonText: "获取园区招商具体详情",
  145. },
  146. {
  147. title: "高标准厂房出租,环境优美,交通便捷",
  148. subtitle: "可按企业需求定制,减轻企业负担",
  149. buttonText: "获取园区载体具体详情",
  150. },
  151. ],
  152. };
  153. },
  154. //监听属性 类似于data概念
  155. computed: {},
  156. //监控data中的数据变化
  157. watch: {},
  158. //方法集合
  159. methods: {
  160. formatImg,
  161. changeTab(index) {
  162. this.activeTab = index;
  163. this.lists = [];
  164. this.getData();
  165. },
  166. getData() {
  167. if (this.activeTab === 0) {
  168. this.lists = this.tempList1;
  169. // this.getParkServiceProduct();
  170. } else {
  171. this.lists = this.tempList2;
  172. // this.getPropertyManage();
  173. }
  174. },
  175. getParkServiceProduct() {
  176. this.serviceLoading = true;
  177. getParkServiceProduct(this.queryParams)
  178. .then(res => {
  179. console.log(res.data);
  180. if (res.data.status == 0) {
  181. this.tempList1 = res.data.data.list;
  182. this.lists = this.tempList1;
  183. } else {
  184. this.$message.error(`获取数据失败,请刷新重试!`);
  185. }
  186. this.serviceLoading = false;
  187. })
  188. .catch(err => {
  189. this.$message.error(`获取数据失败,失败原因${err},请刷新重试!`);
  190. this.serviceLoading = false;
  191. });
  192. },
  193. getPropertyManage() {
  194. this.serviceLoading = true;
  195. getPropertyManage(this.queryParams)
  196. .then(res => {
  197. console.log(res.data);
  198. if (res.data.status == 0) {
  199. this.tempList2 = res.data.data.list;
  200. } else {
  201. this.$message.error(`获取数据失败,请刷新重试!`);
  202. }
  203. this.serviceLoading = false;
  204. })
  205. .catch(err => {
  206. this.$message.error(`获取数据失败,失败原因${err},请刷新重试!`);
  207. this.serviceLoading = false;
  208. });
  209. },
  210. goDetail(id) {
  211. if (this.activeTab === 0) {
  212. routerOpenInNewWindow({
  213. path: "/investment-service/product-detail",
  214. query: {
  215. parkServiceProductId: id,
  216. },
  217. });
  218. } else {
  219. routerOpenInNewWindow({
  220. path: "/investment-service/property-detail",
  221. query: {
  222. propertyManagementId: id,
  223. },
  224. });
  225. }
  226. },
  227. showDialog() {
  228. this.$refs.applyForAdmission.showDialog();
  229. },
  230. },
  231. //生命周期 - 创建完成(可以访问当前this实例)
  232. created() {
  233. this.getParkServiceProduct();
  234. this.getPropertyManage();
  235. },
  236. //生命周期 - 挂载完成(可以访问DOM元素)
  237. mounted() {},
  238. };
  239. </script>
  240. <style lang="scss" scoped>
  241. //@import url(); 引入公共css类
  242. .service {
  243. @include size(100%, 910px);
  244. @include flex(column, center, center, null);
  245. background: url("~@assets/image/index/bg_service.png") no-repeat;
  246. background-size: 100% 100%;
  247. }
  248. .title {
  249. @include font(36px, $color-white);
  250. padding: 60px 0 40px;
  251. @include border-box;
  252. }
  253. .service_box {
  254. @include size($wrapWidth, 700px);
  255. background: #fff;
  256. padding: 30px;
  257. @include border-box;
  258. @include flex(row, space-between, flex-start, null);
  259. .left {
  260. @include size(260px, 100%);
  261. .tab_box {
  262. @include size(100%, calc((100% - 140px) / 2));
  263. margin-bottom: 20px;
  264. padding: 25px 10px 25px 30px;
  265. @include border-box;
  266. .tab_ul {
  267. @include flex(row, flex-start, center, wrap);
  268. li {
  269. margin-top: 20px;
  270. margin-right: 25px;
  271. }
  272. }
  273. background-image: linear-gradient(90deg, #e5f3fd 0%, #fbfeff 100%);
  274. .tab_title {
  275. @include font(24px, #334a5f);
  276. border-bottom: 1px solid #d2e8f6;
  277. padding-bottom: 20px;
  278. @include border-box;
  279. }
  280. .tab_ul {
  281. @include font(16px, #637485);
  282. }
  283. }
  284. .active {
  285. background-image: linear-gradient(90deg, #0689e7 0%, #eff8fe 100%);
  286. .tab_title {
  287. @include font(24px, $color-white);
  288. border-bottom: 1px solid #d2e8f6;
  289. padding-bottom: 20px;
  290. @include border-box;
  291. }
  292. .tab_ul {
  293. @include font(16px, $color-white);
  294. }
  295. }
  296. .enter {
  297. @include size(260px, 100px);
  298. background-image: linear-gradient(135deg, #01d8ba 0%, #0086e7 100%);
  299. padding: 18px 18px 18px 26px;
  300. @include border-box;
  301. @include flex(row, space-between, center, null);
  302. .left {
  303. flex: 1;
  304. padding-right: 48px;
  305. @include border-box;
  306. @include flex(column, space-around, flex-start, null);
  307. .enter_title {
  308. @include font(26px, $color-white);
  309. }
  310. .enter_btn {
  311. width: 100%;
  312. @include font(16px, $color-white);
  313. @include flex(row, space-between, center, null);
  314. }
  315. }
  316. img {
  317. @include size(64px, 64px);
  318. border-radius: 50%;
  319. }
  320. }
  321. }
  322. .right {
  323. @include size(860px, 100%);
  324. padding: 40px 32px 40px 38px;
  325. @include border-box;
  326. background-image: linear-gradient(90deg, #e5f3fd 0%, #fbfeff 100%);
  327. .product_ul {
  328. height: 100%;
  329. @include flex(column, flex-start, flex-start, null);
  330. li {
  331. @include size(100%, 160px);
  332. @include flex(row, space-between, center, null);
  333. img {
  334. @include size(260px, 100%);
  335. }
  336. .product_info {
  337. overflow: hidden;
  338. padding-left: 20px;
  339. height: 100%;
  340. @include border-box;
  341. flex: 1;
  342. @include flex(column, flex-start, flex-start, null);
  343. }
  344. .product_title {
  345. width: 100%;
  346. @include font(18px, #334a5f);
  347. font-weight: 600;
  348. @include text-ellipsis;
  349. }
  350. .product_content {
  351. width: 100%;
  352. margin: 15px 0;
  353. @include font(16px, #637485);
  354. @include text-ellipsis-multiple(3);
  355. }
  356. .product_price {
  357. width: 100%;
  358. @include font(16px, #637485);
  359. @include flex(row, space-between, center, null);
  360. .price {
  361. @include font(24px, #d9121a);
  362. }
  363. .more {
  364. @include font(24px, #637485);
  365. }
  366. }
  367. }
  368. }
  369. .product_ul > li + li {
  370. margin-top: 40px;
  371. }
  372. .have_no_product {
  373. @include flex(column, space-around, center, null);
  374. padding: 130px 88px;
  375. width: 100%;
  376. height: 100%;
  377. @include border-box;
  378. .service_text {
  379. @include font(36px, #f2faff);
  380. @include flex(row, center, center, wrap);
  381. line-height: 64px;
  382. }
  383. .service_btn {
  384. @include size(282px, 62px);
  385. @include font(20px, $color-white);
  386. background-image: linear-gradient(135deg, #01d8ba 0%, #0086e7 100%);
  387. border-radius: 8px;
  388. padding: 0 24px;
  389. @include border-box;
  390. @include flex(row, space-between, center, null);
  391. }
  392. }
  393. .product_bg {
  394. background: url("~@assets/image/index/product_bg.png") no-repeat;
  395. background-size: 100% 100%;
  396. }
  397. .service_bg {
  398. background: url("~@assets/image/index/service_bg.png") no-repeat;
  399. background-size: 100% 100%;
  400. }
  401. }
  402. .no_data_padding {
  403. padding: 28px;
  404. background: #e6f3fd;
  405. }
  406. }
  407. </style>