Commit 713ade9ac17b00a23233e7de823d8573374d7c16

Authored by vking
1 parent b0722044

painter

// components/reserve/share/share.js
import util from '../../../utils/util';
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
hasShow:false,
},
/**
* 组件的方法列表
*/
methods: {
show(){
this.setData({
hasShow:true,
})
},
hide(){
this.setData({
hasShow:false,
})
},
shareDo(e){
this.hide()
let act=util.attr(e,'act');
if('wechat'==act){
}else{
}
},
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--components/reserve/share/share.wxml-->
<view class="share mask" catchtap="hide" wx:if="{{hasShow}}">
<view class="share-view flex-lr">
<button class="button-none share-item flex-vc" open-type="share" catchtap="shareDo">
<image class="share-img wechat"></image>
<view class="share-name">微信</view>
</button>
<view class="share-item flex-vc" catchtap="shareDo" data-act="quanzi">
<image class="share-img quanzi"></image>
<view class="share-name">朋友圈</view>
</view>
<view class="share-item flex-vc" catchtap="shareDo" data-act="qrcode">
<image class="share-img qrcode"></image>
<view class="share-name">二维码</view>
</view>
</view>
</view>
... ...
/* components/reserve/share/share.wxss */
@import "../../../app.wxss";
.share-view{
height: 316rpx;
background: #fefefe;
width: calc(100% - 40rpx);
padding: 0 20rpx;
position: fixed;
bottom: 0;
}
.share-img{
width: 140rpx;
height: 140rpx;
background-size: 100% 100%;
background-color: #cccccc;
}
.share-img.wechat{
background-image: url("http://");
}
.share-img.quanzi{
background-image: url("http://");
}
.share-img.qrcode{
background-image: url("http://");
}
.share-name{
margin-top: 20rpx;
font-size: 30rpx;
height: 42rpx;
line-height: 42rpx;
color: #353535;
}
.share-item{
min-width: 33%;
width: 33%;
}
\ No newline at end of file
... ...
... ... @@ -14,27 +14,8 @@ Page({
pagesHeight:'auto',
current:0,
currentView:1,
palette:{
background: '#fff',
width: '2rpx',
height: '2rpx',
views: [
{
type:'image',
url:'',
},
{
type: 'image',
url: '',
css: {
bottom: '48rpx',
right: '48rpx',
width: '192rpx',
height: '192rpx',
},
}
],
}
paletteImageSrc:'',
palette:null,
},
/**
... ... @@ -61,14 +42,55 @@ Page({
success:res=>{
console.log('cli.im.res:',res.data.data);
this.setData({
[`palette.width`]:getApp().system.windowWidth+'px',
[`palette.height`]:getApp().system.windowHeight+'px',
[`palette.views[0].url`]:'https://xt04.colorcun.com/sellerShare/Share_'+this.options.id+'.png',
[`palette.views[0].css.width`]:getApp().system.windowWidth+'px',
[`palette.views[0].css.height`]:(480*(getApp().system.windowWidth/600))+'px',
[`palette.views[0].css.mode`]:'aspectFill',
[`palette.views[1].url`]:res.data.data,
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',
},
}
],
}
})
}
})
... ... @@ -254,7 +276,8 @@ Page({
})
},
shareUserinfo(){
util.toast('授权成功,请继续分享','none');
//util.toast('授权成功,请继续分享','none');
this.selectComponent('#share').show()
},
bindtransition(e){
this.setData({
... ... @@ -262,6 +285,9 @@ Page({
})
},
onImgOK(e){
console.log('onImgOK',e)
console.log('onImgOK',e.detail.path)
this.setData({
paletteImageSrc:e.detail.path
})
},
})
\ No newline at end of file
... ...
... ... @@ -11,6 +11,7 @@
"nav":"/components/nav/nav",
"getpos":"/components/userinfo/getpos",
"discount":"/components/reserve/discount",
"painter":"/components/painter/painter"
"painter":"/components/painter/painter",
"share":"/components/reserve/share/share"
}
}
\ No newline at end of file
... ...
... ... @@ -148,19 +148,22 @@
</userinfo>
</view>
<view class="reserve share flex-vc">
<userinfo-share class="flex-vc" style="width: 100%" binduserinfo="shareUserinfo">
<userinfo class="flex-vc" style="width: 100%" binduserinfo="shareUserinfo">
<view class="text">分享</view>
</userinfo-share>
</userinfo>
</view>
<view class="reserve">
<formids class="flex-vc" bindclick="reserve" id="reserve-button">
<view class="text">电话预订</view>
</formids>
</view>
</view>
<as id="as" items="{{seller.seller_tel}}" bindclick="reservePhone">拨打电话预订</as>
<getpos bindpos="onpos" id="getpos"></getpos>
<discount id="discount" seller="{{seller}}" bindhide="discountHide" bindshow="discountShow"></discount>
<view>
<painter palette="{{palette}}" bind:imgOK="onImgOK" bind:imgErr="onImgOK"/>
</view>
\ No newline at end of file
<view style="position: fixed;top:-9999rpx;" wx:if="{{palette}}">
<painter palette="{{palette}}" bind:imgOK="onImgOK" bind:imgErr="onImgOK"/>
<painter palette="{{paletteCode}}" bind:imgOK="onImgOKCode" bind:imgErr="onImgOKCode"/>
</view>
<share id="share"></share>
\ No newline at end of file
... ...
... ... @@ -45,7 +45,7 @@
"list": []
},
"miniprogram": {
"current": 25,
"current": 39,
"list": [
{
"id": 0,
... ... @@ -348,7 +348,7 @@
"id": 39,
"name": "pages/reserve/detail 在线订座 ",
"pathName": "pages/reserve/detail",
"query": "id=1",
"query": "id=999",
"scene": null
},
{
... ...