Browse Source

完成页面

h5_css
yanyan 3 years ago
parent
commit
852c19f278
  1. 64
      subpkg/complete/complete.vue

64
subpkg/complete/complete.vue

@ -1,8 +1,8 @@
<template> <template>
<view class="wrap"> <view class="wrap">
<view class="stabar"></view> <view class="stabar"></view>
<view class="marsk"></view> <view class="marsk" v-if="showLayer"></view>
<view class="popup-layer"> <view class="popup-layer" v-if="showMedal">
<image class="animg" src="/static/images/joy.png"></image> <image class="animg" src="/static/images/joy.png"></image>
</view> </view>
@ -13,9 +13,9 @@
<view class="question-item" v-for="(item, i) in questionList" :key="i" @click="itemClickHandler(item)"> <view class="question-item" v-for="(item, i) in questionList" :key="i" @click="itemClickHandler(item)">
<span class="question-num">{{i+1}}</span> <span class="question-num">{{i+1}}</span>
</view> </view>
<view class="question-item erritem" v-for="(item, i) in questionList" :key="i" @click="itemClickHandler(item)"> <!-- <view class="question-item erritem" v-for="(item, i) in questionList" :key="i" @click="itemClickHandler(item)">
<span class="question-num">{{i+1}}</span> <span class="question-num">{{i+1}}</span>
</view> </view> -->
</view> </view>
<view class="answer-content"> <view class="answer-content">
@ -41,7 +41,7 @@
<view class="perinfo"> <view class="perinfo">
<view class="myitem"> <view class="myitem">
<!-- <label><button open-type="share"></button>炫耀一下</label> --> <!-- <label><button open-type="share"></button>炫耀一下</label> -->
<view open-type="share"><label><image src="/static/images/btn-xy.png"></image></label>炫耀一下</view> <view @click="shareUser()"><label><image src="/static/images/btn-xy.png"></image></label>炫耀一下</view>
</view> </view>
<view class="myitem"> <view class="myitem">
<view @click="review()"><label><image src="/static/images/btn-hg.png"></image></label>演练回顾</view> <view @click="review()"><label><image src="/static/images/btn-hg.png"></image></label>演练回顾</view>
@ -51,15 +51,16 @@
</view> </view>
</view> </view>
</view> </view>
<view class="popup-share"> <view class="popup-share" v-if="showShare">
<view @click="closeShare()" style="margin-left: 250px;">关闭</view>
<label class="medimg"><image src="/static/images/medal_1.png"></image></label> <label class="medimg"><image src="/static/images/medal_1.png"></image></label>
<view class="congrat">恭喜你获得1枚成就勋章</view> <view class="congrat">恭喜你获得1枚成就勋章</view>
<view class="perinfo"> <view class="perinfo">
<view class="myitem"> <view class="myitem">
<view @click=""><label><image src="/static/images/btn-wx.png"></image></label>分享给微信好友</view> <view @click=""><label><button open-type="share"></button><image src="/static/images/btn-wx.png"></image></label>分享给微信好友</view>
</view> </view>
<view class="myitem"> <view class="myitem">
<view @click=""><label><image src="/static/images/btn-pyq.png"></image></label>分享到朋友圈</view> <view @click=""><label><button @tap="share"></button><image src="/static/images/btn-pyq.png"></image></label>分享到朋友圈</view>
</view> </view>
<view class="myitem"> <view class="myitem">
<view @click=""><label><image src="/static/images/btn-ma.png"></image></label>二维码邀请</view> <view @click=""><label><image src="/static/images/btn-ma.png"></image></label>二维码邀请</view>
@ -80,8 +81,13 @@
recordList: [], recordList: [],
"ask":"", "ask":"",
"answer":"", "answer":"",
"showLayer":true,
"showAnlysisc":false,
"showMedal":true,
"showShare":false,
}; };
}, },
//
onShareAppMessage(res) { onShareAppMessage(res) {
if (res.from === 'button') {// if (res.from === 'button') {//
console.log(res.target) console.log(res.target)
@ -91,13 +97,36 @@
path: '/pages/home/home' path: '/pages/home/home'
} }
}, },
//
onShareTimeline(res) {
return {
title: "快来和我一起答题吧",
type: 0,
summary: "",
};
},
onLoad(options) { onLoad(options) {
//this.roleId = options.roleId this.timer = setTimeout(() => {
//this.questionFreId = options.questionFreId this.showMedal = false
this.showLayer = false
clearTimeout(this.timer)
}, 5000)
this.roleId = options.roleId
this.questionFreId = options.questionFreId
this.getQuestionList() this.getQuestionList()
this.getRecordList() this.getRecordList()
}, },
methods: { methods: {
async share(){
await uni.share({
title: "快来和我一起答题吧",
type: 0,
summary: "",
success() {
console.log('分享成功')
}
})
},
async getQuestionList() { async getQuestionList() {
const { const {
data: res data: res
@ -125,6 +154,10 @@
url:'/pages/index/index' url:'/pages/index/index'
}) })
}, },
shareUser(){
this.showShare = true
this.showLayer = true
},
reChallenge(){ reChallenge(){
uni.navigateTo({ uni.navigateTo({
url: '/subpkg/rechallenge/rechallenge?questionFreId='+this.questionFreId url: '/subpkg/rechallenge/rechallenge?questionFreId='+this.questionFreId
@ -135,10 +168,15 @@
url: '/subpkg/review/review?questionFreId='+this.questionFreId url: '/subpkg/review/review?questionFreId='+this.questionFreId
}) })
}, },
closeShare(){
this.showShare = false
this.showLayer = false
},
itemClickHandler(item) { itemClickHandler(item) {
if(item !== ""){ if(item !== ""){
this.ask= item.ask this.ask= item.ask
this.answer= item.answer this.answer= item.answer
this.showAnlysisc = true
} }
}, },
} }
@ -150,7 +188,7 @@
/* 设置弹出层 */ /* 设置弹出层 */
.marsk { .marsk {
display: none; // display: none;
position: absolute; position: absolute;
z-index: 999; z-index: 999;
width: 100%; width: 100%;
@ -158,7 +196,7 @@
background-color: rgba(0, 0, 0, .5); background-color: rgba(0, 0, 0, .5);
} }
.popup-layer, .popup-share { .popup-layer, .popup-share {
display: none; //display: none;
position: absolute; position: absolute;
top: 45%; top: 45%;
left: 50%; left: 50%;
@ -239,7 +277,7 @@
} }
} }
.answer-content { .answer-content {
display: none; //display: none;
position: absolute; position: absolute;
z-index: 100; z-index: 100;
margin: 2% 3%; margin: 2% 3%;

Loading…
Cancel
Save