优化推广码
parent
cdd874fe38
commit
27f402a493
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="qrcode">
|
<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>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
} else {
|
} else {
|
||||||
this.level = qrCode.CorrectLevel.L
|
this.level = qrCode.CorrectLevel.L
|
||||||
}
|
}
|
||||||
new qrCode('couponQrcode', {
|
new qrCode('qrcode', {
|
||||||
text: this.text,
|
text: this.text,
|
||||||
width: this.size,
|
width: this.size,
|
||||||
height: this.size,
|
height: this.size,
|
||||||
|
@ -80,15 +80,17 @@
|
||||||
usingIn: this //在自定义组件下,第二个参数传入组件实例this
|
usingIn: this //在自定义组件下,第二个参数传入组件实例this
|
||||||
})
|
})
|
||||||
// 把当前画布指定区域的内容导出生成图片,并返回文件路径。
|
// 把当前画布指定区域的内容导出生成图片,并返回文件路径。
|
||||||
|
setTimeout(()=>{
|
||||||
uni.canvasToTempFilePath({
|
uni.canvasToTempFilePath({
|
||||||
canvasId: 'couponQrcode',
|
canvasId: 'qrcode',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
// 在H5平台下,tempFilePath 为 base64
|
// 在H5平台下,tempFilePath 为 base64
|
||||||
// console.log('yz-qr图片路径:', res.tempFilePath)
|
// console.log('yz-qr图片路径:', res.tempFilePath)
|
||||||
this.canvasQrPath = res.tempFilePath
|
this.canvasQrPath = res.tempFilePath
|
||||||
this.$emit('update:qrPath', this.canvasQrPath)
|
this.$emit('update:qrPath', this.canvasQrPath)
|
||||||
}
|
}
|
||||||
}, this);
|
},that);
|
||||||
|
},200)
|
||||||
|
|
||||||
console.log('绘制完成');
|
console.log('绘制完成');
|
||||||
}
|
}
|
||||||
|
@ -98,9 +100,9 @@
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.qrcode {
|
.qrcode {
|
||||||
padding: 24rpx;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
opacity: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
this.getCouresList();
|
this.getCouresList();
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if(this.total!=this.dataList.lenght){
|
if(this.total!=this.dataList.length){
|
||||||
this.page++;
|
this.page++;
|
||||||
this.getCouresList();
|
this.getCouresList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,14 @@
|
||||||
<view>
|
<view>
|
||||||
<status-container titlet="我的推广" returnc="#FFFFFF">
|
<status-container titlet="我的推广" returnc="#FFFFFF">
|
||||||
<view slot="content" style="margin-top: -20rpx;" v-if="loading">
|
<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">
|
<view class="disjcac pad-sx30 bbot">
|
||||||
<!-- <image :src="personCode" mode="aspectFill" style="width: 242rpx;height: 242rpx;" lazy-load></image> -->
|
<view v-if="personCode" class="">
|
||||||
<yz-qr ref="qrPath" :text="textstr" :size="124" :colorDark="'#000000'" :colorLight="'#FFFFFF'"></yz-qr>
|
<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>
|
||||||
<view class="disjbac pad-sx20 pad-zy10">
|
<view class="disjbac pad-sx20 pad-zy10">
|
||||||
<view class="fon22 col26">推广获取积分</view>
|
<view class="fon22 col26">推广获取积分</view>
|
||||||
|
@ -44,6 +48,7 @@
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
newtop:uni.getSystemInfoSync().statusBarHeight + 42,
|
||||||
dataList:[],
|
dataList:[],
|
||||||
page:1,
|
page:1,
|
||||||
size:20,
|
size:20,
|
||||||
|
@ -62,13 +67,16 @@
|
||||||
this.getExtend();
|
this.getExtend();
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if(this.total!=this.dataList.lenght){
|
if(this.total!=this.dataList.length){
|
||||||
this.page++;
|
this.page++;
|
||||||
this.getExtend();
|
this.getExtend();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取一级推广人
|
getPath(path){
|
||||||
|
this.personCode = path;
|
||||||
|
},
|
||||||
|
// 获取推广人
|
||||||
getExtend(){
|
getExtend(){
|
||||||
let params = {
|
let params = {
|
||||||
action:'order',
|
action:'order',
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<view class="pad-zy20">
|
<view class="pad-zy20">
|
||||||
<view class="posir bacf disac fw pad-zy10 boxshow2 pad-x30" style="z-index: 1;">
|
<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="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 class="fon20" style="color: #676767;" v-if="item.created_at">{{item.created_at.slice(0,10).split('-').join('.')}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -4,8 +4,12 @@
|
||||||
<view slot="content" style="margin-top: -20rpx;">
|
<view slot="content" style="margin-top: -20rpx;">
|
||||||
<view class="bacf pad-zy20 boxshow2">
|
<view class="bacf pad-zy20 boxshow2">
|
||||||
<view class="disjcac pad-sx30 bbot">
|
<view class="disjcac pad-sx30 bbot">
|
||||||
<!-- <image :src="personCode" mode="aspectFill" style="width: 242rpx;height: 242rpx;" lazy-load></image> -->
|
<view v-if="personCode" class="">
|
||||||
<yz-qr ref="qrPath" :text="textstr" :size="124" :colorDark="'#000000'" :colorLight="'#FFFFFF'"></yz-qr>
|
<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>
|
||||||
<view class="disjbac fon24 col26 pad-sx20 pad-zy10">
|
<view class="disjbac fon24 col26 pad-sx20 pad-zy10">
|
||||||
<view class="">代理登记</view>
|
<view class="">代理登记</view>
|
||||||
|
@ -68,13 +72,16 @@
|
||||||
this.getExtend();
|
this.getExtend();
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if(this.total!=this.dataList.lenght){
|
if(this.total!=this.dataList.length){
|
||||||
this.page++;
|
this.page++;
|
||||||
this.getExtend();
|
this.getExtend();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取二级推广人
|
getPath(path){
|
||||||
|
this.personCode = path;
|
||||||
|
},
|
||||||
|
// 获取推广人
|
||||||
getExtend(){
|
getExtend(){
|
||||||
let params = {
|
let params = {
|
||||||
action:'order',
|
action:'order',
|
||||||
|
|
Loading…
Reference in New Issue