默认提交
Showing
44 changed files
with
1121 additions
and
231 deletions
... | @@ -93,17 +93,19 @@ button { | ... | @@ -93,17 +93,19 @@ button { |
93 | position: relative; | 93 | position: relative; |
94 | } | 94 | } |
95 | 95 | ||
96 | .drop-down-item :last-child { | ||
97 | border-bottom: none; | ||
98 | } | ||
99 | |||
100 | |||
96 | 101 | ||
97 | // web font icon | 102 | // web font icon |
98 | 103 | ||
99 | @font-face { | 104 | @font-face { |
100 | font-family: "iconfont"; | 105 | font-family: "iconfont"; |
101 | src: url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAABTsAAsAAAAALfQAABSdAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCKCAq/bLNyATYCJAOBeAt+AAQgBYRtB4ZEG7QmRaRfpFUaIio1vez/SwI3RBT3BbTdC5NUKjW7ckaPxDUVOdGU7/cN+9jU+ipCwU9itRo1oxaajOY9piXuDIBSLmQ/MnIyu53RK7e/TaIrEdoVttnzd+fxy4ZSQvyz1ubviTvqR8jEQOi0Tgzz1mTDPEiAAPkxh/y3HUvIIWyVrFU1urK2/jUEwLG8T6rqbTigFBrgCwyEKoZ/N/M9At3uPUpOklA5UaOdy5O2VI7SllPPJNk82RypnYOfuI+Em/mnf/nmNOdC5QYkS3Lm8Q/upPmljGWfrd+4DBewAlYAW8B6PM3Zz+4SGkISNKZogAataF4JwTyIBrkWbWkdaXcrpknFBDYtFSc9qF8uOaenyv/bAAEE2AfOORo3UWU+0o58gjFkwiZvyMF5IU8+iNhHQJzKWecBjL9IlHOlMSamOrns3VjwEpQU+386dUXcCxjaSm//GQvjcCdD7iQrwOegwo4DUlhJCRyXEKYAqWin5Ql469iR8e3ddh7Hutw/E53/Bwe+arbWMDZrgLE1DnONkipW3P33ZwRQNjUTuH3LLATB8LUA4vlrSg3IUxdnpEEanvI2DPMCFwl+26eBv+j38ZWHBEi4EPDdnxZTPTz8BOlJWqHUpg9d3xhw3oEMcAVZSGrUbRQQSsorIen4rbB/AIZS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QFG9VnMgMSU3Tfsk4bNWlB+ZCTrE3SdFcKEoO5HblinUig/q7bP+CJZna27/sbvOPvfd3xyqQBUL8/wbv+2J+fdOU5gGRw9SEAAEH9G7U+UYS/AmDsxKoIgLlNd6IBZ+kFkWclPTCilifTjrsB/R1YP5CNALDsbUItm+4myzN16+ZQOkMs5DGCzH9oeZHLUARmAuYVl+hwuzSxafosI8DBJBAXnb6dECHRwmvPonsldtyugwMGWlOL6TMkQhDtddZBDJex4bdBJOZTukpoPFwYmEW4HhTgnfj2Z3eRx+M4nOIksBeB4eAJIuJJ/wuPQeYJuKPoYsYILVO8KzL8l711RXz+83Z5HH8TXAMLf/8ZFCDmM/avKGqp2en+gy5shqbOyYjp3fknC6T1UgDc+RZAiwUkLxsoKLvpr60M/x/WBVSe9E6oFUxCiVi7suc51MkuoZ64D01O8jNnLcYpsxXg6HMTatR9hVpVP5Ronj+UgedvqNP1TzwCOw1N3gtwMNvW3BgNzZiWYr4TzUKNpVL4Jq79QtWqnxlotDr7IGMbNYrA9S/lOY1kdGjYdQXMpSiNGsRk0w31vRLaqJYW7NYo05nnldurcBdqOLrxzCAzjCwJc7tg+MaCMipXzG7env4LUlnpzZiMyR6H/0AMqzlwIeDyOVxzYeSarCktW2sVwFiJWMkcywbCBDLSH62KoOlttcgCc9USFi3jefZKXsEtXhym6iYACT71XSeKqumGaf1b8FHcKMf1fACEYATFcIKkaIblBEKRWCKVyRVKlVqj1ekNRpPZYrXZHU6X2+P1+eMXvbIUXHoqdU22PqvVQOe6n410uW3GPY3VOQ2ad9djIt9hsuNIl9gENgCAQIIQRCAGSXB6O2/g2zCAABFKGMIIxjCZuEgIECBAgAABAgQIECBChAgRIkSIECFChBJKKKGEEkoooYQSShj2KAy8J16Z8XJDxaKe8cWGwoQjAA==') format('woff2'), | 106 | src: url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAABaAAAsAAAAAMNgAABYvAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgC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UUMKySWVhAvEhzC8n+m9Nzc8nOnkXAAAA') format('woff2'), |
102 | } | 107 | } |
103 | 108 | ||
104 | .drop-down-item :last-child { | ||
105 | border-bottom: none; | ||
106 | } | ||
107 | 109 | ||
108 | .iconfont { | 110 | .iconfont { |
109 | font-family: "iconfont" !important; | 111 | font-family: "iconfont" !important; |
... | @@ -133,6 +135,14 @@ button { | ... | @@ -133,6 +135,14 @@ button { |
133 | content: "\e606"; | 135 | content: "\e606"; |
134 | } | 136 | } |
135 | 137 | ||
138 | .icondashang:before { | ||
139 | content: "\e699"; | ||
140 | } | ||
141 | |||
142 | .iconhongbao:before { | ||
143 | content: "\e68c"; | ||
144 | } | ||
145 | |||
136 | .iconempty:before { | 146 | .iconempty:before { |
137 | content: "\e6a6"; | 147 | content: "\e6a6"; |
138 | } | 148 | } | ... | ... |
... | @@ -16,6 +16,10 @@ Component({ | ... | @@ -16,6 +16,10 @@ Component({ |
16 | types: { | 16 | types: { |
17 | type: Array, | 17 | type: Array, |
18 | value: ["home", "return"] | 18 | value: ["home", "return"] |
19 | }, | ||
20 | pics: { | ||
21 | type: Array, | ||
22 | value: ["red-package"] | ||
19 | } | 23 | } |
20 | }, | 24 | }, |
21 | data: { | 25 | data: { |
... | @@ -44,6 +48,15 @@ Component({ | ... | @@ -44,6 +48,15 @@ Component({ |
44 | }) | 48 | }) |
45 | break; | 49 | break; |
46 | 50 | ||
51 | case "red-package": | ||
52 | wx.showModal({ | ||
53 | title: '温馨提示', | ||
54 | content: '打赏功能尚未开放,敬请期待!', | ||
55 | showCancel: false, | ||
56 | success(res) {} | ||
57 | }); | ||
58 | break; | ||
59 | |||
47 | default: | 60 | default: |
48 | break; | 61 | break; |
49 | } | 62 | } | ... | ... |
... | @@ -15,10 +15,18 @@ | ... | @@ -15,10 +15,18 @@ |
15 | display: flex; | 15 | display: flex; |
16 | justify-content: center; | 16 | justify-content: center; |
17 | align-items: center; | 17 | align-items: center; |
18 | background-color: rgba($color: #000000, $alpha: 0.6); | 18 | |
19 | } | 19 | } |
20 | 20 | ||
21 | .iconfont { | 21 | .iconfont { |
22 | font-size: 64px; | 22 | font-size: 64px; |
23 | } | 23 | } |
24 | |||
25 | .pics{ | ||
26 | height: $btnSize; | ||
27 | } | ||
28 | |||
29 | .point{ | ||
30 | background-color: rgba($color: #000000, $alpha: 0.6); | ||
31 | } | ||
24 | } | 32 | } | ... | ... |
1 | <view class="comp"> | 1 | <view class="comp"> |
2 | <view wx:for="{{types}}" wx:key="{{index}}" data-data="{{item}}" bindtap="onTapHandler" class="btn"> | 2 | <view wx:for="{{types}}" wx:key="{{index}}" data-data="{{item}}" bindtap="onTapHandler" class="btn point"> |
3 | <span class="iconfont {{typeIconMap[item+''] }}"></span> | 3 | <span class="iconfont {{typeIconMap[item+''] }}"></span> |
4 | </view> | 4 | </view> |
5 | <view wx:for="{{pics}}" wx:key="{{index}}" data-data="{{item}}" bindtap="onTapHandler" class="btn"> | ||
6 | <image mode="aspectFit" src="../../image/shortcut/red-package.png" class="pics" /> | ||
7 | </view> | ||
5 | </view> | 8 | </view> | ... | ... |
... | @@ -2,7 +2,7 @@ let ENV_CONFIG = require('./env/index'); | ... | @@ -2,7 +2,7 @@ let ENV_CONFIG = require('./env/index'); |
2 | 2 | ||
3 | const APPID = '' | 3 | const APPID = '' |
4 | /** ====每次发布版本记得修改此环境配置==== */ | 4 | /** ====每次发布版本记得修改此环境配置==== */ |
5 | const ENV = 'dev'; // Dev Prod | 5 | const ENV = 'Dev'; // Dev Prod |
6 | const NET_CONFIG = ENV_CONFIG[ENV]; | 6 | const NET_CONFIG = ENV_CONFIG[ENV]; |
7 | const MOCKAPI = ENV_CONFIG.mockApi; | 7 | const MOCKAPI = ENV_CONFIG.mockApi; |
8 | 8 | ... | ... |
1 | module.exports = { | 1 | module.exports = { |
2 | mockApi: 'http://mock.simonfungc.com', | 2 | mockApi: 'http://mock.simonfungc.com', |
3 | Dev: { | 3 | Dev: { |
4 | baseApi: 'https://ow.go.qudone.com/xxx', | 4 | baseApi: 'https://ow.go.qudone.com/kd_jyes_api/minipro', |
5 | commonApi: 'https://api.k.wxpai.cn/bizproxy' | 5 | commonApi: 'https://api.k.wxpai.cn/bizproxy' |
6 | }, | 6 | }, |
7 | Test: { | 7 | Test: { | ... | ... |
... | @@ -2,7 +2,14 @@ module.exports = { | ... | @@ -2,7 +2,14 @@ module.exports = { |
2 | login: "/login", // post 通过wxcode换取sessionId | 2 | login: "/login", // post 通过wxcode换取sessionId |
3 | register: '/register', // post 注册(用户授权) | 3 | register: '/register', // post 注册(用户授权) |
4 | 4 | ||
5 | dataList: '/dataList', // 测试接口 | 5 | // dataList: '/dataList', // 测试接口 |
6 | bannerList: '/banner/list', // 轮播图 | ||
7 | tabList: '/tab/list', // 获取标签 | ||
8 | videoList: '/video/list', // 视频列表 | ||
9 | videoAcccout: '/video/acccout', // 帐号下的视频 | ||
10 | videoDetail: '/video/detail', // 视频详情 | ||
11 | rewardDetail: '/hide/order', // 获得打赏视频 | ||
12 | videoMore: '/video/more', // 更多推荐 | ||
6 | 13 | ||
7 | /** | 14 | /** |
8 | * 通用接口 | 15 | * 通用接口 | ... | ... |
src/image/shortcut/red-package.png
0 → 100644
1.46 KB
... | @@ -5,40 +5,60 @@ import { | ... | @@ -5,40 +5,60 @@ import { |
5 | let app = getApp(); | 5 | let app = getApp(); |
6 | Page({ | 6 | Page({ |
7 | data: { | 7 | data: { |
8 | isOverShare: true, | ||
8 | authorizeVisible: false, | 9 | authorizeVisible: false, |
9 | total: 0, | 10 | total: 0, |
10 | page: 1, | 11 | page: 1, |
11 | size: 10, | 12 | size: 10, |
13 | dataList: [], | ||
12 | productList: [], // 产品列表 | 14 | productList: [], // 产品列表 |
13 | indexInfo: {}, | 15 | indexInfo: {}, |
14 | userInfo: {} | 16 | userInfo: {}, |
17 | options: {}, | ||
18 | detailData: {} | ||
19 | }, | ||
20 | onShareAppMessage() { | ||
21 | let detailData = this.data.detailData; | ||
22 | let title = detailData && detailData.videoName || ""; | ||
23 | let path = `pages/detail/detail?c=${detailData.videoCode}`; | ||
24 | let imageUrl = detailData && detailData.thumbnail || ""; | ||
25 | return { | ||
26 | title, | ||
27 | path, | ||
28 | imageUrl | ||
29 | } | ||
15 | }, | 30 | }, |
16 | onShareAppMessage() {}, | ||
17 | showAuth() { | 31 | showAuth() { |
18 | this.setData({ | 32 | this.setData({ |
19 | authorizeVisible: true | 33 | authorizeVisible: true |
20 | }) | 34 | }) |
21 | }, | 35 | }, |
22 | onLoad(options) {}, | 36 | onLoad(options) { |
37 | this.setData({ | ||
38 | options | ||
39 | }); | ||
40 | this.queryVideoDetail(); | ||
41 | this.initData(); | ||
42 | }, | ||
23 | 43 | ||
24 | /** | 44 | /** |
25 | * 基础方法 | 45 | * 基础方法 |
26 | * 授权完毕重拉数据用 | 46 | * 授权完毕重拉数据用 |
27 | */ | 47 | */ |
28 | initData() { | 48 | initData() { |
29 | 49 | this.queryVideoMore(); | |
30 | }, | 50 | }, |
51 | |||
31 | /** | 52 | /** |
32 | * 到达底部 | 53 | * 到达底部 |
33 | * 做加载更多操作 | 54 | * 做加载更多操作 |
34 | */ | 55 | */ |
35 | onReachBottom() { | 56 | onReachBottom() { |
36 | return; | ||
37 | if (this.data.dataList.length < this.data.total) { | 57 | if (this.data.dataList.length < this.data.total) { |
38 | this.setData({ | 58 | this.setData({ |
39 | page: this.data.page + 1 | 59 | page: this.data.page + 1 |
40 | }); | 60 | }); |
41 | // this.queryDataList(); | 61 | this.queryVideoMore(); |
42 | } | 62 | } |
43 | }, | 63 | }, |
44 | 64 | ||
... | @@ -50,25 +70,41 @@ Page({ | ... | @@ -50,25 +70,41 @@ Page({ |
50 | }) | 70 | }) |
51 | }, | 71 | }, |
52 | 72 | ||
53 | |||
54 | /** | 73 | /** |
55 | * 到个人列表页面 | 74 | * 到个人列表页面 |
56 | */ | 75 | */ |
57 | toPersonalList() { | 76 | toPersonalList() { |
77 | let detailData = this.data.detailData; | ||
78 | if (detailData && detailData.accountCode) { | ||
79 | detailData.c = detailData.accountCode; | ||
58 | app.router.push({ | 80 | app.router.push({ |
59 | path: "personalList", | 81 | path: "personalList", |
82 | query: detailData | ||
83 | }) | ||
84 | } | ||
85 | }, | ||
86 | |||
87 | /** | ||
88 | * 跳转详情页面 | ||
89 | */ | ||
90 | onDetailHandler(evt) { | ||
91 | let curItem = getBindtapData(evt); | ||
92 | app.router.push({ | ||
93 | path: "detail", | ||
94 | query: { | ||
95 | c: curItem.videoCode || "" | ||
96 | } | ||
60 | }) | 97 | }) |
61 | }, | 98 | }, |
62 | 99 | ||
63 | /** | 100 | /** |
64 | * 请求DataList | 101 | * 请求DataList |
65 | */ | 102 | */ |
66 | queryDataList() { | 103 | queryVideoMore() { |
67 | return; | ||
68 | return new Promise((resolve, reject) => { | 104 | return new Promise((resolve, reject) => { |
69 | app.post({ | 105 | app.post({ |
70 | sid: false, | 106 | sid: false, |
71 | url: app.api.dataList, | 107 | url: app.api.videoMore, |
72 | data: { | 108 | data: { |
73 | page: this.data.page, | 109 | page: this.data.page, |
74 | size: this.data.size, | 110 | size: this.data.size, |
... | @@ -76,6 +112,7 @@ Page({ | ... | @@ -76,6 +112,7 @@ Page({ |
76 | }).then((result) => { | 112 | }).then((result) => { |
77 | let dataList = result.list; | 113 | let dataList = result.list; |
78 | dataList = this.data.dataList.concat(dataList); | 114 | dataList = this.data.dataList.concat(dataList); |
115 | console.log("dataList:", dataList); | ||
79 | this.setData({ | 116 | this.setData({ |
80 | dataList: dataList, | 117 | dataList: dataList, |
81 | total: result.total | 118 | total: result.total |
... | @@ -86,6 +123,27 @@ Page({ | ... | @@ -86,6 +123,27 @@ Page({ |
86 | }, | 123 | }, |
87 | 124 | ||
88 | /** | 125 | /** |
126 | * 视频详情 | ||
127 | */ | ||
128 | queryVideoDetail() { | ||
129 | return new Promise((resolve, reject) => { | ||
130 | app.post({ | ||
131 | url: app.api.videoDetail, | ||
132 | data: { | ||
133 | videoCode: this.data.options.c | ||
134 | } | ||
135 | }).then((result) => { | ||
136 | this.setData({ | ||
137 | detailData: result | ||
138 | }) | ||
139 | resolve(result); | ||
140 | }).catch((err) => { | ||
141 | reject(err); | ||
142 | }); | ||
143 | }); | ||
144 | }, | ||
145 | |||
146 | /** | ||
89 | * 隐藏蒙层 | 147 | * 隐藏蒙层 |
90 | */ | 148 | */ |
91 | hideMask() { | 149 | hideMask() { | ... | ... |
... | @@ -24,11 +24,13 @@ | ... | @@ -24,11 +24,13 @@ |
24 | width: 100%; | 24 | width: 100%; |
25 | height: 944px; | 25 | height: 944px; |
26 | background-color: #333333; | 26 | background-color: #333333; |
27 | text-align: center; | ||
27 | 28 | ||
28 | .vid { | 29 | .vid { |
29 | margin: 232px auto 0; | 30 | text-align: center; |
31 | margin: 160px auto 0; | ||
30 | width: 100%; | 32 | width: 100%; |
31 | height: 360px; | 33 | // height: 400px; |
32 | } | 34 | } |
33 | 35 | ||
34 | .btn-wrap { | 36 | .btn-wrap { | ... | ... |
... | @@ -6,13 +6,13 @@ | ... | @@ -6,13 +6,13 @@ |
6 | <view class="content"> | 6 | <view class="content"> |
7 | <!-- 视频详情 --> | 7 | <!-- 视频详情 --> |
8 | <view class="detail"> | 8 | <view class="detail"> |
9 | <video objectFit="cover" class="vid" src="https://kd.cdn.xyiyang.com/pro/mzczcradmin/7e91e8a4c7b84e6fa4bada7c8617c9cf.mp4" /> | 9 | <video objectFit="cover" class="vid" poster="{{detailData.thumbnail}}" src="{{detailData.videoUrl}}" /> |
10 | <view class="btn-wrap"> | 10 | <view class="btn-wrap"> |
11 | <button class="btn"> | 11 | <button open-type="share" class="btn"> |
12 | <span class="t1 iconfont iconplane"></span> | 12 | <span class="t1 iconfont iconplane"></span> |
13 | <span class="t1">分享给好友</span> | 13 | <span class="t1">分享给好友</span> |
14 | </button> | 14 | </button> |
15 | <button class="btn btn2"> | 15 | <button open-type="share" class="btn btn2"> |
16 | <span class="t1 iconfont iconplane"></span> | 16 | <span class="t1 iconfont iconplane"></span> |
17 | <span class="t1">分享到群</span> | 17 | <span class="t1">分享到群</span> |
18 | </button> | 18 | </button> |
... | @@ -21,10 +21,10 @@ | ... | @@ -21,10 +21,10 @@ |
21 | <!-- 功能区 --> | 21 | <!-- 功能区 --> |
22 | <view class="func"> | 22 | <view class="func"> |
23 | <view bindtap="toPersonalList" class="user"> | 23 | <view bindtap="toPersonalList" class="user"> |
24 | <image class="portrait" mode="aspectFill" src="https://kd.cdn.xyiyang.com/pro/mzczcradmin/008194acee794506aac4c7200ce654dc.jpg" /> | 24 | <image class="portrait" mode="aspectFill" src="{{detailData.headImage}}" /> |
25 | <view class="desc"> | 25 | <view class="desc"> |
26 | <view class="t1 name">我爱我家</view> | 26 | <view class="t1 name">{{detailData.accountName}}</view> |
27 | <view class="t1 num">280个视频</view> | 27 | <view class="t1 num">{{detailData.count || 0}}个视频</view> |
28 | </view> | 28 | </view> |
29 | </view> | 29 | </view> |
30 | <view class="btn-wrap"> | 30 | <view class="btn-wrap"> |
... | @@ -48,10 +48,14 @@ | ... | @@ -48,10 +48,14 @@ |
48 | <view class="more"> | 48 | <view class="more"> |
49 | <view class="more-title">-- 更多推荐欣赏 --</view> | 49 | <view class="more-title">-- 更多推荐欣赏 --</view> |
50 | <view class="more-list"> | 50 | <view class="more-list"> |
51 | <view wx:for="{{2}}" wx:key="{{index}}" class="more-list-item"> | 51 | <view bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" wx:for="{{dataList}}" wx:key="{{index}}" class="more-list-item"> |
52 | <view class="tit">{{item.videoName}}</view> | ||
53 | <image class="poster" src="{{item.thumbnail}}" /> | ||
54 | </view> | ||
55 | <!-- <view wx:for="{{2}}" wx:key="{{index}}" class="more-list-item"> | ||
52 | <view class="tit">新政策来了!家有小孩的都要过来看看</view> | 56 | <view class="tit">新政策来了!家有小孩的都要过来看看</view> |
53 | <image class="poster" src="https://kd.cdn.xyiyang.com/pro/mzczcradmin/008194acee794506aac4c7200ce654dc.jpg" /> | 57 | <image class="poster" src="https://kd.cdn.xyiyang.com/pro/mzczcradmin/008194acee794506aac4c7200ce654dc.jpg" /> |
54 | </view> | 58 | </view> --> |
55 | </view> | 59 | </view> |
56 | </view> | 60 | </view> |
57 | <!-- 返回首页按钮 --> | 61 | <!-- 返回首页按钮 --> |
... | @@ -62,4 +66,5 @@ | ... | @@ -62,4 +66,5 @@ |
62 | </view> | 66 | </view> |
63 | </view> | 67 | </view> |
64 | </view> | 68 | </view> |
65 | <shortcut></shortcut> | 69 | <!-- <shortcut types="{{[]}}" pics="{{['red-package']}}"></shortcut> --> |
70 | <shortcut ></shortcut> | ... | ... |
... | @@ -5,41 +5,195 @@ import { | ... | @@ -5,41 +5,195 @@ import { |
5 | let app = getApp(); | 5 | let app = getApp(); |
6 | Page({ | 6 | Page({ |
7 | data: { | 7 | data: { |
8 | active: 0 | 8 | authorizeVisible: false, |
9 | total: 0, | ||
10 | page: 1, | ||
11 | size: 10, | ||
12 | dataList: [], | ||
13 | tabList: [], // 标签列表 | ||
14 | bannerList: [], | ||
15 | curTab: {}, | ||
16 | queueCode: "", // 队列标识,每次请求,会返回一个队列标识,用户加载更多时候请携带queueCode参数 | ||
17 | active: 0, | ||
18 | }, | ||
19 | onShareAppMessage() {}, | ||
20 | showAuth() { | ||
21 | this.setData({ | ||
22 | authorizeVisible: true | ||
23 | }) | ||
24 | }, | ||
25 | onLoad(options) { | ||
26 | this.initData(); | ||
9 | }, | 27 | }, |
10 | onLoad(options) {}, | ||
11 | initData() { | 28 | initData() { |
12 | 29 | this.queryTabList().then((result) => { | |
30 | this.setData({ | ||
31 | curTab: this.data.tabList[0] | ||
32 | }) | ||
33 | this.resetPage(); | ||
34 | this.queryBannerList(); | ||
35 | this.queryVideoList(); | ||
36 | }); | ||
13 | }, | 37 | }, |
14 | onChange(event) { | 38 | /** |
15 | wx.showToast({ | 39 | * 到达底部 |
16 | title: `切换到标签 ${event.detail.name}`, | 40 | * 做加载更多操作 |
17 | icon: 'none' | 41 | */ |
42 | onReachBottom() { | ||
43 | console.log("onReachBottom"); | ||
44 | if (this.data.dataList.length < this.data.total) { | ||
45 | this.setData({ | ||
46 | page: this.data.page + 1 | ||
18 | }); | 47 | }); |
48 | this.queryVideoList(); | ||
49 | } | ||
50 | }, | ||
51 | |||
52 | // 重置页面列表 点击搜索条件时需要 | ||
53 | resetPage() { | ||
54 | this.setData({ | ||
55 | page: 1, | ||
56 | dataList: [], | ||
57 | queueCode: "", | ||
58 | }) | ||
59 | }, | ||
60 | onTabsChange(event) { | ||
61 | // console.log("this.data.tabList:", this.data.tabList); | ||
62 | // if (this.data.tabList && this.data.tabList.length > 0) { | ||
63 | // this.setData({ | ||
64 | // curTab: this.data.tabList[event.detail.index] | ||
65 | // }) | ||
66 | // this.resetPage(); | ||
67 | // this.queryVideoList(); | ||
68 | // } | ||
19 | }, | 69 | }, |
20 | onVanTabsHandler(event) { | 70 | onVanTabsHandler(event) { |
21 | console.log("event:", event); | ||
22 | let { | 71 | let { |
23 | index, | 72 | index, |
24 | title | 73 | title |
25 | } = event.detail; | 74 | } = event.detail; |
75 | if (this.data.tabList && this.data.tabList.length > 0) { | ||
76 | this.setData({ | ||
77 | curTab: this.data.tabList[event.detail.index] | ||
78 | }) | ||
79 | this.resetPage(); | ||
80 | this.queryVideoList(); | ||
81 | } | ||
26 | }, | 82 | }, |
27 | onVideoHandler(evt) { | 83 | onDetailHandler(evt) { |
28 | let curItem = getBindtapData(evt); | 84 | let curItem = getBindtapData(evt); |
29 | let curIndex = getBindtapData(evt, "index"); | ||
30 | app.router.push({ | 85 | app.router.push({ |
31 | path: "detail", | 86 | path: "detail", |
32 | query: { | 87 | query: { |
33 | c: curIndex + "" | 88 | c: curItem.videoCode || "" |
34 | } | 89 | } |
35 | }) | 90 | }) |
36 | console.log("curItem:", curItem); | ||
37 | console.log("curIndex:", curIndex); | ||
38 | }, | 91 | }, |
39 | /** | 92 | /** |
40 | * 获取列列表 | 93 | * 获取tab列表 |
41 | */ | 94 | */ |
42 | queryList() { | 95 | queryTabList() { |
96 | return new Promise((resolve, reject) => { | ||
97 | app.post({ | ||
98 | sid: false, | ||
99 | url: app.api.tabList, | ||
100 | data: {} | ||
101 | }).then((result) => { | ||
102 | this.setData({ | ||
103 | tabList: result | ||
104 | }) | ||
105 | resolve(result); | ||
106 | }).catch((err) => { | ||
107 | reject(err) | ||
108 | }); | ||
109 | }); | ||
110 | }, | ||
43 | 111 | ||
112 | /** | ||
113 | * 获取banner列表 | ||
114 | */ | ||
115 | queryBannerList() { | ||
116 | return new Promise((resolve, reject) => { | ||
117 | app.post({ | ||
118 | sid: false, | ||
119 | url: app.api.bannerList, | ||
120 | data: { | ||
121 | tabCode: this.data.curTab.tabCode || "", | ||
44 | } | 122 | } |
123 | }).then((result) => { | ||
124 | this.setData({ | ||
125 | bannerList: result | ||
126 | }) | ||
127 | resolve(result); | ||
128 | }).catch((err) => { | ||
129 | reject(err) | ||
130 | }); | ||
131 | }); | ||
132 | }, | ||
133 | |||
134 | /** | ||
135 | * 获取视频列表 | ||
136 | */ | ||
137 | queryVideoList() { | ||
138 | return new Promise((resolve, reject) => { | ||
139 | app.post({ | ||
140 | sid: true, | ||
141 | url: app.api.videoList, | ||
142 | data: { | ||
143 | page: this.data.page, | ||
144 | size: this.data.size, | ||
145 | queueCode: this.data.queueCode, | ||
146 | tabCode: this.data.curTab.tabCode || "", | ||
147 | } | ||
148 | }).then((result) => { | ||
149 | let dataList = result.list; | ||
150 | dataList = this.data.dataList.concat(dataList); | ||
151 | this.setData({ | ||
152 | dataList: dataList, | ||
153 | total: result.total, | ||
154 | queueCode: result.queueCode, | ||
155 | }) | ||
156 | resolve(result); | ||
157 | }).catch((err) => { | ||
158 | reject(err) | ||
159 | }); | ||
160 | }); | ||
161 | }, | ||
162 | /** | ||
163 | * 隐藏蒙层 | ||
164 | */ | ||
165 | hideMask() { | ||
166 | this.setData({ | ||
167 | productDetailVisible: false, | ||
168 | authorizeVisible: false, | ||
169 | }) | ||
170 | }, | ||
171 | /** | ||
172 | * 子组件事件 | ||
173 | * @param {*} evt | ||
174 | */ | ||
175 | evtcomp(evt) { | ||
176 | let { | ||
177 | name, | ||
178 | data | ||
179 | } = evt.detail; | ||
180 | switch (name) { | ||
181 | |||
182 | // 隐藏蒙层 | ||
183 | case "_evt_hide_mask": | ||
184 | this.hideMask(); | ||
185 | break; | ||
186 | |||
187 | /** | ||
188 | * 重拉数据已在 | ||
189 | */ | ||
190 | case "_evt_auth_complete": | ||
191 | // this.initData(); | ||
192 | this.hideMask(); | ||
193 | break; | ||
194 | |||
195 | default: | ||
196 | break; | ||
197 | } | ||
198 | }, | ||
45 | }) | 199 | }) | ... | ... |
... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
2 | @import '../../assets/scss/utils'; | 2 | @import '../../assets/scss/utils'; |
3 | 3 | ||
4 | .page { | 4 | .page { |
5 | 5 | $contentWidth: 670px; | |
6 | padding-bottom: $pageBottom; | 6 | padding-bottom: $pageBottom; |
7 | 7 | ||
8 | color: #333333; | 8 | color: #333333; |
... | @@ -21,6 +21,39 @@ | ... | @@ -21,6 +21,39 @@ |
21 | 21 | ||
22 | .content { | 22 | .content { |
23 | position: relative; | 23 | position: relative; |
24 | padding-top: 24px; | ||
25 | |||
26 | } | ||
27 | |||
28 | .banner { | ||
29 | position: relative; | ||
30 | |||
31 | .swiper { | ||
32 | width: $contentWidth; | ||
33 | height: 280px; | ||
34 | margin: 0 auto; | ||
35 | |||
36 | .swiper-image { | ||
37 | width: $contentWidth; | ||
38 | height: 250px; | ||
39 | } | ||
40 | } | ||
41 | |||
42 | .tit { | ||
43 | position: absolute; | ||
44 | bottom: 12px; | ||
45 | width: 750px; | ||
46 | height: 64px; | ||
47 | line-height: 64px; | ||
48 | left: 0; | ||
49 | right: 0; | ||
50 | margin: 0 auto; | ||
51 | text-align: center; | ||
52 | background-color: rgba($color: #000000, $alpha: 0.7); | ||
53 | color: #ffffff; | ||
54 | font-size: 30px; | ||
55 | |||
56 | } | ||
24 | } | 57 | } |
25 | 58 | ||
26 | .list { | 59 | .list { |
... | @@ -39,11 +72,13 @@ | ... | @@ -39,11 +72,13 @@ |
39 | justify-content: center; | 72 | justify-content: center; |
40 | position: relative; | 73 | position: relative; |
41 | width: $contentWidth; | 74 | width: $contentWidth; |
75 | background-color: #dddddd; | ||
42 | 76 | ||
43 | .vid { | 77 | .vid { |
44 | @include border-top-radius(16px); | 78 | @include border-top-radius(16px); |
45 | width: $contentWidth; | 79 | width: $contentWidth; |
46 | pointer-events: none; | 80 | pointer-events: none; |
81 | |||
47 | } | 82 | } |
48 | 83 | ||
49 | .tit { | 84 | .tit { |
... | @@ -61,6 +96,19 @@ | ... | @@ -61,6 +96,19 @@ |
61 | @include ellipsis(1); | 96 | @include ellipsis(1); |
62 | 97 | ||
63 | } | 98 | } |
99 | |||
100 | .iconfont { | ||
101 | font-size: 160px; | ||
102 | position: absolute; | ||
103 | left: 0; | ||
104 | right: 0; | ||
105 | top: 100px; | ||
106 | margin: 0 auto; | ||
107 | text-align: center; | ||
108 | font-weight: bold; | ||
109 | // color: #efefef; | ||
110 | color: #ffffff; | ||
111 | } | ||
64 | } | 112 | } |
65 | 113 | ||
66 | &-func { | 114 | &-func { |
... | @@ -122,3 +170,11 @@ | ... | @@ -122,3 +170,11 @@ |
122 | border-width: 0; | 170 | border-width: 0; |
123 | } | 171 | } |
124 | } | 172 | } |
173 | |||
174 | .red-p { | ||
175 | .comp { | ||
176 | bottom: auto; | ||
177 | top: 15%; | ||
178 | } | ||
179 | |||
180 | } | ... | ... |
... | @@ -5,16 +5,41 @@ | ... | @@ -5,16 +5,41 @@ |
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 | <van-sticky> | 7 | <van-sticky> |
8 | <van-tabs active="{{ active }}" bind:click="onVanTabsHandler"> | 8 | <van-tabs ellipsis="{{ false }}" active="{{ active }}" bind:click="onVanTabsHandler" bind:change="onTabsChange"> |
9 | <van-tab title="精彩推荐"></van-tab> | 9 | <van-tab wx:for="{{tabList}}" wx:key="{{index}}" title="{{item.tabName}}"></van-tab> |
10 | <van-tab title="一起旅行"></van-tab> | ||
11 | <van-tab title="齐家欢乐"></van-tab> | ||
12 | <van-tab title="童趣无限"></van-tab> | ||
13 | </van-tabs> | 10 | </van-tabs> |
14 | </van-sticky> | 11 | </van-sticky> |
15 | <view class="content"> | 12 | <view class="content"> |
13 | <view class="banner" wx:if="{{bannerList && bannerList.length>0}}"> | ||
14 | <swiper class="swiper" indicator-color="rgba(0,0,0,.3)" indicator-active-color="rgba(255,255,255,1)" indicator-dots="{{true}}" autoplay="{{true}}" interval="{{5000}}" duration="{{500}}"> | ||
15 | <block wx:for="{{bannerList}}" wx:key="{{index}}"> | ||
16 | <swiper-item> | ||
17 | <image class="swiper-image" src="{{item.imageUrl}}" mode="aspectFill" /> | ||
18 | </swiper-item> | ||
19 | </block> | ||
20 | </swiper> | ||
21 | <view class="tit">banner名字</view> | ||
22 | </view> | ||
16 | <view class="list"> | 23 | <view class="list"> |
17 | <view bindtap="onVideoHandler" wx:for="{{8}}" wx:key="index" data-data="{{item}}" data-index="{{index}}" class="list-item"> | 24 | <view wx:for="{{dataList}}" wx:key="index" class="list-item"> |
25 | <view bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" class="list-item-video"> | ||
26 | <!-- <video objectFit="cover" class="vid" poster="{{item.thumbnail}}" src="{{item.videoUrl}}" /> --> | ||
27 | <image src="{{item.thumbnail}}" mode="aspectFill" /> | ||
28 | <view class="tit">{{item.videoName}}</view> | ||
29 | <span class="iconfont iconicon-test16"></span> | ||
30 | </view> | ||
31 | <view class="list-item-func"> | ||
32 | <view class="user"> | ||
33 | <image class="portrait" mode="aspectFill" src="{{item.headImage}}" /> | ||
34 | <text class="name">{{item.accountName || ""}}</text> | ||
35 | </view> | ||
36 | <button class="share" open-type="share"> | ||
37 | <span class="t1 iconfont iconwechat"></span> | ||
38 | <span class="t1">分享</span> | ||
39 | </button> | ||
40 | </view> | ||
41 | </view> | ||
42 | <!-- <view bindtap="onDetailHandler" wx:for="{{8}}" wx:key="index" data-data="{{item}}" data-index="{{index}}" class="list-item"> | ||
18 | <view class="list-item-video"> | 43 | <view class="list-item-video"> |
19 | <video objectFit="cover" class="vid" poster="https://kd.cdn.xyiyang.com/pro/mzczcradmin/008194acee794506aac4c7200ce654dc.jpg" src="https://kd.cdn.xyiyang.com/pro/mzczcradmin/7e91e8a4c7b84e6fa4bada7c8617c9cf.mp4" /> | 44 | <video objectFit="cover" class="vid" poster="https://kd.cdn.xyiyang.com/pro/mzczcradmin/008194acee794506aac4c7200ce654dc.jpg" src="https://kd.cdn.xyiyang.com/pro/mzczcradmin/7e91e8a4c7b84e6fa4bada7c8617c9cf.mp4" /> |
20 | <view class="tit">这是一个视频</view> | 45 | <view class="tit">这是一个视频</view> |
... | @@ -29,8 +54,10 @@ | ... | @@ -29,8 +54,10 @@ |
29 | <span class="t1">分享</span> | 54 | <span class="t1">分享</span> |
30 | </button> | 55 | </button> |
31 | </view> | 56 | </view> |
32 | </view> | 57 | </view> --> |
33 | </view> | 58 | </view> |
34 | </view> | 59 | </view> |
35 | </view> | 60 | </view> |
36 | </view> | 61 | </view> |
62 | |||
63 | <shortcut class="red-p" types="{{[]}}" pics="{{['red-package']}}"></shortcut> | ... | ... |
... | @@ -5,41 +5,132 @@ import { | ... | @@ -5,41 +5,132 @@ import { |
5 | let app = getApp(); | 5 | let app = getApp(); |
6 | Page({ | 6 | Page({ |
7 | data: { | 7 | data: { |
8 | active: 0 | 8 | isOverShare: true, |
9 | authorizeVisible: false, | ||
10 | total: 0, | ||
11 | page: 1, | ||
12 | size: 10, | ||
13 | dataList: [], | ||
14 | options: {}, | ||
15 | }, | ||
16 | onShareAppMessage() { | ||
17 | let detailData = this.data.detailData; | ||
18 | let title = detailData && detailData.videoName || ""; | ||
19 | let path = `pages/detail/detail?c=${detailData.videoCode}`; | ||
20 | let imageUrl = detailData && detailData.thumbnail || ""; | ||
21 | return { | ||
22 | title, | ||
23 | path, | ||
24 | imageUrl | ||
25 | } | ||
26 | }, | ||
27 | showAuth() { | ||
28 | this.setData({ | ||
29 | authorizeVisible: true | ||
30 | }) | ||
31 | }, | ||
32 | onLoad(options) { | ||
33 | let tempOptions = JSON.parse(decodeURIComponent(JSON.stringify(options))); | ||
34 | this.setData({ | ||
35 | options: tempOptions | ||
36 | }); | ||
37 | this.initData(); | ||
9 | }, | 38 | }, |
10 | onLoad(options) {}, | ||
11 | initData() { | 39 | initData() { |
12 | 40 | this.resetPage(); | |
41 | this.queryVideoList(); | ||
13 | }, | 42 | }, |
14 | onChange(event) { | 43 | /** |
15 | wx.showToast({ | 44 | * 到达底部 |
16 | title: `切换到标签 ${event.detail.name}`, | 45 | * 做加载更多操作 |
17 | icon: 'none' | 46 | */ |
47 | onReachBottom() { | ||
48 | if (this.data.dataList.length < this.data.total) { | ||
49 | this.setData({ | ||
50 | page: this.data.page + 1 | ||
18 | }); | 51 | }); |
52 | this.queryVideoList(); | ||
53 | } | ||
19 | }, | 54 | }, |
20 | onVanTabsHandler(event) { | 55 | |
21 | console.log("event:", event); | 56 | // 重置页面列表 点击搜索条件时需要 |
22 | let { | 57 | resetPage() { |
23 | index, | 58 | this.setData({ |
24 | title | 59 | page: 1, |
25 | } = event.detail; | 60 | dataList: [], |
61 | queueCode: "", | ||
62 | }) | ||
26 | }, | 63 | }, |
27 | onVideoHandler(evt) { | 64 | onDetailHandler(evt) { |
28 | let curItem = getBindtapData(evt); | 65 | let curItem = getBindtapData(evt); |
29 | let curIndex = getBindtapData(evt, "index"); | ||
30 | app.router.push({ | 66 | app.router.push({ |
31 | path: "detail", | 67 | path: "detail", |
32 | query: { | 68 | query: { |
33 | c: curIndex + "" | 69 | c: curItem.videoCode || "" |
70 | } | ||
71 | }) | ||
72 | }, | ||
73 | |||
74 | /** | ||
75 | * 获取视频列表 | ||
76 | */ | ||
77 | queryVideoList() { | ||
78 | return new Promise((resolve, reject) => { | ||
79 | app.post({ | ||
80 | url: app.api.videoAcccout, | ||
81 | data: { | ||
82 | page: this.data.page, | ||
83 | size: this.data.size, | ||
84 | accountCode: this.data.options.c | ||
34 | } | 85 | } |
86 | }).then((result) => { | ||
87 | let dataList = result.list; | ||
88 | dataList = this.data.dataList.concat(dataList); | ||
89 | this.setData({ | ||
90 | dataList: dataList, | ||
91 | total: result.total, | ||
92 | }) | ||
93 | resolve(result); | ||
94 | }).catch((err) => { | ||
95 | reject(err) | ||
96 | }); | ||
97 | }); | ||
98 | }, | ||
99 | /** | ||
100 | * 隐藏蒙层 | ||
101 | */ | ||
102 | hideMask() { | ||
103 | this.setData({ | ||
104 | productDetailVisible: false, | ||
105 | authorizeVisible: false, | ||
35 | }) | 106 | }) |
36 | console.log("curItem:", curItem); | ||
37 | console.log("curIndex:", curIndex); | ||
38 | }, | 107 | }, |
39 | /** | 108 | /** |
40 | * 获取列列表 | 109 | * 子组件事件 |
110 | * @param {*} evt | ||
111 | */ | ||
112 | evtcomp(evt) { | ||
113 | let { | ||
114 | name, | ||
115 | data | ||
116 | } = evt.detail; | ||
117 | switch (name) { | ||
118 | |||
119 | // 隐藏蒙层 | ||
120 | case "_evt_hide_mask": | ||
121 | this.hideMask(); | ||
122 | break; | ||
123 | |||
124 | /** | ||
125 | * 重拉数据已在 | ||
41 | */ | 126 | */ |
42 | queryList() { | 127 | case "_evt_auth_complete": |
128 | // this.initData(); | ||
129 | this.hideMask(); | ||
130 | break; | ||
43 | 131 | ||
132 | default: | ||
133 | break; | ||
44 | } | 134 | } |
135 | }, | ||
45 | }) | 136 | }) | ... | ... |
... | @@ -5,12 +5,28 @@ | ... | @@ -5,12 +5,28 @@ |
5 | <view class="app__content main"> | 5 | <view class="app__content main"> |
6 | <view class="personal"> | 6 | <view class="personal"> |
7 | <view class="top-space"></view> | 7 | <view class="top-space"></view> |
8 | <view class="name">我爱我家 的视频列表</view> | 8 | <view class="name">{{options.accountName}} 的视频列表</view> |
9 | <image class="portrait" mode="aspectFill" src="https://kd.cdn.xyiyang.com/pro/mzczcradmin/008194acee794506aac4c7200ce654dc.jpg" /> | 9 | <image class="portrait" mode="aspectFill" src="{{options.headImage}}" /> |
10 | </view> | 10 | </view> |
11 | <view class="content"> | 11 | <view class="content"> |
12 | <view class="list"> | 12 | <view class="list"> |
13 | <view bindtap="onVideoHandler" wx:for="{{8}}" wx:key="index" data-data="{{item}}" data-index="{{index}}" class="list-item"> | 13 | <view wx:for="{{dataList}}" wx:key="index" class="list-item"> |
14 | <view bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" class="list-item-video"> | ||
15 | <video objectFit="cover" class="vid" poster="{{item.thumbnail}}" src="{{item.videoUrl}}" /> | ||
16 | <view class="tit">{{item.videoName}}</view> | ||
17 | </view> | ||
18 | <view class="list-item-func"> | ||
19 | <view class="user"> | ||
20 | <image class="portrait" mode="aspectFill" src="{{item.headImage}}" /> | ||
21 | <text class="name">{{item.accountName || ""}}</text> | ||
22 | </view> | ||
23 | <button class="share" open-type="share"> | ||
24 | <span class="t1 iconfont iconwechat"></span> | ||
25 | <span class="t1">分享</span> | ||
26 | </button> | ||
27 | </view> | ||
28 | </view> | ||
29 | <!-- <view bindtap="onVideoHandler" wx:for="{{8}}" wx:key="index" data-data="{{item}}" data-index="{{index}}" class="list-item"> | ||
14 | <view class="list-item-video"> | 30 | <view class="list-item-video"> |
15 | <video objectFit="cover" class="vid" poster="https://kd.cdn.xyiyang.com/pro/mzczcradmin/008194acee794506aac4c7200ce654dc.jpg" src="https://kd.cdn.xyiyang.com/pro/mzczcradmin/7e91e8a4c7b84e6fa4bada7c8617c9cf.mp4" /> | 31 | <video objectFit="cover" class="vid" poster="https://kd.cdn.xyiyang.com/pro/mzczcradmin/008194acee794506aac4c7200ce654dc.jpg" src="https://kd.cdn.xyiyang.com/pro/mzczcradmin/7e91e8a4c7b84e6fa4bada7c8617c9cf.mp4" /> |
16 | <view class="tit">这是一个视频</view> | 32 | <view class="tit">这是一个视频</view> |
... | @@ -25,7 +41,7 @@ | ... | @@ -25,7 +41,7 @@ |
25 | <span class="t1">分享</span> | 41 | <span class="t1">分享</span> |
26 | </button> | 42 | </button> |
27 | </view> | 43 | </view> |
28 | </view> | 44 | </view> --> |
29 | </view> | 45 | </view> |
30 | </view> | 46 | </view> |
31 | </view> | 47 | </view> | ... | ... |
... | @@ -82,12 +82,10 @@ VantComponent({ | ... | @@ -82,12 +82,10 @@ VantComponent({ |
82 | onChange(event) { | 82 | onChange(event) { |
83 | const { index, picker, value } = event.detail; | 83 | const { index, picker, value } = event.detail; |
84 | this.code = value[index].code; | 84 | this.code = value[index].code; |
85 | let getValues = picker.getValues(); | ||
86 | getValues = this.parseOutputValues(getValues); | ||
87 | this.setValues().then(() => { | 85 | this.setValues().then(() => { |
88 | this.$emit('change', { | 86 | this.$emit('change', { |
89 | picker, | 87 | picker, |
90 | values: getValues, | 88 | values: this.parseOutputValues(picker.getValues()), |
91 | index | 89 | index |
92 | }); | 90 | }); |
93 | }); | 91 | }); | ... | ... |
... | @@ -19,7 +19,7 @@ VantComponent({ | ... | @@ -19,7 +19,7 @@ VantComponent({ |
19 | childIndex: this.children.length | 19 | childIndex: this.children.length |
20 | }); | 20 | }); |
21 | this.children.push(target); | 21 | this.children.push(target); |
22 | // 收集 dropdown-item 的 data 挂在 data 上 | 22 | // 收集 dorpdown-item 的 data 挂在 data 上 |
23 | target && | 23 | target && |
24 | this.setData({ | 24 | this.setData({ |
25 | itemListData: this.data.itemListData.concat([target.data]) | 25 | itemListData: this.data.itemListData.concat([target.data]) | ... | ... |
1 | @import '../common/index.wxss';:host{-webkit-flex:1;flex:1}.van-goods-action-button{border:none!important;height:40px!important;height:var(--goods-action-button-height,40px)!important;font-weight:500!important;font-weight:var(--font-weight-bold,500)!important;line-height:40px!important;line-height:var(--goods-action-button-height,40px)!important}.van-goods-action-button--first{display:block!important;margin-left:5px;border-top-left-radius:40px/2!important;border-top-left-radius:var(--goods-action-button-height,40px)/2!important;border-bottom-left-radius:40px/2!important;border-bottom-left-radius:var(--goods-action-button-height,40px)/2!important}.van-goods-action-button--last{display:block!important;margin-right:5px;border-top-right-radius:40px/2!important;border-top-right-radius:var(--goods-action-button-height,40px)/2!important;border-bottom-right-radius:40px/2!important;border-bottom-right-radius:var(--goods-action-button-height,40px)/2!important}.van-goods-action-button--warning{background:linear-gradient(90deg,#ffd01e,#ff8917);background:var(--goods-action-button-warning-color,linear-gradient(90deg,#ffd01e,#ff8917))}.van-goods-action-button--danger{background:linear-gradient(90deg,#ff6034,#ee0a24);background:var(--goods-action-button-danger-color,linear-gradient(90deg,#ff6034,#ee0a24))}@media (max-width:321px){.van-goods-action-button{font-size:13px}} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | @import '../common/index.wxss';:host{-webkit-flex:1;flex:1}.van-goods-action-button{border:none!important;height:40px!important;height:var(--goods-action-button-height,40px)!important;font-weight:500!important;font-weight:var(--font-weight-bold,500)!important;line-height:40px!important;line-height:var(--goods-action-button-height,40px)!important}.van-goods-action-button--first{display:block!important;margin-left:5px;border-top-left-radius:20px!important;border-top-left-radius:var(--goods-action-button-border-radius,20px)!important;border-bottom-left-radius:20px!important;border-bottom-left-radius:var(--goods-action-button-border-radius,20px)!important}.van-goods-action-button--last{display:block!important;margin-right:5px;border-top-right-radius:20px!important;border-top-right-radius:var(--goods-action-button-border-radius,20px)!important;border-bottom-right-radius:20px!important;border-bottom-right-radius:var(--goods-action-button-border-radius,20px)!important}.van-goods-action-button--warning{background:linear-gradient(90deg,#ffd01e,#ff8917);background:var(--goods-action-button-warning-color,linear-gradient(90deg,#ffd01e,#ff8917))}.van-goods-action-button--danger{background:linear-gradient(90deg,#ff6034,#ee0a24);background:var(--goods-action-button-danger-color,linear-gradient(90deg,#ff6034,#ee0a24))}@media (max-width:321px){.van-goods-action-button{font-size:13px}} | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | @import '../common/index.wxss';@font-face{font-weight:400;font-family:vant-icon;font-style:normal;font-display:auto;src:url(https://img.yzcdn.cn/vant/vant-icon-0bc654.woff2) format("woff2"),url(https://img.yzcdn.cn/vant/vant-icon-0bc654.woff) format("woff"),url(https://img.yzcdn.cn/vant/vant-icon-0bc654.ttf) format("truetype")}.van-icon{position:relative;font:normal normal normal 14px/1 vant-icon;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased}.van-icon,.van-icon:before{display:inline-block}.van-icon-add-o:before{content:"\F000"}.van-icon-add-square:before{content:"\F001"}.van-icon-add:before{content:"\F002"}.van-icon-after-sale:before{content:"\F003"}.van-icon-aim:before{content:"\F004"}.van-icon-alipay:before{content:"\F005"}.van-icon-apps-o:before{content:"\F006"}.van-icon-arrow-down:before{content:"\F007"}.van-icon-arrow-left:before{content:"\F008"}.van-icon-arrow-up:before{content:"\F009"}.van-icon-arrow:before{content:"\F00A"}.van-icon-ascending:before{content:"\F00B"}.van-icon-audio:before{content:"\F00C"}.van-icon-award-o:before{content:"\F00D"}.van-icon-award:before{content:"\F00E"}.van-icon-bag-o:before{content:"\F00F"}.van-icon-bag:before{content:"\F010"}.van-icon-balance-list-o:before{content:"\F011"}.van-icon-balance-list:before{content:"\F012"}.van-icon-balance-o:before{content:"\F013"}.van-icon-balance-pay:before{content:"\F014"}.van-icon-bar-chart-o:before{content:"\F015"}.van-icon-bars:before{content:"\F016"}.van-icon-bell:before{content:"\F017"}.van-icon-bill-o:before{content:"\F018"}.van-icon-bill:before{content:"\F019"}.van-icon-birthday-cake-o:before{content:"\F01A"}.van-icon-bookmark-o:before{content:"\F01B"}.van-icon-bookmark:before{content:"\F01C"}.van-icon-browsing-history-o:before{content:"\F01D"}.van-icon-browsing-history:before{content:"\F01E"}.van-icon-brush-o:before{content:"\F01F"}.van-icon-bulb-o:before{content:"\F020"}.van-icon-bullhorn-o:before{content:"\F021"}.van-icon-calender-o:before{content:"\F022"}.van-icon-card:before{content:"\F023"}.van-icon-cart-circle-o:before{content:"\F024"}.van-icon-cart-circle:before{content:"\F025"}.van-icon-cart-o:before{content:"\F026"}.van-icon-cart:before{content:"\F027"}.van-icon-cash-back-record:before{content:"\F028"}.van-icon-cash-on-deliver:before{content:"\F029"}.van-icon-cashier-o:before{content:"\F02A"}.van-icon-certificate:before{content:"\F02B"}.van-icon-chart-trending-o:before{content:"\F02C"}.van-icon-chat-o:before{content:"\F02D"}.van-icon-chat:before{content:"\F02E"}.van-icon-checked:before{content:"\F02F"}.van-icon-circle:before{content:"\F030"}.van-icon-clear:before{content:"\F031"}.van-icon-clock-o:before{content:"\F032"}.van-icon-clock:before{content:"\F033"}.van-icon-close:before{content:"\F034"}.van-icon-closed-eye:before{content:"\F035"}.van-icon-cluster-o:before{content:"\F036"}.van-icon-cluster:before{content:"\F037"}.van-icon-column:before{content:"\F038"}.van-icon-comment-circle-o:before{content:"\F039"}.van-icon-comment-circle:before{content:"\F03A"}.van-icon-comment-o:before{content:"\F03B"}.van-icon-comment:before{content:"\F03C"}.van-icon-completed:before{content:"\F03D"}.van-icon-contact:before{content:"\F03E"}.van-icon-coupon-o:before{content:"\F03F"}.van-icon-coupon:before{content:"\F040"}.van-icon-credit-pay:before{content:"\F041"}.van-icon-cross:before{content:"\F042"}.van-icon-debit-pay:before{content:"\F043"}.van-icon-delete:before{content:"\F044"}.van-icon-descending:before{content:"\F045"}.van-icon-description:before{content:"\F046"}.van-icon-desktop-o:before{content:"\F047"}.van-icon-diamond-o:before{content:"\F048"}.van-icon-diamond:before{content:"\F049"}.van-icon-discount:before{content:"\F04A"}.van-icon-down:before{content:"\F04B"}.van-icon-ecard-pay:before{content:"\F04C"}.van-icon-edit:before{content:"\F04D"}.van-icon-ellipsis:before{content:"\F04E"}.van-icon-empty:before{content:"\F04F"}.van-icon-envelop-o:before{content:"\F050"}.van-icon-exchange:before{content:"\F051"}.van-icon-expand-o:before{content:"\F052"}.van-icon-expand:before{content:"\F053"}.van-icon-eye-o:before{content:"\F054"}.van-icon-eye:before{content:"\F055"}.van-icon-fail:before{content:"\F056"}.van-icon-failure:before{content:"\F057"}.van-icon-filter-o:before{content:"\F058"}.van-icon-fire-o:before{content:"\F059"}.van-icon-fire:before{content:"\F05A"}.van-icon-flag-o:before{content:"\F05B"}.van-icon-flower-o:before{content:"\F05C"}.van-icon-free-postage:before{content:"\F05D"}.van-icon-friends-o:before{content:"\F05E"}.van-icon-friends:before{content:"\F05F"}.van-icon-gem-o:before{content:"\F060"}.van-icon-gem:before{content:"\F061"}.van-icon-gift-card-o:before{content:"\F062"}.van-icon-gift-card:before{content:"\F063"}.van-icon-gift-o:before{content:"\F064"}.van-icon-gift:before{content:"\F065"}.van-icon-gold-coin-o:before{content:"\F066"}.van-icon-gold-coin:before{content:"\F067"}.van-icon-good-job-o:before{content:"\F068"}.van-icon-good-job:before{content:"\F069"}.van-icon-goods-collect-o:before{content:"\F06A"}.van-icon-goods-collect:before{content:"\F06B"}.van-icon-graphic:before{content:"\F06C"}.van-icon-home-o:before{content:"\F06D"}.van-icon-hot-o:before{content:"\F06E"}.van-icon-hot-sale-o:before{content:"\F06F"}.van-icon-hot-sale:before{content:"\F070"}.van-icon-hot:before{content:"\F071"}.van-icon-hotel-o:before{content:"\F072"}.van-icon-idcard:before{content:"\F073"}.van-icon-info-o:before{content:"\F074"}.van-icon-info:before{content:"\F075"}.van-icon-invition:before{content:"\F076"}.van-icon-label-o:before{content:"\F077"}.van-icon-label:before{content:"\F078"}.van-icon-like-o:before{content:"\F079"}.van-icon-like:before{content:"\F07A"}.van-icon-live:before{content:"\F07B"}.van-icon-location-o:before{content:"\F07C"}.van-icon-location:before{content:"\F07D"}.van-icon-lock:before{content:"\F07E"}.van-icon-logistics:before{content:"\F07F"}.van-icon-manager-o:before{content:"\F080"}.van-icon-manager:before{content:"\F081"}.van-icon-map-marked:before{content:"\F082"}.van-icon-medel-o:before{content:"\F083"}.van-icon-medel:before{content:"\F084"}.van-icon-more-o:before{content:"\F085"}.van-icon-more:before{content:"\F086"}.van-icon-music-o:before{content:"\F087"}.van-icon-music:before{content:"\F088"}.van-icon-new-arrival-o:before{content:"\F089"}.van-icon-new-arrival:before{content:"\F08A"}.van-icon-new-o:before{content:"\F08B"}.van-icon-new:before{content:"\F08C"}.van-icon-newspaper-o:before{content:"\F08D"}.van-icon-notes-o:before{content:"\F08E"}.van-icon-orders-o:before{content:"\F08F"}.van-icon-other-pay:before{content:"\F090"}.van-icon-paid:before{content:"\F091"}.van-icon-passed:before{content:"\F092"}.van-icon-pause-circle-o:before{content:"\F093"}.van-icon-pause-circle:before{content:"\F094"}.van-icon-pause:before{content:"\F095"}.van-icon-peer-pay:before{content:"\F096"}.van-icon-pending-payment:before{content:"\F097"}.van-icon-phone-circle-o:before{content:"\F098"}.van-icon-phone-circle:before{content:"\F099"}.van-icon-phone-o:before{content:"\F09A"}.van-icon-phone:before{content:"\F09B"}.van-icon-photo-o:before{content:"\F09C"}.van-icon-photo:before{content:"\F09D"}.van-icon-photograph:before{content:"\F09E"}.van-icon-play-circle-o:before{content:"\F09F"}.van-icon-play-circle:before{content:"\F0A0"}.van-icon-play:before{content:"\F0A1"}.van-icon-plus:before{content:"\F0A2"}.van-icon-point-gift-o:before{content:"\F0A3"}.van-icon-point-gift:before{content:"\F0A4"}.van-icon-points:before{content:"\F0A5"}.van-icon-printer:before{content:"\F0A6"}.van-icon-qr-invalid:before{content:"\F0A7"}.van-icon-qr:before{content:"\F0A8"}.van-icon-question-o:before{content:"\F0A9"}.van-icon-question:before{content:"\F0AA"}.van-icon-records:before{content:"\F0AB"}.van-icon-refund-o:before{content:"\F0AC"}.van-icon-replay:before{content:"\F0AD"}.van-icon-scan:before{content:"\F0AE"}.van-icon-search:before{content:"\F0AF"}.van-icon-send-gift-o:before{content:"\F0B0"}.van-icon-send-gift:before{content:"\F0B1"}.van-icon-service-o:before{content:"\F0B2"}.van-icon-service:before{content:"\F0B3"}.van-icon-setting-o:before{content:"\F0B4"}.van-icon-setting:before{content:"\F0B5"}.van-icon-share:before{content:"\F0B6"}.van-icon-shop-collect-o:before{content:"\F0B7"}.van-icon-shop-collect:before{content:"\F0B8"}.van-icon-shop-o:before{content:"\F0B9"}.van-icon-shop:before{content:"\F0BA"}.van-icon-shopping-cart-o:before{content:"\F0BB"}.van-icon-shopping-cart:before{content:"\F0BC"}.van-icon-shrink:before{content:"\F0BD"}.van-icon-sign:before{content:"\F0BE"}.van-icon-smile-comment-o:before{content:"\F0BF"}.van-icon-smile-comment:before{content:"\F0C0"}.van-icon-smile-o:before{content:"\F0C1"}.van-icon-smile:before{content:"\F0C2"}.van-icon-star-o:before{content:"\F0C3"}.van-icon-star:before{content:"\F0C4"}.van-icon-stop-circle-o:before{content:"\F0C5"}.van-icon-stop-circle:before{content:"\F0C6"}.van-icon-stop:before{content:"\F0C7"}.van-icon-success:before{content:"\F0C8"}.van-icon-thumb-circle-o:before{content:"\F0C9"}.van-icon-thumb-circle:before{content:"\F0CA"}.van-icon-todo-list-o:before{content:"\F0CB"}.van-icon-todo-list:before{content:"\F0CC"}.van-icon-tosend:before{content:"\F0CD"}.van-icon-tv-o:before{content:"\F0CE"}.van-icon-umbrella-circle:before{content:"\F0CF"}.van-icon-underway-o:before{content:"\F0D0"}.van-icon-underway:before{content:"\F0D1"}.van-icon-upgrade:before{content:"\F0D2"}.van-icon-user-circle-o:before{content:"\F0D3"}.van-icon-user-o:before{content:"\F0D4"}.van-icon-video-o:before{content:"\F0D5"}.van-icon-video:before{content:"\F0D6"}.van-icon-vip-card-o:before{content:"\F0D7"}.van-icon-vip-card:before{content:"\F0D8"}.van-icon-volume-o:before{content:"\F0D9"}.van-icon-volume:before{content:"\F0DA"}.van-icon-wap-home-o:before{content:"\F0DB"}.van-icon-wap-home:before{content:"\F0DC"}.van-icon-wap-nav:before{content:"\F0DD"}.van-icon-warn-o:before{content:"\F0DE"}.van-icon-warning-o:before{content:"\F0DF"}.van-icon-warning:before{content:"\F0E0"}.van-icon-weapp-nav:before{content:"\F0E1"}.van-icon-wechat:before{content:"\F0E2"}.van-icon-youzan-shield:before{content:"\F0E3"}:host{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-icon--image{width:1em;height:1em}.van-icon__image{width:100%;height:100%}.van-icon__info{z-index:1} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | @import '../common/index.wxss';@font-face{font-weight:400;font-family:vant-icon;font-style:normal;font-display:auto;src:url(https://img.yzcdn.cn/vant/vant-icon-0bc654.woff2) format("woff2"),url(https://img.yzcdn.cn/vant/vant-icon-0bc654.woff) format("woff"),url(https://img.yzcdn.cn/vant/vant-icon-0bc654.ttf) format("truetype")}.van-icon{position:relative;font:normal normal normal 14px/1 vant-icon;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased}.van-icon,.van-icon:before{display:inline-block}.van-icon-add-o:before{content:"\F000"}.van-icon-add-square:before{content:"\F001"}.van-icon-add:before{content:"\F002"}.van-icon-after-sale:before{content:"\F003"}.van-icon-aim:before{content:"\F004"}.van-icon-alipay:before{content:"\F005"}.van-icon-apps-o:before{content:"\F006"}.van-icon-arrow-down:before{content:"\F007"}.van-icon-arrow-left:before{content:"\F008"}.van-icon-arrow-up:before{content:"\F009"}.van-icon-arrow:before{content:"\F00A"}.van-icon-ascending:before{content:"\F00B"}.van-icon-audio:before{content:"\F00C"}.van-icon-award-o:before{content:"\F00D"}.van-icon-award:before{content:"\F00E"}.van-icon-bag-o:before{content:"\F00F"}.van-icon-bag:before{content:"\F010"}.van-icon-balance-list-o:before{content:"\F011"}.van-icon-balance-list:before{content:"\F012"}.van-icon-balance-o:before{content:"\F013"}.van-icon-balance-pay:before{content:"\F014"}.van-icon-bar-chart-o:before{content:"\F015"}.van-icon-bars:before{content:"\F016"}.van-icon-bell:before{content:"\F017"}.van-icon-bill-o:before{content:"\F018"}.van-icon-bill:before{content:"\F019"}.van-icon-birthday-cake-o:before{content:"\F01A"}.van-icon-bookmark-o:before{content:"\F01B"}.van-icon-bookmark:before{content:"\F01C"}.van-icon-browsing-history-o:before{content:"\F01D"}.van-icon-browsing-history:before{content:"\F01E"}.van-icon-brush-o:before{content:"\F01F"}.van-icon-bulb-o:before{content:"\F020"}.van-icon-bullhorn-o:before{content:"\F021"}.van-icon-calender-o:before{content:"\F022"}.van-icon-card:before{content:"\F023"}.van-icon-cart-circle-o:before{content:"\F024"}.van-icon-cart-circle:before{content:"\F025"}.van-icon-cart-o:before{content:"\F026"}.van-icon-cart:before{content:"\F027"}.van-icon-cash-back-record:before{content:"\F028"}.van-icon-cash-on-deliver:before{content:"\F029"}.van-icon-cashier-o:before{content:"\F02A"}.van-icon-certificate:before{content:"\F02B"}.van-icon-chart-trending-o:before{content:"\F02C"}.van-icon-chat-o:before{content:"\F02D"}.van-icon-chat:before{content:"\F02E"}.van-icon-checked:before{content:"\F02F"}.van-icon-circle:before{content:"\F030"}.van-icon-clear:before{content:"\F031"}.van-icon-clock-o:before{content:"\F032"}.van-icon-clock:before{content:"\F033"}.van-icon-close:before{content:"\F034"}.van-icon-closed-eye:before{content:"\F035"}.van-icon-cluster-o:before{content:"\F036"}.van-icon-cluster:before{content:"\F037"}.van-icon-column:before{content:"\F038"}.van-icon-comment-circle-o:before{content:"\F039"}.van-icon-comment-circle:before{content:"\F03A"}.van-icon-comment-o:before{content:"\F03B"}.van-icon-comment:before{content:"\F03C"}.van-icon-completed:before{content:"\F03D"}.van-icon-contact:before{content:"\F03E"}.van-icon-coupon-o:before{content:"\F03F"}.van-icon-coupon:before{content:"\F040"}.van-icon-credit-pay:before{content:"\F041"}.van-icon-cross:before{content:"\F042"}.van-icon-debit-pay:before{content:"\F043"}.van-icon-delete:before{content:"\F044"}.van-icon-descending:before{content:"\F045"}.van-icon-description:before{content:"\F046"}.van-icon-desktop-o:before{content:"\F047"}.van-icon-diamond-o:before{content:"\F048"}.van-icon-diamond:before{content:"\F049"}.van-icon-discount:before{content:"\F04A"}.van-icon-down:before{content:"\F04B"}.van-icon-ecard-pay:before{content:"\F04C"}.van-icon-edit:before{content:"\F04D"}.van-icon-ellipsis:before{content:"\F04E"}.van-icon-empty:before{content:"\F04F"}.van-icon-envelop-o:before{content:"\F050"}.van-icon-exchange:before{content:"\F051"}.van-icon-expand-o:before{content:"\F052"}.van-icon-expand:before{content:"\F053"}.van-icon-eye-o:before{content:"\F054"}.van-icon-eye:before{content:"\F055"}.van-icon-fail:before{content:"\F056"}.van-icon-failure:before{content:"\F057"}.van-icon-filter-o:before{content:"\F058"}.van-icon-fire-o:before{content:"\F059"}.van-icon-fire:before{content:"\F05A"}.van-icon-flag-o:before{content:"\F05B"}.van-icon-flower-o:before{content:"\F05C"}.van-icon-free-postage:before{content:"\F05D"}.van-icon-friends-o:before{content:"\F05E"}.van-icon-friends:before{content:"\F05F"}.van-icon-gem-o:before{content:"\F060"}.van-icon-gem:before{content:"\F061"}.van-icon-gift-card-o:before{content:"\F062"}.van-icon-gift-card:before{content:"\F063"}.van-icon-gift-o:before{content:"\F064"}.van-icon-gift:before{content:"\F065"}.van-icon-gold-coin-o:before{content:"\F066"}.van-icon-gold-coin:before{content:"\F067"}.van-icon-good-job-o:before{content:"\F068"}.van-icon-good-job:before{content:"\F069"}.van-icon-goods-collect-o:before{content:"\F06A"}.van-icon-goods-collect:before{content:"\F06B"}.van-icon-graphic:before{content:"\F06C"}.van-icon-home-o:before{content:"\F06D"}.van-icon-hot-o:before{content:"\F06E"}.van-icon-hot-sale-o:before{content:"\F06F"}.van-icon-hot-sale:before{content:"\F070"}.van-icon-hot:before{content:"\F071"}.van-icon-hotel-o:before{content:"\F072"}.van-icon-idcard:before{content:"\F073"}.van-icon-info-o:before{content:"\F074"}.van-icon-info:before{content:"\F075"}.van-icon-invition:before{content:"\F076"}.van-icon-label-o:before{content:"\F077"}.van-icon-label:before{content:"\F078"}.van-icon-like-o:before{content:"\F079"}.van-icon-like:before{content:"\F07A"}.van-icon-live:before{content:"\F07B"}.van-icon-location-o:before{content:"\F07C"}.van-icon-location:before{content:"\F07D"}.van-icon-lock:before{content:"\F07E"}.van-icon-logistics:before{content:"\F07F"}.van-icon-manager-o:before{content:"\F080"}.van-icon-manager:before{content:"\F081"}.van-icon-map-marked:before{content:"\F082"}.van-icon-medel-o:before{content:"\F083"}.van-icon-medel:before{content:"\F084"}.van-icon-more-o:before{content:"\F085"}.van-icon-more:before{content:"\F086"}.van-icon-music-o:before{content:"\F087"}.van-icon-music:before{content:"\F088"}.van-icon-new-arrival-o:before{content:"\F089"}.van-icon-new-arrival:before{content:"\F08A"}.van-icon-new-o:before{content:"\F08B"}.van-icon-new:before{content:"\F08C"}.van-icon-newspaper-o:before{content:"\F08D"}.van-icon-notes-o:before{content:"\F08E"}.van-icon-orders-o:before{content:"\F08F"}.van-icon-other-pay:before{content:"\F090"}.van-icon-paid:before{content:"\F091"}.van-icon-passed:before{content:"\F092"}.van-icon-pause-circle-o:before{content:"\F093"}.van-icon-pause-circle:before{content:"\F094"}.van-icon-pause:before{content:"\F095"}.van-icon-peer-pay:before{content:"\F096"}.van-icon-pending-payment:before{content:"\F097"}.van-icon-phone-circle-o:before{content:"\F098"}.van-icon-phone-circle:before{content:"\F099"}.van-icon-phone-o:before{content:"\F09A"}.van-icon-phone:before{content:"\F09B"}.van-icon-photo-o:before{content:"\F09C"}.van-icon-photo:before{content:"\F09D"}.van-icon-photograph:before{content:"\F09E"}.van-icon-play-circle-o:before{content:"\F09F"}.van-icon-play-circle:before{content:"\F0A0"}.van-icon-play:before{content:"\F0A1"}.van-icon-plus:before{content:"\F0A2"}.van-icon-point-gift-o:before{content:"\F0A3"}.van-icon-point-gift:before{content:"\F0A4"}.van-icon-points:before{content:"\F0A5"}.van-icon-printer:before{content:"\F0A6"}.van-icon-qr-invalid:before{content:"\F0A7"}.van-icon-qr:before{content:"\F0A8"}.van-icon-question-o:before{content:"\F0A9"}.van-icon-question:before{content:"\F0AA"}.van-icon-records:before{content:"\F0AB"}.van-icon-refund-o:before{content:"\F0AC"}.van-icon-replay:before{content:"\F0AD"}.van-icon-scan:before{content:"\F0AE"}.van-icon-search:before{content:"\F0AF"}.van-icon-send-gift-o:before{content:"\F0B0"}.van-icon-send-gift:before{content:"\F0B1"}.van-icon-service-o:before{content:"\F0B2"}.van-icon-service:before{content:"\F0B3"}.van-icon-setting-o:before{content:"\F0B4"}.van-icon-setting:before{content:"\F0B5"}.van-icon-share:before{content:"\F0B6"}.van-icon-shop-collect-o:before{content:"\F0B7"}.van-icon-shop-collect:before{content:"\F0B8"}.van-icon-shop-o:before{content:"\F0B9"}.van-icon-shop:before{content:"\F0BA"}.van-icon-shopping-cart-o:before{content:"\F0BB"}.van-icon-shopping-cart:before{content:"\F0BC"}.van-icon-shrink:before{content:"\F0BD"}.van-icon-sign:before{content:"\F0BE"}.van-icon-smile-comment-o:before{content:"\F0BF"}.van-icon-smile-comment:before{content:"\F0C0"}.van-icon-smile-o:before{content:"\F0C1"}.van-icon-smile:before{content:"\F0C2"}.van-icon-star-o:before{content:"\F0C3"}.van-icon-star:before{content:"\F0C4"}.van-icon-stop-circle-o:before{content:"\F0C5"}.van-icon-stop-circle:before{content:"\F0C6"}.van-icon-stop:before{content:"\F0C7"}.van-icon-success:before{content:"\F0C8"}.van-icon-thumb-circle-o:before{content:"\F0C9"}.van-icon-thumb-circle:before{content:"\F0CA"}.van-icon-todo-list-o:before{content:"\F0CB"}.van-icon-todo-list:before{content:"\F0CC"}.van-icon-tosend:before{content:"\F0CD"}.van-icon-tv-o:before{content:"\F0CE"}.van-icon-umbrella-circle:before{content:"\F0CF"}.van-icon-underway-o:before{content:"\F0D0"}.van-icon-underway:before{content:"\F0D1"}.van-icon-upgrade:before{content:"\F0D2"}.van-icon-user-circle-o:before{content:"\F0D3"}.van-icon-user-o:before{content:"\F0D4"}.van-icon-video-o:before{content:"\F0D5"}.van-icon-video:before{content:"\F0D6"}.van-icon-vip-card-o:before{content:"\F0D7"}.van-icon-vip-card:before{content:"\F0D8"}.van-icon-volume-o:before{content:"\F0D9"}.van-icon-volume:before{content:"\F0DA"}.van-icon-wap-home-o:before{content:"\F0DB"}.van-icon-wap-home:before{content:"\F0DC"}.van-icon-wap-nav:before{content:"\F0DD"}.van-icon-warn-o:before{content:"\F0DE"}.van-icon-warning-o:before{content:"\F0DF"}.van-icon-warning:before{content:"\F0E0"}.van-icon-weapp-nav:before{content:"\F0E1"}.van-icon-wechat:before{content:"\F0E2"}.van-icon-youzan-shield:before{content:"\F0E3"}:host{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-icon--image{width:1em;height:1em}.van-icon__image{width:100%;height:100%}.van-icon__info{z-index:1} | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
src/ui/vant-weapp/index-anchor/index.d.ts
0 → 100755
1 | export {}; |
src/ui/vant-weapp/index-anchor/index.js
0 → 100755
1 | import { VantComponent } from '../common/component'; | ||
2 | VantComponent({ | ||
3 | relation: { | ||
4 | name: 'index-bar', | ||
5 | type: 'ancestor', | ||
6 | linked(target) { | ||
7 | this.parent = target; | ||
8 | }, | ||
9 | unlinked() { | ||
10 | this.parent = null; | ||
11 | } | ||
12 | }, | ||
13 | props: { | ||
14 | useSlot: Boolean, | ||
15 | index: null | ||
16 | }, | ||
17 | data: { | ||
18 | active: false, | ||
19 | wrapperStyle: '', | ||
20 | anchorStyle: '' | ||
21 | } | ||
22 | }); |
src/ui/vant-weapp/index-anchor/index.json
0 → 100755
src/ui/vant-weapp/index-anchor/index.wxml
0 → 100755
1 | <view | ||
2 | class="van-index-anchor-wrapper" | ||
3 | style="{{ wrapperStyle }}" | ||
4 | > | ||
5 | <view | ||
6 | class="van-index-anchor {{ active ? 'van-index-anchor--active van-hairline--bottom' : '' }}" | ||
7 | style="{{ anchorStyle }}" | ||
8 | > | ||
9 | <slot wx:if="{{ useSlot }}"/> | ||
10 | <block wx:else> | ||
11 | <text>{{ index }}</text> | ||
12 | </block> | ||
13 | </view> | ||
14 | </view> |
src/ui/vant-weapp/index-anchor/index.wxss
0 → 100755
1 | @import '../common/index.wxss';.van-index-anchor{padding:0 16px;padding:var(--index-anchor-padding,0 16px);color:#323233;color:var(--index-anchor-text-color,#323233);font-weight:500;font-weight:var(--index-anchor-font-weight,500);font-size:14px;font-size:var(--index-anchor-font-size,14px);line-height:32px;line-height:var(--index-anchor-line-height,32px);background-color:initial;background-color:var(--index-anchor-background-color,transparent)}.van-index-anchor--active{right:0;left:0;color:#07c160;color:var(--index-anchor-active-text-color,#07c160);background-color:#fff;background-color:var(--index-anchor-active-background-color,#fff)} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
src/ui/vant-weapp/index-bar/index.d.ts
0 → 100755
1 | export {}; |
src/ui/vant-weapp/index-bar/index.js
0 → 100755
1 | import { VantComponent } from '../common/component'; | ||
2 | import { GREEN } from '../common/color'; | ||
3 | const indexList = () => { | ||
4 | const indexList = []; | ||
5 | const charCodeOfA = 'A'.charCodeAt(0); | ||
6 | for (let i = 0; i < 26; i++) { | ||
7 | indexList.push(String.fromCharCode(charCodeOfA + i)); | ||
8 | } | ||
9 | return indexList; | ||
10 | }; | ||
11 | VantComponent({ | ||
12 | relation: { | ||
13 | name: 'index-anchor', | ||
14 | type: 'descendant', | ||
15 | linked() { | ||
16 | this.updateData(); | ||
17 | }, | ||
18 | linkChanged() { | ||
19 | this.updateData(); | ||
20 | }, | ||
21 | unlinked() { | ||
22 | this.updateData(); | ||
23 | } | ||
24 | }, | ||
25 | props: { | ||
26 | sticky: { | ||
27 | type: Boolean, | ||
28 | value: true | ||
29 | }, | ||
30 | zIndex: { | ||
31 | type: Number, | ||
32 | value: 1 | ||
33 | }, | ||
34 | highlightColor: { | ||
35 | type: String, | ||
36 | value: GREEN | ||
37 | }, | ||
38 | scrollTop: { | ||
39 | type: Number, | ||
40 | value: 0, | ||
41 | observer: 'onScroll' | ||
42 | }, | ||
43 | stickyOffsetTop: { | ||
44 | type: Number, | ||
45 | value: 0 | ||
46 | }, | ||
47 | indexList: { | ||
48 | type: Array, | ||
49 | value: indexList() | ||
50 | } | ||
51 | }, | ||
52 | data: { | ||
53 | activeAnchorIndex: null, | ||
54 | showSidebar: false | ||
55 | }, | ||
56 | methods: { | ||
57 | updateData() { | ||
58 | this.timer && clearTimeout(this.timer); | ||
59 | this.timer = setTimeout(() => { | ||
60 | this.children = this.getRelationNodes('../index-anchor/index'); | ||
61 | this.setData({ | ||
62 | showSidebar: !!this.children.length | ||
63 | }); | ||
64 | this.setRect().then(() => { | ||
65 | this.onScroll(); | ||
66 | }); | ||
67 | }, 0); | ||
68 | }, | ||
69 | setRect() { | ||
70 | return Promise.all([ | ||
71 | this.setAnchorsRect(), | ||
72 | this.setListRect(), | ||
73 | this.setSiderbarRect() | ||
74 | ]); | ||
75 | }, | ||
76 | setAnchorsRect() { | ||
77 | return Promise.all(this.children.map(anchor => (anchor.getRect('.van-index-anchor-wrapper').then((rect) => { | ||
78 | Object.assign(anchor, { | ||
79 | height: rect.height, | ||
80 | top: rect.top + this.data.scrollTop | ||
81 | }); | ||
82 | })))); | ||
83 | }, | ||
84 | setListRect() { | ||
85 | return this.getRect('.van-index-bar').then((rect) => { | ||
86 | Object.assign(this, { | ||
87 | height: rect.height, | ||
88 | top: rect.top + this.data.scrollTop | ||
89 | }); | ||
90 | }); | ||
91 | }, | ||
92 | setSiderbarRect() { | ||
93 | return this.getRect('.van-index-bar__sidebar').then(res => { | ||
94 | this.sidebar = { | ||
95 | height: res.height, | ||
96 | top: res.top | ||
97 | }; | ||
98 | }); | ||
99 | }, | ||
100 | setDiffData({ target, data }) { | ||
101 | const diffData = {}; | ||
102 | Object.keys(data).forEach(key => { | ||
103 | if (target.data[key] !== data[key]) { | ||
104 | diffData[key] = data[key]; | ||
105 | } | ||
106 | }); | ||
107 | if (Object.keys(diffData).length) { | ||
108 | target.setData(diffData); | ||
109 | } | ||
110 | }, | ||
111 | getAnchorRect(anchor) { | ||
112 | return anchor.getRect('.van-index-anchor-wrapper').then((rect) => ({ | ||
113 | height: rect.height, | ||
114 | top: rect.top | ||
115 | })); | ||
116 | }, | ||
117 | getActiveAnchorIndex() { | ||
118 | const { children } = this; | ||
119 | const { sticky, scrollTop, stickyOffsetTop } = this.data; | ||
120 | for (let i = this.children.length - 1; i >= 0; i--) { | ||
121 | const preAnchorHeight = i > 0 ? children[i - 1].height : 0; | ||
122 | const reachTop = sticky ? preAnchorHeight + stickyOffsetTop : 0; | ||
123 | if (reachTop + scrollTop >= children[i].top) { | ||
124 | return i; | ||
125 | } | ||
126 | } | ||
127 | return -1; | ||
128 | }, | ||
129 | onScroll() { | ||
130 | const { children = [] } = this; | ||
131 | if (!children.length) { | ||
132 | return; | ||
133 | } | ||
134 | const { sticky, stickyOffsetTop, zIndex, highlightColor, scrollTop } = this.data; | ||
135 | const active = this.getActiveAnchorIndex(); | ||
136 | this.setDiffData({ | ||
137 | target: this, | ||
138 | data: { | ||
139 | activeAnchorIndex: active | ||
140 | } | ||
141 | }); | ||
142 | if (sticky) { | ||
143 | let isActiveAnchorSticky = false; | ||
144 | if (active !== -1) { | ||
145 | isActiveAnchorSticky = children[active].top <= stickyOffsetTop + scrollTop; | ||
146 | } | ||
147 | children.forEach((item, index) => { | ||
148 | if (index === active) { | ||
149 | let wrapperStyle = ''; | ||
150 | let anchorStyle = ` | ||
151 | color: ${highlightColor}; | ||
152 | `; | ||
153 | if (isActiveAnchorSticky) { | ||
154 | wrapperStyle = ` | ||
155 | height: ${children[index].height}px; | ||
156 | `; | ||
157 | anchorStyle = ` | ||
158 | position: fixed; | ||
159 | top: ${stickyOffsetTop}px; | ||
160 | z-index: ${zIndex}; | ||
161 | color: ${highlightColor}; | ||
162 | `; | ||
163 | } | ||
164 | this.setDiffData({ | ||
165 | target: item, | ||
166 | data: { | ||
167 | active: true, | ||
168 | anchorStyle, | ||
169 | wrapperStyle | ||
170 | } | ||
171 | }); | ||
172 | } | ||
173 | else if (index === active - 1) { | ||
174 | const currentAnchor = children[index]; | ||
175 | const currentOffsetTop = currentAnchor.top; | ||
176 | const targetOffsetTop = index === children.length - 1 | ||
177 | ? this.top | ||
178 | : children[index + 1].top; | ||
179 | const parentOffsetHeight = targetOffsetTop - currentOffsetTop; | ||
180 | const translateY = parentOffsetHeight - currentAnchor.height; | ||
181 | const anchorStyle = ` | ||
182 | position: relative; | ||
183 | transform: translate3d(0, ${translateY}px, 0); | ||
184 | z-index: ${zIndex}; | ||
185 | color: ${highlightColor}; | ||
186 | `; | ||
187 | this.setDiffData({ | ||
188 | target: item, | ||
189 | data: { | ||
190 | active: true, | ||
191 | anchorStyle | ||
192 | } | ||
193 | }); | ||
194 | } | ||
195 | else { | ||
196 | this.setDiffData({ | ||
197 | target: item, | ||
198 | data: { | ||
199 | active: false, | ||
200 | anchorStyle: '', | ||
201 | wrapperStyle: '', | ||
202 | } | ||
203 | }); | ||
204 | } | ||
205 | }); | ||
206 | } | ||
207 | }, | ||
208 | onClick(event) { | ||
209 | this.scrollToAnchor(event.target.dataset.index); | ||
210 | }, | ||
211 | onTouchMove(event) { | ||
212 | const sidebarLength = this.children.length; | ||
213 | const touch = event.touches[0]; | ||
214 | const itemHeight = this.sidebar.height / sidebarLength; | ||
215 | let index = Math.floor((touch.clientY - this.sidebar.top) / itemHeight); | ||
216 | if (index < 0) { | ||
217 | index = 0; | ||
218 | } | ||
219 | else if (index > sidebarLength - 1) { | ||
220 | index = sidebarLength - 1; | ||
221 | } | ||
222 | this.scrollToAnchor(index); | ||
223 | }, | ||
224 | onTouchStop() { | ||
225 | this.scrollToAnchorIndex = null; | ||
226 | }, | ||
227 | scrollToAnchor(index) { | ||
228 | if (typeof index !== 'number' || this.scrollToAnchorIndex === index) { | ||
229 | return; | ||
230 | } | ||
231 | this.scrollToAnchorIndex = index; | ||
232 | const anchor = this.children.filter(item => item.data.index === this.data.indexList[index])[0]; | ||
233 | this.$emit('select', anchor.data.index); | ||
234 | anchor && wx.pageScrollTo({ | ||
235 | duration: 0, | ||
236 | scrollTop: anchor.top | ||
237 | }); | ||
238 | } | ||
239 | } | ||
240 | }); |
src/ui/vant-weapp/index-bar/index.json
0 → 100755
src/ui/vant-weapp/index-bar/index.wxml
0 → 100755
1 | <view class="van-index-bar"> | ||
2 | <slot /> | ||
3 | |||
4 | <view | ||
5 | wx:if="{{ showSidebar }}" | ||
6 | class="van-index-bar__sidebar" | ||
7 | catch:tap="onClick" | ||
8 | catch:touchmove="onTouchMove" | ||
9 | catch:touchend="onTouchStop" | ||
10 | catch:touchcancel="onTouchStop" | ||
11 | > | ||
12 | <view | ||
13 | wx:for="{{ indexList }}" | ||
14 | wx:key="index" | ||
15 | class="van-index-bar__index" | ||
16 | style="z-index: {{ zIndex + 1 }}; color: {{ activeAnchorIndex === index ? highlightColor : '' }}" | ||
17 | data-index="{{ index }}" | ||
18 | > | ||
19 | {{ item }} | ||
20 | </view> | ||
21 | </view> | ||
22 | </view> |
src/ui/vant-weapp/index-bar/index.wxss
0 → 100755
1 | @import '../common/index.wxss';.van-index-bar{position:relative}.van-index-bar__sidebar{position:fixed;top:50%;right:0;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;text-align:center;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-user-select:none;user-select:none}.van-index-bar__index{font-weight:500;padding:0 4px 0 16px;padding:0 var(--padding-base,4px) 0 var(--padding-md,16px);font-size:10px;font-size:var(--index-bar-index-font-size,10px);line-height:14px;line-height:var(--index-bar-index-line-height,14px)} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | @import '../common/index.wxss';.van-nav-bar{position:relative;text-align:center;-webkit-user-select:none;user-select:none;height:44px;height:var(--nav-bar-height,44px);line-height:44px;line-height:var(--nav-bar-height,44px);background-color:#fff;background-color:var(--nav-bar-background-color,#fff)}.van-nav-bar__text{display:inline-block;vertical-align:middle;margin:0 -16px;margin:0 -var(--padding-md,16px);padding:0 -16px;padding:0 -var(--padding-md,16px);color:#1989fa;color:var(--nav-bar-text-color,#1989fa)}.van-nav-bar__text--hover{background-color:#f2f3f5;background-color:var(--active-color,#f2f3f5)}.van-nav-bar__arrow{vertical-align:middle;font-size:16px;font-size:var(--nav-bar-arrow-size,16px);color:#1989fa;color:var(--nav-bar-text-color,#1989fa)}.van-nav-bar__arrow+.van-nav-bar__text{margin-left:-20px;padding-left:25px}.van-nav-bar--fixed{position:fixed;top:0;left:0;width:100%}.van-nav-bar__title{max-width:60%;margin:0 auto;color:#323233;color:var(--nav-bar-title-text-color,#323233);font-weight:500;font-weight:var(--font-weight-bold,500);font-size:16px;font-size:var(--nav-bar-title-font-size,16px)}.van-nav-bar__left,.van-nav-bar__right{position:absolute;bottom:0;font-size:14px;font-size:var(--font-size-md,14px)}.van-nav-bar__left{left:16px;left:var(--padding-md,16px)}.van-nav-bar__right{right:16px;right:var(--padding-md,16px)} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | @import '../common/index.wxss';.van-nav-bar{position:relative;text-align:center;-webkit-user-select:none;user-select:none;height:44px;height:var(--nav-bar-height,44px);line-height:44px;line-height:var(--nav-bar-height,44px);background-color:#fff;background-color:var(--nav-bar-background-color,#fff)}.van-nav-bar__text{display:inline-block;vertical-align:middle;margin:0 -16px;margin:0 -var(--padding-md,16px);padding:0 16px;padding:0 var(--padding-md,16px);color:#1989fa;color:var(--nav-bar-text-color,#1989fa)}.van-nav-bar__text--hover{background-color:#f2f3f5;background-color:var(--active-color,#f2f3f5)}.van-nav-bar__arrow{vertical-align:middle;font-size:16px;font-size:var(--nav-bar-arrow-size,16px);color:#1989fa;color:var(--nav-bar-text-color,#1989fa)}.van-nav-bar__arrow+.van-nav-bar__text{margin-left:-20px;padding-left:25px}.van-nav-bar--fixed{position:fixed;top:0;left:0;width:100%}.van-nav-bar__title{max-width:60%;margin:0 auto;color:#323233;color:var(--nav-bar-title-text-color,#323233);font-weight:500;font-weight:var(--font-weight-bold,500);font-size:16px;font-size:var(--nav-bar-title-font-size,16px)}.van-nav-bar__left,.van-nav-bar__right{position:absolute;bottom:0;font-size:14px;font-size:var(--font-size-md,14px)}.van-nav-bar__left{left:16px;left:var(--padding-md,16px)}.van-nav-bar__right{right:16px;right:var(--padding-md,16px)} | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -8,10 +8,7 @@ VantComponent({ | ... | @@ -8,10 +8,7 @@ VantComponent({ |
8 | readonly: Boolean, | 8 | readonly: Boolean, |
9 | disabled: Boolean, | 9 | disabled: Boolean, |
10 | allowHalf: Boolean, | 10 | allowHalf: Boolean, |
11 | size: { | 11 | size: null, |
12 | type: null, | ||
13 | observer: 'setSizeWithUnit' | ||
14 | }, | ||
15 | icon: { | 12 | icon: { |
16 | type: String, | 13 | type: String, |
17 | value: 'star' | 14 | value: 'star' |
... | @@ -47,8 +44,7 @@ VantComponent({ | ... | @@ -47,8 +44,7 @@ VantComponent({ |
47 | }, | 44 | }, |
48 | data: { | 45 | data: { |
49 | innerValue: 0, | 46 | innerValue: 0, |
50 | gutterWithUnit: undefined, | 47 | gutterWithUnit: undefined |
51 | sizeWithUnit: '20px' | ||
52 | }, | 48 | }, |
53 | watch: { | 49 | watch: { |
54 | value(value) { | 50 | value(value) { |
... | @@ -58,11 +54,6 @@ VantComponent({ | ... | @@ -58,11 +54,6 @@ VantComponent({ |
58 | } | 54 | } |
59 | }, | 55 | }, |
60 | methods: { | 56 | methods: { |
61 | setSizeWithUnit(val) { | ||
62 | this.setData({ | ||
63 | sizeWithUnit: addUnit(val) | ||
64 | }); | ||
65 | }, | ||
66 | setGutterWithUnit(val) { | 57 | setGutterWithUnit(val) { |
67 | this.setData({ | 58 | this.setData({ |
68 | gutterWithUnit: addUnit(val) | 59 | gutterWithUnit: addUnit(val) | ... | ... |
... | @@ -8,10 +8,11 @@ | ... | @@ -8,10 +8,11 @@ |
8 | class="van-rate__item" | 8 | class="van-rate__item" |
9 | wx:for="{{ count }}" | 9 | wx:for="{{ count }}" |
10 | wx:key="index" | 10 | wx:key="index" |
11 | style="font-size: {{ sizeWithUnit }};padding-right: {{ index !== count - 1 ? gutterWithUnit : '' }}" | 11 | style="padding-right: {{ index !== count - 1 ? gutterWithUnit : '' }}" |
12 | > | 12 | > |
13 | <van-icon | 13 | <van-icon |
14 | name="{{ index + 1 <= innerValue ? icon : voidIcon }}" | 14 | name="{{ index + 1 <= innerValue ? icon : voidIcon }}" |
15 | size="{{ size }}" | ||
15 | class="van-rate__icon" | 16 | class="van-rate__icon" |
16 | custom-class="icon-class" | 17 | custom-class="icon-class" |
17 | data-score="{{ index }}" | 18 | data-score="{{ index }}" |
... | @@ -21,6 +22,7 @@ | ... | @@ -21,6 +22,7 @@ |
21 | 22 | ||
22 | <van-icon | 23 | <van-icon |
23 | wx:if="{{ allowHalf }}" | 24 | wx:if="{{ allowHalf }}" |
25 | size="{{ size }}" | ||
24 | name="{{ index + 0.5 <= innerValue ? icon : voidIcon }}" | 26 | name="{{ index + 0.5 <= innerValue ? icon : voidIcon }}" |
25 | class="{{ utils.bem('rate__icon', ['half']) }}" | 27 | class="{{ utils.bem('rate__icon', ['half']) }}" |
26 | custom-class="icon-class" | 28 | custom-class="icon-class" | ... | ... |
... | @@ -17,6 +17,7 @@ | ... | @@ -17,6 +17,7 @@ |
17 | /> | 17 | /> |
18 | <view | 18 | <view |
19 | wx:for="row" | 19 | wx:for="row" |
20 | wx:key="index" | ||
20 | wx:for-index="index" | 21 | wx:for-index="index" |
21 | class="{{ utils.bem('skeleton__row') }}" | 22 | class="{{ utils.bem('skeleton__row') }}" |
22 | style="{{ 'width:' + (isArray ? rowWidth[index] : rowWidth) }}" | 23 | style="{{ 'width:' + (isArray ? rowWidth[index] : rowWidth) }}" | ... | ... |
1 | import { VantComponent } from '../common/component'; | 1 | import { VantComponent } from '../common/component'; |
2 | const ROOT_ELEMENT = '.van-sticky'; | ||
2 | VantComponent({ | 3 | VantComponent({ |
3 | props: { | 4 | props: { |
4 | zIndex: { | 5 | zIndex: { |
... | @@ -7,9 +8,27 @@ VantComponent({ | ... | @@ -7,9 +8,27 @@ VantComponent({ |
7 | }, | 8 | }, |
8 | offsetTop: { | 9 | offsetTop: { |
9 | type: Number, | 10 | type: Number, |
10 | value: 0 | 11 | value: 0, |
12 | observer: 'observeContent' | ||
11 | }, | 13 | }, |
12 | disabled: Boolean | 14 | disabled: { |
15 | type: Boolean, | ||
16 | observer(value) { | ||
17 | if (!this.mounted) { | ||
18 | return; | ||
19 | } | ||
20 | value ? this.disconnectObserver() : this.initObserver(); | ||
21 | } | ||
22 | }, | ||
23 | container: { | ||
24 | type: null, | ||
25 | observer(target) { | ||
26 | if (typeof target !== 'function' || !this.data.height) { | ||
27 | return; | ||
28 | } | ||
29 | this.observeContainer(); | ||
30 | } | ||
31 | } | ||
13 | }, | 32 | }, |
14 | data: { | 33 | data: { |
15 | wrapStyle: '', | 34 | wrapStyle: '', |
... | @@ -31,35 +50,91 @@ VantComponent({ | ... | @@ -31,35 +50,91 @@ VantComponent({ |
31 | }); | 50 | }); |
32 | } | 51 | } |
33 | }, | 52 | }, |
34 | observerContentScroll() { | 53 | getContainerRect() { |
54 | const nodesRef = this.data.container(); | ||
55 | return new Promise(resolve => nodesRef.boundingClientRect(resolve).exec()); | ||
56 | }, | ||
57 | initObserver() { | ||
58 | this.disconnectObserver(); | ||
59 | this.getRect(ROOT_ELEMENT).then((rect) => { | ||
60 | this.setData({ height: rect.height }); | ||
61 | wx.nextTick(() => { | ||
62 | this.observeContent(); | ||
63 | this.observeContainer(); | ||
64 | }); | ||
65 | }); | ||
66 | }, | ||
67 | disconnectObserver(observerName) { | ||
68 | if (observerName) { | ||
69 | const observer = this[observerName]; | ||
70 | observer && observer.disconnect(); | ||
71 | } | ||
72 | else { | ||
73 | this.contentObserver && this.contentObserver.disconnect(); | ||
74 | this.containerObserver && this.containerObserver.disconnect(); | ||
75 | } | ||
76 | }, | ||
77 | observeContent() { | ||
35 | const { offsetTop } = this.data; | 78 | const { offsetTop } = this.data; |
36 | const intersectionObserver = this.createIntersectionObserver({ | 79 | this.disconnectObserver('contentObserver'); |
80 | const contentObserver = this.createIntersectionObserver({ | ||
81 | thresholds: [0, 1] | ||
82 | }); | ||
83 | this.contentObserver = contentObserver; | ||
84 | contentObserver.relativeToViewport({ top: -offsetTop }); | ||
85 | contentObserver.observe(ROOT_ELEMENT, res => { | ||
86 | if (this.data.disabled) { | ||
87 | return; | ||
88 | } | ||
89 | this.setFixed(res.boundingClientRect.top); | ||
90 | }); | ||
91 | }, | ||
92 | observeContainer() { | ||
93 | if (typeof this.data.container !== 'function') { | ||
94 | return; | ||
95 | } | ||
96 | const { height } = this.data; | ||
97 | this.getContainerRect().then((rect) => { | ||
98 | this.containerHeight = rect.height; | ||
99 | this.disconnectObserver('containerObserver'); | ||
100 | const containerObserver = this.createIntersectionObserver({ | ||
37 | thresholds: [0, 1] | 101 | thresholds: [0, 1] |
38 | }); | 102 | }); |
39 | this.intersectionObserver = intersectionObserver; | 103 | this.containerObserver = containerObserver; |
40 | intersectionObserver.relativeToViewport({ top: -offsetTop }); | 104 | containerObserver.relativeToViewport({ |
41 | intersectionObserver.observe('.van-sticky', (res) => { | 105 | top: this.containerHeight - height |
106 | }); | ||
107 | containerObserver.observe(ROOT_ELEMENT, res => { | ||
42 | if (this.data.disabled) { | 108 | if (this.data.disabled) { |
43 | return; | 109 | return; |
44 | } | 110 | } |
45 | // @ts-ignore | 111 | this.setFixed(res.boundingClientRect.top); |
46 | const { top, height } = res.boundingClientRect; | 112 | }); |
47 | const fixed = top <= offsetTop; | 113 | }); |
114 | }, | ||
115 | setFixed(top) { | ||
116 | const { offsetTop, height } = this.data; | ||
117 | const { containerHeight } = this; | ||
118 | const fixed = containerHeight && height | ||
119 | ? top > height - containerHeight && top < offsetTop | ||
120 | : top < offsetTop; | ||
48 | this.$emit('scroll', { | 121 | this.$emit('scroll', { |
49 | scrollTop: top, | 122 | scrollTop: top, |
50 | isFixed: fixed | 123 | isFixed: fixed |
51 | }); | 124 | }); |
52 | this.setData({ fixed, height }); | 125 | this.setData({ fixed }); |
53 | wx.nextTick(() => { | 126 | wx.nextTick(() => { |
54 | this.setStyle(); | 127 | this.setStyle(); |
55 | }); | 128 | }); |
56 | }); | ||
57 | } | 129 | } |
58 | }, | 130 | }, |
59 | mounted() { | 131 | mounted() { |
60 | this.observerContentScroll(); | 132 | this.mounted = true; |
133 | if (!this.data.disabled) { | ||
134 | this.initObserver(); | ||
135 | } | ||
61 | }, | 136 | }, |
62 | destroyed() { | 137 | destroyed() { |
63 | this.intersectionObserver.disconnect(); | 138 | this.disconnectObserver(); |
64 | } | 139 | } |
65 | }); | 140 | }); | ... | ... |
1 | <wxs src="../wxs/utils.wxs" module="utils" /> | 1 | <wxs src="../wxs/utils.wxs" module="utils" /> |
2 | 2 | ||
3 | <view class="custom-class van-sticky }}" style="{{ containerStyle }}"> | 3 | <view class="custom-class van-sticky" style="{{ containerStyle }}"> |
4 | <view class="{{ utils.bem('sticky-wrap', { fixed }) }}" style="{{ wrapStyle }}"> | 4 | <view class="{{ utils.bem('sticky-wrap', { fixed }) }}" style="{{ wrapStyle }}"> |
5 | <slot /> | 5 | <slot /> |
6 | </view> | 6 | </view> | ... | ... |
... | @@ -22,10 +22,7 @@ VantComponent({ | ... | @@ -22,10 +22,7 @@ VantComponent({ |
22 | } | 22 | } |
23 | }, | 23 | }, |
24 | data: { | 24 | data: { |
25 | width: null, | 25 | active: false |
26 | inited: false, | ||
27 | active: false, | ||
28 | animated: false | ||
29 | }, | 26 | }, |
30 | watch: { | 27 | watch: { |
31 | title: 'update', | 28 | title: 'update', |
... | @@ -35,15 +32,20 @@ VantComponent({ | ... | @@ -35,15 +32,20 @@ VantComponent({ |
35 | titleStyle: 'update' | 32 | titleStyle: 'update' |
36 | }, | 33 | }, |
37 | methods: { | 34 | methods: { |
38 | setComputedName() { | ||
39 | this.computedName = this.data.name || this.index; | ||
40 | }, | ||
41 | getComputedName() { | 35 | getComputedName() { |
42 | if (this.data.name !== '') { | 36 | if (this.data.name !== '') { |
43 | return this.data.name; | 37 | return this.data.name; |
44 | } | 38 | } |
45 | return this.index; | 39 | return this.index; |
46 | }, | 40 | }, |
41 | updateRender(active, parent) { | ||
42 | const { data: parentData } = parent; | ||
43 | this.inited = this.inited || active; | ||
44 | this.setData({ | ||
45 | active, | ||
46 | shouldRender: this.inited || !parentData.lazyRender | ||
47 | }); | ||
48 | }, | ||
47 | update() { | 49 | update() { |
48 | if (this.parent) { | 50 | if (this.parent) { |
49 | this.parent.updateTabs(); | 51 | this.parent.updateTabs(); | ... | ... |
1 | <wxs src="../wxs/utils.wxs" module="utils" /> | 1 | <wxs src="../wxs/utils.wxs" module="utils" /> |
2 | 2 | ||
3 | <view | 3 | <view |
4 | wx:if="{{ animated || inited }}" | 4 | wx:if="{{ shouldRender }}" |
5 | class="custom-class {{ utils.bem('tab__pane', { active, inactive: !active }) }}" | 5 | class="custom-class {{ utils.bem('tab__pane', { active, inactive: !active }) }}" |
6 | style="{{ animated || active ? '' : 'display: none;' }} {{ width ? 'width:' + width + 'px;' : '' }}" | ||
7 | > | 6 | > |
8 | <slot /> | 7 | <slot /> |
9 | </view> | 8 | </view> | ... | ... |
1 | @import '../common/index.wxss';.van-tab__pane{box-sizing:border-box;overflow-y:auto}.van-tab__pane--active{height:auto}.van-tab__pane--inactive{height:0;overflow:visible} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | @import '../common/index.wxss';:host{-webkit-flex-shrink:0;flex-shrink:0;width:100%}.van-tab__pane,:host{box-sizing:border-box}.van-tab__pane{overflow-y:auto}.van-tab__pane--active{height:auto}.van-tab__pane--inactive{height:0;overflow:visible} | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | import { VantComponent } from '../common/component'; | 1 | import { VantComponent } from '../common/component'; |
2 | import { touch } from '../mixins/touch'; | 2 | import { touch } from '../mixins/touch'; |
3 | import { nextTick, isDef, addUnit } from '../common/utils'; | 3 | import { isDef, addUnit } from '../common/utils'; |
4 | VantComponent({ | 4 | VantComponent({ |
5 | mixins: [touch], | 5 | mixins: [touch], |
6 | classes: ['nav-class', 'tab-class', 'tab-active-class', 'line-class'], | 6 | classes: ['nav-class', 'tab-class', 'tab-active-class', 'line-class'], |
7 | relation: { | 7 | relation: { |
8 | name: 'tab', | 8 | name: 'tab', |
9 | type: 'descendant', | 9 | type: 'descendant', |
10 | linked(child) { | 10 | linked(target) { |
11 | child.index = this.children.length; | 11 | target.index = this.children.length; |
12 | this.children.push(child); | 12 | this.children.push(target); |
13 | this.updateTabs(this.data.tabs.concat(child.data)); | 13 | this.updateTabs(); |
14 | }, | 14 | }, |
15 | unlinked(child) { | 15 | unlinked(target) { |
16 | const index = this.children.indexOf(child); | 16 | this.children = this.children |
17 | const { tabs } = this.data; | 17 | .filter((child) => child !== target) |
18 | tabs.splice(index, 1); | 18 | .map((child, index) => { |
19 | this.children.splice(index, 1); | 19 | child.index = index; |
20 | let i = index; | 20 | return child; |
21 | while (i >= 0 && i < this.children.length) { | 21 | }); |
22 | const currentChild = this.children[i]; | 22 | this.updateTabs(); |
23 | currentChild.index--; | ||
24 | i++; | ||
25 | } | ||
26 | this.updateTabs(tabs); | ||
27 | } | 23 | } |
28 | }, | 24 | }, |
29 | props: { | 25 | props: { |
... | @@ -47,12 +43,15 @@ VantComponent({ | ... | @@ -47,12 +43,15 @@ VantComponent({ |
47 | value: -1, | 43 | value: -1, |
48 | observer: 'setLine' | 44 | observer: 'setLine' |
49 | }, | 45 | }, |
46 | titleActiveColor: String, | ||
47 | titleInactiveColor: String, | ||
50 | active: { | 48 | active: { |
51 | type: [String, Number], | 49 | type: [String, Number], |
52 | value: 0, | 50 | value: 0, |
53 | observer(value) { | 51 | observer(name) { |
54 | this.currentName = value; | 52 | if (name !== this.getCurrentName()) { |
55 | this.setActiveTab(); | 53 | this.setCurrentIndexByName(name); |
54 | } | ||
56 | } | 55 | } |
57 | }, | 56 | }, |
58 | type: { | 57 | type: { |
... | @@ -63,6 +62,10 @@ VantComponent({ | ... | @@ -63,6 +62,10 @@ VantComponent({ |
63 | type: Boolean, | 62 | type: Boolean, |
64 | value: true | 63 | value: true |
65 | }, | 64 | }, |
65 | ellipsis: { | ||
66 | type: Boolean, | ||
67 | value: true | ||
68 | }, | ||
66 | duration: { | 69 | duration: { |
67 | type: Number, | 70 | type: Number, |
68 | value: 0.3 | 71 | value: 0.3 |
... | @@ -74,16 +77,20 @@ VantComponent({ | ... | @@ -74,16 +77,20 @@ VantComponent({ |
74 | swipeThreshold: { | 77 | swipeThreshold: { |
75 | type: Number, | 78 | type: Number, |
76 | value: 4, | 79 | value: 4, |
77 | observer() { | 80 | observer(value) { |
78 | this.setData({ | 81 | this.setData({ |
79 | scrollable: this.children.length > this.data.swipeThreshold | 82 | scrollable: this.children.length > value || !this.data.ellipsis |
80 | }); | 83 | }); |
81 | } | 84 | } |
82 | }, | 85 | }, |
83 | offsetTop: { | 86 | offsetTop: { |
84 | type: Number, | 87 | type: Number, |
85 | value: 0 | 88 | value: 0 |
86 | } | 89 | }, |
90 | lazyRender: { | ||
91 | type: Boolean, | ||
92 | value: true | ||
93 | }, | ||
87 | }, | 94 | }, |
88 | data: { | 95 | data: { |
89 | tabs: [], | 96 | tabs: [], |
... | @@ -91,51 +98,87 @@ VantComponent({ | ... | @@ -91,51 +98,87 @@ VantComponent({ |
91 | scrollLeft: 0, | 98 | scrollLeft: 0, |
92 | scrollable: false, | 99 | scrollable: false, |
93 | trackStyle: '', | 100 | trackStyle: '', |
94 | wrapStyle: '', | 101 | currentIndex: null, |
95 | position: '', | 102 | container: null |
96 | currentIndex: 0 | ||
97 | }, | 103 | }, |
98 | beforeCreate() { | 104 | beforeCreate() { |
99 | this.children = []; | 105 | this.children = []; |
100 | }, | 106 | }, |
101 | mounted() { | 107 | mounted() { |
108 | this.setData({ | ||
109 | container: () => this.createSelectorQuery().select('.van-tabs') | ||
110 | }); | ||
102 | this.setLine(true); | 111 | this.setLine(true); |
103 | this.setTrack(); | 112 | this.setTrack(); |
104 | this.scrollIntoView(); | 113 | this.scrollIntoView(); |
105 | }, | 114 | }, |
106 | methods: { | 115 | methods: { |
107 | updateTabs(tabs) { | 116 | updateTabs() { |
108 | tabs = tabs || this.data.tabs; | 117 | const { children = [], data } = this; |
109 | this.setData({ | 118 | this.setData({ |
110 | tabs, | 119 | tabs: children.map((child) => child.data), |
111 | scrollable: tabs.length > this.data.swipeThreshold | 120 | scrollable: this.children.length > data.swipeThreshold || !data.ellipsis |
112 | }); | 121 | }); |
113 | this.setActiveTab(); | 122 | this.setCurrentIndexByName(this.getCurrentName() || data.active); |
114 | }, | 123 | }, |
115 | trigger(eventName, name) { | 124 | trigger(eventName) { |
116 | const { tabs, currentIndex } = this.data; | 125 | const { currentIndex } = this.data; |
126 | const child = this.children[currentIndex]; | ||
117 | this.$emit(eventName, { | 127 | this.$emit(eventName, { |
118 | name, | 128 | index: currentIndex, |
119 | title: tabs[currentIndex].title | 129 | name: child.getComputedName(), |
130 | title: child.data.title | ||
120 | }); | 131 | }); |
121 | }, | 132 | }, |
122 | onTap(event) { | 133 | onTap(event) { |
123 | const { index } = event.currentTarget.dataset; | 134 | const { index } = event.currentTarget.dataset; |
124 | const child = this.children[index]; | 135 | const child = this.children[index]; |
125 | const computedName = child.getComputedName(); | 136 | if (child.data.disabled) { |
126 | if (this.data.tabs[index].disabled) { | 137 | this.trigger('disabled'); |
127 | this.trigger('disabled', computedName); | ||
128 | } | 138 | } |
129 | else { | 139 | else { |
130 | this.trigger('click', computedName); | 140 | this.setCurrentIndex(index); |
131 | this.setActive(computedName); | 141 | wx.nextTick(() => { |
142 | this.trigger('click'); | ||
143 | }); | ||
144 | } | ||
145 | }, | ||
146 | // correct the index of active tab | ||
147 | setCurrentIndexByName(name) { | ||
148 | const { children = [] } = this; | ||
149 | const matched = children.filter((child) => child.getComputedName() === name); | ||
150 | const defaultIndex = (children[0] || {}).index || 0; | ||
151 | this.setCurrentIndex(matched.length ? matched[0].index : defaultIndex); | ||
152 | }, | ||
153 | setCurrentIndex(currentIndex) { | ||
154 | const { data, children = [] } = this; | ||
155 | if (!isDef(currentIndex) || | ||
156 | currentIndex >= children.length || | ||
157 | currentIndex < 0) { | ||
158 | return; | ||
132 | } | 159 | } |
160 | const shouldEmitChange = data.currentIndex !== null; | ||
161 | this.setData({ currentIndex }); | ||
162 | children.forEach((item, index) => { | ||
163 | const active = index === currentIndex; | ||
164 | if (active !== item.data.active || !item.inited) { | ||
165 | item.updateRender(active, this); | ||
166 | } | ||
167 | }); | ||
168 | wx.nextTick(() => { | ||
169 | this.setLine(); | ||
170 | this.setTrack(); | ||
171 | this.scrollIntoView(); | ||
172 | this.trigger('input'); | ||
173 | if (shouldEmitChange) { | ||
174 | this.trigger('change'); | ||
175 | } | ||
176 | }); | ||
133 | }, | 177 | }, |
134 | setActive(name) { | 178 | getCurrentName() { |
135 | if (name !== this.currentName) { | 179 | const activeTab = this.children[this.data.currentIndex]; |
136 | this.currentName = name; | 180 | if (activeTab) { |
137 | this.trigger('change', name); | 181 | return activeTab.getComputedName(); |
138 | this.setActiveTab(); | ||
139 | } | 182 | } |
140 | }, | 183 | }, |
141 | setLine(skipTransition) { | 184 | setLine(skipTransition) { |
... | @@ -143,8 +186,11 @@ VantComponent({ | ... | @@ -143,8 +186,11 @@ VantComponent({ |
143 | return; | 186 | return; |
144 | } | 187 | } |
145 | const { color, duration, currentIndex, lineWidth, lineHeight } = this.data; | 188 | const { color, duration, currentIndex, lineWidth, lineHeight } = this.data; |
146 | this.getRect('.van-tab', true).then((rects) => { | 189 | this.getRect('.van-tab', true).then((rects = []) => { |
147 | const rect = rects[currentIndex]; | 190 | const rect = rects[currentIndex]; |
191 | if (rect == null) { | ||
192 | return; | ||
193 | } | ||
148 | const width = lineWidth !== -1 ? lineWidth : rect.width / 2; | 194 | const width = lineWidth !== -1 ? lineWidth : rect.width / 2; |
149 | const height = lineHeight !== -1 | 195 | const height = lineHeight !== -1 |
150 | ? `height: ${addUnit(lineHeight)}; border-radius: ${addUnit(lineHeight)};` | 196 | ? `height: ${addUnit(lineHeight)}; border-radius: ${addUnit(lineHeight)};` |
... | @@ -170,51 +216,13 @@ VantComponent({ | ... | @@ -170,51 +216,13 @@ VantComponent({ |
170 | }, | 216 | }, |
171 | setTrack() { | 217 | setTrack() { |
172 | const { animated, duration, currentIndex } = this.data; | 218 | const { animated, duration, currentIndex } = this.data; |
173 | if (!animated) | ||
174 | return ''; | ||
175 | this.getRect('.van-tabs__content').then((rect) => { | ||
176 | const { width } = rect; | ||
177 | this.setData({ | 219 | this.setData({ |
178 | trackStyle: ` | 220 | trackStyle: ` |
179 | width: ${width * this.children.length}px; | 221 | transform: translate3d(${-100 * currentIndex}%, 0, 0); |
180 | left: ${-1 * currentIndex * width}px; | 222 | -webkit-transition-duration: ${animated ? duration : 0}s; |
181 | transition: left ${duration}s; | 223 | transition-duration: ${animated ? duration : 0}s; |
182 | display: -webkit-box; | ||
183 | display: flex; | ||
184 | ` | 224 | ` |
185 | }); | 225 | }); |
186 | const data = { width, animated }; | ||
187 | this.children.forEach((item) => { | ||
188 | item.setData(data); | ||
189 | }); | ||
190 | }); | ||
191 | }, | ||
192 | setActiveTab() { | ||
193 | if (!isDef(this.currentName)) { | ||
194 | const { active } = this.data; | ||
195 | const { children = [] } = this; | ||
196 | this.currentName = | ||
197 | active === '' && children.length | ||
198 | ? children[0].getComputedName() | ||
199 | : active; | ||
200 | } | ||
201 | this.children.forEach((item, index) => { | ||
202 | const data = { | ||
203 | active: item.getComputedName() === this.currentName | ||
204 | }; | ||
205 | if (data.active) { | ||
206 | this.setData({ currentIndex: index }); | ||
207 | data.inited = true; | ||
208 | } | ||
209 | if (data.active !== item.data.active) { | ||
210 | item.setData(data); | ||
211 | } | ||
212 | }); | ||
213 | nextTick(() => { | ||
214 | this.setLine(); | ||
215 | this.setTrack(); | ||
216 | this.scrollIntoView(); | ||
217 | }); | ||
218 | }, | 226 | }, |
219 | // scroll active tab into view | 227 | // scroll active tab into view |
220 | scrollIntoView() { | 228 | scrollIntoView() { |
... | @@ -235,6 +243,9 @@ VantComponent({ | ... | @@ -235,6 +243,9 @@ VantComponent({ |
235 | }); | 243 | }); |
236 | }); | 244 | }); |
237 | }, | 245 | }, |
246 | onTouchScroll(event) { | ||
247 | this.$emit('scroll', event.detail); | ||
248 | }, | ||
238 | onTouchStart(event) { | 249 | onTouchStart(event) { |
239 | if (!this.data.swipeable) | 250 | if (!this.data.swipeable) |
240 | return; | 251 | return; |
... | @@ -254,12 +265,10 @@ VantComponent({ | ... | @@ -254,12 +265,10 @@ VantComponent({ |
254 | const minSwipeDistance = 50; | 265 | const minSwipeDistance = 50; |
255 | if (direction === 'horizontal' && offsetX >= minSwipeDistance) { | 266 | if (direction === 'horizontal' && offsetX >= minSwipeDistance) { |
256 | if (deltaX > 0 && currentIndex !== 0) { | 267 | if (deltaX > 0 && currentIndex !== 0) { |
257 | const child = this.children[currentIndex - 1]; | 268 | this.setCurrentIndex(currentIndex - 1); |
258 | this.setActive(child.getComputedName()); | ||
259 | } | 269 | } |
260 | else if (deltaX < 0 && currentIndex !== tabs.length - 1) { | 270 | else if (deltaX < 0 && currentIndex !== tabs.length - 1) { |
261 | const child = this.children[currentIndex - 1]; | 271 | this.setCurrentIndex(currentIndex + 1); |
262 | this.setActive(child.getComputedName()); | ||
263 | } | 272 | } |
264 | } | 273 | } |
265 | } | 274 | } | ... | ... |
1 | <wxs src="../wxs/utils.wxs" module="utils" /> | 1 | <wxs src="../wxs/utils.wxs" module="utils" /> |
2 | <wxs src="./index.wxs" module="getters" /> | ||
2 | 3 | ||
3 | <view class="custom-class {{ utils.bem('tabs', [type]) }}"> | 4 | <view class="custom-class {{ utils.bem('tabs', [type]) }}"> |
4 | <van-sticky disabled="{{ !sticky }}" z-index="{{ zIndex }}" offset-top="{{ offsetTop }}"> | 5 | <van-sticky |
6 | disabled="{{ !sticky }}" | ||
7 | z-index="{{ zIndex }}" | ||
8 | offset-top="{{ offsetTop }}" | ||
9 | container="{{ container }}" | ||
10 | bind:scroll="onTouchScroll" | ||
11 | > | ||
5 | <view class="{{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'van-hairline--top-bottom' : '' }}"> | 12 | <view class="{{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'van-hairline--top-bottom' : '' }}"> |
6 | <slot name="nav-left" /> | 13 | <slot name="nav-left" /> |
7 | 14 | ||
... | @@ -18,11 +25,11 @@ | ... | @@ -18,11 +25,11 @@ |
18 | wx:for="{{ tabs }}" | 25 | wx:for="{{ tabs }}" |
19 | wx:key="index" | 26 | wx:key="index" |
20 | data-index="{{ index }}" | 27 | data-index="{{ index }}" |
21 | class="van-ellipsis tab-class {{ index === currentIndex ? 'tab-active-class' : '' }} {{ utils.bem('tab', { active: index === currentIndex, disabled: item.disabled }) }}" | 28 | class="{{ getters.tabClass(index === currentIndex, ellipsis) }} {{ utils.bem('tab', { active: index === currentIndex, disabled: item.disabled, complete: !ellipsis }) }}" |
22 | style="{{ color && index !== currentIndex && type === 'card' && !item.disabled ? 'color: ' + color : '' }} {{ color && index === currentIndex && type === 'card' ? ';background-color:' + color : '' }} {{ color ? ';border-color: ' + color : '' }} {{ scrollable ? ';flex-basis:' + (88 / swipeThreshold) + '%' : '' }}" | 29 | style="{{ getters.tabStyle(index === currentIndex, ellipsis, color, type, item.disabled, titleActiveColor, titleInactiveColor, swipeThreshold, scrollable) }}" |
23 | bind:tap="onTap" | 30 | bind:tap="onTap" |
24 | > | 31 | > |
25 | <view class="van-ellipsis" style="{{ item.titleStyle }}"> | 32 | <view class="{{ ellipsis ? 'van-ellipsis' : '' }}" style="{{ item.titleStyle }}"> |
26 | {{ item.title }} | 33 | {{ item.title }} |
27 | <van-info | 34 | <van-info |
28 | wx:if="{{ item.info !== null || item.dot }}" | 35 | wx:if="{{ item.info !== null || item.dot }}" | ... | ... |
src/ui/vant-weapp/tabs/index.wxs
0 → 100755
1 | /* eslint-disable */ | ||
2 | function tabClass(active, ellipsis) { | ||
3 | var classes = ['tab-class']; | ||
4 | |||
5 | if (active) { | ||
6 | classes.push('tab-active-class'); | ||
7 | } | ||
8 | |||
9 | if (ellipsis) { | ||
10 | classes.push('van-ellipsis'); | ||
11 | } | ||
12 | |||
13 | return classes.join(' '); | ||
14 | } | ||
15 | |||
16 | function tabStyle( | ||
17 | active, | ||
18 | ellipsis, | ||
19 | color, | ||
20 | type, | ||
21 | disabled, | ||
22 | activeColor, | ||
23 | inactiveColor, | ||
24 | swipeThreshold, | ||
25 | scrollable | ||
26 | ) { | ||
27 | var styles = []; | ||
28 | var isCard = type === 'card'; | ||
29 | // card theme color | ||
30 | if (color && isCard) { | ||
31 | styles.push('border-color:' + color); | ||
32 | |||
33 | if (!disabled) { | ||
34 | if (active) { | ||
35 | styles.push('background-color:' + color); | ||
36 | } else { | ||
37 | styles.push('color:' + color); | ||
38 | } | ||
39 | } | ||
40 | } | ||
41 | |||
42 | var titleColor = active ? activeColor : inactiveColor; | ||
43 | if (titleColor) { | ||
44 | styles.push('color:' + titleColor); | ||
45 | } | ||
46 | |||
47 | if (scrollable && ellipsis) { | ||
48 | styles.push('flex-basis:' + 88 / swipeThreshold + '%'); | ||
49 | } | ||
50 | |||
51 | return styles.join(';'); | ||
52 | } | ||
53 | |||
54 | module.exports.tabClass = tabClass; | ||
55 | module.exports.tabStyle = tabStyle; |
1 | @import '../common/index.wxss';.van-tabs{position:relative;-webkit-tap-highlight-color:transparent}.van-tabs__wrap{display:-webkit-flex;display:flex;overflow:hidden}.van-tabs__wrap--scrollable .van-tab{-webkit-flex:0 0 22%;flex:0 0 22%}.van-tabs__scroll{background-color:#fff;background-color:var(--tabs-nav-background-color,#fff)}.van-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.van-tabs__scroll--card{margin:0 16px;margin:0 var(--padding-md,16px)}.van-tabs__nav{position:relative;display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none}.van-tabs__nav--card{box-sizing:border-box;height:30px;height:var(--tabs-card-height,30px);border:1px solid #ee0a24;border:var(--border-width-base,1px) solid var(--tabs-default-color,#ee0a24);border-radius:2px;border-radius:var(--border-radius-sm,2px)}.van-tabs__nav--card .van-tab{color:#ee0a24;color:var(--tabs-default-color,#ee0a24);line-height:28px;line-height:calc(var(--tabs-card-height, 30px) - 2*var(--border-width-base, 1px));border-right:1px solid #ee0a24;border-right:var(--border-width-base,1px) solid var(--tabs-default-color,#ee0a24)}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{color:#fff;color:var(--white,#fff);background-color:#ee0a24;background-color:var(--tabs-default-color,#ee0a24)}.van-tabs__nav--card .van-tab--disabled{color:#c8c9cc;color:var(--tab-disabled-text-color,#c8c9cc)}.van-tabs__line{position:absolute;bottom:0;left:0;z-index:1;height:3px;height:var(--tabs-bottom-bar-height,3px);border-radius:3px;border-radius:var(--tabs-bottom-bar-height,3px);background-color:#ee0a24;background-color:var(--tabs-bottom-bar-color,#ee0a24)}.van-tabs__track{position:relative}.van-tabs__content{overflow:hidden}.van-tabs--line .van-tabs__wrap{height:44px;height:var(--tabs-line-height,44px)}.van-tabs--card .van-tabs__wrap{height:30px;height:var(--tabs-card-height,30px)}.van-tab{position:relative;-webkit-flex:1;flex:1;box-sizing:border-box;min-width:0;padding:0 5px;text-align:center;cursor:pointer;color:#7d7e80;color:var(--tab-text-color,#7d7e80);font-size:14px;font-size:var(--tab-font-size,14px);line-height:44px;line-height:var(--tabs-line-height,44px)}.van-tab--active{font-weight:500;font-weight:var(--font-weight-bold,500);color:#323233;color:var(--tab-active-text-color,#323233)}.van-tab--disabled{color:#c8c9cc;color:var(--tab-disabled-text-color,#c8c9cc)}.van-tab__title__info{position:relative!important;top:-1px!important;display:inline-block;-webkit-transform:translateX(0)!important;transform:translateX(0)!important} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | @import '../common/index.wxss';.van-tabs{position:relative;-webkit-tap-highlight-color:transparent}.van-tabs__wrap{display:-webkit-flex;display:flex;overflow:hidden}.van-tabs__wrap--scrollable .van-tab{-webkit-flex:0 0 22%;flex:0 0 22%}.van-tabs__scroll{background-color:#fff;background-color:var(--tabs-nav-background-color,#fff)}.van-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.van-tabs__scroll--card{margin:0 16px;margin:0 var(--padding-md,16px)}.van-tabs__nav{position:relative;display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none}.van-tabs__nav--card{box-sizing:border-box;height:30px;height:var(--tabs-card-height,30px);border:1px solid #ee0a24;border:var(--border-width-base,1px) solid var(--tabs-default-color,#ee0a24);border-radius:2px;border-radius:var(--border-radius-sm,2px)}.van-tabs__nav--card .van-tab{color:#ee0a24;color:var(--tabs-default-color,#ee0a24);line-height:28px;line-height:calc(var(--tabs-card-height, 30px) - 2*var(--border-width-base, 1px));border-right:1px solid #ee0a24;border-right:var(--border-width-base,1px) solid var(--tabs-default-color,#ee0a24)}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{color:#fff;color:var(--white,#fff);background-color:#ee0a24;background-color:var(--tabs-default-color,#ee0a24)}.van-tabs__nav--card .van-tab--disabled{color:#c8c9cc;color:var(--tab-disabled-text-color,#c8c9cc)}.van-tabs__line{position:absolute;bottom:0;left:0;z-index:1;height:3px;height:var(--tabs-bottom-bar-height,3px);border-radius:3px;border-radius:var(--tabs-bottom-bar-height,3px);background-color:#ee0a24;background-color:var(--tabs-bottom-bar-color,#ee0a24)}.van-tabs__track{position:relative;display:-webkit-flex;display:flex;width:100%;height:100%;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform}.van-tabs__content{overflow:hidden}.van-tabs--line .van-tabs__wrap{height:44px;height:var(--tabs-line-height,44px)}.van-tabs--card .van-tabs__wrap{height:30px;height:var(--tabs-card-height,30px)}.van-tab{position:relative;-webkit-flex:1;flex:1;box-sizing:border-box;min-width:0;padding:0 5px;text-align:center;cursor:pointer;color:#7d7e80;color:var(--tab-text-color,#7d7e80);font-size:14px;font-size:var(--tab-font-size,14px);line-height:44px;line-height:var(--tabs-line-height,44px)}.van-tab--active{font-weight:500;font-weight:var(--font-weight-bold,500);color:#323233;color:var(--tab-active-text-color,#323233)}.van-tab--disabled{color:#c8c9cc;color:var(--tab-disabled-text-color,#c8c9cc)}.van-tab--complete{-webkit-flex:1 0 auto!important;flex:1 0 auto!important}.van-tab__title__info{position:relative!important;top:-1px!important;display:inline-block;-webkit-transform:translateX(0)!important;transform:translateX(0)!important} | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -4,6 +4,7 @@ import { addUnit } from '../common/utils'; | ... | @@ -4,6 +4,7 @@ import { addUnit } from '../common/utils'; |
4 | VantComponent({ | 4 | VantComponent({ |
5 | props: { | 5 | props: { |
6 | disabled: Boolean, | 6 | disabled: Boolean, |
7 | multiple: Boolean, | ||
7 | uploadText: String, | 8 | uploadText: String, |
8 | previewSize: { | 9 | previewSize: { |
9 | type: null, | 10 | type: null, |
... | @@ -77,12 +78,8 @@ VantComponent({ | ... | @@ -77,12 +78,8 @@ VantComponent({ |
77 | wx.chooseImage({ | 78 | wx.chooseImage({ |
78 | count: multiple ? (newMaxCount > 9 ? 9 : newMaxCount) : 1, | 79 | count: multiple ? (newMaxCount > 9 ? 9 : newMaxCount) : 1, |
79 | sourceType: capture, | 80 | sourceType: capture, |
80 | success: res => { | 81 | success: resolve, |
81 | resolve(res); | 82 | fail: reject |
82 | }, | ||
83 | fail: err => { | ||
84 | reject(err); | ||
85 | } | ||
86 | }); | 83 | }); |
87 | }); | 84 | }); |
88 | } | 85 | } |
... | @@ -91,16 +88,12 @@ VantComponent({ | ... | @@ -91,16 +88,12 @@ VantComponent({ |
91 | wx.chooseMessageFile({ | 88 | wx.chooseMessageFile({ |
92 | count: multiple ? newMaxCount : 1, | 89 | count: multiple ? newMaxCount : 1, |
93 | type: 'file', | 90 | type: 'file', |
94 | success(res) { | 91 | success: resolve, |
95 | resolve(res); | 92 | fail: reject |
96 | }, | ||
97 | fail: err => { | ||
98 | reject(err); | ||
99 | } | ||
100 | }); | 93 | }); |
101 | }); | 94 | }); |
102 | } | 95 | } |
103 | chooseFile.then(res => { | 96 | chooseFile.then((res) => { |
104 | const file = multiple ? res.tempFiles : res.tempFiles[0]; | 97 | const file = multiple ? res.tempFiles : res.tempFiles[0]; |
105 | // 检查文件大小 | 98 | // 检查文件大小 |
106 | if (file instanceof Array) { | 99 | if (file instanceof Array) { |
... | @@ -119,7 +112,7 @@ VantComponent({ | ... | @@ -119,7 +112,7 @@ VantComponent({ |
119 | this.$emit('before-read', { | 112 | this.$emit('before-read', { |
120 | file, | 113 | file, |
121 | name, | 114 | name, |
122 | callback: result => { | 115 | callback: (result) => { |
123 | if (result) { | 116 | if (result) { |
124 | // 开始上传 | 117 | // 开始上传 |
125 | this.$emit('after-read', { file, name }); | 118 | this.$emit('after-read', { file, name }); | ... | ... |
-
Please register or sign in to post a comment