feat:下载分享检查
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"styleIsolation": "isolated",
|
||||
"usingComponents": {
|
||||
"van-popup": "@vant/weapp/popup/index"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
.share-guide-popup {
|
||||
.share-guide-popup-content {
|
||||
padding: 60rpx 40rpx 40rpx;
|
||||
width: 600rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.share-guide-popup-title {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #323233;
|
||||
text-align: center;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.share-guide-popup-message {
|
||||
font-size: 28rpx;
|
||||
color: #646566;
|
||||
line-height: 1.6;
|
||||
text-align: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.share-guide-popup-hint {
|
||||
font-size: 24rpx;
|
||||
color: #969799;
|
||||
line-height: 1.5;
|
||||
text-align: center;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.share-guide-popup-buttons {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.share-button {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
border: none;
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
&::after {
|
||||
border: none;
|
||||
}
|
||||
|
||||
&--primary {
|
||||
background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import { recordShareSuccess } from '../../utils/shareGuide';
|
||||
|
||||
Component({
|
||||
options: {},
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
/** 关闭弹窗 */
|
||||
onClose() {
|
||||
this.triggerEvent('onClose');
|
||||
},
|
||||
|
||||
/** 点击遮罩层关闭 */
|
||||
onOverlayClick() {
|
||||
this.onClose();
|
||||
},
|
||||
|
||||
/** 点击分享按钮 */
|
||||
onShare() {
|
||||
// 记录分享成功(用户点击了分享按钮,视为已分享)
|
||||
recordShareSuccess();
|
||||
// 关闭弹窗并通知父组件分享成功(不触发下载,用户需要重新点击下载按钮)
|
||||
this.triggerEvent('onShareSuccess');
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,25 @@
|
||||
<van-popup
|
||||
show="{{show}}"
|
||||
position="center"
|
||||
round
|
||||
closeable
|
||||
close-on-click-overlay
|
||||
bind:close="onClose"
|
||||
bind:click-overlay="onOverlayClick"
|
||||
custom-class="share-guide-popup">
|
||||
<view class="share-guide-popup-content">
|
||||
<view class="share-guide-popup-title">分享解锁下载</view>
|
||||
<view class="share-guide-popup-message"> 今日免费下载次数已用完 </view>
|
||||
<view class="share-guide-popup-hint">
|
||||
分享给好友后,可重新点击“下载打印”按钮继续下载
|
||||
</view>
|
||||
<view class="share-guide-popup-buttons">
|
||||
<button
|
||||
class="share-button share-button--primary"
|
||||
open-type="share"
|
||||
bind:tap="onShare">
|
||||
分享给好友
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</van-popup>
|
||||
Reference in New Issue
Block a user