Commit a7d03ac3 authored by jiangjiantao's avatar jiangjiantao

引入weui&登录页面开发

引入weui&登录页面开发
parent eabd5025
{ {
"pages": [ "pages": [
"pages/login/login",
"pages/index/index", "pages/index/index",
"pages/logs/logs" "pages/logs/logs"
], ],
......
/**app.wxss**/ /**app.wxss**/
/* @import '/weui-miniprogram/miniprogram_dist/weui-wxss/dist/style/weui.wxss'; */
.container { .container {
height: 100%; height: 100%;
display: flex; display: flex;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 1);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */,
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
multipleSlots: true,
// 在组件定义时的选项中启用多slot支持
addGlobalClass: true
},
properties: {
title: {
// 标题
type: String,
value: ''
},
showCancel: {
// 是否显示取消按钮
type: Boolean,
value: true
},
cancelText: {
// 取消按钮文案
type: String,
value: '取消'
},
maskClass: {
// 遮罩层class
type: String,
value: ''
},
extClass: {
// 弹出窗 class
type: String,
value: ''
},
maskClosable: {
// 点击遮罩 关闭 actionsheet
type: Boolean,
value: true
},
mask: {
// 是否需要 遮罩层
type: Boolean,
value: true
},
show: {
// 是否开启 actionsheet
type: Boolean,
value: false
},
actions: {
// actions 列表
type: Array,
value: [],
// {text, extClass}
observer: '_groupChange'
}
},
methods: {
_groupChange(e) {
// 支持 一维数组 写法
if (e.length > 0 && typeof e[0] !== 'string' && !(e[0] instanceof Array)) {
this.setData({
actions: [this.data.actions]
});
}
},
buttonTap(e) {
const {
value,
groupindex,
index
} = e.currentTarget.dataset;
this.triggerEvent('actiontap', {
value,
groupindex,
index
});
},
closeActionSheet(e) {
const {
type
} = e.currentTarget.dataset;
if (this.data.maskClosable || type) {
// 点击 action 里面的 取消
this.setData({
show: false
}); // 关闭回调事件
this.triggerEvent('close');
}
}
}
});
/***/ })
/******/ ]);
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<wxs module="utils">
var join = function(a,b) {
return a+b
};
var isNotSlot = function(v) {
return typeof v !== 'string'
}
module.exports = {
join: join,
isNotSlot: isNotSlot
}
</wxs>
<view wx:if="{{mask}}" class="weui-mask {{show ? '' : 'weui-mask_hidden'}} {{maskClass}}" bindtap="closeActionSheet"></view>
<view class="weui-actionsheet {{show ? 'weui-actionsheet_toggle' : ''}} {{extClass}}">
<!-- 标题 -->
<block wx:if="{{title}}">
<view class="weui-actionsheet__title">
<view class="weui-actionsheet__title-text">{{title}}</view>
</view>
</block>
<slot name="title" wx:else></slot>
<view
class="{{ !showCancel && index === actions.length-1 ? 'weui-actionsheet__action' : 'weui-actionsheet__menu' }}"
wx:key="index"
wx:for-item="actionItem"
wx:for-index="index"
wx:for="{{actions}}"
>
<block wx:if="{{utils.isNotSlot(actionItem)}}">
<view
class="weui-actionsheet__cell {{item.type === 'warn' ? 'weui-actionsheet__cell_warn' : '' }}"
hover-class="weui-active"
wx:key="actionIndex"
wx:for="{{actionItem}}"
wx:for-index="actionIndex"
data-groupindex="{{index}}"
data-index="{{actionIndex}}"
data-value="{{item.value}}"
bindtap="buttonTap"
>
{{item.text}}
</view>
</block>
<slot name="{{actionItem}}" wx:else></slot>
</view>
<!-- 取消按钮 -->
<view class="weui-actionsheet__action" wx:if="{{showCancel}}">
<view class="weui-actionsheet__cell" hover-class="weui-active" data-type="close" id="iosActionsheetCancel" bindtap="closeActionSheet">{{cancelText}}</view>
</view>
</view>
.weui-mask.weui-mask_hidden{opacity:0;transform:scale3d(1, 1, 0)}.weui-mask{opacity:1;transform:scale3d(1, 1, 1);transition:all .3s}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 15);
/******/ })
/************************************************************************/
/******/ ({
/***/ 15:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true
},
properties: {
extClass: {
type: String,
value: ''
},
content: {
type: String,
value: ''
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="weui-badge {{extClass}} {{!content ? 'weui-badge_dot' : ''}}">{{content}}</view>
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 9);
/******/ })
/************************************************************************/
/******/ ({
/***/ 9:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
properties: {
hover: {
type: Boolean,
value: false
},
link: {
type: Boolean,
value: false
},
extClass: {
type: String,
value: ''
},
iconClass: {
type: String,
value: ''
},
bodyClass: {
type: String,
value: ''
},
icon: {
type: String,
value: ''
},
title: {
// 和icon二选一,都是放在cell_hd里面
type: String,
value: ''
},
value: {
type: String,
value: ''
},
showError: {
type: Boolean,
value: false
},
prop: {
// 校验的属性,给父元素form使用
type: String,
value: ''
},
url: {
// 在link为true的时候有效,表示navigator的跳转url
type: String,
value: ''
},
footerClass: {
type: String,
value: ''
},
footer: {
type: String,
value: ''
},
inline: {
// 左右布局样式还是上下布局
type: Boolean,
value: true
},
hasHeader: {
type: Boolean,
value: true
},
hasFooter: {
type: Boolean,
value: true
},
hasBody: {
type: Boolean,
value: true
},
extHoverClass: {
// 提供给需要定制 hover-class 的场景,要求 hover 为 false
type: String,
value: ''
}
},
relations: {
'../form/form': {
type: 'ancestor'
},
'../cells/cells': {
type: 'ancestor'
}
},
data: {
inForm: false
},
methods: {
setError(error) {
this.setData({
error: error || false
});
},
setInForm() {
this.setData({
inForm: true
});
},
setOuterClass(className) {
this.setData({
outerClass: className
});
},
navigateTo() {
const data = this.data;
if (data.url && data.link) {
wx.navigateTo({
url: data.url,
success: res => {
this.triggerEvent('navigatesuccess', res, {});
},
fail: fail => {
this.triggerEvent('navigateerror', fail, {});
}
});
}
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {
"mp-cells": "../cells/cells"
}
}
\ No newline at end of file
<block wx:if="{{link}}">
<view bindtap="navigateTo" class="weui-cell weui-cell_access {{extClass}} {{outerClass}}{{inForm ? ' weui-cell-inform' : ''}}{{inline ? '' : ' .weui-cell_label-block'}}" hover-class="{{hover ? 'weui-cell_active weui-active' : extHoverClass}}">
<view wx:if="{{hasHeader}}" class="weui-cell__hd {{iconClass}}">
<block wx:if="{{icon}}">
<image src="{{icon}}" class="weui-cell__icon" mode="aspectFit"></image>
</block>
<block wx:else>
<slot name="icon"></slot>
</block>
<block wx:if="{{inForm}}">
<block wx:if="{{title}}"><view class="weui-label">{{title}}</view></block>
<block wx:else>
<slot name="title"></slot>
</block>
</block>
<block wx:else>
<block wx:if="{{title}}">{{title}}</block>
<block wx:else>
<slot name="title"></slot>
</block>
</block>
</view>
<view wx:if="{{hasBody}}" class="weui-cell__bd">
<block wx:if="{{value}}">{{value}}</block>
<block wx:else>
<slot></slot>
</block>
</view>
<view wx:if="{{hasFooter}}" class="weui-cell__ft weui-cell__ft_in-access {{footerClass}}">
<block wx:if="{{footer}}">{{footer}}</block>
<block wx:else>
<slot name="footer"></slot>
</block>
</view>
</view>
</block>
<block wx:else>
<view bindtap="navigateTo" class="weui-cell {{showError && error ? 'weui-cell_warn' : ''}} {{inForm ? 'weui-cell-inform' : ''}} {{extClass}} {{outerClass}}" hover-class="{{hover ? 'weui-cell_active weui-active' : extHoverClass}}">
<view wx:if="{{hasHeader}}" class="weui-cell__hd {{iconClass}}">
<block wx:if="{{icon}}">
<image src="{{icon}}" class="weui-cell__icon" mode="aspectFit"></image>
</block>
<block wx:else>
<slot name="icon"></slot>
</block>
<block wx:if="{{inForm}}">
<block wx:if="{{title}}"><view class="weui-label">{{title}}</view></block>
<block wx:else>
<slot name="title"></slot>
</block>
</block>
<block wx:else>
<block wx:if="{{title}}">{{title}}</block>
<block wx:else>
<slot name="title"></slot>
</block>
</block>
</view>
<view wx:if="{{hasBody}}" class="weui-cell__bd {{bodyClass}}">
<block wx:if="{{value}}">{{value}}</block>
<block wx:else>
<slot></slot>
</block>
</view>
<view wx:if="{{hasFooter}}" class="weui-cell__ft {{footerClass}}">
<block wx:if="{{footer}}">{{footer}}</block>
<block wx:else>
<slot name="footer"></slot>
</block>
<icon wx:if="{{showError && error}}" type="warn" size="23" color="#E64340"></icon>
</view>
</view>
</block>
\ No newline at end of file
.weui-cell_wxss.weui-cell_wxss:before{display:block}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 8);
/******/ })
/************************************************************************/
/******/ ({
/***/ 8:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
properties: {
title: {
type: String,
value: ''
},
extClass: {
type: String,
value: ''
},
footer: {
type: String,
value: ''
}
},
data: {
firstItem: null,
checkboxCount: 0,
checkboxIsMulti: false,
outerClass: '',
childClass: ''
},
relations: {
'../cell/cell': {
type: 'descendant',
linked(target) {
if (!this.data.firstItem) {
this.data.firstItem = target;
}
if (target !== this.data.firstItem) {
target.setOuterClass('weui-cell_wxss');
}
}
},
'../form-page/form-page': {
type: 'ancestor'
},
'../checkbox-group/checkbox-group': {
type: 'descendant',
linked(target) {
this.setData({
checkboxCount: this.data.checkboxCount + 1,
checkboxIsMulti: target.data.multi
});
},
unlinked(target) {
this.setData({
checkboxCount: this.data.checkboxCount - 1,
checkboxIsMulti: target.data.multi
});
}
}
},
methods: {
setCellMulti(multi) {
this.setData({
checkboxIsMulti: multi
});
},
setCellsClass(className) {
this.setData({
childClass: className
});
},
setOuterClass(className) {
this.setData({
outerClass: className
});
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="{{extClass}} weui-cells__group {{outerClass}} {{childClass}}">
<view wx:if="{{title}}" class="weui-cells__title">{{title}}</view>
<view class="weui-cells weui-cells_after-title {{checkboxCount > 0 && checkboxIsMulti ? 'weui-cells_checkbox' : ''}}">
<slot></slot>
</view>
<view wx:if="{{footer}}" class="weui-cells__tips">{{footer}}</view>
<slot name="footer" wx:else></slot>
</view>
\ No newline at end of file
.weui-cells__group_wxss.weui-cells__group_wxss .weui-cells__title{margin-top:24px}.weui-cells__group_form .weui-cells__tips{margin-top:8px;padding:0 32px;color:var(--weui-FG-1)}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 24);
/******/ })
/************************************************************************/
/******/ ({
/***/ 24:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
properties: {
multi: {
type: Boolean,
value: true,
observer: '_multiChange'
},
extClass: {
type: String,
value: ''
},
prop: {
type: String,
value: ''
}
},
data: {
targetList: [],
parentCell: null
},
relations: {
'../checkbox/checkbox': {
type: 'descendant',
linked(target) {
this.data.targetList.push(target);
target.setMulti(this.data.multi);
if (!this.data.firstItem) {
this.data.firstItem = target;
}
if (target !== this.data.firstItem) {
target.setOuterClass('weui-cell_wxss');
}
},
unlinked(target) {
let index = -1;
this.data.targetList.forEach((item, idx) => {
if (item === target) {
index = idx;
}
});
this.data.targetList.splice(index, 1);
if (!this.data.targetList) {
this.data.firstItem = null;
}
}
},
'../form/form': {
type: 'ancestor'
},
'../cells/cells': {
type: 'ancestor',
linked(target) {
if (!this.data.parentCell) {
this.data.parentCell = target;
}
this.setParentCellsClass();
},
unlinked() {
this.data.parentCell = null; // 方便内存回收
}
}
},
methods: {
checkedChange(checked, target) {
if (this.data.multi) {
const vals = [];
this.data.targetList.forEach(item => {
if (item.data.checked) {
vals.push(item.data.value);
}
});
this.triggerEvent('change', {
value: vals
});
} else {
let val = '';
this.data.targetList.forEach(item => {
if (item === target) {
val = item.data.value;
} else {
item.setData({
checked: false
});
}
});
this.triggerEvent('change', {
value: val
}, {});
}
},
setParentCellsClass() {
const className = this.data.multi ? 'weui-cells_checkbox' : '';
if (this.data.parentCell) {
this.data.parentCell.setCellsClass(className);
}
},
_multiChange(multi) {
this.data.targetList.forEach(target => {
target.setMulti(multi);
});
if (this.data.parentCell) {
this.data.parentCell.setCellMulti(multi);
}
return multi;
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {
"mp-cells": "../cells/cells"
}
}
\ No newline at end of file
<checkbox-group class="{{extClass}}" wx-if="{{multi}}" bindchange="checkedChange">
<slot></slot>
</checkbox-group>
<radio-group class="{{extClass}}" wx-else bindchange="checkedChange">
<slot></slot>
</radio-group>
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 25);
/******/ })
/************************************************************************/
/******/ ({
/***/ 25:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
properties: {
multi: {
type: Boolean,
value: true
},
checked: {
type: Boolean,
value: false
},
value: {
type: String,
value: ''
},
label: {
type: String,
value: 'label'
},
extClass: {
type: String,
value: ''
}
},
data: {},
relations: {
'../checkbox-group/checkbox-group': {
type: 'ancestor',
linked(target) {
this.data.group = target;
},
unlinked() {
this.data.group = null;
}
}
},
methods: {
setMulti(multi) {
this.setData({
multi
});
},
setOuterClass(className) {
this.setData({
outerClass: className
});
},
checkedChange() {
if (this.data.multi) {
const checked = !this.data.checked;
this.setData({
checked
});
if (this.data.group) {
this.data.group.checkedChange(checked, this);
}
} else {
const checked = this.data.checked;
if (checked) return;
this.setData({
checked: true
});
if (this.data.group) {
this.data.group.checkedChange(checked, this);
}
}
this.triggerEvent('change', {
value: this.data.value,
checked: this.data.checked
});
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {
"mp-cell": "../cell/cell",
"mp-checkbox-group": "../checkbox-group/checkbox-group"
}
}
<mp-cell
has-footer="{{!multi}}"
has-header="{{multi}}"
bindtap="checkedChange"
ext-class="weui-check__label {{outerClass}} {{extClass}} {{!multi ? '^weui-cell_radio' : '^weui-cell_checkbox'}}"
ext-hover-class="weui-active">
<view slot="icon" wx:if="{{multi}}">
<checkbox value="{{value}}" checked="{{checked}}" disabled="{{disabled}}" color="{{color}}" class="weui-check">
</checkbox>
<!-- 未勾选 -->
<icon class="weui-icon-checked"></icon>
</view>
<view>{{label}}</view>
<view slot="footer" wx:if="{{!multi}}">
<radio value="{{value}}" checked="{{checked}}" disabled="{{disabled}}" color="{{color}}" class="weui-check"></radio>
<!-- 已勾选 -->
<icon class="weui-icon-checked"></icon>
</view>
</mp-cell>
.weui-cell_radio .weui-check+.weui-icon-checked{color:transparent}.weui-check[checked]+.weui-icon-checked{color:var(--weui-BRAND);-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 20);
/******/ })
/************************************************************************/
/******/ ({
/***/ 20:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
multipleSlots: true,
// 在组件定义时的选项中启用多slot支持
addGlobalClass: true
},
properties: {
title: {
// 弹窗标题,也可以通过 slot 自定义
type: String,
value: ''
},
extClass: {
// 弹窗 class
type: String,
value: ''
},
maskClosable: {
type: Boolean,
value: true
},
mask: {
// 是否需要 遮罩层
type: Boolean,
value: true
},
show: {
// 是否开启弹窗
type: Boolean,
value: false,
observer: '_showChange'
},
buttons: {
type: Array,
value: [] // {text, extClass}
}
},
data: {
innerShow: false
},
ready() {
const buttons = this.data.buttons;
const len = buttons.length;
buttons.forEach((btn, index) => {
if (len === 1) {
btn.className = 'weui-dialog__btn_primary';
} else if (index === 0) {
btn.className = 'weui-dialog__btn_default';
} else {
btn.className = 'weui-dialog__btn_primary';
}
});
this.setData({
buttons
});
},
methods: {
buttonTap(e) {
const {
index
} = e.currentTarget.dataset;
this.triggerEvent('buttontap', {
index,
item: this.data.buttons[index]
}, {});
},
close() {
const data = this.data;
if (!data.maskClosable) return;
this.setData({
show: false
});
this.triggerEvent('close', {}, {});
},
stopEvent() {}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view bindtap="close" class="weui-mask {{!show ? 'weui-mask_hidden' : '' }}" wx:if="{{mask}}"></view>
<view wx:if="{{show}}" bindtap="close" class="weui-dialog__wrp {{extClass}}">
<view class="weui-dialog" catchtap="stopEvent">
<view class="weui-dialog__hd">
<view class="weui-dialog__title">{{title}}
<slot name="title"></slot>
</view>
</view>
<view class="weui-dialog__bd">
<slot></slot>
</view>
<view class="weui-dialog__ft">
<block wx:if="{{buttons && buttons.length}}">
<view wx:for="{{buttons}}" wx:key="index" class="weui-dialog__btn {{item.className}} {{item.extClass}}" hover-class="weui-active" data-index="{{index}}" bindtap="buttonTap">{{item.text}}</view>
</block>
<slot name="footer" wx:else></slot>
</view>
</view>
</view>
.weui-dialog.weui-dialog_hidden{opacity:0;transform:scale3d(1, 1, 0)}.weui-dialog{opacity:1;-webkit-transform:scale3d(1, 1, 1) translateY(-50%);transform:scale3d(1, 1, 1) translateY(-50%);transition:all .2s ease-in}.weui-mask.weui-mask_hidden{opacity:0;transform:scale3d(1, 1, 0)}.weui-mask{opacity:1;transform:scale3d(1, 1, 1);transition:all .2s ease-in}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 2);
/******/ })
/************************************************************************/
/******/ ({
/***/ 2:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
properties: {
title: {
// Msg 标题
type: String,
value: ''
},
subtitle: {
// icon 的 type
type: String,
value: ''
}
},
relations: {
'../cells/cells': {
type: 'descendant',
linked(target) {
if (!this.data.firstItem) {
this.data.firstItem = target;
}
target.setOuterClass('weui-cells__group weui-cells__group_form weui-cells_form');
if (target !== this.data.firstItem) {
target.setOuterClass('weui-cells__group_wxss weui-cells__group weui-cells__group_form weui-cells_form');
}
}
}
},
data: {
firstItem: null
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="weui-form">
<block wx:if="{{title || subtitle}}">
<view class="weui-form__text-area">
<view class="weui-form__title">{{title}}</view>
<view class="weui-form__desc">{{subtitle}}</view>
</view>
</block>
<block wx:else>
<view class="weui-form__text-area">
<slot name="title"></slot>
</view>
</block>
<view class="weui-form__control-area">
<slot></slot>
</view>
<view class="weui-form__tips-area">
<slot name="tips"></slot>
</view>
<view class="weui-form__opr-area">
<slot name="button"></slot>
</view>
<view class="weui-form__tips-area">
<slot name="suffixtips"></slot>
</view>
<view class="weui-form__extra-area">
<view class="weui-footer">
<slot name="footer"></slot>
</view>
</view>
</view>
This diff is collapsed.
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="{{extClass}}">
<slot></slot>
</view>
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 21);
/******/ })
/************************************************************************/
/******/ ({
/***/ 21:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true
},
properties: {
imgUrls: {
type: Array,
value: [],
observer(newVal) {
this.setData({
currentImgs: newVal
});
}
},
showDelete: {
// 是否显示delete按钮
type: Boolean,
value: true
},
show: {
type: Boolean,
value: true
},
current: {
type: Number,
value: 0
},
hideOnClick: {
type: Boolean,
value: true
},
extClass: {
type: String,
value: ''
}
},
data: {
currentImgs: []
},
ready() {
const data = this.data;
this.setData({
currentImgs: data.imgUrls
});
},
methods: {
change(e) {
this.setData({
current: e.detail.current
});
this.triggerEvent('change', {
current: e.detail.current
}, {});
},
deleteImg() {
const data = this.data;
const imgs = data.currentImgs;
const url = imgs.splice(data.current, 1);
this.triggerEvent('delete', {
url: url[0],
index: data.current
}, {});
if (imgs.length === 0) {
// @ts-ignore
this.hideGallery();
return;
}
this.setData({
current: 0,
currentImgs: imgs
});
},
hideGallery() {
const data = this.data;
if (data.hideOnClick) {
this.setData({
show: false
});
this.triggerEvent('hide', {}, {});
}
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="weui-gallery {{show ? 'weui-gallery_show' : ''}} {{extClass}}">
<view class="weui-gallery__info">{{current+1}}/{{currentImgs.length}}</view>
<swiper class="weui-gallery__img__wrp" bindtap="hideGallery" indicator-dots="{{false}}" bindchange="change" current="{{current}}" autoplay="{{false}}" duration="{{500}}">
<block wx:for="{{currentImgs}}" wx:key="index">
<swiper-item>
<image mode="aspectFit" class="weui-gallery__img" src="{{item}}"></image>
</swiper-item>
</block>
</swiper>
<view class="weui-gallery__opr" wx:if="{{showDelete}}">
<navigator bindtap="deleteImg" class="weui-gallery__del">删除</navigator>
</view>
</view>
.weui-gallery{display:none}.weui-gallery_show.weui-gallery{display:flex}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 23);
/******/ })
/************************************************************************/
/******/ ({
/***/ 23:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
addGlobalClass: true,
pureDataPattern: /^_/
},
properties: {
extClass: {
type: String,
value: ''
},
grids: {
type: Array,
value: []
}
},
data: {
innerGrids: [],
_defaultGridProps: {
target: 'self',
url: '',
openType: 'navigate',
delta: 1,
appId: '',
path: '',
extraData: '',
version: 'release',
hoverClass: 'navigator-hover',
hoverStopPropagation: false,
hoverStartTime: 50,
hoverStayTime: 600,
bindsuccess() {},
bindfail() {},
bindcomplete() {}
}
},
ready() {},
lifetimes: {
attached() {
if (this.data.grids) {
this.setData({
innerGrids: this.data.grids.map(grid => Object.assign({}, this.data._defaultGridProps, grid))
});
}
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="weui-grids {{extClass}}">
<block wx:for="{{innerGrids}}" wx:key="index">
<navigator
class="weui-grid"
target="{{item.target}}"
url="{{item.url}}"
open-type="{{item.openType}}"
app-id="{{item.appId}}"
path="{{item.path}}"
extra-data="{{item.extraData}}"
version="{{item.version}}"
hover-class="{{item.hoverClass}}"
hover-stop-propagation="{{item.hoverStopPropagation}}"
hover-start-time="{{item.hoverStartTime}}"
hover-stay-time="{{item.hoverStayTime}}"
bindsuccess="{{item.bindsuccess}}"
bindfail="{{item.bindfail}}"
bindcomplete="{{item.bindcomplete}}"
>
<view class="weui-grid__icon">
<image class="weui-grid__icon_img" src="{{item.imgUrl}}" alt></image>
</view>
<view class="weui-grid__label">{{item.text}}</view>
</navigator>
</block>
</view>
\ No newline at end of file
.weui-grid .weui-grid__icon_img{width:100%;height:100%}
\ No newline at end of file
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 17);
/******/ })
/************************************************************************/
/******/ ({
/***/ 17:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
multipleSlots: true,
// 在组件定义时的选项中启用多slot支持
addGlobalClass: true
},
properties: {
closabled: {
// 是否具有关闭标签
type: Boolean,
value: true
},
title: {
// 标题,也可以通过 slot 自定义
type: String,
value: ''
},
subTitle: {
// 副标题,也可以通过 slot 自定义
type: String,
value: ''
},
extClass: {
// 弹窗 class
type: String,
value: ''
},
desc: {
type: String,
value: ''
},
tips: {
type: String,
value: ''
},
maskClosable: {
type: Boolean,
value: true
},
mask: {
// 是否需要 遮罩层
type: Boolean,
value: true
},
show: {
// 是否开启弹窗
type: Boolean,
value: false,
observer: '_showChange'
},
buttons: {
type: Array,
value: [] // {text, extClass}
}
},
methods: {
close(e) {
const {
type
} = e.currentTarget.dataset;
if (this.data.maskClosable || type === 'close') {
this.setData({
show: false
}); // 关闭弹窗回调事件
this.triggerEvent('close');
}
},
buttonTap(e) {
const {
index
} = e.currentTarget.dataset;
this.triggerEvent('buttontap', {
index,
item: this.data.buttons[index]
}, {});
},
onMaskMouseMove(e) {// do nothing
}
}
});
/***/ })
/******/ });
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="{{show ? 'weui-show' :'weui-hidden'}}">
<view class="weui-mask init" wx:if="{{mask}}" bindtap="close" catch:touchmove="onMaskMouseMove" data-type="tap"></view>
<view class="weui-half-screen-dialog {{extClass}}">
<view class="weui-half-screen-dialog__hd">
<view wx:if="{{closabled}}" class="weui-half-screen-dialog__hd__side" bindtap="close" data-type="close">
<view class="weui-icon-btn weui-icon-btn_close" hover-class="weui-active">关闭</view>
</view>
<view class="weui-half-screen-dialog__hd__main">
<block wx:if="{{title}}">
<text class="weui-half-screen-dialog__title">{{title}}</text>
<text class="weui-half-screen-dialog__subtitle">{{subTitle}}</text>
</block>
<block wx:else>
<view class="weui-half-screen-dialog__title"><slot name="title"></slot></view>
</block>
</view>
<view class="weui-half-screen-dialog__hd__side">
<view class="weui-icon-btn weui-icon-btn_more" hover-class="weui-active">更多</view>
</view>
</view>
<view class="weui-half-screen-dialog__bd">
<block wx:if="{{title}}">
<view class="weui-half-screen-dialog__desc">{{desc}}</view>
<view class="weui-half-screen-dialog__tips">{{tips}}</view>
</block>
<slot name="desc" wx:else></slot>
</view>
<view class="weui-half-screen-dialog__ft">
<block wx:if="{{buttons && buttons.length}}">
<button
wx:for="{{buttons}}"
wx:key="index"
type="{{item.type}}"
class="weui-btn {{item.className}}"
data-index="{{index}}"
bindtap="buttonTap"
>{{item.text}}</button>
</block>
<slot name="footer" wx:else></slot>
</view>
</view>
</view>
\ No newline at end of file
.weui-mask,.weui-half-screen-dialog{transition:all .3s}.weui-hidden .weui-mask{visibility:hidden;opacity:0}.weui-hidden .weui-half-screen-dialog{transform:translateY(100%)}.weui-show .weui-mask{opacity:1;visibility:visible}.weui-show .weui-half-screen-dialog{transform:translateY(0%)}
\ No newline at end of file
This diff is collapsed.
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<wxs module="utils">
var double = function(a) {
return 2*a
};
var ifSpecialIcon = function(v) {
return v === 'arrow' || v === 'back'
}
module.exports = {
double: double,
ifSpecialIcon: ifSpecialIcon
}
</wxs>
<view class="{{extClass}} weui-icon" style="background:{{color}};width:{{size}}px;height:{{ utils.ifSpecialIcon(icon) ? utils.double(size) : size}}px;mask-image:url({{src}});-webkit-mask-image:url({{src}});-moz-mask-image:url({{src}})"></view>
.weui-icon{vertical-align:middle;display:inline-block;background:black;mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;-moz-mask-repeat:no-repeat;mask-size:cover;-webkit-mask-size:cover;-moz-mask-size:cover}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view style="display:{{displayStyle}};" class="wx_loading_view {{extClass}}" animation="{{animationData}}" id="wx_loading_view">
<view wx:if="{{type==='dot-white'}}" class="loading wx_dot_loading wx_dot_loading_white">
</view>
<view wx:elif="{{type==='dot-gray'}}" class="loading wx_dot_loading"></view>
<view wx:elif="{{type==='circle'}}" class="weui-loadmore">
<view class="weui-loading"></view>
<view class="weui-loadmore__tips">{{tips}}</view>
</view>
</view>
\ No newline at end of file
.wx_loading_view{display:flex;justify-content:center;align-items:center;overflow:hidden}.loading{color:rgba(255,255,255,0.9);font-size:17px;text-align:center}.loading_view_translation{transition:height .2s .3s ease}
\ No newline at end of file
This diff is collapsed.
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
This diff is collapsed.
.weui-msg__icon-img{width:190rpx;height:190rpx}
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
.weui-search-bar__label text{display:inline-block;font-size:14px;vertical-align:middle}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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