作者 wumengyu

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

@@ -30,7 +30,13 @@ Page({ @@ -30,7 +30,13 @@ Page({
30 }, 30 },
31 //关闭金火柴勋章弹框 31 //关闭金火柴勋章弹框
32 close() { 32 close() {
33 - this.setData({show_gold_modal:false,show_normal_modal:false}) 33 + this.setData({show_gold_modal:false,show_normal_modal:false});
  34 + try {
  35 + wx.removeStorageSync('score');
  36 + console.log('删除后score',wx.getStorageSync('score'));
  37 + } catch (e) {
  38 + // Do something when catch error
  39 + }
34 }, 40 },
35 //获取城市列表 41 //获取城市列表
36 getCityList() { 42 getCityList() {
@@ -237,7 +243,8 @@ Page({ @@ -237,7 +243,8 @@ Page({
237 243
238 } else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题 244 } else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
239 self.setData({ 245 self.setData({
240 - is_showAnswer: true //弹出 去答题弹框 246 + is_showAnswer: true, //弹出 去答题弹框
  247 + is_showRelease:false,
241 }); 248 });
242 } else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1) { //已填写且可以发布 =>去发布 249 } else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1) { //已填写且可以发布 =>去发布
243 self.setData({ 250 self.setData({
@@ -304,7 +311,7 @@ Page({ @@ -304,7 +311,7 @@ Page({
304 // wx.setStorageSync('score',30); 311 // wx.setStorageSync('score',30);
305 console.log('score',wx.getStorageSync('score')); 312 console.log('score',wx.getStorageSync('score'));
306 if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')>=80) { 313 if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')>=80) {
307 - self.setData({show_gold_modal:true}) 314 + self.setData({show_gold_modal:true,});
308 }else if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')<80) { 315 }else if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')<80) {
309 self.setData({show_normal_modal:true}) 316 self.setData({show_normal_modal:true})
310 } 317 }
@@ -16,6 +16,16 @@ Page({ @@ -16,6 +16,16 @@ Page({
16 images:'', 16 images:'',
17 images_params:'', 17 images_params:'',
18 }, 18 },
  19 + //关闭金火柴勋章弹框
  20 + close() {
  21 + this.setData({show_gold_modal:false,show_normal_modal:false});
  22 + try {
  23 + wx.removeStorageSync('score');
  24 + console.log('删除后score',wx.getStorageSync('score'));
  25 + } catch (e) {
  26 + // Do something when catch error
  27 + }
  28 + },
19 //上传背景图 29 //上传背景图
20 uploadImg() { //这里是选取图片的方法 30 uploadImg() { //这里是选取图片的方法
21 let that = this; 31 let that = this;
@@ -357,7 +367,13 @@ Page({ @@ -357,7 +367,13 @@ Page({
357 console.log('获取首页', res); 367 console.log('获取首页', res);
358 this.setData({ 368 this.setData({
359 user:res.data.member 369 user:res.data.member
360 - }) 370 + });
  371 + console.log('score',wx.getStorageSync('score'));
  372 + if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')>=80) {
  373 + self.setData({show_gold_modal:true})
  374 + }else if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')<80) {
  375 + self.setData({show_normal_modal:true})
  376 + }
361 // console.log(this.data.this_week_test_info); 377 // console.log(this.data.this_week_test_info);
362 }) 378 })
363 } 379 }
@@ -418,6 +434,28 @@ Page({ @@ -418,6 +434,28 @@ Page({
418 * 用户点击右上角分享 434 * 用户点击右上角分享
419 */ 435 */
420 onShareAppMessage: function () { 436 onShareAppMessage: function () {
421 - 437 + let self = this;
  438 + self.setData({show_gold_modal:false});
  439 + // 设置菜单中的转发按钮触发转发事件时的转发内容
  440 + var shareObj = {
  441 + title: '火柴西路', // 默认是小程序的名称(可以写slogan等)
  442 + path: '', // 默认是当前页面,必须是以‘/’开头的完整路径
  443 + imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
  444 + success: function (res) {
  445 + if (res.errMsg == 'shareAppMessage:ok') {
  446 + }
  447 + },
  448 + fail: function () {
  449 + // 转发失败之后的回调
  450 + if (res.errMsg == 'shareAppMessage:fail cancel') {
  451 + // 用户取消转发
  452 + } else if (res.errMsg == 'shareAppMessage:fail') {
  453 + // 转发失败,其中 detail message 为详细失败信息
  454 + }
  455 + },
  456 + complete: function () {
  457 + // 转发结束之后的回调(转发成不成功都会执行)
  458 + }
  459 + }
422 } 460 }
423 }) 461 })
@@ -72,26 +72,6 @@ @@ -72,26 +72,6 @@
72 </view> 72 </view>
73 </button> 73 </button>
74 </view> 74 </view>
75 -  
76 -  
77 -  
78 -  
79 -  
80 -  
81 -  
82 -  
83 -  
84 -  
85 -  
86 -  
87 -  
88 -  
89 -  
90 -  
91 -  
92 -  
93 -  
94 -  
95 <!--底部tab--> 75 <!--底部tab-->
96 <import src="/templates/templates.wxml" /> 76 <import src="/templates/templates.wxml" />
97 <template is="tabBar" data='{{...tabcurrent}}' /> 77 <template is="tabBar" data='{{...tabcurrent}}' />
@@ -123,4 +103,27 @@ @@ -123,4 +103,27 @@
123 <view class="text">发布拼活动</view> 103 <view class="text">发布拼活动</view>
124 </view> 104 </view>
125 </view> 105 </view>
126 -<view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>  
  106 +<view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
  107 +
  108 +<!--分数>=80弹框-->
  109 +<view class="input-box score-box" wx:if="{{show_gold_modal}}" catchtouchmove="disableScroll">
  110 + <image class="sorry-img gold-img" src="../../images/gold@2x.png"></image>
  111 + <view class="title text">恭喜您</view>
  112 + <view class="title text">获得首批入场卷</view>
  113 + <view class="tips text">并得到一枚金火柴等级勋章</view>
  114 + <view class="tips share-text">将喜悦分享给好友</view>
  115 + <view class="share-box">
  116 + <view class="answer-btn close" catchtap="close">完成</view>
  117 + <button class="answer-btn share" open-type="share">去分享</button>
  118 + </view>
  119 +</view>
  120 +<view class="modal_box" wx:if="{{show_gold_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
  121 +
  122 +<!--分数<80弹框-->
  123 +<view class="input-box score-box normal-box" wx:if="{{show_normal_modal}}" catchtouchmove="disableScroll">
  124 + <image class="sorry-img img" src="../../images/achieve-answer-img@2x.png"></image>
  125 + <view class="title text margin">恭喜您获得入场卷</view>
  126 + <view class="title text margin">等待开放权限</view>
  127 + <view class="answer-btn close close-btn" catchtap="close">随便看看</view>
  128 +</view>
  129 +<view class="modal_box" wx:if="{{show_normal_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
@@ -55,17 +55,17 @@ @@ -55,17 +55,17 @@
55 width: 100%; 55 width: 100%;
56 height: 100%; 56 height: 100%;
57 } 57 }
58 -.margin {  
59 - width: 50%;  
60 - height: 314rpx;  
61 - padding: 40rpx;  
62 - position: absolute;  
63 - top:0rpx;  
64 - left:0rpx;  
65 - -webkit-box-sizing: border-box;  
66 - -moz-box-sizing: border-box;  
67 - box-sizing: border-box;  
68 -} 58 +/*.margin {*/
  59 + /*width: 50%;*/
  60 + /*height: 314rpx;*/
  61 + /*padding: 40rpx;*/
  62 + /*position: absolute;*/
  63 + /*top:0rpx;*/
  64 + /*left:0rpx;*/
  65 + /*-webkit-box-sizing: border-box;*/
  66 + /*-moz-box-sizing: border-box;*/
  67 + /*box-sizing: border-box;*/
  68 +/*}*/
69 .left { 69 .left {
70 position: absolute; 70 position: absolute;
71 top:65%; 71 top:65%;
@@ -206,4 +206,118 @@ @@ -206,4 +206,118 @@
206 .btn-box .right .arrow { 206 .btn-box .right .arrow {
207 width: 14rpx; 207 width: 14rpx;
208 height: 26rpx; 208 height: 26rpx;
  209 +}
  210 +
  211 +/*弹框样式*/
  212 +.modal_box {
  213 + width: 100%;
  214 + height: 100%;
  215 + position: fixed;
  216 + top: 0;
  217 + left: 0;
  218 + z-index: 10;
  219 + background: rgba(0,0,0,0.3);
  220 +}
  221 +.input-box {
  222 + width: 80%;
  223 + /* height: 1100rpx; */
  224 + background: #ffffff;
  225 + display: flex;
  226 + align-items: center;
  227 + flex-direction: column;
  228 + z-index:999;
  229 + position: fixed;
  230 + top: 48%;
  231 + left: 50%;
  232 + transform: translate(-50%,-50%);
  233 + padding: 46rpx 78rpx;
  234 + -webkit-box-sizing: border-box;
  235 + -moz-box-sizing: border-box;
  236 + box-sizing: border-box;
  237 + border-radius: 40rpx;
  238 +}
  239 +.input-box image {
  240 + width: 110rpx;
  241 + height: 110rpx;
  242 + border-radius: 50%;
  243 + margin-bottom: 34rpx;
  244 +}
  245 +.input-box .title {
  246 + color: #333333;
  247 + font-size: 36rpx;
  248 + margin-bottom: 16rpx;
  249 +}
  250 +.input-box .tips {
  251 + color: #333333;
  252 + font-size: 24rpx;
  253 + margin-bottom: 26rpx;
  254 +}
  255 +.input-box .answer-btn {
  256 + width: 100%;
  257 + height: 66rpx;
  258 + background-color: #323232;
  259 + border-radius: 6rpx;
  260 + color: #E2C8B1;
  261 + font-size: 30rpx;
  262 + text-align: center;
  263 + line-height: 66rpx;
  264 + margin-top: 16rpx;
  265 +}
  266 +.score-box {
  267 + height:696rpx;
  268 + /* top:68%; */
  269 + background-image: url('http://pk86rwhci.bkt.clouddn.com/dsdfhgfhfdh@2x.png');
  270 + background-repeat: no-repeat;
  271 + -webkit-background-size: 100%;
  272 + background-size: 100%;
  273 + background-color: transparent;
  274 + border-radius: 0;
  275 + /* top:29%; */
  276 +}
  277 +.score-box .gold-img {
  278 + width: 212rpx;
  279 + height: 212rpx;
  280 + margin-top: -56rpx;
  281 + margin-bottom: 0;
  282 +}
  283 +.share-box {
  284 + display: flex;
  285 + align-items: center;
  286 + justify-content: space-between;
  287 +}
  288 +.share-box .close, .share-box .share {
  289 + width: 200rpx;
  290 + height: 66rpx;
  291 + margin-top: 0;
  292 +}
  293 +.share-box .close {
  294 + margin-right: 20rpx;
  295 +}
  296 +.share-box .share {
  297 + padding: 0;
  298 +}
  299 +.share-box .share::after {
  300 + border:0;
  301 +}
  302 +.score-box .share-text {
  303 + margin: 56rpx 0 26rpx 0;
  304 +}
  305 +.score-box .text {
  306 + margin-bottom: 10rpx;
  307 + font-size: 36rpx;
  308 + color:#343434;
  309 +}
  310 +.score-box .img {
  311 + width: 106rpx;
  312 + height: 106rpx;
  313 +}
  314 +.margin {
  315 + margin-top: 30rpx;
  316 +}
  317 +.normal-box {
  318 + height: 540rpx;
  319 + background-image: url('http://pk86rwhci.bkt.clouddn.com/safsfdsghk@2x.png');
  320 +}
  321 +.normal-box .close-btn {
  322 + margin-top: 52rpx;
209 } 323 }
@@ -14,6 +14,16 @@ Page({ @@ -14,6 +14,16 @@ Page({
14 is_answer: true, 14 is_answer: true,
15 is_write: 0,//1:已填写,2:未填写 15 is_write: 0,//1:已填写,2:未填写
16 }, 16 },
  17 + //关闭金火柴勋章弹框
  18 + close() {
  19 + this.setData({show_gold_modal:false,show_normal_modal:false});
  20 + try {
  21 + wx.removeStorageSync('score');
  22 + console.log('删除后score',wx.getStorageSync('score'));
  23 + } catch (e) {
  24 + // Do something when catch error
  25 + }
  26 + },
17 //删除 27 //删除
18 cancel(e) { 28 cancel(e) {
19 const self = this; 29 const self = this;
@@ -257,6 +267,12 @@ Page({ @@ -257,6 +267,12 @@ Page({
257 // cate: res.data.cate, 267 // cate: res.data.cate,
258 }); 268 });
259 } 269 }
  270 + console.log('score',wx.getStorageSync('score'));
  271 + if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')>=80) {
  272 + self.setData({show_gold_modal:true})
  273 + }else if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')<80) {
  274 + self.setData({show_normal_modal:true})
  275 + }
260 wx.hideLoading() 276 wx.hideLoading()
261 }) 277 })
262 }, 278 },
@@ -315,6 +331,28 @@ Page({ @@ -315,6 +331,28 @@ Page({
315 * 用户点击右上角分享 331 * 用户点击右上角分享
316 */ 332 */
317 onShareAppMessage: function () { 333 onShareAppMessage: function () {
318 - 334 + let self = this;
  335 + self.setData({show_gold_modal:false});
  336 + // 设置菜单中的转发按钮触发转发事件时的转发内容
  337 + var shareObj = {
  338 + title: '火柴西路', // 默认是小程序的名称(可以写slogan等)
  339 + path: '', // 默认是当前页面,必须是以‘/’开头的完整路径
  340 + imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
  341 + success: function (res) {
  342 + if (res.errMsg == 'shareAppMessage:ok') {
  343 + }
  344 + },
  345 + fail: function () {
  346 + // 转发失败之后的回调
  347 + if (res.errMsg == 'shareAppMessage:fail cancel') {
  348 + // 用户取消转发
  349 + } else if (res.errMsg == 'shareAppMessage:fail') {
  350 + // 转发失败,其中 detail message 为详细失败信息
  351 + }
  352 + },
  353 + complete: function () {
  354 + // 转发结束之后的回调(转发成不成功都会执行)
  355 + }
  356 + }
319 } 357 }
320 }) 358 })
@@ -39,20 +39,6 @@ @@ -39,20 +39,6 @@
39 </view> 39 </view>
40 </view> 40 </view>
41 </view> 41 </view>
42 -  
43 -  
44 -  
45 -  
46 -  
47 -  
48 -  
49 -  
50 -  
51 -  
52 -  
53 -  
54 -  
55 -  
56 <!--底部tab--> 42 <!--底部tab-->
57 <import src="/templates/templates.wxml" /> 43 <import src="/templates/templates.wxml" />
58 <template is="tabBar" data='{{...tabcurrent}}' /> 44 <template is="tabBar" data='{{...tabcurrent}}' />
@@ -85,3 +71,26 @@ @@ -85,3 +71,26 @@
85 </view> 71 </view>
86 </view> 72 </view>
87 <view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view> 73 <view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
  74 +<!--分数>=80弹框-->
  75 +<view class="input-box score-box" wx:if="{{show_gold_modal}}" catchtouchmove="disableScroll">
  76 + <image class="sorry-img gold-img" src="../../images/gold@2x.png"></image>
  77 + <view class="title text">恭喜您</view>
  78 + <view class="title text">获得首批入场卷</view>
  79 + <view class="tips text">并得到一枚金火柴等级勋章</view>
  80 + <view class="tips share-text">将喜悦分享给好友</view>
  81 + <view class="share-box">
  82 + <view class="answer-btn close" catchtap="close">完成</view>
  83 + <button class="answer-btn share" open-type="share">去分享</button>
  84 + </view>
  85 +</view>
  86 +<view class="modal_box" wx:if="{{show_gold_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
  87 +
  88 +<!--分数<80弹框-->
  89 +<view class="input-box score-box normal-box" wx:if="{{show_normal_modal}}" catchtouchmove="disableScroll">
  90 + <image class="sorry-img img" src="../../images/achieve-answer-img@2x.png"></image>
  91 + <view class="title text margin">恭喜您获得入场卷</view>
  92 + <view class="title text margin">等待开放权限</view>
  93 + <view class="answer-btn close close-btn" catchtap="close">随便看看</view>
  94 +</view>
  95 +<view class="modal_box" wx:if="{{show_normal_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
  96 +
@@ -53,7 +53,8 @@ @@ -53,7 +53,8 @@
53 width: 80rpx; 53 width: 80rpx;
54 height: 2rpx; 54 height: 2rpx;
55 background: #EA5D27; 55 background: #EA5D27;
56 -}.content_box { 56 +}
  57 +.content_box {
57 padding: 10rpx 20rpx; 58 padding: 10rpx 20rpx;
58 -webkit-box-sizing: border-box; 59 -webkit-box-sizing: border-box;
59 -moz-box-sizing: border-box; 60 -moz-box-sizing: border-box;
@@ -141,3 +142,116 @@ @@ -141,3 +142,116 @@
141 color: #cccccc; 142 color: #cccccc;
142 margin-top: 200rpx; 143 margin-top: 200rpx;
143 } 144 }
  145 +/*弹框样式*/
  146 +.modal_box {
  147 + width: 100%;
  148 + height: 100%;
  149 + position: fixed;
  150 + top: 0;
  151 + left: 0;
  152 + z-index: 10;
  153 + background: rgba(0,0,0,0.3);
  154 +}
  155 +.input-box {
  156 + width: 80%;
  157 + /* height: 1100rpx; */
  158 + background: #ffffff;
  159 + display: flex;
  160 + align-items: center;
  161 + flex-direction: column;
  162 + z-index:999;
  163 + position: fixed;
  164 + top: 48%;
  165 + left: 50%;
  166 + transform: translate(-50%,-50%);
  167 + padding: 46rpx 78rpx;
  168 + -webkit-box-sizing: border-box;
  169 + -moz-box-sizing: border-box;
  170 + box-sizing: border-box;
  171 + border-radius: 40rpx;
  172 +}
  173 +.input-box image {
  174 + width: 110rpx;
  175 + height: 110rpx;
  176 + border-radius: 50%;
  177 + margin-bottom: 34rpx;
  178 +}
  179 +.input-box .title {
  180 + color: #333333;
  181 + font-size: 36rpx;
  182 + margin-bottom: 16rpx;
  183 +}
  184 +.input-box .tips {
  185 + color: #333333;
  186 + font-size: 24rpx;
  187 + margin-bottom: 26rpx;
  188 +}
  189 +.input-box .answer-btn {
  190 + width: 100%;
  191 + height: 66rpx;
  192 + background-color: #323232;
  193 + border-radius: 6rpx;
  194 + color: #E2C8B1;
  195 + font-size: 30rpx;
  196 + text-align: center;
  197 + line-height: 66rpx;
  198 + margin-top: 16rpx;
  199 +}
  200 +.score-box {
  201 + height:696rpx;
  202 + /* top:68%; */
  203 + background-image: url('http://pk86rwhci.bkt.clouddn.com/dsdfhgfhfdh@2x.png');
  204 + background-repeat: no-repeat;
  205 + -webkit-background-size: 100%;
  206 + background-size: 100%;
  207 + background-color: transparent;
  208 + border-radius: 0;
  209 + /* top:29%; */
  210 +}
  211 +.score-box .gold-img {
  212 + width: 212rpx;
  213 + height: 212rpx;
  214 + margin-top: -56rpx;
  215 + margin-bottom: 0;
  216 +}
  217 +.share-box {
  218 + display: flex;
  219 + align-items: center;
  220 + justify-content: space-between;
  221 +}
  222 +.share-box .close, .share-box .share {
  223 + width: 200rpx;
  224 + height: 66rpx;
  225 + margin-top: 0;
  226 +}
  227 +.share-box .close {
  228 + margin-right: 20rpx;
  229 +}
  230 +.share-box .share {
  231 + padding: 0;
  232 +}
  233 +.share-box .share::after {
  234 + border:0;
  235 +}
  236 +.score-box .share-text {
  237 + margin: 56rpx 0 26rpx 0;
  238 +}
  239 +.score-box .text {
  240 + margin-bottom: 10rpx;
  241 + font-size: 36rpx;
  242 + color:#343434;
  243 +}
  244 +.score-box .img {
  245 + width: 106rpx;
  246 + height: 106rpx;
  247 +}
  248 +.margin {
  249 + margin-top: 30rpx;
  250 +}
  251 +.normal-box {
  252 + height: 540rpx;
  253 + background-image: url('http://pk86rwhci.bkt.clouddn.com/safsfdsghk@2x.png');
  254 +}
  255 +.normal-box .close-btn {
  256 + margin-top: 52rpx;
  257 +}
@@ -44,8 +44,19 @@ Page({ @@ -44,8 +44,19 @@ Page({
44 is_write:2,//1:已填写,2:未填写 44 is_write:2,//1:已填写,2:未填写
45 cityList:[], 45 cityList:[],
46 addr:'', //切换地址 46 addr:'', //切换地址
  47 + // show_normal_modal:true
47 48
48 }, 49 },
  50 + //关闭金火柴勋章弹框
  51 + close() {
  52 + this.setData({show_gold_modal:false,show_normal_modal:false});
  53 + try {
  54 + wx.removeStorageSync('score');
  55 + console.log('删除后score',wx.getStorageSync('score'));
  56 + } catch (e) {
  57 + // Do something when catch error
  58 + }
  59 + },
49 //获取城市列表 60 //获取城市列表
50 getCityList() { 61 getCityList() {
51 const self = this; 62 const self = this;
@@ -91,6 +102,12 @@ Page({ @@ -91,6 +102,12 @@ Page({
91 self.setData({ 102 self.setData({
92 is_write:res.data.is_write,//1:已填写2:未填写 103 is_write:res.data.is_write,//1:已填写2:未填写
93 }); 104 });
  105 + console.log('score',wx.getStorageSync('score'));
  106 + if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')>=80) {
  107 + self.setData({show_gold_modal:true})
  108 + }else if(wx.getStorageSync('score') !== '' && wx.getStorageSync('score')<80) {
  109 + self.setData({show_normal_modal:true})
  110 + }
94 // console.log(this.data.this_week_test_info); 111 // console.log(this.data.this_week_test_info);
95 } 112 }
96 }) 113 })
@@ -487,6 +504,28 @@ Page({ @@ -487,6 +504,28 @@ Page({
487 * 用户点击右上角分享 504 * 用户点击右上角分享
488 */ 505 */
489 onShareAppMessage: function () { 506 onShareAppMessage: function () {
490 - 507 + let self = this;
  508 + self.setData({show_gold_modal:false});
  509 + // 设置菜单中的转发按钮触发转发事件时的转发内容
  510 + var shareObj = {
  511 + title: '火柴西路', // 默认是小程序的名称(可以写slogan等)
  512 + path: '', // 默认是当前页面,必须是以‘/’开头的完整路径
  513 + imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
  514 + success: function (res) {
  515 + if (res.errMsg == 'shareAppMessage:ok') {
  516 + }
  517 + },
  518 + fail: function () {
  519 + // 转发失败之后的回调
  520 + if (res.errMsg == 'shareAppMessage:fail cancel') {
  521 + // 用户取消转发
  522 + } else if (res.errMsg == 'shareAppMessage:fail') {
  523 + // 转发失败,其中 detail message 为详细失败信息
  524 + }
  525 + },
  526 + complete: function () {
  527 + // 转发结束之后的回调(转发成不成功都会执行)
  528 + }
  529 + }
491 } 530 }
492 }) 531 })
@@ -151,4 +151,26 @@ @@ -151,4 +151,26 @@
151 <view class="text">发布拼活动</view> 151 <view class="text">发布拼活动</view>
152 </view> 152 </view>
153 </view> 153 </view>
154 -<view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>  
  154 +<view class="modal_box" wx:if="{{is_showRelease}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
  155 +<!--分数>=80弹框-->
  156 +<view class="input-box score-box" wx:if="{{show_gold_modal}}" catchtouchmove="disableScroll">
  157 + <image class="sorry-img gold-img" src="../../images/gold@2x.png"></image>
  158 + <view class="title text">恭喜您</view>
  159 + <view class="title text">获得首批入场卷</view>
  160 + <view class="tips text">并得到一枚金火柴等级勋章</view>
  161 + <view class="tips share-text">将喜悦分享给好友</view>
  162 + <view class="share-box">
  163 + <view class="answer-btn close" catchtap="close">完成</view>
  164 + <button class="answer-btn share" open-type="share">去分享</button>
  165 + </view>
  166 +</view>
  167 +<view class="modal_box" wx:if="{{show_gold_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
  168 +
  169 +<!--分数<80弹框-->
  170 +<view class="input-box score-box normal-box" wx:if="{{show_normal_modal}}" catchtouchmove="disableScroll">
  171 + <image class="sorry-img img" src="../../images/achieve-answer-img@2x.png"></image>
  172 + <view class="title text margin">恭喜您获得入场卷</view>
  173 + <view class="title text margin">等待开放权限</view>
  174 + <view class="answer-btn close close-btn" catchtap="close">随便看看</view>
  175 +</view>
  176 +<view class="modal_box" wx:if="{{show_normal_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
@@ -277,4 +277,117 @@ @@ -277,4 +277,117 @@
277 .content_item .user text { 277 .content_item .user text {
278 color: #666666; 278 color: #666666;
279 font-size: 22rpx; 279 font-size: 22rpx;
  280 +}
  281 +/*弹框样式*/
  282 +.modal_box {
  283 + width: 100%;
  284 + height: 100%;
  285 + position: fixed;
  286 + top: 0;
  287 + left: 0;
  288 + z-index: 10;
  289 + background: rgba(0,0,0,0.3);
  290 +}
  291 +.input-box {
  292 + width: 80%;
  293 + /* height: 1100rpx; */
  294 + background: #ffffff;
  295 + display: flex;
  296 + align-items: center;
  297 + flex-direction: column;
  298 + z-index:999;
  299 + position: fixed;
  300 + top: 48%;
  301 + left: 50%;
  302 + transform: translate(-50%,-50%);
  303 + padding: 46rpx 78rpx;
  304 + -webkit-box-sizing: border-box;
  305 + -moz-box-sizing: border-box;
  306 + box-sizing: border-box;
  307 + border-radius: 40rpx;
  308 +}
  309 +.input-box image {
  310 + width: 110rpx;
  311 + height: 110rpx;
  312 + border-radius: 50%;
  313 + margin-bottom: 34rpx;
  314 +}
  315 +.input-box .title {
  316 + color: #333333;
  317 + font-size: 36rpx;
  318 + margin-bottom: 16rpx;
  319 +}
  320 +.input-box .tips {
  321 + color: #333333;
  322 + font-size: 24rpx;
  323 + margin-bottom: 26rpx;
  324 +}
  325 +.input-box .answer-btn {
  326 + width: 100%;
  327 + height: 66rpx;
  328 + background-color: #323232;
  329 + border-radius: 6rpx;
  330 + color: #E2C8B1;
  331 + font-size: 30rpx;
  332 + text-align: center;
  333 + line-height: 66rpx;
  334 + margin-top: 16rpx;
  335 +}
  336 +.score-box {
  337 + height:696rpx;
  338 + /* top:68%; */
  339 + background-image: url('http://pk86rwhci.bkt.clouddn.com/dsdfhgfhfdh@2x.png');
  340 + background-repeat: no-repeat;
  341 + -webkit-background-size: 100%;
  342 + background-size: 100%;
  343 + background-color: transparent;
  344 + border-radius: 0;
  345 + /* top:29%; */
  346 +}
  347 +.score-box .gold-img {
  348 + width: 212rpx;
  349 + height: 212rpx;
  350 + margin-top: -56rpx;
  351 + margin-bottom: 0;
  352 +}
  353 +.share-box {
  354 + display: flex;
  355 + align-items: center;
  356 + justify-content: space-between;
  357 +}
  358 +.share-box .close, .share-box .share {
  359 + width: 200rpx;
  360 + height: 66rpx;
  361 + margin-top: 0;
  362 +}
  363 +.share-box .close {
  364 + margin-right: 20rpx;
  365 +}
  366 +.share-box .share {
  367 + padding: 0;
  368 +}
  369 +.share-box .share::after {
  370 + border:0;
  371 +}
  372 +.score-box .share-text {
  373 + margin: 56rpx 0 26rpx 0;
  374 +}
  375 +.score-box .text {
  376 + margin-bottom: 10rpx;
  377 + font-size: 36rpx;
  378 + color:#343434;
  379 +}
  380 +.score-box .img {
  381 + width: 106rpx;
  382 + height: 106rpx;
  383 +}
  384 +.margin {
  385 + margin-top: 30rpx;
  386 +}
  387 +.normal-box {
  388 + height: 540rpx;
  389 + background-image: url('http://pk86rwhci.bkt.clouddn.com/safsfdsghk@2x.png');
  390 +}
  391 +.normal-box .close-btn {
  392 + margin-top: 52rpx;
280 } 393 }