Authored by yyq

Merge branch 'feature/import' of git.yoho.cn:fe/yoho-miniapp-eshop into feature/import

... ... @@ -16,7 +16,7 @@ export default {
},
"appid": "wxe8bfc9b404772199",
"unionType": "100000000011678",
"mini_app_type": "5",
"mini_app_type": "6",
"resourceContentCode": {
"home": {
"top": "72c65730150543d295532c942b0e5a33"
... ...
... ... @@ -115,5 +115,19 @@ export default {
method: 'miniapp.product.preference'
}, params)
});
},
/**
* 促销信息
* @param params
* @returns {*}
*/
promotion(params) {
return api.get({
url: '',
data: Object.assign({
method: 'app.product.promotion'
}, params)
});
}
};
... ...
... ... @@ -81,6 +81,11 @@ Page(Object.assign({
preferList: [],
// 促销
proList: [],
proTypes: [],
expandPro: false,
showMenu: false,
showBackTop: false,
showBottomTipView: false,
... ... @@ -88,6 +93,7 @@ Page(Object.assign({
productOnlyProvideByYohoAPP: false,
productOnlyProvideByYohoStore: false,
productNotForSale: false,
},
getUserInfoLogin,
onLoad: function(options) {
... ... @@ -110,6 +116,7 @@ Page(Object.assign({
this.supportService();
this.productIntro();
this.preferList();
this.getPromotion();
this._getShopInfo();
this._getCountInCart();
}, 500);
... ... @@ -633,6 +640,40 @@ Page(Object.assign({
this._addToCart();
},
// 促销
getPromotion: function() {
detailModel.promotion({product_skn: this.data.productSkn})
.then(res => {
res.data.forEach(function(e) {
e.time = '';
});
let proList = res.data;
let proTypes = [];
proList.forEach(item => {
let proType = item.promotionType;
if (proTypes.indexOf(proType) === -1) {
proTypes.push(proType);
}
});
this.setData({
proList,
proTypes,
});
})
.catch(() => {});
},
toggleExpandPro: function() {
this.setData({
expandPro: !this.data.expandPro
});
},
_addToCart() {
let params = {
product_sku: this.data.selectedSKU > 0 ? this.data.selectedSKU : 0,
... ... @@ -654,7 +695,9 @@ Page(Object.assign({
duration: 2000
});
} else {
return Promise.reject();
return Promise.reject({
message: res.message
});
}
})
.catch(err => {
... ...
... ... @@ -16,6 +16,30 @@
</view>
</view>
<view class="gap"></view>
<!-- 促销 -->
<view class="promotion" wx:if="{{proList.length}}">
<view class="pro-header" bindtap="toggleExpandPro">
<text>促销</text>
<view wx:if="{{expandPro}}" class="expand-tip">促销优惠信息以确认订单页为准</view>
<view wx:else class="pro-types">
<view wx:for="{{proTypes}}" wx:key="{{index}}" class="type">{{item}}</view>
</view>
<text wx:if="{{!expandPro}}" class="expand-arrow iconfont icon-bottom"></text>
<text wx:else class="expand-arrow iconfont icon-top"></text>
</view>
<view wx:if="{{expandPro}}" class="pro-detail">
<view wx:for="{{proList}}" wx:key="index" class="detail-item">
<view class="item-type">{{item.promotionType}}</view>
<view class="item-detail">
<view class="detail-title">{{item.promotionTitle}}</view>
<view class="detail-time">2017.11.24-2019.02.28</view>
</view>
</view>
</view>
</view>
<view class="gap" wx:if="{{proList.length}}"></view>
<!-- 支持的服务 -->
<view class="support-service"
style="display: {{productSupportServiceList.length>0?'block':'none'}} ;flex-direction: row; display: flex;">
... ... @@ -26,18 +50,19 @@
</view>
</view>
<view class="gap"></view>
<!--店铺-->
<view class='row-shop-brief'>
<view class='row-shop-brief' bindtap="toShop">
<image class='shop-icon' src="{{helper.image(shopInfo.brand_ico, 120, 60)}}"></image>
<text class='shop-name'>{{shopInfo.brand_name}}</text>
<text class="shop-nav-arrow iconfont icon-right"></text>
<text class='shop-nav' bindtap="toShop">返回首页</text>
<text class='shop-nav'>返回首页</text>
</view>
<view class="gap"></view>
<view class="goods-info" style="display:{{productDesc.length>0?'block':'none'}}">
<view class="module-title">
<text class="text">商品信息 <text class="sub-text">DESCRIPTION</text></text>
<view class="text">商品信息 <text class="sub-text">DESCRIPTION</text></view>
</view>
<view class="table">
<view class="tr" wx:for="{{productDesc.length/2}}" wx:key="unique">
... ... @@ -51,7 +76,7 @@
</view>
<view class="goods-info" style="display:{{productSizeContent.length>0?'block':'none'}}">
<view class="module-title">
<text class="text">尺码信息 <text class="sub-text">INFORMATION</text></text>
<text class="text">尺码信息 <text class="sub-text">SIZE INFO</text></text>
</view>
<scroll-view class="table">
<view class="tr">
... ... @@ -65,13 +90,13 @@
<view class="goods-info" style="display:{{productMeasurementImage?'block':'none'}}">
<view class="module-title">
<text class="text">测量信息 <text class="sub-text">DESCRIPTION</text></text>
<text class="text">测量信息 <text class="sub-text">MEASUREMENT METHOD</text></text>
</view>
<image src="{{productMeasurementImage}}" mode="widthFix"></image>
</view>
<view class="goods-info" style="display:{{productMaterialList[0].remark?'block':'none'}}">
<view class="module-title">
<text class="text">商品材质 <text class="sub-text">DESCRIPTION</text></text>
<text class="text">商品材质 <text class="sub-text">MATERIALS</text></text>
</view>
<view class="info-description">
<text class="light-gray-font">{{productMaterialList[0].remark}}</text>
... ... @@ -88,7 +113,7 @@
<view class="goods-info img" style="display:{{productIntroImageList.length>0?'block':'none'}}">
<view class="module-title">
<text class="text">商品详情 <text class="sub-text">DESCRIPTION</text></text>
<text class="text">商品详情 <text class="sub-text">DETAILS</text></text>
</view>
<view wx:for="{{productIntroImageList}}" wx:key="introImage" style="text-align:center">
<image class="intro-image" src="{{item}}" mode="widthFix"></image>
... ...
... ... @@ -78,110 +78,6 @@
align-items: center;
}
.promotion {
vertical-align: center;
padding-left: 30rpx;
display: flex;
align-items: center;
}
.promotion-item {
vertical-align: center;
display: flex;
flex-direction: row;
padding-right: 20rpx;
height: 100%;
flex-wrap: wrap;
width: 100%;
}
.promotion-title {
color: #444;
font-size: 14px;
padding-left: 10rpx;
padding-right: 10rpx;
width: 80rpx;
align-items: center;
}
.promotion-item-left {
padding-left: 10rpx;
padding-right: 10rpx;
color: #ff575c;
font-size: 25rpx;
height: 32rpx;
vertical-align: center;
margin-bottom: 15rpx;
align-items: center;
}
.promotion-item-border {
height: 14px;
border-radius: 5rpx;
border: solid 2rpx #ff575c;
width: 45px;
display: flex;
justify-content: center;
align-items: center;
}
.promotion-title-item {
color: #ff575c;
font-size: 9px;
line-height: 12px;
vertical-align: center;
align-items: center;
justify-content: center;
}
.promotion-item-seperator {
height: 1rpx;
transform: scaleY(0.5);
background-color: #e0e0e0;
width: 100%;
padding-left: 20rpx;
}
.promotion-detail {
flex-direction: row;
display: flex;
padding-top: 20rpx;
}
.promotion-tips-title {
color: #b0b0b0;
font-size: 25rpx;
vertical-align: center;
display: flex;
flex-direction: row;
padding-right: 20rpx;
height: 100%;
flex-wrap: wrap;
width: 100%;
}
.promotion-detail-title {
color: #444;
font-size: 12px;
padding-left: 10rpx;
padding-right: 15rpx;
}
.promotion-detail-date {
color: #b0b0b0;
font-size: 9px;
padding-bottom: 20rpx;
margin-left: 10rpx;
}
.promotion-seperator {
margin-top: 20rpx;
margin-bottom: 20rpx;
padding-left: 100rpx;
height: 10rpx;
background: rgb(238, 238, 238);
}
.support-service-image {
width: 30rpx;
height: 30rpx;
... ... @@ -542,47 +438,27 @@
}
.module-title {
height: 100rpx;
line-height: 100rpx;
text-align: center;
padding: 20rpx 0 15rpx 0;
margin-bottom: 15rpx;
border-bottom: 1rpx solid #e0e0e0;
}
.module-title .text {
font-family: PingFang-SC-Medium, sans-serif;
position: relative;
font-size: 28rpx;
color: #444;
font-size: 30rpx;
font-weight: bold;
letter-spacing: -0.33rpx;
}
.module-title .text:before {
position: absolute;
display: inline-block;
top: 19rpx;
left: -140rpx;
content: "";
height: 2rpx;
width: 100rpx;
background-color: #444;
}
.module-title .text:after {
position: absolute;
display: inline-block;
top: 19rpx;
right: -140rpx;
content: "";
height: 2rpx;
width: 100rpx;
background-color: #444;
}
.module-title .sub-text {
font-family: PingFang-SC-Medium, sans-serif;
font-size: 18rpx;
color: #000;
font-size: 25rpx;
color: #444;
letter-spacing: -0.33px;
line-height: 20rpx;
font-weight: normal;
}
.title-container {
... ... @@ -626,3 +502,79 @@
.product-list.prefer {
padding-bottom: 60rpx;
}
.promotion .pro-header {
color: #444;
font-size: 28rpx;
height: 80rpx;
line-height: 80rpx;
padding: 0 30rpx;
}
.promotion .pro-header .expand-arrow {
float: right;
color: #b0b0b0;
font-size: 38rpx;
}
.promotion .pro-header .pro-types {
display: inline-block;
}
.promotion .pro-types .type {
display: inline-block;
padding: 5rpx 20rpx;
line-height: 1;
color: #ff575c;
font-size: 20rpx;
text-align: center;
border-radius: 5rpx;
border: 1rpx solid #ff575c;
margin-left: 20rpx;
margin-bottom: 2rpx;
}
.promotion .expand-tip {
display: inline-block;
color: #b0b0b0;
font-size: 25rpx;
padding-left: 20rpx;
}
.promotion .item-type {
position: absolute;
top: 24rpx;
left: 30rpx;
display: inline-block;
padding: 5rpx 20rpx;
color: #ff575c;
font-size: 20rpx;
line-height: 1;
text-align: center;
border-radius: 5rpx;
border: 1rpx solid #ff575c;
}
.promotion .detail-item {
position: relative;
padding: 20rpx 30rpx 0;
box-sizing: border-box;
}
.promotion .item-detail {
padding-bottom: 20rpx;
margin-left: 100rpx;
border-bottom: 1rpx solid #e0e0e0;
}
.promotion .detail-item:last-child .item-detail {
border-bottom: none;
}
.promotion .detail-item .detail-title {
font-size: 24rpx;
}
.promotion .detail-item .detail-time {
font-size: 24rpx;
}
... ...
... ... @@ -29,7 +29,7 @@
"list": []
},
"miniprogram": {
"current": 3,
"current": -1,
"list": [
{
"id": -1,
... ... @@ -52,9 +52,10 @@
{
"id": -1,
"name": "购物车",
"pathName": "pages/cart/cart"
"pathName": "pages/cart/cart",
"query": ""
}
]
}
}
}
}
\ No newline at end of file
... ...