enterprise_detail.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <template>
  2. <div class="content" :class="{ 'margin-bottom-80': isMar }" v-if="isShow">
  3. <div class="title">
  4. <div class="logo">
  5. <img :src="'https://kiq.xazhima.com' + info.pic_url" alt="" />
  6. </div>
  7. <div class="name">
  8. {{ info.name }}
  9. </div>
  10. </div>
  11. <view class="enterprise-item-box">
  12. <view
  13. v-for="(item, idx) in titleList"
  14. :key="idx"
  15. :class="{ active: active === idx }"
  16. class="enterprise-item-name"
  17. @click="change(idx)"
  18. >
  19. {{ item }}
  20. </view>
  21. </view>
  22. <div class="baseInfo" v-if="active === 0">
  23. <div class="card-title">{{ model.title }}</div>
  24. <div class="item-list">
  25. <div v-for="(item, idx) in model.item" :key="idx" class="term">
  26. <div class="term-name">{{ item.name }}:</div>
  27. <div class="term-value-group">
  28. <p
  29. v-for="(value, idx) in item.value"
  30. :key="idx"
  31. class="term-value-item"
  32. :class="{ blue: item.name == '电话' }"
  33. >
  34. {{ value }}
  35. </p>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. <div v-else-if="active === 1" class="proInfo">
  41. <div class="products">
  42. <div class="product" @click="toDetail(1)">
  43. <div class="img">
  44. <img src="/static/enterprise/product.jpg" />
  45. </div>
  46. <div class="name">硬件销售</div>
  47. </div>
  48. <div class="product">
  49. <div class="img">
  50. <img src="/static/enterprise/product.jpg" />
  51. </div>
  52. <div class="name">硬件销售</div>
  53. </div>
  54. <div class="product">
  55. <div class="img">
  56. <img src="/static/enterprise/product.jpg" />
  57. </div>
  58. <div class="name">硬件销售</div>
  59. </div>
  60. </div>
  61. </div>
  62. <div style="width: 100%">
  63. <footer-share
  64. style="width: 100%"
  65. :isCollection="true"
  66. @collectionPages="collectionPage"
  67. @sharePages="sharePage"
  68. ></footer-share>
  69. </div>
  70. </div>
  71. </template>
  72. <script>
  73. import md5 from "@/common/md5.js";
  74. export default {
  75. data() {
  76. return {
  77. id: "",
  78. scrollTop: 0,
  79. titleList: ["基本信息", "产品信息"],
  80. active: 0,
  81. info: {},
  82. model:{},
  83. isShow: false,
  84. };
  85. },
  86. onLoad(option) {
  87. let id = option.id;
  88. this.getCompanyInfo(id);
  89. },
  90. methods: {
  91. collectionPage() {
  92. console.log("已收藏");
  93. },
  94. sharePage() {
  95. console.log("分享");
  96. uni.showShareMenu({
  97. title: "园区XXX",
  98. path: "pages/park/park_detail",
  99. success(res) {
  100. console.log(res);
  101. },
  102. });
  103. },
  104. change(idx) {
  105. this.active = idx;
  106. },
  107. toDetail(index) {
  108. uni.navigateTo({
  109. url: "/pages/enterprise/product_detail?id=" + index,
  110. });
  111. },
  112. getCompanyInfo(id) {
  113. let md5Sign = md5(
  114. "method=" +
  115. "common" +
  116. "&timestamp=" +
  117. getApp().globalData.globalTimestamp +
  118. "&secret=" +
  119. getApp().globalData.secret
  120. );
  121. let url =
  122. getApp().globalData.shareUrl +
  123. "api/api.php" +
  124. "?method=common&source=company&action=info_by_id&timestamp=" +
  125. getApp().globalData.globalTimestamp +
  126. "&sign=" +
  127. md5Sign;
  128. uni.request({
  129. url: url,
  130. method: "POST",
  131. header: {
  132. "content-type": "application/x-www-form-urlencoded",
  133. },
  134. data: { id },
  135. success: (res) => {
  136. if (res.data.code === 200) {
  137. let {
  138. name,
  139. pic_url,
  140. representative,
  141. found_date,
  142. capital,
  143. code,
  144. industry_name,
  145. park_name,
  146. work_address,
  147. rigiser_address,
  148. web_url,
  149. contact,
  150. } = res.data.data;
  151. console.log(res.data.data);
  152. this.info = {
  153. name,
  154. pic_url,
  155. representative,
  156. found_date,
  157. capital,
  158. code,
  159. industry_name,
  160. park_name,
  161. work_address,
  162. rigiser_address,
  163. web_url,
  164. contact,
  165. };
  166. this.model = {
  167. title: this.info.name,
  168. item: [
  169. {
  170. name: "法定代表人",
  171. value: [this.info.representative],
  172. },
  173. {
  174. name: "成立日期",
  175. value: [this.info.found_date],
  176. },
  177. {
  178. name: "注册资本",
  179. value: [this.info.capital],
  180. },
  181. {
  182. name: "统一社会信用代码",
  183. value: [this.info.code],
  184. },
  185. {
  186. name: "所属行业",
  187. value: [this.info.industry_name],
  188. },
  189. {
  190. name: "所属园区",
  191. value: [this.info.park_name],
  192. },
  193. {
  194. name: "经营地址",
  195. value: [this.info.work_address],
  196. },
  197. {
  198. name: "经营范围",
  199. value: [
  200. "一、提供国内、地区和国际定期及不定期航空客、货、邮、行李运输服务;二、提供通用航空服务;三、提供航空器维修服务;四、经营国内外航空公司的代理业务;五、提供航空配餐服务(仅限分支机构经营);六、进行其他航空业务及相关业务,包括为该等业务进行广告宣传;",
  201. ],
  202. },
  203. {
  204. name: "地址",
  205. value: [this.info.rigiser_address],
  206. },
  207. {
  208. name: "网址",
  209. value: [this.info.web_url],
  210. },
  211. {
  212. name: "电话",
  213. value: [this.info.contact],
  214. },
  215. ],
  216. };
  217. this.isShow = true;
  218. }
  219. },
  220. fail: () => {
  221. console.log("连接失败");
  222. },
  223. });
  224. },
  225. },
  226. };
  227. </script>
  228. <style lang="scss" scoped>
  229. .content {
  230. padding: 4%;
  231. font-size: 30rpx;
  232. .blue {
  233. color: #02a7f0;
  234. }
  235. .title {
  236. display: flex;
  237. align-items: center;
  238. border-radius: 10rpx;
  239. margin-bottom: 50rpx;
  240. box-shadow: rgba(0, 0, 0, 0.35) 0rpx 5rpx 15rpx;
  241. .logo {
  242. image {
  243. width: 200rpx;
  244. height: 100rpx;
  245. margin: 0 30rpx;
  246. }
  247. }
  248. }
  249. .baseInfo {
  250. margin-bottom: 50rpx;
  251. .card-title {
  252. padding: 20rpx 20rpx 0rpx 20rpx;
  253. font-weight: 600;
  254. }
  255. .item-list {
  256. margin-left: 20rpx;
  257. display: flex;
  258. flex-direction: column;
  259. .term {
  260. display: flex;
  261. .term-name {
  262. font-size: 27rpx;
  263. width: 30%;
  264. display: flex;
  265. margin: 20rpx;
  266. color: #7f7f7f;
  267. }
  268. .term-value-group {
  269. flex: 1;
  270. display: flex;
  271. flex-direction: column;
  272. font-size: 27rpx;
  273. .term-value-item {
  274. margin: 20rpx;
  275. }
  276. }
  277. }
  278. }
  279. }
  280. .proInfo {
  281. font-size: 25rpx;
  282. .products {
  283. width: 100%;
  284. display: flex;
  285. padding: 4%;
  286. flex-wrap: wrap;
  287. .product {
  288. margin: 2%;
  289. padding: 2%;
  290. border-radius: 30rpx;
  291. box-shadow: rgba(0, 0, 0, 0.35) 0rpx 5rpx 15rpx;
  292. width: 40%;
  293. height: 30%;
  294. display: flex;
  295. flex-flow: column;
  296. justify-content: space-between;
  297. align-items: center;
  298. img {
  299. width: 250rpx;
  300. height: 200rpx;
  301. }
  302. }
  303. }
  304. }
  305. .enterprise-item-box {
  306. display: flex;
  307. justify-content: space-evenly;
  308. margin: 0 20rpx;
  309. margin-top: 10rpx;
  310. .enterprise-item-name {
  311. padding-bottom: 10rpx;
  312. font-size: 27rpx;
  313. }
  314. .active {
  315. font-weight: 600;
  316. border-bottom: 7rpx solid #02a7f0;
  317. }
  318. }
  319. }
  320. .margin-bottom-80 {
  321. margin-bottom: 80rpx;
  322. }
  323. </style>