details.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. <template>
  2. <view class="main_content">
  3. <view v-if='sitePhotoAddress.length>0' class='swiper'>
  4. <swiper class="screen-swiper header-swiper" ::class="dotStyle?'square-dot':'round-dot'"
  5. :indicator-dots="false" :circular="true" interval="5000" :current="status" @change="topSwiperTab">
  6. <swiper-item class="swiper-item" v-for="(item,index) in sitePhotoAddress" :key="index"
  7. :class="status==index?'text-white':''" @click="preview(sitePhotoAddress,index)">
  8. <image :src="item"></image>
  9. <!-- <view style='position:absolute;top:50%;left:50%;transform: translate(-50%,-50%);'>11111</view> -->
  10. </swiper-item>
  11. </swiper>
  12. <view class="dots">
  13. <text class='Regular'>{{status+1}} / {{sitePhotoAddress.length}}</text>
  14. </view>
  15. <view class='functionality'>
  16. <image @click='show=true' class='jubao' src="../../static/img/liangmai/jubao.png" mode=""></image>
  17. <image @click='collect' class='collect'
  18. :src="companylist.collectionCompanyList.length>0?'../../static/img/liangmai/shoucang1.png':'../../static/img/liangmai/shoucang-2.png'"
  19. mode=""></image>
  20. </view>
  21. </view>
  22. <view class='company'>
  23. <view style='padding:21px;padding-bottom:0;'>
  24. <view style='font-size:24px;' class='Medium'>{{companylist.compName}}</view>
  25. <view style='margin-top:3px;' class='flex'>
  26. <view class='aptitude'>
  27. <image class='aptitudeImage'
  28. :src="aptiutudeStatus?'../../static/img/liangmai/bg_no_check.png':'../../static/img/liangmai/bg_check.png'"
  29. mode=""></image>
  30. <text class='aptitudeText Medium'>资质</text>
  31. </view>
  32. <view class='Regular' style='font-size:13px;'>主营:<text style='display:inline-block;margin:3px;'
  33. v-for='item in mainBusiness'> {{item}} </text></view>
  34. </view>
  35. <view style='margin:12.5px 0;' class='flex'>
  36. <view v-for='item in label' class="tag Regular">
  37. {{item}}
  38. </view>
  39. </view>
  40. </view>
  41. <view class="generalSituation">
  42. <view class="title Medium">企业概况</view>
  43. <view class="content Regular">
  44. {{companylist.companyContant}}
  45. </view>
  46. </view>
  47. <view class='contactWay'>
  48. <view class="title Medium">联系方式</view>
  49. <view class='contactWayContent'>
  50. <view class='flex linkman'>
  51. <view style='flex:1;' class='title Regular'>联系人</view>
  52. <view style='flex:3;'>
  53. <view class='Regular linkmanItem' v-for='item in companylist.settledCompanyContacts'>
  54. <view @click="contactUs(item)">
  55. {{item.contacts}}
  56. <image class="phone" src="../../static/img/liangmai/dianhau.png" mode=""></image>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="flex mailbox">
  62. <view style='flex:1;' class='title Regular'>邮箱</view>
  63. <view class='Regular' style='font-size:14px;flex:3;'>
  64. {{companylist.email}}
  65. </view>
  66. </view>
  67. <view v-show="companylist.fax" class="flex fax">
  68. <view style='flex:1;' class='title Regular'>传真</view>
  69. <view class='Regular' style='font-size:14px;flex:3;'>
  70. {{companylist.fax}}
  71. </view>
  72. </view>
  73. <view class="flex fax">
  74. <view style='flex:1;' class='title Regular'>地址</view>
  75. <view style='font-size:14px;flex:3;' class='Regular'>
  76. {{companylist.province}}{{companylist.city}}{{companylist.area}}{{companylist.detailedAddress}}
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <u-picker mode="selector" v-model="show" @confirm='selecttype' :range="selector" confirm-color='rgb(34, 197, 114)'></u-picker>
  83. </view>
  84. </template>
  85. <script>
  86. import {
  87. mapState
  88. } from 'vuex';
  89. export default {
  90. components: {
  91. },
  92. data() {
  93. return {
  94. imagelist: [{
  95. url: '../../static/img/authentication/banklow(2).png'
  96. },
  97. {
  98. url: '../../static/img/authentication/banklow(2).png'
  99. },
  100. {
  101. url: '../../static/img/authentication/banklow(2).png'
  102. }
  103. ],
  104. linkmanList: [{
  105. name: '廖经理',
  106. phone: '18513069273'
  107. },
  108. {
  109. name: '廖经理',
  110. phone: '18513069273'
  111. },
  112. {
  113. name: '廖经理',
  114. phone: '18513069273'
  115. },
  116. {
  117. name: '廖经理',
  118. phone: '18513069273'
  119. },
  120. ],
  121. id: 0,
  122. dotStyle: false,
  123. status: 0,
  124. companylist: {
  125. settledCompanyContacts: []
  126. },
  127. show: false,
  128. mainBusiness: [],
  129. label: [],
  130. sitePhotoAddress: [],
  131. selector: ['纠错', '举报'],
  132. aptiutudeStatus: false,
  133. iscollect: false
  134. }
  135. },
  136. computed: {
  137. ...mapState(['hasLogin', 'userInfo'])
  138. },
  139. onLoad(options) {
  140. this.id = options.id
  141. },
  142. onShow() {
  143. var that = this
  144. this.$nextTick(function() {
  145. that.$api.doRequest('get', '/settledCompanyInfo/getSettledCompanyInfo', {
  146. id: that.id,
  147. pcFlag: 2
  148. }).then(res => {
  149. if (res.data.code == 200) {
  150. that.companylist = res.data.data
  151. that.mainBusiness = res.data.data.mainBusinessType.split(',')
  152. if (res.data.data.label) {
  153. that.label = res.data.data.label.split(',')
  154. }
  155. that.sitePhotoAddress = []
  156. if (res.data.data.attachmentAddress) {
  157. that.sitePhotoAddress.push(res.data.data.attachmentAddress)
  158. }
  159. if (res.data.data.sitePhotoAddress) {
  160. var tmp = res.data.data.sitePhotoAddress.split(',')
  161. for (var i = 0; i < tmp.length; i++) {
  162. if (tmp[i] && tmp[i] != res.data.data.attachmentAddress) {
  163. that.sitePhotoAddress.push(tmp[i])
  164. }
  165. }
  166. console.log("that.sitePhotoAddress", that.sitePhotoAddress)
  167. }
  168. }
  169. })
  170. })
  171. },
  172. methods: {
  173. preview(img, index) {
  174. console.log("preview", img, index)
  175. uni.previewImage({
  176. urls: img,
  177. current: index
  178. });
  179. },
  180. contactUs(item) {
  181. const that = this
  182. uni.makePhoneCall({
  183. // 手机号
  184. phoneNumber: item.contactsPhone,
  185. // 成功回调
  186. success: (res) => {
  187. console.log('调用成功!')
  188. },
  189. // 失败回调
  190. fail: (res) => {
  191. console.log('调用失败!')
  192. that.contactUs()
  193. }
  194. });
  195. },
  196. topSwiperTab(e) {
  197. var that = this;
  198. this.status = Number(e.target.current);
  199. },
  200. collect() {
  201. var that = this
  202. //取消收藏
  203. if (this.companylist.collectionCompanyList.length > 0) {
  204. this.$api.doRequest('post', '/settledCompanyInfo/api/collectionNot', {
  205. id: this.companylist.id,
  206. loginPhone: this.userInfo.phone
  207. }).then(res => {
  208. if (res.data.code == 200) {
  209. debugger
  210. uni.showToast({
  211. title: '取消收藏',
  212. icon: 'none',
  213. duration: 2000
  214. })
  215. that.$api.doRequest('get', '/settledCompanyInfo/getSettledCompanyInfo', {
  216. id: that.id,
  217. pcFlag: 2
  218. }).then(res => {
  219. if (res.data.code == 200) {
  220. that.companylist = res.data.data
  221. that.mainBusiness = res.data.data.mainBusinessType.split(',')
  222. if (res.data.data.label) {
  223. that.label = res.data.data.label.split(',')
  224. }
  225. that.sitePhotoAddress = []
  226. if (res.data.data.attachmentAddress) {
  227. that.sitePhotoAddress.push(res.data.data.attachmentAddress)
  228. }
  229. if (res.data.data.sitePhotoAddress) {
  230. var tmp = res.data.data.sitePhotoAddress.split(',')
  231. for (var i = 0; i < tmp.length; i++) {
  232. if (tmp[i] && tmp[i] != res.data.data
  233. .attachmentAddress) {
  234. that.sitePhotoAddress.push(tmp[i])
  235. }
  236. }
  237. }
  238. }
  239. })
  240. }
  241. })
  242. } else {
  243. //添加收藏
  244. this.$api.doRequest('post', '/settledCompanyInfo/api/collection', {
  245. id: this.companylist.id,
  246. compName: this.companylist.compName,
  247. loginPhone: this.userInfo.phone
  248. }).then(res => {
  249. if (res.data.code == 200) {
  250. uni.showToast({
  251. title: '收藏成功',
  252. icon: 'none',
  253. duration: 2000
  254. })
  255. that.$api.doRequest('get', '/settledCompanyInfo/getSettledCompanyInfo', {
  256. id: that.id,
  257. pcFlag: 2
  258. }).then(res => {
  259. if (res.data.code == 200) {
  260. that.companylist = res.data.data
  261. that.mainBusiness = res.data.data.mainBusinessType.split(',')
  262. if (res.data.data.label) {
  263. that.label = res.data.data.label.split(',')
  264. }
  265. that.sitePhotoAddress = []
  266. if (res.data.data.attachmentAddress) {
  267. that.sitePhotoAddress.push(res.data.data.attachmentAddress)
  268. }
  269. if (res.data.data.sitePhotoAddress) {
  270. var tmp = res.data.data.sitePhotoAddress.split(',')
  271. for (var i = 0; i < tmp.length; i++) {
  272. if (tmp[i] && tmp[i] != res.data.data
  273. .attachmentAddress) {
  274. that.sitePhotoAddress.push(tmp[i])
  275. }
  276. }
  277. }
  278. }
  279. })
  280. }
  281. })
  282. }
  283. },
  284. selecttype(e) {
  285. console.log(e)
  286. if (e[0] == 1) {
  287. uni.navigateTo({
  288. url: '/pages/grain_pulse/jubao?id=' + this.companylist.id + '&compName=' + this
  289. .companylist
  290. .compName
  291. })
  292. } else {
  293. uni.navigateTo({
  294. url: '/pages/grain_pulse/errorcorrection?id=' + this.companylist.id +
  295. '&compName=' + this
  296. .companylist.compName
  297. })
  298. }
  299. },
  300. jubao() {
  301. },
  302. }
  303. }
  304. </script>
  305. <style lang='scss' scoped>
  306. .main_content {
  307. /* margin-top: 30rpx; */
  308. }
  309. /* 《--轮播 */
  310. .swiper {
  311. position: relative;
  312. height: 281.5px;
  313. }
  314. .screen-swiper {
  315. height: 281.5px;
  316. }
  317. .swiper .dots {
  318. position: absolute;
  319. bottom: 53px;
  320. background: rgba(255, 255, 255, 0.4);
  321. border-radius: 0px 11px 11px 0px;
  322. width: 58.5px;
  323. height: 23px;
  324. line-height: 23px;
  325. text-align: center;
  326. padding: 3px;
  327. color: #FFFFFF;
  328. }
  329. .functionality {
  330. position: absolute;
  331. right: 0;
  332. bottom: 53px;
  333. }
  334. .jubao {
  335. width: 44rpx;
  336. height: 44rpx;
  337. margin-right: 25px;
  338. }
  339. .collect {
  340. width: 22px;
  341. height: 22px;
  342. margin-right: 19.5px;
  343. }
  344. /* 轮播--》 */
  345. /*《--公司 */
  346. .company {
  347. background: linear-gradient(180deg, #FFFFFF 0%, #F7F8FC 100%);
  348. height: 550px;
  349. border-radius: 20px;
  350. margin-top: -38px;
  351. position: relative;
  352. z-index: 3;
  353. }
  354. .aptitude,
  355. .aptitudeImage {
  356. width: 38px;
  357. height: 20px;
  358. }
  359. .aptitude {
  360. position: relative;
  361. margin-right: 5px;
  362. }
  363. .aptitudeText {
  364. color: #8B511E;
  365. position: absolute;
  366. left: 0;
  367. width: 40px;
  368. top: 0;
  369. text-align: center;
  370. width: 100%;
  371. line-height: 20px;
  372. font-size: 11px;
  373. height: 100%;
  374. }
  375. .tag {
  376. background: #F5F6F9;
  377. padding: 2.5px 6.5px;
  378. border-radius: 3px;
  379. font-size: 11px;
  380. margin-right: 11.5px;
  381. }
  382. .generalSituation {
  383. background: #fff;
  384. margin: 9px;
  385. padding: 12px;
  386. /* border-radius: 10px; */
  387. .title {
  388. font-size: 16px;
  389. margin: 0 0 9.5px;
  390. }
  391. .content {
  392. font-size: 12px;
  393. color: #676E80;
  394. }
  395. }
  396. .contactWay {
  397. margin: 9px;
  398. padding: 11.5px 13px;
  399. background: #fff;
  400. border-radius: 10px;
  401. >.title {
  402. font-size: 16px;
  403. color: #333;
  404. margin-bottom: 12px;
  405. }
  406. .contactWayContent {
  407. .linkman>.title,
  408. .mailbox>.title,
  409. .fax>.title,
  410. .address>.title {
  411. color: #676E80;
  412. font-size: 14px;
  413. }
  414. .mailbox,
  415. .fax,
  416. .address {
  417. margin-bottom: 10px;
  418. }
  419. .linkmanItem {
  420. margin-bottom: 10px;
  421. }
  422. .phone {
  423. width: 22rpx;
  424. height: 22rpx;
  425. margin-left: 6px;
  426. }
  427. }
  428. }
  429. /* 公司--》 */
  430. </style>