作者 wumengyu

我的、拼单、订单添加答题后弹框

... ... @@ -30,7 +30,13 @@ Page({
},
//关闭金火柴勋章弹框
close() {
this.setData({show_gold_modal:false,show_normal_modal:false})
this.setData({show_gold_modal:false,show_normal_modal:false});
try {
wx.removeStorageSync('score');
console.log('删除后score',wx.getStorageSync('score'));
} catch (e) {
// Do something when catch error
}
},
//获取城市列表
getCityList() {
... ... @@ -237,7 +243,8 @@ Page({
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
self.setData({
is_showAnswer: true //弹出 去答题弹框
is_showAnswer: true, //弹出 去答题弹框
is_showRelease:false,
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1) { //已填写且可以发布 =>去发布
self.setData({
... ... @@ -304,7 +311,7 @@ Page({
// wx.setStorageSync('score',30);
console.log('score',wx.getStorageSync('score'));
if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')>=80) {
self.setData({show_gold_modal:true})
self.setData({show_gold_modal:true,});
}else if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')<80) {
self.setData({show_normal_modal:true})
}
... ...
... ... @@ -16,6 +16,16 @@ Page({
images:'',
images_params:'',
},
//关闭金火柴勋章弹框
close() {
this.setData({show_gold_modal:false,show_normal_modal:false});
try {
wx.removeStorageSync('score');
console.log('删除后score',wx.getStorageSync('score'));
} catch (e) {
// Do something when catch error
}
},
//上传背景图
uploadImg() { //这里是选取图片的方法
let that = this;
... ... @@ -357,7 +367,13 @@ Page({
console.log('获取首页', res);
this.setData({
user:res.data.member
})
});
console.log('score',wx.getStorageSync('score'));
if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')>=80) {
self.setData({show_gold_modal:true})
}else if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')<80) {
self.setData({show_normal_modal:true})
}
// console.log(this.data.this_week_test_info);
})
}
... ... @@ -418,6 +434,28 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {
let self = this;
self.setData({show_gold_modal:false});
// 设置菜单中的转发按钮触发转发事件时的转发内容
var shareObj = {
title: '火柴西路', // 默认是小程序的名称(可以写slogan等)
path: '', // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function (res) {
if (res.errMsg == 'shareAppMessage:ok') {
}
},
fail: function () {
// 转发失败之后的回调
if (res.errMsg == 'shareAppMessage:fail cancel') {
// 用户取消转发
} else if (res.errMsg == 'shareAppMessage:fail') {
// 转发失败,其中 detail message 为详细失败信息
}
},
complete: function () {
// 转发结束之后的回调(转发成不成功都会执行)
}
}
}
})
\ No newline at end of file
... ...
... ... @@ -72,26 +72,6 @@
</view>
</button>
</view>
<!--底部tab-->
<import src="/templates/templates.wxml" />
<template is="tabBar" data='{{...tabcurrent}}' />
... ... @@ -123,4 +103,27 @@
<view class="text">发布拼活动</view>
</view>
</view>
<view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
\ No newline at end of file
<view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
<!--分数>=80弹框-->
<view class="input-box score-box" wx:if="{{show_gold_modal}}" catchtouchmove="disableScroll">
<image class="sorry-img gold-img" src="../../images/gold@2x.png"></image>
<view class="title text">恭喜您</view>
<view class="title text">获得首批入场卷</view>
<view class="tips text">并得到一枚金火柴等级勋章</view>
<view class="tips share-text">将喜悦分享给好友</view>
<view class="share-box">
<view class="answer-btn close" catchtap="close">完成</view>
<button class="answer-btn share" open-type="share">去分享</button>
</view>
</view>
<view class="modal_box" wx:if="{{show_gold_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
<!--分数<80弹框-->
<view class="input-box score-box normal-box" wx:if="{{show_normal_modal}}" catchtouchmove="disableScroll">
<image class="sorry-img img" src="../../images/achieve-answer-img@2x.png"></image>
<view class="title text margin">恭喜您获得入场卷</view>
<view class="title text margin">等待开放权限</view>
<view class="answer-btn close close-btn" catchtap="close">随便看看</view>
</view>
<view class="modal_box" wx:if="{{show_normal_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
\ No newline at end of file
... ...
... ... @@ -55,17 +55,17 @@
width: 100%;
height: 100%;
}
.margin {
width: 50%;
height: 314rpx;
padding: 40rpx;
position: absolute;
top:0rpx;
left:0rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/*.margin {*/
/*width: 50%;*/
/*height: 314rpx;*/
/*padding: 40rpx;*/
/*position: absolute;*/
/*top:0rpx;*/
/*left:0rpx;*/
/*-webkit-box-sizing: border-box;*/
/*-moz-box-sizing: border-box;*/
/*box-sizing: border-box;*/
/*}*/
.left {
position: absolute;
top:65%;
... ... @@ -206,4 +206,118 @@
.btn-box .right .arrow {
width: 14rpx;
height: 26rpx;
}
/*弹框样式*/
.modal_box {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 10;
background: rgba(0,0,0,0.3);
}
.input-box {
width: 80%;
/* height: 1100rpx; */
background: #ffffff;
display: flex;
align-items: center;
flex-direction: column;
z-index:999;
position: fixed;
top: 48%;
left: 50%;
transform: translate(-50%,-50%);
padding: 46rpx 78rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-radius: 40rpx;
}
.input-box image {
width: 110rpx;
height: 110rpx;
border-radius: 50%;
margin-bottom: 34rpx;
}
.input-box .title {
color: #333333;
font-size: 36rpx;
margin-bottom: 16rpx;
}
.input-box .tips {
color: #333333;
font-size: 24rpx;
margin-bottom: 26rpx;
}
.input-box .answer-btn {
width: 100%;
height: 66rpx;
background-color: #323232;
border-radius: 6rpx;
color: #E2C8B1;
font-size: 30rpx;
text-align: center;
line-height: 66rpx;
margin-top: 16rpx;
}
.score-box {
height:696rpx;
/* top:68%; */
background-image: url('http://pk86rwhci.bkt.clouddn.com/dsdfhgfhfdh@2x.png');
background-repeat: no-repeat;
-webkit-background-size: 100%;
background-size: 100%;
background-color: transparent;
border-radius: 0;
/* top:29%; */
}
.score-box .gold-img {
width: 212rpx;
height: 212rpx;
margin-top: -56rpx;
margin-bottom: 0;
}
.share-box {
display: flex;
align-items: center;
justify-content: space-between;
}
.share-box .close, .share-box .share {
width: 200rpx;
height: 66rpx;
margin-top: 0;
}
.share-box .close {
margin-right: 20rpx;
}
.share-box .share {
padding: 0;
}
.share-box .share::after {
border:0;
}
.score-box .share-text {
margin: 56rpx 0 26rpx 0;
}
.score-box .text {
margin-bottom: 10rpx;
font-size: 36rpx;
color:#343434;
}
.score-box .img {
width: 106rpx;
height: 106rpx;
}
.margin {
margin-top: 30rpx;
}
.normal-box {
height: 540rpx;
background-image: url('http://pk86rwhci.bkt.clouddn.com/safsfdsghk@2x.png');
}
.normal-box .close-btn {
margin-top: 52rpx;
}
\ No newline at end of file
... ...
... ... @@ -14,6 +14,16 @@ Page({
is_answer: true,
is_write: 0,//1:已填写,2:未填写
},
//关闭金火柴勋章弹框
close() {
this.setData({show_gold_modal:false,show_normal_modal:false});
try {
wx.removeStorageSync('score');
console.log('删除后score',wx.getStorageSync('score'));
} catch (e) {
// Do something when catch error
}
},
//删除
cancel(e) {
const self = this;
... ... @@ -257,6 +267,12 @@ Page({
// cate: res.data.cate,
});
}
console.log('score',wx.getStorageSync('score'));
if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')>=80) {
self.setData({show_gold_modal:true})
}else if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')<80) {
self.setData({show_normal_modal:true})
}
wx.hideLoading()
})
},
... ... @@ -315,6 +331,28 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {
let self = this;
self.setData({show_gold_modal:false});
// 设置菜单中的转发按钮触发转发事件时的转发内容
var shareObj = {
title: '火柴西路', // 默认是小程序的名称(可以写slogan等)
path: '', // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function (res) {
if (res.errMsg == 'shareAppMessage:ok') {
}
},
fail: function () {
// 转发失败之后的回调
if (res.errMsg == 'shareAppMessage:fail cancel') {
// 用户取消转发
} else if (res.errMsg == 'shareAppMessage:fail') {
// 转发失败,其中 detail message 为详细失败信息
}
},
complete: function () {
// 转发结束之后的回调(转发成不成功都会执行)
}
}
}
})
\ No newline at end of file
... ...
... ... @@ -39,20 +39,6 @@
</view>
</view>
</view>
<!--底部tab-->
<import src="/templates/templates.wxml" />
<template is="tabBar" data='{{...tabcurrent}}' />
... ... @@ -85,3 +71,26 @@
</view>
</view>
<view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
<!--分数>=80弹框-->
<view class="input-box score-box" wx:if="{{show_gold_modal}}" catchtouchmove="disableScroll">
<image class="sorry-img gold-img" src="../../images/gold@2x.png"></image>
<view class="title text">恭喜您</view>
<view class="title text">获得首批入场卷</view>
<view class="tips text">并得到一枚金火柴等级勋章</view>
<view class="tips share-text">将喜悦分享给好友</view>
<view class="share-box">
<view class="answer-btn close" catchtap="close">完成</view>
<button class="answer-btn share" open-type="share">去分享</button>
</view>
</view>
<view class="modal_box" wx:if="{{show_gold_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
<!--分数<80弹框-->
<view class="input-box score-box normal-box" wx:if="{{show_normal_modal}}" catchtouchmove="disableScroll">
<image class="sorry-img img" src="../../images/achieve-answer-img@2x.png"></image>
<view class="title text margin">恭喜您获得入场卷</view>
<view class="title text margin">等待开放权限</view>
<view class="answer-btn close close-btn" catchtap="close">随便看看</view>
</view>
<view class="modal_box" wx:if="{{show_normal_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
... ...
... ... @@ -53,7 +53,8 @@
width: 80rpx;
height: 2rpx;
background: #EA5D27;
}.content_box {
}
.content_box {
padding: 10rpx 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
... ... @@ -141,3 +142,116 @@
color: #cccccc;
margin-top: 200rpx;
}
/*弹框样式*/
.modal_box {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 10;
background: rgba(0,0,0,0.3);
}
.input-box {
width: 80%;
/* height: 1100rpx; */
background: #ffffff;
display: flex;
align-items: center;
flex-direction: column;
z-index:999;
position: fixed;
top: 48%;
left: 50%;
transform: translate(-50%,-50%);
padding: 46rpx 78rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-radius: 40rpx;
}
.input-box image {
width: 110rpx;
height: 110rpx;
border-radius: 50%;
margin-bottom: 34rpx;
}
.input-box .title {
color: #333333;
font-size: 36rpx;
margin-bottom: 16rpx;
}
.input-box .tips {
color: #333333;
font-size: 24rpx;
margin-bottom: 26rpx;
}
.input-box .answer-btn {
width: 100%;
height: 66rpx;
background-color: #323232;
border-radius: 6rpx;
color: #E2C8B1;
font-size: 30rpx;
text-align: center;
line-height: 66rpx;
margin-top: 16rpx;
}
.score-box {
height:696rpx;
/* top:68%; */
background-image: url('http://pk86rwhci.bkt.clouddn.com/dsdfhgfhfdh@2x.png');
background-repeat: no-repeat;
-webkit-background-size: 100%;
background-size: 100%;
background-color: transparent;
border-radius: 0;
/* top:29%; */
}
.score-box .gold-img {
width: 212rpx;
height: 212rpx;
margin-top: -56rpx;
margin-bottom: 0;
}
.share-box {
display: flex;
align-items: center;
justify-content: space-between;
}
.share-box .close, .share-box .share {
width: 200rpx;
height: 66rpx;
margin-top: 0;
}
.share-box .close {
margin-right: 20rpx;
}
.share-box .share {
padding: 0;
}
.share-box .share::after {
border:0;
}
.score-box .share-text {
margin: 56rpx 0 26rpx 0;
}
.score-box .text {
margin-bottom: 10rpx;
font-size: 36rpx;
color:#343434;
}
.score-box .img {
width: 106rpx;
height: 106rpx;
}
.margin {
margin-top: 30rpx;
}
.normal-box {
height: 540rpx;
background-image: url('http://pk86rwhci.bkt.clouddn.com/safsfdsghk@2x.png');
}
.normal-box .close-btn {
margin-top: 52rpx;
}
... ...
... ... @@ -44,8 +44,19 @@ Page({
is_write:2,//1:已填写,2:未填写
cityList:[],
addr:'', //切换地址
// show_normal_modal:true
},
//关闭金火柴勋章弹框
close() {
this.setData({show_gold_modal:false,show_normal_modal:false});
try {
wx.removeStorageSync('score');
console.log('删除后score',wx.getStorageSync('score'));
} catch (e) {
// Do something when catch error
}
},
//获取城市列表
getCityList() {
const self = this;
... ... @@ -91,6 +102,12 @@ Page({
self.setData({
is_write:res.data.is_write,//1:已填写2:未填写
});
console.log('score',wx.getStorageSync('score'));
if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')>=80) {
self.setData({show_gold_modal:true})
}else if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')<80) {
self.setData({show_normal_modal:true})
}
// console.log(this.data.this_week_test_info);
}
})
... ... @@ -487,6 +504,28 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {
let self = this;
self.setData({show_gold_modal:false});
// 设置菜单中的转发按钮触发转发事件时的转发内容
var shareObj = {
title: '火柴西路', // 默认是小程序的名称(可以写slogan等)
path: '', // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function (res) {
if (res.errMsg == 'shareAppMessage:ok') {
}
},
fail: function () {
// 转发失败之后的回调
if (res.errMsg == 'shareAppMessage:fail cancel') {
// 用户取消转发
} else if (res.errMsg == 'shareAppMessage:fail') {
// 转发失败,其中 detail message 为详细失败信息
}
},
complete: function () {
// 转发结束之后的回调(转发成不成功都会执行)
}
}
}
})
\ No newline at end of file
... ...
... ... @@ -151,4 +151,26 @@
<view class="text">发布拼活动</view>
</view>
</view>
<view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
\ No newline at end of file
<view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
<!--分数>=80弹框-->
<view class="input-box score-box" wx:if="{{show_gold_modal}}" catchtouchmove="disableScroll">
<image class="sorry-img gold-img" src="../../images/gold@2x.png"></image>
<view class="title text">恭喜您</view>
<view class="title text">获得首批入场卷</view>
<view class="tips text">并得到一枚金火柴等级勋章</view>
<view class="tips share-text">将喜悦分享给好友</view>
<view class="share-box">
<view class="answer-btn close" catchtap="close">完成</view>
<button class="answer-btn share" open-type="share">去分享</button>
</view>
</view>
<view class="modal_box" wx:if="{{show_gold_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
<!--分数<80弹框-->
<view class="input-box score-box normal-box" wx:if="{{show_normal_modal}}" catchtouchmove="disableScroll">
<image class="sorry-img img" src="../../images/achieve-answer-img@2x.png"></image>
<view class="title text margin">恭喜您获得入场卷</view>
<view class="title text margin">等待开放权限</view>
<view class="answer-btn close close-btn" catchtap="close">随便看看</view>
</view>
<view class="modal_box" wx:if="{{show_normal_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
\ No newline at end of file
... ...
... ... @@ -277,4 +277,117 @@
.content_item .user text {
color: #666666;
font-size: 22rpx;
}
/*弹框样式*/
.modal_box {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 10;
background: rgba(0,0,0,0.3);
}
.input-box {
width: 80%;
/* height: 1100rpx; */
background: #ffffff;
display: flex;
align-items: center;
flex-direction: column;
z-index:999;
position: fixed;
top: 48%;
left: 50%;
transform: translate(-50%,-50%);
padding: 46rpx 78rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-radius: 40rpx;
}
.input-box image {
width: 110rpx;
height: 110rpx;
border-radius: 50%;
margin-bottom: 34rpx;
}
.input-box .title {
color: #333333;
font-size: 36rpx;
margin-bottom: 16rpx;
}
.input-box .tips {
color: #333333;
font-size: 24rpx;
margin-bottom: 26rpx;
}
.input-box .answer-btn {
width: 100%;
height: 66rpx;
background-color: #323232;
border-radius: 6rpx;
color: #E2C8B1;
font-size: 30rpx;
text-align: center;
line-height: 66rpx;
margin-top: 16rpx;
}
.score-box {
height:696rpx;
/* top:68%; */
background-image: url('http://pk86rwhci.bkt.clouddn.com/dsdfhgfhfdh@2x.png');
background-repeat: no-repeat;
-webkit-background-size: 100%;
background-size: 100%;
background-color: transparent;
border-radius: 0;
/* top:29%; */
}
.score-box .gold-img {
width: 212rpx;
height: 212rpx;
margin-top: -56rpx;
margin-bottom: 0;
}
.share-box {
display: flex;
align-items: center;
justify-content: space-between;
}
.share-box .close, .share-box .share {
width: 200rpx;
height: 66rpx;
margin-top: 0;
}
.share-box .close {
margin-right: 20rpx;
}
.share-box .share {
padding: 0;
}
.share-box .share::after {
border:0;
}
.score-box .share-text {
margin: 56rpx 0 26rpx 0;
}
.score-box .text {
margin-bottom: 10rpx;
font-size: 36rpx;
color:#343434;
}
.score-box .img {
width: 106rpx;
height: 106rpx;
}
.margin {
margin-top: 30rpx;
}
.normal-box {
height: 540rpx;
background-image: url('http://pk86rwhci.bkt.clouddn.com/safsfdsghk@2x.png');
}
.normal-box .close-btn {
margin-top: 52rpx;
}
\ No newline at end of file
... ...