main
lion 2 years ago
parent 3d9a206e58
commit e9b472cf1c

@ -0,0 +1,57 @@
<template>
<view class="">
<cover-view class="loadwrap" v-if="showLoad">
<cover-view class="loadwrap-my">
<cover-image src="/static/loading.gif" alt="">
</cover-view>
</cover-view>
</view>
</template>
<script>
export default {
data() {
return {
showLoad:false
}
},
methods:{
showLoading(){
this.showLoad = true
},
hideLoading(){
this.showLoad = false
}
},
}
</script>
<style>
.loadwrap{
position: fixed;
top: 0;
left: 0;
width: 100%;
height:100vh;
z-index: 999;
/* background-color: #000; */
}
.loadwrap-my{
position: absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%);
width:200rpx;
height:200rpx;
background-color: rgba(0,0,0,0.6);
border-radius: 20rpx;
}
.loadwrap-my cover-image{
width:150rpx;
height:150rpx;
margin:0 auto;
margin-top:25rpx;
}
</style>

@ -1,7 +1,7 @@
<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>
:src="require('../static/cer-bg.jpg')"></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>
@ -32,19 +32,22 @@
<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 :style="{'top':navBarTop+'px','right':navBarRight+'px'}" :src="require('../static/cer-toShare.png')" class="share_cover_arrow"></image>
<view class="share_cover_word" :style="{'margin-top':200+navBarTop+'px'}">
<cover-view class="share_cover" v-show="isShare" @click="isShare = false">
<cover-image :style="{'top':navBarTop+'px','right':navBarRight+'px'}" src="../static/cer-toShare.png" class="share_cover_arrow"></cover-image>
<cover-view class="share_cover_word" :style="{'margin-top':200+navBarTop+'px'}">
请点击右上角将它发送给指定朋友或分享到朋友圈
</view>
</view>
</cover-view>
</cover-view>
</transition>
<view class="share" v-if="isHidden">
<view class="share-mask" @click="isHidden = false">
</view>
<view class="share-page">
<view class="share-page">
<cover-view class="share-page__close" @click="isHidden = false">
x
</cover-view>
<!-- <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>
@ -110,7 +113,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-bg.jpg', 0, 0,w, h);
ctx.drawImage('../static/cer-logo.png', w-lw-20, 20, lw, lh);
ctx.font = "13rpx bold";
ctx.fillStyle = "#fff";
@ -342,7 +345,8 @@
width: 60%;
margin: 400rpx auto;
text-align: center;
line-height: 40px;
line-height: 40px;
white-space: pre-wrap;
}
@ -351,7 +355,8 @@
right: 0;
top: 0;
width: 300rpx;
height: 400rpx;
height: 400rpx;
z-index: 1000001;
}
}
@ -359,7 +364,7 @@
min-height: 100vh;
overflow-y: scroll;
padding: 278rpx 0;
// padding: 278rpx 0;
z-index: 2;
position: fixed;
top: 0;
@ -385,17 +390,30 @@
top: 50%;
left: 50%;
right: 0;
width:100%;
width:100%;
padding-top: 40rpx;
&>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;
}
&__close{
color: #fff;
width: 80rpx;
height: 80rpx;
border-radius: 80rpx;
line-height: 70rpx;
text-align: center;
border: 1px solid #fff;
position: absolute;
top: 0rpx;
left: 0rpx;
font-size: 50rpx;
z-index: 10;
}
&__btn {
display: flex;
justify-content: center;

@ -90,12 +90,26 @@
<text>去预约</text>
</view>
</view>
</view>
</view>
<!-- vr -->
<view class="detail-vr" v-if="vrInfo.length>0">
<view class="detail-vr-title">
<image :src="require('@/packages/static/detail-vr.png')" mode=""></image>
</view>
<swiper class="detail-vr-swiper" :current="currentIndex" next-margin="140rpx" @change="swierChange"
</view>
<view class="detail-vr-swiper" v-if="vrInfo.length==1" style="margin-left: -25rpx;">
<view @click="toVr(vrInfo[0].url)" class="detail-vr-swiper-item" style="width:490rpx;margin: 0 auto;position: relative;margin-top:20rpx">
<view class="detail-vr-swiper-item-img">
<image :src="vrInfo[0].image.url" mode=""></image>
</view>
<view class="detail-vr-swiper-item-title">
<image :src="require('@/packages/static/detail-icon.png')" mode=""></image>
<text>{{vrInfo[0].name}}</text>
</view>
</view>
</view>
<swiper v-else class="detail-vr-swiper" :current="currentIndex" next-margin="140rpx" @change="swierChange"
circular :autoplay="false">
<swiper-item v-for="(item,index) in vrInfo" :key="index">
<view @click="toVr(item.url)" class="detail-vr-swiper-item"
@ -109,7 +123,6 @@
</view>
</view>
</swiper-item>
</swiper>
</view>
<view class="detail-content">
@ -483,7 +496,7 @@
border-radius: 10rpx;
margin-top: 30rpx;
padding-right: 0;
padding-bottom: 25rpx;
&-title {
image {
width: 122rpx;
@ -495,7 +508,7 @@
// display: flex;
// overflow: auto;
min-height: 530rpx;
position: relative;
&-item {
padding: 25rpx;
margin: 20rpx;

@ -60,9 +60,9 @@
</template>
<script>
import tabbar from '@/components/tabbar/tabbar.vue'
import {
shareInfo
import tabbar from '@/components/tabbar/tabbar.vue'
import {
shareInfo
} from "@/common/util.js"
export default {
components: {
@ -76,17 +76,19 @@
isCorrect: false,
progress: 1, //123
flag: -1, //active index
id: ''
id: '',
questionTotal: 0
};
},
onShareAppMessage() {
return shareInfo
},
onShareTimeline(){
return shareInfo
},
onShareAppMessage() {
return shareInfo
},
onShareTimeline() {
return shareInfo
},
onLoad(option) {
this.id = option.id
this.getConfig()
this.getQuestions(option.id);
},
computed: {
@ -160,11 +162,41 @@
}
},
methods: {
async getConfig() {
await this.$u.api.getAppId().then(res => {
res.config.map(item => {
if (item.key === 'question_total') {
this.questionTotal = parseInt(item.value)
}
})
})
},
async getQuestions(id) {
const res = await this.$u.api.getQuestions({
point_id: id
})
this.answers = res.questions
if (res.questions.length <= this.questionTotal) {
this.answers = res.questions
} else {
this.answers = this.getRandomItems(res.questions,this.questionTotal)
}
},
getRandomItems(arr,n) {
if (n > arr.length) {
n = arr.length;
}
const itemsCopy = [...arr];
const result = [];
for (let i = 0; i < n; i++) {
const randomIndex = Math.floor(Math.random() * (itemsCopy.length - i));
result.push(itemsCopy.splice(randomIndex, 1)[0]);
}
return result;
},
answer(item, index) {
this.flag = index
@ -183,6 +215,7 @@
point_id: this.id,
answers: this.myAnswers
})
uni.setStorageSync('vuex_point_id', this.id)
}
}, 500)
},
@ -296,13 +329,12 @@
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.7);
position: relative;
position: fixed;
top: 0;
left: 0;
z-index: 999;
&-active {
}
&-active {}
&-wrap {
&-img {
@ -326,6 +358,8 @@
font-size: 33rpx;
>view {
width: 80%;
margin: 0 auto;
margin-bottom: 60rpx;
}
}

@ -1,7 +1,7 @@
<template>
<view class="cotainer">
<view class="line">
<block v-if="pointers.length>0">
<block v-if="showNo">
<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="">
@ -14,7 +14,7 @@
</view>
</block>
<view v-else class="nodata">
<u-empty text="还没有打卡记录" mode="search"></u-empty>
<u-empty text="还没有打卡记录" mode="data"></u-empty>
</view>
</view>
<tabbar :currentPage="6"></tabbar>
@ -33,7 +33,8 @@
data() {
return {
keyword: '',
pointers: []
pointers: [],
showNo:true
}
},
onShareAppMessage() {
@ -52,7 +53,8 @@
this.$u.api.getPoints({
myself:1
}).then((res) => {
this.pointers = res.points
this.pointers = res.points
this.showNo = res.points.length>0?true:false
})
},

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

@ -89,7 +89,7 @@
: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" @click="showTips=false,showNear=true">
<view class="tips-wrap-close" @click="showTips=false,showNear=true">
x
</view>
@ -108,13 +108,14 @@
</view>
</view>
<myloading ref="myloading"></myloading>
<tabbar :currentPage="0"></tabbar>
</view>
</template>
<script>
import tabbar from '@/components/tabbar/tabbar.vue'
import tabbar from '@/components/tabbar/tabbar.vue'
import myloading from '@/components/myloading.vue'
import {
ROOTPATH as baseUrl
} from "@/common/config.js"
@ -125,10 +126,11 @@
getDistance,
toMapAPP
} from '@/common/util.js'
export default {
components: {
tabbar
tabbar,
myloading
},
data() {
return {
@ -186,7 +188,9 @@
},
onShow() {
let vuex_pointer = uni.getStorageSync('vuex_pointer') ? uni.getStorageSync('vuex_pointer') : null
let vuex_latlng = uni.getStorageSync('vuex_latlng') ? uni.getStorageSync('vuex_latlng') : ''
let vuex_latlng = uni.getStorageSync('vuex_latlng') ? uni.getStorageSync('vuex_latlng') : ''
let vuex_point_id = uni.getStorageSync('vuex_point_id') ? uni.getStorageSync('vuex_point_id') : ''
//
if (vuex_pointer) {
this.pointer = vuex_pointer
this.pointer.distance = getDistance(vuex_latlng.lat, vuex_latlng.lng, this.pointer.lat, this.pointer.lng)
@ -197,6 +201,16 @@
longitude: parseFloat(this.pointer.lng),
latitude: parseFloat(this.pointer.lat)
});
}
//
console.log("vuex_point_id",vuex_point_id)
if(vuex_point_id){
this.markers.map(item=>{
if(item.id==vuex_point_id){
item.has_answer = 1
uni.removeStorageSync("vuex_point_id")
}
})
}
},
onHide() {
@ -421,7 +435,8 @@
this.pointers.map((item, index) => {
// 10
if (index > lengthM - 1 && index < lengthM + 10) {
uni.showLoading()
// uni.showLoading()
this.$refs.myloading.showLoading()
this.showLoad = true
this.markers.push({
id: item.id,
@ -442,7 +457,9 @@
})
let that = this
setTimeout(function() {
uni.hideLoading()
// uni.hideLoading()
that.$refs.myloading.hideLoading()
that.showLoad = false
}, 2000)
}
@ -642,7 +659,7 @@
width: 70rpx;
height: 70rpx;
border-radius: 70rpx;
border: 2px solid #dbd0ba;
border: 4rpx solid #dbd0ba;
}
&-lock {
@ -730,10 +747,10 @@
font-size: 33rpx;
margin: 0 auto;
line-height: 2;
height: 800rpx;
height: 650rpx;
overflow: scroll;
position: absolute;
top: 220rpx;
top: 350rpx;
left: 50%;
transform: translate(-50%, 0%);
width: 80%;

@ -77,7 +77,7 @@
{
name: 'zoomIn',
duration: '1s',
timer: 1000,
timer: 1500,
content: require('../../static/index-title.png'),
autoplay: false,
class: 'title',
@ -113,7 +113,7 @@
this.showBtn = true
}
}, 35);
}, 30);
},
play(index) {
if (index > this.animations.length - 1) {

@ -1,6 +1,6 @@
<template>
<view class="wrap">
<image class="bg" :src="require('@/static/qus-bg.png')" mode=""></image>
<image class="bg" :src="require('@/static/qus-bg.jpg')" mode=""></image>
<view class="me" :style="{paddingTop: navBarTop+'px'}">
<view class="me-avatar" @click="showform = true,maskClose=true">
<image :src="info.headimgurl?info.headimgurl:headReplace" mode=""></image>
@ -19,14 +19,15 @@
<view>
<view v-if="item.id==='cer'" class="cer">
<view class="cer-progress">
<view>{{(done/answerTotal)*100+'%'}}</view>
<view v-if="done>0 && answerTotal>0">{{(done/answerTotal)*100+'%'}}</view>
<view v-else>0</view>
<view class="cer-progress-bar">
<view class="cer-progress-item" :style="{'width':(done/answerTotal)*100+'%'}">
<view class="cer-progress-item" :style="{'width':done>0 && answerTotal>0?(done/answerTotal)*100+'%':0}">
</view>
</view>
</view>
<view class="cer-btn" :class="{'cer-btn-active':done>(answerTotal-1)}">
<text>{{done < answerTotal ? '未完成打卡' : '生成证书'}}</text>
<view class="cer-btn" :class="{'cer-btn-active':(done>0 && answerTotal>0 && done>=answerTotal)?true:false}">
<text>{{done>0 && answerTotal>0 && done >= answerTotal ? '生成证书' : '未完成打卡'}}</text>
</view>
</view>
<u-icon v-else name="arrow-right" size="40" color="#e0e0e0"></u-icon>
@ -36,7 +37,7 @@
</view>
<!-- 锦囊 -->
<view class="tips" v-if="showTips" :class="showTips?'fade-in':'fade-out'">
<view class="tips-wrap">
<view class="tips-wrap" @click="showTips=false">
<view class="tips-wrap-close" @click="showTips=false">
x
</view>
@ -45,7 +46,7 @@
:src="require('../../static/toast.png')"></u-image>
<view class="tips-wrap-tip">
<view class="">
<view class="">
<rich-text v-if='showTips' :nodes="tips?tips:' '"></rich-text>
</view>
</view>
@ -143,10 +144,11 @@
onLoad() {
const MenuButton = uni.getMenuButtonBoundingClientRect()
this.navBarTop = MenuButton.top //
this.getInitUser()
this.getConfig()
this.getDone()
},
onShow() {
this.getInitUser()
this.getDone()
},
methods: {
onChooseAvatar(e) {
@ -191,12 +193,12 @@
}
},
async getDone() {
const res = await this.$u.api.getPoints()
const res = await this.$u.api.getPoints()
// this.done = res.point_answer_total
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
@ -222,9 +224,6 @@
},
toUrl(item) {
if (item.id == 'cer') {
uni.navigateTo({
url: item.url
})
if (this.done > this.answerTotal - 1) {
uni.navigateTo({
url: item.url
@ -475,10 +474,10 @@
font-size: 33rpx;
margin: 0 auto;
line-height: 2;
height: 800rpx;
height: 650rpx;
overflow: scroll;
position: absolute;
top: 220rpx;
top: 350rpx;
left: 50%;
transform: translate(-50%, 0%);
width: 80%;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 KiB

After

Width:  |  Height:  |  Size: 139 KiB

Loading…
Cancel
Save