修改图片,分享样式

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 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"> <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" /> --> <!-- <image class="image" :src="item.icon" mode="widthFix" /> -->
<text v-else :class="'sc icon-ymt '+item.icon" ></text> <text v-else :class="'sc icon-ymt '+item.icon" ></text>
</view> </view>

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

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