forked from wux-weapp/wux-weapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
优化 toptips、dialog、xnumber 组件,增加 seats 组件
- Loading branch information
Showing
31 changed files
with
1,733 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
## seats(id, options) | ||
座位图 | ||
|
||
| 参数 | 类型 | 描述 | | ||
| --- | --- | --- | | ||
| id | <code>string</code> | 唯一标识 | | ||
| options | <code>object</code> | 配置项 | | ||
| options.maps | <code>array</code> | 座位图 | | ||
| options.max | <code>number</code> | 勾选最大值 | | ||
| options.maxRowIndex | <code>number</code> | 最大行数 | | ||
| options.maxColumnIndex | <code>number</code> | 最大列数 | | ||
| options.onSelect | <code>function</code> | 监听选中时的回调函数 | | ||
|
||
**Example** | ||
```html | ||
<import src="../../components/seats/seats.wxml"/> | ||
|
||
<view class="seats-ticket"> | ||
<view class="movie-info"> | ||
<view class="movie"> | ||
<view class="title">金刚狼3:殊死一战 | ||
<text class="sub hide">英语/2D</text> | ||
</view> | ||
<view class="time">今天3月5日(周日) 16:55</view> | ||
</view> | ||
</view> | ||
</view> | ||
|
||
<view class="seats-img"> | ||
<text class="seats-icon seats-available"></text> | ||
<text class="text">可选</text> | ||
<text class="seats-icon selected"></text> | ||
<text class="text">已选</text> | ||
<text class="seats-icon unavailable"></text> | ||
<text class="text">已售</text> | ||
<text class="seats-icon double"></text> | ||
<text class="text">情侣座</text> | ||
<view class="front">5号厅银幕</view> | ||
</view> | ||
|
||
<view class="seats-area"> | ||
<template is="seats" data="{{ ...$wux.seats.movie }}"/> | ||
</view> | ||
|
||
<view class="selected-seats"> | ||
<view class="info" wx:if="{{ !items.length }}">一次最多选5个座位</view> | ||
<view class="seat-wrap" wx:if="{{ !!items.length }}"> | ||
<view class="seat" data-id="{{ item.id }}" wx:for="{{ items }}" wx:key="">{{ item.label }}</view> | ||
</view> | ||
<view class="money">¥{{ total || '00.00' }}</view> | ||
</view> | ||
``` | ||
|
||
```js | ||
import data from './data' | ||
const App = getApp() | ||
|
||
Page({ | ||
data: {}, | ||
onLoad() { | ||
this.initSeats() | ||
}, | ||
initSeats() { | ||
const seatingPlan = data.msg.seatingPlan | ||
const maps = seatingPlan.ajaxSeatBeanList | ||
const maxRowIndex = seatingPlan.maxRowIndex | ||
const maxColumnIndex = seatingPlan.maxColumnIndex | ||
|
||
this.$wuxSeats = App.Wux().$wuxSeats.init('movie', { | ||
maps: maps, | ||
maxRowIndex: maxRowIndex, | ||
maxColumnIndex: maxColumnIndex, | ||
max: 5, | ||
onSelect(items) { | ||
console.log(items) | ||
|
||
this.page.setData({ | ||
items, | ||
total: (items.length * 20).toFixed(2) | ||
}) | ||
}, | ||
}) | ||
|
||
this.$wuxSeats.disabled([`4520200`]) | ||
}, | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.