默认提交
Showing
18 changed files
with
338 additions
and
71 deletions
... | @@ -10,7 +10,8 @@ | ... | @@ -10,7 +10,8 @@ |
10 | </view> | 10 | </view> |
11 | </view> | 11 | </view> |
12 | <view class="btn-wrap"> | 12 | <view class="btn-wrap"> |
13 | <button class="btn gray" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">确认授权</button> | 13 | <!-- <button class="btn gray" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">确认授权</button> --> |
14 | <button class="btn gray" bindtap="hideMask">暂不授权</button> | ||
14 | <button class="btn" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">确认授权</button> | 15 | <button class="btn" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">确认授权</button> |
15 | </view> | 16 | </view> |
16 | </view> | 17 | </view> | ... | ... |
... | @@ -30,11 +30,22 @@ Component({ | ... | @@ -30,11 +30,22 @@ Component({ |
30 | type: Object, | 30 | type: Object, |
31 | value: {} | 31 | value: {} |
32 | }, | 32 | }, |
33 | // 订单状态 | ||
34 | orderStatus: { | ||
35 | type: Number, | ||
36 | value: 0, | ||
37 | }, | ||
38 | // 是否售罄 | ||
39 | isSellOut: { | ||
40 | type: Boolean, | ||
41 | value: false, | ||
42 | } | ||
33 | }, | 43 | }, |
34 | data: { | 44 | data: { |
35 | // 这里是一些组件内部数据 | 45 | // 这里是一些组件内部数据 |
36 | someData: {}, | 46 | someData: {}, |
37 | num: 1, | 47 | num: 1, |
48 | remark: "", | ||
38 | }, | 49 | }, |
39 | methods: { | 50 | methods: { |
40 | 51 | ||
... | @@ -47,22 +58,51 @@ Component({ | ... | @@ -47,22 +58,51 @@ Component({ |
47 | onStepperChange(e) { | 58 | onStepperChange(e) { |
48 | this.setNum(e.detail); | 59 | this.setNum(e.detail); |
49 | }, | 60 | }, |
61 | bindRemarkInput(e) { | ||
62 | this.setData({ | ||
63 | remark: e.detail.value | ||
64 | }); | ||
65 | }, | ||
50 | setNum(val) { | 66 | setNum(val) { |
51 | this.setData({ | 67 | this.setData({ |
52 | num: val | 68 | num: val |
53 | }) | 69 | }) |
54 | }, | 70 | }, |
71 | setRemark(val) { | ||
72 | this.setData({ | ||
73 | remark: val | ||
74 | }) | ||
75 | }, | ||
55 | // 隐藏蒙层 | 76 | // 隐藏蒙层 |
56 | hideMask() { | 77 | hideMask() { |
57 | this.triggerEvent('evtcomp', { | 78 | this.triggerEvent('evtcomp', { |
58 | name: "_evt_hide_mask" | 79 | name: "_evt_hide_mask" |
59 | }); | 80 | }); |
60 | }, | 81 | }, |
82 | |||
61 | // 点击自定义按钮 | 83 | // 点击自定义按钮 |
62 | onInnerButtonHandler() { | 84 | onInnerButtonHandler(evt) { |
63 | this.triggerEvent('evtcomp', { | 85 | this.triggerEvent('evtcomp', { |
64 | name: "_evt_hide_mask" | 86 | name: "_evt_hide_mask" |
65 | }); | 87 | }); |
88 | }, | ||
89 | |||
90 | // 确认下单 | ||
91 | onSubmitOrderHandler(evt) { | ||
92 | this.triggerEvent('evtcomp', { | ||
93 | name: "_evt_submit_order", | ||
94 | data: { | ||
95 | num: this.data.num, | ||
96 | remark: this.data.remark, | ||
97 | } | ||
98 | }); | ||
99 | }, | ||
100 | |||
101 | // 返回个人中心 | ||
102 | onReturnUserCenterHandler(evt) { | ||
103 | this.triggerEvent('evtcomp', { | ||
104 | name: "_evt_return_user_center" | ||
105 | }); | ||
66 | } | 106 | } |
67 | } | 107 | } |
68 | }) | 108 | }) | ... | ... |
... | @@ -16,8 +16,19 @@ | ... | @@ -16,8 +16,19 @@ |
16 | color: #333333; | 16 | color: #333333; |
17 | } | 17 | } |
18 | 18 | ||
19 | .succ { | ||
20 | position: absolute; | ||
21 | left: 0; | ||
22 | right: 0; | ||
23 | top: 24px; | ||
24 | margin: 0 auto; | ||
25 | width: 100%; | ||
26 | text-align: center; | ||
27 | color: #3680EB; | ||
28 | } | ||
29 | |||
19 | .cspace { | 30 | .cspace { |
20 | height: 76px; | 31 | height: 120px; |
21 | } | 32 | } |
22 | 33 | ||
23 | .cont { | 34 | .cont { |
... | @@ -39,7 +50,7 @@ | ... | @@ -39,7 +50,7 @@ |
39 | 50 | ||
40 | .con { | 51 | .con { |
41 | @extend .bb; | 52 | @extend .bb; |
42 | padding: 0 0 0 24px; | 53 | padding: 0 0 0 32px; |
43 | display: flex; | 54 | display: flex; |
44 | align-content: space-between; | 55 | align-content: space-between; |
45 | justify-content: flex-start; | 56 | justify-content: flex-start; | ... | ... |
... | @@ -3,6 +3,8 @@ | ... | @@ -3,6 +3,8 @@ |
3 | <span class="iconfont iconbaseline-close-px remove" bindtap="hideMask"></span> | 3 | <span class="iconfont iconbaseline-close-px remove" bindtap="hideMask"></span> |
4 | <view class="cspace"></view> | 4 | <view class="cspace"></view> |
5 | <view class="cont"> | 5 | <view class="cont"> |
6 | <view wx:if="{{orderStatus == 1}}" class="succ">下单成功</view> | ||
7 | <!-- 产品 --> | ||
6 | <view class="product"> | 8 | <view class="product"> |
7 | <view class="prize"> | 9 | <view class="prize"> |
8 | <image class="image" mode="aspectFill" src="{{productInfo.seckillImages && productInfo.seckillImages[0] || ''}}" /> | 10 | <image class="image" mode="aspectFill" src="{{productInfo.seckillImages && productInfo.seckillImages[0] || ''}}" /> |
... | @@ -28,8 +30,14 @@ | ... | @@ -28,8 +30,14 @@ |
28 | <view class="tt t3 price">¥{{filter.Fen2Yuan(productInfo.originalPrice*num)}}</view> | 30 | <view class="tt t3 price">¥{{filter.Fen2Yuan(productInfo.originalPrice*num)}}</view> |
29 | </view> | 31 | </view> |
30 | </view> | 32 | </view> |
33 | <!-- 无存库 --> | ||
34 | <view class="table" wx:if="{{isSellOut}}"> | ||
35 | <view class="empty-tips"> | ||
36 | <text class="txt">抱歉来晚一步,库存已告罄\n下次再来吧!</text> | ||
37 | </view> | ||
38 | </view> | ||
31 | <!-- 表单 --> | 39 | <!-- 表单 --> |
32 | <view class="table" wx:if="{{1>10}}"> | 40 | <view class="table" wx:else> |
33 | <view class="tips">*本活动仅记录订单,无需付款,后期由线下工作人员另行安排支付与配送,请确保收货信息准确。</view> | 41 | <view class="tips">*本活动仅记录订单,无需付款,后期由线下工作人员另行安排支付与配送,请确保收货信息准确。</view> |
34 | <view class="form"> | 42 | <view class="form"> |
35 | <view class="form-item"> | 43 | <view class="form-item"> |
... | @@ -46,19 +54,19 @@ | ... | @@ -46,19 +54,19 @@ |
46 | </view> | 54 | </view> |
47 | <view class="form-item"> | 55 | <view class="form-item"> |
48 | <view class="label">备注:</view> | 56 | <view class="label">备注:</view> |
49 | <!-- <view class="val">{{userInfo.storeName}}</view> --> | 57 | <input wx:if="{{orderStatus==0}}" value="{{remark}}" bindinput="bindRemarkInput" class="val ipt" placeholder="请填写备注" /> |
50 | <input value="{{remark}}" bindinput="bindRemarkInput" class="val ipt" placeholder="请填写备注" /> | 58 | <view wx:if="{{orderStatus==1}}" class="val">{{remark || '无'}}</view> |
51 | </view> | 59 | </view> |
52 | </view> | 60 | </view> |
53 | </view> | 61 | </view> |
54 | <!-- 无存库 --> | ||
55 | <view class="table" wx:else> | ||
56 | <view class="empty-tips"> | ||
57 | <text class="txt">抱歉来晚一步,库存已告罄\n下次再来吧!</text> | ||
58 | </view> | ||
59 | </view> | ||
60 | </view> | 62 | </view> |
61 | <view class="btn-wrap"> | 63 | <view class="btn-wrap"> |
62 | <view bindtap="onInnerButtonHandler" class="btn">确认下单</view> | 64 | <block wx:if="{{isSellOut}}"> |
65 | <view bindtap="hideMask" class="btn">返回个人中心</view> | ||
66 | </block> | ||
67 | <block wx:else> | ||
68 | <view wx:if="{{orderStatus==0}}" bindtap="onSubmitOrderHandler" class="btn">确认下单</view> | ||
69 | <view wx:if="{{orderStatus==1}}" bindtap="onReturnUserCenterHandler" class="btn">返回个人中心</view> | ||
70 | </block> | ||
63 | </view> | 71 | </view> |
64 | </view> | 72 | </view> | ... | ... |
... | @@ -2,7 +2,7 @@ let ENV_CONFIG = require('./env/index'); | ... | @@ -2,7 +2,7 @@ let ENV_CONFIG = require('./env/index'); |
2 | 2 | ||
3 | const APPID = '' | 3 | const APPID = '' |
4 | /** ====每次发布版本记得修改此环境配置==== */ | 4 | /** ====每次发布版本记得修改此环境配置==== */ |
5 | const ENV = 'Dev'; | 5 | const ENV = 'Dev'; // Dev Prod |
6 | const NET_CONFIG = ENV_CONFIG[ENV]; | 6 | const NET_CONFIG = ENV_CONFIG[ENV]; |
7 | const MOCKAPI = ENV_CONFIG.mockApi; | 7 | const MOCKAPI = ENV_CONFIG.mockApi; |
8 | 8 | ... | ... |
... | @@ -95,7 +95,9 @@ const fetch = function ({ | ... | @@ -95,7 +95,9 @@ const fetch = function ({ |
95 | data, | 95 | data, |
96 | method | 96 | method |
97 | }) { | 97 | }) { |
98 | if (loading && mode != 'log') wx.showLoading(); | 98 | if (loading && mode != 'log') wx.showLoading({ |
99 | mask: true | ||
100 | }); | ||
99 | // 新建promise对象 | 101 | // 新建promise对象 |
100 | let promise = new Promise((resolve, reject) => { | 102 | let promise = new Promise((resolve, reject) => { |
101 | /** | 103 | /** | ... | ... |
... | @@ -44,10 +44,6 @@ Page({ | ... | @@ -44,10 +44,6 @@ Page({ |
44 | this.setData({ | 44 | this.setData({ |
45 | options | 45 | options |
46 | }) | 46 | }) |
47 | this.queryAuctionDetail().then((result) => { | ||
48 | this.startTimer(); | ||
49 | }) | ||
50 | this.queryAuctionRecordLast(); | ||
51 | this.initData(); | 47 | this.initData(); |
52 | }, | 48 | }, |
53 | onUnload() { | 49 | onUnload() { |
... | @@ -57,6 +53,10 @@ Page({ | ... | @@ -57,6 +53,10 @@ Page({ |
57 | 53 | ||
58 | initData() { | 54 | initData() { |
59 | this.queryMember().then((result) => { | 55 | this.queryMember().then((result) => { |
56 | this.queryAuctionDetail().then((result) => { | ||
57 | this.startTimer(); | ||
58 | }) | ||
59 | this.queryAuctionRecordLast(); | ||
60 | this.openSocket(); | 60 | this.openSocket(); |
61 | }); | 61 | }); |
62 | }, | 62 | }, |
... | @@ -106,7 +106,7 @@ Page({ | ... | @@ -106,7 +106,7 @@ Page({ |
106 | getTimeStr(initObj) { | 106 | getTimeStr(initObj) { |
107 | let productInfo = this.data.productInfo; | 107 | let productInfo = this.data.productInfo; |
108 | let endTime = productInfo && productInfo.endTime || 0; | 108 | let endTime = productInfo && productInfo.endTime || 0; |
109 | return formatDateTime(endTime,initObj) | 109 | return formatDateTime(endTime, initObj) |
110 | }, | 110 | }, |
111 | 111 | ||
112 | /** | 112 | /** |
... | @@ -214,6 +214,7 @@ Page({ | ... | @@ -214,6 +214,7 @@ Page({ |
214 | }) | 214 | }) |
215 | app.post({ | 215 | app.post({ |
216 | toast: false, | 216 | toast: false, |
217 | loading: true, | ||
217 | url: app.api.auctionSubmit, | 218 | url: app.api.auctionSubmit, |
218 | data: { | 219 | data: { |
219 | auctionCode: code, | 220 | auctionCode: code, | ... | ... |
... | @@ -9,7 +9,7 @@ | ... | @@ -9,7 +9,7 @@ |
9 | <!-- 产品图 --> | 9 | <!-- 产品图 --> |
10 | <view class="img-wrap"> | 10 | <view class="img-wrap"> |
11 | <swiper class="swiper" indicator-color="rgba(0,0,0,.3)" indicator-active-color="rgba(255,255,255,1)" indicator-dots="{{true}}" autoplay="{{true}}" interval="{{5000}}" duration="{{500}}"> | 11 | <swiper class="swiper" indicator-color="rgba(0,0,0,.3)" indicator-active-color="rgba(255,255,255,1)" indicator-dots="{{true}}" autoplay="{{true}}" interval="{{5000}}" duration="{{500}}"> |
12 | <block wx:for="{{productInfo.auctionImage}}" wx:key="{{index}}"> | 12 | <block wx:for="{{productInfo.auctionImages}}" wx:key="{{index}}"> |
13 | <swiper-item> | 13 | <swiper-item> |
14 | <image class="swiper-image" src="{{item}}" mode="aspectFill" /> | 14 | <image class="swiper-image" src="{{item}}" mode="aspectFill" /> |
15 | </swiper-item> | 15 | </swiper-item> | ... | ... |
... | @@ -12,7 +12,7 @@ | ... | @@ -12,7 +12,7 @@ |
12 | <view class="list"> | 12 | <view class="list"> |
13 | <view wx:for="{{dataList}}" wx:key="{{index}}" class="border list-item"> | 13 | <view wx:for="{{dataList}}" wx:key="{{index}}" class="border list-item"> |
14 | <view class="prize"> | 14 | <view class="prize"> |
15 | <image class="image" mode="aspectFill" src="{{item.auctionImage && item.auctionImage[0] || ''}}" /> | 15 | <image class="image" mode="aspectFill" src="{{item.auctionImages && item.auctionImages[0] || ''}}" /> |
16 | </view> | 16 | </view> |
17 | <view class="cont"> | 17 | <view class="cont"> |
18 | <view class="up"> | 18 | <view class="up"> | ... | ... |
... | @@ -62,12 +62,9 @@ Page({ | ... | @@ -62,12 +62,9 @@ Page({ |
62 | if (!result) return; | 62 | if (!result) return; |
63 | if (!result.list) return; | 63 | if (!result.list) return; |
64 | let dataList = result.list; | 64 | let dataList = result.list; |
65 | dataList.forEach(element => { | ||
66 | element.dateStr = new Date(element.startTime).toString("yyyy.MM.dd hh:mm") + " - " + new Date(element.endTime).toString("yyyy.MM.dd hh:mm"); | ||
67 | }); | ||
68 | dataList = this.data.dataList.concat(dataList); | 65 | dataList = this.data.dataList.concat(dataList); |
69 | dataList.forEach(element => { | 66 | dataList.forEach(element => { |
70 | element.recordTime = new Date(element.recordTime).toString("yyyy.MM.dd hh:mm:ss"); | 67 | element.dateStr = new Date(element.auctionTime).toString("yyyy.MM.dd hh:mm"); |
71 | }); | 68 | }); |
72 | console.log("dataList:", dataList); | 69 | console.log("dataList:", dataList); |
73 | this.setData({ | 70 | this.setData({ | ... | ... |
... | @@ -12,7 +12,7 @@ $contentWidth:690px; | ... | @@ -12,7 +12,7 @@ $contentWidth:690px; |
12 | 12 | ||
13 | .main { | 13 | .main { |
14 | .top-space { | 14 | .top-space { |
15 | height: 0px; | 15 | height: 24px; |
16 | } | 16 | } |
17 | 17 | ||
18 | .content { | 18 | .content { |
... | @@ -21,7 +21,7 @@ $contentWidth:690px; | ... | @@ -21,7 +21,7 @@ $contentWidth:690px; |
21 | // list | 21 | // list |
22 | .list { | 22 | .list { |
23 | width: $contentWidth; | 23 | width: $contentWidth; |
24 | margin: 24px auto 0; | 24 | margin: 0 auto 0; |
25 | font-size: 22px; | 25 | font-size: 22px; |
26 | 26 | ||
27 | &-item { | 27 | &-item { |
... | @@ -34,7 +34,7 @@ $contentWidth:690px; | ... | @@ -34,7 +34,7 @@ $contentWidth:690px; |
34 | .prize { | 34 | .prize { |
35 | margin: 0 32px; | 35 | margin: 0 32px; |
36 | 36 | ||
37 | border:solid 1PX #F0F0F0; | 37 | border: solid 1PX #F0F0F0; |
38 | border-radius: 8px; | 38 | border-radius: 8px; |
39 | padding: 16px; | 39 | padding: 16px; |
40 | 40 | ||
... | @@ -50,6 +50,15 @@ $contentWidth:690px; | ... | @@ -50,6 +50,15 @@ $contentWidth:690px; |
50 | flex: 1; | 50 | flex: 1; |
51 | // padding: 0 0 0 16px; | 51 | // padding: 0 0 0 16px; |
52 | @extend .bb; | 52 | @extend .bb; |
53 | height: 220px; | ||
54 | |||
55 | .up {} | ||
56 | |||
57 | .down { | ||
58 | position: absolute; | ||
59 | bottom: 0; | ||
60 | } | ||
61 | |||
53 | 62 | ||
54 | .tt {} | 63 | .tt {} |
55 | 64 | ||
... | @@ -59,22 +68,22 @@ $contentWidth:690px; | ... | @@ -59,22 +68,22 @@ $contentWidth:690px; |
59 | 68 | ||
60 | .t2 { | 69 | .t2 { |
61 | font-size: 26px; | 70 | font-size: 26px; |
62 | margin-top: 8px; | 71 | margin-top: 4px; |
63 | } | 72 | } |
64 | 73 | ||
65 | .t3 { | 74 | .t3 { |
66 | font-size: 26px; | 75 | font-size: 26px; |
67 | font-weight: bold; | 76 | font-weight: bold; |
68 | margin-top: 4px; | 77 | margin-top: 0px; |
69 | } | 78 | } |
70 | 79 | ||
71 | .t4 { | 80 | .t4 { |
72 | font-size: 22px; | 81 | font-size: 22px; |
73 | margin-top: 4px; | 82 | margin-top: 2px; |
74 | color: #666666; | 83 | color: #666666; |
75 | } | 84 | } |
76 | 85 | ||
77 | .sp4{ | 86 | .sp4 { |
78 | margin-top: 24px; | 87 | margin-top: 24px; |
79 | } | 88 | } |
80 | } | 89 | } | ... | ... |
... | @@ -9,14 +9,18 @@ | ... | @@ -9,14 +9,18 @@ |
9 | <view class="list"> | 9 | <view class="list"> |
10 | <view wx:for="{{dataList}}" wx:key="{{index}}" class="border list-item"> | 10 | <view wx:for="{{dataList}}" wx:key="{{index}}" class="border list-item"> |
11 | <view class="prize"> | 11 | <view class="prize"> |
12 | <image class="image" mode="aspectFill" src="{{item.auctionImage && item.auctionImage[0] || ''}}" /> | 12 | <image class="image" mode="aspectFill" src="{{item.auctionImages && item.auctionImages[0] || ''}}" /> |
13 | </view> | 13 | </view> |
14 | <view class="cont"> | 14 | <view class="cont"> |
15 | <view class="up"> | ||
15 | <view class="tt t1">{{item.auctionName}}</view> | 16 | <view class="tt t1">{{item.auctionName}}</view> |
16 | <view class="tt t2">原价:{{filter.Fen2Yuan(item.originalPrice)}}元</view> | 17 | <view class="tt t2">原价:{{filter.Fen2Yuan(item.originalPrice)}}元</view> |
17 | <view class="tt t3 price">竞拍价格:{{filter.Fen2Yuan(item.auctionPrice)}}元</view> | 18 | <view class="tt t3 price">竞拍价格:{{filter.Fen2Yuan(item.auctionPrice)}}元</view> |
18 | <view class="tt t4 sp4">订单编号:A20191008103818293X</view> | 19 | </view> |
19 | <view class="tt t4">竞拍时间:{{item.auctionTime}}</view> | 20 | <view class="down"> |
21 | <view class="tt t4 sp4">订单编号:{{item.auctionCode}}</view> | ||
22 | <view class="tt t4">竞拍时间:{{item.dateStr}}</view> | ||
23 | </view> | ||
20 | </view> | 24 | </view> |
21 | </view> | 25 | </view> |
22 | </view> | 26 | </view> | ... | ... |
... | @@ -11,13 +11,15 @@ let app = getApp(); | ... | @@ -11,13 +11,15 @@ let app = getApp(); |
11 | Page({ | 11 | Page({ |
12 | data: { | 12 | data: { |
13 | authorizeVisible: false, | 13 | authorizeVisible: false, |
14 | seckillOrderVisible: true, | 14 | seckillOrderVisible: false, |
15 | userInfo: {}, | 15 | userInfo: {}, |
16 | productInfo: {}, | 16 | productInfo: {}, |
17 | navBackTimeout: 0, | 17 | navBackTimeout: 0, |
18 | options: {}, | 18 | options: {}, |
19 | wxTimerList: {}, | 19 | wxTimerList: {}, |
20 | lastTime: "", | 20 | lastTime: "", |
21 | isSellOut: false, | ||
22 | orderStatus: 0, // 0.未下单 1.下单成功 | ||
21 | }, | 23 | }, |
22 | onShareAppMessage() {}, | 24 | onShareAppMessage() {}, |
23 | showAuth() { | 25 | showAuth() { |
... | @@ -34,9 +36,6 @@ Page({ | ... | @@ -34,9 +36,6 @@ Page({ |
34 | this.setData({ | 36 | this.setData({ |
35 | options | 37 | options |
36 | }) | 38 | }) |
37 | this.querySeckillDetail().then((result) => { | ||
38 | this.startTimer(); | ||
39 | }) | ||
40 | this.initData(); | 39 | this.initData(); |
41 | }, | 40 | }, |
42 | onUnload() { | 41 | onUnload() { |
... | @@ -44,7 +43,11 @@ Page({ | ... | @@ -44,7 +43,11 @@ Page({ |
44 | }, | 43 | }, |
45 | 44 | ||
46 | initData() { | 45 | initData() { |
47 | this.queryMember().then((result) => {}); | 46 | this.queryMember().then((result) => { |
47 | this.querySeckillDetail().then((result) => { | ||
48 | this.startTimer(); | ||
49 | }) | ||
50 | }); | ||
48 | }, | 51 | }, |
49 | 52 | ||
50 | // 开始倒计时 | 53 | // 开始倒计时 |
... | @@ -104,14 +107,17 @@ Page({ | ... | @@ -104,14 +107,17 @@ Page({ |
104 | if (productInfo && productInfo.status == 1) { | 107 | if (productInfo && productInfo.status == 1) { |
105 | // 显示弹窗 | 108 | // 显示弹窗 |
106 | this.setData({ | 109 | this.setData({ |
110 | orderStatus: 0, | ||
111 | isSellOut: false, | ||
107 | seckillOrderVisible: true | 112 | seckillOrderVisible: true |
108 | }) | 113 | }) |
109 | let minNum = productInfo.minNum; | 114 | let minNum = productInfo.minNum; |
110 | this.seckillOrderComp = this.selectComponent("#seckillOrderComp"); | 115 | this.seckillOrderComp = this.selectComponent("#seckillOrderComp"); |
111 | console.log("this.seckillOrderComp:",this.seckillOrderComp); | 116 | console.log("this.seckillOrderComp:", this.seckillOrderComp); |
112 | console.log("minNum:",minNum); | 117 | console.log("minNum:", minNum); |
113 | if (this.seckillOrderComp) { | 118 | if (this.seckillOrderComp) { |
114 | this.seckillOrderComp.setNum(minNum); | 119 | this.seckillOrderComp.setNum(minNum); |
120 | this.seckillOrderComp.setRemark(""); | ||
115 | } | 121 | } |
116 | } | 122 | } |
117 | }, | 123 | }, |
... | @@ -149,37 +155,41 @@ Page({ | ... | @@ -149,37 +155,41 @@ Page({ |
149 | * 拍卖出价提交 | 155 | * 拍卖出价提交 |
150 | * @param {*} price | 156 | * @param {*} price |
151 | */ | 157 | */ |
152 | querySeckillSubmit(price) { | 158 | querySeckillSubmit(data) { |
153 | let code = this.data.options.code; | 159 | let code = this.data.options.code; |
160 | data.seckillCode = code; | ||
154 | app.post({ | 161 | app.post({ |
155 | toast: false, | 162 | toast: false, |
163 | loading: true, | ||
156 | url: app.api.seckillSubmit, | 164 | url: app.api.seckillSubmit, |
157 | data: { | 165 | data: data |
158 | seckillCode: code, | ||
159 | price: price * 100 //转成分 | ||
160 | } | ||
161 | }).then((result) => { | 166 | }).then((result) => { |
162 | console.log("result:", result); | 167 | console.log("result:", result); |
163 | // this.setData({ | 168 | this.setData({ |
164 | // auctionBidSuccessVisible: true | 169 | orderStatus: 1, |
165 | // }) | 170 | }) |
171 | wx.showModal({ | ||
172 | content: '下单成功', | ||
173 | showCancel: false, | ||
174 | success(res) {} | ||
175 | }) | ||
166 | }).catch((err) => { | 176 | }).catch((err) => { |
167 | console.log("querySeckillSubmit err:", err); | 177 | console.log("querySeckillSubmit err:", err); |
168 | 178 | ||
169 | // switch (err.code) { | 179 | switch (err.code) { |
170 | // // 来晚一步,该价格已经被其他用户提交 显示组件 | 180 | // 库存不足 |
171 | // case 1010: | 181 | case 1013: |
172 | // this.setData({ | 182 | this.setData({ |
173 | // auctionBidFailVisible: true | 183 | isSellOut: true, |
174 | // }) | 184 | }) |
175 | // break; | 185 | break; |
176 | 186 | ||
177 | // default: | 187 | default: |
178 | // wx.showToast({ | 188 | wx.showToast({ |
179 | // title: err.errMsg || "系统开小差" | 189 | title: err.errMsg || "系统开小差" |
180 | // }) | 190 | }) |
181 | // break; | 191 | break; |
182 | // } | 192 | } |
183 | }); | 193 | }); |
184 | }, | 194 | }, |
185 | 195 | ||
... | @@ -221,7 +231,19 @@ Page({ | ... | @@ -221,7 +231,19 @@ Page({ |
221 | this.hideMask(); | 231 | this.hideMask(); |
222 | break; | 232 | break; |
223 | 233 | ||
234 | // 返回个人中心 | ||
235 | case "_evt_return_user_center": | ||
236 | this.hideMask(); | ||
237 | app.router.push({ | ||
238 | openType: "switchTab", | ||
239 | path: "userCenter" | ||
240 | }) | ||
241 | break; | ||
224 | 242 | ||
243 | // 确认下单 | ||
244 | case "_evt_submit_order": | ||
245 | this.querySeckillSubmit(data); | ||
246 | break; | ||
225 | 247 | ||
226 | default: | 248 | default: |
227 | break; | 249 | break; | ... | ... |
... | @@ -51,5 +51,5 @@ | ... | @@ -51,5 +51,5 @@ |
51 | <authorize-comp bind:evtcomp="evtcomp"></authorize-comp> | 51 | <authorize-comp bind:evtcomp="evtcomp"></authorize-comp> |
52 | </van-popup> | 52 | </van-popup> |
53 | <van-popup show="{{ seckillOrderVisible }}"> | 53 | <van-popup show="{{ seckillOrderVisible }}"> |
54 | <seckill-order-comp id="seckillOrderComp" product-info="{{productInfo}}" user-info="{{userInfo}}" bind:evtcomp="evtcomp"></seckill-order-comp> | 54 | <seckill-order-comp id="seckillOrderComp" product-info="{{productInfo}}" user-info="{{userInfo}}" order-status="{{orderStatus}}" is-sell-out="{{isSellOut}}" bind:evtcomp="evtcomp"></seckill-order-comp> |
55 | </van-popup> | 55 | </van-popup> | ... | ... |
1 | import { | 1 | import { |
2 | getBindtapData | 2 | getBindtapData |
3 | } from '../../utils/util'; | 3 | } from '../../utils/util'; |
4 | let Date = require('../../utils/date.js'); | ||
4 | 5 | ||
5 | let app = getApp(); | 6 | let app = getApp(); |
6 | Page({ | 7 | Page({ |
7 | data: {}, | 8 | data: { |
9 | authorizeVisible: false, | ||
10 | isInit: false, | ||
11 | total: 0, | ||
12 | page: 1, | ||
13 | size: 10, | ||
14 | dataList: [], | ||
15 | |||
16 | }, | ||
8 | onShareAppMessage() {}, | 17 | onShareAppMessage() {}, |
9 | showAuth() { | 18 | showAuth() { |
10 | this.setData({ | 19 | this.setData({ |
11 | authorizeVisible: true | 20 | authorizeVisible: true |
12 | }) | 21 | }) |
13 | }, | 22 | }, |
14 | onLoad(options) {}, | 23 | onShow() { |
24 | |||
25 | }, | ||
26 | onLoad(options) { | ||
27 | this.resetPage(); | ||
28 | this.initData(); | ||
29 | }, | ||
30 | initData() { | ||
31 | this.queryAuctionList(); | ||
32 | }, | ||
33 | |||
34 | // 到达底部 | ||
35 | onReachBottom() { | ||
36 | if (this.data.dataList.length < this.data.total) { | ||
37 | this.setData({ | ||
38 | page: this.data.page + 1 | ||
39 | }); | ||
40 | this.queryAuctionList(); | ||
41 | } | ||
42 | }, | ||
43 | |||
44 | // 重置页面列表 点击搜索条件时需要 | ||
45 | resetPage() { | ||
46 | this.setData({ | ||
47 | page: 1, | ||
48 | dataList: [] | ||
49 | }) | ||
50 | }, | ||
51 | |||
52 | // 拍卖列表 | ||
53 | queryAuctionList() { | ||
54 | return new Promise((resolve, reject) => { | ||
55 | app.post({ | ||
56 | url: app.api.auctionMine, | ||
57 | data: { | ||
58 | page: this.data.page, | ||
59 | size: this.data.size, | ||
60 | } | ||
61 | }).then((result) => { | ||
62 | if (!result) return; | ||
63 | if (!result.list) return; | ||
64 | let dataList = result.list; | ||
65 | dataList.forEach(element => { | ||
66 | element.dateStr = new Date(element.startTime).toString("yyyy.MM.dd hh:mm") + " - " + new Date(element.endTime).toString("yyyy.MM.dd hh:mm"); | ||
67 | }); | ||
68 | dataList = this.data.dataList.concat(dataList); | ||
69 | dataList.forEach(element => { | ||
70 | element.recordTime = new Date(element.recordTime).toString("yyyy.MM.dd hh:mm:ss"); | ||
71 | }); | ||
72 | console.log("dataList:", dataList); | ||
73 | this.setData({ | ||
74 | dataList: dataList, | ||
75 | total: result.total || 0, | ||
76 | isInit: true, | ||
77 | }) | ||
78 | resolve(); | ||
79 | }) | ||
80 | }) | ||
81 | }, | ||
82 | |||
15 | // 隐藏蒙层 | 83 | // 隐藏蒙层 |
16 | hideMask() { | 84 | hideMask() { |
17 | this.setData({ | 85 | this.setData({ | ... | ... |
1 | @import '../../assets/scss/mixins'; | ||
2 | @import '../../assets/scss/utils'; | ||
3 | |||
4 | $contentWidth:690px; | ||
5 | |||
6 | .page { | ||
7 | .bgc { | ||
8 | background-color: #f8f8f8; | ||
9 | } | ||
10 | |||
11 | .bg {} | ||
12 | |||
13 | .main { | ||
14 | .top-space { | ||
15 | height: 0px; | ||
16 | } | ||
17 | |||
18 | .content { | ||
19 | position: relative; | ||
20 | |||
21 | // list | ||
22 | .list { | ||
23 | width: $contentWidth; | ||
24 | margin: 24px auto 0; | ||
25 | font-size: 22px; | ||
26 | |||
27 | &-item { | ||
28 | @extend .bb; | ||
29 | padding: 30px 0; | ||
30 | display: flex; | ||
31 | justify-content: space-between; | ||
32 | align-items: center; | ||
33 | |||
34 | .prize { | ||
35 | margin: 0 32px; | ||
36 | |||
37 | border:solid 1PX #F0F0F0; | ||
38 | border-radius: 8px; | ||
39 | padding: 16px; | ||
40 | |||
41 | .image { | ||
42 | width: 160px; | ||
43 | height: 160px; | ||
44 | } | ||
45 | } | ||
46 | |||
47 | .cont { | ||
48 | position: relative; | ||
49 | height: 100%; | ||
50 | flex: 1; | ||
51 | // padding: 0 0 0 16px; | ||
52 | @extend .bb; | ||
53 | |||
54 | .tt {} | ||
55 | |||
56 | .t1 { | ||
57 | font-size: 32px; | ||
58 | } | ||
59 | |||
60 | .t2 { | ||
61 | font-size: 26px; | ||
62 | margin-top: 8px; | ||
63 | } | ||
64 | |||
65 | .t3 { | ||
66 | font-size: 26px; | ||
67 | font-weight: bold; | ||
68 | margin-top: 4px; | ||
69 | } | ||
70 | |||
71 | .t4 { | ||
72 | font-size: 22px; | ||
73 | margin-top: 4px; | ||
74 | color: #666666; | ||
75 | } | ||
76 | |||
77 | .sp4{ | ||
78 | margin-top: 24px; | ||
79 | } | ||
80 | } | ||
81 | |||
82 | } | ||
83 | } | ||
84 | |||
85 | } | ||
86 | } | ||
87 | } | ... | ... |
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> |
4 | <!-- <view class="app__top-shadow"></view> --> | 5 | <!-- <view class="app__top-shadow"></view> --> |
5 | <view class="app__content main"> | 6 | <view class="app__content main"> |
6 | <view class="top-space"></view> | 7 | <view class="top-space"></view> |
7 | <view class="content"></view> | 8 | <view class="content"> |
9 | <view class="list"> | ||
10 | <view wx:for="{{dataList}}" wx:key="{{index}}" class="border list-item"> | ||
11 | <view class="prize"> | ||
12 | <image class="image" mode="aspectFill" src="{{item.auctionImage && item.auctionImage[0] || ''}}" /> | ||
13 | </view> | ||
14 | <view class="cont"> | ||
15 | <view class="tt t1">{{item.auctionName}}</view> | ||
16 | <view class="tt t2">原价:{{filter.Fen2Yuan(item.originalPrice)}}元</view> | ||
17 | <view class="tt t3 price">竞拍价格:{{filter.Fen2Yuan(item.auctionPrice)}}元</view> | ||
18 | <view class="tt t4 sp4">订单编号:A20191008103818293X</view> | ||
19 | <view class="tt t4">竞拍时间:{{item.auctionTime}}</view> | ||
20 | </view> | ||
21 | </view> | ||
22 | </view> | ||
23 | </view> | ||
24 | <empty-tips-light inner-text="这里空空如也~" wx:if="{{dataList.length <= 0 && isInit}}"></empty-tips-light> | ||
8 | </view> | 25 | </view> |
9 | </view> | 26 | </view> |
10 | <van-popup show="{{ authorizeVisible }}"> | 27 | <van-popup show="{{ authorizeVisible }}"> | ... | ... |
-
Please register or sign in to post a comment