details.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  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. uni.showToast({
  210. title: '取消收藏',
  211. icon: 'none',
  212. duration: 2000
  213. })
  214. that.$api.doRequest('get', '/settledCompanyInfo/getSettledCompanyInfo', {
  215. id: that.id,
  216. pcFlag: 2
  217. }).then(res => {
  218. if (res.data.code == 200) {
  219. that.companylist = res.data.data
  220. that.mainBusiness = res.data.data.mainBusinessType.split(',')
  221. if (res.data.data.label) {
  222. that.label = res.data.data.label.split(',')
  223. }
  224. that.sitePhotoAddress = []
  225. if (res.data.data.attachmentAddress) {
  226. that.sitePhotoAddress.push(res.data.data.attachmentAddress)
  227. }
  228. if (res.data.data.sitePhotoAddress) {
  229. var tmp = res.data.data.sitePhotoAddress.split(',')
  230. for (var i = 0; i < tmp.length; i++) {
  231. if (tmp[i] && tmp[i] != res.data.data
  232. .attachmentAddress) {
  233. that.sitePhotoAddress.push(tmp[i])
  234. }
  235. }
  236. }
  237. }
  238. })
  239. }
  240. })
  241. } else {
  242. //添加收藏
  243. this.$api.doRequest('post', '/settledCompanyInfo/api/collection', {
  244. id: this.companylist.id,
  245. compName: this.companylist.compName,
  246. loginPhone: this.userInfo.phone
  247. }).then(res => {
  248. if (res.data.code == 200) {
  249. uni.showToast({
  250. title: '收藏成功',
  251. icon: 'none',
  252. duration: 2000
  253. })
  254. that.$api.doRequest('get', '/settledCompanyInfo/getSettledCompanyInfo', {
  255. id: that.id,
  256. pcFlag: 2
  257. }).then(res => {
  258. if (res.data.code == 200) {
  259. that.companylist = res.data.data
  260. that.mainBusiness = res.data.data.mainBusinessType.split(',')
  261. if (res.data.data.label) {
  262. that.label = res.data.data.label.split(',')
  263. }
  264. that.sitePhotoAddress = []
  265. if (res.data.data.attachmentAddress) {
  266. that.sitePhotoAddress.push(res.data.data.attachmentAddress)
  267. }
  268. if (res.data.data.sitePhotoAddress) {
  269. var tmp = res.data.data.sitePhotoAddress.split(',')
  270. for (var i = 0; i < tmp.length; i++) {
  271. if (tmp[i] && tmp[i] != res.data.data
  272. .attachmentAddress) {
  273. that.sitePhotoAddress.push(tmp[i])
  274. }
  275. }
  276. }
  277. }
  278. })
  279. }
  280. })
  281. }
  282. },
  283. selecttype(e) {
  284. console.log(e)
  285. if (e[0] == 1) {
  286. uni.navigateTo({
  287. url: '/pages/grain_pulse/jubao?id=' + this.companylist.id + '&compName=' + this
  288. .companylist
  289. .compName
  290. })
  291. } else {
  292. uni.navigateTo({
  293. url: '/pages/grain_pulse/errorcorrection?id=' + this.companylist.id +
  294. '&compName=' + this
  295. .companylist.compName
  296. })
  297. }
  298. },
  299. jubao() {
  300. },
  301. }
  302. }
  303. </script>
  304. <style lang='scss' scoped>
  305. .main_content {
  306. /* margin-top: 30rpx; */
  307. }
  308. /* 《--轮播 */
  309. .swiper {
  310. position: relative;
  311. height: 281.5px;
  312. }
  313. .screen-swiper {
  314. height: 281.5px;
  315. }
  316. .swiper .dots {
  317. position: absolute;
  318. bottom: 53px;
  319. background: rgba(255, 255, 255, 0.4);
  320. border-radius: 0px 11px 11px 0px;
  321. width: 58.5px;
  322. height: 23px;
  323. line-height: 23px;
  324. text-align: center;
  325. padding: 3px;
  326. color: #FFFFFF;
  327. }
  328. .functionality {
  329. position: absolute;
  330. right: 0;
  331. bottom: 53px;
  332. }
  333. .jubao {
  334. width: 44rpx;
  335. height: 44rpx;
  336. margin-right: 25px;
  337. }
  338. .collect {
  339. width: 22px;
  340. height: 22px;
  341. margin-right: 19.5px;
  342. }
  343. /* 轮播--》 */
  344. /*《--公司 */
  345. .company {
  346. background: linear-gradient(180deg, #FFFFFF 0%, #F7F8FC 100%);
  347. height: 550px;
  348. border-radius: 20px;
  349. margin-top: -38px;
  350. position: relative;
  351. z-index: 3;
  352. }
  353. .aptitude,
  354. .aptitudeImage {
  355. width: 38px;
  356. height: 20px;
  357. }
  358. .aptitude {
  359. position: relative;
  360. margin-right: 5px;
  361. }
  362. .aptitudeText {
  363. color: #8B511E;
  364. position: absolute;
  365. left: 0;
  366. width: 40px;
  367. top: 0;
  368. text-align: center;
  369. width: 100%;
  370. line-height: 20px;
  371. font-size: 11px;
  372. height: 100%;
  373. }
  374. .tag {
  375. background: #F5F6F9;
  376. padding: 2.5px 6.5px;
  377. border-radius: 3px;
  378. font-size: 11px;
  379. margin-right: 11.5px;
  380. }
  381. .generalSituation {
  382. background: #fff;
  383. margin: 9px;
  384. padding: 12px;
  385. /* border-radius: 10px; */
  386. .title {
  387. font-size: 16px;
  388. margin: 0 0 9.5px;
  389. }
  390. .content {
  391. font-size: 12px;
  392. color: #676E80;
  393. }
  394. }
  395. .contactWay {
  396. margin: 9px;
  397. padding: 11.5px 13px;
  398. background: #fff;
  399. border-radius: 10px;
  400. >.title {
  401. font-size: 16px;
  402. color: #333;
  403. margin-bottom: 12px;
  404. }
  405. .contactWayContent {
  406. .linkman>.title,
  407. .mailbox>.title,
  408. .fax>.title,
  409. .address>.title {
  410. color: #676E80;
  411. font-size: 14px;
  412. }
  413. .mailbox,
  414. .fax,
  415. .address {
  416. margin-bottom: 10px;
  417. }
  418. .linkmanItem {
  419. margin-bottom: 10px;
  420. }
  421. .phone {
  422. width: 22rpx;
  423. height: 22rpx;
  424. margin-left: 6px;
  425. }
  426. }
  427. }
  428. /* 公司--》 */
  429. </style>