├── .gitignore ├── App.vue ├── README.md ├── common ├── config.js ├── css │ ├── animate.min.css │ ├── base.css │ └── iconfont.css ├── http.interceptor.js └── util.js ├── components ├── approval-detail │ └── approval-detail.vue ├── m-chat │ └── m-chat.vue ├── m-help-list │ └── m-help-list.vue ├── m-hot-list │ └── m-hot-list.vue ├── m-index-hot │ └── m-index-hot.vue ├── m-index-list │ └── m-index-list.vue ├── m-notice-list │ └── m-notice-list.vue ├── m-notice │ └── m-notice.vue ├── m-payment-list │ └── m-payment-list.vue ├── m-popup │ └── m-popup.vue ├── m-tabs │ └── m-tabs.vue ├── m-tags │ └── m-tags.vue ├── m-talk-list │ └── m-talk-list.vue ├── m-task-list │ └── m-task-list.vue ├── super-man-icon │ └── super-man-icon.vue ├── task-detail │ └── task-detail.vue ├── tki-qrcode │ ├── qrcode.js │ └── tki-qrcode.vue ├── uni-badge │ └── uni-badge.vue ├── uni-icons │ ├── icons.js │ └── uni-icons.vue ├── uni-list-item │ └── uni-list-item.vue ├── uni-list │ ├── uni-list.vue │ ├── uni-refresh.vue │ └── uni-refresh.wxs ├── uni-notice-bar │ └── uni-notice-bar.vue ├── uni-popup │ ├── message.js │ ├── popup.js │ ├── uni-popup-dialog.vue │ ├── uni-popup-message.vue │ ├── uni-popup-share.vue │ └── uni-popup.vue ├── uni-status-bar │ └── uni-status-bar.vue ├── uni-tag │ └── uni-tag.vue ├── uni-transition │ └── uni-transition.vue └── vip-home-list │ └── vip-home-list.vue ├── js_sdk └── junyi-h5-copy │ └── junyi-h5-copy │ └── junyi-h5-copy.js ├── main.js ├── pages.json ├── pages ├── addTask │ ├── addTask.vue │ ├── addTask2.vue │ └── addTask3.vue ├── approval │ ├── detail.vue │ └── list.vue ├── bond │ ├── bond.vue │ └── recharge.vue ├── deposit │ └── deposit.vue ├── help │ ├── data.js │ ├── detail.vue │ └── help.vue ├── hot │ └── hot.vue ├── index │ └── index.vue ├── inv │ ├── data.js │ └── inv.vue ├── login │ └── login.vue ├── my │ ├── my.vue │ └── task.vue ├── myTaskList │ └── myTaskList.vue ├── notice │ └── notice.vue ├── orderDetail │ └── orderDetail.vue ├── rank │ └── rank.vue ├── search │ └── search.vue ├── setTask │ └── setTask.vue ├── setting │ └── setting.vue ├── smrz │ └── smrz.vue ├── talk │ └── index.vue ├── taskDetail │ └── taskDetail.vue ├── taskPreview │ └── taskPreview.vue ├── tools │ └── tools.vue ├── user │ └── index.vue ├── vip │ ├── home.vue │ └── vip.vue └── wallet │ ├── addPay.vue │ ├── bankData.js │ ├── bankTools.js │ ├── payment.vue │ └── tx.vue ├── static ├── iconfont.css ├── iconfont.ttf ├── image │ ├── 1.png │ ├── 2.png │ ├── alipay.png │ ├── camera.png │ ├── dsh.png │ ├── dtj.png │ ├── home.png │ ├── home_selected.png │ ├── hot.png │ ├── idcard1.png │ ├── idcard2.png │ ├── idcard3.jpg │ ├── inv.png │ ├── invHb.jpg │ ├── inv_desc.png │ ├── inv_foot.png │ ├── inv_index.png │ ├── inv_selected.png │ ├── jg.png │ ├── jia.png │ ├── mao.png │ ├── my.png │ ├── my_selected.png │ ├── rank_1.png │ ├── rank_2.png │ ├── rank_3.png │ ├── tj.png │ ├── tj_selected.png │ ├── tupian.png │ ├── vipbj.jpg │ ├── vipbj.png │ ├── wechat.png │ ├── wtg.png │ ├── ytg.png │ └── zhuanshi.png └── logo.png ├── store └── index.js ├── uni.scss └── uview-ui ├── LICENSE ├── README.md ├── components ├── u-action-sheet │ └── u-action-sheet.vue ├── u-alert-tips │ └── u-alert-tips.vue ├── u-avatar-cropper │ ├── u-avatar-cropper.vue │ └── weCropper.js ├── u-avatar │ └── u-avatar.vue ├── u-back-top │ └── u-back-top.vue ├── u-badge │ └── u-badge.vue ├── u-button │ └── u-button.vue ├── u-calendar │ └── u-calendar.vue ├── u-car-keyboard │ └── u-car-keyboard.vue ├── u-card │ └── u-card.vue ├── u-cell-group │ └── u-cell-group.vue ├── u-cell-item │ └── u-cell-item.vue ├── u-checkbox-group │ └── u-checkbox-group.vue ├── u-checkbox │ └── u-checkbox.vue ├── u-circle-progress │ └── u-circle-progress.vue ├── u-col │ └── u-col.vue ├── u-collapse-item │ └── u-collapse-item.vue ├── u-collapse │ └── u-collapse.vue ├── u-column-notice │ └── u-column-notice.vue ├── u-count-down │ └── u-count-down.vue ├── u-count-to │ └── u-count-to.vue ├── u-divider │ └── u-divider.vue ├── u-dropdown-list │ └── u-dropdown-list.vue ├── u-empty │ ├── icon.js │ └── u-empty.vue ├── u-field │ └── u-field.vue ├── u-form-item │ └── u-form-item.vue ├── u-form │ └── u-form.vue ├── u-full-screen │ └── u-full-screen.vue ├── u-gap │ └── u-gap.vue ├── u-grid-item │ └── u-grid-item.vue ├── u-grid │ └── u-grid.vue ├── u-icon │ └── u-icon.vue ├── u-index-anchor │ └── u-index-anchor.vue ├── u-index-list │ └── u-index-list.vue ├── u-input │ └── u-input.vue ├── u-keyboard │ └── u-keyboard.vue ├── u-lazy-load │ └── u-lazy-load.vue ├── u-line-progress │ └── u-line-progress.vue ├── u-line │ └── u-line.vue ├── u-link │ └── u-link.vue ├── u-loading │ └── u-loading.vue ├── u-loadmore │ └── u-loadmore.vue ├── u-mask │ └── u-mask.vue ├── u-message-input │ └── u-message-input.vue ├── u-modal │ └── u-modal.vue ├── u-navbar │ └── u-navbar.vue ├── u-no-network │ └── u-no-network.vue ├── u-notice-bar │ └── u-notice-bar.vue ├── u-number-box │ └── u-number-box.vue ├── u-number-keyboard │ └── u-number-keyboard.vue ├── u-picker │ └── u-picker.vue ├── u-popup │ └── u-popup.vue ├── u-radio-group │ └── u-radio-group.vue ├── u-radio │ └── u-radio.vue ├── u-rate │ └── u-rate.vue ├── u-read-more │ └── u-read-more.vue ├── u-row-notice │ └── u-row-notice.vue ├── u-row │ └── u-row.vue ├── u-search │ └── u-search.vue ├── u-section │ └── u-section.vue ├── u-select │ └── u-select.vue ├── u-skeleton │ └── u-skeleton.vue ├── u-slider │ └── u-slider.vue ├── u-steps │ └── u-steps.vue ├── u-sticky │ └── u-sticky.vue ├── u-subsection │ └── u-subsection.vue ├── u-swipe-action │ └── u-swipe-action.vue ├── u-swiper │ └── u-swiper.vue ├── u-switch │ └── u-switch.vue ├── u-table │ └── u-table.vue ├── u-tabs-swiper │ └── u-tabs-swiper.vue ├── u-tabs │ └── u-tabs.vue ├── u-tag │ └── u-tag.vue ├── u-td │ └── u-td.vue ├── u-th │ └── u-th.vue ├── u-time-line-item │ └── u-time-line-item.vue ├── u-time-line │ └── u-time-line.vue ├── u-toast │ └── u-toast.vue ├── u-top-tips │ └── u-top-tips.vue ├── u-tr │ └── u-tr.vue ├── u-upload │ └── u-upload.vue ├── u-verification-code │ └── u-verification-code.vue └── u-waterfall │ └── u-waterfall.vue ├── iconfont.css ├── index.js ├── index.scss ├── libs ├── config │ ├── config.js │ └── zIndex.js ├── css │ ├── color.scss │ └── common.scss ├── function │ ├── bem.js │ ├── color.js │ ├── colorGradient.js │ ├── deepClone.js │ ├── deepMerge.js │ ├── guid.js │ ├── md5.js │ ├── queryParams.js │ ├── random.js │ ├── randomArray.js │ ├── route.js │ ├── test.js │ ├── timeFormat.js │ ├── timeFrom.js │ ├── toast.js │ ├── trim.js │ └── type2icon.js ├── mixin │ ├── mixin.js │ └── mpShare.js ├── request │ └── index.js ├── store │ └── index.js └── util │ ├── area.js │ ├── async-validator.js │ ├── city.js │ ├── emitter.js │ └── province.js ├── package.json └── theme.scss /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /manifest.json 3 | /unpackage 4 | -------------------------------------------------------------------------------- /App.vue: -------------------------------------------------------------------------------- 1 | 5 | 19 | 20 | 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # uniappRewardCat -------------------------------------------------------------------------------- /common/config.js: -------------------------------------------------------------------------------- 1 | // 全局配置信息 2 | export default { 3 | // api请求地址 4 | apiUrl:'http://27.148.190.44:8070', 5 | // websocket地址 6 | websocketUrl: '', 7 | // 首页 分类 8 | indexClassTab:[ 9 | { 10 | id:0, 11 | name:'全部' 12 | }, 13 | { 14 | id:1, 15 | name:'下载注册', 16 | desc:'APP下载,软件注册下载任务' 17 | }, 18 | { 19 | id:2, 20 | name:'砍价红包', 21 | desc:'拼多多,美团,抖音等砍价任务' 22 | }, 23 | { 24 | id:3, 25 | name:'关注投票', 26 | desc:'微信公众号,抖音,微博等关注投票任务' 27 | }, 28 | { 29 | id:4, 30 | name:'分享转发', 31 | desc:'社交软件内容分享,转发专区' 32 | }, 33 | { 34 | id:5, 35 | name:'电商', 36 | desc:'拼多多,淘宝,京东等电商任务专区' 37 | }, 38 | { 39 | id:6, 40 | name:'多天任务', 41 | desc:'需要连续多天才能完成的任务,在此发布' 42 | }, 43 | { 44 | id:7, 45 | name:'高价任务', 46 | desc:'高价任务发布专区' 47 | }, 48 | { 49 | id:8, 50 | name:'其他任务', 51 | desc:'其他类型任务' 52 | }, 53 | ] 54 | } 55 | -------------------------------------------------------------------------------- /common/css/iconfont.css: -------------------------------------------------------------------------------- 1 | @font-face {font-family: "iconfont"; 2 | src: url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAANcAAsAAAAABxwAAAMOAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCcAqCKIIWATYCJAMICwYABCAFhG0HLhs6BsgekiSCeAYKIkUVARAggmitrN6dR1SIChWgJpbAQr36lwnL+DhAj8Khi2cj7se6/DetZ2uk9VcBzX4Ag2Qyu86mun3yBJ9In8Dz1tbm/xxLvRTPD3Qu2UH3DvC49YC6MTcaDnQDGZhvGLvAJVwnUK5Nf8JSx5AxECSx5gXiytBlCMrJpZbUUCoU12xN4jH4K83u+NzGo/D347/RCCJTlLMyVk/aNWj6tdeO8J3pnWmKjwDGfFqwXeQYARKxWatf5hv7R/gq1/x+usC+UoNfe71en77bfzyCKGYlV4IWSL8nhsu81YIMJPfefwhcj/qGFFVPhYTEAcx8eWLJqX2CcHt28Wn7zneC8PSZ9PTp9uPHm1eedMKWH21Xn3YJsy7VPnu28+TJ1onP4ObN7ct9px+bN3wpE48+nPWo0rTkROKzWaLeLzmXLqxjL9VMq3fN2imKd7fP3JEzZBSNLSnrU1YSS9Gp5l2fvo42JVN/ySybVl07tcrXpviUeIgsmf1pnCSNmOEOC6B5y4sCd355/8wXUzAFf0XR8jyKjpZfezk5vjoiNnLEkBlZQzNnDEnoOrSWavalGSebd6I1u5pPja4Z8murc2zEkEi4A2AOoLA1/5b78X/jyfc7V9PD6/6XViTwU7wqtBa2JuhnBKW3Zwh+M6NnXdJZliJLKqM2nDnkf/sl5cpRAGyu93asuOmdwqFU05sZS7SmkCvVg0zYEShSYRyKlZqFcsOk3RUaML4ilWHIPACh1j7IVPsIuVp3kAn7Boo0+w7FasMXym1H9JEV+sIQWxmWOdaQ0osM1ekgjoqLUeoorHfaZJZlhbhxmHkMFyouKCqGJOzAbI4Vni69hHOCCHPaUQe4DdtsTuRiTgtWeQHl3FVTWEjqPqlAddpBtIjBZBymQRS9EIPKyYH4zTmx9POjYLpONjLWUlMjHwdjPIzBkWIFinogJb6jV8293OPRRVeC4wiEYJzskA6gxWy23wlx1U+ywFRcATrC61KjEDUiffkF6wvtX7cFylmSLOzcXLrEpBMAAAA=') format('woff2') 3 | } 4 | 5 | .iconfont { 6 | font-family: "iconfont" !important; 7 | font-size: 16px; 8 | font-style: normal; 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | } 12 | 13 | .iconkefu:before { 14 | content: "\e6ae"; 15 | } 16 | -------------------------------------------------------------------------------- /common/http.interceptor.js: -------------------------------------------------------------------------------- 1 | const install = (Vue, vm) => { 2 | // 请求配置 3 | Vue.prototype.$u.http.setConfig({ 4 | baseUrl: vm.$C.apiUrl, 5 | loadingText: '加载中...', 6 | loadingTime: 300, 7 | noToken: false, 8 | header: { 9 | 'content-type': 'application/json;charset=UTF-8', 10 | 'Authorization': '' 11 | } 12 | }); 13 | 14 | // 请求拦截部分 15 | Vue.prototype.$u.http.interceptor.request = (config) => { 16 | let noTokenUrl = [ 17 | 'user/login', 18 | 'user/create', 19 | 'user/codeLogin', 20 | 'user/refreshToken', 21 | 'user/code', 22 | 'user/getUser', 23 | 'task/detail' 24 | ]; 25 | if (noTokenUrl.indexOf(config.url) != '-1') { 26 | config.header.noToken = true; 27 | } else { 28 | let user = uni.getStorageSync('user'); 29 | if (user) { 30 | const token = JSON.parse(user); 31 | config.header.Authorization = token.accessToken; 32 | } else { 33 | config.header.noToken = true; 34 | } 35 | } 36 | // 判断是否需要刷新token 37 | const loginTime = uni.getStorageSync('loginTime'); 38 | const diffTime = Math.round(new Date() / 1000) - loginTime; 39 | const userInfo = vm.$U.getUserInfo(); 40 | if (loginTime && userInfo && diffTime > 3600 * 24) { 41 | uni.request({ 42 | url: vm.$C.apiUrl + '/user/refreshToken', 43 | method: 'POST', 44 | data: { 45 | refreshToken: userInfo.refreshToken 46 | }, 47 | success: (refreshRes) => { 48 | let refreshData = refreshRes.data; 49 | let user = vm.$u.deepMerge(userInfo, refreshData.data); 50 | if (refreshData.code == 200) { 51 | vm.$store.commit('login', user); 52 | } else { 53 | vm.$store.commit('logout'); 54 | } 55 | } 56 | }); 57 | } 58 | return config; 59 | } 60 | 61 | // 响应拦截 62 | Vue.prototype.$u.http.interceptor.response = (res) => { 63 | if (res.code == 200) { 64 | return res; 65 | } else if (res.code == '-100') { 66 | vm.$U.outputMsg('你还没登录,请先登录'); 67 | setTimeout(() => { 68 | return uni.navigateTo({ 69 | url: '/pages/login/login' 70 | }); 71 | }, 800); 72 | } else { 73 | return { 74 | message: res.message, 75 | code: res.code, 76 | }; 77 | } 78 | } 79 | } 80 | 81 | export default { 82 | install 83 | } 84 | -------------------------------------------------------------------------------- /common/util.js: -------------------------------------------------------------------------------- 1 | // 引入全局配置文件 2 | import config from '@/common/config.js'; 3 | export default { 4 | /** 5 | * 验证手机号是否合法 6 | * @param {Number} number 7 | */ 8 | checkPhone(number) { 9 | let reg = /^1([38]\d|5[0-35-9]|7[3678])\d{8}$/; 10 | if (number == '' || number.length != 11 || !reg.test(number)) return false; 11 | return true; 12 | }, 13 | /** 14 | * 数字转汉字 15 | * @param {Object} num 16 | */ 17 | numberToHz(num) { 18 | let arr = ['一', '二', '三', '四', '五', '六']; 19 | return arr[num - 1]; 20 | }, 21 | /** 22 | * 快捷输出提示 23 | * @param {String} msg 24 | */ 25 | outputMsg(msg) { 26 | return uni.showToast({ 27 | icon: 'none', 28 | title: msg 29 | }); 30 | }, 31 | /** 32 | * 获取设备ClientID 33 | */ 34 | getClientId() { 35 | // #ifdef APP-PLUS 36 | const clientInfo = plus.push.getClientInfo() 37 | return clientInfo.clientid; 38 | // #endif 39 | }, 40 | /** 41 | * 获取用户Token 42 | */ 43 | getUserToken() { 44 | const info = uni.getStorageSync('user'); 45 | return info ? JSON.parse(info).accessToken : false; 46 | }, 47 | /** 48 | * 获取用户刷新Token 49 | */ 50 | getUserRefreshToken() { 51 | const info = uni.getStorageSync('user'); 52 | return info ? JSON.parse(info).refreshToken : false; 53 | }, 54 | /** 55 | * 获取用户信息 56 | */ 57 | getUserInfo() { 58 | const info = uni.getStorageSync('user'); 59 | return info ? JSON.parse(info) : false; 60 | }, 61 | /** 62 | * 获取任务类型名称 63 | * @param {Number} index 64 | */ 65 | getTaskTypeName(index) { 66 | if (config.indexClassTab[index]) { 67 | return config.indexClassTab[index].name 68 | } 69 | }, 70 | /** 71 | * 获取时间戳 不为空时 转换秒 为空获取当前时间戳(秒) 72 | * @param {Object} time 73 | */ 74 | getTime(time = false) { 75 | if (!time) return Math.round(new Date() / 1000); 76 | return Math.round(time / 1000); 77 | }, 78 | 79 | /** 80 | * 生成随机数 81 | * @param {Object} min 82 | * @param {Object} max 83 | */ 84 | random(min, max) { 85 | return Math.floor(Math.random() * (max - min)) + min; 86 | }, 87 | /** 88 | * 判断是否是数字 89 | * @param {Object} val 90 | */ 91 | isRealNum(val) { 92 | if (val === "" || val == null) return false; 93 | if (!isNaN(val)) return true; 94 | return false; 95 | }, 96 | /** 97 | * 隐藏手机号4位 98 | * @param {Object} number 99 | */ 100 | hiddenPhone(number) { 101 | number = "" + number; 102 | var reg = /(\d{3})\d{4}(\d{4})/; 103 | return number.replace(reg, "$1****$2") 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /components/m-chat/m-chat.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 45 | 46 | 92 | -------------------------------------------------------------------------------- /components/m-help-list/m-help-list.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /components/m-hot-list/m-hot-list.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /components/m-index-hot/m-index-hot.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /components/m-index-list/m-index-list.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /components/m-notice-list/m-notice-list.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 32 | 33 | 36 | -------------------------------------------------------------------------------- /components/m-notice/m-notice.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 44 | 45 | 48 | -------------------------------------------------------------------------------- /components/m-payment-list/m-payment-list.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 43 | 44 | 113 | 114 | -------------------------------------------------------------------------------- /components/m-popup/m-popup.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 29 | 30 | 33 | -------------------------------------------------------------------------------- /components/m-tabs/m-tabs.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 36 | 37 | 45 | -------------------------------------------------------------------------------- /components/m-tags/m-tags.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 27 | 28 | 34 | -------------------------------------------------------------------------------- /components/m-talk-list/m-talk-list.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 36 | 37 | 78 | -------------------------------------------------------------------------------- /components/m-task-list/m-task-list.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 38 | 39 | 77 | -------------------------------------------------------------------------------- /components/super-man-icon/super-man-icon.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | 17 | 20 | -------------------------------------------------------------------------------- /components/uni-badge/uni-badge.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 67 | 68 | -------------------------------------------------------------------------------- /components/uni-icons/icons.js: -------------------------------------------------------------------------------- 1 | export default { 2 | "pulldown": "\ue588", 3 | "refreshempty": "\ue461", 4 | "back": "\ue471", 5 | "forward": "\ue470", 6 | "more": "\ue507", 7 | "more-filled": "\ue537", 8 | "scan": "\ue612", 9 | "qq": "\ue264", 10 | "weibo": "\ue260", 11 | "weixin": "\ue261", 12 | "pengyouquan": "\ue262", 13 | "loop": "\ue565", 14 | "refresh": "\ue407", 15 | "refresh-filled": "\ue437", 16 | "arrowthindown": "\ue585", 17 | "arrowthinleft": "\ue586", 18 | "arrowthinright": "\ue587", 19 | "arrowthinup": "\ue584", 20 | "undo-filled": "\ue7d6", 21 | "undo": "\ue406", 22 | "redo": "\ue405", 23 | "redo-filled": "\ue7d9", 24 | "bars": "\ue563", 25 | "chatboxes": "\ue203", 26 | "camera": "\ue301", 27 | "chatboxes-filled": "\ue233", 28 | "camera-filled": "\ue7ef", 29 | "cart-filled": "\ue7f4", 30 | "cart": "\ue7f5", 31 | "checkbox-filled": "\ue442", 32 | "checkbox": "\ue7fa", 33 | "arrowleft": "\ue582", 34 | "arrowdown": "\ue581", 35 | "arrowright": "\ue583", 36 | "smallcircle-filled": "\ue801", 37 | "arrowup": "\ue580", 38 | "circle": "\ue411", 39 | "eye-filled": "\ue568", 40 | "eye-slash-filled": "\ue822", 41 | "eye-slash": "\ue823", 42 | "eye": "\ue824", 43 | "flag-filled": "\ue825", 44 | "flag": "\ue508", 45 | "gear-filled": "\ue532", 46 | "reload": "\ue462", 47 | "gear": "\ue502", 48 | "hand-thumbsdown-filled": "\ue83b", 49 | "hand-thumbsdown": "\ue83c", 50 | "hand-thumbsup-filled": "\ue83d", 51 | "heart-filled": "\ue83e", 52 | "hand-thumbsup": "\ue83f", 53 | "heart": "\ue840", 54 | "home": "\ue500", 55 | "info": "\ue504", 56 | "home-filled": "\ue530", 57 | "info-filled": "\ue534", 58 | "circle-filled": "\ue441", 59 | "chat-filled": "\ue847", 60 | "chat": "\ue263", 61 | "mail-open-filled": "\ue84d", 62 | "email-filled": "\ue231", 63 | "mail-open": "\ue84e", 64 | "email": "\ue201", 65 | "checkmarkempty": "\ue472", 66 | "list": "\ue562", 67 | "locked-filled": "\ue856", 68 | "locked": "\ue506", 69 | "map-filled": "\ue85c", 70 | "map-pin": "\ue85e", 71 | "map-pin-ellipse": "\ue864", 72 | "map": "\ue364", 73 | "minus-filled": "\ue440", 74 | "mic-filled": "\ue332", 75 | "minus": "\ue410", 76 | "micoff": "\ue360", 77 | "mic": "\ue302", 78 | "clear": "\ue434", 79 | "smallcircle": "\ue868", 80 | "close": "\ue404", 81 | "closeempty": "\ue460", 82 | "paperclip": "\ue567", 83 | "paperplane": "\ue503", 84 | "paperplane-filled": "\ue86e", 85 | "person-filled": "\ue131", 86 | "contact-filled": "\ue130", 87 | "person": "\ue101", 88 | "contact": "\ue100", 89 | "images-filled": "\ue87a", 90 | "phone": "\ue200", 91 | "images": "\ue87b", 92 | "image": "\ue363", 93 | "image-filled": "\ue877", 94 | "location-filled": "\ue333", 95 | "location": "\ue303", 96 | "plus-filled": "\ue439", 97 | "plus": "\ue409", 98 | "plusempty": "\ue468", 99 | "help-filled": "\ue535", 100 | "help": "\ue505", 101 | "navigate-filled": "\ue884", 102 | "navigate": "\ue501", 103 | "mic-slash-filled": "\ue892", 104 | "search": "\ue466", 105 | "settings": "\ue560", 106 | "sound": "\ue590", 107 | "sound-filled": "\ue8a1", 108 | "spinner-cycle": "\ue465", 109 | "download-filled": "\ue8a4", 110 | "personadd-filled": "\ue132", 111 | "videocam-filled": "\ue8af", 112 | "personadd": "\ue102", 113 | "upload": "\ue402", 114 | "upload-filled": "\ue8b1", 115 | "starhalf": "\ue463", 116 | "star-filled": "\ue438", 117 | "star": "\ue408", 118 | "trash": "\ue401", 119 | "phone-filled": "\ue230", 120 | "compose": "\ue400", 121 | "videocam": "\ue300", 122 | "trash-filled": "\ue8dc", 123 | "download": "\ue403", 124 | "chatbubble-filled": "\ue232", 125 | "chatbubble": "\ue202", 126 | "cloud-download": "\ue8e4", 127 | "cloud-upload-filled": "\ue8e5", 128 | "cloud-upload": "\ue8e6", 129 | "cloud-download-filled": "\ue8e9", 130 | "headphones":"\ue8bf", 131 | "shop":"\ue609" 132 | } 133 | -------------------------------------------------------------------------------- /components/uni-list/uni-list.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 52 | -------------------------------------------------------------------------------- /components/uni-list/uni-refresh.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 59 | 60 | -------------------------------------------------------------------------------- /components/uni-list/uni-refresh.wxs: -------------------------------------------------------------------------------- 1 | var pullDown = { 2 | threshold: 95, 3 | maxHeight: 200, 4 | callRefresh: 'onrefresh', 5 | callPullingDown: 'onpullingdown', 6 | refreshSelector: '.uni-refresh' 7 | }; 8 | 9 | function ready(newValue, oldValue, ownerInstance, instance) { 10 | var state = instance.getState() 11 | state.canPullDown = newValue; 12 | // console.log(newValue); 13 | } 14 | 15 | function touchStart(e, instance) { 16 | var state = instance.getState(); 17 | state.refreshInstance = instance.selectComponent(pullDown.refreshSelector); 18 | state.canPullDown = (state.refreshInstance != null && state.refreshInstance != undefined); 19 | if (!state.canPullDown) { 20 | return 21 | } 22 | 23 | // console.log("touchStart"); 24 | 25 | state.height = 0; 26 | state.touchStartY = e.touches[0].pageY || e.changedTouches[0].pageY; 27 | state.refreshInstance.setStyle({ 28 | 'height': 0 29 | }); 30 | state.refreshInstance.callMethod("onchange", true); 31 | } 32 | 33 | function touchMove(e, ownerInstance) { 34 | var instance = e.instance; 35 | var state = instance.getState(); 36 | if (!state.canPullDown) { 37 | return 38 | } 39 | 40 | var oldHeight = state.height; 41 | var endY = e.touches[0].pageY || e.changedTouches[0].pageY; 42 | var height = endY - state.touchStartY; 43 | if (height > pullDown.maxHeight) { 44 | return; 45 | } 46 | 47 | var refreshInstance = state.refreshInstance; 48 | refreshInstance.setStyle({ 49 | 'height': height + 'px' 50 | }); 51 | 52 | height = height < pullDown.maxHeight ? height : pullDown.maxHeight; 53 | state.height = height; 54 | refreshInstance.callMethod(pullDown.callPullingDown, { 55 | height: height 56 | }); 57 | } 58 | 59 | function touchEnd(e, ownerInstance) { 60 | var state = e.instance.getState(); 61 | if (!state.canPullDown) { 62 | return 63 | } 64 | 65 | state.refreshInstance.callMethod("onchange", false); 66 | 67 | var refreshInstance = state.refreshInstance; 68 | if (state.height > pullDown.threshold) { 69 | refreshInstance.callMethod(pullDown.callRefresh); 70 | return; 71 | } 72 | 73 | refreshInstance.setStyle({ 74 | 'height': 0 75 | }); 76 | } 77 | 78 | function propObserver(newValue, oldValue, instance) { 79 | pullDown = newValue; 80 | } 81 | 82 | module.exports = { 83 | touchmove: touchMove, 84 | touchstart: touchStart, 85 | touchend: touchEnd, 86 | propObserver: propObserver 87 | } 88 | -------------------------------------------------------------------------------- /components/uni-popup/message.js: -------------------------------------------------------------------------------- 1 | export default { 2 | created() { 3 | if (this.type === 'message') { 4 | // 获取自组件对象 5 | this.maskShow = false 6 | this.children = null 7 | } 8 | }, 9 | created() { 10 | if (this.type === 'message') { 11 | // 不显示遮罩 12 | this.maskShow = false 13 | // 获取子组件对象 14 | this.childrenMsg = null 15 | } 16 | }, 17 | methods: { 18 | customOpen() { 19 | if (this.childrenMsg) { 20 | this.childrenMsg.open() 21 | } 22 | }, 23 | customClose() { 24 | if (this.childrenMsg) { 25 | this.childrenMsg.close() 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /components/uni-popup/popup.js: -------------------------------------------------------------------------------- 1 | import message from './message.js'; 2 | // 定义 type 类型:弹出类型:top/bottom/center 3 | const config = { 4 | // 顶部弹出 5 | top:'top', 6 | // 底部弹出 7 | bottom:'bottom', 8 | // 居中弹出 9 | center:'center', 10 | // 消息提示 11 | message:'top', 12 | // 对话框 13 | dialog:'center', 14 | // 分享 15 | share:'bottom', 16 | } 17 | 18 | export default { 19 | data(){ 20 | return { 21 | config:config 22 | } 23 | }, 24 | mixins: [message], 25 | } 26 | -------------------------------------------------------------------------------- /components/uni-popup/uni-popup-message.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 67 | -------------------------------------------------------------------------------- /components/uni-popup/uni-popup-share.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 86 | -------------------------------------------------------------------------------- /components/uni-status-bar/uni-status-bar.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 18 | 19 | -------------------------------------------------------------------------------- /components/vip-home-list/vip-home-list.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 35 | 36 | 39 | -------------------------------------------------------------------------------- /js_sdk/junyi-h5-copy/junyi-h5-copy/junyi-h5-copy.js: -------------------------------------------------------------------------------- 1 | export default function h5Copy(content) { 2 | 3 | if (!document.queryCommandSupported('copy')) { 4 | // 不支持 5 | return false 6 | } 7 | 8 | let textarea = document.createElement("textarea") 9 | textarea.value = content 10 | textarea.readOnly = "readOnly" 11 | document.body.appendChild(textarea) 12 | textarea.select() // 选择对象 13 | textarea.setSelectionRange(0, content.length) //核心 14 | let result = document.execCommand("copy") // 执行浏览器复制命令 15 | textarea.remove() 16 | return result 17 | 18 | } -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App' 3 | import store from './store/index.js'; 4 | 5 | import uView from "uview-ui"; 6 | Vue.use(uView); 7 | 8 | Vue.prototype.$store = store; 9 | 10 | Vue.config.productionTip = false 11 | 12 | // 引入全局配置文件 13 | import $C from '@/common/config.js'; 14 | Vue.prototype.$C = $C; 15 | 16 | // 引入助手函数 17 | import $U from '@/common/util.js'; 18 | Vue.prototype.$U = $U; 19 | 20 | // 权限验证 21 | Vue.prototype.checkAuth = (callback) => { 22 | if (!store.state.loginStatus) { 23 | $U.outputMsg('你还没有登陆,请先登陆'); 24 | return uni.navigateTo({ 25 | url: '/pages/login/login', 26 | }); 27 | } 28 | callback(); 29 | } 30 | 31 | // 权限验证跳转 32 | Vue.prototype.navigateTo = (options) => { 33 | if (!store.state.loginStatus) { 34 | $U.outputMsg('你还没有登陆,请先登陆'); 35 | return uni.navigateTo({ 36 | url: '/pages/login/login', 37 | }); 38 | } 39 | return uni.navigateTo(options); 40 | } 41 | 42 | App.mpType = 'app' 43 | 44 | const app = new Vue({ 45 | store, 46 | ...App 47 | }) 48 | 49 | // http拦截器 50 | import httpInterceptor from '@/common/http.interceptor.js' 51 | Vue.use(httpInterceptor, app); 52 | 53 | app.$mount() 54 | -------------------------------------------------------------------------------- /pages/addTask/addTask.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 49 | 50 | 53 | -------------------------------------------------------------------------------- /pages/approval/detail.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 103 | 104 | 107 | -------------------------------------------------------------------------------- /pages/bond/bond.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 35 | 36 | 53 | -------------------------------------------------------------------------------- /pages/bond/recharge.vue: -------------------------------------------------------------------------------- 1 | 34 | 35 | 72 | 73 | 83 | -------------------------------------------------------------------------------- /pages/deposit/deposit.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /pages/help/data.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | name: '关于商家', 4 | list: [ 5 | { 6 | type: '关于商家', 7 | title: '发布任务后多久会审核?', 8 | content: '发布任务后一小时内生贺' 9 | } 10 | ] 11 | }, 12 | { 13 | name: '关于用户', 14 | list: [ 15 | { 16 | type: '关于用户', 17 | title: '发布任务后多久会审核?', 18 | content: '发布任务后一小时内生贺' 19 | } 20 | ] 21 | }, 22 | { 23 | name: '发布规则', 24 | list: [ 25 | { 26 | type: '发布规则', 27 | title: '发布任务后多久会审核?', 28 | content: '发布任务后一小时内生贺' 29 | } 30 | ] 31 | }, 32 | { 33 | name: '关于复审', 34 | list: [ 35 | { 36 | type: '关于复审', 37 | title: '关于复审?', 38 | content: '发布任务后一小时内生贺' 39 | } 40 | ] 41 | } 42 | ]; 43 | -------------------------------------------------------------------------------- /pages/help/detail.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /pages/help/help.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 83 | 84 | 97 | -------------------------------------------------------------------------------- /pages/hot/hot.vue: -------------------------------------------------------------------------------- 1 | 49 | 50 | 126 | 127 | 132 | -------------------------------------------------------------------------------- /pages/inv/data.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | '张三', '刘德华', '企鹅小屋', '云朵', '酷酷酷', '爱奔跑的小孩' 3 | ]; 4 | -------------------------------------------------------------------------------- /pages/notice/notice.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 59 | 60 | 63 | -------------------------------------------------------------------------------- /pages/orderDetail/orderDetail.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 94 | 95 | 98 | -------------------------------------------------------------------------------- /pages/setting/setting.vue: -------------------------------------------------------------------------------- 1 | 43 | 44 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /pages/talk/index.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 36 | 37 | 56 | -------------------------------------------------------------------------------- /pages/taskDetail/taskDetail.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 58 | 59 | 62 | -------------------------------------------------------------------------------- /pages/taskPreview/taskPreview.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 34 | 35 | 38 | -------------------------------------------------------------------------------- /pages/wallet/bankData.js: -------------------------------------------------------------------------------- 1 | // 这里是填写 支持的银行 2 | export default [ 3 | 'ICBC', 4 | 'CCB', 5 | 'HSBC', 6 | 'BC', 7 | 'ABC', 8 | 'BC', 9 | 'CMB', 10 | 'SPDB', 11 | 'CEB', 12 | 'CITIC', 13 | 'HXBANK', 14 | 'SPABANK', 15 | 'CIB', 16 | 'SHBANK', 17 | 'GDB', 18 | 'GCB', 19 | 'CITI', 20 | 'CZBANK' 21 | ]; 22 | -------------------------------------------------------------------------------- /pages/wallet/payment.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 40 | 41 | 44 | -------------------------------------------------------------------------------- /static/iconfont.css: -------------------------------------------------------------------------------- 1 | @font-face {font-family: "iconfont"; 2 | src: url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAO8AAsAAAAAB9AAAANvAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDBgqDOIMXATYCJAMMCwgABCAFhG0HNhvdBsgOJS2RwABgAABgBNUa1rO7d0FwiQKUkYDlowDAiEQCCf/ujSFjSbIR+ek96yWzEOakBZQeWXDSZOt0ehC+jPQMftfnOVzatATmB8pljuVRL0vjgAIaa1MUBlogJ+g3jF3QEg8TaDaoM2alqccACFKYowJxI5r1EJQxKA3loVGoKxYW8QaVxnTPXgPwGvw+/kNeBJFUmTlx9azRBDW/rB92oIm+iXY8Agins4EtI2MKKMRepWMDihJTkGZV4decXytCmirs8xEINFlt/cMjCaJmlraCMZRM/LI6gkS5A4qu+qAMajTiFfgKJq3XZ1Zy+0xYWLR2Rilh4vbDc47uZJi7E7OP2eQ9DPPhIffgwaB79wacv98C1txruPCgJTPpbPnDh4Pv3x94+DTA7a5r59oeu6dYcasg5MCdSXeLQ+ccTn44Sc7xOSczmWVsI1PoYu8kOSTkYcvErW3codCsOSxCi243bFwZGkcWTn3svXuj55CxsSw8L0Pll/boJ8TnFXQoyIsX8NFa76kPeTWpgj+n0Icuunh0EbK4HjfqoOcU/kICx/XROZ0ChHbzcwLl969khLmYi9+RM7+dgA8UXnxSNLg0Kj66Tw9dq54tdT2Shu/tm65AQosjtTJcdHhrj+Yt6fFrYIuBUT2iYQXAxEd5kN1hylbNWHbjRnasBnD9hrFspkP6XqWSHT2aUWoQF1mVjAZyoZ9VatjMFBYOAN435Y9IGaTk/AAN+ol/4+eXGTO1kRX/g1oK+BalGQL975sKdC/SKMGEv0zYsaZoYtOYiyJwBEY6O+b/QniQx5V+VCV0ezHc1QcSW2jkQoikwQCyRkPEQp1CpcU0ao3m0WwSt7xFDwkSpQkTpgGETjuRtPuErNN1YqE+R6Xfd9Q6A6HZWsRu2GIkxJB6iegpMWHDKCwaHXbeNtOQsLwfMXuseiktDuiDiOQWwzg3Kyef5oidSFNMcQ8351HKY15y2HATOI5YrQ7slBzNxEizBEqdZdnZfNWLsowOG4RYJiH0KMIEMxgFExk52PFecyqk8P1+CDMPKz2poarKOQghcRPbx3JlyelA5BT2TlW38ozbcGZ5KIqH8SQONlgT6EdYWTlgzup+zQgjKoswIOZUJtuqx3dVZC2vsr3fFmhm7pYjRY6iXBPe48/rDZ4uAAA=') format('woff2') 3 | } 4 | 5 | .iconfont { 6 | font-family: "iconfont" !important; 7 | font-size: 16px; 8 | font-style: normal; 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | } 12 | 13 | .iconkefu:before { 14 | content: "\e6ae"; 15 | } 16 | 17 | .iconfabu-:before { 18 | content: "\e66c"; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /static/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/iconfont.ttf -------------------------------------------------------------------------------- /static/image/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/1.png -------------------------------------------------------------------------------- /static/image/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/2.png -------------------------------------------------------------------------------- /static/image/alipay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/alipay.png -------------------------------------------------------------------------------- /static/image/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/camera.png -------------------------------------------------------------------------------- /static/image/dsh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/dsh.png -------------------------------------------------------------------------------- /static/image/dtj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/dtj.png -------------------------------------------------------------------------------- /static/image/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/home.png -------------------------------------------------------------------------------- /static/image/home_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/home_selected.png -------------------------------------------------------------------------------- /static/image/hot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/hot.png -------------------------------------------------------------------------------- /static/image/idcard1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/idcard1.png -------------------------------------------------------------------------------- /static/image/idcard2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/idcard2.png -------------------------------------------------------------------------------- /static/image/idcard3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/idcard3.jpg -------------------------------------------------------------------------------- /static/image/inv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/inv.png -------------------------------------------------------------------------------- /static/image/invHb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/invHb.jpg -------------------------------------------------------------------------------- /static/image/inv_desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/inv_desc.png -------------------------------------------------------------------------------- /static/image/inv_foot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/inv_foot.png -------------------------------------------------------------------------------- /static/image/inv_index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/inv_index.png -------------------------------------------------------------------------------- /static/image/inv_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/inv_selected.png -------------------------------------------------------------------------------- /static/image/jg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/jg.png -------------------------------------------------------------------------------- /static/image/jia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/jia.png -------------------------------------------------------------------------------- /static/image/mao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/mao.png -------------------------------------------------------------------------------- /static/image/my.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/my.png -------------------------------------------------------------------------------- /static/image/my_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/my_selected.png -------------------------------------------------------------------------------- /static/image/rank_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/rank_1.png -------------------------------------------------------------------------------- /static/image/rank_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/rank_2.png -------------------------------------------------------------------------------- /static/image/rank_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/rank_3.png -------------------------------------------------------------------------------- /static/image/tj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/tj.png -------------------------------------------------------------------------------- /static/image/tj_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/tj_selected.png -------------------------------------------------------------------------------- /static/image/tupian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/tupian.png -------------------------------------------------------------------------------- /static/image/vipbj.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/vipbj.jpg -------------------------------------------------------------------------------- /static/image/vipbj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/vipbj.png -------------------------------------------------------------------------------- /static/image/wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/wechat.png -------------------------------------------------------------------------------- /static/image/wtg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/wtg.png -------------------------------------------------------------------------------- /static/image/ytg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/ytg.png -------------------------------------------------------------------------------- /static/image/zhuanshi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/image/zhuanshi.png -------------------------------------------------------------------------------- /static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/force-boot/uniappRewardCat/04801b68f4ce7d8f1b19a7a1db0be61155c4a30e/static/logo.png -------------------------------------------------------------------------------- /store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Vuex from 'vuex'; 3 | 4 | Vue.use(Vuex); 5 | 6 | // 引入全局配置文件 7 | import config from '@/common/config.js'; 8 | export default new Vuex.Store({ 9 | state: { 10 | loginStatus: false, 11 | loginTime: 0, 12 | user: { 13 | 14 | }, 15 | }, 16 | mutations: { 17 | login(state, user) { 18 | let time = Math.round(new Date() / 1000); 19 | state.loginStatus = true; 20 | state.user = user; 21 | state.loginTime = time; 22 | uni.setStorageSync('loginTime', time); 23 | uni.setStorageSync('user', JSON.stringify(user)); 24 | }, 25 | initLogin(state) { 26 | let user = uni.getStorageSync('user'); 27 | let loginTime = uni.getStorageSync('loginTime'); 28 | if (user && loginTime) { 29 | state.loginTime = loginTime; 30 | state.loginStatus = true; 31 | state.user = JSON.parse(user); 32 | } 33 | }, 34 | logout(state) { 35 | state.loginStatus = false; 36 | uni.removeStorageSync('loginTime'); 37 | uni.removeStorageSync('user'); 38 | }, 39 | } 40 | }) 41 | -------------------------------------------------------------------------------- /uni.scss: -------------------------------------------------------------------------------- 1 | @import 'uview-ui/theme.scss'; -------------------------------------------------------------------------------- /uview-ui/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 www.uviewui.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /uview-ui/README.md: -------------------------------------------------------------------------------- 1 |

2 | logo 3 |

4 |

uView

5 |

多平台快速开发的UI框架

6 | 7 | 8 | ## 说明 9 | 10 | uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水 11 | 12 | ## 特性 13 | 14 | - 兼容安卓,iOS,微信小程序,H5,QQ小程序,百度小程序,支付宝小程序,头条小程序 15 | - 60+精选组件,功能丰富,多端兼容,让您快速集成,开箱即用 16 | - 众多贴心的JS利器,让您飞镖在手,召之即来,百步穿杨 17 | - 众多的常用页面和布局,让您专注逻辑,事半功倍 18 | - 详尽的文档支持,现代化的演示效果 19 | - 按需引入,精简打包体积 20 | 21 | 22 | ## 安装 23 | 24 | ```bash 25 | # npm方式安装 26 | npm i uview-ui 27 | ``` 28 | 29 | ## 快速上手 30 | 31 | 1. `main.js`引入uView库 32 | ```js 33 | // main.js 34 | import uView from 'uview-ui'; 35 | Vue.use(uView); 36 | ``` 37 | 38 | 2. `App.vue`引入基础样式(注意style标签需声明scss属性支持) 39 | ```css 40 | /* App.vue */ 41 | 44 | ``` 45 | 46 | 3. `uni.scss`引入全局scss变量文件 47 | ```css 48 | /* uni.scss */ 49 | @import "uview-ui/theme.scss"; 50 | ``` 51 | 52 | 4. `pages.json`配置easycom规则(按需引入) 53 | 54 | ```js 55 | // pages.json 56 | { 57 | "easycom": { 58 | "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" 59 | }, 60 | // 此为本身已有的内容 61 | "pages": [ 62 | // ...... 63 | ] 64 | } 65 | ``` 66 | 67 | 请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容 68 | 69 | ## 使用方法 70 | 配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。 71 | 72 | ```html 73 | 76 | ``` 77 | 78 | 请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容 79 | 80 | ## 链接 81 | 82 | - [官方文档](https://uviewui.com/) 83 | - [更新日志](https://uviewui.com/components/changelog.html) 84 | - [升级指南](https://uviewui.com/components/changelog.html) 85 | - [关于我们](https://uviewui.com/cooperation/about.html) 86 | 87 | ## 预览 88 | 89 | 您可以通过**微信**扫码,查看最佳的演示效果。 90 |
91 |
92 | 93 | 94 | 101 | ## 版权信息 102 | uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。 103 | -------------------------------------------------------------------------------- /uview-ui/components/u-back-top/u-back-top.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 124 | 125 | 146 | -------------------------------------------------------------------------------- /uview-ui/components/u-cell-group/u-cell-group.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 56 | 57 | 73 | -------------------------------------------------------------------------------- /uview-ui/components/u-checkbox-group/u-checkbox-group.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 98 | 99 | 107 | -------------------------------------------------------------------------------- /uview-ui/components/u-col/u-col.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 39 | 40 | 99 | -------------------------------------------------------------------------------- /uview-ui/components/u-collapse/u-collapse.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 95 | 96 | 99 | -------------------------------------------------------------------------------- /uview-ui/components/u-divider/u-divider.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 107 | 108 | 132 | -------------------------------------------------------------------------------- /uview-ui/components/u-empty/u-empty.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 96 | 97 | 117 | -------------------------------------------------------------------------------- /uview-ui/components/u-form/u-form.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /uview-ui/components/u-full-screen/u-full-screen.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 38 | 39 | 51 | -------------------------------------------------------------------------------- /uview-ui/components/u-gap/u-gap.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /uview-ui/components/u-grid-item/u-grid-item.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 70 | 71 | 112 | -------------------------------------------------------------------------------- /uview-ui/components/u-grid/u-grid.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 77 | 78 | 94 | -------------------------------------------------------------------------------- /uview-ui/components/u-index-anchor/u-index-anchor.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 60 | 61 | 80 | -------------------------------------------------------------------------------- /uview-ui/components/u-line-progress/u-line-progress.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 95 | 96 | 137 | -------------------------------------------------------------------------------- /uview-ui/components/u-line/u-line.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 68 | 69 | 74 | -------------------------------------------------------------------------------- /uview-ui/components/u-link/u-link.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 82 | 83 | 88 | -------------------------------------------------------------------------------- /uview-ui/components/u-loading/u-loading.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 53 | 54 | 100 | -------------------------------------------------------------------------------- /uview-ui/components/u-mask/u-mask.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 83 | 84 | 99 | -------------------------------------------------------------------------------- /uview-ui/components/u-number-keyboard/u-number-keyboard.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 117 | 118 | 153 | -------------------------------------------------------------------------------- /uview-ui/components/u-radio-group/u-radio-group.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 76 | 77 | 85 | -------------------------------------------------------------------------------- /uview-ui/components/u-read-more/u-read-more.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 128 | 129 | 165 | -------------------------------------------------------------------------------- /uview-ui/components/u-row/u-row.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 60 | 61 | 77 | -------------------------------------------------------------------------------- /uview-ui/components/u-section/u-section.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 85 | 86 | 122 | -------------------------------------------------------------------------------- /uview-ui/components/u-steps/u-steps.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 80 | 81 | 141 | -------------------------------------------------------------------------------- /uview-ui/components/u-sticky/u-sticky.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 145 | 146 | 151 | -------------------------------------------------------------------------------- /uview-ui/components/u-table/u-table.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 82 | 83 | 93 | -------------------------------------------------------------------------------- /uview-ui/components/u-td/u-td.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 53 | 54 | 114 | -------------------------------------------------------------------------------- /uview-ui/components/u-th/u-th.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 44 | 45 | 57 | -------------------------------------------------------------------------------- /uview-ui/components/u-time-line-item/u-time-line-item.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 52 | 53 | 82 | -------------------------------------------------------------------------------- /uview-ui/components/u-time-line/u-time-line.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 23 | 24 | 42 | -------------------------------------------------------------------------------- /uview-ui/components/u-top-tips/u-top-tips.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 69 | 70 | 120 | -------------------------------------------------------------------------------- /uview-ui/components/u-tr/u-tr.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 29 | 30 | 35 | -------------------------------------------------------------------------------- /uview-ui/index.js: -------------------------------------------------------------------------------- 1 | // 引入全局mixin 2 | import mixin from './libs/mixin/mixin.js' 3 | // 引入关于是否mixin集成小程序分享的配置 4 | import wxshare from './libs/mixin/mpShare.js' 5 | // 全局挂载引入http相关请求拦截插件 6 | import http from './libs/request' 7 | 8 | function wranning(str) { 9 | // 开发环境进行信息输出,主要是一些报错信息 10 | // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见: 11 | // https://uniapp.dcloud.io/frame?id=%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%92%8c%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83 12 | if (process.env.NODE_ENV === 'development') { 13 | console.warn(str) 14 | } 15 | } 16 | 17 | // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量 18 | // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式, 19 | // let vuexStore = {}; 20 | // try { 21 | // vuexStore = require("@/store/$u.mixin.js"); 22 | // } catch (e) { 23 | // //TODO handle the exception 24 | // } 25 | 26 | // post类型对象参数转为get类型url参数 27 | import queryParams from './libs/function/queryParams.js' 28 | // 路由封装 29 | import route from './libs/function/route.js' 30 | // 时间格式化 31 | import timeFormat from './libs/function/timeFormat.js' 32 | // 时间戳格式化,返回多久之前 33 | import timeFrom from './libs/function/timeFrom.js' 34 | // 颜色渐变相关,colorGradient-颜色渐变,hexToRgb-十六进制颜色转rgb颜色,rgbToHex-rgb转十六进制 35 | import colorGradient from './libs/function/colorGradient.js' 36 | // 生成全局唯一guid字符串 37 | import guid from './libs/function/guid.js' 38 | // 主题相关颜色,info|success|warning|primary|default|error,此颜色已在uview.scss中定义,但是为js中也能使用,故也定义一份 39 | import color from './libs/function/color.js' 40 | // 根据type获取图标名称 41 | import type2icon from './libs/function/type2icon.js' 42 | // 打乱数组的顺序 43 | import randomArray from './libs/function/randomArray.js' 44 | // 对象和数组的深度克隆 45 | import deepClone from './libs/function/deepClone.js' 46 | // 对象深度拷贝 47 | import deepMerge from './libs/function/deepMerge.js' 48 | 49 | // 规则检验 50 | import test from './libs/function/test.js' 51 | // 随机数 52 | import random from './libs/function/random.js' 53 | // 去除空格 54 | import trim from './libs/function/trim.js' 55 | // toast提示,对uni.showToast的封装 56 | import toast from './libs/function/toast.js' 57 | 58 | 59 | // 配置信息 60 | import config from './libs/config/config.js' 61 | // 各个需要fixed的地方的z-index配置文件 62 | import zIndex from './libs/config/zIndex.js' 63 | 64 | const $u = { 65 | queryParams: queryParams, 66 | route: route, 67 | timeFormat: timeFormat, 68 | date: timeFormat, // 另名date 69 | timeFrom, 70 | colorGradient: colorGradient.colorGradient, 71 | guid, 72 | color, 73 | type2icon, 74 | randomArray, 75 | wranning, 76 | get: http.get, 77 | post: http.post, 78 | put: http.put, 79 | 'delete': http.delete, 80 | hexToRgb: colorGradient.hexToRgb, 81 | rgbToHex: colorGradient.rgbToHex, 82 | test, 83 | random, 84 | deepClone, 85 | deepMerge, 86 | trim, 87 | type: ['primary', 'success', 'error', 'warning', 'info'], 88 | http, 89 | toast, 90 | config, // uView配置信息相关,比如版本号 91 | zIndex 92 | } 93 | 94 | const install = Vue => { 95 | Vue.mixin(mixin) 96 | if (Vue.prototype.openShare) { 97 | Vue.mixin(mpShare); 98 | } 99 | // Vue.mixin(vuexStore); 100 | // 时间格式化,同时两个名称,date和timeFormat 101 | Vue.filter('timeFormat', (timestamp, format) => { 102 | return timeFormat(timestamp, format) 103 | }) 104 | Vue.filter('date', (timestamp, format) => { 105 | return timeFormat(timestamp, format) 106 | }) 107 | // 将多久以前的方法,注入到全局过滤器 108 | Vue.filter('timeFrom', (timestamp, format) => { 109 | return timeFrom(timestamp, format) 110 | }) 111 | Vue.prototype.$u = $u 112 | } 113 | 114 | export default { 115 | install 116 | } -------------------------------------------------------------------------------- /uview-ui/libs/config/config.js: -------------------------------------------------------------------------------- 1 | // 此版本发布于2020-05-26 2 | let version = '1.2.9'; 3 | 4 | export default { 5 | v: version, 6 | version: version 7 | } -------------------------------------------------------------------------------- /uview-ui/libs/config/zIndex.js: -------------------------------------------------------------------------------- 1 | // uniapp在H5中各API的z-index值如下: 2 | /** 3 | * actionsheet: 999 4 | * modal: 999 5 | * navigate: 998 6 | * tabbar: 998 7 | */ 8 | 9 | export default { 10 | toast: 10090, 11 | noNetwork: 10080, 12 | // popup包含popup,actionsheet,keyboard,picker的值 13 | popup: 10075, 14 | mask: 10070, 15 | navbar: 980, 16 | topTips: 975, 17 | sticky: 970, 18 | indexListSticky: 965, 19 | } -------------------------------------------------------------------------------- /uview-ui/libs/css/color.scss: -------------------------------------------------------------------------------- 1 | .u-type-primary-light { 2 | color: $u-type-primary-light!important; 3 | } 4 | 5 | .u-type-warning-light { 6 | color: $u-type-warning-light!important; 7 | } 8 | 9 | .u-type-success-light { 10 | color: $u-type-success-light!important; 11 | } 12 | 13 | .u-type-error-light { 14 | color: $u-type-error-light!important; 15 | } 16 | 17 | .u-type-info-light { 18 | color: $u-type-info-light!important; 19 | } 20 | 21 | .u-type-primary-light-bg { 22 | background-color: $u-type-primary-light!important; 23 | } 24 | 25 | .u-type-warning-light-bg { 26 | background-color: $u-type-warning-light!important; 27 | } 28 | 29 | .u-type-success-light-bg { 30 | background-color: $u-type-success-light!important; 31 | } 32 | 33 | .u-type-error-light-bg { 34 | background-color: $u-type-error-light!important; 35 | } 36 | 37 | .u-type-info-light-bg { 38 | background-color: $u-type-info-light!important; 39 | } 40 | 41 | .u-type-primary-dark { 42 | color: $u-type-primary-dark!important; 43 | } 44 | 45 | .u-type-warning-dark { 46 | color: $u-type-warning-dark!important; 47 | } 48 | 49 | .u-type-success-dark { 50 | color: $u-type-success-dark!important; 51 | } 52 | 53 | .u-type-error-dark { 54 | color: $u-type-error-dark!important; 55 | } 56 | 57 | .u-type-info-dark { 58 | color: $u-type-info-dark!important; 59 | } 60 | 61 | .u-type-primary-dark-bg { 62 | background-color: $u-type-primary-dark!important; 63 | } 64 | 65 | .u-type-warning-dark-bg { 66 | background-color: $u-type-warning-dark!important; 67 | } 68 | 69 | .u-type-success-dark-bg { 70 | background-color: $u-type-success-dark!important; 71 | } 72 | 73 | .u-type-error-dark-bg { 74 | background-color: $u-type-error-dark!important; 75 | } 76 | 77 | .u-type-info-dark-bg { 78 | background-color: $u-type-info-dark!important; 79 | } 80 | 81 | .u-type-primary-disabled { 82 | color: $u-type-primary-disabled!important; 83 | } 84 | 85 | .u-type-warning-disabled { 86 | color: $u-type-warning-disabled!important; 87 | } 88 | 89 | .u-type-success-disabled { 90 | color: $u-type-success-disabled!important; 91 | } 92 | 93 | .u-type-error-disabled { 94 | color: $u-type-error-disabled!important; 95 | } 96 | 97 | .u-type-info-disabled { 98 | color: $u-type-info-disabled!important; 99 | } 100 | 101 | .u-type-primary { 102 | color: $u-type-primary!important; 103 | } 104 | 105 | .u-type-warning { 106 | color: $u-type-warning!important; 107 | } 108 | 109 | .u-type-success { 110 | color: $u-type-success!important; 111 | } 112 | 113 | .u-type-error { 114 | color: $u-type-error!important; 115 | } 116 | 117 | .u-type-info { 118 | color: $u-type-info!important; 119 | } 120 | 121 | .u-type-primary-bg { 122 | background-color: $u-type-primary!important; 123 | } 124 | 125 | .u-type-warning-bg { 126 | background-color: $u-type-warning!important; 127 | } 128 | 129 | .u-type-success-bg { 130 | background-color: $u-type-success!important; 131 | } 132 | 133 | .u-type-error-bg { 134 | background-color: $u-type-error!important; 135 | } 136 | 137 | .u-type-info-bg { 138 | background-color: $u-type-info!important; 139 | } 140 | 141 | .u-main-color { 142 | color: $u-main-color; 143 | } 144 | 145 | .u-content-color { 146 | color: $u-content-color; 147 | } 148 | 149 | .u-tips-color { 150 | color: $u-tips-color; 151 | } 152 | 153 | .u-light-color { 154 | color: $u-light-color; 155 | } 156 | -------------------------------------------------------------------------------- /uview-ui/libs/css/common.scss: -------------------------------------------------------------------------------- 1 | .u-relative, 2 | .u-rela { 3 | position: relative; 4 | } 5 | 6 | .u-absolute, 7 | .u-abso { 8 | position: absolute; 9 | } 10 | 11 | .u-font-xs { 12 | font-size: 22rpx; 13 | } 14 | 15 | .u-font-sm { 16 | font-size: 26rpx; 17 | } 18 | 19 | .u-font-md { 20 | font-size: 28rpx; 21 | } 22 | 23 | .u-font-lg { 24 | font-size: 30rpx; 25 | } 26 | 27 | .u-font-xl { 28 | font-size: 34rpx; 29 | } 30 | 31 | .u-flex { 32 | display: flex; 33 | flex-direction: row; 34 | align-items: center; 35 | } 36 | 37 | .u-flex-wrap { 38 | flex-wrap: wrap; 39 | } 40 | 41 | .u-flex-nowrap { 42 | flex-wrap: nowrap; 43 | } 44 | 45 | .u-col-center { 46 | align-items: center; 47 | } 48 | 49 | .u-col-top { 50 | align-items: flex-start; 51 | } 52 | 53 | .u-col-bottom { 54 | align-items: flex-end; 55 | } 56 | 57 | .u-row-center { 58 | justify-content: center; 59 | } 60 | 61 | .u-row-left { 62 | justify-content: flex-start; 63 | } 64 | 65 | .u-row-right { 66 | justify-content: flex-end; 67 | } 68 | 69 | .u-row-between { 70 | justify-content: space-between; 71 | } 72 | 73 | .u-row-around { 74 | justify-content: space-around; 75 | } 76 | 77 | .u-text-left { 78 | text-align: left; 79 | } 80 | 81 | .u-text-center { 82 | text-align: center; 83 | } 84 | 85 | .u-text-right { 86 | text-align: right; 87 | } 88 | 89 | .u-flex-col { 90 | display: flex; 91 | flex-direction: column; 92 | } 93 | 94 | // 定义flex等分 95 | @for $i from 1 through 12 { 96 | .u-flex-#{$i} { 97 | flex: $i; 98 | } 99 | } 100 | 101 | // 定义字体(px)单位,小于20都为px单位字体 102 | @for $i from 9 to 20 { 103 | .u-font-#{$i} { 104 | font-size: $i + px; 105 | } 106 | } 107 | 108 | // 定义字体(rpx)单位,大于或等于20的都为rpx单位字体 109 | @for $i from 20 through 40 { 110 | .u-font-#{$i} { 111 | font-size: $i + rpx; 112 | } 113 | } 114 | 115 | // 定义内外边距,历遍1-80 116 | @for $i from 0 through 80 { 117 | // 只要双数和能被5除尽的数 118 | @if $i % 2 == 0 or $i % 5 == 0 { 119 | // 得出:u-margin-30或者u-m-30 120 | .u-margin-#{$i}, .u-m-#{$i} { 121 | margin: $i + rpx!important; 122 | } 123 | 124 | // 得出:u-padding-30或者u-p-30 125 | .u-padding-#{$i}, .u-p-#{$i} { 126 | padding: $i + rpx!important; 127 | } 128 | 129 | @each $short, $long in l left, t top, r right, b bottom { 130 | // 缩写版,结果如: u-m-l-30 131 | // 定义外边距 132 | .u-m-#{$short}-#{$i} { 133 | margin-#{$long}: $i + rpx!important; 134 | } 135 | 136 | // 定义内边距 137 | .u-p-#{$short}-#{$i} { 138 | padding-#{$long}: $i + rpx!important; 139 | } 140 | 141 | // 完整版,结果如:u-margin-left-30 142 | // 定义外边距 143 | .u-margin-#{$long}-#{$i} { 144 | margin-#{$long}: $i + rpx!important; 145 | } 146 | 147 | // 定义内边距 148 | .u-padding-#{$long}-#{$i} { 149 | padding-#{$long}: $i + rpx!important; 150 | } 151 | } 152 | } 153 | } 154 | 155 | -------------------------------------------------------------------------------- /uview-ui/libs/function/bem.js: -------------------------------------------------------------------------------- 1 | var array = require('./array.wxs'); 2 | var object = require('./object.wxs'); 3 | var PREFIX = 'van-'; 4 | 5 | function join(name, mods) { 6 | name = PREFIX + name; 7 | mods = mods.map(function(mod) { 8 | return name + '--' + mod; 9 | }); 10 | mods.unshift(name); 11 | return mods.join(' '); 12 | } 13 | 14 | function traversing(mods, conf) { 15 | if (!conf) { 16 | return; 17 | } 18 | 19 | if (typeof conf === 'string' || typeof conf === 'number') { 20 | mods.push(conf); 21 | } else if (array.isArray(conf)) { 22 | conf.forEach(function(item) { 23 | traversing(mods, item); 24 | }); 25 | } else if (typeof conf === 'object') { 26 | object.keys(conf).forEach(function(key) { 27 | conf[key] && mods.push(key); 28 | }); 29 | } 30 | } 31 | 32 | function bem(name, conf) { 33 | var mods = []; 34 | traversing(mods, conf); 35 | return join(name, mods); 36 | } 37 | 38 | module.exports.bem = bem; 39 | -------------------------------------------------------------------------------- /uview-ui/libs/function/color.js: -------------------------------------------------------------------------------- 1 | let color = { 2 | primary: "#2979ff", 3 | primaryDark: "#2b85e4", 4 | primaryDisabled: "#a0cfff", 5 | primaryLight: "#ecf5ff", 6 | bgColor: "#f3f4f6", 7 | 8 | info: "#909399", 9 | infoDark: "#82848a", 10 | infoDisabled: "#c8c9cc", 11 | infoLight: "#f4f4f5", 12 | 13 | warning: "#ff9900", 14 | warningDark: "#f29100", 15 | warningDisabled: "#fcbd71", 16 | warningLight: "#fdf6ec", 17 | 18 | error: "#fa3534", 19 | errorDark: "#dd6161", 20 | errorDisabled: "#fab6b6", 21 | errorLight: "#fef0f0", 22 | 23 | success: "#19be6b", 24 | successDark: "#18b566", 25 | successDisabled: "#71d5a1", 26 | successLight: "#dbf1e1", 27 | 28 | mainColor: "#303133", 29 | contentColor: "#606266", 30 | tipsColor: "#909399", 31 | lightColor: "#c0c4cc", 32 | borderColor: "#e4e7ed" 33 | } 34 | 35 | export default color; -------------------------------------------------------------------------------- /uview-ui/libs/function/colorGradient.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 求两个颜色之间的渐变值 3 | * @param {string} startColor 开始的颜色 4 | * @param {string} endColor 结束的颜色 5 | * @param {number} step 颜色等分的份额 6 | * */ 7 | function colorGradient(startColor = 'rgb(0, 0, 0)', endColor = 'rgb(255, 255, 255)', step = 10) { 8 | let startRGB = hexToRgb(startColor, false); //转换为rgb数组模式 9 | let startR = startRGB[0]; 10 | let startG = startRGB[1]; 11 | let startB = startRGB[2]; 12 | 13 | let endRGB = hexToRgb(endColor, false); 14 | let endR = endRGB[0]; 15 | let endG = endRGB[1]; 16 | let endB = endRGB[2]; 17 | 18 | let sR = (endR - startR) / step; //总差值 19 | let sG = (endG - startG) / step; 20 | let sB = (endB - startB) / step; 21 | let colorArr = []; 22 | for (let i = 0; i < step; i++) { 23 | //计算每一步的hex值 24 | let hex = rgbToHex('rgb(' + Math.round((sR * i + startR)) + ',' + Math.round((sG * i + startG)) + ',' + Math.round((sB * 25 | i + startB)) + ')'); 26 | colorArr.push(hex); 27 | } 28 | return colorArr; 29 | } 30 | 31 | // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式) 32 | function hexToRgb(sColor, str = true) { 33 | let reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; 34 | sColor = sColor.toLowerCase(); 35 | if (sColor && reg.test(sColor)) { 36 | if (sColor.length === 4) { 37 | let sColorNew = "#"; 38 | for (let i = 1; i < 4; i += 1) { 39 | sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); 40 | } 41 | sColor = sColorNew; 42 | } 43 | //处理六位的颜色值 44 | let sColorChange = []; 45 | for (let i = 1; i < 7; i += 2) { 46 | sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2))); 47 | } 48 | if(!str) { 49 | return sColorChange; 50 | } else { 51 | return `rgb(${sColorChange[0]},${sColorChange[1]},${sColorChange[2]})`; 52 | } 53 | } else if (/^(rgb|RGB)/.test(sColor)) { 54 | let arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",") 55 | return arr.map(val => Number(val)); 56 | } else { 57 | return sColor; 58 | } 59 | }; 60 | 61 | // 将rgb表示方式转换为hex表示方式 62 | function rgbToHex(rgb) { 63 | let _this = rgb; 64 | let reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; 65 | if (/^(rgb|RGB)/.test(_this)) { 66 | let aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(","); 67 | let strHex = "#"; 68 | for (let i = 0; i < aColor.length; i++) { 69 | let hex = Number(aColor[i]).toString(16); 70 | hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位 71 | if (hex === "0") { 72 | hex += hex; 73 | } 74 | strHex += hex; 75 | } 76 | if (strHex.length !== 7) { 77 | strHex = _this; 78 | } 79 | return strHex; 80 | } else if (reg.test(_this)) { 81 | let aNum = _this.replace(/#/, "").split(""); 82 | if (aNum.length === 6) { 83 | return _this; 84 | } else if (aNum.length === 3) { 85 | let numHex = "#"; 86 | for (let i = 0; i < aNum.length; i += 1) { 87 | numHex += (aNum[i] + aNum[i]); 88 | } 89 | return numHex; 90 | } 91 | } else { 92 | return _this; 93 | } 94 | } 95 | 96 | export default { 97 | colorGradient, 98 | hexToRgb, 99 | rgbToHex 100 | } -------------------------------------------------------------------------------- /uview-ui/libs/function/deepClone.js: -------------------------------------------------------------------------------- 1 | // 对象深度克隆 2 | function deepClone(object = {}) { 3 | var o, i, j, k; 4 | if (typeof(object) !== "object" || object === null) return object; 5 | if (object instanceof Array) { 6 | o = []; 7 | i = 0; 8 | j = object.length; 9 | for (; i < j; i++) { 10 | if (typeof(object[i]) === "object" && object[i] != null) { 11 | o[i] = deepClone(object[i]); 12 | } else { 13 | o[i] = object[i]; 14 | } 15 | } 16 | } else { 17 | o = {}; 18 | for (i in object) { 19 | if (typeof(object[i]) === "object" && object[i] !== null) { 20 | o[i] = deepClone(object[i]); 21 | } else { 22 | o[i] = object[i]; 23 | } 24 | } 25 | } 26 | return o; 27 | } 28 | 29 | export default deepClone; 30 | -------------------------------------------------------------------------------- /uview-ui/libs/function/deepMerge.js: -------------------------------------------------------------------------------- 1 | import deepClone from "./deepClone"; 2 | 3 | // JS对象深度合并 4 | function deepMerge(target = {}, source = {}) { 5 | target = deepClone(target); 6 | if (typeof target !== 'object' || typeof source !== 'object') return false; 7 | for (var prop in source) { 8 | if (!source.hasOwnProperty(prop)) continue; 9 | if (prop in target) { 10 | if (typeof target[prop] !== 'object') { 11 | target[prop] = source[prop]; 12 | } else { 13 | if (typeof source[prop] !== 'object') { 14 | target[prop] = source[prop]; 15 | } else { 16 | if (target[prop].concat && source[prop].concat) { 17 | target[prop] = target[prop].concat(source[prop]); 18 | } else { 19 | target[prop] = deepMerge(target[prop], source[prop]); 20 | } 21 | } 22 | } 23 | } else { 24 | target[prop] = source[prop]; 25 | } 26 | } 27 | return target; 28 | } 29 | 30 | export default deepMerge; -------------------------------------------------------------------------------- /uview-ui/libs/function/guid.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85 3 | * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier) 4 | * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题 5 | * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱 6 | * v-for的时候,推荐使用后端返回的id而不是循环的index 7 | * @param {Number} len uuid的长度 8 | * @param {Boolean} firstU 将返回的首字母置为"u" 9 | * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制 10 | */ 11 | function guid(len = 32, firstU = true, radix = null) { 12 | let chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); 13 | let uuid = []; 14 | radix = radix || chars.length; 15 | 16 | if (len) { 17 | // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位 18 | for (let i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix]; 19 | } else { 20 | let r; 21 | // rfc4122标准要求返回的uuid中,某些位为固定的字符 22 | uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-'; 23 | uuid[14] = '4'; 24 | 25 | for (let i = 0; i < 36; i++) { 26 | if (!uuid[i]) { 27 | r = 0 | Math.random() * 16; 28 | uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r]; 29 | } 30 | } 31 | } 32 | // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class 33 | if (firstU) { 34 | uuid.shift(); 35 | return 'u' + uuid.join(''); 36 | } else { 37 | return uuid.join(''); 38 | } 39 | } 40 | 41 | export default guid; 42 | -------------------------------------------------------------------------------- /uview-ui/libs/function/queryParams.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 对象转url参数 3 | * @param {*} data,对象 4 | * @param {*} isPrefix,是否自动加上"?" 5 | */ 6 | function queryParams(data = {}, isPrefix = true, arrayFormat = 'brackets') { 7 | let prefix = isPrefix ? '?' : '' 8 | let _result = [] 9 | if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets'; 10 | for (let key in data) { 11 | let value = data[key] 12 | // 去掉为空的参数 13 | if (['', undefined, null].indexOf(value) >= 0) { 14 | continue; 15 | } 16 | // 如果值为数组,另行处理 17 | if (value.constructor === Array) { 18 | // e.g. {ids: [1, 2, 3]} 19 | switch (arrayFormat) { 20 | case 'indices': 21 | // 结果: ids[0]=1&ids[1]=2&ids[2]=3 22 | for (i = 0; i < value.length; i++) { 23 | _result.push(key + '[' + i + ']=' + value[i]) 24 | } 25 | break; 26 | case 'brackets': 27 | // 结果: ids[]=1&ids[]=2&ids[]=3 28 | value.forEach(_value => { 29 | _result.push(key + '[]=' + _value) 30 | }) 31 | break; 32 | case 'repeat': 33 | // 结果: ids=1&ids=2&ids=3 34 | value.forEach(_value => { 35 | _result.push(key + '=' + _value) 36 | }) 37 | break; 38 | case 'comma': 39 | // 结果: ids=1,2,3 40 | let commaStr = ""; 41 | value.forEach(_value => { 42 | commaStr += (commaStr ? "," : "") + _value; 43 | }) 44 | _result.push(key + '=' + commaStr) 45 | break; 46 | default: 47 | value.forEach(_value => { 48 | _result.push(key + '[]=' + _value) 49 | }) 50 | } 51 | } else { 52 | _result.push(key + '=' + value) 53 | } 54 | } 55 | return _result.length ? prefix + _result.join('&') : '' 56 | } 57 | 58 | export default queryParams; 59 | -------------------------------------------------------------------------------- /uview-ui/libs/function/random.js: -------------------------------------------------------------------------------- 1 | function random(min, max) { 2 | if (min >= 0 && max > 0 && max >= min) { 3 | let gab = max - min + 1; 4 | return Math.floor(Math.random() * gab + min); 5 | } else { 6 | return 0; 7 | } 8 | } 9 | 10 | export default random; 11 | -------------------------------------------------------------------------------- /uview-ui/libs/function/randomArray.js: -------------------------------------------------------------------------------- 1 | // 打乱数组 2 | function randomArray(array = []) { 3 | // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0 4 | return array.sort(() => Math.random() - 0.5); 5 | } 6 | 7 | export default randomArray 8 | -------------------------------------------------------------------------------- /uview-ui/libs/function/route.js: -------------------------------------------------------------------------------- 1 | import queryParams from '../../libs/function/queryParams.js'; 2 | /** 3 | * 路由跳转 4 | * 注意:本方法没有对跳转的回调函数进行封装 5 | */ 6 | function route(options = {}, params = false) { 7 | let config = { 8 | type: 'navigateTo', 9 | url: '', 10 | delta: 1, // navigateBack页面后退时,回退的层数 11 | params: {}, // 传递的参数 12 | animationType: 'pop-in', // 窗口动画,只在APP有效 13 | animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效 14 | }; 15 | config = Object.assign(config, options); 16 | // 如果url没有"/"开头,添加上,因为uni的路由跳转需要"/"开头 17 | if (config.url[0] != '/') config.url = '/' + config.url; 18 | // 判断是否有传递显式的参数,Object.keys转为数组并判断长度,switchTab类型时不能携带参数 19 | if (Object.keys(config.params).length && config.type != 'switchTab') { 20 | // 判断用户传递的url中,是否带有参数 21 | // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary" 22 | // 如果有url中有get参数,转换后无需带上"?" 23 | let query = ''; 24 | if (/.*\/.*\?.*=.*/.test(config.url)) { 25 | // object对象转为get类型的参数 26 | query = queryParams(config.params, false); 27 | // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开 28 | config.url += "&" + query; 29 | } else { 30 | query = queryParams(config.params); 31 | config.url += query; 32 | } 33 | } 34 | // 简写形式,把url和参数拼接起来 35 | if (typeof options === 'string' && typeof params == 'object') { 36 | let query = ''; 37 | if (/.*\/.*\?.*=.*/.test(options)) { 38 | // object对象转为get类型的参数 39 | query = queryParams(params, false); 40 | // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开 41 | options += "&" + query; 42 | } else { 43 | query = queryParams(params); 44 | options += query; 45 | } 46 | } 47 | // 判断是否一个字符串,如果是,直接跳转(简写法) 48 | // 如果是中情形,默认第二个参数为对象形式的参数 49 | if (typeof options === 'string') { 50 | if (options[0] != '/') options = '/' + options; 51 | return uni.navigateTo({ 52 | url: options 53 | }); 54 | } 55 | // navigateTo类型的跳转 56 | if (config.type == 'navigateTo' || config.type == 'to') { 57 | return uni.navigateTo({ 58 | url: config.url, 59 | animationType: config.animationType, 60 | animationDuration: config.animationDuration, 61 | }); 62 | } 63 | if (config.type == 'redirectTo' || config.type == 'redirect') { 64 | return uni.redirectTo({ 65 | url: config.url, 66 | }); 67 | } 68 | if (config.type == 'switchTab' || config.type == 'tab') { 69 | return uni.switchTab({ 70 | url: config.url, 71 | }); 72 | } 73 | if (config.type == 'reLaunch') { 74 | return uni.reLaunch({ 75 | url: config.url 76 | }); 77 | } 78 | if (config.type == 'navigateBack' || config.type == 'back') { 79 | return uni.navigateBack({ 80 | delta: parseInt(config.delta ? config.delta : this.delta) 81 | }); 82 | } 83 | } 84 | 85 | export default route; 86 | -------------------------------------------------------------------------------- /uview-ui/libs/function/test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 验证电子邮箱格式 3 | */ 4 | function email(value) { 5 | return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value); 6 | } 7 | 8 | /** 9 | * 验证手机格式 10 | */ 11 | function mobile(value) { 12 | return /^1[23456789]\d{9}$/.test(value) 13 | } 14 | 15 | /** 16 | * 验证URL格式 17 | */ 18 | function url(value) { 19 | return /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i 20 | .test(value) 21 | } 22 | 23 | /** 24 | * 验证日期格式 25 | */ 26 | function date(value) { 27 | return !/Invalid|NaN/.test(new Date(value).toString()) 28 | } 29 | 30 | /** 31 | * 验证ISO类型的日期格式 32 | */ 33 | function dateISO(value) { 34 | return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value) 35 | } 36 | 37 | /** 38 | * 验证十进制数字 39 | */ 40 | function number(value) { 41 | return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value) 42 | } 43 | 44 | /** 45 | * 验证整数 46 | */ 47 | function digits(value) { 48 | return /^\d+$/.test(value) 49 | } 50 | 51 | /** 52 | * 验证身份证号码 53 | */ 54 | function idCard(value) { 55 | return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test( 56 | value) 57 | } 58 | 59 | /** 60 | * 是否车牌号 61 | */ 62 | function carNo(value) { 63 | // 新能源车牌 64 | const xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/; 65 | // 旧车牌 66 | const creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/; 67 | if (value.length === 7) { 68 | return creg.test(value); 69 | } else if (value.length === 8) { 70 | return xreg.test(value); 71 | } else { 72 | return false; 73 | } 74 | } 75 | 76 | /** 77 | * 金额,只允许2位小数 78 | */ 79 | function amount(value) { 80 | //金额,只允许保留两位小数 81 | return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0.\d{1,2}$/.test(value); 82 | } 83 | 84 | /** 85 | * 中文 86 | */ 87 | function chinese(value) { 88 | let reg = /^[\u4e00-\u9fa5]+$/gi; 89 | return reg.test(value); 90 | } 91 | 92 | /** 93 | * 只能输入字母 94 | */ 95 | function letter(value) { 96 | return /^[a-zA-Z]*$/.test(value); 97 | } 98 | 99 | /** 100 | * 只能是字母或者数字 101 | */ 102 | function enOrNum(value) { 103 | //英文或者数字 104 | let reg = /^[0-9a-zA-Z]*$/g; 105 | return reg.test(value); 106 | } 107 | 108 | /** 109 | * 验证是否包含某个值 110 | */ 111 | function contains(value, param) { 112 | return value.indexOf(param) >= 0 113 | } 114 | 115 | /** 116 | * 验证一个值范围[min, max] 117 | */ 118 | function range(value, param) { 119 | return value >= param[0] && value <= param[1] 120 | } 121 | 122 | /** 123 | * 验证一个长度范围[min, max] 124 | */ 125 | function rangeLength(value, param) { 126 | return value.length >= param[0] && value.length <= param[1] 127 | } 128 | 129 | /** 130 | * 判断是否为空 131 | */ 132 | function empty(value){ 133 | switch (typeof value) { 134 | case 'undefined': 135 | return true; 136 | case 'string': 137 | if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true; 138 | break; 139 | case 'boolean': 140 | if (!value) return true; 141 | break; 142 | case 'number': 143 | if (0 === value || isNaN(value)) return true; 144 | break; 145 | case 'object': 146 | if (null === value || value.length === 0) return true; 147 | for (var i in value) { 148 | return false; 149 | } 150 | return true; 151 | } 152 | return false; 153 | } 154 | 155 | 156 | export default { 157 | email, 158 | mobile, 159 | url, 160 | date, 161 | dateISO, 162 | number, 163 | digits, 164 | idCard, 165 | carNo, 166 | amount, 167 | chinese, 168 | letter, 169 | enOrNum, 170 | contains, 171 | range, 172 | rangeLength, 173 | empty, 174 | isEmpty: empty 175 | } -------------------------------------------------------------------------------- /uview-ui/libs/function/timeFormat.js: -------------------------------------------------------------------------------- 1 | function timeFormat(timestamp = null, fmt = 'yyyy-mm-dd') { 2 | // 其他更多是格式化有如下: 3 | // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合 4 | timestamp = parseInt(timestamp); 5 | // 如果为null,则格式化当前时间 6 | if (timestamp == null) timestamp = Number(new Date()); 7 | // 判断用户输入的时间戳是秒还是毫秒,一般前端js获取的时间戳是毫秒(13位),后端传过来的为秒(10位) 8 | if (timestamp.toString().length == 10) timestamp *= 1000; 9 | let date = new Date(timestamp); 10 | let ret; 11 | let opt = { 12 | "y+": date.getFullYear().toString(), // 年 13 | "m+": (date.getMonth() + 1).toString(), // 月 14 | "d+": date.getDate().toString(), // 日 15 | "h+": date.getHours().toString(), // 时 16 | "M+": date.getMinutes().toString(), // 分 17 | "s+": date.getSeconds().toString() // 秒 18 | // 有其他格式化字符需求可以继续添加,必须转化成字符串 19 | }; 20 | for (let k in opt) { 21 | ret = new RegExp("(" + k + ")").exec(fmt); 22 | if (ret) { 23 | fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0"))) 24 | }; 25 | }; 26 | return fmt; 27 | } 28 | 29 | export default timeFormat 30 | -------------------------------------------------------------------------------- /uview-ui/libs/function/timeFrom.js: -------------------------------------------------------------------------------- 1 | import timeFormat from '../../libs/function/timeFormat.js'; 2 | 3 | /** 4 | * 时间戳转为多久之前 5 | * @param String timestamp 时间戳 6 | * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式; 7 | * 如果为布尔值false,无论什么时间,都返回多久以前的格式 8 | */ 9 | function timeFrom(timestamp = null, format = 'yyyy-mm-dd') { 10 | if (timestamp == null) timestamp = Number(new Date()); 11 | timestamp = parseInt(timestamp); 12 | // 判断用户输入的时间戳是秒还是毫秒,一般前端js获取的时间戳是毫秒(13位),后端传过来的为秒(10位) 13 | if (timestamp.toString().length == 10) timestamp *= 1000; 14 | var timer = (new Date()).getTime() - timestamp; 15 | timer = parseInt(timer / 1000); 16 | // 如果小于5分钟,则返回"刚刚",其他以此类推 17 | let tips = ''; 18 | switch (true) { 19 | case timer < 300: 20 | tips = '刚刚'; 21 | break; 22 | case timer >= 300 && timer < 3600: 23 | tips = parseInt(timer / 60) + '分钟前'; 24 | break; 25 | case timer >= 3600 && timer < 86400: 26 | tips = parseInt(timer / 3600) + '小时前'; 27 | break; 28 | case timer >= 86400 && timer < 2592000: 29 | tips = parseInt(timer / 86400) + '天前'; 30 | break; 31 | default: 32 | // 如果format为false,则无论什么时间戳,都显示xx之前 33 | if(format === false) { 34 | if(timer >= 2592000 && timer < 365 * 86400) { 35 | tips = parseInt(timer / (86400 * 30)) + '个月前'; 36 | } else { 37 | tips = parseInt(timer / (86400 * 365)) + '年前'; 38 | } 39 | } else { 40 | tips = timeFormat(timestamp, format); 41 | } 42 | } 43 | return tips; 44 | } 45 | 46 | export default timeFrom; 47 | -------------------------------------------------------------------------------- /uview-ui/libs/function/toast.js: -------------------------------------------------------------------------------- 1 | function toast(title, duration = 1500) { 2 | uni.showToast({ 3 | title: title, 4 | icon: 'none', 5 | duration: duration 6 | }) 7 | } 8 | 9 | export default toast 10 | -------------------------------------------------------------------------------- /uview-ui/libs/function/trim.js: -------------------------------------------------------------------------------- 1 | function trim(str, pos = 'both') { 2 | if (pos == 'both') { 3 | return str.replace(/^\s+|\s+$/g, ""); 4 | } else if (pos == "left") { 5 | return str.replace(/^\s*/, ''); 6 | } else if (pos == 'right') { 7 | return str.replace(/(\s*$)/g, ""); 8 | } else if (pos == 'all') { 9 | return str.replace(/\s+/g, ""); 10 | } else { 11 | return str; 12 | } 13 | } 14 | 15 | export default trim 16 | -------------------------------------------------------------------------------- /uview-ui/libs/function/type2icon.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 根据主题type值,获取对应的图标 3 | * @param String type 主题名称,primary|info|error|warning|success 4 | * @param String fill 是否使用fill填充实体的图标 5 | */ 6 | function type2icon(type = 'success', fill = false) { 7 | // 如果非预置值,默认为success 8 | if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success'; 9 | let iconName = ''; 10 | // 目前(2019-12-12),info和primary使用同一个图标 11 | switch (type) { 12 | case 'primary': 13 | iconName = 'info-circle'; 14 | break; 15 | case 'info': 16 | iconName = 'info-circle'; 17 | break; 18 | case 'error': 19 | iconName = 'close-circle'; 20 | break; 21 | case 'warning': 22 | iconName = 'error-circle'; 23 | break; 24 | case 'success': 25 | iconName = 'checkmark-circle'; 26 | break; 27 | default: 28 | iconName = 'checkmark-circle'; 29 | } 30 | // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的 31 | if (fill) iconName += '-fill'; 32 | return iconName; 33 | } 34 | 35 | export default type2icon 36 | -------------------------------------------------------------------------------- /uview-ui/libs/mixin/mixin.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | data() { 3 | return {} 4 | }, 5 | onLoad() { 6 | // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出 7 | this.$u.getRect = this.$uGetRect 8 | }, 9 | methods: { 10 | // 查询节点信息 11 | $uGetRect(selector, all) { 12 | return new Promise(resolve => { 13 | uni.createSelectorQuery(). 14 | in(this)[all ? 'selectAll' : 'select'](selector) 15 | .boundingClientRect(rect => { 16 | if (all && Array.isArray(rect) && rect.length) { 17 | resolve(rect) 18 | } 19 | if (!all && rect) { 20 | resolve(rect) 21 | } 22 | }) 23 | .exec() 24 | }) 25 | } 26 | }, 27 | onReachBottom() { 28 | uni.$emit('uOnReachBottom') 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /uview-ui/libs/mixin/mpShare.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | onLoad() { 3 | // 设置默认的转发参数 4 | this.$u.mpShare = { 5 | title: '', // 默认为小程序名称 6 | path: '', // 默认为当前页面路径 7 | imageUrl: '' // 默认为当前页面的截图 8 | } 9 | }, 10 | onShareAppMessage() { 11 | return this.$u.mpShare 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /uview-ui/libs/store/index.js: -------------------------------------------------------------------------------- 1 | // 暂时不用vuex模块方式实现,将该方法直接放入到/store/index.js中 2 | const module = { 3 | actions: { 4 | $uStore({rootState}, params) { 5 | let nameArr = params.name.split('.'); 6 | if(nameArr.length >= 2) { 7 | let obj = rootState[nameArr[0]]; 8 | for(let i = 1; i < nameArr.length - 1; i ++) { 9 | obj = obj[nameArr[i]]; 10 | } 11 | obj[nameArr[nameArr.length - 1]] = params.value; 12 | } else { 13 | rootState[params.name] = params.value; 14 | } 15 | } 16 | } 17 | } 18 | 19 | export default module -------------------------------------------------------------------------------- /uview-ui/libs/util/emitter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 递归使用 call 方式this指向 3 | * @param componentName // 需要找的组件的名称 4 | * @param eventName // 事件名称 5 | * @param params // 需要传递的参数 6 | */ 7 | function broadcast(componentName, eventName, params) { 8 | // 循环子节点找到名称一样的子节点 否则 递归 当前子节点 9 | this.$children.map(child=>{ 10 | if (componentName===child.$options.name) { 11 | child.$emit.apply(child,[eventName].concat(params)) 12 | }else { 13 | broadcast.apply(child,[componentName,eventName].concat(params)) 14 | } 15 | }) 16 | } 17 | export default { 18 | methods: { 19 | /** 20 | * 派发 (向上查找) (一个) 21 | * @param componentName // 需要找的组件的名称 22 | * @param eventName // 事件名称 23 | * @param params // 需要传递的参数 24 | */ 25 | dispatch(componentName, eventName, params) { 26 | let parent = this.$parent || this.$root;//$parent 找到最近的父节点 $root 根节点 27 | let name = parent.$options.name; // 获取当前组件实例的name 28 | // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点 29 | // 循环出当前名称的一样的组件实例 30 | while (parent && (!name||name!==componentName)) { 31 | parent = parent.$parent; 32 | if (parent) { 33 | name = parent.$options.name; 34 | } 35 | } 36 | // 有节点表示当前找到了name一样的实例 37 | if (parent) { 38 | parent.$emit.apply(parent,[eventName].concat(params)) 39 | } 40 | }, 41 | /** 42 | * 广播 (向下查找) (广播多个) 43 | * @param componentName // 需要找的组件的名称 44 | * @param eventName // 事件名称 45 | * @param params // 需要传递的参数 46 | */ 47 | broadcast(componentName, eventName, params) { 48 | broadcast.call(this,componentName, eventName, params) 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /uview-ui/libs/util/province.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var provinceData = [{ 3 | "label": "北京市", 4 | "value": "11" 5 | }, 6 | { 7 | "label": "天津市", 8 | "value": "12" 9 | }, 10 | { 11 | "label": "河北省", 12 | "value": "13" 13 | }, 14 | { 15 | "label": "山西省", 16 | "value": "14" 17 | }, 18 | { 19 | "label": "内蒙古自治区", 20 | "value": "15" 21 | }, 22 | { 23 | "label": "辽宁省", 24 | "value": "21" 25 | }, 26 | { 27 | "label": "吉林省", 28 | "value": "22" 29 | }, 30 | { 31 | "label": "黑龙江省", 32 | "value": "23" 33 | }, 34 | { 35 | "label": "上海市", 36 | "value": "31" 37 | }, 38 | { 39 | "label": "江苏省", 40 | "value": "32" 41 | }, 42 | { 43 | "label": "浙江省", 44 | "value": "33" 45 | }, 46 | { 47 | "label": "安徽省", 48 | "value": "34" 49 | }, 50 | { 51 | "label": "福建省", 52 | "value": "35" 53 | }, 54 | { 55 | "label": "江西省", 56 | "value": "36" 57 | }, 58 | { 59 | "label": "山东省", 60 | "value": "37" 61 | }, 62 | { 63 | "label": "河南省", 64 | "value": "41" 65 | }, 66 | { 67 | "label": "湖北省", 68 | "value": "42" 69 | }, 70 | { 71 | "label": "湖南省", 72 | "value": "43" 73 | }, 74 | { 75 | "label": "广东省", 76 | "value": "44" 77 | }, 78 | { 79 | "label": "广西壮族自治区", 80 | "value": "45" 81 | }, 82 | { 83 | "label": "海南省", 84 | "value": "46" 85 | }, 86 | { 87 | "label": "重庆市", 88 | "value": "50" 89 | }, 90 | { 91 | "label": "四川省", 92 | "value": "51" 93 | }, 94 | { 95 | "label": "贵州省", 96 | "value": "52" 97 | }, 98 | { 99 | "label": "云南省", 100 | "value": "53" 101 | }, 102 | { 103 | "label": "西藏自治区", 104 | "value": "54" 105 | }, 106 | { 107 | "label": "陕西省", 108 | "value": "61" 109 | }, 110 | { 111 | "label": "甘肃省", 112 | "value": "62" 113 | }, 114 | { 115 | "label": "青海省", 116 | "value": "63" 117 | }, 118 | { 119 | "label": "宁夏回族自治区", 120 | "value": "64" 121 | }, 122 | { 123 | "label": "新疆维吾尔自治区", 124 | "value": "65" 125 | }, 126 | { 127 | "label": "台湾", 128 | "value": "66" 129 | }, 130 | { 131 | "label": "香港", 132 | "value": "67" 133 | }, 134 | { 135 | "label": "澳门", 136 | "value": "68" 137 | } 138 | ] 139 | export default provinceData; 140 | -------------------------------------------------------------------------------- /uview-ui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "uview-ui", 3 | "version": "1.3.0", 4 | "description": "uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水", 5 | "main": "index.js", 6 | "keywords": ["uview", "uView", "uni-app", "uni-app ui", "uniapp", "uviewui", "uview ui", "uviewUI", "uViewui", "uViewUI", "uView UI", "uni ui", "uni UI", "uniapp ui", "ui", "UI框架", "uniapp ui框架", "uniapp UI"], 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "" 13 | }, 14 | "devDependencies": { 15 | "node-sass": "^4.14.0", 16 | "sass-loader": "^8.0.2" 17 | }, 18 | "author": "uView", 19 | "license": "MIT" 20 | } 21 | -------------------------------------------------------------------------------- /uview-ui/theme.scss: -------------------------------------------------------------------------------- 1 | // 此文件为uView的主题变量,这些变量目前只能通过uni.scss引入才有效,另外由于 2 | // uni.scss中引入的样式会同时混入到全局样式文件和单独每一个页面的样式中,造成微信程序包太大, 3 | // 故uni.scss只建议放scss变量名相关样式,其他的样式可以通过main.js或者App.vue引入 4 | 5 | $u-main-color: #303133; 6 | $u-content-color: #606266; 7 | $u-tips-color: #909399; 8 | $u-light-color: #c0c4cc; 9 | $u-border-color: #e4e7ed; 10 | $u-bg-color: #f3f4f6; 11 | 12 | $u-type-primary: #2979ff; 13 | $u-type-primary-light: #ecf5ff; 14 | $u-type-primary-disabled: #a0cfff; 15 | $u-type-primary-dark: #2b85e4; 16 | 17 | $u-type-warning: #ff9900; 18 | $u-type-warning-disabled: #fcbd71; 19 | $u-type-warning-dark: #f29100; 20 | $u-type-warning-light: #fdf6ec; 21 | 22 | $u-type-success: #19be6b; 23 | $u-type-success-disabled: #71d5a1; 24 | $u-type-success-dark: #18b566; 25 | $u-type-success-light: #dbf1e1; 26 | 27 | $u-type-error: #fa3534; 28 | $u-type-error-disabled: #fab6b6; 29 | $u-type-error-dark: #dd6161; 30 | $u-type-error-light: #fef0f0; 31 | 32 | $u-type-info: #909399; 33 | $u-type-info-disabled: #c8c9cc; 34 | $u-type-info-dark: #82848a; 35 | $u-type-info-light: #f4f4f5; 36 | 37 | $u-form-item-height: 70rpx; 38 | $u-form-item-border-color: #dcdfe6; 39 | --------------------------------------------------------------------------------