diff --git a/app.js b/app.js index 814a59e..978f9b0 100644 --- a/app.js +++ b/app.js @@ -21,17 +21,26 @@ App({ }, success: function (res) { if (res.data.code == 1) { - wx.setStorageSync('userid', res.data.userid) - wx.setStorageSync('username', res.data.username) if (res.header.hasOwnProperty('Set-Cookie')){ wx.setStorageSync('sessionid', res.header["Set-Cookie"]) }else{ wx.setStorageSync('sessionid', res.header["set-cookie"]) } - wx.setStorageSync('mpopenid', res.data.mpopenid) - if (that.callback) { //这个函数名字和你定义的一样即可 - that.callback() //执行定义的回调函数 - } + that.globalData.userInfo.name = res.data.name + that.globalData.userInfo.username = res.data.username + that.globalData.userInfo.userid = res.data.userid + that.globalData.userInfo.mpopenid = res.data.mpopenid + that.globalData.userInfo.perms = res.data.rights //拉取权限 + that.globalData.userInfo.companyid = res.data.companyid + // if (that.callback) { //这个函数名字和你定义的一样即可 + // that.callback() //执行定义的回调函数 + // } + /**** KEY PART START ****/ + var pages = getCurrentPages() // get all current pages + var currentPage = pages[pages.length - 1] // Get current loading page + currentPage.callback(); // Callback + that.oncallback = false; // Callback called + /**** KEY PART END ****/ let openid = res.data.openid; if(openid==null){ wx.showModal({ @@ -59,28 +68,12 @@ App({ data: {}, success: res => { if (res.data.code == 1) { - that.globalData.isaqy = 1 + that.globalData.userInfo.isaqy = 1 } } - }); - //拉取权限 - wx.request({ - url: getApp().globalData.serverUrl + 'api/rights?a=have', - header: { - 'content-type': 'application/json', // 默认值 - 'Cookie': wx.getStorageSync("sessionid"), - }, - data: {}, - success: res => { - if (res.statusCode === 200) { - console.log(res.data.rights) - that.globalData.rights = res.data.rights - } - - } - }); + }); } else { - wx.setStorageSync('mpopenid', res.data.mpopenid) + that.globalData.userInfo.mpopenid = res.data.mpopenid wx.reLaunch({ url: '/pages/bind/binduser?mpopenid=' + res.data.mpopenid, }) @@ -106,12 +99,19 @@ App({ }) }, globalData: { - userInfo: null, + userInfo: { + userid:0, + username:'', + name:'', + isaqy:0, + mpopenid:'', + companyid:'', + perms:[] + }, serverUrl: 'https://safeyun.ctcshe.com/', //serverUrl: 'http://127.0.0.1:8000/', - //serverUrl: 'http://192.168.0.102:8000/', + //serverUrl: 'http://192.168.0.107:8000/', //serverUrl:'http://10.0.11.195:8000/', - isaqy: 0, timepass:null //定时器 }, diff --git a/app.json b/app.json index 29c6a39..aed9f49 100644 --- a/app.json +++ b/app.json @@ -70,7 +70,12 @@ "pages/risktask/detail", "pages/riskact/index2", "pages/area/detail", - "pages/bindwxtz/index" + "pages/bindwxtz/index", + "pages/examtest/note2", + "pages/data/index", + "pages/examtest/rate", + "pages/data/detail", + "pages/totalrate/index" ], "window": { "backgroundTextStyle": "light", diff --git a/app.wxss b/app.wxss index 58026a6..2d3601c 100644 --- a/app.wxss +++ b/app.wxss @@ -1,6 +1,5 @@ /**app.wxss**/ @import 'weui.wxss'; -@import "/wxParse/wxParse.wxss"; page{ background-color: #F8F8F8; font-size: 16px; diff --git a/miniprogram_npm/weui-miniprogram/actionsheet/actionsheet.js b/miniprogram_npm/weui-miniprogram/actionsheet/actionsheet.js new file mode 100644 index 0000000..25e9fae --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/actionsheet/actionsheet.js @@ -0,0 +1,170 @@ +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, + addGlobalClass: true + }, + properties: { + title: { + type: String, + value: '' + }, + showCancel: { + type: Boolean, + value: true + }, + cancelText: { + type: String, + value: '取消' + }, + maskClass: { + type: String, + value: '' + }, + extClass: { + type: String, + value: '' + }, + maskClosable: { + type: Boolean, + value: true + }, + mask: { + type: Boolean, + value: true + }, + show: { + type: Boolean, + value: false + }, + actions: { + type: Array, + value: [], + observer: '_groupChange' + } + }, + methods: { + _groupChange: function _groupChange(e) { + if (e.length > 0 && typeof e[0] !== 'string' && !(e[0] instanceof Array)) { + this.setData({ + actions: [this.data.actions] + }); + } + }, + buttonTap: function buttonTap(e) { + var _e$currentTarget$data = e.currentTarget.dataset, + value = _e$currentTarget$data.value, + groupindex = _e$currentTarget$data.groupindex, + index = _e$currentTarget$data.index; + + this.triggerEvent('actiontap', { value: value, groupindex: groupindex, index: index }); + }, + closeActionSheet: function closeActionSheet(e) { + var type = e.currentTarget.dataset.type; + + if (this.data.maskClosable || type) { + this.setData({ + show: false + }); + this.triggerEvent('close'); + } + } + } +}); + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/actionsheet/actionsheet.json b/miniprogram_npm/weui-miniprogram/actionsheet/actionsheet.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/actionsheet/actionsheet.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/actionsheet/actionsheet.wxml b/miniprogram_npm/weui-miniprogram/actionsheet/actionsheet.wxml new file mode 100644 index 0000000..0b41d0d --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/actionsheet/actionsheet.wxml @@ -0,0 +1,50 @@ + + var join = function(a,b) { + return a+b + }; + var isNotSlot = function(v) { + return typeof v !== 'string' + } + module.exports = { + join: join, + isNotSlot: isNotSlot + } + + + + + + + + {{title}} + + + + + + + {{item.text}} + + + + + + + {{cancelText}} + + diff --git a/miniprogram_npm/weui-miniprogram/actionsheet/actionsheet.wxss b/miniprogram_npm/weui-miniprogram/actionsheet/actionsheet.wxss new file mode 100644 index 0000000..ebbba8f --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/actionsheet/actionsheet.wxss @@ -0,0 +1 @@ +.weui-mask{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,0.6)}.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-actionsheet{position:fixed;left:0;bottom:0;transform:translate(0, 100%);backface-visibility:hidden;z-index:5000;width:100%;background-color:#EAE7E8;transition:transform .3s;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden}.weui-actionsheet__title{position:relative;height:56px;padding:0 24px;display:flex;justify-content:center;flex-direction:column;text-align:center;font-size:12px;color:rgba(0,0,0,0.5);line-height:1.4;background:#FFFFFF}.weui-actionsheet__title:before{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-actionsheet__title .weui-actionsheet__title-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-actionsheet__menu{color:rgba(0,0,0,0.9);background-color:#FFFFFF}.weui-actionsheet__action{margin-top:8px;background-color:#FFFFFF;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-actionsheet__cell{position:relative;padding:16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-actionsheet__cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-actionsheet__cell:active{background-color:#ECECEC}.weui-actionsheet__cell:first-child:before{display:none}.weui-actionsheet__cell_warn{color:#FA5151}.weui-skin_android .weui-actionsheet{position:fixed;left:50%;top:50%;bottom:auto;transform:translate(-50%, -50%);width:274px;box-sizing:border-box;backface-visibility:hidden;background:transparent;transition:transform .3s;border-radius:2px}.weui-skin_android .weui-actionsheet__action{display:none}.weui-skin_android .weui-actionsheet__menu{border-radius:2px;box-shadow:0 6px 30px 0 rgba(0,0,0,0.1)}.weui-skin_android .weui-actionsheet__cell{padding:16px;font-size:17px;line-height:1.41176471;color:rgba(0,0,0,0.9);text-align:left}.weui-skin_android .weui-actionsheet__cell:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.weui-skin_android .weui-actionsheet__cell:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.weui-actionsheet_toggle{transform:translate(0, 0)}.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 diff --git a/miniprogram_npm/weui-miniprogram/badge/badge.js b/miniprogram_npm/weui-miniprogram/badge/badge.js new file mode 100644 index 0000000..cd5a2dd --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/badge/badge.js @@ -0,0 +1,114 @@ +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 diff --git a/miniprogram_npm/weui-miniprogram/badge/badge.json b/miniprogram_npm/weui-miniprogram/badge/badge.json new file mode 100644 index 0000000..7e37c03 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/badge/badge.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/badge/badge.wxml b/miniprogram_npm/weui-miniprogram/badge/badge.wxml new file mode 100644 index 0000000..b7caee3 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/badge/badge.wxml @@ -0,0 +1 @@ +{{content}} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/badge/badge.wxss b/miniprogram_npm/weui-miniprogram/badge/badge.wxss new file mode 100644 index 0000000..3996e89 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/badge/badge.wxss @@ -0,0 +1 @@ +.weui-badge{display:inline-block;padding:.15em .4em;min-width:8px;border-radius:18px;background-color:#FA5151;color:#FFFFFF;line-height:1.2;text-align:center;font-size:12px;vertical-align:middle}.weui-badge_dot{padding:.4em;min-width:0} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/cell/cell.js b/miniprogram_npm/weui-miniprogram/cell/cell.js new file mode 100644 index 0000000..18048aa --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/cell/cell.js @@ -0,0 +1,219 @@ +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: { + type: String, + value: '' + }, + value: { + type: String, + value: '' + }, + showError: { + type: Boolean, + value: false + }, + prop: { + type: String, + value: '' + }, + 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 + } + }, + relations: { + '../form/form': { + type: 'ancestor' + }, + '../cells/cells': { + type: 'ancestor' + } + }, + data: { + inForm: false + }, + methods: { + setError: function setError(error) { + this.setData({ + error: error || false + }); + }, + setInForm: function setInForm() { + this.setData({ + inForm: true + }); + }, + setOuterClass: function setOuterClass(className) { + this.setData({ + outerClass: className + }); + }, + navigateTo: function navigateTo() { + var _this = this; + + var data = this.data; + if (data.url && data.link) { + wx.navigateTo({ + url: data.url, + success: function success(res) { + _this.triggerEvent('navigatesuccess', res, {}); + }, + fail: function fail(_fail) { + _this.triggerEvent('navigateerror', _fail, {}); + } + }); + } + } + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/cell/cell.json b/miniprogram_npm/weui-miniprogram/cell/cell.json new file mode 100644 index 0000000..38feec9 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/cell/cell.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "mp-cells": "../cells/cells" + } +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/cell/cell.wxml b/miniprogram_npm/weui-miniprogram/cell/cell.wxml new file mode 100644 index 0000000..6d61dbc --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/cell/cell.wxml @@ -0,0 +1,73 @@ + + + + + + + + + + + {{title}} + + + + + + {{title}} + + + + + + + {{value}} + + + + + + {{footer}} + + + + + + + + + + + + + + + + + {{title}} + + + + + + {{title}} + + + + + + + {{value}} + + + + + + {{footer}} + + + + + + + \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/cell/cell.wxss b/miniprogram_npm/weui-miniprogram/cell/cell.wxss new file mode 100644 index 0000000..e33b369 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/cell/cell.wxss @@ -0,0 +1 @@ +.weui-cells{position:relative;margin-top:8px;background-color:#FFFFFF;line-height:1.41176471;font-size:17px}.weui-cells:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-cells:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-cells__title{margin-top:16px;margin-bottom:3px;padding-left:16px;padding-right:16px;color:rgba(0,0,0,0.5);font-size:14px}.weui-cells_after-title{margin-top:0}.weui-cells__tips{margin-top:3px;color:rgba(0,0,0,0.5);padding-left:16px;padding-right:16px;font-size:14px}.weui-cell{padding:16px;position:relative;display:flex;align-items:center}.weui-cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1);left:16px}.weui-cell:first-child:before{display:none}.weui-cell_active{background-color:#ECECEC}.weui-cell_primary{align-items:flex-start}.weui-cell__bd{flex:1}.weui-cell__ft{text-align:right;color:rgba(0,0,0,0.5)}.weui-cell_wxss.weui-cell_wxss:before{display:block}.weui-cell_label-block{display:block}.weui-cell_label-block .weui-label{width:auto;word-break:initial;-webkit-hyphens:auto;hyphens:auto}.weui-cell_vcode{padding-top:0;padding-right:0;padding-bottom:0}.weui-vcode-img{margin-left:5px;height:3.29411765em;vertical-align:middle}.weui-vcode-btn{display:inline-block;height:3.29411765em;margin-left:5px;padding:0 .6em 0 .7em;border-left:1rpx solid rgba(0,0,0,0.1);line-height:3.29411765em;vertical-align:middle;font-size:17px;color:#576B95;white-space:nowrap}button.weui-vcode-btn{min-height:0;background-color:transparent;border:0;outline:0}.weui-vcode-btn:active{color:#767676} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/cells/cells.js b/miniprogram_npm/weui-miniprogram/cells/cells.js new file mode 100644 index 0000000..d6c30c4 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/cells/cells.js @@ -0,0 +1,174 @@ +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: function 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: function linked(target) { + this.setData({ + checkboxCount: this.data.checkboxCount + 1, + checkboxIsMulti: target.data.multi + }); + }, + unlinked: function unlinked(target) { + this.setData({ + checkboxCount: this.data.checkboxCount - 1, + checkboxIsMulti: target.data.multi + }); + } + } + }, + methods: { + setCellMulti: function setCellMulti(multi) { + this.setData({ + checkboxIsMulti: multi + }); + }, + setCellsClass: function setCellsClass(className) { + this.setData({ + childClass: className + }); + }, + setOuterClass: function setOuterClass(className) { + this.setData({ + outerClass: className + }); + } + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/cells/cells.json b/miniprogram_npm/weui-miniprogram/cells/cells.json new file mode 100644 index 0000000..7e37c03 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/cells/cells.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/cells/cells.wxml b/miniprogram_npm/weui-miniprogram/cells/cells.wxml new file mode 100644 index 0000000..8c2a6ed --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/cells/cells.wxml @@ -0,0 +1,8 @@ + + {{title}} + + + + {{footer}} + + \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/checkbox-group/checkbox-group.js b/miniprogram_npm/weui-miniprogram/checkbox-group/checkbox-group.js new file mode 100644 index 0000000..1c23eb0 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/checkbox-group/checkbox-group.js @@ -0,0 +1,203 @@ +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({ + 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: function 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: function unlinked(target) { + var index = -1; + this.data.targetList.forEach(function (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: function linked(target) { + if (!this.data.parentCell) { + this.data.parentCell = target; + } + this.setParentCellsClass(); + }, + unlinked: function unlinked(target) { + this.data.parentCell = null; + } + } + }, + methods: { + checkedChange: function checkedChange(checked, target) { + console.log('checked change', checked); + if (this.data.multi) { + var vals = []; + this.data.targetList.forEach(function (item) { + if (item.data.checked) { + vals.push(item.data.value); + } + }); + this.triggerEvent('change', { value: vals }); + } else { + var val = ''; + this.data.targetList.forEach(function (item) { + if (item === target) { + val = item.data.value; + } else { + item.setData({ + checked: false + }); + } + }); + this.triggerEvent('change', { value: val }, {}); + } + }, + setParentCellsClass: function setParentCellsClass() { + var className = this.data.multi ? 'weui-cells_checkbox' : ''; + if (this.data.parentCell) { + this.data.parentCell.setCellsClass(className); + } + }, + _multiChange: function _multiChange(multi) { + this.data.targetList.forEach(function (target) { + target.setMulti(multi); + }); + if (this.data.parentCell) { + this.data.parentCell.setCellMulti(multi); + } + return multi; + } + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/checkbox-group/checkbox-group.json b/miniprogram_npm/weui-miniprogram/checkbox-group/checkbox-group.json new file mode 100644 index 0000000..38feec9 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/checkbox-group/checkbox-group.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "mp-cells": "../cells/cells" + } +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/checkbox-group/checkbox-group.wxml b/miniprogram_npm/weui-miniprogram/checkbox-group/checkbox-group.wxml new file mode 100644 index 0000000..9864e38 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/checkbox-group/checkbox-group.wxml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/checkbox-group/checkbox-group.wxss b/miniprogram_npm/weui-miniprogram/checkbox-group/checkbox-group.wxss new file mode 100644 index 0000000..e69de29 diff --git a/miniprogram_npm/weui-miniprogram/checkbox/checkbox.js b/miniprogram_npm/weui-miniprogram/checkbox/checkbox.js new file mode 100644 index 0000000..7547def --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/checkbox/checkbox.js @@ -0,0 +1,172 @@ +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 + }, + 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: function linked(target) { + this.data.group = target; + }, + unlinked: function unlinked() { + this.data.group = null; + } + } + }, + methods: { + setMulti: function setMulti(multi) { + this.setData({ + multi: multi + }); + }, + setOuterClass: function setOuterClass(className) { + this.setData({ + outerClass: className + }); + }, + checkedChange: function checkedChange(e) { + if (this.data.multi) { + var checked = !this.data.checked; + this.setData({ + checked: checked + }); + if (this.data.group) { + this.data.group.checkedChange(checked, this); + } + } else { + var _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 diff --git a/miniprogram_npm/weui-miniprogram/checkbox/checkbox.json b/miniprogram_npm/weui-miniprogram/checkbox/checkbox.json new file mode 100644 index 0000000..6ebe5fc --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/checkbox/checkbox.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "mp-cell": "../cell/cell", + "mp-checkbox-group": "../checkbox-group/checkbox-group" + } +} diff --git a/miniprogram_npm/weui-miniprogram/checkbox/checkbox.wxml b/miniprogram_npm/weui-miniprogram/checkbox/checkbox.wxml new file mode 100644 index 0000000..342c472 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/checkbox/checkbox.wxml @@ -0,0 +1,15 @@ + + + + + + + + + {{label}} + + + + + + \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/checkbox/checkbox.wxss b/miniprogram_npm/weui-miniprogram/checkbox/checkbox.wxss new file mode 100644 index 0000000..34a083c --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/checkbox/checkbox.wxss @@ -0,0 +1 @@ +.weui-cells_checkbox .weui-check__label:before{left:55px}.weui-check__label:active{background-color:#ECECEC}.weui-check{position:absolute;left:-9999px}.weui-check__hd_in-checkbox{padding-right:16px}.weui-cell__ft_in-radio{padding-left:16px} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/dialog/dialog.js b/miniprogram_npm/weui-miniprogram/dialog/dialog.js new file mode 100644 index 0000000..a105076 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/dialog/dialog.js @@ -0,0 +1,168 @@ +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, + addGlobalClass: true + }, + properties: { + title: { + type: String, + value: '' + }, + extClass: { + type: String, + value: '' + }, + maskClosable: { + type: Boolean, + value: true + }, + mask: { + type: Boolean, + value: true + }, + show: { + type: Boolean, + value: false, + observer: '_showChange' + }, + buttons: { + type: Array, + value: [] + } + }, + data: { + innerShow: false + }, + ready: function ready() { + var buttons = this.data.buttons; + var len = buttons.length; + buttons.forEach(function (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: buttons + }); + }, + + methods: { + buttonTap: function buttonTap(e) { + var index = e.currentTarget.dataset.index; + + this.triggerEvent('buttontap', { index: index, item: this.data.buttons[index] }, {}); + }, + close: function close() { + var data = this.data; + if (!data.maskClosable) return; + this.setData({ + show: false + }); + this.triggerEvent('close', {}, {}); + }, + stopEvent: function stopEvent() {} + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/dialog/dialog.json b/miniprogram_npm/weui-miniprogram/dialog/dialog.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/dialog/dialog.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/dialog/dialog.wxml b/miniprogram_npm/weui-miniprogram/dialog/dialog.wxml new file mode 100644 index 0000000..334fb9a --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/dialog/dialog.wxml @@ -0,0 +1,21 @@ + + + + + {{title}} + + + + + + + + + {{item.text}} + + + + + + + diff --git a/miniprogram_npm/weui-miniprogram/dialog/dialog.wxss b/miniprogram_npm/weui-miniprogram/dialog/dialog.wxss new file mode 100644 index 0000000..494d260 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/dialog/dialog.wxss @@ -0,0 +1 @@ +.weui-mask{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,0.6)}.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-dialog__wrp{position:fixed;z-index:5000;top:16px;bottom:16px;left:16px;right:16px;text-align:center;font-size:0;display:-webkit-box;display:-webkit-flex;display:flex;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__wrp .weui-dialog{max-height:100%}.weui-dialog{background-color:#FFFFFF;text-align:center;border-radius:12px;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;max-height:90%}.weui-dialog__hd{padding:32px 24px 16px}.weui-dialog__title{font-weight:700;font-size:17px;line-height:1.4}.weui-dialog__bd{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 24px;margin-bottom:32px;min-height:40px;font-size:17px;line-height:1.4;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;color:rgba(0,0,0,0.5)}.weui-dialog__bd:first-child{padding:32px 24px 0;font-weight:700;color:rgba(0,0,0,0.9);display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__ft{position:relative;line-height:64px;min-height:64px;font-size:17px;display:flex}.weui-dialog__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-dialog__btn{display:block;flex:1;color:#576B95;font-weight:700;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:relative}.weui-dialog__btn:active{background-color:#ECECEC}.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-dialog__btn:first-child:after{display:none}.weui-dialog__btn_default{color:rgba(0,0,0,0.9)}@media screen and (min-width:352px){.weui-dialog{width:320px;margin:0 auto}}.weui-dialog.weui-dialog_hidden{opacity:0;transform:scale3d(1, 1, 0)}.weui-dialog{opacity:1;-webkit-transform:scale3d(1, 1, 1);transform:scale3d(1, 1, 1);transition:all .3s 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 .3s ease-in} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/form-page/form-page.js b/miniprogram_npm/weui-miniprogram/form-page/form-page.js new file mode 100644 index 0000000..7db760d --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/form-page/form-page.js @@ -0,0 +1,131 @@ +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: { + type: String, + value: '' + }, + subtitle: { + type: String, + value: '' + } + }, + relations: { + '../cells/cells': { + type: 'descendant', + linked: function linked(target) { + if (!this.data.firstItem) { + this.data.firstItem = target; + } + if (target !== this.data.firstItem) { + target.setOuterClass('weui-cells__group_wxss'); + } + } + } + }, + data: { + firstItem: null + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/form-page/form-page.json b/miniprogram_npm/weui-miniprogram/form-page/form-page.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/form-page/form-page.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/form-page/form-page.wxml b/miniprogram_npm/weui-miniprogram/form-page/form-page.wxml new file mode 100644 index 0000000..9f067aa --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/form-page/form-page.wxml @@ -0,0 +1,33 @@ + + + + {{title}} + {{subtitle}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/miniprogram_npm/weui-miniprogram/form-page/form-page.wxss b/miniprogram_npm/weui-miniprogram/form-page/form-page.wxss new file mode 100644 index 0000000..dcc182d --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/form-page/form-page.wxss @@ -0,0 +1 @@ +.weui-cells__group_form:first-child .weui-cells__title{margin-top:0}.weui-cells__group_form .weui-cells__title{margin-top:24px;margin-bottom:8px;padding:0 32px}.weui-cells__group_form .weui-cells:before,.weui-cells__group_form .weui-cell:before{left:32px;right:32px}.weui-cells__group_form .weui-cells_checkbox .weui-check__label:before{left:72px}.weui-cells__group_form .weui-cells:after{left:32px;right:32px}.weui-cells__group_form .weui-cell{padding:16px 32px;color:rgba(0,0,0,0.9)}.weui-cells__group_form .weui-cell__hd{padding-right:16px}.weui-cells__group_form .weui-cell__ft{padding-left:16px}.weui-cells__group_form .weui-cell_warn input{color:#FA5151}.weui-cells__group_form .weui-label{max-width:5em;margin-right:8px}.weui-cells__group_form .weui-cells__tips{margin-top:8px;padding:0 32px;color:rgba(0,0,0,0.3)}.weui-cells__group_form .weui-cells__tips a{font-weight:700}.weui-cells__group_form .weui-cell_vcode{padding:12px 32px}.weui-cells__group_form .weui-vcode-btn{font-size:16px;padding:0 12px;margin-left:0;height:auto;width:auto;line-height:2em;color:#06AE56;background-color:#F2F2F2}.weui-cells__group_form .weui-vcode-btn:before{display:none}.weui-cells__group_form .weui-cell_select{padding:0}.weui-cells__group_form .weui-cell_select .weui-select{padding:0 32px}.weui-cells__group_form .weui-cell_select .weui-cell__bd:after{right:32px}.weui-cells__group_form .weui-cell_select-before .weui-label{margin-right:24px}.weui-cells__group_form .weui-cell_select-before .weui-select{padding-right:24px;box-sizing:initial}.weui-cells__group_form .weui-cell_select-after{padding-left:32px}.weui-cells__group_form .weui-cell_select-after .weui-select{padding-left:0}.weui-cells__group_form .weui-cell_switch{padding:12px 32px}.weui-cells__group_wxss.weui-cells__group_wxss .weui-cells__title{margin-top:24px}.weui-form{padding:56px 0 0;padding:calc(56px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(56px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);display:flex;flex-direction:column;min-height:100%;box-sizing:border-box;line-height:1.4;background-color:#FFFFFF}.weui-form a:not(.weui-btn){color:#576B95}.weui-form .weui-footer,.weui-form .weui-footer__link{font-size:12px}.weui-form .weui-agree{padding:0}.weui-form__text-area{padding:0 32px;color:rgba(0,0,0,0.9);text-align:center}.weui-form__control-area{flex:1;margin:48px 0}.weui-form__tips-area,.weui-form__extra-area{margin-bottom:24px;text-align:center}.weui-form__opr-area{margin-bottom:64px}.weui-form__opr-area:last-child{margin-bottom:96px}.weui-form__title{font-size:22px;font-weight:700;line-height:1.36}.weui-form__desc{font-size:17px;margin-top:16px}.weui-form__tips{color:rgba(0,0,0,0.5);font-size:12px} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/form/form.js b/miniprogram_npm/weui-miniprogram/form/form.js new file mode 100644 index 0000000..a61d4b4 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/form/form.js @@ -0,0 +1,591 @@ +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 = 4); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.diff = function (old, newVal) { + if (!old && newVal || old && !newVal) return true; + for (var k in newVal) { + if (old[k] !== newVal[k]) return true; + } + for (var _k in old) { + if (old[_k] !== newVal[_k]) return true; + } + return false; +}; +exports.diffObject = function (old, newVal) { + if (!old && newVal) return newVal; + if (!newVal && old) return old; + var diffObj = {}; + var isDiff = false; + for (var k in newVal) { + if (old[k] !== newVal[k]) { + isDiff = true; + diffObj[k] = newVal[k]; + } + } + for (var _k2 in old) { + if (old[_k2] !== newVal[_k2]) { + isDiff = true; + diffObj[_k2] = newVal[_k2]; + } + } + return isDiff ? diffObj : null; +}; + +/***/ }), +/* 1 */, +/* 2 */, +/* 3 */, +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { value: true }); +var form_validator_1 = __webpack_require__(5); +var object_1 = __webpack_require__(0); +function linked(target) { + if (target.data.prop) { + this.data.formItems[target.data.prop] = target; + } + if (target.setInForm) { + target.setInForm(); + } + if (!this.data.firstItem) { + this.data.firstItem = target; + } + if (target !== this.data.firstItem) {} +} +function unlinked(target) { + if (target.data.prop) { + delete this.data.formItems[target.data.prop]; + } +} +Component({ + properties: { + models: { + type: Object, + value: {}, + observer: '_modelChange' + }, + rules: { + type: Array, + value: [], + observer: '_rulesChange' + }, + extClass: { + type: String, + value: '' + } + }, + data: { + errors: {}, + formItems: {}, + firstItem: null + }, + relations: { + '../cell/cell': { + type: 'descendant', + linked: linked, + unlinked: unlinked + }, + '../checkbox-group/checkbox-group': { + type: 'descendant', + linked: linked, + unlinked: unlinked + } + }, + attached: function attached() { + this.initRules(); + this.formValidator = new form_validator_1.default(this.data.models, this.data.newRules); + }, + + methods: { + initRules: function initRules(rules) { + var newRules = {}; + (rules || this.data.rules).forEach(function (rule) { + if (rule.name && rule.rules) { + newRules[rule.name] = rule.rules || []; + } + }); + this.setData({ newRules: newRules }); + return newRules; + }, + _modelChange: function _modelChange(newVal, oldVal, path) { + var _this = this; + + if (!this.isInit) { + this.isInit = true; + return newVal; + } + this.formValidator.setModel(newVal); + this.isInit = true; + var diffObj = object_1.diffObject(oldVal, newVal); + if (diffObj) { + (function () { + var isValid = true; + var errors = []; + var errorMap = {}; + + var _loop = function _loop(k) { + _this.formValidator.validateField(k, diffObj[k], function (isValided, error) { + if (error && error[k]) { + errors.push(error[k]); + errorMap[k] = error[k]; + } + isValid = isValided; + }); + }; + + for (var k in diffObj) { + _loop(k); + } + _this._showErrors(diffObj, errorMap); + _this.triggerEvent(isValid ? 'success' : 'fail', isValid ? { trigger: 'change' } : { errors: errors, trigger: 'change' }); + })(); + } + return newVal; + }, + _rulesChange: function _rulesChange(newVal) { + var newRules = this.initRules(newVal); + if (this.formValidator) { + this.formValidator.setRules(newRules); + } + return newVal; + }, + _showAllErrors: function _showAllErrors(errors) { + for (var k in this.data.newRules) { + this._showError(k, errors && errors[k]); + } + }, + _showErrors: function _showErrors(objs, errors) { + for (var k in objs) { + this._showError(k, errors && errors[k]); + } + }, + _showError: function _showError(prop, error) { + var formItem = this.data.formItems[prop]; + if (formItem && formItem.data.showError) { + formItem.setError(error); + } + }, + validate: function validate(cb) { + var _this2 = this; + + return this.formValidator.validate(function (isValid, errors) { + _this2._showAllErrors(errors); + var handleError = _this2.handleErrors(errors); + _this2.triggerEvent(isValid ? 'success' : 'fail', isValid ? { trigger: 'validate' } : { errors: handleError, trigger: 'validate' }); + cb && cb(isValid, handleError); + }); + }, + validateField: function validateField(name, value) { + var _this3 = this; + + var cb = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (v) { + var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + }; + + return this.formValidator.validateField(name, value, function (isValid, errors) { + _this3._showError(name, errors); + var handleError = _this3.handleErrors(errors); + _this3.triggerEvent(isValid ? 'success' : 'fail', isValid ? { trigger: 'validate' } : { errors: handleError, trigger: 'validate' }); + cb && cb(isValid, handleError); + }); + }, + handleErrors: function handleErrors(errors) { + if (errors) { + var newErrors = []; + this.data.rules.forEach(function (rule) { + if (errors[rule.name]) { + errors[rule.name].name = rule.name; + newErrors.push(errors[rule.name]); + } + }); + return newErrors; + } + return errors; + }, + addMethod: function addMethod(ruleName, method) { + return this.formValidator.addMethod(ruleName, method); + } + } +}); +exports.default = form_validator_1.default; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +Object.defineProperty(exports, "__esModule", { value: true }); +var validator_1 = __webpack_require__(6); +var object_1 = __webpack_require__(0); +var toString = Object.prototype.toString; +var validateSingleRule = function validateSingleRule(rule, value) { + var param = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + var models = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; + + var message = ''; + for (var ruleKey in rule) { + if (ruleKey === 'name' || ruleKey === 'message') continue; + var validateMethod = typeof rule.validator !== 'undefined' ? rule.validator : validator_1.default[ruleKey]; + if (typeof validateMethod === 'function') { + message = validateMethod(rule, value, param, models); + if (message) { + return message; + } + } + } + return message; +}; + +var FormValidator = function () { + function FormValidator(models, rules) { + _classCallCheck(this, FormValidator); + + this.models = models; + this.rules = rules; + this.errors = {}; + } + + FormValidator.prototype.validate = function validate(cb) { + var _this = this; + + return new Promise(function (resolve) { + var fieldCount = 0; + var failCount = 0; + var errors = _this.errors; + var models = _this.models; + var errorChanged = false; + + var _loop = function _loop(k) { + (function (fieldName) { + var oldError = errors[fieldName]; + _this._innerValidateField(k, models[fieldName], function (valid, newError) { + fieldCount++; + if (!valid) failCount++; + if (object_1.diff(oldError, newError)) { + errors[fieldName] = newError; + errorChanged = true; + } + }); + })(k); + }; + + for (var k in _this.rules) { + _loop(k); + } + if (errorChanged) {} + var keys = Object.keys(errors); + keys.forEach(function (key) { + if (!errors[key]) delete errors[key]; + }); + resolve({ isValid: !failCount, errors: failCount ? errors : undefined }); + cb && cb(!failCount, failCount ? errors : undefined); + }); + }; + + FormValidator.prototype.validateField = function validateField(name, value) { + var _this2 = this; + + var cb = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (v) { + var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + }; + + return new Promise(function (resolve) { + _this2._innerValidateField(name, value, function (valid, error) { + var errObj = {}; + errObj[name] = error; + resolve({ valid: valid, error: valid ? undefined : error }); + cb(valid, valid ? undefined : errObj); + var oldError = _this2.errors[name]; + var errorChanged = object_1.diff(oldError, error); + if (errorChanged) { + if (!error) delete _this2.errors[name]; + _this2.errors[name] = error; + } + }); + }); + }; + + FormValidator.prototype._innerValidateField = function _innerValidateField(name, value) { + var cb = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (v) { + var errors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + }; + + var rules = this.rules[name]; + if (!rules) { + console.warn("[form-validtor] rule name " + name + " not exists."); + cb(true); + return; + } + if (typeof value === 'function') { + cb = value; + value = undefined; + } + var isFail = false; + var models = this.models; + if (toString.call(rules) === '[object Array]') { + rules.forEach(function (rule) { + rule.name = name; + var resMessage = validateSingleRule(rule, value || models[name], rule.param, models); + if (resMessage && !isFail) { + isFail = true; + var error = resMessage ? { message: resMessage, rule: rule } : undefined; + cb(false, error); + } + }); + if (!isFail) { + cb(!isFail); + } + } else { + var rule = rules; + rule.name = name; + var resMessage = validateSingleRule(rule, value || models[name], rule.param, models); + var error = resMessage ? { message: resMessage, rule: rule } : undefined; + if (resMessage) { + isFail = true; + } + cb(!isFail, error); + } + }; + + FormValidator.prototype.addMethod = function addMethod(ruleName, method) { + validator_1.default[ruleName] = method; + }; + + FormValidator.prototype.setModel = function setModel(newModel) { + this.models = newModel; + }; + + FormValidator.prototype.setRules = function setRules(newRules) { + this.rules = newRules; + }; + + return FormValidator; +}(); + +exports.default = FormValidator; + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { value: true }); +var string_1 = __webpack_require__(7); +var defaultMessage = { + required: '%s必填', + minlength: '长度最少为%s', + maxlength: '长度最大为%s', + rangelength: '长度在%s和%s之间', + bytelength: '最多只能输入%s个字', + min: '值最小为%s', + max: '值最大为%s', + range: '值的范围为%s和%s之间', + mobile: '请输入正确的手机号', + email: '请输入正确的电子邮件', + url: '请输入正确的URL地址', + equalTo: '值和字段%s不相等' +}; +exports.default = { + required: function required(r, val, param, models) { + if (r.required === false) return; + if (!val) return string_1.sprintf(r.message || defaultMessage.required, r.name); + }, + minlength: function minlength(r, val) { + var minlen = r.minlength; + val = val || ''; + if (val.length < minlen) return string_1.sprintf(r.message || defaultMessage.minlength, minlen); + }, + maxlength: function maxlength(r, val) { + var maxlen = r.maxlength; + val = val || ''; + if (val.length > maxlen) return string_1.sprintf(r.message || defaultMessage.maxlength, maxlen); + }, + rangelength: function rangelength(r, val) { + var range = r.range; + val = val || ''; + if (val.length > range[1] || val.length < range[0]) return string_1.sprintf(r.message || defaultMessage.rangelength, range[0], range[1]); + }, + min: function min(r, val) { + var min = r.min; + if (val < min) return string_1.sprintf(r.message || defaultMessage.min, min); + }, + max: function max(r, val) { + var max = r.max; + if (val > max) return string_1.sprintf(r.message || defaultMessage.max, max); + }, + range: function range(r, val) { + var range = r.range; + if (val < range[0] || val > range[1]) return string_1.sprintf(r.message || defaultMessage.range, range[0], range[1]); + }, + mobile: function mobile(r, val) { + if (r.mobile === false) return; + val = val || ''; + if (val.length !== 11) return string_1.sprintf(r.message || defaultMessage.mobile); + }, + email: function email(r, value) { + if (r.email === false) return; + if (!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(value)) { + return string_1.sprintf(r.message || defaultMessage.email); + } + }, + url: function url(r, value) { + if (r.url === false) return; + if (!/^(https?|s?ftp|weixin):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value)) { + return r.message || defaultMessage.url; + } + }, + equalTo: function equalTo(r, value, param, models) { + var equalTo = r.equalTo; + if (value !== models[equalTo]) return string_1.sprintf(r.message || defaultMessage.equalTo, r.name); + }, + bytelength: function bytelength(r, value, param, models) { + param = r.param; + var len = value.replace(/[^\x00-\xff]/g, '**').length; + if (len > param) return string_1.sprintf(r.message || defaultMessage.bytelength, param); + } +}; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.sprintf = function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var i = void 0; + var result = args[0] || ''; + var para = void 0; + var reg = void 0; + var length = args.length - 1; + if (length < 1) { + return result; + } + i = 1; + while (i < length + 1) { + result = result.replace(/%s/, '{#' + i + '#}'); + i++; + } + result.replace('%s', ''); + i = 1; + while (true) { + para = args[i]; + if (para === undefined) { + break; + } + reg = new RegExp('{#' + i + '#}', 'g'); + result = result.replace(reg, para); + i++; + } + return result; +}; + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/form/form.json b/miniprogram_npm/weui-miniprogram/form/form.json new file mode 100644 index 0000000..7e37c03 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/form/form.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/form/form.wxml b/miniprogram_npm/weui-miniprogram/form/form.wxml new file mode 100644 index 0000000..d58aa4d --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/form/form.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/gallery/gallery.js b/miniprogram_npm/weui-miniprogram/gallery/gallery.js new file mode 100644 index 0000000..4d14d2e --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/gallery/gallery.js @@ -0,0 +1,172 @@ +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: function observer(newVal, oldVal, changedPath) { + this.setData({ currentImgs: newVal }); + } + }, + showDelete: { + type: Boolean, + value: true + }, + show: { + type: Boolean, + value: true + }, + current: { + type: Number, + value: 0 + }, + hideOnClick: { + type: Boolean, + value: true + }, + extClass: { + type: Boolean, + value: '' + } + }, + data: { + currentImgs: [] + }, + ready: function ready() { + var data = this.data; + this.setData({ currentImgs: data.imgUrls }); + }, + + methods: { + change: function change(e) { + this.setData({ + current: e.detail.current + }); + this.triggerEvent('change', { current: e.detail.current }, {}); + }, + deleteImg: function deleteImg() { + var data = this.data; + var imgs = data.currentImgs; + var url = imgs.splice(data.current, 1); + this.triggerEvent('delete', { url: url[0], index: data.current }, {}); + if (imgs.length === 0) { + this.hideGallery(); + return; + } + this.setData({ + current: 0, + currentImgs: imgs + }); + }, + hideGallery: function hideGallery() { + var data = this.data; + if (data.hideOnClick) { + this.setData({ + show: false + }); + this.triggerEvent('hide', {}, {}); + } + } + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/gallery/gallery.json b/miniprogram_npm/weui-miniprogram/gallery/gallery.json new file mode 100644 index 0000000..7e37c03 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/gallery/gallery.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/gallery/gallery.wxml b/miniprogram_npm/weui-miniprogram/gallery/gallery.wxml new file mode 100644 index 0000000..2529a71 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/gallery/gallery.wxml @@ -0,0 +1,13 @@ + + {{current+1}}/{{currentImgs.length}} + + + + + + + + + 删除 + + diff --git a/miniprogram_npm/weui-miniprogram/gallery/gallery.wxss b/miniprogram_npm/weui-miniprogram/gallery/gallery.wxss new file mode 100644 index 0000000..5e6caa4 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/gallery/gallery.wxss @@ -0,0 +1 @@ +.weui-gallery{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000000;z-index:1000;-webkit-flex-direction:column;flex-direction:column;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;opacity:0;visibility:hidden;transition:opacity .3s}.weui-gallery_show{display:-webkit-box;display:-webkit-flex;display:flex;visibility:visible;opacity:1}.weui-gallery__img__wrp{-webkit-box-flex:1;-webkit-flex:1;flex:1;position:relative;font-size:0}.weui-gallery__img{background:center center no-repeat;background-size:contain;position:absoulte;width:100%;height:100%}.weui-gallery__opr{background-color:#0D0D0D;color:#FFFFFF;line-height:60px;min-height:60px;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);text-align:center}.weui-gallery__opr navigator{color:#FFFFFF}.weui-gallery__del{display:block}.weui-gallery__info{color:#FFFFFF;font-size:17px;line-height:60px;min-height:60px;text-align:center} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/half-screen-dialog/half-screen-dialog.js b/miniprogram_npm/weui-miniprogram/half-screen-dialog/half-screen-dialog.js new file mode 100644 index 0000000..9f7c6eb --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/half-screen-dialog/half-screen-dialog.js @@ -0,0 +1,165 @@ +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, + addGlobalClass: true + }, + properties: { + closabled: { + type: Boolean, + value: true + }, + title: { + type: String, + value: '' + }, + subTitle: { + type: String, + value: '' + }, + extClass: { + 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: [] + } + }, + methods: { + close: function close(e) { + var type = e.currentTarget.dataset.type; + + if (this.data.maskClosable || type === 'close') { + this.setData({ + show: false + }); + this.triggerEvent('close'); + } + }, + buttonTap: function buttonTap(e) { + var index = e.currentTarget.dataset.index; + + this.triggerEvent('buttontap', { index: index, item: this.data.buttons[index] }, {}); + } + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/half-screen-dialog/half-screen-dialog.json b/miniprogram_npm/weui-miniprogram/half-screen-dialog/half-screen-dialog.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/half-screen-dialog/half-screen-dialog.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/half-screen-dialog/half-screen-dialog.wxml b/miniprogram_npm/weui-miniprogram/half-screen-dialog/half-screen-dialog.wxml new file mode 100644 index 0000000..7a74a5c --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/half-screen-dialog/half-screen-dialog.wxml @@ -0,0 +1,43 @@ + + + + + + 关闭 + + + + {{title}} + {{subTitle}} + + + + + + + 更多 + + + + + {{desc}} + {{tips}} + + + + + + + + + + + + \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/half-screen-dialog/half-screen-dialog.wxss b/miniprogram_npm/weui-miniprogram/half-screen-dialog/half-screen-dialog.wxss new file mode 100644 index 0000000..93f2fe2 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/half-screen-dialog/half-screen-dialog.wxss @@ -0,0 +1 @@ +.weui-half-screen-dialog{position:fixed;left:0;right:0;bottom:0;max-height:75%;z-index:5000;line-height:1.4;background-color:#FFFFFF;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden;padding:0 24px;padding:0 calc(24px + constant(safe-area-inset-right)) constant(safe-area-inset-bottom) calc(24px + constant(safe-area-inset-left));padding:0 calc(24px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(24px + env(safe-area-inset-left))}.weui-half-screen-dialog__hd{font-size:8px;height:8em;display:flex;align-items:center}.weui-half-screen-dialog__hd .weui-icon-btn{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.weui-half-screen-dialog__hd__side{position:relative;left:-8px}.weui-half-screen-dialog__hd__main{flex:1}.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main{text-align:center;padding:0 40px}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side{right:-8px;left:auto}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side .weui-icon-btn{right:0}.weui-half-screen-dialog__title{display:block;color:rgba(0,0,0,0.9);font-weight:700;font-size:15px}.weui-half-screen-dialog__subtitle{display:block;color:rgba(0,0,0,0.5);font-size:10px}.weui-half-screen-dialog__bd{word-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;overflow-y:auto}.weui-half-screen-dialog__desc{padding-top:4px;font-size:17px;font-weight:700;color:rgba(0,0,0,0.9);line-height:1.4}.weui-half-screen-dialog__tips{padding-top:16px;font-size:14px;color:rgba(0,0,0,0.3);line-height:1.4}.weui-half-screen-dialog__ft{padding:40px 24px 32px;text-align:center}.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2),.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2)+.weui-btn{display:inline-block;vertical-align:top;margin:0 8px;width:120px}.weui-icon-btn{background-color:transparent;background-repeat:no-repeat;background-position:50% 50%;background-size:100%;border:0;outline:0;font-size:0}.weui-icon-btn_goback{width:12px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M26 39.438L24.955 40.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42l7.666-7.79L26 24.563 18.682 32 26 39.438z'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_close{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'%3E %3Cdefs%3E %3Cpath id='33cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a' d='M8 6.943L1.807.75.75 1.807 6.943 8 .75 14.193l1.057 1.057L8 9.057l6.193 6.193 1.057-1.057L9.057 8l6.193-6.193L14.193.75z'/%3E %3C/defs%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cuse fill='%23000' fill-opacity='.9' transform='translate(20 24)' xlink:href='%2333cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_more{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-374 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M380.75 32a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0zm5.25-1.75a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E %3C/g%3E%3C/svg%3E")}.weui-mask{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,0.6)}.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.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 diff --git a/miniprogram_npm/weui-miniprogram/icon/icon.js b/miniprogram_npm/weui-miniprogram/icon/icon.js new file mode 100644 index 0000000..4b030ed --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/icon/icon.js @@ -0,0 +1,295 @@ +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 = 10); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 10: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { value: true }); +var base64_1 = __webpack_require__(11); +var icondata_1 = __webpack_require__(12); +Component({ + options: { + addGlobalClass: true + }, + properties: { + extClass: { + type: String, + value: '' + }, + type: { + type: String, + value: 'outline', + observer: '_genSrcByType' + }, + icon: { + type: String, + value: '', + observer: '_genSrcByIcon' + }, + size: { + type: Number, + value: 20 + }, + color: { + type: String, + value: '#000000' + } + }, + data: { + src: '', + height: 20, + width: 20 + }, + methods: { + _genSrcByIcon: function _genSrcByIcon(v) { + this._genSrc(icondata_1.default[v][this.data.type]); + }, + _genSrcByType: function _genSrcByType(v) { + this._genSrc(icondata_1.default[this.data.icon][v]); + }, + _genSrc: function _genSrc(rawData) { + if (!rawData) return; + var base64 = base64_1.default.encode(rawData); + this.setData({ + src: 'data:image/svg+xml;base64,' + base64 + }); + } + } +}); + +/***/ }), + +/***/ 11: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { value: true }); +var b64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +var cb_encode = function cb_encode(ccc) { + var padlen = [0, 2, 1][ccc.length % 3], + ord = ccc.charCodeAt(0) << 16 | (ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8 | (ccc.length > 2 ? ccc.charCodeAt(2) : 0), + chars = [b64chars.charAt(ord >>> 18), b64chars.charAt(ord >>> 12 & 63), padlen >= 2 ? '=' : b64chars.charAt(ord >>> 6 & 63), padlen >= 1 ? '=' : b64chars.charAt(ord & 63)]; + return chars.join(''); +}; +var btoa = global.btoa ? function (b) { + return global.btoa(b); +} : function (b) { + return b.replace(/[\s\S]{1,3}/g, cb_encode); +}; +var fromCharCode = String.fromCharCode; +var cb_utob = function cb_utob(c) { + var cc; + if (c.length < 2) { + cc = c.charCodeAt(0); + return cc < 0x80 ? c : cc < 0x800 ? fromCharCode(0xc0 | cc >>> 6) + fromCharCode(0x80 | cc & 0x3f) : fromCharCode(0xe0 | cc >>> 12 & 0x0f) + fromCharCode(0x80 | cc >>> 6 & 0x3f) + fromCharCode(0x80 | cc & 0x3f); + } else { + cc = 0x10000 + (c.charCodeAt(0) - 0xD800) * 0x400 + (c.charCodeAt(1) - 0xDC00); + return fromCharCode(0xf0 | cc >>> 18 & 0x07) + fromCharCode(0x80 | cc >>> 12 & 0x3f) + fromCharCode(0x80 | cc >>> 6 & 0x3f) + fromCharCode(0x80 | cc & 0x3f); + } +}; +var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g; +var utob = function utob(u) { + return u.replace(re_utob, cb_utob); +}; +var _encode = function _encode(u) { + var isUint8Array = Object.prototype.toString.call(u) === '[object Uint8Array]'; + return isUint8Array ? u.toString('base64') : btoa(utob(String(u))); +}; +var encode = function encode(u) { + var urisafe = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + return !urisafe ? _encode(u) : _encode(String(u)).replace(/[+\/]/g, function (m0) { + return m0 == '+' ? '-' : '_'; + }).replace(/=/g, ''); +}; +exports.default = { + encode: encode +}; + +/***/ }), + +/***/ 12: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = { + "add-friends": { outline: "3.Icons/Outlined/add-friendsCreated with Sketch. ", field: " 3.Icons/Filled/add-friends Created with Sketch. " }, + "add": { outline: " 3.Icons/Outlined/add Created with Sketch. ", field: " 3.Icons/Filled/add Created with Sketch. " }, + "add2": { outline: " 3.Icons/Outlined/add2 Created with Sketch. ", field: " 3.Icons/Filled/add2 Created with Sketch. " }, + "album": { outline: " 3.Icons/Outlined/album Created with Sketch. ", field: " 3.Icons/Filled/album Created with Sketch. " }, + "arrow": { outline: " 3.Icons/Outlined/arrow Created with Sketch. ", field: " 3.Icons/Filled/arrow Created with Sketch. " }, + "at": { outline: " 3.Icons/Outlined/at Created with Sketch. ", field: " 3.Icons/Filled/at Created with Sketch. " }, + "back": { outline: " 3.Icons/Outlined/back Created with Sketch. ", field: " 3.Icons/Filled/back Created with Sketch. " }, + "back2": { outline: " 3.Icons/Outlined/back2 Created with Sketch. ", field: " 3.Icons/Filled/back2 Created with Sketch. " }, + "bellring-off": { outline: " 3.Icons/Outlined/bellring_off Created with Sketch. ", field: " 3.Icons/Filled/bell-ring_off Created with Sketch. " }, + "bellring-on": { outline: " 3.Icons/Outlined/bellring_on Created with Sketch. ", field: " 3.Icons/Filled/bell-ring_on Created with Sketch. " }, + "camera": { outline: " 3.Icons/Outlined/camera Created with Sketch. ", field: " 3.Icons/Filled/camera Created with Sketch. " }, + "cellphone": { outline: " 3.Icons/Outlined/cellphone Created with Sketch. ", field: " 3.Icons/Filled/cellphone Created with Sketch. " }, + "clip": { outline: " 3.Icons/Outlined/clip Created with Sketch. ", field: " 3.Icons/Filled/clip Created with Sketch. " }, + "close": { outline: " 3.Icons/Outlined/close Created with Sketch. ", field: " 3.Icons/Filled/close Created with Sketch. " }, + "close2": { outline: " 3.Icons/Outlined/close2 Created with Sketch. ", field: " 3.Icons/Filled/close2 Created with Sketch. " }, + "comment": { outline: " 3.Icons/Outlined/comment Created with Sketch. ", field: " 3.Icons/Filled/comment Created with Sketch. " }, + "contacts": { outline: " 3.Icons/Outlined/contacts Created with Sketch. ", field: " 3.Icons/Filled/contacts Created with Sketch. " }, + "copy": { outline: " 3.Icons/Outlined/copy Created with Sketch. ", field: " 3.Icons/Filled/copy Created with Sketch. " }, + "delete-on": { outline: " 3.Icons/Outlined/delete_on Created with Sketch. ", field: " 3.Icons/Filled/delete_on Created with Sketch. " }, + "delete": { outline: " 3.Icons/Outlined/delete Created with Sketch. ", field: " 3.Icons/Filled/delete Created with Sketch. " }, + "discover": { outline: " 3.Icons/Outlined/discover Created with Sketch. ", field: " 3.Icons/Filled/discover Created with Sketch. " }, + "display": { outline: " 3.Icons/Outlined/display Created with Sketch. ", field: " 3.Icons/Filled/display Created with Sketch. " }, + "done": { outline: " 3.Icons/Outlined/done Created with Sketch. ", field: " 3.Icons/Filled/done Created with Sketch. " }, + "done2": { outline: " 3.Icons/Outlined/done2 Created with Sketch. ", field: " 3.Icons/Filled/done2 Created with Sketch. " }, + "download": { outline: " 3.Icons/Outlined/download Created with Sketch. ", field: " 3.Icons/Filled/download Created with Sketch. " }, + "email": { outline: " 3.Icons/Outlined/email Created with Sketch. ", field: " 3.Icons/Filled/email Created with Sketch. " }, + "error": { outline: " 3.Icons/Outlined/error Created with Sketch. ", field: " 3.Icons/Filled/error Created with Sketch. " }, + "eyes-off": { outline: " 3.Icons/Outlined/eyes_off Created with Sketch. ", field: " 3.Icons/Filled/eyes_off Created with Sketch. " }, + "eyes-on": { outline: " 3.Icons/Outlined/eyes_on Created with Sketch. ", field: " 3.Icons/Filled/eyes_on Created with Sketch. " }, + "folder": { outline: " 3.Icons/Outlined/folder Created with Sketch. ", field: " 3.Icons/Filled/folder Created with Sketch. " }, + "group-detail": { outline: " 3.Icons/Outlined/group-detail Created with Sketch. ", field: " 3.Icons/Filled/group-detail Created with Sketch. " }, + "help": { outline: " 3.Icons/Outlined/help Created with Sketch. ", field: " 3.Icons/Filled/help Created with Sketch. " }, + "home": { outline: " 3.Icons/Outlined/home Created with Sketch. ", field: " 3.Icons/Filled/home Created with Sketch. " }, + "imac": { outline: " 3.Icons/Outlined/imac Created with Sketch. ", field: " 3.Icons/Filled/imac Created with Sketch. " }, + "info": { outline: " 3.Icons/Outlined/info Created with Sketch. ", field: " 3.Icons/Filled/info Created with Sketch. " }, + "keyboard": { outline: " 3.Icons/Outlined/keyboard Created with Sketch. ", field: " 3.Icons/Filled/keyboard Created with Sketch. " }, + "like": { outline: " 3.Icons/Outlined/like Created with Sketch. ", field: " 3.Icons/Filled/like Created with Sketch. " }, + "link": { outline: " 3.Icons/Outlined/link Created with Sketch. ", field: " 3.Icons/Filled/link Created with Sketch. " }, + "location": { outline: " 3.Icons/Outlined/location Created with Sketch. ", field: " 3.Icons/Filled/location Created with Sketch. " }, + "lock": { outline: " 3.Icons/Outlined/lock Created with Sketch. ", field: " 3.Icons/Filled/lock Created with Sketch. " }, + "max-window": { outline: " 3.Icons/Outlined/max-window Created with Sketch. ", field: " 3.Icons/Filled/max-window Created with Sketch. " }, + "me": { outline: " 3.Icons/Outlined/me Created with Sketch. ", field: " 3.Icons/Filled/me Created with Sketch. " }, + "mike": { outline: " 3.Icons/Outlined/mike Created with Sketch. ", field: " 3.Icons/Filled/mike Created with Sketch. " }, + "mike2": { outline: " 3.Icons/Outlined/mike2 Created with Sketch. ", field: " 3.Icons/Filled/mike2 Created with Sketch. " }, + "mobile-contacts": { outline: " 3.Icons/Outlined/mobile-contacts Created with Sketch. ", field: " 3.Icons/Filled/mobile-contacts Created with Sketch. " }, + "more": { outline: " 3.Icons/Outlined/more Created with Sketch. ", field: " 3.Icons/Filled/more Created with Sketch. " }, + "more2": { outline: " 3.Icons/Outlined/more2 Created with Sketch. ", field: " 3.Icons/Filled/more2 Created with Sketch. " }, + "mosaic": { outline: " 3.Icons/Outlined/mosaic Created with Sketch. ", field: " 3.Icons/Filled/mask Created with Sketch. " }, + "music-off": { outline: " 3.Icons/Outlined/music_off Created with Sketch. ", field: " 3.Icons/Filled/music-off Created with Sketch. " }, + "music": { outline: " 3.Icons/Outlined/music Created with Sketch. ", field: " 3.Icons/Filled/music Created with Sketch. " }, + "note": { outline: " 3.Icons/Outlined/note Created with Sketch. ", field: " 3.Icons/Filled/note Created with Sketch. " }, + "pad": { outline: " 3.Icons/Outlined/pad Created with Sketch. ", field: " 3.Icons/Filled/pad Created with Sketch. " }, + "pause": { outline: " 3.Icons/Outlined/pause Created with Sketch. ", field: " 3.Icons/Filled/pause Created with Sketch. " }, + "pencil": { outline: " 3.Icons/Outlined/pencil Created with Sketch. ", field: " 3.Icons/Filled/pencil Created with Sketch. " }, + "photo-wall": { outline: " 3.Icons/Outlined/photo-wall Created with Sketch. ", field: " 3.Icons/Filled/photo-wall Created with Sketch. " }, + "play": { outline: " 3.Icons/Outlined/play Created with Sketch. ", field: " 3.Icons/Filled/play Created with Sketch. " }, + "play2": { outline: " 3.Icons/Outlined/play2 Created with Sketch. ", field: " 3.Icons/Filled/play2 Created with Sketch. " }, + "previous": { outline: " 3.Icons/Outlined/previous Created with Sketch. ", field: " 3.Icons/Filled/previous Created with Sketch. " }, + "previous2": { outline: " 3.Icons/Outlined/previous2 Created with Sketch. ", field: " 3.Icons/Filled/previous2 Created with Sketch. " }, + "qr-code": { outline: " 3.Icons/Outlined/qr-code Created with Sketch. ", field: " 3.Icons/Filled/qr-code Created with Sketch. " }, + "refresh": { outline: " 3.Icons/Outlined/refresh Created with Sketch. ", field: " 3.Icons/Filled/refresh Created with Sketch. " }, + "report-problem": { outline: " 3.Icons/Outlined/report_problem Created with Sketch. ", field: " 3.Icons/Filled/report-problem Created with Sketch. " }, + "search": { outline: " 3.Icons/Outlined/search Created with Sketch. ", field: " 3.Icons/Filled/search Created with Sketch. " }, + "sending": { outline: " 3.Icons/Outlined/sending Created with Sketch. ", field: " 3.Icons/Filled/sending Created with Sketch. " }, + "setting": { outline: " 3.Icons/Outlined/setting Created with Sketch. ", field: " 3.Icons/Filled/setting Created with Sketch. " }, + "share": { outline: " 3.Icons/Outlined/share Created with Sketch. ", field: " 3.Icons/Filled/share Created with Sketch. " }, + "shop": { outline: " 3.Icons/Outlined/shop Created with Sketch. ", field: " 3.Icons/Filled/shop Created with Sketch. " }, + "star": { outline: " 3.Icons/Outlined/star Created with Sketch. ", field: " 3.Icons/Filled/star Created with Sketch. " }, + "sticker": { outline: " 3.Icons/Outlined/sticker Created with Sketch. ", field: " 3.Icons/Filled/sticker Created with Sketch. " }, + "tag": { outline: " 3.Icons/Outlined/tag Created with Sketch. ", field: " 3.Icons/Filled/tag Created with Sketch. " }, + "text": { outline: " 3.Icons/Outlined/text Created with Sketch. ", field: " 3.Icons/Filled/text Created with Sketch. " }, + "time": { outline: " 3.Icons/Outlined/time Created with Sketch. ", field: " 3.Icons/Filled/time Created with Sketch. " }, + "transfer-text": { outline: " 3.Icons/Outlined/transfer-text Created with Sketch. ", field: " 3.Icons/Filled/transfer-text Created with Sketch. " }, + "transfer2": { outline: " 3.Icons/Outlined/transfer2 Created with Sketch. ", field: " 3.Icons/Filled/transfer2 Created with Sketch. " }, + "translate": { outline: " 3.Icons/Outlined/translate Created with Sketch. ", field: " 3.Icons/Filled/translate Created with Sketch. " }, + "tv": { outline: " 3.Icons/Outlined/tv Created with Sketch. ", field: " 3.Icons/Filled/tv Created with Sketch. " }, + "video-call": { outline: " 3.Icons/Outlined/video-call Created with Sketch. ", field: " 3.Icons/Filled/video-call Created with Sketch. " }, + "voice": { outline: " 3.Icons/Outlined/voice Created with Sketch. ", field: " 3.Icons/Filled/voice Created with Sketch. " }, + "volume-down": { outline: " 3.Icons/Outlined/volume_down Created with Sketch. ", field: " 3.Icons/Filled/volume-down Created with Sketch. " }, + "volume-off": { outline: " 3.Icons/Outlined/volume_off Created with Sketch. ", field: " 3.Icons/Filled/volume-off Created with Sketch. " }, + "volume-up": { outline: " 3.Icons/Outlined/volume_up Created with Sketch. ", field: " 3.Icons/Filled/volume-up Created with Sketch. " } +}; + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/icon/icon.json b/miniprogram_npm/weui-miniprogram/icon/icon.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/icon/icon.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/icon/icon.wxml b/miniprogram_npm/weui-miniprogram/icon/icon.wxml new file mode 100644 index 0000000..dba5634 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/icon/icon.wxml @@ -0,0 +1,14 @@ + + var double = function(a) { + return 2*a + }; + var ifSpecialIcon = function(v) { + return v === 'arrow' || v === 'back' + } + module.exports = { + double: double, + ifSpecialIcon: ifSpecialIcon + } + + + diff --git a/miniprogram_npm/weui-miniprogram/icon/icon.wxss b/miniprogram_npm/weui-miniprogram/icon/icon.wxss new file mode 100644 index 0000000..f84d9ca --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/icon/icon.wxss @@ -0,0 +1 @@ +.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 diff --git a/miniprogram_npm/weui-miniprogram/index.js b/miniprogram_npm/weui-miniprogram/index.js new file mode 100644 index 0000000..e24a3fd --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/index.js @@ -0,0 +1,100 @@ +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 = 26); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 26: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { value: true }); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/index.json b/miniprogram_npm/weui-miniprogram/index.json new file mode 100644 index 0000000..d3b37ef --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/index.json @@ -0,0 +1,24 @@ +{ + "usingComponents": { + "actionsheet": "./actionsheet/actionsheet", + "form-page": "./form-page/form-page", + "navigation-bar": "./navigation-bar/navigation-bar", + "form": "./form/form", + "cell": "./cell/cell", + "icon": "./icon/icon", + "toptips": "./toptips/toptips", + "loading": "./loading/loading", + "tabbar": "./tabbar/tabbar", + "cells": "./cells/cells", + "half-screen-dialog": "./half-screen-dialog/half-screen-dialog", + "slideview": "./slideview/slideview", + "msg": "./msg/msg", + "dialog": "./dialog/dialog", + "uploader": "./uploader/uploader", + "gallery": "./gallery/gallery", + "checkbox": "./checkbox/checkbox", + "badge": "./badge/badge", + "searchbar": "./searchbar/searchbar", + "checkbox-group": "./checkbox-group/checkbox-group" + } +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/loading/loading.js b/miniprogram_npm/weui-miniprogram/loading/loading.js new file mode 100644 index 0000000..3c38b7a --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/loading/loading.js @@ -0,0 +1,181 @@ +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 = 14); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 14: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Component({ + options: { + addGlobalClass: true + }, + properties: { + extClass: { + type: String, + value: '' + }, + show: { + type: Boolean, + value: true, + observer: function observer(newValue) { + this._computedStyle(newValue, this.data.animated); + } + }, + animated: { + type: Boolean, + value: false, + observer: function observer(newValue) { + this._computedStyle(this.data.show, newValue); + } + }, + duration: { + type: Number, + value: 350 + }, + type: { + type: String, + value: 'dot-gray' + }, + tips: { + type: String, + value: '加载中' + } + }, + data: { + animationData: {}, + animationInstance: {}, + displayStyle: 'none' + }, + methods: { + _computedStyle: function _computedStyle(show, animated) { + if (!show) { + if (!animated) { + this.setData({ + displayStyle: 'none' + }); + } else { + this._startAnimation(); + } + } else { + this.setData({ + displayStyle: '' + }); + } + }, + _startAnimation: function _startAnimation() { + var _this = this; + + setTimeout(function () { + var data = _this.data; + var animation = data.animationInstance; + animation.height(0).step(); + _this.setData({ + animationData: animation.export() + }); + }, 0); + } + }, + lifetimes: { + attached: function attached() { + var data = this.data; + var animationInstance = wx.createAnimation({ + duration: data.duration, + timingFunction: 'ease' + }); + this.setData({ animationInstance: animationInstance }); + this._computedStyle(this.data.show, this.data.animated); + } + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/loading/loading.json b/miniprogram_npm/weui-miniprogram/loading/loading.json new file mode 100644 index 0000000..7e37c03 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/loading/loading.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/loading/loading.wxml b/miniprogram_npm/weui-miniprogram/loading/loading.wxml new file mode 100644 index 0000000..00b30ec --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/loading/loading.wxml @@ -0,0 +1,9 @@ + + + + + + + {{tips}} + + \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/loading/loading.wxss b/miniprogram_npm/weui-miniprogram/loading/loading.wxss new file mode 100644 index 0000000..f5aa149 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/loading/loading.wxss @@ -0,0 +1 @@ +.weui-loading{margin:0 5px;width:20px;height:20px;display:inline-block;vertical-align:middle;animation:weuiLoading 1s steps(12, end) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}.weui-loading.weui-loading_transparent{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")}@keyframes weuiLoading{0%{transform:rotate3d(0, 0, 1, 0deg)}100%{transform:rotate3d(0, 0, 1, 360deg)}}.weui-loadmore{width:65%;margin:1.5em auto;line-height:1.6em;font-size:14px;text-align:center}.weui-loadmore__tips{display:inline-block;vertical-align:middle}.weui-loadmore_line{border-top:1px solid rgba(0,0,0,0.1);margin-top:2.4em}.weui-loadmore__tips_in-line{position:relative;top:-0.9em;padding:0 .55em;background-color:#FFFFFF;color:rgba(0,0,0,0.5)}.weui-loadmore__tips_in-dot{position:relative;padding:0 .16em;width:4px;height:1.6em}.weui-loadmore__tips_in-dot:before{content:" ";position:absolute;top:50%;left:50%;margin-top:-1px;margin-left:-2px;width:4px;height:4px;border-radius:50%;background-color:rgba(0,0,0,0.1)}.wx_dot_loading,.wx_dot_loading:before,.wx_dot_loading:after{display:inline-block;vertical-align:middle;width:6px;height:6px;-webkit-border-radius:50%;border-radius:50%;background-color:rgba(0,0,0,0.3);font-size:0;animation:dot2 1.6s step-start infinite}.wx_dot_loading{position:relative}.wx_dot_loading:before{content:"";position:absolute;left:-12px;background-color:rgba(0,0,0,0.1);animation:dot1 1.6s step-start infinite}.wx_dot_loading:after{content:"";position:absolute;right:-12px;background-color:rgba(0,0,0,0.5);animation:dot3 1.6s step-start infinite}@keyframes dot1{0%,100%{background-color:rgba(0,0,0,0.1)}30%{background-color:rgba(0,0,0,0.5)}60%{background-color:rgba(0,0,0,0.3)}}@keyframes dot2{0%,100%{background-color:rgba(0,0,0,0.3)}30%{background-color:rgba(0,0,0,0.1)}60%{background-color:rgba(0,0,0,0.5)}}@keyframes dot3{0%,100%{background-color:rgba(0,0,0,0.5)}30%{background-color:rgba(0,0,0,0.3)}60%{background-color:rgba(0,0,0,0.1)}}.wx_dot_loading_white{background-color:rgba(255,255,255,0.3);animation:dotw2 1.6s step-start infinite}.wx_dot_loading_white:before{background-color:rgba(255,255,255,0.5);animation:dotw1 1.6s step-start infinite}.wx_dot_loading_white:after{background-color:rgba(255,255,255,0.1);animation:dotw3 1.6s step-start infinite}@keyframes dotw1{0%,100%{background-color:rgba(255,255,255,0.5)}30%{background-color:rgba(255,255,255,0.1)}60%{background-color:rgba(255,255,255,0.3)}}@keyframes dotw2{0%,100%{background-color:rgba(255,255,255,0.3)}30%{background-color:rgba(255,255,255,0.5)}60%{background-color:rgba(255,255,255,0.1)}}@keyframes dotw3{0%,100%{background-color:rgba(255,255,255,0.1)}30%{background-color:rgba(255,255,255,0.3)}60%{background-color:rgba(255,255,255,0.5)}}.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 diff --git a/miniprogram_npm/weui-miniprogram/msg/msg.js b/miniprogram_npm/weui-miniprogram/msg/msg.js new file mode 100644 index 0000000..6bc37ad --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/msg/msg.js @@ -0,0 +1,132 @@ +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 = 19); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 19: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Component({ + options: { + addGlobalClass: true, + multipleSlots: true + }, + properties: { + title: { + type: String, + value: '' + }, + type: { + type: String, + value: '' + }, + icon: { + type: String, + value: '' + }, + desc: { + type: String, + value: '' + }, + extClass: { + type: String, + value: '' + }, + size: { + type: Number, + value: 64 + } + }, + data: {} +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/msg/msg.json b/miniprogram_npm/weui-miniprogram/msg/msg.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/msg/msg.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/msg/msg.wxml b/miniprogram_npm/weui-miniprogram/msg/msg.wxml new file mode 100644 index 0000000..edc3148 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/msg/msg.wxml @@ -0,0 +1,24 @@ + + + + + + + {{title}} + + {{desc}} + + + + + + + + + + + + + + + diff --git a/miniprogram_npm/weui-miniprogram/msg/msg.wxss b/miniprogram_npm/weui-miniprogram/msg/msg.wxss new file mode 100644 index 0000000..4fc5590 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/msg/msg.wxss @@ -0,0 +1 @@ +.weui-msg{padding-top:36px;padding:calc(36px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(36px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);text-align:center;line-height:1.4;min-height:100%;box-sizing:border-box;display:flex;flex-direction:column;background-color:#FFFFFF}.weui-msg__link{color:#576B95;display:inline-block;vertical-align:baseline}.weui-msg__icon-area{margin-bottom:32px}.weui-msg__text-area{margin-bottom:32px;padding:0 32px;flex:1;line-height:1.6}.weui-msg__text-area:first-child{padding-top:96px}.weui-msg__title{margin-bottom:5px;font-weight:700;font-size:22px;word-wrap:break-word;word-break:break-all}.weui-msg__desc{font-size:17px;color:rgba(0,0,0,0.9);word-wrap:break-word;word-break:break-all;margin-bottom:16px}.weui-msg__desc-primary{font-size:14px;color:rgba(0,0,0,0.5);word-wrap:break-word;word-break:break-all;margin-bottom:16px}.weui-msg__opr-area{margin-bottom:16px}.weui-msg__opr-area .weui-btn-area{margin:0 16px}.weui-msg__opr-area .weui-btn+.weui-btn{margin-bottom:16px}.weui-msg__opr-area:last-child{margin-bottom:96px}.weui-msg__opr-area+.weui-msg__extra-area{margin-top:48px}.weui-msg__tips-area{margin-bottom:16px;padding:0 40px}.weui-msg__opr-area+.weui-msg__tips-area{margin-bottom:48px}.weui-msg__tips-area:last-child{margin-bottom:64px}.weui-msg__tips{font-size:12px;color:rgba(0,0,0,0.5)}.weui-msg__extra-area{position:static;margin-bottom:24px;font-size:12px;color:rgba(0,0,0,0.5)}.weui-msg__icon-area image{width:190rpx;height:190rpx} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/navigation-bar/navigation-bar.js b/miniprogram_npm/weui-miniprogram/navigation-bar/navigation-bar.js new file mode 100644 index 0000000..d975c8c --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/navigation-bar/navigation-bar.js @@ -0,0 +1,189 @@ +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 = 3); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 3: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Component({ + options: { + multipleSlots: true, + addGlobalClass: true + }, + properties: { + extClass: { + type: String, + value: '' + }, + title: { + type: String, + value: '' + }, + background: { + type: String, + value: '' + }, + color: { + type: String, + value: '' + }, + back: { + type: Boolean, + value: true + }, + loading: { + type: Boolean, + value: false + }, + animated: { + type: Boolean, + value: true + }, + show: { + type: Boolean, + value: true, + observer: '_showChange' + }, + delta: { + type: Number, + value: 1 + } + }, + data: { + displayStyle: '' + }, + attached: function attached() { + var _this = this; + + var isSupport = !!wx.getMenuButtonBoundingClientRect; + var rect = wx.getMenuButtonBoundingClientRect ? wx.getMenuButtonBoundingClientRect() : null; + wx.getSystemInfo({ + success: function success(res) { + var ios = !!(res.system.toLowerCase().search('ios') + 1); + _this.setData({ + ios: ios, + statusBarHeight: res.statusBarHeight, + innerWidth: isSupport ? 'width:' + rect.left + 'px' : '', + innerPaddingRight: isSupport ? 'padding-right:' + (res.windowWidth - rect.left) + 'px' : '', + leftWidth: isSupport ? 'width:' + (res.windowWidth - rect.left) + 'px' : '' + }); + } + }); + }, + + methods: { + _showChange: function _showChange(show) { + var animated = this.data.animated; + var displayStyle = ''; + if (animated) { + displayStyle = 'opacity: ' + (show ? '1' : '0') + ';-webkit-transition:opacity 0.5s;transition:opacity 0.5s;'; + } else { + displayStyle = 'display: ' + (show ? '' : 'none'); + } + this.setData({ + displayStyle: displayStyle + }); + }, + back: function back() { + var data = this.data; + if (data.delta) { + wx.navigateBack({ + delta: data.delta + }); + } + this.triggerEvent('back', { delta: data.delta }, {}); + } + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/navigation-bar/navigation-bar.json b/miniprogram_npm/weui-miniprogram/navigation-bar/navigation-bar.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/navigation-bar/navigation-bar.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/navigation-bar/navigation-bar.wxml b/miniprogram_npm/weui-miniprogram/navigation-bar/navigation-bar.wxml new file mode 100644 index 0000000..6a8e1cc --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/navigation-bar/navigation-bar.wxml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + {{title}} + + + + + + + + + + + diff --git a/miniprogram_npm/weui-miniprogram/navigation-bar/navigation-bar.wxss b/miniprogram_npm/weui-miniprogram/navigation-bar/navigation-bar.wxss new file mode 100644 index 0000000..c4f3460 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/navigation-bar/navigation-bar.wxss @@ -0,0 +1 @@ +page{--height:44px;--right:190rpx}.weui-navigation-bar{overflow:hidden}.weui-navigation-bar .android{--height:48px;--right:222rpx}.weui-navigation-bar__inner{position:fixed;top:0;left:0;z-index:5001;height:var(--height);display:flex;align-items:center;padding-right:var(--right);width:calc(100% - var(--right))}.weui-navigation-bar__inner .weui-navigation-bar__left{position:relative;width:var(--right);padding-left:16px;display:-webkit-box;display:-webkit-flex;display:flex;align-items:center;-webkit-box-pack:center}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn{display:inline-block;vertical-align:middle;background-repeat:no-repeat}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback{font-size:12px;width:1em;height:2em;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E");background-position:50% 50%;background-size:cover}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback:active{opacity:.5}.weui-navigation-bar__inner .weui-navigation-bar__center{font-size:17px;text-align:center;position:relative;flex:1;display:-webkit-box;display:-webkit-flex;display:flex;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-navigation-bar__inner .weui-navigation-bar__loading{font-size:0}.weui-navigation-bar__inner .weui-navigation-bar__loading .weui-loading{margin-left:0}.weui-navigation-bar__inner .weui-navigation-bar__right{margin-right:16px}.weui-navigation-bar__placeholder{height:var(--height);background:#F8F8F8;position:relative;z-index:50} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/package.json b/miniprogram_npm/weui-miniprogram/package.json new file mode 100644 index 0000000..f5e319b --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/package.json @@ -0,0 +1,7 @@ +{ + "name": "weui-miniprogram", + "version": "0.2.1", + "description": "", + "author": "xushengni,tomylin,cunjinli,rockhou", + "license": "MIT" +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/searchbar/searchbar.js b/miniprogram_npm/weui-miniprogram/searchbar/searchbar.js new file mode 100644 index 0000000..9602201 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/searchbar/searchbar.js @@ -0,0 +1,209 @@ +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 + }, + properties: { + extClass: { + type: String, + value: '' + }, + focus: { + type: Boolean, + value: false + }, + placeholder: { + type: String, + value: '搜索' + }, + value: { + type: String, + value: '' + }, + search: { + type: Function, + value: null + }, + throttle: { + type: Number, + value: 500 + }, + cancelText: { + type: String, + value: '取消' + }, + cancel: { + type: Boolean, + value: true + } + }, + data: { + result: [] + }, + lastSearch: Date.now(), + lifetimes: { + attached: function attached() { + if (this.data.focus) { + this.setData({ + searchState: true + }); + } + } + }, + methods: { + clearInput: function clearInput() { + this.setData({ + value: '' + }); + this.triggerEvent('clear'); + }, + inputFocus: function inputFocus(e) { + this.triggerEvent('focus', e.detail); + }, + inputBlur: function inputBlur(e) { + this.setData({ + focus: false + }); + this.triggerEvent('blur', e.detail); + }, + showInput: function showInput() { + this.setData({ + focus: true, + searchState: true + }); + }, + hideInput: function hideInput() { + this.setData({ + searchState: false + }); + }, + inputChange: function inputChange(e) { + var _this = this; + + this.setData({ + value: e.detail.value + }); + this.triggerEvent('input', e.detail); + if (Date.now() - this.lastSearch < this.data.throttle) { + return; + } + if (typeof this.data.search !== 'function') { + return; + } + this.lastSearch = Date.now(); + this.timerId = setTimeout(function () { + _this.data.search(e.detail.value).then(function (json) { + _this.setData({ + result: json + }); + }).catch(function (err) { + console.log('search error', err); + }); + }, this.data.throttle); + }, + selectResult: function selectResult(e) { + var index = e.currentTarget.dataset.index; + + var item = this.data.result[index]; + this.triggerEvent('selectresult', { index: index, item: item }); + } + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/searchbar/searchbar.json b/miniprogram_npm/weui-miniprogram/searchbar/searchbar.json new file mode 100644 index 0000000..67ee694 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/searchbar/searchbar.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "mp-cells": "../cells/cells", + "mp-cell": "../cell/cell" + } +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/searchbar/searchbar.wxml b/miniprogram_npm/weui-miniprogram/searchbar/searchbar.wxml new file mode 100644 index 0000000..b7c3ee4 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/searchbar/searchbar.wxml @@ -0,0 +1,21 @@ + + + + + + + + + + + + {{cancelText}} + + + + {{item.text}} + + \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/searchbar/searchbar.wxss b/miniprogram_npm/weui-miniprogram/searchbar/searchbar.wxss new file mode 100644 index 0000000..a50b28e --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/searchbar/searchbar.wxss @@ -0,0 +1 @@ +.weui-search-bar{position:relative;padding:8px;display:flex;box-sizing:border-box;background-color:#EDEDED;-webkit-text-size-adjust:100%;align-items:center}.weui-icon-search{margin-right:8px;font-size:14px;vertical-align:top;margin-top:.64em;height:1em;line-height:1em}.weui-icon-search_in-box{position:absolute;left:12px;top:50%;margin-top:-8px}.weui-search-bar__text{display:inline-block;font-size:14px;vertical-align:top}.weui-search-bar__form{position:relative;flex:auto;border-radius:4px;background:#FFFFFF}.weui-search-bar__box{position:relative;padding-left:32px;padding-right:32px;width:100%;box-sizing:border-box;z-index:1}.weui-search-bar__input{height:32px;line-height:32px;font-size:14px;caret-color:#07C160}.weui-icon-clear{position:absolute;top:0;right:0;bottom:0;padding:0 12px;font-size:0}.weui-icon-clear:after{content:"";height:100%;vertical-align:middle;display:inline-block;width:0;overflow:hidden}.weui-search-bar__label{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;border-radius:4px;text-align:center;color:rgba(0,0,0,0.5);background:#FFFFFF;line-height:32px}.weui-search-bar__cancel-btn{margin-left:8px;line-height:32px;color:#576B95;white-space:nowrap} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/slideview/slideview.js b/miniprogram_npm/weui-miniprogram/slideview/slideview.js new file mode 100644 index 0000000..50b239e --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/slideview/slideview.js @@ -0,0 +1,205 @@ +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 = 18); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 18: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Component({ + options: { + addGlobalClass: true, + multipleSlots: true + }, + properties: { + extClass: { + type: String, + value: '' + }, + buttons: { + type: Array, + value: [], + observer: function observer(newVal) { + this.addClassNameForButton(); + } + }, + disable: { + type: Boolean, + value: false + }, + icon: { + type: Boolean, + value: false + }, + show: { + type: Boolean, + value: false + }, + duration: { + type: Number, + value: 350 + }, + throttle: { + type: Number, + value: 40 + }, + rebounce: { + type: Number, + value: 0 + } + }, + data: { + size: null + }, + ready: function ready() { + this.updateRight(); + this.addClassNameForButton(); + }, + + methods: { + updateRight: function updateRight() { + var _this = this; + + var data = this.data; + var query = wx.createSelectorQuery().in(this); + query.select('.left').boundingClientRect(function (res) { + console.log('right res', res); + var btnQuery = wx.createSelectorQuery().in(_this); + btnQuery.selectAll('.btn').boundingClientRect(function (rects) { + console.log('btn rects', rects); + _this.setData({ + size: { + buttons: rects, + button: res, + show: data.show, + disable: data.disable, + throttle: data.throttle, + rebounce: data.rebounce + } + }); + }).exec(); + }).exec(); + }, + addClassNameForButton: function addClassNameForButton() { + var _data = this.data, + buttons = _data.buttons, + icon = _data.icon; + + buttons.forEach(function (btn) { + if (icon) { + btn.className = ''; + } else if (btn.type === 'warn') { + btn.className = 'weui-slideview__btn-group_warn'; + } else { + btn.className = 'weui-slideview__btn-group_default'; + } + }); + this.setData({ + buttons: buttons + }); + }, + buttonTapByWxs: function buttonTapByWxs(data) { + this.triggerEvent('buttontap', data, {}); + }, + hide: function hide() { + this.triggerEvent('hide', {}, {}); + }, + show: function show() { + this.triggerEvent('show', {}, {}); + }, + transitionEnd: function transitionEnd() { + console.log('transitiion end'); + } + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/slideview/slideview.json b/miniprogram_npm/weui-miniprogram/slideview/slideview.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/slideview/slideview.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/slideview/slideview.wxml b/miniprogram_npm/weui-miniprogram/slideview/slideview.wxml new file mode 100644 index 0000000..f906edf --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/slideview/slideview.wxml @@ -0,0 +1,23 @@ + + + + + + + + + + + {{item.text}} + + + + + + diff --git a/miniprogram_npm/weui-miniprogram/slideview/slideview.wxs b/miniprogram_npm/weui-miniprogram/slideview/slideview.wxs new file mode 100644 index 0000000..c62d085 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/slideview/slideview.wxs @@ -0,0 +1,243 @@ +/* eslint-disable */ +var touchstart = function(event, ownerInstance) { + var ins = event.instance + var st = ins.getState() + if (st.disable) return // disable的逻辑 + // console.log('touchstart st', JSON.stringify(st)) + if (!st.size) return + // console.log('touchstart', JSON.stringify(event)) + st.isMoving = true + st.startX = event.touches[0].pageX + st.startY = event.touches[0].pageY + st.firstAngle = 0 +} +var touchmove = function(event, ownerInstance) { + var ins = event.instance + var st = ins.getState() + if (!st.size || !st.isMoving) return + // console.log('touchmove', JSON.stringify(event)) + var pagex = event.touches[0].pageX - st.startX + var pagey = event.touches[0].pageY - st.startY + // 左侧45度角为界限,大于45度则允许水平滑动 + if (st.firstAngle === 0) { + st.firstAngle = Math.abs(pagex) - Math.abs(pagey) + } + if (st.firstAngle < 0) { + return + } + var movex = pagex > 0 ? Math.min(st.max, pagex) : Math.max(-st.max, pagex) + // 往回滑动的情况 + if (st.out) { + // 已经是划出来了,还要往左滑动,忽略 + if (movex < 0) return + ins.setStyle({ + 'transform': 'translateX(' + (st.transformx + movex) + 'px)', + 'transition': '' + }) + var btns = ownerInstance.selectAllComponents('.btn') + var transformTotal = 0 + var len = btns.length + var i = len - 1; + for (;i >= 0; i--) { + var transform = st.size.buttons[i].width / st.max * movex + var transformx = st.size.buttons[i].max - Math.min(st.size.buttons[i].max, transform + transformTotal) + btns[i].setStyle({ + 'transform': 'translateX(' + (-transformx) + 'px)', + 'transition': '' + }) + transformTotal += transform + } + return false + } + if (movex > 0) movex = 0 + ins.setStyle({ + 'transform': 'translateX(' + movex + 'px)', + 'transition': '' + }) + st.transformx = movex + var btns = ownerInstance.selectAllComponents('.btn') + var transformTotal = 0 + var len = btns.length + var i = len - 1; + for (;i >= 0; i--) { + var transform = st.size.buttons[i].width / st.max * movex + var transformx = Math.max(-st.size.buttons[i].max, transform + transformTotal) + btns[i].setStyle({ + 'transform': 'translateX(' + transformx + 'px)', + 'transition': '' + }) + st.size.buttons[i].transformx = transformx + transformTotal += transform + } + return false // 禁止垂直方向的滑动 +} +var touchend = function(event, ownerInstance) { + var ins = event.instance + var st = ins.getState() + if (!st.size || !st.isMoving) return + // 左侧45度角为界限,大于45度则允许水平滑动 + if (st.firstAngle < 0) { + return + } + var duration = st.duration / 1000 + st.isMoving = false + // console.log('touchend', JSON.stringify(event)) + var btns = ownerInstance.selectAllComponents('.btn') + var len = btns.length + var i = len - 1 + // console.log('len size', len) + if (Math.abs(event.changedTouches[0].pageX - st.startX) < st.throttle || event.changedTouches[0].pageX - st.startX > 0) { // 方向也要控制 + st.out = false + ins.setStyle({ + 'transform': 'translate3d(0px, 0, 0)', + 'transition': 'transform ' + (duration) + 's' + }) + for (;i >= 0; i--) { + btns[i].setStyle({ + 'transform': 'translate3d(0px, 0, 0)', + 'transition': 'transform ' + (duration) + 's' + }) + } + ownerInstance.callMethod('hide') + return + } + showButtons(ins, ownerInstance, duration) + ownerInstance.callMethod('show') +} +var REBOUNCE_TIME = 0.2 +var showButtons = function(ins, ownerInstance, withDuration) { + var st = ins.getState() + if (!st.size) return + var rebounceTime = st.rebounce ? REBOUNCE_TIME : 0 + var movex = st.max + st.out = true + var btns = ownerInstance.selectAllComponents('.btn') + var rebounce = st.rebounce || 0 + var len = btns.length + var i = len - 1 + ins.setStyle({ + 'transform': 'translate3d(' + (-movex - rebounce) + 'px, 0, 0)', + 'transition': 'transform ' + (withDuration) + 's' + }) + st.transformx = -movex + var transformTotal = 0 + for (;i >= 0; i--) { + var transform = st.size.buttons[i].width / st.max * movex + var transformx = (-(transform + transformTotal)) + btns[i].setStyle({ + 'transform': 'translate3d(' + transformx + 'px, 0, 0)', + 'transition': 'transform ' + (withDuration ? withDuration + rebounceTime : withDuration) + 's' + }) + st.size.buttons[i].transformx = transformx + transformTotal += transform + } +} +var innerHideButton = function(ownerInstance) { + var ins = ownerInstance.selectComponent('.left') + var st = ins.getState() + if (!st.size) return + var duration = st.duration ? st.duration / 1000 : 0 + var btns = ownerInstance.selectAllComponents('.btn') + var len = btns.length + var i = len - 1 + ins.setStyle({ + 'transform': 'translate3d(0px, 0, 0)', + 'transition': 'transform ' + (duration) + 's' + }) + st.transformx = 0 + for (;i >= 0; i--) { + btns[i].setStyle({ + 'transform': 'translate3d(0px, 0, 0)', + 'transition': 'transform ' + (duration) + 's' + }) + st.size.buttons[i].transformx = 0 + } +} +var hideButton = function(event, ownerInstance) { + innerHideButton(ownerInstance) + ownerInstance.callMethod('buttonTapByWxs', {index: event.currentTarget.dataset.index, data: event.currentTarget.dataset.data}) + return false +} +var sizeReady = function(newVal, oldVal, ownerInstance, ins) { + var st = ins.getState() + // st.disable = newVal && newVal.disable + if (newVal && newVal.button && newVal.buttons) { + st.size = newVal + st.transformx = 0 + // var min = newVal.button.width + var max = 0 + var len = newVal.buttons.length + var i = newVal.buttons.length - 1; + var total = 0 + for (; i >= 0; i--) { + max += newVal.buttons[i].width + // if (min > newVal.buttons[i]) { + // min = newVal.buttons[i].width + // } + total += newVal.buttons[i].width + newVal.buttons[i].max = total + newVal.buttons[i].transformx = 0 + } + st.throttle = st.size.throttle || 40 // 固定值 + st.rebounce = st.size.rebounce + st.max = max + ownerInstance.selectComponent('.right').setStyle({ + 'line-height': newVal.button.height + 'px', + left: (newVal.button.width) + 'px', + width: max + 'px' + }) + // console.log('st size', JSON.stringify(newVal)) + if (!st.size.disable && st.size.show) { + showButtons(ins, ownerInstance) + } + } +} +var disableChange = function(newVal, oldVal, ownerInstance, ins) { + var st = ins.getState() + st.disable = newVal +} +var durationChange = function(newVal, oldVal, ownerInstance, ins) { + var st = ins.getState() + st.duration = newVal || 400 +} +var showChange = function(newVal, oldVal, ownerInstance, ins) { + var st = ins.getState() + st.show = newVal + if (st.disable) return + // console.log('show change') + if (st.show) { + showButtons(ins, ownerInstance, st.duration) + } else { + innerHideButton(ownerInstance) + } +} +var rebounceChange = function(newVal, oldVal, ownerInstance, ins) { + var st = ins.getState() + // console.log('rebounce', st.rebounce) + st.rebounce = newVal +} +var transitionEnd = function(event, ownerInstance) { + // console.log('transition') + var ins = event.instance + var st = ins.getState() + // 回弹效果 + if (st.out && st.rebounce) { + console.log('transition rebounce', st.rebounce) + ins.setStyle({ + 'transform': 'translate3d(' + (-st.max) + 'px, 0, 0)', + 'transition': 'transform ' + REBOUNCE_TIME +'s' + }) + } +} +module.exports = { + touchstart: touchstart, + touchmove: touchmove, + touchend: touchend, + hideButton: hideButton, + sizeReady: sizeReady, + disableChange: disableChange, + durationChange: durationChange, + showChange: showChange, + rebounceChange: rebounceChange, + transitionEnd: transitionEnd +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/slideview/slideview.wxss b/miniprogram_npm/weui-miniprogram/slideview/slideview.wxss new file mode 100644 index 0000000..0129c65 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/slideview/slideview.wxss @@ -0,0 +1 @@ +:host{width:100%}.weui-slideview{overflow:hidden;position:relative}.weui-slideview{position:relative}.weui-slideview__left{position:relative;z-index:10}.weui-slideview__right{position:absolute;z-index:1;left:100%;top:0;height:100%}.weui-slideview__btn__wrp{position:absolute;left:0;bottom:0;text-align:center;min-width:69px;height:100%;white-space:nowrap}.weui-slideview__btn{color:#FFFFFF;padding:0 17px}.weui-slideview__btn-group_default .weui-slideview__btn{background:#C7C7CC}.weui-slideview__btn-group_default~.weui-slideview__btn-group_default:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #FFFFFF;color:#FFFFFF}.weui-slideview__btn-group_default:first-child:before{display:none}.weui-slideview__btn-group_warn .weui-slideview__btn{background:#FE3B30}.weui-slideview__btn-group_warn~.weui-slideview__btn-group_warn:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #FFFFFF;color:#FFFFFF}.weui-slideview__btn-group_warn:first-child:before{display:none}.weui-slideview_icon .weui-slideview__btn__wrp{background:transparent;font-size:0}.weui-slideview_icon .weui-slideview__btn__wrp:after{content:"";width:0;height:100%;vertical-align:middle;display:inline-block}.weui-slideview_icon .weui-slideview__btn__wrp:first-child{padding-left:16px}.weui-slideview_icon .weui-slideview__btn__wrp:last-child{padding-right:8px}.weui-slideview_icon .weui-slideview__btn{width:48px;height:48px;line-height:48px;padding:0;display:inline-block;vertical-align:middle;border-radius:50%;background-color:#FFFFFF}.weui-slideview_icon .weui-slideview__btn__icon{display:inline-block;vertical-align:middle;width:22px;height:22px} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/static/icon/s-arrow-back.png b/miniprogram_npm/weui-miniprogram/static/icon/s-arrow-back.png new file mode 100644 index 0000000..720481d Binary files /dev/null and b/miniprogram_npm/weui-miniprogram/static/icon/s-arrow-back.png differ diff --git a/miniprogram_npm/weui-miniprogram/static/icon/s-arrow-back.svg b/miniprogram_npm/weui-miniprogram/static/icon/s-arrow-back.svg new file mode 100644 index 0000000..ac849c0 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/static/icon/s-arrow-back.svg @@ -0,0 +1,20 @@ + + + + Icons/Filled/arrow Copy 2 + Created with Sketch. + + + + + + + + + + + + + + + diff --git a/miniprogram_npm/weui-miniprogram/tabbar/tabbar.js b/miniprogram_npm/weui-miniprogram/tabbar/tabbar.js new file mode 100644 index 0000000..e21c3aa --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/tabbar/tabbar.js @@ -0,0 +1,131 @@ +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 = 16); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 16: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Component({ + options: { + addGlobalClass: true + }, + properties: { + extClass: { + type: String, + value: '' + }, + list: { + type: Array, + value: [] + }, + current: { + type: Number, + value: 0 + } + }, + methods: { + tabChange: function tabChange(e) { + var index = e.currentTarget.dataset.index; + + if (index === this.data.current) { + return; + } + this.setData({ + current: index + }); + this.triggerEvent('change', { index: index, item: this.data.list[index] }); + } + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/tabbar/tabbar.json b/miniprogram_npm/weui-miniprogram/tabbar/tabbar.json new file mode 100644 index 0000000..e083792 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/tabbar/tabbar.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "mp-badge": "../badge/badge" + } +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/tabbar/tabbar.wxml b/miniprogram_npm/weui-miniprogram/tabbar/tabbar.wxml new file mode 100644 index 0000000..49ff2d9 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/tabbar/tabbar.wxml @@ -0,0 +1,10 @@ + + + + + + + + {{item.text}} + + \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/tabbar/tabbar.wxss b/miniprogram_npm/weui-miniprogram/tabbar/tabbar.wxss new file mode 100644 index 0000000..bccaad7 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/tabbar/tabbar.wxss @@ -0,0 +1 @@ +.weui-tabbar{display:flex;position:relative;z-index:500;background-color:#F7F7F7}.weui-tabbar:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-tabbar__item{display:block;flex:1;padding:8px 0 4px;padding-bottom:calc(8px + constant(safe-area-inset-bottom));padding-bottom:calc(8px + env(safe-area-inset-bottom));font-size:0;color:rgba(0,0,0,0.5);text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-tabbar__item:first-child{padding-left:constant(safe-area-inset-left);padding-left:env(safe-area-inset-left)}.weui-tabbar__item:last-child{padding-right:constant(safe-area-inset-right);padding-right:env(safe-area-inset-right)}.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{color:#07C160}.weui-tabbar__icon{display:inline-block;width:28px;height:28px;margin-bottom:2px}i.weui-tabbar__icon,.weui-tabbar__icon>i{font-size:24px;color:rgba(0,0,0,0.5)}.weui-tabbar__icon image{width:100%;height:100%}.weui-tabbar__label{color:rgba(0,0,0,0.9);font-size:10px;line-height:1.4} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/toptips/toptips.js b/miniprogram_npm/weui-miniprogram/toptips/toptips.js new file mode 100644 index 0000000..34513a5 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/toptips/toptips.js @@ -0,0 +1,170 @@ +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 = 13); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 13: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Component({ + options: { + addGlobalClass: true + }, + properties: { + type: { + type: String, + value: 'error', + observer: '_typeChange' + }, + show: { + type: Boolean, + value: false, + observer: '_showChange' + }, + msg: { + type: String, + value: '' + }, + delay: { + type: Number, + value: 2000 + }, + extClass: { + type: String, + value: '' + } + }, + data: { + typeClassMap: { + 'warn': 'weui-toptips_warn', + 'info': 'weui-toptips_info', + 'success': 'weui-toptips_success', + 'error': 'weui-toptips_error' + } + }, + attached: function attached() { + var data = this.data; + this.setData({ + className: data.typeClassMap[data.type] || '' + }); + }, + + methods: { + _typeChange: function _typeChange(newVal) { + this.setData({ + className: this.data.typeClassMap[newVal] || '' + }); + return newVal; + }, + _showChange: function _showChange(newVal) { + this._showToptips(newVal); + }, + _showToptips: function _showToptips(newVal) { + var _this = this; + + if (newVal && this.data.delay) { + setTimeout(function () { + _this.setData({ + show: false + }, function () { + _this.triggerEvent('hide', {}, {}); + }); + }, this.data.delay); + } + this.setData({ + show: newVal + }); + } + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/toptips/toptips.json b/miniprogram_npm/weui-miniprogram/toptips/toptips.json new file mode 100644 index 0000000..7e37c03 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/toptips/toptips.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/toptips/toptips.wxml b/miniprogram_npm/weui-miniprogram/toptips/toptips.wxml new file mode 100644 index 0000000..61a337c --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/toptips/toptips.wxml @@ -0,0 +1,6 @@ + + {{msg}} + + + + \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/toptips/toptips.wxss b/miniprogram_npm/weui-miniprogram/toptips/toptips.wxss new file mode 100644 index 0000000..a904311 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/toptips/toptips.wxss @@ -0,0 +1 @@ +.weui-toptips{position:fixed;-webkit-transform:translateZ(0) translateY(calc(-100% - 8px));transform:translateZ(0) translateY(calc(-100% - 8px));text-align:center;top:8px;left:16px;right:16px;border-radius:4px;padding:8px;-webkit-border-radius:4px;color:rgba(255,255,255,0.9);font-size:17px;line-height:1.4;background:rgba(250,81,81,0.9);z-index:5000;word-wrap:break-word;word-break:break-all;-webkit-transition:all .4s ease-in-out;transition:all .4s ease-in-out}.weui-toptips_show{-webkit-transform:translateZ(0) translateY(0);transform:translateZ(0) translateY(0);opacity:1}.weui-toptips_warn{background-color:#FA5151}.weui-toptips_success{background-color:#09BB07}.weui-toptips_error{background-color:#FA5151}.weui-toptips_info{background-color:#10AEFF} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/uploader/uploader.js b/miniprogram_npm/weui-miniprogram/uploader/uploader.js new file mode 100644 index 0000000..13e0014 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/uploader/uploader.js @@ -0,0 +1,261 @@ +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 = 22); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 22: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Component({ + options: { + addGlobalClass: true + }, + properties: { + title: { + type: String, + value: '图片上传' + }, + sizeType: { + type: Array, + value: ['original', 'compressed'] + }, + sourceType: { + type: Array, + value: ['album', 'camera'] + }, + maxSize: { + type: Number, + value: 5 * 1024 * 1024 + }, + maxCount: { + type: Number, + value: 1 + }, + files: { + type: Array, + value: [], + observer: function observer(newVal, oldVal, changedP) { + this.setData({ + currentFiles: newVal + }); + } + }, + select: { + type: Function, + value: function value() {} + }, + upload: { + type: Function, + value: null + }, + tips: { + type: String, + value: '' + }, + extClass: { + type: String, + value: '' + }, + showDelete: { + type: Boolean, + value: true + } + }, + data: { + currentFiles: [], + showPreview: false, + previewImageUrls: [] + }, + ready: function ready() {}, + + methods: { + previewImage: function previewImage(e) { + var index = e.currentTarget.dataset.index; + + var previewImageUrls = []; + this.data.files.map(function (item) { + previewImageUrls.push(item.url); + }); + this.setData({ + previewImageUrls: previewImageUrls, + previewCurrent: index, + showPreview: true + }); + }, + chooseImage: function chooseImage(e) { + var _this = this; + + if (this.uploading) return; + wx.chooseImage({ + count: this.data.maxCount - this.data.files.length, + success: function success(res) { + var invalidIndex = -1; + res.tempFiles.forEach(function (item, index) { + if (item.size > _this.data.maxSize) { + invalidIndex = index; + } + }); + if (typeof _this.data.select === 'function') { + var ret = _this.data.select(res); + if (ret === false) { + return; + } + } + if (invalidIndex >= 0) { + _this.triggerEvent('fail', { type: 1, errMsg: 'chooseImage:fail size exceed ' + _this.data.maxSize, total: res.tempFilePaths.length, index: invalidIndex }, {}); + return; + } + var mgr = wx.getFileSystemManager(); + var contents = res.tempFilePaths.map(function (item) { + var fileContent = mgr.readFileSync(item); + return fileContent; + }); + var obj = { tempFilePaths: res.tempFilePaths, tempFiles: res.tempFiles, contents: contents }; + _this.triggerEvent('select', obj, {}); + var files = res.tempFilePaths.map(function (item, i) { + return { loading: true, url: 'data:image/jpg;base64,' + wx.arrayBufferToBase64(contents[i]) }; + }); + if (!files || !files.length) return; + if (typeof _this.data.upload === 'function') { + var len = _this.data.files.length; + var newFiles = _this.data.files.concat(files); + _this.setData({ files: newFiles, currentFiles: newFiles }); + _this.loading = true; + _this.data.upload(obj).then(function (json) { + _this.loading = false; + if (json.urls) { + var oldFiles = _this.data.files; + json.urls.forEach(function (url, index) { + oldFiles[len + index].url = url; + oldFiles[len + index].loading = false; + }); + _this.setData({ files: oldFiles, currentFiles: newFiles }); + _this.triggerEvent('success', json, {}); + } else { + _this.triggerEvent('fail', { type: 3, errMsg: 'upload file fail, urls not found' }, {}); + } + }).catch(function (err) { + _this.loading = false; + var oldFiles = _this.data.files; + res.tempFilePaths.map(function (item, index) { + oldFiles[len + index].error = true; + oldFiles[len + index].loading = false; + }); + _this.setData({ files: oldFiles, currentFiles: newFiles }); + _this.triggerEvent('fail', { type: 3, errMsg: 'upload file fail', error: err }, {}); + }); + } + }, + fail: function fail(_fail) { + if (_fail.errMsg.indexOf('chooseImage:fail cancel') >= 0) { + _this.triggerEvent('cancel', {}, {}); + return; + } + _fail.type = 2; + _this.triggerEvent('fail', _fail, {}); + } + }); + }, + deletePic: function deletePic(e) { + var index = e.detail.index; + var files = this.data.files; + var file = files.splice(index, 1); + this.setData({ + files: files, + currentFiles: files + }); + this.triggerEvent('delete', { index: index, item: file[0] }); + } + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/uploader/uploader.json b/miniprogram_npm/weui-miniprogram/uploader/uploader.json new file mode 100644 index 0000000..e3479ce --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/uploader/uploader.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "mp-gallery": "../gallery/gallery" + } +} diff --git a/miniprogram_npm/weui-miniprogram/uploader/uploader.wxml b/miniprogram_npm/weui-miniprogram/uploader/uploader.wxml new file mode 100644 index 0000000..9828c8d --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/uploader/uploader.wxml @@ -0,0 +1,36 @@ + + +
+ {{title}} + {{currentFiles.length}}/{{maxCount}} + +
+ {{tips}} + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ diff --git a/miniprogram_npm/weui-miniprogram/uploader/uploader.wxss b/miniprogram_npm/weui-miniprogram/uploader/uploader.wxss new file mode 100644 index 0000000..1e3dad9 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/uploader/uploader.wxss @@ -0,0 +1 @@ +.weui-uploader{flex:1}.weui-uploader__hd{padding-bottom:16px}.weui-uploader__overview{display:flex;align-items:center}.weui-uploader__title{flex:1}.weui-uploader__tips{color:rgba(0,0,0,0.3);font-size:14px;line-height:1.4;padding-top:4px}.weui-uploader__info{color:rgba(0,0,0,0.3)}.weui-uploader__bd{margin-bottom:-8px;margin-right:-8px;overflow:hidden}.weui-uploader__file{float:left;margin-right:8px;margin-bottom:8px}.weui-uploader__img{display:block;width:96px;height:96px}.weui-uploader__file_status{position:relative}.weui-uploader__file_status:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,0.5)}.weui-uploader__file-content{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);color:#FFFFFF}.weui-uploader__input-box{float:left;position:relative;margin-right:8px;margin-bottom:8px;width:96px;height:96px;box-sizing:border-box;background-color:#EDEDED}.weui-uploader__input-box:before,.weui-uploader__input-box:after{content:" ";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);background-color:#A3A3A3}.weui-uploader__input-box:before{width:2px;height:32px}.weui-uploader__input-box:after{width:32px;height:2px}.weui-uploader__input-box:active{border-color:#8b8b8b}.weui-uploader__input-box:active:before,.weui-uploader__input-box:active:after{background-color:#8b8b8b}.weui-uploader__input{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0}.weui-loading{margin:0 5px;width:20px;height:20px;display:inline-block;vertical-align:middle;animation:weuiLoading 1s steps(12, end) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}.weui-loading.weui-loading_transparent{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")}@keyframes weuiLoading{0%{transform:rotate3d(0, 0, 1, 0deg)}100%{transform:rotate3d(0, 0, 1, 360deg)}} \ No newline at end of file diff --git a/miniprogram_npm/weui-miniprogram/weui-wxss/dist/style/weui.wxss b/miniprogram_npm/weui-miniprogram/weui-wxss/dist/style/weui.wxss new file mode 100644 index 0000000..0f09085 --- /dev/null +++ b/miniprogram_npm/weui-miniprogram/weui-wxss/dist/style/weui.wxss @@ -0,0 +1,6 @@ +/*! + * WeUI v2.0.1 (https://github.com/weui/weui-wxss) + * Copyright 2019 Tencent, Inc. + * Licensed under the MIT license + */ +page{line-height:1.6;font-family:-apple-system-font,Helvetica Neue,sans-serif}icon{vertical-align:middle}.weui-cells{position:relative;margin-top:8px;background-color:#fff;line-height:1.41176471;font-size:17px}.weui-cells:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-cells:after,.weui-cells:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-cells:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-cells__title{margin-top:16px;margin-bottom:3px;padding-left:16px;padding-right:16px;color:rgba(0,0,0,.5);font-size:14px}.weui-cells_after-title{margin-top:0}.weui-cells__tips{margin-top:3px;color:rgba(0,0,0,.5);padding-left:16px;padding-right:16px;font-size:14px}.weui-cell{padding:16px;position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.weui-cell:first-child:before{display:none}.weui-cell_active{background-color:#ececec}.weui-cell_primary{-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start}.weui-cell__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-cell__ft{text-align:right;color:rgba(0,0,0,.5)}.weui-cell_label-block,.weui-cell_wxss.weui-cell_wxss:before{display:block}.weui-cell_label-block .weui-label{width:auto;word-break:normal;-webkit-hyphens:auto;hyphens:auto}.weui-cell_access{color:inherit;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-cell__ft_in-access{padding-right:16px;position:relative}.weui-cell__ft_in-access:after{content:" ";display:inline-block;height:8px;width:8px;border-width:2px 2px 0 0;border-color:#b2b2b2;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;margin-top:-5px;right:0}.weui-cell_link{color:#576b95;font-size:17px}.weui-cell_link:active{background-color:#ececec}.weui-cell_link:first-child:before{display:block}.weui-cells_checkbox .weui-check__label:before{left:55px}.weui-check__label:active{background-color:#ececec}.weui-check{position:absolute;left:-9999px}.weui-check__hd_in-checkbox{padding-right:16px}.weui-cell__ft_in-radio{padding-left:16px}.weui-cell_input{padding-top:0;padding-bottom:0}.weui-label{width:105px;word-wrap:break-word;word-break:break-all}.weui-input{height:1.41176471em;min-height:1.41176471em;line-height:1.41176471}.weui-textarea{display:block;width:100%}.weui-textarea-counter{color:rgba(0,0,0,.3);text-align:right}.weui-cell_warn,.weui-textarea-counter_warn{color:#fa5151}.weui-form-preview{position:relative;background-color:#fff}.weui-form-preview:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-form-preview:after,.weui-form-preview:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-form-preview:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-form-preview__value{font-size:14px}.weui-form-preview__value_in-hd{font-size:26px}.weui-form-preview__hd{position:relative;padding:16px;text-align:right;line-height:2.5em}.weui-form-preview__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.weui-form-preview__bd{padding:16px;font-size:.9em;text-align:right;color:rgba(0,0,0,.5);line-height:2}.weui-form-preview__ft{position:relative;line-height:56px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-form-preview__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-form-preview__item{overflow:hidden}.weui-form-preview__label{float:left;margin-right:1em;min-width:4em;color:rgba(0,0,0,.5);text-align:justify;text-align-last:justify}.weui-form-preview__value{display:block;overflow:hidden;word-break:normal;word-wrap:break-word}.weui-form-preview__btn{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#576b95;text-align:center;font-weight:700;font-size:17px}.weui-form-preview__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-form-preview__btn:first-child:after{display:none}.weui-form-preview__btn_active{background-color:#ececec}.weui-form-preview__btn_default{color:rgba(0,0,0,.9)}.weui-form-preview__btn_primary{color:#576b95}.weui-cell_select{padding:0;overflow:hidden}.weui-cell_select .weui-select{padding-right:30px}.weui-cell_select .weui-cell__bd:after{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:rgba(0,0,0,.3);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");position:absolute;top:50%;right:16px;margin-top:-12px}.weui-select{-webkit-appearance:none;border:0;outline:0;background-color:transparent;width:100%;font-size:inherit;height:56px;line-height:56px;position:relative;z-index:1;padding-left:16px}.weui-cell_select-before{padding-right:16px}.weui-cell_select-before .weui-select{width:105px;box-sizing:border-box}.weui-cell_select-before .weui-cell__hd{position:relative}.weui-cell_select-before .weui-cell__hd:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-cell_select-before .weui-cell__hd:before{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:rgba(0,0,0,.3);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");position:absolute;top:50%;right:16px;margin-top:-12px}.weui-cell_select-before .weui-cell__bd{padding-left:16px}.weui-cell_select-before .weui-cell__bd:after{display:none}.weui-cell_select-before.weui-cell_access .weui-cell__hd{line-height:56px;padding-left:32px}.weui-cell_select-after{padding-left:16px}.weui-cell_select-after .weui-select{padding-left:0}.weui-cell_select-after.weui-cell_access .weui-cell__bd{line-height:56px}.weui-cell_vcode{padding-top:0;padding-right:0;padding-bottom:0}.weui-vcode-btn,.weui-vcode-img{margin-left:5px;height:3.29411765em;vertical-align:middle}.weui-vcode-btn{display:inline-block;padding:0 .6em 0 .7em;border-left:1rpx solid rgba(0,0,0,.1);line-height:3.29411765em;font-size:17px;color:#576b95;white-space:nowrap}button.weui-vcode-btn{min-height:0;background-color:transparent;border:0;outline:0}.weui-vcode-btn:active{color:#767676}.weui-cell_switch{padding-top:12px;padding-bottom:12px}.weui-uploader{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__hd{padding-bottom:16px}.weui-uploader__overview{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-uploader__title{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__tips{color:rgba(0,0,0,.3);font-size:14px;line-height:1.4;padding-top:4px}.weui-uploader__info{color:rgba(0,0,0,.3)}.weui-uploader__bd{margin-bottom:-8px;margin-right:-8px;overflow:hidden}.weui-uploader__file{float:left;margin-right:8px;margin-bottom:8px}.weui-uploader__img{display:block;width:96px;height:96px}.weui-uploader__file_status{position:relative}.weui-uploader__file_status:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.5)}.weui-uploader__file-content{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#fff}.weui-uploader__input-box{float:left;position:relative;margin-right:8px;margin-bottom:8px;width:96px;height:96px;box-sizing:border-box;background-color:#ededed}.weui-uploader__input-box:after,.weui-uploader__input-box:before{content:" ";position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#a3a3a3}.weui-uploader__input-box:before{width:2px;height:32px}.weui-uploader__input-box:after{width:32px;height:2px}.weui-uploader__input-box:active{border-color:#8b8b8b}.weui-uploader__input-box:active:after,.weui-uploader__input-box:active:before{background-color:#8b8b8b}.weui-uploader__input{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0}.weui-article{padding:24px 16px;padding:24px calc(16px + constant(safe-area-inset-right)) calc(24px + constant(safe-area-inset-bottom)) calc(16px + constant(safe-area-inset-left));padding:24px calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));font-size:17px;color:rgba(0,0,0,.9)}.weui-article__section{margin-bottom:1.5em}.weui-article__h1{font-size:22px;font-weight:700;margin-bottom:.9em;line-height:1.4}.weui-article__h2{font-size:17px}.weui-article__h2,.weui-article__h3{font-weight:700;margin-bottom:.34em;line-height:1.4}.weui-article__h3{font-size:15px}.weui-article__p{margin:0 0 .8em}.weui-msg{padding-top:36px;padding:calc(36px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(36px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);text-align:center;line-height:1.4;min-height:100%;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;background-color:#fff}.weui-msg__link{color:#576b95;display:inline-block;vertical-align:baseline}.weui-msg__icon-area{margin-bottom:32px}.weui-msg__text-area{margin-bottom:32px;padding:0 32px;-webkit-box-flex:1;-webkit-flex:1;flex:1;line-height:1.6}.weui-msg__text-area:first-child{padding-top:96px}.weui-msg__title{margin-bottom:5px;font-weight:700;font-size:22px;word-wrap:break-word;word-break:break-all}.weui-msg__desc{font-size:17px;color:rgba(0,0,0,.9)}.weui-msg__desc,.weui-msg__desc-primary{word-wrap:break-word;word-break:break-all;margin-bottom:16px}.weui-msg__desc-primary{font-size:14px;color:rgba(0,0,0,.5)}.weui-msg__opr-area{margin-bottom:16px}.weui-msg__opr-area .weui-btn-area{margin:0 16px}.weui-msg__opr-area .weui-btn+.weui-btn{margin-bottom:16px}.weui-msg__opr-area:last-child{margin-bottom:96px}.weui-msg__opr-area+.weui-msg__extra-area{margin-top:48px}.weui-msg__tips-area{margin-bottom:16px;padding:0 40px}.weui-msg__opr-area+.weui-msg__tips-area{margin-bottom:48px}.weui-msg__tips-area:last-child{margin-bottom:64px}.weui-msg__extra-area,.weui-msg__tips{font-size:12px;color:rgba(0,0,0,.5)}.weui-msg__extra-area{position:static;margin-bottom:24px}.weui-cells__group_form:first-child .weui-cells__title{margin-top:0}.weui-cells__group_form .weui-cells__title{margin-top:24px;margin-bottom:8px;padding:0 32px}.weui-cells__group_form .weui-cell:before,.weui-cells__group_form .weui-cells:before{left:32px;right:32px}.weui-cells__group_form .weui-cells_checkbox .weui-check__label:before{left:72px}.weui-cells__group_form .weui-cells:after{left:32px;right:32px}.weui-cells__group_form .weui-cell{padding:16px 32px;color:rgba(0,0,0,.9)}.weui-cells__group_form .weui-cell__hd{padding-right:16px}.weui-cells__group_form .weui-cell__ft{padding-left:16px}.weui-cells__group_form .weui-cell_warn input{color:#fa5151}.weui-cells__group_form .weui-label{max-width:5em;margin-right:8px}.weui-cells__group_form .weui-cells__tips{margin-top:8px;padding:0 32px;color:rgba(0,0,0,.3)}.weui-cells__group_form .weui-cells__tips a{font-weight:700}.weui-cells__group_form .weui-cell_vcode{padding:12px 32px}.weui-cells__group_form .weui-vcode-btn{font-size:16px;padding:0 12px;margin-left:0;height:auto;width:auto;line-height:2em;color:#06ae56;background-color:#f2f2f2}.weui-cells__group_form .weui-vcode-btn:before{display:none}.weui-cells__group_form .weui-cell_select{padding:0}.weui-cells__group_form .weui-cell_select .weui-select{padding:0 32px}.weui-cells__group_form .weui-cell_select .weui-cell__bd:after{right:32px}.weui-cells__group_form .weui-cell_select-before .weui-label{margin-right:24px}.weui-cells__group_form .weui-cell_select-before .weui-select{padding-right:24px;box-sizing:initial}.weui-cells__group_form .weui-cell_select-after{padding-left:32px}.weui-cells__group_form .weui-cell_select-after .weui-select{padding-left:0}.weui-cells__group_form .weui-cell_switch{padding:12px 32px}.weui-cells__group_wxss.weui-cells__group_wxss .weui-cells__title{margin-top:24px}.weui-form{padding:56px 0 0;padding:calc(56px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(56px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;min-height:100%;box-sizing:border-box;line-height:1.4;background-color:#fff}.weui-form a:not(.weui-btn){color:#576b95}.weui-form .weui-footer,.weui-form .weui-footer__link{font-size:12px}.weui-form .weui-agree{padding:0}.weui-form__text-area{padding:0 32px;color:rgba(0,0,0,.9);text-align:center}.weui-form__control-area{-webkit-box-flex:1;-webkit-flex:1;flex:1;margin:48px 0}.weui-form__extra-area,.weui-form__tips-area{margin-bottom:24px;text-align:center}.weui-form__opr-area{margin-bottom:64px}.weui-form__opr-area:last-child{margin-bottom:96px}.weui-form__title{font-size:22px;font-weight:700;line-height:1.36}.weui-form__desc{font-size:17px;margin-top:16px}.weui-form__tips{color:rgba(0,0,0,.5);font-size:12px}.weui-flex{display:-webkit-box;display:-webkit-flex;display:flex}.weui-flex__item{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-btn+.weui-btn{margin-top:16px}.weui-btn.weui-btn_inline+.weui-btn.weui-btn_inline{margin-top:auto;margin-left:16px}.weui-btn-area{margin:48px 16px 8px}.weui-btn-area_inline{display:-webkit-box;display:-webkit-flex;display:flex}.weui-btn-area_inline .weui-btn{margin-top:auto;margin-right:16px;width:100%;-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-btn-area_inline .weui-btn:last-child{margin-right:0}.weui-agree{display:block;padding:.5em 15px;font-size:13px}.weui-agree__text{color:rgba(0,0,0,.5)}.weui-agree__link{display:inline;color:#576b95}.weui-agree__checkbox{position:absolute;left:-9999px}.weui-agree__checkbox-icon{position:relative;top:2px;display:inline-block;border:1px solid #d1d1d1;background-color:#fff;border-radius:3px;width:11px;height:11px}.weui-agree__checkbox-icon-check{position:absolute;top:1px;left:1px}.weui-footer{color:rgba(0,0,0,.3);font-size:14px;line-height:1.4;text-align:center}.weui-footer_fixed-bottom{position:fixed;bottom:16px;bottom:calc(16px + constant(safe-area-inset-bottom));bottom:calc(16px + env(safe-area-inset-bottom));left:0;right:0}.weui-footer__links{font-size:0}.weui-footer__link{display:inline-block;vertical-align:top;margin:0 8px;position:relative;font-size:14px;color:#576b95}.weui-footer__link:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #c7c7c7;color:#c7c7c7;left:-8px;top:.36em;bottom:.36em}.weui-footer__link:first-child:before{display:none}.weui-footer__text{padding:0 .34em;font-size:12px}.weui-grids{border-top:1rpx solid rgba(0,0,0,.1);border-left:1rpx solid rgba(0,0,0,.1);overflow:hidden}.weui-grid{position:relative;float:left;padding:20px 10px;width:33.33333333%;box-sizing:border-box;border-right:1rpx solid rgba(0,0,0,.1);border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-grid_active{background-color:#ececec}.weui-grid__icon{display:block;width:28px;height:28px;margin:0 auto}.weui-grid__label{margin-top:5px;display:block;text-align:center;color:rgba(0,0,0,.9);font-size:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.weui-loading{margin:0 5px;width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:a 1s steps(12) infinite;animation:a 1s steps(12) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}.weui-loading.weui-loading_transparent{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.wx_dot_loading,.wx_dot_loading:after,.wx_dot_loading:before{display:inline-block;vertical-align:middle;width:6px;height:6px;border-radius:50%;background-color:rgba(0,0,0,.3);font-size:0;-webkit-animation:c 1.6s step-start infinite;animation:c 1.6s step-start infinite}.wx_dot_loading{position:relative}.wx_dot_loading:before{content:"";position:absolute;left:-12px;background-color:rgba(0,0,0,.1);-webkit-animation:b 1.6s step-start infinite;animation:b 1.6s step-start infinite}.wx_dot_loading:after{content:"";position:absolute;right:-12px;background-color:rgba(0,0,0,.5);-webkit-animation:d 1.6s step-start infinite;animation:d 1.6s step-start infinite}@-webkit-keyframes b{0%,to{background-color:rgba(0,0,0,.1)}30%{background-color:rgba(0,0,0,.5)}60%{background-color:rgba(0,0,0,.3)}}@keyframes b{0%,to{background-color:rgba(0,0,0,.1)}30%{background-color:rgba(0,0,0,.5)}60%{background-color:rgba(0,0,0,.3)}}@-webkit-keyframes c{0%,to{background-color:rgba(0,0,0,.3)}30%{background-color:rgba(0,0,0,.1)}60%{background-color:rgba(0,0,0,.5)}}@keyframes c{0%,to{background-color:rgba(0,0,0,.3)}30%{background-color:rgba(0,0,0,.1)}60%{background-color:rgba(0,0,0,.5)}}@-webkit-keyframes d{0%,to{background-color:rgba(0,0,0,.5)}30%{background-color:rgba(0,0,0,.3)}60%{background-color:rgba(0,0,0,.1)}}@keyframes d{0%,to{background-color:rgba(0,0,0,.5)}30%{background-color:rgba(0,0,0,.3)}60%{background-color:rgba(0,0,0,.1)}}.wx_dot_loading_white{background-color:hsla(0,0%,100%,.3);-webkit-animation:f 1.6s step-start infinite;animation:f 1.6s step-start infinite}.wx_dot_loading_white:before{background-color:hsla(0,0%,100%,.5);-webkit-animation:e 1.6s step-start infinite;animation:e 1.6s step-start infinite}.wx_dot_loading_white:after{background-color:hsla(0,0%,100%,.1);-webkit-animation:g 1.6s step-start infinite;animation:g 1.6s step-start infinite}@-webkit-keyframes e{0%,to{background-color:hsla(0,0%,100%,.5)}30%{background-color:hsla(0,0%,100%,.1)}60%{background-color:hsla(0,0%,100%,.3)}}@keyframes e{0%,to{background-color:hsla(0,0%,100%,.5)}30%{background-color:hsla(0,0%,100%,.1)}60%{background-color:hsla(0,0%,100%,.3)}}@-webkit-keyframes f{0%,to{background-color:hsla(0,0%,100%,.3)}30%{background-color:hsla(0,0%,100%,.5)}60%{background-color:hsla(0,0%,100%,.1)}}@keyframes f{0%,to{background-color:hsla(0,0%,100%,.3)}30%{background-color:hsla(0,0%,100%,.5)}60%{background-color:hsla(0,0%,100%,.1)}}@-webkit-keyframes g{0%,to{background-color:hsla(0,0%,100%,.1)}30%{background-color:hsla(0,0%,100%,.3)}60%{background-color:hsla(0,0%,100%,.5)}}@keyframes g{0%,to{background-color:hsla(0,0%,100%,.1)}30%{background-color:hsla(0,0%,100%,.3)}60%{background-color:hsla(0,0%,100%,.5)}}.weui-loadmore{width:65%;margin:1.5em auto;line-height:1.6em;font-size:14px;text-align:center}.weui-loadmore__tips{display:inline-block;vertical-align:middle}.weui-loadmore_line{border-top:1px solid rgba(0,0,0,.1);margin-top:2.4em}.weui-loadmore__tips_in-line{position:relative;top:-.9em;padding:0 .55em;background-color:#fff;color:rgba(0,0,0,.5)}.weui-loadmore__tips_in-dot{position:relative;padding:0 .16em;width:4px;height:1.6em}.weui-loadmore__tips_in-dot:before{content:" ";position:absolute;top:50%;left:50%;margin-top:-1px;margin-left:-2px;width:4px;height:4px;border-radius:50%;background-color:rgba(0,0,0,.1)}.weui-badge{display:inline-block;padding:.15em .4em;min-width:8px;border-radius:18px;background-color:#fa5151;color:#fff;line-height:1.2;text-align:center;font-size:12px;vertical-align:middle}.weui-badge_dot{padding:.4em;min-width:0}.weui-panel{background-color:#fff;margin-top:10px;position:relative;overflow:hidden}.weui-panel:first-child{margin-top:0}.weui-panel:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-panel:after,.weui-panel:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-panel:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-panel__hd{padding:16px 16px 13px;color:rgba(0,0,0,.9);font-size:15px;font-weight:700;position:relative}.weui-panel__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.weui-media-box{padding:16px;position:relative}.weui-media-box:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:1s6px}.weui-media-box:first-child:before{display:none}.weui-media-box__title{font-weight:400;font-size:17px;color:rgba(0,0,0,.9);width:auto;white-space:nowrap;word-wrap:normal;word-wrap:break-word;word-break:break-all}.weui-media-box__desc,.weui-media-box__title{line-height:1.4;overflow:hidden;text-overflow:ellipsis}.weui-media-box__desc{color:rgba(0,0,0,.5);font-size:14px;padding-top:4px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-media-box__info{margin-top:16px;padding-bottom:4px;font-size:13px;color:#cecece;line-height:1em;list-style:none;overflow:hidden}.weui-media-box__info__meta{float:left;padding-right:1em}.weui-media-box__info__meta_extra{padding-left:1em;border-left:1px solid #cecece}.weui-media-box__title_in-text{margin-bottom:8px}.weui-media-box_appmsg{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-media-box__thumb{width:100%;height:100%;vertical-align:top}.weui-media-box__hd_in-appmsg{margin-right:16px;width:60px;height:60px;line-height:60px;text-align:center}.weui-media-box__bd_in-appmsg{-webkit-box-flex:1;-webkit-flex:1;flex:1;min-width:0}.weui-media-box_small-appmsg{padding:0}.weui-cells_in-small-appmsg{margin-top:0}.weui-cells_in-small-appmsg:before{display:none}.weui-progress{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-progress__bar{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-progress__opr{margin-left:15px;font-size:0}.weui-navbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:#fff;border-bottom:1rpx solid rgba(0,0,0,.1);padding-top:constant(safe-area-inset-top);padding-top:env(safe-area-inset-top)}.weui-navbar+.weui-tab__panel{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-navbar__item{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:16px;padding:calc(16px + constant(safe-area-inset-top)) 16px 16px;padding:calc(16px + env(safe-area-inset-top)) 16px 16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-navbar__item:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-navbar__item.weui-bar__item_on{background-color:#ececec}.weui-navbar__item:first-child{padding-left:calc(16px + constant(safe-area-inset-left));padding-left:calc(16px + env(safe-area-inset-left))}.weui-navbar__item:last-child{padding-right:calc(16px + constant(safe-area-inset-right));padding-right:calc(16px + env(safe-area-inset-right))}.weui-navbar__item:last-child:after{display:none}.weui-navbar__slider{position:absolute;content:" ";left:0;bottom:0;width:6em;height:2px;background-color:#07c160;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;display:none}.weui-navbar__title{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.weui-tabbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:#f7f7f7}.weui-tabbar:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-tabbar__item{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:8px 0 4px;padding-bottom:calc(8px + constant(safe-area-inset-bottom));padding-bottom:calc(8px + env(safe-area-inset-bottom));font-size:0;color:rgba(0,0,0,.5);text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-tabbar__item:first-child{padding-left:constant(safe-area-inset-left);padding-left:env(safe-area-inset-left)}.weui-tabbar__item:last-child{padding-right:constant(safe-area-inset-right);padding-right:env(safe-area-inset-right)}.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{color:#07c160}.weui-tabbar__icon{display:inline-block;width:28px;height:28px;margin-bottom:2px}.weui-tabbar__icon>i,i.weui-tabbar__icon{font-size:24px;color:rgba(0,0,0,.5)}.weui-tabbar__icon image{width:100%;height:100%}.weui-tabbar__label{color:rgba(0,0,0,.9);font-size:10px;line-height:1.4}.weui-tab{display:-webkit-box;display:-webkit-flex;display:flex;height:100%;box-sizing:border-box;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column}.weui-tab__panel{box-sizing:border-box;-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow:auto;-webkit-overflow-scrolling:touch}:host{width:100%}.weui-slideview{overflow:hidden;position:relative}.weui-slideview__left{position:relative;z-index:10}.weui-slideview__right{position:absolute;z-index:1;left:100%;top:0;height:100%}.weui-slideview__btn__wrp{position:absolute;left:0;bottom:0;text-align:center;min-width:69px;height:100%;white-space:nowrap}.weui-slideview__btn{color:#fff;padding:0 17px}.weui-slideview__btn-group_default .weui-slideview__btn{background:#c7c7cc}.weui-slideview__btn-group_default~.weui-slideview__btn-group_default:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #fff;color:#fff}.weui-slideview__btn-group_default:first-child:before{display:none}.weui-slideview__btn-group_warn .weui-slideview__btn{background:#fe3b30}.weui-slideview__btn-group_warn~.weui-slideview__btn-group_warn:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #fff;color:#fff}.weui-slideview__btn-group_warn:first-child:before{display:none}.weui-slideview_icon .weui-slideview__btn__wrp{background:transparent;font-size:0}.weui-slideview_icon .weui-slideview__btn__wrp:after{content:"";width:0;height:100%;vertical-align:middle;display:inline-block}.weui-slideview_icon .weui-slideview__btn__wrp:first-child{padding-left:16px}.weui-slideview_icon .weui-slideview__btn__wrp:last-child{padding-right:8px}.weui-slideview_icon .weui-slideview__btn{width:48px;height:48px;line-height:48px;padding:0;display:inline-block;vertical-align:middle;border-radius:50%;background-color:#fff}.weui-slideview_icon .weui-slideview__btn__icon{display:inline-block;vertical-align:middle;width:22px;height:22px}.weui-gallery{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;z-index:1000;-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;opacity:0;visibility:hidden;-webkit-transition:opacity .3s;transition:opacity .3s}.weui-gallery_show{display:-webkit-box;display:-webkit-flex;display:flex;visibility:visible;opacity:1}.weui-gallery__img__wrp{-webkit-box-flex:1;-webkit-flex:1;flex:1;position:relative;font-size:0}.weui-gallery__img{background:50% no-repeat;background-size:contain;position:absoulte;width:100%;height:100%}.weui-gallery__opr{background-color:#0d0d0d;color:#fff;line-height:60px;min-height:60px;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);text-align:center}.weui-gallery__opr navigator{color:#fff}.weui-gallery__del{display:block}.weui-gallery__info{color:#fff;font-size:17px;line-height:60px;min-height:60px;text-align:center}.weui-search-bar{position:relative;padding:8px;display:-webkit-box;display:-webkit-flex;display:flex;box-sizing:border-box;background-color:#ededed;-webkit-text-size-adjust:100%;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-icon-search{margin-right:8px;font-size:14px;vertical-align:top;margin-top:.64em;height:1em;line-height:1em}.weui-icon-search_in-box{position:absolute;left:12px;top:50%;margin-top:-8px}.weui-search-bar__text{display:inline-block;font-size:14px;vertical-align:top}.weui-search-bar__form{position:relative;-webkit-box-flex:1;-webkit-flex:auto;flex:auto;border-radius:4px;background:#fff}.weui-search-bar__box{position:relative;padding-left:32px;padding-right:32px;width:100%;box-sizing:border-box;z-index:1}.weui-search-bar__input{height:32px;line-height:32px;font-size:14px;caret-color:#07c160}.weui-icon-clear{position:absolute;top:0;right:0;bottom:0;padding:0 12px;font-size:0}.weui-icon-clear:after{content:"";height:100%;vertical-align:middle;display:inline-block;width:0;overflow:hidden}.weui-search-bar__label{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;border-radius:4px;text-align:center;color:rgba(0,0,0,.5);background:#fff;line-height:32px}.weui-search-bar__cancel-btn{margin-left:8px;line-height:32px;color:#576b95;white-space:nowrap}icon[type=success]:after,icon[type=success]:before{color:#07c160!important}.weui-mask{background:rgba(0,0,0,.6)}.weui-mask,.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-dialog__wrp{position:fixed;z-index:5000;top:16px;bottom:16px;left:16px;right:16px;text-align:center;font-size:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__wrp .weui-dialog{max-height:100%}.weui-dialog{background-color:#fff;text-align:center;border-radius:12px;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;max-height:90%}.weui-dialog__hd{padding:32px 24px 16px}.weui-dialog__title{font-weight:700;font-size:17px;line-height:1.4}.weui-dialog__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 24px;margin-bottom:32px;min-height:40px;font-size:17px;line-height:1.4;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;color:rgba(0,0,0,.5)}.weui-dialog__bd:first-child{padding:32px 24px 0;font-weight:700;color:rgba(0,0,0,.9);-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__bd:first-child,.weui-dialog__ft{display:-webkit-box;display:-webkit-flex;display:flex}.weui-dialog__ft{position:relative;line-height:64px;min-height:64px;font-size:17px}.weui-dialog__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-dialog__btn{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#576b95;font-weight:700;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:relative}.weui-dialog__btn:active{background-color:#ececec}.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-dialog__btn:first-child:after{display:none}.weui-dialog__btn_default{color:rgba(0,0,0,.9)}@media screen and (min-width:352px){.weui-dialog{width:320px;margin:0 auto}}.weui-actionsheet{position:fixed;left:0;bottom:0;-webkit-transform:translateY(100%);transform:translateY(100%);-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:5000;width:100%;background-color:#eae7e8;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden}.weui-actionsheet__title{position:relative;height:56px;padding:0 24px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;text-align:center;font-size:12px;color:rgba(0,0,0,.5);line-height:1.4;background:#fff}.weui-actionsheet__title:before{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-actionsheet__title .weui-actionsheet__title-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-actionsheet__menu{color:rgba(0,0,0,.9);background-color:#fff}.weui-actionsheet__action{margin-top:8px;background-color:#fff;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-actionsheet__cell{position:relative;padding:16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-actionsheet__cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-actionsheet__cell:active{background-color:#ececec}.weui-actionsheet__cell:first-child:before{display:none}.weui-actionsheet__cell_warn{color:#fa5151}.weui-skin_android .weui-actionsheet{position:fixed;left:50%;top:50%;bottom:auto;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:274px;box-sizing:border-box;-webkit-backface-visibility:hidden;backface-visibility:hidden;background:transparent;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;border-radius:2px}.weui-skin_android .weui-actionsheet__action{display:none}.weui-skin_android .weui-actionsheet__menu{border-radius:2px;box-shadow:0 6px 30px 0 rgba(0,0,0,.1)}.weui-skin_android .weui-actionsheet__cell{padding:16px;font-size:17px;line-height:1.41176471;color:rgba(0,0,0,.9);text-align:left}.weui-skin_android .weui-actionsheet__cell:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.weui-skin_android .weui-actionsheet__cell:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.weui-actionsheet_toggle{-webkit-transform:translate(0);transform:translate(0)}.weui-half-screen-dialog{position:fixed;left:0;right:0;bottom:0;max-height:75%;z-index:5000;line-height:1.4;background-color:#fff;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden;padding:0 24px;padding:0 calc(24px + constant(safe-area-inset-right)) constant(safe-area-inset-bottom) calc(24px + constant(safe-area-inset-left));padding:0 calc(24px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(24px + env(safe-area-inset-left))}.weui-half-screen-dialog__hd{font-size:8px;height:8em;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-half-screen-dialog__hd .weui-icon-btn{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.weui-half-screen-dialog__hd__side{position:relative;left:-8px}.weui-half-screen-dialog__hd__main{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main{text-align:center;padding:0 40px}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side{right:-8px;left:auto}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side .weui-icon-btn{right:0}.weui-half-screen-dialog__title{display:block;color:rgba(0,0,0,.9);font-weight:700;font-size:15px}.weui-half-screen-dialog__subtitle{display:block;color:rgba(0,0,0,.5);font-size:10px}.weui-half-screen-dialog__bd{word-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;overflow-y:auto}.weui-half-screen-dialog__desc{padding-top:4px;font-size:17px;font-weight:700;color:rgba(0,0,0,.9);line-height:1.4}.weui-half-screen-dialog__tips{padding-top:16px;font-size:14px;color:rgba(0,0,0,.3);line-height:1.4}.weui-half-screen-dialog__ft{padding:40px 24px 32px;text-align:center}.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2),.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2)+.weui-btn{display:inline-block;vertical-align:top;margin:0 8px;width:120px}.weui-icon-btn{background-color:transparent;background-repeat:no-repeat;background-position:50% 50%;background-size:100%;border:0;outline:0;font-size:0}.weui-icon-btn_goback{width:12px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M26 39.438L24.955 40.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42l7.666-7.79L26 24.563 18.682 32 26 39.438z'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_close{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'%3E %3Cdefs%3E %3Cpath id='33cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a' d='M8 6.943L1.807.75.75 1.807 6.943 8 .75 14.193l1.057 1.057L8 9.057l6.193 6.193 1.057-1.057L9.057 8l6.193-6.193L14.193.75z'/%3E %3C/defs%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cuse fill='%23000' fill-opacity='.9' transform='translate(20 24)' xlink:href='%2333cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_more{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-374 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M380.75 32a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0zm5.25-1.75a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E %3C/g%3E%3C/svg%3E")}.weui-toptips{position:fixed;-webkit-transform:translateZ(0) translateY(-108%);transform:translateZ(0) translateY(-108%);text-align:center;top:8px;left:16px;right:16px;border-radius:4px;padding:8px;-webkit-border-radius:4px;color:hsla(0,0%,100%,.9);font-size:17px;line-height:1.4;background:rgba(250,81,81,.9);z-index:5000;word-wrap:break-word;word-break:break-all;-webkit-transition:all .4s ease-in-out;transition:all .4s ease-in-out}.weui-toptips_show{-webkit-transform:translateZ(0) translateY(0);transform:translateZ(0) translateY(0);opacity:1}.weui-toptips_warn{background-color:#fa5151}.weui-toptips_success{background-color:#09bb07}.weui-toptips_error{background-color:#fa5151}.weui-toptips_info{background-color:#10aeff}page{--height:44px;--right:190rpx}.weui-navigation-bar{overflow:hidden}.weui-navigation-bar .android{--height:48px;--right:222rpx}.weui-navigation-bar__inner{position:fixed;top:0;left:0;z-index:5001;height:var(--height);padding-right:var(--right);width:calc(100% - var(--right))}.weui-navigation-bar__inner,.weui-navigation-bar__inner .weui-navigation-bar__left{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-navigation-bar__inner .weui-navigation-bar__left{position:relative;width:var(--right);padding-left:16px;-webkit-box-pack:center}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn{display:inline-block;vertical-align:middle;background-repeat:no-repeat}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback{font-size:12px;width:1em;height:2em;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E");background-position:50% 50%;background-size:cover}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback:active{opacity:.5}.weui-navigation-bar__inner .weui-navigation-bar__center{font-size:17px;text-align:center;position:relative;-webkit-box-flex:1;-webkit-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-navigation-bar__inner .weui-navigation-bar__loading{font-size:0}.weui-navigation-bar__inner .weui-navigation-bar__loading .weui-loading{margin-left:0}.weui-navigation-bar__inner .weui-navigation-bar__right{margin-right:16px}.weui-navigation-bar__placeholder{height:var(--height);background:#f8f8f8;position:relative;z-index:50} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..a14ba0a --- /dev/null +++ b/package-lock.json @@ -0,0 +1,11 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "weui-miniprogram": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/weui-miniprogram/-/weui-miniprogram-0.2.1.tgz", + "integrity": "sha512-Of/r4QwmlzMwvpW9BQHcL/KW3WV5kw+7yxCFSob3UIqMpwLxKHuBrQajuCVkM3CbqxIpc0XWyDYnpCWk3VkLYg==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..e025ca7 --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "aqyj", + "version": "1.0.0", + "description": "", + "main": "app.js", + "dependencies": { + "weui-miniprogram": "^0.2.1" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://e.coding.net/ctcdevteam/aqyj.git" + }, + "author": "", + "license": "ISC" +} diff --git a/pages/bind/binduser.js b/pages/bind/binduser.js index 77e3b71..4271022 100644 --- a/pages/bind/binduser.js +++ b/pages/bind/binduser.js @@ -5,7 +5,9 @@ Page({ * 页面的初始数据 */ data: { - + username:'', + password:'', + mpopenid:'' }, usernameChange: function (e) { this.data.username = e.detail.value @@ -15,11 +17,11 @@ Page({ }, denglu: function(){ var that=this - console.log(that.data) + // console.log(that.data) wx.request({ url: getApp().globalData.serverUrl + 'bindmp', header: { - 'content-type': 'application/x-www-form-urlencoded', // + 'content-type': 'application/json', // }, method: 'POST', data:that.data, @@ -27,6 +29,16 @@ Page({ if (res.statusCode === 200) { if (res.data.code == 1) { wx.showToast({}) + wx.removeStorageSync('sessionid') + getApp().globalData.userInfo = { + userid: 0, + username: '', + name: '', + isaqy: 0, + mpopenid: '', + companyid: '', + perms: [] + } //重置globaldata和session getApp().mplogin() wx.switchTab({ url: '/pages/main/main', @@ -42,13 +54,18 @@ Page({ } }); }, - + onGetInfo:function(e){ + this.setData({ + userInfo:e.detail.userInfo + }) + this.denglu() + }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { this.setData({ - mpopenid:wx.getStorageSync('mpopenid') + mpopenid:getApp().globalData.userInfo.mpopenid }) }, diff --git a/pages/bind/binduser.wxml b/pages/bind/binduser.wxml index 79a6fb3..468c92e 100644 --- a/pages/bind/binduser.wxml +++ b/pages/bind/binduser.wxml @@ -20,12 +20,13 @@ - + 点击下载系统/小程序文档介绍 - Copyright © 2018-2019 国检集团 + Copyright © 2018-2020 国检集团 + 中存大数据提供技术支持 \ No newline at end of file diff --git a/pages/data/detail.js b/pages/data/detail.js new file mode 100644 index 0000000..63cf95c --- /dev/null +++ b/pages/data/detail.js @@ -0,0 +1,162 @@ +// pages/suggest/detail.js +var util = require('../../utils/util.js') +Page({ + openfj: function (e) { + var that = this + let fileurl = that.data.url + wx.showLoading({ + title: '正在下载...', + }) + wx.downloadFile({ + url: fileurl, + success(res) { + wx.showLoading({ + title: '成功,正在打开...', + }) + const filePath = res.tempFilePath + console.log(filePath) + var filetype + if (fileurl.indexOf(".docx") != -1) { + filetype = 'docx' + } + else if (fileurl.indexOf(".doc") != -1) { + filetype = 'doc' + } + else if (fileurl.indexOf(".xlsx") != -1) { + filetype = 'xlsx' + } + else if (fileurl.indexOf(".xls") != -1) { + filetype = 'xls' + } + else if (fileurl.indexOf(".pptx") != -1) { + filetype = 'pptx' + } + else if (fileurl.indexOf(".ppt") != -1) { + filetype = 'ppt' + } + else if (fileurl.indexOf(".pdf") != -1) { + filetype = 'pdf' + }else{ + wx.hideLoading() + return + } + wx.openDocument({ + filePath, + fileType: filetype, + success(res) { + wx.hideLoading() + console.log('打开文档成功') + }, fail: function (e) { + console.log(e) + } + }) + that.hasRead() + } + }) + + }, + hasRead:function(){ + wx.request({ + url: this.data.serverUrl + 'edu/api?a=downfile&id=' + this.data.id, + header: { + 'content-type': 'application/json', // 默认值 + 'Cookie': wx.getStorageSync("sessionid"), + }, + data: { + }, + success: res => { + } + }); + }, + /** + * 页面的初始数据 + */ + data: { + serverUrl: getApp().globalData.serverUrl, + isDocument:false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getFiledetail(options.id); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + getFiledetail: function (id) { + wx.showLoading({ + title: '加载中', + }), + wx.request({ + url: this.data.serverUrl + 'edu/api?a=detail&id=' + id, + header: { + 'content-type': 'application/json', // 默认值 + 'Cookie': wx.getStorageSync("sessionid"), + }, + data: { + }, + success: res => { + wx.hideLoading(); + console.log(res.data); + if (res.statusCode === 200) { + var filedetail = res.data + filedetail.url = this.data.serverUrl + filedetail.url + this.setData(filedetail) + if([2,3,4,5].indexOf(filedetail.type)!=-1){ + this.setData({ + isDocument:true + }) + } + } + } + }); + }, +}) \ No newline at end of file diff --git a/pages/data/detail.json b/pages/data/detail.json new file mode 100644 index 0000000..88c8e75 --- /dev/null +++ b/pages/data/detail.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "文件详情" +} \ No newline at end of file diff --git a/pages/data/detail.wxml b/pages/data/detail.wxml new file mode 100644 index 0000000..0e756c4 --- /dev/null +++ b/pages/data/detail.wxml @@ -0,0 +1,33 @@ + + + + {{title}} + 分享者: + {{user__ubelongpart__partname}} + {{user__name}} + + 下载量: + {{downnum}} + + 最近编辑时间:{{modifytime}} + + + + + + {{desciption}} + + + + + + + + + + + + + + + diff --git a/pages/data/detail.wxss b/pages/data/detail.wxss new file mode 100644 index 0000000..1068258 --- /dev/null +++ b/pages/data/detail.wxss @@ -0,0 +1,5 @@ +/* pages/data/detail.wxss */ +.weui-btn{ + width:auto; + margin: 5px; +} \ No newline at end of file diff --git a/pages/data/index.js b/pages/data/index.js new file mode 100644 index 0000000..501899b --- /dev/null +++ b/pages/data/index.js @@ -0,0 +1,136 @@ +// pages/miss/miss.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + page: 1, + serverUrl: getApp().globalData.serverUrl, + datalist: [] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + var that = this; + that.getDatalist(1) + this.data.page = 1; + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + var that = this; + that.getDatalist(1); + wx.stopPullDownRefresh(); + this.data.page = 1; + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + //上拉分页,将页码加1,然后调用分页函数 + this.data.page = this.data.page + 1; + this.getDatalist(); + wx.stopPullDownRefresh(); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + getDatalist: function (page,search='') { + var that = this; + if (page != 1) { page = that.data.page } + wx.showLoading({ + title: '加载中', + }), + wx.request({ + url: this.data.serverUrl + 'edu/api?a=listall&rows=10&page=' + page+'&search='+search, + header: { + 'content-type': 'application/json', // 默认值 + 'Cookie': wx.getStorageSync("sessionid"), + }, + success: res => { + if (res.statusCode === 200) { + if (res.data.rows.length == 0) { + if (page == 1) { + this.setData({ + total: 0, + datalist: [] + }) + } + else { + wx.showModal({ + content: "已经到底啦!", + showCancel: false, + confirmText: "确定", + }) + } + } else { + let list + if (page == 1) { + list = res.data.rows + } else { + list = this.data.datalist.concat(res.data.rows) + } + this.setData({ + total: res.data.total, + datalist: list + }) + } + } + wx.hideLoading(); + } + }); + }, + //搜索框文本内容显示 + inputBind: function (event) { + this.setData({ + inputValue: event.detail.value + }) + }, + query: function(){ + this.page = 1 + this.getDatalist(this.page,this.data.inputValue) + }, + reset: function(){ + this.page = 1 + this.inputValue = '' + this.getDatalist(this.page) + } +}) \ No newline at end of file diff --git a/pages/data/index.json b/pages/data/index.json new file mode 100644 index 0000000..973b78e --- /dev/null +++ b/pages/data/index.json @@ -0,0 +1,5 @@ +{ + "navigationBarTitleText": "资料", + "enablePullDownRefresh": true, + "onReachBottomDistance": 50 +} \ No newline at end of file diff --git a/pages/data/index.wxml b/pages/data/index.wxml new file mode 100644 index 0000000..4530f54 --- /dev/null +++ b/pages/data/index.wxml @@ -0,0 +1,55 @@ + + + 共{{total}}条资料 + + + + + + + + + + + + + + + + + + + + + + + + {{item.title}} + {{item.user__ubelongpart__partname}} {{item.user__name}}分享 + 类别:{{item.cate__name}} + 最新编辑:{{item.modifytime}} + + + + 播放量 + 下载量 + {{item.downnum}} + + + + + + + diff --git a/pages/data/index.wxss b/pages/data/index.wxss new file mode 100644 index 0000000..b5cf000 --- /dev/null +++ b/pages/data/index.wxss @@ -0,0 +1,31 @@ +.weui-btn{ + width:auto; + margin: 5px; +} +.container { + background-color: #fff; + color: #939393; +} +.head{ + color:#fff; + background-color: cornflowerblue; + text-align: center; +} +.search +{ + display: flex; + justify-content: flex-end; + align-items: center; + width:100%; + height:auto; + background-color:white; + border:2rpx solid goldenrod; + border-radius: 5rpx; + +} + +/* 搜索框提示文字样式 */ +.search input +{ + padding-left:30rpx; +} diff --git a/pages/examtest/detail.js b/pages/examtest/detail.js index dc1c0c0..5fece31 100644 --- a/pages/examtest/detail.js +++ b/pages/examtest/detail.js @@ -33,7 +33,7 @@ Page({ this.detaildata = data this.setData({ starttime:data.starttime, - took:data.took, + took: util.formatSeconds(data.took), tmIndex:0, tmtotal: data['testdetail'].length, currentTm:data['testdetail'][0] @@ -115,7 +115,6 @@ Page({ showanswer: function () { var that = this var currentTm = that.data.currentTm - console.log(currentTm) var answer = currentTm.question__answer var sorder = Object.keys(answer).sort(); var answerChecked=[] diff --git a/pages/examtest/detail.wxml b/pages/examtest/detail.wxml index a11c950..214e32f 100644 --- a/pages/examtest/detail.wxml +++ b/pages/examtest/detail.wxml @@ -1,7 +1,7 @@ -答题耗时{{took}}分钟 +答题耗时——{{took}} diff --git a/pages/examtest/index.js b/pages/examtest/index.js index 06448ef..236ba85 100644 --- a/pages/examtest/index.js +++ b/pages/examtest/index.js @@ -1,11 +1,12 @@ //var base64 = require("../images/base64"); +var util = require('../../utils/util.js') var sliderWidth = 96; Page({ data: { page: 1, serverUrl: getApp().globalData.serverUrl, allyhlist: [], - tabs: ["待考", "已考"], + tabs: ["可参加", "已考", "全部"], activeIndex: 0, sliderOffset: 0, sliderLeft: 0 @@ -17,13 +18,17 @@ Page({ activeIndex: e.currentTarget.id }); if (that.data.activeIndex == 0) { - that.gettodokslist(1) - that.data.todopage = 1 + that.getkklist(1) + that.data.kkpage = 1 } else if (that.data.activeIndex == 1) { that.getyklist(1) that.data.page = 1 } + else if (that.data.activeIndex == 2) { + that.getalllist(1) + that.data.allpage = 1 + } }, getyklist: function (page) { var that = this; @@ -61,6 +66,9 @@ Page({ } else { list = this.data.yklist.concat(res.data.rows) } + for(var i=0;i { + if (res.statusCode === 200) { + if (res.data.rows.length == 0) { + if (page == 1) { + this.setData({ + kktotal: 0, + kklist: [] + }) + } + else { + wx.showModal({ + content: "已经到底啦!", + showCancel: false, + confirmText: "确定", + }) + } + + + } else { + let list + if (page == 1) { + list = res.data.rows + } else { + list = this.data.kklist.concat(res.data.rows) + } + this.setData({ + kktotal: res.data.total, + kklist: list + }) + } + } + wx.hideLoading(); + } + }); + }, + getalllist: function (page) { //全部考试 + var that = this; + if (page != 1) { page = that.data.allpage } + wx.showLoading({ + title: '加载中', + }), + wx.request({ + url: this.data.serverUrl + 'api/examtest?a=listall&rows=10&page=' + page, + header: { + 'content-type': 'application/json', // 默认值 + 'Cookie': wx.getStorageSync("sessionid"), + }, + success: res => { + if (res.statusCode === 200) { + if (res.data.rows.length == 0) { + if (page == 1) { + this.setData({ + alltotal: 0, + alllist: [] + }) + } + else { + wx.showModal({ + content: "已经到底啦!", + showCancel: false, + confirmText: "确定", + }) + } + + + } else { + let list + if (page == 1) { + list = res.data.rows + } else { + list = this.data.alllist.concat(res.data.rows) + } + this.setData({ + alltotal: res.data.total, + alllist: list + }) + } + } + wx.hideLoading(); + } + }); + }, onLoad: function () { // this.setData({ // icon: base64.icon20 @@ -136,58 +238,74 @@ Page({ var that = this; console.log(that.data.activeIndex) if (that.data.activeIndex == 0) { - that.gettodokslist(1) - that.data.todopage = 1 + that.getkklist(1) + that.data.kkpage = 1 } else if (that.data.activeIndex == 1) { that.getyklist(1) that.data.page = 1 } + else if (that.data.activeIndex == 2) { + that.getalllist(1) + that.data.allpage = 1 + } }, onPullDownRefresh: function () { var that = this; if (that.data.activeIndex == 0) { - that.gettodokslist(1) + that.getkklist(1) wx.stopPullDownRefresh(); - that.data.todopage = 1 + that.data.kkpage = 1 } else if (that.data.activeIndex == 1) { that.getyklist(1) wx.stopPullDownRefresh(); that.data.page = 1 } + else if (that.data.activeIndex == 2) { + that.getalllist(1) + wx.stopPullDownRefresh(); + that.data.allpage = 1 + } }, onReachBottom: function () { //上拉分页,将页码加1,然后调用分页函数 var that = this; if (that.data.activeIndex == 0) { - this.data.todopage = this.data.todopage + 1; - this.gettodokslist(); + this.data.kkpage = this.data.kkpage + 1; + this.getkklist(); } else if (that.data.activeIndex == 1) { this.data.page = this.data.page + 1; this.getyklist(); } + else if (that.data.activeIndex == 2) { + this.data.allpage = this.data.allpage + 1; + this.getalllist(); + } }, testDetail:function(e){ - let data = e.currentTarget.dataset - let examtest__state = data.examtest__state - console.log(examtest__state) - let id = data.id - if (examtest__state==0){ - let url = "detail?detailid="+id.toString() + let data = e.currentTarget.dataset.test + console.log(data) + // let examtest__state = data.examtest__state + // console.log(examtest__state) + // let id = data.id + // if (examtest__state==0){ + // let url = "detail?detailid="+id.toString() + let url = "note2?examtestid=" + data.examtest__id.toString()+"&detailid="+data.id.toString() + + "&took="+data.took.toString()+"&score="+data.score.toString() wx.navigateTo({ url: url, }) - }else{ - wx.showModal({ - title: "系统提示", - content: '发布人未关闭考试,暂不能查看', - showCancel: false, - confirmText: "确定" - }) - } + // }else{ + // wx.showModal({ + // title: "系统提示", + // content: '发布人未关闭考试,暂不能查看', + // showCancel: false, + // confirmText: "确定" + // }) + // } }, scan: function () { diff --git a/pages/examtest/index.wxml b/pages/examtest/index.wxml index cd84568..76246c4 100644 --- a/pages/examtest/index.wxml +++ b/pages/examtest/index.wxml @@ -10,20 +10,29 @@ - - + + - {{item.examtest__name}} + {{item.name}} + + + 答卷时长: + {{item.duration}}分钟 + 通过分数: + {{item.passscore}} - 答卷时长:{{item.examtest__duration}}分钟 通过分数:{{item.examtest__passscore}} - - 可参加 - 已过期 - + + 进行中 + 已关闭 + + @@ -34,19 +43,19 @@ 共{{yktotal}}条考试 - + {{item.examtest__name}} 参加时间:{{item.starttime}} - 耗时:{{item.took}}分钟 得分:{{item.score}} + 耗时:{{item.took}} 得分:{{item.score}} 通过 未通过 进行中 - 已关闭 + 已结束 @@ -54,9 +63,38 @@ + - + + 点击去查查学习资料吧 + {{msg}} diff --git a/pages/examtest/note2.js b/pages/examtest/note2.js new file mode 100644 index 0000000..62673fc --- /dev/null +++ b/pages/examtest/note2.js @@ -0,0 +1,105 @@ +// pages/examtest/note.js +var util = require('../../utils/util.js') +Page({ + + /** + * 页面的初始数据 + */ + data: { + testdisable: false, + fromWx: false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var examtestid = options.examtestid + var detailid = options.detailid + this.setData({ + examtestid:examtestid, + detailid:detailid, + took: util.formatSeconds(options.took), + score:options.score + }) + wx.request({ + url: getApp().globalData.serverUrl + 'api/examtest?a=detail&id=' + examtestid, + header: { + 'content-type': 'application/json', // 默认值 + 'Cookie': wx.getStorageSync("sessionid"), + }, + success: res => { + if (res.statusCode === 200) { + let ksdata = res.data + this.setData(ksdata) + } + } + }); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + showDetail: function () { + if(this.data.state == 1){ + wx.showModal({ + content: "考试未关闭!不能查看答案", + showCancel: false, + confirmText: "确定", + }) + }else{ + wx.navigateTo({ + url: 'detail?detailid=' + this.data.detailid, + }) + } + }, + showRate: function() { + wx.navigateTo({ + url: 'rate?examtestid=' + this.data.examtestid, + }) + } +}) \ No newline at end of file diff --git a/pages/examtest/note2.json b/pages/examtest/note2.json new file mode 100644 index 0000000..9732061 --- /dev/null +++ b/pages/examtest/note2.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "考试信息" +} \ No newline at end of file diff --git a/pages/examtest/note2.wxml b/pages/examtest/note2.wxml new file mode 100644 index 0000000..4889cdc --- /dev/null +++ b/pages/examtest/note2.wxml @@ -0,0 +1,32 @@ + + + + 考卷信息 + 名称:{{name}} + 答卷时长:{{duration}}分钟 + 满分{{totalscore}};{{passscore}}以上通过 + {{exampaper__total.dx.num}}道单选题,{{exampaper__total.duox.num}}道多选题,{{exampaper__total.pd.num}}道判断题 + 最早参加时间: + {{starttime}} + + 最迟参加时间: + {{endtime}} + + + + 答题信息 + 您耗时:{{took}} + 总得分:{{score}} 分 + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/examtest/note2.wxss b/pages/examtest/note2.wxss new file mode 100644 index 0000000..5bbca33 --- /dev/null +++ b/pages/examtest/note2.wxss @@ -0,0 +1,4 @@ +.weui-btn{ + width:auto; + margin: 5px; +} \ No newline at end of file diff --git a/pages/examtest/rate.js b/pages/examtest/rate.js new file mode 100644 index 0000000..ddb5129 --- /dev/null +++ b/pages/examtest/rate.js @@ -0,0 +1,130 @@ +// pages/examtest/rate.js +var util = require('../../utils/util.js') +Page({ + + /** + * 页面的初始数据 + */ + data: { + page: 1, + serverUrl: getApp().globalData.serverUrl, + ratelist: [] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var examtestid = options.examtestid + this.setData({ + examtestid:examtestid + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + var that = this; + that.getRatelist(1) + this.data.page = 1; + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + var that = this; + that.getRatelist(1); + wx.stopPullDownRefresh(); + this.data.page = 1; + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + //上拉分页,将页码加1,然后调用分页函数 + this.data.page = this.data.page + 1; + this.getRatelist(); + wx.stopPullDownRefresh(); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + getRatelist: function (page) { + var that = this; + if (page != 1) { page = that.data.page } + wx.showLoading({ + title: '加载中', + }), + wx.request({ + url: this.data.serverUrl + 'api/examtestdetail?a=rate&examtestid='+this.data.examtestid + '&rows=20&page=' + page, + header: { + 'content-type': 'application/json', // 默认值 + 'Cookie': wx.getStorageSync("sessionid"), + }, + success: res => { + if (res.statusCode === 200) { + console.log(res.data) + if (res.data.rows.length == 0) { + if (page == 1) { + this.setData({ + total: 0, + ratelist: [] + }) + } + else { + wx.showModal({ + content: "已经到底啦!", + showCancel: false, + confirmText: "确定", + }) + } + } else { + let list + if (page == 1) { + list = res.data.rows + } else { + list = this.data.ratelist.concat(res.data.rows) + } + for (var i = 0; i < list.length; i++) { + list[i].took = util.formatSeconds(list[i].took) + } + this.setData({ + total: res.data.total, + ratelist: list, + examtestname: res.data.examtestname + }) + } + } + wx.hideLoading(); + } + }); + }, +}) \ No newline at end of file diff --git a/pages/examtest/rate.json b/pages/examtest/rate.json new file mode 100644 index 0000000..f32dd8d --- /dev/null +++ b/pages/examtest/rate.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "考试排名", + "enablePullDownRefresh": true +} \ No newline at end of file diff --git a/pages/examtest/rate.wxml b/pages/examtest/rate.wxml new file mode 100644 index 0000000..d66ed45 --- /dev/null +++ b/pages/examtest/rate.wxml @@ -0,0 +1,30 @@ + +{{examtestname}} +已有{{total}}人参与 + + + + + {{index+1}} + + + + + + + {{item.user__name}} + + 部门: {{item.user__ubelongpart__partname}} + + + + + {{item.score}}分 + + {{item.took}} + + + + + + \ No newline at end of file diff --git a/pages/examtest/rate.wxss b/pages/examtest/rate.wxss new file mode 100644 index 0000000..6c9e363 --- /dev/null +++ b/pages/examtest/rate.wxss @@ -0,0 +1,6 @@ +/* pages/examtest/rate.wxss */ +.head{ + color:#fff; + background-color: cornflowerblue; + text-align: center; +} \ No newline at end of file diff --git a/pages/examtest/result.js b/pages/examtest/result.js index 95659d9..01898f4 100644 --- a/pages/examtest/result.js +++ b/pages/examtest/result.js @@ -18,7 +18,8 @@ Page({ totalscore:options.totalscore, rights:options.rights, tmnum:options.tmnum, - detailid: options.examtestdetailid + detailid: options.examtestdetailid, + examtestid: options.examtestid }) }, @@ -79,5 +80,10 @@ Page({ wx.switchTab({ url: '/pages/main/main' }) + }, + showRate: function () { + wx.navigateTo({ + url: 'rate?examtestid=' + this.data.examtestid, + }) } }) \ No newline at end of file diff --git a/pages/examtest/result.wxml b/pages/examtest/result.wxml index ba65fc7..5cf8f2f 100644 --- a/pages/examtest/result.wxml +++ b/pages/examtest/result.wxml @@ -16,11 +16,19 @@ 得分{{score}},满分{{totalscore}} 全对{{rights}}题,共{{tmnum}}题 - + + - + --> + + + + + + + + \ No newline at end of file diff --git a/pages/images/data.png b/pages/images/data.png new file mode 100644 index 0000000..1fdbb83 Binary files /dev/null and b/pages/images/data.png differ diff --git a/pages/images/excel.svg b/pages/images/excel.svg new file mode 100644 index 0000000..5d76766 --- /dev/null +++ b/pages/images/excel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pages/images/file.png b/pages/images/file.png deleted file mode 100644 index afe91b2..0000000 Binary files a/pages/images/file.png and /dev/null differ diff --git a/pages/images/file.svg b/pages/images/file.svg new file mode 100644 index 0000000..478dc37 --- /dev/null +++ b/pages/images/file.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pages/images/mp4.svg b/pages/images/mp4.svg new file mode 100644 index 0000000..a989e54 --- /dev/null +++ b/pages/images/mp4.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pages/images/pdf.svg b/pages/images/pdf.svg new file mode 100644 index 0000000..d8f9cda --- /dev/null +++ b/pages/images/pdf.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pages/images/ppt.svg b/pages/images/ppt.svg new file mode 100644 index 0000000..9f1ad7a --- /dev/null +++ b/pages/images/ppt.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pages/images/rate.png b/pages/images/rate.png new file mode 100644 index 0000000..64782d6 Binary files /dev/null and b/pages/images/rate.png differ diff --git a/pages/images/reset.png b/pages/images/reset.png new file mode 100644 index 0000000..540804b Binary files /dev/null and b/pages/images/reset.png differ diff --git a/pages/images/search.png b/pages/images/search.png new file mode 100644 index 0000000..fc2d61a Binary files /dev/null and b/pages/images/search.png differ diff --git a/pages/images/train.png b/pages/images/train.png index cb37e51..724c0dd 100644 Binary files a/pages/images/train.png and b/pages/images/train.png differ diff --git a/pages/images/word.svg b/pages/images/word.svg new file mode 100644 index 0000000..5eb6535 --- /dev/null +++ b/pages/images/word.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pages/images/zip.png b/pages/images/zip.png new file mode 100644 index 0000000..c836cb6 Binary files /dev/null and b/pages/images/zip.png differ diff --git a/pages/images/zip.svg b/pages/images/zip.svg new file mode 100644 index 0000000..5325174 --- /dev/null +++ b/pages/images/zip.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index 1f868c1..27d1314 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -15,8 +15,8 @@ Page({ this.getName(); }, getName: function(){ - var username = wx.getStorageSync('username') - var userid = wx.getStorageSync('userid') + var username = app.globalData.userInfo.username + var userid = app.globalData.userInfo.userid this.setData({ username: username, userid: userid, diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 9a5cc0e..be2d3f9 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -61,4 +61,12 @@ - \ No newline at end of file + + + + 点击下载系统/小程序文档介绍 + Copyright © 2018-2020 国检集团 + 中存大数据提供技术支持 + \ No newline at end of file diff --git a/pages/main/main.js b/pages/main/main.js index 766baa6..eef434e 100644 --- a/pages/main/main.js +++ b/pages/main/main.js @@ -15,6 +15,7 @@ Page({ jytodonum: 0, tasknum: 0, serverUrl: getApp().globalData.serverUrl, + isGjjt:false, // Banner数据 images: [], // 是否显示面板指示点 @@ -32,7 +33,7 @@ Page({ // 前边距,可用于露出前一项的一小部分,接受 px 和 rpx 值 previousMargin: 0, // 后边距,可用于露出后一项的一小部分,接受 px 和 rpx 值 - nextMargin: 0 + nextMargin: 0, }, /** @@ -45,17 +46,29 @@ Page({ that.data.serverUrl + 'media/banner/2.jpg', that.data.serverUrl + 'media/banner/3.jpg', that.data.serverUrl + 'media/banner/4.jpg', - that.data.serverUrl + 'media/banner/5.jpg', ] that.setData({ images: images }) }, - + callback: function () { + var that = this; + if (getApp().globalData.userInfo.companyid == 2681) { + this.setData({ + isGjjt: true, + user__name:getApp().globalData.userInfo.name, + msgList: [ + { title: "齐心协力抗肺炎,众志成城渡难关。武汉加油!祖国加油!" }, + { title: "'国检战疫,有我助力'知识竞赛火热进行中!" },] + }) + } + this.getNew() + }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { + }, /** @@ -63,33 +76,11 @@ Page({ */ onShow: function () { var that = this + console.log(getApp().globalData.userInfo) //获取待阅读通知数目 - //console.log(wx.getStorageSync('sessionid')) - if (wx.getStorageSync("sessionid").indexOf('sessionid')!=-1) { - wx.request({ - url: getApp().globalData.serverUrl + 'api/check_session', - header: { - 'content-type': 'application/json', // 默认值 - 'Cookie': wx.getStorageSync("sessionid"), - }, - data: {}, - success: res => { - if(res.data.code==1){ - this.getNew() - }else{ - getApp().callback = () => { - this.getNew() - }; - } - } - }); - - } else { - getApp().callback = () => { - this.getNew() - }; + if (wx.getStorageSync('sessionid').indexOf('sessinid')!=-1){ + that.getNew() } - }, getNew:function(){ @@ -219,7 +210,7 @@ Page({ var that = this //获取待考 wx.request({ - url: this.data.serverUrl + 'api/examtestdetail?a=dknum', + url: this.data.serverUrl + 'api/examtest?a=dknum', header: { 'content-type': 'application/json', // 默认值 'Cookie': wx.getStorageSync("sessionid"), @@ -316,8 +307,8 @@ Page({ }); }, taptest: function () { - if (getApp().globalData.rights != undefined) { - if (getApp().globalData.rights.indexOf(25) != -1) {//考试功能 + if (getApp().globalData.userInfo.perms != undefined) { + if (getApp().globalData.userInfo.perms.indexOf(25) != -1) {//考试功能 wx.navigateTo({ url: '/pages/examtest/index', }) @@ -335,8 +326,13 @@ Page({ } }, tapexercise: function () { - if (getApp().globalData.rights != undefined) { - if (getApp().globalData.rights.indexOf(25) != -1) {//考试功能 + if (this.data.isGjjt) { //练习功能 + wx.showModal({ + content: '本次活动该功能不便访问!', + showCancel: false + }) + } else if (getApp().globalData.userInfo.perms != undefined) { + if (getApp().globalData.userInfo.perms.indexOf(25) != -1) {//考试功能 wx.navigateTo({ url: '/pages/exercise/index', }) @@ -355,8 +351,8 @@ Page({ } }, tapinspect: function () { - if (getApp().globalData.rights != undefined) { - if (getApp().globalData.rights.indexOf(35) != -1) {//设备巡检 + if (getApp().globalData.userInfo.perms != undefined) { + if (getApp().globalData.userInfo.perms.indexOf(35) != -1) {//设备巡检 wx.navigateTo({ url: '/pages/inspect/index', }) diff --git a/pages/main/main.wxml b/pages/main/main.wxml index b4c0834..148d110 100644 --- a/pages/main/main.wxml +++ b/pages/main/main.wxml @@ -1,24 +1,24 @@ - - + + - + - + - 数据采集 - + + + +{{item.title}} + + + + 数据采集 + 排查任务 @@ -58,8 +58,33 @@ 设备巡检 - 学习园地 + + 学习园地 + + {{user__name}} + ,进入在线考试答题吧! + + + + + + 学习资料 + + + + 在线考试 + {{dknum}} + + + + 实时总排名 + + + + 线下培训 + {{dqdnum}} + 公告 @@ -67,23 +92,28 @@ 通知 - {{noread}} - - - 线下培训 - {{dqdnum}} - - - - 在线考试 - {{dknum}} - - + 模拟练习 + + \ No newline at end of file diff --git a/pages/main/main.wxss b/pages/main/main.wxss index d9973d0..85813dd 100644 --- a/pages/main/main.wxss +++ b/pages/main/main.wxss @@ -3,3 +3,25 @@ width: 100%; height: 300rpx; } +/*横向布局 */ +.layout_horizontal{ + height: 200rpx; + display: flex; + /*row 横向 column 列表 */ + flex-direction: row; + padding:4rpx +} +.swiper_container { +background-color: #e7e6e6; +height: 50rpx; +width: 100%; +text-align: center +} +.swiper_item { +font-size: 30rpx; +font-weight: bold; +color:darkblue; +overflow: hidden; +text-overflow: ellipsis; +white-space: nowrap; +} \ No newline at end of file diff --git a/pages/miss/addmiss.js b/pages/miss/addmiss.js index e876a91..fbf20c4 100644 --- a/pages/miss/addmiss.js +++ b/pages/miss/addmiss.js @@ -114,7 +114,7 @@ Page({ }); this.data.misstime = time //拉取地图权限 - if (getApp().globalData.rights.indexOf(30) != -1) { + if (getApp().globalData.userInfo.perms.indexOf(30) != -1) { this.setData({ mapright: true }) diff --git a/pages/notice/detail.js b/pages/notice/detail.js index cba195e..2a3e8c3 100644 --- a/pages/notice/detail.js +++ b/pages/notice/detail.js @@ -1,6 +1,5 @@ // pages/suggest/detail.js var util = require('../../utils/util.js') -var WxParse = require('../../wxParse/wxParse.js'); Page({ /** @@ -139,11 +138,9 @@ Page({ material: material, title:tzdata.notice.title, readpeople:tzdata.readpeople, - readsnum:tzdata.readsnum + readsnum:tzdata.readsnum, + content:tzdata.notice.content }) - - - WxParse.wxParse('article', 'html', tzdata.notice.content, this, 0) } } }); diff --git a/pages/notice/detail.wxml b/pages/notice/detail.wxml index bea177f..fe4150d 100644 --- a/pages/notice/detail.wxml +++ b/pages/notice/detail.wxml @@ -1,4 +1,3 @@ - @@ -13,7 +12,7 @@ -