详情页添加拼团列表相关 review by 黄敬囿
Showing
20 changed files
with
240 additions
and
9 deletions
images/free-post@3x.png
0 → 100644
2.69 KB
images/tab@3x.png
0 → 100644
2.47 KB
@@ -76,7 +76,9 @@ function request(method = 'GET') { | @@ -76,7 +76,9 @@ function request(method = 'GET') { | ||
76 | params.session_key = sessionkey; | 76 | params.session_key = sessionkey; |
77 | params.source_type = "wechat"; | 77 | params.source_type = "wechat"; |
78 | params.client_type = "miniapp"; | 78 | params.client_type = "miniapp"; |
79 | + if (!params.business_line) { | ||
79 | params.business_line = "miniapp"; | 80 | params.business_line = "miniapp"; |
81 | + } | ||
80 | params.user_source = "wechat" | 82 | params.user_source = "wechat" |
81 | 83 | ||
82 | if (params && !params.hasOwnProperty('udid')) { | 84 | if (params && !params.hasOwnProperty('udid')) { |
@@ -54,7 +54,7 @@ | @@ -54,7 +54,7 @@ | ||
54 | <view class="code">{{code}}</view> | 54 | <view class="code">{{code}}</view> |
55 | </view> | 55 | </view> |
56 | <form bindsubmit='submitFormId' report-submit='true'> | 56 | <form bindsubmit='submitFormId' report-submit='true'> |
57 | - <button class="share" form-type="submit" bindtap="goShare">分享一下,中奖概率马上 double!</button> | 57 | + <button class="share" form-type="submit" bindtap="goShare">分享一下,中奖概率立马double</button> |
58 | </form> | 58 | </form> |
59 | <view class="share-desc">1个好友参加=1个抽奖码=中奖几率UP!</view> | 59 | <view class="share-desc">1个好友参加=1个抽奖码=中奖几率UP!</view> |
60 | </view> | 60 | </view> |
1 | +// pages/zeroSell/components/group-recommend-cell.js | ||
2 | +import { getImageUrl } from '../../../utils/util.js'; | ||
3 | +Component({ | ||
4 | + /** | ||
5 | + * 组件的属性列表 | ||
6 | + */ | ||
7 | + properties: { | ||
8 | + product: { | ||
9 | + type: Object, | ||
10 | + value: {}, | ||
11 | + observer(newValue) { | ||
12 | + newValue.default_images = getImageUrl(newValue.default_images, 483, 645); | ||
13 | + this.setData({ | ||
14 | + group_product: newValue | ||
15 | + }) | ||
16 | + } | ||
17 | + } | ||
18 | + }, | ||
19 | + | ||
20 | + /** | ||
21 | + * 组件的初始数据 | ||
22 | + */ | ||
23 | + data: { | ||
24 | + group_product: {}, | ||
25 | + group_number_image: '../../../images/tab@3x.png', | ||
26 | + free_post: '../../../images/free-post@3x.png' | ||
27 | + }, | ||
28 | + | ||
29 | + /** | ||
30 | + * 组件的方法列表 | ||
31 | + */ | ||
32 | + methods: { | ||
33 | + | ||
34 | + } | ||
35 | +}) |
1 | +<!--pages/zeroSell/components/group-recommend-cell.wxml--> | ||
2 | +<!-- <text>pages/zeroSell/components/group-recommend-cell.wxml</text> --> | ||
3 | + | ||
4 | +<view class="group-product-cell-bg"> | ||
5 | + <view class="group-product-header"> | ||
6 | + <image class="group-product-left-icon" src="{{group_number_image}}"></image> | ||
7 | + <image class="group-product-image" src="{{group_product.default_images}}"></image> | ||
8 | + </view> | ||
9 | + <view class="group-product-name">{{group_product.product_name}}</view> | ||
10 | + <view class="group-price"> | ||
11 | + <view class="group-prict-bg"> | ||
12 | + <text class="group-price-market">{{group_product.market_price_str}}</text> | ||
13 | + <text class="group-price-collage">{{group_product.collage_price_str}}</text> | ||
14 | + </view> | ||
15 | + <image class="group-free-post" src="{{free_post}}"></image> | ||
16 | + </view> | ||
17 | +</view> |
1 | +/* pages/zeroSell/components/group-recommend-cell.wxss */ | ||
2 | +.group-product-image { | ||
3 | + margin-left: -72rpx; | ||
4 | + width: 322rpx; | ||
5 | + height: 430rpx; | ||
6 | + z-index: 1; | ||
7 | +} | ||
8 | + | ||
9 | +.group-product-cell-bg { | ||
10 | + margin-top: 20rpx; | ||
11 | +} | ||
12 | + | ||
13 | +.group-product-header { | ||
14 | + display: flex; | ||
15 | + flex-direction: row; | ||
16 | +} | ||
17 | + | ||
18 | +.group-product-left-icon { | ||
19 | + margin-top: 10rpx; | ||
20 | + width: 88rpx; | ||
21 | + height: 40rpx; | ||
22 | + z-index: 2; | ||
23 | +} | ||
24 | + | ||
25 | +.group-product-name { | ||
26 | + width: 322rpx; | ||
27 | + height: 56rpx; | ||
28 | + font-family: PingFangSC-Medium; | ||
29 | + font-size: 20rpx; | ||
30 | + color: #444444; | ||
31 | + margin-top: 24rpx; | ||
32 | + margin-left: 16rpx; | ||
33 | + display: -webkit-box; | ||
34 | + overflow: hidden; | ||
35 | + text-overflow: ellipsis; | ||
36 | + word-wrap: break-word; | ||
37 | + white-space: normal !important; | ||
38 | + -webkit-line-clamp: 3; | ||
39 | + -webkit-box-orient: vertical; | ||
40 | +} | ||
41 | + | ||
42 | +.group-price { | ||
43 | + margin-left: 16rpx; | ||
44 | + display: flex; | ||
45 | + flex-direction: row; | ||
46 | + align-items: center; | ||
47 | +} | ||
48 | + | ||
49 | +.group-price-market { | ||
50 | + text-decoration: line-through; | ||
51 | +} | ||
52 | + | ||
53 | +.group-price-collage { | ||
54 | + font-size: 32rpx; | ||
55 | + color: #D0021B; | ||
56 | +} | ||
57 | + | ||
58 | +.group-prict-bg { | ||
59 | + font-size: 22rpx; | ||
60 | + color: #444444; | ||
61 | +} | ||
62 | + | ||
63 | +.group-free-post { | ||
64 | + width: 60rpx; | ||
65 | + height: 40rpx; | ||
66 | + margin-left: 20rpx; | ||
67 | +} |
pages/zeroSell/components/group-recommend.js
0 → 100644
1 | +// pages/zeroSell/components/group-recommend.js | ||
2 | +Component({ | ||
3 | + /** | ||
4 | + * 组件的属性列表 | ||
5 | + */ | ||
6 | + properties: { | ||
7 | + groupRecommendList: { | ||
8 | + type: Array, | ||
9 | + value: [] | ||
10 | + } | ||
11 | + }, | ||
12 | + | ||
13 | + /** | ||
14 | + * 组件的初始数据 | ||
15 | + */ | ||
16 | + data: { | ||
17 | + | ||
18 | + }, | ||
19 | + | ||
20 | + /** | ||
21 | + * 组件的方法列表 | ||
22 | + */ | ||
23 | + methods: { | ||
24 | + | ||
25 | + } | ||
26 | +}) |
1 | +<!--pages/zeroSell/components/group-recommend.wxml--> | ||
2 | +<view class="title-view"> | ||
3 | + <view class="space-line"></view> | ||
4 | + <text class="title">邀新团</text> | ||
5 | +</view> | ||
6 | +<view class="group-list"> | ||
7 | + <block wx:for="{{groupRecommendList}}"> | ||
8 | + <group-recommend-cell product="{{item}}"></group-recommend-cell> | ||
9 | + </block> | ||
10 | +</view> |
1 | +/* pages/zeroSell/components/group-recommend.wxss */ | ||
2 | + | ||
3 | +.group-list { | ||
4 | + display: flex; | ||
5 | + flex-direction: row; | ||
6 | + flex-wrap: wrap; | ||
7 | + justify-content: space-around; | ||
8 | + margin-left: 20rpx; | ||
9 | + margin-right: 20rpx; | ||
10 | +} | ||
11 | + | ||
12 | +.space-line { | ||
13 | + background-color: #444444; | ||
14 | + width: 8rpx; | ||
15 | + height: 30rpx; | ||
16 | + margin-right: 10rpx; | ||
17 | +} | ||
18 | + | ||
19 | +.title-view { | ||
20 | + margin-left: 32rpx; | ||
21 | + margin-top: 20rpx; | ||
22 | + font-size: 32rpx; | ||
23 | + color: #444444; | ||
24 | + letter-spacing: -0.14px; | ||
25 | + display: flex; | ||
26 | + flex-direction: row; | ||
27 | + align-items: center; | ||
28 | + font-family: PingFangSC-Medium; | ||
29 | +} |
@@ -105,6 +105,7 @@ Page(Object.assign({ | @@ -105,6 +105,7 @@ Page(Object.assign({ | ||
105 | app = getApp(); | 105 | app = getApp(); |
106 | 106 | ||
107 | this.service = new ZeroSellService(); | 107 | this.service = new ZeroSellService(); |
108 | + this.commonService = new CommonService(); | ||
108 | 109 | ||
109 | let data = {}; | 110 | let data = {}; |
110 | 111 | ||
@@ -152,6 +153,7 @@ Page(Object.assign({ | @@ -152,6 +153,7 @@ Page(Object.assign({ | ||
152 | }) | 153 | }) |
153 | 154 | ||
154 | this._getUser(); | 155 | this._getUser(); |
156 | + this._getGroupList(); | ||
155 | 157 | ||
156 | if (this.data.shareUid && this.data.scene) { | 158 | if (this.data.shareUid && this.data.scene) { |
157 | this._init(); | 159 | this._init(); |
@@ -205,6 +207,19 @@ Page(Object.assign({ | @@ -205,6 +207,19 @@ Page(Object.assign({ | ||
205 | 207 | ||
206 | }, | 208 | }, |
207 | 209 | ||
210 | + _getGroupList(page) { | ||
211 | + this.commonService.getGroupList({ | ||
212 | + limit: 20, | ||
213 | + page | ||
214 | + }).then(res => { | ||
215 | + if (res.code === 200 && res.data) { | ||
216 | + this.setData({ | ||
217 | + groupList: res.data.list | ||
218 | + }) | ||
219 | + } | ||
220 | + }); | ||
221 | + }, | ||
222 | + | ||
208 | _init() { | 223 | _init() { |
209 | let params = { | 224 | let params = { |
210 | actPrizeId: this.data.actPrizeId | 225 | actPrizeId: this.data.actPrizeId |
@@ -373,7 +388,7 @@ Page(Object.assign({ | @@ -373,7 +388,7 @@ Page(Object.assign({ | ||
373 | jumpByUrl(that.data.bannerUrl); | 388 | jumpByUrl(that.data.bannerUrl); |
374 | }, | 389 | }, |
375 | _getDetailBanner() { | 390 | _getDetailBanner() { |
376 | - let commonService = new CommonService() | 391 | + let commonService = this.commonService; |
377 | commonService.getResourceCode('ccc32dbedf164a52b4efa34383878860') | 392 | commonService.getResourceCode('ccc32dbedf164a52b4efa34383878860') |
378 | .then(data => { | 393 | .then(data => { |
379 | // console.log(data) | 394 | // console.log(data) |
@@ -13,6 +13,7 @@ | @@ -13,6 +13,7 @@ | ||
13 | "fellow-bar": "./components/fellow-bar", | 13 | "fellow-bar": "./components/fellow-bar", |
14 | "action-bar": "./components/action-bar", | 14 | "action-bar": "./components/action-bar", |
15 | "quickNavigation": "/pages/quickNavigation/quickNavigation", | 15 | "quickNavigation": "/pages/quickNavigation/quickNavigation", |
16 | - "zero-alert": "./components/alert" | 16 | + "zero-alert": "./components/alert", |
17 | + "group-recommend": "./components/group-recommend" | ||
17 | } | 18 | } |
18 | } | 19 | } |
@@ -28,6 +28,8 @@ | @@ -28,6 +28,8 @@ | ||
28 | <view class="fellow-bar" wx:if="{{product.status}}"> | 28 | <view class="fellow-bar" wx:if="{{product.status}}"> |
29 | <fellow-bar></fellow-bar> | 29 | <fellow-bar></fellow-bar> |
30 | </view> | 30 | </view> |
31 | +<group-recommend groupRecommendList="{{groupList}}"> | ||
32 | +</group-recommend> | ||
31 | 33 | ||
32 | <view class="action-bar"> | 34 | <view class="action-bar"> |
33 | <action-bar wx:if="{{isLogin}}" status="{{actionStatus}}" num="{{myPrizeCount}}" share-uid="{{shareUid}}" act-prize-id="{{actPrizeId}}" bindgetcode="changeActionStatus" bindshare="share" bind:requireauth="requireAuth" | 35 | <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 @@ | @@ -49,7 +51,6 @@ | ||
49 | </view> | 51 | </view> |
50 | </block> | 52 | </block> |
51 | </view> | 53 | </view> |
52 | - | ||
53 | <view class="foot"></view> | 54 | <view class="foot"></view> |
54 | 55 | ||
55 | </block> | 56 | </block> |
@@ -28,12 +28,14 @@ | @@ -28,12 +28,14 @@ | ||
28 | position: fixed; | 28 | position: fixed; |
29 | width: 100%; | 29 | width: 100%; |
30 | top: 0rpx; | 30 | top: 0rpx; |
31 | + z-index: 5; | ||
31 | } | 32 | } |
32 | 33 | ||
33 | .action-bar { | 34 | .action-bar { |
34 | position: fixed; | 35 | position: fixed; |
35 | width: 100%; | 36 | width: 100%; |
36 | - bottom: 0 | 37 | + bottom: 0; |
38 | + z-index: 5; | ||
37 | } | 39 | } |
38 | 40 | ||
39 | .foot { | 41 | .foot { |
@@ -26,6 +26,14 @@ | @@ -26,6 +26,14 @@ | ||
26 | </view> | 26 | </view> |
27 | </tabs-pane> | 27 | </tabs-pane> |
28 | 28 | ||
29 | + <tabs-pane name="已参加"> | ||
30 | + <view class="productList"> | ||
31 | + <block wx:for="{{list[2].products}}" wx:key="{{item.id}}"> | ||
32 | + <product-item product="{{item}}" class="product"></product-item> | ||
33 | + </block> | ||
34 | + </view> | ||
35 | + </tabs-pane> | ||
36 | + | ||
29 | <view class="list-foot-blank">{{footText}}</view> | 37 | <view class="list-foot-blank">{{footText}}</view> |
30 | </tabs> | 38 | </tabs> |
31 | 39 | ||
@@ -33,7 +41,7 @@ | @@ -33,7 +41,7 @@ | ||
33 | <image class="bottom-banner-img" src="{{bannerSrc}}"></image> | 41 | <image class="bottom-banner-img" src="{{bannerSrc}}"></image> |
34 | </view> | 42 | </view> |
35 | 43 | ||
36 | -<view class="bottom-bar"> | 44 | +<!-- <view class="bottom-bar"> |
37 | <block wx:if="{{isLogin}}"> | 45 | <block wx:if="{{isLogin}}"> |
38 | <view bindtap="goMyList">我的抽奖码</view> | 46 | <view bindtap="goMyList">我的抽奖码</view> |
39 | </block> | 47 | </block> |
@@ -41,7 +49,7 @@ | @@ -41,7 +49,7 @@ | ||
41 | <block wx:else> | 49 | <block wx:else> |
42 | <button class="bottom-btn" plain="true" hover-class="none" open-type="{{!hasUnionID ? 'getUserInfo':'getPhoneNumber'}}" bindgetphonenumber="getPhoneNumber" bindgetuserinfo='getUserInfo'>我的抽奖码</button> | 50 | <button class="bottom-btn" plain="true" hover-class="none" open-type="{{!hasUnionID ? 'getUserInfo':'getPhoneNumber'}}" bindgetphonenumber="getPhoneNumber" bindgetuserinfo='getUserInfo'>我的抽奖码</button> |
43 | </block> | 51 | </block> |
44 | -</view> | 52 | +</view> --> |
45 | 53 | ||
46 | <import src="../../../../vendors/zanui/toast/index.wxml"/> | 54 | <import src="../../../../vendors/zanui/toast/index.wxml"/> |
47 | <template is="zan-toast" data="{{zanToast}}"/> | 55 | <template is="zan-toast" data="{{zanToast}}"/> |
@@ -36,6 +36,14 @@ class CommonService extends Service { | @@ -36,6 +36,14 @@ class CommonService extends Service { | ||
36 | }) | 36 | }) |
37 | 37 | ||
38 | } | 38 | } |
39 | + | ||
40 | + getGroupList(data) { | ||
41 | + return this._get(API_HOST, Object.assign({ | ||
42 | + method: 'app.collage.promoteList', | ||
43 | + business_line: 'miniappGroup', | ||
44 | + joinLimit: 1 | ||
45 | + }, data)); | ||
46 | + } | ||
39 | } | 47 | } |
40 | 48 | ||
41 | export default CommonService; | 49 | export default CommonService; |
-
Please register or login to post a comment