Commit 3c3a6827 authored by youjie's avatar youjie

no message

parent 8289c18d
...@@ -36,11 +36,6 @@ ...@@ -36,11 +36,6 @@
margin-bottom: 0; margin-bottom: 0;
} }
.sty-box { .sty-box {
// width: 750px;
// height: 1344px;
// position: fixed;
// top: -2000px;
// left: -1500px;
width: 500rpx; width: 500rpx;
height: 500rpx; height: 500rpx;
} }
...@@ -58,12 +53,12 @@ ...@@ -58,12 +53,12 @@
<text class="fz24">{{ list[current].TCNUMS }}</text> <text class="fz24">{{ list[current].TCNUMS }}</text>
</view> </view>
<view class="orcodeImg row items-center justify-center PX40"> <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"> :current="current" @change="changeHandler">
<swiper-item v-for="(item, index) in list" :key="index"> <swiper-item v-for="(item, index) in list" :key="index">
<canvas canvas-id="TeamLeaderCanvas" class="sty-box" @error="canvasIdErrorCallback"> <canvas :canvas-id="`firstCanvas_${index}`" class="sty-box"
<image mode="aspectFit" :src="item.Url" /> @error="(e)=>canvasIdErrorCallback(e,index)"></canvas>
</canvas> <!-- <image mode="aspectFit" :src="item.Url" /> -->
</swiper-item> </swiper-item>
</swiper> </swiper>
<!-- <img :src="list[0].Url"/> --> <!-- <img :src="list[0].Url"/> -->
...@@ -74,6 +69,7 @@ ...@@ -74,6 +69,7 @@
<view class="flex1 PY20 text-center" @click="preservation">保存</view> <view class="flex1 PY20 text-center" @click="preservation">保存</view>
</view> </view>
</view> </view>
</u-popup> </u-popup>
</view> </view>
</template> </template>
...@@ -90,6 +86,7 @@ export default { ...@@ -90,6 +86,7 @@ export default {
interval: 2000, interval: 2000,
duration: 500, duration: 500,
BaseInfo: [], BaseInfo: [],
TCIDsList: []
} }
}, },
watch: { watch: {
...@@ -117,9 +114,9 @@ export default { ...@@ -117,9 +114,9 @@ export default {
}, (res) => { }, (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.BaseInfo = res.data.BaseInfo this.BaseInfo = res.data.BaseInfo
let TCIDs = this.TCIDs.split(',') this.TCIDsList = this.TCIDs.split(',')
TCIDs.forEach(x => { this.TCIDsList.forEach((x,index) => {
this.init(x) this.init(x,index)
}); });
} }
}) })
...@@ -135,7 +132,12 @@ export default { ...@@ -135,7 +132,12 @@ export default {
TCID:x, TCID:x,
TCNUMS:this.BaseInfo[findIndex].TCNUMS 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 { ...@@ -143,13 +145,48 @@ export default {
this.currencyVisible = false this.currencyVisible = false
this.$emit('close') 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(){ preservation(){
uni.showLoading({ uni.showLoading({
title: "正在生成", title: "正在生成",
}); });
let that = this; let that = this;
uni.canvasToTempFilePath({ uni.canvasToTempFilePath({
canvasId: "TeamLeaderCanvas", canvasId: `firstCanvas_${that.current}`,
success: (res) => { success: (res) => {
uni.hideLoading(); uni.hideLoading();
uni.showLoading({ uni.showLoading({
...@@ -167,7 +204,7 @@ export default { ...@@ -167,7 +204,7 @@ export default {
uni.authorize({ uni.authorize({
scope: 'scope.writePhotosAlbum', scope: 'scope.writePhotosAlbum',
success: (res) => { success: (res) => {
console.log('11111');
}, },
fail: (res) => { fail: (res) => {
uni.showModal({ uni.showModal({
...@@ -217,8 +254,8 @@ export default { ...@@ -217,8 +254,8 @@ export default {
); );
}, },
canvasIdErrorCallback: function(e) { canvasIdErrorCallback: function(e,index) {
console.error(e.detail.errMsg); 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