first commit
This commit is contained in:
1
衣莎项目/源码/YiShaXiYi/user/sharingCourtesy/.pydio
Normal file
1
衣莎项目/源码/YiShaXiYi/user/sharingCourtesy/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
aa37a479-24d1-455d-8bfa-9c70a83e6c5d
|
||||
162
衣莎项目/源码/YiShaXiYi/user/sharingCourtesy/sharingCourtesy.js
Normal file
162
衣莎项目/源码/YiShaXiYi/user/sharingCourtesy/sharingCourtesy.js
Normal file
@@ -0,0 +1,162 @@
|
||||
// user/sharingCourtesy/sharingCourtesy.js
|
||||
const app = getApp();
|
||||
const regeneratorRuntime = app.loadAsync()
|
||||
const model = app.loadModel("index")
|
||||
const http = app.loadHttp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
system: app.globalData.system, //设备相关信息
|
||||
pageTitle: "分享有礼", //头部标题
|
||||
isBack: true,//显示返回
|
||||
isTips: false,//弹出窗口
|
||||
fileName: "",//图片地址
|
||||
},
|
||||
// 保存图片
|
||||
/**
|
||||
* 获取canvas外围view宽高,然后把通过计算图片在canvas中的位置,最后绘制到canvas中
|
||||
* 如果用户同意授权时在调用canvasToTempFilePath把canvas中的内容生成图片,再通过saveImageToPhotosAlbum方法
|
||||
* 把图片保存的用户相册
|
||||
*/
|
||||
async preservationImg() {
|
||||
var that = this
|
||||
wx.previewImage({
|
||||
current: that.data.fileName, // 当前显示图片的http链接
|
||||
urls: [that.data.fileName] // 需要预览的图片http链接列表
|
||||
})
|
||||
// let album = await model.getauth.albumAuthorization()
|
||||
// this.tips()
|
||||
// // 获取外节点信息把宽高赋给需要绘制的图片
|
||||
// wx.createSelectorQuery().select('.share_img_con_b').fields({
|
||||
// dataset: true,
|
||||
// size: true,
|
||||
// scrollOffset: true,
|
||||
// properties: ['scrollX', 'scrollY']
|
||||
// }, function (res) {
|
||||
// var ctx = wx.createCanvasContext('testCanvas');
|
||||
// ctx.drawImage('/static/img/15639450.png', 0, 0, res.width, res.height);
|
||||
// ctx.drawImage(that.data.fileName, (res.width) / 2 - 77, (res.height) * 0.74 - 77, 154, 154);
|
||||
// ctx.draw();
|
||||
// }).exec()
|
||||
// // 用户同意授权
|
||||
// if (album == "ok") {
|
||||
// setTimeout(() => {
|
||||
// // 生成图片
|
||||
// wx.canvasToTempFilePath({
|
||||
// canvasId: 'testCanvas',
|
||||
// fileType: 'jpg',
|
||||
// success: function (res) {
|
||||
// // 保存图片
|
||||
// wx.saveImageToPhotosAlbum({
|
||||
// filePath: res.tempFilePath,
|
||||
// success(res) {
|
||||
// wx.showToast({
|
||||
// title: '保存成功',
|
||||
// icon: 'none',
|
||||
// duration: 2000
|
||||
// });
|
||||
// },
|
||||
// fail() {
|
||||
// wx.hideLoading()
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// }, 500)
|
||||
// return
|
||||
// } else {
|
||||
// wx.showModal({
|
||||
// title: '你拒绝了授权',
|
||||
// content: '是否打开权限表重新授权',
|
||||
// success(res) {
|
||||
// if (res.confirm) {
|
||||
// wx.openSetting()
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// 用户取消授权时,提示用户自主截图
|
||||
// wx.showToast({
|
||||
// title: '您已取消授权请自主截屏保存二维码',
|
||||
// icon: 'none',
|
||||
// duration: 2000
|
||||
// })
|
||||
},
|
||||
// 弹窗
|
||||
tips() {
|
||||
this.setData({
|
||||
isTips: !this.data.isTips
|
||||
})
|
||||
},
|
||||
// 获取二维码图片
|
||||
/**
|
||||
* 获取获取全局唯一的文件管理器,然后把拿到的小程序二维码去掉空格去掉转移字符串
|
||||
* 然后转换成二进制编码,使用writeFileSync方法把图片临时存到本地
|
||||
*/
|
||||
getCode() {
|
||||
var that = this
|
||||
http.http.request2({ url: `${http.api.getWxaqrCode}`, method: "POST", data: { path: "/pages/startUp/startUp" } })
|
||||
.then(res => {
|
||||
that.setData({
|
||||
fileName: res.data.data
|
||||
})
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
this.getCode()
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"navigationBarTextStyle": "black",
|
||||
"usingComponents": {},
|
||||
"disableScroll": true
|
||||
}
|
||||
65
衣莎项目/源码/YiShaXiYi/user/sharingCourtesy/sharingCourtesy.wxml
Normal file
65
衣莎项目/源码/YiShaXiYi/user/sharingCourtesy/sharingCourtesy.wxml
Normal file
@@ -0,0 +1,65 @@
|
||||
<!-- 头部 -->
|
||||
<nav-bar isBack="{{isBack}}" pageTitle="{{pageTitle}}" system="{{system}}"></nav-bar>
|
||||
<!-- user/sharingCourtesy/sharingCourtesy.wxml -->
|
||||
<view class="sharingCourtesy" style="padding-bottom: {{system.statusHeight+system.titleHeight+'px'}}">
|
||||
<view class="bac_img">
|
||||
<image mode="widthFix" src="/static/img/tjyl.jpg" />
|
||||
</view>
|
||||
<!-- <view class="sha_Cou_rule">
|
||||
<span>活动规则</span>
|
||||
</view> -->
|
||||
<view class="sha_Cou_cen">
|
||||
<view class="sha_Cou_z">
|
||||
<view class="sha_Cou_reward">
|
||||
<image class="images" src="/static/img/tjyll.png" />
|
||||
<view class="sha_Cou_reward_cen">
|
||||
<view class="reward_title">每推荐1位好友</view>
|
||||
<view class="reward_img mt30">
|
||||
<view class="reward_img_l">
|
||||
<image src="/static/img/fxyr.png" />
|
||||
<view class="reward_img_lp lp_c">好友可得</view>
|
||||
</view>
|
||||
<view class="reward_img_r">
|
||||
<image src="/static/img/fxyl.png" />
|
||||
<view class="reward_img_lp lp_m">
|
||||
<span>100 元</span>
|
||||
新人大礼包
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="reward_img mt30">
|
||||
<view class="reward_img_l">
|
||||
<image src="/static/img/fxyr.png" />
|
||||
<view class="reward_img_lp lp_c">自己可得</view>
|
||||
</view>
|
||||
<view class="reward_img_r">
|
||||
<image src="/static/img/fxyl.png" />
|
||||
<view class="reward_img_lp lp_m">
|
||||
<span>10 元</span>
|
||||
洗衣券
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sha_rule mt40">
|
||||
生成自己的专属二维码图片,将图片分享或者发送给好友,好友识别关注伊莎洗衣洗衣,点击立即邀请,将海报分享给您的好友吧~
|
||||
</view>
|
||||
</view>
|
||||
<view class="sha_Cou_sub mt50" bind:tap="preservationImg">立即邀请</view>
|
||||
</view>
|
||||
<!-- <view class="share_img" style="padding-top:{{system.statusHeight+system.titleHeight+'px'}}" hidden="{{!isTips}}">
|
||||
<view class="share_img_con">
|
||||
<view class="share_img_con_b">
|
||||
<canvas canvas-id='testCanvas' class='testCanvas'></canvas>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tips mt30">图片已保存到相册,可分享给好友</view>
|
||||
<view class="tips_colse mt20">
|
||||
<image bind:tap="tips" src="/static/img/icon/colse_tips.png" />
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- toasta提示 -->
|
||||
<i-toast id="toast" />
|
||||
250
衣莎项目/源码/YiShaXiYi/user/sharingCourtesy/sharingCourtesy.wxss
Normal file
250
衣莎项目/源码/YiShaXiYi/user/sharingCourtesy/sharingCourtesy.wxss
Normal file
@@ -0,0 +1,250 @@
|
||||
/* user/sharingCourtesy/sharingCourtesy.wxss */
|
||||
page{
|
||||
height: 100%;
|
||||
background-color: #faca50 !important;
|
||||
}
|
||||
.sharingCourtesy{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
.bac_img{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.bac_img image{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.sha_Cou_rule{
|
||||
position: absolute;
|
||||
top: 22rpx;
|
||||
right: 0;
|
||||
height: 50rpx;
|
||||
text-align: right;
|
||||
}
|
||||
.sha_Cou_rule span{
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
width: 141rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
background-color: #ff4938;
|
||||
border-radius: 25rpx 0px 0px 25rpx;
|
||||
}
|
||||
.sha_Cou_cen{
|
||||
position: absolute;
|
||||
top: 224rpx;
|
||||
padding: 0 30rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.sha_Cou_z{
|
||||
height: 746rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 15rpx;
|
||||
padding: 50rpx 54rpx 0;
|
||||
}
|
||||
.sha_Cou_reward{
|
||||
height: 497rpx;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
.sha_Cou_reward .images{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.sha_Cou_reward_cen{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
padding: 0 36rpx;
|
||||
}
|
||||
.reward_title{
|
||||
margin: 40rpx 0;
|
||||
font-size: 60rpx;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
}
|
||||
.reward_img{
|
||||
height: 110rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
}
|
||||
.reward_img_l{
|
||||
display: inline-block;
|
||||
width: 182rpx;
|
||||
height: 110rpx;
|
||||
position: relative;
|
||||
}
|
||||
.reward_img_l image{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
position: absolute;
|
||||
}
|
||||
.reward_img_lp{
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
line-height: 110rpx;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
}
|
||||
.reward_img_r{
|
||||
display: inline-block;
|
||||
flex: 1;
|
||||
position: relative;
|
||||
}
|
||||
.reward_img_r image{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.lp_c{
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
.lp_m{
|
||||
font-size: 36rpx;
|
||||
color: #9a7555;
|
||||
}
|
||||
.lp_m span{
|
||||
font-size: 36rpx;
|
||||
color: #ef7f0a;
|
||||
}
|
||||
|
||||
.sha_rule{
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #9c9c9c;
|
||||
}
|
||||
.sha_Cou_sub{
|
||||
height: 100rpx;
|
||||
background-color: #fc541e;
|
||||
box-shadow: 0px 10rpx 30rpx 0px
|
||||
rgba(240, 52, 33, 0.5);
|
||||
border-radius: 50rpx;
|
||||
font-size: 38rpx;
|
||||
color: #ffffff;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.share_img{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: rgba(0, 0, 0, .75);
|
||||
padding: 0 100rpx;
|
||||
}
|
||||
.share_img_con{
|
||||
margin-top: 145rpx;
|
||||
}
|
||||
.share_img_con_b{
|
||||
height: 712rpx;
|
||||
box-shadow: -7rpx 4rpx 56rpx 3rpx
|
||||
rgba(16, 142, 239, 0.08);
|
||||
border-radius: 10rpx;
|
||||
position: relative;
|
||||
}
|
||||
.testCanvas{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.share_flex{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
padding: 0 48rpx;
|
||||
}
|
||||
.share_flex1{
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.share_img1{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.share_img1 image{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.share_flex1_img{
|
||||
width: 100%;
|
||||
height: 46rpx;
|
||||
margin-top: 70rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.share_flex1_img image{
|
||||
width: 384rpx;
|
||||
height: 46rpx;
|
||||
}
|
||||
.share_flex1_p{
|
||||
margin-top: 20rpx;
|
||||
font-size: 30rpx;
|
||||
line-height: 45rpx;
|
||||
color: #333333;
|
||||
text-align: center;
|
||||
}
|
||||
.share_flex1_span{
|
||||
text-align: center;
|
||||
font-size: 25rpx;
|
||||
color: #999999;
|
||||
}
|
||||
.qr_code{
|
||||
width: 309rpx;
|
||||
height: 309rpx;
|
||||
}
|
||||
.tips{
|
||||
font-size: 26rpx;
|
||||
line-height: 52rpx;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
}
|
||||
.tips_colse{
|
||||
text-align: center;
|
||||
}
|
||||
.tips_colse image{
|
||||
width: 69rpx;
|
||||
height: 69rpx;
|
||||
}
|
||||
.sha_Cou_sub{
|
||||
-webkit-animation: Cou_sub 2s linear infinite;
|
||||
}
|
||||
|
||||
|
||||
@keyframes Cou_sub {
|
||||
0%{
|
||||
transform: scale(0.9);
|
||||
}
|
||||
50%{
|
||||
transform: scale(1);
|
||||
}
|
||||
100%{
|
||||
transform: scale(0.9);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user