card.vue 7.0 KB

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