supplierDetail.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <view class="supp-detail-container">
  3. <view class="supp-detail-info">
  4. <view class="supplier-detail-title">
  5. <view class="supplier-detail-title-text">
  6. {{detailData.name || '-'}}
  7. </view>
  8. <view class="supplier-detail-title-contacts">
  9. {{detailData.contactName || '-'}}
  10. </view>
  11. </view>
  12. <view class="supplier-detail-tel" @click="makeOhoneHandle">
  13. <u-icon name="phone"></u-icon>
  14. {{detailData.contactPhone || '-'}}
  15. </view>
  16. </view>
  17. <view class="supplier-detail-basic">
  18. <!-- <view class="supplier-detail-telphone" @click="makeOhoneHandle">
  19. <u-icon name="phone"></u-icon>
  20. <span style="margin-left: 10rpx;">{{detailData.contactPhone || '-'}}</span>
  21. </view> -->
  22. <view class="supplier-detail-address">
  23. <u-icon name="map"></u-icon>
  24. <span style="margin-left: 10rpx;">{{detailData.address || '-'}}</span>
  25. </view>
  26. <view class="supp-detail-scope-title">
  27. 供应范围
  28. </view>
  29. <view class="supp-detail-scope-text">
  30. {{detailData.radius || '-'}}
  31. </view>
  32. <view class="supp-detail-annex-title">
  33. 附件
  34. </view>
  35. <view class="supp-detail-annex-text">
  36. <image :src="img" v-for="(img, i) in detailData.urls" :key="i" class="supp-detail-annex-img"
  37. @click="imageHandle(i)"></image>
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. export default {
  44. data() {
  45. return {
  46. detailData: {},
  47. }
  48. },
  49. //第一次加载
  50. onLoad(options) {
  51. let data = decodeURIComponent(options.dataInfo)
  52. let detailData = JSON.parse(data)
  53. if (detailData.attachment) {
  54. detailData.urls = detailData.attachment.split(',')
  55. }
  56. this.detailData = detailData
  57. },
  58. onReady() {
  59. },
  60. //页面显示
  61. onShow() {
  62. },
  63. methods: {
  64. //拨打电话
  65. makeOhoneHandle() {
  66. uni.makePhoneCall({
  67. phoneNumber: this.detailData.contactPhone
  68. })
  69. },
  70. //唤起导航
  71. getLocalHandle() {
  72. if (this.detailData.lat && this.detailData.lng && this.detailData.address && this.detailData.name) {
  73. uni.openLocation({
  74. latitude: lat,
  75. longitude: lng,
  76. name: name,
  77. address: address
  78. })
  79. } else {
  80. this.$utils.msg("位置信息丢失");
  81. }
  82. },
  83. //点击图片
  84. imageHandle(data) {
  85. let _that = this;
  86. let list = [];
  87. _that.detailData.urls.forEach(item => {
  88. list.push(item)
  89. })
  90. uni.previewImage({
  91. urls: list,
  92. current: _that.detailData.urls[data]
  93. })
  94. },
  95. }
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .supp-detail-container {
  100. height: 100vh;
  101. position: relative;
  102. box-sizing: border-box;
  103. background: $uni-bg-color;
  104. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  105. padding-top: 30rpx;
  106. .supp-detail-info {
  107. height: 160rpx;
  108. background: #FFFFFF;
  109. border-radius: 16rpx 16rpx 16rpx 16rpx;
  110. margin: 0 30rpx 30rpx;
  111. padding: 30rpx;
  112. .supplier-detail-title {
  113. display: flex;
  114. .supplier-detail-title-text {
  115. flex: 1;
  116. font-size: 30rpx;
  117. font-family: PingFang SC-Regular, PingFang SC;
  118. font-weight: 400;
  119. color: #1D2129;
  120. line-height: 44rpx;
  121. }
  122. .supplier-detail-title-contacts {
  123. font-size: 30rpx;
  124. font-family: PingFang SC-Regular, PingFang SC;
  125. font-weight: 400;
  126. color: #1D2129;
  127. line-height: 44rpx;
  128. text-align: right;
  129. }
  130. }
  131. .supplier-detail-tel {
  132. text-align: right;
  133. font-size: 26rpx;
  134. font-family: PingFang SC-Regular, PingFang SC;
  135. font-weight: 400;
  136. color: #86909C;
  137. line-height: 44rpx;
  138. margin-top: 20rpx;
  139. }
  140. }
  141. .supplier-detail-basic {
  142. background: #FFFFFF;
  143. border-radius: 16rpx 16rpx 16rpx 16rpx;
  144. margin: 0 30rpx 30rpx;
  145. padding: 30rpx;
  146. .supplier-detail-telphone {
  147. font-size: 30rpx;
  148. font-family: PingFang SC-Regular, PingFang SC;
  149. font-weight: 400;
  150. color: #1D2129;
  151. line-height: 44rpx;
  152. }
  153. .supplier-detail-address {
  154. font-size: 30rpx;
  155. font-family: PingFang SC-Regular, PingFang SC;
  156. font-weight: 400;
  157. color: #1D2129;
  158. line-height: 44rpx;
  159. margin-top: 20rpx;
  160. }
  161. .supp-detail-scope-title {
  162. font-size: 30rpx;
  163. font-family: PingFang SC-Regular, PingFang SC;
  164. font-weight: 600;
  165. color: #1D2129;
  166. line-height: 44rpx;
  167. margin-top: 20rpx;
  168. }
  169. .supp-detail-scope-text {
  170. font-size: 30rpx;
  171. font-family: PingFang SC-Regular, PingFang SC;
  172. font-weight: 400;
  173. color: #1D2129;
  174. line-height: 44rpx;
  175. margin-top: 10rpx;
  176. }
  177. .supp-detail-annex-title {
  178. font-size: 30rpx;
  179. font-family: PingFang SC-Regular, PingFang SC;
  180. font-weight: 600;
  181. color: #1D2129;
  182. line-height: 44rpx;
  183. margin-top: 20rpx;
  184. }
  185. .supp-detail-annex-text {
  186. display: flex;
  187. margin-top: 20rpx;
  188. width: 100%;
  189. flex-wrap: wrap;
  190. .supp-detail-annex-img {
  191. width: 120rpx;
  192. height: 120rpx;
  193. margin: 0 10rpx 10rpx 0;
  194. }
  195. }
  196. }
  197. }
  198. </style>