@xtdev/xt-miniprogram-ui 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -18,21 +18,33 @@ yarn安装:
18
18
  yarn add @xtdev/xt-miniprogram-ui
19
19
  ```
20
20
 
21
+ ## 构建
22
+ 在微信开发者工具中找到 <b>工具</b>=><b>构建npm</b>
23
+ 执行编译生成小程序专有包
24
+
25
+
21
26
  ## 使用
22
27
 
23
28
  import组件:
29
+ 以xt-icon和xt-search为例,在app.json或页面配置json中引入
24
30
 
25
31
  ```
26
- import { button } from "ui-lib";
32
+ {
33
+ "usingComponents": {
34
+ "xt-icon": "@xtdev/xt-miniprogram-ui/xt-icon",
35
+ "xt-search": "@xtdev/xt-miniprogram-ui/xt-search",
36
+ }
37
+ }
27
38
  ```
28
39
 
29
40
  使用组件:
30
41
 
31
42
  ```
32
- <button>按钮</button>
43
+ <xt-icon icon="zhankai" size="30" />
44
+ <xt-search placeholder="请输入搜索网点" bind:onSearch="handSearchSubmit"></xt-search>
33
45
  ```
34
46
 
35
- ## API 文档
47
+ <!-- ## API 文档
36
48
 
37
49
  ### Button 按钮
38
50
 
@@ -51,4 +63,6 @@ import { button } from "ui-lib";
51
63
  | size | string | | 尺寸 |
52
64
  | prefix | node | | 前缀图标节点 |
53
65
  | suffix | node | | 后缀图标节点 |
54
- | onChange| (event) => {} | | 输入框值改变时的回调函数 |
66
+ | onChange| (event) => {} | | 输入框值改变时的回调函数 | -->
67
+
68
+ # 开发
package/bin/index.js ADDED
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env node
2
+
3
+ const program = require('commander');
4
+ const path = require('path');
5
+ const chalk = require('chalk');
6
+ const mkdirp = require('mkdirp');
7
+ const { readFileSync, existsSync, readdirSync, statSync, createReadStream, createWriteStream, writeFileSync } = require('fs');
8
+ chalk.enabled = true
9
+ /**
10
+ * 拷贝文件夹下的文件到指定位置
11
+ * @param {*} sourceDir
12
+ * @param {*} destDir
13
+ */
14
+ function copyFiles(sourceDir, destDir) {
15
+ // 确保目标文件夹存在,如果不存在则创建它
16
+ mkdirp.sync(destDir);
17
+ const filenames = readdirSync(sourceDir);
18
+ filenames.forEach(function (filename) {
19
+ const sourceFile = path.join(sourceDir, filename);
20
+ const destFile = path.join(destDir, filename);
21
+ const stat = statSync(sourceFile);
22
+ if (stat.isDirectory()) {
23
+ // 如果当前文件是一个文件夹,则递归拷贝该文件夹下所有文件
24
+ copyFiles(sourceFile, destFile);
25
+ } else {
26
+ // 如果当前文件是一个普通文件,则复制文件到目标文件夹
27
+ const reader = createReadStream(sourceFile);
28
+ const writer = createWriteStream(destFile);
29
+ reader.pipe(writer);
30
+ }
31
+ });
32
+ }
33
+ // 新增创建
34
+ program.command('create <template-name>')
35
+ .description('根据模板名称,快速构建页面模板')
36
+ .action(async (templateName) => {
37
+ console.log('🎉 开始构建');
38
+ if (!templateName) {
39
+ console.error(chalk.red.dim('请填写模板名称'));
40
+ return;
41
+ }
42
+ // const tempFolder = `/template/${templateName}`;
43
+ const tempFolder = path.join(__dirname, '..', `./template/${templateName}`);
44
+ console.log(tempFolder);
45
+ const tempExist = existsSync(`${tempFolder}/index.js`);
46
+ if (!tempExist) {
47
+ console.error(chalk.red.dim('请填写正确的模板名称'));
48
+ return;
49
+ }
50
+ console.log('📋 开始拷贝');
51
+ copyFiles(tempFolder, process.cwd());
52
+ console.log('✅ 拷贝完成');
53
+ console.log('🔄 更改json引入路径');
54
+ const jsonPath = path.join(process.cwd(), './index.json');
55
+ // 延迟一秒读取文件
56
+ await new Promise(resolve => setTimeout(resolve, 1000))
57
+ const data = readFileSync(jsonPath);
58
+ const result = data.toString('utf-8').replace(/\.\.\/\.\./g, '@xtdev/xt-miniprogram-ui');
59
+ writeFileSync(jsonPath, result, 'utf-8');
60
+ console.log('🎉 创建完成');
61
+ });
62
+ program.parse(process.argv);
@@ -0,0 +1,41 @@
1
+ Component({
2
+ options: {
3
+ multipleSlots: true
4
+ },
5
+ properties: {
6
+ contentSlot: {
7
+ type: Boolean,
8
+ value: false
9
+ },
10
+ item: {
11
+ type: Object,
12
+ value: false
13
+ }
14
+ },
15
+
16
+ /**
17
+ * 组件的初始数据
18
+ */
19
+ data: {
20
+ },
21
+ attached: function () {
22
+ },
23
+
24
+ /**
25
+ * 组件的方法列表
26
+ */
27
+ methods: {
28
+ call(e) {
29
+ const tel = e.currentTarget.dataset.tel;
30
+ wx.makePhoneCall({
31
+ phoneNumber: tel, // 这里是电话号码[假的]可以调用自己的数据this.data.xxx
32
+ success: function () {
33
+ console.log('拨打电话成功!');
34
+ },
35
+ fail: function () {
36
+ console.log('拨打电话失败!');
37
+ }
38
+ });
39
+ }
40
+ }
41
+ });
@@ -0,0 +1,6 @@
1
+ {
2
+ "component": true,
3
+ "multipleSlots": true,
4
+ "usingComponents": {
5
+ }
6
+ }
@@ -0,0 +1,31 @@
1
+ <view class="list-item">
2
+ <!-- 列表标题 -->
3
+ <view class="head">
4
+ <!-- 标题 -->
5
+ <view class="flex-between ac">
6
+ <view class="ft20 c000 bold title-width">{{item.title}}</view>
7
+ <view class="sub-title" style="color: {{item.subTitleColor}};">{{item.subTitle}}</view>
8
+ </view>
9
+ <!-- 下单时间 -->
10
+ </view>
11
+ <!-- 列表中间 -->
12
+ <!-- 除非可申请宴席状态列表 -->
13
+ <slot wx:if="{{contentSlot}}" name="content"></slot>
14
+ <view wx:else class="card-cell-content">
15
+ <view class="flex-between center" wx:for="{{item.dataList}}" wx:for-item="_item" wx:key="index">
16
+ <view class="center-left">{{_item.label}}</view>
17
+ <view wx:if="{{_item.valueType === 'text' || !_item.valueType}}" class="center-right">{{_item.value}}</view>
18
+ <view bindtap="call" data-tel="{{_item.value}}" wx:elif="{{_item.valueType === 'tel'}}" class="center-right">
19
+ {{_item.value}}
20
+ <view class="call-box">
21
+ <image src="https://img.tanjiu.cn/home/4Cp4kKzMK77cNfhDhnFnTzBJKyNd6iEX.png"></image>
22
+ 拨打电话
23
+ </view>
24
+ </view>
25
+ </view>
26
+ </view>
27
+ <!-- 卡片底部 -->
28
+ <view class="card-cell-footer">
29
+ <slot name="card-footer"></slot>
30
+ </view>
31
+ </view>
@@ -0,0 +1,504 @@
1
+ /* page {
2
+ height: 100%;
3
+ } */
4
+ .c222 {
5
+ color: #222;
6
+ }
7
+
8
+ .c999 {
9
+ color: #999;
10
+ }
11
+
12
+ .red {
13
+ color: red;
14
+ }
15
+
16
+ .ft14 {
17
+ font-size: 28rpx;
18
+ line-height: 40rpx;
19
+ }
20
+
21
+ .ft20 {
22
+ font-size: 40rpx;
23
+ }
24
+
25
+ .ft17 {
26
+ font-size: 34rpx;
27
+ line-height: 48rpx;
28
+ }
29
+
30
+ .bold {
31
+ font-weight: 800;
32
+ }
33
+
34
+ .mt8 {
35
+ margin-top: 16rpx;
36
+ }
37
+
38
+ .ml12 {
39
+ margin-left: 24rpx;
40
+ }
41
+
42
+ .flex {
43
+ display: flex;
44
+ /* align-items: center; */
45
+ justify-content: space-between;
46
+ }
47
+
48
+ .flex1 {
49
+ flex: 1;
50
+ }
51
+
52
+ .flex-end {
53
+ display: flex;
54
+ justify-content: flex-end;
55
+ }
56
+
57
+ /* 顶部筛选 */
58
+ .top-content {
59
+ /* width: 750rpx; */
60
+ display: flex;
61
+ flex-wrap: wrap;
62
+ box-sizing: border-box;
63
+ padding: 24rpx 0 4rpx 24rpx;
64
+ background: white;
65
+ border-radius: 16rpx;
66
+ }
67
+
68
+ .top-item {
69
+ font-size: 28rpx;
70
+ line-height: 40rpx;
71
+ padding: 12rpx 20rpx;
72
+ background-color: #f6f6f6;
73
+ border-radius: 8rpx;
74
+ color: #000000;
75
+ margin-right: 20rpx;
76
+ margin-bottom: 20rpx;
77
+ }
78
+
79
+ .top-item-hover {
80
+ color: #6900a7;
81
+ background-color: #f5edff;
82
+ border: 2rpx solid #6900a7;
83
+ padding: 10rpx 18rpx;
84
+ font-weight: 600;
85
+ }
86
+
87
+ /* 搜索 */
88
+ .search-div {
89
+ margin: 24rpx auto;
90
+ width: 702rpx;
91
+ /* padding: 24rpx 24rpx; */
92
+ background-color: #f5f5f5;
93
+ }
94
+
95
+ .fix-top {
96
+ /* position: fixed;
97
+ top: 0;
98
+ left: 0; */
99
+ }
100
+
101
+ /* 列表 */
102
+ .invite-content {
103
+ width: 100%;
104
+ /* height: calc(100% - 300rpx); */
105
+ /* overflow-y: auto; */
106
+ /* margin-top: 24rpx; */
107
+ /* padding-top: calc(100% - 280rpx); */
108
+ }
109
+
110
+ /* 中间列表 */
111
+ .list-item {
112
+ /* padding: 0 24rpx 32rpx; */
113
+ padding: 0 32rpx 32rpx;
114
+ background-color: white;
115
+ border-radius: 16rpx;
116
+ margin: 0 auto 24rpx;
117
+ box-sizing: border-box;
118
+ }
119
+
120
+ .head {
121
+ padding: 32rpx 0;
122
+ width: 100%;
123
+ border-bottom: 2rpx solid #ededed;
124
+ margin-bottom: 32rpx;
125
+ word-break: break-all;
126
+ }
127
+
128
+ .head1 {
129
+ padding: 24rpx 0 0;
130
+ width: 100%;
131
+ border-top: 2rpx solid #ededed;
132
+ word-break: break-all;
133
+ margin-top: 24rpx;
134
+ color: #159c4e;
135
+ font-size: 24rpx;
136
+ }
137
+
138
+ .title-width {
139
+ max-width: 500rpx;
140
+ }
141
+
142
+ .appealcomplain {
143
+ position: relative;
144
+ height: 88rpx;
145
+ margin-top: 24rpx;
146
+ width: 100%;
147
+ border-top: 2rpx solid #eeeeee;
148
+ font-size: 28rpx;
149
+ line-height: 40rpx;
150
+ color: #999999;
151
+ }
152
+
153
+ .appealcomplain .grey {
154
+ position: absolute;
155
+ left: 0rpx;
156
+ top: 36rpx;
157
+ }
158
+
159
+ .appealcomplain .grey .van-count-down {
160
+ display: inline-block;
161
+ color: #f5222d;
162
+ }
163
+
164
+ .appealcomplain .btn {
165
+ position: absolute;
166
+ right: 0rpx;
167
+ top: 24rpx;
168
+ padding: 12rpx 32rpx;
169
+ background: #6900a7;
170
+ border-radius: 8rpx;
171
+ color: #fff;
172
+ }
173
+
174
+ .appealcomplain .btn-grey {
175
+ background: #dddddd;
176
+ }
177
+
178
+ .head-right {
179
+ font-size: 28rpx;
180
+ color: #cb7a00;
181
+ line-height: 45rpx;
182
+ width: 220rpx;
183
+ margin-left: 40rpx;
184
+ text-align: right;
185
+ }
186
+
187
+ .address {
188
+ margin-top: 12rpx;
189
+ color: #222222;
190
+ font-size: 24rpx;
191
+ line-height: 34rpx;
192
+ }
193
+
194
+ .change-btn {
195
+ height: 40rpx;
196
+ line-height: 40rpx;
197
+ font-size: 28rpx;
198
+ color: #222222;
199
+ padding: 0 12rpx;
200
+ border-radius: 8rpx;
201
+ border: 2rpx solid #999999;
202
+ margin-left: 16rpx;
203
+ display: flex;
204
+ align-items: center;
205
+ }
206
+
207
+ .phone-img {
208
+ width: 28rpx;
209
+ height: 28rpx;
210
+ margin-right: 8rpx;
211
+ }
212
+
213
+ .address-w {
214
+ /* max-width: 400rpx; */
215
+ line-height: 40rpx;
216
+ flex-wrap: wrap;
217
+ }
218
+
219
+ .flex-between {
220
+ display: flex;
221
+ justify-content: space-between;
222
+ }
223
+
224
+ .center {
225
+ margin-top: 16rpx;
226
+ font-size: 28rpx;
227
+ }
228
+
229
+ .center-left {
230
+ width: 188rpx;
231
+ margin-right: 20rpx;
232
+ color: #666666;
233
+ display: flex;
234
+ height: 48rpx;
235
+ font-size: 34rpx;
236
+ line-height: 48rpx;
237
+ white-space: nowrap;
238
+ }
239
+
240
+ .sub-title {
241
+ font-size: 34rpx;
242
+ font-family: PingFang SC-Semibold, PingFang SC;
243
+ font-weight: 600;
244
+ line-height: 48rpx;
245
+ }
246
+
247
+ .w90 {
248
+ width: 210rpx;
249
+ }
250
+
251
+ .center-left1 {
252
+ width: 196rpx;
253
+ }
254
+
255
+ .pop-detail-center {
256
+ height: calc(90vh - 100rpx);
257
+ overflow-y: auto;
258
+ padding-bottom: 60rpx;
259
+ box-sizing: border-box;
260
+ }
261
+
262
+ .has-appealcomplain {
263
+ height: calc(90vh - 236rpx);
264
+ }
265
+
266
+ .pop-detail .center-left {
267
+ height: auto;
268
+ }
269
+
270
+ .long-title {
271
+ width: 100%;
272
+ }
273
+
274
+ .pop-detail .center-left {
275
+ height: auto;
276
+ }
277
+
278
+ .center-right {
279
+ text-align: right;
280
+ color: #000000;
281
+ font-size: 34rpx;
282
+ line-height: 48rpx;
283
+ font-weight: 800;
284
+ display: flex;
285
+ align-items: center;
286
+ }
287
+
288
+ .call-box {
289
+ padding: 6rpx 12rpx;
290
+ font-size: 24rpx;
291
+ line-height: 34rpx;
292
+ font-size: 24rpx;
293
+ font-family: PingFang SC-Semibold, PingFang SC;
294
+ font-weight: 600;
295
+ color: #6722ab;
296
+ border-radius: 8rpx;
297
+ display: flex;
298
+ align-items: center;
299
+ background-color: rgba(103, 34, 171, 0.05);
300
+ margin-left: 14rpx;
301
+ }
302
+
303
+ .call-box image {
304
+ width: 24rpx;
305
+ height: 24rpx;
306
+ margin-right: 6rpx;
307
+ }
308
+
309
+ .look {
310
+ border-bottom: 2rpx solid #6900a7;
311
+ color: #6900a7;
312
+ }
313
+
314
+ .hover-btn {
315
+ border: none;
316
+ background-color: #6900a7;
317
+ color: white;
318
+ }
319
+
320
+ .wait {
321
+ color: #cb7a00;
322
+ }
323
+
324
+ .refuse {
325
+ color: #f5222d;
326
+ }
327
+
328
+ .c672 {
329
+ color: #6722ab;
330
+ }
331
+
332
+ .mt16 {
333
+ margin-top: 16rpx;
334
+ }
335
+
336
+ .pb16 {
337
+ padding-bottom: 32rpx;
338
+ }
339
+
340
+ .pb24 {
341
+ padding-bottom: 24rpx;
342
+ }
343
+
344
+ /* 日期选择 */
345
+ .datebew {
346
+ display: flex;
347
+ align-items: center;
348
+ justify-content: space-between;
349
+ padding: 0 24rpx;
350
+ box-sizing: border-box;
351
+ margin-bottom: 24rpx;
352
+ }
353
+
354
+ .datepg {
355
+ padding: 16rpx 24rpx;
356
+ background: #fff;
357
+ }
358
+
359
+ .dateflex {
360
+ display: flex;
361
+ align-items: center;
362
+ /* padding:16rpx 24rpx */
363
+ }
364
+
365
+ .datesel {
366
+ border-radius: 16rpx;
367
+ padding: 12rpx 16rpx;
368
+ width: 216rpx;
369
+ height: 64rpx;
370
+ box-sizing: border-box;
371
+ font-size: 28rpx;
372
+ display: flex;
373
+ justify-content: space-between;
374
+ align-items: center;
375
+ }
376
+
377
+ .dateF5 {
378
+ background: #f5f5f5;
379
+ }
380
+
381
+ .datebf {
382
+ background: #ffffff;
383
+ }
384
+
385
+ .todate {
386
+ margin: 0 16rpx;
387
+ color: #999999;
388
+ font-size: 28rpx;
389
+ }
390
+
391
+ .c999999 {
392
+ color: #999999;
393
+ }
394
+
395
+ .yanxi-title {
396
+ color: #222222;
397
+ font-size: 28rpx;
398
+ }
399
+
400
+ .yanxi-title view {
401
+ padding: 0 4rpx;
402
+ }
403
+
404
+ /* 宴席详情视频展示 */
405
+ .item-image {
406
+ width: 196rpx;
407
+ height: 196rpx;
408
+ border-radius: 8rpx;
409
+ margin-top: 16rpx;
410
+ margin-right: 32rpx;
411
+ position: relative;
412
+ }
413
+
414
+ .item-image image {
415
+ width: 200rpx;
416
+ height: 200rpx;
417
+ border-radius: 8rpx;
418
+ }
419
+
420
+ .item-image .play-icon {
421
+ width: 60rpx;
422
+ height: 60rpx;
423
+ position: absolute;
424
+ top: 68rpx;
425
+ left: 68rpx;
426
+ }
427
+
428
+ .item-image .delete-iamge-icon {
429
+ position: absolute;
430
+ top: 0;
431
+ right: 0;
432
+ z-index: 10;
433
+ width: 32rpx;
434
+ height: 32rpx;
435
+ }
436
+
437
+ .photo-btn {
438
+ display: flex;
439
+ align-items: center;
440
+ justify-content: center;
441
+ background: rgba(197, 197, 207, 0.4);
442
+ }
443
+
444
+ .notify {
445
+ width: 100%;
446
+ height: 66rpx;
447
+ background: #fff7e6;
448
+ color: #cb7a00;
449
+ font-size: 24rpx;
450
+ display: flex;
451
+ justify-content: space-between;
452
+ align-items: center;
453
+ padding: 0 24rpx;
454
+ box-sizing: border-box;
455
+ }
456
+
457
+ .photo-btn image {
458
+ width: 66rpx;
459
+ height: 60rpx;
460
+ }
461
+
462
+ .mt2 {
463
+ margin-top: 4rpx;
464
+ }
465
+
466
+ .change-cont {
467
+ display: flex;
468
+ align-items: center;
469
+ margin: 24rpx 0;
470
+ width: 100%;
471
+ padding: 24rpx;
472
+ background-color: rgba(242, 107, 39, 0.2);
473
+ color: #f26b27;
474
+ box-sizing: border-box;
475
+ font-size: 28rpx;
476
+ font-weight: 800;
477
+ border-radius: 16rpx;
478
+ }
479
+
480
+ .yanxi-change-btn {
481
+ color: white;
482
+ background-color: rgba(242, 107, 39, 1);
483
+ border-radius: 24rpx;
484
+ font-size: 24rpx;
485
+ height: 40rpx;
486
+ width: 80rpx;
487
+ display: flex;
488
+ align-items: center;
489
+ justify-content: center;
490
+ line-height: 34rpx;
491
+ margin-left: 16rpx;
492
+ }
493
+
494
+ .cff4 {
495
+ color: #ff4d4d;
496
+ }
497
+
498
+ .card-cell-content{
499
+ padding-bottom: 32rpx;
500
+ }
501
+ .card-cell-footer{
502
+ text-align: right;
503
+ border-top: 1rpx solid #ededed;
504
+ }
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "component": true,
3
- "styleIsolation": "apply-shared",
4
3
  "usingComponents": {
5
4
  "xt-icon": "../xt-icon"
6
5
  }
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@xtdev/xt-miniprogram-ui",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "",
5
+ "bin": {
6
+ "xt-page-cli": "bin/index.js"
7
+ },
5
8
  "miniprogram": "libs",
6
9
  "publishConfig": {
7
10
  "access": "public",
@@ -9,13 +12,16 @@
9
12
  },
10
13
  "files": [
11
14
  "libs",
15
+ "bin",
16
+ "template",
12
17
  "README.md"
13
18
  ],
14
19
  "scripts": {
15
20
  "test": "echo \"Error: no test specified\" && exit 1",
16
21
  "dev": "gulp",
17
22
  "build": "gulp build",
18
- "publish": "yarn version --patch && yarn build && npm publish --access public --registry=https://registry.npmjs.org"
23
+ "release": "yarn version --patch && yarn build && npm publish --access public --registry=https://registry.npmjs.org",
24
+ "cli:demo": "xt-page-cli create list"
19
25
  },
20
26
  "repository": {
21
27
  "type": "git",
@@ -24,12 +30,15 @@
24
30
  "author": "",
25
31
  "license": "ISC",
26
32
  "devDependencies": {
33
+ "chalk": "^4.0.0",
34
+ "commander": "^10.0.1",
27
35
  "del": "^3.0.0",
28
36
  "gulp": "^4.0.2",
29
37
  "gulp-changed": "^4.0.3",
30
38
  "gulp-clean": "^0.4.0",
31
39
  "gulp-json-transform": "^0.4.8",
32
- "gulp-rename": "^2.0.0"
40
+ "gulp-rename": "^2.0.0",
41
+ "mkdirp": "^3.0.1"
33
42
  },
34
43
  "dependencies": {}
35
44
  }
File without changes
@@ -0,0 +1,81 @@
1
+ // template/index.js
2
+ Page({
3
+
4
+ /**
5
+ * 页面的初始数据
6
+ */
7
+ data: {
8
+ page: {
9
+ isLoading: false,
10
+ size: 10,
11
+ over: false,
12
+ curPage: 0
13
+ },
14
+ list: []
15
+ },
16
+
17
+ /**
18
+ * 生命周期函数--监听页面加载
19
+ */
20
+ onLoad(options) {
21
+ this.getListData();
22
+ },
23
+ handleSearch(e) {
24
+ console.log(e.detail);
25
+ this.setData({
26
+ page: {
27
+ isLoading: false,
28
+ size: 10,
29
+ over: false,
30
+ curPage: 0
31
+ }
32
+ })
33
+ this.getListData(true);
34
+ },
35
+ async getListData(refresh = false) {
36
+ const { isLoading, curPage, size } = this.data.page;
37
+ if (isLoading) return;
38
+ wx.showLoading();
39
+ this.setData({
40
+ 'page.isLoading': true,
41
+ 'page.curPage': curPage + 1
42
+ })
43
+ // 模拟接口请求,开发请切换成真实数据
44
+ const data = await new Promise(resolve => {
45
+ setTimeout(() => {
46
+ const temp = new Array(size).fill(1).map(num => ({
47
+ title: '北京老布鞋烟酒店',
48
+ subTitle: '合作中',
49
+ subTitleColor: '#6722ab',
50
+ state: 20,
51
+ dataList: [{
52
+ label: '店老板名称',
53
+ valueType: 'text',
54
+ value: '张三',
55
+ }, {
56
+ label: '联系电话',
57
+ valueType: 'tel',
58
+ value: '18080166584',
59
+ }, {
60
+ label: '报销金',
61
+ valueType: 'text',
62
+ value: '3000元',
63
+ }]
64
+ }));
65
+ resolve(temp);
66
+ }, 2000);
67
+ })
68
+ const list = refresh ? data : this.data.list.concat(data);
69
+ this.setData({
70
+ list,
71
+ 'page.isLoading': false,
72
+ 'page.over': list.length > 10
73
+ })
74
+ wx.hideLoading();
75
+ },
76
+ onReachBottom() {
77
+ if (!this.data.page.over) {
78
+ this.getListData();
79
+ }
80
+ }
81
+ })
@@ -0,0 +1,6 @@
1
+ {
2
+ "usingComponents": {
3
+ "xt-card-cell": "../../libs/xt-card-cell",
4
+ "xt-search": "../../libs/xt-search"
5
+ }
6
+ }
@@ -0,0 +1,17 @@
1
+ <view class="search-content">
2
+ <xt-search bind:onSearch="handleSearch"></xt-search>
3
+ </view>
4
+ <view wx:for="{{list}}" wx:key="id">
5
+ <xt-card-cell item="{{item}}">
6
+ <view slot="card-footer">
7
+ <!-- 列表按钮 -->
8
+ <view class="footer">
9
+ <view class="default-btn">
10
+ 查看详情
11
+ </view>
12
+ </view>
13
+ </view>
14
+ </xt-card-cell>
15
+ </view>
16
+ <view wx:if="{{page.over}}" class="bottom-tips">没有更多数据</view>
17
+ <view wx:elif="{{page.isLoading && list.length}}" class="bottom-tips">加载中...</view>
@@ -0,0 +1,24 @@
1
+ page{
2
+ background-color: #f2f2f2;
3
+ padding: 24rpx;
4
+ box-sizing: border-box;
5
+ }
6
+ .search-content{
7
+ margin-bottom: 24rpx;
8
+ }
9
+ .default-btn {
10
+ display: inline-block;
11
+ color: #6722AB;
12
+ border: 2rpx solid #6722AB;
13
+ box-sizing: border-box;
14
+ border-radius: 120rpx;
15
+ margin-top: 32rpx;
16
+ font-size: 34rpx;
17
+ line-height: 48rpx;
18
+ font-weight: 800;
19
+ padding: 16rpx 32rpx;
20
+ }
21
+ .bottom-tips{
22
+ text-align: center;
23
+ padding: 20px;
24
+ }
@@ -1,24 +0,0 @@
1
- Component({
2
- /**
3
- * 组件的属性列表
4
- */
5
- properties: {
6
- icon: {
7
- type: String,
8
- },
9
- size: {
10
- type: Number,
11
- value: 28,
12
- },
13
- },
14
-
15
- /**
16
- * 组件的初始数据
17
- */
18
- data: {},
19
-
20
- /**
21
- * 组件的方法列表
22
- */
23
- methods: {},
24
- });
@@ -1,4 +0,0 @@
1
- {
2
- "component": true,
3
- "usingComponents": {}
4
- }
@@ -1,2 +0,0 @@
1
- <!--pages/components/xt-icon.wxml-->
2
- <text class="iconfont icon-{{icon}}" style="font-size: {{size}}rpx;"></text>
@@ -1,180 +0,0 @@
1
- @font-face {
2
- font-family: "iconfont"; /* Project id 4088939 */
3
- src: url("//at.alicdn.com/t/c/font_4088939_xa6wjfwsbpj.woff2?t=1685353003131")
4
- format("woff2"),
5
- url("//at.alicdn.com/t/c/font_4088939_xa6wjfwsbpj.woff?t=1685353003131")
6
- format("woff"),
7
- url("//at.alicdn.com/t/c/font_4088939_xa6wjfwsbpj.ttf?t=1685353003131")
8
- format("truetype");
9
- }
10
-
11
- .iconfont {
12
- font-family: "iconfont" !important;
13
- font-style: normal;
14
- -webkit-font-smoothing: antialiased;
15
- -moz-osx-font-smoothing: grayscale;
16
- }
17
-
18
- .icon-a-8:before {
19
- content: "\e61e";
20
- }
21
-
22
- .icon-a-9:before {
23
- content: "\e61f";
24
- }
25
-
26
- .icon-a-10:before {
27
- content: "\e620";
28
- }
29
-
30
- .icon-a-13:before {
31
- content: "\e621";
32
- }
33
-
34
- .icon-a-15:before {
35
- content: "\e622";
36
- }
37
-
38
- .icon-a-16:before {
39
- content: "\e623";
40
- }
41
-
42
- .icon-a-11:before {
43
- content: "\e624";
44
- }
45
-
46
- .icon-a-12:before {
47
- content: "\e625";
48
- }
49
-
50
- .icon-a-14:before {
51
- content: "\e626";
52
- }
53
-
54
- .icon-a-23:before {
55
- content: "\e627";
56
- }
57
-
58
- .icon-a-19:before {
59
- content: "\e628";
60
- }
61
-
62
- .icon-a-22:before {
63
- content: "\e629";
64
- }
65
-
66
- .icon-a-21:before {
67
- content: "\e62a";
68
- }
69
-
70
- .icon-a-20:before {
71
- content: "\e62b";
72
- }
73
-
74
- .icon-a-18:before {
75
- content: "\e62c";
76
- }
77
-
78
- .icon-a-17:before {
79
- content: "\e62d";
80
- }
81
-
82
- .icon-xingzhuangjiehe:before {
83
- content: "\e60e";
84
- }
85
-
86
- .icon-a-3:before {
87
- content: "\e60f";
88
- }
89
-
90
- .icon-a-4:before {
91
- content: "\e614";
92
- }
93
-
94
- .icon-a-2:before {
95
- content: "\e615";
96
- }
97
-
98
- .icon-a-5:before {
99
- content: "\e616";
100
- }
101
-
102
- .icon-a-6:before {
103
- content: "\e61c";
104
- }
105
-
106
- .icon-a-7:before {
107
- content: "\e61d";
108
- }
109
-
110
- .icon-jian-weixuanzhong:before {
111
- content: "\e682";
112
- }
113
-
114
- .icon-jia-xuanzhong:before {
115
- content: "\e683";
116
- }
117
-
118
- .icon-jian-xuanzhong:before {
119
- content: "\e684";
120
- }
121
-
122
- .icon-xiala:before {
123
- content: "\e685";
124
- }
125
-
126
- .icon-shangla:before {
127
- content: "\e686";
128
- }
129
-
130
- .icon-jinggao:before {
131
- content: "\e687";
132
- }
133
-
134
- .icon-weixuanzhong1:before {
135
- content: "\e688";
136
- }
137
-
138
- .icon-jinggao-hong:before {
139
- content: "\e60b";
140
- }
141
-
142
- .icon-daohang:before {
143
- content: "\e60d";
144
- }
145
-
146
- .icon-shouqi:before {
147
- content: "\e610";
148
- }
149
-
150
- .icon-shaixuan:before {
151
- content: "\e611";
152
- }
153
-
154
- .icon-shanchu:before {
155
- content: "\e612";
156
- }
157
-
158
- .icon-sousuo:before {
159
- content: "\e613";
160
- }
161
-
162
- .icon-zhengque:before {
163
- content: "\e617";
164
- }
165
-
166
- .icon-wenhao-xiao:before {
167
- content: "\e618";
168
- }
169
-
170
- .icon-youjiantou:before {
171
- content: "\e619";
172
- }
173
-
174
- .icon-wenhao:before {
175
- content: "\e61a";
176
- }
177
-
178
- .icon-zhankai:before {
179
- content: "\e61b";
180
- }