Commit 609c150a by 高淑倩

商品详情页分享授权

parent fd74b18f
...@@ -1313,7 +1313,7 @@ a { ...@@ -1313,7 +1313,7 @@ a {
white-space: nowrap; white-space: nowrap;
} }
button { button {
background-color: none; background-color: transparent;
border-radius:0; border-radius:0;
padding: 0; padding: 0;
} }
......
...@@ -103,7 +103,6 @@ wxService.page({ ...@@ -103,7 +103,6 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
console.log('0this.data.currentHasUserInfo', this.data.currentHasUserInfo)
this.getProInfo() this.getProInfo()
this.getOpenStatus() this.getOpenStatus()
this.data.currentShareContent = null this.data.currentShareContent = null
......
...@@ -30,7 +30,17 @@ ...@@ -30,7 +30,17 @@
<text class="price">¥618</text> <text class="price">¥618</text>
<text class="cost-price">¥888</text> <text class="cost-price">¥888</text>
</view> </view>
<view class="share-wrap" bindtap="onTapShare"> <button
wx:if="{{!currentHasUserInfo}}"
bindgetuserinfo="_getUserInfo"
data-jflag="false"
open-type='getUserInfo'
hover-class="btn-hover"
>
<image class="share-img" src="/assets/imgs/share.png" />
<text class="share-text">分享</text>
</button>
<view wx:if="{{currentHasUserInfo}}" class="share-wrap" bindtap="onTapShare">
<image class="share-img" src="/assets/imgs/share.png" /> <image class="share-img" src="/assets/imgs/share.png" />
<text class="share-text">分享</text> <text class="share-text">分享</text>
</view> </view>
...@@ -127,9 +137,9 @@ ...@@ -127,9 +137,9 @@
bindsubmit="addCart" bindsubmit="addCart"
report-submit report-submit
name='nav' name='nav'
wx:if="{{!fromZc}}" wx:if="{{!fromZc}}"
> >
<button class="cart-button get-formId--btn" formType="submit" >加入购物车</button> <button class="cart-button get-formId--btn" formType="submit">加入购物车</button>
</form> </form>
<form <form
class='get-formId get-formId--form' class='get-formId get-formId--form'
...@@ -157,7 +167,7 @@ ...@@ -157,7 +167,7 @@
btn-text="{{btnText}}" btn-text="{{btnText}}"
product-stock="{{productInfo.stock}}" product-stock="{{productInfo.stock}}"
currentHasUserInfo="{{currentHasUserInfo}}" currentHasUserInfo="{{currentHasUserInfo}}"
bind:getAuth="_getUserInfo" bind:getAuth="_getUserInfo"
/> />
<card-modal <card-modal
......
/* pages/productDetail/productDetail.wxss */ /* pages/productDetail/productDetail.wxss */
@import './../../base/base.wxss';
page{ page{
padding-bottom: 100rpx; padding-bottom: 100rpx;
} }
.swiper-image{ .swiper-image{
width: 100%; width: 100%;
} }
.product-price {
display: flex;
justify-content: space-between;
align-items: center;
}
.dots{ .dots{
position: absolute; position: absolute;
left: 0; left: 0;
...@@ -70,7 +77,7 @@ page{ ...@@ -70,7 +77,7 @@ page{
margin-left: 8rpx; margin-left: 8rpx;
} }
.price-wrap{ .price-wrap{
display: inline-block; flex: 1;
} }
.product-name{ .product-name{
color: #333333; color: #333333;
......
...@@ -285,8 +285,7 @@ const formatNumber = n => { ...@@ -285,8 +285,7 @@ const formatNumber = n => {
} }
function _getUserInfo(ev) { function _getUserInfo(ev) {
console.log('iiiiiiiiiiiiii', ev) const userInfo = ev.detail || ev
const userInfo = ev.detail
return getUserInfoByBtn(userInfo).then((data = {}) => { return getUserInfoByBtn(userInfo).then((data = {}) => {
const { token } = data const { token } = data
wx.setStorageSync('_accreditUserInfo', userInfo) wx.setStorageSync('_accreditUserInfo', userInfo)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment