版本提交
Showing
15 changed files
with
574 additions
and
46 deletions
... | @@ -7,7 +7,9 @@ | ... | @@ -7,7 +7,9 @@ |
7 | </view> | 7 | </view> |
8 | <view class="name">{{item.commodityTitle}}</view> | 8 | <view class="name">{{item.commodityTitle}}</view> |
9 | <button class="btn" bindtap="onInnerButtonHandler">{{innerButton}}</button> | 9 | <button class="btn" bindtap="onInnerButtonHandler">{{innerButton}}</button> |
10 | <view wx:if="{{item.commodityType == 'packet'}}" class="tips">您可以在“个人中心→我的订单”中查看物流进度</view> | 10 | <view wx:if="{{item.commodityType == 'packet'}}" class="tips"> |
11 | <view wx:else class="tips">后台审核通过后,红包将会通过公众号消息或微信服务消息发送,届时请及时领取!</view> | 11 | 后台审核通过后,红包将会通过公众号消息或微信服务消息发送,届时请及时领取! |
12 | </view> | ||
13 | <view wx:else class="tips">您可以在“个人中心→我的订单”中查看物流进度</view> | ||
12 | </view> | 14 | </view> |
13 | </view> | 15 | </view> | ... | ... |
... | @@ -33,7 +33,7 @@ module.exports = { | ... | @@ -33,7 +33,7 @@ module.exports = { |
33 | scanPersonQrcode: '/scan/person/qrcode', // post 扫个人二维码 | 33 | scanPersonQrcode: '/scan/person/qrcode', // post 扫个人二维码 |
34 | signInfo: '/sign/info', // post 签到信息 用户注册接口 | 34 | signInfo: '/sign/info', // post 签到信息 用户注册接口 |
35 | sign: '/sign', // post 签到动作 用户注册接口 | 35 | sign: '/sign', // post 签到动作 用户注册接口 |
36 | sginRecord: '/sgin/record', // post 签到记录 用户注册接口 | 36 | signRecord: '/sign/record', // post 签到记录 用户注册接口 |
37 | 37 | ||
38 | areaQuery: 'https://api.k.wxpai.cn/bizproxy/kdapi/area', // post 区域查询 | 38 | areaQuery: 'https://api.k.wxpai.cn/bizproxy/kdapi/area', // post 区域查询 |
39 | 39 | ... | ... |
... | @@ -118,7 +118,7 @@ Page({ | ... | @@ -118,7 +118,7 @@ Page({ |
118 | } = this.data; | 118 | } = this.data; |
119 | wx.showModal({ | 119 | wx.showModal({ |
120 | title: '兑换确认', | 120 | title: '兑换确认', |
121 | content: `将花费${item.commodityPrice}兑换${commodityTitle}一份`, | 121 | content: `将花费${item.commodityPrice}兑换${item.commodityTitle}一份`, |
122 | success(res) { | 122 | success(res) { |
123 | if (res.confirm) { | 123 | if (res.confirm) { |
124 | app.post({ | 124 | app.post({ |
... | @@ -126,7 +126,7 @@ Page({ | ... | @@ -126,7 +126,7 @@ Page({ |
126 | data: { | 126 | data: { |
127 | commodityCode: item.commodityCode, | 127 | commodityCode: item.commodityCode, |
128 | receiverCode: defaultReceiver.receiverCode, | 128 | receiverCode: defaultReceiver.receiverCode, |
129 | remark: this.data.remark | 129 | remark: _this.data.remark |
130 | } | 130 | } |
131 | }).then((result) => { | 131 | }).then((result) => { |
132 | _this.initData().then((result) => { | 132 | _this.initData().then((result) => { |
... | @@ -134,8 +134,6 @@ Page({ | ... | @@ -134,8 +134,6 @@ Page({ |
134 | orderSubmitSuccessCompVisible: true | 134 | orderSubmitSuccessCompVisible: true |
135 | }) | 135 | }) |
136 | }) | 136 | }) |
137 | |||
138 | |||
139 | }) | 137 | }) |
140 | } | 138 | } |
141 | } | 139 | } | ... | ... |
1 | import { | ||
2 | getBindtapData | ||
3 | } from '../../utils/util'; | ||
4 | let Date = require('../../utils/date.js'); | ||
5 | |||
1 | let app = getApp(); | 6 | let app = getApp(); |
2 | Page({ | 7 | Page({ |
3 | data: { | 8 | data: { |
4 | authorizeVisible: false, | 9 | authorizeVisible: false, |
10 | userInfo: {}, | ||
11 | dateStart: "", | ||
12 | dateEnd: "", | ||
13 | dateStr: "", | ||
14 | total: 0, | ||
15 | page: 1, | ||
16 | size: 10, | ||
17 | status: "", | ||
18 | dataList: [], | ||
5 | navIndex: 0, | 19 | navIndex: 0, |
6 | navList: [{ | 20 | navList: [{ |
7 | t1: "全部", | 21 | t1: "全部", |
8 | t2: "", | 22 | t2: "", |
9 | index: 0, | 23 | index: "0", |
10 | }, | 24 | }, |
11 | { | 25 | { |
12 | t1: "300", | 26 | t1: "300", |
13 | t2: "购买积分", | 27 | t2: "购买积分", |
14 | index: 1, | 28 | index: "1", |
15 | }, | 29 | }, |
16 | { | 30 | { |
17 | t1: "200", | 31 | t1: "200", |
18 | t2: "推广积分", | 32 | t2: "推广积分", |
19 | index: 2, | 33 | index: "2", |
20 | }, | 34 | }, |
21 | { | 35 | { |
22 | t1: "50", | 36 | t1: "50", |
23 | t2: "签到积分", | 37 | t2: "签到积分", |
24 | index: 3, | 38 | index: "3", |
25 | }, | 39 | }, |
26 | { | 40 | { |
27 | t1: "300", | 41 | t1: "300", |
28 | t2: "奖励积分", | 42 | t2: "奖励积分", |
29 | index: 4, | 43 | index: "4", |
30 | }, | 44 | }, |
31 | { | 45 | { |
32 | t1: "300", | 46 | t1: "300", |
33 | t2: "兑换积分", | 47 | t2: "兑换积分", |
34 | index: 5, | 48 | index: "5", |
35 | }, | 49 | }, |
36 | ], | 50 | ], |
37 | }, | 51 | }, |
... | @@ -41,5 +55,157 @@ Page({ | ... | @@ -41,5 +55,157 @@ Page({ |
41 | authorizeVisible: true | 55 | authorizeVisible: true |
42 | }) | 56 | }) |
43 | }, | 57 | }, |
44 | onLoad(options) {} | 58 | onLoad(options) { |
59 | let dateStart = new Date().last().week().toString("yyyy-MM-dd"); | ||
60 | let dateEnd = Date.today().toString("yyyy-MM-dd"); | ||
61 | let dateStr = Date.today().toString("yyyy-MM"); | ||
62 | this.setData({ | ||
63 | dateStart, | ||
64 | dateEnd, | ||
65 | dateStr | ||
66 | }) | ||
67 | this.refreshStatus(); | ||
68 | this.initData(); | ||
69 | }, | ||
70 | |||
71 | initData() { | ||
72 | this.queryMember().then((result) => {}); | ||
73 | }, | ||
74 | |||
75 | // 到达底部 | ||
76 | onReachBottom() { | ||
77 | if (this.data.dataList.length < this.data.total) { | ||
78 | this.setData({ | ||
79 | page: this.data.page + 1 | ||
80 | }); | ||
81 | this.queryOrder(); | ||
82 | } | ||
83 | }, | ||
84 | |||
85 | // 重置页面列表 点击搜索条件时需要 | ||
86 | resetPage() { | ||
87 | this.setData({ | ||
88 | page: 1, | ||
89 | dataList: [] | ||
90 | }) | ||
91 | }, | ||
92 | |||
93 | /** | ||
94 | * 获取会员信息 | ||
95 | */ | ||
96 | queryMember() { | ||
97 | return new Promise((resolve, reject) => { | ||
98 | app.post({ | ||
99 | url: app.api.member, | ||
100 | data: {} | ||
101 | }).then((result) => { | ||
102 | this.setData({ | ||
103 | userInfo: result | ||
104 | }) | ||
105 | resolve(); | ||
106 | }) | ||
107 | }); | ||
108 | }, | ||
109 | |||
110 | /** | ||
111 | * 积分概览 | ||
112 | */ | ||
113 | queryPointsOverview() { | ||
114 | return new Promise((resolve, reject) => { | ||
115 | let year = this.data.dateStr.slice(0, 4); | ||
116 | let month = this.data.dateStr.slice(5, 7); | ||
117 | app.post({ | ||
118 | url: app.api.pointsOverview, | ||
119 | data: { | ||
120 | page: this.data.page, | ||
121 | size: this.data.size, | ||
122 | pointsType: this.data.status, | ||
123 | year: year, | ||
124 | month: month, | ||
125 | } | ||
126 | }).then((result) => { | ||
127 | console.log("result:", result); | ||
128 | let dataList = result.list; | ||
129 | dataList = this.data.dataList.concat(dataList); | ||
130 | dataList.forEach(element => { | ||
131 | element.time = new Date(element.createTime).toString("yyyy.MM.dd") | ||
132 | }); | ||
133 | this.setData({ | ||
134 | dataList: dataList, | ||
135 | total: result.total | ||
136 | }) | ||
137 | resolve(); | ||
138 | }) | ||
139 | }); | ||
140 | }, | ||
141 | |||
142 | bindDateChange(e) { | ||
143 | this.setData({ | ||
144 | dateStr: e.detail.value | ||
145 | }) | ||
146 | this.resetPage(); | ||
147 | this.refreshStatus(); | ||
148 | }, | ||
149 | |||
150 | /** | ||
151 | * 选择导航 | ||
152 | * @param {*} evt | ||
153 | */ | ||
154 | onNavSelectHandler(evt) { | ||
155 | let navIndex = this.data.navIndex; | ||
156 | let curIndex = getBindtapData(evt, "index"); | ||
157 | if (navIndex != curIndex) { | ||
158 | this.setData({ | ||
159 | navIndex: curIndex | ||
160 | }) | ||
161 | this.refreshStatus(); | ||
162 | } | ||
163 | }, | ||
164 | |||
165 | /** | ||
166 | * 刷新状态重新请求 | ||
167 | */ | ||
168 | refreshStatus() { | ||
169 | let status = ""; | ||
170 | let navIndex = this.data.navIndex + ""; | ||
171 | switch (navIndex) { | ||
172 | // 全部 | ||
173 | case "0": | ||
174 | status = ""; | ||
175 | break; | ||
176 | |||
177 | // 购买积分 | ||
178 | case "1": | ||
179 | status = "buy"; | ||
180 | break; | ||
181 | |||
182 | // 推广积分 | ||
183 | case "2": | ||
184 | status = "promotion"; | ||
185 | break; | ||
186 | |||
187 | // 签到积分 | ||
188 | case "3": | ||
189 | status = "sign"; | ||
190 | break; | ||
191 | |||
192 | // 奖励积分 | ||
193 | case "4": | ||
194 | status = "award"; | ||
195 | break; | ||
196 | |||
197 | // 兑换积分 | ||
198 | case "5": | ||
199 | status = "exchange"; | ||
200 | break; | ||
201 | |||
202 | default: | ||
203 | break; | ||
204 | } | ||
205 | this.setData({ | ||
206 | status: status | ||
207 | }) | ||
208 | this.resetPage(); | ||
209 | this.queryPointsOverview(); | ||
210 | } | ||
45 | }) | 211 | }) | ... | ... |
... | @@ -26,7 +26,7 @@ $contentWidth:690px; | ... | @@ -26,7 +26,7 @@ $contentWidth:690px; |
26 | width: $contentWidth; | 26 | width: $contentWidth; |
27 | margin: 0 auto; | 27 | margin: 0 auto; |
28 | 28 | ||
29 | .func { | 29 | .header { |
30 | display: flex; | 30 | display: flex; |
31 | justify-content: space-between; | 31 | justify-content: space-between; |
32 | align-items: flex-end; | 32 | align-items: flex-end; |
... | @@ -55,6 +55,55 @@ $contentWidth:690px; | ... | @@ -55,6 +55,55 @@ $contentWidth:690px; |
55 | height: 32px; | 55 | height: 32px; |
56 | margin: 8px; | 56 | margin: 8px; |
57 | } | 57 | } |
58 | |||
59 | .d1{ | ||
60 | margin-left: 8px; | ||
61 | } | ||
62 | } | ||
63 | } | ||
64 | |||
65 | .func-wrap { | ||
66 | display: flex; | ||
67 | justify-content: space-between; | ||
68 | // padding: 4px 0; | ||
69 | } | ||
70 | |||
71 | .func { | ||
72 | @extend .fcc; | ||
73 | height: 80px; | ||
74 | // border-bottom: solid 1px #DDDDDD; | ||
75 | font-size: 26px; | ||
76 | color: #3680EB; | ||
77 | |||
78 | .icon { | ||
79 | width: 32px; | ||
80 | height: 32px; | ||
81 | margin: 0 8px; | ||
82 | } | ||
83 | |||
84 | .arrow { | ||
85 | width: 12px; | ||
86 | height: 8px; | ||
87 | margin: 0 8px; | ||
88 | } | ||
89 | } | ||
90 | |||
91 | // 时间 | ||
92 | .time { | ||
93 | .sel { | ||
94 | font-size: 28px; | ||
95 | color: #3680EB; | ||
96 | padding: 4px 16px; | ||
97 | @extend .fcc; | ||
98 | background-color: rgba($color: #3680EB, $alpha: 0.05); | ||
99 | border-radius: 4px; | ||
100 | margin-bottom: 12px; | ||
101 | |||
102 | .icon { | ||
103 | width: 32px; | ||
104 | height: 32px; | ||
105 | margin: 8px; | ||
106 | } | ||
58 | } | 107 | } |
59 | } | 108 | } |
60 | 109 | ... | ... |
... | @@ -4,20 +4,49 @@ | ... | @@ -4,20 +4,49 @@ |
4 | <view class="app__content main"> | 4 | <view class="app__content main"> |
5 | <view class="top-space"></view> | 5 | <view class="top-space"></view> |
6 | <view class="content"> | 6 | <view class="content"> |
7 | <view class="func"> | 7 | <view class="header"> |
8 | <view class="info"> | 8 | <view class="info"> |
9 | 现有积分 | 9 | 现有积分 |
10 | <span class="t1">360</span> | 10 | <span class="t1">{{userInfo.memberPoints}}</span> |
11 | 分 | 11 | 分 |
12 | </view> | 12 | </view> |
13 | <picker mode="date" fields="month" value="{{date}}" bindchange="bindDateChange"> | ||
14 | <view class="sel"> | ||
15 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-calendar.png" /> | ||
16 | 时间筛选 | ||
17 | <span class="d1">{{dateStr}}</span> | ||
18 | </view> | ||
19 | </picker> | ||
20 | </view> | ||
21 | <!-- 时间 --> | ||
22 | <!-- <view class="time"> | ||
13 | <view class="sel"> | 23 | <view class="sel"> |
14 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-calendar.png" /> | 24 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-calendar.png" /> |
15 | 时间筛选 | 25 | 起始时间 |
16 | </view> | 26 | </view> |
17 | </view> | 27 | </view> --> |
28 | <!-- 时间选择器 --> | ||
29 | <!-- <view class="func-wrap"> | ||
30 | <picker mode="date" value="{{dateStart}}" bindchange="bindDateStartChange"> | ||
31 | <view class="func"> | ||
32 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-sign-record.png" /> | ||
33 | 起始时间 | ||
34 | <image class="arrow" mode="aspectFit" src="../../image/icon/icon-filter-down-on.png" /> | ||
35 | {{dateStart}} | ||
36 | </view> | ||
37 | </picker> | ||
38 | <picker mode="date" value="{{dateEnd}}" bindchange="bindDateEndChange"> | ||
39 | <view class="func"> | ||
40 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-sign-record.png" /> | ||
41 | 结束时间 | ||
42 | <image class="arrow" mode="aspectFit" src="../../image/icon/icon-filter-down-on.png" /> | ||
43 | {{dateEnd}} | ||
44 | </view> | ||
45 | </picker> | ||
46 | </view> --> | ||
18 | <!-- 标签 --> | 47 | <!-- 标签 --> |
19 | <view class="tag"> | 48 | <view class="tag"> |
20 | <view data-index="{{index}}" wx:for="{{navList}}" wx:key="{{index}}" class="tag-item"> | 49 | <view bindtap="onNavSelectHandler" data-data="{{item}}" data-index="{{index}}" wx:for="{{navList}}" wx:key="{{index}}" class="tag-item"> |
21 | <image wx:if="{{navIndex==index}}" class="ebg" mode="aspectFit" src="../../image/icon/icon-integral-tag.png" /> | 50 | <image wx:if="{{navIndex==index}}" class="ebg" mode="aspectFit" src="../../image/icon/icon-integral-tag.png" /> |
22 | <view class="desc {{navIndex == index ? 'act' : ''}}"> | 51 | <view class="desc {{navIndex == index ? 'act' : ''}}"> |
23 | <view class="t1">{{item.t1}}</view> | 52 | <view class="t1">{{item.t1}}</view> |
... | @@ -29,19 +58,22 @@ | ... | @@ -29,19 +58,22 @@ |
29 | <view class="tit"> | 58 | <view class="tit"> |
30 | <view class="tt t1">时间</view> | 59 | <view class="tt t1">时间</view> |
31 | <view class="tt t2">获取方式</view> | 60 | <view class="tt t2">获取方式</view> |
32 | <view class="tt t3">积分</view> | 61 | <view class="tt t3">名称</view> |
33 | <view class="tt t4 minus">积分</view> | 62 | <view class="tt t4 minus">积分</view> |
34 | </view> | 63 | </view> |
35 | <!-- 积分 --> | 64 | <!-- 积分 --> |
36 | <view class="integral"> | 65 | <view class="integral"> |
37 | <view class="integral-item"> | 66 | <view wx:for="{{dataList}}" wx:key="{{item}}" class="integral-item"> |
38 | <view class="tt t1">2019.03.13</view> | 67 | <view class="tt t1">{{item.time}}</view> |
39 | <view class="tt t2">扫码获取</view> | 68 | <view class="tt t2">{{item.subTitle}}</view> |
40 | <view class="tt t3">产品名称</view> | 69 | <view class="tt t3">产品名称</view> |
41 | <view class="tt t4 minus">+1000</view> | 70 | <view class="tt t4 {{item.pointsIp == 0 ? 'minus':''}}"> |
71 | {{item.pointsIp == 1 ? '+':'-'}} {{item.pointsNum}} | ||
72 | </view> | ||
42 | </view> | 73 | </view> |
43 | </view> | 74 | </view> |
44 | </view> | 75 | </view> |
76 | <empty-tips wx:if="{{dataList.length <= 0}}"></empty-tips> | ||
45 | </view> | 77 | </view> |
46 | </view> | 78 | </view> |
47 | <van-popup show="{{ authorizeVisible }}"> | 79 | <van-popup show="{{ authorizeVisible }}"> | ... | ... |
... | @@ -11,6 +11,7 @@ Page({ | ... | @@ -11,6 +11,7 @@ Page({ |
11 | page: 1, | 11 | page: 1, |
12 | size: 10, | 12 | size: 10, |
13 | dataList: [], | 13 | dataList: [], |
14 | orderStatus: "" | ||
14 | }, | 15 | }, |
15 | onShareAppMessage() {}, | 16 | onShareAppMessage() {}, |
16 | showAuth() { | 17 | showAuth() { |
... | @@ -27,11 +28,12 @@ Page({ | ... | @@ -27,11 +28,12 @@ Page({ |
27 | navIndex: navIndex | 28 | navIndex: navIndex |
28 | }) | 29 | }) |
29 | } | 30 | } |
30 | this.initData(); | 31 | this.refreshOrderStatus(); |
32 | // this.initData(); | ||
31 | }, | 33 | }, |
32 | 34 | ||
33 | initData() { | 35 | initData() { |
34 | this.queryOrder(); | 36 | // this.queryOrder(); |
35 | }, | 37 | }, |
36 | 38 | ||
37 | // 到达底部 | 39 | // 到达底部 |
... | @@ -44,6 +46,14 @@ Page({ | ... | @@ -44,6 +46,14 @@ Page({ |
44 | } | 46 | } |
45 | }, | 47 | }, |
46 | 48 | ||
49 | // 重置页面列表 点击搜索条件时需要 | ||
50 | resetPage() { | ||
51 | this.setData({ | ||
52 | page: 1, | ||
53 | dataList: [] | ||
54 | }) | ||
55 | }, | ||
56 | |||
47 | /** | 57 | /** |
48 | * 订单状态 | 58 | * 订单状态 |
49 | */ | 59 | */ |
... | @@ -54,7 +64,7 @@ Page({ | ... | @@ -54,7 +64,7 @@ Page({ |
54 | data: { | 64 | data: { |
55 | page: this.data.page, | 65 | page: this.data.page, |
56 | size: this.data.size, | 66 | size: this.data.size, |
57 | orderStatus: "" | 67 | orderStatus: this.data.orderStatus |
58 | } | 68 | } |
59 | }).then((result) => { | 69 | }).then((result) => { |
60 | let dataList = result.list; | 70 | let dataList = result.list; |
... | @@ -75,12 +85,53 @@ Page({ | ... | @@ -75,12 +85,53 @@ Page({ |
75 | onNavSelectHandler(evt) { | 85 | onNavSelectHandler(evt) { |
76 | let navIndex = this.data.navIndex; | 86 | let navIndex = this.data.navIndex; |
77 | let curIndex = getBindtapData(evt, "index"); | 87 | let curIndex = getBindtapData(evt, "index"); |
78 | console.log("curIndex:", curIndex); | ||
79 | if (navIndex != curIndex) { | 88 | if (navIndex != curIndex) { |
80 | this.setData({ | 89 | this.setData({ |
81 | navIndex: curIndex | 90 | navIndex: curIndex |
82 | }) | 91 | }) |
92 | this.refreshOrderStatus(); | ||
83 | } | 93 | } |
84 | }, | 94 | }, |
95 | /** | ||
96 | * 更新状态 | ||
97 | */ | ||
98 | refreshOrderStatus() { | ||
99 | let orderStatus = ""; | ||
100 | let navIndex = this.data.navIndex; | ||
101 | switch (navIndex) { | ||
102 | // 全部 | ||
103 | case "0": | ||
104 | orderStatus = ""; | ||
105 | break; | ||
106 | |||
107 | // 待审核 | ||
108 | case "1": | ||
109 | orderStatus = "unaudited"; | ||
110 | break; | ||
111 | |||
112 | // 已通过 | ||
113 | case "2": | ||
114 | orderStatus = "pass"; | ||
115 | break; | ||
116 | |||
117 | // 已发货 | ||
118 | case "3": | ||
119 | orderStatus = "deliver"; | ||
120 | break; | ||
121 | |||
122 | // 未通过 | ||
123 | case "4": | ||
124 | orderStatus = "audit_faild"; | ||
125 | break; | ||
126 | |||
127 | default: | ||
128 | break; | ||
129 | } | ||
130 | this.setData({ | ||
131 | orderStatus: orderStatus | ||
132 | }) | ||
133 | this.resetPage(); | ||
134 | this.queryOrder(); | ||
135 | } | ||
85 | 136 | ||
86 | }) | 137 | }) | ... | ... |
... | @@ -28,7 +28,71 @@ | ... | @@ -28,7 +28,71 @@ |
28 | </view> | 28 | </view> |
29 | </view> | 29 | </view> |
30 | <!-- 卡片 --> | 30 | <!-- 卡片 --> |
31 | 31 | <view class="card"> | |
32 | <view wx:for="{{dataList}}" wx:key="{{index}}" class="border card-item"> | ||
33 | <view class="no">订单编号:{{item.orderCode}}</view> | ||
34 | <view class="line"></view> | ||
35 | <view class="cont"> | ||
36 | <view class="prize"> | ||
37 | <image class="image" mode="aspectFit" /> | ||
38 | </view> | ||
39 | <view class="detail"> | ||
40 | <view class="t1">{{item.orderCommodityTitle}}</view> | ||
41 | <view class="t1 t2">{{item.orderCommodityPoints}}</view> | ||
42 | <view class="t1 t3"> | ||
43 | <span wx:if="{{item.orderStatus == 'unaudited'}}">待审核</span> | ||
44 | <span wx:if="{{item.orderStatus == 'pass'}}">已通过</span> | ||
45 | <span wx:if="{{item.orderStatus == 'deliver'}}">已发货</span> | ||
46 | <span wx:if="{{item.orderStatus == 'audit_faild'}}">未通过</span> | ||
47 | </view> | ||
48 | </view> | ||
49 | </view> | ||
50 | <view class="line"></view> | ||
51 | <view class="logistics"> | ||
52 | <view class="logistics-item"> | ||
53 | <view class="label">收货地址</view> | ||
54 | <view class="val">{{item.orderAddress}}</view> | ||
55 | </view> | ||
56 | <view class="logistics-item"> | ||
57 | <view class="label">物流公司</view> | ||
58 | <view class="val">{{item.logisticsCompany}}</view> | ||
59 | </view> | ||
60 | <view class="logistics-item"> | ||
61 | <view class="label">物流单号</view> | ||
62 | <view class="val">{{item.logisticsOdd}}</view> | ||
63 | </view> | ||
64 | </view> | ||
65 | </view> | ||
66 | <!-- <view class="border card-item"> | ||
67 | <view class="no">订单编号:2357123413491</view> | ||
68 | <view class="line"></view> | ||
69 | <view class="cont"> | ||
70 | <view class="prize"> | ||
71 | <image class="image" mode="aspectFit" /> | ||
72 | </view> | ||
73 | <view class="detail"> | ||
74 | <view class="t1">某东购物卡200元</view> | ||
75 | <view class="t1 t2">消耗积分:1000分</view> | ||
76 | <view class="t1 t3">处理中</view> | ||
77 | </view> | ||
78 | </view> | ||
79 | <view class="line"></view> | ||
80 | <view class="logistics"> | ||
81 | <view class="logistics-item"> | ||
82 | <view class="label">收货地址</view> | ||
83 | <view class="val">深圳市龙岗区XXX路</view> | ||
84 | </view> | ||
85 | <view class="logistics-item"> | ||
86 | <view class="label">物流公司</view> | ||
87 | <view class="val">待定</view> | ||
88 | </view> | ||
89 | <view class="logistics-item"> | ||
90 | <view class="label">物流单号</view> | ||
91 | <view class="val">暂定</view> | ||
92 | </view> | ||
93 | </view> | ||
94 | </view> --> | ||
95 | </view> | ||
32 | </view> | 96 | </view> |
33 | <empty-tips wx:if="{{dataList.length <= 0}}"></empty-tips> | 97 | <empty-tips wx:if="{{dataList.length <= 0}}"></empty-tips> |
34 | </view> | 98 | </view> | ... | ... |
1 | import QR from '../../utils/qrcode' | ||
2 | |||
1 | let app = getApp(); | 3 | let app = getApp(); |
2 | Page({ | 4 | Page({ |
3 | data: { | 5 | data: { |
4 | authorizeVisible: false, | 6 | authorizeVisible: false, |
7 | userInfo: {}, | ||
8 | qrImagePath: "", | ||
5 | }, | 9 | }, |
6 | onShareAppMessage() {}, | 10 | onShareAppMessage() {}, |
7 | showAuth() { | 11 | showAuth() { |
... | @@ -9,5 +13,73 @@ Page({ | ... | @@ -9,5 +13,73 @@ Page({ |
9 | authorizeVisible: true | 13 | authorizeVisible: true |
10 | }) | 14 | }) |
11 | }, | 15 | }, |
12 | onLoad(options) {} | 16 | onLoad(options) { |
17 | this.initData(); | ||
18 | }, | ||
19 | initData() { | ||
20 | this.queryMember().then((result) => { | ||
21 | }); | ||
22 | }, | ||
23 | /** | ||
24 | * 获取会员信息 | ||
25 | */ | ||
26 | queryMember() { | ||
27 | return new Promise((resolve, reject) => { | ||
28 | app.post({ | ||
29 | url: app.api.member, | ||
30 | data: {} | ||
31 | }).then((result) => { | ||
32 | this.setData({ | ||
33 | userInfo: result | ||
34 | }) | ||
35 | |||
36 | // 设置二维码 | ||
37 | let qrSize = this.setCanvasSize(440); | ||
38 | let codeContent = "xxx"; | ||
39 | this.createQrCode(codeContent, 'qrcanvas', qrSize.w, qrSize.h); | ||
40 | |||
41 | resolve(); | ||
42 | }) | ||
43 | }); | ||
44 | }, | ||
45 | |||
46 | createQrCode(content, canvasId, cavW, cavH) { | ||
47 | //调用插件中的draw方法,绘制二维码图片 | ||
48 | QR.api.draw(content, canvasId, cavW, cavH); | ||
49 | this.canvasToTempImage(canvasId); | ||
50 | }, | ||
51 | //获取临时缓存图片路径,存入data中 | ||
52 | canvasToTempImage(canvasId) { | ||
53 | let that = this; | ||
54 | wx.canvasToTempFilePath({ | ||
55 | canvasId, // 这里canvasId即之前创建的canvas-id | ||
56 | success: function (res) { | ||
57 | let tempFilePath = res.tempFilePath; | ||
58 | console.log(tempFilePath); | ||
59 | that.setData({ // 如果采用mpvue,即 this.imagePath = tempFilePath | ||
60 | qrImagePath: tempFilePath, | ||
61 | }); | ||
62 | }, | ||
63 | fail: function (res) { | ||
64 | console.log(res); | ||
65 | } | ||
66 | }); | ||
67 | }, | ||
68 | //适配不同屏幕大小的canvas | ||
69 | setCanvasSize(sz) { | ||
70 | var size = {}; | ||
71 | try { | ||
72 | var res = wx.getSystemInfoSync(); | ||
73 | var scale = 750 / sz; //不同屏幕下canvas的适配比例;设计稿是750宽 | ||
74 | var width = res.windowWidth / scale; | ||
75 | var height = width; //canvas画布为正方形 | ||
76 | size.w = width; | ||
77 | size.h = height; | ||
78 | } catch (e) { | ||
79 | // Do something when catch error | ||
80 | console.log("获取设备信息失败" + e); | ||
81 | } | ||
82 | return size; | ||
83 | }, | ||
84 | |||
13 | }) | 85 | }) | ... | ... |
... | @@ -5,9 +5,11 @@ | ... | @@ -5,9 +5,11 @@ |
5 | <view class="top-space"></view> | 5 | <view class="top-space"></view> |
6 | <view class="content"> | 6 | <view class="content"> |
7 | <view class="card"> | 7 | <view class="card"> |
8 | <image class="avatar" mode="widthFix" src="../../image/icon/icon-default-avatar.png" /> | 8 | <image class="avatar" mode="widthFix" src="{{userInfo.avatar}}" /> |
9 | <view class="nickname">昵称填充</view> | 9 | <view class="nickname">{{userInfo.nickname}}</view> |
10 | <image class="qrcode" mode="widthFix" src="../../image/icon/icon-default-qrcode.png" /> | 10 | <!-- <image class="qrcode" mode="widthFix" src="../../image/icon/icon-default-qrcode.png" /> --> |
11 | <image wx:if="{{qrImagePath}}" class="qrcode" mode="widthFix" src="{{qrImagePath}}" /> | ||
12 | <canvas wx:else class="qrcode" canvas-id="qrcanvas" /> | ||
11 | <view class="t1">深士照明</view> | 13 | <view class="t1">深士照明</view> |
12 | <view class="t1 t2">扫码即获专属积分,兑换超值奖品</view> | 14 | <view class="t1 t2">扫码即获专属积分,兑换超值奖品</view> |
13 | </view> | 15 | </view> | ... | ... |
1 | let Date = require('../../utils/date.js'); | ||
2 | |||
1 | let app = getApp(); | 3 | let app = getApp(); |
2 | Page({ | 4 | Page({ |
3 | data: { | 5 | data: { |
4 | authorizeVisible: false, | 6 | authorizeVisible: false, |
7 | dateStart: "", | ||
8 | dateEnd: "", | ||
9 | total: 0, | ||
10 | page: 1, | ||
11 | size: 10, | ||
12 | dataList: [], | ||
5 | }, | 13 | }, |
6 | onShareAppMessage() {}, | 14 | onShareAppMessage() {}, |
7 | showAuth() { | 15 | showAuth() { |
... | @@ -9,5 +17,73 @@ Page({ | ... | @@ -9,5 +17,73 @@ Page({ |
9 | authorizeVisible: true | 17 | authorizeVisible: true |
10 | }) | 18 | }) |
11 | }, | 19 | }, |
12 | onLoad(options) {} | 20 | onLoad(options) { |
21 | let dateStart = new Date().last().week().toString("yyyy-MM-dd"); | ||
22 | let dateEnd = Date.today().toString("yyyy-MM-dd"); | ||
23 | this.setData({ | ||
24 | dateStart, | ||
25 | dateEnd | ||
26 | }) | ||
27 | this.initData(); | ||
28 | }, | ||
29 | initData() { | ||
30 | this.querySginRecord(); | ||
31 | }, | ||
32 | // 到达底部 | ||
33 | onReachBottom() { | ||
34 | if (this.data.dataList.length < this.data.total) { | ||
35 | this.setData({ | ||
36 | page: this.data.page + 1 | ||
37 | }); | ||
38 | this.queryAnnouncementList(); | ||
39 | } | ||
40 | }, | ||
41 | // 重置页面列表 点击搜索条件时需要 | ||
42 | resetPage() { | ||
43 | this.setData({ | ||
44 | page: 1, | ||
45 | dataList: [] | ||
46 | }) | ||
47 | }, | ||
48 | /** | ||
49 | * 请求签到记录 | ||
50 | */ | ||
51 | querySginRecord() { | ||
52 | return new Promise((resolve, reject) => { | ||
53 | app.post({ | ||
54 | url: app.api.signRecord, | ||
55 | data: { | ||
56 | start: this.data.dateStart, | ||
57 | end: this.data.dateEnd, | ||
58 | page: this.data.page, | ||
59 | size: this.data.size, | ||
60 | } | ||
61 | }).then((result) => { | ||
62 | let dataList = result.list; | ||
63 | dataList = this.data.dataList.concat(dataList); | ||
64 | this.setData({ | ||
65 | dataList: dataList, | ||
66 | total: result.total | ||
67 | }) | ||
68 | resolve(); | ||
69 | }) | ||
70 | }); | ||
71 | }, | ||
72 | |||
73 | // 起始时间 | ||
74 | bindDateStartChange(e) { | ||
75 | this.setData({ | ||
76 | dateStart: e.detail.value | ||
77 | }) | ||
78 | this.resetPage(); | ||
79 | this.querySginRecord(); | ||
80 | }, | ||
81 | // 结束时间 | ||
82 | bindDateEndChange(e) { | ||
83 | this.setData({ | ||
84 | dateEnd: e.detail.value | ||
85 | }) | ||
86 | this.resetPage(); | ||
87 | this.querySginRecord(); | ||
88 | }, | ||
13 | }) | 89 | }) | ... | ... |
... | @@ -13,7 +13,7 @@ $contentWidth:690px; | ... | @@ -13,7 +13,7 @@ $contentWidth:690px; |
13 | color: #333333; | 13 | color: #333333; |
14 | 14 | ||
15 | .top-space { | 15 | .top-space { |
16 | height: 0px; | 16 | height: 20px; |
17 | } | 17 | } |
18 | 18 | ||
19 | .content { | 19 | .content { |
... | @@ -21,10 +21,12 @@ $contentWidth:690px; | ... | @@ -21,10 +21,12 @@ $contentWidth:690px; |
21 | width: 690px; | 21 | width: 690px; |
22 | margin: 0 auto; | 22 | margin: 0 auto; |
23 | 23 | ||
24 | .func-wrap{ | ||
25 | } | ||
24 | .func { | 26 | .func { |
25 | @extend .fcc; | 27 | @extend .fcc; |
26 | height: 80px; | 28 | height: 80px; |
27 | border-bottom: solid 1px #DDDDDD; | 29 | // border-bottom: solid 1px #DDDDDD; |
28 | font-size: 32px; | 30 | font-size: 32px; |
29 | color: #3680EB; | 31 | color: #3680EB; |
30 | 32 | ... | ... |
... | @@ -5,22 +5,36 @@ | ... | @@ -5,22 +5,36 @@ |
5 | <view class="app__content main"> | 5 | <view class="app__content main"> |
6 | <view class="top-space"></view> | 6 | <view class="top-space"></view> |
7 | <view class="content"> | 7 | <view class="content"> |
8 | <view class="func"> | 8 | <view class="func-wrap"> |
9 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-sign-record.png" /> | 9 | <picker mode="date" value="{{dateStart}}" bindchange="bindDateStartChange"> |
10 | 时间筛选 | 10 | <view class="func"> |
11 | <image class="arrow" mode="aspectFit" src="../../image/icon/icon-filter-down-on.png" /> | 11 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-sign-record.png" /> |
12 | 起始时间 | ||
13 | <image class="arrow" mode="aspectFit" src="../../image/icon/icon-filter-down-on.png" /> | ||
14 | {{dateStart}} | ||
15 | </view> | ||
16 | </picker> | ||
17 | <picker mode="date" value="{{dateEnd}}" bindchange="bindDateEndChange"> | ||
18 | <view class="func"> | ||
19 | <image class="icon" mode="aspectFit" src="../../image/icon/icon-sign-record.png" /> | ||
20 | 结束时间 | ||
21 | <image class="arrow" mode="aspectFit" src="../../image/icon/icon-filter-down-on.png" /> | ||
22 | {{dateEnd}} | ||
23 | </view> | ||
24 | </picker> | ||
12 | </view> | 25 | </view> |
13 | <view class="sign"> | 26 | <view class="sign"> |
14 | <view class="sign-item"> | 27 | <view wx:for="{{dataList}}" wx:key="{{index}}" class="sign-item"> |
15 | <view class="date">2019.03.13</view> | 28 | <view class="date">{{item.signTime}}</view> |
16 | <view class="desc"> | 29 | <view class="desc"> |
17 | 签到成功,获得 | 30 | 签到成功,获得 |
18 | <span class="green red">1</span> | 31 | <span class="green {{item.prizeType == 'packet' ? 'red':''}}">{{item.prizeSize}}</span> |
19 | 红包 | 32 | {{item.prizeType == 'packet' ? '元红包' : '积分' }} |
20 | </view> | 33 | </view> |
21 | </view> | 34 | </view> |
22 | </view> | 35 | </view> |
23 | </view> | 36 | </view> |
37 | <empty-tips wx:if="{{dataList.length <= 0}}"></empty-tips> | ||
24 | </view> | 38 | </view> |
25 | </view> | 39 | </view> |
26 | <van-popup show="{{ authorizeVisible }}"> | 40 | <van-popup show="{{ authorizeVisible }}"> | ... | ... |
src/utils/qrcode.js
0 → 100755
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment