优化推广码

master
chen 2022-08-17 15:52:02 +08:00
parent cdd874fe38
commit 27f402a493
5 changed files with 40 additions and 23 deletions

View File

@ -1,7 +1,7 @@
<template>
<view>
<view class="qrcode">
<canvas :style="{width:size+ 'px', height:size+ 'px', background:bgc}" canvas-id="couponQrcode"></canvas>
<canvas :style="{width:size+ 'px', height:size+ 'px', background:bgc}" canvas-id="qrcode"></canvas>
</view>
</view>
</template>
@ -68,7 +68,7 @@
} else {
this.level = qrCode.CorrectLevel.L
}
new qrCode('couponQrcode', {
new qrCode('qrcode', {
text: this.text,
width: this.size,
height: this.size,
@ -80,15 +80,17 @@
usingIn: this //this
})
//
setTimeout(()=>{
uni.canvasToTempFilePath({
canvasId: 'couponQrcode',
canvasId: 'qrcode',
success: (res) => {
// H5tempFilePath base64
// console.log('yz-qr:', res.tempFilePath)
this.canvasQrPath = res.tempFilePath
this.$emit('update:qrPath', this.canvasQrPath)
}
}, this);
},that);
},200)
console.log('绘制完成');
}
@ -98,9 +100,9 @@
<style>
.qrcode {
padding: 24rpx;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
}
</style>

View File

@ -48,7 +48,7 @@
this.getCouresList();
},
onReachBottom() {
if(this.total!=this.dataList.lenght){
if(this.total!=this.dataList.length){
this.page++;
this.getCouresList();
}

View File

@ -2,10 +2,14 @@
<view>
<status-container titlet="我的推广" returnc="#FFFFFF">
<view slot="content" style="margin-top: -20rpx;" v-if="loading">
<view class="bacf pad-zy20 boxshow2">
<view class="bacf pad-zy20 boxshow2 posi-sticky" :style="{top:newtop+'px'}">
<view class="disjcac pad-sx30 bbot">
<!-- <image :src="personCode" mode="aspectFill" style="width: 242rpx;height: 242rpx;" lazy-load></image> -->
<yz-qr ref="qrPath" :text="textstr" :size="124" :colorDark="'#000000'" :colorLight="'#FFFFFF'"></yz-qr>
<view v-if="personCode" class="">
<image :src="personCode" mode="aspectFill" style="width: 124px;height: 124px;" lazy-load></image>
</view>
<view class="" v-else>
<yz-qr @update:qrPath="getPath" ref="qrPath" :text="textstr" :size="124" :colorDark="'#000000'" :colorLight="'#FFFFFF'"></yz-qr>
</view>
</view>
<view class="disjbac pad-sx20 pad-zy10">
<view class="fon22 col26">推广获取积分</view>
@ -44,6 +48,7 @@
},
data() {
return {
newtop:uni.getSystemInfoSync().statusBarHeight + 42,
dataList:[],
page:1,
size:20,
@ -62,13 +67,16 @@
this.getExtend();
},
onReachBottom() {
if(this.total!=this.dataList.lenght){
if(this.total!=this.dataList.length){
this.page++;
this.getExtend();
}
},
methods: {
// 广
getPath(path){
this.personCode = path;
},
// 广
getExtend(){
let params = {
action:'order',

View File

@ -25,7 +25,7 @@
<view class="pad-zy20">
<view class="posir bacf disac fw pad-zy10 boxshow2 pad-x30" style="z-index: 1;">
<view class="disjbac bbot width100 pad-sx20 pad-zy30" v-for="(item,index) in dataList" :key="index">
<view class="fon24 col-e42417">{{item.num}}</view>
<view class="fon24 col-e42417">+{{item.num}}</view>
<view class="fon20" style="color: #676767;" v-if="item.created_at">{{item.created_at.slice(0,10).split('-').join('.')}}</view>
</view>
</view>

View File

@ -4,8 +4,12 @@
<view slot="content" style="margin-top: -20rpx;">
<view class="bacf pad-zy20 boxshow2">
<view class="disjcac pad-sx30 bbot">
<!-- <image :src="personCode" mode="aspectFill" style="width: 242rpx;height: 242rpx;" lazy-load></image> -->
<yz-qr ref="qrPath" :text="textstr" :size="124" :colorDark="'#000000'" :colorLight="'#FFFFFF'"></yz-qr>
<view v-if="personCode" class="">
<image :src="personCode" mode="aspectFill" style="width: 124px;height: 124px;" lazy-load></image>
</view>
<view class="" v-else>
<yz-qr @update:qrPath="getPath" ref="qrPath" :text="textstr" :size="124" :colorDark="'#000000'" :colorLight="'#FFFFFF'"></yz-qr>
</view>
</view>
<view class="disjbac fon24 col26 pad-sx20 pad-zy10">
<view class="">代理登记</view>
@ -68,13 +72,16 @@
this.getExtend();
},
onReachBottom() {
if(this.total!=this.dataList.lenght){
if(this.total!=this.dataList.length){
this.page++;
this.getExtend();
}
},
methods: {
// 广
getPath(path){
this.personCode = path;
},
// 广
getExtend(){
let params = {
action:'order',