修改图片,分享样式

youmengting-dev
游梦婷 1 year ago
parent a880676a32
commit 126ed23251
  1. 2
      components/uni-goods-nav/components/uni-goods-nav/uni-goods-nav.vue
  2. 2
      physical-merchants/classify/goodsDetail/goodsDetail.vue
  3. 156
      physical-merchants/classify/poster/poster.vue
  4. BIN
      physical-merchants/static/img/placard.png
  5. BIN
      physical-merchants/static/img/share_wechat.png

@ -7,7 +7,7 @@
<view v-for="(item,index) in options" :key="index" class="flex uni-tab__cart-button-left uni-tab__shop-cart" @click="onClick(index,item)">
<view class="uni-tab__icon">
<uni-icons v-if="item.icon=='cart'||item.icon=='chat'" :type="item.icon" size="20" color="#646566"></uni-icons>
<uni-icons v-if="item.icon=='cart'||item.icon=='redo'" :type="item.icon" size="20" color="#646566"></uni-icons>
<!-- <image class="image" :src="item.icon" mode="widthFix" /> -->
<text v-else :class="'sc icon-ymt '+item.icon" ></text>
</view>

@ -191,7 +191,7 @@
color: "#646566"
},
{
icon: 'icon-y share',
icon: 'redo',//icon-y
text: '分享',
},
],

@ -118,33 +118,38 @@
// usingIn: this //this
})
console.log(qrde, " qrde")
//
const ctx = uni.createCanvasContext('qrImg');
ctx.draw(true,setTimeout(() => {
uni.canvasToTempFilePath({
canvasId: 'qrImg',
success: (res) => {
uni.hideLoading()
// H5tempFilePath base64
// console.log('yz-qr:', res)
console.log('二维码图片地址', res.tempFilePath)
this.dataInfo.recommendCodeGoods = res.tempFilePath;
/* qrcode = null; */
/* uni.getFileSystemManager().readFile({
filePath: res.tempFilePath, //
encoding: 'base64', //
success: res => {
//
let base64 = 'data:image/jpeg;base64,' + res.data;
this.dataInfo.recommendCodeGoods = base64;
}
}); */
},
fail: (err) => {
uni.hideLoading();
/* qrcode = null; */
console.log(err)
}
}, this);
}, 0))
//
// uni.canvasToTempFilePath({
// canvasId: 'qrImg',
// success: (res) => {
// uni.hideLoading()
// // H5tempFilePath base64
// // console.log('yz-qr:', res)
// this.dataInfo.recommendCodeGoods = res.tempFilePath;
// /* qrcode = null; */
// },
// fail: (err) => {
// uni.hideLoading();
// /* qrcode = null; */
// console.log(err)
// }
// }, this);
// console.log('');
},
@ -287,73 +292,98 @@
uni.hideLoading();
// #endif
// #ifdef MP-WEIXIN
this.savePosterPath(imgUrl)
// #endif
},
savePosterPath(url) {
uni.showLoading({
title: '海报下载中'
title: '海报下载中...'
});
// if (this.settingWritePhotosAlbum) {
//
uni.getSetting({
success: res => {
if (res.authSetting['scope.writePhotosAlbum']) {
uni.saveImageToPhotosAlbum({
filePath: imgUrl,
success: (res) => {
//
if (!res.authSetting["scope.writePhotosAlbum"]) {
//
uni.authorize({
scope: "scope.writePhotosAlbum",
success: () => {
//
uni.saveImageToPhotosAlbum({
//
filePath: url,
success: (res) => {
uni.hideLoading();
uni.showToast({
title: '保存成功'
return uni.showToast({
title: "保存成功!",
});
},
fail: (res) => {
console.log(res.errMsg);
return uni.showToast({
title: res.errMsg,
});
},
fail() {
complete: (res) => {
uni.hideLoading();
}
},
});
} else {
},
//
fail: () => {
uni.hideLoading();
uni.showModal({
title: '提示',
content: '请先在设置页面打开“保存相册”使用权限',
confirmText: '去设置',
cancelText: '算了',
success: data => {
if (data.confirm) {
uni.openSetting();
title: "您已拒绝获取相册权限",
content: "是否进入权限管理,调整授权?",
success: (res) => {
if (res.confirm) {
//
uni.openSetting({
success: (res) => {
console.log(res
.authSetting
);
},
});
} else if (res.cancel) {
return uni.showToast({
title: "已取消!",
});
}
},
});
},
});
} else {
//
uni.saveImageToPhotosAlbum({
filePath: url,
success: (res) => {
uni.hideLoading();
return uni.showToast({
title: "保存成功!",
});
},
fail() {
fail: (res) => {
uni.hideLoading();
}
console.log(res.errMsg);
return uni.showToast({
title: res.errMsg,
});
}
},
fail() {
//
complete: (res) => {
uni.hideLoading();
},
});
}
},
fail: (res) => {
uni.hideLoading()
},
});
// } else {
// this.settingWritePhotosAlbum = true;
// uni.authorize({
// scope: 'scope.writePhotosAlbum',
// success: () => {
// uni.saveImageToPhotosAlbum({
// filePath: imgUrl,
// success: () => {
// uni.hideLoading();
// uni.showToast({
// title: ''
// });
// },
// fail(){
// uni.hideLoading();
// }
// });
// },
// fail(){
// uni.hideLoading();
// }
// });
// }
// #endif
},
//
drawtext(text, maxWidth) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Loading…
Cancel
Save