Authored by QC-L

详情页添加拼团列表相关 review by 黄敬囿

... ... @@ -76,7 +76,9 @@ function request(method = 'GET') {
params.session_key = sessionkey;
params.source_type = "wechat";
params.client_type = "miniapp";
params.business_line = "miniapp";
if (!params.business_line) {
params.business_line = "miniapp";
}
params.user_source = "wechat"
if (params && !params.hasOwnProperty('udid')) {
... ...
... ... @@ -54,7 +54,7 @@
<view class="code">{{code}}</view>
</view>
<form bindsubmit='submitFormId' report-submit='true'>
<button class="share" form-type="submit" bindtap="goShare">分享一下,中奖概率马上 double!</button>
<button class="share" form-type="submit" bindtap="goShare">分享一下,中奖概率立马double</button>
</form>
<view class="share-desc">1个好友参加=1个抽奖码=中奖几率UP!</view>
</view>
... ...
// pages/zeroSell/components/group-recommend-cell.js
import { getImageUrl } from '../../../utils/util.js';
Component({
/**
* 组件的属性列表
*/
properties: {
product: {
type: Object,
value: {},
observer(newValue) {
newValue.default_images = getImageUrl(newValue.default_images, 483, 645);
this.setData({
group_product: newValue
})
}
}
},
/**
* 组件的初始数据
*/
data: {
group_product: {},
group_number_image: '../../../images/tab@3x.png',
free_post: '../../../images/free-post@3x.png'
},
/**
* 组件的方法列表
*/
methods: {
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--pages/zeroSell/components/group-recommend-cell.wxml-->
<!-- <text>pages/zeroSell/components/group-recommend-cell.wxml</text> -->
<view class="group-product-cell-bg">
<view class="group-product-header">
<image class="group-product-left-icon" src="{{group_number_image}}"></image>
<image class="group-product-image" src="{{group_product.default_images}}"></image>
</view>
<view class="group-product-name">{{group_product.product_name}}</view>
<view class="group-price">
<view class="group-prict-bg">
<text class="group-price-market">{{group_product.market_price_str}}</text>
<text class="group-price-collage">{{group_product.collage_price_str}}</text>
</view>
<image class="group-free-post" src="{{free_post}}"></image>
</view>
</view>
... ...
/* pages/zeroSell/components/group-recommend-cell.wxss */
.group-product-image {
margin-left: -72rpx;
width: 322rpx;
height: 430rpx;
z-index: 1;
}
.group-product-cell-bg {
margin-top: 20rpx;
}
.group-product-header {
display: flex;
flex-direction: row;
}
.group-product-left-icon {
margin-top: 10rpx;
width: 88rpx;
height: 40rpx;
z-index: 2;
}
.group-product-name {
width: 322rpx;
height: 56rpx;
font-family: PingFangSC-Medium;
font-size: 20rpx;
color: #444444;
margin-top: 24rpx;
margin-left: 16rpx;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
.group-price {
margin-left: 16rpx;
display: flex;
flex-direction: row;
align-items: center;
}
.group-price-market {
text-decoration: line-through;
}
.group-price-collage {
font-size: 32rpx;
color: #D0021B;
}
.group-prict-bg {
font-size: 22rpx;
color: #444444;
}
.group-free-post {
width: 60rpx;
height: 40rpx;
margin-left: 20rpx;
}
\ No newline at end of file
... ...
// pages/zeroSell/components/group-recommend.js
Component({
/**
* 组件的属性列表
*/
properties: {
groupRecommendList: {
type: Array,
value: []
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
... ...
{
"component": true,
"usingComponents": {
"group-recommend-cell": "./group-recommend-cell"
}
}
\ No newline at end of file
... ...
<!--pages/zeroSell/components/group-recommend.wxml-->
<view class="title-view">
<view class="space-line"></view>
<text class="title">邀新团</text>
</view>
<view class="group-list">
<block wx:for="{{groupRecommendList}}">
<group-recommend-cell product="{{item}}"></group-recommend-cell>
</block>
</view>
\ No newline at end of file
... ...
/* pages/zeroSell/components/group-recommend.wxss */
.group-list {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-around;
margin-left: 20rpx;
margin-right: 20rpx;
}
.space-line {
background-color: #444444;
width: 8rpx;
height: 30rpx;
margin-right: 10rpx;
}
.title-view {
margin-left: 32rpx;
margin-top: 20rpx;
font-size: 32rpx;
color: #444444;
letter-spacing: -0.14px;
display: flex;
flex-direction: row;
align-items: center;
font-family: PingFangSC-Medium;
}
\ No newline at end of file
... ...
... ... @@ -29,7 +29,7 @@
color: #B0B0B0;
font-size: 36rpx;
font-weight: bold;
margin-left: 30rpx;
margin-left: 20rpx;
text-decoration: line-through;
}
... ...
... ... @@ -105,6 +105,7 @@ Page(Object.assign({
app = getApp();
this.service = new ZeroSellService();
this.commonService = new CommonService();
let data = {};
... ... @@ -152,6 +153,7 @@ Page(Object.assign({
})
this._getUser();
this._getGroupList();
if (this.data.shareUid && this.data.scene) {
this._init();
... ... @@ -205,6 +207,19 @@ Page(Object.assign({
},
_getGroupList(page) {
this.commonService.getGroupList({
limit: 20,
page
}).then(res => {
if (res.code === 200 && res.data) {
this.setData({
groupList: res.data.list
})
}
});
},
_init() {
let params = {
actPrizeId: this.data.actPrizeId
... ... @@ -373,7 +388,7 @@ Page(Object.assign({
jumpByUrl(that.data.bannerUrl);
},
_getDetailBanner() {
let commonService = new CommonService()
let commonService = this.commonService;
commonService.getResourceCode('ccc32dbedf164a52b4efa34383878860')
.then(data => {
// console.log(data)
... ...
... ... @@ -13,6 +13,7 @@
"fellow-bar": "./components/fellow-bar",
"action-bar": "./components/action-bar",
"quickNavigation": "/pages/quickNavigation/quickNavigation",
"zero-alert": "./components/alert"
"zero-alert": "./components/alert",
"group-recommend": "./components/group-recommend"
}
}
\ No newline at end of file
... ...
... ... @@ -28,6 +28,8 @@
<view class="fellow-bar" wx:if="{{product.status}}">
<fellow-bar></fellow-bar>
</view>
<group-recommend groupRecommendList="{{groupList}}">
</group-recommend>
<view class="action-bar">
<action-bar wx:if="{{isLogin}}" status="{{actionStatus}}" num="{{myPrizeCount}}" share-uid="{{shareUid}}" act-prize-id="{{actPrizeId}}" bindgetcode="changeActionStatus" bindshare="share" bind:requireauth="requireAuth"
... ... @@ -49,7 +51,6 @@
</view>
</block>
</view>
<view class="foot"></view>
</block>
... ...
... ... @@ -28,12 +28,14 @@
position: fixed;
width: 100%;
top: 0rpx;
z-index: 5;
}
.action-bar {
position: fixed;
width: 100%;
bottom: 0
bottom: 0;
z-index: 5;
}
.foot {
... ...
... ... @@ -26,6 +26,14 @@
</view>
</tabs-pane>
<tabs-pane name="已参加">
<view class="productList">
<block wx:for="{{list[2].products}}" wx:key="{{item.id}}">
<product-item product="{{item}}" class="product"></product-item>
</block>
</view>
</tabs-pane>
<view class="list-foot-blank">{{footText}}</view>
</tabs>
... ... @@ -33,7 +41,7 @@
<image class="bottom-banner-img" src="{{bannerSrc}}"></image>
</view>
<view class="bottom-bar">
<!-- <view class="bottom-bar">
<block wx:if="{{isLogin}}">
<view bindtap="goMyList">我的抽奖码</view>
</block>
... ... @@ -41,7 +49,7 @@
<block wx:else>
<button class="bottom-btn" plain="true" hover-class="none" open-type="{{!hasUnionID ? 'getUserInfo':'getPhoneNumber'}}" bindgetphonenumber="getPhoneNumber" bindgetuserinfo='getUserInfo'>我的抽奖码</button>
</block>
</view>
</view> -->
<import src="../../../../vendors/zanui/toast/index.wxml"/>
<template is="zan-toast" data="{{zanToast}}"/>
... ...
... ... @@ -24,7 +24,7 @@
.bottom-banner {
/* position: fixed; */
padding-bottom: 88rpx;
/* padding-bottom: 88rpx; */
height: 234rpx;
width: 100%;
}
... ...
... ... @@ -36,6 +36,14 @@ class CommonService extends Service {
})
}
getGroupList(data) {
return this._get(API_HOST, Object.assign({
method: 'app.collage.promoteList',
business_line: 'miniappGroup',
joinLimit: 1
}, data));
}
}
export default CommonService;
\ No newline at end of file
... ...