123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- <template>
- <view class="page">
- <view class="qj" @click="call()">
- <view class="icon"></view>
- SOS
- </view>
- <view class="top">
- <view class="wz">
- <text class="icon"></text>
- <text>谢通门县欢迎您!</text>
- </view>
- <view class="wd">
- <view class="qw">28°</view>
- <view class="xs">
- <view>中雨 东风2级</view>
- <view>空气优23</view>
- </view>
- </view>
- <view class="ms">城市后花园·温泉养生地·胜境谢通门</view>
- <image src="../../static/bg.jpg" mode="aspectFill"></image>
- </view>
- <view class="main">
- <view class="flex menu">
- <view class="f" @click="tab('/pages/travel/index')">
- <view class="icon" style="background-color: #0f0b51;"></view>
- <view class="title">景区介绍</view>
- </view>
- <view class="f" @click="tab('/pages/government/index')">
- <view class="icon" style="background-color: #e23e33;"></view>
- <view class="title">党政服务</view>
- </view>
- <view class="f" @click="navigate('/pages/travel/introduction')">
- <view class="icon" style="background-color: #2cc937;"></view>
- <view class="title">旅游攻略</view>
- </view>
- <view class="f" @click="navigate('/pages/government/activity')">
- <view class="icon" style="background-color: #e23e33;"></view>
- <view class="title">热门活动</view>
- </view>
- </view>
- <view class="flex mt10">
- <view class="item" @click="tab('/pages/travel/index')">
- <view class="tag">景区介绍</view>
- <image src="../../static/img77.jpg" mode="aspectFill" class="gray"></image>
- <view class="more">点击显示更多</view>
- </view>
- <view class="item" @click="tab('/pages/government/index')">
- <view class="tag">党政服务</view>
- <image src="../../static/img3.jpg" mode="aspectFill" class="gray"></image>
- <view class="more">点击显示更多</view>
- </view>
- </view>
- <view class="flex">
- <view class="item" @click="navigate('/pages/travel/introduction')">
- <view class="tag">旅游攻略</view>
- <image src="../../static/img2.jpg" mode="aspectFill" class="gray"></image>
- <view class="more">点击显示更多</view>
- </view>
- <view class="item" @click="navigate('/pages/government/activity')">
- <view class="tag">热门活动</view>
- <image src="../../static/img4.jpg" mode="aspectFill" class="gray"></image>
- <view class="more">点击显示更多</view>
- </view>
- </view>
- </view>
- <u-back-top :scroll-top="scrollTop"></u-back-top>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- ip: this.$http.urls.ip,
- scrollTop: 0,
- item: {}
- };
- },
- onPageScroll(e) {
- this.scrollTop = e.scrollTop;
- },
- onLoad(e) {
- this.init();
- },
- methods: {
- init() {
- this.$http.request({
- url: this.$http.urls.getAboutUs,
- success: res => {
- this.item = res.data.data.aboutUs;
- }
- });
- },
- //拨打sos
- call() {
- if (!this.$hasLogin()) {
- uni.showModal({ content: '登陆才能使用该功能', showCancel: false });
- return;
- }
- //获取拨打人位置
- uni.authorize({
- scope: 'scope.userLocation',
- success: s => {
- uni.getLocation({
- type: 'wgs84',
- success: res => {
- uni.showModal({
- title: '提示',
- content: '是否拨打' + this.item.helpPhone + '求援电话?',
- success: c => {
- if (c.confirm) {
- //上传拨打救援记录
- this.$http.request({
- method: 'POST',
- url: this.$http.urls.pushHelp,
- data: { memberId: this.$getUser().memberId, lat: res.latitude, lng: res.longitude, phone: this.$getUser().mobile },
- success: r => {
- uni.makePhoneCall({
- phoneNumber: this.item.helpPhone
- });
- }
- });
- }
- }
- });
- }
- });
- },
- fail(res) {
- //1.2 拒绝授权
- console.log(JSON.stringify(res));
- }
- });
- },
- tab(url) {
- uni.switchTab({
- url: url
- });
- },
- navigate(url) {
- uni.navigateTo({ url: url });
- }
- }
- };
- </script>
- <style lang="scss">
- .top {
- position: relative;
- height: 300px;
- color: white;
- .wz {
- position: absolute;
- top: 45px;
- left: 20px;
- z-index: 111111;
- .icon {
- padding-right: 5px;
- }
- }
- .wd {
- position: absolute;
- top: 80px;
- left: 20px;
- z-index: 111111;
- .qw {
- font-size: 40px;
- float: left;
- font-weight: bold;
- }
- .xs {
- margin-left: 75px;
- width: 100%;
- font-weight: bold;
- margin-top: 6px;
- }
- }
- .ms {
- position: absolute;
- top: 155px;
- left: 20px;
- z-index: 111111;
- font-size: 17px;
- font-weight: bold;
- }
- image {
- width: 100%;
- height: 300px;
- position: absolute;
- }
- }
- .main {
- padding: 15px 15px 50px 15px;
- width: 100%;
- margin-top: -50px;
- overflow: hidden;
- position: absolute;
- .menu {
- background-color: white;
- border-radius: 10px;
- padding: 15px;
- width: 100%;
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
- .icon {
- font-size: 30px;
- background-color: red;
- width: 38px;
- height: 38px;
- border-radius: 5px;
- margin: 0 auto;
- color: white;
- padding: 3px;
- }
- .title {
- padding-top: 4px;
- font-size: 13px;
- }
- }
- .item {
- flex: 1;
- overflow: hidden;
- padding: 5px;
- position: relative;
- image {
- border-radius: 5px;
- width: 100%;
- height: 180px;
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
- }
- .tag {
- position: absolute;
- left: 10px;
- top: 10px;
- z-index: 11111;
- font-weight: bold;
- color: white;
- font-size: 16px;
- }
- .more {
- position: absolute;
- width: 70%;
- background: #e23e33;
- opacity: 0.78;
- color: white;
- bottom: 20px;
- border-radius: 5px;
- left: 16%;
- padding: 5px 7px;
- font-size: 13px;
- }
- }
- }
- .gray {
- -webkit-filter: grayscale(30%);
- -moz-filter: grayscale(100%);
- -ms-filter: grayscale(100%);
- -o-filter: grayscale(100%);
- filter: grayscale(30%);
- filter: black;
- }
- .qj {
- position: fixed;
- top: 53%;
- right: 0px;
- width: 50px;
- background: red;
- z-index: 111;
- padding: 10px 10px 5px 10px;
- color: white;
- font-size: 15px;
- text-align: center;
- border-radius: 10px 0px 0px 10px;
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.3);
- opacity: 0.8;
- .icon {
- font-size: 25px;
- padding-bottom: 3px;
- }
- }
- </style>
|