Commit 09a9dcd5 by wangying

1.1.2 / 2017-11-03

==================
 * 1.修改门锁管理、关联开锁信息、绑定开锁信息、邀请绑定页面样式
 * 2.添加产品型号页面
parent b61259fe
1.1.1 / 2017-10-18
1.1.2 / 2017-11-03
==================
* 1.修改门锁管理、关联开锁信息、绑定开锁信息、邀请绑定页面样式
* 2.添加产品型号页面
1.1.1 / 2017-10-18
==================
* 1.修改列表为空样式
......
......@@ -54,9 +54,13 @@
"userList": "用户列表",
"doorlockUser": "门锁用户",
"addUser": "添加用户",
"editName": "修改名称",
"inviteBind": "邀请绑定",
"unlockInfo": "绑定开锁信息"
"unlockInfo": "关联开锁信息",
"myInfo": "个人信息",
"editNickname": "修改昵称",
"editPassword": "修改密码",
"addUnlockInfo": "绑定开锁信息",
"deviceList": "产品型号"
},
"guide":{
"footer": "指纹改变生活"
......@@ -66,6 +70,7 @@
"passwordInputTip": "请输入密码",
"register": "快速注册",
"forgetPassword": "忘记密码",
"failure": "登陆失败",
"error": {
"telNull": "请输入手机号",
"passWordNull": "请输入密码"
......@@ -102,32 +107,62 @@
"followCont1": "关注 “i智信” 微信服务号可随时随地掌握设备动态<br>再也不担心错过重要通知,赶紧按下方提示试试吧",
"followCont2": "1.保存二维码-2.用微信从<span>相册选取扫码</span>-3.关注",
"laterFollow": "稍后关注",
"newMsgDoorlock": "门锁最新消息",
"doorLockRinging": "门铃响了",
"defaultNewMsg": "您尚未绑定门锁",
"noNewMsg": "门锁休息中",
"bindDoorlock": "绑定门锁"
},
"opendoorRecord":{
"noRecordTip": "暂无记录"
"noRecordTip": "暂无记录",
"passwordOpenDoor": "密码开门",
"fingerprintOpenDoor": "指纹开门",
"ICcardOpenDoor": "IC卡开门",
"remoteOpenDoor": "遥控器开门",
"keyOpenDoor": "钥匙开门",
"hijackingAlarm": "劫持报警",
"appRemoteOpenDoor": "app远程开门"
},
"alarmInfo":{
"noInfoTip": "暂无信息"
"noInfoTip": "暂无信息",
"tamperAlarm": "防撬报警",
"trialAlarm": "试错报警",
"powerAlarm": "欠电报警",
"fackLockAlram": "假锁报警"
},
"remoteOpendoor":{
"loading": "远程开门中",
"passwordInputTip": "请输入远程开门密码",
"openDoorSuccess": "远程开门成功",
"openDoorFailure": "远程开门失败",
"remoteOpendoorAgain": "请尝试重试",
"error": {
"noPasswordTip": "远程密码不能为空"
}
},
"hijackRecord":{
"noRecordTip": "暂无记录"
"noRecordTip": "暂无记录",
"hijackingAlarm": "劫持指纹报警"
},
"doorlockManage":{
"name": "名称",
"deleteDialogTip": "<span>{0}</span>将被删除",
"logoutDialogTip": "确定要退出系统吗?",
"deleteSuccess": "删除成功",
"deleteFailue": "删除失败",
"defaultNickname": "门锁",
"unbindDialogTip": "<span></span>解锁门锁后,您将失去对该门锁<br>所有查看、管理等功能操作",
"unbindSuccess": "解绑成功"
"unbindSuccess": "解绑成功",
"doorbellMsgPush": "门铃消息推送",
"alarmMsgPush": "报警消息推送",
"opendoorMsgPush": "开门消息推送"
},
"editName":{
"nameInputTip": "请输入门锁名称",
"editNameSuccess": "名字修改成功",
"editNameFailue": "名字修改失败",
"error": {
"nameCanNotBeBlank": "昵称不能为空"
}
},
"qrcode":{
......@@ -139,7 +174,11 @@
},
"addDevice": {
"scanCodeAdd": "扫描绑定设备",
"wifiAdd": "配置Wi-Fi"
"wifiAdd": "配置Wi-Fi",
"loading": "loading",
"bindSuccess": "绑定成功",
"bindFailure": "绑定失败",
"reBindDevice": "请重新绑定"
},
"wifiAddHelp": {
"helpTitle": "配置Wi-Fi说明:",
......@@ -193,46 +232,93 @@
},
"addUser":{
"nameInputTip": "请输入您想添加的用户名",
"addUserSuccess": "添加用户成功",
"addUserFailure": "添加用户失败",
"error": {
"nameCanNotEmpty": "用户名不能为空"
}
},
"doorlockUser":{
"name": "昵称:",
"inviteBind": "邀请绑定",
"bindUnlockInfo": "绑定开锁信息",
"bindUnlockInfo": "关联开锁信息",
"opendoorRecord": "历史开门记录",
"unbindDialogTip": "<span></span>解绑后,您将失去对门锁所有查看功能该用户仍在用户列表中",
"deleteUserDialogTip": "删除后,二者不再为绑定关系,用户无法查看该门锁下的任何信息,该用户名下绑定的所有ID号仍可以显示在开门记录中",
"unbindSuccess": "解绑成功",
"unbindFailue": "解绑失败",
"guideStep1Tip1": "邀请绑定成功",
"guideStep1Tip2": "(可查看开门记录,报警记录等<br>相关门锁信息)",
"guideStep3Tip": "绑定后看可了解<br>该用户的开门情况"
"guideStep3Tip": "绑定后看可了解<br>该用户的开门情况",
"deleteSuccess": "删除成功",
"deleteFailure": "删除失败"
},
"editName":{
"nameInputTip": "请输入用户名",
"nameInputTip": "请输入设备名称",
"nickNameInputTip": "请输入用户名",
"editNameSuccess": "修改名称成功",
"editNameFailue": "修改名称失败",
"error": {
"nameCanNotBeBlank": "设备名称不能为空",
"nicknameCanNotBeBlank": "用户名不能为空"
}
},
"inviteBind":{
"qrcodeExpireTip": "二维码已过期,请重新生成",
"title": "注意事项:",
"cont1": "1.直接通过微信扫一扫添加门锁",
"cont2": "2.将此二维码保存为图片,发送给好友,好友通过长按识别二维码"
},
"unlockInfo":{
"bindUnlockInfo": "已绑定的开锁信息",
"noInfoTip": "目前无绑定任何信息,请添加"
"bindUnlockInfo": "已关联的开锁信息",
"noInfoTip": "目前无绑定任何信息,请添加",
"passwordOpenDoor": "密码",
"fingerprintOpenDoor": "指纹",
"ICcardOpenDoor": "IC卡",
"remoteOpenDoor": "遥控器",
"keyOpenDoor": "钥匙",
"appRemoteOpenDoor": "app远程",
"setHijack": "设为劫持",
"setHijackTip": "确认设为劫持指纹吗?",
"cancelHijack": "取消劫持",
"cancelHijackTip": "确认取消劫持指纹吗?",
"cancelAssociated": "取消关联",
"cancelAssociatedTip": "取消关联后,开门历史记录中将不再显示关联的用户信息"
},
"addUnlockInfo":{
"opendoorMode": "开门方式",
"opendoorMode": "选择要关联的开锁方式",
"fingerprint": "指纹",
"password": "密码",
"icCard": "IC卡",
"key": "钥匙",
"hijackFingerprint": "劫持指纹",
"opendoorRecord": "今日开门记录",
"opendoorRecord": "选择要关联的开锁ID",
"tip": "仅显示未绑定开门记录",
"noRecordTip": "暂无记录"
"addInfoSuccess": "添加绑定开锁信息成功",
"addInfoFailue": "添加绑定开锁信息失败",
"noRecordTip": "暂无记录",
"setHijackSwitch": "设为劫持指纹",
"guideStep1Tip": "选择需要添加关联的开门方式",
"guideStep3Tip": "根据开门记录中的开门时间,选择关联的<br>开门ID<span>(一个ID只能被一个用户绑定)</span>",
"guideStep5Tip": "使用劫持指纹开门时,会以报警形式<br>通知到该门锁名下的其他绑定用户"
},
"myInfo":{
"editNickname": "修改昵称",
"editPassword": "修改密码",
"logoutDialogTip": "确定要退出系统吗?"
},
"editNickname": {
"nickNameInputTip": "请输入昵称"
},
"editPassword": {
"newPasswordInputTip": "请输入新密码",
"oldPasswordInputTip": "请输入旧密码",
"oldPasswordInputTipAgain": "请再次输入旧密码"
},
"request":{
"error": "请求发送失败"
},
"deviceList":{
"model": "型号:"
}
}
\ No newline at end of file
/**
* v_deviceList.js
* Version: 0.1
* User: wy
* Date: 2017-11-03
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 产品型号页面
*/
import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init);
function init() {
//通用 list、dialog、loading组件
uPublic.componentsInit(['u-list','u-dialog','u-loading']);
const app = new Vue({
data:{
//配置组件
componentsConfig: initComponentsConfig()
},
mounted(){
},
methods:{
//tap <
onBackTap(){
backTap();
},
onDeviceListRowTap(){
deviceListRowTap();
}
}
}).$mount('#app');
}
//配置组件参数
function initComponentsConfig() {
let model = Vue.t('deviceList.model');
return {
deviceList:{
initParam: {
class: 'custom-device-list',
list: [
{leftImage: '../../resources/image/deviceImg.png', title:'智能门锁', subtitle: model + 'ABCDEFG',rightIcon: '&#xe6a7;'},
{leftImage: '../../resources/image/deviceImg.png', title:'智能门锁', subtitle: model + 'ABCDEFG',rightIcon: '&#xe6a7;'},
{leftImage: '../../resources/image/deviceImg.png', title:'智能门锁', subtitle: model + 'ABCDEFG',rightIcon: '&#xe6a7;'},
{leftImage: '../../resources/image/deviceImg.png', title:'智能门锁', subtitle: model + 'ABCDEFG',rightIcon: '&#xe6a7;'}
],
tip: ''
}
},
dialog: {
initParam: {
class: 'custom-dialog'
}
},
loading: {
initParam: {
class: 'custom-loading'
}
}
}
}
//tap <
function backTap(){
iot.navigator.back();
}
function deviceListRowTap(){
iot.navigator.openWindow({
url: './wifiAddHelp.html',
id: 'wifiAddHelp'
});
}
\ No newline at end of file
......@@ -69,7 +69,7 @@ function scanAddTap(){
//tap 配置Wi-Fi
function wifiAddTap(){
iot.navigator.openWindow({
url: './wifiAddHelp.html',
id: 'wifiAddHelp'
url: './deviceList.html',
id: 'deviceList'
});
}
\ No newline at end of file
......@@ -12,31 +12,17 @@ import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init);
function init() {
//通用 input、按钮、dialog、loading组件
uPublic.componentsInit(['u-text','u-button','u-commstatus-loading','u-dialog','u-loading']);
uPublic.componentsInit(['u-text','u-button','u-comm-loading','u-dialog','u-loading']);
const app = new Vue({
data:{
textPassword: null,
textErrorTip: null,
textLoading: 'loading...',
status: 0,
//配置组件
componentsConfig: initComponentsConfig()
},
mounted(){
},
methods:{
getTextLoading(){
return this.textLoading;
},
setTextLoading(text){
this.textLoading = text;
},
getStatus(){
return this.status;
},
setStatus(value){
this.status = value;
},
onPasswordChange(text){
passwordChange(this,text);
},
......@@ -49,8 +35,8 @@ function init() {
connectButtonTap(this);
},
//tap loading button
onCommstatusLoadingButtonTap(){
commstatusLoadingButtonTap(this);
onCommLoadingButtonTap(){
commLoadingButtonTap(this);
}
}
}).$mount('#app');
......@@ -84,10 +70,12 @@ function initComponentsConfig() {
class: 'custom-loading'
}
},
ucommstatusloading: {
ucommloading: {
initParam: {
class: 'custom-commstatus-loading',
buttonText: Vue.t('btn.confirm')
class: 'custom-comm-loading',
buttonText: Vue.t('btn.confirm'),
text: '密码确认中...',
status: 0,
}
}
}
......@@ -105,29 +93,25 @@ function backTap(){
//tap 连接
function connectButtonTap(self){
uComponents.showCommstatusloading(self);
uComponents.showCommLoading(self);
setTimeout(function(){
self.setTextLoading(Vue.t('commstatusLoading.connectSuccess'));
uComponents.changeCommLoadingStatusAndText(self,0,'门锁响应中...');
setTimeout(function(){
//绑定成功
self.setStatus(1);
self.setTextLoading(Vue.t('commstatusLoading.bindSuccess'));
uComponents.changeCommLoadingStatusAndText(self,1,'远程开门成功');
//绑定失败
//self.setStatus(2);
//self.setTextLoading(Vue.t('commstatusLoading.bindFailed'));
//uComponents.changeCommstatusButtonText(self,Vue.t('btn.reBound'));
//uComponents.changeCommLoadingStatusAndText(self,1,'远程开门失败');
//uComponents.changeCommButtonText(self,'请尝试重试');
},3000);
},3000);
}
//tap loading button
function commstatusLoadingButtonTap(self) {
function commLoadingButtonTap(self) {
//绑定成功
uComponents.hideCommstatusloading(self);
uComponents.hideCommLoading(self);
iot.navigator.openWindow({
url: '../device/',
id: 'device'
});
//绑定失败
//uComponents.hideCommstatusloading(self);
}
\ No newline at end of file
......@@ -11,14 +11,20 @@ import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init);
function init() {
//通用 按钮、dialog、loading组件
uPublic.componentsInit(['u-button','u-dialog','u-loading']);
//通用 开关、按钮、dialog、loading组件
uPublic.componentsInit(['u-switch','u-button','u-dialog','u-loading']);
//项目 list组件
uPublic.componentsExtend(['grid-list']);
const app = new Vue({
data:{
textDoorlock: '智能指纹锁1',
stateShowFlag: false,
//门铃消息推送 switch
valueDoorbell: 1,
//报警消息推送 switch
valueAlarm: 0,
//开门消息推送 switch
valueOpendoor: 1,
//配置组件
componentsConfig: initComponentsConfig()
},
......@@ -52,6 +58,24 @@ function init() {
//配置组件参数
function initComponentsConfig() {
return {
//门铃消息推送 switch 参数
doorbellSwitch: {
initParam: {
class: 'custom-switch'
}
},
//报警消息推送 switch 参数
alarmSwitch: {
initParam: {
class: 'custom-switch'
}
},
//开门消息推送 switch 参数
opendoorSwitch: {
initParam: {
class: 'custom-switch'
}
},
//解绑门锁 button 参数
unbindDoorlockButton: {
initParam: {
......
......@@ -11,18 +11,68 @@ import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init);
function init() {
//通用 select、按钮、dialog、loading组件
uPublic.componentsInit(['u-select','u-button','u-dialog','u-loading']);
//通用 select、开关、按钮、dialog、loading组件
uPublic.componentsInit(['u-select','u-switch','u-button','u-dialog','u-loading']);
const app = new Vue({
data:{
recordSelectIndex: 0,
recordSelectList: [],
valueSetHijack: 1,
guideShowFlag: false,
guideStep1ShowFlag: false,
guideStep2ShowFlag: false,
guideStep3ShowFlag: false,
guideStep4ShowFlag: false,
guideStep5ShowFlag: false,
guideStep6ShowFlag: false,
//配置组件
componentsConfig: initComponentsConfig()
},
mounted(){
},
methods:{
getGuideShowFlag(){
return this.guideShowFlag;
},
setGuideShowFlag(boolean){
this.guideShowFlag = boolean;
},
getGuideStep1ShowFlag(){
return this.guideStep1ShowFlag;
},
setGuideStep1ShowFlag(boolean){
this.guideStep1ShowFlag = boolean;
},
getGuideStep2ShowFlag(){
return this.guideStep2ShowFlag;
},
setGuideStep2ShowFlag(boolean){
this.guideStep2ShowFlag = boolean;
},
getGuideStep3ShowFlag(){
return this.guideStep3ShowFlag;
},
setGuideStep3ShowFlag(boolean){
this.guideStep3ShowFlag = boolean;
},
getGuideStep4ShowFlag(){
return this.guideStep4ShowFlag;
},
setGuideStep4ShowFlag(boolean){
this.guideStep4ShowFlag = boolean;
},
getGuideStep5ShowFlag(){
return this.guideStep5ShowFlag;
},
setGuideStep5ShowFlag(boolean){
this.guideStep5ShowFlag = boolean;
},
getGuideStep6ShowFlag(){
return this.guideStep6ShowFlag;
},
setGuideStep6ShowFlag(boolean){
this.guideStep6ShowFlag = boolean;
},
//tap <
onBackTap(){
backTap();
......@@ -33,6 +83,17 @@ function init() {
//tap 添加
onAddButtonTap(){
addButtonTap();
},
//tap 下一步
onNextButtonTap(){
nextButtonTap(this);
},
onNextStepButtonTap(){
nextStepButtonTap(this);
},
//tap 我知道了
onISeeButtonTap(){
iSeeButtonTap(this);
}
}
}).$mount('#app');
......@@ -53,6 +114,13 @@ function initComponentsConfig() {
tip: Vue.t('addUnlockInfo.noRecordTip')
}
},
//设为劫持指纹
setHijackSwitch: {
initParam: {
class: 'custom-setHijack-switch',
text: Vue.t('addUnlockInfo.setHijackSwitch')
}
},
//添加 button 参数
addButton: {
initParam: {
......@@ -60,6 +128,20 @@ function initComponentsConfig() {
text: Vue.t('btn.add')
}
},
//下一步 button 参数
nextButton: {
initParam: {
class: 'custom-dialog-button',
text: Vue.t('btn.next')
}
},
//我知道了 button 参数
iSeeButton: {
initParam: {
class: 'custom-dialog-button',
text: Vue.t('btn.iSee')
}
},
dialog: {
initParam: {
class: 'custom-dialog'
......@@ -87,3 +169,23 @@ function recordSelectChange(self, value) {
function addButtonTap(){
iot.navigator.back();
}
//tap 下一步
function nextButtonTap(self){
self.setGuideStep1ShowFlag(false);
self.setGuideStep2ShowFlag(false);
self.setGuideStep3ShowFlag(true);
self.setGuideStep4ShowFlag(true);
}
function nextStepButtonTap(self){
self.setGuideStep3ShowFlag(false);
self.setGuideStep4ShowFlag(false);
self.setGuideStep5ShowFlag(true);
self.setGuideStep6ShowFlag(true);
}
//tap 我知道了
function iSeeButtonTap(self){
self.setGuideShowFlag(false);
}
\ No newline at end of file
......@@ -11,8 +11,8 @@ import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init);
function init() {
//通用 list、dialog、loading组件
uPublic.componentsInit(['u-list','u-dialog','u-loading']);
//通用 侧滑列表、dialog、loading组件
uPublic.componentsInit(['u-swipe-list','u-dialog','u-loading']);
const app = new Vue({
data:{
//配置组件
......@@ -28,6 +28,10 @@ function init() {
//tap 添加
onAddTap(){
addTap();
},
//tap list row btn
onUnlockInfoListButtonTap(value, buttonValue){
unlockInfoListButtonTap(this, value, buttonValue);
}
}
}).$mount('#app');
......@@ -36,12 +40,13 @@ function init() {
//配置组件参数
function initComponentsConfig() {
return {
unlockInfoList:{
unlockInfoList: {
initParam: {
class: 'custom-unlockInfo-list',
class: 'custom-swipe-list',
list: [
{title: '指纹1', rightText: 'ID:123456'},
{title: '指纹2', rightText: 'ID:123456'}
{title: '指纹1', subtitle: 'ID:123456', buttons: [{'text': Vue.t('unlockInfo.setHijack')},{'text': Vue.t('unlockInfo.cancelAssociated')}]},
{title: '指纹2', subtitle: 'ID:123456', buttons: [{'text': Vue.t('unlockInfo.setHijack')},{'text': Vue.t('unlockInfo.cancelAssociated')}]},
{title: '劫持指纹1', subtitle: 'ID:123456', buttons: [{'text': Vue.t('unlockInfo.cancelHijack')},{'text': Vue.t('unlockInfo.cancelAssociated')}]}
],
tip: Vue.t('unlockInfo.noInfoTip')
}
......@@ -71,3 +76,20 @@ function addTap(){
id: 'addUnlockInfo'
});
}
function unlockInfoListButtonTap(self, value, buttonValue) {
//设为劫持&取消劫持
if(buttonValue == '0'){
uComponents.openConfirm(self, Vue.t('unlockInfo.setHijackTip'),
{text: Vue.t('dialog.cancel'), callback: function () {}},
{text: Vue.t('dialog.confirm'), callback: function () {}}
);
}
//取消关联
else if(buttonValue == '1'){
uComponents.openConfirm(self, Vue.t('unlockInfo.cancelAssociatedTip'),
{text: Vue.t('dialog.cancel'), callback: function () {}},
{text: Vue.t('dialog.confirm'), callback: function () {}}
);
}
}
\ No newline at end of file
......@@ -32,7 +32,7 @@
/******/
/******/ // objects to store loaded and loading chunks
/******/ var installedChunks = {
/******/ 23: 0
/******/ 24: 0
/******/ };
/******/
/******/ // The require function
......@@ -87,7 +87,7 @@
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = __webpack_require__.p + "" + ({"0":"bindUser/index","1":"login/register","2":"login/login","3":"login/index","4":"login/forgetPassword","5":"doorlockUsers/unlockInfo","6":"doorlockUsers/inviteBind","7":"doorlockUsers/index","8":"doorlockUsers/editName","9":"doorlockUsers/doorlockUser","10":"doorlockUsers/addUser","11":"doorlockUsers/addUnlockInfo","12":"doorlockManage/index","13":"doorlockManage/editName","14":"device/remoteOpendoor","15":"device/opendoorRecord","16":"device/index","17":"device/hijackRecord","18":"device/alarmInfo","19":"addDevice/wifiAddHelp","20":"addDevice/wifiAdd","21":"addDevice/scanCodeAdd","22":"addDevice/index"}[chunkId]||chunkId) + ".js";
/******/ script.src = __webpack_require__.p + "" + ({"0":"bindUser/index","1":"login/register","2":"login/login","3":"login/index","4":"login/forgetPassword","5":"doorlockUsers/unlockInfo","6":"doorlockUsers/inviteBind","7":"doorlockUsers/index","8":"doorlockUsers/editName","9":"doorlockUsers/doorlockUser","10":"doorlockUsers/addUser","11":"doorlockUsers/addUnlockInfo","12":"doorlockManage/index","13":"doorlockManage/editName","14":"device/remoteOpendoor","15":"device/opendoorRecord","16":"device/index","17":"device/hijackRecord","18":"device/alarmInfo","19":"addDevice/wifiAddHelp","20":"addDevice/wifiAdd","21":"addDevice/scanCodeAdd","22":"addDevice/index","23":"addDevice/deviceList"}[chunkId]||chunkId) + ".js";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
......@@ -9469,7 +9469,7 @@ Vue$3.compile = compileToFunctions;
/* harmony default export */ __webpack_exports__["default"] = (Vue$3);
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(3), __webpack_require__(7), __webpack_require__(4)))
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(3), __webpack_require__(6), __webpack_require__(4)))
/***/ }),
/* 1 */
......@@ -10972,2110 +10972,12 @@ return Promise;
})));
//# sourceMappingURL=es6-promise.map
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3), __webpack_require__(4), __webpack_require__(7)))
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3), __webpack_require__(4), __webpack_require__(6)))
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/*! iScroll v5.2.0 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license */
(function (window, document, Math) {
var rAF = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function (callback) { window.setTimeout(callback, 1000 / 60); };
var utils = (function () {
var me = {};
var _elementStyle = document.createElement('div').style;
var _vendor = (function () {
var vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT'],
transform,
i = 0,
l = vendors.length;
for ( ; i < l; i++ ) {
transform = vendors[i] + 'ransform';
if ( transform in _elementStyle ) return vendors[i].substr(0, vendors[i].length-1);
}
return false;
})();
function _prefixStyle (style) {
if ( _vendor === false ) return false;
if ( _vendor === '' ) return style;
return _vendor + style.charAt(0).toUpperCase() + style.substr(1);
}
me.getTime = Date.now || function getTime () { return new Date().getTime(); };
me.extend = function (target, obj) {
for ( var i in obj ) {
target[i] = obj[i];
}
};
me.addEvent = function (el, type, fn, capture) {
el.addEventListener(type, fn, !!capture);
};
me.removeEvent = function (el, type, fn, capture) {
el.removeEventListener(type, fn, !!capture);
};
me.prefixPointerEvent = function (pointerEvent) {
return window.MSPointerEvent ?
'MSPointer' + pointerEvent.charAt(7).toUpperCase() + pointerEvent.substr(8):
pointerEvent;
};
me.momentum = function (current, start, time, lowerMargin, wrapperSize, deceleration) {
var distance = current - start,
speed = Math.abs(distance) / time,
destination,
duration;
deceleration = deceleration === undefined ? 0.0006 : deceleration;
destination = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 );
duration = speed / deceleration;
if ( destination < lowerMargin ) {
destination = wrapperSize ? lowerMargin - ( wrapperSize / 2.5 * ( speed / 8 ) ) : lowerMargin;
distance = Math.abs(destination - current);
duration = distance / speed;
} else if ( destination > 0 ) {
destination = wrapperSize ? wrapperSize / 2.5 * ( speed / 8 ) : 0;
distance = Math.abs(current) + destination;
duration = distance / speed;
}
return {
destination: Math.round(destination),
duration: duration
};
};
var _transform = _prefixStyle('transform');
me.extend(me, {
hasTransform: _transform !== false,
hasPerspective: _prefixStyle('perspective') in _elementStyle,
hasTouch: 'ontouchstart' in window,
hasPointer: !!(window.PointerEvent || window.MSPointerEvent), // IE10 is prefixed
hasTransition: _prefixStyle('transition') in _elementStyle
});
/*
This should find all Android browsers lower than build 535.19 (both stock browser and webview)
- galaxy S2 is ok
- 2.3.6 : `AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1`
- 4.0.4 : `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`
- galaxy S3 is badAndroid (stock brower, webview)
`AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`
- galaxy S4 is badAndroid (stock brower, webview)
`AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`
- galaxy S5 is OK
`AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`
- galaxy S6 is OK
`AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`
*/
me.isBadAndroid = (function() {
var appVersion = window.navigator.appVersion;
// Android browser is not a chrome browser.
if (/Android/.test(appVersion) && !(/Chrome\/\d/.test(appVersion))) {
var safariVersion = appVersion.match(/Safari\/(\d+.\d)/);
if(safariVersion && typeof safariVersion === "object" && safariVersion.length >= 2) {
return parseFloat(safariVersion[1]) < 535.19;
} else {
return true;
}
} else {
return false;
}
})();
me.extend(me.style = {}, {
transform: _transform,
transitionTimingFunction: _prefixStyle('transitionTimingFunction'),
transitionDuration: _prefixStyle('transitionDuration'),
transitionDelay: _prefixStyle('transitionDelay'),
transformOrigin: _prefixStyle('transformOrigin')
});
me.hasClass = function (e, c) {
var re = new RegExp("(^|\\s)" + c + "(\\s|$)");
return re.test(e.className);
};
me.addClass = function (e, c) {
if ( me.hasClass(e, c) ) {
return;
}
var newclass = e.className.split(' ');
newclass.push(c);
e.className = newclass.join(' ');
};
me.removeClass = function (e, c) {
if ( !me.hasClass(e, c) ) {
return;
}
var re = new RegExp("(^|\\s)" + c + "(\\s|$)", 'g');
e.className = e.className.replace(re, ' ');
};
me.offset = function (el) {
var left = -el.offsetLeft,
top = -el.offsetTop;
// jshint -W084
while (el = el.offsetParent) {
left -= el.offsetLeft;
top -= el.offsetTop;
}
// jshint +W084
return {
left: left,
top: top
};
};
me.preventDefaultException = function (el, exceptions) {
for ( var i in exceptions ) {
if ( exceptions[i].test(el[i]) ) {
return true;
}
}
return false;
};
me.extend(me.eventType = {}, {
touchstart: 1,
touchmove: 1,
touchend: 1,
mousedown: 2,
mousemove: 2,
mouseup: 2,
pointerdown: 3,
pointermove: 3,
pointerup: 3,
MSPointerDown: 3,
MSPointerMove: 3,
MSPointerUp: 3
});
me.extend(me.ease = {}, {
quadratic: {
style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',
fn: function (k) {
return k * ( 2 - k );
}
},
circular: {
style: 'cubic-bezier(0.1, 0.57, 0.1, 1)', // Not properly "circular" but this looks better, it should be (0.075, 0.82, 0.165, 1)
fn: function (k) {
return Math.sqrt( 1 - ( --k * k ) );
}
},
back: {
style: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',
fn: function (k) {
var b = 4;
return ( k = k - 1 ) * k * ( ( b + 1 ) * k + b ) + 1;
}
},
bounce: {
style: '',
fn: function (k) {
if ( ( k /= 1 ) < ( 1 / 2.75 ) ) {
return 7.5625 * k * k;
} else if ( k < ( 2 / 2.75 ) ) {
return 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75;
} else if ( k < ( 2.5 / 2.75 ) ) {
return 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375;
} else {
return 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375;
}
}
},
elastic: {
style: '',
fn: function (k) {
var f = 0.22,
e = 0.4;
if ( k === 0 ) { return 0; }
if ( k == 1 ) { return 1; }
return ( e * Math.pow( 2, - 10 * k ) * Math.sin( ( k - f / 4 ) * ( 2 * Math.PI ) / f ) + 1 );
}
}
});
me.tap = function (e, eventName) {
var ev = document.createEvent('Event');
ev.initEvent(eventName, true, true);
ev.pageX = e.pageX;
ev.pageY = e.pageY;
e.target.dispatchEvent(ev);
};
me.click = function (e) {
var target = e.target,
ev;
if ( !(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName) ) {
ev = document.createEvent('MouseEvents');
ev.initMouseEvent('click', true, true, e.view, 1,
target.screenX, target.screenY, target.clientX, target.clientY,
e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,
0, null);
ev._constructed = true;
target.dispatchEvent(ev);
}
};
return me;
})();
function IScroll (el, options) {
this.wrapper = typeof el == 'string' ? document.querySelector(el) : el;
this.scroller = this.wrapper.children[0];
this.scrollerStyle = this.scroller.style; // cache style for better performance
this.options = {
resizeScrollbars: true,
mouseWheelSpeed: 20,
snapThreshold: 0.334,
// INSERT POINT: OPTIONS
disablePointer : !utils.hasPointer,
disableTouch : utils.hasPointer || !utils.hasTouch,
disableMouse : utils.hasPointer || utils.hasTouch,
startX: 0,
startY: 0,
scrollY: true,
directionLockThreshold: 5,
momentum: true,
bounce: true,
bounceTime: 600,
bounceEasing: '',
preventDefault: true,
preventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ },
HWCompositing: true,
useTransition: true,
useTransform: true,
bindToWrapper: typeof window.onmousedown === "undefined"
};
for ( var i in options ) {
this.options[i] = options[i];
}
// Normalize options
this.translateZ = this.options.HWCompositing && utils.hasPerspective ? ' translateZ(0)' : '';
this.options.useTransition = utils.hasTransition && this.options.useTransition;
this.options.useTransform = utils.hasTransform && this.options.useTransform;
this.options.eventPassthrough = this.options.eventPassthrough === true ? 'vertical' : this.options.eventPassthrough;
this.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault;
// If you want eventPassthrough I have to lock one of the axes
this.options.scrollY = this.options.eventPassthrough == 'vertical' ? false : this.options.scrollY;
this.options.scrollX = this.options.eventPassthrough == 'horizontal' ? false : this.options.scrollX;
// With eventPassthrough we also need lockDirection mechanism
this.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough;
this.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold;
this.options.bounceEasing = typeof this.options.bounceEasing == 'string' ? utils.ease[this.options.bounceEasing] || utils.ease.circular : this.options.bounceEasing;
this.options.resizePolling = this.options.resizePolling === undefined ? 60 : this.options.resizePolling;
if ( this.options.tap === true ) {
this.options.tap = 'tap';
}
if ( this.options.shrinkScrollbars == 'scale' ) {
this.options.useTransition = false;
}
this.options.invertWheelDirection = this.options.invertWheelDirection ? -1 : 1;
// INSERT POINT: NORMALIZATION
// Some defaults
this.x = 0;
this.y = 0;
this.directionX = 0;
this.directionY = 0;
this._events = {};
// INSERT POINT: DEFAULTS
this._init();
this.refresh();
this.scrollTo(this.options.startX, this.options.startY);
this.enable();
}
IScroll.prototype = {
version: '5.2.0',
_init: function () {
this._initEvents();
if ( this.options.scrollbars || this.options.indicators ) {
this._initIndicators();
}
if ( this.options.mouseWheel ) {
this._initWheel();
}
if ( this.options.snap ) {
this._initSnap();
}
if ( this.options.keyBindings ) {
this._initKeys();
}
// INSERT POINT: _init
},
destroy: function () {
this._initEvents(true);
clearTimeout(this.resizeTimeout);
this.resizeTimeout = null;
this._execEvent('destroy');
},
_transitionEnd: function (e) {
if ( e.target != this.scroller || !this.isInTransition ) {
return;
}
this._transitionTime();
if ( !this.resetPosition(this.options.bounceTime) ) {
this.isInTransition = false;
this._execEvent('scrollEnd');
}
},
_start: function (e) {
// React to left mouse button only
if ( utils.eventType[e.type] != 1 ) {
// for button property
// http://unixpapa.com/js/mouse.html
var button;
if (!e.which) {
/* IE case */
button = (e.button < 2) ? 0 :
((e.button == 4) ? 1 : 2);
} else {
/* All others */
button = e.button;
}
if ( button !== 0 ) {
return;
}
}
if ( !this.enabled || (this.initiated && utils.eventType[e.type] !== this.initiated) ) {
return;
}
if ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {
e.preventDefault();
}
var point = e.touches ? e.touches[0] : e,
pos;
this.initiated = utils.eventType[e.type];
this.moved = false;
this.distX = 0;
this.distY = 0;
this.directionX = 0;
this.directionY = 0;
this.directionLocked = 0;
this.startTime = utils.getTime();
if ( this.options.useTransition && this.isInTransition ) {
this._transitionTime();
this.isInTransition = false;
pos = this.getComputedPosition();
this._translate(Math.round(pos.x), Math.round(pos.y));
this._execEvent('scrollEnd');
} else if ( !this.options.useTransition && this.isAnimating ) {
this.isAnimating = false;
this._execEvent('scrollEnd');
}
this.startX = this.x;
this.startY = this.y;
this.absStartX = this.x;
this.absStartY = this.y;
this.pointX = point.pageX;
this.pointY = point.pageY;
this._execEvent('beforeScrollStart');
},
_move: function (e) {
if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {
return;
}
if ( this.options.preventDefault ) { // increases performance on Android? TODO: check!
e.preventDefault();
}
var point = e.touches ? e.touches[0] : e,
deltaX = point.pageX - this.pointX,
deltaY = point.pageY - this.pointY,
timestamp = utils.getTime(),
newX, newY,
absDistX, absDistY;
this.pointX = point.pageX;
this.pointY = point.pageY;
this.distX += deltaX;
this.distY += deltaY;
absDistX = Math.abs(this.distX);
absDistY = Math.abs(this.distY);
// We need to move at least 10 pixels for the scrolling to initiate
if ( timestamp - this.endTime > 300 && (absDistX < 10 && absDistY < 10) ) {
return;
}
// If you are scrolling in one direction lock the other
if ( !this.directionLocked && !this.options.freeScroll ) {
if ( absDistX > absDistY + this.options.directionLockThreshold ) {
this.directionLocked = 'h'; // lock horizontally
} else if ( absDistY >= absDistX + this.options.directionLockThreshold ) {
this.directionLocked = 'v'; // lock vertically
} else {
this.directionLocked = 'n'; // no lock
}
}
if ( this.directionLocked == 'h' ) {
if ( this.options.eventPassthrough == 'vertical' ) {
e.preventDefault();
} else if ( this.options.eventPassthrough == 'horizontal' ) {
this.initiated = false;
return;
}
deltaY = 0;
} else if ( this.directionLocked == 'v' ) {
if ( this.options.eventPassthrough == 'horizontal' ) {
e.preventDefault();
} else if ( this.options.eventPassthrough == 'vertical' ) {
this.initiated = false;
return;
}
deltaX = 0;
}
deltaX = this.hasHorizontalScroll ? deltaX : 0;
deltaY = this.hasVerticalScroll ? deltaY : 0;
newX = this.x + deltaX;
newY = this.y + deltaY;
// Slow down if outside of the boundaries
if ( newX > 0 || newX < this.maxScrollX ) {
newX = this.options.bounce ? this.x + deltaX / 3 : newX > 0 ? 0 : this.maxScrollX;
}
if ( newY > 0 || newY < this.maxScrollY ) {
newY = this.options.bounce ? this.y + deltaY / 3 : newY > 0 ? 0 : this.maxScrollY;
}
this.directionX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0;
this.directionY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0;
if ( !this.moved ) {
this._execEvent('scrollStart');
}
this.moved = true;
this._translate(newX, newY);
/* REPLACE START: _move */
if ( timestamp - this.startTime > 300 ) {
this.startTime = timestamp;
this.startX = this.x;
this.startY = this.y;
}
/* REPLACE END: _move */
},
_end: function (e) {
if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {
return;
}
if ( this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {
e.preventDefault();
}
var point = e.changedTouches ? e.changedTouches[0] : e,
momentumX,
momentumY,
duration = utils.getTime() - this.startTime,
newX = Math.round(this.x),
newY = Math.round(this.y),
distanceX = Math.abs(newX - this.startX),
distanceY = Math.abs(newY - this.startY),
time = 0,
easing = '';
this.isInTransition = 0;
this.initiated = 0;
this.endTime = utils.getTime();
// reset if we are outside of the boundaries
if ( this.resetPosition(this.options.bounceTime) ) {
return;
}
this.scrollTo(newX, newY); // ensures that the last position is rounded
// we scrolled less than 10 pixels
if ( !this.moved ) {
if ( this.options.tap ) {
utils.tap(e, this.options.tap);
}
if ( this.options.click ) {
utils.click(e);
}
this._execEvent('scrollCancel');
return;
}
if ( this._events.flick && duration < 200 && distanceX < 100 && distanceY < 100 ) {
this._execEvent('flick');
return;
}
// start momentum animation if needed
if ( this.options.momentum && duration < 300 ) {
momentumX = this.hasHorizontalScroll ? utils.momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { destination: newX, duration: 0 };
momentumY = this.hasVerticalScroll ? utils.momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options.deceleration) : { destination: newY, duration: 0 };
newX = momentumX.destination;
newY = momentumY.destination;
time = Math.max(momentumX.duration, momentumY.duration);
this.isInTransition = 1;
}
if ( this.options.snap ) {
var snap = this._nearestSnap(newX, newY);
this.currentPage = snap;
time = this.options.snapSpeed || Math.max(
Math.max(
Math.min(Math.abs(newX - snap.x), 1000),
Math.min(Math.abs(newY - snap.y), 1000)
), 300);
newX = snap.x;
newY = snap.y;
this.directionX = 0;
this.directionY = 0;
easing = this.options.bounceEasing;
}
// INSERT POINT: _end
if ( newX != this.x || newY != this.y ) {
// change easing function when scroller goes out of the boundaries
if ( newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY ) {
easing = utils.ease.quadratic;
}
this.scrollTo(newX, newY, time, easing);
return;
}
this._execEvent('scrollEnd');
},
_resize: function () {
var that = this;
clearTimeout(this.resizeTimeout);
this.resizeTimeout = setTimeout(function () {
that.refresh();
}, this.options.resizePolling);
},
resetPosition: function (time) {
var x = this.x,
y = this.y;
time = time || 0;
if ( !this.hasHorizontalScroll || this.x > 0 ) {
x = 0;
} else if ( this.x < this.maxScrollX ) {
x = this.maxScrollX;
}
if ( !this.hasVerticalScroll || this.y > 0 ) {
y = 0;
} else if ( this.y < this.maxScrollY ) {
y = this.maxScrollY;
}
if ( x == this.x && y == this.y ) {
return false;
}
this.scrollTo(x, y, time, this.options.bounceEasing);
return true;
},
disable: function () {
this.enabled = false;
},
enable: function () {
this.enabled = true;
},
refresh: function () {
var rf = this.wrapper.offsetHeight; // Force reflow
this.wrapperWidth = this.wrapper.clientWidth;
this.wrapperHeight = this.wrapper.clientHeight;
/* REPLACE START: refresh */
this.scrollerWidth = this.scroller.offsetWidth;
this.scrollerHeight = this.scroller.offsetHeight;
this.maxScrollX = this.wrapperWidth - this.scrollerWidth;
this.maxScrollY = this.wrapperHeight - this.scrollerHeight;
/* REPLACE END: refresh */
this.hasHorizontalScroll = this.options.scrollX && this.maxScrollX < 0;
this.hasVerticalScroll = this.options.scrollY && this.maxScrollY < 0;
if ( !this.hasHorizontalScroll ) {
this.maxScrollX = 0;
this.scrollerWidth = this.wrapperWidth;
}
if ( !this.hasVerticalScroll ) {
this.maxScrollY = 0;
this.scrollerHeight = this.wrapperHeight;
}
this.endTime = 0;
this.directionX = 0;
this.directionY = 0;
this.wrapperOffset = utils.offset(this.wrapper);
this._execEvent('refresh');
this.resetPosition();
// INSERT POINT: _refresh
},
on: function (type, fn) {
if ( !this._events[type] ) {
this._events[type] = [];
}
this._events[type].push(fn);
},
off: function (type, fn) {
if ( !this._events[type] ) {
return;
}
var index = this._events[type].indexOf(fn);
if ( index > -1 ) {
this._events[type].splice(index, 1);
}
},
_execEvent: function (type) {
if ( !this._events[type] ) {
return;
}
var i = 0,
l = this._events[type].length;
if ( !l ) {
return;
}
for ( ; i < l; i++ ) {
this._events[type][i].apply(this, [].slice.call(arguments, 1));
}
},
scrollBy: function (x, y, time, easing) {
x = this.x + x;
y = this.y + y;
time = time || 0;
this.scrollTo(x, y, time, easing);
},
scrollTo: function (x, y, time, easing) {
easing = easing || utils.ease.circular;
this.isInTransition = this.options.useTransition && time > 0;
var transitionType = this.options.useTransition && easing.style;
if ( !time || transitionType ) {
if(transitionType) {
this._transitionTimingFunction(easing.style);
this._transitionTime(time);
}
this._translate(x, y);
} else {
this._animate(x, y, time, easing.fn);
}
},
scrollToElement: function (el, time, offsetX, offsetY, easing) {
el = el.nodeType ? el : this.scroller.querySelector(el);
if ( !el ) {
return;
}
var pos = utils.offset(el);
pos.left -= this.wrapperOffset.left;
pos.top -= this.wrapperOffset.top;
// if offsetX/Y are true we center the element to the screen
if ( offsetX === true ) {
offsetX = Math.round(el.offsetWidth / 2 - this.wrapper.offsetWidth / 2);
}
if ( offsetY === true ) {
offsetY = Math.round(el.offsetHeight / 2 - this.wrapper.offsetHeight / 2);
}
pos.left -= offsetX || 0;
pos.top -= offsetY || 0;
pos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left;
pos.top = pos.top > 0 ? 0 : pos.top < this.maxScrollY ? this.maxScrollY : pos.top;
time = time === undefined || time === null || time === 'auto' ? Math.max(Math.abs(this.x-pos.left), Math.abs(this.y-pos.top)) : time;
this.scrollTo(pos.left, pos.top, time, easing);
},
_transitionTime: function (time) {
time = time || 0;
var durationProp = utils.style.transitionDuration;
this.scrollerStyle[durationProp] = time + 'ms';
if ( !time && utils.isBadAndroid ) {
this.scrollerStyle[durationProp] = '0.0001ms';
// remove 0.0001ms
var self = this;
rAF(function() {
if(self.scrollerStyle[durationProp] === '0.0001ms') {
self.scrollerStyle[durationProp] = '0s';
}
});
}
if ( this.indicators ) {
for ( var i = this.indicators.length; i--; ) {
this.indicators[i].transitionTime(time);
}
}
// INSERT POINT: _transitionTime
},
_transitionTimingFunction: function (easing) {
this.scrollerStyle[utils.style.transitionTimingFunction] = easing;
if ( this.indicators ) {
for ( var i = this.indicators.length; i--; ) {
this.indicators[i].transitionTimingFunction(easing);
}
}
// INSERT POINT: _transitionTimingFunction
},
_translate: function (x, y) {
if ( this.options.useTransform ) {
/* REPLACE START: _translate */
this.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ;
/* REPLACE END: _translate */
} else {
x = Math.round(x);
y = Math.round(y);
this.scrollerStyle.left = x + 'px';
this.scrollerStyle.top = y + 'px';
}
this.x = x;
this.y = y;
if ( this.indicators ) {
for ( var i = this.indicators.length; i--; ) {
this.indicators[i].updatePosition();
}
}
// INSERT POINT: _translate
},
_initEvents: function (remove) {
var eventType = remove ? utils.removeEvent : utils.addEvent,
target = this.options.bindToWrapper ? this.wrapper : window;
eventType(window, 'orientationchange', this);
eventType(window, 'resize', this);
if ( this.options.click ) {
eventType(this.wrapper, 'click', this, true);
}
if ( !this.options.disableMouse ) {
eventType(this.wrapper, 'mousedown', this);
eventType(target, 'mousemove', this);
eventType(target, 'mousecancel', this);
eventType(target, 'mouseup', this);
}
if ( utils.hasPointer && !this.options.disablePointer ) {
eventType(this.wrapper, utils.prefixPointerEvent('pointerdown'), this);
eventType(target, utils.prefixPointerEvent('pointermove'), this);
eventType(target, utils.prefixPointerEvent('pointercancel'), this);
eventType(target, utils.prefixPointerEvent('pointerup'), this);
}
if ( utils.hasTouch && !this.options.disableTouch ) {
eventType(this.wrapper, 'touchstart', this);
eventType(target, 'touchmove', this);
eventType(target, 'touchcancel', this);
eventType(target, 'touchend', this);
}
eventType(this.scroller, 'transitionend', this);
eventType(this.scroller, 'webkitTransitionEnd', this);
eventType(this.scroller, 'oTransitionEnd', this);
eventType(this.scroller, 'MSTransitionEnd', this);
},
getComputedPosition: function () {
var matrix = window.getComputedStyle(this.scroller, null),
x, y;
if ( this.options.useTransform ) {
matrix = matrix[utils.style.transform].split(')')[0].split(', ');
x = +(matrix[12] || matrix[4]);
y = +(matrix[13] || matrix[5]);
} else {
x = +matrix.left.replace(/[^-\d.]/g, '');
y = +matrix.top.replace(/[^-\d.]/g, '');
}
return { x: x, y: y };
},
_initIndicators: function () {
var interactive = this.options.interactiveScrollbars,
customStyle = typeof this.options.scrollbars != 'string',
indicators = [],
indicator;
var that = this;
this.indicators = [];
if ( this.options.scrollbars ) {
// Vertical scrollbar
if ( this.options.scrollY ) {
indicator = {
el: createDefaultScrollbar('v', interactive, this.options.scrollbars),
interactive: interactive,
defaultScrollbars: true,
customStyle: customStyle,
resize: this.options.resizeScrollbars,
shrink: this.options.shrinkScrollbars,
fade: this.options.fadeScrollbars,
listenX: false
};
this.wrapper.appendChild(indicator.el);
indicators.push(indicator);
}
// Horizontal scrollbar
if ( this.options.scrollX ) {
indicator = {
el: createDefaultScrollbar('h', interactive, this.options.scrollbars),
interactive: interactive,
defaultScrollbars: true,
customStyle: customStyle,
resize: this.options.resizeScrollbars,
shrink: this.options.shrinkScrollbars,
fade: this.options.fadeScrollbars,
listenY: false
};
this.wrapper.appendChild(indicator.el);
indicators.push(indicator);
}
}
if ( this.options.indicators ) {
// TODO: check concat compatibility
indicators = indicators.concat(this.options.indicators);
}
for ( var i = indicators.length; i--; ) {
this.indicators.push( new Indicator(this, indicators[i]) );
}
// TODO: check if we can use array.map (wide compatibility and performance issues)
function _indicatorsMap (fn) {
if (that.indicators) {
for ( var i = that.indicators.length; i--; ) {
fn.call(that.indicators[i]);
}
}
}
if ( this.options.fadeScrollbars ) {
this.on('scrollEnd', function () {
_indicatorsMap(function () {
this.fade();
});
});
this.on('scrollCancel', function () {
_indicatorsMap(function () {
this.fade();
});
});
this.on('scrollStart', function () {
_indicatorsMap(function () {
this.fade(1);
});
});
this.on('beforeScrollStart', function () {
_indicatorsMap(function () {
this.fade(1, true);
});
});
}
this.on('refresh', function () {
_indicatorsMap(function () {
this.refresh();
});
});
this.on('destroy', function () {
_indicatorsMap(function () {
this.destroy();
});
delete this.indicators;
});
},
_initWheel: function () {
utils.addEvent(this.wrapper, 'wheel', this);
utils.addEvent(this.wrapper, 'mousewheel', this);
utils.addEvent(this.wrapper, 'DOMMouseScroll', this);
this.on('destroy', function () {
clearTimeout(this.wheelTimeout);
this.wheelTimeout = null;
utils.removeEvent(this.wrapper, 'wheel', this);
utils.removeEvent(this.wrapper, 'mousewheel', this);
utils.removeEvent(this.wrapper, 'DOMMouseScroll', this);
});
},
_wheel: function (e) {
if ( !this.enabled ) {
return;
}
e.preventDefault();
var wheelDeltaX, wheelDeltaY,
newX, newY,
that = this;
if ( this.wheelTimeout === undefined ) {
that._execEvent('scrollStart');
}
// Execute the scrollEnd event after 400ms the wheel stopped scrolling
clearTimeout(this.wheelTimeout);
this.wheelTimeout = setTimeout(function () {
if(!that.options.snap) {
that._execEvent('scrollEnd');
}
that.wheelTimeout = undefined;
}, 400);
if ( 'deltaX' in e ) {
if (e.deltaMode === 1) {
wheelDeltaX = -e.deltaX * this.options.mouseWheelSpeed;
wheelDeltaY = -e.deltaY * this.options.mouseWheelSpeed;
} else {
wheelDeltaX = -e.deltaX;
wheelDeltaY = -e.deltaY;
}
} else if ( 'wheelDeltaX' in e ) {
wheelDeltaX = e.wheelDeltaX / 120 * this.options.mouseWheelSpeed;
wheelDeltaY = e.wheelDeltaY / 120 * this.options.mouseWheelSpeed;
} else if ( 'wheelDelta' in e ) {
wheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * this.options.mouseWheelSpeed;
} else if ( 'detail' in e ) {
wheelDeltaX = wheelDeltaY = -e.detail / 3 * this.options.mouseWheelSpeed;
} else {
return;
}
wheelDeltaX *= this.options.invertWheelDirection;
wheelDeltaY *= this.options.invertWheelDirection;
if ( !this.hasVerticalScroll ) {
wheelDeltaX = wheelDeltaY;
wheelDeltaY = 0;
}
if ( this.options.snap ) {
newX = this.currentPage.pageX;
newY = this.currentPage.pageY;
if ( wheelDeltaX > 0 ) {
newX--;
} else if ( wheelDeltaX < 0 ) {
newX++;
}
if ( wheelDeltaY > 0 ) {
newY--;
} else if ( wheelDeltaY < 0 ) {
newY++;
}
this.goToPage(newX, newY);
return;
}
newX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0);
newY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0);
this.directionX = wheelDeltaX > 0 ? -1 : wheelDeltaX < 0 ? 1 : 0;
this.directionY = wheelDeltaY > 0 ? -1 : wheelDeltaY < 0 ? 1 : 0;
if ( newX > 0 ) {
newX = 0;
} else if ( newX < this.maxScrollX ) {
newX = this.maxScrollX;
}
if ( newY > 0 ) {
newY = 0;
} else if ( newY < this.maxScrollY ) {
newY = this.maxScrollY;
}
this.scrollTo(newX, newY, 0);
// INSERT POINT: _wheel
},
_initSnap: function () {
this.currentPage = {};
if ( typeof this.options.snap == 'string' ) {
this.options.snap = this.scroller.querySelectorAll(this.options.snap);
}
this.on('refresh', function () {
var i = 0, l,
m = 0, n,
cx, cy,
x = 0, y,
stepX = this.options.snapStepX || this.wrapperWidth,
stepY = this.options.snapStepY || this.wrapperHeight,
el;
this.pages = [];
if ( !this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight ) {
return;
}
if ( this.options.snap === true ) {
cx = Math.round( stepX / 2 );
cy = Math.round( stepY / 2 );
while ( x > -this.scrollerWidth ) {
this.pages[i] = [];
l = 0;
y = 0;
while ( y > -this.scrollerHeight ) {
this.pages[i][l] = {
x: Math.max(x, this.maxScrollX),
y: Math.max(y, this.maxScrollY),
width: stepX,
height: stepY,
cx: x - cx,
cy: y - cy
};
y -= stepY;
l++;
}
x -= stepX;
i++;
}
} else {
el = this.options.snap;
l = el.length;
n = -1;
for ( ; i < l; i++ ) {
if ( i === 0 || el[i].offsetLeft <= el[i-1].offsetLeft ) {
m = 0;
n++;
}
if ( !this.pages[m] ) {
this.pages[m] = [];
}
x = Math.max(-el[i].offsetLeft, this.maxScrollX);
y = Math.max(-el[i].offsetTop, this.maxScrollY);
cx = x - Math.round(el[i].offsetWidth / 2);
cy = y - Math.round(el[i].offsetHeight / 2);
this.pages[m][n] = {
x: x,
y: y,
width: el[i].offsetWidth,
height: el[i].offsetHeight,
cx: cx,
cy: cy
};
if ( x > this.maxScrollX ) {
m++;
}
}
}
this.goToPage(this.currentPage.pageX || 0, this.currentPage.pageY || 0, 0);
// Update snap threshold if needed
if ( this.options.snapThreshold % 1 === 0 ) {
this.snapThresholdX = this.options.snapThreshold;
this.snapThresholdY = this.options.snapThreshold;
} else {
this.snapThresholdX = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width * this.options.snapThreshold);
this.snapThresholdY = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height * this.options.snapThreshold);
}
});
this.on('flick', function () {
var time = this.options.snapSpeed || Math.max(
Math.max(
Math.min(Math.abs(this.x - this.startX), 1000),
Math.min(Math.abs(this.y - this.startY), 1000)
), 300);
this.goToPage(
this.currentPage.pageX + this.directionX,
this.currentPage.pageY + this.directionY,
time
);
});
},
_nearestSnap: function (x, y) {
if ( !this.pages.length ) {
return { x: 0, y: 0, pageX: 0, pageY: 0 };
}
var i = 0,
l = this.pages.length,
m = 0;
// Check if we exceeded the snap threshold
if ( Math.abs(x - this.absStartX) < this.snapThresholdX &&
Math.abs(y - this.absStartY) < this.snapThresholdY ) {
return this.currentPage;
}
if ( x > 0 ) {
x = 0;
} else if ( x < this.maxScrollX ) {
x = this.maxScrollX;
}
if ( y > 0 ) {
y = 0;
} else if ( y < this.maxScrollY ) {
y = this.maxScrollY;
}
for ( ; i < l; i++ ) {
if ( x >= this.pages[i][0].cx ) {
x = this.pages[i][0].x;
break;
}
}
l = this.pages[i].length;
for ( ; m < l; m++ ) {
if ( y >= this.pages[0][m].cy ) {
y = this.pages[0][m].y;
break;
}
}
if ( i == this.currentPage.pageX ) {
i += this.directionX;
if ( i < 0 ) {
i = 0;
} else if ( i >= this.pages.length ) {
i = this.pages.length - 1;
}
x = this.pages[i][0].x;
}
if ( m == this.currentPage.pageY ) {
m += this.directionY;
if ( m < 0 ) {
m = 0;
} else if ( m >= this.pages[0].length ) {
m = this.pages[0].length - 1;
}
y = this.pages[0][m].y;
}
return {
x: x,
y: y,
pageX: i,
pageY: m
};
},
goToPage: function (x, y, time, easing) {
easing = easing || this.options.bounceEasing;
if ( x >= this.pages.length ) {
x = this.pages.length - 1;
} else if ( x < 0 ) {
x = 0;
}
if ( y >= this.pages[x].length ) {
y = this.pages[x].length - 1;
} else if ( y < 0 ) {
y = 0;
}
var posX = this.pages[x][y].x,
posY = this.pages[x][y].y;
time = time === undefined ? this.options.snapSpeed || Math.max(
Math.max(
Math.min(Math.abs(posX - this.x), 1000),
Math.min(Math.abs(posY - this.y), 1000)
), 300) : time;
this.currentPage = {
x: posX,
y: posY,
pageX: x,
pageY: y
};
this.scrollTo(posX, posY, time, easing);
},
next: function (time, easing) {
var x = this.currentPage.pageX,
y = this.currentPage.pageY;
x++;
if ( x >= this.pages.length && this.hasVerticalScroll ) {
x = 0;
y++;
}
this.goToPage(x, y, time, easing);
},
prev: function (time, easing) {
var x = this.currentPage.pageX,
y = this.currentPage.pageY;
x--;
if ( x < 0 && this.hasVerticalScroll ) {
x = 0;
y--;
}
this.goToPage(x, y, time, easing);
},
_initKeys: function (e) {
// default key bindings
var keys = {
pageUp: 33,
pageDown: 34,
end: 35,
home: 36,
left: 37,
up: 38,
right: 39,
down: 40
};
var i;
// if you give me characters I give you keycode
if ( typeof this.options.keyBindings == 'object' ) {
for ( i in this.options.keyBindings ) {
if ( typeof this.options.keyBindings[i] == 'string' ) {
this.options.keyBindings[i] = this.options.keyBindings[i].toUpperCase().charCodeAt(0);
}
}
} else {
this.options.keyBindings = {};
}
for ( i in keys ) {
this.options.keyBindings[i] = this.options.keyBindings[i] || keys[i];
}
utils.addEvent(window, 'keydown', this);
this.on('destroy', function () {
utils.removeEvent(window, 'keydown', this);
});
},
_key: function (e) {
if ( !this.enabled ) {
return;
}
var snap = this.options.snap, // we are using this alot, better to cache it
newX = snap ? this.currentPage.pageX : this.x,
newY = snap ? this.currentPage.pageY : this.y,
now = utils.getTime(),
prevTime = this.keyTime || 0,
acceleration = 0.250,
pos;
if ( this.options.useTransition && this.isInTransition ) {
pos = this.getComputedPosition();
this._translate(Math.round(pos.x), Math.round(pos.y));
this.isInTransition = false;
}
this.keyAcceleration = now - prevTime < 200 ? Math.min(this.keyAcceleration + acceleration, 50) : 0;
switch ( e.keyCode ) {
case this.options.keyBindings.pageUp:
if ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {
newX += snap ? 1 : this.wrapperWidth;
} else {
newY += snap ? 1 : this.wrapperHeight;
}
break;
case this.options.keyBindings.pageDown:
if ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {
newX -= snap ? 1 : this.wrapperWidth;
} else {
newY -= snap ? 1 : this.wrapperHeight;
}
break;
case this.options.keyBindings.end:
newX = snap ? this.pages.length-1 : this.maxScrollX;
newY = snap ? this.pages[0].length-1 : this.maxScrollY;
break;
case this.options.keyBindings.home:
newX = 0;
newY = 0;
break;
case this.options.keyBindings.left:
newX += snap ? -1 : 5 + this.keyAcceleration>>0;
break;
case this.options.keyBindings.up:
newY += snap ? 1 : 5 + this.keyAcceleration>>0;
break;
case this.options.keyBindings.right:
newX -= snap ? -1 : 5 + this.keyAcceleration>>0;
break;
case this.options.keyBindings.down:
newY -= snap ? 1 : 5 + this.keyAcceleration>>0;
break;
default:
return;
}
if ( snap ) {
this.goToPage(newX, newY);
return;
}
if ( newX > 0 ) {
newX = 0;
this.keyAcceleration = 0;
} else if ( newX < this.maxScrollX ) {
newX = this.maxScrollX;
this.keyAcceleration = 0;
}
if ( newY > 0 ) {
newY = 0;
this.keyAcceleration = 0;
} else if ( newY < this.maxScrollY ) {
newY = this.maxScrollY;
this.keyAcceleration = 0;
}
this.scrollTo(newX, newY, 0);
this.keyTime = now;
},
_animate: function (destX, destY, duration, easingFn) {
var that = this,
startX = this.x,
startY = this.y,
startTime = utils.getTime(),
destTime = startTime + duration;
function step () {
var now = utils.getTime(),
newX, newY,
easing;
if ( now >= destTime ) {
that.isAnimating = false;
that._translate(destX, destY);
if ( !that.resetPosition(that.options.bounceTime) ) {
that._execEvent('scrollEnd');
}
return;
}
now = ( now - startTime ) / duration;
easing = easingFn(now);
newX = ( destX - startX ) * easing + startX;
newY = ( destY - startY ) * easing + startY;
that._translate(newX, newY);
if ( that.isAnimating ) {
rAF(step);
}
}
this.isAnimating = true;
step();
},
handleEvent: function (e) {
switch ( e.type ) {
case 'touchstart':
case 'pointerdown':
case 'MSPointerDown':
case 'mousedown':
this._start(e);
break;
case 'touchmove':
case 'pointermove':
case 'MSPointerMove':
case 'mousemove':
this._move(e);
break;
case 'touchend':
case 'pointerup':
case 'MSPointerUp':
case 'mouseup':
case 'touchcancel':
case 'pointercancel':
case 'MSPointerCancel':
case 'mousecancel':
this._end(e);
break;
case 'orientationchange':
case 'resize':
this._resize();
break;
case 'transitionend':
case 'webkitTransitionEnd':
case 'oTransitionEnd':
case 'MSTransitionEnd':
this._transitionEnd(e);
break;
case 'wheel':
case 'DOMMouseScroll':
case 'mousewheel':
this._wheel(e);
break;
case 'keydown':
this._key(e);
break;
case 'click':
if ( this.enabled && !e._constructed ) {
e.preventDefault();
e.stopPropagation();
}
break;
}
}
};
function createDefaultScrollbar (direction, interactive, type) {
var scrollbar = document.createElement('div'),
indicator = document.createElement('div');
if ( type === true ) {
scrollbar.style.cssText = 'position:absolute;z-index:9999';
indicator.style.cssText = '-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px';
}
indicator.className = 'iScrollIndicator';
if ( direction == 'h' ) {
if ( type === true ) {
scrollbar.style.cssText += ';height:7px;left:2px;right:2px;bottom:0';
indicator.style.height = '100%';
}
scrollbar.className = 'iScrollHorizontalScrollbar';
} else {
if ( type === true ) {
scrollbar.style.cssText += ';width:7px;bottom:2px;top:2px;right:1px';
indicator.style.width = '100%';
}
scrollbar.className = 'iScrollVerticalScrollbar';
}
scrollbar.style.cssText += ';overflow:hidden';
if ( !interactive ) {
scrollbar.style.pointerEvents = 'none';
}
scrollbar.appendChild(indicator);
return scrollbar;
}
function Indicator (scroller, options) {
this.wrapper = typeof options.el == 'string' ? document.querySelector(options.el) : options.el;
this.wrapperStyle = this.wrapper.style;
this.indicator = this.wrapper.children[0];
this.indicatorStyle = this.indicator.style;
this.scroller = scroller;
this.options = {
listenX: true,
listenY: true,
interactive: false,
resize: true,
defaultScrollbars: false,
shrink: false,
fade: false,
speedRatioX: 0,
speedRatioY: 0
};
for ( var i in options ) {
this.options[i] = options[i];
}
this.sizeRatioX = 1;
this.sizeRatioY = 1;
this.maxPosX = 0;
this.maxPosY = 0;
if ( this.options.interactive ) {
if ( !this.options.disableTouch ) {
utils.addEvent(this.indicator, 'touchstart', this);
utils.addEvent(window, 'touchend', this);
}
if ( !this.options.disablePointer ) {
utils.addEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);
utils.addEvent(window, utils.prefixPointerEvent('pointerup'), this);
}
if ( !this.options.disableMouse ) {
utils.addEvent(this.indicator, 'mousedown', this);
utils.addEvent(window, 'mouseup', this);
}
}
if ( this.options.fade ) {
this.wrapperStyle[utils.style.transform] = this.scroller.translateZ;
var durationProp = utils.style.transitionDuration;
this.wrapperStyle[durationProp] = utils.isBadAndroid ? '0.0001ms' : '0ms';
// remove 0.0001ms
var self = this;
if(utils.isBadAndroid) {
rAF(function() {
if(self.wrapperStyle[durationProp] === '0.0001ms') {
self.wrapperStyle[durationProp] = '0s';
}
});
}
this.wrapperStyle.opacity = '0';
}
}
Indicator.prototype = {
handleEvent: function (e) {
switch ( e.type ) {
case 'touchstart':
case 'pointerdown':
case 'MSPointerDown':
case 'mousedown':
this._start(e);
break;
case 'touchmove':
case 'pointermove':
case 'MSPointerMove':
case 'mousemove':
this._move(e);
break;
case 'touchend':
case 'pointerup':
case 'MSPointerUp':
case 'mouseup':
case 'touchcancel':
case 'pointercancel':
case 'MSPointerCancel':
case 'mousecancel':
this._end(e);
break;
}
},
destroy: function () {
if ( this.options.fadeScrollbars ) {
clearTimeout(this.fadeTimeout);
this.fadeTimeout = null;
}
if ( this.options.interactive ) {
utils.removeEvent(this.indicator, 'touchstart', this);
utils.removeEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);
utils.removeEvent(this.indicator, 'mousedown', this);
utils.removeEvent(window, 'touchmove', this);
utils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);
utils.removeEvent(window, 'mousemove', this);
utils.removeEvent(window, 'touchend', this);
utils.removeEvent(window, utils.prefixPointerEvent('pointerup'), this);
utils.removeEvent(window, 'mouseup', this);
}
if ( this.options.defaultScrollbars ) {
this.wrapper.parentNode.removeChild(this.wrapper);
}
},
_start: function (e) {
var point = e.touches ? e.touches[0] : e;
e.preventDefault();
e.stopPropagation();
this.transitionTime();
this.initiated = true;
this.moved = false;
this.lastPointX = point.pageX;
this.lastPointY = point.pageY;
this.startTime = utils.getTime();
if ( !this.options.disableTouch ) {
utils.addEvent(window, 'touchmove', this);
}
if ( !this.options.disablePointer ) {
utils.addEvent(window, utils.prefixPointerEvent('pointermove'), this);
}
if ( !this.options.disableMouse ) {
utils.addEvent(window, 'mousemove', this);
}
this.scroller._execEvent('beforeScrollStart');
},
_move: function (e) {
var point = e.touches ? e.touches[0] : e,
deltaX, deltaY,
newX, newY,
timestamp = utils.getTime();
if ( !this.moved ) {
this.scroller._execEvent('scrollStart');
}
this.moved = true;
deltaX = point.pageX - this.lastPointX;
this.lastPointX = point.pageX;
deltaY = point.pageY - this.lastPointY;
this.lastPointY = point.pageY;
newX = this.x + deltaX;
newY = this.y + deltaY;
this._pos(newX, newY);
// INSERT POINT: indicator._move
e.preventDefault();
e.stopPropagation();
},
_end: function (e) {
if ( !this.initiated ) {
return;
}
this.initiated = false;
e.preventDefault();
e.stopPropagation();
utils.removeEvent(window, 'touchmove', this);
utils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);
utils.removeEvent(window, 'mousemove', this);
if ( this.scroller.options.snap ) {
var snap = this.scroller._nearestSnap(this.scroller.x, this.scroller.y);
var time = this.options.snapSpeed || Math.max(
Math.max(
Math.min(Math.abs(this.scroller.x - snap.x), 1000),
Math.min(Math.abs(this.scroller.y - snap.y), 1000)
), 300);
if ( this.scroller.x != snap.x || this.scroller.y != snap.y ) {
this.scroller.directionX = 0;
this.scroller.directionY = 0;
this.scroller.currentPage = snap;
this.scroller.scrollTo(snap.x, snap.y, time, this.scroller.options.bounceEasing);
}
}
if ( this.moved ) {
this.scroller._execEvent('scrollEnd');
}
},
transitionTime: function (time) {
time = time || 0;
var durationProp = utils.style.transitionDuration;
this.indicatorStyle[durationProp] = time + 'ms';
if ( !time && utils.isBadAndroid ) {
this.indicatorStyle[durationProp] = '0.0001ms';
// remove 0.0001ms
var self = this;
rAF(function() {
if(self.indicatorStyle[durationProp] === '0.0001ms') {
self.indicatorStyle[durationProp] = '0s';
}
});
}
},
transitionTimingFunction: function (easing) {
this.indicatorStyle[utils.style.transitionTimingFunction] = easing;
},
refresh: function () {
this.transitionTime();
if ( this.options.listenX && !this.options.listenY ) {
this.indicatorStyle.display = this.scroller.hasHorizontalScroll ? 'block' : 'none';
} else if ( this.options.listenY && !this.options.listenX ) {
this.indicatorStyle.display = this.scroller.hasVerticalScroll ? 'block' : 'none';
} else {
this.indicatorStyle.display = this.scroller.hasHorizontalScroll || this.scroller.hasVerticalScroll ? 'block' : 'none';
}
if ( this.scroller.hasHorizontalScroll && this.scroller.hasVerticalScroll ) {
utils.addClass(this.wrapper, 'iScrollBothScrollbars');
utils.removeClass(this.wrapper, 'iScrollLoneScrollbar');
if ( this.options.defaultScrollbars && this.options.customStyle ) {
if ( this.options.listenX ) {
this.wrapper.style.right = '8px';
} else {
this.wrapper.style.bottom = '8px';
}
}
} else {
utils.removeClass(this.wrapper, 'iScrollBothScrollbars');
utils.addClass(this.wrapper, 'iScrollLoneScrollbar');
if ( this.options.defaultScrollbars && this.options.customStyle ) {
if ( this.options.listenX ) {
this.wrapper.style.right = '2px';
} else {
this.wrapper.style.bottom = '2px';
}
}
}
var r = this.wrapper.offsetHeight; // force refresh
if ( this.options.listenX ) {
this.wrapperWidth = this.wrapper.clientWidth;
if ( this.options.resize ) {
this.indicatorWidth = Math.max(Math.round(this.wrapperWidth * this.wrapperWidth / (this.scroller.scrollerWidth || this.wrapperWidth || 1)), 8);
this.indicatorStyle.width = this.indicatorWidth + 'px';
} else {
this.indicatorWidth = this.indicator.clientWidth;
}
this.maxPosX = this.wrapperWidth - this.indicatorWidth;
if ( this.options.shrink == 'clip' ) {
this.minBoundaryX = -this.indicatorWidth + 8;
this.maxBoundaryX = this.wrapperWidth - 8;
} else {
this.minBoundaryX = 0;
this.maxBoundaryX = this.maxPosX;
}
this.sizeRatioX = this.options.speedRatioX || (this.scroller.maxScrollX && (this.maxPosX / this.scroller.maxScrollX));
}
if ( this.options.listenY ) {
this.wrapperHeight = this.wrapper.clientHeight;
if ( this.options.resize ) {
this.indicatorHeight = Math.max(Math.round(this.wrapperHeight * this.wrapperHeight / (this.scroller.scrollerHeight || this.wrapperHeight || 1)), 8);
this.indicatorStyle.height = this.indicatorHeight + 'px';
} else {
this.indicatorHeight = this.indicator.clientHeight;
}
this.maxPosY = this.wrapperHeight - this.indicatorHeight;
if ( this.options.shrink == 'clip' ) {
this.minBoundaryY = -this.indicatorHeight + 8;
this.maxBoundaryY = this.wrapperHeight - 8;
} else {
this.minBoundaryY = 0;
this.maxBoundaryY = this.maxPosY;
}
this.maxPosY = this.wrapperHeight - this.indicatorHeight;
this.sizeRatioY = this.options.speedRatioY || (this.scroller.maxScrollY && (this.maxPosY / this.scroller.maxScrollY));
}
this.updatePosition();
},
updatePosition: function () {
var x = this.options.listenX && Math.round(this.sizeRatioX * this.scroller.x) || 0,
y = this.options.listenY && Math.round(this.sizeRatioY * this.scroller.y) || 0;
if ( !this.options.ignoreBoundaries ) {
if ( x < this.minBoundaryX ) {
if ( this.options.shrink == 'scale' ) {
this.width = Math.max(this.indicatorWidth + x, 8);
this.indicatorStyle.width = this.width + 'px';
}
x = this.minBoundaryX;
} else if ( x > this.maxBoundaryX ) {
if ( this.options.shrink == 'scale' ) {
this.width = Math.max(this.indicatorWidth - (x - this.maxPosX), 8);
this.indicatorStyle.width = this.width + 'px';
x = this.maxPosX + this.indicatorWidth - this.width;
} else {
x = this.maxBoundaryX;
}
} else if ( this.options.shrink == 'scale' && this.width != this.indicatorWidth ) {
this.width = this.indicatorWidth;
this.indicatorStyle.width = this.width + 'px';
}
if ( y < this.minBoundaryY ) {
if ( this.options.shrink == 'scale' ) {
this.height = Math.max(this.indicatorHeight + y * 3, 8);
this.indicatorStyle.height = this.height + 'px';
}
y = this.minBoundaryY;
} else if ( y > this.maxBoundaryY ) {
if ( this.options.shrink == 'scale' ) {
this.height = Math.max(this.indicatorHeight - (y - this.maxPosY) * 3, 8);
this.indicatorStyle.height = this.height + 'px';
y = this.maxPosY + this.indicatorHeight - this.height;
} else {
y = this.maxBoundaryY;
}
} else if ( this.options.shrink == 'scale' && this.height != this.indicatorHeight ) {
this.height = this.indicatorHeight;
this.indicatorStyle.height = this.height + 'px';
}
}
this.x = x;
this.y = y;
if ( this.scroller.options.useTransform ) {
this.indicatorStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.scroller.translateZ;
} else {
this.indicatorStyle.left = x + 'px';
this.indicatorStyle.top = y + 'px';
}
},
_pos: function (x, y) {
if ( x < 0 ) {
x = 0;
} else if ( x > this.maxPosX ) {
x = this.maxPosX;
}
if ( y < 0 ) {
y = 0;
} else if ( y > this.maxPosY ) {
y = this.maxPosY;
}
x = this.options.listenX ? Math.round(x / this.sizeRatioX) : this.scroller.x;
y = this.options.listenY ? Math.round(y / this.sizeRatioY) : this.scroller.y;
this.scroller.scrollTo(x, y);
},
fade: function (val, hold) {
if ( hold && !this.visible ) {
return;
}
clearTimeout(this.fadeTimeout);
this.fadeTimeout = null;
var time = val ? 250 : 500,
delay = val ? 0 : 300;
val = val ? '1' : '0';
this.wrapperStyle[utils.style.transitionDuration] = time + 'ms';
this.fadeTimeout = setTimeout((function (val) {
this.wrapperStyle.opacity = val;
this.visible = +val;
}).bind(this, val), delay);
}
};
IScroll.utils = utils;
if ( typeof module != 'undefined' && module.exports ) {
module.exports = IScroll;
} else if ( true ) {
!(__WEBPACK_AMD_DEFINE_RESULT__ = function () { return IScroll; }.call(exports, __webpack_require__, exports, module),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {
window.IScroll = IScroll;
}
})(window, document, Math);
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Underscore.js 1.8.3
// http://underscorejs.org
// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
......@@ -14628,7 +12530,7 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Underscor
/***/ }),
/* 7 */
/* 6 */
/***/ (function(module, exports) {
var g;
......@@ -14655,6 +12557,7 @@ module.exports = g;
/***/ }),
/* 7 */,
/* 8 */,
/* 9 */,
/* 10 */,
......@@ -14700,19 +12603,14 @@ Object.defineProperty(exports, "__esModule", {
//
//
//
//
//
//
//
exports.default = {
props: ['disabled', 'text', 'initParam'],
props: ['disabled', 'initParam'],
data: function data() {
return {
buttonDisabled: this.disabled,
initClass: this.initParam.class,
// 按钮文字
buttonText: this.text ? this.text : this.initParam.text
initText: this.initParam.text
};
},
......@@ -14720,9 +12618,6 @@ exports.default = {
watch: {
disabled: function disabled(_disabled) {
this.buttonDisabled = _disabled;
},
text: function text(_text) {
this.buttonText = _text;
}
},
methods: {
......@@ -15337,14 +13232,7 @@ function _changeList(self, list) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _iscroll = __webpack_require__(5);
var _iscroll2 = _interopRequireDefault(_iscroll);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var PAGE_SIZE = 10; //
//
//
//
//
......@@ -15373,6 +13261,7 @@ var PAGE_SIZE = 10; //
//
//
var PAGE_SIZE = 10;
exports.default = {
props: ['initParam'],
data: function data() {
......@@ -15384,8 +13273,6 @@ exports.default = {
// 组件初始化无数据显示文字
tip: this.initParam.tip,
pagesize: this.initParam.pagesize || PAGE_SIZE,
// IScroll
listScroll: null,
loadText: Vue.t('scroll.clickToLoadMore'),
// loading是否显示
loadShowFlag: false,
......@@ -15395,17 +13282,9 @@ exports.default = {
},
mounted: function mounted() {
this.setLoadShowFlag(this.list.length);
this.initIScroll(this);
},
methods: {
initIScroll: function initIScroll(self) {
self.listScroll = new _iscroll2.default(self.$el, {
bounce: false,
scrollbars: 'custom',
fadeScrollbars: true
});
},
setLoadShowFlag: function setLoadShowFlag(number) {
this.loadShowFlag = number >= this.pagesize;
},
......@@ -15439,7 +13318,6 @@ function _changeList(self, list) {
self.list = list;
self.$nextTick(function () {
self.loadText = Vue.t('scroll.clickToLoadMore');
self.listScroll.refresh();
self.loadFlag = false;
});
}
......@@ -15520,20 +13398,21 @@ Object.defineProperty(exports, "__esModule", {
//
exports.default = {
props: ['initParam', 'activeFlag'],
props: ['active', 'initParam'],
data: function data() {
return {
// 组件初始化文本内容
initText: this.initParam.text,
// 组件初始化样式
initClass: this.initParam.class,
isActive: this.activeFlag
// 组件动画是否执行
activeFlag: this.active
};
},
watch: {
activeFlag: function activeFlag(_activeFlag) {
this.isActive = _activeFlag;
active: function active(_active) {
this.activeFlag = _active;
}
},
methods: {
......@@ -15697,7 +13576,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
var _underscore = __webpack_require__(6);
var _underscore = __webpack_require__(5);
var _underscore2 = _interopRequireDefault(_underscore);
......@@ -15814,7 +13693,6 @@ exports.default = {
//若已存在位置则回到原来的位置,若是新生成的列则给它的位置赋予初始值
};
function initSelect(self, index) {
if (self.distance.length < self.itemList.length) {
self.distance.push(self.minY);
}
......@@ -15987,7 +13865,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
var _underscore = __webpack_require__(6);
var _underscore = __webpack_require__(5);
var _underscore2 = _interopRequireDefault(_underscore);
......@@ -16253,14 +14131,6 @@ function _setValue(self, parameter) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _iscroll = __webpack_require__(5);
var _iscroll2 = _interopRequireDefault(_iscroll);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var PAGE_SIZE = 10; //
//
//
//
......@@ -16300,6 +14170,7 @@ var PAGE_SIZE = 10; //
//
//
var PAGE_SIZE = 10;
exports.default = {
props: ['initParam'],
data: function data() {
......@@ -16312,8 +14183,6 @@ exports.default = {
tip: this.initParam.tip,
// 组件列表滑动下标
swipeListIndex: null,
// IScroll
swipeListScroll: null,
pagesize: this.initParam.pagesize || PAGE_SIZE,
loadText: Vue.t('scroll.clickToLoadMore'),
// loading是否显示
......@@ -16324,17 +14193,9 @@ exports.default = {
},
mounted: function mounted() {
this.setLoadShowFlag(this.swipeList.length);
this.initIScroll(this);
},
methods: {
initIScroll: function initIScroll(self) {
self.swipeListScroll = new _iscroll2.default(self.$el, {
bounce: false,
scrollbars: 'custom',
fadeScrollbars: true
});
},
setLoadShowFlag: function setLoadShowFlag(number) {
this.loadShowFlag = number >= this.pagesize;
},
......@@ -16394,7 +14255,6 @@ function _changeList(self, list) {
self.swipeList = list;
self.$nextTick(function () {
self.loadText = Vue.t('scroll.clickToLoadMore');
self.swipeListScroll.refresh();
self.loadFlag = false;
});
}
......@@ -16538,6 +14398,11 @@ exports.default = {
},
watch: {
text: function text(_text) {
console.log(_text);
this.inputText = _text;
},
// 文本变化 控制清除按钮显示 通知事件和变化后的文本
inputText: function inputText(text) {
watchInputText(this, text);
......@@ -21480,7 +19345,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
value: ((_vm.list.length == 0)),
expression: "(list.length == 0)"
}],
staticClass: "folding-tip"
staticClass: "u-folding-tip"
}, [_vm._v(_vm._s(_vm.tip))])])
},staticRenderFns: []}
module.exports.render._withStripped = true
......@@ -21511,6 +19376,9 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
return _c('v-touch', {
key: index,
staticClass: "u-swipe-list-row",
class: {
'active': (index == _vm.swipeListIndex)
},
attrs: {
"tag": "li",
"swipe-options": {
......@@ -21525,9 +19393,6 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
}
}, [_c('v-touch', {
staticClass: "u-swipe-list-handle",
class: {
'u-swipe-list-selected': (index == _vm.swipeListIndex)
},
attrs: {
"tag": "div"
},
......@@ -21654,7 +19519,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
on: {
"tap": _vm.onTapButton
}
}, [_vm._v(_vm._s(_vm.buttonText) + "\n")])
}, [_vm._v(_vm._s(_vm.initText) + "\n")])
},staticRenderFns: []}
module.exports.render._withStripped = true
if (false) {
......@@ -22033,7 +19898,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
return _c('div', {
staticClass: "u-marquee",
class: [_vm.initClass, {
activeFlag: _vm.isActive
active: _vm.activeFlag
}]
}, [_c('div', {
staticClass: "u-marquee-text",
......@@ -22099,6 +19964,12 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
staticClass: "u-select",
class: _vm.initClass
}, [_c('ul', {
directives: [{
name: "show",
rawName: "v-show",
value: (_vm.selectList.length),
expression: "selectList.length"
}],
staticClass: "u-select-scroll"
}, [_vm._l((_vm.selectList), function(item, index) {
return _c('v-touch', {
......
......@@ -26,6 +26,9 @@
.tap_row(@ADDDEVICE-ROW-ACTIVE-BG);
}
//产品型号
.u-list();
//配置Wi-Fi
.wifiAddHelp{
.help();
......
......@@ -152,9 +152,9 @@
}
//门锁管理
.doorlockManage{
.doorlockManage li{
font-size: 16px;
padding: 17px 72px 17px 42px;
padding: 17px 42px;
position: relative;
overflow: hidden;
p{
......@@ -164,11 +164,14 @@
margin-top: 3px;
}
// > icon
&.name{
padding-right: 72px;
&:before{
content: '\e6a7';
.transformV_center(right,35px);
.iconfont(@USERINFOLINK-ICON-FONTSIZE);
}
}
&:after{
content: '';
position: absolute;
......@@ -180,4 +183,6 @@
}
}
.u-switch();
.unbindState-dialog();
\ No newline at end of file
......@@ -145,10 +145,11 @@
.inviteBind{
margin: 40px 38px 0;
li{
p{
&:first-child{
width: 200px;
height: 200px;
margin: 0 auto;
position: relative;
}
&:not(:first-child){
color: @INVITEBIND-TEXT-COLOR;
......@@ -164,6 +165,19 @@
margin-top: 33px;
}
}
p{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
text-align: center;
background-color: rgba(255, 255, 255, 0.1);
span{
.transformV_center(left,0);
width: 100%;
}
}
}
}
......
......@@ -4,7 +4,7 @@
//开锁信息列表
.title{
height: 48px;
line-height: 48px;
line-height: 46px;
position: relative;
font-size: @UNLOCKINFO-TITLE-FONTSIZE;
padding-left: 42px;
......@@ -14,6 +14,7 @@
}
}
/*
.u-list();
.custom-unlockInfo-list{
......@@ -45,13 +46,24 @@
font-size: @LIST-NOCONTTIP-FONTSIZE;
}
}
*/
//绑定开锁信
.u-swipe-list();
.custom-swipe-list{
.u-swipe-list-scroll .u-swipe-list-row .u-swipe-list-handle{
background-color: #242635;
}
}
//绑定开锁信息
.opendoorMode{
border: solid #50515d;
border-width: 2px 0;/*no*/
overflow: hidden;
ul{
}
.modeSelect{
padding: 11px 42px;
font-size: 0;
margin: 0 -5px;
......@@ -82,7 +94,6 @@
}
}
}
}
}
.u-select();
......@@ -129,9 +140,15 @@
margin-top: 4px;
}
.u-switch();
.u-button();
.custom-button{
.button();
.buttonPosition();
}
.guide-dialog{
.mask(1051,@CUSTOM-BACKDROP-BG);
}
\ No newline at end of file
......@@ -355,8 +355,8 @@
.u-swipe-list{
width: 100%;
height: 100%;
overflow: auto;
position: relative;
overflow: auto;
}
.u-swipe-list-scroll .u-swipe-list-row{
position: relative;
......@@ -389,9 +389,6 @@
.u-swipe-list-subtitle{
.text_oneRow_ellipsis();
}
&.u-swipe-list-selected{
left: -120px;
}
}
.u-swipe-list-button{
position: absolute;
......@@ -419,12 +416,15 @@
.defaultBorder();
z-index: 2;
}
&.active .u-swipe-list-handle{
left: -120px;
}
}
//上拉加载
.u-swipe-list-load{
text-align: center;
}
//list 无内容
//swipeList 无内容
.u-swipeList-tip{
.transformV_center(left,0);
width: 100%;
......
web/resources/image/scanCodeAdd.png

3.26 KB | W: | H:

web/resources/image/scanCodeAdd.png

3.07 KB | W: | H:

web/resources/image/scanCodeAdd.png
web/resources/image/scanCodeAdd.png
web/resources/image/scanCodeAdd.png
web/resources/image/scanCodeAdd.png
  • 2-up
  • Swipe
  • Onion skin
{"loading":"loading...","scroll":{"clickToLoadMore":"点击加载更多","loading":"loading..."},"btn":{"confirm":"确定","guideLogin":"账号/密码登录","login":"登录","getCode":"获取验证码","register":"注册","logout":"退出系统","save":"保存","qrcode":"生成二维码","wifiAdd":"开始配置Wi-Fi","connect":"连接","bindUser":"绑定姓名","bind":"我要绑定","reBound":"请重新绑定","saveQRcode":"保存二维码到相册","unbind":"解绑","deleteUser":"删除该用户","qrcodeReset":"重新生成二维码","add":"添加","next":"下一步","iSee":"我知道了","unbindDoorlock":"解绑门锁"},"dialog":{"confirm":"确认","cancel":"取消","unbind":"解绑","delete":"删除"},"title":{"login":"登录","register":"注册","forgetPassword":"忘记密码","device":"智能指纹锁","opendoorRecord":"开门记录","alarmInfo":"报警信息","remoteOpendoor":"远程开门","hijackRecord":"劫持记录","doorlockManage":"门锁管理","editName":"修改名称","qrcode":"生成绑定二维码","addDevice":"添加设备","scanCodeAdd":"扫描绑定设备","wifiAddHelp":"配置Wi-Fi","wifiAdd":"连接Wi-Fi","bindUserHelp":"ID-姓名绑定","bindUser":"绑定用户","userList":"用户列表","doorlockUser":"门锁用户","addUser":"添加用户","inviteBind":"邀请绑定","unlockInfo":"绑定开锁信息"},"guide":{"footer":"指纹改变生活"},"login":{"telInputTip":"请输入手机号","passwordInputTip":"请输入密码","register":"快速注册","forgetPassword":"忘记密码","error":{"telNull":"请输入手机号","passWordNull":"请输入密码"}},"register":{"telInputTip":"请输入手机号","codeInputTip":"请输入验证码","passwordInputTip":"请输入6位登录密码","error":{"telNull":"请输入手机号","codeNull":"请输入验证码","passWordNull":"请输入密码"}},"forgetPassword":{"telInputTip":"请输入手机号","codeInputTip":"请输入验证码","passwordInputTip":"请输入6位登录密码","error":{"telNull":"请输入手机号","codeNull":"请输入验证码","passWordNull":"请输入密码"}},"device":{"opendoorRecord":"开门记录","securityAlarm":"安全报警","doorlockUser":"门锁用户","remoteOpendoor":"远程开门","hijackAlarm":"劫持报警","doorlockManage":"门锁管理","followTitle":"关注服务号","followCont1":"关注 “i智信” 微信服务号可随时随地掌握设备动态<br>再也不担心错过重要通知,赶紧按下方提示试试吧","followCont2":"1.保存二维码-2.用微信从<span>相册选取扫码</span>-3.关注","laterFollow":"稍后关注","bindDoorlock":"绑定门锁"},"opendoorRecord":{"noRecordTip":"暂无记录"},"alarmInfo":{"noInfoTip":"暂无信息"},"remoteOpendoor":{"passwordInputTip":"请输入远程开门密码","error":{}},"hijackRecord":{"noRecordTip":"暂无记录"},"doorlockManage":{"name":"名称","unbindDialogTip":"<span></span>解锁门锁后,您将失去对该门锁<br>所有查看、管理等功能操作","unbindSuccess":"解绑成功"},"editName":{"nameInputTip":"请输入用户名","error":{}},"qrcode":{"helpTitle":"注意事项:","helpCont1":"1.仅超级管理员(通过Wi-Fi配网绑定的用户为超级管理员)可以生成绑定二维码","helpCont2":"2.二维码有效时间为10分钟且只能使用一次","helpCont3":"3.用户只需要扫描该二维码即可绑定指纹锁","helpCont4":"4.绑定失败则需要重新生成二维码进行绑定"},"addDevice":{"scanCodeAdd":"扫描绑定设备","wifiAdd":"配置Wi-Fi"},"wifiAddHelp":{"helpTitle":"配置Wi-Fi说明:","helpCont1":"1.按下指纹锁背面的按钮,进入主菜单,选择Wi-Fi设置→配置Wi-Fi,门锁进入等待配网状态","helpCont2":"2.点击页面 “开始配置Wi-Fi” 按钮,进入Wi-Fi配网画面","helpCont3":"3.输入Wi-Fi密码,点击 “l连接” 按钮,等待锁端相应,直至配网成功","helpCont4":"(提示:如果指纹锁已经绑定过用户,重新绑定成功后会清除之前所有绑定信息)"},"wifiAdd":{"passwordInputTip":"请输入Wi-Fi密码","remindTitle":"配置Wi-Fi提醒:","remindCont1":"1. 请确保Wi-Fi信号良好","remindCont2":"2. 本产品暂不支持5GHz无线网络","error":{}},"bindUserHelp":{"helpTitle":"配对姓名说明:","helpCont1":"1.在指纹锁上录入指纹、密码、卡并获得相应ID","helpCont2":"2.通过姓名绑定将该ID绑定对应用户姓名","helpCont3":"3.绑定成功后,开门记录中将会显示已绑定的用户姓名","helpCont4":"4.用户姓名信息只保存在APP端,不影响锁端设置","boundUser":"查看已绑定ID姓名"},"bindUser":{"editHeadTip":"点击编辑用户头像","nameTitle":"姓名","fingerprintIDTitle":"指纹ID","passwordIDTitle":"密码ID","ICCardIDTitle":"IC卡ID","requiredInputTip":"(必填)","optionalInputTip":"(选填)","error":{}},"userList":{"name":"昵称:","noUserTip":"暂无用户"},"commstatusLoading":{"connectSuccess":"Wi-Fi连接成功,正在绑定...","bindSuccess":"绑定成功","bindFailed":"绑定失败"},"addUser":{"nameInputTip":"请输入您想添加的用户名","error":{}},"doorlockUser":{"name":"昵称:","inviteBind":"邀请绑定","bindUnlockInfo":"绑定开锁信息","opendoorRecord":"历史开门记录","unbindDialogTip":"<span></span>解绑后,您将失去对门锁所有查看功能该用户仍在用户列表中","deleteUserDialogTip":"删除后,二者不再为绑定关系,用户无法查看该门锁下的任何信息,该用户名下绑定的所有ID号仍可以显示在开门记录中","unbindSuccess":"解绑成功","guideStep1Tip1":"邀请绑定成功","guideStep1Tip2":"(可查看开门记录,报警记录等<br>相关门锁信息)","guideStep3Tip":"绑定后看可了解<br>该用户的开门情况"},"inviteBind":{"title":"注意事项:","cont1":"1.直接通过微信扫一扫添加门锁","cont2":"2.将此二维码保存为图片,发送给好友,好友通过长按识别二维码"},"unlockInfo":{"bindUnlockInfo":"已绑定的开锁信息","noInfoTip":"目前无绑定任何信息,请添加"},"addUnlockInfo":{"opendoorMode":"开门方式","fingerprint":"指纹","password":"密码","icCard":"IC卡","key":"钥匙","hijackFingerprint":"劫持指纹","opendoorRecord":"今日开门记录","tip":"仅显示未绑定开门记录","noRecordTip":"暂无记录"}}
\ No newline at end of file
{"loading":"loading...","scroll":{"clickToLoadMore":"点击加载更多","loading":"loading..."},"btn":{"confirm":"确定","guideLogin":"账号/密码登录","login":"登录","getCode":"获取验证码","register":"注册","logout":"退出系统","save":"保存","qrcode":"生成二维码","wifiAdd":"开始配置Wi-Fi","connect":"连接","bindUser":"绑定姓名","bind":"我要绑定","reBound":"请重新绑定","saveQRcode":"保存二维码到相册","unbind":"解绑","deleteUser":"删除该用户","qrcodeReset":"重新生成二维码","add":"添加","next":"下一步","iSee":"我知道了","unbindDoorlock":"解绑门锁"},"dialog":{"confirm":"确认","cancel":"取消","unbind":"解绑","delete":"删除"},"title":{"login":"登录","register":"注册","forgetPassword":"忘记密码","device":"智能指纹锁","opendoorRecord":"开门记录","alarmInfo":"报警信息","remoteOpendoor":"远程开门","hijackRecord":"劫持记录","doorlockManage":"门锁管理","editName":"修改名称","qrcode":"生成绑定二维码","addDevice":"添加设备","scanCodeAdd":"扫描绑定设备","wifiAddHelp":"配置Wi-Fi","wifiAdd":"连接Wi-Fi","bindUserHelp":"ID-姓名绑定","bindUser":"绑定用户","userList":"用户列表","doorlockUser":"门锁用户","addUser":"添加用户","inviteBind":"邀请绑定","unlockInfo":"关联开锁信息","myInfo":"个人信息","editNickname":"修改昵称","editPassword":"修改密码","addUnlockInfo":"绑定开锁信息","deviceList":"产品型号"},"guide":{"footer":"指纹改变生活"},"login":{"telInputTip":"请输入手机号","passwordInputTip":"请输入密码","register":"快速注册","forgetPassword":"忘记密码","failure":"登陆失败","error":{"telNull":"请输入手机号","passWordNull":"请输入密码"}},"register":{"telInputTip":"请输入手机号","codeInputTip":"请输入验证码","passwordInputTip":"请输入6位登录密码","error":{"telNull":"请输入手机号","codeNull":"请输入验证码","passWordNull":"请输入密码"}},"forgetPassword":{"telInputTip":"请输入手机号","codeInputTip":"请输入验证码","passwordInputTip":"请输入6位登录密码","error":{"telNull":"请输入手机号","codeNull":"请输入验证码","passWordNull":"请输入密码"}},"device":{"opendoorRecord":"开门记录","securityAlarm":"安全报警","doorlockUser":"门锁用户","remoteOpendoor":"远程开门","hijackAlarm":"劫持报警","doorlockManage":"门锁管理","followTitle":"关注服务号","followCont1":"关注 “i智信” 微信服务号可随时随地掌握设备动态<br>再也不担心错过重要通知,赶紧按下方提示试试吧","followCont2":"1.保存二维码-2.用微信从<span>相册选取扫码</span>-3.关注","laterFollow":"稍后关注","newMsgDoorlock":"门锁最新消息","doorLockRinging":"门铃响了","defaultNewMsg":"您尚未绑定门锁","noNewMsg":"门锁休息中","bindDoorlock":"绑定门锁"},"opendoorRecord":{"noRecordTip":"暂无记录","passwordOpenDoor":"密码开门","fingerprintOpenDoor":"指纹开门","ICcardOpenDoor":"IC卡开门","remoteOpenDoor":"遥控器开门","keyOpenDoor":"钥匙开门","hijackingAlarm":"劫持报警","appRemoteOpenDoor":"app远程开门"},"alarmInfo":{"noInfoTip":"暂无信息","tamperAlarm":"防撬报警","trialAlarm":"试错报警","powerAlarm":"欠电报警","fackLockAlram":"假锁报警"},"remoteOpendoor":{"loading":"远程开门中","passwordInputTip":"请输入远程开门密码","openDoorSuccess":"远程开门成功","openDoorFailure":"远程开门失败","remoteOpendoorAgain":"请尝试重试","error":{"noPasswordTip":"远程密码不能为空"}},"hijackRecord":{"noRecordTip":"暂无记录","hijackingAlarm":"劫持指纹报警"},"doorlockManage":{"name":"名称","deleteDialogTip":"<span>{0}</span>将被删除","logoutDialogTip":"确定要退出系统吗?","deleteSuccess":"删除成功","deleteFailue":"删除失败","defaultNickname":"门锁","unbindDialogTip":"<span></span>解锁门锁后,您将失去对该门锁<br>所有查看、管理等功能操作","unbindSuccess":"解绑成功","doorbellMsgPush":"门铃消息推送","alarmMsgPush":"报警消息推送","opendoorMsgPush":"开门消息推送"},"editName":{"nameInputTip":"请输入设备名称","nickNameInputTip":"请输入用户名","editNameSuccess":"修改名称成功","editNameFailue":"修改名称失败","error":{"nameCanNotBeBlank":"设备名称不能为空","nicknameCanNotBeBlank":"用户名不能为空"}},"qrcode":{"helpTitle":"注意事项:","helpCont1":"1.仅超级管理员(通过Wi-Fi配网绑定的用户为超级管理员)可以生成绑定二维码","helpCont2":"2.二维码有效时间为10分钟且只能使用一次","helpCont3":"3.用户只需要扫描该二维码即可绑定指纹锁","helpCont4":"4.绑定失败则需要重新生成二维码进行绑定"},"addDevice":{"scanCodeAdd":"扫描绑定设备","wifiAdd":"配置Wi-Fi","loading":"loading","bindSuccess":"绑定成功","bindFailure":"绑定失败","reBindDevice":"请重新绑定"},"wifiAddHelp":{"helpTitle":"配置Wi-Fi说明:","helpCont1":"1.按下指纹锁背面的按钮,进入主菜单,选择Wi-Fi设置→配置Wi-Fi,门锁进入等待配网状态","helpCont2":"2.点击页面 “开始配置Wi-Fi” 按钮,进入Wi-Fi配网画面","helpCont3":"3.输入Wi-Fi密码,点击 “l连接” 按钮,等待锁端相应,直至配网成功","helpCont4":"(提示:如果指纹锁已经绑定过用户,重新绑定成功后会清除之前所有绑定信息)"},"wifiAdd":{"passwordInputTip":"请输入Wi-Fi密码","remindTitle":"配置Wi-Fi提醒:","remindCont1":"1. 请确保Wi-Fi信号良好","remindCont2":"2. 本产品暂不支持5GHz无线网络","error":{}},"bindUserHelp":{"helpTitle":"配对姓名说明:","helpCont1":"1.在指纹锁上录入指纹、密码、卡并获得相应ID","helpCont2":"2.通过姓名绑定将该ID绑定对应用户姓名","helpCont3":"3.绑定成功后,开门记录中将会显示已绑定的用户姓名","helpCont4":"4.用户姓名信息只保存在APP端,不影响锁端设置","boundUser":"查看已绑定ID姓名"},"bindUser":{"editHeadTip":"点击编辑用户头像","nameTitle":"姓名","fingerprintIDTitle":"指纹ID","passwordIDTitle":"密码ID","ICCardIDTitle":"IC卡ID","requiredInputTip":"(必填)","optionalInputTip":"(选填)","error":{}},"userList":{"name":"昵称:","noUserTip":"暂无用户"},"commstatusLoading":{"connectSuccess":"Wi-Fi连接成功,正在绑定...","bindSuccess":"绑定成功","bindFailed":"绑定失败"},"addUser":{"nameInputTip":"请输入您想添加的用户名","addUserSuccess":"添加用户成功","addUserFailure":"添加用户失败","error":{"nameCanNotEmpty":"用户名不能为空"}},"doorlockUser":{"name":"昵称:","inviteBind":"邀请绑定","bindUnlockInfo":"关联开锁信息","opendoorRecord":"历史开门记录","unbindDialogTip":"<span></span>解绑后,您将失去对门锁所有查看功能该用户仍在用户列表中","deleteUserDialogTip":"删除后,二者不再为绑定关系,用户无法查看该门锁下的任何信息,该用户名下绑定的所有ID号仍可以显示在开门记录中","unbindSuccess":"解绑成功","unbindFailue":"解绑失败","guideStep1Tip1":"邀请绑定成功","guideStep1Tip2":"(可查看开门记录,报警记录等<br>相关门锁信息)","guideStep3Tip":"绑定后看可了解<br>该用户的开门情况","deleteSuccess":"删除成功","deleteFailure":"删除失败"},"inviteBind":{"qrcodeExpireTip":"二维码已过期,请重新生成","title":"注意事项:","cont1":"1.直接通过微信扫一扫添加门锁","cont2":"2.将此二维码保存为图片,发送给好友,好友通过长按识别二维码"},"unlockInfo":{"bindUnlockInfo":"已关联的开锁信息","noInfoTip":"目前无绑定任何信息,请添加","passwordOpenDoor":"密码","fingerprintOpenDoor":"指纹","ICcardOpenDoor":"IC卡","remoteOpenDoor":"遥控器","keyOpenDoor":"钥匙","appRemoteOpenDoor":"app远程","setHijack":"设为劫持","setHijackTip":"确认设为劫持指纹吗?","cancelHijack":"取消劫持","cancelHijackTip":"确认取消劫持指纹吗?","cancelAssociated":"取消关联","cancelAssociatedTip":"取消关联后,开门历史记录中将不再显示关联的用户信息"},"addUnlockInfo":{"opendoorMode":"选择要关联的开锁方式","fingerprint":"指纹","password":"密码","icCard":"IC卡","key":"钥匙","hijackFingerprint":"劫持指纹","opendoorRecord":"选择要关联的开锁ID","tip":"仅显示未绑定开门记录","addInfoSuccess":"添加绑定开锁信息成功","addInfoFailue":"添加绑定开锁信息失败","noRecordTip":"暂无记录","setHijackSwitch":"设为劫持指纹","guideStep1Tip":"选择需要添加关联的开门方式","guideStep3Tip":"根据开门记录中的开门时间,选择关联的<br>开门ID<span>(一个ID只能被一个用户绑定)</span>","guideStep5Tip":"使用劫持指纹开门时,会以报警形式<br>通知到该门锁名下的其他绑定用户"},"myInfo":{"editNickname":"修改昵称","editPassword":"修改密码","logoutDialogTip":"确定要退出系统吗?"},"editNickname":{"nickNameInputTip":"请输入昵称"},"editPassword":{"newPasswordInputTip":"请输入新密码","oldPasswordInputTip":"请输入旧密码","oldPasswordInputTipAgain":"请再次输入旧密码"},"request":{"error":"请求发送失败"},"deviceList":{"model":"型号:"}}
\ No newline at end of file
......@@ -483,6 +483,92 @@ p {
background-color: #153D4C;
}
.u-list {
width: 100%;
height: 100%;
overflow: auto;
position: relative;
}
.u-list-scroll .u-list-row {
padding: 0.4rem 0.4rem 0.4rem 0.533rem;
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
}
.u-list-scroll .u-list-row .u-list-left-image {
width: 1.333rem;
height: 1.333rem;
margin-right: 0.267rem;
}
.u-list-scroll .u-list-row .u-list-left-icon {
margin-right: 0.267rem;
font-family: iconfont;
font-size: 0.533rem;
-webkit-font-smoothing: antialiased;
line-height: 1;
}
.u-list-scroll .u-list-row div {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
min-width: 0;
}
.u-list-scroll .u-list-row .u-list-title {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.u-list-scroll .u-list-row .u-list-subtitle {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.u-list-scroll .u-list-row .u-list-right-text {
margin-left: 0.107rem;
}
.u-list-scroll .u-list-row .u-list-right-icon {
font-family: defaultIconfont;
font-size: 0.667rem;
-webkit-font-smoothing: antialiased;
line-height: 1;
}
.u-list-scroll .u-list-row:after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 1px;
background: #bbb;
}
.u-list-load {
text-align: center;
}
.u-list-tip {
position: absolute;
top: 50%;
left: 0;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
width: 100%;
text-align: center;
}
.wifiAddHelp {
margin: 0.8rem 1.013rem 1.547rem;
}
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="format-detection" content="telephone=no"/>
<title></title>
<link rel="stylesheet" type="text/css" href="../../lib/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="./addDevice.css">
<style type="text/css">
[v-cloak]{
display: none;
}
</style>
<script type="text/javascript" src="../../lib/js/p.js"></script>
<script type="text/javascript" src="../../lib/js/UIOT.js"></script>
</head>
<body ontouchstart="">
<div id="app" v-cloak>
<div class="header">
<v-touch tag="span" class="header-left icon" v-on:tap="onBackTap">&#xe611;</v-touch>
<p>{{ $t('title.deviceList') }}</p>
</div>
<u-list :init-param="componentsConfig.deviceList.initParam" v-on:u-list-tap="onDeviceListRowTap"></u-list>
<u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog>
<u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading>
</div>
<script type="text/javascript" src="./deviceList.js" defer async></script>
</body>
</html>
\ No newline at end of file
......@@ -41,11 +41,11 @@
</ul>
<u-button :init-param="componentsConfig.connectButton.initParam" v-on:u-button-tap="onConnectButtonTap"></u-button>
</div>
<u-commstatus-loading ref="ucommstatusloading" :text="textLoading" :status="status"
:init-param="componentsConfig.ucommstatusloading.initParam" v-on:u-commstatus-loading-tap="onCommstatusLoadingButtonTap()">
<u-comm-loading ref="ucommloading"
:init-param="componentsConfig.ucommloading.initParam" v-on:u-comm-loading-tap="onCommLoadingButtonTap()">
<p class="loader"></p>
<p class="icon"></p>
</u-commstatus-loading>
</u-comm-loading>
<u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog>
<u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading>
</div>
......
......@@ -715,8 +715,8 @@ p {
.u-swipe-list {
width: 100%;
height: 100%;
overflow: auto;
position: relative;
overflow: auto;
}
.u-swipe-list-scroll .u-swipe-list-row {
......@@ -773,10 +773,6 @@ p {
text-overflow: ellipsis;
}
.u-swipe-list-scroll .u-swipe-list-row .u-swipe-list-handle.u-swipe-list-selected {
left: -3.2rem;
}
.u-swipe-list-scroll .u-swipe-list-row .u-swipe-list-button {
position: absolute;
top: 0;
......@@ -820,6 +816,10 @@ p {
z-index: 2;
}
.u-swipe-list-scroll .u-swipe-list-row.active .u-swipe-list-handle {
left: -3.2rem;
}
.u-swipe-list-load {
text-align: center;
}
......
......@@ -818,21 +818,25 @@ p {
line-height: 1.067rem;
}
.doorlockManage {
.doorlockManage li {
font-size: 0.427rem;
padding: 0.453rem 1.92rem 0.453rem 1.12rem;
padding: 0.453rem 1.12rem;
position: relative;
overflow: hidden;
}
.doorlockManage p {
.doorlockManage li p {
float: right;
color: #A0A0A7;
font-size: 0.32rem;
margin-top: 0.08rem;
}
.doorlockManage:before {
.doorlockManage li.name {
padding-right: 1.92rem;
}
.doorlockManage li.name:before {
content: '\e6a7';
position: absolute;
top: 50%;
......@@ -845,7 +849,7 @@ p {
line-height: 1;
}
.doorlockManage:after {
.doorlockManage li:after {
content: '';
position: absolute;
bottom: 0;
......@@ -856,6 +860,71 @@ p {
background: linear-gradient(to right, #242635, #fff, #242635);
}
.u-switch {
position: relative;
width: 2.667rem;
height: 1.333rem;
}
.u-switch .u-switch-handle {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
width: 1.333rem;
height: 0.8rem;
border: 2px solid;
border-radius: 0.533rem;
background-clip: padding-box;
}
.u-switch .u-switch-handle:before {
content: '';
position: absolute;
z-index: 1;
top: -1px;
width: 0.747rem;
height: 0.747rem;
-webkit-transition: left 0.2s ease-in-out;
transition: left 0.2s ease-in-out;
border-radius: 0.427rem;
background-color: #fff;
background-clip: padding-box;
-webkit-box-shadow: 0 0.053rem 0.133rem rgba(0, 0, 0, 0.4);
box-shadow: 0 0.053rem 0.133rem rgba(0, 0, 0, 0.4);
}
.u-switch.u-switch-on .u-switch-handle {
border-color: #4cd964;
-webkit-box-shadow: inset 0 0 0 0.427rem #4cd964;
box-shadow: inset 0 0 0 0.427rem #4cd964;
background-color: #4cd964;
-webkit-transition: border ease 0.4s, -webkit-box-shadow ease 0.4s, background-color ease 1.2s;
transition: border ease 0.4s, box-shadow ease 0.4s, background-color ease 1.2s;
}
.u-switch.u-switch-on .u-switch-handle:before {
left: 0.48rem;
}
.u-switch.u-switch-off .u-switch-handle {
border-color: #bbb;
-webkit-box-shadow: inset 0 0 0 0 #bbb;
box-shadow: inset 0 0 0 0 #bbb;
background-color: #bbb;
-webkit-transition: border cubic-bezier(0, 0, 0, 1) 0.4s, -webkit-box-shadow cubic-bezier(0, 0, 0, 1) 0.4s;
transition: border cubic-bezier(0, 0, 0, 1) 0.4s, box-shadow cubic-bezier(0, 0, 0, 1) 0.4s;
}
.u-switch.u-switch-off .u-switch-handle:before {
left: -1px;
}
.u-switch.disabled {
opacity: 0.3;
}
.unbindState-dialog {
position: fixed;
top: 0;
......
......@@ -25,10 +25,24 @@
<p>{{ $t('title.doorlockManage') }}</p>
</div>
<div class="content">
<v-touch tag="div" class="doorlockManage" v-on:tap="onEditNameTap">
<ul class="doorlockManage">
<v-touch tag="li" class="name" v-on:tap="onEditNameTap">
{{ $t('doorlockManage.name') }}
<p>{{ textDoorlock }}</p>
</v-touch>
<li>
{{ $t('doorlockManage.doorbellMsgPush') }}
<u-switch :value="valueDoorbell" :init-param="componentsConfig.doorbellSwitch.initParam"></u-switch>
</li>
<li>
{{ $t('doorlockManage.alarmMsgPush') }}
<u-switch :value="valueAlarm" :init-param="componentsConfig.alarmSwitch.initParam"></u-switch>
</li>
<li>
{{ $t('doorlockManage.opendoorMsgPush') }}
<u-switch :value="valueOpendoor" :init-param="componentsConfig.opendoorSwitch.initParam"></u-switch>
</li>
</ul>
<u-button :init-param="componentsConfig.unbindDoorlockButton.initParam" v-on:u-button-tap="onUnbindDoorlockButtonTap"></u-button>
</div>
<transition name="fade">
......
......@@ -22,17 +22,16 @@
<div id="app" v-cloak>
<div class="header">
<v-touch tag="span" class="header-left icon" v-on:tap="onBackTap">&#xe611;</v-touch>
<p>{{ $t('title.unlockInfo') }}</p>
<p>{{ $t('title.addUnlockInfo') }}</p>
</div>
<div class="content">
<div class="opendoorMode">
<p class="title">{{ $t('addUnlockInfo.opendoorMode') }}</p>
<ul>
<ul class="modeSelect">
<li class="active">{{ $t('addUnlockInfo.fingerprint') }}</li>
<li>{{ $t('addUnlockInfo.password') }}</li>
<li>{{ $t('addUnlockInfo.icCard') }}</li>
<li>{{ $t('addUnlockInfo.key') }}</li>
<li>{{ $t('addUnlockInfo.hijackFingerprint') }}</li>
<li>遥控器</li>
</ul>
</div>
<div class="opendoorRecord">
......@@ -40,9 +39,70 @@
<u-select ref="uselect" :value="recordSelectIndex" :init-param="componentsConfig.recordSelect.initParam"
v-on:u-select-change="onRecordSelectChange(arguments[0])"></u-select>
<p class="tip">{{ $t('addUnlockInfo.tip') }}</p>
<u-switch :value="valueSetHijack" :init-param="componentsConfig.setHijackSwitch.initParam"></u-switch>
</div>
<u-button :init-param="componentsConfig.addButton.initParam" v-on:u-button-tap="onAddButtonTap"></u-button>
</div>
<transition name="fade">
<div class="guide-dialog" v-show="guideShowFlag">
<transition name="fade">
<div class="guideStep1" v-show="guideStep1ShowFlag">
<div class="guideStep1Cont">
<p class="title">{{ $t('addUnlockInfo.opendoorMode') }}</p>
<ul class="modeSelect">
<li class="active">{{ $t('addUnlockInfo.fingerprint') }}</li>
<li>{{ $t('addUnlockInfo.password') }}</li>
<li>{{ $t('addUnlockInfo.icCard') }}</li>
<li>遥控器</li>
</ul>
</div>
<div class="guideStep1Tip">
{{ $t('addUnlockInfo.guideStep1Tip') }}
</div>
</div>
</transition>
<transition name="fade">
<div class="guideStep2" v-show="guideStep2ShowFlag">
<u-button :init-param="componentsConfig.nextButton.initParam" v-on:u-button-tap="onNextButtonTap"></u-button>
</div>
</transition>
<transition name="fade">
<div class="guideStep3" v-show="guideStep3ShowFlag">
<div class="guideStep3Tip" v-html="$t('addUnlockInfo.guideStep3Tip')"></div>
<div class="guideStep3Cont">
<ul>
<li class="active">
<p>16:35</p>
<p>ID:001</p>
</li>
<li>
<p>15:33</p>
<p>ID:002</p>
</li>
</ul>
</div>
</div>
</transition>
<transition name="fade">
<div class="guideStep4" v-show="guideStep4ShowFlag">
<u-button :init-param="componentsConfig.nextButton.initParam" v-on:u-button-tap="onNextStepButtonTap"></u-button>
</div>
</transition>
<transition name="fade">
<div class="guideStep5" v-show="guideStep5ShowFlag">
<div class="guideStep5Tip" v-html="$t('addUnlockInfo.guideStep5Tip')"></div>
<div class="guideStep3Cont">
<p>{{ $t('addUnlockInfo.setHijackSwitch') }}</p>
</div>
</div>
</transition>
<transition name="fade">
<div class="guideStep6" v-show="guideStep6ShowFlag">
<u-button :init-param="componentsConfig.iSeeButton.initParam" v-on:u-button-tap="onISeeButtonTap"></u-button>
</div>
</transition>
</div>
</transition>
<u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog>
<u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading>
</div>
......
......@@ -814,10 +814,11 @@ p {
margin: 1.067rem 1.013rem 0;
}
.inviteBind li p {
.inviteBind li:first-child {
width: 5.333rem;
height: 5.333rem;
margin: 0 auto;
position: relative;
}
.inviteBind li:not(:first-child) {
......@@ -835,6 +836,25 @@ p {
margin-top: 0.88rem;
}
.inviteBind li p {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
text-align: center;
background-color: rgba(255, 255, 255, 0.1);
}
.inviteBind li p span {
position: absolute;
top: 50%;
left: 0;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
width: 100%;
}
.unbindState-dialog {
position: fixed;
top: 0;
......
......@@ -27,7 +27,9 @@
<div class="content">
<ul class="inviteBind">
<li>
<p></p>
<p>
<span>{{ $t('inviteBind.qrcodeExpireTip') }}</span>
</p>
</li>
<li>{{ $t('inviteBind.title') }}</li>
<li>{{ $t('inviteBind.cont1') }}</li>
......
......@@ -454,7 +454,7 @@ p {
.title {
height: 1.28rem;
line-height: 1.28rem;
line-height: 1.227rem;
position: relative;
font-size: 0.427rem;
padding-left: 1.12rem;
......@@ -465,31 +465,75 @@ p {
top: 2.453rem;
}
.u-list {
/*
.u-list();
.custom-unlockInfo-list{
position: absolute;
top: 44px;
bottom: 0;
left: 0;
height: auto;
.u-list-scroll .u-list-row{
color: @UNLOCKINFOLIST-TEXT-COLOR;
font-size: @UNLOCKINFOLIST-TEXT-FONTSIZE;
padding: 18px 42px 8px;
&:after{
.white_gradient_border();
}
}
//上拉加载
.u-list-load{
.listLoad();
}
//list 无内容
.u-list-tip{
.bgImg("unlockNoCont.png");
background-position: top center;
background-repeat: no-repeat;
.background-size(70px 70px);
padding-top: 88px;
color: @LIST-NOCONTTIP-COLOR;
font-size: @LIST-NOCONTTIP-FONTSIZE;
}
}
*/
.u-swipe-list {
width: 100%;
height: 100%;
position: relative;
overflow: auto;
}
.u-swipe-list-scroll .u-swipe-list-row {
position: relative;
overflow: hidden;
}
.u-list-scroll .u-list-row {
padding: 0.4rem 0.4rem 0.4rem 0.533rem;
.u-swipe-list-scroll .u-swipe-list-row .u-swipe-list-handle {
position: relative;
-webkit-transition: left 0.4s ease;
transition: left 0.4s ease;
left: 0;
background-color: #fff;
padding: 0.4rem 0.533rem;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
z-index: 2;
}
.u-list-scroll .u-list-row .u-list-left-image {
.u-swipe-list-scroll .u-swipe-list-row .u-swipe-list-handle .u-swipe-list-image {
width: 1.333rem;
height: 1.333rem;
margin-right: 0.267rem;
}
.u-list-scroll .u-list-row .u-list-left-icon {
.u-swipe-list-scroll .u-swipe-list-row .u-swipe-list-handle .u-swipe-list-icon {
margin-right: 0.267rem;
font-family: iconfont;
font-size: 0.533rem;
......@@ -497,37 +541,58 @@ p {
line-height: 1;
}
.u-list-scroll .u-list-row div {
.u-swipe-list-scroll .u-swipe-list-row .u-swipe-list-handle div {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
min-width: 0;
}
.u-list-scroll .u-list-row .u-list-title {
.u-swipe-list-scroll .u-swipe-list-row .u-swipe-list-handle .u-swipe-list-title {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.u-list-scroll .u-list-row .u-list-subtitle {
.u-swipe-list-scroll .u-swipe-list-row .u-swipe-list-handle .u-swipe-list-subtitle {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.u-list-scroll .u-list-row .u-list-right-text {
margin-left: 0.107rem;
.u-swipe-list-scroll .u-swipe-list-row .u-swipe-list-button {
position: absolute;
top: 0;
bottom: 0;
right: 0;
z-index: 1;
}
.u-list-scroll .u-list-row .u-list-right-icon {
font-family: defaultIconfont;
font-size: 0.667rem;
-webkit-font-smoothing: antialiased;
line-height: 1;
.u-swipe-list-scroll .u-swipe-list-row .u-swipe-list-button div {
width: 1.6rem;
height: 100%;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
color: #fff;
float: left;
}
.u-swipe-list-scroll .u-swipe-list-row .u-swipe-list-button div:nth-last-of-type(1) {
background-color: #ff0000;
}
.u-swipe-list-scroll .u-swipe-list-row .u-swipe-list-button div:nth-last-of-type(2) {
background-color: #bbb;
}
.u-list-scroll .u-list-row:after {
.u-swipe-list-scroll .u-swipe-list-row:after {
content: '';
position: absolute;
bottom: 0;
......@@ -535,13 +600,18 @@ p {
right: 0;
height: 1px;
background: #bbb;
z-index: 2;
}
.u-swipe-list-scroll .u-swipe-list-row.active .u-swipe-list-handle {
left: -3.2rem;
}
.u-list-load {
.u-swipe-list-load {
text-align: center;
}
.u-list-tip {
.u-swipeList-tip {
position: absolute;
top: 50%;
left: 0;
......@@ -551,43 +621,8 @@ p {
text-align: center;
}
.custom-unlockInfo-list {
position: absolute;
top: 1.173rem;
bottom: 0;
left: 0;
height: auto;
}
.custom-unlockInfo-list .u-list-scroll .u-list-row {
color: #91929a;
font-size: 0.427rem;
padding: 0.48rem 1.12rem 0.213rem;
}
.custom-unlockInfo-list .u-list-scroll .u-list-row:after {
background: -webkit-linear-gradient(left, #242635, #fff, #242635);
background: linear-gradient(to right, #242635, #fff, #242635);
}
.custom-unlockInfo-list .u-list-load {
color: #00ffff;
font-size: 0.427rem;
-webkit-transform: scale(0.7);
transform: scale(0.7);
height: 0.933rem;
line-height: 0.933rem;
}
.custom-unlockInfo-list .u-list-tip {
background-image: url("../../resources/image/unlockNoCont.png");
background-position: top center;
background-repeat: no-repeat;
-webkit-background-size: 1.867rem 1.867rem;
background-size: 1.867rem 1.867rem;
padding-top: 2.347rem;
color: #91929a;
font-size: 0.427rem;
.custom-swipe-list .u-swipe-list-scroll .u-swipe-list-row .u-swipe-list-handle {
background-color: #242635;
}
.opendoorMode {
......@@ -596,13 +631,13 @@ p {
overflow: hidden;
}
.opendoorMode ul {
.modeSelect {
padding: 0.293rem 1.12rem;
font-size: 0;
margin: 0 -0.133rem;
}
.opendoorMode ul li {
.modeSelect li {
color: #00ffff;
font-size: 0.347rem;
border: 1px solid;
......@@ -616,7 +651,7 @@ p {
margin: 0.267rem 0.133rem;
}
.opendoorMode ul li:before {
.modeSelect li:before {
content: '\e631';
position: absolute;
top: 50%;
......@@ -629,11 +664,11 @@ p {
display: none;
}
.opendoorMode ul li.active {
.modeSelect li.active {
background-color: #153D4C;
}
.opendoorMode ul li.active:before {
.modeSelect li.active:before {
display: inline-block;
}
......@@ -791,6 +826,71 @@ p {
margin-top: 0.107rem;
}
.u-switch {
position: relative;
width: 2.667rem;
height: 1.333rem;
}
.u-switch .u-switch-handle {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
width: 1.333rem;
height: 0.8rem;
border: 2px solid;
border-radius: 0.533rem;
background-clip: padding-box;
}
.u-switch .u-switch-handle:before {
content: '';
position: absolute;
z-index: 1;
top: -1px;
width: 0.747rem;
height: 0.747rem;
-webkit-transition: left 0.2s ease-in-out;
transition: left 0.2s ease-in-out;
border-radius: 0.427rem;
background-color: #fff;
background-clip: padding-box;
-webkit-box-shadow: 0 0.053rem 0.133rem rgba(0, 0, 0, 0.4);
box-shadow: 0 0.053rem 0.133rem rgba(0, 0, 0, 0.4);
}
.u-switch.u-switch-on .u-switch-handle {
border-color: #4cd964;
-webkit-box-shadow: inset 0 0 0 0.427rem #4cd964;
box-shadow: inset 0 0 0 0.427rem #4cd964;
background-color: #4cd964;
-webkit-transition: border ease 0.4s, -webkit-box-shadow ease 0.4s, background-color ease 1.2s;
transition: border ease 0.4s, box-shadow ease 0.4s, background-color ease 1.2s;
}
.u-switch.u-switch-on .u-switch-handle:before {
left: 0.48rem;
}
.u-switch.u-switch-off .u-switch-handle {
border-color: #bbb;
-webkit-box-shadow: inset 0 0 0 0 #bbb;
box-shadow: inset 0 0 0 0 #bbb;
background-color: #bbb;
-webkit-transition: border cubic-bezier(0, 0, 0, 1) 0.4s, -webkit-box-shadow cubic-bezier(0, 0, 0, 1) 0.4s;
transition: border cubic-bezier(0, 0, 0, 1) 0.4s, box-shadow cubic-bezier(0, 0, 0, 1) 0.4s;
}
.u-switch.u-switch-off .u-switch-handle:before {
left: -1px;
}
.u-switch.disabled {
opacity: 0.3;
}
.u-button {
width: 6.4rem;
color: #fff;
......@@ -835,3 +935,13 @@ p {
background-color: transparent;
color: #999;
}
.guide-dialog {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1051;
background-color: rgba(36, 38, 53, 0.9);
}
\ No newline at end of file
......@@ -27,17 +27,8 @@
</div>
<div class="content">
<p class="title">{{ $t('unlockInfo.bindUnlockInfo') }}</p>
<u-list :init-param="componentsConfig.unlockInfoList.initParam"></u-list>
<!-- <div class="unlockInfo-list">
<ul class="unlockInfo-list-scroll" v-show="unlockInfoList.length">
<li class="unlockInfo-list-row" v-for="item in unlockInfoList">
{{ item.title }}
<p>ID:{{ item.rightText }}</p>
</li>
<v-touch tag="li" class="unlockInfo-list-load" v-on:tap="onTapLoad" v-show="loadShowFlag">{{ loadText }}</v-touch>
</ul>
<p class="unlockInfo-list-tip" v-show="(unlockInfoList.length == 0)">{{ tip }}</p>
</div> -->
<u-swipe-list ref="uswipelist" :init-param="componentsConfig.unlockInfoList.initParam"
v-on:u-swipe-list-button-tap="onUnlockInfoListButtonTap(arguments[0],arguments[1])"></u-swipe-list>
</div>
<u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog>
<u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading>
......
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