card.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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 Shishou 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>石首市建宁大道586号</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-7819125</text></view>
  19. <!-- #endif -->
  20. <!-- #ifndef H5 -->
  21. <view class="text" @click="uni.makePhoneCall({phoneNumber: '0716-7819125'})"><text>0716-7819125</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>jssws_xx@163.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/icon/erweima.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. scale: '12',
  65. longitude: '112.409623', //石首市经度,
  66. latitude: '29.698843', //石首市纬度
  67. longitudeNew: '', //当前经度
  68. latitudeNew: '', //当前纬度
  69. addr: '石首市红十字会',
  70. markers: [{
  71. id: '226',
  72. title: '石首市红十字会',
  73. iconPath: '/static/img/img10.png',
  74. width: '28',
  75. height: '28',
  76. longitude: '112.409623', //石首市经度
  77. latitude: '29.698843',
  78. }]
  79. };
  80. },
  81. onLoad() {
  82. let obj = this;
  83. this.IndexShare();
  84. uni.getLocation({
  85. type: 'wgs84',
  86. success: res => {
  87. console.log('当前位置的经度:' + res.longitude);
  88. console.log('当前位置的纬度:' + res.latitude);
  89. obj.longitudeNew = res.longitude;
  90. obj.latitudeNew = res.latitude;
  91. },
  92. fail(e) {
  93. console.log('获取位置失败', e);
  94. }
  95. });
  96. },
  97. methods: {
  98. navigation() {
  99. this.$refs.popup2.open();
  100. },
  101. toGaodeMap() {
  102. let latitude = this.latitude
  103. let longitude = this.longitude
  104. let address = this.addr
  105. console.log(latitude,longitude,address);
  106. window.location.href = `https://uri.amap.com/marker?position=${longitude},${latitude}&name=${address}`
  107. },
  108. toTengxunMap() {
  109. let latitude = this.latitude
  110. let longitude = this.longitude
  111. let address = this.addr
  112. window.location.href = `http://apis.map.qq.com/uri/v1/marker?marker=coord:${latitude},${longitude};addr:${address}`;
  113. },
  114. toBaiduMap() {
  115. window.location.href=
  116. `http://api.map.baidu.com/marker?location=29.705031,112.416098&title=石首市红十字会&content=石首市红十字会&output=html&src=webapp.baidu.openAPIdemo `
  117. },
  118. //分享
  119. IndexShare() {
  120. let obj = this;
  121. let item = {
  122. link: obj.$store.state.baseURL + '/index/#/pages/share/card',// 分享链接
  123. imgUrl: obj.$store.state.baseURL + '/index/static/img/002.png',
  124. desc: '电子名片分享',
  125. title: '石首市红十字会',
  126. };
  127. console.log('分享加',item)
  128. weixindata(item);
  129. },
  130. }
  131. };
  132. </script>
  133. <style lang="scss">
  134. .center {
  135. border: 20rpx solid #e01a1c;
  136. min-height: 100%;
  137. // min-height: 600px;
  138. }
  139. .flex {
  140. display: flex;
  141. justify-content: space-between;
  142. align-items: center;
  143. }
  144. page {
  145. width: 100%;
  146. height: 100%;
  147. margin: 0;
  148. padding: 0;
  149. }
  150. .bg {
  151. width: 100%;
  152. height: 100%;
  153. position: absolute;
  154. left: 0;
  155. top: 0;
  156. padding: 20rpx;
  157. .imgBox {
  158. width: 100%;
  159. }
  160. }
  161. .top {
  162. flex-direction: column;
  163. width: 100%;
  164. image {
  165. width: 312rpx;
  166. height: 312rpx;
  167. border-color: linear-gradient(0deg, #e01a1c, #e01a1c);
  168. border-radius: 50%;
  169. margin-top: 85rpx;
  170. }
  171. .china-font {
  172. z-index: 0;
  173. width: 100%;
  174. font-size: 62rpx;
  175. padding-left: 20rpx;
  176. letter-spacing: 20rpx;
  177. font-family: Swei Fist Leg CJK SC;
  178. font-weight: bold;
  179. color: #e01a1c;
  180. line-height: 1;
  181. margin-top: 19rpx;
  182. text-align: center;
  183. }
  184. .english-font {
  185. margin-top: 14rpx;
  186. z-index: 0;
  187. letter-spacing: -1.9rpx;
  188. width: 100%;
  189. font-size: 20rpx;
  190. font-weight: bold;
  191. color: #e01a1c;
  192. text-align: center;
  193. }
  194. .fgx {
  195. margin-top: 25rpx;
  196. margin-bottom: 25rpx;
  197. z-index: 0;
  198. width: 625rpx;
  199. border-bottom: 1rpx dashed #e01a1c;
  200. }
  201. }
  202. .buttom {
  203. flex-direction: column;
  204. .item {
  205. z-index: 0;
  206. margin: 0 auto;
  207. margin-top: 20rpx;
  208. width: 532rpx;
  209. border: 1rpx solid #e01a1c;
  210. border-radius: 38rpx;
  211. justify-content: flex-start;
  212. .home_img {
  213. height: 58rpx;
  214. width: 58rpx;
  215. margin: 8rpx 13rpx;
  216. }
  217. .text {
  218. width: 405rpx;
  219. // display: inline-block;
  220. // padding-left: 75rpx;
  221. letter-spacing: 1.2rpx;
  222. font-size: 25rpx;
  223. font-weight: bold;
  224. text-align: center;
  225. // background-color: red;
  226. // .text1 {
  227. // padding-left: 60rpx;
  228. // }
  229. }
  230. }
  231. .map {
  232. margin-top: 25rpx;
  233. margin-bottom: 25rpx;
  234. background-color: #ffffff;
  235. z-index: 0;
  236. width: 517rpx;
  237. border: 2rpx solid #ea3638;
  238. line-height: 0;
  239. .map-box {
  240. width: 513rpx;
  241. height: 513rpx;
  242. background: #ffffff;
  243. }
  244. .map-font {
  245. height: 90rpx;
  246. padding: 0 20rpx;
  247. justify-content: space-between;
  248. .font-left {
  249. font-family: PingFang SC;
  250. font-weight: bold;
  251. font-size: 29rpx;
  252. color: #333333;
  253. line-height: 1;
  254. }
  255. .font-right {
  256. border-radius: 10rpx;
  257. overflow: hidden;
  258. background-color: #1593ff;
  259. image {
  260. width: 120rpx;
  261. height: 45rpx;
  262. }
  263. }
  264. }
  265. }
  266. .qrcode {
  267. width: 517rpx;
  268. image {
  269. width: 517rpx;
  270. margin: 20rpx 0 36rpx;
  271. }
  272. }
  273. }
  274. .popup_row {
  275. width: 100%;
  276. height: 500rpx;
  277. background-color: #FFFFFF;
  278. border-radius: 20rpx 20rpx 0 0;
  279. display: flex;
  280. justify-content: center;
  281. align-items: center;
  282. .rows {
  283. width: 100%;
  284. padding: 0 24rpx;
  285. .rows-item {
  286. height: 80rpx;
  287. line-height: 80rpx;
  288. text-align: center;
  289. width: 100%;
  290. font-size: 32rpx;
  291. color: #303133;
  292. }
  293. }
  294. }
  295. </style>