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