数字化园区前端项目
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 14KB

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