card.vue 7.6 KB

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