Commit 2fc5e4a0 by ArronYR

first commit

parents
//app.js
import req from './utils/Request.js'
App({
onLaunch: function(options) {
this.options = options
// 请求配置
this.configReq()
// 用户登录
this.checkUserLogin()
},
onShow: function(options) {
wx.showShareMenu({
withShareTicket: true,
success: function(ret) {
console.log('shareTickets:', ret)
}
})
},
configReq() {
//配置baseUrl和拦截器,baseUrl例如 /api
req.baseUrl(this.globalData.apiPath).interceptor(res => {
console.log(res)
})
},
/**
* 用户资料授权
*/
checkUserLogin: function(callback) {
let _app = this
if (_app.globalData.userInfo == null) {
_app.requestWxLogin(function(res) {
typeof callback == "function" && callback()
})
} else {
console.log("用户已登录", _app.globalData.userInfo)
typeof callback == "function" && callback()
}
},
/**
* 请求微信授权登陆
*/
requestWxLogin: function(callback) {
let that = this
wx.login({
success: function(res) {
if (res.code) {
//发起网络请求
let wxcode = res.code
wx.getUserInfo({
withCredentials: true,
lang: 'zh_CN',
success: function(data) {
console.info("1成功获取用户返回数据", wxcode, data);
that.requestServerLogin(wxcode, data, callback)
},
fail: function() {
console.info("1授权失败返回数据");
// 显示提示弹窗
wx.showModal({
title: '授权失败',
content: '你的微信授权未开启,将无法使用小程序!',
success: function(res) {
if (res.confirm) {
wx.openSetting({
success: function(data) {
if (data && data.authSetting["scope.userInfo"] == true) {
wx.getUserInfo({
withCredentials: true,
success: function(data) {
console.info("3成功获取用户返回数据");
that.requestServerLogin(wxcode, data, callback)
},
fail: function() {
console.info("3授权失败返回数据");
}
});
}
},
fail: function() {
console.info("设置失败返回数据");
}
});
} else if (res.cancel) {
console.log('用户坚持取消授权')
}
}
});
}
});
}
},
fail: function() {
console.info("登录失败返回数据");
}
});
},
/**
* 请求获取群id openGid 所需参数
*/
requestShareTicket: function(callback) {
let that = this
wx.login({
success: function(res) {
let wxcode = res.code
wx.getShareInfo({
shareTicket: that.options.shareTicket,
success: function(res) {
that.requestServerWithShareData(wxcode, {
encryptedData: res.encryptedData,
iv: res.iv
}, callback)
}
})
}
})
},
/**
* 请求服务器登陆
*/
requestServerLogin: function(wxcode, data, callback) {
let _app = this
req.post('user/login', {
code: wxcode,
signature: data.signature,
rawData: data.rawData,
encryptedData: data.encryptedData,
iv: data.iv,
scene: _app.options.query && _app.options.query.scene ? decodeURIComponent(_app.options.query.scene) : ''
}).then(res => res.data).then(res => {
if (!res.code) {
_app.globalData.userInfo = res.user
_app.globalData.token = res.token
typeof callback == "function" && callback(res.user)
}
if (_app.options.scene == 1044 && _app.options.shareTicket) {
_app.requestShareTicket(function(ret) {
console.log("Request Share Ticket", ret)
})
}
})
},
/**
* 请求服务器解析数据获取 openGid
*/
requestServerWithShareData(wxcode, data, callback) {
let _app = this
req.post('user/get_groupid', {
token: _app.globalData.token,
code: wxcode,
encryptedData: data.encryptedData,
iv: data.iv
}).then(res => res.data).then(res => {
typeof callback == "function" && callback(res)
})
},
globalData: {
userInfo: null,
token: '',
apiPath: "https://kt.imgondar.com/api/"
}
})
\ No newline at end of file
{
"pages": [
"pages/index/index",
"pages/webview/index",
"pages/auth/index",
"pages/search/index",
"pages/apply/index",
"pages/reserve/index",
"pages/me/index",
"pages/me/profile/index",
"pages/me/order/index",
"pages/me/vip/index",
"pages/me/collection/index",
"pages/guide/index",
"pages/guide/detail/index"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "black"
}
}
\ No newline at end of file
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
/* 用于收集 formid 的 button 样式 */
button.form-button {
background-color: transparent;
padding: 0;
margin: 0;
display: inline;
position: static;
border: 0;
padding-left: 0;
padding-right: 0;
border-radius: 0;
font-size: 0;
text-align: left;
line-height: normal;
}
button.form-button::after {
content: '';
width: 0;
height: 0;
-webkit-transform: scale(1);
transform: scale(1);
display: none;
background-color: transparent;
}
const Util = require('../utils/util.js')
const app = getApp()
module.exports = Behavior({
behaviors: [],
properties: {},
data: {},
attached: function () { },
methods: {
/**
* 获取手机号按钮回调事件
*/
__getPhoneNumber: function (event, callback) {
let that = this
wx.login({
success: function (res) {
let encryptedData = event.detail.encryptedData
let iv = event.detail.iv
that.__decodePhoneData(res.code, encryptedData, iv, function (res) {
typeof callback == "function" && callback(res)
})
}
})
},
/**
* 解密用户数据
*/
__decodePhoneData: function (code, encryptedData, iv, callback) {
let that = this
app.requestData('user/auth_phone', Util.sign({
token: app.globalData.token,
code: code,
encryptedData: encryptedData,
iv: iv
}), 'POST', function (res) {
if (!res.code) {
typeof callback == "function" && callback(res)
} else {
app.showToastWithImg('授权失败')
}
})
}
}
})
\ No newline at end of file
// components/banners/index.js
const Util = require('../../utils/util')
const formBehavior = require('../../behaviors/form.js')
const app = getApp()
Component({
behaviors: [formBehavior],
/**
* 组件的属性列表
*/
properties: {
api: {
type: String,
value: 'course/banners'
},
banners: {
type: Object,
}
},
/**
* 组件的初始数据
*/
data: {
banners: [],
indicatorDots: true,
autoplay: true,
interval: 5000,
duration: 1000
},
attached() {
// this._getBannerData()
},
/**
* 组件的方法列表
*/
methods: {
_tapBanner(event) {
let oid = event.currentTarget.dataset.oid
let type = event.currentTarget.dataset.type
let url = event.currentTarget.dataset.url
let type_text = event.currentTarget.dataset.txt
if (type == 1) {
wx.navigateTo({
url: '/pages/course/single/index?id=' + oid,
})
} else if (type == 2) {
wx.navigateTo({
url: '/pages/course/multiple/index?id=' + oid,
})
} else if (type == 3) {
wx.navigateTo({
url: '/pages/courses/coach/index?id=' + oid,
})
} else if (type == 4 && Util.isString(url)) {
wx.navigateTo({
url: '/pages/webview/index?url=' + url + '&t=' + type_text,
})
}
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--components/banners/index.wxml-->
<view class='banners-wrapper'>
<view class='banners-swipper'>
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{banners}}" wx:for-item="banner" wx:key="{{banner.id}}">
<swiper-item>
<view data-url="{{banner.url}}" data-type="{{banner.type}}" data-oid="{{banner.oid}}" data-txt="{{banner.type_text}}" catchtap='_tapBanner'>
<form bindsubmit="__collectFormId" report-submit='true'>
<button class='form-button' form-type='submit'>
<image src="{{banner.banner}}" class="banner-image" mode='aspectFill' />
</button>
</form>
</view>
</swiper-item>
</block>
</swiper>
</view>
</view>
\ No newline at end of file
/* components/banners/index.wxss */
@import "/styles/form.wxss";
.banners-wrapper {
width: 100%;
position: relative;
box-shadow: 0px 0px 15px #c6c6c6;
border-radius: 6px;
}
.banners-swipper {
width: 100%;
position: relative;
background: transparent;
border-radius: inherit;
overflow: hidden;
-webkit-transform: translateZ(0);
transform: translateZ(0);
-webkit-mask-image: -webkit-radial-gradient(circle, white 100%, black 100%);
}
.banner-image {
background: transparent;
width: 100%;
height: 150px;
}
Component({
externalClasses: ['i-class', 'i-class-mask', 'i-class-header'],
options: {
multipleSlots: true
},
properties: {
visible: {
type: Boolean,
value: false
},
maskClosable: {
type: Boolean,
value: true
},
showCancel: {
type: Boolean,
value: false
},
cancelText: {
type: String,
value: '取消'
},
actions: {
type: Array,
value: []
}
},
methods: {
handleClickMask () {
if (!this.data.maskClosable) return;
this.handleClickCancel();
},
handleClickItem ({ currentTarget = {} }) {
const dataset = currentTarget.dataset || {};
const { index } = dataset;
this.triggerEvent('click', { index });
},
handleClickCancel () {
this.triggerEvent('cancel');
}
}
});
{
"component": true,
"usingComponents":
{
"i-button": "../button/index",
"i-icon": "../icon/index"
}
}
<view class="i-as-mask i-class-mask {{ visible ? 'i-as-mask-show' : '' }}" bindtap="handleClickMask"></view>
<view class="i-class i-as {{ visible ? 'i-as-show' : '' }}">
<view class="i-as-header i-class-header"><slot name="header"></slot></view>
<view class="i-as-actions">
<view class="i-as-action-item" wx:for="{{ actions }}" wx:key="{{ item.name }}">
<i-button
bind:click="handleClickItem"
data-index="{{ index }}"
open-type="{{ item.openType }}"
type="ghost"
size="large"
long
>
<view class="i-as-btn-loading" wx:if="{{ item.loading }}"></view>
<i-icon wx:if="{{ item.icon }}" type="{{ item.icon }}" i-class="i-as-btn-icon"></i-icon>
<view class="i-as-btn-text" style="{{ item.color ? 'color: ' + item.color : '' }}">{{ item.name }}</view>
</i-button>
</view>
</view>
<view class="i-as-cancel" wx:if="{{ showCancel }}">
<i-button i-class="i-as-cancel-btn" type="ghost" size="large" long="true" bind:click="handleClickCancel">{{ cancelText }}</i-button>
</view>
</view>
.i-as{position:fixed;width:100%;box-sizing:border-box;left:0;right:0;bottom:0;background:#f7f7f7;transform:translate3d(0,100%,0);transform-origin:center;transition:all .2s ease-in-out;z-index:900;visibility:hidden}.i-as-show{transform:translate3d(0,0,0);visibility:visible}.i-as-mask{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.7);z-index:900;transition:all .2s ease-in-out;opacity:0;visibility:hidden}.i-as-mask-show{opacity:1;visibility:visible}.i-as-action-item{position:relative}.i-as-action-item::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px}.i-as-header{background:#fff;text-align:center;position:relative;font-size:12px;color:#80848f}.i-as-header::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px}.i-as-cancel{margin-top:6px}.i-as-btn-loading{display:inline-block;vertical-align:middle;margin-right:10px;width:12px;height:12px;background:0 0;border-radius:50%;border:2px solid #e5e5e5;border-color:#666 #e5e5e5 #e5e5e5 #e5e5e5;animation:btn-spin .6s linear;animation-iteration-count:infinite}.i-as-btn-text{display:inline-block;vertical-align:middle}.i-as-btn-icon{font-size:14px!important;margin-right:4px}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
options: {
multipleSlots: true
},
properties: {
//info, success, warning, error
type: {
type: String,
value: 'info'
},
closable: {
type: Boolean,
value: false
},
showIcon: {
type: Boolean,
default: false
},
desc: {
type: Boolean,
default: false
},
},
data: {
closed: false
},
methods: {
handleTap() {
this.setData({
closed: !this.data.closed,
});
this.triggerEvent('close');
},
}
});
{
"component": true,
"usingComponents":
{
"i-icon": "../icon/index"
}
}
<view class="i-class i-alert {{'i-alert-'+type}} {{showIcon?'i-alert-with-icon':''}} {{desc?'i-alert-with-desc':''}}" wx:if="{{!closed}}">
<view wx:if="{{ showIcon }}" class="i-alert-icon">
<i-icon type="prompt" wx:if="{{ type === 'info' }}" size="{{desc?24:16}}"></i-icon>
<i-icon type="success" wx:if="{{ type === 'success' }}" size="{{desc?24:16}}"></i-icon>
<i-icon type="warning" wx:if="{{ type === 'warning' }}" size="{{desc?24:16}}"></i-icon>
<i-icon type="delete" wx:if="{{ type === 'error' }}" size="{{desc?24:16}}"></i-icon>
</view>
<slot></slot>
<view class="i-alert-desc">
<slot name="desc"></slot>
</view>
<view class="i-alert-close" wx:if="{{ closable }}" bindtap="handleTap">
<i-icon type="close"></i-icon>
</view>
</view>
.i-alert{position:relative;margin:10px;padding:8px 48px 8px 16px;font-size:14px;border-radius:2px;color:#fff;background:#f7f7f7;color:#495060}.i-alert.i-alert-with-icon{padding:8px 48px 8px 38px}.i-alert-info{color:#fff;background:#2db7f5}.i-alert-success{color:#fff;background:#19be6b}.i-alert-warning{color:#fff;background:#f90}.i-alert-error{color:#fff;background:#ed3f14}.i-alert-icon{position:absolute;top:9px;left:16px;font-size:14px}.i-alert-desc{font-size:12px}.i-alert-with-desc{padding:16px;position:relative}.i-alert-with-desc.i-alert-with-icon{padding:16px 16px 16px 69px}.i-alert-with-desc .i-alert-icon{top:50%;left:24px;margin-top:-21px;font-size:28px}.i-alert-close{font-size:12px;position:absolute;right:16px;top:8px;overflow:hidden;cursor:pointer}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
properties: {
// circle || square
shape: {
type: String,
value: 'circle'
},
// small || large || default
size: {
type: String,
value: 'default'
},
src: {
type: String,
value: ''
}
}
});
{
"component": true
}
<view class="i-class i-avatar i-avatar-{{ shape }} i-avatar-{{ size }} {{ src ? 'i-avatar-image' : '' }}">
<image src="{{ src }}" wx:if="{{ src !== '' }}"></image>
<view class="i-avatar-string" wx:else><slot></slot></view>
</view>
\ No newline at end of file
.i-avatar{display:inline-block;text-align:center;background:#ccc;color:#fff;white-space:nowrap;position:relative;overflow:hidden;vertical-align:middle;width:32px;height:32px;line-height:32px;border-radius:16px;font-size:18px}.i-avatar .ivu-avatar-string{line-height:32px}.i-avatar-large{width:40px;height:40px;line-height:40px;border-radius:20px;font-size:24px}.i-avatar-large .ivu-avatar-string{line-height:40px}.i-avatar-small{width:24px;height:24px;line-height:24px;border-radius:12px;font-size:14px}.i-avatar-small .ivu-avatar-string{line-height:24px}.i-avatar-image{background:0 0}.i-avatar-square{border-radius:4px}.i-avatar>image{width:100%;height:100%}
\ No newline at end of file
Component({
externalClasses: ['i-class', 'i-class-alone'],
properties: {
count: {
type: Number,
value: 0,
observer: 'finalCount'
},
overflowCount: {
type: Number,
value: 99
},
dot: {
type: Boolean,
value: false
},
},
data: {
finalCount: 0
},
methods: {
finalCount() {
this.setData({
finalCount: parseInt(this.data.count) >= parseInt(this.data.overflowCount) ? `${this.data.overflowCount}+` : this.data.count
});
},
}
});
{
"component": true
}
<view class="i-class i-badge">
<slot></slot>
<view class="i-badge-dot" wx:if="{{ dot }}"></view>
<view class="i-badge-count i-class-alone" wx:elif="{{ count !== 0 }}">{{ finalCount }}</view>
</view>
.i-badge{position:relative;display:inline-block;line-height:1;vertical-align:middle}.i-badge-count{position:absolute;transform:translateX(50%);top:-6px;right:0;height:18px;border-radius:9px;min-width:18px;background:#ed3f14;border:1px solid transparent;color:#fff;line-height:18px;text-align:center;padding:0 5px;font-size:12px;white-space:nowrap;transform-origin:-10% center;z-index:10;box-shadow:0 0 0 1px #fff;box-sizing:border-box;text-rendering:optimizeLegibility}.i-badge-count-alone{top:auto;display:block;position:relative;transform:translateX(0)}.i-badge-dot{position:absolute;transform:translateX(-50%);transform-origin:0 center;top:-4px;right:-8px;height:8px;width:8px;border-radius:100%;background:#ed3f14;z-index:10;box-shadow:0 0 0 1px #fff}
\ No newline at end of file
function getCtx (selector) {
const pages = getCurrentPages();
const ctx = pages[pages.length - 1];
const componentCtx = ctx.selectComponent(selector);
if (!componentCtx) {
console.error('无法找到对应的组件,请按文档说明使用组件');
return null;
}
return componentCtx;
}
function Toast(options) {
const { selector = '#toast' } = options;
const ctx = getCtx(selector);
ctx.handleShow(options);
}
Toast.hide = function (selector = '#toast') {
const ctx = getCtx(selector);
ctx.handleHide();
};
function Message(options) {
const { selector = '#message' } = options;
const ctx = getCtx(selector);
ctx.handleShow(options);
}
module.exports = {
$Toast: Toast,
$Message: Message
};
\ No newline at end of file
Component({
externalClasses: ['i-class'],
properties: {
// default, primary, ghost, info, success, warning, error
type: {
type: String,
value: '',
},
inline: {
type: Boolean,
value: false
},
// default, large, small
size: {
type: String,
value: '',
},
// circle, square
shape: {
type: String,
value: 'square'
},
disabled: {
type: Boolean,
value: false,
},
loading: {
type: Boolean,
value: false,
},
long: {
type: Boolean,
value: false
},
openType: String,
appParameter: String,
hoverStopPropagation: Boolean,
hoverStartTime: {
type: Number,
value: 20
},
hoverStayTime: {
type: Number,
value: 70
},
lang: {
type: String,
value: 'en'
},
sessionFrom: {
type: String,
value: ''
},
sendMessageTitle: String,
sendMessagePath: String,
sendMessageImg: String,
showMessageCard: Boolean
},
methods: {
handleTap () {
if (this.data.disabled) return false;
this.triggerEvent('click');
},
bindgetuserinfo({ detail = {} } = {}) {
this.triggerEvent('getuserinfo', detail);
},
bindcontact({ detail = {} } = {}) {
this.triggerEvent('contact', detail);
},
bindgetphonenumber({ detail = {} } = {}) {
this.triggerEvent('getphonenumber', detail);
},
binderror({ detail = {} } = {}) {
this.triggerEvent('error', detail);
}
}
});
{
"component": true
}
<button
class="i-class i-btn {{ long ? 'i-btn-long' : '' }} {{ 'i-btn-' + size }} {{ 'i-btn-' + type }} {{ 'i-btn-' + shape }} {{ loading ? 'i-btn-loading' : '' }} {{ disabled ? 'i-btn-disabled' : ''}} {{ inline ? 'i-btn-inline' : '' }}"
hover-class="i-btn-hover"
bindtap="handleTap"
open-type="{{ openType }}"
app-parameter="{{ appParameter }}"
hover-stop-propagation="{{ hoverStopPropagation }}"
hover-start-time="{{ hoverStartTime }}"
hover-stay-time="{{ hoverStayTime }}"
session-from="{{ sessionFrom }}"
send-message-title="{{ sendMessageTitle }}"
send-message-path="{{ sendMessagePath }}"
send-message-img="{{ sendMessageImg }}"
show-message-card="{{ showMessageCard }}"
bindcontact="bindcontact"
bindgetuserinfo="bindgetuserinfo"
bindgetphonenumber="bindgetphonenumber"
binderror="binderror"
plain="true"
><view class="i-btn-loading-inner" wx:if="{{loading}}"></view><slot></slot></button>
\ No newline at end of file
.i-btn{text-align:center;vertical-align:middle;touch-action:manipulation;cursor:pointer;background-image:none;white-space:nowrap;user-select:none;font-size:14px;border-radius:2px;border:0!important;position:relative;text-decoration:none;height:44px;line-height:44px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);color:#fff!important;background:#f7f7f7!important;color:#495060!important;margin:10px}.i-btn-hover{opacity:.9}.i-btn-long{border-radius:0;margin:0;box-shadow:none}.i-btn-large{height:48px;line-height:48px}.i-btn-small{height:40px;line-height:40px}.i-btn-primary{color:#fff!important;background:#2d8cf0!important}.i-btn-ghost{color:#fff!important;background:#fff!important;color:#495060!important}.i-btn-success{color:#fff!important;background:#19be6b!important}.i-btn-warning{color:#fff!important;background:#f90!important}.i-btn-error{color:#fff!important;background:#ed3f14!important}.i-btn-info{color:#fff!important;background:#2db7f5!important}.i-btn-circle{border-radius:44px}.i-btn-large.i-btn-circle{border-radius:48px}.i-btn-small.i-btn-circle{border-radius:40px}.i-btn-loading{opacity:.6}.i-btn-loading-inner{display:inline-block;margin-right:12px;vertical-align:middle;width:14px;height:14px;background:0 0;border-radius:50%;border:2px solid #fff;border-color:#fff #fff #fff transparent;animation:btn-spin .6s linear;animation-iteration-count:infinite}.i-btn-disabled{color:#bbbec4!important;background:#f7f7f7!important}.i-btn-inline{display:inline-block}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
options: {
multipleSlots: true
},
properties: {
full: {
type: Boolean,
value: false
},
thumb: {
type: String,
value: ''
},
title: {
type: String,
value: ''
},
extra: {
type: String,
value: ''
}
}
});
{
"component": true
}
<view class="i-class i-card {{ full ? 'i-card-full' : '' }}">
<view class="i-class i-card-header">
<view class="i-card-header-content">
<image class="i-card-header-thumb" src="{{ thumb }}" mode="aspectFit" wx:if="{{ thumb }}" />
{{ title }}
</view>
<view class="i-card-header-extra" wx:if="{{ extra }}">{{ extra }}</view>
</view>
<view class="i-class i-card-body"><slot name="content"></slot></view>
<view class="i-class i-card-footer"><slot name="footer"></slot></view>
</view>
.i-card{margin:0 16px;font-size:14px;overflow:hidden;position:relative;background:#fff;border:1rpx solid #dddee1;border-radius:5px}.i-card-full{margin:0;border-left:none;border-right:none;border-radius:0}.i-card-header{display:flex;padding:6px 16px;align-items:center}.i-card-header-content{flex:1;text-align:left}.i-card-header-thumb{display:inline-block;width:64px;height:64px;position:relative;margin-left:auto;margin-right:auto;overflow:hidden;background-size:cover;vertical-align:middle}.i-card-header-title{display:inline-block;vertical-align:middle;font-size:14px;color:#1c2438}.i-card-header-extra{flex:1;text-align:right;font-size:14px;color:#80848f}.i-card-body{position:relative;padding:6px 16px;color:#495060;font-size:14px}.i-card-body::before{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-top-width:1px}.i-card-footer{position:relative;padding:6px 16px;color:#80848f;font-size:12px}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
relations: {
'../cell/index': {
type: 'child',
linked () {
this._updateIsLastCell();
},
linkChanged () {
this._updateIsLastCell();
},
unlinked () {
this._updateIsLastCell();
}
}
},
methods: {
_updateIsLastCell() {
let cells = this.getRelationNodes('../cell/index');
const len = cells.length;
if (len > 0) {
let lastIndex = len - 1;
cells.forEach((cell, index) => {
cell.updateIsLastCell(index === lastIndex);
});
}
}
}
});
{
"component": true
}
<view class="i-class i-cell-group">
<slot></slot>
</view>
\ No newline at end of file
const warn = (msg, getValue) => {
console.warn(msg);
console.log('接受到的值为:', getValue);
};
Component({
externalClasses: ['i-class'],
options: {
multipleSlots: true
},
relations: {
'../cell-group/index': {
type: 'parent'
}
},
properties: {
// 左侧标题
title: {
type: String
},
// 标题下方的描述信息
label: {
type: String
},
// 右侧内容
value: {
type: String
},
// 只有点击 footer 区域才触发 tab 事件
onlyTapFooter: {
type: Boolean
},
// 是否展示右侧箭头并开启尝试以 url 跳转
isLink: {
type: null,
value: ''
},
// 链接类型,可选值为 navigateTo,redirectTo,switchTab,reLaunch
linkType: {
type: String,
value: 'navigateTo'
},
url: {
type: String,
value: ''
}
},
data: {
isLastCell: true
},
methods: {
navigateTo () {
const { url } = this.data;
const type = typeof this.data.isLink;
this.triggerEvent('click', {});
if (!this.data.isLink || !url || url === 'true' || url === 'false') return;
if (type !== 'boolean' && type !== 'string') {
warn('isLink 属性值必须是一个字符串或布尔值', this.data.isLink);
return;
}
if (['navigateTo', 'redirectTo', 'switchTab', 'reLaunch'].indexOf(this.data.linkType) === -1) {
warn('linkType 属性可选值为 navigateTo,redirectTo,switchTab,reLaunch', this.data.linkType);
return;
}
wx[this.data.linkType].call(wx, {url});
},
handleTap () {
if (!this.data.onlyTapFooter) {
this.navigateTo();
}
},
updateIsLastCell (isLastCell) {
this.setData({ isLastCell });
}
}
});
{
"component": true
}
<view bindtap="handleTap" class="i-class i-cell {{ isLastCell ? 'i-cell-last' : '' }} {{ isLink ? 'i-cell-access' : '' }}">
<view class="i-cell-icon">
<slot name="icon"></slot>
</view>
<view class="i-cell-bd">
<view wx:if="{{ title }}" class="i-cell-text">{{ title }}</view>
<view wx:if="{{ label }}" class="i-cell-desc">{{ label }}</view>
<slot></slot>
</view>
<view catchtap="navigateTo" class="i-cell-ft">
<block wx:if="{{value}}">{{ value }}</block>
<block wx:else>
<slot name="footer"></slot>
</block>
</view>
</view>
\ No newline at end of file
.i-cell{position:relative;padding:12px 15px;display:flex;background:#fff;align-items:center;line-height:1.4;font-size:14px;overflow:hidden}.i-cell::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px;left:15px;right:0}.i-cell-last::after{display:none}.i-cell-icon{margin-right:5px}.i-cell-icon:empty{display:none}.i-cell-bd{flex:1}.i-cell-text{line-height:24px;font-size:14px}.i-cell-desc{line-height:1.2;font-size:12px;color:#80848f}.i-cell-ft{position:relative;text-align:right;color:#495060}.i-cell-access .i-cell-ft{padding-right:13px}.i-cell-access .i-cell-ft::after{content:" ";display:inline-block;width:6px;height:6px;position:absolute;top:50%;right:2px;border-width:2px 2px 0 0;border-color:#dddee1;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
relations: {
'../checkbox/index': {
type: 'child',
linked() {
this.changeCurrent();
},
linkChanged() {
this.changeCurrent();
},
unlinked() {
this.changeCurrent();
}
}
},
properties: {
current: {
type: Array,
value: [],
observer: 'changeCurrent'
},
},
methods: {
changeCurrent(val = this.data.current) {
let items = this.getRelationNodes('../checkbox/index');
const len = items.length;
if (len > 0) {
items.forEach(item => {
item.changeCurrent(val.indexOf(item.data.value) !== -1);
});
}
},
emitEvent(current) {
this.triggerEvent('change', current);
}
}
});
{
"component": true,
"usingComponents":
{
"i-cell-group": "../cell-group/index"
}
}
<i-cell-group class="i-class">
<slot></slot>
</i-cell-group>
const prefixCls = 'i-checkbox';
Component({
externalClasses: ['i-class'],
relations: {
'../checkbox-group/index': {
type: 'parent'
}
},
properties: {
value: {
type: String,
value: ''
},
checked: {
type: Boolean,
value: false
},
disabled: {
type: Boolean,
value: false
},
color: {
type: String,
value: '#2d8cf0'
},
position: {
type: String,
value: 'left', //left right
observer: 'setPosition'
}
},
data: {
checked: true,
positionCls: `${prefixCls}-checkbox-left`,
},
attached() {
this.setPosition();
},
methods: {
changeCurrent(current) {
this.setData({ checked: current });
},
checkboxChange() {
if (this.data.disabled) return;
const item = { current: !this.data.checked, value: this.data.value };
const parent = this.getRelationNodes('../checkbox-group/index')[0];
parent ? parent.emitEvent(item) : this.triggerEvent('change', item);
},
setPosition() {
this.setData({
positionCls: this.data.position.indexOf('left') !== -1 ? `${prefixCls}-checkbox-left` : `${prefixCls}-checkbox-right`,
});
}
}
});
{
"component": true,
"usingComponents":
{
"i-cell": "../cell/index"
}
}
<view class="i-class i-checkbox" catchtap="checkboxChange">
<i-cell i-class="i-checkbox-cell">
<label>
<radio value="{{value}}" checked="{{checked}}" color="{{checked?color:''}}" disabled="{{disabled}}" class="i-checkbox-radio {{positionCls}}" />
<view class="i-checkbox-title">{{value}}</view>
</label>
</i-cell>
</view>
.i-checkbox-cell::after{display:block}.i-checkbox-checkbox-left{float:left}.i-checkbox-checkbox-right{float:right}.i-checkbox-radio{vertical-align:middle}.i-checkbox-title{display:inline-block;vertical-align:middle}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
relations: {
'../row/index': {
type: 'parent'
}
},
properties: {
span: {
value: 0,
type: Number
},
offset: {
value: 0,
type: Number
}
}
});
{
"component": true
}
\ No newline at end of file
<view class="i-class i-col {{ span ? 'i-col-span-' + span : '' }} {{ offset ? 'i-col-offset-' + offset : '' }}"><slot></slot></view>
\ No newline at end of file
.i-col{float:left;box-sizing:border-box;width:0}.i-col-span-1{display:block;width:4.16666667%}.i-col-offset-1{margin-left:4.16666667%}.i-col-span-2{display:block;width:8.33333333%}.i-col-offset-2{margin-left:8.33333333%}.i-col-span-3{display:block;width:12.5%}.i-col-offset-3{margin-left:12.5%}.i-col-span-4{display:block;width:16.66666667%}.i-col-offset-4{margin-left:16.66666667%}.i-col-span-5{display:block;width:20.83333333%}.i-col-offset-5{margin-left:20.83333333%}.i-col-span-6{display:block;width:25%}.i-col-offset-6{margin-left:25%}.i-col-span-7{display:block;width:29.16666667%}.i-col-offset-7{margin-left:29.16666667%}.i-col-span-8{display:block;width:33.33333333%}.i-col-offset-8{margin-left:33.33333333%}.i-col-span-9{display:block;width:37.5%}.i-col-offset-9{margin-left:37.5%}.i-col-span-10{display:block;width:41.66666667%}.i-col-offset-10{margin-left:41.66666667%}.i-col-span-11{display:block;width:45.83333333%}.i-col-offset-11{margin-left:45.83333333%}.i-col-span-12{display:block;width:50%}.i-col-offset-12{margin-left:50%}.i-col-span-13{display:block;width:54.16666667%}.i-col-offset-13{margin-left:54.16666667%}.i-col-span-14{display:block;width:58.33333333%}.i-col-offset-14{margin-left:58.33333333%}.i-col-span-15{display:block;width:62.5%}.i-col-offset-15{margin-left:62.5%}.i-col-span-16{display:block;width:66.66666667%}.i-col-offset-16{margin-left:66.66666667%}.i-col-span-17{display:block;width:70.83333333%}.i-col-offset-17{margin-left:70.83333333%}.i-col-span-18{display:block;width:75%}.i-col-offset-18{margin-left:75%}.i-col-span-19{display:block;width:79.16666667%}.i-col-offset-19{margin-left:79.16666667%}.i-col-span-20{display:block;width:83.33333333%}.i-col-offset-20{margin-left:83.33333333%}.i-col-span-21{display:block;width:87.5%}.i-col-offset-21{margin-left:87.5%}.i-col-span-22{display:block;width:91.66666667%}.i-col-offset-22{margin-left:91.66666667%}.i-col-span-23{display:block;width:95.83333333%}.i-col-offset-23{margin-left:95.83333333%}.i-col-span-24{display:block;width:100%}.i-col-offset-24{margin-left:100%}
\ No newline at end of file
Component({
externalClasses: ['i-class-content', 'i-class-title', 'i-class'],
relations: {
'../collapse/index': {
type: 'parent',
linked: function (target) {
const options = {
accordion: target.data.accordion
}
if (target.data.name === this.data.name) {
options.showContent = 'i-collapse-item-show-content';
}
this.setData(options);
}
}
},
properties: {
title: String,
name: String
},
data: {
showContent: '',
accordion: false
},
options: {
multipleSlots: true
},
methods: {
trigger(e) {
const data = this.data;
if (data.accordion) {
this.triggerEvent('collapse', {name: data.name}, {composed: true, bubbles: true});
} else {
this.setData({
showContent: data.showContent ? '' : 'i-collapse-item-show-content'
});
}
},
}
});
{
"component": true,
"usingComponents": {
"i-icon": "../icon/index"
}
}
<view id="{{name}}" class="i-class i-collapse-item ">
<view class="i-collapse-item-title-wrap" bindtap="trigger">
<i-icon size="16" type="enter" i-class="{{ showContent ? 'i-collapse-item-arrow-show' : 'i-collapse-item-arrow' }}"/>
<text class="i-collapse-item-title i-class-title">{{title}}</text>
</view>
<view class="i-collapse-item-content {{showContent}} i-class-content">
<slot name="content"></slot>
</view>
</view>
\ No newline at end of file
.i-collapse-item{padding:2px 8px;border-top:1px solid #dddee1}.i-collapse-item-title{vertical-align:middle}.i-collapse-item-title-wrap{padding:2px 0 0}.i-collapse-item-content{padding:6px;display:none}.i-collapse-item-show-content{display:block}.i-collapse-item-arrow{transition:transform .2s ease-in-out}.i-collapse-item-arrow-show{transition:transform .2s ease-in-out;transform:rotate(90deg)}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
relations: {
'../collapse-item/index': {
type: 'child'
}
},
properties: {
name: String,
accordion: Boolean
},
methods: {
clickfn(e) {
const params = e.detail;
const allList = this.getRelationNodes('../collapse-item/index');
allList.forEach((item) => {
if (params.name === item.data.name) {
item.setData({
showContent: 'i-collapse-item-show-content'
});
} else {
item.setData({
showContent: ''
});
}
});
},
}
});
{
"component": true
}
<view class="i-class i-collapse" bindcollapse="clickfn">
<slot></slot>
</view>
Component({
properties: {
target: Number,
showDay: Boolean,
callback: String,
format: Array,
clearTimer: Boolean
},
externalClasses: ['countdown-class'],
data: {
time: '',
resultFormat: [],
changeFormat: false
},
ready() {
this.getFormat();
},
methods: {
getFormat() {
const data = this.data;
const len = data.format.length;
if (!data.showDay) data.resultFormat.push('');
if (len >= 3) {
for (let i = 0; i < len; i++) {
if (data.resultFormat.length >= 4) break;
if (data.format[i]) {
data.resultFormat.push(data.format[i].toString());
}
}
if (data.resultFormat.length >= 4) data.changeFormat = true;
}
this.getLastTime();
},
init() {
const self = this;
setTimeout(function () {
self.getLastTime.call(self);
}, 1000);
},
getLastTime() {
const data = this.data;
const gapTime = Math.ceil((data.target - new Date().getTime()) / 1000);
let result = '';
let time = '00:00:00';
let day = '00';
const format = data.resultFormat;
if (gapTime > 0) {
day = this.formatNum(parseInt(gapTime / 86400));
let lastTime = gapTime % 86400;
const hour = this.formatNum(parseInt(lastTime / 3600));
lastTime = lastTime % 3600;
const minute = this.formatNum(parseInt(lastTime / 60));
const second = this.formatNum(lastTime % 60);
if (data.changeFormat) time = `${hour}${format[1]}${minute}${format[2]}${second}${format[3]}`;
else time = `${hour}:${minute}:${second}`;
if (!data.clearTimer) this.init.call(this);
} else {
this.endfn();
}
if (data.showDay) {
if (data.changeFormat) {
result = `${day}${format[0]} ${time}`;
} else {
result = `${day}d ${time}`;
}
} else {
result = time;
}
this.setData({
time: result
});
},
formatNum(num) {
return num > 9 ? num : `0${num}`;
},
endfn() {
this.triggerEvent('callback', {});
}
}
});
{
"component": true
}
<text class="countdown-class">
{{time}}
</text>
Component({
externalClasses: ['i-class'],
properties: {
content: {
type: String,
value: ''
},
height : {
type: Number,
value: 48
},
color : {
type : String,
value : '#80848f'
},
lineColor : {
type : String,
value : '#e9eaec'
},
size : {
type: String,
value: 12
}
}
});
{
"component": true
}
<view class="i-divider i-class" style="{{parse.getStyle(color,size,height)}}">
<view class="i-divider-content" wx:if="{{content !== ''}}">
{{content}}
</view>
<view class="i-divider-content" wx:else>
<slot></slot>
</view>
<view class="i-divider-line" style="background:{{lineColor}}"></view>
</view>
<wxs module="parse">
module.exports = {
getStyle : function(color,size,height){
var color = 'color:' + color +';';
var size = 'font-size:' + size + 'px;';
var height = 'height:' + height+'px;'
return color + size + height;
}
}
</wxs>
.i-divider{width:100%;text-align:center;font-size:12px;position:relative;display:flex;align-items:center;justify-content:center}.i-divider-line{position:absolute;left:0;width:100%;height:1rpx;background-color:#f7f7f7;top:50%}.i-divider-content{background:#fff;position:relative;z-index:1;display:inline-block;padding:0 10px}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
properties: {
visible: {
type: Boolean,
value: false
},
mask: {
type: Boolean,
value: true
},
maskClosable: {
type: Boolean,
value: true
},
mode: {
type: String,
value: 'left' // left right
}
},
data: {},
methods: {
handleMaskClick() {
if (!this.data.maskClosable) {
return;
}
this.triggerEvent('close', {});
}
}
});
{
"component": true
}
<view class="i-class i-drawer {{ visible ? 'i-drawer-show' : '' }} {{ 'i-drawer-' + mode }}">
<view wx:if="{{ mask }}" class="i-drawer-mask" bindtap="handleMaskClick"></view>
<view class="i-drawer-container">
<slot></slot>
</view>
</view>
.i-drawer{visibility:hidden}.i-drawer-show{visibility:visible}.i-drawer-show .i-drawer-mask{display:block;opacity:1}.i-drawer-show .i-drawer-container{opacity:1}.i-drawer-show.i-drawer-left .i-drawer-container,.i-drawer-show.i-drawer-right .i-drawer-container{transform:translate3d(0,-50%,0)}.i-drawer-mask{opacity:0;position:fixed;top:0;left:0;right:0;bottom:0;z-index:6;background:rgba(0,0,0,.6);transition:all .3s ease-in-out}.i-drawer-container{position:fixed;left:50%;top:50%;transform:translate3d(-50%,-50%,0);transform-origin:center;transition:all .3s ease-in-out;z-index:7;opacity:0}.i-drawer-left .i-drawer-container{left:0;top:50%;transform:translate3d(-100%,-50%,0)}.i-drawer-right .i-drawer-container{right:0;top:50%;left:auto;transform:translate3d(100%,-50%,0)}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
relations: {
'../grid-item/index': {
type: 'parent'
}
},
});
{
"component": true
}
<view class="i-class i-grid-icon"><slot></slot></view>
\ No newline at end of file
.i-grid-icon{display:block;width:28px;height:28px;margin:0 auto}.i-grid-icon image{width:100%;height:100%}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
relations: {
'../grid/index': {
type: 'parent'
},
'../grid-icon/index': {
type: 'child'
}
},
data: {
width: '33.33%'
}
});
{
"component": true
}
<view class="i-class i-grid-item" style="width: {{ width }}"><slot></slot></view>
\ No newline at end of file
.i-grid-item{position:relative;float:left;padding:20px 10px;width:33.33333333%;box-sizing:border-box;border-right:1rpx solid #e9eaec;border-bottom:1rpx solid #e9eaec}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
relations: {
'../grid-item/index': {
type: 'parent'
}
},
});
{
"component": true
}
<view class="i-class i-grid-label"><slot></slot></view>
\ No newline at end of file
.i-grid-label{margin-top:5px;display:block;text-align:center;color:#1c2438;font-size:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
relations: {
'../grid-item/index': {
type: 'child',
linked () {
this.setGridItemWidth();
},
linkChanged () {
this.setGridItemWidth();
},
unlinked () {
this.setGridItemWidth();
}
}
},
methods: {
setGridItemWidth () {
const nodes = this.getRelationNodes('../grid-item/index');
// const len = nodes.length;
// if (len < 3) {
// nodes.forEach(item => {
// item.setData({
// 'width': '33.33%'
// });
// });
// } else {
// const width = 100 / nodes.length;
// nodes.forEach(item => {
// item.setData({
// 'width': width + '%'
// });
// });
// }
const width = 100 / nodes.length;
nodes.forEach(item => {
item.setData({
'width': width + '%'
});
});
}
},
ready () {
this.setGridItemWidth();
}
});
{
"component": true
}
<view class="i-class i-grid"><slot></slot></view>
\ No newline at end of file
.i-grid{border-top:1rpx solid #e9eaec;border-left:1rpx solid #e9eaec;overflow:hidden}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
properties: {
type: {
type: String,
value: ''
},
custom: {
type: String,
value: ''
},
size: {
type: Number,
value: 14
},
color: {
type: String,
value: ''
}
}
});
{
"component": true
}
<view class="i-class i-icon {{ type === '' ? '' : 'i-icon-' + type }} {{ custom }}" style="font-size: {{ size }}px; {{ color ? 'color:' + color : '' }}"></view>
\ No newline at end of file
@font-face{font-family:iconfont;src:url('data:application/x-font-woff;charset=utf-8;base64,d09GRg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UmTJ3MS4J2mm5EZ7LfI4zFSry8RZpx9lrea1PYUSlTtluq+klFRMEX+ExwkVknoPQgc7q9mcSiGYdVrWbi455jMqq6Y1TLmJycAWVEqV85oYpn1Ae8KUyraRtZ8Y92ROFbOThuhV/40dP0lbbaT1TzO15tQHPf+PmOZMMNNfiMeTXNK2YrWZDcBfQr6tScWp/3xPIpZzI9UB4yZhlTzD/SU4GNqdTMXO8trIwx1yi2YFY3lG+nubDCwuBFk6KehQYo0uBV+WZn4MfahFK4S28bI6XCp7HYmz/vDSxtgM2Z8MbGa/zpaKCC8PbNEB5crLb0j3hMmKbTNpEx8KkjGROOtWxYKv/PqgQ5aud3Rt6VATQYeCinARd8ZfYGXLyXo07Ue/sLJVFnfG0UUlMy5YU8peSPeEoJKKRbUta7mZyqIQw65xT0JpSqamDaemVf1UT4JGkG3cGX9sh/oajTxOG0X40CceW8lWqRmkDh8qljc2Z8yr8Y6OFStsH5apYjYa30SRx3awLtSh6vIY2I6qA83qfLpfpOOeJNqu9QkNHUx0SfpYQgenunXvRL/NEzvqxp4Z6Q03tDzSW21Ytef+dF+JjM2JVEHXMvGuj2YdElz7DZOBxYZXfa46tDCK1FqQXYune0JosX1YnPVb2jqX4ZrnTCbOemc2RNW89jU/7kmkGVG0TPzgXqWmzawH5VLK3Icb61L6y/FukOOXJurS0DZRWxdS5IeFfUBqyvuyj+1rU0nbt9vR6F8KbDL8') format('woff')}.i-icon{display:inline-block;font-family:iconfont;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;text-rendering:auto;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:middle}.i-icon-accessory:before{content:"\e6dd"}.i-icon-activity:before{content:"\e6de"}.i-icon-activity_fill:before{content:"\e6df"}.i-icon-add:before{content:"\e6e0"}.i-icon-addressbook_fill:before{content:"\e6e2"}.i-icon-addressbook:before{content:"\e6e3"}.i-icon-barrage_fill:before{content:"\e6e4"}.i-icon-barrage:before{content:"\e6e5"}.i-icon-browse_fill:before{content:"\e6e6"}.i-icon-browse:before{content:"\e6e7"}.i-icon-brush:before{content:"\e6e8"}.i-icon-brush_fill:before{content:"\e6e9"}.i-icon-businesscard_fill:before{content:"\e6ea"}.i-icon-businesscard:before{content:"\e6eb"}.i-icon-camera_fill:before{content:"\e6ec"}.i-icon-camera:before{content:"\e6ed"}.i-icon-clock_fill:before{content:"\e6ee"}.i-icon-clock:before{content:"\e6ef"}.i-icon-close:before{content:"\e6f0"}.i-icon-collection_fill:before{content:"\e6f1"}.i-icon-collection:before{content:"\e6f2"}.i-icon-computer_fill:before{content:"\e6f3"}.i-icon-computer:before{content:"\e6f4"}.i-icon-coordinates_fill:before{content:"\e6f5"}.i-icon-coordinates:before{content:"\e6f6"}.i-icon-coupons_fill:before{content:"\e6f7"}.i-icon-coupons:before{content:"\e6f8"}.i-icon-createtask_fill:before{content:"\e6f9"}.i-icon-createtask:before{content:"\e6fa"}.i-icon-customerservice_fill:before{content:"\e6fb"}.i-icon-customerservice:before{content:"\e6fc"}.i-icon-delete_fill:before{content:"\e6fd"}.i-icon-delete:before{content:"\e6fe"}.i-icon-document:before{content:"\e6ff"}.i-icon-document_fill:before{content:"\e700"}.i-icon-dynamic_fill:before{content:"\e701"}.i-icon-dynamic:before{content:"\e702"}.i-icon-editor:before{content:"\e703"}.i-icon-eit:before{content:"\e704"}.i-icon-emoji_fill:before{content:"\e705"}.i-icon-emoji:before{content:"\e706"}.i-icon-enter:before{content:"\e707"}.i-icon-enterinto:before{content:"\e708"}.i-icon-enterinto_fill:before{content:"\e709"}.i-icon-feedback_fill:before{content:"\e70a"}.i-icon-feedback:before{content:"\e70b"}.i-icon-flag_fill:before{content:"\e70c"}.i-icon-flag:before{content:"\e70d"}.i-icon-flashlight:before{content:"\e70e"}.i-icon-flashlight_fill:before{content:"\e70f"}.i-icon-fullscreen:before{content:"\e710"}.i-icon-group:before{content:"\e711"}.i-icon-group_fill:before{content:"\e712"}.i-icon-homepage_fill:before{content:"\e713"}.i-icon-homepage:before{content:"\e714"}.i-icon-integral_fill:before{content:"\e715"}.i-icon-integral:before{content:"\e716"}.i-icon-interactive_fill:before{content:"\e717"}.i-icon-interactive:before{content:"\e718"}.i-icon-keyboard:before{content:"\e719"}.i-icon-label:before{content:"\e71a"}.i-icon-label_fill:before{content:"\e71b"}.i-icon-like_fill:before{content:"\e71c"}.i-icon-like:before{content:"\e71d"}.i-icon-live_fill:before{content:"\e71e"}.i-icon-live:before{content:"\e71f"}.i-icon-lock_fill:before{content:"\e720"}.i-icon-lock:before{content:"\e721"}.i-icon-mail:before{content:"\e722"}.i-icon-mail_fill:before{content:"\e723"}.i-icon-message:before{content:"\e724"}.i-icon-message_fill:before{content:"\e725"}.i-icon-mine:before{content:"\e726"}.i-icon-mine_fill:before{content:"\e727"}.i-icon-mobilephone_fill:before{content:"\e728"}.i-icon-mobilephone:before{content:"\e729"}.i-icon-more:before{content:"\e72a"}.i-icon-narrow:before{content:"\e72b"}.i-icon-offline_fill:before{content:"\e72c"}.i-icon-offline:before{content:"\e72d"}.i-icon-other:before{content:"\e72e"}.i-icon-picture_fill:before{content:"\e72f"}.i-icon-picture:before{content:"\e730"}.i-icon-play:before{content:"\e731"}.i-icon-play_fill:before{content:"\e732"}.i-icon-playon_fill:before{content:"\e733"}.i-icon-playon:before{content:"\e734"}.i-icon-praise_fill:before{content:"\e735"}.i-icon-praise:before{content:"\e736"}.i-icon-prompt_fill:before{content:"\e737"}.i-icon-prompt:before{content:"\e738"}.i-icon-redpacket_fill:before{content:"\e739"}.i-icon-redpacket:before{content:"\e73a"}.i-icon-refresh:before{content:"\e73b"}.i-icon-remind_fill:before{content:"\e73c"}.i-icon-remind:before{content:"\e73d"}.i-icon-return:before{content:"\e73e"}.i-icon-right:before{content:"\e73f"}.i-icon-scan:before{content:"\e740"}.i-icon-send:before{content:"\e741"}.i-icon-service_fill:before{content:"\e742"}.i-icon-service:before{content:"\e743"}.i-icon-setup_fill:before{content:"\e744"}.i-icon-setup:before{content:"\e745"}.i-icon-share_fill:before{content:"\e746"}.i-icon-share:before{content:"\e747"}.i-icon-success_fill:before{content:"\e748"}.i-icon-success:before{content:"\e749"}.i-icon-suspend:before{content:"\e74a"}.i-icon-switch:before{content:"\e74b"}.i-icon-systemprompt_fill:before{content:"\e74c"}.i-icon-systemprompt:before{content:"\e74d"}.i-icon-tailor:before{content:"\e74e"}.i-icon-task:before{content:"\e74f"}.i-icon-task_fill:before{content:"\e750"}.i-icon-tasklist_fill:before{content:"\e751"}.i-icon-tasklist:before{content:"\e752"}.i-icon-time_fill:before{content:"\e753"}.i-icon-time:before{content:"\e754"}.i-icon-translation_fill:before{content:"\e755"}.i-icon-translation:before{content:"\e756"}.i-icon-trash:before{content:"\e757"}.i-icon-trash_fill:before{content:"\e758"}.i-icon-undo:before{content:"\e759"}.i-icon-video:before{content:"\e75a"}.i-icon-video_fill:before{content:"\e75b"}.i-icon-warning_fill:before{content:"\e75c"}.i-icon-warning:before{content:"\e75d"}.i-icon-search:before{content:"\e75e"}.i-icon-searchfill:before{content:"\e75f"}.i-icon-publishgoods_fill:before{content:"\e760"}.i-icon-shop_fill:before{content:"\e761"}.i-icon-transaction_fill:before{content:"\e762"}.i-icon-packup:before{content:"\e763"}.i-icon-unfold:before{content:"\e764"}.i-icon-financial_fill:before{content:"\e765"}.i-icon-commodity:before{content:"\e766"}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
properties : {
name : {
type : String,
value : ''
}
},
relations : {
'../index/index' : {
type : 'parent'
}
},
data : {
top : 0,
height : 0,
currentName : ''
},
methods: {
updateDataChange() {
const className = '.i-index-item';
const query = wx.createSelectorQuery().in(this);
query.select( className ).boundingClientRect((res)=>{
this.setData({
top : res.top,
height : res.height,
currentName : this.data.name
})
}).exec()
}
}
})
\ No newline at end of file
{
"component": true
}
<view class="i-index-item i-class">
<view class="i-index-item-header">{{name}}</view>
<view class="i-index-item-content">
<slot></slot>
</view>
</view>
<wxs module="parse">
module.exports = {
}
</wxs>
.i-index-item-header{height:30px;line-height:30px;background:#eee;font-size:14px;padding-left:10px;width:100%;box-sizing:border-box}.i-index-item-content{font-size:14px}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
properties : {
height : {
type : String,
value : '300'
},
itemHeight : {
type : Number,
value : 18
}
},
relations : {
'../index-item/index' : {
type : 'child',
linked(){
this._updateDataChange();
},
linkChanged () {
this._updateDataChange();
},
unlinked () {
this._updateDataChange();
}
}
},
data : {
scrollTop : 0,
fixedData : [],
current : 0,
timer : null,
startTop : 0,
itemLength : 0,
currentName : '',
isTouches : false
},
methods : {
loop(){},
_updateDataChange( ){
const indexItems = this.getRelationNodes('../index-item/index');
const len = indexItems.length;
const fixedData = this.data.fixedData;
/*
* 使用函数节流限制重复去设置数组内容进而限制多次重复渲染
* 暂时没有研究微信在渲染的时候是否会进行函数节流
*/
if (len > 0) {
if( this.data.timer ){
clearTimeout( this.data.timer )
this.setData({
timer : null
})
}
this.data.timer = setTimeout(()=>{
const data = [];
indexItems.forEach((item) => {
if( item.data.name && fixedData.indexOf( item.data.name ) === -1 ){
data.push(item.data.name);
item.updateDataChange();
}
})
this.setData({
fixedData : data,
itemLength : indexItems.length
})
//组件加载完成之后重新设置顶部高度
this.setTouchStartVal();
},0);
this.setData({
timer : this.data.timer
})
}
},
handlerScroll(event){
const detail = event.detail;
const scrollTop = detail.scrollTop;
const indexItems = this.getRelationNodes('../index-item/index');
indexItems.forEach((item,index)=>{
let data = item.data;
let offset = data.top + data.height;
if( scrollTop < offset && scrollTop >= data.top ){
this.setData({
current : index,
currentName : data.currentName
})
}
})
},
getCurrentItem(index){
const indexItems = this.getRelationNodes('../index-item/index');
let result = {};
result = indexItems[index].data;
result.total = indexItems.length;
return result;
},
triggerCallback(options){
this.triggerEvent('change',options)
},
handlerFixedTap(event){
const eindex = event.currentTarget.dataset.index;
const item = this.getCurrentItem(eindex);
this.setData({
scrollTop : item.top,
currentName : item.currentName,
isTouches : true
})
this.triggerCallback({
index : eindex,
current : item.currentName
})
},
handlerTouchMove(event){
const data = this.data;
const touches = event.touches[0] || {};
const pageY = touches.pageY;
const rest = pageY - data.startTop;
let index = Math.ceil( rest/data.itemHeight );
index = index >= data.itemLength ? data.itemLength -1 : index;
const movePosition = this.getCurrentItem(index);
/*
* 当touch选中的元素和当前currentName不相等的时候才震动一下
* 微信震动事件
*/
if( movePosition.name !== this.data.currentName ){
wx.vibrateShort();
}
this.setData({
scrollTop : movePosition.top,
currentName : movePosition.name,
isTouches : true
})
this.triggerCallback({
index : index,
current : movePosition.name
})
},
handlerTouchEnd(){
this.setData({
isTouches : false
})
},
setTouchStartVal(){
const className = '.i-index-fixed';
const query = wx.createSelectorQuery().in(this);
query.select( className ).boundingClientRect((res)=>{
this.setData({
startTop : res.top
})
}).exec()
}
}
})
\ No newline at end of file
{
"component": true
}
<view class="i-index i-class">
<scroll-view
scroll-y
style="{{parse.setScrollStyle(height)}}"
bindscroll="handlerScroll"
scroll-top="{{scrollTop}}">
<slot></slot>
<view class="i-index-fixed"
catchtouchstart="handlerTouchMove"
catchtouchmove="handlerTouchMove"
catchtouchend="handlerTouchEnd">
<view class="i-index-fixed-item"
wx:for="{{fixedData}}"
wx:key="{{index}}"
data-index="{{index}}"
catchtap="handlerFixedTap">
{{item}}
</view>
</view>
<view class="i-index-tooltip" style="{{ isTouches ? 'display:block' : 'display:none' }}">{{currentName}}</view>
</scroll-view>
</view>
<wxs module="parse">
module.exports = {
setScrollStyle : function(height){
var units = ['%','px','rem','rpx','em','rem'];
var hasUnits = false;
for( var i = 0; i < units.length;i++ ){
var u = units[i];
if( height.indexOf( u ) > -1 ){
hasUnits = true;
break;
}
}
return 'height:'+ ( hasUnits ? height : height+'px' );
}
}
</wxs>
.i-index{width:100%;height:100%}.i-index-line{position:absolute;left:0;width:100%;height:1rpx;background-color:#f7f7f7;top:50%}.i-index-content{background:#fff;position:relative;z-index:1;display:inline-block;padding:0 10px}.i-index-fixed{position:fixed;right:0;top:50%;z-index:10;padding-left:10px;transform:translateY(-50%)}.i-index-fixed-item{display:block;height:18px;line-height:18px;padding:0 5px;text-align:center;color:#2d8cf0;font-size:12px;border-radius:50%}.i-index-fixed-item-current{background:#2d8cf0;color:#fff}.i-index-tooltip{position:fixed;left:50%;top:50%;transform:translate3d(-50%,-50%,0);background:rgba(0,0,0,.7);color:#fff;font-size:24px;border-radius:50%;width:80px;height:80px;line-height:80px;text-align:center}
\ No newline at end of file
function addNum (num1, num2) {
let sq1, sq2, m;
try {
sq1 = num1.toString().split('.')[1].length;
}
catch (e) {
sq1 = 0;
}
try {
sq2 = num2.toString().split('.')[1].length;
}
catch (e) {
sq2 = 0;
}
m = Math.pow(10, Math.max(sq1, sq2));
return (Math.round(num1 * m) + Math.round(num2 * m)) / m;
}
Component({
externalClasses: ['i-class'],
properties: {
// small || default || large
size: String,
value: {
type: Number,
value: 1
},
min: {
type: Number,
value: -Infinity
},
max: {
type: Number,
value: Infinity
},
step: {
type: Number,
value: 1
}
},
methods: {
handleChangeStep(e, type) {
const { dataset = {} } = e.currentTarget;
const { disabled } = dataset;
const { step } = this.data;
let { value } = this.data;
if (disabled) return null;
if (type === 'minus') {
value = addNum(value, -step);
} else if (type === 'plus') {
value = addNum(value, step);
}
if (value < this.data.min || value > this.data.max) return null;
this.handleEmit(value, type);
},
handleMinus(e) {
this.handleChangeStep(e, 'minus');
},
handlePlus(e) {
this.handleChangeStep(e, 'plus');
},
handleBlur(e) {
let { value } = e.detail;
const { min, max } = this.data;
if (!value) {
setTimeout(() => {
this.handleEmit(value);
}, 16);
return;
}
value = +value;
if (value > max) {
value = max;
} else if (value < min) {
value = min;
}
this.handleEmit(value);
},
handleEmit (value, type) {
const data = {
value: value
};
if (type) data.type = type;
this.triggerEvent('change', data);
}
}
});
{
"component": true
}
<view class="i-class i-input-number i-input-number-size-{{ size }}">
<view class="i-input-number-minus {{ value <= min ? 'i-input-number-disabled' : '' }}" data-disabled="{{ value <= min }}" bindtap="handleMinus">-</view>
<input class="i-input-number-text {{ min >= max ? 'i-input-number-disabled' : '' }}" type="number" value="{{ value }}" disabled="{{ min >= max }}" bindblur="handleBlur" />
<view class="i-input-number-plus {{ value >= max ? 'i-input-number-disabled' : '' }}" data-disabled="{{ value >= max }}" bindtap="handlePlus">+</view>
</view>
.i-input-number{color:#495060}.i-input-number view{display:inline-block;line-height:20px;padding:5px 0;text-align:center;min-width:40px;box-sizing:border-box;vertical-align:middle;font-size:12px;border:1rpx solid #dddee1}.i-input-number-minus{border-right:none;border-radius:2px 0 0 2px}.i-input-number-plus{border-left:none;border-radius:0 2px 2px 0}.i-input-number-text{border:1rpx solid #dddee1;display:inline-block;text-align:center;vertical-align:middle;height:30px;width:40px;min-height:auto;font-size:12px;line-height:30px}.i-input-number-disabled{border-color:#dddee1;color:#bbbec4;background:#f7f7f7}
\ No newline at end of file
Component({
behaviors: ['wx://form-field'],
externalClasses: ['i-class'],
properties: {
title: {
type: String
},
// text || textarea || password || number
type: {
type: String,
value: 'text'
},
disabled: {
type: Boolean,
value: false
},
placeholder: {
type: String,
value: ''
},
autofocus: {
type: Boolean,
value: false
},
mode: {
type: String,
value: 'normal'
},
right: {
type: Boolean,
value: false
},
error: {
type: Boolean,
value: false
},
maxlength: {
type: Number
}
},
methods: {
handleInputChange(event) {
const { detail = {} } = event;
const { value = '' } = detail;
this.setData({ value });
this.triggerEvent('change', event);
},
handleInputFocus(event) {
this.triggerEvent('focus', event);
},
handleInputBlur(event) {
this.triggerEvent('blur', event);
}
}
});
{
"component": true
}
<view class="i-class i-cell i-input {{ error ? 'i-input-error' : '' }} {{ mode === 'wrapped' ? 'i-input-wrapped' : '' }}">
<view wx:if="{{ title }}" class="i-cell-hd i-input-title">{{ title }}</view>
<textarea
wx:if="{{ type === 'textarea' }}"
auto-height
disabled="{{ disabled }}"
focus="{{ autofocus }}"
value="{{ value }}"
placeholder="{{ placeholder }}"
maxlength="{{ maxlength }}"
class="i-input-input i-cell-bd {{ right ? 'i-input-input-right' : '' }}"
placeholder-class="i-input-placeholder"
bindinput="handleInputChange"
bindfocus="handleInputFocus"
bindblur="handleInputBlur"
></textarea>
<input
wx:else
type="{{ type }}"
disabled="{{ disabled }}"
focus="{{ autofocus }}"
value="{{ value }}"
placeholder="{{ placeholder }}"
maxlength="{{ maxlength }}"
class="i-input-input i-cell-bd {{ right ? 'i-input-input-right' : '' }}"
placeholder-class="i-input-placeholder"
bindinput="handleInputChange"
bindfocus="handleInputFocus"
bindblur="handleInputBlur"
/>
</view>
.i-cell{position:relative;padding:12px 15px;display:flex;background:#fff;align-items:center;line-height:1.4;font-size:14px;overflow:hidden}.i-cell::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px;left:15px;right:0}.i-cell-last::after{display:none}.i-cell-icon{margin-right:5px}.i-cell-icon:empty{display:none}.i-cell-bd{flex:1}.i-cell-text{line-height:24px;font-size:14px}.i-cell-desc{line-height:1.2;font-size:12px;color:#80848f}.i-cell-ft{position:relative;text-align:right;color:#495060}.i-cell-access .i-cell-ft{padding-right:13px}.i-cell-access .i-cell-ft::after{content:" ";display:inline-block;width:6px;height:6px;position:absolute;top:50%;right:2px;border-width:2px 2px 0 0;border-color:#dddee1;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}.i-input{padding:7px 15px;color:#495060}.i-input-wrapped{margin:10px 15px;background-color:#fff}.i-input-wrapped::after{left:0;border-width:1px;border-radius:4px}.i-input-error{color:#ed3f14}.i-input-title{color:#495060;min-width:65px;padding-right:10px}.i-input-input{flex:1;line-height:1.6;padding:4px 0;min-height:22px;height:auto;font-size:14px}.i-input-placeholder{font-size:14px}.i-input-input-right{text-align:right}.i-input.i-input-wrapped::after{display:block}.i-input-wrapped.i-input-error::after{border-color:#ed3f14}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
properties: {
loading: {
type: Boolean,
value: true
},
tip: {
type: String,
value: ''
}
},
});
{
"component": true
}
<view class="i-class i-load-more {{ loading ? '' : 'i-load-more-line' }}">
<view class="i-load-more-loading" wx:if="{{ loading }}"></view>
<view class="i-load-more-tip">
<view wx:if="{{ tip !== '' }}">{{ tip }}</view>
<view wx:elif="{{ tip === '' && loading }}">正在加载</view>
<view class="i-load-more-empty" wx:else></view>
</view>
</view>
\ No newline at end of file
.i-load-more{width:65%;margin:1.5em auto;line-height:1.6em;font-size:14px;text-align:center}.i-load-more-loading{display:inline-block;margin-right:12px;vertical-align:middle;width:14px;height:14px;background:0 0;border-radius:50%;border:2px solid #e9eaec;border-color:#e9eaec #e9eaec #e9eaec #2d8cf0;animation:btn-spin .6s linear;animation-iteration-count:infinite}.i-load-more-tip{display:inline-block;vertical-align:middle;color:#495060}.i-load-more-line{border-top:1px solid #dddee1;display:flex;border-top:0}.i-load-more-line::before{position:relative;top:-1px;-webkit-box-flex:1;-webkit-flex:1;flex:1;content:'';border-top:1px solid #dddee1}.i-load-more-line::after{position:relative;top:-1px;-webkit-box-flex:1;-webkit-flex:1;flex:1;content:'';border-top:1px solid #dddee1}.i-load-more-line .i-load-more-tip{position:relative;top:-.9em;padding:0 .55em}.i-load-more-empty{width:4px;height:4px;border-radius:50%;background-color:#e5e5e5;display:inline-block;position:relative;vertical-align:0;top:-.16em}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}
\ No newline at end of file
const default_data = {
visible: false,
content: '',
duration: 2,
type: 'default', // default || success || warning || error
};
let timmer = null;
Component({
externalClasses: ['i-class'],
data: {
...default_data
},
methods: {
handleShow (options) {
const { type = 'default', duration = 2 } = options;
this.setData({
...options,
type,
duration,
visible: true
});
const d = this.data.duration * 1000;
if (timmer) clearTimeout(timmer);
if (d !== 0) {
timmer = setTimeout(() => {
this.handleHide();
timmer = null;
}, d);
}
},
handleHide () {
this.setData({
...default_data
});
}
}
});
\ No newline at end of file
{
"component": true
}
<view class="i-class i-message i-message-{{type}} {{ visible ? 'i-message-show' : '' }}">
{{ content }}
</view>
\ No newline at end of file
.i-message{display:block;width:100%;min-height:32px;line-height:2.3;position:fixed;top:0;left:0;right:0;background:#2d8cf0;color:#fff;text-align:center;font-size:14px;z-index:1010;opacity:0;-webkit-transform:translateZ(0) translateY(-100%);transition:all .4s ease-in-out}.i-message-show{-webkit-transform:translateZ(0) translateY(0);opacity:1}.i-message-default{background:#2d8cf0}.i-message-success{background:#19be6b}.i-message-warning{background:#f90}.i-message-error{background:#ed3f14}
\ No newline at end of file
Component({
externalClasses: ['i-class', 'i-class-mask'],
properties: {
visible: {
type: Boolean,
value: false
},
title: {
type: String,
value: ''
},
showOk: {
type: Boolean,
value: true
},
showCancel: {
type: Boolean,
value: true
},
okText: {
type: String,
value: '确定'
},
cancelText: {
type: String,
value: '取消'
},
// 按钮组,有此值时,不显示 ok 和 cancel 按钮
actions: {
type: Array,
value: []
},
// horizontal || vertical
actionMode: {
type: String,
value: 'horizontal'
}
},
methods: {
handleClickItem ({ currentTarget = {} }) {
const dataset = currentTarget.dataset || {};
const { index } = dataset;
this.triggerEvent('click', { index });
},
handleClickOk () {
this.triggerEvent('ok');
},
handleClickCancel () {
this.triggerEvent('cancel');
}
}
});
{
"component": true,
"usingComponents": {
"i-grid": "../grid/index",
"i-grid-item": "../grid-item/index",
"i-button": "../button/index",
"i-icon": "../icon/index"
}
}
<view class="i-modal-mask i-class-mask {{ visible ? 'i-modal-mask-show' : '' }}"></view>
<view class="i-class i-modal {{ visible ? 'i-modal-show' : '' }}">
<view class="i-modal-main">
<view class="i-modal-content">
<view class="i-modal-title" wx:if="{{ title }}">{{ title }}</view>
<view class="i-modal-body">
<slot></slot>
</view>
<view class="i-modal-actions" wx:if="{{ actions.length }}">
<block wx:if="{{ actionMode === 'horizontal' }}">
<i-grid i-class="i-modal-grid">
<i-grid-item i-class="{{ actions.length === (index + 1) ? 'i-modal-grid-item-last' : 'i-modal-grid-item' }}" wx:for="{{ actions }}" wx:key="{{ item.name }}">
<template is="button" data="{{ item, index }}"></template>
</i-grid-item>
</i-grid>
</block>
<block wx:else>
<view class="i-modal-action-vertical" wx:for="{{ actions }}" wx:key="{{ item.name }}">
<template is="button" data="{{ item, index }}"></template>
</view>
</block>
</view>
<view class="i-modal-actions" wx:else>
<i-grid i-class="i-modal-grid" wx:if="{{ showOk || showCancel }}">
<i-grid-item i-class="i-modal-grid-item" wx:if="{{ showCancel }}">
<i-button i-class="i-modal-btn-cancel" long type="ghost" bind:click="handleClickCancel">{{ cancelText }}</i-button>
</i-grid-item>
<i-grid-item i-class="i-modal-grid-item-last" wx:if="{{ showOk }}">
<i-button i-class="i-modal-btn-ok" long type="ghost" bind:click="handleClickOk">{{ okText }}</i-button>
</i-grid-item>
</i-grid>
</view>
</view>
</view>
</view>
<template name="button">
<i-button long type="ghost" data-index="{{ index }}" bind:click="handleClickItem">
<view class="i-modal-btn-loading" wx:if="{{ item.loading }}"></view>
<i-icon wx:if="{{ item.icon }}" type="{{ item.icon }}" i-class="i-modal-btn-icon"></i-icon>
<view class="i-modal-btn-text" style="{{ item.color ? 'color: ' + item.color : '' }}">{{ item.name }}</view>
</i-button>
</template>
\ No newline at end of file
.i-modal{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;height:100%;z-index:1000;display:flex;outline:0;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;transform:translateZ(1px);opacity:0;visibility:hidden}.i-modal-show{visibility:visible;opacity:1}.i-modal-mask{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.7);z-index:1000;transition:all .2s ease-in-out;opacity:0;visibility:hidden}.i-modal-mask-show{opacity:1;visibility:visible}.i-modal-main{width:270px;position:relative}.i-modal-content{border-radius:7px;padding-top:15px;position:relative;background-color:#fff;border:0;background-clip:padding-box;text-align:center;height:100%;overflow:hidden}.i-modal-body{max-height:100px;margin-bottom:15px;font-size:14px;color:#80848f;height:100%;line-height:1.5;overflow:auto}.i-modal-title{padding:6px 15px 15px;margin:0;font-size:18px;line-height:1;color:#1c2438;text-align:center}.i-modal-actions{margin:0 1px}.i-modal-action-vertical{position:relative}.i-modal-action-vertical:after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-top-width:1px}.i-modal-grid{border-radius:0 0 7px 7px;border-left:none}.i-modal-grid-item,.i-modal-grid-item-last{padding:0;border-bottom:none}.i-modal-grid-item-last{border-right:none}.i-modal-btn-ok{color:#2d8cf0!important}.i-modal-btn-loading{display:inline-block;vertical-align:middle;margin-right:10px;width:12px;height:12px;background:0 0;border-radius:50%;border:2px solid #e5e5e5;border-color:#666 #e5e5e5 #e5e5e5 #e5e5e5;animation:btn-spin .6s linear;animation-iteration-count:infinite}.i-modal-btn-text{display:inline-block;vertical-align:middle}.i-modal-btn-icon{font-size:14px!important;margin-right:4px}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}
\ No newline at end of file
const VALID_MODE = ['closeable'];
const FONT_COLOR = '#f60';
const BG_COLOR = '#fff7cc';
Component({
externalClasses: ['i-class'],
properties: {
closable: {
type: Boolean,
value: false
},
icon: {
type: String,
value: ''
},
loop: {
type: Boolean,
value: false
},
// 背景颜色
backgroundcolor: {
type: String,
value: '#fefcec'
},
// 字体及图标颜色
color: {
type: String,
value: '#f76a24'
},
// 滚动速度
speed: {
type: Number,
value: 1000
}
},
data: {
show: true,
wrapWidth: 0,
width: 0,
duration: 0,
animation: null,
timer: null,
},
detached() {
this.destroyTimer();
},
ready() {
if (this.data.loop) {
this.initAnimation();
}
},
methods: {
initAnimation() {
wx.createSelectorQuery().in(this).select('.i-noticebar-content-wrap').boundingClientRect((wrapRect) => {
wx.createSelectorQuery().in(this).select('.i-noticebar-content').boundingClientRect((rect) => {
const duration = rect.width / 40 * this.data.speed;
const animation = wx.createAnimation({
duration: duration,
timingFunction: "linear",
});
this.setData({
wrapWidth: wrapRect.width,
width: rect.width,
duration: duration,
animation: animation
}, () => {
this.startAnimation();
});
}).exec();
}).exec();
},
startAnimation() {
//reset
if (this.data.animation.option.transition.duration !== 0) {
this.data.animation.option.transition.duration = 0;
const resetAnimation = this.data.animation.translateX(this.data.wrapWidth).step();
this.setData({
animationData: resetAnimation.export()
});
}
this.data.animation.option.transition.duration = this.data.duration;
const animationData = this.data.animation.translateX(-this.data.width).step();
setTimeout(() => {
this.setData({
animationData: animationData.export()
});
}, 100);
const timer = setTimeout(() => {
this.startAnimation();
}, this.data.duration);
this.setData({
timer,
});
},
destroyTimer() {
if (this.data.timer) {
clearTimeout(this.data.timer);
}
},
handleClose() {
this.destroyTimer();
this.setData({
show: false,
timer: null
});
}
}
});
{
"component": true,
"usingComponents":
{
"i-icon": "../icon/index"
}
}
<view wx:if="{{ show }}" class="i-class i-noticebar" style="color: {{ color }}; background-color: {{ backgroundcolor }}">
<i-icon wx:if="{{ icon }}" type="{{ icon }}" size="24" color="{{color}}" class="i-noticebar-icon"></i-icon>
<view class="i-noticebar-content-wrap">
<view class="i-noticebar-content {{loop?'i-noticebar-content-loop':''}}" animation="{{ animationData }}">
<slot></slot>
</view>
</view>
<i-icon wx:if="{{closable}}" class="i-noticebar-operation" type="close" size="20" color="{{color}}" bindtap="handleClose"></i-icon>
</view>
.i-noticebar{display:flex;height:72rpx;line-height:72rpx;font-size:14px;color:#f76a24;background-color:#fefcec;overflow:hidden}.i-noticebar-icon{display:flex;margin-left:30rpx;align-items:center}.i-noticebar-icon+view{margin-left:10rpx}.i-noticebar-operation{display:flex;margin-right:16rpx;align-items:center}.i-noticebar-content-wrap{position:relative;flex:1;margin:0 30rpx;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.i-noticebar-content-wrap .i-noticebar-content{position:absolute;transition-duration:20s}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
options: {
multipleSlots: true
},
properties: {
// button || number || pointer
mode: {
type: String,
value: 'button'
},
current: {
type: Number,
value: 1
},
total: {
type: Number,
value: 0
},
// 是否隐藏数值
simple: {
type: Boolean,
value: false
}
},
methods: {
handleChange (type) {
this.triggerEvent('change', {
type: type
});
},
handlePrev () {
this.handleChange('prev');
},
handleNext () {
this.handleChange('next');
}
}
});
{
"component": true,
"usingComponents":
{
"i-button": "../button/index"
}
}
<view class="i-class i-page">
<view class="i-page-prev" wx:if="{{ mode === 'button' }}">
<i-button i-class="i-page-button" type="ghost" bindclick="handlePrev" disabled="{{ current === 1 }}"><slot name="prev"></slot></i-button>
</view>
<view class="i-page-number" wx:if="{{ mode !== 'pointer' && !simple }}">
<view class="i-page-number-current">{{ current }}</view>/{{total}}
</view>
<view class="i-page-pointer" wx:if="{{ mode === 'pointer' }}">
<view class="i-page-pointer-dot {{ (index + 1) === current ? 'current' : '' }}" wx:for="{{ total }}" wx:key="index"></view>
</view>
<view class="i-page-next" wx:if="{{ mode === 'button' }}">
<i-button i-class="i-page-button" type="ghost" bindclick="handleNext" disabled="{{ current === total }}"><slot name="next"></slot></i-button>
</view>
</view>
.i-page{display:block;width:100%;height:44px;overflow:hidden;box-sizing:border-box;position:relative}.i-page-prev{position:absolute;left:10px;top:0}.i-page-next{position:absolute;right:10px;top:0}.i-page-number{width:100%;height:44px;line-height:44px;margin:0 auto;text-align:center}.i-page-number-current{display:inline;color:#2d8cf0}.i-page-pointer{width:100%;height:44px;line-height:44px;margin:0 auto;text-align:center}.i-page-pointer-dot{display:inline-block;width:8px;height:8px;margin:0 2px;border-radius:50%;background:#bbbec4}.i-page-pointer-dot.current{background:#80848f}.i-page-button{display:inline-block;margin:0}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
properties: {
title: {
type: String,
value: ''
},
// 标题顶部距离
hideTop: {
type: Boolean,
value: false
},
hideBorder: {
type: Boolean,
value: false
}
}
});
{
"component": true
}
<view class="i-class i-panel">
<view wx:if="{{ title }}" class="i-panel-title {{ hideTop ? 'i-panel-title-hide-top' : '' }}">{{ title }}</view>
<view class="i-panel-content {{ hideBorder ? 'i-panel-without-border' : '' }}"><slot></slot></view>
</view>
.i-panel{position:relative;overflow:hidden}.i-panel-title{font-size:14px;line-height:1;color:#1c2438;padding:20px 16px 10px}.i-panel-title-hide-top{padding-top:0}.i-panel-content{position:relative;background:#fff;overflow:hidden}.i-panel-content::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-top-width:1px;border-bottom-width:1px}.i-panel-without-border::after{border:0 none}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
properties: {
percent: {
type: Number,
value: 0
},
// normal || active || wrong || success
status: {
type: String,
value: 'normal'
},
strokeWidth: {
type: Number,
value: 10
},
hideInfo: {
type: Boolean,
value: false
}
}
});
{
"component": true
}
<view class="i-class i-progress i-progress-{{ status }} {{ !hideInfo ? 'i-progress-show-info' : '' }}">
<view class="i-progress-outer">
<view class="i-progress-inner">
<view class="i-progress-bg" style="width: {{percent}}%;height: {{strokeWidth}}px"></view>
</view>
</view>
<view class="i-progress-text" wx:if="{{ !hideInfo }}">
<view class="i-progress-text-inner">{{ percent }}%</view>
</view>
</view>
\ No newline at end of file
.i-progress{display:inline-block;width:100%;font-size:12px;position:relative}.i-progress-outer{display:inline-block;width:100%;margin-right:0;padding-right:0;box-sizing:border-box}.i-progress-show-info .i-progress-outer{padding-right:55px;margin-right:-55px}.i-progress-inner{display:inline-block;width:100%;background-color:#f3f3f3;border-radius:100px;vertical-align:middle}.i-progress-bg{border-radius:100px;background-color:#2db7f5;transition:all .2s linear;position:relative}.i-progress-text{display:inline-block;margin-left:5px;text-align:left;font-size:1em;vertical-align:middle}.i-progress-active .i-progress-bg:before{content:'';opacity:0;position:absolute;top:0;left:0;right:0;bottom:0;background:#fff;border-radius:10px;animation:i-progress-active 2s ease-in-out infinite}.i-progress-wrong .i-progress-bg{background-color:#ed3f14}.i-progress-wrong .i-progress-text{color:#ed3f14}.i-progress-success .i-progress-bg{background-color:#19be6b}.i-progress-success .i-progress-text{color:#19be6b}@keyframes i-progress-active{0%{opacity:.3;width:0}100%{opacity:0;width:100%}}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
relations: {
'../radio/index': {
type: 'child',
linked() {
this.changeCurrent();
},
linkChanged() {
this.changeCurrent();
},
unlinked() {
this.changeCurrent();
}
}
},
properties: {
current: {
type: String,
value: '',
observer: 'changeCurrent'
},
},
methods: {
changeCurrent(val = this.data.current) {
let items = this.getRelationNodes('../radio/index');
const len = items.length;
if (len > 0) {
items.forEach(item => {
item.changeCurrent(val === item.data.value);
});
}
},
emitEvent(current) {
this.triggerEvent('change', current);
}
}
});
{
"component": true,
"usingComponents":
{
"i-cell-group": "../cell-group/index"
}
}
<i-cell-group class="i-class">
<slot></slot>
</i-cell-group>
const prefixCls = 'i-radio';
Component({
externalClasses: ['i-class'],
relations: {
'../radio-group/index': {
type: 'parent'
}
},
properties: {
value: {
type: String,
value: ''
},
checked: {
type: Boolean,
value: false
},
disabled: {
type: Boolean,
value: false
},
color: {
type: String,
value: '#2d8cf0'
},
position: {
type: String,
value: 'left', //left right
observer: 'setPosition'
}
},
data: {
checked: true,
positionCls: `${prefixCls}-radio-left`,
},
attached() {
this.setPosition();
},
methods: {
changeCurrent(current) {
this.setData({ checked: current });
},
radioChange() {
if (this.data.disabled) return;
const item = { current: !this.data.checked, value: this.data.value };
const parent = this.getRelationNodes('../radio-group/index')[0];
parent ? parent.emitEvent(item) : this.triggerEvent('change', item);
},
setPosition() {
this.setData({
positionCls: this.data.position.indexOf('left') !== -1 ? `${prefixCls}-radio-left` : `${prefixCls}-radio-right`,
});
}
}
});
{
"component": true,
"usingComponents":
{
"i-cell": "../cell/index"
}
}
<view class="i-class i-radio" catchtap="radioChange">
<i-cell i-class="i-radio-cell">
<label>
<radio value="{{value}}" checked="{{checked}}" color="{{checked?color:''}}" disabled="{{disabled}}" class="i-radio-radio {{positionCls}}" />
<view class="i-radio-title">{{value}}</view>
</label>
</i-cell>
</view>
.i-radio-cell::after{display:block}.i-radio-radio-left{float:left}.i-radio-radio-right{float:right}.i-radio-radio{vertical-align:middle}.i-radio-title{display:inline-block;vertical-align:middle}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
properties : {
count : {
type : Number,
value : 5
},
value : {
type : Number,
value : 0
},
disabled : {
type : Boolean,
value : false
},
size : {
type : Number,
value : 20
},
name : {
type : String,
value : ''
}
},
data : {
touchesStart : {
pageX : 0
}
},
methods : {
handleClick(e){
const data = this.data;
if( data.disabled ){
return;
}
const index = e.currentTarget.dataset.index;
this.triggerEvent('change',{
index : index + 1
})
},
handleTouchMove(e){
const data = this.data;
if( data.disabled ){
return;
}
if( !e.changedTouches[0] ){
return;
}
const movePageX = e.changedTouches[0].pageX;
const space = movePageX - data.touchesStart.pageX;
if( space <= 0 ){
return;
}
let setIndex = Math.ceil( space/data.size );
setIndex = setIndex > data.count ? data.count : setIndex ;
this.triggerEvent('change',{
index : setIndex
})
}
},
ready(){
const className = '.i-rate';
var query = wx.createSelectorQuery().in(this)
query.select( className ).boundingClientRect((res)=>{
this.data.touchesStart.pageX = res.left || 0;
}).exec()
}
});
{
"component": true,
"usingComponents":{
"i-icon": "../icon/index"
}
}
<view class="i-class i-rate"
bindtouchmove="handleTouchMove">
<input type="text" :name="name" wx:value="{{value}}" class="i-rate-hide-input" />
<view
wx:for="{{count}}"
wx:key="{{item}}"
class="i-rate-star {{ parse.getCurrent( value,index ) }}"
data-index="{{index}}"
bindtap="handleClick">
<i-icon type="collection_fill" size="{{size}}"></i-icon>
</view>
<view class="i-rate-text" wx:if="{{ value !== 0 }}"><slot></slot></view>
</view>
<wxs module="parse">
var prefixCls = 'i-rate';
module.exports = {
getCurrent : function( value,index ){
if( index < value ){
return prefixCls + '-current'
}
}
}
</wxs>
.i-rate{margin:0;padding:0;font-size:20px;display:inline-block;vertical-align:middle;font-weight:400;font-style:normal}.i-rate-hide-input{display:none}.i-rate-star{display:inline-block;color:#e9e9e9}.i-rate-current{color:#f5a623}.i-rate-text{display:inline-block;vertical-align:middle;margin-left:6px;font-size:14px}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
relations: {
'../col/index': {
type: 'child'
}
}
});
{
"component": true
}
<view class="i-class i-row"><slot></slot></view>
\ No newline at end of file
.i-row:after{content:"";display:table;clear:both}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
options: {
// 在组件定义时的选项中启用多slot支持
multipleSlots: true
},
methods : {
handleTap2(){
console.log(event,1111111)
},
handleTap3(){
}
}
});
{
"component": true,
"usingComponents":
{
"i-button": "../button/index",
"i-icon": "../icon/index"
}
}
<view class="i-class i-slide" capture-catch:touchstart="handleTap2" capture-catch:touchmove="handleTap3">
1111
</view>
\ No newline at end of file
Component({
externalClasses: ['i-class'],
properties: {
// small || default || large
size: {
type: String,
value: 'default'
},
fix: {
type: Boolean,
value: false
},
fullscreen: {
type: Boolean,
value: false
},
custom: {
type: Boolean,
value: false
}
}
});
{
"component": true
}
<view class="i-class i-spin i-spin-{{ size }} {{ fix ? 'i-spin-fix' : '' }} {{ custom ? 'i-spin-show-text' : '' }} {{ fullscreen ? 'i-spin-fullscreen' : '' }}">
<div class="i-spin-main">
<view class="i-spin-dot"></view>
<div class="i-spin-text"><slot></slot></div>
</div>
</view>
.i-spin{color:#2d8cf0;vertical-align:middle;text-align:center}.i-spin-dot{position:relative;display:block;border-radius:50%;background-color:#2d8cf0;width:20px;height:20px;animation:ani-spin-bounce 1s 0s ease-in-out infinite}.i-spin-large .i-spin-dot{width:32px;height:32px}.i-spin-small .i-spin-dot{width:12px;height:12px}.i-spin-fix{position:absolute;top:0;left:0;z-index:8;width:100%;height:100%;background-color:rgba(255,255,255,.9)}.i-spin-fullscreen{z-index:2010}.i-spin-fullscreen-wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.i-spin-fix .i-spin-main{position:absolute;top:50%;left:50%;-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.i-spin-fix .i-spin-dot{display:inline-block}.i-spin-show-text .i-spin-dot,.i-spin-text{display:none}.i-spin-show-text .i-spin-text{display:block;font-size:14px}@keyframes ani-spin-bounce{0%{transform:scale(0)}100%{transform:scale(1);opacity:0}}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
properties : {
status : {
type : String,
//wait、process、finish、error
value : ''
},
title : {
type : String,
value : ''
},
content : {
type : String,
value : ''
},
icon : {
type : String,
value : ''
}
},
options: {
// 在组件定义时的选项中启用多slot支持
multipleSlots: true
},
relations : {
'../steps/index' : {
type : 'parent'
}
},
data : {
//step length
len : 1,
//current in step index
index : 0,
//parent component select current index
current : 0,
//css direction
direction : 'horizontal'
},
methods : {
updateDataChange( options ){
this.setData({
len : options.len,
index : options.index,
current : options.current,
direction : options.direction
})
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents":
{
"i-icon": "../icon/index"
}
}
<view class="i-class i-step-item {{parse.getClass(status,current,index)}} {{ direction === 'vertical' ? 'i-step-vertical' : 'i-step-horizontal' }}" style="{{parse.getItemStyle(len,direction)}}">
<view class="i-step-item-ico">
<view class="i-step-ico" wx:if="{{parse.noIco(status,current,index,icon) }}">{{ index+1 }}</view>
<view class="i-step-ico" wx:else>
<i-icon i-class="i-step-ico-in" type="{{parse.getIcoClass(status,icon)}}"></i-icon>
</view>
<view class="i-step-line" wx:if="{{ index !== len - 1 }}"></view>
</view>
<view class="i-step-item-main">
<view class="i-step-item-title" wx:if="{{title !== ''}}">
{{title}}
</view>
<view class="i-step-item-title" wx:else>
<slot name="title"></slot>
</view>
<view class="i-step-item-content" wx:if="{{content !== ''}}">
{{content}}
</view>
<view class="i-step-item-content" wx:else>
<slot name="content"></slot>
</view>
</view>
</view>
<wxs module="parse">
var allStatus = ['wait','process','finish','error'];
module.exports = {
noIco : function( status,current,index,icon ){
var aindex = allStatus.indexOf(status);
var noIcon = true;
if( index < current || icon !== '' ){
noIcon = false;
}
return noIcon;
},
getIcoClass : function( status,ico ){
var class = '';
if( status === 'error' ){
class = 'close';
}else{
class = 'right';
}
if( ico !== '' ){
class = ico;
}
return class;
},
getItemStyle : function(len,direction){
if( direction === 'horizontal' ){
return 'width :'+100/len + '%';
}else{
return 'width : 100%;';
}
},
getClass : function( status,current,index ) {
//wait、process、finish、error
var startClass = 'i-step-'
var classes = '';
var cindex = allStatus.indexOf( status );
if( cindex !== -1 ){
classes = startClass + allStatus[cindex];
}
if( index < current ){
classes = startClass + 'finish';
}else if( index === current ){
classes = startClass + 'process';
}
return classes;
}
}
</wxs>
\ No newline at end of file
.i-step-ico{width:24px;height:100%;border-radius:100%;background:#fff;position:relative;z-index:2;margin:0 auto;border:#dddee1 solid 1px}.i-step-ico-in{vertical-align:baseline}.i-step-line{position:absolute;left:50%;top:12px;width:100%;height:1px;background:#dddee1}.i-step-horizontal .i-step-ico::after{position:absolute;top:11px;left:23px;z-index:1;content:'';height:1px;background:#fff;width:10px}.i-step-horizontal .i-step-item-main{text-align:center}.i-step-horizontal .i-step-ico::before{position:absolute;top:11px;left:-11px;z-index:1;content:'';height:1px;background:#fff;width:10px}.i-step-ico{box-sizing:border-box;font-size:12px}.i-step-process .i-step-ico{border:#2d8cf0 solid 1px;color:#fff;background:#2d8cf0}.i-step-wait .i-step-ico{border:#e9eaec solid 1px;color:#e9eaec}.i-step-wait .i-step-line{background:#2d8cf0}.i-step-finish .i-step-ico{border:#2d8cf0 solid 1px;color:#2d8cf0}.i-step-finish .i-step-line{background:#2d8cf0}.i-step-error .i-step-ico{border:#ed3f14 solid 1px;color:#ed3f14}.i-step-error .i-step-line{background:#ed3f14}.i-step-item{font-size:12px;position:relative;display:inline-block;box-sizing:border-box;padding-left:10px;vertical-align:top}.i-step-item-ico{width:100%;height:24px;line-height:24px;text-align:center}.i-step-item-main{margin-top:10px;clear:both}.i-step-item-title{font-size:14px;font-weight:700;color:#1c2438}.i-step-item-content{font-size:12px;font-weight:700;margin-top:2px;color:#80848f}.i-step-vertical{padding-bottom:30px}.i-step-vertical .i-step-item-ico{width:24px;float:left}.i-step-vertical .i-step-item-main{margin-left:40px;margin-top:0;clear:inherit}.i-step-vertical .i-step-line{position:absolute;height:100%;top:0;left:10px;margin:0 0 0 12px;width:1px}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
properties : {
current : {
type : Number,
value : -1,
observer : '_updateDataChange'
},
status : {
type : String,
//wait、process、finish、error
value : ''
},
direction : {
type : String,
//value has horizontal or vertical
value : 'horizontal'
}
},
relations : {
'../step/index' : {
type : 'child',
linked(){
this._updateDataChange();
},
linkChanged () {
this._updateDataChange();
},
unlinked () {
this._updateDataChange();
}
}
},
methods: {
_updateDataChange() {
let steps = this.getRelationNodes('../step/index');
const len = steps.length;
if (len > 0) {
steps.forEach((step, index) => {
step.updateDataChange({
len : len,
index : index,
current : this.data.current,
direction : this.data.direction
});
});
}
}
}
})
\ No newline at end of file
{
"component": true
}
<view class="i-class i-steps">
<slot></slot>
</view>
.i-steps{width:100%}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
options: {
multipleSlots: true
},
relations : {
'../sticky/index' : {
type : 'parent'
}
},
data : {
top : 0,
height : 0,
isFixed : false,
index : -1,
},
methods: {
updateScrollTopChange(scrollTop){
const data = this.data;
const top = data.top;
const height = data.height;
this.setData({
isFixed : ( scrollTop >= top && scrollTop < top + height ) ? true : false
})
},
updateDataChange(index) {
const className = '.i-sticky-item';
const query = wx.createSelectorQuery().in(this);
query.select( className ).boundingClientRect((res)=>{
if( res ){
this.setData({
top : res.top,
height : res.height,
index : index
})
}
}).exec()
}
}
})
\ No newline at end of file
{
"component": true
}
<view class="i-sticky-item">
<view class="i-sticky-item-header i-class {{ isFixed === true ? 'i-sticky-fixed' : '' }}">
<view class="i-sticky-title">
<slot name="title"></slot>
</view>
</view>
<view class="i-index-item-content">
<slot name="content"></slot>
</view>
</view>
.i-sticky-item-header{background:#eee;font-size:14px;width:100%;height:32px;line-height:32px}.i-sticky-item-content{font-size:14px}.i-sticky-title{width:100%;padding:0 15px;box-sizing:border-box;background:#eee}.i-sticky-fixed .i-sticky-title{position:fixed;top:0}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
properties : {
scrollTop : {
type : Number,
observer(val){
this._updateScrollTopChange();
}
}
},
relations : {
'../sticky-item/index' : {
type : 'child',
linked(){
this._updateDataChange();
},
linkChanged () {
this._updateDataChange();
},
unlinked () {
this._updateDataChange();
}
}
},
data : {
timer : null,
itemLength : 0,
},
methods : {
_updateScrollTopChange(){
const stickies = this.getRelationNodes('../sticky-item/index');
if( stickies.length > 0 ){
stickies.forEach((item) => {
if( item ){
item.updateScrollTopChange( this.data.scrollTop );
}
})
}
},
_updateDataChange( ){
const stickies = this.getRelationNodes('../sticky-item/index');
if( stickies.length > 0 ){
if( this.data.timer ){
clearTimeout( this.data.timer )
this.setData({
timer : null
})
}
this.data.timer = setTimeout(()=>{
stickies.forEach((item,index) => {
if( item ){
item.updateDataChange(index);
}
})
},0)
this.setData({
timer : this.data.timer
})
}
}
}
})
\ No newline at end of file
{
"component": true
}
<view class="i-sticky i-class">
<slot></slot>
</view>
/*
* touch事件判断方式
* https://github.com/madrobby/zepto/blob/master/src/touch.js#files
*/
function swipeDirection(x1, x2, y1, y2) {
return Math.abs(x1 - x2) >=
Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down')
}
Component({
externalClasses: ['i-class'],
properties: {
actions: {
value: [],
type: Array,
observer : '_updateButtonSize'
},
unclosable : {
value : false,
type : Boolean
},
toggle : {
value : false,
type : Boolean,
observer : 'closeButtonGroup'
},
operateWidth : {
type : Number,
value : 160
}
},
options: {
// 在组件定义时的选项中启用多slot支持
multipleSlots: true
},
data : {
//touch start position
tStart : {
pageX : 0,
pageY : 0
},
//限制滑动距离
limitMove : 0,
//element move position
position : {
pageX : 0,
pageY : 0
}
},
methods : {
//阻止事件冒泡
loop(){},
_updateButtonSize(){
const actions = this.data.actions;
if( actions.length > 0 ){
const query = wx.createSelectorQuery().in(this);
let limitMovePosition = 0;
actions.forEach(item => {
limitMovePosition += item.width || 0;
});
this.data.limitMove = limitMovePosition;
/*
* 动态获取每个传进值的按钮尺寸不能正确获取,在安卓上少了6px
* 暂时实现需要在actions里面传递宽度
* 需要后期调研
*/
//query.selectAll('.i-swipeout-button-right-item').boundingClientRect((rects)=>{
// if( rects ){
// console.log(rects,1111111)
// rects.forEach(item => {
// limitMovePosition += item.width;
// });
// this.data.limitMove = limitMovePosition;
// console.log(limitMovePosition,111111111)
// }
// }).exec()
}else{
this.data.limitMove = this.data.operateWidth;
}
},
handlerTouchstart(event){
const touches = event.touches ? event.touches[0] : {};
const tStart = this.data.tStart;
if( touches ){
for( let i in tStart ){
if( touches[i] ){
tStart[i] = touches[i];
}
}
}
},
swipper(touches){
const data = this.data;
const start = data.tStart;
const spacing = {
pageX : touches.pageX - start.pageX,
pageY : touches.pageY - start.pageY
}
if( data.limitMove < Math.abs( spacing.pageX ) ){
spacing.pageX = -data.limitMove;
}
this.setData({
'position' : spacing
})
},
handlerTouchmove(event){
const start = this.data.tStart;
const touches = event.touches ? event.touches[0] : {};
if( touches ){
const direction = swipeDirection( start.pageX,touches.pageX,start.pageY,touches.pageY );
if( direction === 'Left' ){
this.swipper( touches );
}
}
},
handlerTouchend(event){
const start = this.data.tStart;
const touches = event.changedTouches ? event.changedTouches[0] : {};
if( touches ){
const direction = swipeDirection( start.pageX,touches.pageX,start.pageY,touches.pageY );
const spacing = {
pageX : touches.pageX - start.pageX,
pageY : touches.pageY - start.pageY
}
if( Math.abs( spacing.pageX ) >= 40 && direction === "Left" ){
spacing.pageX = spacing.pageX < 0 ? - this.data.limitMove : this.data.limitMove;
}else{
spacing.pageX = 0;
}
this.setData({
'position' : spacing
})
}
},
handlerButton(event){
if( !this.data.unclosable ){
this.closeButtonGroup();
}
const dataset = event.currentTarget.dataset;
this.triggerEvent('change',{
index : dataset.index
})
},
closeButtonGroup(){
this.setData({
'position' : {pageX : 0,pageY : 0}
})
},
//控制自定义组件
handlerParentButton(event){
if( !this.data.unclosable ){
this.closeButtonGroup();
}
}
},
ready(){
this._updateButtonSize();
}
});
{
"component": true,
"usingComponents": {
"i-cell": "../cell/index",
"i-icon": "../icon/index"
}
}
\ No newline at end of file
<view class="i-swipeout-wrap i-class">
<view class="i-swipeout-item" bindtouchstart="handlerTouchstart" bindtouchmove="handlerTouchmove" bindtouchend="handlerTouchend" style="{{parse.setPosition(position)}}">
<view class="i-swipeout-content">
<slot name="content"></slot>
</view>
<view class="i-swipeout-button-right-group"
wx:if="{{actions.length > 0}}"
catchtouchend="loop" >
<view class="i-swipeout-button-right-item"
wx:for="{{actions}}"
style="{{parse.setStyle(item)}};width:{{item.width}}px;"
wx:key="{{index}}"
data-index="{{index}}"
bind:tap="handlerButton">
<i-icon
wx:if="{{item.icon}}"
type="{{item.icon}}"
size="{{item.fontsize}}"
color="{{item.color}}">
</i-icon>
{{item.name}}
</view>
</view>
<view class="i-swipeout-button-right-group" catchtouchend="loop" bind:tap="handlerParentButton" wx:if="{{actions.length === 0}}" style="width:{{operateWidth}}px;right:-{{operateWidth}}px;">
<slot name="button"></slot>
</view>
</view>
</view>
<wxs module="parse">
module.exports = {
setStyle : function( item ){
var defaults = '#f7f7f7';
return 'background:' + ( item.background ? item.background : defaults ) +';' + 'color:'+ item.color;
},
setPosition : function( position ){
return 'transform:translate(' + position.pageX + 'px,0);';
}
}
</wxs>
\ No newline at end of file
.i-swipeout-wrap{border-bottom:#dddee1 solid 1px;background:#fff;position:relative;overflow:hidden}.i-swipeout-item{width:100%;padding:15px 20px;box-sizing:border-box;transition:transform .2s ease;font-size:14px}.i-swipeout-content{white-space:nowrap;overflow:hidden}.i-swipeout-button-right-group{position:absolute;right:-100%;top:0;height:100%;z-index:1;width:100%}.i-swipeout-button-right-item{height:100%;float:left;white-space:nowrap;box-sizing:border-box;display:flex;align-items:center;justify-content:center}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
properties : {
value : {
type : Boolean,
value : false
},
//large small default
size : {
type : String,
value : 'default'
},
// is or not disable
disabled : {
type : Boolean,
value : false
},
// hidden inut name
name : {
type : String,
value : ''
}
},
options: {
// 在组件定义时的选项中启用多slot支持
multipleSlots: true
},
methods : {
toggle(){
if( this.data.disabled ) return;
const data = this.data;
const value = data.value ? false : true;
this.triggerEvent('change',{
value : value
})
}
}
});
{
"component": true
}
<view class="i-class i-switch {{parse.setSize(size)}} {{parse.setCurrent(value,disabled)}}" bindtap="toggle">
<input type="text" :name="name" wx:value="{{value}}" class="i-switch-hide-input"></input>
<view class="i-switch-inner" wx:if="{{value === true}}">
<slot name="open"></slot>
</view>
<view class="i-switch-inner" wx:else>
<slot name="close"></slot>
</view>
</view>
<wxs module="parse">
var sizes = ['large', 'default'];
var prefixCls = 'i-switch';
module.exports = {
setSize : function( size ){
var index = sizes.indexOf( size );
return prefixCls + ( index > -1 ? ( '-'+size ) : 'default' )
},
setCurrent : function( value,disabled ){
var className = value && !disabled ? prefixCls + '-checked' : '';
if( disabled ){
className += ' ' + prefixCls + '-disabled';
}
return className;
}
}
</wxs>
\ No newline at end of file
.i-switch{display:inline-block;width:48px;height:24px;line-height:24px;border-radius:24px;vertical-align:middle;border:1px solid #ccc;background-color:#ccc;position:relative;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:all .2s ease-in-out}.i-switch-hide-input{display:none;opacity:0}.i-switch-inner{color:#fff;font-size:12px;position:absolute;left:25px;vertical-align:middle}.i-switch-inner .i-icon{width:12px;height:12px;text-align:center;vertical-align:middle}.i-switch:after{content:'';width:22px;height:22px;border-radius:22px;background-color:#fff;position:absolute;left:1px;top:1px;cursor:pointer;transition:left .2s ease-in-out,width .2s ease-in-out}.i-switch-checked:after{left:8px}.i-switch-large{width:60px}.i-switch-large.i-switch-checked:after{left:37px}.i-switch-checked:after{left:25px}.i-switch-checked{border-color:#2d8cf0;background-color:#2d8cf0}.i-switch-checked .i-switch-inner{left:8px}.i-switch-checked:after{left:25px}.i-switch-disabled{background:#f3f3f3;border-color:#f3f3f3}.i-switch-disabled:after{background:#ccc;cursor:not-allowed}.i-switch-disabled .i-switch-inner{color:#ccc}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
relations: {
'../tab-bar/index': {
type: 'parent'
}
},
properties: {
icon: {
type: String,
value: ''
},
currentIcon: {
type: String,
value: ''
},
img: {
type: String,
value: ''
},
currentImg: {
type: String,
value: ''
},
key: {
type: String,
value: ''
},
title: {
type: String,
value: ''
},
dot: {
type: Boolean,
value: false
},
count: {
type: Number,
value: 0
}
},
data: {
current: false,
currentColor: ''
},
methods: {
changeCurrent (current) {
this.setData({ current });
},
changeCurrentColor (currentColor) {
this.setData({ currentColor });
},
handleClickItem () {
const parent = this.getRelationNodes('../tab-bar/index')[0];
parent.emitEvent(this.data.key);
}
}
});
{
"component": true,
"usingComponents":
{
"i-badge": "../badge/index",
"i-icon": "../icon/index"
}
}
<view class="i-class i-tab-bar-item">
<i-badge dot="{{ dot }}" count="{{ dot ? 0 : count }}">
<view>
<i-icon wx:if="{{ icon || currentIcon }}" i-class="i-tab-bar-item-icon {{ current ? 'item-index--i-tab-bar-item-icon-current' : '' }}" color="{{ current ? currentColor : '' }}" type="{{ current ? currentIcon : icon }}" size="22"></i-icon>
<image wx:else class="i-tab-bar-item-img" src="{{ current ? currentImg : img }}"></image>
<view class="i-tab-bar-item-title {{ current ? 'i-tab-bar-item-title-current' : '' }}" wx:if="{{ current && currentColor }}" style="color: {{ currentColor }}">{{ title }}</view>
<view class="i-tab-bar-item-title {{ current ? 'i-tab-bar-item-title-current' : '' }}" wx:else>{{ title }}</view>
</view>
</i-badge>
</view>
\ No newline at end of file
.i-tab-bar-item{flex:1;display:flex;width:100%;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;text-align:center}.i-tab-bar-item-icon{display:flex;-webkit-box-pack:center;justify-content:center;box-sizing:border-box;color:#80848f}.i-tab-bar-item-icon-current{color:#2d8cf0}.i-tab-bar-item-img{display:flex;-webkit-box-pack:center;justify-content:center;box-sizing:border-box;width:22px;height:22px}.i-tab-bar-item-title{font-size:10px;margin:3px 0 0;line-height:1;text-align:center;box-sizing:border-box;color:#80848f}.i-tab-bar-item-title-current{color:#2d8cf0}.i-tab-bar-item-img{display:flex;-webkit-box-pack:center;justify-content:center;box-sizing:border-box;color:#80848f}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
relations: {
'../tab-bar-item/index': {
type: 'child',
linked () {
this.changeCurrent();
},
linkChanged () {
this.changeCurrent();
},
unlinked () {
this.changeCurrent();
}
}
},
properties: {
current: {
type: String,
value: '',
observer: 'changeCurrent'
},
color: {
type: String,
value: ''
},
fixed: {
type: Boolean,
value: false
}
},
data: {
list: []
},
methods: {
changeCurrent (val = this.data.current) {
let items = this.getRelationNodes('../tab-bar-item/index');
const len = items.length;
if (len > 0) {
const list = [];
items.forEach(item => {
item.changeCurrent(item.data.key === val);
item.changeCurrentColor(this.data.color);
list.push({
key: item.data.key
});
});
this.setData({
list: list
});
}
},
emitEvent (key) {
this.triggerEvent('change', { key });
},
handleClickItem (e) {
const key = e.currentTarget.dataset.key;
this.emitEvent(key);
}
}
});
{
"component": true
}
<view class="i-class i-tab-bar {{ fixed ? 'i-tab-bar-fixed' : '' }}">
<slot></slot>
<view class="i-tab-bar-list">
<view class="i-tab-bar-layer" wx:for="{{ list }}" wx:key="{{ item.key }}" data-key="{{ item.key }}" bindtap="handleClickItem" style="width: {{ 100 / list.length }}%"></view>
</view>
</view>
\ No newline at end of file
.i-tab-bar{display:flex;width:100%;height:50px;box-sizing:border-box;position:relative;justify-content:space-around;align-items:center;-webkit-box-align:center;background:#fff}.i-tab-bar::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-top-width:1px}.i-tab-bar-fixed{position:fixed;bottom:0;z-index:2}.i-tab-bar-list{position:absolute;top:0;bottom:0;left:0;right:0}.i-tab-bar-layer{display:block;float:left;height:100%}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
relations: {
'../tabs/index': {
type: 'parent'
}
},
properties: {
key: {
type: String,
value: ''
},
title: {
type: String,
value: ''
},
dot: {
type: Boolean,
value: false
},
count: {
type: Number,
value: 0
}
},
data: {
current: false,
currentColor: '',
scroll: false
},
methods: {
changeCurrent (current) {
this.setData({ current });
},
changeCurrentColor (currentColor) {
this.setData({ currentColor });
},
changeScroll (scroll) {
this.setData({ scroll });
},
handleClickItem () {
const parent = this.getRelationNodes('../tabs/index')[0];
parent.emitEvent(this.data.key);
}
}
});
{
"component": true,
"usingComponents":
{
"i-badge": "../badge/index"
}
}
<view class="i-class i-tabs-tab {{ scroll ? 'i-tabs-tab-scroll' : '' }} {{ current ? 'i-tabs-tab-current' : '' }}">
<i-badge dot="{{ dot }}" count="{{ dot ? 0 : count }}">
<view bindtap="handleClickItem">
<view class="i-tabs-tab-title {{ current ? 'i-tabs-tab-title-current' : '' }}" wx:if="{{ current && currentColor }}" style="color: {{ currentColor }}">{{ title }}</view>
<view class="i-tabs-tab-title {{ current ? 'i-tabs-tab-title-current' : '' }}" wx:else>{{ title }}</view>
</view>
</i-badge>
<view class="i-tabs-tab-bar" wx:if="{{ current }}" style="background: {{ currentColor }}"></view>
</view>
\ No newline at end of file
.i-tabs-tab{flex:1;display:flex;width:100%;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;text-align:center;position:relative}.i-tabs-tab-bar{display:block;width:100%;height:2px;background:0 0;position:absolute;bottom:0;left:0;background:#2d8cf0}.i-tabs-tab-title{font-size:14px;text-align:center;box-sizing:border-box;color:#80848f}.i-tabs-tab-title-current{color:#2d8cf0}.i-tabs-tab-scroll{display:inline-block;width:60px}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
relations: {
'../tab/index': {
type: 'child',
linked () {
this.changeCurrent();
},
linkChanged () {
this.changeCurrent();
},
unlinked () {
this.changeCurrent();
}
}
},
properties: {
current: {
type: String,
value: '',
observer: 'changeCurrent'
},
color: {
type: String,
value: ''
},
scroll: {
type: Boolean,
value: false
},
fixed: {
type: Boolean,
value: false
}
},
methods: {
changeCurrent (val = this.data.current) {
let items = this.getRelationNodes('../tab/index');
const len = items.length;
if (len > 0) {
items.forEach(item => {
item.changeScroll(this.data.scroll);
item.changeCurrent(item.data.key === val);
item.changeCurrentColor(this.data.color);
});
}
},
emitEvent (key) {
this.triggerEvent('change', { key });
}
}
});
{
"component": true
}
<scroll-view wx:if="{{ scroll }}" scroll-x="true" class="i-class i-tabs i-tabs-scroll {{ fixed ? 'i-tabs-fixed' : '' }}"><slot></slot></scroll-view>
<view wx:else class="i-class i-tabs {{ fixed ? 'i-tabs-fixed' : '' }}"><slot></slot></view>
\ No newline at end of file
.i-tabs{display:flex;width:100%;height:42px;line-height:42px;box-sizing:border-box;position:relative;justify-content:space-around;align-items:center;-webkit-box-align:center;background:#fff}.i-tabs::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px}.i-tabs-scroll{display:block;overflow-x:auto;white-space:nowrap}.i-tabs-fixed{position:fixed;top:0;z-index:2}
\ No newline at end of file
Component({
externalClasses: ['i-class'],
properties : {
//slot name
name : {
type : String,
value : ''
},
//can click or not click
checkable : {
type : Boolean,
value : false
},
//is current choose
checked : {
type : Boolean,
value : true
},
//background and color setting
color : {
type : String,
value : 'default'
},
//control fill or not
type : {
type : String,
value : 'dot'
}
},
methods : {
tapTag(){
const data = this.data;
if( data.checkable ){
const checked = data.checked ? false : true;
this.triggerEvent('change',{
name : data.name || '',
checked : checked
});
}
}
}
})
\ No newline at end of file
{
"component" : true
}
\ No newline at end of file
<view
class="i-class i-tag {{ parse.getClass(color,type,checked,checkable) }} {{checkable ? '' : 'i-tag-disable'}}"
bindtap="tapTag">
<slot></slot>
</view>
<wxs module="parse">
module.exports = {
getClass : function(color,type,checked,checkable) {
var initColorList = ['blue', 'green', 'red', 'yellow', 'default'];
var theme = '';
var className = 'i-tag-';
if( initColorList.indexOf( color ) > -1 ){
theme = className + color;
}
if( type === 'border' ){
theme = className+color+'-border';
}
if( checkable && checked ){
theme = className+color+'-checked';
}else if( checkable && !checked ){
theme = ( type === 'border' ? className + color +'-border' : className+'none' );
}
return theme;
}
}
</wxs>
\ No newline at end of file
.i-tag{display:inline-block;height:18px;line-height:18px;padding:0 4px;border-radius:2px;background:#fff;font-size:11px;vertical-align:middle;border:1rpx solid #dddee1}.i-tag-none{border-color:#fff}.i-tag-default{border-color:#dddee1;background:#e9eaec}.i-tag-red{background:#ed3f14;color:#fff}.i-tag-red-border{color:#ed3f14;background:#fff;border-color:#ed3f14}.i-tag-red-checked{background:#ed3f14;color:#fff;border-color:#ed3f14}.i-tag-green{background:#19be6b;color:#fff;border-color:#19be6b}.i-tag-green-border{color:#19be6b;background:#fff;border-color:#19be6b}.i-tag-green-checked{background:#19be6b;color:#fff;border-color:#19be6b}.i-tag-blue{background:#2d8cf0;color:#fff;border-color:#2d8cf0}.i-tag-blue-border{color:#2d8cf0;background:#fff;border-color:#2d8cf0}.i-tag-blue-checked{background:#2d8cf0;color:#fff;border-color:#2d8cf0}.i-tag-yellow{background:#f90;color:#fff;border-color:#f90}.i-tag-yellow-border{color:#f90;background:#fff;border-color:#f90}.i-tag-yellow-checked{background:#f90;color:#fff;border-color:#f90}.i-tag-default-checked{background:#e9eaec;color:#495060;border-color:#e9eaec}
\ No newline at end of file
const default_data = {
visible: false,
content: '',
icon: '',
image: '',
duration: 2,
mask: true,
type: 'default', // default || success || warning || error || loading
};
let timmer = null;
Component({
externalClasses: ['i-class'],
data: {
...default_data
},
methods: {
handleShow (options) {
const { type = 'default', duration = 2 } = options;
this.setData({
...options,
type,
duration,
visible: true
});
const d = this.data.duration * 1000;
if (timmer) clearTimeout(timmer);
if (d !== 0) {
timmer = setTimeout(() => {
this.handleHide();
timmer = null;
}, d);
}
},
handleHide () {
this.setData({
...default_data
});
}
}
});
{
"component": true,
"usingComponents":
{
"i-icon": "../icon/index"
}
}
<view class="i-toast-mask" wx:if="{{ visible && mask }}" bindtap="handleHide"></view>
<view class="i-class i-toast" wx:if="{{ visible }}">
<block wx:if="{{ type !== 'default' }}">
<view class="i-toast-type">
<i-icon i-class="i-toast-icon" type="success" wx:if="{{ type === 'success' }}"></i-icon>
<i-icon i-class="i-toast-icon" type="prompt" wx:elif="{{ type === 'warning' }}"></i-icon>
<i-icon i-class="i-toast-icon" type="delete" wx:elif="{{ type === 'error' }}"></i-icon>
<view class="i-toast-icon i-toast-loading" wx:elif="{{ type === 'loading' }}"></view>
</view>
</block>
<block wx:else>
<i-icon i-class="i-toast-icon" type="{{ icon }}" wx:if="{{ icon }}"></i-icon>
<image class="i-toast-image" src="{{ image }}" wx:if="{{ image }}" mode="aspectFit"></image>
</block>
<view class="i-toast-content" wx:if="{{ content }}">{{ content }}</view>
</view>
\ No newline at end of file
.i-toast{position:fixed;top:35%;left:50%;transform:translate3d(-50%,-50%,0);background:rgba(0,0,0,.7);color:#fff;font-size:14px;line-height:1.5em;margin:0 auto;box-sizing:border-box;padding:10px 18px;text-align:center;border-radius:4px;z-index:1010}.i-toast-mask{position:fixed;top:0;bottom:0;left:0;right:0;z-index:1010}.i-toast-icon{font-size:38px!important;margin-bottom:6px}.i-toast-image{max-width:100px;max-height:100px}.i-toast-loading{display:inline-block;vertical-align:middle;width:28px;height:28px;background:0 0;border-radius:50%;border:2px solid #fff;border-color:#fff #fff #fff #2d8cf0;animation:btn-spin .8s linear;animation-iteration-count:infinite}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}
\ No newline at end of file
// pages/index/apply/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{}
\ No newline at end of file
<!--pages/index/apply/index.wxml-->
<text>pages/index/apply/index.wxml</text>
/* pages/index/apply/index.wxss */
\ No newline at end of file
// pages/auth/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{}
\ No newline at end of file
<!--pages/auth/index.wxml-->
<text>pages/auth/index.wxml</text>
/* pages/auth/index.wxss */
\ No newline at end of file
// /pages/common.wxs
var formatDate = function (date, identity) {
var date = getDate(date)
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
var ident = identity ? '.' : '-'
return [year, month, day].map(formatNumber).join(identity)
}
var formatDateTime = function (date) {
var date = getDate(date)
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
var hour = date.getHours()
var minute = date.getMinutes()
var second = date.getSeconds()
return [year, month, day].map(formatNumber).join('.') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
var formatNumber = function (n) {
n = n.toString()
return n[1] ? n : '0' + n
}
/**
* 秒转分
*/
var secToMinu = function (second) {
return Math.round(second / 60)
}
/**
* 性别文字转换
*/
var formatSex = function (sex) {
if (1 == sex) {
return '男'
} else if (2 == sex) {
return '女'
} else {
return '未知'
}
}
/**
* 数值保留小数位
*/
var numFixed = function (num, fixed) {
var fixed = typeof fixed === 'number' ? fixed : 0;
return parseFloat(num).toFixed(fixed);
}
/**
* 根据两点经纬度计算距离
*/
var getDistance = function (lat1, lng1, lat2, lng2) {
lat1 = lat1 || 0;
lng1 = lng1 || 0;
lat2 = lat2 || 0;
lng2 = lng2 || 0;
var rad1 = lat1 * Math.PI / 180.0;
var rad2 = lat2 * Math.PI / 180.0;
var a = rad1 - rad2;
var b = lng1 * Math.PI / 180.0 - lng2 * Math.PI / 180.0;
var r = 6378137;
var d = r * 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(rad1) * Math.cos(rad2) * Math.pow(Math.sin(b / 2), 2)));
if (d >= 1000) {
d = d / 1000;
return d.toFixed(2) + 'km';
} else {
return d.toFixed(0) + 'm';
}
}
var nextLevel = function (n) {
return parseInt(n) + 1
}
module.exports = {
formatDate: formatDate,
formatDateTime: formatDateTime,
formatSex: formatSex,
numFixed: numFixed,
getDistance: getDistance,
nextLevel: nextLevel,
secToMinu: secToMinu
};
\ No newline at end of file
// pages/guide/detail/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "攻略详情"
}
\ No newline at end of file
<!--pages/guide/detail/index.wxml-->
<text>pages/guide/detail/index.wxml</text>
/* pages/guide/detail/index.wxss */
\ No newline at end of file
// pages/guide/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"navigationBarTitleText": "美行攻略"
}
\ No newline at end of file
<!--pages/guide/index.wxml-->
<text>pages/guide/index.wxml</text>
/* pages/guide/index.wxss */
\ No newline at end of file
// pages/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{}
\ No newline at end of file
<!--pages/index.wxml-->
<text>pages/index.wxml</text>
/* pages/index.wxss */
\ No newline at end of file
// pages/me/collection/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{}
\ No newline at end of file
<!--pages/me/collection/index.wxml-->
<text>pages/me/collection/index.wxml</text>
/* pages/me/collection/index.wxss */
\ No newline at end of file
// pages/me/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{}
\ No newline at end of file
<!--pages/me/index.wxml-->
<text>pages/me/index.wxml</text>
/* pages/me/index.wxss */
\ No newline at end of file
// pages/me/order/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{}
\ No newline at end of file
<!--pages/me/order/index.wxml-->
<text>pages/me/order/index.wxml</text>
/* pages/me/order/index.wxss */
\ No newline at end of file
// pages/me/profile/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{}
\ No newline at end of file
<!--pages/me/profile/index.wxml-->
<text>pages/me/profile/index.wxml</text>
/* pages/me/profile/index.wxss */
\ No newline at end of file
// pages/me/vip/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{}
\ No newline at end of file
<!--pages/me/vip/index.wxml-->
<text>pages/me/vip/index.wxml</text>
/* pages/me/vip/index.wxss */
\ No newline at end of file
// pages/index/reserve/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{}
\ No newline at end of file
<!--pages/index/reserve/index.wxml-->
<text>pages/index/reserve/index.wxml</text>
/* pages/index/reserve/index.wxss */
\ No newline at end of file
// pages/search/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{}
\ No newline at end of file
<!--pages/search/index.wxml-->
<text>pages/search/index.wxml</text>
/* pages/search/index.wxss */
\ No newline at end of file
// pages/webview/index.js
Page({
/**
* 页面的初始数据
*/
data: {
url: '',
title: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that = this
if (options.url) {
that.setData({
url: options.url,
title: options.t
})
wx.setNavigationBarTitle({
title: options.t ? options.t : 'KT精选推荐',
})
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (options) {
let that = this
return {
title: that.data.title,
path: '/pages/webview/index?url=' + that.data.url,
success: function (res) { }
}
}
})
\ No newline at end of file
{
"navigationBarTitleText": "详情"
}
\ No newline at end of file
<!--pages/webview/index.wxml-->
<web-view class='webview' src="{{url}}"></web-view>
\ No newline at end of file
/* pages/webview/index.wxss */
{
"description": "项目配置文件",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": true,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true,
"nodeModules": false
},
"compileType": "miniprogram",
"libVersion": "2.3.0",
"appid": "wx014e1af15c2a641e",
"projectname": "qz-tour",
"debugOptions": {
"hidedInDevtools": []
},
"isGameTourist": false,
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"current": 0,
"list": [
{
"id": -1,
"name": "logs",
"pathName": "pages/logs/logs"
}
]
}
}
}
\ No newline at end of file
import Util from './Util.js'
const METHOD = {
GET: 'GET',
POST: 'POST',
PUT: 'PUT',
DELETE: 'DELETE'
}
class Request {
_header = {
token: null
}
_baseUrl = null
interceptors = []
constructor() {
const token = wx.getStorageSync('token')
if (token) {
this._header.token = token
}
}
intercept(res) {
return this.interceptors
.filter(f => typeof f === 'function')
.every(f => f(res))
}
request({
url,
method,
header = {},
data
}) {
return new Promise((resolve, reject) => {
wx.request({
url: (this._baseUrl || '') + url,
method: method || METHOD.GET,
data: data,
header: {
...this._header,
...header
},
success: res => this.intercept(res) && resolve(res),
fail: reject
})
})
}
get(url, data, header) {
return this.request({
url,
method: METHOD.GET,
header,
data
})
}
post(url, data, header) {
return this.request({
url,
method: METHOD.POST,
header,
data: Util.sign(data)
})
}
put(url, data, header) {
return this.request({
url,
method: METHOD.PUT,
header,
data
})
}
delete(url, data, header) {
return this.request({
url,
method: METHOD.DELETE,
header,
data
})
}
token(token) {
this._header.token = token
return this
}
header(header) {
this._header = header
return this
}
baseUrl(baseUrl) {
this._baseUrl = baseUrl
return this
}
interceptor(f) {
if (typeof f === 'function') {
this.interceptors.push(f)
}
return this
}
}
export default new Request
export {
METHOD
}
\ No newline at end of file
export default class Schedule {
constructor() {
this._delay = 0
this.p = null
}
timer(task, ms) {
return new Promise((resolve, reject) => {
setTimeout(() => {
task && task()
resolve()
}, ms)
})
}
task(task) {
const {
_delay: delay,
timer,
p
} = this
this.p = p ? p.then(() => timer(task, delay)) : timer(task, delay)
return this
}
delay(_delay) {
this._delay = _delay
return this
}
}
\ No newline at end of file
const CryptoJS = require('./crypto-js');
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : '0' + n
}
const formatDuring = s => {
const days = parseInt(s / (60 * 60 * 24))
const hours = parseInt((s % (60 * 60 * 24)) / (60 * 60))
const minutes = parseInt((s % (60 * 60)) / (60))
const seconds = (s % (60))
if (days > 0) {
return formatNumber(days) + '天 ' + formatNumber(hours) + ':' + formatNumber(minutes) + ':' + formatNumber(seconds)
} else if (hours > 0) {
return formatNumber(hours) + ':' + formatNumber(minutes) + ':' + formatNumber(seconds)
} else {
return formatNumber(minutes) + ':' + formatNumber(seconds)
}
}
/**
* 获取当前日期
*/
const getCurrentDate = () => {
const date = new Date()
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
return [year, month, day].map(formatNumber).join('-')
}
/**
* 获取精确到秒的时间戳 10位
*/
const getTimastamp = () => {
return Math.round(Date.parse(new Date()) / 1000);
}
/**
* 生成随机id
*/
const getRandomId = () => {
return Math.round(Date.parse(new Date()));
}
/**
* 去除字符串两端空白
*/
function trim(str) {
return str.replace(/(^\s*)|(\s*$)/g, "")
}
/**
* md5
*/
const md5 = str => {
return CryptoJS.MD5(str).toString(CryptoJS.enc.Hex)
}
/**
* sha1
*/
const sha1 = str => {
return CryptoJS.SHA1(str).toString(CryptoJS.enc.Hex)
}
/**
* sha256
*/
const sha256 = str => {
return CryptoJS.SHA256(str).toString(CryptoJS.enc.Hex)
}
/**
* params object sort to String
*/
const objToStr = obj => {
// 对参数名进行字典排序
let params = [];
for (let key in obj) {
params.push(key);
}
params.sort();
// 拼接有序的参数名-值串
let str = '';
params.forEach((val, idx, arr) => {
str += (val + "=" + obj[val])
})
return str
}
/**
* 加密请求数据
*/
const sign = obj => {
let timestamp = getTimastamp()
let signature = sha1(objToStr({
...obj,
timestamp
}))
return {
...obj,
timestamp,
sign: signature
}
}
/**
* 随机获取hex颜色值
*/
const getRandomColor = () => {
let rgb = []
for (let i = 0; i < 3; ++i) {
let color = Math.floor(Math.random() * 256).toString(16)
color = color.length == 1 ? '0' + color : color
rgb.push(color)
}
return '#' + rgb.join('')
}
/**
* 判断字符串类型
* @param {内容} s
*/
const isString = (s) => {
return (typeof s === 'string') && (Object.prototype.toString.call(s) === '[object String]')
}
/**
* 判断数字类型
* @param {内容} n
*/
const isNumber = (n) => {
return (typeof n === 'number') && (Object.prototype.toString.call(n) === '[object Number]')
}
/**
* 判断数组类型
* @param {内容} a
*/
const isArray = (a) => {
return (typeof a === 'object') && (Object.prototype.toString.call(a) === '[object Array]')
}
/**
* 判断对象类型
* @param {内容} o
*/
const isObject = (o) => {
return (typeof o === 'object') && (Object.prototype.toString.call(o) === '[object Object]')
}
/**
* 判断函数类型
* @param {内容} f
*/
const isFunc = (f) => {
return (typeof f === 'function') && (Object.prototype.toString.call(f) === '[object Function]')
}
/**
* 判断 Boolean 类型
* @param {内容} b
*/
const isBoolean = (b) => {
return (typeof b === 'boolean') && (Object.prototype.toString.call(b) === '[object Boolean]')
}
/**
* 判断 Undefined 类型
* @param {内容} u
*/
const isUndefined = (u) => {
return (typeof u === 'undefined') && (Object.prototype.toString.call(u) === '[object Undefined]')
}
/**
* 判断 Null 类型
* @param {内容} n
*/
const isNull = (n) => {
return (typeof n === 'object') && (Object.prototype.toString.call(n) === '[object Null]')
}
/**
* 去除字符串前面的空格
* @param {字符串} s
*/
const ltrim = (s) => {
if (!isString(s)) {
throw new Error('string must be given')
}
return s.replace(/(^\s*)/g, '')
}
/**
* 去除字符串后面的空格
* @param {字符串} s
*/
const rtrim = (s) => {
if (!isString(s)) {
throw new Error('string must be given')
}
return s.replace(/(\s*$)/g, '')
}
/**
* 检查某对象是否在数组中
* @param {被查询的数组} arr
* @param {被检测的对象} obj
*/
const inArray = (arr, obj) => {
if (!isArray(arr)) {
throw new Error('array must be given')
}
if (isNull(obj) || isUndefined(obj)) {
throw new Error('the value to be found must be provided')
}
var len = arr.length
while (len--) {
if (arr[len] === obj) {
return true
}
}
return false
}
module.exports = {
formatTime: formatTime,
getCurrentDate: getCurrentDate,
formatDuring: formatDuring,
trim: trim,
md5: md5,
sha1: sha1,
sha256: sha256,
objToStr: objToStr,
getTimastamp: getTimastamp,
getRandomId: getRandomId,
sign: sign,
getRandomColor: getRandomColor,
isString: isString,
isNumber: isNumber,
isArray: isArray,
isNull: isNull,
isObject: isObject,
isFunc: isFunc,
isBoolean: isBoolean,
isUndefined: isUndefined,
inArray: inArray,
ltrim: ltrim,
rtrim: rtrim
}
function f(func, obj) {
return new Promise((resolve, reject) => {
func({
...obj,
success: resolve,
fail: reject
})
})
}
export default {
// 界面交互
showToast: obj => f(wx.showToast, obj),
showLoading: obj => f(wx.showLoading, obj),
showModal: obj => f(wx.showModal, obj),
showActionSheet: obj => f(wx.showActionSheet, obj),
// 导航条
setNavigationBarTitle: obj => f(wx.setNavigationBarTitle, obj),
setNavigationBarColor: obj => f(wx.setNavigationBarColor, obj),
setTopBarText: obj => f(wx.setTopBarText, obj),
// 导航
navigateTo: obj => f(wx.navigateTo, obj),
redirectTo: obj => f(wx.redirectTo, obj),
switchTab: obj => f(wx.switchTab, obj),
reLaunch: obj => f(wx.reLaunch, obj),
// 用户相关
login: obj => f(wx.login, obj),
checkSession: obj => f(wx.checkSession, obj),
authorize: obj => f(wx.authorize, obj),
getUserInfo: obj => f(wx.getUserInfo, obj),
// 支付
requestPayment: obj => f(wx.requestPayment, obj),
// 图片
chooseImage: obj => f(wx.chooseImage, obj),
previewImage: obj => f(wx.previewImage, obj),
getImageInfo: obj => f(wx.getImageInfo, obj),
saveImageToPhotosAlbum: obj => f(wx.saveImageToPhotosAlbum, obj),
// 文件
uploadFile: obj => f(wx.uploadFile, obj),
downloadFile: obj => f(wx.downloadFile, obj),
// 录音
startRecord: obj => f(wx.startRecord, obj),
// 音频播放
playVoice: obj => f(wx.playVoice, obj),
// 音乐播放
getBackgroundAudioPlayerState: obj => f(wx.getBackgroundAudioPlayerState, obj),
playBackgroundAudio: obj => f(wx.playBackgroundAudio, obj),
seekBackgroundAudio: obj => f(wx.seekBackgroundAudio, obj),
// 视频
chooseVideo: obj => f(wx.chooseVideo, obj),
saveVideoToPhotosAlbum: obj => f(wx.saveVideoToPhotosAlbum, obj),
// 文件
saveFile: obj => f(wx.saveFile, obj),
getFileInfo: obj => f(wx.getFileInfo, obj),
getSavedFileList: obj => f(wx.getSavedFileList, obj),
getSavedFileInfo: obj => f(wx.getSavedFileInfo, obj),
removeSavedFile: obj => f(wx.removeSavedFile, obj),
openDocument: obj => f(wx.openDocument, obj),
// 数据缓存
setStorage: obj => f(wx.setStorage, obj),
getStorage: obj => f(wx.getStorage, obj),
getStorageInfo: obj => f(wx.getStorageInfo, obj),
removeStorage: obj => f(wx.removeStorage, obj),
// 位置
getLocation: obj => f(wx.getLocation, obj),
chooseLocation: obj => f(wx.chooseLocation, obj),
openLocation: obj => f(wx.openLocation, obj),
// 设备
getSystemInfo: obj => f(wx.getSystemInfo, obj),
getNetworkType: obj => f(wx.getNetworkType, obj),
startAccelerometer: obj => f(wx.startAccelerometer, obj),
stopAccelerometer: obj => f(wx.stopAccelerometer, obj),
startCompass: obj => f(wx.startCompass, obj),
stopCompass: obj => f(wx.stopCompass, obj),
// 打电话
makePhoneCall: obj => f(wx.makePhoneCall, obj),
// 扫码
scanCode: obj => f(wx.scanCode, obj),
// 剪切板
setClipboardData: obj => f(wx.setClipboardData, obj),
getClipboardData: obj => f(wx.getClipboardData, obj),
//蓝牙
openBluetoothAdapter: obj => f(wx.openBluetoothAdapter, obj),
closeBluetoothAdapter: obj => f(wx.closeBluetoothAdapter, obj),
getBluetoothAdapterState: obj => f(wx.getBluetoothAdapterState, obj),
startBluetoothDevicesDiscovery: obj => f(wx.startBluetoothDevicesDiscovery, obj),
stopBluetoothDevicesDiscovery: obj => f(wx.stopBluetoothDevicesDiscovery, obj),
getBluetoothDevices: obj => f(wx.getBluetoothDevices, obj),
getConnectedBluetoothDevices: obj => f(wx.getConnectedBluetoothDevices, obj),
createBLEConnection: obj => f(wx.createBLEConnection, obj),
closeBLEConnection: obj => f(wx.closeBLEConnection, obj),
getBLEDeviceServices: obj => f(wx.getBLEDeviceServices, obj),
// iBeacon
startBeaconDiscovery: obj => f(wx.startBeaconDiscovery, obj),
stopBeaconDiscovery: obj => f(wx.stopBeaconDiscovery, obj),
getBeacons: obj => f(wx.getBeacons, obj),
// 屏幕亮度
setScreenBrightness: obj => f(wx.setScreenBrightness, obj),
getScreenBrightness: obj => f(wx.getScreenBrightness, obj),
setKeepScreenOn: obj => f(wx.setKeepScreenOn, obj),
// 振动
vibrateLong: obj => f(wx.vibrateLong, obj),
vibrateShort: obj => f(wx.vibrateShort, obj),
// 联系人
addPhoneContact: obj => f(wx.addPhoneContact, obj),
// NFC
getHCEState: obj => f(wx.getHCEState, obj),
startHCE: obj => f(wx.startHCE, obj),
stopHCE: obj => f(wx.stopHCE, obj),
sendHCEMessage: obj => f(wx.sendHCEMessage, obj),
// Wi-Fi
startWifi: obj => f(wx.startWifi, obj),
stopWifi: obj => f(wx.stopWifi, obj),
connectWifi: obj => f(wx.connectWifi, obj),
getWifiList: obj => f(wx.getWifiList, obj),
setWifiList: obj => f(wx.setWifiList, obj),
getConnectedWifi: obj => f(wx.getConnectedWifi, obj),
// 第三方平台
getExtConfig: obj => f(wx.getExtConfig, obj),
// 转发
showShareMenu: obj => f(wx.showShareMenu, obj),
hideShareMenu: obj => f(wx.hideShareMenu, obj),
updateShareMenu: obj => f(wx.updateShareMenu, obj),
getShareInfo: obj => f(wx.getShareInfo, obj),
// 收货地址
chooseAddress: obj => f(wx.chooseAddress, obj),
// 卡券
addCard: obj => f(wx.addCard, obj),
openCard: obj => f(wx.openCard, obj),
// 设置
openSetting: obj => f(wx.openSetting, obj),
getSetting: obj => f(wx.getSetting, obj),
// 微信运动
getWeRunData: obj => f(wx.getWeRunData, obj),
// 打开小程序
navigateToMiniProgram: obj => f(wx.navigateToMiniProgram, obj),
navigateBackMiniProgram: obj => f(wx.navigateBackMiniProgram, obj),
// 获取发票抬头
chooseInvoiceTitle: obj => f(wx.chooseInvoiceTitle, obj),
// 生物认证
checkIsSupportSoterAuthentication: obj => f(wx.checkIsSupportSoterAuthentication, obj),
startSoterAuthentication: obj => f(wx.startSoterAuthentication, obj),
checkIsSoterEnrolledInDevice: obj => f(wx.checkIsSoterEnrolledInDevice, obj)
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment