cbf060d5 by simon

no message

1 parent c5e7bb74
{
"pages": [
"pages/index/index",
"pages/scan-result/scan-result",
"pages/user-center/user-center",
"pages/scan-result/scan-result",
"pages/gift-shop/gift-shop",
"pages/gift-detail/gift-detail",
"pages/contact/contact",
......
......@@ -37,7 +37,7 @@ $contentWidth:690px;
.cont {
flex: 1;
@extend .bb;
padding-left: 20px;
// padding-left: 20px;
}
}
......
......@@ -6,6 +6,7 @@ Page({
authorizeVisible: false,
userInfo: {},
qrImagePath: "",
imageUrl: "",
},
onShareAppMessage() {},
showAuth() {
......@@ -25,17 +26,29 @@ Page({
* 获取会员信息
*/
queryMember() {
let _this = this;
return new Promise((resolve, reject) => {
app.post({
url: app.api.member,
data: {}
}).then((result) => {
let userInfo = result
this.setData({
_this.setData({
userInfo: userInfo,
qrImagePath: userInfo.memberUrl,
})
wx.downloadFile({
url: userInfo.memberUrl,
success(res) {
if (res.statusCode === 200) {
_this.setData({
imageUrl: res.tempFilePath
})
}
}
})
// 生成个人二维码
// let tlMemberCode = userInfo.memberCode;
// let qrSize = this.setCanvasSize(440);
......@@ -86,4 +99,48 @@ Page({
return size;
},
/**
* 保存图片到本地
*/
saveImageToPhotosAlbum() {
console.log("saveImageToPhotosAlbum");
let _this = this;
if (!_this.data.imageUrl) {
wx.showToast({
title: "图片加载中,请重试",
icon: "none"
})
return;
}
wx.saveImageToPhotosAlbum({
filePath: _this.data.imageUrl,
success(res) {
wx.showToast({
title: '保存成功',
icon: 'success'
});
},
fail(err) {
wx.getSetting({
success: (res) => {
if (!res.authSetting['scope.writePhotosAlbum']) {
// 未授权
wx.showModal({
title: '提示',
content: '小程序请求访问相册权限',
confirmText: '前往授权',
success(res) {
if (res.confirm) {
wx.openSetting({
success(res) {}
})
} else if (res.cancel) {}
}
})
}
}
})
}
})
},
})
......
......@@ -15,7 +15,7 @@
</view>
<view class="tips">分享邀请好友加入,赢取推广积分</view>
<view class="btn-wrap">
<view class="btn">保存图片</view>
<view bindtap="saveImageToPhotosAlbum" class="btn">保存图片</view>
</view>
</view>
</view>
......
......@@ -195,7 +195,7 @@ $contentWidth:690px;
// 排行item
.rank-item {
display: flex;
justify-content: space-between;
// justify-content: space-between;
border-bottom: solid 1px #dddddd;
$itemHeight: 104px;
height: $itemHeight;
......@@ -217,8 +217,8 @@ $contentWidth:690px;
.user {
display: flex;
align-items: center;
font-size: 32px;
width: 300px;
font-size: 28px;
width: 360px;
// background-color: wheat;
@include no-wrap();
overflow-x: hidden;
......
......@@ -41,7 +41,7 @@
.btn2 {
background: transparent;
border: solid 1px #3680EB;
border: solid 1PX #3680EB;
color: #3680EB;
}
}
......
......@@ -24,11 +24,14 @@ $contentWidth:690px;
.func-wrap{
}
.func {
@extend .fcc;
// @extend .fcc;
display: flex;
align-items: center;
height: 80px;
// border-bottom: solid 1px #DDDDDD;
font-size: 32px;
color: #3680EB;
@extend .bb;
padding-left: 150px;
.icon {
width: 32px;
......
......@@ -123,7 +123,7 @@
</view>
<view bindtap="onContactUsHandler" class="func-wrap-item">
<view class="icon-wrap">
<image class="icon" mode="aspectFit" src="../../image/icon//icon-concat-us.png" />
<image class="icon" mode="aspectFit" src="../../image/icon/icon-concat-us.png" />
</view>
<view class="txt">联系我们</view>
</view>
......
......@@ -397,6 +397,7 @@ Page({
this.setData({
membersShipIndex: index,
memberTypeName: this.data.membersShipList[index].memberTypeName,
memberTypeCode: this.data.membersShipList[index].memberTypeCode,
})
},
......