card.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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">黄石市红十字会</view>
  9. <view class="english-font">Red Cross Society of China Huangshi Branch</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>湖北省黄石市下陆区桂林南路10号</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" @click="makeCall('0714-6221833')"><text class="text1">0714-6221833</text></view>
  21. <!-- #endif -->
  22. <!-- #ifndef H5 -->
  23. <view class="text" @click="makeCall('0714-6221833')"><text>0714-6221833 /
  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>hsshszh@163.com</text></view>
  30. </view>
  31. <view class="map">
  32. <!-- <map class="map-box" id="map" :markers="markers" :scale="scale" :latitude="latitude"
  33. :longitude="longitude" ref="map" :show-location="false"></map> -->
  34. <image src="../../static/images/qr.jpg" mode="" class="map-box"></image>
  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: '115.037080', //神农架林区经度,,
  72. latitude: '30.192767', //神农架林区纬度
  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: '115.037080', //神农架林区经度,,
  83. latitude: '30.192767', //神农架林区纬度
  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. makeCall(phone) {
  108. uni.makePhoneCall({
  109. phoneNumber: phone
  110. })
  111. },
  112. navigation() {
  113. this.$refs.popup2.open();
  114. },
  115. toGaodeMap() {
  116. let latitude = this.latitude
  117. let longitude = this.longitude
  118. let address = this.addr
  119. console.log(latitude, longitude, address);
  120. window.location.href = `https://uri.amap.com/marker?position=${longitude},${latitude}&name=${address}`
  121. },
  122. toTengxunMap() {
  123. let latitude = this.latitude
  124. let longitude = this.longitude
  125. let address = this.addr
  126. window.location.href =
  127. `http://apis.map.qq.com/uri/v1/marker?marker=coord:${latitude},${longitude};addr:${address}`;
  128. },
  129. toBaiduMap() {
  130. window.location.href =
  131. `http://api.map.baidu.com/marker?location=30.192767,115.037080&title=黄石市红十字会&content=黄石市红十字会&output=html&src=webapp.baidu.openAPIdemo `
  132. },
  133. //分享
  134. IndexShare() {
  135. let obj = this;
  136. let item = {
  137. link: obj.baseURL + '/index/#/pages/share/card', // 分享链接
  138. imgUrl: obj.baseURL + '/index/static/img/002.png',
  139. desc: '电子名片分享',
  140. title: '黄石市红十字会',
  141. };
  142. console.log('分享加', item)
  143. weixindata(item);
  144. },
  145. }
  146. };
  147. </script>
  148. <style lang="scss">
  149. .center {
  150. border: 20rpx solid #e01a1c;
  151. min-height: 100%;
  152. // min-height: 600px;
  153. }
  154. .flex {
  155. display: flex;
  156. justify-content: space-between;
  157. align-items: center;
  158. }
  159. page {
  160. width: 100%;
  161. height: 100%;
  162. margin: 0;
  163. padding: 0;
  164. }
  165. .bg {
  166. width: 100%;
  167. height: 100%;
  168. position: absolute;
  169. left: 0;
  170. top: 0;
  171. padding: 20rpx;
  172. .imgBox {
  173. width: 100%;
  174. }
  175. }
  176. .top {
  177. flex-direction: column;
  178. width: 100%;
  179. image {
  180. width: 312rpx;
  181. height: 312rpx;
  182. border-color: linear-gradient(0deg, #e01a1c, #e01a1c);
  183. border-radius: 50%;
  184. margin-top: 85rpx;
  185. }
  186. .china-font {
  187. z-index: 0;
  188. width: 100%;
  189. font-size: 62rpx;
  190. padding-left: 20rpx;
  191. letter-spacing: 20rpx;
  192. font-family: Swei Fist Leg CJK SC;
  193. font-weight: bold;
  194. color: #e01a1c;
  195. line-height: 1;
  196. margin-top: 19rpx;
  197. text-align: center;
  198. }
  199. .english-font {
  200. margin-top: 14rpx;
  201. z-index: 0;
  202. letter-spacing: -1.9rpx;
  203. width: 100%;
  204. font-size: 20rpx;
  205. font-weight: bold;
  206. color: #e01a1c;
  207. text-align: center;
  208. }
  209. .fgx {
  210. margin-top: 25rpx;
  211. margin-bottom: 25rpx;
  212. z-index: 0;
  213. width: 625rpx;
  214. border-bottom: 1rpx dashed #e01a1c;
  215. }
  216. }
  217. .buttom {
  218. flex-direction: column;
  219. .item {
  220. z-index: 0;
  221. margin: 0 auto;
  222. margin-top: 20rpx;
  223. width: 532rpx;
  224. border: 1rpx solid #e01a1c;
  225. border-radius: 38rpx;
  226. justify-content: flex-start;
  227. .home_img {
  228. height: 58rpx;
  229. width: 58rpx;
  230. margin: 8rpx 13rpx;
  231. }
  232. .text {
  233. width: 405rpx;
  234. // display: inline-block;
  235. // padding-left: 75rpx;
  236. letter-spacing: 1.2rpx;
  237. font-size: 25rpx;
  238. font-weight: bold;
  239. text-align: center;
  240. // background-color: red;
  241. // .text1 {
  242. // padding-left: 60rpx;
  243. // }
  244. }
  245. }
  246. .map {
  247. margin-top: 25rpx;
  248. margin-bottom: 25rpx;
  249. background-color: #ffffff;
  250. z-index: 0;
  251. width: 517rpx;
  252. border: 2rpx solid #ea3638;
  253. line-height: 0;
  254. .map-box {
  255. width: 513rpx;
  256. height: 513rpx;
  257. background: #ffffff;
  258. }
  259. .map-font {
  260. height: 90rpx;
  261. padding: 0 20rpx;
  262. justify-content: space-between;
  263. .font-left {
  264. font-family: PingFang SC;
  265. font-weight: bold;
  266. font-size: 29rpx;
  267. color: #333333;
  268. line-height: 1;
  269. }
  270. .font-right {
  271. border-radius: 10rpx;
  272. overflow: hidden;
  273. background-color: #1593ff;
  274. image {
  275. width: 120rpx;
  276. height: 45rpx;
  277. }
  278. }
  279. }
  280. }
  281. .qrcode {
  282. width: 517rpx;
  283. image {
  284. width: 517rpx;
  285. margin: 20rpx 0 36rpx;
  286. }
  287. }
  288. }
  289. .popup_row {
  290. width: 100%;
  291. height: 500rpx;
  292. background-color: #FFFFFF;
  293. border-radius: 20rpx 20rpx 0 0;
  294. display: flex;
  295. justify-content: center;
  296. align-items: center;
  297. .rows {
  298. width: 100%;
  299. padding: 0 24rpx;
  300. .rows-item {
  301. height: 80rpx;
  302. line-height: 80rpx;
  303. text-align: center;
  304. width: 100%;
  305. font-size: 32rpx;
  306. color: #303133;
  307. }
  308. }
  309. }
  310. </style>