@@ -67,12 +67,13 @@
settingFile: getApp().globalData.siteinfo,
sharedata: [],
ifshare: false,
- shareitemlist: [{
- title: '微信好友',
- provider: 'weixin',
- type: 1,
- imgsrc: 'weixin.png'
- },
+ shareitemlist: [
+ // {
+ // title: '微信好友',
+ // provider: 'weixin',
+ // type: 1,
+ // imgsrc: 'weixin.png'
+ // },
// {
// title: 'QQ好友',
// provider: 'qq',
@@ -1,7 +1,10 @@
<template>
- <view class="goCode">
+ <view class="goCode" :class="[AppTheme]">
<view class="code">
- <image :src="code1" alt="" class="img" />
+ <image :src="code1" alt="" class="img" mode="widthFix"/>
+ </view>
+ <view class=" bcfxhb" @click="saveImg(code1)" :style="{'background-color': primary}">
+ 保存分享海报
</view>
</template>
@@ -33,6 +36,42 @@
this.$u.toast(ret.msg)
}
})
+ },
+ methods: {
+ saveImg(url) {
+ const that = this;
+ console.log('url',url)
+ uni.downloadFile({
+ url: url,
+ success: res => {
+ if (res.statusCode === 200) {
+ uni.saveImageToPhotosAlbum({
+ filePath: res.tempFilePath,
+ success: function() {
+ uni.showToast({
+ title: '保存下载成功',
+ icon: 'none',
+ position: 'top'
+ })
+ fail: function() {
+ title: '保存失败,请稍后重试',
+ }
+ });
+ } else {
+ title: '下载失败',
</script>
@@ -48,8 +87,21 @@
.code .img {
- position: fixed;
- width: 100%;
- height: 100%;
+ // position: fixed;
+ // width: 100%;
+ // height: 100%;
+ width: 690rpx;
+ display: block;
+ margin: auto;
+ border-radius: 20rpx;
+ .bcfxhb {
+ width: 550rpx;
+ height: 100rpx;
+ color: #fff;
+ border-radius: 50rpx;
+ text-align: center;
+ line-height: 100rpx;
+ margin:20rpx auto;
</style>