项目权限

main
lion 2 years ago
parent f299945b69
commit ed101f01eb

@ -17,7 +17,9 @@
// });
})
},
},
onShow: function() {
console.log('App Show')
},

@ -0,0 +1,31 @@
function AMapWX(a){this.key=a.key;this.requestConfig={key:a.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};this.MeRequestConfig={key:a.key,serviceName:"https://restapi.amap.com/rest/me"}}
AMapWX.prototype.getWxLocation=function(a,b){wx.getLocation({type:"gcj02",success:function(c){c=c.longitude+","+c.latitude;wx.setStorage({key:"userLocation",data:c});b(c)},fail:function(c){wx.getStorage({key:"userLocation",success:function(d){d.data&&b(d.data)}});a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
AMapWX.prototype.getMEKeywordsSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.keywords&&(d.keywords=b.keywords);b.city&&(d.city=b.city);b.filter&&(d.filter=b.filter);b.sortrule&&(d.sortrule=b.sortrule);b.pageNum&&(d.pageNum=b.pageNum);b.pageSize&&(d.pageSize=b.pageSize);b.sig&&(d.sig=
b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/local",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
AMapWX.prototype.getMEIdSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.id&&(d.id=b.id);b.sig&&(d.sig=b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/id",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&
0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
AMapWX.prototype.getMEPolygonSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.keywords&&(d.keywords=b.keywords);b.polygon&&(d.polygon=b.polygon);b.filter&&(d.filter=b.filter);b.sortrule&&(d.sortrule=b.sortrule);b.pageNum&&(d.pageNum=b.pageNum);b.pageSize&&(d.pageSize=b.pageSize);
b.sig&&(d.sig=b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/polygon",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
AMapWX.prototype.getMEaroundSearch=function(a){if(!a.options)return a.fail({errCode:"0",errMsg:"\u7f3a\u5c11\u5fc5\u8981\u53c2\u6570"});var b=a.options,c=this.MeRequestConfig,d={key:c.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"};b.layerId&&(d.layerId=b.layerId);b.keywords&&(d.keywords=b.keywords);b.center&&(d.center=b.center);b.radius&&(d.radius=b.radius);b.filter&&(d.filter=b.filter);b.sortrule&&(d.sortrule=b.sortrule);b.pageNum&&(d.pageNum=b.pageNum);b.pageSize&&
(d.pageSize=b.pageSize);b.sig&&(d.sig=b.sig);wx.request({url:c.serviceName+"/cpoint/datasearch/around",data:d,method:"GET",header:{"content-type":"application/json"},success:function(e){(e=e.data)&&e.status&&"1"===e.status&&0===e.code?a.success(e.data):a.fail({errCode:"0",errMsg:e})},fail:function(e){a.fail({errCode:"0",errMsg:e.errMsg||""})}})};
AMapWX.prototype.getGeo=function(a){var b=this.requestConfig,c=a.options;b={key:this.key,extensions:"all",s:b.s,platform:b.platform,appname:this.key,sdkversion:b.sdkversion,logversion:b.logversion};c.address&&(b.address=c.address);c.city&&(b.city=c.city);c.batch&&(b.batch=c.batch);c.sig&&(b.sig=c.sig);wx.request({url:"https://restapi.amap.com/v3/geocode/geo",data:b,method:"GET",header:{"content-type":"application/json"},success:function(d){(d=d.data)&&d.status&&"1"===d.status?a.success(d):a.fail({errCode:"0",
errMsg:d})},fail:function(d){a.fail({errCode:"0",errMsg:d.errMsg||""})}})};
AMapWX.prototype.getRegeo=function(a){function b(d){var e=c.requestConfig;wx.request({url:"https://restapi.amap.com/v3/geocode/regeo",data:{key:c.key,location:d,extensions:"all",s:e.s,platform:e.platform,appname:c.key,sdkversion:e.sdkversion,logversion:e.logversion},method:"GET",header:{"content-type":"application/json"},success:function(g){if(g.data.status&&"1"==g.data.status){g=g.data.regeocode;var h=g.addressComponent,f=[],k=g.roads[0].name+"\u9644\u8fd1",m=d.split(",")[0],n=d.split(",")[1];if(g.pois&&
g.pois[0]){k=g.pois[0].name+"\u9644\u8fd1";var l=g.pois[0].location;l&&(m=parseFloat(l.split(",")[0]),n=parseFloat(l.split(",")[1]))}h.provice&&f.push(h.provice);h.city&&f.push(h.city);h.district&&f.push(h.district);h.streetNumber&&h.streetNumber.street&&h.streetNumber.number?(f.push(h.streetNumber.street),f.push(h.streetNumber.number)):f.push(g.roads[0].name);f=f.join("");a.success([{iconPath:a.iconPath,width:a.iconWidth,height:a.iconHeight,name:f,desc:k,longitude:m,latitude:n,id:0,regeocodeData:g}])}else a.fail({errCode:g.data.infocode,
errMsg:g.data.info})},fail:function(g){a.fail({errCode:"0",errMsg:g.errMsg||""})}})}var c=this;a.location?b(a.location):c.getWxLocation(a,function(d){b(d)})};
AMapWX.prototype.getWeather=function(a){function b(g){var h="base";a.type&&"forecast"==a.type&&(h="all");wx.request({url:"https://restapi.amap.com/v3/weather/weatherInfo",data:{key:d.key,city:g,extensions:h,s:e.s,platform:e.platform,appname:d.key,sdkversion:e.sdkversion,logversion:e.logversion},method:"GET",header:{"content-type":"application/json"},success:function(f){if(f.data.status&&"1"==f.data.status)if(f.data.lives){if((f=f.data.lives)&&0<f.length){f=f[0];var k={city:{text:"\u57ce\u5e02",data:f.city},
weather:{text:"\u5929\u6c14",data:f.weather},temperature:{text:"\u6e29\u5ea6",data:f.temperature},winddirection:{text:"\u98ce\u5411",data:f.winddirection+"\u98ce"},windpower:{text:"\u98ce\u529b",data:f.windpower+"\u7ea7"},humidity:{text:"\u6e7f\u5ea6",data:f.humidity+"%"}};k.liveData=f;a.success(k)}}else f.data.forecasts&&f.data.forecasts[0]&&a.success({forecast:f.data.forecasts[0]});else a.fail({errCode:f.data.infocode,errMsg:f.data.info})},fail:function(f){a.fail({errCode:"0",errMsg:f.errMsg||""})}})}
function c(g){wx.request({url:"https://restapi.amap.com/v3/geocode/regeo",data:{key:d.key,location:g,extensions:"all",s:e.s,platform:e.platform,appname:d.key,sdkversion:e.sdkversion,logversion:e.logversion},method:"GET",header:{"content-type":"application/json"},success:function(h){if(h.data.status&&"1"==h.data.status){h=h.data.regeocode;if(h.addressComponent)var f=h.addressComponent.adcode;else h.aois&&0<h.aois.length&&(f=h.aois[0].adcode);b(f)}else a.fail({errCode:h.data.infocode,errMsg:h.data.info})},
fail:function(h){a.fail({errCode:"0",errMsg:h.errMsg||""})}})}var d=this,e=d.requestConfig;a.city?b(a.city):d.getWxLocation(a,function(g){c(g)})};
AMapWX.prototype.getPoiAround=function(a){function b(e){e={key:c.key,location:e,s:d.s,platform:d.platform,appname:c.key,sdkversion:d.sdkversion,logversion:d.logversion};a.querytypes&&(e.types=a.querytypes);a.querykeywords&&(e.keywords=a.querykeywords);wx.request({url:"https://restapi.amap.com/v3/place/around",data:e,method:"GET",header:{"content-type":"application/json"},success:function(g){if(g.data.status&&"1"==g.data.status){if((g=g.data)&&g.pois){for(var h=[],f=0;f<g.pois.length;f++){var k=0==
f?a.iconPathSelected:a.iconPath;h.push({latitude:parseFloat(g.pois[f].location.split(",")[1]),longitude:parseFloat(g.pois[f].location.split(",")[0]),iconPath:k,width:22,height:32,id:f,name:g.pois[f].name,address:g.pois[f].address})}a.success({markers:h,poisData:g.pois})}}else a.fail({errCode:g.data.infocode,errMsg:g.data.info})},fail:function(g){a.fail({errCode:"0",errMsg:g.errMsg||""})}})}var c=this,d=c.requestConfig;a.location?b(a.location):c.getWxLocation(a,function(e){b(e)})};
AMapWX.prototype.getStaticmap=function(a){function b(e){c.push("location="+e);a.zoom&&c.push("zoom="+a.zoom);a.size&&c.push("size="+a.size);a.scale&&c.push("scale="+a.scale);a.markers&&c.push("markers="+a.markers);a.labels&&c.push("labels="+a.labels);a.paths&&c.push("paths="+a.paths);a.traffic&&c.push("traffic="+a.traffic);e="https://restapi.amap.com/v3/staticmap?"+c.join("&");a.success({url:e})}var c=[];c.push("key="+this.key);var d=this.requestConfig;c.push("s="+d.s);c.push("platform="+d.platform);
c.push("appname="+d.appname);c.push("sdkversion="+d.sdkversion);c.push("logversion="+d.logversion);a.location?b(a.location):this.getWxLocation(a,function(e){b(e)})};
AMapWX.prototype.getInputtips=function(a){var b=Object.assign({},this.requestConfig);a.location&&(b.location=a.location);a.keywords&&(b.keywords=a.keywords);a.type&&(b.type=a.type);a.city&&(b.city=a.city);a.citylimit&&(b.citylimit=a.citylimit);wx.request({url:"https://restapi.amap.com/v3/assistant/inputtips",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.tips&&a.success({tips:c.data.tips})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||
""})}})};
AMapWX.prototype.getDrivingRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);a.strategy&&(b.strategy=a.strategy);a.waypoints&&(b.waypoints=a.waypoints);a.avoidpolygons&&(b.avoidpolygons=a.avoidpolygons);a.avoidroad&&(b.avoidroad=a.avoidroad);wx.request({url:"https://restapi.amap.com/v3/direction/driving",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&a.success({paths:c.data.route.paths,
taxi_cost:c.data.route.taxi_cost||""})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
AMapWX.prototype.getWalkingRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);wx.request({url:"https://restapi.amap.com/v3/direction/walking",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&a.success({paths:c.data.route.paths})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
AMapWX.prototype.getTransitRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);a.strategy&&(b.strategy=a.strategy);a.city&&(b.city=a.city);a.cityd&&(b.cityd=a.cityd);wx.request({url:"https://restapi.amap.com/v3/direction/transit/integrated",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&(c=c.data.route,a.success({distance:c.distance||"",taxi_cost:c.taxi_cost||
"",transits:c.transits}))},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};
AMapWX.prototype.getRidingRoute=function(a){var b=Object.assign({},this.requestConfig);a.origin&&(b.origin=a.origin);a.destination&&(b.destination=a.destination);wx.request({url:"https://restapi.amap.com/v3/direction/riding",data:b,method:"GET",header:{"content-type":"application/json"},success:function(c){c&&c.data&&c.data.route&&a.success({paths:c.data.route.paths})},fail:function(c){a.fail({errCode:"0",errMsg:c.errMsg||""})}})};module.exports.AMapWX=AMapWX;

@ -63,6 +63,12 @@ const isMobile = (phoneNumber) => {
const regex = /^1[3-9]\d{9}$/;
return regex.test(phoneNumber);
}
// 分享
const shareInfo = {
title:"行走红色苏州",
imageUrl:"/static/share.jpg"
}
// 计算距离
const getDistance = (la1, lo1, la2, lo2) => { // 当前的纬度,当前的经度,接口拿到的纬度,接口拿到的经度
@ -168,5 +174,6 @@ export {
isNull,
isMobile,
getDistance,
toMapAPP
toMapAPP,
shareInfo
}

@ -6,6 +6,7 @@
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div>

File diff suppressed because one or more lines are too long

@ -83,6 +83,9 @@
"disableHostCheck" : true,
"https" : false
},
"title" : "行走红色苏州"
"title" : "行走红色苏州",
"sdkConfigs" : {
"maps" : {}
}
}
}

@ -1,8 +1,446 @@
<template>
</template>
<script>
</script>
<style>
<template>
<div class="body" id="signed" ref="signed" :style="{'padding-top':navBarTop+'px'}">
<u-image :lazy-load="false" :show-loading="false" class="bkg" width="100vw" height="100vh"
:src="require('../static/cer-bg.png')"></u-image>
<u-image id="share-img" v-show="!isHidden" class="share-img" mode="scaleToFill" :width="133" :height="133"
:src="require('../static/cer-share.png')" @click="$u.throttle(share)"> mode=</u-image>
<div class="logo1">
<u-image :lazy-load="false" :show-loading="false" width="176" height="450"
:src="require('../static/cer-logo.png')"></u-image>
</div>
<div class="content">
<div class="container">
<div class="container__text">
<div class="container__text--title">
<span>{{userInfo?userInfo.name:''}}</span>
</div>
<div class="container__text--total">
传承红色基因赓续红色血脉
</div>
<div class="container__text--total">
您是第<span>{{myIndex}}</span>位完成行走红色苏州打卡苏州市党史教育基地活动的学员
</div>
<div class="container__text--total">
学好党史必修课当好时代答卷人快邀请您的好友一起参加活动吧
</div>
</div>
</div>
</div>
<transition name="share-pop" enter-active-class="fade-in" leave-to-class="fade-out">
<view class="share_cover" v-show="isShare" @click="isShare = false">
<image :src="require('../static/cer-toShare.png')" class="share_cover_arrow"></image>
<view class="share_cover_word">
请点击右上角将它发送给指定朋友或分享到朋友圈
</view>
</view>
</transition>
<view class="share" v-if="isHidden">
<view class="share-mask" @click="isHidden = false">
</view>
<view class="share-page">
<!-- <image :src="imgData" mode="widthFix"></image> -->
<canvas :style="{width:'90%',height:SCREEN_HEIGHT*0.7+'px',margin:'0 auto'}" canvas-id="firstCanvas" id="firstCanvas"></canvas>
<view class="share-page__btn">
<view class="share-page__btn--share" @click="isShare = true">分享</view>
<view class="share-page__btn--save" @click="$u.throttle(save)"></view>
</view>
</view>
</view>
</div>
</template>
<script>
import {
ROOTPATH
} from '@/common/config.js'
import {
base64ToFile,
toast,
shareInfo
} from '@/common/util'
import FormData from './formdata/formdata.js'
export default {
data() {
return {
SCREEN_WIDTH:0,
SCREEN_HEIGHT:0,
isShare: false,
isHidden: false,
imgData: '',
//isShowModal: false,
userInfo: {},
myIndex: 0,
navBarTop: 0,
};
},
onShow() {
this.userInfo = uni.getStorageSync('walksz_lifeData').vuex_user
this.myIndex = this.userInfo.myIndex?this.userInfo.myIndex:'-'
const MenuButton = uni.getMenuButtonBoundingClientRect()
this.navBarTop = MenuButton.top + MenuButton.height //
let sysInfo = uni.getSystemInfoSync();
this.SCREEN_WIDTH = sysInfo.screenWidth
this.SCREEN_HEIGHT = sysInfo.screenHeight;
},
methods: {
share() {
this.isHidden = true
uni.showLoading({
title: '图片生成中..'
})
var ctx = uni.createCanvasContext('firstCanvas')
var w = this.SCREEN_WIDTH * 0.9;
var h = this.SCREEN_HEIGHT * 0.7;
console.log(w,h)
var lw = 176 * .3
var lh = 450 * .3
ctx.drawImage('../static/cer-bg.png', 0, 0,w, h);
ctx.drawImage('../static/cer-logo.png', w-lw-20, 20, lw, lh);
ctx.font = "13rpx bold";
ctx.fillStyle = "#fff";
var tleft = w*.13
if(this.SCREEN_WIDTH<380){
tleft = this.SCREEN_WIDTH<330?20:40
console.log("tleft",tleft)
ctx.fillText(this.userInfo.name+"", tleft, lh+40);
ctx.fillText("传承红色基因,赓续红色血脉。", tleft+20, lh+60);
ctx.fillText("您是第"+this.myIndex+"位完成“行走红色苏州——打卡",tleft+20, lh+80);
ctx.fillText("苏州市党史教育基地”活动的学员。", tleft, lh+100);
ctx.fillText("学好党史“必修课”,当好时代“答卷人”,", tleft+20, lh+120);
ctx.fillText("快邀请您的好友一起参加活动吧!", tleft, lh+140);
}else{
ctx.fillText(this.userInfo.name+"", tleft, lh+40);
ctx.fillText("传承红色基因,赓续红色血脉。", tleft+20, lh+60);
ctx.fillText("您是第"+this.myIndex+"位完成“行走红色苏州——打卡苏州市",tleft+20, lh+80);
ctx.fillText("党史教育基地”活动的学员。", tleft, lh+100);
ctx.fillText("学好党史“必修课”,当好时代“答卷人”,快邀", tleft+20, lh+120);
ctx.fillText("请您的好友一起参加活动吧!", tleft, lh+140);
}
ctx.draw()
setTimeout(() => {
uni.canvasToTempFilePath({
canvasId: 'firstCanvas',
fileType: 'jpg',
success: (res) => {
uni.hideLoading()
this.imgData = res.tempFilePath;
},
})
}, 100)
},
save() {
let _this = this
uni.saveImageToPhotosAlbum({
filePath: _this.imgData,
success: function() {
_this.isHidden = false
toast('保存成功')
}
});
uni.uploadFile({
url: `${ROOTPATH}/api/mobile/upload-file`,
filePath: this.imgData,
name: 'file',
formData: {
"file":this.imgData,
'token':this.vuex_token,
'active_tag':'walksz'
},
success: (res) => {
console.log(res)
// return
const val = JSON.parse(res.data)
this.$u.api.savePoster({
upload_id: val.id,
type: 1
}).then(res => {
}).catch(err => {
})
}
})
}
},
}
</script>
<style lang="scss">
.body {
// overflow: hidden;
min-height: 100vh;
position: relative;
}
.logo1 {
text-align: right;
display: block;
u-image {
display: inline-block;
margin-right: 45rpx;
}
}
@keyframes jello-horizontal {
0% {
transform: scale3d(1, 1, 1);
}
15% {
transform: scale3d(1.25, 0.75, 1);
}
20% {
transform: scale3d(0.75, 1.25, 1);
}
25% {
transform: scale3d(1.15, 0.85, 1);
}
33% {
transform: scale3d(0.95, 1.05, 1);
}
38% {
transform: scale3d(1.05, 0.95, 1);
}
50% {
transform: scale3d(1, 1, 1);
}
}
.share-img {
animation: jello-horizontal 3.2s both infinite;
z-index: 99999;
position: fixed;
left: 55rpx;
bottom: 86rpx;
}
.bkg {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.content {
padding-top: 40rpx;
position: relative;
.container {
z-index: 2;
// margin-top: 83rpx;
position: relative;
&__jiangbei {
display: flex;
justify-content: center;
z-index: 3;
position: relative;
}
&__bkg {
z-index: 1;
position: absolute;
top: 103rpx;
bottom: 0;
left: 0;
right: 0;
}
&__text {
z-index: 4;
padding: 0rpx 70rpx 0 90rpx;
position: relative;
&--title {
display: flex;
align-items: center;
font-weight: 400;
color: #ffffff;
font-size: 28rpx;
// line-height: 56rpx;
&>span {
color: #faca92;
// line-height: 56rpx;
border-bottom: 1px solid #fff;
padding: 0 10rpx;
}
}
&--total {
text-indent: 2em;
font-weight: 400;
color: #ffffff;
font-size: 28rpx;
line-height: 2;
// line-height: 56rpx;
&>span {
color: #faca92;
// text-decoration-color: #6F6F6F;
// text-decoration: underline;
border-bottom: 1px solid #fff;
padding: 0 10rpx;
}
}
}
}
.qrcode {
margin: 150rpx auto;
}
}
.share_cover {
background: rgba(0, 0, 0, 0.8);
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
height: 100vh;
width: 100vw;
z-index: 100000;
.share_cover_word {
color: #FFFFFF;
font-size: 48rpx;
width: 60%;
margin: 400rpx auto;
text-align: center;
line-height: 40px;
}
.share_cover_arrow {
position: absolute;
right: 0;
top: 0;
width: 300rpx;
height: 400rpx;
}
}
.share {
min-height: 100vh;
overflow-y: scroll;
padding: 278rpx 0;
z-index: 2;
position: fixed;
top: 0;
left: 0;
right: 0;
&-mask {
background: rgba(0, 0, 0, 0.4);
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
&-page {
width: fit-content;
overflow: scroll;
transform: translate(-50%, -50%);
position: absolute;
top: 50%;
left: 50%;
right: 0;
width:100%;
&>image {
width: 520rpx;
height: auto;
display: block;
border: 6rpx solid #F8E3CF;
box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(19, 1, 2, 0.71);
margin: auto;
}
&__btn {
display: flex;
justify-content: center;
padding-top: 52rpx;
&>view {
width: 230rpx;
height: 66rpx;
background: linear-gradient(0deg, #EFC495, #E9BC8A);
border-radius: 34rpx;
text-align: center;
font-weight: 400;
line-height: 66rpx;
font-size: 26rpx;
letter-spacing: 8rpx;
color: #C93E31;
}
&--share {
margin-right: 60rpx;
}
}
}
}
.fade-in {
animation: fade-in 1s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
}
@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.fade-out {
animation: fade-out .8s ease-out both;
}
@keyframes fade-out {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
</style>

@ -137,7 +137,8 @@
<script>
import tabbar from '@/components/tabbar/tabbar.vue'
import {
toMapAPP
toMapAPP,
shareInfo
} from "@/common/util.js"
export default {
components: {
@ -156,6 +157,12 @@
playvideo: false,
playimg: false
}
},
onShareAppMessage() {
return shareInfo
},
onShareTimeline(){
return shareInfo
},
onReady() {

@ -6,7 +6,7 @@
<view class="answer-wrap">
<view class="answer-wrap-img">
<u-image :show-loading="false" :fade="false" mode="widthFix" :width="711"
:src="require('../static/toast.png')"></u-image>
:src="require('@/static/toast.png')"></u-image>
</view>
<view class="answer-wrap-tip">
<view v-if="isCorrect">
@ -60,7 +60,10 @@
</template>
<script>
import tabbar from '@/components/tabbar/tabbar.vue'
import tabbar from '@/components/tabbar/tabbar.vue'
import {
shareInfo
} from "@/common/util.js"
export default {
components: {
tabbar,
@ -75,6 +78,12 @@
flag: -1, //active index
id: ''
};
},
onShareAppMessage() {
return shareInfo
},
onShareTimeline(){
return shareInfo
},
onLoad(option) {
this.id = option.id

@ -14,7 +14,7 @@
</view>
</block>
<view v-else class="nodata">
<u-empty text="数据为空" mode="search"></u-empty>
<u-empty text="还没有打卡记录" mode="search"></u-empty>
</view>
</view>
<tabbar :currentPage="6"></tabbar>
@ -22,7 +22,10 @@
</template>
<script>
import tabbar from '@/components/tabbar/tabbar.vue'
import tabbar from '@/components/tabbar/tabbar.vue'
import {
shareInfo
} from "@/common/util.js"
export default {
components: {
tabbar
@ -32,11 +35,18 @@
keyword: '',
pointers: []
}
},
onShareAppMessage() {
return shareInfo
},
onShareTimeline(){
return shareInfo
},
onLoad() {
// this.getPoints()
this.getPoints()
},
methods: {
methods: {
getPoints() {
this.pointers = []
this.$u.api.getPoints({

@ -1,28 +1,23 @@
<template>
<view class="cotainer">
<view class="search">
<view class="search-area">
<input type="text" maxlength="20" focus confirm-type="search" placeholder-class="pclass"
v-model="keyword" @confirm="getPoints"/>
<view class="bg-base" @click="getPoints"></view>
</view>
<view class="cotainer">
<view class="search">
<view class="search-area">
<input type="text" maxlength="20" focus confirm-type="search" placeholder-class="pclass"
v-model="keyword" @confirm="getPoints" />
<view class="bg-base" @click="getPoints"></view>
</view>
</view>
<view class="line">
<block v-if="pointers.length>0">
<view class="line-item" v-for="pointer in pointers" @click="toDetail(pointer.id)">
<view class="line-item-pointer">
<image class="line-item-pointer-img" :src="pointer.image.url" mode="">
</image>
<view class="">
<view class="line-item-pointer-title">{{pointer.name}}</view>
<view class="line-item-pointer-detail">点位详情</view>
</view>
</view>
</view>
</block>
<view v-else class="nodata">
<u-empty text="数据为空" mode="search"></u-empty>
<view class="line">
<block v-if="pointers.length>0">
<view class="line-item" v-for="pointer in pointers" @click="toDetail(pointer)">
<image class="line-item-img" src="../static/detail-go.png"></image>
<view class="line-item-title">{{pointer.name}}</view>
</view>
<view class="line-nodata">没有更多记录了</view>
</block>
<view v-else class="nodata">
<u-empty text="没有更多记录了" mode="search"></u-empty>
</view>
</view>
<tabbar :currentPage="6"></tabbar>
@ -30,7 +25,10 @@
</template>
<script>
import tabbar from '@/components/tabbar/tabbar.vue'
import tabbar from '@/components/tabbar/tabbar.vue'
import {
shareInfo
} from "@/common/util.js"
export default {
components: {
tabbar
@ -40,6 +38,12 @@
keyword: '',
pointers: []
}
},
onShareAppMessage() {
return shareInfo
},
onShareTimeline(){
return shareInfo
},
onLoad() {
// this.getPoints()
@ -47,50 +51,55 @@
methods: {
getPoints() {
this.pointers = []
this.$u.api.getPoints({
name:this.keyword
this.$u.api.getPoints({
name: this.keyword
}).then((res) => {
this.pointers = res.points
})
},
toDetail(id) {
uni.navigateTo({
url: '/packages/detail/detail?id=' + id,
});
},
toDetail(pointer) {
console.log("pointer",pointer)
uni.setStorageSync("vuex_pointer",pointer)
uni.switchTab({
url:'/pages/home/home'
})
},
}
}
</script>
<style lang="scss">
.cotainer{
padding-bottom:135rpx;
background-color: #f5f5f5;
}
.search{
position: fixed;
top:0;
left:0;
width:100%;
background-color: #f5f5f5;
z-index:9;
<style lang="scss">
.cotainer {
padding-bottom: 135rpx;
background-color: #f5f5f5;
}
.search {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: #f5f5f5;
z-index: 9;
}
.search-area {
display: flex;
width:90%;
width: 90%;
margin: 30rpx auto;
input {
padding: 20rpx 40rpx;
background-color: #fff;
border-radius: 40rpx 0 0 40rpx;
width: calc(100% - 160rpx);
height: 80rpx;
box-sizing: border-box;
width: calc(100% - 160rpx);
height: 80rpx;
box-sizing: border-box;
}
.bg-base {
background-color: #dbd0ba;
background: linear-gradient(to right, #edc99f, #cc9f6d);
color: #fff;
padding: 20rpx 40rpx;
height: 80rpx;
@ -100,62 +109,45 @@
}
}
.line {
width: 90%;
margin: 30rpx auto;
height:calc(100vh - 200rpx);
background-color: #f5f5f5;
overflow: scroll;
padding-top: 120rpx;
position: relative;
.nodata{
position: absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%);
}
&-item {
&-pointer {
display: flex;
align-items: center;
padding: 20rpx;
background-color: #fff;
border-radius: 20rpx;
// box-shadow: -2px -3rpx 12px rgba(0, 0, 0, 0.1);
margin-bottom: 30rpx;
width: 100%;
height: 180rpx;
&-img {
width: 165rpx;
height: 90rpx;
border-radius: 20rpx;
margin-right: 30rpx;
}
>view {
width: calc(100% - 200rpx)
}
&-title {
font-size: 32rpx;
color: #000;
}
.line {
width: 90%;
margin: 30rpx auto;
height: calc(100vh - 200rpx);
background-color: #f5f5f5;
overflow: scroll;
padding-top: 120rpx;
position: relative;
&-detail {
color: #bc9766;
}
.nodata {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
&-item {
display: flex;
align-items: center;
border-bottom: 1px solid #ddd;
padding: 15rpx;
&-icon {
width: 73rpx;
height: 73rpx;
position: absolute;
right: 30rpx;
bottom: 60rpx;
&-img {
width: 33rpx;
height: 32rpx;
margin-right: 20rpx;
}
}
&-title {
font-size: 32rpx;
color: #bc9766;
width: calc(100% - 60rpx);
}
}
&-nodata {
margin: 20rpx;
color: #ccc;
text-align:center;
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 KiB

@ -4,12 +4,21 @@
</template>
<script>
import {
shareInfo
} from "@/common/util.js"
export default{
data(){
return{
src:''
}
},
onShareAppMessage() {
return shareInfo
},
onShareTimeline(){
return shareInfo
},
onShow() {
},

@ -8,7 +8,7 @@
:src="require('@/static/index-title.png')" mode=""></image>
<!-- 真正的导航栏内容 -->
<view class="navBar">
<view @click="showTips = true">
<view @click="showTips = true,showNear = false">
<image class="navBar-left" :src="require('@/static/index-icon.png')" mode=""></image>
</view>
<view class="navBar-center" @click="openPicker">
@ -25,9 +25,31 @@
</view>
</view>
<view class="maps">
<map id="myMap" :longitude="lng" show-location :scale="scale" :latitude="lat" :markers="markers"
@callouttap="showDetail">
<cover-view class="maps-info">
<map id="myMap" :longitude="lng" show-location :enable-scroll="!showLoad" @regionchange="pushMarkers"
:scale="scale" :latitude="lat" :markers="markers" @callouttap="showDetail">
<cover-view slot="callout" class="maps-covers">
<block v-for="(item,index) in markers">
<cover-view :marker-id="item.id" :key='index'>
<cover-view class="maps-cover">
<cover-view class="maps-cover-wrap">
<cover-image class="maps-cover-img" :src='item.truePath'></cover-image>
<block v-if="item.has_answer===0">
<cover-view class="maps-cover-lock">
<cover-image class="maps-cover-lockimg"
:src="'/static/home-lock.png'"></cover-image>
<cover-view></cover-view>
</cover-view>
</block>
</cover-view>
<cover-view class="maps-cover-label">
<cover-image class="maps-labelbg" :src="'/static/home-cur.png'"></cover-image>
<cover-view>{{item.title}}</cover-view>
</cover-view>
</cover-view>
</cover-view>
</block>
</cover-view>
<cover-view class="maps-info" v-if="showNear">
<cover-view class="maps-info-near" @click="getNears">
<cover-image src="../../static/home-near.png" mode=""></cover-image>
</cover-view>
@ -38,7 +60,7 @@
<cover-image @click="closeDetail" style="width:40rpx;height:39rpx;"
src="/static/home-close.png" mode=""></cover-image>
</cover-view>
<cover-view>距你{{pointer.distance}}</cover-view>
<cover-view>距你{{pointer.distance?pointer.distance:'-'}}</cover-view>
<cover-view v-if="pointer.config.length>0">
<block v-for="con in pointer.config">
<block v-if="con.key==='address'">
@ -59,51 +81,31 @@
</cover-view>
</cover-view>
</cover-view>
<cover-view slot="callout">
<block v-for="(item,index) in markers" v-if="index<15">
<cover-view :marker-id="item.id" :key='index'>
<cover-view class="maps-cover">
<cover-view class="maps-cover-wrap">
<cover-image class="maps-cover-img" :src='item.truePath'></cover-image>
<block v-if="item.has_answer===0">
<cover-view class="maps-cover-lock">
<cover-image class="maps-cover-lockimg"
:src="'/static/home-lock.png'"></cover-image>
<cover-view></cover-view>
</cover-view>
</block>
</cover-view>
<cover-view class="maps-cover-label">
<cover-image class="maps-cover-labelbg" :src="'/static/home-cur.png'"></cover-image>
<cover-view>{{item.title}}</cover-view>
</cover-view>
</cover-view>
</cover-view>
</block>
</cover-view>
</map>
</view>
<u-picker v-model="showArea" @confirm="confirmArea" :range="listArea" range-key="value" confirm-color="#e50015"
mode="selector"></u-picker>
<u-picker v-model="showArea" @confirm="confirmArea" @cancel="cancelArea" :range="listArea" range-key="value"
:confirm-color="'#e50015'" mode="selector"></u-picker>
<!-- 锦囊 -->
<view class="tips" v-if="showTips" :class="showTips?'fade-in':'fade-out'">
<view class="tips-wrap">
<view class="tips-wrap-close" @click="showTips=false">
<view class="tips-wrap-close" @click="showTips=false,showNear=true">
x
</view>
<view class="tips-wrap-img">
<u-image :show-loading="false" :fade="false" mode="widthFix" :width="711"
:src="require('../../static/toast.png')"></u-image>
</view>
<view class="tips-wrap-tip">
<view class="">
<rich-text v-if='showTips' :nodes="tips?tips:' '"></rich-text>
<view class="tips-wrap-tip">
<view class="">
<rich-text v-if='showTips' :nodes="tips?tips:' '"></rich-text>
</view>
</view>
</view>
</view>
</view>
@ -113,6 +115,9 @@
<script>
import tabbar from '@/components/tabbar/tabbar.vue'
import {
ROOTPATH as baseUrl
} from "@/common/config.js"
import {
isNull,
shareInfo,
@ -132,6 +137,7 @@
tips: '',
theme_id: '',
area: '区域',
mapContext: null,
scale: 11,
lat: null,
lng: null,
@ -145,10 +151,18 @@
value: '全部'
}],
showArea: false,
tips: ''
tips: '',
showLoad: false,
showNear: true
}
},
onShareAppMessage() {
return shareInfo
},
onShareTimeline() {
return shareInfo
},
onReady() {
uni.authorize({
scope: 'scope.userLocation',
@ -156,21 +170,41 @@
this.getUserLocation()
}
})
this.mapContext = uni.createMapContext('myMap', this);
},
onLoad() {
onLoad(option) {
const MenuButton = uni.getMenuButtonBoundingClientRect()
this.navBarTop = MenuButton.top //
// this.getUserLocation()
if (isNull(this.vuex_token)) {
this.getToken()
} else {
this.getPointers()
}
this.getArea()
this.getConfig()
},
onShow() {
let vuex_pointer = uni.getStorageSync('vuex_pointer') ? uni.getStorageSync('vuex_pointer') : null
let vuex_latlng = uni.getStorageSync('vuex_latlng') ? uni.getStorageSync('vuex_latlng') : ''
if (vuex_pointer) {
this.pointer = vuex_pointer
this.pointer.distance = getDistance(vuex_latlng.lat, vuex_latlng.lng, this.pointer.lat, this.pointer.lng)
this.showPointer = true
this.scale = 13
uni.removeStorageSync('vuex_pointer')
this.mapContext.moveToLocation({
longitude: parseFloat(this.pointer.lng),
latitude: parseFloat(this.pointer.lat)
});
}
},
onHide() {
console.log("this.showTips", this.showTips)
this.showTips = false
this.showPointer = false
this.pointer = null
},
methods: {
//
getUserLocation() {
@ -178,8 +212,14 @@
type: 'gcj02',
success: (res) => {
console.log("res", res)
uni.removeStorageSync('vuex_latlng')
this.lng = res.longitude
this.lat = res.latitude
uni.setStorageSync('vuex_latlng', {
lng: this.lng,
lat: this.lat
})
this.getPointers()
},
fail: (err) => {
console.log("err", err)
@ -210,7 +250,7 @@
},
async getArea() {
let that = this
let url = 'https://vr.langye.net/api/mobile/base-form/show'
let url = baseUrl + '/api/mobile/base-form/show'
url = url + '?filter[0][key]=number&filter[0][op]=eq&filter[0][value]=theme&with_relations[0]=detail'
await uni.request({
url: url,
@ -234,14 +274,85 @@
if (e) {
this.area = this.listArea[e].value
this.theme_id = this.listArea[e].id
this.getPointers()
this.showPointer = false
this.pointer = null
this.showNear = true
this.scale = 11
this.markers = []
// id markers
if(this.theme_id==''){
// this.mapContext.moveToLocation({
// longitude: this.lng,
// latitude: this.lat,
// });
// this.getPointers()
this.pointers.map((item, index) => {
if(index<10){
this.markers.push({
id: item.id,
latitude: parseFloat(item.lat),
longitude: parseFloat(item.lng),
iconPath: '/static/home-marker.png',
truePath: item.logo ? item.logo.url : item.image.url,
width: 0,
height: 0,
title: item.name,
distance: item.distance ? parseInt(item.distance) : 0,
has_answer: item.has_answer,
customCallout: {
anchorX: 70,
anchorY: 30,
display: 'ALWAYS'
},
})
}
})
}else{
this.pointers.map((item, index) => {
if (this.theme_id && item.theme_id == this.theme_id) {
this.markers.push({
id: item.id,
latitude: parseFloat(item.lat),
longitude: parseFloat(item.lng),
iconPath: '/static/home-marker.png',
truePath: item.logo ? item.logo.url : item.image.url,
width: 0,
height: 0,
title: item.name,
distance: item.distance ? parseInt(item.distance) : 0,
has_answer: item.has_answer,
customCallout: {
anchorX: 70,
anchorY: 30,
display: 'ALWAYS'
},
})
}
})
this.mapContext.moveToLocation({
longitude: this.markers[0].longitude,
latitude: this.markers[0].latitude,
});
}
// this.getPointers()
}
},
cancelArea() {
this.showNear = true
this.showArea = false
this.showPointer = false
this.pointer = null
},
openPicker() {
uni.hideKeyboard()
this.showArea = true
this.showNear = false
this.showPointer = false
this.pointer = null
},
goSearch() {
uni.navigateTo({
@ -258,65 +369,87 @@
})
},
getNears() {
console.log("123")
this.scale = 13
this.showPointer = false
this.pointer = null
this.mapContext.moveToLocation({
longitude: this.lng,
latitude: this.lat
});
},
async getPointers() {
this.pointers = []
this.markers = []
const res = await this.$u.api.getPoints({
theme_id: this.theme_id,
})
this.done = res.point_answer_total > 5 ? 5 : res.point_answer_total
this.pointers = res.points
res.points.map(item => {
this.markers.push({
id: item.id,
latitude: parseFloat(item.lat),
longitude: parseFloat(item.lng),
iconPath: '/static/home-marker.png',
truePath: item.image.url,
width: 0,
height: 0,
title: item.name,
has_answer: item.has_answer,
item: item,
customCallout: {
display: 'ALWAYS'
},
})
this.pointers.map((item, index) => {
item.distance = getDistance(this.lat, this.lng, item.lat, item.lng)
if (index < 10) {
this.markers.push({
id: item.id,
latitude: parseFloat(item.lat),
longitude: parseFloat(item.lng),
iconPath: '/static/home-marker.png',
truePath: item.logo ? item.logo.url : item.image.url,
width: 0,
height: 0,
title: item.name,
distance: item.distance ? parseInt(item.distance) : 0,
has_answer: item.has_answer,
customCallout: {
anchorX: 70,
anchorY: 30,
display: 'ALWAYS'
},
})
}
})
},
async getNears() {
const res = await this.$u.api.getNear({
lat: this.lat,
lng: this.lng,
})
if (res.list && res.list.length > 0) {
this.pointers = []
this.markers = []
this.showPointer = false
} else {
toast('附近暂无红色站点')
//
pushMarkers(e) {
console.log("e", e)
let lengthM = this.markers.length //markers
//
if (this.showLoad || this.theme_id) {
return
}
this.pointers = res.list
res.list.map(item => {
this.markers.push({
id: item.id,
latitude: parseFloat(item.lat),
longitude: parseFloat(item.lng),
iconPath: '/static/home-marker.png',
truePath: item.image.url,
width: 0,
height: 0,
title: item.name,
has_answer: item.has_answer,
item: item,
customCallout: {
display: 'ALWAYS'
},
if (e && this.markers.length < this.pointers.length) {
this.pointers.map((item, index) => {
// 10
if (index > lengthM - 1 && index < lengthM + 10) {
uni.showLoading()
this.showLoad = true
this.markers.push({
id: item.id,
latitude: parseFloat(item.lat),
longitude: parseFloat(item.lng),
iconPath: '/static/home-marker.png',
truePath: item.logo ? item.logo.url : item.image.url,
width: 0,
height: 0,
title: item.name,
distance: item.distance ? parseInt(item.distance) : 0,
has_answer: item.has_answer,
customCallout: {
anchorX: 70,
anchorY: 30,
display: 'ALWAYS'
},
})
let that = this
setTimeout(function() {
uni.hideLoading()
that.showLoad = false
}, 2000)
}
})
})
}
},
toDetail() {
uni.navigateTo({
url: '/packages/detail/detail?id=' + this.pointer.id,
@ -429,6 +562,7 @@
left: 0;
bottom: 160rpx;
width: 100%;
z-index: 99;
&-pointer {
background: #fff;
@ -498,7 +632,7 @@
&-cover {
display: flex;
align-items: center;
// z-index: 9999;
z-index: 9999;
&-wrap {
position: relative;
@ -569,7 +703,7 @@
width: 80rpx;
height: 80rpx;
border-radius: 80rpx;
line-height: 80rpx;
line-height: 70rpx;
text-align: center;
border: 1px solid #fff;
position: absolute;
@ -580,7 +714,7 @@
}
&-img {
position: absolute;
position: relative;
top: 0;
width: 100%;
@ -592,18 +726,17 @@
}
&-tip {
padding-top: 350rpx;
position: relative;
width: 100%;
color: #333;
font-size: 33rpx;
margin: 0 auto;
padding: 60rpx;
margin-top: 230rpx;
line-height: 2;
height: 800rpx;
overflow: scroll;
padding-top: 0;
position: absolute;
top: 220rpx;
left: 50%;
transform: translate(-50%, 0%);
width: 80%;
view {
p {

@ -25,8 +25,30 @@
</view>
</view>
<view class="maps">
<map id="myMap" :longitude="lng" show-location :scale="scale" :latitude="lat" :markers="markers"
<map id="myMap" :longitude="lng" @regionchange="pushMarkers" show-location :scale="scale" :latitude="lat" :markers="markers"
@callouttap="showDetail">
<cover-view slot="callout" class="maps-covers">
<block v-for="(item,index) in markers">
<cover-view :marker-id="item.id" :key='index'>
<cover-view class="maps-cover">
<cover-view class="maps-cover-wrap">
<cover-image class="maps-cover-img" :src='item.truePath'></cover-image>
<block v-if="item.has_answer===0">
<cover-view class="maps-cover-lock">
<cover-image class="maps-cover-lockimg" :src="'/static/home-lock.png'"></cover-image>
<cover-view></cover-view>
</cover-view>
</block>
</cover-view>
<cover-view class="maps-cover-label">
<cover-image class="maps-labelbg" :src="'/static/home-cur.png'"></cover-image>
<cover-view>{{item.title}}</cover-view>
</cover-view>
</cover-view>
</cover-view>
</block>
</cover-view>
<cover-view class="maps-info">
<cover-view class="maps-info-near" @click="getNears">
<cover-image src="../../static/home-near.png" mode=""></cover-image>
@ -38,7 +60,7 @@
<cover-image @click="closeDetail" style="width:40rpx;height:39rpx;"
src="/static/home-close.png" mode=""></cover-image>
</cover-view>
<cover-view>距你{{pointer.distance}}</cover-view>
<cover-view>距你{{pointer.distance?pointer.distance:'-'}}</cover-view>
<cover-view v-if="pointer.config.length>0">
<block v-for="con in pointer.config">
<block v-if="con.key==='address'">
@ -50,8 +72,7 @@
<cover-view style="width:100%;height:1px;background:#e9e9e9"></cover-view>
<cover-view class="maps-info-pointer-btn">
<cover-view @click="toMap">
<cover-image style="width:29rpx;height:30rpx;" src="/static/home-go.png"
mode=""></cover-image>
<cover-image style="width:29rpx;height:30rpx;" src="/static/home-go.png" mode=""></cover-image>
<cover-view style="display:inline-block;vertical-align: middle;">开始前往</cover-view>
</cover-view>
<cover-image @click="toDetail" style="width:201rpx;height:55rpx;" src="/static/home-btn.png"
@ -59,28 +80,6 @@
</cover-view>
</cover-view>
</cover-view>
<cover-view slot="callout">
<block v-for="(item,index) in markers">
<cover-view :marker-id="item.id" :key='index'>
<cover-view class="maps-cover">
<cover-view class="maps-cover-wrap">
<cover-image class="maps-cover-img" :src='item.customCallout.avatar'></cover-image>
<block v-if="item.customCallout.has_answer===0">
<cover-view class="maps-cover-lock">
<cover-image class="maps-cover-lockimg"
:src="'/static/home-lock.png'"></cover-image>
<cover-view></cover-view>
</cover-view>
</block>
</cover-view>
<cover-view class="maps-cover-label">
<cover-image class="maps-cover-labelbg" :src="'/static/home-cur.png'"></cover-image>
<cover-view>{{item.customCallout.title}}</cover-view>
</cover-view>
</cover-view>
</cover-view>
</block>
</cover-view>
</map>
</view>
@ -96,14 +95,16 @@
<view class="tips-wrap-img">
<u-image :show-loading="false" :fade="false" mode="widthFix" :width="711"
:src="require('../../static/toast.png')"></u-image>
</view>
<view class="tips-wrap-tip">
<view class="">
<rich-text v-if='showTips' :nodes="tips?tips:' '"></rich-text>
<view class="tips-wrap-tip">
<view class="">
<rich-text v-if='showTips' :nodes="tips?tips:' '"></rich-text>
</view>
</view>
</view>
</view>
</view>
@ -148,6 +149,12 @@
tips: ''
}
},
onShareAppMessage() {
return shareInfo
},
onShareTimeline(){
return shareInfo
},
onReady() {
uni.authorize({
@ -156,9 +163,8 @@
this.getUserLocation()
}
})
},
onLoad() {
onLoad(option) {
const MenuButton = uni.getMenuButtonBoundingClientRect()
this.navBarTop = MenuButton.top //
// this.getUserLocation()
@ -168,8 +174,25 @@
this.getPointers()
}
this.getArea()
this.getConfig()
this.getConfig()
},
onShow(){
let vuex_pointer = uni.getStorageSync('vuex_pointer')?uni.getStorageSync('vuex_pointer'):null
let vuex_latlng = uni.getStorageSync('vuex_latlng')?uni.getStorageSync('vuex_latlng'):''
if(vuex_pointer){
this.pointer = vuex_pointer
this.pointer.distance = getDistance(vuex_latlng.lat, vuex_latlng.lng, this.pointer.lat, this.pointer.lng)
this.showPointer = true
uni.removeStorageSync('vuex_pointer')
}
},
onHide() {
console.log("this.showTips",this.showTips)
this.showTips = false
this.showPointer = false
this.pointer = null
},
methods: {
//
@ -177,9 +200,11 @@
uni.getLocation({
type: 'gcj02',
success: (res) => {
console.log("res", res)
console.log("res", res)
uni.removeStorageSync('vuex_latlng')
this.lng = res.longitude
this.lat = res.latitude
this.lat = res.latitude
uni.setStorageSync('vuex_latlng',{lng:this.lng,lat:this.lat})
},
fail: (err) => {
console.log("err", err)
@ -259,39 +284,56 @@
})
},
async getPointers() {
let that = this
this.pointers = []
this.markers = []
let _markers = []
this.markers = []
const res = await this.$u.api.getPoints({
theme_id: this.theme_id,
})
this.done = res.point_answer_total > 5 ? 5 : res.point_answer_total
this.pointers = res.points
res.points.map(item => {
_markers.push({
id: item.id,
latitude: parseFloat(item.lat),
longitude: parseFloat(item.lng),
iconPath: '/static/home-marker.png',
truePath: item.image.url,
width: 0,
height: 0,
title: item.name,
has_answer: item.has_answer,
item: item,
customCallout: {
display: 'ALWAYS',
avatar: item.image.url,
res.points.map((item,index) => {
if(index<15){
this.markers.push({
id: item.id,
latitude: parseFloat(item.lat),
longitude: parseFloat(item.lng),
iconPath: '/static/home-marker.png',
truePath: item.image.url,
width: 0,
height: 0,
title: item.name,
has_answer: item.has_answer,
anchor:-15,
anchor:-15
},
})
})
this.markers = _markers
item: item,
customCallout: {
display: 'ALWAYS'
},
})
}
})
},
pushMarkers(e){
console.log("e",e)
if(e && this.markers.length<this.pointers.length){
this.pointers.map((item,index)=>{
if(index>this.markers.length-1){
this.markers.push({
id: item.id,
latitude: parseFloat(item.lat),
longitude: parseFloat(item.lng),
iconPath: '/static/home-marker.png',
truePath: item.image.url,
width: 0,
height: 0,
title: item.name,
has_answer: item.has_answer,
item: item,
customCallout: {
display: 'ALWAYS'
},
})
}
})
}
},
async getNears() {
@ -438,7 +480,7 @@
left: 0;
bottom: 160rpx;
width: 100%;
z-index:99;
&-pointer {
background: #fff;
border-radius: 20rpx;
@ -494,7 +536,7 @@
width: 90%;
margin: 0 auto;
text-align: right;
cover-image {
width: 243rpx;
height: 142rpx;
@ -507,7 +549,7 @@
&-cover {
display: flex;
align-items: center;
// z-index: 9999;
z-index: 9999;
&-wrap {
position: relative;
@ -578,7 +620,7 @@
width: 80rpx;
height: 80rpx;
border-radius: 80rpx;
line-height: 80rpx;
line-height: 70rpx;
text-align: center;
border: 1px solid #fff;
position: absolute;
@ -589,7 +631,7 @@
}
&-img {
position: absolute;
position: relative;
top: 0;
width: 100%;
@ -601,18 +643,17 @@
}
&-tip {
padding-top: 350rpx;
position: relative;
width: 100%;
color: #333;
font-size: 33rpx;
margin: 0 auto;
padding: 60rpx;
margin-top: 230rpx;
line-height: 2;
height: 800rpx;
overflow: scroll;
padding-top: 0;
position: absolute;
top: 220rpx;
left: 50%;
transform: translate(-50%, 0%);
width: 80%;
view {
p {

@ -62,17 +62,18 @@
show: false,
width: '745rpx',
height: '857rpx'
}, {
name: 'fadeIn',
duration: '1s',
timer: 1000,
content: require('../../static/index-icon.png'),
autoplay: false,
class: 'logo1',
show: false,
width: '58rpx',
height: '86rpx'
},
},
// {
// name: 'fadeIn',
// duration: '1s',
// timer: 1000,
// content: require('../../static/index-icon.png'),
// autoplay: false,
// class: 'logo1',
// show: false,
// width: '58rpx',
// height: '86rpx'
// },
{
name: 'zoomIn',
duration: '1s',
@ -194,7 +195,7 @@
.progress-bar-container {
width: 100%;
height: 55rpx;
height: 40rpx;
background-color: #f7f1e2;
overflow: hidden;
border: 4rpx solid #d6aca1;

@ -61,7 +61,10 @@
</template>
<script>
import tabbar from '@/components/tabbar/tabbar.vue'
import tabbar from '@/components/tabbar/tabbar.vue'
import {
shareInfo
} from '@/common/util.js'
export default {
components: {
tabbar
@ -73,6 +76,12 @@
colorList: ['#dbd0ba','#960909'],
}
},
onShareAppMessage() {
return shareInfo
},
onShareTimeline(){
return shareInfo
},
onReady() {

@ -19,13 +19,14 @@
<view>
<view v-if="item.id==='cer'" class="cer">
<view class="cer-progress">
<view>{{done}}</view>
<view>{{(done/answerTotal)*100+'%'}}</view>
<view class="cer-progress-bar">
<view class="cer-progress-item" :style="{'width':(done/5)*100+'%'}"></view>
<view class="cer-progress-item" :style="{'width':(done/answerTotal)*100+'%'}">
</view>
</view>
</view>
<view class="cer-btn" :class="{'cer-btn-active':done>4}">
<text>{{done<5?'':''}}</text>
<view class="cer-btn" :class="{'cer-btn-active':done>(answerTotal-1)}">
<text>{{done < answerTotal ? '未完成打卡' : '生成证书'}}</text>
</view>
</view>
<u-icon v-else name="arrow-right" size="40" color="#e0e0e0"></u-icon>
@ -33,24 +34,24 @@
</view>
</view>
</view>
<!-- 锦囊 -->
<view class="tips" v-if="showTips" :class="showTips?'fade-in':'fade-out'">
<view class="tips-wrap">
<view class="tips-wrap-close" @click="showTips=false">
x
</view>
<view class="tips-wrap-img">
<u-image :show-loading="false" :fade="false" mode="widthFix" :width="711"
:src="require('../../static/toast.png')"></u-image>
</view>
<view class="tips-wrap-tip">
<view class="">
<rich-text v-if='showTips' :nodes="tips?tips:' '"></rich-text>
</view>
</view>
</view>
<!-- 锦囊 -->
<view class="tips" v-if="showTips" :class="showTips?'fade-in':'fade-out'">
<view class="tips-wrap">
<view class="tips-wrap-close" @click="showTips=false">
x
</view>
<view class="tips-wrap-img">
<u-image :show-loading="false" :fade="false" mode="widthFix" :width="711"
:src="require('../../static/toast.png')"></u-image>
<view class="tips-wrap-tip">
<view class="">
<rich-text v-if='showTips' :nodes="tips?tips:' '"></rich-text>
</view>
</view>
</view>
</view>
</view>
<!-- 弹出头像 昵称 -->
<u-popup v-model="showform" mode="bottom" :mask-close-able="maskClose">
@ -58,10 +59,9 @@
<view>
<span>头像</span>
<view style="border:none">
<button open-type="chooseAvatar" @chooseavatar='onChooseAvatar'
style="padding: 0;margin: 0;">
<image :src="imgurl" mode=""></image>
<button open-type="chooseAvatar" @chooseavatar='onChooseAvatar' style="padding: 0;margin: 0;">
<image :src="imgurl" mode=""></image>
</button>
</view>
</view>
@ -82,13 +82,14 @@
</template>
<script>
import tabbar from '@/components/tabbar/tabbar.vue'
import {
ROOTPATH as baseUrl
} from "@/common/config.js"
import {
isNull,
toast
import tabbar from '@/components/tabbar/tabbar.vue'
import {
ROOTPATH as baseUrl
} from "@/common/config.js"
import {
isNull,
toast,
shareInfo
} from "@/common/util.js"
export default {
components: {
@ -96,18 +97,19 @@
},
data() {
return {
navBarTop: 0,
showTips:false,
tips:'',
navBarTop: 0,
showTips: false,
tips: '',
info: {},
headReplace: '',
showform: false,
maskClose: false,
imgurl:'',
maskClose: false,
imgurl: '',
form: {
name: ''
},
done: 0,
answerTotal: 0,
list: [{
id: 'cer',
title: '我的红色证书',
@ -132,13 +134,19 @@
}]
}
},
onShareAppMessage() {
return shareInfo
},
onShareTimeline() {
return shareInfo
},
onLoad() {
const MenuButton = uni.getMenuButtonBoundingClientRect()
this.navBarTop = MenuButton.top //
this.getInitUser()
this.getDone()
this.navBarTop = MenuButton.top //
this.getInitUser()
this.getConfig()
this.getDone()
},
methods: {
onChooseAvatar(e) {
@ -151,77 +159,85 @@
formData: {
token: this.vuex_token
},
success: (res) => {
uni.showToast({
title: '上传成功',
duration: 1000
})
console.log("res",res)
this.imgurl = JSON.parse(res.data).url
this.form.headimgurl = this.imgurl
success: (res) => {
uni.showToast({
title: '上传成功',
duration: 1000
})
console.log("res", res)
this.imgurl = JSON.parse(res.data).url
this.form.headimgurl = this.imgurl
}
})
},
//
blurname(e) {
blurname(e) {
console.log(e)
if (e) {
this.form.name = e.detail.value
}
},
async getInitUser() {
const res = await this.$u.api.user()
this.$u.vuex('vuex_user', res)
console.log(this.vuex_user)
this.form = res
this.imgurl = res.headimgurl?res.headimgurl:''
this.info = this.$u.deepClone(res);
if(isNull(res.name)){
this.showform = true
}
},
async getDone(){
const res = await this.$u.api.getPoints()
this.done = res.point_answer_total>5?5:res.point_answer_total
},
getConfig() {
this.$u.api.getAppId().then((res) => {
},
async getInitUser() {
const res = await this.$u.api.user()
this.$u.vuex('vuex_user', res)
console.log(this.vuex_user)
this.form = res
this.imgurl = res.headimgurl ? res.headimgurl : ''
this.info = this.$u.deepClone(res);
if (isNull(res.name)) {
this.showform = true
}
},
async getDone() {
const res = await this.$u.api.getPoints()
this.done = res.point_answer_total > this.answerTotal ? this.answerTotal : res.point_answer_total
},
async getConfig() {
await this.$u.api.getAppId().then(res=>{
console.log("res",res)
res.config.map(item => {
if (item.key === 'tips') {
this.tips = item.value
}
if (item.key === 'answer_total') {
this.answerTotal = parseInt(item.value)
}
})
})
},
submit() {
if (isNull(this.form.name)) {
toast("请填写所有信息")
return
}
this.$u.api.saveUser(this.form).then(res => {
toast('更新成功')
this.showform = false
this.getInitUser()
if (isNull(this.form.name)) {
toast("请填写所有信息")
return
}
this.$u.api.saveUser(this.form).then(res => {
toast('更新成功')
this.showform = false
this.getInitUser()
})
},
toUrl(item) {
if(item.id=='cer'){
if(this.done>4){
uni.navigateTo({
url: item.url
})
}else{
toast('请先完成打卡')
}
}else if(item.id=='tips'){
this.showTips = true
}else{
uni.navigateTo({
url: item.url
})
toUrl(item) {
if (item.id == 'cer') {
uni.navigateTo({
url: item.url
})
if (this.done > this.answerTotal - 1) {
uni.navigateTo({
url: item.url
})
} else {
toast('请先完成打卡')
}
} else if (item.id == 'tips') {
this.showTips = true
} else {
uni.navigateTo({
url: item.url
})
}
},
@ -376,10 +392,11 @@
button {
width: 100rpx;
height: 100rpx;
image{
width:100%;
height:100%;
height: 100rpx;
image {
width: 100%;
height: 100%;
}
}
@ -387,10 +404,11 @@
border: 1px solid #999;
border-radius: 10rpx;
display: flex;
width: calc(100% - 120rpx);
padding:10rpx 20rpx;
input{
width:100%;
width: calc(100% - 120rpx);
padding: 10rpx 20rpx;
input {
width: 100%;
}
}
@ -413,92 +431,93 @@
}
}
}
.tips {
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.7);
position: fixed;
top: 0;
left: 0;
z-index: 999;
&-wrap {
&-close {
color: #fff;
width: 80rpx;
height: 80rpx;
border-radius: 80rpx;
line-height: 80rpx;
text-align: center;
border: 1px solid #fff;
position: absolute;
top: 135rpx;
left: 20rpx;
font-size: 50rpx;
z-index: 10;
}
&-img {
position: absolute;
top: 0;
width: 100%;
u-image {
&>view {
margin: 0 auto;
}
}
}
&-tip {
padding-top: 350rpx;
position: relative;
width: 100%;
color: #333;
font-size: 33rpx;
margin: 0 auto;
padding: 60rpx;
margin-top: 230rpx;
line-height: 2;
height: 800rpx;
overflow: scroll;
padding-top: 0;
view {
p {
text-indent: 2em;
}
}
}
}
}
}
.fade-in {
animation: fade-in .5s cubic-bezier(0.39, 0.575, 0.565, 1) both;
}
@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.fade-out {
animation: fade-out .4s ease-out both;
}
@keyframes fade-out {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
.tips {
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.7);
position: fixed;
top: 0;
left: 0;
z-index: 999;
&-wrap {
&-close {
color: #fff;
width: 80rpx;
height: 80rpx;
border-radius: 80rpx;
line-height: 70rpx;
text-align: center;
border: 1px solid #fff;
position: absolute;
top: 135rpx;
left: 20rpx;
font-size: 50rpx;
z-index: 10;
}
&-img {
position: relative;
top: 0;
width: 100%;
u-image {
&>view {
margin: 0 auto;
}
}
}
&-tip {
color: #333;
font-size: 33rpx;
margin: 0 auto;
line-height: 2;
height: 800rpx;
overflow: scroll;
position: absolute;
top: 220rpx;
left: 50%;
transform: translate(-50%, 0%);
width: 80%;
view {
p {
text-indent: 2em;
}
}
}
}
}
}
.fade-in {
animation: fade-in .5s cubic-bezier(0.39, 0.575, 0.565, 1) both;
}
@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.fade-out {
animation: fade-out .4s ease-out both;
}
@keyframes fade-out {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Loading…
Cancel
Save