默认提交
Showing
23 changed files
with
641 additions
and
19 deletions
... | @@ -47,7 +47,7 @@ var paths = { | ... | @@ -47,7 +47,7 @@ var paths = { |
47 | imgFiles: 'src/image/**/*', | 47 | imgFiles: 'src/image/**/*', |
48 | scssFiles: 'src/**/*.scss', | 48 | scssFiles: 'src/**/*.scss', |
49 | baseFiles: ['src/**/*.{png,js,json,wxml,wxss,wxs,ts,woff2}', '!src/assets/**/*', '!src/image/**/*'], | 49 | baseFiles: ['src/**/*.{png,js,json,wxml,wxss,wxs,ts,woff2}', '!src/assets/**/*', '!src/image/**/*'], |
50 | busFiles: ['src/**/*.{js,json}', '!src/assets/**/*', '!src/image/**/*', '!src/ui/**/*'], | 50 | busFiles: ['src/**/*.{js,json,wxs}', '!src/assets/**/*', '!src/image/**/*', '!src/ui/**/*'], |
51 | assetsDir: 'src/assets', | 51 | assetsDir: 'src/assets', |
52 | assetsImgFiles: 'src/assets/images/**/*.{png,jpg,jpeg,svg,gif}', | 52 | assetsImgFiles: 'src/assets/images/**/*.{png,jpg,jpeg,svg,gif}', |
53 | wxmlFiles: ['src/**/*.wxml'], | 53 | wxmlFiles: ['src/**/*.wxml'], | ... | ... |
... | @@ -31,6 +31,7 @@ | ... | @@ -31,6 +31,7 @@ |
31 | "devDependencies": { | 31 | "devDependencies": { |
32 | "del": "^4.0.0", | 32 | "del": "^4.0.0", |
33 | "gulp": "^4.0.0", | 33 | "gulp": "^4.0.0", |
34 | "gulp-changed": "^4.0.2", | ||
34 | "gulp-cached": "^1.1.1", | 35 | "gulp-cached": "^1.1.1", |
35 | "gulp-debug": "^4.0.0", | 36 | "gulp-debug": "^4.0.0", |
36 | "gulp-if": "^2.0.2", | 37 | "gulp-if": "^2.0.2", | ... | ... |
... | @@ -74,6 +74,9 @@ | ... | @@ -74,6 +74,9 @@ |
74 | "gift-rank-tips-comp": "../../component/gift-rank-tips-comp/gift-rank-tips-comp", | 74 | "gift-rank-tips-comp": "../../component/gift-rank-tips-comp/gift-rank-tips-comp", |
75 | "gift-sign-tips-comp": "../../component/gift-sign-tips-comp/gift-sign-tips-comp", | 75 | "gift-sign-tips-comp": "../../component/gift-sign-tips-comp/gift-sign-tips-comp", |
76 | "order-submit-success-tips-comp": "../../component/order-submit-success-tips-comp/order-submit-success-tips-comp", | 76 | "order-submit-success-tips-comp": "../../component/order-submit-success-tips-comp/order-submit-success-tips-comp", |
77 | "auction-bid-comp": "../../component/auction-bid-comp/auction-bid-comp", | ||
78 | "auction-bid-success-comp": "../../component/auction-bid-success-comp/auction-bid-success-comp", | ||
79 | "auction-bid-fail-comp": "../../component/auction-bid-fail-comp/auction-bid-fail-comp", | ||
77 | "empty-tips": "../../component/empty-tips/empty-tips", | 80 | "empty-tips": "../../component/empty-tips/empty-tips", |
78 | "empty-tips-light": "../../component/empty-tips-light/empty-tips-light", | 81 | "empty-tips-light": "../../component/empty-tips-light/empty-tips-light", |
79 | "van-popup": "../../ui/vant-weapp/popup/index" | 82 | "van-popup": "../../ui/vant-weapp/popup/index" | ... | ... |
... | @@ -116,6 +116,8 @@ | ... | @@ -116,6 +116,8 @@ |
116 | 116 | ||
117 | // 通用按钮 | 117 | // 通用按钮 |
118 | @mixin cb2($width:320px, $height:84px, $fontSize:32px) { | 118 | @mixin cb2($width:320px, $height:84px, $fontSize:32px) { |
119 | box-sizing: border-box; | ||
120 | background-color: transparent; | ||
119 | position: relative; | 121 | position: relative; |
120 | width: $width; | 122 | width: $width; |
121 | height: $height; | 123 | height: $height; | ... | ... |
1 | let app = getApp(); | ||
2 | Component({ | ||
3 | options: { | ||
4 | styleIsolation: 'apply-shared' | ||
5 | }, | ||
6 | properties: { | ||
7 | // 这里定义了innerText属性,属性值可以在组件使用时指定 | ||
8 | innerText: { | ||
9 | type: String, | ||
10 | value: 'default value', | ||
11 | }, | ||
12 | maxPrice: { | ||
13 | type: Number, | ||
14 | value: 0, | ||
15 | }, | ||
16 | productInfo: { | ||
17 | type: Object, | ||
18 | value: {}, | ||
19 | }, | ||
20 | }, | ||
21 | data: { | ||
22 | // 这里是一些组件内部数据 | ||
23 | someData: {}, | ||
24 | bidPrice: 0 | ||
25 | }, | ||
26 | methods: { | ||
27 | // 这里是一个自定义方法 | ||
28 | customMethod() { | ||
29 | this.triggerEvent('evtcomp', { | ||
30 | name: "_evt_custom" | ||
31 | }) | ||
32 | }, | ||
33 | // 设置价格 | ||
34 | setBidPrice(val) { | ||
35 | this.setData({ | ||
36 | bidPrice: val * 0.01 //表单以元作单位 | ||
37 | }) | ||
38 | }, | ||
39 | bindBidPriceInput(e) { | ||
40 | this.setData({ | ||
41 | bidPrice: e.detail.value | ||
42 | }); | ||
43 | }, | ||
44 | // 出价 | ||
45 | onSubmitHandler() { | ||
46 | let minPrice = (this.properties.maxPrice + this.properties.productInfo.minScope) * 0.01; | ||
47 | if (this.data.bidPrice < minPrice) { | ||
48 | wx.showToast({ | ||
49 | title: `出价不能低于¥${minPrice}`, | ||
50 | icon: 'none' | ||
51 | }) | ||
52 | return; | ||
53 | } | ||
54 | this.triggerEvent('evtcomp', { | ||
55 | name: "_evt_bid_submit", | ||
56 | data: { | ||
57 | bidPrice: this.data.bidPrice | ||
58 | } | ||
59 | }) | ||
60 | }, | ||
61 | |||
62 | // 隐藏蒙层 | ||
63 | hideMask() { | ||
64 | this.triggerEvent('evtcomp', { | ||
65 | name: "_evt_hide_mask" | ||
66 | }); | ||
67 | } | ||
68 | } | ||
69 | }) |
1 | @import '../../assets/scss/mixins'; | ||
2 | @import '../../assets/scss/utils'; | ||
3 | |||
4 | |||
5 | .comp-item { | ||
6 | width: 650px; | ||
7 | border-radius: 10px; | ||
8 | background-color: #ffffff; | ||
9 | color: #333333; | ||
10 | font-size: 28px; | ||
11 | // padding-bottom: 240px; | ||
12 | padding-bottom: 120px; | ||
13 | |||
14 | .cspace { | ||
15 | height: 76px; | ||
16 | } | ||
17 | |||
18 | .cont { | ||
19 | text-align: center; | ||
20 | |||
21 | .tit { | ||
22 | font-size: 36px; | ||
23 | font-weight: bold; | ||
24 | color: #333333; | ||
25 | } | ||
26 | |||
27 | .t1 { | ||
28 | font-size: 22px; | ||
29 | margin: 12px auto 0; | ||
30 | color: #666666; | ||
31 | } | ||
32 | |||
33 | .bid { | ||
34 | display: flex; | ||
35 | justify-content: center; | ||
36 | align-items: center; | ||
37 | margin: 72px auto 120px; | ||
38 | |||
39 | .ipt { | ||
40 | border: solid 1PX #8f8f8f; | ||
41 | width: 160px; | ||
42 | height: 60px; | ||
43 | border-radius: 6px; | ||
44 | margin: 0 32px; | ||
45 | } | ||
46 | } | ||
47 | } | ||
48 | |||
49 | .btn-wrap { | ||
50 | position: absolute; | ||
51 | left: 0; | ||
52 | right: 0; | ||
53 | bottom: 74px; | ||
54 | margin: 0 auto; | ||
55 | display: flex; | ||
56 | justify-content: center; | ||
57 | |||
58 | .btn { | ||
59 | @include cb(240px, 60px, 28px); | ||
60 | margin: 0 16px; | ||
61 | } | ||
62 | |||
63 | .btn2 { | ||
64 | @include cb2(240px, 60px, 28px); | ||
65 | } | ||
66 | } | ||
67 | } |
1 | <wxs module="filter" src="../../utils/utilswxs.wxs"></wxs> | ||
2 | <view class="comp-item"> | ||
3 | <view class="cspace"></view> | ||
4 | <view class="cont"> | ||
5 | <view class="tit">填写报价</view> | ||
6 | <view class="t1"> | ||
7 | 当前价格 | ||
8 | <span class="price">¥{{filter.Fen2Yuan(maxPrice)}}</span> | ||
9 | ,出价不得低于 | ||
10 | <span class="price">¥{{filter.Fen2Yuan(maxPrice + productInfo.minScope)}}</span> | ||
11 | </view> | ||
12 | <view class="bid"> | ||
13 | 我要报价 | ||
14 | <input value="{{bidPrice}}" class="val" bindinput="bindBidPriceInput" class="ipt" placeholder="{{maxPrice + productInfo.minScope}}" /> | ||
15 | 元 | ||
16 | </view> | ||
17 | </view> | ||
18 | <view class="btn-wrap"> | ||
19 | <view class="btn btn2" bindtap="hideMask">我再想想</view> | ||
20 | <view class="btn" bindtap="onSubmitHandler">确认出价</view> | ||
21 | </view> | ||
22 | </view> |
1 | let app = getApp(); | ||
2 | Component({ | ||
3 | options: { | ||
4 | styleIsolation: 'apply-shared' | ||
5 | }, | ||
6 | properties: { | ||
7 | // 这里定义了innerText属性,属性值可以在组件使用时指定 | ||
8 | // cid 用户区分组件 | ||
9 | cid: { | ||
10 | type: String, | ||
11 | value: '1', | ||
12 | }, | ||
13 | innerTitle: { | ||
14 | type: String, | ||
15 | value: '', | ||
16 | }, | ||
17 | innerText: { | ||
18 | type: String, | ||
19 | value: '', | ||
20 | }, | ||
21 | innerButton: { | ||
22 | type: String, | ||
23 | value: '确定', | ||
24 | }, | ||
25 | bidPrice: { | ||
26 | type: Number, | ||
27 | value: 0, | ||
28 | }, | ||
29 | }, | ||
30 | data: { | ||
31 | // 这里是一些组件内部数据 | ||
32 | someData: {} | ||
33 | }, | ||
34 | methods: { | ||
35 | // 这里是一个自定义方法 | ||
36 | customMethod() { | ||
37 | this.triggerEvent('evtcomp', { | ||
38 | name: "_evt_custom" | ||
39 | }) | ||
40 | }, | ||
41 | // 隐藏蒙层 | ||
42 | hideMask() { | ||
43 | this.triggerEvent('evtcomp', { | ||
44 | name: "_evt_hide_mask" | ||
45 | }); | ||
46 | }, | ||
47 | // 点击自定义按钮 | ||
48 | onInnerButtonHandler() { | ||
49 | this.triggerEvent('evtcomp', { | ||
50 | name: "_evt_re_bid" | ||
51 | }); | ||
52 | } | ||
53 | } | ||
54 | }) |
1 | @import '../../assets/scss/mixins'; | ||
2 | @import '../../assets/scss/utils'; | ||
3 | |||
4 | |||
5 | .comp-item { | ||
6 | width: 650px; | ||
7 | min-height: 496px; | ||
8 | border-radius: 10px; | ||
9 | background-color: #ffffff; | ||
10 | |||
11 | .cspace { | ||
12 | height: 76px; | ||
13 | } | ||
14 | |||
15 | .cont { | ||
16 | text-align: center; | ||
17 | width: 520px; | ||
18 | margin: 0 auto; | ||
19 | |||
20 | .logo { | ||
21 | margin: 0 auto; | ||
22 | width: 200px; | ||
23 | height: 153px; | ||
24 | |||
25 | image { | ||
26 | width: 200px; | ||
27 | height: 153px; | ||
28 | } | ||
29 | } | ||
30 | |||
31 | .tit { | ||
32 | font-size: 40px; | ||
33 | color: #333333; | ||
34 | } | ||
35 | |||
36 | .tips { | ||
37 | margin-top: 64px; | ||
38 | font-size: 22px; | ||
39 | color: #333333; | ||
40 | width: 520px; | ||
41 | padding-bottom: 244px; | ||
42 | } | ||
43 | } | ||
44 | |||
45 | .btn-wrap { | ||
46 | position: absolute; | ||
47 | left: 0; | ||
48 | right: 0; | ||
49 | bottom: 74px; | ||
50 | margin: 0 auto; | ||
51 | display: flex; | ||
52 | justify-content: center; | ||
53 | |||
54 | .btn { | ||
55 | @include cb(240px, 60px, 28px); | ||
56 | margin: 0 16px; | ||
57 | } | ||
58 | |||
59 | .btn2 { | ||
60 | @include cb2(240px, 60px, 28px); | ||
61 | } | ||
62 | } | ||
63 | |||
64 | |||
65 | |||
66 | } |
1 | <view class="comp-item"> | ||
2 | <view class="cspace"></view> | ||
3 | <view class="cont"> | ||
4 | <view class="tit">{{innerTitle}}</view> | ||
5 | <view class="tips"> | ||
6 | 来晚一步!另有用户也一样出价 | ||
7 | <span class="price">¥{{bidPrice}}</span> | ||
8 | 哦 | ||
9 | </view> | ||
10 | </view> | ||
11 | <view class="btn-wrap"> | ||
12 | <view bindtap="hideMask" class="btn btn2">我再想想</view> | ||
13 | <view bindtap="onInnerButtonHandler" class="btn">重新报价</view> | ||
14 | </view> | ||
15 | </view> |
1 | let app = getApp(); | ||
2 | Component({ | ||
3 | options: { | ||
4 | styleIsolation: 'apply-shared' | ||
5 | }, | ||
6 | properties: { | ||
7 | // 这里定义了innerText属性,属性值可以在组件使用时指定 | ||
8 | // cid 用户区分组件 | ||
9 | cid: { | ||
10 | type: String, | ||
11 | value: '1', | ||
12 | }, | ||
13 | innerTitle: { | ||
14 | type: String, | ||
15 | value: '', | ||
16 | }, | ||
17 | innerText: { | ||
18 | type: String, | ||
19 | value: '', | ||
20 | }, | ||
21 | innerButton: { | ||
22 | type: String, | ||
23 | value: '确定', | ||
24 | }, | ||
25 | bidPrice: { | ||
26 | type: Number, | ||
27 | value: 0, | ||
28 | }, | ||
29 | }, | ||
30 | data: { | ||
31 | // 这里是一些组件内部数据 | ||
32 | someData: {} | ||
33 | }, | ||
34 | methods: { | ||
35 | // 这里是一个自定义方法 | ||
36 | customMethod() { | ||
37 | this.triggerEvent('evtcomp', { | ||
38 | name: "_evt_custom" | ||
39 | }) | ||
40 | }, | ||
41 | // 隐藏蒙层 | ||
42 | hideMask() { | ||
43 | this.triggerEvent('evtcomp', { | ||
44 | name: "_evt_hide_mask" | ||
45 | }); | ||
46 | }, | ||
47 | // 点击自定义按钮 | ||
48 | onInnerButtonHandler() { | ||
49 | this.triggerEvent('evtcomp', { | ||
50 | name: "_evt_continue_auction" | ||
51 | }); | ||
52 | } | ||
53 | } | ||
54 | }) |
1 | @import '../../assets/scss/mixins'; | ||
2 | @import '../../assets/scss/utils'; | ||
3 | |||
4 | |||
5 | .comp-item { | ||
6 | width: 650px; | ||
7 | min-height: 496px; | ||
8 | border-radius: 10px; | ||
9 | background-color: #ffffff; | ||
10 | |||
11 | .cspace { | ||
12 | height: 76px; | ||
13 | } | ||
14 | |||
15 | .cont { | ||
16 | text-align: center; | ||
17 | width: 520px; | ||
18 | margin: 0 auto; | ||
19 | |||
20 | .logo { | ||
21 | margin: 0 auto; | ||
22 | width: 200px; | ||
23 | height: 153px; | ||
24 | |||
25 | image { | ||
26 | width: 200px; | ||
27 | height: 153px; | ||
28 | } | ||
29 | } | ||
30 | |||
31 | .tit { | ||
32 | font-size: 40px; | ||
33 | color: #333333; | ||
34 | } | ||
35 | |||
36 | .tips { | ||
37 | margin-top: 64px; | ||
38 | font-size: 22px; | ||
39 | color: #333333; | ||
40 | width: 520px; | ||
41 | padding-bottom: 244px; | ||
42 | } | ||
43 | } | ||
44 | |||
45 | .btn-wrap { | ||
46 | position: absolute; | ||
47 | left: 0; | ||
48 | right: 0; | ||
49 | bottom: 74px; | ||
50 | margin: 0 auto; | ||
51 | display: flex; | ||
52 | justify-content: center; | ||
53 | |||
54 | .btn { | ||
55 | @include cb(240px, 60px, 28px); | ||
56 | margin: 0 16px; | ||
57 | } | ||
58 | |||
59 | .btn2 { | ||
60 | @include cb2(240px, 60px, 28px); | ||
61 | } | ||
62 | } | ||
63 | |||
64 | |||
65 | |||
66 | } |
1 | <view class="comp-item"> | ||
2 | <view class="cspace"></view> | ||
3 | <view class="cont"> | ||
4 | <view class="tit">{{innerTitle}}</view> | ||
5 | <view class="tips"> | ||
6 | 我的出价 | ||
7 | <span class="price">¥{{bidPrice}}</span> | ||
8 | 出价成功,请返回活动查看详情 | ||
9 | </view> | ||
10 | </view> | ||
11 | <view class="btn-wrap"> | ||
12 | <view bindtap="onInnerButtonHandler" class="btn">返回活动</view> | ||
13 | </view> | ||
14 | </view> |
1 | <wxs module="filter" src="../../utils/utilswxs.wxs"></wxs> | ||
1 | <view class="page"> | 2 | <view class="page"> |
2 | <view class="app__bgc bgc"></view> | 3 | <view class="app__bgc bgc"></view> |
3 | <view class="app__bg bg"></view> | 4 | <view class="app__bg bg"></view> |
... | @@ -21,7 +22,7 @@ | ... | @@ -21,7 +22,7 @@ |
21 | <view class="block">{{index == 0 ? "领先" : "淘汰"}}</view> | 22 | <view class="block">{{index == 0 ? "领先" : "淘汰"}}</view> |
22 | </view> | 23 | </view> |
23 | <view class="item item2">{{item.memberPhone}}</view> | 24 | <view class="item item2">{{item.memberPhone}}</view> |
24 | <view class="item item3">¥{{item.priceStr}}</view> | 25 | <view class="item item3">¥{{filter.Fen2Yuan(item.price)}}</view> |
25 | <view class="item item4">{{item.recordTime}}</view> | 26 | <view class="item item4">{{item.recordTime}}</view> |
26 | </view> | 27 | </view> |
27 | </view> | 28 | </view> | ... | ... |
1 | import { | 1 | import { |
2 | getBindtapData | 2 | getBindtapData, |
3 | } from '../../utils/util'; | 3 | } from '../../utils/util'; |
4 | let Date = require('../../utils/date.js'); | 4 | let Date = require('../../utils/date.js'); |
5 | var timer = require('../../utils/wxTimer.js'); | 5 | var timer = require('../../utils/wxTimer.js'); |
... | @@ -10,6 +10,9 @@ let app = getApp(); | ... | @@ -10,6 +10,9 @@ let app = getApp(); |
10 | Page({ | 10 | Page({ |
11 | data: { | 11 | data: { |
12 | authorizeVisible: false, | 12 | authorizeVisible: false, |
13 | auctionBidVisible: false, | ||
14 | auctionBidSuccessVisible: false, | ||
15 | auctionBidFailVisible: false, | ||
13 | userInfo: {}, | 16 | userInfo: {}, |
14 | productInfo: {}, | 17 | productInfo: {}, |
15 | priceInfo: [], | 18 | priceInfo: [], |
... | @@ -23,6 +26,7 @@ Page({ | ... | @@ -23,6 +26,7 @@ Page({ |
23 | options: {}, | 26 | options: {}, |
24 | wxTimerList: {}, | 27 | wxTimerList: {}, |
25 | lastTime: "", | 28 | lastTime: "", |
29 | bidPrice: 0, // 我的出价 单位元 | ||
26 | }, | 30 | }, |
27 | onShareAppMessage() {}, | 31 | onShareAppMessage() {}, |
28 | showAuth() { | 32 | showAuth() { |
... | @@ -112,7 +116,7 @@ Page({ | ... | @@ -112,7 +116,7 @@ Page({ |
112 | /** | 116 | /** |
113 | * 点击显示详情 | 117 | * 点击显示详情 |
114 | */ | 118 | */ |
115 | onShowAuctionBidDetailHandler() { | 119 | onShowAuctionBidDetailHandler(evt) { |
116 | app.router.push({ | 120 | app.router.push({ |
117 | path: "auctionBidDetail", | 121 | path: "auctionBidDetail", |
118 | query: { | 122 | query: { |
... | @@ -122,6 +126,24 @@ Page({ | ... | @@ -122,6 +126,24 @@ Page({ |
122 | }, | 126 | }, |
123 | 127 | ||
124 | /** | 128 | /** |
129 | * 我要出价 | ||
130 | */ | ||
131 | onSubmitHandler() { | ||
132 | let productInfo = this.data.productInfo; | ||
133 | if (productInfo && productInfo.status == 1) { | ||
134 | this.setData({ | ||
135 | auctionBidVisible: true | ||
136 | }) | ||
137 | let maxPrice = this.data.maxPrice; | ||
138 | let minBidPrice = maxPrice + productInfo.minScope; | ||
139 | this.auctionBidComp = this.selectComponent("#auctionBidComp"); | ||
140 | if (this.auctionBidComp) { | ||
141 | this.auctionBidComp.setBidPrice(minBidPrice); | ||
142 | } | ||
143 | } | ||
144 | }, | ||
145 | |||
146 | /** | ||
125 | * 秒杀详情 | 147 | * 秒杀详情 |
126 | */ | 148 | */ |
127 | queryAuctionDetail() { | 149 | queryAuctionDetail() { |
... | @@ -136,7 +158,6 @@ Page({ | ... | @@ -136,7 +158,6 @@ Page({ |
136 | auctionCode: code | 158 | auctionCode: code |
137 | } | 159 | } |
138 | }).then((result) => { | 160 | }).then((result) => { |
139 | result.delayPeriod = (result.delayPeriod / 60) + "分钟"; | ||
140 | this.setData({ | 161 | this.setData({ |
141 | productInfo: result | 162 | productInfo: result |
142 | }) | 163 | }) |
... | @@ -159,6 +180,7 @@ Page({ | ... | @@ -159,6 +180,7 @@ Page({ |
159 | * 获得最高价 和列表 | 180 | * 获得最高价 和列表 |
160 | */ | 181 | */ |
161 | queryAuctionRecordLast() { | 182 | queryAuctionRecordLast() { |
183 | return new Promise((resolve, reject) => { | ||
162 | let code = this.data.options.code; | 184 | let code = this.data.options.code; |
163 | if (code) { | 185 | if (code) { |
164 | app.post({ | 186 | app.post({ |
... | @@ -172,14 +194,63 @@ Page({ | ... | @@ -172,14 +194,63 @@ Page({ |
172 | element.recordTime = new Date(element.recordTime).toString("yyyy.MM.dd hh:mm:ss"); | 194 | element.recordTime = new Date(element.recordTime).toString("yyyy.MM.dd hh:mm:ss"); |
173 | element.memberPhone = element.memberPhone.substr(0, 3) + '****' + element.memberPhone.substr(7); | 195 | element.memberPhone = element.memberPhone.substr(0, 3) + '****' + element.memberPhone.substr(7); |
174 | }); | 196 | }); |
175 | priceInfo = []; | ||
176 | this.setData({ | 197 | this.setData({ |
177 | priceInfo: priceInfo, | 198 | priceInfo: priceInfo, |
178 | maxPrice: result.maxPrice || 0, | 199 | maxPrice: result.maxPrice || 0, |
179 | priceTotal: result.total || 0 | 200 | priceTotal: result.total || 0 |
180 | }) | 201 | }) |
202 | resolve(); | ||
181 | }); | 203 | }); |
204 | } else { | ||
205 | resolve(); | ||
206 | } | ||
207 | }) | ||
208 | |||
209 | |||
210 | }, | ||
211 | |||
212 | /** | ||
213 | * 拍卖出价提交 | ||
214 | * @param {*} price | ||
215 | */ | ||
216 | queryAuctionSubmit(price) { | ||
217 | let code = this.data.options.code; | ||
218 | this.setData({ | ||
219 | bidPrice: price | ||
220 | }) | ||
221 | app.post({ | ||
222 | toast: false, | ||
223 | url: app.api.auctionSubmit, | ||
224 | data: { | ||
225 | auctionCode: code, | ||
226 | price: price * 100 //转成分 | ||
182 | } | 227 | } |
228 | }).then((result) => { | ||
229 | console.log("result:", result); | ||
230 | this.queryAuctionRecordLast().then((res2) => { | ||
231 | this.setData({ | ||
232 | auctionBidSuccessVisible: true | ||
233 | }) | ||
234 | }) | ||
235 | }).catch((err) => { | ||
236 | console.log("queryAuctionSubmit err:", err); | ||
237 | this.queryAuctionRecordLast().then((res2) => { | ||
238 | switch (err.code) { | ||
239 | // 来晚一步,该价格已经被其他用户提交 显示组件 | ||
240 | case 1010: | ||
241 | this.setData({ | ||
242 | auctionBidFailVisible: true | ||
243 | }) | ||
244 | break; | ||
245 | |||
246 | default: | ||
247 | wx.showToast({ | ||
248 | title: err.errMsg || "系统开小差" | ||
249 | }) | ||
250 | break; | ||
251 | } | ||
252 | }) | ||
253 | }); | ||
183 | }, | 254 | }, |
184 | 255 | ||
185 | /** | 256 | /** |
... | @@ -283,6 +354,9 @@ Page({ | ... | @@ -283,6 +354,9 @@ Page({ |
283 | hideMask() { | 354 | hideMask() { |
284 | this.setData({ | 355 | this.setData({ |
285 | authorizeVisible: false, | 356 | authorizeVisible: false, |
357 | auctionBidVisible: false, | ||
358 | auctionBidSuccessVisible: false, | ||
359 | auctionBidFailVisible: false, | ||
286 | }) | 360 | }) |
287 | }, | 361 | }, |
288 | // 子组件事件 | 362 | // 子组件事件 |
... | @@ -291,6 +365,7 @@ Page({ | ... | @@ -291,6 +365,7 @@ Page({ |
291 | name, | 365 | name, |
292 | data | 366 | data |
293 | } = evt.detail; | 367 | } = evt.detail; |
368 | console.log("@auction-detail || evt:", name) | ||
294 | switch (name) { | 369 | switch (name) { |
295 | 370 | ||
296 | // 隐藏弹窗 | 371 | // 隐藏弹窗 |
... | @@ -298,6 +373,27 @@ Page({ | ... | @@ -298,6 +373,27 @@ Page({ |
298 | this.hideMask(); | 373 | this.hideMask(); |
299 | break; | 374 | break; |
300 | 375 | ||
376 | // 拍卖出价 | ||
377 | case "_evt_bid_submit": | ||
378 | let { | ||
379 | bidPrice | ||
380 | } = data; | ||
381 | console.log("bidPrice:", bidPrice); | ||
382 | this.hideMask(); | ||
383 | this.queryAuctionSubmit(bidPrice); | ||
384 | break; | ||
385 | |||
386 | // 返回活动 | ||
387 | case "_evt_continue_auction": | ||
388 | this.hideMask(); | ||
389 | break; | ||
390 | |||
391 | // 重新报价 | ||
392 | case "_evt_re_bid": | ||
393 | this.hideMask(); | ||
394 | this.onSubmitHandler(); | ||
395 | break; | ||
396 | |||
301 | default: | 397 | default: |
302 | break; | 398 | break; |
303 | } | 399 | } | ... | ... |
... | @@ -66,12 +66,10 @@ $contentWidth:690px; | ... | @@ -66,12 +66,10 @@ $contentWidth:690px; |
66 | @extend .bb; | 66 | @extend .bb; |
67 | 67 | ||
68 | .price { | 68 | .price { |
69 | color: #cb3939; | ||
70 | font-size: 52px; | 69 | font-size: 52px; |
71 | font-weight: bold; | 70 | font-weight: bold; |
72 | } | 71 | } |
73 | 72 | ||
74 | |||
75 | } | 73 | } |
76 | 74 | ||
77 | &-left { | 75 | &-left { |
... | @@ -240,10 +238,16 @@ $contentWidth:690px; | ... | @@ -240,10 +238,16 @@ $contentWidth:690px; |
240 | } | 238 | } |
241 | } | 239 | } |
242 | 240 | ||
243 | .tips { | 241 | .all-bid-tips { |
244 | color: #3680EB; | 242 | color: #3680EB; |
245 | margin-top: 32px; | 243 | margin-top: 32px; |
246 | } | 244 | } |
245 | |||
246 | .empty-tips{ | ||
247 | text-align: center; | ||
248 | padding: 60px 0; | ||
249 | color: #666666; | ||
250 | } | ||
247 | } | 251 | } |
248 | } | 252 | } |
249 | 253 | ... | ... |
1 | <wxs module="filter" src="../../utils/utilswxs.wxs"></wxs> | ||
1 | <view class="page"> | 2 | <view class="page"> |
2 | <view class="app__bgc bgc"></view> | 3 | <view class="app__bgc bgc"></view> |
3 | <view class="app__bg bg"></view> | 4 | <view class="app__bg bg"></view> |
... | @@ -19,7 +20,7 @@ | ... | @@ -19,7 +20,7 @@ |
19 | <view class="func"> | 20 | <view class="func"> |
20 | <view class="arrow"></view> | 21 | <view class="arrow"></view> |
21 | <view class="func-ele func-left"> | 22 | <view class="func-ele func-left"> |
22 | <text class="price">¥{{maxPrice}}</text> | 23 | <text class="price">¥{{filter.Fen2Yuan(maxPrice)}}</text> |
23 | <text class="t1">当前价格</text> | 24 | <text class="t1">当前价格</text> |
24 | </view> | 25 | </view> |
25 | <view class="func-ele func-right {{productInfo.status != 1 ? 'disable' : ''}}"> | 26 | <view class="func-ele func-right {{productInfo.status != 1 ? 'disable' : ''}}"> |
... | @@ -41,10 +42,10 @@ | ... | @@ -41,10 +42,10 @@ |
41 | <!-- 拍卖详情 --> | 42 | <!-- 拍卖详情 --> |
42 | <view class="auction"> | 43 | <view class="auction"> |
43 | <view class="auction-desc"> | 44 | <view class="auction-desc"> |
44 | <view class="t1">产品原价:{{productInfo.originalPrice}}元</view> | 45 | <view class="t1">产品原价:{{filter.Fen2Yuan(productInfo.originalPrice)}} 元</view> |
45 | <view class="t1">起拍价:{{productInfo.startPrice}}元</view> | 46 | <view class="t1">起拍价:{{filter.Fen2Yuan(productInfo.startPrice)}}元</view> |
46 | <view class="t1">最小加价幅度:{{productInfo.minScope}}元</view> | 47 | <view class="t1">最小加价幅度:{{filter.Fen2Yuan(productInfo.minScope)}}元</view> |
47 | <view class="t1">延时周期:{{productInfo.delayPeriod}}</view> | 48 | <view class="t1">延时周期: {{filter.msTimeFormat(productInfo.delayPeriod)}}</view> |
48 | </view> | 49 | </view> |
49 | <view class="auction-table"> | 50 | <view class="auction-table"> |
50 | <view wx:if="{{priceInfo && priceInfo.length > 0}}"> | 51 | <view wx:if="{{priceInfo && priceInfo.length > 0}}"> |
... | @@ -62,20 +63,35 @@ | ... | @@ -62,20 +63,35 @@ |
62 | <view class="block">{{index == 0 ? "领先" : "淘汰"}}</view> | 63 | <view class="block">{{index == 0 ? "领先" : "淘汰"}}</view> |
63 | </view> | 64 | </view> |
64 | <view class="item item2">{{item.memberPhone}}</view> | 65 | <view class="item item2">{{item.memberPhone}}</view> |
65 | <view class="item item3">¥{{item.priceStr}}</view> | 66 | <view class="item item3">¥{{filter.Fen2Yuan(item.price)}}</view> |
66 | <view class="item item4">{{item.recordTime}}</view> | 67 | <view class="item item4">{{item.recordTime}}</view> |
67 | </view> | 68 | </view> |
68 | </view> | 69 | </view> |
69 | <view bindtap="onShowAuctionBidDetailHandler" class="tips">查看所有{{priceTotal}}次出价></view> | 70 | <view bindtap="onShowAuctionBidDetailHandler" class="all-bid-tips"> |
71 | 查看所有{{priceTotal}}次出价> | ||
72 | </view> | ||
73 | </view> | ||
74 | <view class="empty-tips" wx:else> | ||
75 | <text>大家都很矜持,该拍卖还未有人出价</text> | ||
70 | </view> | 76 | </view> |
71 | <view wx:else>大家都很矜持,该拍卖还未有人出价</view> | ||
72 | </view> | 77 | </view> |
73 | </view> | 78 | </view> |
74 | </view> | 79 | </view> |
75 | <!-- 按钮 --> | 80 | <!-- 按钮 --> |
76 | <view class="submit-btn">我要出价</view> | 81 | <view bindtap="onSubmitHandler" class="submit-btn {{productInfo.status != 1 ? 'disable' : ''}}"> |
82 | 我要出价 | ||
83 | </view> | ||
77 | </view> | 84 | </view> |
78 | </view> | 85 | </view> |
79 | <van-popup show="{{ authorizeVisible }}"> | 86 | <van-popup show="{{ authorizeVisible }}"> |
80 | <authorize-comp bind:evtcomp="evtcomp"></authorize-comp> | 87 | <authorize-comp bind:evtcomp="evtcomp"></authorize-comp> |
81 | </van-popup> | 88 | </van-popup> |
89 | <van-popup show="{{ auctionBidVisible }}"> | ||
90 | <auction-bid-comp id="auctionBidComp" max-price="{{maxPrice}}" product-info="{{productInfo}}" bind:evtcomp="evtcomp"></auction-bid-comp> | ||
91 | </van-popup> | ||
92 | <van-popup show="{{ auctionBidSuccessVisible }}"> | ||
93 | <auction-bid-success-comp bid-price="{{bidPrice}}" inner-title="成功出价" bind:evtcomp="evtcomp"></auction-bid-success-comp> | ||
94 | </van-popup> | ||
95 | <van-popup show="{{ auctionBidFailVisible }}"> | ||
96 | <auction-bid-fail-comp inner-title="出价失败" bind:evtcomp="evtcomp"></auction-bid-fail-comp> | ||
97 | </van-popup> | ... | ... |
... | @@ -122,6 +122,20 @@ function formatWeek(week) { | ... | @@ -122,6 +122,20 @@ function formatWeek(week) { |
122 | return result; | 122 | return result; |
123 | } | 123 | } |
124 | 124 | ||
125 | /** | ||
126 | * 分转成元 | ||
127 | * @param {*} fen | ||
128 | */ | ||
129 | function Fen2Yuan(fen, k = false) { | ||
130 | var num = fen * 0.01; //分到元 | ||
131 | num += ''; //转成字符串 | ||
132 | if (k) { | ||
133 | var reg = num.indexOf('.') > -1 ? /(\d{1,3})(?=(?:\d{3})+\.)/g : /(\d{1,3})(?=(?:\d{3})+$)/g; //千分符的正则 | ||
134 | num = num.replace(reg, '$1,'); //千分位格式化 | ||
135 | } | ||
136 | return num; | ||
137 | } | ||
138 | |||
125 | 139 | ||
126 | /** | 140 | /** |
127 | * 根据url获取参数 | 141 | * 根据url获取参数 |
... | @@ -244,4 +258,5 @@ module.exports = { | ... | @@ -244,4 +258,5 @@ module.exports = { |
244 | wxacodeGet: wxacodeGet, | 258 | wxacodeGet: wxacodeGet, |
245 | getObjByListKeyValue: getObjByListKeyValue, | 259 | getObjByListKeyValue: getObjByListKeyValue, |
246 | getQueryByUrl: getQueryByUrl, | 260 | getQueryByUrl: getQueryByUrl, |
261 | Fen2Yuan: Fen2Yuan | ||
247 | } | 262 | } | ... | ... |
src/utils/utilswxs.wxs
0 → 100644
1 | var filter = { | ||
2 | // 分转元 | ||
3 | Fen2Yuan: function (val) { | ||
4 | var result = val * 0.01; //分到元 | ||
5 | // result += ''; //转成字符串 | ||
6 | // result = result.toFixed(2); //留两位小数 | ||
7 | return result.toFixed(2); | ||
8 | }, | ||
9 | // 毫秒转格式 | ||
10 | msTimeFormat: function (val, day = true) { | ||
11 | // var result = (val / 60 / 1000) + "分钟"; | ||
12 | var t = val; | ||
13 | if (t <= 0) return "-"; | ||
14 | var d = Math.floor(t / 1000 / 60 / 60 / 24); | ||
15 | var h = Math.floor(t / 1000 / 60 / 60 % 24) + (day ? 0 : 24 * d); // 含日的话,就不用24*d了 | ||
16 | var m = Math.floor(t / 1000 / 60 % 60); | ||
17 | var s = Math.floor(t / 1000 % 60); | ||
18 | var zeroStr = ""; | ||
19 | var dStr = d + ""; | ||
20 | var hStr = h < 10 ? zeroStr + h : h; | ||
21 | var mStr = m < 10 ? zeroStr + m : m; | ||
22 | var sStr = s < 10 ? zeroStr + s : s; | ||
23 | var result = ""; | ||
24 | if (d > 0 && day) { | ||
25 | result = dStr + "天" + hStr + "时" + mStr + "分" + sStr + "秒"; | ||
26 | } else { | ||
27 | if (h > 0) { | ||
28 | result = hStr + "时" + mStr + "分" + sStr + "秒"; | ||
29 | } else { | ||
30 | if (m > 0) { | ||
31 | result = mStr + "分" + sStr + "秒"; | ||
32 | } else { | ||
33 | result = sStr + "秒"; | ||
34 | } | ||
35 | } | ||
36 | } | ||
37 | |||
38 | return result; | ||
39 | } | ||
40 | } | ||
41 | |||
42 | module.exports = { | ||
43 | Fen2Yuan: filter.Fen2Yuan, | ||
44 | msTimeFormat: filter.msTimeFormat, | ||
45 | |||
46 | } |
-
Please register or sign in to post a comment