Commit 3c3a6827 authored by youjie's avatar youjie

no message

parent 8289c18d
......@@ -36,11 +36,6 @@
margin-bottom: 0;
}
.sty-box {
// width: 750px;
// height: 1344px;
// position: fixed;
// top: -2000px;
// left: -1500px;
width: 500rpx;
height: 500rpx;
}
......@@ -58,12 +53,12 @@
<text class="fz24">{{ list[current].TCNUMS }}</text>
</view>
<view class="orcodeImg row items-center justify-center PX40">
<swiper indicator-dots circular style="height:500rpx;width:500rpx"
<swiper :indicator-dots="false" circular style="height:500rpx;width:500rpx"
:current="current" @change="changeHandler">
<swiper-item v-for="(item, index) in list" :key="index">
<canvas canvas-id="TeamLeaderCanvas" class="sty-box" @error="canvasIdErrorCallback">
<image mode="aspectFit" :src="item.Url" />
</canvas>
<canvas :canvas-id="`firstCanvas_${index}`" class="sty-box"
@error="(e)=>canvasIdErrorCallback(e,index)"></canvas>
<!-- <image mode="aspectFit" :src="item.Url" /> -->
</swiper-item>
</swiper>
<!-- <img :src="list[0].Url"/> -->
......@@ -74,6 +69,7 @@
<view class="flex1 PY20 text-center" @click="preservation">保存</view>
</view>
</view>
</u-popup>
</view>
</template>
......@@ -90,6 +86,7 @@ export default {
interval: 2000,
duration: 500,
BaseInfo: [],
TCIDsList: []
}
},
watch: {
......@@ -117,9 +114,9 @@ export default {
}, (res) => {
if (res.resultCode == 1) {
this.BaseInfo = res.data.BaseInfo
let TCIDs = this.TCIDs.split(',')
TCIDs.forEach(x => {
this.init(x)
this.TCIDsList = this.TCIDs.split(',')
this.TCIDsList.forEach((x,index) => {
this.init(x,index)
});
}
})
......@@ -135,7 +132,12 @@ export default {
TCID:x,
TCNUMS:this.BaseInfo[findIndex].TCNUMS
})
uni.hideLoading()
if(this.list.length==this.TCIDsList.length) {
this.list.forEach((x,i)=>{
this.drawCtx(i)
})
}
// uni.hideLoading()
}
})
},
......@@ -143,13 +145,48 @@ export default {
this.currencyVisible = false
this.$emit('close')
},
drawCtx(i) {
// uni.showLoading({
// title: "正在生成",
// });
let ctx = uni.createCanvasContext(`firstCanvas_${i}`, this);
let that = this;
ctx.drawImage(that.list[i].Url, 0, 0, 250, 250); //绘制图
that.drawQrCode(ctx)
},
drawQrCode(ctx) {
let that = this;
setTimeout(() => {
ctx.draw(false, () => {
uni.canvasToTempFilePath({
x: 0,
y: 0,
width: 750,
height: 1344,
destWidth: 750.0,
destHeight: 1344.0,
canvasId: "firstCanvas",
success: (res) => {
uni.hideLoading();
// that.tempPic = res.tempFilePath;
},
fail(e) {
uni.hideLoading();
console.log(e);
},
},
that
);
});
}, 200)
},
preservation(){
uni.showLoading({
title: "正在生成",
});
let that = this;
uni.canvasToTempFilePath({
canvasId: "TeamLeaderCanvas",
canvasId: `firstCanvas_${that.current}`,
success: (res) => {
uni.hideLoading();
uni.showLoading({
......@@ -167,7 +204,7 @@ export default {
uni.authorize({
scope: 'scope.writePhotosAlbum',
success: (res) => {
console.log('11111');
},
fail: (res) => {
uni.showModal({
......@@ -217,8 +254,8 @@ export default {
);
},
canvasIdErrorCallback: function(e) {
console.error(e.detail.errMsg);
canvasIdErrorCallback: function(e,index) {
console.error(e.detail.errMsg,'---index',index);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment