Showing
8 changed files
with
168 additions
and
39 deletions
components/reserve/share/share.js
0 → 100644
| 1 | +// components/reserve/share/share.js | ||
| 2 | +import util from '../../../utils/util'; | ||
| 3 | +Component({ | ||
| 4 | + /** | ||
| 5 | + * 组件的属性列表 | ||
| 6 | + */ | ||
| 7 | + properties: { | ||
| 8 | + | ||
| 9 | + }, | ||
| 10 | + | ||
| 11 | + /** | ||
| 12 | + * 组件的初始数据 | ||
| 13 | + */ | ||
| 14 | + data: { | ||
| 15 | + hasShow:false, | ||
| 16 | + }, | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * 组件的方法列表 | ||
| 20 | + */ | ||
| 21 | + methods: { | ||
| 22 | + show(){ | ||
| 23 | + this.setData({ | ||
| 24 | + hasShow:true, | ||
| 25 | + }) | ||
| 26 | + }, | ||
| 27 | + hide(){ | ||
| 28 | + this.setData({ | ||
| 29 | + hasShow:false, | ||
| 30 | + }) | ||
| 31 | + }, | ||
| 32 | + shareDo(e){ | ||
| 33 | + this.hide() | ||
| 34 | + let act=util.attr(e,'act'); | ||
| 35 | + if('wechat'==act){ | ||
| 36 | + | ||
| 37 | + }else{ | ||
| 38 | + | ||
| 39 | + } | ||
| 40 | + }, | ||
| 41 | + } | ||
| 42 | +}) |
components/reserve/share/share.json
0 → 100644
components/reserve/share/share.wxml
0 → 100644
| 1 | +<!--components/reserve/share/share.wxml--> | ||
| 2 | +<view class="share mask" catchtap="hide" wx:if="{{hasShow}}"> | ||
| 3 | + <view class="share-view flex-lr"> | ||
| 4 | + <button class="button-none share-item flex-vc" open-type="share" catchtap="shareDo"> | ||
| 5 | + <image class="share-img wechat"></image> | ||
| 6 | + <view class="share-name">微信</view> | ||
| 7 | + </button> | ||
| 8 | + <view class="share-item flex-vc" catchtap="shareDo" data-act="quanzi"> | ||
| 9 | + <image class="share-img quanzi"></image> | ||
| 10 | + <view class="share-name">朋友圈</view> | ||
| 11 | + </view> | ||
| 12 | + <view class="share-item flex-vc" catchtap="shareDo" data-act="qrcode"> | ||
| 13 | + <image class="share-img qrcode"></image> | ||
| 14 | + <view class="share-name">二维码</view> | ||
| 15 | + </view> | ||
| 16 | + </view> | ||
| 17 | +</view> |
components/reserve/share/share.wxss
0 → 100644
| 1 | +/* components/reserve/share/share.wxss */ | ||
| 2 | +@import "../../../app.wxss"; | ||
| 3 | +.share-view{ | ||
| 4 | + height: 316rpx; | ||
| 5 | + background: #fefefe; | ||
| 6 | + width: calc(100% - 40rpx); | ||
| 7 | + padding: 0 20rpx; | ||
| 8 | + position: fixed; | ||
| 9 | + bottom: 0; | ||
| 10 | +} | ||
| 11 | +.share-img{ | ||
| 12 | + width: 140rpx; | ||
| 13 | + height: 140rpx; | ||
| 14 | + background-size: 100% 100%; | ||
| 15 | + background-color: #cccccc; | ||
| 16 | +} | ||
| 17 | +.share-img.wechat{ | ||
| 18 | + background-image: url("http://"); | ||
| 19 | +} | ||
| 20 | +.share-img.quanzi{ | ||
| 21 | + background-image: url("http://"); | ||
| 22 | +} | ||
| 23 | +.share-img.qrcode{ | ||
| 24 | + background-image: url("http://"); | ||
| 25 | +} | ||
| 26 | +.share-name{ | ||
| 27 | + margin-top: 20rpx; | ||
| 28 | + font-size: 30rpx; | ||
| 29 | + height: 42rpx; | ||
| 30 | + line-height: 42rpx; | ||
| 31 | + color: #353535; | ||
| 32 | +} | ||
| 33 | +.share-item{ | ||
| 34 | + min-width: 33%; | ||
| 35 | + width: 33%; | ||
| 36 | +} |
| @@ -14,27 +14,8 @@ Page({ | @@ -14,27 +14,8 @@ Page({ | ||
| 14 | pagesHeight:'auto', | 14 | pagesHeight:'auto', |
| 15 | current:0, | 15 | current:0, |
| 16 | currentView:1, | 16 | currentView:1, |
| 17 | - palette:{ | ||
| 18 | - background: '#fff', | ||
| 19 | - width: '2rpx', | ||
| 20 | - height: '2rpx', | ||
| 21 | - views: [ | ||
| 22 | - { | ||
| 23 | - type:'image', | ||
| 24 | - url:'', | ||
| 25 | - }, | ||
| 26 | - { | ||
| 27 | - type: 'image', | ||
| 28 | - url: '', | ||
| 29 | - css: { | ||
| 30 | - bottom: '48rpx', | ||
| 31 | - right: '48rpx', | ||
| 32 | - width: '192rpx', | ||
| 33 | - height: '192rpx', | ||
| 34 | - }, | ||
| 35 | - } | ||
| 36 | - ], | ||
| 37 | - } | 17 | + paletteImageSrc:'', |
| 18 | + palette:null, | ||
| 38 | }, | 19 | }, |
| 39 | 20 | ||
| 40 | /** | 21 | /** |
| @@ -61,14 +42,55 @@ Page({ | @@ -61,14 +42,55 @@ Page({ | ||
| 61 | success:res=>{ | 42 | success:res=>{ |
| 62 | console.log('cli.im.res:',res.data.data); | 43 | console.log('cli.im.res:',res.data.data); |
| 63 | this.setData({ | 44 | this.setData({ |
| 64 | - [`palette.width`]:getApp().system.windowWidth+'px', | ||
| 65 | - [`palette.height`]:getApp().system.windowHeight+'px', | ||
| 66 | - [`palette.views[0].url`]:'https://xt04.colorcun.com/sellerShare/Share_'+this.options.id+'.png', | ||
| 67 | - [`palette.views[0].css.width`]:getApp().system.windowWidth+'px', | ||
| 68 | - [`palette.views[0].css.height`]:(480*(getApp().system.windowWidth/600))+'px', | ||
| 69 | - [`palette.views[0].css.mode`]:'aspectFill', | ||
| 70 | - | ||
| 71 | - [`palette.views[1].url`]:res.data.data, | 45 | + palette:{ |
| 46 | + background: '#fff', | ||
| 47 | + width: getApp().system.windowWidth+'px', | ||
| 48 | + height: getApp().system.windowHeight+'px', | ||
| 49 | + views: [ | ||
| 50 | + { | ||
| 51 | + type:'image', | ||
| 52 | + url:'https://xt04.colorcun.com/sellerShare/Share_'+this.options.id+'.png', | ||
| 53 | + css:{ | ||
| 54 | + width:getApp().system.windowWidth+'px', | ||
| 55 | + height:(480*(getApp().system.windowWidth/600))+'px', | ||
| 56 | + mode:'aspectFill' | ||
| 57 | + } | ||
| 58 | + }, | ||
| 59 | + { | ||
| 60 | + type:'text', | ||
| 61 | + text: "陕西风味面馆", | ||
| 62 | + css:{ | ||
| 63 | + fontSize:'14px', | ||
| 64 | + color:'#f00', | ||
| 65 | + background:'#ff0', | ||
| 66 | + padding:'8px 20px', | ||
| 67 | + top:(480*(getApp().system.windowWidth/600)+20)+'px', | ||
| 68 | + left:'16px', | ||
| 69 | + lineHeight:'18px' | ||
| 70 | + } | ||
| 71 | + }, | ||
| 72 | + { | ||
| 73 | + type:'rect', | ||
| 74 | + css:{ | ||
| 75 | + color:'rgba(0,0,0,0.5)', | ||
| 76 | + top:(480*(getApp().system.windowWidth/600)+12)+'px', | ||
| 77 | + left:'0px', | ||
| 78 | + width:'320px', | ||
| 79 | + height:'34px' | ||
| 80 | + } | ||
| 81 | + }, | ||
| 82 | + { | ||
| 83 | + type: 'image', | ||
| 84 | + url: res.data.data, | ||
| 85 | + css: { | ||
| 86 | + bottom: '48rpx', | ||
| 87 | + right: '48rpx', | ||
| 88 | + width: '192rpx', | ||
| 89 | + height: '192rpx', | ||
| 90 | + }, | ||
| 91 | + } | ||
| 92 | + ], | ||
| 93 | + } | ||
| 72 | }) | 94 | }) |
| 73 | } | 95 | } |
| 74 | }) | 96 | }) |
| @@ -254,7 +276,8 @@ Page({ | @@ -254,7 +276,8 @@ Page({ | ||
| 254 | }) | 276 | }) |
| 255 | }, | 277 | }, |
| 256 | shareUserinfo(){ | 278 | shareUserinfo(){ |
| 257 | - util.toast('授权成功,请继续分享','none'); | 279 | + //util.toast('授权成功,请继续分享','none'); |
| 280 | + this.selectComponent('#share').show() | ||
| 258 | }, | 281 | }, |
| 259 | bindtransition(e){ | 282 | bindtransition(e){ |
| 260 | this.setData({ | 283 | this.setData({ |
| @@ -262,6 +285,9 @@ Page({ | @@ -262,6 +285,9 @@ Page({ | ||
| 262 | }) | 285 | }) |
| 263 | }, | 286 | }, |
| 264 | onImgOK(e){ | 287 | onImgOK(e){ |
| 265 | - console.log('onImgOK',e) | 288 | + console.log('onImgOK',e.detail.path) |
| 289 | + this.setData({ | ||
| 290 | + paletteImageSrc:e.detail.path | ||
| 291 | + }) | ||
| 266 | }, | 292 | }, |
| 267 | }) | 293 | }) |
| @@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
| 11 | "nav":"/components/nav/nav", | 11 | "nav":"/components/nav/nav", |
| 12 | "getpos":"/components/userinfo/getpos", | 12 | "getpos":"/components/userinfo/getpos", |
| 13 | "discount":"/components/reserve/discount", | 13 | "discount":"/components/reserve/discount", |
| 14 | - "painter":"/components/painter/painter" | 14 | + "painter":"/components/painter/painter", |
| 15 | + "share":"/components/reserve/share/share" | ||
| 15 | } | 16 | } |
| 16 | } | 17 | } |
| @@ -148,19 +148,22 @@ | @@ -148,19 +148,22 @@ | ||
| 148 | </userinfo> | 148 | </userinfo> |
| 149 | </view> | 149 | </view> |
| 150 | <view class="reserve share flex-vc"> | 150 | <view class="reserve share flex-vc"> |
| 151 | - <userinfo-share class="flex-vc" style="width: 100%" binduserinfo="shareUserinfo"> | 151 | + <userinfo class="flex-vc" style="width: 100%" binduserinfo="shareUserinfo"> |
| 152 | <view class="text">分享</view> | 152 | <view class="text">分享</view> |
| 153 | - </userinfo-share> | 153 | + </userinfo> |
| 154 | </view> | 154 | </view> |
| 155 | <view class="reserve"> | 155 | <view class="reserve"> |
| 156 | <formids class="flex-vc" bindclick="reserve" id="reserve-button"> | 156 | <formids class="flex-vc" bindclick="reserve" id="reserve-button"> |
| 157 | <view class="text">电话预订</view> | 157 | <view class="text">电话预订</view> |
| 158 | </formids> | 158 | </formids> |
| 159 | </view> | 159 | </view> |
| 160 | + | ||
| 160 | </view> | 161 | </view> |
| 161 | <as id="as" items="{{seller.seller_tel}}" bindclick="reservePhone">拨打电话预订</as> | 162 | <as id="as" items="{{seller.seller_tel}}" bindclick="reservePhone">拨打电话预订</as> |
| 162 | <getpos bindpos="onpos" id="getpos"></getpos> | 163 | <getpos bindpos="onpos" id="getpos"></getpos> |
| 163 | <discount id="discount" seller="{{seller}}" bindhide="discountHide" bindshow="discountShow"></discount> | 164 | <discount id="discount" seller="{{seller}}" bindhide="discountHide" bindshow="discountShow"></discount> |
| 164 | -<view> | ||
| 165 | -<painter palette="{{palette}}" bind:imgOK="onImgOK" bind:imgErr="onImgOK"/> | ||
| 166 | -</view> | ||
| 165 | +<view style="position: fixed;top:-9999rpx;" wx:if="{{palette}}"> | ||
| 166 | + <painter palette="{{palette}}" bind:imgOK="onImgOK" bind:imgErr="onImgOK"/> | ||
| 167 | + <painter palette="{{paletteCode}}" bind:imgOK="onImgOKCode" bind:imgErr="onImgOKCode"/> | ||
| 168 | +</view> | ||
| 169 | +<share id="share"></share> |
| @@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
| 45 | "list": [] | 45 | "list": [] |
| 46 | }, | 46 | }, |
| 47 | "miniprogram": { | 47 | "miniprogram": { |
| 48 | - "current": 25, | 48 | + "current": 39, |
| 49 | "list": [ | 49 | "list": [ |
| 50 | { | 50 | { |
| 51 | "id": 0, | 51 | "id": 0, |
| @@ -348,7 +348,7 @@ | @@ -348,7 +348,7 @@ | ||
| 348 | "id": 39, | 348 | "id": 39, |
| 349 | "name": "pages/reserve/detail 在线订座 ", | 349 | "name": "pages/reserve/detail 在线订座 ", |
| 350 | "pathName": "pages/reserve/detail", | 350 | "pathName": "pages/reserve/detail", |
| 351 | - "query": "id=1", | 351 | + "query": "id=999", |
| 352 | "scene": null | 352 | "scene": null |
| 353 | }, | 353 | }, |
| 354 | { | 354 | { |
-
Please register or login to post a comment