├── uview-ui
├── libs
│ ├── css
│ │ ├── style.components.scss
│ │ ├── style.nvue.scss
│ │ ├── style.h5.scss
│ │ ├── style.mp.scss
│ │ ├── color.scss
│ │ ├── common.scss
│ │ └── style.vue.scss
│ ├── function
│ │ ├── bem.js
│ │ ├── sys.js
│ │ ├── toast.js
│ │ ├── randomArray.js
│ │ ├── random.js
│ │ ├── addUnit.js
│ │ ├── trim.js
│ │ ├── $parent.js
│ │ ├── deepClone.js
│ │ ├── throttle.js
│ │ ├── debounce.js
│ │ ├── deepMerge.js
│ │ ├── color.js
│ │ ├── type2icon.js
│ │ ├── getParent.js
│ │ ├── guid.js
│ │ ├── timeFrom.js
│ │ ├── queryParams.js
│ │ ├── timeFormat.js
│ │ ├── route.js
│ │ └── colorGradient.js
│ ├── config
│ │ ├── config.js
│ │ └── zIndex.js
│ ├── mixin
│ │ ├── mpShare.js
│ │ └── mixin.js
│ ├── store
│ │ └── index.js
│ └── util
│ │ ├── emitter.js
│ │ └── province.js
├── components
│ ├── u-loading-page
│ │ └── u-loading-page.vue
│ ├── u-parse
│ │ └── libs
│ │ │ ├── handler.wxs
│ │ │ ├── config.js
│ │ │ └── CssHandler.js
│ ├── u-tr
│ │ └── u-tr.vue
│ ├── u-time-line
│ │ └── u-time-line.vue
│ ├── u-full-screen
│ │ └── u-full-screen.vue
│ ├── u-gap
│ │ └── u-gap.vue
│ ├── u-th
│ │ └── u-th.vue
│ ├── u-time-line-item
│ │ └── u-time-line-item.vue
│ ├── u-cell-group
│ │ └── u-cell-group.vue
│ ├── u-grid
│ │ └── u-grid.vue
│ ├── u-row
│ │ └── u-row.vue
│ ├── u-index-anchor
│ │ └── u-index-anchor.vue
│ ├── u-link
│ │ └── u-link.vue
│ ├── u-table
│ │ └── u-table.vue
│ ├── u-td
│ │ └── u-td.vue
│ ├── u-line
│ │ └── u-line.vue
│ ├── u-collapse
│ │ └── u-collapse.vue
│ ├── u-grid-item
│ │ └── u-grid-item.vue
│ ├── u-radio-group
│ │ └── u-radio-group.vue
│ ├── u-top-tips
│ │ └── u-top-tips.vue
│ ├── u-col
│ │ └── u-col.vue
│ ├── u-mask
│ │ └── u-mask.vue
│ ├── u-checkbox-group
│ │ └── u-checkbox-group.vue
│ ├── u-back-top
│ │ └── u-back-top.vue
│ ├── u-line-progress
│ │ └── u-line-progress.vue
│ ├── u-section
│ │ └── u-section.vue
│ ├── u-form
│ │ └── u-form.vue
│ └── u-divider
│ │ └── u-divider.vue
├── index.scss
├── package.json
├── LICENSE
├── theme.scss
└── index.js
├── static
├── bg.png
├── bg1.png
├── logo.png
├── star.png
├── nodata.png
├── title.png
├── emptyCart.png
├── exchange.png
├── img
│ ├── sort0.png
│ ├── sort1.png
│ ├── sort2.png
│ ├── title.png
│ ├── used.png
│ ├── main-bg.png
│ └── overdue.png
├── logo-dark.png
├── map
│ ├── scan.png
│ ├── ui-list.png
│ ├── ui-map.png
│ ├── location.png
│ ├── slow-pile-count.png
│ ├── current-location.png
│ ├── fast-pile-count-l.png
│ ├── fast-pile-count-m.png
│ ├── fast-pile-count-r.png
│ ├── slow-pile-count-l.png
│ ├── slow-pile-count-m.png
│ └── slow-pile-count-r.png
├── mine
│ ├── car.png
│ ├── about.png
│ ├── coupon.png
│ ├── order.png
│ ├── wallet.png
│ ├── feedback.png
│ └── car-list-bg.png
├── order
│ ├── t1.png
│ ├── t3.png
│ ├── order-b.png
│ ├── order-bg.png
│ ├── order-m.png
│ ├── order-t.png
│ ├── station.png
│ ├── order-b-dark.png
│ ├── order-bg-dark.png
│ ├── order-list-bg.png
│ ├── order-m-dark.png
│ ├── order-t-dark.png
│ └── order-complete.png
├── tabbar
│ ├── my.png
│ ├── cart.png
│ ├── my-s.png
│ ├── cart-s.png
│ ├── charging.png
│ └── charging-s.png
├── index
│ ├── arrow-up.png
│ ├── coupon.png
│ ├── electric.png
│ ├── support.png
│ ├── arrow-down.png
│ ├── arrow-up-1.png
│ ├── connector.png
│ ├── navigation.png
│ ├── order-wait.png
│ ├── station-0.png
│ ├── station-1.png
│ ├── station-2.png
│ ├── station-3.png
│ ├── station-4.png
│ ├── arrow-down-1.png
│ ├── car-parking.png
│ ├── parking-free.png
│ ├── progress-bg.png
│ └── station-255.png
├── missing-face.png
├── appleidButton@2x.png
└── pointTrade
│ ├── point_bg_1.png
│ └── tradehall.png
├── lib
└── request
│ ├── index.js
│ ├── core
│ ├── dispatchRequest.js
│ ├── defaults.js
│ ├── settle.js
│ ├── buildFullPath.js
│ ├── InterceptorManager.js
│ └── mergeConfig.js
│ ├── helpers
│ ├── combineURLs.js
│ ├── isAbsoluteURL.js
│ └── buildURL.js
│ ├── adapters
│ └── index.js
│ └── utils.js
├── aosheng.code-workspace
├── .gitignore
├── utils
├── utils.js
├── RegExp.js
├── storage.js
└── tools.js
├── theme.json
├── project.private.config.json
├── pages
├── floor
│ └── empty.vue
├── passport
│ ├── login.scss
│ └── wechatH5Login.vue
├── tabbar
│ └── mine
│ │ └── utils
│ │ └── tool.vue
├── station
│ └── components
│ │ └── -price.vue
└── mine
│ └── about
│ └── index.vue
├── project.config.json
├── vue.config.js
├── config
├── api.js
└── config.js
├── store
└── index.js
├── api
├── station.js
├── members.js
├── car.js
├── common.js
├── order.js
├── message.js
├── login.js
├── passport.js
└── connect.js
├── main.js
├── manifest.json
├── components
├── default-page
│ └── default-page.vue
├── float-btn
│ ├── float-btn.scss
│ └── float-btn.vue
└── verification
│ └── animation.css
└── README.md
/uview-ui/libs/css/style.components.scss:
--------------------------------------------------------------------------------
1 | .demo {
2 | }
3 |
--------------------------------------------------------------------------------
/uview-ui/libs/css/style.nvue.scss:
--------------------------------------------------------------------------------
1 | .nvue {
2 | font-size: 24rpx;
3 | }
--------------------------------------------------------------------------------
/static/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/bg.png
--------------------------------------------------------------------------------
/static/bg1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/bg1.png
--------------------------------------------------------------------------------
/static/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/logo.png
--------------------------------------------------------------------------------
/static/star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/star.png
--------------------------------------------------------------------------------
/lib/request/index.js:
--------------------------------------------------------------------------------
1 | import Request from './core/Request'
2 | export default Request
3 |
--------------------------------------------------------------------------------
/static/nodata.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/nodata.png
--------------------------------------------------------------------------------
/static/title.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/title.png
--------------------------------------------------------------------------------
/static/emptyCart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/emptyCart.png
--------------------------------------------------------------------------------
/static/exchange.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/exchange.png
--------------------------------------------------------------------------------
/static/img/sort0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/img/sort0.png
--------------------------------------------------------------------------------
/static/img/sort1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/img/sort1.png
--------------------------------------------------------------------------------
/static/img/sort2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/img/sort2.png
--------------------------------------------------------------------------------
/static/img/title.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/img/title.png
--------------------------------------------------------------------------------
/static/img/used.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/img/used.png
--------------------------------------------------------------------------------
/static/logo-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/logo-dark.png
--------------------------------------------------------------------------------
/static/map/scan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/map/scan.png
--------------------------------------------------------------------------------
/static/mine/car.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/mine/car.png
--------------------------------------------------------------------------------
/static/order/t1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/order/t1.png
--------------------------------------------------------------------------------
/static/order/t3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/order/t3.png
--------------------------------------------------------------------------------
/static/tabbar/my.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/tabbar/my.png
--------------------------------------------------------------------------------
/static/img/main-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/img/main-bg.png
--------------------------------------------------------------------------------
/static/img/overdue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/img/overdue.png
--------------------------------------------------------------------------------
/static/map/ui-list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/map/ui-list.png
--------------------------------------------------------------------------------
/static/map/ui-map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/map/ui-map.png
--------------------------------------------------------------------------------
/static/mine/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/mine/about.png
--------------------------------------------------------------------------------
/static/mine/coupon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/mine/coupon.png
--------------------------------------------------------------------------------
/static/mine/order.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/mine/order.png
--------------------------------------------------------------------------------
/static/mine/wallet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/mine/wallet.png
--------------------------------------------------------------------------------
/static/tabbar/cart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/tabbar/cart.png
--------------------------------------------------------------------------------
/static/tabbar/my-s.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/tabbar/my-s.png
--------------------------------------------------------------------------------
/static/index/arrow-up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/arrow-up.png
--------------------------------------------------------------------------------
/static/index/coupon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/coupon.png
--------------------------------------------------------------------------------
/static/index/electric.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/electric.png
--------------------------------------------------------------------------------
/static/index/support.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/support.png
--------------------------------------------------------------------------------
/static/map/location.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/map/location.png
--------------------------------------------------------------------------------
/static/mine/feedback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/mine/feedback.png
--------------------------------------------------------------------------------
/static/missing-face.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/missing-face.png
--------------------------------------------------------------------------------
/static/order/order-b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/order/order-b.png
--------------------------------------------------------------------------------
/static/order/order-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/order/order-bg.png
--------------------------------------------------------------------------------
/static/order/order-m.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/order/order-m.png
--------------------------------------------------------------------------------
/static/order/order-t.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/order/order-t.png
--------------------------------------------------------------------------------
/static/order/station.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/order/station.png
--------------------------------------------------------------------------------
/static/tabbar/cart-s.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/tabbar/cart-s.png
--------------------------------------------------------------------------------
/static/appleidButton@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/appleidButton@2x.png
--------------------------------------------------------------------------------
/static/index/arrow-down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/arrow-down.png
--------------------------------------------------------------------------------
/static/index/arrow-up-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/arrow-up-1.png
--------------------------------------------------------------------------------
/static/index/connector.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/connector.png
--------------------------------------------------------------------------------
/static/index/navigation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/navigation.png
--------------------------------------------------------------------------------
/static/index/order-wait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/order-wait.png
--------------------------------------------------------------------------------
/static/index/station-0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/station-0.png
--------------------------------------------------------------------------------
/static/index/station-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/station-1.png
--------------------------------------------------------------------------------
/static/index/station-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/station-2.png
--------------------------------------------------------------------------------
/static/index/station-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/station-3.png
--------------------------------------------------------------------------------
/static/index/station-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/station-4.png
--------------------------------------------------------------------------------
/static/mine/car-list-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/mine/car-list-bg.png
--------------------------------------------------------------------------------
/static/tabbar/charging.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/tabbar/charging.png
--------------------------------------------------------------------------------
/uview-ui/libs/function/bem.js:
--------------------------------------------------------------------------------
1 | function bem(name, conf) {
2 |
3 | }
4 |
5 | module.exports.bem = bem;
6 |
--------------------------------------------------------------------------------
/aosheng.code-workspace:
--------------------------------------------------------------------------------
1 | {
2 | "folders": [
3 | {
4 | "path": "."
5 | }
6 | ],
7 | "settings": {}
8 | }
--------------------------------------------------------------------------------
/static/index/arrow-down-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/arrow-down-1.png
--------------------------------------------------------------------------------
/static/index/car-parking.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/car-parking.png
--------------------------------------------------------------------------------
/static/index/parking-free.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/parking-free.png
--------------------------------------------------------------------------------
/static/index/progress-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/progress-bg.png
--------------------------------------------------------------------------------
/static/index/station-255.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/index/station-255.png
--------------------------------------------------------------------------------
/static/map/slow-pile-count.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/map/slow-pile-count.png
--------------------------------------------------------------------------------
/static/order/order-b-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/order/order-b-dark.png
--------------------------------------------------------------------------------
/static/order/order-bg-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/order/order-bg-dark.png
--------------------------------------------------------------------------------
/static/order/order-list-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/order/order-list-bg.png
--------------------------------------------------------------------------------
/static/order/order-m-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/order/order-m-dark.png
--------------------------------------------------------------------------------
/static/order/order-t-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/order/order-t-dark.png
--------------------------------------------------------------------------------
/static/tabbar/charging-s.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/tabbar/charging-s.png
--------------------------------------------------------------------------------
/static/map/current-location.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/map/current-location.png
--------------------------------------------------------------------------------
/static/map/fast-pile-count-l.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/map/fast-pile-count-l.png
--------------------------------------------------------------------------------
/static/map/fast-pile-count-m.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/map/fast-pile-count-m.png
--------------------------------------------------------------------------------
/static/map/fast-pile-count-r.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/map/fast-pile-count-r.png
--------------------------------------------------------------------------------
/static/map/slow-pile-count-l.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/map/slow-pile-count-l.png
--------------------------------------------------------------------------------
/static/map/slow-pile-count-m.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/map/slow-pile-count-m.png
--------------------------------------------------------------------------------
/static/map/slow-pile-count-r.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/map/slow-pile-count-r.png
--------------------------------------------------------------------------------
/static/order/order-complete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/order/order-complete.png
--------------------------------------------------------------------------------
/static/pointTrade/point_bg_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/pointTrade/point_bg_1.png
--------------------------------------------------------------------------------
/static/pointTrade/tradehall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NaTieJun/orise-mp/HEAD/static/pointTrade/tradehall.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 | node_modules/
5 |
6 | #Intellij idea
7 | .idea/
8 | /idea/
9 | .vscode/
10 | /unpackage/
11 | .hbuilderx/launch.json
12 |
--------------------------------------------------------------------------------
/lib/request/core/dispatchRequest.js:
--------------------------------------------------------------------------------
1 | import adapter from '../adapters/index'
2 |
3 |
4 | export default (config) => {
5 | config.header = config.header || {}
6 | return adapter(config)
7 | }
8 |
--------------------------------------------------------------------------------
/uview-ui/libs/function/sys.js:
--------------------------------------------------------------------------------
1 | export function os() {
2 | return uni.getSystemInfoSync().platform;
3 | };
4 |
5 | export function sys() {
6 | return uni.getSystemInfoSync();
7 | }
8 |
9 |
10 |
--------------------------------------------------------------------------------
/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/css/style.h5.scss:
--------------------------------------------------------------------------------
1 | /* H5的时候,隐藏滚动条 */
2 | ::-webkit-scrollbar {
3 | display: none;
4 | width: 0 !important;
5 | height: 0 !important;
6 | -webkit-appearance: none;
7 | background: transparent;
8 | }
9 |
--------------------------------------------------------------------------------
/utils/utils.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * 线程等待
4 | * @param {Number} duration(ms)
5 | */
6 | export async function wait(duration) {
7 | return new Promise((resolve, reject) => {
8 | setTimeout(resolve, duration);
9 | });
10 | }
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 |
--------------------------------------------------------------------------------
/theme.json:
--------------------------------------------------------------------------------
1 | {
2 | "light": {
3 | "tabBarBgColor": "#ffffff",
4 | "navTxtStyle": "black",
5 | "fontColor": "#333333"
6 | },
7 | "dark": {
8 | "tabBarBgColor": "#0C0D1A",
9 | "navTxtStyle": "white",
10 | "fontColor": "#ffffff"
11 | }
12 | }
--------------------------------------------------------------------------------
/uview-ui/libs/config/config.js:
--------------------------------------------------------------------------------
1 | // 此版本发布于2020-08-06
2 | let version = '1.6.0';
3 |
4 | export default {
5 | v: version,
6 | version: version,
7 | // 主题名称
8 | type: [
9 | 'primary',
10 | 'success',
11 | 'info',
12 | 'error',
13 | 'warning'
14 | ]
15 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/project.private.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
3 | "projectname": "mp-aosheng",
4 | "setting": {
5 | "compileHotReLoad": true
6 | }
7 | }
--------------------------------------------------------------------------------
/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/function/addUnit.js:
--------------------------------------------------------------------------------
1 | import validation from './test.js';
2 |
3 | // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
4 | export default function addUnit(value = 'auto', unit = 'rpx') {
5 | value = String(value);
6 | // 用uView内置验证规则中的number判断是否为数值
7 | return validation.number(value) ? `${value}${unit}` : value;
8 | }
--------------------------------------------------------------------------------
/uview-ui/components/u-loading-page/u-loading-page.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
22 |
23 |
26 |
--------------------------------------------------------------------------------
/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 | * toast: 999
8 | */
9 |
10 | export default {
11 | toast: 10090,
12 | noNetwork: 10080,
13 | // popup包含popup,actionsheet,keyboard,picker的值
14 | popup: 10075,
15 | mask: 10070,
16 | navbar: 980,
17 | topTips: 975,
18 | sticky: 970,
19 | indexListSticky: 965,
20 | }
--------------------------------------------------------------------------------
/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/components/u-parse/libs/handler.wxs:
--------------------------------------------------------------------------------
1 | var inline = {
2 | abbr: 1,
3 | b: 1,
4 | big: 1,
5 | code: 1,
6 | del: 1,
7 | em: 1,
8 | i: 1,
9 | ins: 1,
10 | label: 1,
11 | q: 1,
12 | small: 1,
13 | span: 1,
14 | strong: 1,
15 | sub: 1,
16 | sup: 1
17 | }
18 | module.exports = {
19 | use: function(item) {
20 | return !item.c && !inline[item.name] && (item.attrs.style || '').indexOf('display:inline') == -1
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/lib/request/helpers/combineURLs.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | /**
4 | * Creates a new URL by combining the specified URLs
5 | *
6 | * @param {string} baseURL The base URL
7 | * @param {string} relativeURL The relative URL
8 | * @returns {string} The combined URL
9 | */
10 | export default function combineURLs(baseURL, relativeURL) {
11 | return relativeURL
12 | ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
13 | : baseURL
14 | }
15 |
--------------------------------------------------------------------------------
/pages/floor/empty.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
21 |
22 |
25 |
--------------------------------------------------------------------------------
/uview-ui/index.scss:
--------------------------------------------------------------------------------
1 | // 引入公共基础类
2 | @import "./libs/css/common.scss";
3 | @import "./libs/css/color.scss";
4 |
5 | // 非nvue的样式
6 | /* #ifndef APP-NVUE */
7 | @import "./libs/css/style.vue.scss";
8 | /* #endif */
9 |
10 | // nvue的特有样式
11 | /* #ifdef APP-NVUE */
12 | @import "./libs/css/style.nvue.scss";
13 | /* #endif */
14 |
15 | // 小程序特有的样式
16 | /* #ifdef MP */
17 | @import "./libs/css/style.mp.scss";
18 | /* #endif */
19 |
20 | // H5特有的样式
21 | /* #ifdef H5 */
22 | @import "./libs/css/style.h5.scss";
23 | /* #endif */
--------------------------------------------------------------------------------
/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/components/u-tr/u-tr.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
18 |
19 |
26 |
--------------------------------------------------------------------------------
/lib/request/core/defaults.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 默认的全局配置
3 | */
4 |
5 |
6 | export default {
7 | baseURL: '',
8 | header: {},
9 | method: 'GET',
10 | dataType: 'json',
11 | // #ifndef MP-ALIPAY || APP-PLUS
12 | responseType: 'text',
13 | // #endif
14 | custom: {},
15 | // #ifdef MP-ALIPAY || MP-WEIXIN
16 | timeout: 30000,
17 | // #endif
18 | // #ifdef APP-PLUS
19 | sslVerify: true,
20 | // #endif
21 | // #ifdef H5
22 | withCredentials: false,
23 | // #endif
24 | validateStatus: function validateStatus(status) {
25 | return status >= 200 && status < 300
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib/request/core/settle.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Resolve or reject a Promise based on response status.
3 | *
4 | * @param {Function} resolve A function that resolves the promise.
5 | * @param {Function} reject A function that rejects the promise.
6 | * @param {object} response The response.
7 | */
8 | export default function settle(resolve, reject, response) {
9 | const validateStatus = response.config.validateStatus
10 | const status = response.statusCode
11 | if (status && (!validateStatus || validateStatus(status))) {
12 | resolve(response)
13 | } else {
14 | reject(response)
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/uview-ui/libs/function/$parent.js:
--------------------------------------------------------------------------------
1 | // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
2 | // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
3 | // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
4 | // 值(默认为undefined),就是查找最顶层的$parent
5 | export default function $parent(name = undefined) {
6 | let parent = this.$parent;
7 | // 通过while历遍,这里主要是为了H5需要多层解析的问题
8 | while (parent) {
9 | // 父组件
10 | if (parent.$options && parent.$options.name !== name) {
11 | // 如果组件的name不相等,继续上一级寻找
12 | parent = parent.$parent;
13 | } else {
14 | return parent;
15 | }
16 | }
17 | return false;
18 | }
--------------------------------------------------------------------------------
/uview-ui/libs/css/style.mp.scss:
--------------------------------------------------------------------------------
1 | /* start--微信小程序编译后页面有组件名的元素,特别处理--start */
2 | /* #ifdef MP-WEIXIN */
3 | u-td, u-th {
4 | flex: 1;
5 | align-self: stretch;
6 | }
7 |
8 | .u-td {
9 | height: 100%;
10 | }
11 |
12 | u-icon {
13 | display: inline-flex;
14 | align-items: center;
15 | }
16 |
17 | // 各家小程序宫格组件外层设置为100%,避免受到父元素display: flex;的影响
18 | u-grid {
19 | width: 100%;
20 | flex: 0 0 100%;
21 | }
22 |
23 | // 避免小程序线条组件因为父组件display: flex;而失效
24 | u-line {
25 | flex: 1;
26 | }
27 |
28 | u-switch {
29 | display: inline-flex;
30 | align-items: center;
31 | }
32 | /* #endif */
33 | /* end-微信小程序编译后页面有组件名的元素,特别处理--end */
--------------------------------------------------------------------------------
/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileType": "miniprogram",
3 | "libVersion": "2.27.0",
4 | "packOptions": {
5 | "ignore": [],
6 | "include": []
7 | },
8 | "setting": {
9 | "coverView": true,
10 | "es6": true,
11 | "postcss": true,
12 | "minified": true,
13 | "enhance": true,
14 | "showShadowRootInWxmlPanel": true,
15 | "packNpmRelationList": [],
16 | "babelSetting": {
17 | "ignore": [],
18 | "disablePlugins": [],
19 | "outputPath": ""
20 | }
21 | },
22 | "condition": {},
23 | "editorSetting": {
24 | "tabIndent": "insertSpaces",
25 | "tabSize": 2
26 | }
27 | }
--------------------------------------------------------------------------------
/lib/request/helpers/isAbsoluteURL.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | /**
4 | * Determines whether the specified URL is absolute
5 | *
6 | * @param {string} url The URL to test
7 | * @returns {boolean} True if the specified URL is absolute, otherwise false
8 | */
9 | export default function isAbsoluteURL(url) {
10 | // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL).
11 | // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
12 | // by any combination of letters, digits, plus, period, or hyphen.
13 | return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url)
14 | }
15 |
--------------------------------------------------------------------------------
/uview-ui/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "uview-ui",
3 | "version": "1.6.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/libs/function/deepClone.js:
--------------------------------------------------------------------------------
1 | // 判断arr是否为一个数组,返回一个bool值
2 | function isArray (arr) {
3 | return Object.prototype.toString.call(arr) === '[object Array]';
4 | }
5 |
6 | // 深度克隆
7 | function deepClone (obj) {
8 | // 对常见的“非”值,直接返回原来值
9 | if([null, undefined, NaN, false].includes(obj)) return obj;
10 | if(typeof obj !== "object" && typeof obj !== 'function') {
11 | //原始类型直接返回
12 | return obj;
13 | }
14 | var o = isArray(obj) ? [] : {};
15 | for(let i in obj) {
16 | if(obj.hasOwnProperty(i)){
17 | o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i];
18 | }
19 | }
20 | return o;
21 | }
22 |
23 | export default deepClone;
24 |
--------------------------------------------------------------------------------
/vue.config.js:
--------------------------------------------------------------------------------
1 |
2 | // module.exports = {
3 | // /**
4 | // * 此处为发行h5,微信小程序,app中删除console
5 | // * 如需显示console 需要注释此处重新运行
6 | // */
7 | // chainWebpack: (config) => {
8 | // // 发行或运行时启用了压缩时会生效
9 | // config.optimization.minimizer('terser').tap((args) => {
10 | // const compress = args[0].terserOptions.compress
11 | // // 非 App 平台移除 console 代码(包含所有 console 方法,如 log,debug,info...)
12 | // compress.drop_console = true
13 | // compress.pure_funcs = [
14 | // '__f__', // App 平台 vue 移除日志代码
15 | // // 'console.debug' // 可移除指定的 console 方法
16 | // ]
17 | // return args
18 | // })
19 | // }
20 | // }
--------------------------------------------------------------------------------
/config/api.js:
--------------------------------------------------------------------------------
1 | /**
2 | * base : 基础业务API
3 | * buyer : 买家API
4 | */
5 | // 开发环境
6 | const dev = {
7 | common: "http://plat.trytowish.cn/prod-api",
8 | baseFacility: "http://plat.trytowish.cn/prod-api/aio",
9 | };
10 | // 生产环境
11 | const prod = {
12 | common: "http://plat.trytowish.cn/prod-api",
13 | baseFacility: "http://plat.trytowish.cn/prod-api/aio",
14 | };
15 |
16 | //默认生产环境
17 | let api = dev;
18 | //如果是开发环境
19 | if (process.env.NODE_ENV == "development") {
20 | api = dev;
21 | } else {
22 | api = prod;
23 | }
24 | //微信小程序,app的打包方式建议为生产环境,所以这块直接条件编译赋值
25 | // #ifdef MP-WEIXIN || MP-ALIPAY || APP-PLUS
26 | api = prod;
27 | // #endif
28 |
29 | // api.buyer += "/buyer";
30 | // api.common += "/common";
31 | export default {
32 | ...api,
33 | };
34 |
--------------------------------------------------------------------------------
/lib/request/core/buildFullPath.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | import isAbsoluteURL from '../helpers/isAbsoluteURL'
4 | import combineURLs from '../helpers/combineURLs'
5 |
6 | /**
7 | * Creates a new URL by combining the baseURL with the requestedURL,
8 | * only when the requestedURL is not already an absolute URL.
9 | * If the requestURL is absolute, this function returns the requestedURL untouched.
10 | *
11 | * @param {string} baseURL The base URL
12 | * @param {string} requestedURL Absolute or relative URL to combine
13 | * @returns {string} The combined full path
14 | */
15 | export default function buildFullPath(baseURL, requestedURL) {
16 | if (baseURL && !isAbsoluteURL(requestedURL)) {
17 | return combineURLs(baseURL, requestedURL)
18 | }
19 | return requestedURL
20 | }
21 |
--------------------------------------------------------------------------------
/uview-ui/libs/function/throttle.js:
--------------------------------------------------------------------------------
1 | let timer, flag;
2 | /**
3 | * 节流原理:在一定时间内,只能触发一次
4 | *
5 | * @param {Function} func 要执行的回调函数
6 | * @param {Number} wait 延时的时间
7 | * @param {Boolean} immediate 是否立即执行
8 | * @return null
9 | */
10 | function throttle(func, wait = 500, immediate = true) {
11 | if (immediate) {
12 | if (!flag) {
13 | flag = true;
14 | // 如果是立即执行,则在wait毫秒内开始时执行
15 | typeof func === 'function' && func();
16 | timer = setTimeout(() => {
17 | flag = false;
18 | }, wait);
19 | }
20 | } else {
21 | if (!flag) {
22 | flag = true
23 | // 如果是非立即执行,则在wait毫秒内的结束处执行
24 | timer = setTimeout(() => {
25 | flag = false
26 | typeof func === 'function' && func();
27 | }, wait);
28 | }
29 |
30 | }
31 | };
32 | export default throttle
33 |
--------------------------------------------------------------------------------
/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import Vuex from "vuex";
3 | import storage from "@/utils/storage";
4 |
5 | Vue.use(Vuex);
6 |
7 | const store = new Vuex.Store({
8 | state: {
9 | verificationKey: "",
10 | distributionId:"",
11 | hasLogin: storage.getHasLogin(),
12 | userInfo: storage.getUserInfo(),
13 | uuid: storage.getUuid(),
14 | token: "",
15 | },
16 | mutations: {
17 | login(state, userInfo) {
18 | state.userInfo = userInfo || {};
19 | state.userName =
20 | userInfo.Name || userInfo.Nickname || userInfo.Username || "匿名用户";
21 | state.hasLogin = true;
22 | },
23 | logout(state) {
24 | state.userName = "";
25 | state.hasLogin = false;
26 | },
27 | },
28 | actions: {},
29 | });
30 |
31 | export default store;
32 |
--------------------------------------------------------------------------------
/config/config.js:
--------------------------------------------------------------------------------
1 | const name = "奥升"; //全局商城name
2 | const schemeName = "Orise"; //唤醒app需要的schemeName
3 | export default {
4 | name: name,
5 | customerServiceMobile: "", //默认客服电话
6 | customerServiceEmail: "", //客服邮箱
7 | qrLink: "http://plat.trytowish.cn/",
8 | // #ifdef MP-WEIXIN
9 | appid: "wx66a19ee384891552", //微信测试
10 | // #endif
11 | // #ifdef MP-ALIPAY
12 | appid: "2021004128601128", //支付宝测试
13 | // #endif
14 | wxMapSubKey: "BAGBZ-CJOLG-K7BQ2-IO6GZ-5FLWE-J6B46", //微信地图的key
15 | wxNotifyKey: ["O5_2PL86dBvmL_bv4OL7mQDobDoP0iexPR5VOKDOiJs","6jg6BYBHRl_AU5e7oPhpK-a6-Qxen1ovP2a-ywL8bAs"], //微信推送模板,订单开发、结束两个模板
16 | /**
17 | * 如需更换主题请修改此处以及uni.scss中的全局颜色
18 | */
19 | mainColor: "#4A98D3", // 主题色
20 | lightColor: "#0974C5", // 高亮主题色
21 | aiderLightColor: "#00d591", // 辅助高亮颜色
22 | };
23 |
--------------------------------------------------------------------------------
/uview-ui/libs/function/debounce.js:
--------------------------------------------------------------------------------
1 | let timeout = null;
2 |
3 | /**
4 | * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
5 | *
6 | * @param {Function} func 要执行的回调函数
7 | * @param {Number} wait 延时的时间
8 | * @param {Boolean} immediate 是否立即执行
9 | * @return null
10 | */
11 | function debounce(func, wait = 500, immediate = false) {
12 | // 清除定时器
13 | if (timeout !== null) clearTimeout(timeout);
14 | // 立即执行,此类情况一般用不到
15 | if (immediate) {
16 | var callNow = !timeout;
17 | timeout = setTimeout(function() {
18 | timeout = null;
19 | }, wait);
20 | if (callNow) typeof func === 'function' && func();
21 | } else {
22 | // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
23 | timeout = setTimeout(function() {
24 | typeof func === 'function' && func();
25 | }, wait);
26 | }
27 | }
28 |
29 | export default debounce
30 |
--------------------------------------------------------------------------------
/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 | // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
12 | // 解决办法为在组件根部再套一个没有任何作用的view元素
13 | $uGetRect(selector, all) {
14 | return new Promise(resolve => {
15 | uni.createSelectorQuery().
16 | in(this)[all ? 'selectAll' : 'select'](selector)
17 | .boundingClientRect(rect => {
18 | if (all && Array.isArray(rect) && rect.length) {
19 | resolve(rect)
20 | }
21 | if (!all && rect) {
22 | resolve(rect)
23 | }
24 | })
25 | .exec()
26 | })
27 | }
28 | },
29 | onReachBottom() {
30 | uni.$emit('uOnReachBottom')
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/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/components/u-time-line/u-time-line.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
23 |
24 |
44 |
--------------------------------------------------------------------------------
/uview-ui/libs/function/color.js:
--------------------------------------------------------------------------------
1 | // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
2 | // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
3 | let color = {
4 | primary: "#2979ff",
5 | primaryDark: "#2b85e4",
6 | primaryDisabled: "#a0cfff",
7 | primaryLight: "#ecf5ff",
8 | bgColor: "#f3f4f6",
9 |
10 | info: "#909399",
11 | infoDark: "#82848a",
12 | infoDisabled: "#c8c9cc",
13 | infoLight: "#f4f4f5",
14 |
15 | warning: "#ff9900",
16 | warningDark: "#f29100",
17 | warningDisabled: "#fcbd71",
18 | warningLight: "#fdf6ec",
19 |
20 | error: "#fa3534",
21 | errorDark: "#dd6161",
22 | errorDisabled: "#fab6b6",
23 | errorLight: "#fef0f0",
24 |
25 | success: "#0974C5",
26 | successDark: "#18b566",
27 | successDisabled: "#71d5a1",
28 | successLight: "#dbf1e1",
29 |
30 | mainColor: "#303133",
31 | contentColor: "#606266",
32 | tipsColor: "#909399",
33 | lightColor: "#c0c4cc",
34 | borderColor: "#e4e7ed"
35 | }
36 |
37 | export default color;
--------------------------------------------------------------------------------
/api/station.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 交♂易相关API
3 | */
4 | import { http, Method } from "@/utils/request.js";
5 | import { encodeURL } from "@/api/common";
6 | import api from "../config/api";
7 |
8 | /**
9 | * 获取购物车列表
10 | * @param show_type 要显示的类型 all:全部 checked:已选中的
11 | */
12 | export function getStations(params) {
13 | let path = "/mp/v1/geo/geoStationList";
14 | const url = encodeURL(path, params);
15 | return http.request({
16 | url: url,
17 | method: "get",
18 | });
19 | }
20 |
21 | /**
22 | * 获取充电站详情
23 | * @param stationId 充电站id
24 | */
25 | export function getStation(stationId) {
26 | return http.request({
27 | url: '/mp/v1/station/' + stationId,
28 | method: Method.GET,
29 | });
30 | }
31 |
32 | /**
33 | * 获取充电接口详情
34 | * @param connectorId 充电接口id
35 | */
36 | export function getConnector(params) {
37 | return http.request({
38 | url: '/mp/v1/charge/order/prepareOrderInfo',
39 | method: Method.GET,
40 | params: params,
41 | });
42 | }
43 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/api/members.js:
--------------------------------------------------------------------------------
1 | import storage from "@/utils/storage";
2 | import { http, Method } from "@/utils/request.js";
3 |
4 | /**
5 | * 意见反馈
6 | */
7 | export function feedback(data) {
8 | return http.request({
9 | url: "/mp/v1/feedback/feedback",
10 | method: Method.POST,
11 | needToken: true,
12 | data,
13 | });
14 | }
15 |
16 | /**
17 | * 获取意见反馈列表
18 | * @param params
19 | */
20 | export function getFeedbackList(params) {
21 | return http.request({
22 | url: "/mp/v1/feedback/feedbackList",
23 | method: Method.GET,
24 | params,
25 | });
26 | }
27 |
28 | /**
29 | * 获取活动基本信息
30 | * @param id
31 | */
32 | export function getFeedbackInfo(id) {
33 | return http.request({
34 | url: `/mp/v1/feedback/info/${id}`,
35 | method: Method.GET,
36 | loading: false,
37 | });
38 | }
39 |
40 | /**
41 | * 获取用户信息
42 | */
43 | export function fetchUserInfo() {
44 | return http.request({
45 | url: `/mp/v1/auth/info`,
46 | method: Method.GET,
47 | needToken: true,
48 | });
49 | }
50 |
--------------------------------------------------------------------------------
/main.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import App from "./App";
3 | import * as filters from "./utils/filters.js"; // global filter
4 | import uView from "uview-ui";
5 | import store from "./store";
6 | import config from '@/config/config';
7 |
8 | // 引入uView对小程序分享的mixin封装
9 | let mpShare = require('uview-ui/libs/mixin/mpShare.js');
10 | Vue.mixin(mpShare)
11 |
12 | /**
13 | * 全局filters
14 | */
15 |
16 | Object.keys(filters).forEach((key) => {
17 | Vue.filter(key, filters[key]);
18 | });
19 |
20 | // 引入Vuex
21 | Vue.prototype.$store = store;
22 | Vue.use(uView);
23 | Vue.config.productionTip = false;
24 |
25 |
26 | /**
27 | * 注意!
28 | * 此处将常用的颜色嵌入到原型链上面
29 | * 颜色使用驼峰命名对应 uni.scss中全局颜色变量名
30 | * 如需更换主题请修改此处以及uni.scss中的全局颜色
31 | */
32 | // 主题色
33 | Vue.prototype.$mainColor = config.mainColor;
34 | // 高亮主题色
35 | Vue.prototype.$lightColor = config.lightColor;
36 | // 辅助高亮颜色
37 | Vue.prototype.$aiderLightColor = config.aiderLightColor;
38 |
39 |
40 | App.mpType = "app";
41 |
42 | const app = new Vue({
43 | ...App,
44 | });
45 | app.$mount();
46 |
--------------------------------------------------------------------------------
/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/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: #80808020;
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: #0974C5;
23 | $u-type-success-disabled: #53c8af;
24 | $u-type-success-dark: #009777;
25 | $u-type-success-light: #c3e7df;
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 |
--------------------------------------------------------------------------------
/uview-ui/components/u-full-screen/u-full-screen.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
38 |
39 |
53 |
--------------------------------------------------------------------------------
/pages/passport/login.scss:
--------------------------------------------------------------------------------
1 | .sub-title {
2 | font-size: 24rpx;
3 | color: #999;
4 | }
5 | .cell {
6 | margin: 40rpx 0;
7 | }
8 | .login-ball {
9 | border-bottom-left-radius: 300rpx;
10 | height: 400rpx;
11 | position: relative;
12 | }
13 |
14 | /deep/ .u-form-item--right__content__slot {
15 | width: 100%;
16 | display: block;
17 | }
18 |
19 | .title {
20 | font-size: 48rpx;
21 | color: #000;
22 | text-align: center;
23 | }
24 | .privacy {
25 | font-size: 24upx;
26 | color: #999;
27 | text-align: center;
28 | margin-top: 360rpx;
29 | width: 100%;
30 | display: flex;
31 | justify-content: center;
32 | }
33 | span {
34 | color: $aider-light-color;
35 | }
36 | .form {
37 | padding: 0 72rpx;
38 | }
39 | .divider {
40 | margin: 30rpx 0 !important;
41 | }
42 | .submit {
43 | height: 80rpx;
44 | line-height: 80rpx;
45 | color: #fff;
46 | text-align: center;
47 | font-size: 30rpx;
48 | border-radius: 100px;
49 | }
50 | .logo {
51 | margin-top: 20rpx;
52 | width: 200rpx;
53 | height: 200rpx;
54 | text-align: center;
55 | }
56 | .logo-cell {
57 | text-align: center;
58 | }
59 | .text-tips {
60 | text-align: center;
61 | }
62 | .tips {
63 | position: absolute;
64 | bottom: 10rpx;
65 | width: 100%;
66 |
67 | text-align: center;
68 | }
69 |
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "闪电",
3 | "appid" : "__UNI__B0A0BC2",
4 | "description" : "",
5 | "versionName" : "4.2.7",
6 | "versionCode" : 4000270,
7 | "transformPx" : false,
8 | "permission" : {
9 | "scope.userLocation" : {
10 | "desc" : "你的位置信息将用于地图的效果展示"
11 | }
12 | },
13 | /* SDK配置 */
14 | "quickapp" : {},
15 | /* 快应用特有相关 */
16 | "mp-weixin" : {
17 | /* 小程序特有相关 */
18 | "usingComponents" : {},
19 | "appid" : "wx66a19ee384891552",
20 | "setting" : {
21 | "urlCheck" : false,
22 | "minified" : true,
23 | "postcss" : false,
24 | "es6" : true
25 | },
26 | "permission" : {
27 | "scope.userLocation" : {
28 | "desc" : "位置信息将用于地图的效果展示"
29 | }
30 | },
31 | "requiredPrivateInfos" : [ "getLocation" ],
32 | "plugins" : {},
33 | /* 夜间模式 */
34 | "darkmode" : true,
35 | "themeLocation" : "theme.json"
36 | },
37 | "mp-alipay" : {
38 | "appid" : "2021004128601128",
39 | "usingComponents" : true,
40 | "component2" : true,
41 | "darkmode" : true,
42 | "themeLocation" : "theme.json"
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/api/car.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 车辆相关API
3 | */
4 |
5 | import { http, Method } from "@/utils/request.js";
6 |
7 | /**
8 | * 添加车辆
9 | * @param data
10 | */
11 | export function addCar(data) {
12 | return http.request({
13 | url: `/mp/v1/car/insert`,
14 | method: Method.POST,
15 | needToken: true,
16 | data,
17 | });
18 | }
19 |
20 | /**
21 | * 删除
22 | * @param params
23 | */
24 | export function deleteCar(carId) {
25 | return http.request({
26 | url: `/mp/v1/car/del/${carId}`,
27 | method: Method.PUT,
28 | needToken: true,
29 | });
30 | }
31 |
32 | /**
33 | * 获取用户车辆列表
34 | * @param params
35 | */
36 | export function getCarList(params) {
37 | return http.request({
38 | url: "/mp/v1/car/list",
39 | method: Method.GET,
40 | needToken: true,
41 | params,
42 | });
43 | }
44 |
45 | /**
46 | * 获取车辆详情
47 | * @param params
48 | */
49 | export function getCar(carId) {
50 | return http.request({
51 | url: `/mp/v1/car/info/${carId}`,
52 | method: Method.GET,
53 | needToken: true,
54 | });
55 | }
56 |
57 | /**
58 | * 修改车辆
59 | * @param data
60 | */
61 | export function updateCar(data) {
62 | return http.request({
63 | url: `/mp/v1/car/upcar`,
64 | method: Method.POST,
65 | needToken: true,
66 | data,
67 | });
68 | }
69 |
70 |
--------------------------------------------------------------------------------
/uview-ui/components/u-gap/u-gap.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
51 |
52 |
55 |
--------------------------------------------------------------------------------
/uview-ui/libs/function/getParent.js:
--------------------------------------------------------------------------------
1 | // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
2 | // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
3 | export default function getParent(name, keys) {
4 | let parent = this.$parent;
5 | // 通过while历遍,这里主要是为了H5需要多层解析的问题
6 | while (parent) {
7 | // 父组件
8 | if (parent.$options.name !== name) {
9 | // 如果组件的name不相等,继续上一级寻找
10 | parent = parent.$parent;
11 | } else {
12 | let data = {};
13 | // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
14 | if(Array.isArray(keys)) {
15 | keys.map(val => {
16 | data[val] = parent[val] ? parent[val] : '';
17 | })
18 | } else {
19 | // 历遍传过来的对象参数
20 | for(let i in keys) {
21 | // 如果子组件有此值则用,无此值则用父组件的值
22 | // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
23 | if(Array.isArray(keys[i])) {
24 | if(keys[i].length) {
25 | data[i] = keys[i];
26 | } else {
27 | data[i] = parent[i];
28 | }
29 | } else if(keys[i].constructor === Object) {
30 | // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
31 | if(Object.keys(keys[i]).length) {
32 | data[i] = keys[i];
33 | } else {
34 | data[i] = parent[i];
35 | }
36 | } else {
37 | // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
38 | data[i] = (keys[i] || keys[i] === false) ? keys[i] : parent[i];
39 | }
40 | }
41 | }
42 | return data;
43 | }
44 | }
45 |
46 | return {};
47 | }
--------------------------------------------------------------------------------
/lib/request/core/InterceptorManager.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 |
4 | function InterceptorManager() {
5 | this.handlers = []
6 | }
7 |
8 | /**
9 | * Add a new interceptor to the stack
10 | *
11 | * @param {Function} fulfilled The function to handle `then` for a `Promise`
12 | * @param {Function} rejected The function to handle `reject` for a `Promise`
13 | *
14 | * @return {Number} An ID used to remove interceptor later
15 | */
16 | InterceptorManager.prototype.use = function use(fulfilled, rejected) {
17 | this.handlers.push({
18 | fulfilled: fulfilled,
19 | rejected: rejected
20 | })
21 | return this.handlers.length - 1
22 | }
23 |
24 | /**
25 | * Remove an interceptor from the stack
26 | *
27 | * @param {Number} id The ID that was returned by `use`
28 | */
29 | InterceptorManager.prototype.eject = function eject(id) {
30 | if (this.handlers[id]) {
31 | this.handlers[id] = null
32 | }
33 | }
34 |
35 | /**
36 | * Iterate over all the registered interceptors
37 | *
38 | * This method is particularly useful for skipping over any
39 | * interceptors that may have become `null` calling `eject`.
40 | *
41 | * @param {Function} fn The function to call for each interceptor
42 | */
43 | InterceptorManager.prototype.forEach = function forEach(fn) {
44 | this.handlers.forEach(h => {
45 | if (h !== null) {
46 | fn(h)
47 | }
48 | })
49 | }
50 |
51 | export default InterceptorManager
52 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/api/common.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 公共API
3 | */
4 | import { http, Method } from "@/utils/request.js";
5 | import api from "@/config/api.js";
6 | import config from "@/config/config";
7 |
8 | /**
9 | * 逆地址解析
10 | * @param location
11 | */
12 | export function wxGeocoder(location) {
13 | return http.request({
14 | url: `https://apis.map.qq.com/ws/geocoder/v1/?key=${config.wxMapSubKey}&location=${location}`,
15 | method: Method.GET,
16 | message: false,
17 | });
18 | }
19 |
20 | /**
21 | * 获取地区数据
22 | * @param id
23 | */
24 | export function getRegionsById(id = 0) {
25 | return http.request({
26 | url: `${api.common}/common/region/item/${id}`,
27 | method: Method.GET,
28 | message: false,
29 | });
30 | }
31 |
32 | // 获取IM接口前缀
33 | export function getIMDetail() {
34 | return http.request({
35 | url: `${api.common}/IM`,
36 | method: Method.GET,
37 | message: false,
38 | });
39 | }
40 |
41 | /**
42 | * url encode
43 | * @param {String} url
44 | * @param {Object} params
45 | */
46 | export function encodeURL(url, params) {
47 | const arr = [];
48 | Object.entries(params).forEach((param) => {
49 | if (param[1]) {
50 | arr.push(`${param[0]}=${encodeURIComponent(param[1])}`);
51 | }
52 | });
53 | const result = url + "?" + arr.join("&");
54 | return result;
55 | }
56 |
57 | /**
58 | * 文件上传地址
59 | * @type {string}
60 | */
61 | export const upload = api.common + "/mp/v1/file/upload";
62 |
--------------------------------------------------------------------------------
/api/order.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 订单相关API
3 | */
4 |
5 | import { http, Method } from "@/utils/request.js";
6 |
7 | /**
8 | * 获取订单列表
9 | * @param params
10 | */
11 | export function getOrderList(params) {
12 | return http.request({
13 | url: "/mp/v1/charge/getChargeOrderList",
14 | method: Method.GET,
15 | needToken: true,
16 | params,
17 | });
18 | }
19 |
20 | /**
21 | * 获取订单详情
22 | * @param orderSn 订单编号
23 | */
24 | export function getOrderDetail(orderSn) {
25 | return http.request({
26 | url: `/mp/v1/charge/getChargeOrderInfo`,
27 | method: Method.GET,
28 | needToken: true,
29 | params: { startChargeSeq: orderSn },
30 | });
31 | }
32 |
33 | /**
34 | * 启动充电
35 | * @param data 订单编号
36 | */
37 | export function startCharge(data) {
38 | return http.request({
39 | url: `/mp/v1/charge/startCharge`,
40 | method: Method.POST,
41 | needToken: true,
42 | data,
43 | });
44 | }
45 |
46 | /**
47 | * 手动结束充电
48 | * @param data 订单编号
49 | */
50 | export function stopCharge(data) {
51 | return http.request({
52 | url: `/mp/v1/charge/stopCharge`,
53 | method: Method.POST,
54 | needToken: true,
55 | data,
56 | });
57 | }
58 |
59 | /**
60 | * 充电订单推送通知
61 | * @param data 订单编号
62 | */
63 | export function setOrderNofity(data) {
64 | return http.request({
65 | url: `/mp/v1/push/msg/orderChargeTaskOnceMsg`,
66 | method: Method.POST,
67 | needToken: true,
68 | data,
69 | });
70 | }
71 |
--------------------------------------------------------------------------------
/uview-ui/components/u-th/u-th.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
39 |
40 |
54 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/utils/RegExp.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 各种正则表达式
3 | * mobile 手机号
4 | * email 电子邮箱
5 | * password 密码【6-20位】
6 | * integer 正整数【不包含0】
7 | * money 金钱
8 | * TINumber 纳税识别号
9 | * IDCard 身份证
10 | * userName 账户名称【汉字、字母、数字、“-”、“_”的组合】
11 | * URL URL
12 | * TEL 固定电话
13 | */
14 |
15 | // 手机号
16 | export const mobile = /^0?(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])[0-9]{8}$/
17 |
18 | // 电子邮箱
19 | export const email = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
20 |
21 | // 密码【6-20位】
22 | export const password = /^[@A-Za-z0-9!#$%^&*.~,]{6,20}$/
23 |
24 | // 正整数【不包含0】
25 | export const integer = /^[1-9]\d*$/
26 |
27 | // 正整数【包含0】
28 | export const Integer = /^[0-9]\d*$/
29 |
30 | // 金钱
31 | export const money = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
32 |
33 | // 纳税识别号
34 | export const TINumber = /^((\d{6}[0-9A-Z]{9})|([0-9A-Za-z]{2}\d{6}[0-9A-Za-z]{10,12}))$/
35 |
36 | // 身份证
37 | export const IDCard = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
38 |
39 | // 账户名称【汉字、字母、数字、“-”、“_”的组合】
40 | export const userName = /[A-Za-z0-9_\-\u4e00-\u9fa5]$/
41 |
42 | // URL
43 | export const URL =
44 | /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
45 |
46 | // 固话
47 | export const TEL = /0\d{2,3}-\d{7,8}/
48 |
--------------------------------------------------------------------------------
/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 (let 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 |
--------------------------------------------------------------------------------
/api/message.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 站内消息相关API
3 | */
4 |
5 | import {http,Method} from '@/utils/request.js';
6 | const request = http.request
7 |
8 | /**
9 | * 获取微信消息订阅
10 | * @param params
11 | * @returns {AxiosPromise}
12 | */
13 | export function getWeChatMpMessage() {
14 | return http.request({
15 | url: 'passport/connect/miniProgram/subscribeMessage',
16 | method: Method.GET
17 | });
18 | }
19 |
20 | /**
21 | * 获取消息列表
22 | * @param params
23 | * @returns {AxiosPromise}
24 | */
25 | export function getMessages(params) {
26 | params = params || {};
27 | params.pageSize = params.pageSize || 5;
28 | return http.request({
29 | url: 'members/member-nocice-logs',
30 | method: Method.GET,
31 | needToken: true,
32 | params,
33 | });
34 | }
35 |
36 |
37 | /**
38 | * 标记消息为已读
39 | * @param ids
40 | */
41 | export function messageMarkAsRead(ids) {
42 | return http.request({
43 | url: `members/member-nocice-logs/${ids}/read`,
44 | method: Method.PUT,
45 | needToken: true,
46 | });
47 | }
48 |
49 | //读取站内消息
50 | export function editMessages(message_id,params){
51 | return http.request({
52 | url:`/message/member/${message_id}`,
53 | method:Method.PUT,
54 | needToken:true,
55 | params
56 | })
57 | }
58 | //获取站内消息
59 | export function messages(params) {
60 | return http.request({
61 | url: "/message/member",
62 | method: Method.GET,
63 | needToken: true,
64 | params,
65 | });
66 | }
67 |
68 | /**
69 | * @param appType
70 | * @returns {AxiosPromise}
71 | *
72 | */
73 | export function getAppVersion(appType) {
74 | return http.request({
75 | url: `/other/appVersion/${appType}`,
76 | method: Method.GET,
77 | type:"manager"
78 | });
79 | }
--------------------------------------------------------------------------------
/components/default-page/default-page.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{title}}
6 |
7 | 去逛逛
8 |
9 |
10 |
11 |
12 |
13 |
48 |
49 |
87 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/request/helpers/buildURL.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | import * as utils from './../utils'
4 |
5 | function encode(val) {
6 | return encodeURIComponent(val).
7 | replace(/%40/gi, '@').
8 | replace(/%3A/gi, ':').
9 | replace(/%24/g, '$').
10 | replace(/%2C/gi, ',').
11 | replace(/%20/g, '+').
12 | replace(/%5B/gi, '[').
13 | replace(/%5D/gi, ']')
14 | }
15 |
16 | /**
17 | * Build a URL by appending params to the end
18 | *
19 | * @param {string} url The base of the url (e.g., http://www.google.com)
20 | * @param {object} [params] The params to be appended
21 | * @returns {string} The formatted url
22 | */
23 | export default function buildURL(url, params) {
24 | /*eslint no-param-reassign:0*/
25 | if (!params) {
26 | return url
27 | }
28 |
29 | var serializedParams
30 | if (utils.isURLSearchParams(params)) {
31 | serializedParams = params.toString()
32 | } else {
33 | var parts = []
34 |
35 | utils.forEach(params, function serialize(val, key) {
36 | if (val === null || typeof val === 'undefined') {
37 | return
38 | }
39 |
40 | if (utils.isArray(val)) {
41 | key = key + '[]'
42 | } else {
43 | val = [val]
44 | }
45 |
46 | utils.forEach(val, function parseValue(v) {
47 | if (utils.isDate(v)) {
48 | v = v.toISOString()
49 | } else if (utils.isObject(v)) {
50 | v = JSON.stringify(v)
51 | }
52 | parts.push(encode(key) + '=' + encode(v))
53 | })
54 | })
55 |
56 | serializedParams = parts.join('&')
57 | }
58 |
59 | if (serializedParams) {
60 | var hashmarkIndex = url.indexOf('#')
61 | if (hashmarkIndex !== -1) {
62 | url = url.slice(0, hashmarkIndex)
63 | }
64 |
65 | url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams
66 | }
67 |
68 | return url
69 | }
70 |
--------------------------------------------------------------------------------
/uview-ui/libs/function/timeFormat.js:
--------------------------------------------------------------------------------
1 | // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
2 | // 所以这里做一个兼容polyfill的兼容处理
3 | if (!String.prototype.padStart) {
4 | // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
5 | String.prototype.padStart = function(maxLength, fillString = ' ') {
6 | if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
7 | 'fillString must be String')
8 | let str = this
9 | // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
10 | if (str.length >= maxLength) return String(str)
11 |
12 | let fillLength = maxLength - str.length,
13 | times = Math.ceil(fillLength / fillString.length)
14 | while (times >>= 1) {
15 | fillString += fillString
16 | if (times === 1) {
17 | fillString += fillString
18 | }
19 | }
20 | return fillString.slice(0, fillLength) + str;
21 | }
22 | }
23 |
24 | function timeFormat(timestamp = null, fmt = 'yyyy-mm-dd') {
25 | // 其他更多是格式化有如下:
26 | // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
27 | timestamp = parseInt(timestamp);
28 | // 如果为null,则格式化当前时间
29 | if (!timestamp) timestamp = Number(new Date());
30 | // 判断用户输入的时间戳是秒还是毫秒,一般前端js获取的时间戳是毫秒(13位),后端传过来的为秒(10位)
31 | if (timestamp.toString().length == 10) timestamp *= 1000;
32 | let date = new Date(timestamp);
33 | let ret;
34 | let opt = {
35 | "y+": date.getFullYear().toString(), // 年
36 | "m+": (date.getMonth() + 1).toString(), // 月
37 | "d+": date.getDate().toString(), // 日
38 | "h+": date.getHours().toString(), // 时
39 | "M+": date.getMinutes().toString(), // 分
40 | "s+": date.getSeconds().toString() // 秒
41 | // 有其他格式化字符需求可以继续添加,必须转化成字符串
42 | };
43 | for (let k in opt) {
44 | ret = new RegExp("(" + k + ")").exec(fmt);
45 | if (ret) {
46 | fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
47 | };
48 | };
49 | return fmt;
50 | }
51 |
52 | export default timeFormat
53 |
--------------------------------------------------------------------------------
/api/login.js:
--------------------------------------------------------------------------------
1 | import { http } from "@/utils/request.js";
2 |
3 | import api from "@/config/api.js";
4 |
5 | /**
6 | * 通过短信重置密码
7 | * @param mobile
8 | */
9 | export function resetByMobile(params) {
10 | return http.request({
11 | url: `/passport/member/resetByMobile`,
12 | method: "POST",
13 | params,
14 | });
15 | }
16 |
17 | /**
18 | * 账号密码登陆
19 | * @params password
20 | * @params username
21 | */
22 | export function userLogin(params){
23 | return http.request({
24 | method: "POST",
25 | url:`/passport/member/userLogin`,
26 | data: params,
27 | header: {
28 | "content-type": "application/x-www-form-urlencoded",
29 | },
30 | })
31 | }
32 |
33 |
34 | /**
35 | * 发送验证码
36 | * @param mobile
37 | */
38 | export function sendMobile(mobile,type='LOGIN') {
39 | return http.request({
40 | url: `${api.common}/common/sms/${type}/${mobile}`,
41 | method: "GET",
42 | });
43 | }
44 |
45 | /**
46 | * 短信登录
47 | * @param mobile
48 | * @param smsCode
49 | */
50 | export function smsLogin(params, clientType) {
51 | return http.request({
52 | url: `/passport/member/smsLogin`,
53 | method: "POST",
54 | data: params,
55 | header: {
56 | "content-type": "application/x-www-form-urlencoded",
57 | clientType: clientType,
58 | },
59 | });
60 | }
61 |
62 | /**
63 | * 修改密码
64 | * @param newPassword
65 | * @param password
66 | */
67 |
68 | export function modifyPass(params) {
69 | return http.request({
70 | url: `/passport/member/modifyPass`,
71 | method: "PUT",
72 | params,
73 | });
74 | }
75 |
76 | /**
77 | * 刷新token
78 | */
79 | export function refreshTokenFn(refresh_token) {
80 | return http.request({
81 | url: `/passport/member/refresh/${refresh_token}`,
82 | method: "GET",
83 | });
84 | }
85 |
86 | // 获取密码状态
87 | export function logout () {
88 | return http.request({
89 | url: '/passport/member/logout',
90 | method: "POST",
91 | needToken: true,
92 | })
93 | }
94 |
--------------------------------------------------------------------------------
/uview-ui/components/u-time-line-item/u-time-line-item.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
52 |
53 |
84 |
--------------------------------------------------------------------------------
/components/float-btn/float-btn.scss:
--------------------------------------------------------------------------------
1 | @mixin notSelect {
2 | -moz-user-select: none; /*火狐*/
3 | -webkit-user-select: none; /*webkit浏览器*/
4 | -ms-user-select: none; /*IE10*/
5 | -khtml-user-select: none; /*早期浏览器*/
6 | user-select: none;
7 | }
8 | @mixin not-touch {
9 | -webkit-touch-callout: none;
10 | -webkit-user-select: none;
11 | -khtml-user-select: none;
12 | -moz-user-select: none;
13 | -ms-user-select: none;
14 | user-select: none;
15 | }
16 | .floatBtn {
17 | @include notSelect;
18 | @include not-touch();
19 | position: absolute;
20 | // z-index: 9999;
21 | overflow: visible;
22 | width: 160rpx;
23 | height: 76rpx;
24 | right: 0;
25 | // left: calc(100% - 196px);
26 | // top: calc(100% - 180px);
27 | color: #f5fef9;
28 | background: #239ad8;
29 | font-size: 28rpx;
30 | line-height: 76rpx;
31 | text-align: right;
32 | box-sizing: border-box;
33 | // padding: 10px;
34 | &.rightBtn {
35 | border-radius: 21rpx;
36 | }
37 | &.leftBtn {
38 | border-radius: 21rpx;
39 | }
40 | &.moveBtn {
41 | border-radius: 21rpx;
42 | }
43 | }
44 | @keyframes lightning-anim {
45 | 0% {
46 | opacity: 0;
47 | }
48 | 5% {
49 | opacity: 1;
50 | }
51 | 10% {
52 | opacity: 0;
53 | }
54 | 15% {
55 | opacity: 1;
56 | }
57 | 100% {
58 | opacity: 0;
59 | }
60 | }
61 | .lighting {
62 | position: absolute;
63 | top: 43%;
64 | left: 30rpx;
65 | font-size: 10rpx;
66 | transform: skewX(-10deg);
67 | animation: lightning-anim 2s linear infinite;
68 | }
69 | .lighting::before {
70 | content: "";
71 | position: absolute;
72 | margin-top: -20rpx;
73 | margin-left: -10rpx;
74 | border-top: 15rpx solid transparent;
75 | border-right: 10rpx solid #f7f5ff;
76 | border-bottom: 15rpx solid #f7f5ff;
77 | border-left: 10rpx solid transparent;
78 | }
79 | .lighting::after {
80 | content: "";
81 | position: absolute;
82 | margin-left: 6rpx;
83 | border-top: 15rpx solid #f7f5ff;
84 | border-right: 10rpx solid transparent;
85 | border-bottom: 15rpx solid transparent;
86 | border-left: 10rpx solid #f7f5ff;
87 | }
88 |
--------------------------------------------------------------------------------
/uview-ui/components/u-cell-group/u-cell-group.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{ title }}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
49 |
50 |
87 |
--------------------------------------------------------------------------------
/uview-ui/components/u-grid/u-grid.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
77 |
78 |
96 |
--------------------------------------------------------------------------------
/uview-ui/components/u-row/u-row.vue:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
65 |
66 |
85 |
--------------------------------------------------------------------------------
/uview-ui/components/u-index-anchor/u-index-anchor.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{ index }}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
63 |
64 |
85 |
--------------------------------------------------------------------------------
/uview-ui/components/u-link/u-link.vue:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
82 |
83 |
90 |
--------------------------------------------------------------------------------
/uview-ui/components/u-table/u-table.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
81 |
82 |
96 |
--------------------------------------------------------------------------------
/uview-ui/components/u-td/u-td.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
40 |
41 |
103 |
--------------------------------------------------------------------------------
/uview-ui/components/u-line/u-line.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
77 |
78 |
85 |
--------------------------------------------------------------------------------
/api/passport.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Andste on 2018/5/2.
3 | * 用户认证相关API
4 | */
5 | import storage from "@/utils/storage.js";
6 | import { http, Method } from "@/utils/request.js";
7 | import { md5 } from "@/utils/md5.js";
8 |
9 | /**
10 | * 普通登录
11 | * @param username
12 | * @param password
13 | * @param captcha
14 | */
15 | export function login(username, password, captcha) {
16 | return http.request({
17 | url: "passport/login",
18 | method: Method.POST,
19 | params: {
20 | username,
21 | password: md5(password),
22 | captcha,
23 | uuid: storage.getUuid(),
24 | },
25 | });
26 | }
27 |
28 | /**
29 | * 验证账户信息
30 | * @param captcha
31 | * @param account
32 | */
33 | export function validAccount(captcha, account) {
34 | return http.request({
35 | url: "passport/find-pwd",
36 | method: Method.GET,
37 | params: {
38 | uuid: storage.getUuid(),
39 | captcha,
40 | account,
41 | },
42 | });
43 | }
44 |
45 | /**
46 | * 发送找回密码短信
47 | * @param uuid
48 | * @param captcha
49 | */
50 | export function sendFindPasswordSms(uuid, captcha) {
51 | return http.request({
52 | url: "passport/find-pwd/send",
53 | method: Method.POST,
54 | header: { "content-type": "application/x-www-form-urlencoded" },
55 | data: {
56 | uuid: uuid,
57 | captcha,
58 | },
59 | });
60 | }
61 |
62 | /**
63 | * 校验找回密码验证码
64 | * @param uuid
65 | * @param sms_code
66 | */
67 | export function validFindPasswordSms(uuid, sms_code) {
68 | return http.request({
69 | url: "passport/find-pwd/valid",
70 | method: Method.GET,
71 | params: {
72 | uuid,
73 | sms_code,
74 | },
75 | });
76 | }
77 |
78 | /**
79 | * 修改密码【找回密码用】
80 | * @param password
81 | * @param uuid
82 | */
83 | export function changePassword(password, uuid) {
84 | if (!uuid) {
85 | uuid = storage.getUuid();
86 | }
87 | return http.request({
88 | url: "passport/find-pwd/update-password",
89 | method: Method.PUT,
90 | header: { "content-type": "application/x-www-form-urlencoded" },
91 | data: {
92 | uuid,
93 | password: md5(password),
94 | },
95 | });
96 | }
97 |
98 | // 保存生物认证登录
99 | export function setBiolofy(params) {
100 | return http.request({
101 | url: `passport/login/save/biology`,
102 | method: "POST",
103 | params,
104 | });
105 | }
106 |
--------------------------------------------------------------------------------
/api/connect.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 信任登录相关API
3 | */
4 |
5 | import { http, Method } from "@/utils/request.js";
6 | import api from "../config/api";
7 | const request = http.request;
8 |
9 | /**
10 | * web 第三方登录
11 | * @param {Object} code
12 | */
13 | export function webConnect(code) {
14 | return http.request({
15 | url: `passport/connect/connect/login/web/${code}`,
16 | method: Method.GET,
17 | needToken: true,
18 | header: {
19 | clientType: "H5",
20 | },
21 | });
22 | }
23 | export function openIdLogin(params, clientType) {
24 | return http.request({
25 | url: `passport/connect/connect/app/login`,
26 | method: Method.GET,
27 | needToken: true,
28 | data: params,
29 | header: {
30 | clientType: clientType,
31 | },
32 | });
33 | }
34 |
35 | /**
36 | * 第三方登录成功 回调接口
37 | */
38 | export function loginCallback(state) {
39 | return http.request({
40 | url: `passport/connect/connect/result?state=${state}`,
41 | method: Method.GET,
42 | needToken: false,
43 | });
44 | }
45 |
46 | /**
47 | * 小程序拿unionId
48 | * @param params
49 | */
50 | export function mpLogin(data, appid) {
51 | return http.request({
52 | url: `/mp/v1/auth/login/${appid}`,
53 | method: Method.POST,
54 | // header: { "content-type": "application/json;charset=utf-8" },
55 | data,
56 | });
57 | }
58 |
59 | /**
60 | * 支付宝小程序拿unionId
61 | * @param params
62 | */
63 | export function alipayLogin(data, appid) {
64 | return http.request({
65 | url: `/mp/v1/auth/ali/login`,
66 | method: Method.POST,
67 | // header: { "content-type": "application/json;charset=utf-8" },
68 | data,
69 | });
70 | }
71 |
72 | /**
73 | * 小程序绑定手机号
74 | * @param params
75 | */
76 | export function mpBindPhone(data, appid) {
77 | return http.request({
78 | url: `/mp/v1/auth/phone/${appid}`,
79 | method: Method.POST,
80 | data,
81 | });
82 | }
83 |
84 | /**
85 | * 小程序绑定手机号
86 | * @param params
87 | */
88 | export function alipayBindPhone(data, appid) {
89 | return http.request({
90 | url: `/mp/v1/auth/ali/phone`,
91 | method: Method.POST,
92 | data,
93 | });
94 | }
95 |
96 | /**
97 | * 更新用户信息
98 | * @param params
99 | */
100 | export function mpUpdateUserProfile(data) {
101 | return http.request({
102 | url: `/mp/v1/auth/update`,
103 | method: Method.POST,
104 | data,
105 | });
106 | }
107 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/request/adapters/index.js:
--------------------------------------------------------------------------------
1 | import buildURL from '../helpers/buildURL'
2 | import buildFullPath from '../core/buildFullPath'
3 | import settle from '../core/settle'
4 |
5 | /**
6 | * 返回可选值存在的配置
7 | * @param {Array} keys - 可选值数组
8 | * @param {Object} config2 - 配置
9 | * @return {{}} - 存在的配置项
10 | */
11 | const mergeKeys = (keys, config2) => {
12 | let config = {}
13 | keys.forEach(prop => {
14 | if (typeof config2[prop] !== 'undefined') {
15 | config[prop] = config2[prop]
16 | }
17 | })
18 | return config
19 | }
20 | export default (config) => {
21 | return new Promise((resolve, reject) => {
22 | const _config = {
23 | url: buildURL(buildFullPath(config.baseURL, config.url), config.params),
24 | header: config.header,
25 | complete: (response) => {
26 | response.config = config
27 | try {
28 | // 对可能字符串不是json 的情况容错
29 | if (typeof response.data === 'string') {
30 | response.data = JSON.parse(response.data)
31 | }
32 | // eslint-disable-next-line no-empty
33 | } catch (e) {
34 | }
35 | settle(resolve, reject, response)
36 | }
37 | }
38 | let requestTask
39 | if (config.method === 'UPLOAD') {
40 | let otherConfig = {
41 | // #ifdef MP-ALIPAY
42 | fileType: config.fileType,
43 | // #endif
44 | filePath: config.filePath,
45 | name: config.name
46 | }
47 | const optionalKeys = [
48 | // #ifdef APP-PLUS || H5
49 | 'files',
50 | // #endif
51 | // #ifdef H5
52 | 'file',
53 | // #endif
54 | 'formData'
55 | ]
56 | requestTask = uni.uploadFile({..._config, ...otherConfig, ...mergeKeys(optionalKeys, config)})
57 | } else if (config.method === 'DOWNLOAD') {
58 | requestTask = uni.downloadFile(_config)
59 | } else {
60 | const optionalKeys = [
61 | 'data',
62 | 'method',
63 | // #ifdef MP-ALIPAY || MP-WEIXIN
64 | 'timeout',
65 | // #endif
66 | 'dataType',
67 | // #ifndef MP-ALIPAY || APP-PLUS
68 | 'responseType',
69 | // #endif
70 | // #ifdef APP-PLUS
71 | 'sslVerify',
72 | // #endif
73 | // #ifdef H5
74 | 'withCredentials'
75 | // #endif
76 | ]
77 | requestTask = uni.request({..._config,...mergeKeys(optionalKeys, config)})
78 | }
79 | if (config.getTask) {
80 | config.getTask(requestTask, config)
81 | }
82 | })
83 | }
84 |
--------------------------------------------------------------------------------
/uview-ui/components/u-collapse/u-collapse.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
101 |
102 |
105 |
--------------------------------------------------------------------------------
/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/components/u-parse/libs/config.js:
--------------------------------------------------------------------------------
1 | /* 配置文件 */
2 | var cfg = {
3 | // 出错占位图
4 | errorImg: null,
5 | // 过滤器函数
6 | filter: null,
7 | // 代码高亮函数
8 | highlight: null,
9 | // 文本处理函数
10 | onText: null,
11 | // 实体编码列表
12 | entities: {
13 | quot: '"',
14 | apos: "'",
15 | semi: ';',
16 | nbsp: '\xA0',
17 | ensp: '\u2002',
18 | emsp: '\u2003',
19 | ndash: '–',
20 | mdash: '—',
21 | middot: '·',
22 | lsquo: '‘',
23 | rsquo: '’',
24 | ldquo: '“',
25 | rdquo: '”',
26 | bull: '•',
27 | hellip: '…'
28 | },
29 | blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'),
30 | boolAttrs: makeMap('allowfullscreen,autoplay,autostart,controls,ignore,loop,muted'),
31 | // 块级标签,将被转为 div
32 | blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section'),
33 | // 将被移除的标签
34 | ignoreTags: makeMap('area,base,canvas,frame,iframe,input,link,map,meta,param,script,source,style,svg,textarea,title,track,wbr'),
35 | // 只能被 rich-text 显示的标签
36 | richOnlyTags: makeMap('a,colgroup,fieldset,legend,table'),
37 | // 自闭合的标签
38 | selfClosingTags: makeMap('area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr'),
39 | // 信任的标签
40 | trustTags: makeMap('a,abbr,ad,audio,b,blockquote,br,code,col,colgroup,dd,del,dl,dt,div,em,fieldset,h1,h2,h3,h4,h5,h6,hr,i,img,ins,label,legend,li,ol,p,q,source,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,title,ul,video'),
41 | // 默认的标签样式
42 | userAgentStyles: {
43 | address: 'font-style:italic',
44 | big: 'display:inline;font-size:1.2em',
45 | blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px',
46 | caption: 'display:table-caption;text-align:center',
47 | center: 'text-align:center',
48 | cite: 'font-style:italic',
49 | dd: 'margin-left:40px',
50 | mark: 'background-color:yellow',
51 | pre: 'font-family:monospace;white-space:pre;overflow:scroll',
52 | s: 'text-decoration:line-through',
53 | small: 'display:inline;font-size:0.8em',
54 | u: 'text-decoration:underline'
55 | }
56 | }
57 |
58 | function makeMap(str) {
59 | var map = Object.create(null),
60 | list = str.split(',');
61 | for (var i = list.length; i--;)
62 | map[list[i]] = true;
63 | return map;
64 | }
65 |
66 | // #ifdef MP-WEIXIN
67 | if (wx.canIUse('editor')) {
68 | cfg.blockTags.pre = void 0;
69 | cfg.ignoreTags.rp = true;
70 | Object.assign(cfg.richOnlyTags, makeMap('bdi,bdo,caption,rt,ruby'));
71 | Object.assign(cfg.trustTags, makeMap('bdi,bdo,caption,pre,rt,ruby'));
72 | }
73 | // #endif
74 |
75 | // #ifdef APP-PLUS
76 | cfg.ignoreTags.iframe = void 0;
77 | Object.assign(cfg.trustTags, makeMap('embed,iframe'));
78 | // #endif
79 |
80 | module.exports = cfg;
81 |
--------------------------------------------------------------------------------
/uview-ui/components/u-grid-item/u-grid-item.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
70 |
71 |
114 |
--------------------------------------------------------------------------------
/uview-ui/components/u-radio-group/u-radio-group.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
95 |
96 |
106 |
--------------------------------------------------------------------------------
/lib/request/core/mergeConfig.js:
--------------------------------------------------------------------------------
1 | import {deepMerge, isObject} from '../utils'
2 |
3 | /**
4 | * 合并局部配置优先的配置,如果局部有该配置项则用局部,如果全局有该配置项则用全局
5 | * @param {Array} keys - 配置项
6 | * @param {Object} globalsConfig - 当前的全局配置
7 | * @param {Object} config2 - 局部配置
8 | * @return {{}}
9 | */
10 | const mergeKeys = (keys, globalsConfig, config2) => {
11 | let config = {}
12 | keys.forEach(prop => {
13 | if (typeof config2[prop] !== 'undefined') {
14 | config[prop] = config2[prop]
15 | } else if (typeof globalsConfig[prop] !== 'undefined') {
16 | config[prop] = globalsConfig[prop]
17 | }
18 | })
19 | return config
20 | }
21 | /**
22 | *
23 | * @param globalsConfig - 当前实例的全局配置
24 | * @param config2 - 当前的局部配置
25 | * @return - 合并后的配置
26 | */
27 | export default (globalsConfig, config2 = {}) => {
28 | const method = config2.method || globalsConfig.method || 'GET'
29 | let config = {
30 | baseURL: globalsConfig.baseURL || '',
31 | method: method,
32 | url: config2.url || ''
33 | }
34 | const mergeDeepPropertiesKeys = ['header', 'params', 'custom']
35 | const defaultToConfig2Keys = ['getTask', 'validateStatus']
36 | mergeDeepPropertiesKeys.forEach(prop => {
37 | if (isObject(config2[prop])) {
38 | config[prop] = deepMerge(globalsConfig[prop], config2[prop])
39 | } else if (typeof config2[prop] !== 'undefined') {
40 | config[prop] = config2[prop]
41 | } else if (isObject(globalsConfig[prop])) {
42 | config[prop] = deepMerge(globalsConfig[prop])
43 | } else if (typeof globalsConfig[prop] !== 'undefined') {
44 | config[prop] = globalsConfig[prop]
45 | }
46 | })
47 | config = {...config, ...mergeKeys(defaultToConfig2Keys, globalsConfig, config2)}
48 |
49 | // eslint-disable-next-line no-empty
50 | if (method === 'DOWNLOAD') {
51 |
52 | } else if (method === 'UPLOAD') {
53 | if (isObject(config.header)) {
54 | delete config.header['content-type']
55 | delete config.header['Content-Type']
56 | }
57 | const uploadKeys = [
58 | // #ifdef APP-PLUS || H5
59 | 'files',
60 | // #endif
61 | // #ifdef MP-ALIPAY
62 | 'fileType',
63 | // #endif
64 | // #ifdef H5
65 | 'file',
66 | // #endif
67 | 'filePath',
68 | 'name',
69 | 'formData',
70 | ]
71 | uploadKeys.forEach(prop => {
72 | if (typeof config2[prop] !== 'undefined') {
73 | config[prop] = config2[prop]
74 | }
75 | })
76 | } else {
77 | const defaultsKeys = [
78 | 'data',
79 | // #ifdef MP-ALIPAY || MP-WEIXIN
80 | 'timeout',
81 | // #endif
82 | 'dataType',
83 | // #ifndef MP-ALIPAY || APP-PLUS
84 | 'responseType',
85 | // #endif
86 | // #ifdef APP-PLUS
87 | 'sslVerify',
88 | // #endif
89 | // #ifdef H5
90 | 'withCredentials'
91 | // #endif
92 | ]
93 | config = {...config, ...mergeKeys(defaultsKeys, globalsConfig, config2)}
94 | }
95 |
96 | return config
97 | }
98 |
--------------------------------------------------------------------------------
/uview-ui/components/u-top-tips/u-top-tips.vue:
--------------------------------------------------------------------------------
1 |
2 | {{ title }}
6 |
7 |
8 |
69 |
70 |
122 |
--------------------------------------------------------------------------------
/uview-ui/libs/css/color.scss:
--------------------------------------------------------------------------------
1 | .u-type-primary-light {
2 | color: $u-type-primary-light;
3 | }
4 |
5 | .u-type-warning-light {
6 | color: $u-type-warning-light;
7 | }
8 |
9 | .u-type-success-light {
10 | color: $u-type-success-light;
11 | }
12 |
13 | .u-type-error-light {
14 | color: $u-type-error-light;
15 | }
16 |
17 | .u-type-info-light {
18 | color: $u-type-info-light;
19 | }
20 |
21 | .u-type-primary-light-bg {
22 | background-color: $u-type-primary-light;
23 | }
24 |
25 | .u-type-warning-light-bg {
26 | background-color: $u-type-warning-light;
27 | }
28 |
29 | .u-type-success-light-bg {
30 | background-color: $u-type-success-light;
31 | }
32 |
33 | .u-type-error-light-bg {
34 | background-color: $u-type-error-light;
35 | }
36 |
37 | .u-type-info-light-bg {
38 | background-color: $u-type-info-light;
39 | }
40 |
41 | .u-type-primary-dark {
42 | color: $u-type-primary-dark;
43 | }
44 |
45 | .u-type-warning-dark {
46 | color: $u-type-warning-dark;
47 | }
48 |
49 | .u-type-success-dark {
50 | color: $u-type-success-dark;
51 | }
52 |
53 | .u-type-error-dark {
54 | color: $u-type-error-dark;
55 | }
56 |
57 | .u-type-info-dark {
58 | color: $u-type-info-dark;
59 | }
60 |
61 | .u-type-primary-dark-bg {
62 | background-color: $u-type-primary-dark;
63 | }
64 |
65 | .u-type-warning-dark-bg {
66 | background-color: $u-type-warning-dark;
67 | }
68 |
69 | .u-type-success-dark-bg {
70 | background-color: $u-type-success-dark;
71 | }
72 |
73 | .u-type-error-dark-bg {
74 | background-color: $u-type-error-dark;
75 | }
76 |
77 | .u-type-info-dark-bg {
78 | background-color: $u-type-info-dark;
79 | }
80 |
81 | .u-type-primary-disabled {
82 | color: $u-type-primary-disabled;
83 | }
84 |
85 | .u-type-warning-disabled {
86 | color: $u-type-warning-disabled;
87 | }
88 |
89 | .u-type-success-disabled {
90 | color: $u-type-success-disabled;
91 | }
92 |
93 | .u-type-error-disabled {
94 | color: $u-type-error-disabled;
95 | }
96 |
97 | .u-type-info-disabled {
98 | color: $u-type-info-disabled;
99 | }
100 |
101 | .u-type-primary {
102 | color: $u-type-primary;
103 | }
104 |
105 | .u-type-warning {
106 | color: $u-type-warning;
107 | }
108 |
109 | .u-type-success {
110 | color: $u-type-success;
111 | }
112 |
113 | .u-type-error {
114 | color: $u-type-error;
115 | }
116 |
117 | .u-type-info {
118 | color: $u-type-info;
119 | }
120 |
121 | .u-type-primary-bg {
122 | background-color: $u-type-primary;
123 | }
124 |
125 | .u-type-warning-bg {
126 | background-color: $u-type-warning;
127 | }
128 |
129 | .u-type-success-bg {
130 | background-color: $u-type-success;
131 | }
132 |
133 | .u-type-error-bg {
134 | background-color: $u-type-error;
135 | }
136 |
137 | .u-type-info-bg {
138 | background-color: $u-type-info;
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/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 | }
--------------------------------------------------------------------------------
/components/float-btn/float-btn.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 充电中
5 |
6 |
7 |
8 |
98 |
99 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Orise充电站
2 |
3 | [🔥 充电平台微服务源码](https://github.com/NaTieJun/orise-charge-cloud)
4 |
5 | [🔥 充电管理后台源码](https://github.com/NaTieJun/orise-admin)
6 |
7 | [🔥 充电小程序源码](https://github.com/NaTieJun/orise-mp) (当前)
8 |
9 | ### 快速开始
10 |
11 | #### 阅读文档
12 |
13 | `uni-app` https://uniapp.dcloud.net.cn/api/
14 |
15 | `vue2` https://v2.cn.vuejs.org/
16 |
17 | `uView v1` https://v1.uviewui.com/
18 |
19 | #### 环境
20 |
21 | 在开发之前保证本地安装了以下软件
22 | `hbulider` https://www.dcloud.io/hbuilderx.html
23 |
24 | ### 技术栈
25 |
26 | 本项目技术栈为 `uni-app` + `scss` + `ES2015` + `uView` 提前学习和了解这些知识将帮助你更好地上手我们的项目。
27 |
28 | ### 安装
29 |
30 | 1. 克隆项目到本地
31 |
32 | ```shell
33 | git clone https://gitee.com/orise001/orise-mp.git
34 | ```
35 |
36 | 2. 从`hbulider`中打开项目
37 |
38 | ```shell
39 | 直接将项目拖进hbulider中点击运行即可
40 | ```
41 |
42 | ### 目录结构
43 |
44 | ```
45 | ├── api // 接口
46 | ├── components // 组件
47 | ├── config // 配置文件
48 | ├── pages // 页面
49 | ├── static // 静态资源
50 | ├── store // vuex
51 | ├── utils // 工具类
52 | ├── uview-ui // uview
53 | ├── App.vue // 入口页面
54 | ├── main.js // 入口文件
55 | ├── manifest.json // hbulider配置文件
56 | ├── pages.json // 路由配置文件
57 | ├── uni.scss // 全局样式
58 | └── vue.config.js // vue配置文件
59 | ```
60 |
61 | ### 运行
62 |
63 | #### 运行在微信小程序
64 |
65 | 1.需要保证本地要有`微信开发者工具` https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html
66 |
67 | 2.在`hbulider`中点击`运行`->`运行到小程序模拟器`->`微信开发者工具` 运行的时候需要配置小程序的`appid`,配置完成后即可运行
68 |
69 |
70 | ### 项目配置/开发
71 |
72 | #### config配置
73 | 在根目录`config`下的`config`设置中配置了一些默认的配置,可以根据自己的需求进行修改
74 |
75 | ```
76 | const name = "奥升"; //全局商城name
77 | const schemeName = "Orise"; //唤醒app需要的schemeName
78 | export default {
79 | name: name,
80 | customerServiceMobile: "", //默认客服电话
81 | customerServiceEmail: "", //默认客服邮箱
82 | /**
83 | * 如需更换主题请修改此处以及uni.scss中的全局颜色
84 | */
85 | mainColor: "#ff3c2a", // 主题色
86 | lightColor: "#ff6b35", // 高亮主题色
87 | aiderLightColor: "#ff9f28", // 辅助高亮颜色
88 | };
89 |
90 | ```
91 | #### 组件
92 | 在根目录`components`下的`components`设置中配置了一些默认的组件,可以根据自己的需求进行修改
93 |
94 | #### 页面
95 | 在`pages`文件夹写入或修改页面代码,在`pages.json`中去配置页面路由,具体配置可以参考`pages.json` 或参考uni-app的文档
96 |
97 | 在微信小程序中默认启用分包操作,如果需要在微信小程序中使用分包,需要在`pages.json`中配置分包路径,具体配置可以参考`pages.json` 或参考uni-app的文档
98 |
99 | #### 主题
100 | 1.现在`config`中设置主题色
101 |
102 | 2.在`uni.scss`中设置全局颜色
103 |
104 | 3.替换项目中一些icon以及图片的颜色
105 |
106 |
107 |
108 |
109 | ### 常见问题
110 |
111 | #### 微信小程序移动端启动报错
112 |
113 | 小程序直播插件报错,在`manifest`中删除代码。
114 |
115 | #### 微信小程序上传文件过大超出 2MB
116 |
117 | 1.关闭微信小程序,停止微信小程序运行
118 |
119 | 2.重新点击运行小程序模拟器,在最下方有一个 `运行时是否压缩代码` 勾选并重新运行
120 |
121 | 3.如果还是提示超出2MB,重新执行1步骤,然后点击`发行`->`小程序`即可
122 |
123 | 4.以上1-3步骤都不行,可以尝试删除一些自己开发的代码或本地的静态资源图片
124 |
125 | #### 微信小程序在开发者工具中可以使用接口在测试版却不行
126 | 1.首先保证是否填写`request`合法域名 在微信小程序后台配置
127 |
128 | 2.需保证接口为https请求
129 |
130 | #### 如何配置API
131 | 在根目录 `config` -> `api` 中配置开发环境以及生产环境 api 接口地址
132 |
133 | #### 运行报错
134 | 初次运行时候可能因为本地环境缺少编译插件,这个时候一定要注意看报错信息,根据报错信息安装相应的插件即可
135 |
136 | #### 如何配置微信小程序appid
137 | 在根目录 `manifest.json` 中配置微信小程序appid
138 |
139 |
140 | #### 微信登录报错
141 | 需检查appId是否配置正确,在后台管理中信任登录的`appId`以及`appSecret`是否配置正确
142 |
143 |
--------------------------------------------------------------------------------
/uview-ui/components/u-col/u-col.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 |
16 |
75 |
76 |
136 |
--------------------------------------------------------------------------------
/uview-ui/components/u-mask/u-mask.vue:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
101 |
102 |
123 |
--------------------------------------------------------------------------------
/uview-ui/components/u-parse/libs/CssHandler.js:
--------------------------------------------------------------------------------
1 | const cfg = require('./config.js'),
2 | isLetter = c => (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
3 |
4 | function CssHandler(tagStyle) {
5 | var styles = Object.assign(Object.create(null), cfg.userAgentStyles);
6 | for (var item in tagStyle)
7 | styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];
8 | this.styles = styles;
9 | }
10 | CssHandler.prototype.getStyle = function(data) {
11 | this.styles = new parser(data, this.styles).parse();
12 | }
13 | CssHandler.prototype.match = function(name, attrs) {
14 | var tmp, matched = (tmp = this.styles[name]) ? tmp + ';' : '';
15 | if (attrs.class) {
16 | var items = attrs.class.split(' ');
17 | for (var i = 0, item; item = items[i]; i++)
18 | if (tmp = this.styles['.' + item])
19 | matched += tmp + ';';
20 | }
21 | if (tmp = this.styles['#' + attrs.id])
22 | matched += tmp + ';';
23 | return matched;
24 | }
25 | module.exports = CssHandler;
26 |
27 | function parser(data, init) {
28 | this.data = data;
29 | this.floor = 0;
30 | this.i = 0;
31 | this.list = [];
32 | this.res = init;
33 | this.state = this.Space;
34 | }
35 | parser.prototype.parse = function() {
36 | for (var c; c = this.data[this.i]; this.i++)
37 | this.state(c);
38 | return this.res;
39 | }
40 | parser.prototype.section = function() {
41 | return this.data.substring(this.start, this.i);
42 | }
43 | // 状态机
44 | parser.prototype.Space = function(c) {
45 | if (c == '.' || c == '#' || isLetter(c)) {
46 | this.start = this.i;
47 | this.state = this.Name;
48 | } else if (c == '/' && this.data[this.i + 1] == '*')
49 | this.Comment();
50 | else if (!cfg.blankChar[c] && c != ';')
51 | this.state = this.Ignore;
52 | }
53 | parser.prototype.Comment = function() {
54 | this.i = this.data.indexOf('*/', this.i) + 1;
55 | if (!this.i) this.i = this.data.length;
56 | this.state = this.Space;
57 | }
58 | parser.prototype.Ignore = function(c) {
59 | if (c == '{') this.floor++;
60 | else if (c == '}' && !--this.floor) this.state = this.Space;
61 | }
62 | parser.prototype.Name = function(c) {
63 | if (cfg.blankChar[c]) {
64 | this.list.push(this.section());
65 | this.state = this.NameSpace;
66 | } else if (c == '{') {
67 | this.list.push(this.section());
68 | this.Content();
69 | } else if (c == ',') {
70 | this.list.push(this.section());
71 | this.Comma();
72 | } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_')
73 | this.state = this.Ignore;
74 | }
75 | parser.prototype.NameSpace = function(c) {
76 | if (c == '{') this.Content();
77 | else if (c == ',') this.Comma();
78 | else if (!cfg.blankChar[c]) this.state = this.Ignore;
79 | }
80 | parser.prototype.Comma = function() {
81 | while (cfg.blankChar[this.data[++this.i]]);
82 | if (this.data[this.i] == '{') this.Content();
83 | else {
84 | this.start = this.i--;
85 | this.state = this.Name;
86 | }
87 | }
88 | parser.prototype.Content = function() {
89 | this.start = ++this.i;
90 | if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
91 | var content = this.section();
92 | for (var i = 0, item; item = this.list[i++];)
93 | if (this.res[item]) this.res[item] += ';' + content;
94 | else this.res[item] = content;
95 | this.list = [];
96 | this.state = this.Space;
97 | }
98 |
--------------------------------------------------------------------------------
/uview-ui/components/u-checkbox-group/u-checkbox-group.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
112 |
113 |
123 |
--------------------------------------------------------------------------------
/utils/storage.js:
--------------------------------------------------------------------------------
1 | let isDev = process.env.NODE_ENV === "development";
2 |
3 | const UUID = isDev ? "uuid_key_dev" : "uuid_key";
4 | const HAS_LOGIN = isDev ? "has_login_key_dev" : "has_login_key";
5 | const ACCESS_TOKEN = isDev ? "access_token_key_dev" : "access_token_key";
6 | const REFRESH_TOKEN = isDev ? "refresh_token_key_dev" : "refresh_token_key";
7 | const USER_INFO = isDev ? "user_info_obj_dev" : "user_info_obj";
8 | const FACE_LOGIN = isDev ? "face_login_dev" : "face_login";
9 | const FINGER_LOGIN = isDev ? "finger_login_dev" : "finger_login";
10 | const CART_BACKBTN = isDev ? "cart_backbtn_dev" : "cart_backbtn";
11 | const AFTERSALE_DATA = isDev ? "aftersale_data_dev" : "aftersale_data";
12 | export default {
13 | // 写入热门搜索时间戳
14 | setHotWords(val) {
15 | uni.setStorageSync("hotWords", val);
16 | },
17 | // 获取热门搜索时间戳
18 | getHotWords() {
19 | return uni.getStorageSync(`hotWords`);
20 | },
21 | //写入 展示还是不展示
22 | setShow(val) {
23 | uni.setStorageSync("show", val);
24 | },
25 | getShow() {
26 | if (uni.getStorageSync(`show`) === "" || uni.getStorageSync(`show`) === undefined) {
27 | return true;
28 | }
29 | return uni.getStorageSync(`show`);
30 | },
31 | // 获取face id登录
32 | getFaceLogin() {
33 | return uni.getStorageSync(FACE_LOGIN);
34 | },
35 | // 写入face id
36 | setFaceLogin(val) {
37 | uni.setStorageSync(FACE_LOGIN, val);
38 | },
39 | // 获取指纹登录
40 | getFingerLogin() {
41 | return uni.getStorageSync(FINGER_LOGIN);
42 | },
43 | // 写入指纹登录
44 | setFingerLogin(val) {
45 | uni.setStorageSync(FINGER_LOGIN, val);
46 | },
47 | // 写入用户信息
48 | setUserInfo(val) {
49 | uni.setStorageSync(USER_INFO, val);
50 | },
51 | // 获取用户信息
52 | getUserInfo() {
53 | return uni.getStorageSync(USER_INFO);
54 | },
55 | // 写入uuid
56 | setUuid(val) {
57 | uni.setStorageSync(UUID, val);
58 | },
59 | // 获取uuid
60 | getUuid() {
61 | return uni.getStorageSync(UUID);
62 | },
63 | // 写入登录
64 | setHasLogin(val) {
65 | uni.setStorageSync(HAS_LOGIN, val);
66 | },
67 | // 获取是否登录
68 | getHasLogin() {
69 | return uni.getStorageSync(HAS_LOGIN);
70 | },
71 | // 删除uuid
72 | removeUuid() {
73 | uni.removeStorageSync(UUID);
74 | },
75 | // 写入accessToken
76 | setAccessToken(val) {
77 | uni.setStorageSync(ACCESS_TOKEN, val);
78 | },
79 | // 获取accessToken
80 | getAccessToken() {
81 | return uni.getStorageSync(ACCESS_TOKEN);
82 | },
83 | // 后退购物车
84 | setCartBackbtn(val) {
85 | uni.setStorageSync(CART_BACKBTN, val);
86 | },
87 |
88 | // 删除token
89 | removeAccessToken() {
90 | uni.removeStorageSync(ACCESS_TOKEN);
91 | },
92 | // 写入刷新token
93 | setRefreshToken(val) {
94 | uni.setStorageSync(REFRESH_TOKEN, val);
95 | },
96 | // 获取刷新token
97 | getRefreshToken() {
98 | return uni.getStorageSync(REFRESH_TOKEN);
99 | },
100 | // 删除token
101 | removeRefreshToken() {
102 | uni.removeStorageSync(REFRESH_TOKEN);
103 | },
104 |
105 | setAfterSaleData(val) {
106 | uni.setStorageSync(AFTERSALE_DATA, val);
107 | },
108 |
109 | getAfterSaleData() {
110 | return uni.getStorageSync(AFTERSALE_DATA);
111 | },
112 | // 删除token
113 | removeAfterSaleData() {
114 | uni.removeStorageSync(AFTERSALE_DATA);
115 | },
116 | };
117 |
--------------------------------------------------------------------------------
/pages/tabbar/mine/utils/tool.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
57 |
58 |
116 |
--------------------------------------------------------------------------------
/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 | // nvue不能用标签命名样式,不能放在微信组件中,否则微信开发工具会报警告,无法使用标签名当做选择器
12 | /* #ifndef APP-NVUE */
13 | image {
14 | display: inline-block;
15 | }
16 |
17 | // 在weex,也即nvue中,所有元素默认为border-box
18 | view,
19 | text {
20 | box-sizing: border-box;
21 | }
22 | /* #endif */
23 |
24 | .u-font-xs {
25 | font-size: 22rpx;
26 | }
27 |
28 | .u-font-sm {
29 | font-size: 26rpx;
30 | }
31 |
32 | .u-font-md {
33 | font-size: 28rpx;
34 | }
35 |
36 | .u-font-lg {
37 | font-size: 30rpx;
38 | }
39 |
40 | .u-font-xl {
41 | font-size: 34rpx;
42 | }
43 |
44 | .u-flex {
45 | /* #ifndef APP-NVUE */
46 | display: flex;
47 | /* #endif */
48 | flex-direction: row;
49 | align-items: center;
50 | }
51 |
52 | .u-flex-wrap {
53 | flex-wrap: wrap;
54 | }
55 |
56 | .u-flex-nowrap {
57 | flex-wrap: nowrap;
58 | }
59 |
60 | .u-col-center {
61 | align-items: center;
62 | }
63 |
64 | .u-col-top {
65 | align-items: flex-start;
66 | }
67 |
68 | .u-col-bottom {
69 | align-items: flex-end;
70 | }
71 |
72 | .u-row-center {
73 | justify-content: center;
74 | }
75 |
76 | .u-row-left {
77 | justify-content: flex-start;
78 | }
79 |
80 | .u-row-right {
81 | justify-content: flex-end;
82 | }
83 |
84 | .u-row-between {
85 | justify-content: space-between;
86 | }
87 |
88 | .u-row-around {
89 | justify-content: space-around;
90 | }
91 |
92 | .u-text-left {
93 | text-align: left;
94 | }
95 |
96 | .u-text-center {
97 | text-align: center;
98 | }
99 |
100 | .u-text-right {
101 | text-align: right;
102 | }
103 |
104 | .u-flex-col {
105 | /* #ifndef APP-NVUE */
106 | display: flex;
107 | /* #endif */
108 | flex-direction: column;
109 | }
110 |
111 | // 定义flex等分
112 | // @for $i from 0 through 12 {
113 | // .u-flex-#{$i} {
114 | // flex: $i;
115 | // }
116 | // }
117 |
118 | // // 定义字体(px)单位,小于20都为px单位字体
119 | // @for $i from 9 to 20 {
120 | // .u-font-#{$i} {
121 | // font-size: $i + px;
122 | // }
123 | // }
124 |
125 | // // 定义字体(rpx)单位,大于或等于20的都为rpx单位字体
126 | // @for $i from 20 through 40 {
127 | // .u-font-#{$i} {
128 | // font-size: $i + rpx;
129 | // }
130 | // }
131 |
132 | // // 定义内外边距,历遍1-80
133 | // @for $i from 0 through 80 {
134 | // // 只要双数和能被5除尽的数
135 | // @if $i % 2 == 0 or $i % 5 == 0 {
136 | // // 得出:u-margin-30或者u-m-30
137 | // .u-margin-#{$i}, .u-m-#{$i} {
138 | // margin: $i + rpx!important;
139 | // }
140 |
141 | // // 得出:u-padding-30或者u-p-30
142 | // .u-padding-#{$i}, .u-p-#{$i} {
143 | // padding: $i + rpx!important;
144 | // }
145 |
146 | // @each $short, $long in l left, t top, r right, b bottom {
147 | // // 缩写版,结果如: u-m-l-30
148 | // // 定义外边距
149 | // .u-m-#{$short}-#{$i} {
150 | // margin-#{$long}: $i + rpx!important;
151 | // }
152 |
153 | // // 定义内边距
154 | // .u-p-#{$short}-#{$i} {
155 | // padding-#{$long}: $i + rpx!important;
156 | // }
157 |
158 | // // 完整版,结果如:u-margin-left-30
159 | // // 定义外边距
160 | // .u-margin-#{$long}-#{$i} {
161 | // margin-#{$long}: $i + rpx!important;
162 | // }
163 |
164 | // // 定义内边距
165 | // .u-padding-#{$long}-#{$i} {
166 | // padding-#{$long}: $i + rpx!important;
167 | // }
168 | // }
169 | // }
170 | // }
171 |
172 |
--------------------------------------------------------------------------------
/utils/tools.js:
--------------------------------------------------------------------------------
1 | import configs from "@/config/config";
2 | import Foundation from "@/utils/Foundation.js";
3 |
4 | const getNetworkType = () => {
5 | uni.getNetworkType({
6 | success: (res) => {
7 | if (res.networkType === "none") {
8 | uni.showToast({
9 | title: "网络好像有点问题,请检查后重试!",
10 | duration: 2000,
11 | icon: "none",
12 | });
13 | let pages = getCurrentPages();
14 | if (pages.length) {
15 | let route = pages[pages.length - 1].route;
16 | if (route !== "pages/empty/empty") {
17 | uni.navigateTo({
18 | url: `/pages/empty/empty?type=wifi`,
19 | });
20 | }
21 | } else {
22 | uni.navigateTo({
23 | url: `/pages/empty/empty?type=wifi`,
24 | });
25 | }
26 | }
27 | },
28 | });
29 | };
30 |
31 | const throttle = (fn, that, gapTime) => {
32 | // export function throttle(fn, gapTime) {
33 | if (gapTime == null || gapTime == undefined) {
34 | gapTime = 1800;
35 | }
36 | let _lastTime = that.lastTime;
37 | let _nowTime = +new Date();
38 | if (_nowTime - _lastTime > gapTime || !_lastTime) {
39 | fn.apply(that, arguments); //将this和参数传给原函数
40 | that.lastTime = _nowTime;
41 | }
42 | };
43 |
44 | /**
45 | * 计算传秒数的倒计时【天、时、分、秒】
46 | * @param seconds
47 | * @returns {{day : *, hours : *, minutes : *, seconds : *}}
48 | */
49 | const countTimeDown = (seconds) => {
50 | const leftTime = (time) => {
51 | if (time < 10) time = "0" + time;
52 | return time + "";
53 | };
54 | return {
55 | day: leftTime(parseInt(seconds / 60 / 60 / 24, 10)),
56 | hours: leftTime(parseInt((seconds / 60 / 60) % 24, 10)),
57 | minutes: leftTime(parseInt((seconds / 60) % 60, 10)),
58 | seconds: leftTime(parseInt(seconds % 60, 10)),
59 | };
60 | };
61 |
62 | /**
63 | * 计算当前时间到第二天0点的倒计时[秒]
64 | * @returns {number}
65 | */
66 | const theNextDayTime = () => {
67 | const nowDate = new Date();
68 | const time =
69 | new Date(
70 | nowDate.getFullYear(),
71 | nowDate.getMonth(),
72 | nowDate.getDate() + 1,
73 | 0,
74 | 0,
75 | 0
76 | ).getTime() - nowDate.getTime();
77 | return parseInt(time / 1000);
78 | };
79 |
80 | const mpScan = () => {
81 | uni.scanCode({
82 | success: function (res) {
83 | let path = encodeURIComponent(res.result);
84 |
85 | // WX_CODE 为小程序码
86 | if (res.scanType == "WX_CODE") {
87 | uni.navigateTo({
88 | url: `/${res.path}`,
89 | });
90 | }
91 | // QR_CODE 为字符串
92 | else if (res.scanType == "QR_CODE" || res.scanType == "QR") {
93 | // 如果匹配qrLink,说明是枪编号,直接跳转到枪详情
94 | if (
95 | res.result != undefined
96 | ) {
97 | let connectorNum = Foundation.urlParse(res.result).n;
98 | uni.navigateTo({
99 | url: `/pages/station/charge/charging?id=${connectorNum}`,
100 | });
101 | } else {
102 | uni.navigateTo({
103 | url: `${res.result}`,
104 | });
105 | }
106 | }
107 | },
108 | });
109 | };
110 |
111 | const serviceCall = (tel) => {
112 | uni.makePhoneCall({
113 | phoneNumber: tel
114 | })
115 | };
116 |
117 | export { getNetworkType, throttle, countTimeDown, theNextDayTime, mpScan, serviceCall };
118 |
--------------------------------------------------------------------------------
/components/verification/animation.css:
--------------------------------------------------------------------------------
1 | /*
2 | Animation 微动画
3 | 基于ColorUI组建库的动画模块 by 文晓港 2019年3月26日19:52:28
4 | */
5 |
6 | /* css 滤镜 控制黑白底色gif的 */
7 | .gif-black{
8 | mix-blend-mode: screen;
9 | }
10 | .gif-white{
11 | mix-blend-mode: multiply;
12 | }
13 |
14 |
15 | /* Animation css */
16 | [class*=animation-] {
17 | animation-duration: .5s;
18 | animation-timing-function: ease-out;
19 | animation-fill-mode: both
20 | }
21 |
22 | .animation-fade {
23 | animation-name: fade;
24 | animation-duration: .8s;
25 | animation-timing-function: linear
26 | }
27 |
28 | .animation-scale-up {
29 | animation-name: scale-up
30 | }
31 |
32 | .animation-scale-down {
33 | animation-name: scale-down
34 | }
35 |
36 | .animation-slide-top {
37 | animation-name: slide-top
38 | }
39 |
40 | .animation-slide-bottom {
41 | animation-name: slide-bottom
42 | }
43 |
44 | .animation-slide-left {
45 | animation-name: slide-left
46 | }
47 |
48 | .animation-slide-right {
49 | animation-name: slide-right
50 | }
51 |
52 | .animation-shake {
53 | animation-name: shake
54 | }
55 |
56 | .animation-reverse {
57 | animation-direction: reverse
58 | }
59 |
60 | @keyframes fade {
61 | 0% {
62 | opacity: 0
63 | }
64 |
65 | 100% {
66 | opacity: 1
67 | }
68 | }
69 |
70 | @keyframes scale-up {
71 | 0% {
72 | opacity: 0;
73 | transform: scale(.2)
74 | }
75 |
76 | 100% {
77 | opacity: 1;
78 | transform: scale(1)
79 | }
80 | }
81 |
82 | @keyframes scale-down {
83 | 0% {
84 | opacity: 0;
85 | transform: scale(1.8)
86 | }
87 |
88 | 100% {
89 | opacity: 1;
90 | transform: scale(1)
91 | }
92 | }
93 |
94 | @keyframes slide-top {
95 | 0% {
96 | opacity: 0;
97 | transform: translateY(-100%)
98 | }
99 |
100 | 100% {
101 | opacity: 1;
102 | transform: translateY(0)
103 | }
104 | }
105 |
106 | @keyframes slide-bottom {
107 | 0% {
108 | opacity: 0;
109 | transform: translateY(100%)
110 | }
111 |
112 | 100% {
113 | opacity: 1;
114 | transform: translateY(0)
115 | }
116 | }
117 |
118 | @keyframes shake {
119 |
120 | 0%,
121 | 100% {
122 | transform: translateX(0)
123 | }
124 |
125 | 10% {
126 | transform: translateX(-9px)
127 | }
128 |
129 | 20% {
130 | transform: translateX(8px)
131 | }
132 |
133 | 30% {
134 | transform: translateX(-7px)
135 | }
136 |
137 | 40% {
138 | transform: translateX(6px)
139 | }
140 |
141 | 50% {
142 | transform: translateX(-5px)
143 | }
144 |
145 | 60% {
146 | transform: translateX(4px)
147 | }
148 |
149 | 70% {
150 | transform: translateX(-3px)
151 | }
152 |
153 | 80% {
154 | transform: translateX(2px)
155 | }
156 |
157 | 90% {
158 | transform: translateX(-1px)
159 | }
160 | }
161 |
162 | @keyframes slide-left {
163 | 0% {
164 | opacity: 0;
165 | transform: translateX(-100%)
166 | }
167 |
168 | 100% {
169 | opacity: 1;
170 | transform: translateX(0)
171 | }
172 | }
173 |
174 | @keyframes slide-right {
175 | 0% {
176 | opacity: 0;
177 | transform: translateX(100%)
178 | }
179 |
180 | 100% {
181 | opacity: 1;
182 | transform: translateX(0)
183 | }
184 | }
--------------------------------------------------------------------------------
/pages/station/components/-price.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 时段价格
6 |
7 |
8 |
9 |
10 |
11 | {{price.startTm.slice(0, 2)}}:{{price.startTm.slice(2)}}-{{price.endTm.slice(0, 2)}}:{{price.endTm.slice(2)}}
12 | 当前时段
13 |
14 |
15 |
16 | ¥{{(Number(price.elecPrice) + Number(price.servicePrice)).toFixed(2)}}
17 | /度
18 |
19 | 电价:¥{{ Number(price.elecPrice).toFixed(2) }}
20 | 服务费:¥{{ Number(price.servicePrice).toFixed(2) }}
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
67 |
68 |
142 |
--------------------------------------------------------------------------------
/uview-ui/components/u-back-top/u-back-top.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 | {{tips}}
13 |
14 |
15 |
16 |
17 |
18 |
19 |
124 |
125 |
154 |
--------------------------------------------------------------------------------
/uview-ui/libs/css/style.vue.scss:
--------------------------------------------------------------------------------
1 | page {
2 | background-color: #fff;
3 | color: $u-main-color;
4 | font-size: 28rpx;
5 | }
6 |
7 | /* start--去除webkit的默认样式--start */
8 | .u-fix-ios-appearance {
9 | -webkit-appearance:none;
10 | }
11 | /* end--去除webkit的默认样式--end */
12 |
13 | /* start--icon图标外层套一个view,让其达到更好的垂直居中的效果--start */
14 | .u-icon-wrap {
15 | display: flex;
16 | align-items: center;
17 | }
18 | /* end-icon图标外层套一个view,让其达到更好的垂直居中的效果--end */
19 |
20 | /* start--iPhoneX底部安全区定义--start */
21 | .safe-area-inset-bottom {
22 | padding-bottom: 0;
23 | padding-bottom: constant(safe-area-inset-bottom);
24 | padding-bottom: env(safe-area-inset-bottom);
25 | }
26 | /* end-iPhoneX底部安全区定义--end */
27 |
28 | /* start--各种hover点击反馈相关的类名-start */
29 | .u-hover-class {
30 | // background-color: #f7f8f9!important;
31 | opacity: 0.6;
32 | }
33 |
34 | .u-cell-hover {
35 | background-color: #80808020 !important;
36 | }
37 | /* end--各种hover点击反馈相关的类名--end */
38 |
39 | /* start--文本行数限制--start */
40 | .u-line-1 {
41 | overflow: hidden;
42 | white-space: nowrap;
43 | text-overflow: ellipsis;
44 | }
45 |
46 | .u-line-2 {
47 | -webkit-line-clamp: 2;
48 | }
49 |
50 | .u-line-3 {
51 | -webkit-line-clamp: 3;
52 | }
53 |
54 | .u-line-4 {
55 | -webkit-line-clamp: 4;
56 | }
57 |
58 | .u-line-5 {
59 | -webkit-line-clamp: 5;
60 | }
61 |
62 | .u-line-2, .u-line-3, .u-line-4, .u-line-5 {
63 | overflow: hidden;
64 | word-break: break-all;
65 | text-overflow: ellipsis;
66 | display: -webkit-box; // 弹性伸缩盒
67 | -webkit-box-orient: vertical; // 设置伸缩盒子元素排列方式
68 | }
69 |
70 | /* end--文本行数限制--end */
71 |
72 |
73 | /* start--Retina 屏幕下的 1px 边框--start */
74 | .u-border,
75 | .u-border-bottom,
76 | .u-border-left,
77 | .u-border-right,
78 | .u-border-top,
79 | .u-border-top-bottom {
80 | position: relative
81 | }
82 |
83 | .u-border-bottom:after,
84 | .u-border-left:after,
85 | .u-border-right:after,
86 | .u-border-top-bottom:after,
87 | .u-border-top:after,
88 | .u-border:after {
89 | /* #ifndef APP-NVUE */
90 | content: ' ';
91 | /* #endif */
92 | position: absolute;
93 | left: 0;
94 | top: 0;
95 | pointer-events: none;
96 | box-sizing: border-box;
97 | -webkit-transform-origin: 0 0;
98 | transform-origin: 0 0;
99 | // 多加0.1%,能解决有时候边框缺失的问题
100 | width: 199.8%;
101 | height: 199.7%;
102 | transform: scale(0.5, 0.5);
103 | border: 0 solid $u-border-color;
104 | z-index: 2;
105 | }
106 |
107 | .u-border-top:after {
108 | border-top-width: 1px
109 | }
110 |
111 | .u-border-left:after {
112 | border-left-width: 1px
113 | }
114 |
115 | .u-border-right:after {
116 | border-right-width: 1px
117 | }
118 |
119 | .u-border-bottom:after {
120 | border-bottom-width: 1px
121 | }
122 |
123 | .u-border-top-bottom:after {
124 | border-width: 1px 0
125 | }
126 |
127 | .u-border:after {
128 | border-width: 1px
129 | }
130 | /* end--Retina 屏幕下的 1px 边框--end */
131 |
132 |
133 | /* start--clearfix--start */
134 | .u-clearfix:after,
135 | .clearfix:after {
136 | /* #ifndef APP-NVUE */
137 | content: '';
138 | /* #endif */
139 | display: table;
140 | clear: both
141 | }
142 | /* end--clearfix--end */
143 |
144 | /* start--高斯模糊tabbar底部处理--start */
145 | .u-blur-effect-inset {
146 | width: 750rpx;
147 | height: var(--window-bottom);
148 | background-color: #FFFFFF;
149 | }
150 | /* end--高斯模糊tabbar底部处理--end */
151 |
152 | /* start--提升H5端uni.toast()的层级,避免被uView的modal等遮盖--start */
153 | /* #ifdef H5 */
154 | uni-toast {
155 | z-index: 10090;
156 | }
157 | uni-toast .uni-toast {
158 | z-index: 10090;
159 | }
160 | /* #endif */
161 | /* end--提升H5端uni.toast()的层级,避免被uView的modal等遮盖--end */
--------------------------------------------------------------------------------
/pages/passport/wechatH5Login.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 欢迎进入{{ projectName }}
8 |
9 |
10 | 为您提供优质服务,{{ projectName }}需要获取以下信息
11 | 您的公开信息(昵称、头像)
12 |
13 |
14 |
15 | 暂不登录
16 |
17 |
18 |
19 |
20 |
21 |
22 |
58 |
59 |
154 |
--------------------------------------------------------------------------------
/uview-ui/components/u-line-progress/u-line-progress.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
12 |
13 |
14 | {{percent + '%'}}
15 |
16 |
17 |
18 |
19 |
20 |
102 |
103 |
146 |
--------------------------------------------------------------------------------
/lib/request/utils.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | // utils is a library of generic helper functions non-specific to axios
4 |
5 | var toString = Object.prototype.toString
6 |
7 | /**
8 | * Determine if a value is an Array
9 | *
10 | * @param {Object} val The value to test
11 | * @returns {boolean} True if value is an Array, otherwise false
12 | */
13 | export function isArray (val) {
14 | return toString.call(val) === '[object Array]'
15 | }
16 |
17 |
18 | /**
19 | * Determine if a value is an Object
20 | *
21 | * @param {Object} val The value to test
22 | * @returns {boolean} True if value is an Object, otherwise false
23 | */
24 | export function isObject (val) {
25 | return val !== null && typeof val === 'object'
26 | }
27 |
28 | /**
29 | * Determine if a value is a Date
30 | *
31 | * @param {Object} val The value to test
32 | * @returns {boolean} True if value is a Date, otherwise false
33 | */
34 | export function isDate (val) {
35 | return toString.call(val) === '[object Date]'
36 | }
37 |
38 | /**
39 | * Determine if a value is a URLSearchParams object
40 | *
41 | * @param {Object} val The value to test
42 | * @returns {boolean} True if value is a URLSearchParams object, otherwise false
43 | */
44 | export function isURLSearchParams (val) {
45 | return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams
46 | }
47 |
48 |
49 | /**
50 | * Iterate over an Array or an Object invoking a function for each item.
51 | *
52 | * If `obj` is an Array callback will be called passing
53 | * the value, index, and complete array for each item.
54 | *
55 | * If 'obj' is an Object callback will be called passing
56 | * the value, key, and complete object for each property.
57 | *
58 | * @param {Object|Array} obj The object to iterate
59 | * @param {Function} fn The callback to invoke for each item
60 | */
61 | export function forEach (obj, fn) {
62 | // Don't bother if no value provided
63 | if (obj === null || typeof obj === 'undefined') {
64 | return
65 | }
66 |
67 | // Force an array if not already something iterable
68 | if (typeof obj !== 'object') {
69 | /*eslint no-param-reassign:0*/
70 | obj = [obj]
71 | }
72 |
73 | if (isArray(obj)) {
74 | // Iterate over array values
75 | for (var i = 0, l = obj.length; i < l; i++) {
76 | fn.call(null, obj[i], i, obj)
77 | }
78 | } else {
79 | // Iterate over object keys
80 | for (var key in obj) {
81 | if (Object.prototype.hasOwnProperty.call(obj, key)) {
82 | fn.call(null, obj[key], key, obj)
83 | }
84 | }
85 | }
86 | }
87 |
88 | /**
89 | * 是否为boolean 值
90 | * @param val
91 | * @returns {boolean}
92 | */
93 | export function isBoolean(val) {
94 | return typeof val === 'boolean'
95 | }
96 |
97 | /**
98 | * 是否为真正的对象{} new Object
99 | * @param {any} obj - 检测的对象
100 | * @returns {boolean}
101 | */
102 | export function isPlainObject(obj) {
103 | return Object.prototype.toString.call(obj) === '[object Object]'
104 | }
105 |
106 |
107 |
108 | /**
109 | * Function equal to merge with the difference being that no reference
110 | * to original objects is kept.
111 | *
112 | * @see merge
113 | * @param {Object} obj1 Object to merge
114 | * @returns {Object} Result of all merge properties
115 | */
116 | export function deepMerge(/* obj1, obj2, obj3, ... */) {
117 | let result = {}
118 | function assignValue(val, key) {
119 | if (typeof result[key] === 'object' && typeof val === 'object') {
120 | result[key] = deepMerge(result[key], val)
121 | } else if (typeof val === 'object') {
122 | result[key] = deepMerge({}, val)
123 | } else {
124 | result[key] = val
125 | }
126 | }
127 | for (let i = 0, l = arguments.length; i < l; i++) {
128 | forEach(arguments[i], assignValue)
129 | }
130 | return result
131 | }
132 |
--------------------------------------------------------------------------------
/uview-ui/components/u-section/u-section.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
13 |
14 | {{title}}
15 |
16 |
19 |
20 |
21 | {{subTitle}}
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
111 |
112 |
149 |
--------------------------------------------------------------------------------
/uview-ui/components/u-form/u-form.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
146 |
147 |
150 |
--------------------------------------------------------------------------------
/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 | import addUnit from './libs/function/addUnit.js'
50 |
51 | // 规则检验
52 | import test from './libs/function/test.js'
53 | // 随机数
54 | import random from './libs/function/random.js'
55 | // 去除空格
56 | import trim from './libs/function/trim.js'
57 | // toast提示,对uni.showToast的封装
58 | import toast from './libs/function/toast.js'
59 | // 获取父组件参数
60 | import getParent from './libs/function/getParent.js'
61 | // 获取整个父组件
62 | import $parent from './libs/function/$parent.js'
63 | // 获取sys()和os()工具方法
64 | // 获取设备信息,挂载到$u的sys()(system的缩写)属性中,
65 | // 同时把安卓和ios平台的名称"ios"和"android"挂到$u.os()中,方便取用
66 | import {sys, os} from './libs/function/sys.js'
67 | // 防抖方法
68 | import debounce from './libs/function/debounce.js'
69 | // 节流方法
70 | import throttle from './libs/function/throttle.js'
71 |
72 |
73 | // 配置信息
74 | import config from './libs/config/config.js'
75 | // 各个需要fixed的地方的z-index配置文件
76 | import zIndex from './libs/config/zIndex.js'
77 |
78 | const $u = {
79 | queryParams: queryParams,
80 | route: route,
81 | timeFormat: timeFormat,
82 | date: timeFormat, // 另名date
83 | timeFrom,
84 | colorGradient: colorGradient.colorGradient,
85 | guid,
86 | color,
87 | sys,
88 | os,
89 | type2icon,
90 | randomArray,
91 | wranning,
92 | get: http.get,
93 | post: http.post,
94 | put: http.put,
95 | 'delete': http.delete,
96 | hexToRgb: colorGradient.hexToRgb,
97 | rgbToHex: colorGradient.rgbToHex,
98 | test,
99 | random,
100 | deepClone,
101 | deepMerge,
102 | getParent,
103 | $parent,
104 | addUnit,
105 | trim,
106 | type: ['primary', 'success', 'error', 'warning', 'info'],
107 | http,
108 | toast,
109 | config, // uView配置信息相关,比如版本号
110 | zIndex,
111 | debounce,
112 | throttle,
113 | }
114 |
115 | const install = Vue => {
116 | Vue.mixin(mixin)
117 | if (Vue.prototype.openShare) {
118 | Vue.mixin(mpShare);
119 | }
120 | // Vue.mixin(vuexStore);
121 | // 时间格式化,同时两个名称,date和timeFormat
122 | Vue.filter('timeFormat', (timestamp, format) => {
123 | return timeFormat(timestamp, format)
124 | })
125 | Vue.filter('date', (timestamp, format) => {
126 | return timeFormat(timestamp, format)
127 | })
128 | // 将多久以前的方法,注入到全局过滤器
129 | Vue.filter('timeFrom', (timestamp, format) => {
130 | return timeFrom(timestamp, format)
131 | })
132 | Vue.prototype.$u = $u
133 | }
134 |
135 | export default {
136 | install
137 | }
--------------------------------------------------------------------------------
/pages/mine/about/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Version {{localVersion.version}}
9 |
10 |
11 | {{localVersion.version}}
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | {{config.customerServiceEmail ? `客服邮箱:${config.customerServiceEmail}` : ``}}
21 |
22 |
23 | CopyRight ©{{config.name}}
24 |
25 |
26 |
27 |
28 |
110 |
111 |
147 |
--------------------------------------------------------------------------------
/uview-ui/components/u-divider/u-divider.vue:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
15 |
16 |
17 |
106 |
107 |
152 |
--------------------------------------------------------------------------------