| xqd
@@ -13,9 +13,9 @@
|
|
|
<view v-if="goods.subtitle" class="goods-subtitle">
|
|
|
<view class="t-omit-three">{{goods.subtitle}}</view>
|
|
|
</view>
|
|
|
- <view class='price main-between' :class="getTheme+ '-m-text ' + getTheme">
|
|
|
+ <view class='price main-between' :style="{'color': getTheme.color}">
|
|
|
<view class="dir-left-nowrap cross-bottom">
|
|
|
- <image src='./../image/detail-price.png'></image>
|
|
|
+ <image class="detail-price" src='./../image/detail-price.png'></image>
|
|
|
<view class="cross-bottom">{{goods.min_currency}}</view>
|
|
|
<view class="goods-currency" v-if="goods.max_currency > goods.min_currency">起</view>
|
|
|
<view>+</view>
|
| xqd
@@ -23,9 +23,11 @@
|
|
|
<view>{{goods.min_price}}</view>
|
|
|
<view class="goods-currency" v-if="goods.max_price > goods.min_price">起</view>
|
|
|
</view>
|
|
|
- <view class="share" @click="shareClick">
|
|
|
- <image src="/static/image/icon/icon-share.png"></image>
|
|
|
- <view>分享</view>
|
|
|
+ <view @click="shareClick"
|
|
|
+ :style="{'background-color': getTheme.background}"
|
|
|
+ class="share dir-left-nowrap main-center cross-center">
|
|
|
+ <image class="share-image box-grow-0" src="/static/image/icon/icon-share-white.png"></image>
|
|
|
+ <view class="share-text box-grow-0">分享</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<app-share-qr-code :url="shareUrl"
|
| xqd
@@ -33,9 +35,14 @@
|
|
|
:poster-config="poster_config + `&goods_id=` + goods.id"
|
|
|
:poster-generate="poster_generate + `&goods_id=` + goods.id"
|
|
|
v-model="shareShow"
|
|
|
+ :goods="goods"
|
|
|
+ @share="hShareAppMessage"
|
|
|
></app-share-qr-code>
|
|
|
+ <view style="background-color: #FFFFFF;padding: 24upx; 0 0 24upx">
|
|
|
+ <bd-info-extra :goods="goods" :theme="getTheme" :unit="goods.unit" :min-number="goods.min_number" :limit-buy="goods.limit_buy"></bd-info-extra>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <bd-coupon @change="setCoupon" :theme="themeObject" :coupons="goods.goods_coupon_center"></bd-coupon>
|
|
|
+ <bd-coupon @change="setCoupon" :theme="getTheme" :coupons="goods.goods_coupon_center"></bd-coupon>
|
|
|
<bd-xbc
|
|
|
:coAttr="is_open"
|
|
|
:attr-list="selectAttr.attr_list"
|
| xqd
@@ -54,7 +61,7 @@
|
|
|
:coupon="goods.goods_marketing_award.coupon"
|
|
|
:card="goods.goods_marketing_award.card"
|
|
|
:balance="goods.goods_marketing_award.balance"
|
|
|
- :theme="themeObject"
|
|
|
+ :theme="getTheme"
|
|
|
></bd-hc>
|
|
|
<bd-kb
|
|
|
:limit="goods.goods_marketing.limit"
|
| xqd
@@ -62,35 +69,35 @@
|
|
|
:shipping="goods.goods_marketing.shipping"
|
|
|
:pickup="goods.goods_marketing.pickup"
|
|
|
></bd-kb>
|
|
|
- <bd-detail :detail="goods.detail" :after_detail="goods.after_detail" :goodsId="goods.id"></bd-detail>
|
|
|
+ <bd-detail :detail="goods.detail"></bd-detail>
|
|
|
<!--空格区域-->
|
|
|
<view class="safe-area-inset-bottom u-bottom">
|
|
|
<view class="u-bottom-height"></view>
|
|
|
</view>
|
|
|
<!--底部按钮-->
|
|
|
<view v-if="is_open == 1" class="safe-area-inset-bottom u-bottom-fixed">
|
|
|
- <view class="app-bottom dir-left-nowrap">
|
|
|
- <view class="dir-top-nowrap main-center cross-center little box-grow-0" @click="back">
|
|
|
- <image src="/static/image/icon/index.png"></image>
|
|
|
- <view>首页</view>
|
|
|
+ <view class="bd-bottom dir-left-nowrap cross-center">
|
|
|
+ <view class="bd-back dir-top-nowrap main-center cross-center box-grow-0" @click="back">
|
|
|
+ <image class="bd-icon" src="/static/image/icon/index.png"></image>
|
|
|
+ <text class="bd-text">首页</text>
|
|
|
</view>
|
|
|
- <view class="dir-left-nowrap">
|
|
|
- <view v-if="goods.goods_stock == 0" class="dir-left-nowrap">
|
|
|
- <view class="main-center cross-center button" style="background-color: #CDCDCD;color: #fff;">已售罄
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view v-else class="main-center cross-center button"
|
|
|
- :class="getTheme + '-m-back ' + getTheme"
|
|
|
- @click="clickAttr"
|
|
|
- >立即兑换
|
|
|
- </view>
|
|
|
+ <bd-service :name="goods.name" :url="webUrl"></bd-service>
|
|
|
+ <view v-if="goods.goods_stock === 0" class="box-grow-1 bd-btn bd-oversell-btn bd-btn-color" >
|
|
|
+ 已售罄
|
|
|
+ </view>
|
|
|
+ <view
|
|
|
+ v-else
|
|
|
+ @click="clickAttr"
|
|
|
+ :style="{'background': goods.buy_goods_auth ? getTheme.background_gradient_btn : '#999999','color': goods.buy_goods_auth ? getTheme.main_text : ''}"
|
|
|
+ class="bd-btn box-grow-1 bd-btn-color">
|
|
|
+ 立即兑换
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<u-attr
|
|
|
:goods="goods"
|
|
|
v-model="attrShow"
|
|
|
- :themeObject="themeObject"
|
|
|
+ :theme="getTheme"
|
|
|
:checked="selectAttr"
|
|
|
:is_show_left="false"
|
|
|
rightText="立即兑换"
|
| xqd
@@ -118,6 +125,8 @@
|
|
|
import bdKb from '@/components/page-component/goods/bd-kb.vue';
|
|
|
import bdHc from '@/components/page-component/goods/bd-hc.vue';
|
|
|
import appClose from '@/components/basic-component/app-close/app-close.vue';
|
|
|
+ import bdService from '@/components/page-component/goods/bd-service.vue';
|
|
|
+ import bdInfoExtra from '@/components/page-component/goods/bd-info-extra.vue';
|
|
|
|
|
|
export default {
|
|
|
name: "goods",
|
| xqd
@@ -130,36 +139,37 @@
|
|
|
bdDetail,
|
|
|
bdHc,
|
|
|
bdKb,
|
|
|
- appClose
|
|
|
+ appClose,
|
|
|
+ bdService,
|
|
|
+ bdInfoExtra
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
showClose: false,
|
|
|
is_open: 0,
|
|
|
- goods: null,
|
|
|
+ goods: {
|
|
|
+ id: '',
|
|
|
+ name: '',
|
|
|
+ cover_pic: '',
|
|
|
+ price: '',
|
|
|
+ },
|
|
|
+ webUrl: '',
|
|
|
selectAttr: null,
|
|
|
shareShow: false,
|
|
|
shareUrl: null,
|
|
|
attrShow: false,
|
|
|
poster_config: this.$api.step.poster_config,
|
|
|
poster_generate: this.$api.step.poster_generate,
|
|
|
+ disable: 'disable'
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState({
|
|
|
- mall: state => state.mallConfig.mall
|
|
|
+ mall: state => state.mallConfig.mall,
|
|
|
}),
|
|
|
...mapGetters('mallConfig', {
|
|
|
getTheme: 'getTheme',
|
|
|
- }),
|
|
|
- themeObject:function() {
|
|
|
- return {
|
|
|
- back: this.getTheme + '-m-back ' + this.getTheme,
|
|
|
- theme: this.getTheme,
|
|
|
- color: this.getTheme + '-m-text ' + this.getTheme,
|
|
|
- sBack: this.getTheme + '-s-back ' + this.getTheme
|
|
|
- }
|
|
|
- }
|
|
|
+ })
|
|
|
},
|
|
|
onShow() {
|
|
|
this.showClose = false;
|
| xqd
@@ -167,7 +177,8 @@
|
|
|
this.showClose = true;
|
|
|
})
|
|
|
},
|
|
|
- onLoad(options) {
|
|
|
+ onLoad(options) { this.$commonLoad.onload(options);
|
|
|
+ this.webUrl = '/plugins/step/goods/goods?goods_id=' + options.goods_id;
|
|
|
// #ifdef MP-WEIXIN
|
|
|
wx.showShareMenu({
|
|
|
menus: ['shareAppMessage', 'shareTimeline']
|
| xqd
@@ -175,30 +186,36 @@
|
|
|
// #endif
|
|
|
this.loadData(options.goods_id);
|
|
|
},
|
|
|
-
|
|
|
- onShareAppMessage: function() {
|
|
|
- let { app_share_title, name, app_share_pic, cover_pic, id } = this.goods;
|
|
|
- return this.$shareAppMessage({
|
|
|
- title: app_share_title ? app_share_title: name,
|
|
|
- imageUrl: app_share_pic ? app_share_pic: cover_pic,
|
|
|
- path: "/plugins/step/goods/goods",
|
|
|
- params: {
|
|
|
- goods_id: id
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
// #ifdef MP-WEIXIN
|
|
|
onShareTimeline() {
|
|
|
- let { app_share_title, name, id } = this.goods;
|
|
|
+ let { app_share_title, name, app_share_pic, cover_pic, id, pic_url } = this.goods;
|
|
|
return this.$shareTimeline({
|
|
|
title: app_share_title ? app_share_title: name,
|
|
|
+ imageUrl: pic_url[0].pic_url,
|
|
|
query: {
|
|
|
goods_id: id
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
// #endif
|
|
|
+ // #ifdef MP
|
|
|
+ onShareAppMessage() {
|
|
|
+ return this.hShareAppMessage();
|
|
|
+ },
|
|
|
+ // #endif
|
|
|
methods: {
|
|
|
+ hShareAppMessage(s = false){
|
|
|
+ let { app_share_title, name, app_share_pic, cover_pic, id , subtitle} = this.goods;
|
|
|
+ return this.$shareAppMessage({
|
|
|
+ title: app_share_title ? app_share_title: name,
|
|
|
+ imageUrl: app_share_pic ? app_share_pic: cover_pic,
|
|
|
+ path: "/plugins/step/goods/goods",
|
|
|
+ desc: subtitle,
|
|
|
+ params: {
|
|
|
+ goods_id: id
|
|
|
+ }
|
|
|
+ }, s);
|
|
|
+ },
|
|
|
getMall(e) {
|
|
|
this.is_open = e.is_open;
|
|
|
},
|
| xqd
@@ -215,6 +232,9 @@
|
|
|
this.goods = response.data.detail;
|
|
|
this.shareUrl = this.$api.step.goods_poster + '&goods_id=' + id;
|
|
|
this.goods.id = id;
|
|
|
+ // #ifdef H5
|
|
|
+ this.hShareAppMessage();
|
|
|
+ // #endif
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
title: response.msg,
|
| xqd
@@ -225,8 +245,8 @@
|
|
|
this.$hideLoading();
|
|
|
});
|
|
|
},
|
|
|
- onAttr(data) {
|
|
|
- this.selectAttr = data;
|
|
|
+ onAttr({item}) {
|
|
|
+ this.selectAttr = item;
|
|
|
},
|
|
|
shareClick() {
|
|
|
this.shareShow = true;
|
| xqd
@@ -237,36 +257,19 @@
|
|
|
});
|
|
|
},
|
|
|
clickAttr() {
|
|
|
+ if (!this.goods.buy_goods_auth) {
|
|
|
+ this.$tips.showToast({
|
|
|
+ title: '您暂无权限购买该商品',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.attrShow = true;
|
|
|
},
|
|
|
setCoupon(index) {
|
|
|
this.$set(this.goods.goods_coupon_center[index], 'is_receive', 1);
|
|
|
},
|
|
|
rightFunc(data) {
|
|
|
- if (this.$user.isLogin() && this.$store.state.user.info) {
|
|
|
- let member_level = this.$store.state.user.info.identity.member_level;
|
|
|
- if (member_level < this.goods.member_level) {
|
|
|
- uni.showModal({
|
|
|
- title: "提示",
|
|
|
- content: "需达到" + this.goods.member_name + "会员才可购买",
|
|
|
- showCancel: true,
|
|
|
- confirmText: '升级',
|
|
|
- success: (res) => {
|
|
|
- if (res.confirm) {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/member/upgrade/upgrade?level=' + member_level + '&other=' + this.goods.member_level
|
|
|
-
|
|
|
- })
|
|
|
- } else if (res.cancel) {
|
|
|
- console.log('用户点击取消');
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/order-submit/order-submit?mch_list=${JSON.stringify([data])}&preview_url=${encodeURIComponent(this.$api.step.order_preview)}&submit_url=${encodeURIComponent(this.$api.step.order_submit)}`
|
|
|
});
|
| xqd
@@ -299,99 +302,38 @@
|
|
|
background-color: #ffffff;
|
|
|
color: #999999;
|
|
|
}
|
|
|
-
|
|
|
- .attr {
|
|
|
- background-color: #f7f7f7;
|
|
|
+ .bd-bottom {
|
|
|
+ width: 750upx;
|
|
|
+ height: 110upx;
|
|
|
+ padding: 20upx 24upx;
|
|
|
}
|
|
|
-
|
|
|
- .recommend {
|
|
|
- .recommend-title {
|
|
|
- margin: #{40rpx} 0 #{32rpx} 0;
|
|
|
- font-size: $uni-font-size-weak-one;
|
|
|
- color: $uni-general-color-two;
|
|
|
-
|
|
|
- .border {
|
|
|
- border-top: #{1rpx} solid #bbbbbb;
|
|
|
- height: 0;
|
|
|
- width: #{40rpx};
|
|
|
- margin: 0 #{24rpx};
|
|
|
- }
|
|
|
-
|
|
|
- image {
|
|
|
- width: #{24rpx};
|
|
|
- height: #{24rpx};
|
|
|
- display: block;
|
|
|
- margin-right: #{12rpx};
|
|
|
- }
|
|
|
- }
|
|
|
+ .bd-back {
|
|
|
+ width: 66upx;
|
|
|
+ height: 100%;
|
|
|
+ margin-right: 20upx;
|
|
|
}
|
|
|
-
|
|
|
- .bottom {
|
|
|
- width: 100%;
|
|
|
- height: #{110rpx};
|
|
|
+ .bd-icon {
|
|
|
+ width: 30upx;
|
|
|
+ height: 30upx;
|
|
|
+ margin-bottom: 8upx;
|
|
|
}
|
|
|
-
|
|
|
- .app-bottom {
|
|
|
- width: 100%;
|
|
|
- height: #{110rpx};
|
|
|
- font-size: $uni-font-size-general-one;
|
|
|
-
|
|
|
- .little {
|
|
|
- width: #{110rpx};
|
|
|
- height: 100%;
|
|
|
- background-color: #ffffff;
|
|
|
- font-size: #{20rpx};
|
|
|
- color: $uni-general-color-two;
|
|
|
-
|
|
|
- &:first-child {
|
|
|
- border-right: #{1rpx} solid #e2e2e2;
|
|
|
- }
|
|
|
-
|
|
|
- image {
|
|
|
- width: #{40rpx};
|
|
|
- height: #{40rpx};
|
|
|
- display: block;
|
|
|
- margin-bottom: #{10rpx};
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .button {
|
|
|
- width: #{650rpx};
|
|
|
- height: #{110rpx};
|
|
|
- color: #ffffff;
|
|
|
- }
|
|
|
-
|
|
|
- .service {
|
|
|
- background-color: #446dfd;
|
|
|
- color: #ffffff;
|
|
|
- }
|
|
|
-
|
|
|
- .contact-tel {
|
|
|
- background-color: #f39800;
|
|
|
- color: #ffffff;
|
|
|
- }
|
|
|
-
|
|
|
- .contact {
|
|
|
- background-color: #4cbf2a;
|
|
|
- color: #ffffff;
|
|
|
- }
|
|
|
+ .bd-text {
|
|
|
+ font-size: 20upx;
|
|
|
+ color: #888888;
|
|
|
+ line-height: 1;
|
|
|
}
|
|
|
-
|
|
|
- .comments {
|
|
|
- margin-bottom: #{20rpx};
|
|
|
- background-color: #ffffff;
|
|
|
+ .bd-btn {
|
|
|
+ text-align: center;
|
|
|
+ line-height: 70upx;
|
|
|
+ font-size: 28upx;
|
|
|
+ border-radius: 35upx;
|
|
|
}
|
|
|
-
|
|
|
- .detail {
|
|
|
- background-color: #ffffff;
|
|
|
-
|
|
|
- image {
|
|
|
- width: 100%;
|
|
|
- height: #{80rpx};
|
|
|
- display: block;
|
|
|
- }
|
|
|
+ .bd-btn-color {
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ .bd-oversell-btn {
|
|
|
+ background-color: #CDCDCD;
|
|
|
}
|
|
|
-
|
|
|
.price {
|
|
|
height: #{106rpx};
|
|
|
font-size: #{40rpx};
|
| xqd
@@ -402,7 +344,7 @@
|
|
|
position: relative;
|
|
|
}
|
|
|
|
|
|
- .price image {
|
|
|
+ .price .detail-price {
|
|
|
height: #{44rpx};
|
|
|
width: #{44rpx};
|
|
|
display: block;
|
| xqd
@@ -411,15 +353,20 @@
|
|
|
}
|
|
|
|
|
|
.share {
|
|
|
- margin-right: #{20rpx};
|
|
|
margin-top: #{10rpx};
|
|
|
- font-size: $uni-font-size-weak-two;
|
|
|
- color: $uni-general-color-one;
|
|
|
+ height: #{48rpx};
|
|
|
+ border-radius: #{40rpx} 0 0 #{40rpx};
|
|
|
+ padding: 0 #{14rpx};
|
|
|
+ width: #{103rpx};
|
|
|
|
|
|
- image {
|
|
|
- width: #{40rpx};
|
|
|
- height: #{40rpx};
|
|
|
- margin-bottom: #{10rpx};
|
|
|
+ .share-image {
|
|
|
+ width: #{22rpx};
|
|
|
+ height: #{22rpx};
|
|
|
+ }
|
|
|
+ .share-text {
|
|
|
+ font-size: #{22rpx};
|
|
|
+ color: #ffffff;
|
|
|
+ margin-left: #{10rpx};
|
|
|
}
|
|
|
}
|
|
|
|