card.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <template>
  2. <view class="center">
  3. <view class="bg"><image class="imgBox" src="../../static/img/test_bg.png" mode="scaleToFill"></image></view>
  4. <view class="top flex">
  5. <image src="../../static/img/top_bg.png" mode="aspectFill"></image>
  6. <view class="china-font">荆州区红十字会</view>
  7. <view class="english-font">Red Cross Society of China Jingzhou District Branch</view>
  8. <view class="fgx"></view>
  9. </view>
  10. <view class="buttom flex">
  11. <view class="item flex">
  12. <image class="home_img" src="../../static/img/test_home.png" mode="aspectFill"></image>
  13. <view class="text"><text>荆州市荆州区荆北路51号</text></view>
  14. </view>
  15. <view class="item flex">
  16. <image class="home_img" src="../../static/img/test_phone.png" mode="aspectFill"></image>
  17. <!-- #ifdef H5 -->
  18. <view class="text"><text class="text1">0716-8497162</text></view>
  19. <!-- #endif -->
  20. <!-- #ifndef H5 -->
  21. <view class="text" @click="uni.makePhoneCall({phoneNumber: '0716-8497162'})"><text>0716-8497162</text></view>
  22. <!-- #endif -->
  23. </view>
  24. <view class="item flex">
  25. <image class="home_img" src="../../static/img/test_mail.png" mode="aspectFill"></image>
  26. <view class="text"><text>3300491137@qq.com</text></view>
  27. </view>
  28. <view class="map">
  29. <!-- <image class="map-box" src="../../static/icon/erweima.jpg"></image> -->
  30. <map class="map-box" id="map" :markers="markers" :scale="scale" :latitude="latitude"
  31. :longitude="longitude" ref="map" :show-location="false"></map>
  32. <view class="map-font flex">
  33. <view class="font-left">荆州区红十字会</view>
  34. <view @click="navigation()" class="font-right"><image src="../../static/img/btn.png" mode="aspectFill"></image></view>
  35. </view>
  36. </view>
  37. <!-- <view class="qrcode">
  38. <image src="../../static/images/qrcode.jpg" mode="aspectFill"></image>
  39. </view> -->
  40. </view>
  41. <uni-popup ref="popup2" type="bottom" @click="close">
  42. <view class="popup_row">
  43. <view class="rows">
  44. <view class="rows-item" @click="toGaodeMap()">高德地图</view>
  45. <view class="rows-item" @click="toBaiduMap()">百度地图</view>
  46. <view class="rows-item" @click="toTengxunMap()">腾讯地图</view>
  47. </view>
  48. </view>
  49. </uni-popup>
  50. </view>
  51. </template>
  52. <script>
  53. import uniPopup from '@/components/uni-popup/uni-popup.vue'
  54. import {
  55. weixindata,
  56. weixinlocation
  57. } from '@/utils/wxAuthorized.js';
  58. export default {
  59. components: {
  60. uniPopup
  61. },
  62. data() {
  63. return {
  64. longitude: '112.193401', //荆州市经度,,30.356889,112.193401
  65. latitude: '30.356889', //荆州市纬度
  66. longitudeNew: '', //当前经度
  67. latitudeNew: '', //当前纬度
  68. addr: '荆州区红十字会',
  69. markers: [{
  70. id: '226',
  71. title: '荆州区红十字会',
  72. iconPath: '/static/img/img10.png',
  73. width: '28',
  74. height: '28',
  75. longitude: '112.193401', //荆州市经度,,30.356889,112.193401
  76. latitude: '30.356889',
  77. }]
  78. };
  79. },
  80. onLoad() {
  81. let obj = this;
  82. this.IndexShare();
  83. uni.getLocation({
  84. type: 'gcj02',
  85. success: res => {
  86. console.log('当前位置的经度:' + res.longitude);
  87. console.log('当前位置的纬度:' + res.latitude);
  88. obj.longitudeNew = res.longitude;
  89. obj.latitudeNew = res.latitude;
  90. },
  91. fail(e) {
  92. console.log('获取位置失败', e);
  93. }
  94. });
  95. },
  96. methods: {
  97. navigation() {
  98. this.$refs.popup2.open();
  99. },
  100. toGaodeMap() {
  101. let latitude = this.latitude
  102. let longitude = this.longitude
  103. let address = this.addr
  104. console.log(latitude,longitude,address);
  105. window.location.href = `https://uri.amap.com/marker?position=${longitude},${latitude}&name=${address}`
  106. },
  107. toTengxunMap() {
  108. let latitude = this.latitude
  109. let longitude = this.longitude
  110. let address = this.addr
  111. window.location.href = `http://apis.map.qq.com/uri/v1/marker?marker=coord:${latitude},${longitude};addr:${address}`;
  112. },
  113. toBaiduMap() {
  114. window.location.href=
  115. `http://api.map.baidu.com/marker?location=30.357764,112.218665&title=荆州区红十字会&content=荆州区红十字会&output=html&src=webapp.baidu.openAPIdemo `
  116. },
  117. //分享
  118. IndexShare() {
  119. let obj = this;
  120. let item = {
  121. link: 'http://jz.red.igxys.com/jzq/#/pages/share/card',// 分享链接
  122. imgUrl: 'http://jz.red.igxys.com/static/img/22.jpg',
  123. desc: '电子名片分享',
  124. title: '荆州区红十字会',
  125. };
  126. console.log('分享加',item)
  127. weixindata(item);
  128. },
  129. }
  130. };
  131. </script>
  132. <style lang="scss">
  133. .center {
  134. border: 20rpx solid #e01a1c;
  135. min-height: 100%;
  136. // min-height: 600px;
  137. }
  138. .flex {
  139. display: flex;
  140. justify-content: space-between;
  141. align-items: center;
  142. }
  143. page {
  144. width: 100%;
  145. height: 100%;
  146. margin: 0;
  147. padding: 0;
  148. }
  149. .bg {
  150. width: 100%;
  151. height: 100%;
  152. position: absolute;
  153. left: 0;
  154. top: 0;
  155. padding: 20rpx;
  156. .imgBox {
  157. width: 100%;
  158. }
  159. }
  160. .top {
  161. flex-direction: column;
  162. width: 100%;
  163. image {
  164. width: 312rpx;
  165. height: 312rpx;
  166. border-color: linear-gradient(0deg, #e01a1c, #e01a1c);
  167. border-radius: 50%;
  168. margin-top: 85rpx;
  169. }
  170. .china-font {
  171. z-index: 0;
  172. width: 100%;
  173. font-size: 62rpx;
  174. padding-left: 20rpx;
  175. letter-spacing: 20rpx;
  176. font-family: Swei Fist Leg CJK SC;
  177. font-weight: bold;
  178. color: #e01a1c;
  179. line-height: 1;
  180. margin-top: 19rpx;
  181. text-align: center;
  182. }
  183. .english-font {
  184. margin-top: 14rpx;
  185. z-index: 0;
  186. letter-spacing: -1.9rpx;
  187. width: 100%;
  188. font-size: 20rpx;
  189. font-weight: bold;
  190. color: #e01a1c;
  191. text-align: center;
  192. }
  193. .fgx {
  194. margin-top: 25rpx;
  195. margin-bottom: 25rpx;
  196. z-index: 0;
  197. width: 625rpx;
  198. border-bottom: 1rpx dashed #e01a1c;
  199. }
  200. }
  201. .buttom {
  202. flex-direction: column;
  203. .item {
  204. z-index: 0;
  205. margin: 0 auto;
  206. margin-top: 20rpx;
  207. width: 532rpx;
  208. border: 1rpx solid #e01a1c;
  209. border-radius: 38rpx;
  210. justify-content: flex-start;
  211. .home_img {
  212. height: 58rpx;
  213. width: 58rpx;
  214. margin: 8rpx 13rpx;
  215. }
  216. .text {
  217. width: 405rpx;
  218. // display: inline-block;
  219. // padding-left: 75rpx;
  220. letter-spacing: 1.2rpx;
  221. font-size: 25rpx;
  222. font-weight: bold;
  223. text-align: center;
  224. // background-color: red;
  225. // .text1 {
  226. // padding-left: 60rpx;
  227. // }
  228. }
  229. }
  230. .map {
  231. margin-top: 25rpx;
  232. margin-bottom: 25rpx;
  233. background-color: #ffffff;
  234. z-index: 0;
  235. width: 517rpx;
  236. border: 2rpx solid #ea3638;
  237. line-height: 0;
  238. .map-box {
  239. width: 513rpx;
  240. height: 513rpx;
  241. background: #ffffff;
  242. }
  243. .map-font {
  244. height: 90rpx;
  245. padding: 0 20rpx;
  246. justify-content: space-between;
  247. .font-left {
  248. font-family: PingFang SC;
  249. font-weight: bold;
  250. font-size: 29rpx;
  251. color: #333333;
  252. line-height: 1;
  253. }
  254. .font-right {
  255. border-radius: 10rpx;
  256. overflow: hidden;
  257. background-color: #1593ff;
  258. image {
  259. width: 120rpx;
  260. height: 45rpx;
  261. }
  262. }
  263. }
  264. }
  265. .qrcode {
  266. width: 517rpx;
  267. image {
  268. width: 517rpx;
  269. margin: 20rpx 0 36rpx;
  270. }
  271. }
  272. }
  273. .popup_row {
  274. width: 100%;
  275. height: 500rpx;
  276. background-color: #FFFFFF;
  277. border-radius: 20rpx 20rpx 0 0;
  278. display: flex;
  279. justify-content: center;
  280. align-items: center;
  281. .rows {
  282. width: 100%;
  283. padding: 0 24rpx;
  284. .rows-item {
  285. height: 80rpx;
  286. line-height: 80rpx;
  287. text-align: center;
  288. width: 100%;
  289. font-size: 32rpx;
  290. color: #303133;
  291. }
  292. }
  293. }
  294. </style>