├── .gitignore
├── App.vue
├── README.md
├── common
├── denglu.css
├── graceChecker.js
├── icon.css
├── uni.css
└── util.js
├── components
└── qrcode
│ ├── qrcode.js
│ └── qrcode.vue
├── main.js
├── manifest.json
├── pages.json
├── pages
├── denglu
│ ├── login
│ │ └── login.vue
│ ├── logout
│ │ └── logout.vue
│ ├── password
│ │ └── password.vue
│ └── register
│ │ └── register.vue
├── index
│ └── index.vue
├── mine
│ ├── info
│ │ └── info.vue
│ ├── logo
│ │ └── logo.vue
│ ├── qrcode
│ │ └── qrcode.vue
│ └── scan
│ │ └── scan.vue
└── tabBar
│ ├── contact
│ └── contact.vue
│ ├── mine
│ └── mine.vue
│ └── news
│ └── news.vue
├── static
├── 44.jpg
├── contact.png
├── contactHL.png
├── index_1.jpg
├── index_2.jpg
├── index_3.jpg
├── mine.png
├── mineHL.png
├── news.png
├── newsHL.png
├── qunliao.png
├── saoyisao.png
├── shezhi.png
└── xinpy.png
└── store
└── index.js
/.gitignore:
--------------------------------------------------------------------------------
1 | # My project ignore
2 | *.project
3 | .DS_Store
4 | .project
5 | node_modules
6 | unpackage/
7 | config.json
8 |
--------------------------------------------------------------------------------
/App.vue:
--------------------------------------------------------------------------------
1 |
14 |
15 |
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # uni-shop
2 | 用[uni-app](https://uniapp.dcloud.io/)创建的类微信应用。
3 |
4 |
5 | - 项目使用[Easy Mock](https://easy-mock.com/)模拟数据,并不是真实数据。
6 | - 项目登录用户名随便写,只做了密码判断,用来模拟登录行为。
7 | - 登录密码为123。
8 |
9 | ## 知识点
10 | 简单罗列出项目中使用到的组件和相关技术,详细信息查询官方手册即可。
11 | - [pages.json](https://uniapp.dcloud.io/collocation/pages):用来对 uni-app 进行全局配置,决定页面文件的路径、窗口表现、设置多 tab 等。项目中包括修改标题文本、启动页修改透明标题栏、开发环境启动指定页面,设置底部tab选项卡和图标文字等,都是通过修改这个文件实现的。
12 | - [vuex](https://vuex.vuejs.org/zh/):专为 Vue.js 应用程序开发的状态管理模式。因为项目模拟了用户登录的过程,所以采用vuex管理用户登录状态,并将用户信息,包括头像、昵称、账号等信息存储起来。
13 | - [uni.setStorageSync](https://uniapp.dcloud.io/api/storage/storage?id=setstoragesync):将 data 存储在本地缓存中指定的 key 中。因为vuex不是持久化的状态,一点用户关掉程序,然后再次启动程序,就会丢失掉用户信息。这里我想到的解决办法就是使用storage,将用户信息保存在本地缓存中。
14 | - [uni.reLaunch(OBJECT)](https://uniapp.dcloud.io/api/router?id=relaunch):关闭所有页面,打开到应用内的某个页面。这个接口的主要区别就是关掉当前所有页面,然后新打开一个页面。与`uni.navigateTo(OBJECT)`不同。`navigateTo`接口是在当前页面打开新的页面。
15 | - [使用代码块直接创建组件模板](https://uniapp.dcloud.io/snippet?id=%E4%BD%BF%E7%94%A8%E4%BB%A3%E7%A0%81%E5%9D%97%E7%9B%B4%E6%8E%A5%E5%88%9B%E5%BB%BA%E7%BB%84%E4%BB%B6%E6%A8%A1%E6%9D%BF):在Hbulider X中,内置了很多的代码块,灵活使用代码块可以提高不少开发效率。
16 | - [使用 Chrome 调试](https://uniapp.dcloud.io/snippet?id=%E4%BD%BF%E7%94%A8-chrome-%E8%B0%83%E8%AF%95):最新版本的HbuliderX已经可以开发H5程序了。并且可以在Chrome中调试程序,感觉比在微信开发者工具中调试更舒服。
17 | - [onPullDownRefresh](https://uniapp.dcloud.io/api/ui/pulldown?id=onpulldownrefresh):监听页面用户下拉刷新事件。因为我没有想明白该怎样实现微信聊天功能的,消息实时同步的过程,所以暂时让用户手动刷新获取最新消息。体验并不好~ :-(
18 | - [index-list](https://github.com/dcloudio/hello-uniapp/tree/master/pages/template/index-list):在hello uniapp中,有这个例子,参考使用即可做出类似微信通讯录的页面。
19 | - [qrcode二维码](https://github.com/dcloudio/hello-uniapp/tree/master/pages/template/qrcode):参考这个页面内容,可以生成二维码。
20 | - [scan扫描二维码](https://github.com/dcloudio/hello-uniapp/tree/master/pages/API/scan-code):参考这个例子可以实现扫描二维码。
21 |
22 | ## 修复的bug问题
23 |
24 | - 注册页面文字两端对齐bug。本来以为跟浏览器中一样,使用转义字符就能解决,项目中使用了` `,但是发现在某些安卓机中,会失效。所以改成了css实现两端对齐。使用css3 [justify-content](http://www.runoob.com/cssref/css3-pr-justify-content.html)实现。
25 | - 启动页跳过按钮失效。启动页计划是不显示导航栏的,为了跳过启动页,添加了一个跳过按钮。但是我没有考虑到导航栏的高度。因为我本来以为这个导航栏已经被隐藏了,其实不然,这个导航栏一直存在,只不过变成了透明而已。如果这个跳过按钮位置是在导航栏上,会导致按钮失效。通过查找论坛文档,找到了这个导航栏高度[【示例】原生标题栏titleNView使用说明](http://ask.dcloud.net.cn/article/1205),是固定高度44px。
26 |
27 |
28 | ## 相关文章
29 |
30 | 整理的相关学习文章:
31 | - [uni-app官方教程学习手记](https://segmentfault.com/a/1190000017020710)
32 | - [uni-app 创建的第一个应用](https://segmentfault.com/a/1190000017168549)
33 |
--------------------------------------------------------------------------------
/common/denglu.css:
--------------------------------------------------------------------------------
1 | .content {
2 | display: flex;
3 | flex: 1;
4 | flex-direction: column;
5 | /* background-color: #efeff4; */
6 | padding: 20px;
7 | }
8 |
9 | .input-group {
10 | background-color: #ffffff;
11 | margin-top: 40upx;
12 | position: relative;
13 | }
14 |
15 | .input-row.border::after {
16 | position: absolute;
17 | right: 0;
18 | bottom: 0;
19 | left: 0px;
20 | height: 1px;
21 | content: '';
22 | -webkit-transform: scaleY(.5);
23 | transform: scaleY(.5);
24 | background-color: #c8c7cc;
25 | }
26 |
27 | .input-group::after {
28 | position: absolute;
29 | right: 0;
30 | bottom: 0;
31 | left: 0;
32 | height: 1px;
33 | content: '';
34 | -webkit-transform: scaleY(.5);
35 | transform: scaleY(.5);
36 | background-color: #c8c7cc;
37 | }
38 |
39 | .input-row {
40 | display: flex;
41 | flex-direction: row;
42 | position: relative;
43 | }
44 |
45 | .input-row .title,.input-row input{
46 | height: 70upx;
47 | padding: 20upx 0;
48 | line-height: 70upx;
49 | }
50 |
51 | .action-row {
52 | display: flex;
53 | flex-direction: row;
54 | justify-content: center;
55 | }
56 |
57 | .action-row navigator {
58 | color: #09BB07;
59 | padding: 0 20px;
60 | }
61 |
62 | .btn-row {
63 | margin: 50px 0;
64 | }
65 |
66 | button.primary {
67 | background-color: #09BB07;
68 | }
--------------------------------------------------------------------------------
/common/graceChecker.js:
--------------------------------------------------------------------------------
1 | /**
2 | 数据验证(表单验证)
3 | 来自 grace.hcoder.net
4 | 作者 hcoder 深海
5 | */
6 | module.exports = {
7 | error:'',
8 | check : function (data, rule){
9 | for(var i = 0; i < rule.length; i++){
10 | if (!rule[i].checkType){return true;}
11 | if (!rule[i].name) {return true;}
12 | if (!rule[i].errorMsg) {return true;}
13 | if (!data[rule[i].name]) {this.error = rule[i].errorMsg; return false;}
14 | switch (rule[i].checkType){
15 | case 'string':
16 | var reg = new RegExp('^.{' + rule[i].checkRule + '}$');
17 | if(!reg.test(data[rule[i].name])) {this.error = rule[i].errorMsg; return false;}
18 | break;
19 | case 'int':
20 | var reg = new RegExp('^(-[1-9]|[1-9])[0-9]{' + rule[i].checkRule + '}$');
21 | if(!reg.test(data[rule[i].name])) {this.error = rule[i].errorMsg; return false;}
22 | break;
23 | break;
24 | case 'between':
25 | if (!this.isNumber(data[rule[i].name])){
26 | this.error = rule[i].errorMsg;
27 | return false;
28 | }
29 | var minMax = rule[i].checkRule.split(',');
30 | minMax[0] = Number(minMax[0]);
31 | minMax[1] = Number(minMax[1]);
32 | if (data[rule[i].name] > minMax[1] || data[rule[i].name] < minMax[0]) {
33 | this.error = rule[i].errorMsg;
34 | return false;
35 | }
36 | break;
37 | case 'betweenD':
38 | var reg = /^-?[1-9][0-9]?$/;
39 | if (!reg.test(data[rule[i].name])) { this.error = rule[i].errorMsg; return false; }
40 | var minMax = rule[i].checkRule.split(',');
41 | minMax[0] = Number(minMax[0]);
42 | minMax[1] = Number(minMax[1]);
43 | if (data[rule[i].name] > minMax[1] || data[rule[i].name] < minMax[0]) {
44 | this.error = rule[i].errorMsg;
45 | return false;
46 | }
47 | break;
48 | case 'betweenF':
49 | var reg = /^-?[0-9][0-9]?.+[0-9]+$/;
50 | if (!reg.test(data[rule[i].name])){this.error = rule[i].errorMsg; return false;}
51 | var minMax = rule[i].checkRule.split(',');
52 | minMax[0] = Number(minMax[0]);
53 | minMax[1] = Number(minMax[1]);
54 | if (data[rule[i].name] > minMax[1] || data[rule[i].name] < minMax[0]) {
55 | this.error = rule[i].errorMsg;
56 | return false;
57 | }
58 | break;
59 | case 'same':
60 | if (data[rule[i].name] != rule[i].checkRule) { this.error = rule[i].errorMsg; return false;}
61 | break;
62 | case 'notsame':
63 | if (data[rule[i].name] == rule[i].checkRule) { this.error = rule[i].errorMsg; return false; }
64 | break;
65 | case 'email':
66 | var reg = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
67 | if (!reg.test(data[rule[i].name])) { this.error = rule[i].errorMsg; return false; }
68 | break;
69 | case 'phoneno':
70 | var reg = /^1[0-9]{10,10}$/;
71 | if (!reg.test(data[rule[i].name])) { this.error = rule[i].errorMsg; return false; }
72 | break;
73 | case 'zipcode':
74 | var reg = /^[0-9]{6}$/;
75 | if (!reg.test(data[rule[i].name])) { this.error = rule[i].errorMsg; return false; }
76 | break;
77 | case 'reg':
78 | var reg = new RegExp(rule[i].checkRule);
79 | if (!reg.test(data[rule[i].name])) { this.error = rule[i].errorMsg; return false; }
80 | break;
81 | case 'in':
82 | if(rule[i].checkRule.indexOf(data[rule[i].name]) == -1){
83 | this.error = rule[i].errorMsg; return false;
84 | }
85 | break;
86 | case 'notnull':
87 | if(data[rule[i].name] == null || data[rule[i].name].length < 1){this.error = rule[i].errorMsg; return false;}
88 | break;
89 | }
90 | }
91 | return true;
92 | },
93 | isNumber : function (checkVal){
94 | var reg = /^-?[1-9][0-9]?.?[0-9]*$/;
95 | return reg.test(checkVal);
96 | }
97 | }
--------------------------------------------------------------------------------
/common/icon.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: uniicons;
3 | font-weight: normal;
4 | font-style: normal;
5 | src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf?t=1536565627510') format('truetype');
6 | }
7 |
8 | .uni-icon {
9 | font-family: uniicons;
10 | font-size: 48upx;
11 | font-weight: normal;
12 | font-style: normal;
13 | line-height: 1;
14 | display: inline-block;
15 | text-decoration: none;
16 | -webkit-font-smoothing: antialiased;
17 | }
18 |
19 | .uni-icon.uni-active {
20 | color: #007aff;
21 | }
22 |
23 | .uni-icon-contact:before {
24 | content: '\e100';
25 | }
26 |
27 | .uni-icon-person:before {
28 | content: '\e101';
29 | }
30 |
31 | .uni-icon-personadd:before {
32 | content: '\e102';
33 | }
34 |
35 | .uni-icon-contact-filled:before {
36 | content: '\e130';
37 | }
38 |
39 | .uni-icon-person-filled:before {
40 | content: '\e131';
41 | }
42 |
43 | .uni-icon-personadd-filled:before {
44 | content: '\e132';
45 | }
46 |
47 | .uni-icon-phone:before {
48 | content: '\e200';
49 | }
50 |
51 | .uni-icon-email:before {
52 | content: '\e201';
53 | }
54 |
55 | .uni-icon-chatbubble:before {
56 | content: '\e202';
57 | }
58 |
59 | .uni-icon-chatboxes:before {
60 | content: '\e203';
61 | }
62 |
63 | .uni-icon-phone-filled:before {
64 | content: '\e230';
65 | }
66 |
67 | .uni-icon-email-filled:before {
68 | content: '\e231';
69 | }
70 |
71 | .uni-icon-chatbubble-filled:before {
72 | content: '\e232';
73 | }
74 |
75 | .uni-icon-chatboxes-filled:before {
76 | content: '\e233';
77 | }
78 |
79 | .uni-icon-weibo:before {
80 | content: '\e260';
81 | }
82 |
83 | .uni-icon-weixin:before {
84 | content: '\e261';
85 | }
86 |
87 | .uni-icon-pengyouquan:before {
88 | content: '\e262';
89 | }
90 |
91 | .uni-icon-chat:before {
92 | content: '\e263';
93 | }
94 |
95 | .uni-icon-qq:before {
96 | content: '\e264';
97 | }
98 |
99 | .uni-icon-videocam:before {
100 | content: '\e300';
101 | }
102 |
103 | .uni-icon-camera:before {
104 | content: '\e301';
105 | }
106 |
107 | .uni-icon-mic:before {
108 | content: '\e302';
109 | }
110 |
111 | .uni-icon-location:before {
112 | content: '\e303';
113 | }
114 |
115 | .uni-icon-mic-filled:before,
116 | .uni-icon-speech:before {
117 | content: '\e332';
118 | }
119 |
120 | .uni-icon-location-filled:before {
121 | content: '\e333';
122 | }
123 |
124 | .uni-icon-micoff:before {
125 | content: '\e360';
126 | }
127 |
128 | .uni-icon-image:before {
129 | content: '\e363';
130 | }
131 |
132 | .uni-icon-map:before {
133 | content: '\e364';
134 | }
135 |
136 | .uni-icon-compose:before {
137 | content: '\e400';
138 | }
139 |
140 | .uni-icon-trash:before {
141 | content: '\e401';
142 | }
143 |
144 | .uni-icon-upload:before {
145 | content: '\e402';
146 | }
147 |
148 | .uni-icon-download:before {
149 | content: '\e403';
150 | }
151 |
152 | .uni-icon-close:before {
153 | content: '\e404';
154 | }
155 |
156 | .uni-icon-redo:before {
157 | content: '\e405';
158 | }
159 |
160 | .uni-icon-undo:before {
161 | content: '\e406';
162 | }
163 |
164 | .uni-icon-refresh:before {
165 | content: '\e407';
166 | }
167 |
168 | .uni-icon-star:before {
169 | content: '\e408';
170 | }
171 |
172 | .uni-icon-plus:before {
173 | content: '\e409';
174 | }
175 |
176 | .uni-icon-minus:before {
177 | content: '\e410';
178 | }
179 |
180 | .uni-icon-circle:before,
181 | .uni-icon-checkbox:before {
182 | content: '\e411';
183 | }
184 |
185 | .uni-icon-close-filled:before,
186 | .uni-icon-clear:before {
187 | content: '\e434';
188 | }
189 |
190 | .uni-icon-refresh-filled:before {
191 | content: '\e437';
192 | }
193 |
194 | .uni-icon-star-filled:before {
195 | content: '\e438';
196 | }
197 |
198 | .uni-icon-plus-filled:before {
199 | content: '\e439';
200 | }
201 |
202 | .uni-icon-minus-filled:before {
203 | content: '\e440';
204 | }
205 |
206 | .uni-icon-circle-filled:before {
207 | content: '\e441';
208 | }
209 |
210 | .uni-icon-checkbox-filled:before {
211 | content: '\e442';
212 | }
213 |
214 | .uni-icon-closeempty:before {
215 | content: '\e460';
216 | }
217 |
218 | .uni-icon-refreshempty:before {
219 | content: '\e461';
220 | }
221 |
222 | .uni-icon-reload:before {
223 | content: '\e462';
224 | }
225 |
226 | .uni-icon-starhalf:before {
227 | content: '\e463';
228 | }
229 |
230 | .uni-icon-spinner:before {
231 | content: '\e464';
232 | }
233 |
234 | .uni-icon-spinner-cycle:before {
235 | content: '\e465';
236 | }
237 |
238 | .uni-icon-search:before {
239 | content: '\e466';
240 | }
241 |
242 | .uni-icon-plusempty:before {
243 | content: '\e468';
244 | }
245 |
246 | .uni-icon-forward:before {
247 | content: '\e470';
248 | }
249 |
250 | .uni-icon-back:before,
251 | .uni-icon-left-nav:before {
252 | content: '\e471';
253 | }
254 |
255 | .uni-icon-checkmarkempty:before {
256 | content: '\e472';
257 | }
258 |
259 | .uni-icon-home:before {
260 | content: '\e500';
261 | }
262 |
263 | .uni-icon-navigate:before {
264 | content: '\e501';
265 | }
266 |
267 | .uni-icon-gear:before {
268 | content: '\e502';
269 | }
270 |
271 | .uni-icon-paperplane:before {
272 | content: '\e503';
273 | }
274 |
275 | .uni-icon-info:before {
276 | content: '\e504';
277 | }
278 |
279 | .uni-icon-help:before {
280 | content: '\e505';
281 | }
282 |
283 | .uni-icon-locked:before {
284 | content: '\e506';
285 | }
286 |
287 | .uni-icon-more:before {
288 | content: '\e507';
289 | }
290 |
291 | .uni-icon-flag:before {
292 | content: '\e508';
293 | }
294 |
295 | .uni-icon-home-filled:before {
296 | content: '\e530';
297 | }
298 |
299 | .uni-icon-gear-filled:before {
300 | content: '\e532';
301 | }
302 |
303 | .uni-icon-info-filled:before {
304 | content: '\e534';
305 | }
306 |
307 | .uni-icon-help-filled:before {
308 | content: '\e535';
309 | }
310 |
311 | .uni-icon-more-filled:before {
312 | content: '\e537';
313 | }
314 |
315 | .uni-icon-settings:before {
316 | content: '\e560';
317 | }
318 |
319 | .uni-icon-list:before {
320 | content: '\e562';
321 | }
322 |
323 | .uni-icon-bars:before {
324 | content: '\e563';
325 | }
326 |
327 | .uni-icon-loop:before {
328 | content: '\e565';
329 | }
330 |
331 | .uni-icon-paperclip:before {
332 | content: '\e567';
333 | }
334 |
335 | .uni-icon-eye:before {
336 | content: '\e568';
337 | }
338 |
339 | .uni-icon-arrowup:before {
340 | content: '\e580';
341 | }
342 |
343 | .uni-icon-arrowdown:before {
344 | content: '\e581';
345 | }
346 |
347 | .uni-icon-arrowleft:before {
348 | content: '\e582';
349 | }
350 |
351 | .uni-icon-arrowright:before {
352 | content: '\e583';
353 | }
354 |
355 | .uni-icon-arrowthinup:before {
356 | content: '\e584';
357 | }
358 |
359 | .uni-icon-arrowthindown:before {
360 | content: '\e585';
361 | }
362 |
363 | .uni-icon-arrowthinleft:before {
364 | content: '\e586';
365 | }
366 |
367 | .uni-icon-arrowthinright:before {
368 | content: '\e587';
369 | }
370 |
371 | .uni-icon-pulldown:before {
372 | content: '\e588';
373 | }
374 |
375 | .uni-icon-scan:before {
376 | content: "\e612";
377 | }
378 |
--------------------------------------------------------------------------------
/common/uni.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: uniicons;
3 | font-weight: normal;
4 | font-style: normal;
5 | src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
6 | }
7 |
8 |
9 |
10 |
11 | /*通用 */
12 |
13 | .uni-flex {
14 | display: flex;
15 | flex-direction: row;
16 | }
17 |
18 | .uni-flex-item {
19 | flex: 1;
20 | }
21 |
22 | .uni-row {
23 | flex-direction: row;
24 | }
25 |
26 | .uni-column {
27 | flex-direction: column;
28 | }
29 |
30 | .uni-h6 {
31 | font-size: 24upx;
32 | color: #8f8f94;
33 | }
34 |
35 | .uni-h5 {
36 | font-size: 28upx;
37 | color: #8f8f94;
38 | }
39 |
40 | .uni-h4 {
41 | font-size: 36upx;
42 | }
43 |
44 | .uni-h3 {
45 | font-size: 48upx;
46 | font-weight: 600;
47 | }
48 |
49 | .uni-h2 {
50 | font-size: 60upx;
51 | font-weight: 600;
52 | }
53 |
54 | .uni-h1 {
55 | font-size: 72upx;
56 | font-weight: 600;
57 | }
58 |
59 | .uni-ellipsis {
60 | overflow: hidden;
61 | white-space: nowrap;
62 | text-overflow: ellipsis;
63 | }
64 |
65 | .uni-input {
66 | height: 50upx;
67 | min-height: 50upx;
68 | padding: 15upx 0;
69 | line-height: 50upx;
70 | }
71 |
72 | .uni-label {
73 | width: 210upx;
74 | word-wrap: break-word;
75 | word-break: break-all;
76 | }
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | /*数字角标*/
85 |
86 | .uni-badge,
87 | .uni-badge-default {
88 | font-family: 'Helvetica Neue', Helvetica, sans-serif;
89 | font-size: 12px;
90 | line-height: 1;
91 | display: inline-block;
92 | padding: 3px 6px;
93 | color: #333;
94 | border-radius: 100px;
95 | background-color: rgba(0, 0, 0, .15);
96 | }
97 |
98 | .uni-badge.uni-badge-inverted {
99 | padding: 0 5px 0 0;
100 | color: #929292;
101 | background-color: transparent
102 | }
103 |
104 | .uni-badge-primary {
105 | color: #fff;
106 | background-color: #007aff
107 | }
108 |
109 | .uni-badge-blue.uni-badge-inverted,
110 | .uni-badge-primary.uni-badge-inverted {
111 | color: #007aff;
112 | background-color: transparent
113 | }
114 |
115 | .uni-badge-green,
116 | .uni-badge-success {
117 | color: #fff;
118 | background-color: #4cd964;
119 | }
120 |
121 | .uni-badge-green.uni-badge-inverted,
122 | .uni-badge-success.uni-badge-inverted {
123 | color: #4cd964;
124 | background-color: transparent
125 | }
126 |
127 | .uni-badge-warning,
128 | .uni-badge-yellow {
129 | color: #fff;
130 | background-color: #f0ad4e
131 | }
132 |
133 | .uni-badge-warning.uni-badge-inverted,
134 | .uni-badge-yellow.uni-badge-inverted {
135 | color: #f0ad4e;
136 | background-color: transparent
137 | }
138 |
139 | .uni-badge-danger,
140 | .uni-badge-red {
141 | color: #fff;
142 | background-color: #dd524d
143 | }
144 |
145 | .uni-badge-danger.uni-badge-inverted,
146 | .uni-badge-red.uni-badge-inverted {
147 | color: #dd524d;
148 | background-color: transparent
149 | }
150 |
151 | .uni-badge-purple,
152 | .uni-badge-royal {
153 | color: #fff;
154 | background-color: #8a6de9
155 | }
156 |
157 | .uni-badge-purple.uni-badge-inverted,
158 | .uni-badge-royal.uni-badge-inverted {
159 | color: #8a6de9;
160 | background-color: transparent
161 | }
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 | /*折叠面板 */
170 |
171 | .uni-collapse-content {
172 | height: 0;
173 | width: 100%;
174 | overflow: hidden;
175 | }
176 |
177 | .uni-collapse-content.uni-active {
178 | height: auto;
179 | }
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 | /*卡片视图 */
188 |
189 | .uni-card {
190 | background: #fff;
191 | border-radius: 8upx;
192 | margin: 20upx;
193 | position: relative;
194 | box-shadow: 0 2upx 4upx rgba(0, 0, 0, .3);
195 | }
196 |
197 | .uni-card-content {
198 | font-size: 30upx;
199 | }
200 |
201 | .uni-card-content-inner {
202 | position: relative;
203 | padding: 30upx;
204 | }
205 |
206 | .uni-card-footer,
207 | .uni-card-header {
208 | position: relative;
209 | display: flex;
210 | min-height: 50upx;
211 | padding: 20upx 30upx;
212 | justify-content: space-between;
213 | align-items: center;
214 | }
215 |
216 | .uni-card-header {
217 | font-size: 36upx;
218 | }
219 |
220 | .uni-card-footer {
221 | color: #6d6d72;
222 | }
223 |
224 | .uni-card-footer:before,
225 | .uni-card-header:after {
226 | position: absolute;
227 | top: 0;
228 | right: 0;
229 | left: 0;
230 | height: 2upx;
231 | content: '';
232 | -webkit-transform: scaleY(.5);
233 | transform: scaleY(.5);
234 | background-color: #c8c7cc;
235 | }
236 |
237 | .uni-card-header:after {
238 | top: auto;
239 | bottom: 0;
240 | }
241 |
242 | .uni-card-media {
243 | justify-content: flex-start;
244 | }
245 |
246 | .uni-card-media-logo {
247 | height: 84upx;
248 | width: 84upx;
249 | margin-right: 20upx;
250 | }
251 |
252 | .uni-card-media-body {
253 | height: 84upx;
254 | display: flex;
255 | flex-direction: column;
256 | justify-content: space-between;
257 | align-items: flex-start;
258 | }
259 |
260 | .uni-card-media-text-top {
261 | line-height: 36upx;
262 | font-size: 34upx;
263 | }
264 |
265 | .uni-card-media-text-bottom {
266 | line-height: 30upx;
267 | font-size: 28upx;
268 | color: #8f8f94;
269 | }
270 |
271 | .uni-card-link {
272 | color: #007AFF;
273 | }
274 |
275 |
276 |
277 |
278 | /* 列表 */
279 |
280 | .uni-list {
281 | background-color: #FFFFFF;
282 | position: relative;
283 | width: 100%;
284 | display: flex;
285 | flex-direction: column;
286 | }
287 |
288 | .uni-list:after {
289 | position: absolute;
290 | z-index: 10;
291 | right: 0;
292 | bottom: 0;
293 | left: 0;
294 | height: 1upx;
295 | content: '';
296 | -webkit-transform: scaleY(.5);
297 | transform: scaleY(.5);
298 | background-color: #c8c7cc;
299 | }
300 |
301 | .uni-list:before {
302 | position: absolute;
303 | z-index: 10;
304 | right: 0;
305 | top: 0;
306 | left: 0;
307 | height: 1upx;
308 | content: '';
309 | -webkit-transform: scaleY(.5);
310 | transform: scaleY(.5);
311 | background-color: #c8c7cc;
312 | }
313 |
314 | .uni-list-cell {
315 | position: relative;
316 | display: flex;
317 | flex-direction: row;
318 | justify-content: space-between;
319 | align-items: center;
320 | }
321 |
322 | .uni-list-cell-hover {
323 | background-color: #eee;
324 | }
325 |
326 | .uni-list-cell-pd {
327 | padding: 22upx 30upx;
328 | }
329 |
330 | .uni-list-cell-left {
331 | padding: 0 30upx;
332 | }
333 |
334 | .uni-list-cell-db,
335 | .uni-list-cell-right {
336 | flex: 1;
337 | }
338 |
339 | .uni-list-cell:after {
340 | position: absolute;
341 | right: 0;
342 | bottom: 0;
343 | left: 30upx;
344 | height: 1upx;
345 | content: '';
346 | -webkit-transform: scaleY(.5);
347 | transform: scaleY(.5);
348 | background-color: #c8c7cc;
349 | }
350 |
351 | .uni-list .uni-list-cell:last-child:after {
352 | height: 0upx;
353 | }
354 |
355 | .uni-list-cell-last.uni-list-cell:after {
356 | height: 0upx;
357 | }
358 |
359 | .uni-list-cell-divider {
360 | position: relative;
361 | display: flex;
362 | color: #999;
363 | background-color: #f7f7f7;
364 | padding: 10upx 20upx;
365 | }
366 |
367 | .uni-list-cell-divider:before {
368 | position: absolute;
369 | right: 0;
370 | top: 0;
371 | left: 0upx;
372 | height: 1upx;
373 | content: '';
374 | -webkit-transform: scaleY(.5);
375 | transform: scaleY(.5);
376 | background-color: #c8c7cc;
377 | }
378 |
379 | .uni-list-cell-divider:after {
380 | position: absolute;
381 | right: 0;
382 | bottom: 0;
383 | left: 0upx;
384 | height: 1upx;
385 | content: '';
386 | -webkit-transform: scaleY(.5);
387 | transform: scaleY(.5);
388 | background-color: #c8c7cc;
389 | }
390 |
391 | .uni-list-cell-navigate {
392 | padding: 22upx 30upx;
393 | line-height: 48upx;
394 | position: relative;
395 | display: flex;
396 | box-sizing: border-box;
397 | width: 100%;
398 | flex: 1;
399 | justify-content: space-between;
400 | align-items: center;
401 | }
402 |
403 | .uni-list-cell-navigate {
404 | padding-right: 36upx;
405 | }
406 |
407 | .uni-navigate-badge {
408 | padding-right: 50upx;
409 | }
410 |
411 | .uni-list-cell-navigate.uni-navigate-right:after {
412 | font-family: uniicons;
413 | content: '\e583';
414 | position: absolute;
415 | right: 24upx;
416 | top: 50%;
417 | color: #bbb;
418 | -webkit-transform: translateY(-50%);
419 | transform: translateY(-50%);
420 | }
421 |
422 | .uni-list-cell-navigate.uni-navigate-bottom:after {
423 | font-family: uniicons;
424 | content: '\e581';
425 | position: absolute;
426 | right: 24upx;
427 | top: 50%;
428 | color: #bbb;
429 | -webkit-transform: translateY(-50%);
430 | transform: translateY(-50%);
431 | }
432 |
433 | .uni-list-cell-navigate.uni-navigate-bottom.uni-active:after {
434 | font-family: uniicons;
435 | content: '\e580';
436 | position: absolute;
437 | right: 24upx;
438 | top: 50%;
439 | color: #bbb;
440 | -webkit-transform: translateY(-50%);
441 | transform: translateY(-50%);
442 | }
443 |
444 | .uni-collapse.uni-list-cell {
445 | flex-direction: column;
446 | }
447 |
448 | .uni-list-cell-navigate.uni-active {
449 | background: #eee;
450 | }
451 |
452 | .uni-list.uni-collapse {
453 | box-sizing: border-box;
454 | height: 0;
455 | overflow: hidden;
456 | }
457 |
458 | .uni-collapse .uni-list-cell {
459 | padding-left: 36upx;
460 | }
461 |
462 | .uni-collapse .uni-list-cell:after {
463 | left: 52upx;
464 | }
465 |
466 | .uni-list.uni-active {
467 | height: auto;
468 | }
469 |
470 |
471 |
472 |
473 |
474 |
475 | /* 三行列表 */
476 |
477 | .uni-triplex-row {
478 | display: flex;
479 | flex: 1;
480 | width: 100%;
481 | box-sizing: border-box;
482 | flex-direction: row;
483 | padding: 22upx 30upx;
484 | }
485 |
486 | .uni-triplex-right,
487 | .uni-triplex-left {
488 | display: flex;
489 | flex-direction: column;
490 | }
491 |
492 | .uni-triplex-left {
493 | width: 84%;
494 | }
495 |
496 | .uni-triplex-right {
497 | width: 16%;
498 | text-align: right;
499 | }
500 |
501 |
502 |
503 |
504 |
505 |
506 | /* 图文列表 */
507 |
508 | .uni-media-list {
509 | padding: 22upx 30upx;
510 | box-sizing: border-box;
511 | display: flex;
512 | width: 100%;
513 | flex-direction: row;
514 | }
515 |
516 | .uni-navigate-right.uni-media-list {
517 | padding-right: 74upx;
518 | }
519 |
520 | .uni-pull-right {
521 | flex-direction: row-reverse;
522 | }
523 |
524 | .uni-pull-right>.uni-media-list-logo {
525 | margin-right: 0upx;
526 | margin-left: 20upx;
527 | }
528 |
529 | .uni-media-list-logo {
530 | height: 84upx;
531 | width: 84upx;
532 | margin-right: 20upx;
533 | }
534 |
535 | .uni-media-list-logo image {
536 | height: 100%;
537 | width: 100%;
538 | }
539 |
540 | .uni-media-list-body {
541 | height: 84upx;
542 | display: flex;
543 | flex: 1;
544 | flex-direction: column;
545 | justify-content: space-between;
546 | align-items: flex-start;
547 | overflow: hidden;
548 | }
549 |
550 | .uni-media-list-text-top {
551 | width: 100%;
552 | line-height: 36upx;
553 | font-size: 34upx;
554 | }
555 |
556 | .uni-media-list-text-bottom {
557 | width: 100%;
558 | line-height: 30upx;
559 | font-size: 28upx;
560 | color: #8f8f94;
561 | }
562 |
563 |
564 |
565 |
566 |
567 | /* 九宫格 */
568 |
569 | .uni-grid-9 {
570 | background: #f2f2f2;
571 | width: 750upx;
572 | display: flex;
573 | flex-direction: row;
574 | flex-wrap: wrap;
575 | border-top: 2upx solid #eee;
576 | }
577 |
578 | .uni-grid-9-item {
579 | width: 250upx;
580 | height: 200upx;
581 | display: flex;
582 | flex-direction: column;
583 | align-items: center;
584 | justify-content: center;
585 | border-bottom: 2upx solid;
586 | border-right: 2upx solid;
587 | border-color: #eee;
588 | box-sizing: border-box;
589 | }
590 |
591 | .no-border-right {
592 | border-right: none;
593 | }
594 |
595 | .uni-grid-9-image {
596 | width: 100upx;
597 | height: 100upx;
598 | }
599 |
600 | .uni-grid-9-text {
601 | width: 250upx;
602 | line-height: 4upx;
603 | height: 40upx;
604 | text-align: center;
605 | font-size: 30upx;
606 | }
607 |
608 | .uni-grid-9-item-hover {
609 | background: rgba(0, 0, 0, 0.1);
610 | }
611 |
612 |
613 |
614 |
615 |
616 | /* 上传 */
617 |
618 | .uni-uploader {
619 | flex: 1;
620 | flex-direction: column;
621 | }
622 |
623 | .uni-uploader-head {
624 | display: flex;
625 | flex-direction: row;
626 | justify-content: space-between;
627 | }
628 |
629 | .uni-uploader-info {
630 | color: #B2B2B2;
631 | }
632 |
633 | .uni-uploader-body {
634 | margin-top: 16upx;
635 | }
636 |
637 | .uni-uploader__files {
638 | display: flex;
639 | flex-direction: row;
640 | flex-wrap: wrap;
641 | }
642 |
643 | .uni-uploader__file {
644 | float: left;
645 | margin-right: 18upx;
646 | margin-bottom: 18upx;
647 | }
648 |
649 | .uni-uploader__img {
650 | display: block;
651 | width: 158upx;
652 | height: 158upx;
653 | }
654 |
655 | .uni-uploader__input-box {
656 | float: left;
657 | position: relative;
658 | margin-right: 18upx;
659 | margin-bottom: 18upx;
660 | width: 154upx;
661 | height: 154upx;
662 | border: 2upx solid #D9D9D9;
663 | }
664 |
665 | .uni-uploader__input-box:before,
666 | .uni-uploader__input-box:after {
667 | content: " ";
668 | position: absolute;
669 | top: 50%;
670 | left: 50%;
671 | -webkit-transform: translate(-50%, -50%);
672 | transform: translate(-50%, -50%);
673 | background-color: #D9D9D9;
674 | }
675 |
676 | .uni-uploader__input-box:before {
677 | width: 4upx;
678 | height: 79upx;
679 | }
680 |
681 | .uni-uploader__input-box:after {
682 | width: 79upx;
683 | height: 4upx;
684 | }
685 |
686 | .uni-uploader__input-box:active {
687 | border-color: #999999;
688 | }
689 |
690 | .uni-uploader__input-box:active:before,
691 | .uni-uploader__input-box:active:after {
692 | background-color: #999999;
693 | }
694 |
695 | .uni-uploader__input {
696 | position: absolute;
697 | z-index: 1;
698 | top: 0;
699 | left: 0;
700 | width: 100%;
701 | height: 100%;
702 | opacity: 0;
703 | }
704 |
705 |
706 |
707 |
708 |
709 | /*问题反馈*/
710 |
711 | .feedback-title {
712 | display: flex;
713 | flex-direction: row;
714 | justify-content: space-between;
715 | align-items: center;
716 | padding: 20upx;
717 | color: #8f8f94;
718 | font-size: 28upx;
719 | }
720 |
721 | .feedback-star-view.feedback-title {
722 | justify-content: flex-start;
723 | margin: 0;
724 | }
725 |
726 | .feedback-quick {
727 | position: relative;
728 | padding-right: 40upx;
729 | }
730 |
731 | .feedback-quick:after {
732 | font-family: uniicons;
733 | font-size: 40upx;
734 | content: '\e581';
735 | position: absolute;
736 | right: 0;
737 | top: 50%;
738 | color: #bbb;
739 | -webkit-transform: translateY(-50%);
740 | transform: translateY(-50%);
741 | }
742 |
743 | .feedback-body {
744 | background: #fff;
745 | }
746 |
747 | .feedback-textare {
748 | height: 200upx;
749 | font-size: 34upx;
750 | line-height: 50upx;
751 | width: 100%;
752 | box-sizing: border-box;
753 | padding: 20upx 30upx 0;
754 | }
755 |
756 | .feedback-input {
757 | font-size: 34upx;
758 | height: 50upx;
759 | min-height: 50upx;
760 | padding: 15upx 20upx;
761 | line-height: 50upx;
762 | }
763 |
764 | .feedback-uploader {
765 | padding: 22upx 20upx;
766 | }
767 |
768 | .feedback-star {
769 | font-family: uniicons;
770 | font-size: 40upx;
771 | margin-left: 6upx;
772 | }
773 |
774 | .feedback-star-view {
775 | margin-left: 20upx;
776 | }
777 |
778 | .feedback-star:after {
779 | content: '\e408';
780 | }
781 |
782 | .feedback-star.active {
783 | color: #FFB400;
784 | }
785 |
786 | .feedback-star.active:after {
787 | content: '\e438';
788 | }
789 |
790 | .feedback-submit {
791 | background: #007AFF;
792 | color: #FFFFFF;
793 | margin: 20upx;
794 | }
795 |
--------------------------------------------------------------------------------
/common/util.js:
--------------------------------------------------------------------------------
1 | function formatTime(time) {
2 | if (typeof time !== 'number' || time < 0) {
3 | return time
4 | }
5 |
6 | var hour = parseInt(time / 3600)
7 | time = time % 3600
8 | var minute = parseInt(time / 60)
9 | time = time % 60
10 | var second = time
11 |
12 | return ([hour, minute, second]).map(function (n) {
13 | n = n.toString()
14 | return n[1] ? n : '0' + n
15 | }).join(':')
16 | }
17 |
18 | function formatLocation(longitude, latitude) {
19 | if (typeof longitude === 'string' && typeof latitude === 'string') {
20 | longitude = parseFloat(longitude)
21 | latitude = parseFloat(latitude)
22 | }
23 |
24 | longitude = longitude.toFixed(2)
25 | latitude = latitude.toFixed(2)
26 |
27 | return {
28 | longitude: longitude.toString().split('.'),
29 | latitude: latitude.toString().split('.')
30 | }
31 | }
32 | var dateUtils = {
33 | UNITS: {
34 | '年': 31557600000,
35 | '月': 2629800000,
36 | '天': 86400000,
37 | '小时': 3600000,
38 | '分钟': 60000,
39 | '秒': 1000
40 | },
41 | humanize: function (milliseconds) {
42 | var humanize = '';
43 | for (var key in this.UNITS) {
44 | if (milliseconds >= this.UNITS[key]) {
45 | humanize = Math.floor(milliseconds / this.UNITS[key]) + key + '前';
46 | break;
47 | }
48 | }
49 | return humanize || '刚刚';
50 | },
51 | format: function (dateStr) {
52 | var date = this.parse(dateStr)
53 | var diff = Date.now() - date.getTime();
54 | if (diff < this.UNITS['天']) {
55 | return this.humanize(diff);
56 | }
57 | var _format = function (number) {
58 | return (number < 10 ? ('0' + number) : number);
59 | };
60 | return date.getFullYear() + '/' + _format(date.getMonth() + 1) + '/' + _format(date.getDay()) + '-' +
61 | _format(date.getHours()) + ':' + _format(date.getMinutes());
62 | },
63 | parse: function (str) { //将"yyyy-mm-dd HH:MM:ss"格式的字符串,转化为一个Date对象
64 | var a = str.split(/[^0-9]/);
65 | return new Date(a[0], a[1] - 1, a[2], a[3], a[4], a[5]);
66 | }
67 | };
68 |
69 | module.exports = {
70 | formatTime: formatTime,
71 | formatLocation: formatLocation,
72 | dateUtils: dateUtils
73 | }
74 |
--------------------------------------------------------------------------------
/components/qrcode/qrcode.js:
--------------------------------------------------------------------------------
1 | function qrPolynomial(r,t){if("undefined"==typeof r.length)throw new Error(r.length+"/"+t);var e=function(){for(var e=0;e=7&&w(r),null==f&&(f=p(o,a,c)),M(f,t)},h=function(r,t){for(var e=-1;e<=7;e+=1)if(!(r+e<=-1||u<=r+e))for(var n=-1;n<=7;n+=1)t+n<=-1||u<=t+n||(0<=e&&e<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==e||6==e)||2<=e&&e<=4&&2<=n&&n<=4?i[r+e][t+n]=!0:i[r+e][t+n]=!1)},v=function(){for(var r=0,t=0,e=0;e<8;e+=1){l(!0,e);var n=QRUtil.getLostPoint(g);(0==e||r>n)&&(r=n,t=e)}return t},s=function(){for(var r=8;r>e&1);i[Math.floor(e/3)][e%3+u-8-3]=n}for(var e=0;e<18;e+=1){var n=!r&&1==(t>>e&1);i[e%3+u-8-3][Math.floor(e/3)]=n}},y=function(r,t){for(var e=a<<3|t,n=QRUtil.getBCHTypeInfo(e),o=0;o<15;o+=1){var f=!r&&1==(n>>o&1);o<6?i[o][8]=f:o<8?i[o+1][8]=f:i[u-15+o][8]=f}for(var o=0;o<15;o+=1){var f=!r&&1==(n>>o&1);o<8?i[8][u-o-1]=f:o<9?i[8][15-o-1+1]=f:i[8][15-o-1]=f}i[u-8][8]=!r},M=function(r,t){for(var e=-1,n=u-1,o=7,a=0,f=QRUtil.getMaskFunction(t),c=u-1;c>0;c-=2)for(6==c&&(c-=1);;){for(var g=0;g<2;g+=1)if(null==i[n][c-g]){var l=!1;a>>o&1));var h=f(n,c-g);h&&(l=!l),i[n][c-g]=l,o-=1,o==-1&&(a+=1,o=7)}if(n+=e,n<0||u<=n){n-=e,e=-e;break}}},B=function(r,t){for(var e=0,n=0,o=0,a=new Array(t.length),i=new Array(t.length),u=0;u=0?v.getAt(s):0}}for(var d=0,g=0;g8*c)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+8*c+")");for(i.getLengthInBits()+4<=8*c&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;;){if(i.getLengthInBits()>=8*c)break;if(i.put(e,8),i.getLengthInBits()>=8*c)break;i.put(n,8)}return B(i,a)};return g.addData=function(r){var t=qr8BitByte(r);c.push(t),f=null},g.isDark=function(r,t){if(r<0||u<=r||t<0||u<=t)throw new Error(r+","+t);return i[r][t]},g.getModuleCount=function(){return u},g.make=function(){l(!1,v())},g.createTableTag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e="";e+='',e+="";for(var n=0;n";for(var o=0;o';e+=""}return e+="",e+="
"},g.createImgTag=function(r,t,e){r=r||2,t="undefined"==typeof t?4*r:t;var n=t,o=g.getModuleCount()*r+t;return createImgTag(e,e,function(t,e){if(n<=t&&t>>8),t.push(255&i)):t.push(n)}}return t}};var QRMode={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},QRErrorCorrectLevel={L:1,M:0,Q:3,H:2},QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},QRUtil=function(){var r=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,e=7973,n=21522,o={},a=function(r){for(var t=0;0!=r;)t+=1,r>>>=1;return t};return o.getBCHTypeInfo=function(r){for(var e=r<<10;a(e)-a(t)>=0;)e^=t<=0;)t^=e<5&&(e+=3+a-5)}for(var n=0;n=256;)t-=255;return r[t]},n}(),QRRSBlock=function(){var r=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(r,t){var e={};return e.totalCount=r,e.dataCount=t,e},e={},n=function(t,e){switch(e){case QRErrorCorrectLevel.L:return r[4*(t-1)+0];case QRErrorCorrectLevel.M:return r[4*(t-1)+1];case QRErrorCorrectLevel.Q:return r[4*(t-1)+2];case QRErrorCorrectLevel.H:return r[4*(t-1)+3];default:return}};return e.getRSBlocks=function(r,e){var o=n(r,e);if("undefined"==typeof o)throw new Error("bad rs block [url=home.php?mod=space&uid=5302]@[/url] typeNumber:"+r+"/errorCorrectLevel:"+e);for(var a=o.length/3,i=new Array,u=0;u>>7-t%8&1)},e.put=function(r,t){for(var n=0;n>>t-n-1&1))},e.getLengthInBits=function(){return t},e.putBit=function(e){var n=Math.floor(t/8);r.length<=n&&r.push(0),e&&(r[n]|=128>>>t%8),t+=1},e},qr8BitByte=function(r){for(var t=QRMode.MODE_8BIT_BYTE,e=r,n=[],o={},a=0,i=e.length;a65536?(u[0]=240|(1835008&f)>>>18,u[1]=128|(258048&f)>>>12,u[2]=128|(4032&f)>>>6,u[3]=128|63&f):f>2048?(u[0]=224|(61440&f)>>>12,u[1]=128|(4032&f)>>>6,u[2]=128|63&f):f>128?(u[0]=192|(1984&f)>>>6,u[1]=128|63&f):u[0]=f,n.push(u)}n=Array.prototype.concat.apply([],n),n.length!=e.length&&(n.unshift(191),n.unshift(187),n.unshift(239));var c=n;return o.getMode=function(){return t},o.getLength=function(r){return c.length},o.write=function(r){for(var t=0;t>>8)},t.writeBytes=function(r,e,n){e=e||0,n=n||r.length;for(var o=0;o0&&(t+=","),t+=r[e];return t+="]"},t},base64EncodeOutputStream=function(){var r=0,t=0,e=0,n="",o={},a=function(r){n+=String.fromCharCode(i(63&r))},i=function(r){if(r<0);else{if(r<26)return 65+r;if(r<52)return 97+(r-26);if(r<62)return 48+(r-52);if(62==r)return 43;if(63==r)return 47}throw new Error("n:"+r)};return o.writeByte=function(n){for(r=r<<8|255&n,t+=8,e+=1;t>=6;)a(r>>>t-6),t-=6},o.flush=function(){if(t>0&&(a(r<<6-t),r=0,t=0),e%3!=0)for(var o=3-e%3,i=0;i=t.length){if(0==o)return-1;throw new Error("unexpected end of file./"+o)}var r=t.charAt(e);if(e+=1,"="==r)return o=0,-1;r.match(/^\s$/)||(n=n<<6|i(r.charCodeAt(0)),o+=6)}var a=n>>>o-8&255;return o-=8,a};var i=function(r){if(65<=r&&r<=90)return r-65;if(97<=r&&r<=122)return r-97+26;if(48<=r&&r<=57)return r-48+52;if(43==r)return 62;if(47==r)return 63;throw new Error("c:"+r)};return a},gifImage=function(r,t){var e=r,n=t,o=new Array(r*t),a={};a.setPixel=function(r,t,n){o[t*e+r]=n},a.write=function(r){r.writeString("GIF87a"),r.writeShort(e),r.writeShort(n),r.writeByte(128),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(255),r.writeByte(255),r.writeByte(255),r.writeString(","),r.writeShort(0),r.writeShort(0),r.writeShort(e),r.writeShort(n),r.writeByte(0);var t=2,o=u(t);r.writeByte(t);for(var a=0;o.length-a>255;)r.writeByte(255),r.writeBytes(o,a,255),a+=255;r.writeByte(o.length-a),r.writeBytes(o,a,o.length-a),r.writeByte(0),r.writeString(";")};var i=function(r){var t=r,e=0,n=0,o={};return o.write=function(r,o){if(r>>>o!=0)throw new Error("length over");for(;e+o>=8;)t.writeByte(255&(r<>>=8-e,n=0,e=0;n|=r<0&&t.writeByte(n)},o},u=function(r){for(var t=1<=40)throw new Error("Text too long to encode");return gen(r,{size:a,errorCorrectLevel:o,typeNumber:n+1})}var i=parseInt(a/e.getModuleCount()),u=parseInt((a-e.getModuleCount()*i)/2);return e.createImgTag(i,u,a)};module.exports={createQrCodeImg:createQrCodeImg};
--------------------------------------------------------------------------------
/components/qrcode/qrcode.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
30 |
31 |
34 |
--------------------------------------------------------------------------------
/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App'
3 |
4 | import store from './store'
5 |
6 | Vue.config.productionTip = false;
7 |
8 | Vue.prototype.$store = store
9 |
10 | App.mpType = 'app'
11 |
12 | const app = new Vue({
13 | ...App,
14 | store
15 | })
16 | app.$mount()
17 |
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "uni-shop",
3 | "appid" : "__UNI__484A718",
4 | "description": "",
5 | "versionName": "1.0.0",
6 | "versionCode": "100",
7 | "transformPx":false,
8 | "app-plus": { /* 5+App特有相关 */
9 | "modules": { /* 模块配置 */
10 |
11 | },
12 | "distribute": { /* 应用发布信息 */
13 | "android": { /* android打包配置 */
14 | "permissions": ["",
15 | "",
16 | "",
17 | "",
18 | "",
19 | "",
20 | "",
21 | "",
22 | "",
23 | "",
24 | "",
25 | "",
26 | "",
27 | "",
28 | "",
29 | "",
30 | "",
31 | "",
32 | "",
33 | "",
34 | "",
35 | ""
36 | ]
37 | },
38 | "ios": { /* ios打包配置 */
39 |
40 | },
41 | "sdkConfigs": { /* SDK配置 */
42 |
43 | }
44 | }
45 | },
46 | "quickapp": { /* 快应用特有相关 */
47 |
48 | },
49 | "mp-weixin": { /* 小程序特有相关 */
50 | "appid": "",
51 | "setting" : {
52 | "urlCheck" : true
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/pages.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages" : [
3 | //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
4 | {
5 | "path" : "pages/index/index",
6 | "style" : {
7 | "navigationBarTitleText" : " ",
8 | "app-plus" : {
9 | "titleNView" : {
10 | "type" : "transparent"
11 | }
12 | }
13 | }
14 | },
15 | {
16 | "path" : "pages/tabBar/news/news",
17 | "style" : {
18 | "navigationBarTitleText" : "微商",
19 | "enablePullDownRefresh" : true,
20 | "onReachBottomDistance" : 50
21 | }
22 | },
23 | {
24 | "path" : "pages/tabBar/contact/contact",
25 | "style" : {
26 | "navigationBarTitleText" : "联系"
27 | }
28 | },
29 | {
30 | "path" : "pages/tabBar/mine/mine",
31 | "style" : {
32 | "navigationBarTitleText" : "我"
33 | }
34 | },
35 | {
36 | "path" : "pages/denglu/login/login",
37 | "style" : {
38 | "navigationBarTitleText" : "登录"
39 | }
40 | },
41 | {
42 | "path" : "pages/denglu/register/register",
43 | "style" : {
44 | "navigationBarTitleText" : "注册"
45 | }
46 | },
47 | {
48 | "path" : "pages/denglu/password/password",
49 | "style" : {
50 | "navigationBarTitleText" : "忘记密码"
51 | }
52 | },
53 | {
54 | "path" : "pages/denglu/logout/logout",
55 | "style" : {
56 | "navigationBarTitleText" : "退出"
57 | }
58 | },
59 | {
60 | "path" : "pages/mine/info/info",
61 | "style" : {
62 | "navigationBarTitleText" : "个人信息"
63 | }
64 | },
65 | {
66 | "path" : "pages/mine/qrcode/qrcode",
67 | "style" : {
68 | "navigationBarTitleText" : "我的二维码"
69 | }
70 | },
71 | {
72 | "path" : "pages/mine/logo/logo",
73 | "style" : {
74 | "navigationBarTitleText" : "个人头像"
75 | }
76 | },
77 | {
78 | "path" : "pages/mine/scan/scan",
79 | "style" : {}
80 | }
81 | ],
82 | "globalStyle" : {
83 | "navigationBarTextStyle" : "black",
84 | "navigationBarTitleText" : "微商",
85 | "navigationBarBackgroundColor" : "#F8F8F8",
86 | "backgroundColor" : "#F8F8F8"
87 | },
88 | "tabBar" : {
89 | "color" : "#929292",
90 | "selectedColor" : "#1afa29",
91 | "borderStyle" : "black",
92 | "backgroundColor" : "#ffffff",
93 | "list" : [
94 | {
95 | "pagePath" : "pages/tabBar/news/news",
96 | "iconPath" : "static/news.png",
97 | "selectedIconPath" : "static/newsHL.png",
98 | "text" : "消息"
99 | },
100 | {
101 | "pagePath" : "pages/tabBar/contact/contact",
102 | "iconPath" : "static/contact.png",
103 | "selectedIconPath" : "static/contactHL.png",
104 | "text" : "联系"
105 | },
106 | {
107 | "pagePath" : "pages/tabBar/mine/mine",
108 | "iconPath" : "static/mine.png",
109 | "selectedIconPath" : "static/mineHL.png",
110 | "text" : "我的"
111 | }
112 | ]
113 | },
114 | "condition" : {
115 | //模式配置,仅开发期间生效
116 | "current" : 0, //当前激活的模式(list 的索引项)
117 | "list" : [
118 | {
119 | "name" : "mine",
120 | "path" : "pages/index/index",
121 | "query" : ""
122 | }
123 | ]
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/pages/denglu/login/login.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 账号
6 |
7 |
8 |
9 | 密码
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 注册账号
18 | |
19 | 忘记密码
20 |
21 |
22 |
23 |
24 |
68 |
69 |
76 |
--------------------------------------------------------------------------------
/pages/denglu/logout/logout.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
25 |
26 |
37 |
--------------------------------------------------------------------------------
/pages/denglu/password/password.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 找回密码
4 |
5 |
6 |
7 |
16 |
17 |
20 |
--------------------------------------------------------------------------------
/pages/denglu/register/register.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 账
7 | 号
8 |
9 |
10 |
11 |
12 |
13 | 密
14 | 码
15 |
16 |
17 |
18 |
19 | 确认密码
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
51 |
52 |
64 |
--------------------------------------------------------------------------------
/pages/index/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 跳过
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
46 |
47 |
72 |
--------------------------------------------------------------------------------
/pages/mine/info/info.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 头像
9 |
10 |
11 |
12 |
13 |
14 | 昵称
15 | {{userName}}
16 |
17 |
18 |
19 |
20 | 微商号
21 | 12343212345
22 |
23 |
24 |
25 |
26 | 我的二维码
27 |
28 |
29 |
30 |
31 |
32 |
33 |
56 |
57 |
79 |
--------------------------------------------------------------------------------
/pages/mine/logo/logo.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
57 |
58 |
70 |
--------------------------------------------------------------------------------
/pages/mine/qrcode/qrcode.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
26 |
27 |
39 |
--------------------------------------------------------------------------------
/pages/mine/scan/scan.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
16 |
17 |
20 |
--------------------------------------------------------------------------------
/pages/tabBar/contact/contact.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 新朋友
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 群聊
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | {{list.letter}}
26 |
27 |
28 |
29 |
30 |
31 | {{item.name}}
32 | {{item.title}}
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | {{list.letter}}
42 |
43 |
44 | {{lists[touchmoveIndex].letter}}
45 |
46 |
47 |
48 |
49 |
103 |
104 |
170 |
--------------------------------------------------------------------------------
/pages/tabBar/mine/mine.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{userName}}
9 | 微商号:12343212345
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 扫一扫
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | 设置
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
73 |
74 |
116 |
--------------------------------------------------------------------------------
/pages/tabBar/news/news.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{item.title}}
9 | {{item.content}}
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
62 |
63 |
83 |
--------------------------------------------------------------------------------
/static/44.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siberiawolf/uni-shop/344c2da265336d531ec34b30a9e884094ea30fcb/static/44.jpg
--------------------------------------------------------------------------------
/static/contact.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siberiawolf/uni-shop/344c2da265336d531ec34b30a9e884094ea30fcb/static/contact.png
--------------------------------------------------------------------------------
/static/contactHL.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siberiawolf/uni-shop/344c2da265336d531ec34b30a9e884094ea30fcb/static/contactHL.png
--------------------------------------------------------------------------------
/static/index_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siberiawolf/uni-shop/344c2da265336d531ec34b30a9e884094ea30fcb/static/index_1.jpg
--------------------------------------------------------------------------------
/static/index_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siberiawolf/uni-shop/344c2da265336d531ec34b30a9e884094ea30fcb/static/index_2.jpg
--------------------------------------------------------------------------------
/static/index_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siberiawolf/uni-shop/344c2da265336d531ec34b30a9e884094ea30fcb/static/index_3.jpg
--------------------------------------------------------------------------------
/static/mine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siberiawolf/uni-shop/344c2da265336d531ec34b30a9e884094ea30fcb/static/mine.png
--------------------------------------------------------------------------------
/static/mineHL.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siberiawolf/uni-shop/344c2da265336d531ec34b30a9e884094ea30fcb/static/mineHL.png
--------------------------------------------------------------------------------
/static/news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siberiawolf/uni-shop/344c2da265336d531ec34b30a9e884094ea30fcb/static/news.png
--------------------------------------------------------------------------------
/static/newsHL.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siberiawolf/uni-shop/344c2da265336d531ec34b30a9e884094ea30fcb/static/newsHL.png
--------------------------------------------------------------------------------
/static/qunliao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siberiawolf/uni-shop/344c2da265336d531ec34b30a9e884094ea30fcb/static/qunliao.png
--------------------------------------------------------------------------------
/static/saoyisao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siberiawolf/uni-shop/344c2da265336d531ec34b30a9e884094ea30fcb/static/saoyisao.png
--------------------------------------------------------------------------------
/static/shezhi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siberiawolf/uni-shop/344c2da265336d531ec34b30a9e884094ea30fcb/static/shezhi.png
--------------------------------------------------------------------------------
/static/xinpy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siberiawolf/uni-shop/344c2da265336d531ec34b30a9e884094ea30fcb/static/xinpy.png
--------------------------------------------------------------------------------
/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Vuex from 'vuex';
3 |
4 | Vue.use(Vuex);
5 |
6 | let userState = {
7 | userName: '',
8 | hasLogin: false, // 是否登录
9 | hasSkip: false // 是否跳过启动页
10 | };
11 |
12 | const userInfo = uni.getStorageSync('userInfo');
13 | if(userInfo.hasLogin){
14 | userState = userInfo;
15 | }
16 | if(userInfo.hasSkip){ // 用户已经跳过启动页,但是没有登录
17 | userState.hasSkip = true;
18 | }
19 | const store = new Vuex.Store({
20 | state: {...userState},
21 | mutations: {
22 | login(state, user) { // 用户登录
23 | state.userName = user.userName;
24 | state.hasLogin = true;
25 | state.userImg = user.userImg;
26 |
27 | uni.setStorageSync('userInfo', {...state});
28 | },
29 | logout(state) { // 用户退出
30 | state.userName = "";
31 | state.hasLogin = false;
32 | // todo: 当用户退出时,启动页可以不再显示
33 | uni.clearStorageSync();
34 | },
35 | changeLogo(state, img){ // 用户修改图片
36 | state.userImg = img;
37 |
38 | uni.setStorageSync('userInfo', {...state});
39 | },
40 | skipIndex(state){ // 用户跳过首页
41 | state.hasSkip = true;
42 |
43 | uni.setStorageSync('userInfo', {...state});
44 | }
45 | }
46 | });
47 |
48 | export default store
49 |
--------------------------------------------------------------------------------