优化推广码
parent
cdd874fe38
commit
27f402a493
|
@ -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
|
||||
})
|
||||
// 把当前画布指定区域的内容导出生成图片,并返回文件路径。
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: 'couponQrcode',
|
||||
success: (res) => {
|
||||
// 在H5平台下,tempFilePath 为 base64
|
||||
// console.log('yz-qr图片路径:', res.tempFilePath)
|
||||
this.canvasQrPath = res.tempFilePath
|
||||
this.$emit('update:qrPath', this.canvasQrPath)
|
||||
}
|
||||
}, this);
|
||||
setTimeout(()=>{
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: 'qrcode',
|
||||
success: (res) => {
|
||||
// 在H5平台下,tempFilePath 为 base64
|
||||
// console.log('yz-qr图片路径:', res.tempFilePath)
|
||||
this.canvasQrPath = res.tempFilePath
|
||||
this.$emit('update:qrPath', this.canvasQrPath)
|
||||
}
|
||||
},that);
|
||||
},200)
|
||||
|
||||
console.log('绘制完成');
|
||||
}
|
||||
|
@ -98,9 +100,9 @@
|
|||
|
||||
<style>
|
||||
.qrcode {
|
||||
padding: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
opacity: 0;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
this.getCouresList();
|
||||
},
|
||||
onReachBottom() {
|
||||
if(this.total!=this.dataList.lenght){
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++;
|
||||
this.getCouresList();
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue