Commit 3937354e7a5d87d9c57b5b1462c67ef0fefc8bed

Authored by vking
1 parent 863af818

painter

... ... @@ -14,8 +14,6 @@ Page({
pagesHeight:'auto',
current:0,
currentView:1,
paletteImageSrc:'',
palette:null,
},
/**
... ... @@ -32,68 +30,6 @@ Page({
IsCollectionSeller:res.data,
})
})
wx.request({
url:'https://cli.im/mina/generate_qrcode',
data:{
tpl_id: 25415,
code_type: 'wxcode',
'param_value[0]':80
},
success:res=>{
console.log('cli.im.res:',res.data.data);
this.setData({
palette:{
background: '#fff',
width: getApp().system.windowWidth+'px',
height: getApp().system.windowHeight+'px',
views: [
{
type:'image',
url:'https://xt04.colorcun.com/sellerShare/Share_'+this.options.id+'.png',
css:{
width:getApp().system.windowWidth+'px',
height:(480*(getApp().system.windowWidth/600))+'px',
mode:'aspectFill'
}
},
{
type:'text',
text: "陕西风味面馆",
css:{
fontSize:'14px',
color:'#f00',
background:'#ff0',
padding:'8px 20px',
top:(480*(getApp().system.windowWidth/600)+20)+'px',
left:'16px',
lineHeight:'18px'
}
},
{
type:'rect',
css:{
color:'rgba(0,0,0,0.5)',
top:(480*(getApp().system.windowWidth/600)+12)+'px',
left:'0px',
width:'320px',
height:'34px'
}
},
{
type: 'image',
url: res.data.data,
css: {
bottom: '48rpx',
right: '48rpx',
width: '192rpx',
height: '192rpx',
},
}
],
}
})
}
})
},
GetSellerDetail(){
let options=this.options
... ...
... ... @@ -8,14 +8,18 @@ Page({
* 页面的初始数据
*/
data: {
seller:{},
paletteImageSrc:'',
palette:null,
hasLoadData:false,
act:'',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.options=options;
this.GetSellerDetail();
},
/**
... ... @@ -59,11 +63,87 @@ Page({
onReachBottom: function () {
},
GetSellerDetail(){
let options=this.options
App.Customer.GetSellerDetail({
sid:options.id,
}).then(async res=>{
if(res.ret==200){
let seller=res.data
console.log('App',App)
let qrcode=await App.Other.generate_qrcode({
tpl_id: 25415,
code_type: 'wxcode',
'param_value[0]':80
});
this.setData({
seller:seller,
qrcode:qrcode.data,
hasLoadData:true,
})
setTimeout(()=>{
this.initImage()
},0);
}
})
},
initImage(){
this.setData({
palette:{
background: '#fff',
width: getApp().system.windowWidth+'px',
height: getApp().system.windowHeight+'px',
views: [
{
type:'image',
url:'https://xt04.colorcun.com/sellerShare/Share_'+this.options.id+'.png',
css:{
width:getApp().system.windowWidth+'px',
height:(480*(getApp().system.windowWidth/600))+'px',
mode:'aspectFill'
}
},
{
type:'text',
text: "陕西风味面馆",
css:{
fontSize:'14px',
color:'#f00',
background:'#ff0',
padding:'8px 20px',
top:(480*(getApp().system.windowWidth/600)+20)+'px',
left:'16px',
lineHeight:'18px'
}
},
{
type:'rect',
css:{
color:'rgba(0,0,0,0.5)',
top:(480*(getApp().system.windowWidth/600)+12)+'px',
left:'0px',
width:'320px',
height:'34px'
}
},
{
type: 'image',
url: this.data.qrcode,
css: {
bottom: '48rpx',
right: '48rpx',
width: '192rpx',
height: '192rpx',
},
}
],
}
})
},
onImgOK(e){
console.log('onImgOK',e.detail.path)
this.setData({
paletteImageSrc:e.detail.path
paletteImageSrc:e.detail.path,
})
},
})
\ No newline at end of file
... ...
<!--pages/reserve/share.wxml-->
<nav>{{true?'分享图':'二维码下载'}}</nav>
<view style="position: fixed;top:-9999rpx;" wx:if="{{palette}}">
<loading wx:if="{{!hasLoadData || !paletteImageSrc}}">图片生成中</loading>
<view wx:if="{{hasLoadData}}" style="position: fixed;top:-9999rpx;">
<painter palette="{{palette}}" bind:imgOK="onImgOK" bind:imgErr="onImgOK"/>
<painter palette="{{paletteCode}}" bind:imgOK="onImgOKCode" bind:imgErr="onImgOKCode"/>
</view>
<view wx:if="{{paletteImageSrc}}" class="pages">
<image src="{{paletteImageSrc}}" style="width:100%;height:999px;"></image>
</view>
... ...
... ... @@ -45,7 +45,7 @@
"list": []
},
"miniprogram": {
"current": 39,
"current": 54,
"list": [
{
"id": 0,
... ... @@ -448,6 +448,13 @@
"pathName": "pack-book/pages/book/b_desk",
"query": "rdate=1559617200-1559631600&tid=0&pnum=6&checked_tids=760,761&rid=",
"scene": null
},
{
"id": -1,
"name": "pages/reserve/share 在线订座 ",
"pathName": "pages/reserve/share",
"query": "id=999&act=quanzi",
"scene": null
}
]
}
... ...
... ... @@ -249,4 +249,10 @@ export default {
openid:'openid',
cachetime: 60,
},
//获得小程序码
'App.Other.generate_qrcode':{
host: 'https://cli.im/mina/',
alias:'generate_qrcode'
}
}
\ No newline at end of file
... ...