Commit 34157f00ee7507e4f947ecde350a3f292638fc77

Authored by vking
1 parent 93dd231f

shareImg 调整

Showing 1 changed file with 16 additions and 2 deletions
@@ -26,6 +26,7 @@ Page({ @@ -26,6 +26,7 @@ Page({
26 console.log('onLoad', options) 26 console.log('onLoad', options)
27 console.log('初次进入详情页---小米8测试',this.data.reserveDate ? this.data.reserveDate : '没有日期','openid:',getApp().openid) 27 console.log('初次进入详情页---小米8测试',this.data.reserveDate ? this.data.reserveDate : '没有日期','openid:',getApp().openid)
28 this.options=options 28 this.options=options
  29 + this.downloadImages()
29 if(options.activeTab && options.activeTab!='detail'){ 30 if(options.activeTab && options.activeTab!='detail'){
30 this.setData({ 31 this.setData({
31 activeTab:options.activeTab||'detail', 32 activeTab:options.activeTab||'detail',
@@ -136,15 +137,28 @@ Page({ @@ -136,15 +137,28 @@ Page({
136 onReachBottom: function () { 137 onReachBottom: function () {
137 138
138 }, 139 },
139 - 140 + shareImageTmp:'',
  141 + downloadImages(){
  142 + wx.downloadFile({
  143 + url:'https://xt04.colorcun.com/sellerShare/Share_'+this.options.id+'.png?'+Math.random(),
  144 + success:res=>{
  145 + this.shareImageTmp=res.tempFilePath
  146 + },
  147 + })
  148 + },
140 /** 149 /**
141 * 用户点击右上角分享 150 * 用户点击右上角分享
142 */ 151 */
143 onShareAppMessage: function () { 152 onShareAppMessage: function () {
144 let path=util.http_build_query({id:this.data.seller.id,fromid:getApp().openid},'/pages/reserve/detail') 153 let path=util.http_build_query({id:this.data.seller.id,fromid:getApp().openid},'/pages/reserve/detail')
  154 + let imageUrl=this.shareImageTmp
  155 + if(!imageUrl){
  156 + imageUrl='https://xt04.colorcun.com/sellerShare/Share_'+this.options.id+'.png?'+Math.random()
  157 + }
  158 + console.log('imageUrl',imageUrl)
145 return { 159 return {
146 title:'请客订包间,就上周到安排', 160 title:'请客订包间,就上周到安排',
147 - imageUrl:'https://xt04.colorcun.com/sellerShare/Share_'+this.options.id+'.png?'+Math.random(), 161 + imageUrl:imageUrl,
148 path:path, 162 path:path,
149 } 163 }
150 }, 164 },