Commit 488af917bea0bcace6b17265f232c5497bc53527
Merge remote-tracking branch 'remotes/origin/seller-share-img'
Showing
26 changed files
with
670 additions
and
19 deletions
.gitmodules
0 → 100644
| @@ -27,7 +27,8 @@ | @@ -27,7 +27,8 @@ | ||
| 27 | "pages/manager-invitation/setting/history", | 27 | "pages/manager-invitation/setting/history", |
| 28 | "pages/reserve/activity", | 28 | "pages/reserve/activity", |
| 29 | "pages/reserve/discount", | 29 | "pages/reserve/discount", |
| 30 | - "pages/reserve/indexList" | 30 | + "pages/reserve/indexList", |
| 31 | + "pages/reserve/share" | ||
| 31 | ], | 32 | ], |
| 32 | "subpackages": [ | 33 | "subpackages": [ |
| 33 | { | 34 | { |
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 | + seller_id:String, | ||
| 9 | + hasSellerShare:{ | ||
| 10 | + type:Boolean, | ||
| 11 | + value:false, | ||
| 12 | + } | ||
| 13 | + }, | ||
| 14 | + | ||
| 15 | + /** | ||
| 16 | + * 组件的初始数据 | ||
| 17 | + */ | ||
| 18 | + data: { | ||
| 19 | + hasShow:false, | ||
| 20 | + }, | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 组件的方法列表 | ||
| 24 | + */ | ||
| 25 | + methods: { | ||
| 26 | + show(){ | ||
| 27 | + this.setData({ | ||
| 28 | + hasShow:true, | ||
| 29 | + }) | ||
| 30 | + }, | ||
| 31 | + hide(){ | ||
| 32 | + this.setData({ | ||
| 33 | + hasShow:false, | ||
| 34 | + }) | ||
| 35 | + }, | ||
| 36 | + shareDo(e){ | ||
| 37 | + this.hide() | ||
| 38 | + let act=util.attr(e,'act'); | ||
| 39 | + if(!act) return; | ||
| 40 | + console.log('shareDo.'+act,e); | ||
| 41 | + wx.navigateTo({ | ||
| 42 | + url:util.http_build_query({ | ||
| 43 | + id:this.data.seller_id, | ||
| 44 | + act:act, | ||
| 45 | + hasSellerShare:this.data.hasSellerShare | ||
| 46 | + },'/pages/reserve/share') | ||
| 47 | + }) | ||
| 48 | + }, | ||
| 49 | + } | ||
| 50 | +}) |
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 | +} | ||
| 16 | +.share-img.wechat{ | ||
| 17 | + background-image: url("http://qn.colorcun.com/reserve/share/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201906251004331.png"); | ||
| 18 | +} | ||
| 19 | +.share-img.quanzi{ | ||
| 20 | + background-image: url("http://qn.colorcun.com/reserve/share/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20190625100433.png"); | ||
| 21 | +} | ||
| 22 | +.share-img.qrcode{ | ||
| 23 | + background-image: url("http://qn.colorcun.com/reserve/share/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201906251004332.png"); | ||
| 24 | +} | ||
| 25 | +.share-name{ | ||
| 26 | + margin-top: 20rpx; | ||
| 27 | + font-size: 30rpx; | ||
| 28 | + height: 42rpx; | ||
| 29 | + line-height: 42rpx; | ||
| 30 | + color: #353535; | ||
| 31 | +} | ||
| 32 | +.share-item{ | ||
| 33 | + min-width: 33%; | ||
| 34 | + width: 33%; | ||
| 35 | +} |
components/userinfo/savefile.js
0 → 100644
| 1 | +// component/menu/addDelete.js | ||
| 2 | +import util from '../../utils/util'; | ||
| 3 | +import App from '../../utils/api'; | ||
| 4 | + | ||
| 5 | +Component({ | ||
| 6 | + /** | ||
| 7 | + * 组件的属性列表 | ||
| 8 | + */ | ||
| 9 | + properties: { | ||
| 10 | + filePath:String, | ||
| 11 | + }, | ||
| 12 | + | ||
| 13 | + /** | ||
| 14 | + * 组件的初始数据 | ||
| 15 | + */ | ||
| 16 | + data: { | ||
| 17 | + | ||
| 18 | + }, | ||
| 19 | + attached(){ | ||
| 20 | + | ||
| 21 | + }, | ||
| 22 | + ready () { | ||
| 23 | + | ||
| 24 | + }, | ||
| 25 | + detached(){ | ||
| 26 | + | ||
| 27 | + }, | ||
| 28 | + /** | ||
| 29 | + * 组件的方法列表 | ||
| 30 | + */ | ||
| 31 | + methods: { | ||
| 32 | + saveFile(){ | ||
| 33 | + let filePath=this.data.filePath | ||
| 34 | + console.log('saveFile.filePath',filePath) | ||
| 35 | + wx.saveImageToPhotosAlbum({ | ||
| 36 | + filePath:filePath, | ||
| 37 | + complete:res=>{ | ||
| 38 | + console.log(res,filePath) | ||
| 39 | + }, | ||
| 40 | + success:res=>{ | ||
| 41 | + util.toast('已保存到相册') | ||
| 42 | + }, | ||
| 43 | + fail:(efail)=>{ | ||
| 44 | + console.log('saveImageToPhotosAlbum.fail',efail) | ||
| 45 | + wx.showModal({ | ||
| 46 | + title: '授权提示', | ||
| 47 | + content: '您拒绝了保存文件,请点击确定打开授权', | ||
| 48 | + confirmColor: '#199095', | ||
| 49 | + cancelColor: '#999', | ||
| 50 | + success: function (res) { | ||
| 51 | + if (res.confirm) { | ||
| 52 | + util.setting(); | ||
| 53 | + } | ||
| 54 | + } | ||
| 55 | + }) | ||
| 56 | + }, | ||
| 57 | + }) | ||
| 58 | + }, | ||
| 59 | + } | ||
| 60 | +}) |
components/userinfo/savefile.json
0 → 100644
components/userinfo/savefile.wxml
0 → 100644
components/userinfo/savefile.wxss
0 → 100644
| 1 | +@import "../../app.wxss"; |
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | </button> | 4 | </button> |
| 5 | </block> | 5 | </block> |
| 6 | <block wx:else=""> | 6 | <block wx:else=""> |
| 7 | - <formids bindclick="setUserInfoSuccess" catchtap="catchtap"> | 7 | + <formids bindclick="setUserInfoSuccess" catchtap="catchtap" style="width: 100%;"> |
| 8 | <slot></slot> | 8 | <slot></slot> |
| 9 | </formids> | 9 | </formids> |
| 10 | </block> | 10 | </block> |
| @@ -67,9 +67,30 @@ Page({ | @@ -67,9 +67,30 @@ Page({ | ||
| 67 | onHide: function () { | 67 | onHide: function () { |
| 68 | 68 | ||
| 69 | }, | 69 | }, |
| 70 | + onShareAppMessage: function () { | ||
| 71 | + let path=util.http_build_query( | ||
| 72 | + { | ||
| 73 | + id:this.data.seller.id, | ||
| 74 | + fromid:getApp().openid, | ||
| 75 | + hasSellerShare:true, | ||
| 76 | + },'/pages/reserve/detail') | ||
| 77 | + return { | ||
| 78 | + title:'请客订包间,就上一键订', | ||
| 79 | + imageUrl:'https://xt04.colorcun.com/sellerShare/Share_'+this.data.seller.id+'.png?'+Math.random(), | ||
| 80 | + path: path, | ||
| 81 | + } | ||
| 82 | + }, | ||
| 70 | NewCustomer(e){ | 83 | NewCustomer(e){ |
| 71 | this.setData({ | 84 | this.setData({ |
| 72 | NewCustomerTotal:e.detail.total | 85 | NewCustomerTotal:e.detail.total |
| 73 | }) | 86 | }) |
| 74 | - } | 87 | + }, |
| 88 | + shareDisplay(){ | ||
| 89 | + this.selectComponent('#share').show() | ||
| 90 | + }, | ||
| 91 | + gotoSellerShop(){ | ||
| 92 | + wx.navigateTo({ | ||
| 93 | + url:util.http_build_query({id:this.data.seller.id},'/pages/reserve/detail') | ||
| 94 | + }) | ||
| 95 | + }, | ||
| 75 | }) | 96 | }) |
| @@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | "nav":"/components/nav/nav", | 6 | "nav":"/components/nav/nav", |
| 7 | "tabBar":"../../../components/book/tabBar/tabBar", | 7 | "tabBar":"../../../components/book/tabBar/tabBar", |
| 8 | - "formids":"/components/formids/formids" | 8 | + "formids":"/components/formids/formids", |
| 9 | + "share":"/components/reserve/share/share" | ||
| 9 | } | 10 | } |
| 10 | } | 11 | } |
| 1 | <!--pages/book/setting/index.wxml--> | 1 | <!--pages/book/setting/index.wxml--> |
| 2 | <nav id="nav" backgroundColor="#199095" color="#fefefe">订座</nav> | 2 | <nav id="nav" backgroundColor="#199095" color="#fefefe">订座</nav> |
| 3 | -<view class="header"> | 3 | +<view class="header flex-lr"> |
| 4 | <view class="info"> | 4 | <view class="info"> |
| 5 | - <view class="nick">{{user.nick_name || user.nickname}}</view> | ||
| 6 | - <view class="seller Medium">{{seller.sellername}} | {{user.role_name||''}}</view> | 5 | + <view class="nick flex-lr"> |
| 6 | + <view bindtap="gotoSellerShop">{{seller.sellername}}</view> | ||
| 7 | + <view class="share-but" bindtap="shareDisplay"></view> | ||
| 8 | + </view> | ||
| 9 | + <view class="seller Medium">{{user.nick_name || user.nickname}} | {{user.role_name||''}}</view> | ||
| 7 | </view> | 10 | </view> |
| 8 | </view> | 11 | </view> |
| 9 | <view class="page"> | 12 | <view class="page"> |
| @@ -59,3 +62,4 @@ | @@ -59,3 +62,4 @@ | ||
| 59 | </formids> | 62 | </formids> |
| 60 | </view> | 63 | </view> |
| 61 | <tabBar bindNewCustomer="NewCustomer" id="tabBar"></tabBar> | 64 | <tabBar bindNewCustomer="NewCustomer" id="tabBar"></tabBar> |
| 65 | +<share id="share" seller_id="{{seller.id}}" hasSellerShare="{{true}}"></share> |
| @@ -4,15 +4,15 @@ http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png | @@ -4,15 +4,15 @@ http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png | ||
| 4 | http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png | 4 | http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png |
| 5 | */ | 5 | */ |
| 6 | .header{ | 6 | .header{ |
| 7 | - height: 302rpx; | ||
| 8 | background-color: #199095; | 7 | background-color: #199095; |
| 9 | margin-top: -2rpx; | 8 | margin-top: -2rpx; |
| 10 | } | 9 | } |
| 11 | .header .info{ | 10 | .header .info{ |
| 12 | color:#FEFEFE; | 11 | color:#FEFEFE; |
| 13 | width: 90%; | 12 | width: 90%; |
| 14 | - padding-top: 86rpx; | 13 | + padding-top: 66rpx; |
| 15 | margin: 0 auto; | 14 | margin: 0 auto; |
| 15 | + padding-bottom: 80rpx; | ||
| 16 | } | 16 | } |
| 17 | .header .info .nick{ | 17 | .header .info .nick{ |
| 18 | font-size: 44rpx; | 18 | font-size: 44rpx; |
| @@ -43,4 +43,11 @@ http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png | @@ -43,4 +43,11 @@ http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png | ||
| 43 | } | 43 | } |
| 44 | .row .more{ | 44 | .row .more{ |
| 45 | margin-left: 20rpx; | 45 | margin-left: 20rpx; |
| 46 | +} | ||
| 47 | +.share-but{ | ||
| 48 | + background-image: url("http://qn.colorcun.com/reserve/share/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20190625162307.png"); | ||
| 49 | + width: 52rpx; | ||
| 50 | + height: 52rpx; | ||
| 51 | + background-size: 100% 100%; | ||
| 52 | + min-width: 52rpx; | ||
| 46 | } | 53 | } |
| @@ -30,6 +30,7 @@ Page({ | @@ -30,6 +30,7 @@ Page({ | ||
| 30 | IsCollectionSeller:res.data, | 30 | IsCollectionSeller:res.data, |
| 31 | }) | 31 | }) |
| 32 | }) | 32 | }) |
| 33 | + this.SetRelaOpenid(); | ||
| 33 | }, | 34 | }, |
| 34 | GetSellerDetail(){ | 35 | GetSellerDetail(){ |
| 35 | let options=this.options | 36 | let options=this.options |
| @@ -110,9 +111,11 @@ Page({ | @@ -110,9 +111,11 @@ Page({ | ||
| 110 | * 用户点击右上角分享 | 111 | * 用户点击右上角分享 |
| 111 | */ | 112 | */ |
| 112 | onShareAppMessage: function () { | 113 | onShareAppMessage: function () { |
| 114 | + let path=util.http_build_query({id:this.data.seller.id,fromid:getApp().openid},'/pages/reserve/detail') | ||
| 113 | return { | 115 | return { |
| 114 | title:'请客订包间,就上一键订', | 116 | title:'请客订包间,就上一键订', |
| 115 | imageUrl:'https://xt04.colorcun.com/sellerShare/Share_'+this.options.id+'.png?'+Math.random(), | 117 | imageUrl:'https://xt04.colorcun.com/sellerShare/Share_'+this.options.id+'.png?'+Math.random(), |
| 118 | + path:path, | ||
| 116 | } | 119 | } |
| 117 | }, | 120 | }, |
| 118 | reserve(){ | 121 | reserve(){ |
| @@ -212,11 +215,22 @@ Page({ | @@ -212,11 +215,22 @@ Page({ | ||
| 212 | }) | 215 | }) |
| 213 | }, | 216 | }, |
| 214 | shareUserinfo(){ | 217 | shareUserinfo(){ |
| 215 | - util.toast('授权成功,请继续分享','none'); | 218 | + //util.toast('授权成功,请继续分享','none'); |
| 219 | + this.selectComponent('#share').show() | ||
| 216 | }, | 220 | }, |
| 217 | bindtransition(e){ | 221 | bindtransition(e){ |
| 218 | this.setData({ | 222 | this.setData({ |
| 219 | currentView:e.detail.current+1 | 223 | currentView:e.detail.current+1 |
| 220 | }) | 224 | }) |
| 221 | }, | 225 | }, |
| 226 | + async SetRelaOpenid(){ | ||
| 227 | + if(!this.options.fromid) return; | ||
| 228 | + let openid=await getApp().getOpenid() | ||
| 229 | + App.Reserve.SetRelaOpenid({ | ||
| 230 | + openid:openid, | ||
| 231 | + fromid:this.options.fromid, | ||
| 232 | + sid:this.options.id, | ||
| 233 | + sub:this.options.hasSellerShare?2:3,//关系类型:1/2/3 邀请关系/商户端分享关系/C端分享关系 | ||
| 234 | + }) | ||
| 235 | + }, | ||
| 222 | }) | 236 | }) |
| @@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
| 10 | "as":"/components/actionSheet/index", | 10 | "as":"/components/actionSheet/index", |
| 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 | + "share":"/components/reserve/share/share" | ||
| 14 | } | 15 | } |
| 15 | } | 16 | } |
| @@ -148,16 +148,18 @@ | @@ -148,16 +148,18 @@ | ||
| 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> | ||
| 165 | +<share id="share" seller_id="{{seller.id}}"></share> |
pages/reserve/share.js
0 → 100644
| 1 | +// pages/reserve/share.js | ||
| 2 | +import util from '../../utils/util'; | ||
| 3 | +import App from '../../utils/api'; | ||
| 4 | +const {regeneratorRuntime} = global | ||
| 5 | +Page({ | ||
| 6 | + | ||
| 7 | + /** | ||
| 8 | + * 页面的初始数据 | ||
| 9 | + */ | ||
| 10 | + data: { | ||
| 11 | + seller:{}, | ||
| 12 | + paletteImageSrc:'', | ||
| 13 | + palette:null, | ||
| 14 | + hasLoadData:false, | ||
| 15 | + act:'', | ||
| 16 | + hasActName:'', | ||
| 17 | + hasSellerShare:false, | ||
| 18 | + }, | ||
| 19 | + /** | ||
| 20 | + * 生命周期函数--监听页面加载 | ||
| 21 | + */ | ||
| 22 | + onLoad: function (options) { | ||
| 23 | + this.options=options; | ||
| 24 | + this.setData({ | ||
| 25 | + actType:options.act, | ||
| 26 | + hasSellerShare:options.hasSellerShare||false, | ||
| 27 | + }) | ||
| 28 | + this.GetSellerDetail(); | ||
| 29 | + }, | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 生命周期函数--监听页面初次渲染完成 | ||
| 33 | + */ | ||
| 34 | + onReady: function () { | ||
| 35 | + | ||
| 36 | + }, | ||
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * 生命周期函数--监听页面显示 | ||
| 40 | + */ | ||
| 41 | + onShow: function () { | ||
| 42 | + | ||
| 43 | + }, | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * 生命周期函数--监听页面隐藏 | ||
| 47 | + */ | ||
| 48 | + onHide: function () { | ||
| 49 | + | ||
| 50 | + }, | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * 生命周期函数--监听页面卸载 | ||
| 54 | + */ | ||
| 55 | + onUnload: function () { | ||
| 56 | + | ||
| 57 | + }, | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
| 61 | + */ | ||
| 62 | + onPullDownRefresh: function () { | ||
| 63 | + | ||
| 64 | + }, | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * 页面上拉触底事件的处理函数 | ||
| 68 | + */ | ||
| 69 | + onReachBottom: function () { | ||
| 70 | + | ||
| 71 | + }, | ||
| 72 | + GetSellerDetail(){ | ||
| 73 | + let options=this.options | ||
| 74 | + App.Customer.GetSellerDetail({ | ||
| 75 | + sid:options.id, | ||
| 76 | + }).then(async res=>{ | ||
| 77 | + if(res.ret==200){ | ||
| 78 | + let seller=res.data | ||
| 79 | + console.log('App',App) | ||
| 80 | + let openid=await getApp().getOpenid() | ||
| 81 | + let qrcode=await App.Other.generate_qrcode({ | ||
| 82 | + tpl_id: 25415, | ||
| 83 | + code_type: 'wxcode', | ||
| 84 | + 'param_value[0]':options.id, | ||
| 85 | + 'param_value[1]':openid, | ||
| 86 | + 'param_value[2]':this.options.hasSellerShare | ||
| 87 | + }); | ||
| 88 | + this.setData({ | ||
| 89 | + seller:seller, | ||
| 90 | + qrcode:qrcode.data.replace('http://','https://'), | ||
| 91 | + hasLoadData:true, | ||
| 92 | + }) | ||
| 93 | + setTimeout(()=>{ | ||
| 94 | + this.initImage() | ||
| 95 | + },0); | ||
| 96 | + } | ||
| 97 | + }) | ||
| 98 | + }, | ||
| 99 | + initImage(){ | ||
| 100 | + let palette={} | ||
| 101 | + if(this.options.act=='quanzi'){ | ||
| 102 | + let seller=this.data.seller | ||
| 103 | + let pw=getApp().system.windowWidth-20; | ||
| 104 | + let ph=pw/355*558; | ||
| 105 | + let tagsHeight=60//rpx | ||
| 106 | + if(seller.activity.length==0){ | ||
| 107 | + ph=pw/355*500; | ||
| 108 | + } | ||
| 109 | + let cai_jiu_bao=[]//菜酒包 | ||
| 110 | + if(seller.cate.length>0){ | ||
| 111 | + cai_jiu_bao.push(seller.cate[0]) | ||
| 112 | + } | ||
| 113 | + cai_jiu_bao.push(seller.is_belt_wine==1?'不可带酒水':'可自带酒水'); | ||
| 114 | + if(seller.room_num>0){ | ||
| 115 | + cai_jiu_bao.push(seller.room_num+'个包间') | ||
| 116 | + } | ||
| 117 | + cai_jiu_bao=cai_jiu_bao.join(' | ') | ||
| 118 | + let tags=[]; | ||
| 119 | + tags=tags.join(' | ') | ||
| 120 | + if(!tags){ | ||
| 121 | + ph=ph-tagsHeight/2 | ||
| 122 | + tagsHeight=0 | ||
| 123 | + } | ||
| 124 | + let share_image=seller.share_image | ||
| 125 | + .replace('http://','https://') | ||
| 126 | + +'?imageView2/1/w/750/h/500/q/100' | ||
| 127 | + console.log('share_image:',share_image) | ||
| 128 | + palette={ | ||
| 129 | + background: '#fff', | ||
| 130 | + width: pw+'px', | ||
| 131 | + height: ph+'px', | ||
| 132 | + views: [ | ||
| 133 | + { | ||
| 134 | + type:'image', | ||
| 135 | + url:share_image, | ||
| 136 | + css:{ | ||
| 137 | + width:pw+'px', | ||
| 138 | + height:470+'rpx', | ||
| 139 | + mode:'aspectFill' | ||
| 140 | + } | ||
| 141 | + }, | ||
| 142 | + { | ||
| 143 | + type:'text', | ||
| 144 | + text: seller.sellername, | ||
| 145 | + id:'seller-name', | ||
| 146 | + css:{ | ||
| 147 | + fontSize:'36rpx', | ||
| 148 | + color:'#353535', | ||
| 149 | + top:520+'rpx', | ||
| 150 | + left:'30rpx', | ||
| 151 | + fontWeight:'bold', | ||
| 152 | + } | ||
| 153 | + }, | ||
| 154 | + { | ||
| 155 | + type:'text', | ||
| 156 | + text: seller.rank, | ||
| 157 | + css:{ | ||
| 158 | + fontSize:'20rpx', | ||
| 159 | + color:'#ffffff', | ||
| 160 | + top:531+'rpx', | ||
| 161 | + left:['60rpx', 'seller-name', 1] , | ||
| 162 | + background:'#F57E32', | ||
| 163 | + padding:'2rpx 8rpx', | ||
| 164 | + lineHeight:'28rpx' | ||
| 165 | + } | ||
| 166 | + }, | ||
| 167 | + { | ||
| 168 | + type:'text', | ||
| 169 | + text: cai_jiu_bao, | ||
| 170 | + css:{ | ||
| 171 | + fontSize:'26rpx', | ||
| 172 | + color:'#999999', | ||
| 173 | + top: '578rpx', | ||
| 174 | + left: '30rpx', | ||
| 175 | + } | ||
| 176 | + }, | ||
| 177 | + { | ||
| 178 | + type:'text', | ||
| 179 | + text: tags, | ||
| 180 | + css:{ | ||
| 181 | + fontSize:'22rpx', | ||
| 182 | + color:'#C0A369', | ||
| 183 | + top: '638rpx', | ||
| 184 | + left: '42rpx', | ||
| 185 | + background:'#FFEFDF', | ||
| 186 | + lineHeight:'28rpx', | ||
| 187 | + padding:'10rpx 12rpx', | ||
| 188 | + } | ||
| 189 | + }, | ||
| 190 | + { | ||
| 191 | + type:'rect', | ||
| 192 | + css:{ | ||
| 193 | + color:'#F5F5F5', | ||
| 194 | + top:(634+tagsHeight)+'rpx', | ||
| 195 | + left:'30rpx', | ||
| 196 | + width:(pw-30)+'px', | ||
| 197 | + height:'1px' | ||
| 198 | + } | ||
| 199 | + }, | ||
| 200 | + /* | ||
| 201 | + { | ||
| 202 | + type:'text', | ||
| 203 | + text: "陕西风味面馆", | ||
| 204 | + css:{ | ||
| 205 | + fontSize:'14px', | ||
| 206 | + color:'#f00', | ||
| 207 | + background:'#ff0', | ||
| 208 | + padding:'8px 20px', | ||
| 209 | + top:(480*(getApp().system.windowWidth/600)+20)+'px', | ||
| 210 | + left:'16px', | ||
| 211 | + lineHeight:'18px' | ||
| 212 | + } | ||
| 213 | + }, | ||
| 214 | + { | ||
| 215 | + type:'rect', | ||
| 216 | + css:{ | ||
| 217 | + color:'rgba(0,0,0,0.5)', | ||
| 218 | + top:(480*(getApp().system.windowWidth/600)+12)+'px', | ||
| 219 | + left:'0px', | ||
| 220 | + width:'320px', | ||
| 221 | + height:'34px' | ||
| 222 | + } | ||
| 223 | + }, | ||
| 224 | + */ | ||
| 225 | + { | ||
| 226 | + type: 'image', | ||
| 227 | + url: this.data.qrcode, | ||
| 228 | + css: { | ||
| 229 | + bottom: '112rpx', | ||
| 230 | + left: (pw / 2) + 'px', | ||
| 231 | + width: '140rpx', | ||
| 232 | + height: '140rpx', | ||
| 233 | + align: 'center', | ||
| 234 | + }, | ||
| 235 | + }, | ||
| 236 | + { | ||
| 237 | + type:'text', | ||
| 238 | + text: '长按或扫描二维码,预订、导航', | ||
| 239 | + css:{ | ||
| 240 | + fontSize:'22rpx', | ||
| 241 | + color:'#999999', | ||
| 242 | + bottom: '50rpx', | ||
| 243 | + left: (pw / 2) + 'px', | ||
| 244 | + align: 'center', | ||
| 245 | + } | ||
| 246 | + }, | ||
| 247 | + ], | ||
| 248 | + } | ||
| 249 | + if(seller.activity.length>0){ | ||
| 250 | + //活动 | ||
| 251 | + let activity=[]; | ||
| 252 | + seller.activity.forEach(act=>{ | ||
| 253 | + activity.push(act.title) | ||
| 254 | + }) | ||
| 255 | + activity='活动: '+activity.join(' | ') | ||
| 256 | + palette.views.push({ | ||
| 257 | + type:'text', | ||
| 258 | + text: activity, | ||
| 259 | + css:{ | ||
| 260 | + fontSize:'30rpx', | ||
| 261 | + color:'#353535', | ||
| 262 | + top: (676+tagsHeight)+'rpx', | ||
| 263 | + left: '30rpx', | ||
| 264 | + lineHeight:'38rpx', | ||
| 265 | + maxLines:1, | ||
| 266 | + width:(pw-30)+'px', | ||
| 267 | + } | ||
| 268 | + }); | ||
| 269 | + palette.views.push({ | ||
| 270 | + type:'rect', | ||
| 271 | + css:{ | ||
| 272 | + color:'#F5F5F5', | ||
| 273 | + top:(754+tagsHeight)+'rpx', | ||
| 274 | + left:'30rpx', | ||
| 275 | + width:(pw-30)+'px', | ||
| 276 | + height:'1px' | ||
| 277 | + } | ||
| 278 | + }); | ||
| 279 | + } | ||
| 280 | + }else{ | ||
| 281 | + palette={ | ||
| 282 | + background: '#fff', | ||
| 283 | + width: '400rpx', | ||
| 284 | + height: '400rpx', | ||
| 285 | + views: [ | ||
| 286 | + { | ||
| 287 | + type: 'image', | ||
| 288 | + url: this.data.qrcode, | ||
| 289 | + css: { | ||
| 290 | + mode:'scaleToFill', | ||
| 291 | + width: '400rpx', | ||
| 292 | + height: '400rpx', | ||
| 293 | + }, | ||
| 294 | + } | ||
| 295 | + ], | ||
| 296 | + } | ||
| 297 | + } | ||
| 298 | + this.setData({ | ||
| 299 | + palette:palette | ||
| 300 | + }) | ||
| 301 | + }, | ||
| 302 | + onImgOK(e){ | ||
| 303 | + console.log('onImgOK',e.detail.path) | ||
| 304 | + wx.getImageInfo({ | ||
| 305 | + src:e.detail.path, | ||
| 306 | + success:res=>{ | ||
| 307 | + let w=getApp().system.windowWidth-24 | ||
| 308 | + console.log('getImageInfo',res) | ||
| 309 | + this.setData({ | ||
| 310 | + paletteImageWidth:w, | ||
| 311 | + paletteImageHeight:w/res.width*res.height, | ||
| 312 | + paletteImageSrc:e.detail.path, | ||
| 313 | + }) | ||
| 314 | + } | ||
| 315 | + }) | ||
| 316 | + }, | ||
| 317 | + reviewImage(){ | ||
| 318 | + wx.previewImage({ | ||
| 319 | + urls:[this.data.paletteImageSrc], | ||
| 320 | + }) | ||
| 321 | + } | ||
| 322 | +}) |
pages/reserve/share.json
0 → 100644
pages/reserve/share.wxml
0 → 100644
| 1 | +<!--pages/reserve/share.wxml--> | ||
| 2 | +<nav>{{actType=='quanzi'?'分享图':'二维码下载'}}</nav> | ||
| 3 | +<loading wx:if="{{!hasLoadData || !paletteImageSrc}}">图片生成中</loading> | ||
| 4 | +<view wx:if="{{hasLoadData}}" style="position: fixed;top:-9999rpx;"> | ||
| 5 | + <painter palette="{{palette}}" bind:imgOK="onImgOK" bind:imgErr="onImgOK"/> | ||
| 6 | +</view> | ||
| 7 | +<view wx:if="{{paletteImageSrc}}" class="pages"> | ||
| 8 | + <view class="pages-view" wx:if="{{actType=='quanzi'}}"> | ||
| 9 | + <image src="{{paletteImageSrc}}" | ||
| 10 | + bindtap="reviewImage" | ||
| 11 | + style="width:{{paletteImageWidth}}px;height:{{paletteImageHeight}}px;"></image> | ||
| 12 | + </view> | ||
| 13 | + <view class="pages-view flex-vc" wx:else=""> | ||
| 14 | + <image src="{{paletteImageSrc}}" | ||
| 15 | + bindtap="reviewImage" | ||
| 16 | + style="width:400rpx;height:400rpx; margin-top: 90rpx;"></image> | ||
| 17 | + <view class="qrcode-text">{{seller.sellername}}</view> | ||
| 18 | + </view> | ||
| 19 | + <view class="save"> | ||
| 20 | + <savefile filePath="{{paletteImageSrc}}"> | ||
| 21 | + <view class="save-but {{hasSellerShare?'sellerShare':''}} flex-cc"> | ||
| 22 | + <view class="save-but-icon"></view> | ||
| 23 | + <view class="save-but-text">保存到相册</view> | ||
| 24 | + </view> | ||
| 25 | + </savefile> | ||
| 26 | + </view> | ||
| 27 | +</view> | ||
| 28 | + |
pages/reserve/share.wxss
0 → 100644
| 1 | +/* pages/reserve/share.wxss */ | ||
| 2 | +page{ | ||
| 3 | + background-color: #EEF2F2; | ||
| 4 | +} | ||
| 5 | +.pages{ | ||
| 6 | + padding-bottom: 160rpx; | ||
| 7 | + width: 100%; | ||
| 8 | + padding-top: 20rpx; | ||
| 9 | +} | ||
| 10 | +.pages-view{ | ||
| 11 | + width: calc(100% - 24px); | ||
| 12 | + margin: 0 auto; | ||
| 13 | + background-color: #fefefe; | ||
| 14 | +} | ||
| 15 | +.save{ | ||
| 16 | + position: fixed; | ||
| 17 | + bottom: 0; | ||
| 18 | + width: 100%; | ||
| 19 | +} | ||
| 20 | +.save-but{ | ||
| 21 | + width: calc(100% - 24px); | ||
| 22 | + height: 100rpx; | ||
| 23 | + margin: 0 auto 30rpx; | ||
| 24 | + background-color: #C0A369; | ||
| 25 | + font-size: 32rpx; | ||
| 26 | + color: #fefefe; | ||
| 27 | + border-radius: 10rpx; | ||
| 28 | +} | ||
| 29 | +.save-but.sellerShare{ | ||
| 30 | + background-color: #199095; | ||
| 31 | +} | ||
| 32 | +.save-but-icon{ | ||
| 33 | + width: 40rpx; | ||
| 34 | + height: 40rpx; | ||
| 35 | + background-size: 100% 100%; | ||
| 36 | + background-image: url("http://qn.colorcun.com/reserve/share/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201906251004333.png"); | ||
| 37 | +} | ||
| 38 | +.save-but-text{ | ||
| 39 | + height:40rpx; | ||
| 40 | + line-height: 40rpx; | ||
| 41 | + margin-left: 20rpx; | ||
| 42 | +} | ||
| 43 | +.qrcode-text{ | ||
| 44 | + font-size: 34rpx; | ||
| 45 | + margin-top: 40rpx; | ||
| 46 | + margin-bottom: 90rpx; | ||
| 47 | +} |
| @@ -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, |
| @@ -221,7 +221,7 @@ | @@ -221,7 +221,7 @@ | ||
| 221 | }, | 221 | }, |
| 222 | { | 222 | { |
| 223 | "id": -1, | 223 | "id": -1, |
| 224 | - "name": "预订本-设置", | 224 | + "name": "pack-book/pages/book/setting/index 预订本-设置", |
| 225 | "pathName": "pack-book/pages/book/setting/index", | 225 | "pathName": "pack-book/pages/book/setting/index", |
| 226 | "query": "", | 226 | "query": "", |
| 227 | "scene": "1001" | 227 | "scene": "1001" |
| @@ -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&fromid=22222", |
| 352 | "scene": null | 352 | "scene": null |
| 353 | }, | 353 | }, |
| 354 | { | 354 | { |
| @@ -448,6 +448,13 @@ | @@ -448,6 +448,13 @@ | ||
| 448 | "pathName": "pack-book/pages/book/b_desk", | 448 | "pathName": "pack-book/pages/book/b_desk", |
| 449 | "query": "rdate=1559617200-1559631600&tid=0&pnum=6&checked_tids=760,761&rid=", | 449 | "query": "rdate=1559617200-1559631600&tid=0&pnum=6&checked_tids=760,761&rid=", |
| 450 | "scene": null | 450 | "scene": null |
| 451 | + }, | ||
| 452 | + { | ||
| 453 | + "id": 54, | ||
| 454 | + "name": "pages/reserve/share 在线订座 ", | ||
| 455 | + "pathName": "pages/reserve/share", | ||
| 456 | + "query": "id=1&act=quanzi", | ||
| 457 | + "scene": null | ||
| 451 | } | 458 | } |
| 452 | ] | 459 | ] |
| 453 | } | 460 | } |
| @@ -4,7 +4,7 @@ export default { | @@ -4,7 +4,7 @@ export default { | ||
| 4 | silence: true, //静默,不带loading; 默认 true 不带loading | 4 | silence: true, //静默,不带loading; 默认 true 不带loading |
| 5 | cachetime: 0, //缓存 0无,-1永久,86400秒; 默认 0 不缓存 | 5 | cachetime: 0, //缓存 0无,-1永久,86400秒; 默认 0 不缓存 |
| 6 | timeout: 2000, //接口超时时间,默认2s | 6 | timeout: 2000, //接口超时时间,默认2s |
| 7 | - host: '', //默认空使用04服务器,测试填写 'https://xt05.colorcun.com/?s=' | 7 | + host: '', //默认空使用04服务器,测试填写 'https://xt05.colorcun.com:10006/?s=' |
| 8 | alias: 'App.TestManagement.TestReal', //真实接口名称,默认为空 | 8 | alias: 'App.TestManagement.TestReal', //真实接口名称,默认为空 |
| 9 | }, | 9 | }, |
| 10 | 10 | ||
| @@ -249,4 +249,10 @@ export default { | @@ -249,4 +249,10 @@ export default { | ||
| 249 | openid:'openid', | 249 | openid:'openid', |
| 250 | cachetime: 60, | 250 | cachetime: 60, |
| 251 | }, | 251 | }, |
| 252 | + | ||
| 253 | + //获得小程序码 | ||
| 254 | + 'App.Other.generate_qrcode':{ | ||
| 255 | + host: 'https://cli.im/mina/', | ||
| 256 | + alias:'generate_qrcode' | ||
| 257 | + } | ||
| 252 | } | 258 | } |
| @@ -768,7 +768,7 @@ module.exports = { | @@ -768,7 +768,7 @@ module.exports = { | ||
| 768 | http_build_query(obj,url=''){ | 768 | http_build_query(obj,url=''){ |
| 769 | let ps=[] | 769 | let ps=[] |
| 770 | for(let i in obj){ | 770 | for(let i in obj){ |
| 771 | - if(typeof obj[i]=='undefined' || obj[i]==null) continue; | 771 | + if(typeof obj[i]=='undefined' || obj[i]==null || obj[i]===false) continue; |
| 772 | ps.push(i+'='+obj[i].toString()) | 772 | ps.push(i+'='+obj[i].toString()) |
| 773 | } | 773 | } |
| 774 | ps=ps.join('&'); | 774 | ps=ps.join('&'); |
-
Please register or login to post a comment