Showing
7 changed files
with
50 additions
and
26 deletions
| @@ -9,7 +9,11 @@ Component({ | @@ -9,7 +9,11 @@ Component({ | ||
| 9 | hasSellerShare:{ | 9 | hasSellerShare:{ |
| 10 | type:Boolean, | 10 | type:Boolean, |
| 11 | value:false, | 11 | value:false, |
| 12 | - } | 12 | + }, |
| 13 | + seller:{ | ||
| 14 | + type:Object, | ||
| 15 | + value:{}, | ||
| 16 | + }, | ||
| 13 | }, | 17 | }, |
| 14 | 18 | ||
| 15 | /** | 19 | /** |
| @@ -17,8 +21,17 @@ Component({ | @@ -17,8 +21,17 @@ Component({ | ||
| 17 | */ | 21 | */ |
| 18 | data: { | 22 | data: { |
| 19 | hasShow:false, | 23 | hasShow:false, |
| 24 | + product:null, | ||
| 25 | + }, | ||
| 26 | + lifetimes: { | ||
| 27 | + attached: function () { | ||
| 28 | + this.formatProduct() | ||
| 29 | + }, | ||
| 30 | + moved: function () { | ||
| 31 | + }, | ||
| 32 | + detached: function () { | ||
| 33 | + }, | ||
| 20 | }, | 34 | }, |
| 21 | - | ||
| 22 | /** | 35 | /** |
| 23 | * 组件的方法列表 | 36 | * 组件的方法列表 |
| 24 | */ | 37 | */ |
| @@ -46,5 +59,25 @@ Component({ | @@ -46,5 +59,25 @@ Component({ | ||
| 46 | },'/pages/reserve/share') | 59 | },'/pages/reserve/share') |
| 47 | }) | 60 | }) |
| 48 | }, | 61 | }, |
| 62 | + formatProduct(){ | ||
| 63 | + let seller=this.data.seller | ||
| 64 | + let product= { | ||
| 65 | + item_code:seller.id+"", | ||
| 66 | + title:seller.sellername, | ||
| 67 | + desc:seller.slogan, | ||
| 68 | + category_list:seller.cate, | ||
| 69 | + image_list:seller.envi_image, | ||
| 70 | + src_mini_program_path:'/pages/reserve/detail?id='+seller.id+'&from=haowu', | ||
| 71 | + brand_info:{ | ||
| 72 | + name:seller.sellername, | ||
| 73 | + logo:seller.seller_image, | ||
| 74 | + phone:seller.seller_tel, | ||
| 75 | + }, | ||
| 76 | + sku_list:[], | ||
| 77 | + } | ||
| 78 | + this.setData({ | ||
| 79 | + product:product, | ||
| 80 | + }) | ||
| 81 | + }, | ||
| 49 | } | 82 | } |
| 50 | }) | 83 | }) |
| @@ -13,5 +13,11 @@ | @@ -13,5 +13,11 @@ | ||
| 13 | <image class="share-img qrcode"></image> | 13 | <image class="share-img qrcode"></image> |
| 14 | <view class="share-name">二维码</view> | 14 | <view class="share-name">二维码</view> |
| 15 | </view> | 15 | </view> |
| 16 | + <view class="share-item flex-vc" catchtap="shareDo" data-act="qrcode"> | ||
| 17 | + <share-button type="3" fore-color="#dd6" product="{{product}}" style="height: 100rpx;"> | ||
| 18 | + <image class="share-img hwq"></image> | ||
| 19 | + </share-button> | ||
| 20 | + <view class="share-name">好物圈</view> | ||
| 21 | + </view> | ||
| 16 | </view> | 22 | </view> |
| 17 | </view> | 23 | </view> |
| @@ -22,6 +22,9 @@ | @@ -22,6 +22,9 @@ | ||
| 22 | .share-img.qrcode{ | 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"); | 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 | } | 24 | } |
| 25 | +.share-img.hwq{ | ||
| 26 | + background-image: url("http://qn.colorcun.com/reserve/images/hwq.png"); | ||
| 27 | +} | ||
| 25 | .share-name{ | 28 | .share-name{ |
| 26 | margin-top: 20rpx; | 29 | margin-top: 20rpx; |
| 27 | font-size: 30rpx; | 30 | font-size: 30rpx; |
| @@ -30,6 +33,6 @@ | @@ -30,6 +33,6 @@ | ||
| 30 | color: #353535; | 33 | color: #353535; |
| 31 | } | 34 | } |
| 32 | .share-item{ | 35 | .share-item{ |
| 33 | - min-width: 33%; | ||
| 34 | - width: 33%; | 36 | + min-width: 25%; |
| 37 | + width: 25%; | ||
| 35 | } | 38 | } |
| @@ -17,7 +17,6 @@ Page({ | @@ -17,7 +17,6 @@ Page({ | ||
| 17 | hasOnlineReserve:false, | 17 | hasOnlineReserve:false, |
| 18 | activeTab:'detail', | 18 | activeTab:'detail', |
| 19 | hasFullHouse:false,//满房 | 19 | hasFullHouse:false,//满房 |
| 20 | - product:{}, | ||
| 21 | }, | 20 | }, |
| 22 | 21 | ||
| 23 | /** | 22 | /** |
| @@ -79,27 +78,10 @@ Page({ | @@ -79,27 +78,10 @@ Page({ | ||
| 79 | this.setData({ | 78 | this.setData({ |
| 80 | seller:seller, | 79 | seller:seller, |
| 81 | hasOnlineReserve:seller.is_online_reserve==1, | 80 | hasOnlineReserve:seller.is_online_reserve==1, |
| 82 | - product:this.formatProduct(res.data) | ||
| 83 | }) | 81 | }) |
| 84 | } | 82 | } |
| 85 | }) | 83 | }) |
| 86 | }, | 84 | }, |
| 87 | - formatProduct(seller){ | ||
| 88 | - return { | ||
| 89 | - item_code:seller.id, | ||
| 90 | - title:seller.sellername, | ||
| 91 | - desc:seller.slogan, | ||
| 92 | - category_list:seller.cate, | ||
| 93 | - image_list:seller.envi_image, | ||
| 94 | - src_mini_program_path:'/pages/reserve/detail?id='+seller.id+'&from=haowu', | ||
| 95 | - brand_info:{ | ||
| 96 | - name:seller.sellername, | ||
| 97 | - logo:seller.seller_image, | ||
| 98 | - phone:seller.seller_tel, | ||
| 99 | - }, | ||
| 100 | - sku_list:[], | ||
| 101 | - } | ||
| 102 | - }, | ||
| 103 | /** | 85 | /** |
| 104 | * 生命周期函数--监听页面初次渲染完成 | 86 | * 生命周期函数--监听页面初次渲染完成 |
| 105 | */ | 87 | */ |
| @@ -3,7 +3,6 @@ | @@ -3,7 +3,6 @@ | ||
| 3 | "navigationBarTextStyle": "black", | 3 | "navigationBarTextStyle": "black", |
| 4 | "navigationBarTitleText":"一键订", | 4 | "navigationBarTitleText":"一键订", |
| 5 | "usingComponents": { | 5 | "usingComponents": { |
| 6 | - "share-button": "plugin://haowu/share-button", | ||
| 7 | "formids":"/components/formids/formids", | 6 | "formids":"/components/formids/formids", |
| 8 | "userinfo":"/components/userinfo/userinfo", | 7 | "userinfo":"/components/userinfo/userinfo", |
| 9 | "userinfo-share":"/components/userinfo/share", | 8 | "userinfo-share":"/components/userinfo/share", |
| @@ -44,7 +44,6 @@ | @@ -44,7 +44,6 @@ | ||
| 44 | </view> | 44 | </view> |
| 45 | </view> | 45 | </view> |
| 46 | <view class="average" wx:if="{{seller.average>0}}">¥{{seller.average}}/人</view> | 46 | <view class="average" wx:if="{{seller.average>0}}">¥{{seller.average}}/人</view> |
| 47 | - <share-button type="2" fore-color="#dd6" product="{{product}}"></share-button> | ||
| 48 | </view> | 47 | </view> |
| 49 | <view class="ping flex-ll"> | 48 | <view class="ping flex-ll"> |
| 50 | <view class="item" wx:if="{{seller.cate.length>0}}">{{seller.cate[0]}}</view> | 49 | <view class="item" wx:if="{{seller.cate.length>0}}">{{seller.cate[0]}}</view> |
| @@ -208,7 +207,7 @@ | @@ -208,7 +207,7 @@ | ||
| 208 | <as id="as" items="{{seller.seller_tel}}" bindclick="reservePhone">拨打电话预订</as> | 207 | <as id="as" items="{{seller.seller_tel}}" bindclick="reservePhone">拨打电话预订</as> |
| 209 | <getpos bindpos="onpos" id="getpos"></getpos> | 208 | <getpos bindpos="onpos" id="getpos"></getpos> |
| 210 | <discount id="discount" seller="{{seller}}" bindhide="discountHide" bindshow="discountShow"></discount> | 209 | <discount id="discount" seller="{{seller}}" bindhide="discountHide" bindshow="discountShow"></discount> |
| 211 | - <share id="share" seller_id="{{seller.id}}"></share> | 210 | + <share id="share" seller_id="{{seller.id}}" seller="{{seller}}" wx:if="{{seller.id}}"></share> |
| 212 | </view> | 211 | </view> |
| 213 | <view hidden="{{activeTab!='reserve'}}" wx:if="{{seller.id}}"> | 212 | <view hidden="{{activeTab!='reserve'}}" wx:if="{{seller.id}}"> |
| 214 | <view class="olreserve bg_white"> | 213 | <view class="olreserve bg_white"> |
-
Please register or login to post a comment