├── .gitignore ├── src ├── assets │ ├── imgs │ │ ├── 404.jpg │ │ ├── fuli.png │ │ ├── kefu.jpg │ │ ├── none.jpg │ │ ├── wave.jpg │ │ ├── avatar.png │ │ ├── booking.png │ │ ├── favicon.ico │ │ ├── kenan.jpg │ │ ├── kenan2.jpg │ │ ├── loading.gif │ │ ├── audio_ico.png │ │ ├── avatar-bg.jpg │ │ ├── icon-001.jpg │ │ ├── icon-002.jpg │ │ ├── icon-003.jpg │ │ ├── icon-004.jpg │ │ ├── icon-005.jpg │ │ ├── icon-006.jpg │ │ ├── icon-007.jpg │ │ ├── icon-008.jpg │ │ ├── icon-009.png │ │ ├── icon-010.png │ │ ├── icon-011.png │ │ ├── icon-012.png │ │ ├── icon-013.png │ │ ├── icon-014.jpg │ │ ├── temp-001.jpg │ │ ├── temp-002.jpg │ │ ├── temp-003.jpg │ │ ├── temp-004.jpg │ │ ├── temp-005.jpg │ │ ├── temp-006.jpg │ │ ├── temp-007.jpg │ │ ├── temp-008.jpg │ │ ├── temp-009.jpg │ │ ├── temp-010.jpg │ │ ├── temp-011.jpg │ │ ├── temp-012.jpg │ │ ├── temp-013.jpg │ │ ├── temp-014.jpg │ │ ├── temp-015.jpg │ │ ├── temp-016.jpg │ │ ├── temp-017.jpg │ │ ├── temp-018.jpg │ │ ├── temp-019.jpg │ │ ├── temp-020.jpg │ │ ├── temp-021.jpg │ │ ├── temp-022.jpg │ │ ├── temp-023.jpg │ │ ├── temp-024.jpg │ │ ├── temp-025.jpg │ │ ├── temp-026.jpg │ │ ├── temp-027.jpg │ │ ├── temp-028.jpg │ │ ├── temp-029.jpg │ │ ├── temp-030.jpg │ │ ├── temp-031.jpg │ │ ├── temp-032.jpg │ │ ├── temp-033.jpg │ │ ├── temp-034.jpg │ │ ├── temp-035.jpg │ │ ├── temp-036.jpg │ │ ├── temp-037.jpg │ │ ├── temp-038.jpg │ │ ├── temp-039.png │ │ ├── temp-040.png │ │ ├── temp-041.png │ │ ├── temp-042.png │ │ ├── temp-043.jpg │ │ ├── temp-044.jpg │ │ ├── temp-045.jpg │ │ ├── temp-046.jpg │ │ ├── temp-047.jpg │ │ ├── temp-048.jpg │ │ ├── temp-049.jpg │ │ ├── temp-050.png │ │ ├── temp-051.png │ │ ├── temp-052.png │ │ ├── temp-053.png │ │ ├── temp-054.png │ │ ├── temp-055.png │ │ ├── temp-056.jpg │ │ ├── temp-057.jpg │ │ ├── temp-058.jpg │ │ ├── temp-059.jpg │ │ ├── temp-060.jpg │ │ ├── temp-061.jpg │ │ ├── temp-062.jpg │ │ ├── temp-063.jpg │ │ ├── temp-064.jpg │ │ ├── temp-065.png │ │ ├── temp-066.png │ │ ├── temp-067.png │ │ ├── temp-068.png │ │ ├── temp-069.png │ │ ├── temp-070.png │ │ ├── temp-071.jpg │ │ ├── temp-072.jpg │ │ ├── temp-073.jpg │ │ ├── temp-074.jpg │ │ ├── temp-075.jpg │ │ ├── temp-076.jpg │ │ ├── temp-077.jpg │ │ ├── temp-078.jpg │ │ ├── temp-079.jpg │ │ ├── temp-080.jpg │ │ ├── temp-081.jpg │ │ ├── temp-082.jpg │ │ ├── temp-083.png │ │ ├── temp-084.png │ │ ├── temp-085.jpg │ │ ├── temp-086.jpg │ │ ├── temp-087.jpg │ │ ├── temp-088.jpg │ │ ├── temp-089.png │ │ ├── temp-090.png │ │ ├── temp-091.png │ │ ├── temp-092.jpg │ │ ├── temp-093.jpg │ │ ├── temp-094.jpg │ │ ├── temp-095.jpg │ │ ├── temp-096.jpg │ │ ├── temp-097.jpg │ │ ├── temp-098.jpg │ │ ├── temp-099.jpg │ │ ├── temp-100.png │ │ ├── temp-101.jpg │ │ ├── temp-102.jpg │ │ ├── temp-103.jpg │ │ ├── temp-104.jpg │ │ ├── temp-105.jpg │ │ ├── temp-106.jpg │ │ ├── temp-107.jpg │ │ ├── temp-108.jpg │ │ ├── temp-109.jpg │ │ ├── temp-110.jpg │ │ ├── temp-111.jpg │ │ ├── temp-112.png │ │ ├── temp-113.png │ │ ├── temp-114.png │ │ ├── temp-115.png │ │ ├── temp-116.png │ │ ├── temp-117.jpg │ │ ├── temp-118.png │ │ ├── temp-119.png │ │ ├── blue-lotus.mp3 │ │ ├── icon-tabbar.png │ │ ├── share-arrow.png │ │ ├── the-old-you.mp3 │ │ ├── yz-qrcode-test.jpg │ │ └── yz-qrcode-online.jpg │ ├── lib.js │ ├── swiper.animate.js │ ├── jweixin-1.0.0.js │ └── utils.js ├── apps │ ├── default │ │ ├── vuex │ │ │ ├── mutation-types.js │ │ │ ├── index.js │ │ │ ├── mutations.js │ │ │ ├── store.js │ │ │ └── getters_actions.js │ │ ├── page │ │ │ ├── user-coupon-info.vue │ │ │ ├── news-info.vue │ │ │ ├── 404.vue │ │ │ ├── user-faq-info.vue │ │ │ ├── order-tracking.vue │ │ │ ├── user-faq-add.vue │ │ │ ├── activity-info.vue │ │ │ ├── product.vue │ │ │ ├── user-faq.vue │ │ │ ├── user-pwd.vue │ │ │ ├── login.vue │ │ │ ├── news-list.vue │ │ │ ├── user-order.vue │ │ │ ├── user.vue │ │ │ ├── product-list.vue │ │ │ ├── user-faq-feedback.vue │ │ │ ├── register.vue │ │ │ ├── store-info.vue │ │ │ ├── booking.vue │ │ │ ├── activity.vue │ │ │ ├── user-order-info.vue │ │ │ ├── user-coupon-select.vue │ │ │ ├── home.vue │ │ │ ├── user-info.vue │ │ │ ├── user-appointment.vue │ │ │ ├── product-info.vue │ │ │ ├── store-list.vue │ │ │ ├── user-coupon.vue │ │ │ ├── welfare-gift.vue │ │ │ └── company.vue │ │ ├── components │ │ │ ├── news-list.vue │ │ │ └── order-list.vue │ │ ├── config.js │ │ ├── app.vue │ │ ├── main.js │ │ └── router-map.js │ └── template.html ├── plugins │ ├── toast │ │ └── index.js │ ├── toptips │ │ └── index.js │ ├── alert │ │ └── index.js │ ├── loading │ │ └── index.js │ └── confirm │ │ └── index.js └── components │ ├── toptips.vue │ └── l-article.vue ├── .babelrc ├── README.md └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | npm-debug.log 2 | -------------------------------------------------------------------------------- /src/assets/imgs/404.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/404.jpg -------------------------------------------------------------------------------- /src/assets/imgs/fuli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/fuli.png -------------------------------------------------------------------------------- /src/assets/imgs/kefu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/kefu.jpg -------------------------------------------------------------------------------- /src/assets/imgs/none.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/none.jpg -------------------------------------------------------------------------------- /src/assets/imgs/wave.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/wave.jpg -------------------------------------------------------------------------------- /src/assets/imgs/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/avatar.png -------------------------------------------------------------------------------- /src/assets/imgs/booking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/booking.png -------------------------------------------------------------------------------- /src/assets/imgs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/favicon.ico -------------------------------------------------------------------------------- /src/assets/imgs/kenan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/kenan.jpg -------------------------------------------------------------------------------- /src/assets/imgs/kenan2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/kenan2.jpg -------------------------------------------------------------------------------- /src/assets/imgs/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/loading.gif -------------------------------------------------------------------------------- /src/assets/imgs/audio_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/audio_ico.png -------------------------------------------------------------------------------- /src/assets/imgs/avatar-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/avatar-bg.jpg -------------------------------------------------------------------------------- /src/assets/imgs/icon-001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/icon-001.jpg -------------------------------------------------------------------------------- /src/assets/imgs/icon-002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/icon-002.jpg -------------------------------------------------------------------------------- /src/assets/imgs/icon-003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/icon-003.jpg -------------------------------------------------------------------------------- /src/assets/imgs/icon-004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/icon-004.jpg -------------------------------------------------------------------------------- /src/assets/imgs/icon-005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/icon-005.jpg -------------------------------------------------------------------------------- /src/assets/imgs/icon-006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/icon-006.jpg -------------------------------------------------------------------------------- /src/assets/imgs/icon-007.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/icon-007.jpg -------------------------------------------------------------------------------- /src/assets/imgs/icon-008.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/icon-008.jpg -------------------------------------------------------------------------------- /src/assets/imgs/icon-009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/icon-009.png -------------------------------------------------------------------------------- /src/assets/imgs/icon-010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/icon-010.png -------------------------------------------------------------------------------- /src/assets/imgs/icon-011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/icon-011.png -------------------------------------------------------------------------------- /src/assets/imgs/icon-012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/icon-012.png -------------------------------------------------------------------------------- /src/assets/imgs/icon-013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/icon-013.png -------------------------------------------------------------------------------- /src/assets/imgs/icon-014.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/icon-014.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-001.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-002.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-003.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-004.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-005.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-006.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-007.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-007.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-008.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-008.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-009.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-009.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-010.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-011.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-011.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-012.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-012.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-013.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-013.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-014.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-014.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-015.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-015.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-016.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-016.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-017.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-017.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-018.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-018.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-019.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-019.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-020.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-020.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-021.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-021.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-022.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-022.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-023.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-023.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-024.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-024.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-025.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-025.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-026.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-026.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-027.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-027.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-028.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-028.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-029.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-029.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-030.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-030.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-031.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-031.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-032.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-032.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-033.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-033.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-034.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-034.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-035.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-035.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-036.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-036.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-037.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-037.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-038.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-038.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-039.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-039.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-040.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-041.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-041.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-042.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-042.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-043.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-043.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-044.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-044.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-045.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-045.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-046.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-046.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-047.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-047.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-048.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-048.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-049.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-049.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-050.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-050.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-051.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-051.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-052.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-052.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-053.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-053.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-054.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-054.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-055.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-055.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-056.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-056.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-057.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-057.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-058.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-058.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-059.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-059.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-060.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-060.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-061.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-061.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-062.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-062.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-063.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-063.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-064.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-064.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-065.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-065.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-066.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-066.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-067.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-067.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-068.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-068.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-069.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-069.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-070.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-070.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-071.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-071.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-072.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-072.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-073.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-073.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-074.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-074.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-075.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-075.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-076.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-076.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-077.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-077.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-078.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-078.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-079.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-079.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-080.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-080.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-081.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-081.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-082.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-082.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-083.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-083.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-084.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-084.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-085.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-085.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-086.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-086.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-087.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-087.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-088.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-088.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-089.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-089.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-090.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-090.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-091.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-091.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-092.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-092.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-093.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-093.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-094.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-094.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-095.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-095.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-096.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-096.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-097.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-097.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-098.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-098.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-099.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-099.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-100.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-101.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-101.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-102.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-102.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-103.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-103.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-104.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-104.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-105.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-105.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-106.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-106.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-107.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-107.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-108.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-108.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-109.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-109.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-110.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-110.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-111.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-111.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-112.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-112.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-113.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-113.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-114.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-115.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-115.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-116.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-116.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-117.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-117.jpg -------------------------------------------------------------------------------- /src/assets/imgs/temp-118.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-118.png -------------------------------------------------------------------------------- /src/assets/imgs/temp-119.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/temp-119.png -------------------------------------------------------------------------------- /src/assets/imgs/blue-lotus.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/blue-lotus.mp3 -------------------------------------------------------------------------------- /src/assets/imgs/icon-tabbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/icon-tabbar.png -------------------------------------------------------------------------------- /src/assets/imgs/share-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/share-arrow.png -------------------------------------------------------------------------------- /src/assets/imgs/the-old-you.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/the-old-you.mp3 -------------------------------------------------------------------------------- /src/apps/default/vuex/mutation-types.js: -------------------------------------------------------------------------------- 1 | // export const INCREMENT = 'INCREMENT' 2 | // export const DECREMENT = 'DECREMENT' -------------------------------------------------------------------------------- /src/assets/imgs/yz-qrcode-test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/yz-qrcode-test.jpg -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "plugins": ["transform-runtime"], 4 | "comments": false 5 | } 6 | -------------------------------------------------------------------------------- /src/assets/imgs/yz-qrcode-online.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hemin1003/vue-apps/HEAD/src/assets/imgs/yz-qrcode-online.jpg -------------------------------------------------------------------------------- /src/apps/default/vuex/index.js: -------------------------------------------------------------------------------- 1 | import store from './store' 2 | import { getters, actions } from './getters_actions' 3 | 4 | module.exports = { store, getters, actions } 5 | -------------------------------------------------------------------------------- /src/apps/default/page/user-coupon-info.vue: -------------------------------------------------------------------------------- 1 | 6 | 19 | -------------------------------------------------------------------------------- /src/apps/default/vuex/mutations.js: -------------------------------------------------------------------------------- 1 | // import { INCREMENT, DECREMENT } from './mutation-types' 2 | 3 | // export default { 4 | // [INCREMENT] (state) { 5 | // state.count++ 6 | // state.history.push('increment') 7 | // }, 8 | // [DECREMENT] (state) { 9 | // state.count-- 10 | // state.history.push('decrement') 11 | // } 12 | // } -------------------------------------------------------------------------------- /src/apps/default/vuex/store.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | Vue.use(Vuex) 4 | 5 | // 应用状态 6 | const state = { 7 | app_userinfo: {}, 8 | app_coupon: {}, 9 | app_direction: '' // in or out 10 | } 11 | 12 | // 变更函数 13 | const mutations = { 14 | APP_DIRECTION (state, inOrout = '') { 15 | state.app_direction = inOrout 16 | }, 17 | APP_USERINFO(state, userinfo = {}){ 18 | state.app_userinfo = userinfo 19 | }, 20 | APP_COUPON(state, coupon = {}){ 21 | state.app_coupon = coupon 22 | } 23 | } 24 | 25 | // Store实例 26 | export default new Vuex.Store({ 27 | state, 28 | mutations 29 | }) 30 | -------------------------------------------------------------------------------- /src/apps/default/page/news-info.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 34 | 35 | -------------------------------------------------------------------------------- /src/apps/default/page/404.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 39 | 40 | -------------------------------------------------------------------------------- /src/apps/default/page/user-faq-info.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 39 | -------------------------------------------------------------------------------- /src/assets/lib.js: -------------------------------------------------------------------------------- 1 | // import 'vux/dist/vux.css' 2 | import 'vux/src/styles/index.less' 3 | import 'assets/global.less' 4 | import Vue from 'vue' 5 | import Resource from 'vue-resource' 6 | import { utils, storage } from 'assets/utils' 7 | 8 | // mixin 合并策略 9 | const strategies = Vue.config.optionMergeStrategies 10 | strategies.route = strategies.methods 11 | 12 | // 配置是否允许 vue-devtools 检查代码 13 | // Vue.config.devtools = true 14 | Vue.mixin({ // 设备检测 15 | created: function () { 16 | this.$device = utils.device 17 | this.$regexp = utils.regexp 18 | this.$image = utils.image 19 | } 20 | }) 21 | 22 | // https://github.com/pagekit/vue-resource/blob/master/docs/http.md 23 | Vue.use(Resource) 24 | Vue.http.options.emulateJSON = true 25 | // Vue.http.options.xhr = { withCredentials: true } 26 | // Vue.http.headers.common['Authorization'] = 'Basic YXBpOnBhc3N3b3Jk' 27 | // Vue.http.options.emulateHTTP = true 28 | 29 | module.exports = { Vue, utils, storage } 30 | 31 | -------------------------------------------------------------------------------- /src/apps/default/vuex/getters_actions.js: -------------------------------------------------------------------------------- 1 | // import { INCREMENT, DECREMENT } from './mutation-types' 2 | import { storage } from 'assets/utils' 3 | // getters与actions命名不能相同 4 | const getters = { 5 | route: (state) => state.route, 6 | userinfo: (state) => { 7 | let userinfo = null 8 | if(state.app_userinfo && state.app_userinfo.mobilePhone){ 9 | userinfo = state.app_userinfo 10 | }else{ 11 | userinfo = storage.local.get('userinfo') || {} 12 | } 13 | console.log(userinfo) 14 | return userinfo 15 | }, 16 | coupon: (state) => state.app_coupon, 17 | direction: (state) => state.app_direction 18 | } 19 | 20 | const actions = { 21 | acUpdateUserInfo: ({ dispatch }) => { 22 | dispatch('APP_USERINFO', storage.local.get('userinfo') || {}) 23 | }, 24 | acClearUserInfo({ dispatch }) { 25 | storage.local.set('userinfo', null, 0) 26 | dispatch('APP_USERINFO', {}) 27 | }, 28 | acSelectCoupon({ dispatch }, coupon = {}) { 29 | dispatch('APP_COUPON', coupon) 30 | } 31 | } 32 | module.exports = { getters, actions } 33 | 34 | // export default { 35 | // getters, actions 36 | // } 37 | -------------------------------------------------------------------------------- /src/plugins/toast/index.js: -------------------------------------------------------------------------------- 1 | import ToastComponent from 'vux-components/toast' 2 | 3 | let $vm 4 | let watcher 5 | 6 | export default { 7 | install (vue, options) { 8 | const Toast = vue.extend(ToastComponent) 9 | 10 | if (!$vm) { 11 | $vm = new Toast({ 12 | el: document.createElement('div') 13 | }) 14 | document.body.appendChild($vm.$el) 15 | } 16 | 17 | const toast = { 18 | show (options) { 19 | // destroy watcher 20 | watcher && watcher() 21 | if (typeof options === 'string') { 22 | $vm.text = options 23 | } else if (typeof options === 'object') { 24 | for (let i in options) { 25 | $vm[i] = options[i] 26 | } 27 | } 28 | if (typeof options === 'object' && options.onShow || options.onHide) { 29 | watcher = $vm.$watch('show', (val) => { 30 | val && options.onShow && options.onShow($vm) 31 | val === false && options.onHide && options.onHide($vm) 32 | }) 33 | } 34 | $vm.show = true 35 | }, 36 | hide () { 37 | $vm.show = false 38 | } 39 | } 40 | 41 | // all Vux's plugins are included in this.$vux 42 | if (!vue.$vux) { 43 | vue.$vux = { 44 | toast 45 | } 46 | } else { 47 | vue.$vux.toast = toast 48 | } 49 | 50 | vue.mixin({ 51 | created: function () { 52 | this.$vux = vue.$vux 53 | } 54 | }) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/components/toptips.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 36 | 37 | 71 | -------------------------------------------------------------------------------- /src/components/l-article.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 29 | 30 | 73 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #vue-apps 使用说明# 2 | 3 | # 安装(建议先配置一个淘宝npm下载镜像地址:https://npm.taobao.org/ 4 | npm install 5 | 6 | # 调试环境 serve with hot reload at http://localhost:8083 7 | npm run dev 8 | 9 | # 生产环境 build for production with minification 10 | npm run build 11 | 12 | #目录结构 13 | 14 | |---build/ 自动化构建脚本 15 | |---dist/ 默认发布根目录 16 | index.html 访问地址http://localhost 17 | |---static/ 资源目录 18 | |---common.js 19 | |---common.css 20 | |---default.js 21 | |---default.css 22 | |---other.js 23 | |---other.css 24 | |---other/ 访问地址http://localhost/other 25 | |---index.html 26 | |---src/ 应用源码 27 | |---assets/ 资源目录 28 | |---imgs/ 公共图片 29 | |---font/ 字体图标 30 | |---config.js 公共配置(name , logo...) 31 | |---global.less 公共样式(reset...) 32 | |---lib.js 各种框架(vue, vue-router, vux, jquery, fastclick...) 33 | |---components 公共组件 34 | |---index-other.vue 35 | |---apps 单页面应用目录 36 | |---default 37 | |---main.js 当前应用入口 38 | |---config.js 当前应用配置 39 | |---app.vue 40 | !---page/ 41 | |---page1.vue 路由页面组件 42 | |---page2.vue 43 | |---vuex/ 应用状态管理 44 | |---store.js 45 | |---mutation-type.js 46 | |---mutations.js 47 | |---actions.js 48 | |---getters.js 49 | |---other 50 | |---同index 51 | |---template.html 生成html模板 52 | 53 | 54 | #参考 55 | https://github.com/bluefox1688/vue-cli-multi-page 56 | -------------------------------------------------------------------------------- /src/apps/default/components/news-list.vue: -------------------------------------------------------------------------------- 1 | 18 | 37 | 66 | -------------------------------------------------------------------------------- /src/apps/default/page/order-tracking.vue: -------------------------------------------------------------------------------- 1 | 17 | 60 | -------------------------------------------------------------------------------- /src/plugins/toptips/index.js: -------------------------------------------------------------------------------- 1 | import ToptipsComponent from 'components/toptips' 2 | 3 | let $vm 4 | let watcher 5 | 6 | export default { 7 | install (vue) { 8 | 9 | if (!$vm) { 10 | const Toptips = vue.extend(ToptipsComponent) 11 | $vm = new Toptips({ 12 | el: document.createElement('div') 13 | }) 14 | document.body.appendChild($vm.$el) 15 | } 16 | 17 | const toptips = { 18 | show (options) { 19 | // destroy watcher 20 | watcher && watcher() 21 | if (typeof options === 'object') { 22 | for (let i in options) { 23 | if (i !== 'content') { 24 | $vm[i] = options[i] 25 | } else { 26 | $vm.$el.querySelector('.l-toptips-cont').innerHTML = options['content'] 27 | } 28 | } 29 | 30 | } else if (typeof options === 'string') { 31 | $vm.text = options 32 | } 33 | if (typeof options === 'object' && (options.onShow || options.onHide)) { 34 | watcher = $vm.$watch('show', (val) => { 35 | val && options.onShow && options.onShow($vm) 36 | val === false && options.onHide && options.onHide($vm) 37 | }) 38 | } 39 | $vm.show = true 40 | }, 41 | hide () { 42 | $vm.show = false 43 | } 44 | } 45 | 46 | // all Vux's plugins are included in this.$vux 47 | if (!vue.$vux) { 48 | vue.$vux = { 49 | toptips 50 | } 51 | } else { 52 | vue.$vux.toptips = toptips 53 | } 54 | 55 | vue.mixin({ 56 | created: function () { 57 | this.$vux = vue.$vux 58 | } 59 | }) 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/plugins/alert/index.js: -------------------------------------------------------------------------------- 1 | import AlertComponent from 'vux-components/alert' 2 | 3 | let $vm 4 | let watcher 5 | 6 | export default { 7 | install (vue) { 8 | if (!$vm) { 9 | const Alert = vue.extend(AlertComponent) 10 | $vm = new Alert({ 11 | el: document.createElement('div') 12 | }) 13 | document.body.appendChild($vm.$el) 14 | } 15 | 16 | const alert = { 17 | show (options) { 18 | // destroy watcher 19 | watcher && watcher() 20 | if (typeof options === 'object') { 21 | for (let i in options) { 22 | if (i !== 'content') { 23 | $vm[i] = options[i] 24 | } else { 25 | $vm.$el.querySelector('.weui_dialog_bd').innerHTML = options['content'] 26 | } 27 | } 28 | } else if (typeof options === 'string') { 29 | $vm.$el.querySelector('.weui_dialog_bd').innerHTML = options 30 | } 31 | if (typeof options === 'object' && (options.onShow || options.onHide)) { 32 | watcher = $vm.$watch('show', (val) => { 33 | val && options.onShow && options.onShow($vm) 34 | val === false && options.onHide && options.onHide($vm) 35 | }) 36 | } 37 | $vm.show = true 38 | }, 39 | hide () { 40 | $vm.show = false 41 | } 42 | } 43 | 44 | // all Vux's plugins are included in this.$vux 45 | if (!vue.$vux) { 46 | vue.$vux = { 47 | alert 48 | } 49 | } else { 50 | vue.$vux.alert = alert 51 | } 52 | 53 | vue.mixin({ 54 | created: function () { 55 | this.$vux = vue.$vux 56 | } 57 | }) 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/apps/default/components/order-list.vue: -------------------------------------------------------------------------------- 1 | 15 | 56 | -------------------------------------------------------------------------------- /src/plugins/loading/index.js: -------------------------------------------------------------------------------- 1 | import LoadingComponent from 'vux-components/loading' 2 | 3 | let $vm 4 | let watcher 5 | 6 | export default { 7 | install (vue) { 8 | 9 | if (!$vm) { 10 | const Loading = vue.extend(LoadingComponent) 11 | $vm = new Loading({ 12 | el: document.createElement('div'), 13 | propsData: { 14 | text: '加载中' 15 | } 16 | }) 17 | document.body.appendChild($vm.$el) 18 | } 19 | 20 | const loading = { 21 | show (options) { 22 | // destroy watcher 23 | watcher && watcher() 24 | if (typeof options === 'object') { 25 | for (let i in options) { 26 | if (i !== 'content') { 27 | $vm[i] = options[i] 28 | } else { 29 | $vm.$el.querySelector('.weui_toast_content').innerHTML = options['content'] 30 | } 31 | } 32 | } else if (typeof options === 'string') { 33 | $vm.text = options 34 | } 35 | if (typeof options === 'object' && (options.onShow || options.onHide)) { 36 | watcher = $vm.$watch('show', (val) => { 37 | val && options.onShow && options.onShow($vm) 38 | val === false && options.onHide && options.onHide($vm) 39 | }) 40 | } 41 | $vm.show = true 42 | }, 43 | hide () { 44 | $vm.text = '加载中' 45 | $vm.show = false 46 | } 47 | } 48 | 49 | // all Vux's plugins are included in this.$vux 50 | if (!vue.$vux) { 51 | vue.$vux = { 52 | loading 53 | } 54 | } else { 55 | vue.$vux.loading = loading 56 | } 57 | 58 | vue.mixin({ 59 | created: function () { 60 | this.$vux = vue.$vux 61 | } 62 | }) 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/apps/default/page/user-faq-add.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 64 | 65 | 68 | -------------------------------------------------------------------------------- /src/plugins/confirm/index.js: -------------------------------------------------------------------------------- 1 | import ConfirmComponent from 'vux-components/confirm' 2 | 3 | let $vm 4 | let watcher 5 | 6 | export default { 7 | install (vue) { 8 | 9 | if (!$vm) { 10 | const Confirm = vue.extend(ConfirmComponent) 11 | $vm = new Confirm({ 12 | el: document.createElement('div'), 13 | propsData: { 14 | title: '确认提示', 15 | confirmText: '确定', 16 | cancelText: '取消' 17 | } 18 | }) 19 | document.body.appendChild($vm.$el) 20 | } 21 | 22 | const confirm = { 23 | show (options) { 24 | // destroy watcher 25 | watcher && watcher() 26 | if (typeof options === 'object') { 27 | for (let i in options) { 28 | if (i !== 'content') { 29 | $vm[i] = options[i] 30 | } else { 31 | $vm.$el.querySelector('.weui_dialog_bd').innerHTML = options['content'] 32 | } 33 | } 34 | options.onCancel && $vm.$on('on-cancel', options.onCancel) 35 | options.onConfirm && $vm.$on('on-confirm', options.onConfirm) 36 | 37 | } else if (typeof options === 'string') { 38 | $vm.$el.querySelector('.weui_dialog_bd').innerHTML = options 39 | } 40 | if (typeof options === 'object' && (options.onShow || options.onHide)) { 41 | watcher = $vm.$watch('show', (val) => { 42 | val && options.onShow && options.onShow($vm) 43 | val === false && options.onHide && options.onHide($vm) 44 | }) 45 | } 46 | $vm.show = true 47 | }, 48 | hide () { 49 | $vm.show = false 50 | } 51 | } 52 | 53 | // all Vux's plugins are included in this.$vux 54 | if (!vue.$vux) { 55 | vue.$vux = { 56 | confirm 57 | } 58 | } else { 59 | vue.$vux.confirm = confirm 60 | } 61 | 62 | vue.mixin({ 63 | created: function () { 64 | this.$vux = vue.$vux 65 | } 66 | }) 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-vux", 3 | "version": "0.1.0", 4 | "description": "基于vue开发多页面的脚手架", 5 | "author": "leo-lai", 6 | "keywords": [ 7 | "webpack", 8 | "vue", 9 | "vux", 10 | "weui" 11 | ], 12 | "scripts": { 13 | "dev": "node build/dev-server.js", 14 | "build": "node build/build.js" 15 | }, 16 | "dependencies": { 17 | "animate.css": "^3.5.2", 18 | "array-find": "^1.0.0", 19 | "array-map": "^0.0.0", 20 | "fastclick": "^1.0.6", 21 | "iswiper": "^1.4.1", 22 | "lib-flexible": "^0.3.2", 23 | "sprint-js": "^0.1.0", 24 | "swiper": "^3.4.1", 25 | "vue": "^1.0.26", 26 | "vue-resource": "^1.0.3", 27 | "vue-router": "^0.7.5", 28 | "vuex": "^0.8.2", 29 | "vuex-router-sync": "^2.1.1", 30 | "vux": "^0.1.3", 31 | "weixin-js-sdk": "^1.0.7" 32 | }, 33 | "devDependencies": { 34 | "autoprefixer-loader": "^3.2.0", 35 | "babel-core": "^6.0.0", 36 | "babel-loader": "^6.0.0", 37 | "babel-plugin-transform-runtime": "^6.0.0", 38 | "babel-preset-es2015": "^6.0.0", 39 | "babel-preset-stage-2": "^6.0.0", 40 | "clean-webpack-plugin": "^0.1.10", 41 | "connect-history-api-fallback": "^1.1.0", 42 | "css-loader": "^0.26.0", 43 | "eventsource-polyfill": "^0.9.6", 44 | "express": "^4.13.3", 45 | "extract-text-webpack-plugin": "^1.0.1", 46 | "file-loader": "^0.9.0", 47 | "glob": "^7.1.1", 48 | "html-webpack-plugin": "^2.24.1", 49 | "http-proxy-middleware": "^0.17.2", 50 | "json-loader": "^0.5.4", 51 | "less": "^2.7.1", 52 | "less-loader": "^2.2.3", 53 | "ora": "^0.3.0", 54 | "postcss-loader": "^1.2.1", 55 | "shelljs": "^0.7.5", 56 | "style-loader": "^0.13.1", 57 | "url-loader": "^0.5.7", 58 | "vue-hot-reload-api": "^1.2.0", 59 | "vue-html-loader": "^1.0.0", 60 | "vue-loader": "^8.2.1", 61 | "vue-style-loader": "^1.0.0", 62 | "webpack": "^1.12.2", 63 | "webpack-dev-middleware": "^1.8.4", 64 | "webpack-hot-middleware": "^2.13.2", 65 | "webpack-merge": "^0.18.0", 66 | "webpack-require-http": "^0.3.0" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/apps/default/config.js: -------------------------------------------------------------------------------- 1 | // 应用配置 2 | const _HOST = window.location.origin 3 | const _PATH = '/' 4 | let _qrcode = require('assets/imgs/yz-qrcode-online.jpg') 5 | let _appid = 'wx5afd32ac14c76152' 6 | let _serverPath = 'http://ktz.aylsonclub.com/service' 7 | 8 | // 测试环境 9 | if(_HOST.indexOf('http://ktz.aylsonclub.com') === -1){ 10 | _qrcode = require('assets/imgs/yz-qrcode-test.jpg') 11 | _appid = 'wxc8123454324da8b0' 12 | _serverPath = 'https://test.aylsonclub.com/dc-web' 13 | } 14 | 15 | export default { 16 | getHost: () => _HOST, 17 | getPath: () => _PATH, 18 | getServerPath: () => _serverPath, 19 | getAppid: () => _appid, 20 | defaultVal: { 21 | avatar: require('assets/imgs/avatar.png'), 22 | avatarBg: require('assets/imgs/avatar-bg.jpg'), 23 | qrcode: _qrcode 24 | }, 25 | // 组件生命周期 http://vuejs.org.cn/guide/instance.html#生命周期图示 26 | vueHook: { 27 | 'hook:created': function() { 28 | console.log('%s components created!', this.$route.path) 29 | }, 30 | 'hook:ready': function() { 31 | console.log('%s components ready!(loadingRouteData:%s)' , this.$route.path, this.$loadingRouteData) 32 | } 33 | }, 34 | // 路由生命周期 https://github.com/vuejs/vue-router/blob/1.0/docs/zh-cn/pipeline/hooks.md 35 | routeHook: { 36 | // waitForData: true, 37 | data(transition) { 38 | // 每次路由变动时都会被调用 39 | // 在此异步获取数据,此时界面已可见 40 | console.log('%s data ready!(loadingRouteData:%s)' , transition.to.path, this.$loadingRouteData) 41 | }, 42 | canActivate(transition) { 43 | // 在此验证页面授权 44 | console.log('%s canActivate!' , transition.to.path) 45 | transition.next() 46 | }, 47 | activate(transition) { 48 | // 当组件被创建而且将要切换进入的时候被调用,(组件可重用时不调用) 49 | // 在此异步获取数据,此时界面不可见 50 | console.log('%s activate!' , transition.to.path) 51 | transition.next() 52 | }, 53 | canDeactivate(transition){ 54 | console.log('%s canDeactivate!' , transition.to.path) 55 | transition.next() 56 | }, 57 | deactivate(transition) { 58 | // 当一个组件将要被禁用和移除之时被调用 59 | console.log('%s deactivate!' , transition.to.path) 60 | transition.next() 61 | } 62 | } 63 | } 64 | 65 | -------------------------------------------------------------------------------- /src/assets/swiper.animate.js: -------------------------------------------------------------------------------- 1 | // http://www.swiper.com.cn/usage/animate/index.html 2 | export default { 3 | animate(swiper, once = false) { 4 | !once && this.clear() 5 | let aniElements = swiper.slides[swiper.activeIndex].querySelectorAll('.ani') 6 | Array.prototype.forEach.call(aniElements, (elem) => { 7 | elem.style.visibility = 'visible' 8 | 9 | let animated = elem.attributes['animated'] ? elem.attributes['animated'] : '' 10 | if(once && animated){ 11 | return true 12 | } 13 | 14 | let style = elem.attributes['style'].value 15 | let effect = elem.attributes['ani-effect'] ? elem.attributes['ani-effect'].value : '' 16 | let duration = elem.attributes['ani-duration'] ? elem.attributes['ani-duration'].value : '' 17 | let delay = elem.attributes['ani-delay'] ? elem.attributes['ani-delay'].value : '' 18 | 19 | duration && (style = style + ';animation-duration:' + duration + ';-webkit-animation-duration:' + duration) 20 | delay && (style = style + ';animation-delay:' + delay + ';-webkit-animation-delay:' + delay) 21 | 22 | elem.className += ' ' + effect + ' animated' 23 | elem.setAttribute('style', style) 24 | elem.setAttribute('animated', true) 25 | }) 26 | }, 27 | cache() { 28 | let aniElements = window.document.documentElement.querySelectorAll('.ani') 29 | Array.prototype.forEach.call(aniElements, (elem) => { 30 | elem.attributes['style'] ? 31 | elem.setAttribute('ani-style-cache', elem.attributes['style'].value) : 32 | elem.setAttribute('ani-style-cache', ' '), elem.style.visibility = 'hidden' 33 | }) 34 | }, 35 | clear() { 36 | let aniElements = window.document.documentElement.querySelectorAll('.ani') 37 | Array.prototype.forEach.call(aniElements, (elem) => { 38 | elem.attributes['ani-style-cache'] && elem.setAttribute('style', elem.attributes['ani-style-cache'].value) 39 | elem.style.visibility = 'hidden' 40 | elem.className = elem.className.replace(' animated', '') 41 | let effect = elem.attributes['ani-effect'] ? ' ' + elem.attributes['ani-effect'].value : '' 42 | elem.className = elem.className.replace(effect, '') 43 | }) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/apps/default/page/activity-info.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 81 | -------------------------------------------------------------------------------- /src/apps/default/page/product.vue: -------------------------------------------------------------------------------- 1 | 13 | 42 | 91 | -------------------------------------------------------------------------------- /src/apps/default/page/user-faq.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 83 | -------------------------------------------------------------------------------- /src/apps/default/page/user-pwd.vue: -------------------------------------------------------------------------------- 1 | 16 | 83 | -------------------------------------------------------------------------------- /src/apps/default/page/login.vue: -------------------------------------------------------------------------------- 1 | 17 | 83 | -------------------------------------------------------------------------------- /src/apps/default/page/news-list.vue: -------------------------------------------------------------------------------- 1 | 27 | 79 | 80 | -------------------------------------------------------------------------------- /src/apps/default/page/user-order.vue: -------------------------------------------------------------------------------- 1 | 27 | 83 | -------------------------------------------------------------------------------- /src/apps/default/page/user.vue: -------------------------------------------------------------------------------- 1 | 42 | 84 | 104 | -------------------------------------------------------------------------------- /src/apps/default/app.vue: -------------------------------------------------------------------------------- 1 | 34 | 84 | 129 | -------------------------------------------------------------------------------- /src/apps/default/main.js: -------------------------------------------------------------------------------- 1 | import { Vue, utils, storage } from 'assets/lib' 2 | import Router from 'vue-router' 3 | import { sync } from 'vuex-router-sync' 4 | import RouterMap from './router-map' 5 | import store from './vuex/store' 6 | import config from './config' 7 | import App from './app' 8 | 9 | // https://github.com/ftlabs/fastclick/ 10 | import FastClick from 'fastclick' 11 | FastClick.attach(document.body) 12 | 13 | // plugins 14 | import ToastPlugin from 'plugins/toast' 15 | import AlertPlugin from 'plugins/alert' 16 | import ConfirmPlugin from 'plugins/confirm' 17 | import ToptipsPlugin from 'plugins/toptips' 18 | import LoadingPlugin from 'plugins/loading' 19 | Vue.use(ToastPlugin) 20 | Vue.use(AlertPlugin) 21 | Vue.use(ConfirmPlugin) 22 | Vue.use(ToptipsPlugin) 23 | Vue.use(LoadingPlugin) 24 | 25 | // --------- 26 | Vue.http.options.root = config.getServerPath() 27 | 28 | // https://github.com/vuejs/vue-router/tree/1.0/docs/zh-cn 29 | Vue.use(Router) 30 | const router = new Router({ 31 | history: true, 32 | root: config.getPath(), 33 | saveScrollPosition: true, 34 | // suppressTransitionError: true, 35 | transitionOnLoad: false 36 | }) 37 | 38 | // 设置路由 39 | router.map(RouterMap) 40 | // 默认跳转home页面 41 | router.redirect({ 42 | '/': '/home', 43 | '/index.html': '/home' 44 | }) 45 | 46 | // keep vue-router and vuex store in sync 47 | // store.state.route.path 48 | // store.state.route.params 49 | // store.state.route.query 50 | sync(store, router) 51 | 52 | // 记录首次进入app的路径,用于微信授权登录 53 | storage.session.set('wx_url', window.location.href) 54 | 55 | // 跳转站外链接 56 | router.beforeEach(({to, next, abort}) => { 57 | 58 | let url = to.path.substring(config.getPath().length) 59 | if(/^http(s?)/i.test(url)){ 60 | window.location.assign(url) 61 | abort() 62 | }else{ 63 | setTimeout(next, 50) 64 | } 65 | }) 66 | 67 | // 验证登陆 68 | router.beforeEach((transition) => { 69 | if(transition.to.auth){ 70 | let userInfo = storage.local.get('userinfo') 71 | if( !(userInfo && userInfo.mobilePhone) ){ 72 | transition.redirect('/login') 73 | } 74 | return true 75 | } 76 | setTimeout(transition.next, 50) 77 | }) 78 | 79 | // 记录页面浏览顺序,用来判断动画方向 80 | let _history = { count: 0 , prevPath: '/', currPath: '' } 81 | 82 | // 调用发生在整个切换流水线之前。如果此钩子函数拒绝了切换,整个切换流水线根本就不会启动 83 | router.beforeEach(({ to, from, next }) => { 84 | console.log('%s router beforeEach!', to.path) 85 | // 记录当前地址和上一页地址 86 | _history.prevPath = from.path 87 | _history.currPath = to.path 88 | 89 | // 判断页面进场方向 90 | let toIndex = _history[to.path] 91 | let fromIndex = _history[from.path] 92 | 93 | 94 | if(!toIndex){ 95 | Vue.$vux.loading.show() 96 | _history[to.path] = ++_history.count 97 | } 98 | 99 | if(!from.path || (from.mainPage && to.mainPage)){ 100 | store.dispatch('APP_DIRECTION', '') 101 | }else if(!from.mainPage && to.mainPage){ 102 | store.dispatch('APP_DIRECTION', 'out') 103 | }else if(from.mainPage && !to.mainPage){ 104 | store.dispatch('APP_DIRECTION', 'in') 105 | }else if(!(toIndex < fromIndex)){ 106 | store.dispatch('APP_DIRECTION', 'in') 107 | }else{ 108 | store.dispatch('APP_DIRECTION', 'out') 109 | } 110 | 111 | if(to.query && to.query.direction){ 112 | store.dispatch('APP_DIRECTION', to.query.direction) 113 | } 114 | 115 | // from.path.startsWith(to.path) 安卓微信报错 116 | if(from.path){ 117 | if(from.path.indexOf(to.path) === 0){ 118 | store.dispatch('APP_DIRECTION', 'out') 119 | }else if(to.path.indexOf(from.path) === 0){ 120 | store.dispatch('APP_DIRECTION', 'in') 121 | } 122 | } 123 | 124 | storage.session.set('_history', _history) 125 | setTimeout(next, 100) 126 | }) 127 | 128 | // 此钩子函数一个类型为切换对象的参数,但是你只能访问此参数的 to 和 from 属性, 这两个属性都是路由对象。在这个后置钩子函数里不能调用任何切换函数。 129 | router.afterEach(({ to , from }) => { 130 | console.log('%s router afterEach!', to.path) 131 | Vue.$vux.loading.hide() 132 | utils.setTitle(to.title) 133 | storage.session.set('_history', _history) 134 | }) 135 | 136 | router.start(App, '#app') -------------------------------------------------------------------------------- /src/apps/default/page/product-list.vue: -------------------------------------------------------------------------------- 1 | 34 | 99 | 134 | -------------------------------------------------------------------------------- /src/apps/default/page/user-faq-feedback.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 136 | -------------------------------------------------------------------------------- /src/apps/default/page/register.vue: -------------------------------------------------------------------------------- 1 | 23 | 125 | 129 | -------------------------------------------------------------------------------- /src/apps/default/page/store-info.vue: -------------------------------------------------------------------------------- 1 | 31 | 110 | 115 | 145 | -------------------------------------------------------------------------------- /src/apps/default/page/booking.vue: -------------------------------------------------------------------------------- 1 | 21 | 114 | 131 | -------------------------------------------------------------------------------- /src/apps/default/page/activity.vue: -------------------------------------------------------------------------------- 1 | 43 | 106 | 146 | -------------------------------------------------------------------------------- /src/apps/default/page/user-order-info.vue: -------------------------------------------------------------------------------- 1 | 25 | 101 | 102 | -------------------------------------------------------------------------------- /src/apps/default/page/user-coupon-select.vue: -------------------------------------------------------------------------------- 1 | 23 | 76 | 187 | -------------------------------------------------------------------------------- /src/apps/default/page/home.vue: -------------------------------------------------------------------------------- 1 | 64 | 105 | 151 | -------------------------------------------------------------------------------- /src/apps/default/router-map.js: -------------------------------------------------------------------------------- 1 | // 应用配置 2 | const _PAGE = './page' 3 | export default { 4 | '*': { 5 | title: '找不到页面', 6 | component: (resolve) => require([_PAGE + '/404'], resolve) 7 | }, 8 | '/login': { 9 | title: '登录', 10 | component: (resolve) => require([_PAGE + '/login'], resolve) 11 | }, 12 | '/register': { 13 | title: '注册', 14 | component: (resolve) => require([_PAGE + '/register'], resolve) 15 | }, 16 | '/news/list': { 17 | title: '艾臣资讯', 18 | component: (resolve) => require([_PAGE + '/news-list'], resolve) 19 | }, 20 | '/news/list/info': { 21 | title: '资讯详情', 22 | component: (resolve) => require([_PAGE + '/news-info'], resolve) 23 | }, 24 | '/home': { 25 | title: '首页', 26 | mainPage: true, 27 | component: (resolve) => require([_PAGE + '/home'], resolve) 28 | }, 29 | '/order/tracking': { 30 | title: '订单跟踪', 31 | component: (resolve) => require([_PAGE + '/order-tracking'], resolve) 32 | }, 33 | '/wellife': { 34 | title: '智慧生活', 35 | component: (resolve) => require([_PAGE + '/wellife'], resolve) 36 | }, 37 | '/welfare': { 38 | title: '新人福利', 39 | component: (resolve) => require([_PAGE + '/welfare'], resolve) 40 | }, 41 | '/welfare/gift': { 42 | title: '领取奖品', 43 | component: (resolve) => require([_PAGE + '/welfare-gift'], resolve) 44 | }, 45 | '/australia': { 46 | title: '澳式风情', 47 | component: (resolve) => require([_PAGE + '/australia'], resolve) 48 | }, 49 | '/company': { 50 | title: '企业简介', 51 | component: (resolve) => require([_PAGE + '/company'], resolve) 52 | }, 53 | '/store/list': { 54 | title: '门店展示', 55 | component: (resolve) => require([_PAGE + '/store-list'], resolve) 56 | }, 57 | '/store/list/info': { 58 | title: '门店详情', 59 | component: (resolve) => require([_PAGE + '/store-info'], resolve) 60 | }, 61 | '/booking': { 62 | title: '在线预约', 63 | component: (resolve) => require([_PAGE + '/booking'], resolve) 64 | }, 65 | '/activity': { 66 | title: '活动中心', 67 | mainPage: true, 68 | component: (resolve) => require([_PAGE + '/activity'], resolve) 69 | }, 70 | '/activity/info': { 71 | title: '活动详情', 72 | component: (resolve) => require([_PAGE + '/activity-info'], resolve) 73 | }, 74 | '/product': { 75 | title: '产品中心', 76 | mainPage: true, 77 | component: (resolve) => require([_PAGE + '/product'], resolve) 78 | }, 79 | '/product/list': { 80 | title: '产品列表', 81 | component: (resolve) => require([_PAGE + '/product-list'], resolve) 82 | }, 83 | '/product/list/info': { 84 | title: '产品详情', 85 | component: (resolve) => require([_PAGE + '/product-info'], resolve) 86 | }, 87 | '/user': { 88 | title: '个人中心', 89 | mainPage: true, 90 | component: (resolve) => require([_PAGE + '/user'], resolve) 91 | }, 92 | '/user/info': { 93 | title: '个人信息', 94 | auth: true, 95 | component: (resolve) => require([_PAGE + '/user-info'], resolve) 96 | }, 97 | '/user/appointment': { 98 | title: '我的预约', 99 | auth: true, 100 | component: (resolve) => require([_PAGE + '/user-appointment'], resolve) 101 | }, 102 | '/user/appointment/info': { 103 | title: '预约详情', 104 | auth: true, 105 | component: (resolve) => require([_PAGE + '/user-appointment-info'], resolve) 106 | }, 107 | '/user/order': { 108 | title: '我的订单', 109 | auth: true, 110 | component: (resolve) => require([_PAGE + '/user-order'], resolve) 111 | }, 112 | '/user/order/info': { 113 | title: '订单详情', 114 | auth: true, 115 | component: (resolve) => require([_PAGE + '/user-order-info'], resolve) 116 | }, 117 | '/user/coupon/': { 118 | title: '我的优惠券', 119 | auth: true, 120 | component: (resolve) => require([_PAGE + '/user-coupon'], resolve) 121 | }, 122 | '/user/coupon/select': { 123 | title: '选择优惠券', 124 | auth: true, 125 | component: (resolve) => require([_PAGE + '/user-coupon-select'], resolve) 126 | }, 127 | '/user/coupon/info': { 128 | title: '优惠券详情', 129 | auth: true, 130 | component: (resolve) => require([_PAGE + '/user-coupon-info'], resolve) 131 | }, 132 | '/user/pwd': { 133 | title: '重置密码', 134 | auth: true, 135 | component: (resolve) => require([_PAGE + '/user-pwd'], resolve) 136 | }, 137 | '/user/faq': { 138 | title: '常见问题', 139 | auth: true, 140 | component: (resolve) => require([_PAGE + '/user-faq'], resolve) 141 | }, 142 | '/user/faq/info': { 143 | title: '常见问题', 144 | auth: true, 145 | component: (resolve) => require([_PAGE + '/user-faq-info'], resolve) 146 | }, 147 | '/user/faq/add': { 148 | title: '我要反馈', 149 | auth: true, 150 | component: (resolve) => require([_PAGE + '/user-faq-add'], resolve) 151 | }, 152 | '/user/faq/feedback': { 153 | title: '反馈详情', 154 | auth: true, 155 | component: (resolve) => require([_PAGE + '/user-faq-feedback'], resolve) 156 | } 157 | } 158 | 159 | -------------------------------------------------------------------------------- /src/apps/default/page/user-info.vue: -------------------------------------------------------------------------------- 1 | 23 | 103 | 135 | -------------------------------------------------------------------------------- /src/apps/default/page/user-appointment.vue: -------------------------------------------------------------------------------- 1 | 47 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /src/apps/default/page/product-info.vue: -------------------------------------------------------------------------------- 1 | 49 | 118 | 175 | -------------------------------------------------------------------------------- /src/apps/default/page/store-list.vue: -------------------------------------------------------------------------------- 1 | 43 | 126 | 154 | -------------------------------------------------------------------------------- /src/apps/default/page/user-coupon.vue: -------------------------------------------------------------------------------- 1 | 62 | 108 | 218 | -------------------------------------------------------------------------------- /src/apps/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 艾臣安全智能门窗 17 | 18 | 181 | 182 | 183 | 184 |
185 | 186 |
187 |
188 |
189 |
190 |
191 | 210 | 211 | 212 | 213 | 214 | -------------------------------------------------------------------------------- /src/apps/default/page/welfare-gift.vue: -------------------------------------------------------------------------------- 1 | 24 | 179 | 195 | 229 | -------------------------------------------------------------------------------- /src/apps/default/page/company.vue: -------------------------------------------------------------------------------- 1 | 135 | 167 | 205 | -------------------------------------------------------------------------------- /src/assets/jweixin-1.0.0.js: -------------------------------------------------------------------------------- 1 | !function(a,b){"function"==typeof define&&(define.amd||define.cmd)?define(function(){return b(a)}):b(a,!0)}(this,function(a,b){function c(b,c,d){a.WeixinJSBridge?WeixinJSBridge.invoke(b,e(c),function(a){g(b,a,d)}):j(b,d)}function d(b,c,d){a.WeixinJSBridge?WeixinJSBridge.on(b,function(a){d&&d.trigger&&d.trigger(a),g(b,a,c)}):d?j(b,d):j(b,c)}function e(a){return a=a||{},a.appId=E.appId,a.verifyAppId=E.appId,a.verifySignType="sha1",a.verifyTimestamp=E.timestamp+"",a.verifyNonceStr=E.nonceStr,a.verifySignature=E.signature,a}function f(a){return{timeStamp:a.timestamp+"",nonceStr:a.nonceStr,"package":a.package,paySign:a.paySign,signType:a.signType||"SHA1"}}function g(a,b,c){var d,e,f;switch(delete b.err_code,delete b.err_desc,delete b.err_detail,d=b.errMsg,d||(d=b.err_msg,delete b.err_msg,d=h(a,d),b.errMsg=d),c=c||{},c._complete&&(c._complete(b),delete c._complete),d=b.errMsg||"",E.debug&&!c.isInnerInvoke&&alert(JSON.stringify(b)),e=d.indexOf(":"),f=d.substring(e+1)){case"ok":c.success&&c.success(b);break;case"cancel":c.cancel&&c.cancel(b);break;default:c.fail&&c.fail(b)}c.complete&&c.complete(b)}function h(a,b){var e,f,c=a,d=p[c];return d&&(c=d),e="ok",b&&(f=b.indexOf(":"),e=b.substring(f+1),"confirm"==e&&(e="ok"),"failed"==e&&(e="fail"),-1!=e.indexOf("failed_")&&(e=e.substring(7)),-1!=e.indexOf("fail_")&&(e=e.substring(5)),e=e.replace(/_/g," "),e=e.toLowerCase(),("access denied"==e||"no permission to execute"==e)&&(e="permission denied"),"config"==c&&"function not exist"==e&&(e="ok"),""==e&&(e="fail")),b=c+":"+e}function i(a){var b,c,d,e;if(a){for(b=0,c=a.length;c>b;++b)d=a[b],e=o[d],e&&(a[b]=e);return a}}function j(a,b){if(!(!E.debug||b&&b.isInnerInvoke)){var c=p[a];c&&(a=c),b&&b._complete&&delete b._complete,console.log('"'+a+'",',b||"")}}function k(){0!=D.preVerifyState&&(u||v||E.debug||"6.0.2">z||D.systemType<0||A||(A=!0,D.appId=E.appId,D.initTime=C.initEndTime-C.initStartTime,D.preVerifyTime=C.preVerifyEndTime-C.preVerifyStartTime,H.getNetworkType({isInnerInvoke:!0,success:function(a){var b,c;D.networkType=a.networkType,b="http://open.weixin.qq.com/sdk/report?v="+D.version+"&o="+D.preVerifyState+"&s="+D.systemType+"&c="+D.clientVersion+"&a="+D.appId+"&n="+D.networkType+"&i="+D.initTime+"&p="+D.preVerifyTime+"&u="+D.url,c=new Image,c.src=b}})))}function l(){return(new Date).getTime()}function m(b){w&&(a.WeixinJSBridge?b():q.addEventListener&&q.addEventListener("WeixinJSBridgeReady",b,!1))}function n(){H.invoke||(H.invoke=function(b,c,d){a.WeixinJSBridge&&WeixinJSBridge.invoke(b,e(c),d)},H.on=function(b,c){a.WeixinJSBridge&&WeixinJSBridge.on(b,c)})}var o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H;if(!a.jWeixin)return o={config:"preVerifyJSAPI",onMenuShareTimeline:"menu:share:timeline",onMenuShareAppMessage:"menu:share:appmessage",onMenuShareQQ:"menu:share:qq",onMenuShareWeibo:"menu:share:weiboApp",onMenuShareQZone:"menu:share:QZone",previewImage:"imagePreview",getLocation:"geoLocation",openProductSpecificView:"openProductViewWithPid",addCard:"batchAddCard",openCard:"batchViewCard",chooseWXPay:"getBrandWCPayRequest"},p=function(){var b,a={};for(b in o)a[o[b]]=b;return a}(),q=a.document,r=q.title,s=navigator.userAgent.toLowerCase(),t=navigator.platform.toLowerCase(),u=!(!t.match("mac")&&!t.match("win")),v=-1!=s.indexOf("wxdebugger"),w=-1!=s.indexOf("micromessenger"),x=-1!=s.indexOf("android"),y=-1!=s.indexOf("iphone")||-1!=s.indexOf("ipad"),z=function(){var a=s.match(/micromessenger\/(\d+\.\d+\.\d+)/)||s.match(/micromessenger\/(\d+\.\d+)/);return a?a[1]:""}(),A=!1,B=!1,C={initStartTime:l(),initEndTime:0,preVerifyStartTime:0,preVerifyEndTime:0},D={version:1,appId:"",initTime:0,preVerifyTime:0,networkType:"",preVerifyState:1,systemType:y?1:x?2:-1,clientVersion:z,url:encodeURIComponent(location.href)},E={},F={_completes:[]},G={state:0,data:{}},m(function(){C.initEndTime=l()}),H={config:function(a){E=a,j("config",a);var b=E.check===!1?!1:!0;m(function(){var a,d,e;if(b)c(o.config,{verifyJsApiList:i(E.jsApiList)},function(){F._complete=function(a){C.preVerifyEndTime=l(),G.state=1,G.data=a},F.success=function(){D.preVerifyState=0},F.fail=function(a){F._fail?F._fail(a):G.state=-1};var a=F._completes;return a.push(function(){k()}),F.complete=function(){for(var c=0,d=a.length;d>c;++c)a[c]();F._completes=[]},F}()),C.preVerifyStartTime=l();else{for(G.state=1,a=F._completes,d=0,e=a.length;e>d;++d)a[d]();F._completes=[]}}),E.beta&&n()},ready:function(a){0!=G.state?a():(F._completes.push(a),!w&&E.debug&&a())},error:function(a){"6.0.2">z||B||(B=!0,-1==G.state?a(G.data):F._fail=a)},checkJsApi:function(a){var b=function(a){var c,d,b=a.checkResult;for(c in b)d=p[c],d&&(b[d]=b[c],delete b[c]);return a};c("checkJsApi",{jsApiList:i(a.jsApiList)},function(){return a._complete=function(a){if(x){var c=a.checkResult;c&&(a.checkResult=JSON.parse(c))}a=b(a)},a}())},onMenuShareTimeline:function(a){d(o.onMenuShareTimeline,{complete:function(){c("shareTimeline",{title:a.title||r,desc:a.title||r,img_url:a.imgUrl||"",link:a.link||location.href,type:a.type||"link",data_url:a.dataUrl||""},a)}},a)},onMenuShareAppMessage:function(a){d(o.onMenuShareAppMessage,{complete:function(){c("sendAppMessage",{title:a.title||r,desc:a.desc||"",link:a.link||location.href,img_url:a.imgUrl||"",type:a.type||"link",data_url:a.dataUrl||""},a)}},a)},onMenuShareQQ:function(a){d(o.onMenuShareQQ,{complete:function(){c("shareQQ",{title:a.title||r,desc:a.desc||"",img_url:a.imgUrl||"",link:a.link||location.href},a)}},a)},onMenuShareWeibo:function(a){d(o.onMenuShareWeibo,{complete:function(){c("shareWeiboApp",{title:a.title||r,desc:a.desc||"",img_url:a.imgUrl||"",link:a.link||location.href},a)}},a)},onMenuShareQZone:function(a){d(o.onMenuShareQZone,{complete:function(){c("shareQZone",{title:a.title||r,desc:a.desc||"",img_url:a.imgUrl||"",link:a.link||location.href},a)}},a)},startRecord:function(a){c("startRecord",{},a)},stopRecord:function(a){c("stopRecord",{},a)},onVoiceRecordEnd:function(a){d("onVoiceRecordEnd",a)},playVoice:function(a){c("playVoice",{localId:a.localId},a)},pauseVoice:function(a){c("pauseVoice",{localId:a.localId},a)},stopVoice:function(a){c("stopVoice",{localId:a.localId},a)},onVoicePlayEnd:function(a){d("onVoicePlayEnd",a)},uploadVoice:function(a){c("uploadVoice",{localId:a.localId,isShowProgressTips:0==a.isShowProgressTips?0:1},a)},downloadVoice:function(a){c("downloadVoice",{serverId:a.serverId,isShowProgressTips:0==a.isShowProgressTips?0:1},a)},translateVoice:function(a){c("translateVoice",{localId:a.localId,isShowProgressTips:0==a.isShowProgressTips?0:1},a)},chooseImage:function(a){c("chooseImage",{scene:"1|2",count:a.count||9,sizeType:a.sizeType||["original","compressed"],sourceType:a.sourceType||["album","camera"]},function(){return a._complete=function(a){if(x){var b=a.localIds;b&&(a.localIds=JSON.parse(b))}},a}())},previewImage:function(a){c(o.previewImage,{current:a.current,urls:a.urls},a)},uploadImage:function(a){c("uploadImage",{localId:a.localId,isShowProgressTips:0==a.isShowProgressTips?0:1},a)},downloadImage:function(a){c("downloadImage",{serverId:a.serverId,isShowProgressTips:0==a.isShowProgressTips?0:1},a)},getNetworkType:function(a){var b=function(a){var c,d,e,b=a.errMsg;if(a.errMsg="getNetworkType:ok",c=a.subtype,delete a.subtype,c)a.networkType=c;else switch(d=b.indexOf(":"),e=b.substring(d+1)){case"wifi":case"edge":case"wwan":a.networkType=e;break;default:a.errMsg="getNetworkType:fail"}return a};c("getNetworkType",{},function(){return a._complete=function(a){a=b(a)},a}())},openLocation:function(a){c("openLocation",{latitude:a.latitude,longitude:a.longitude,name:a.name||"",address:a.address||"",scale:a.scale||28,infoUrl:a.infoUrl||""},a)},getLocation:function(a){a=a||{},c(o.getLocation,{type:a.type||"wgs84"},function(){return a._complete=function(a){delete a.type},a}())},hideOptionMenu:function(a){c("hideOptionMenu",{},a)},showOptionMenu:function(a){c("showOptionMenu",{},a)},closeWindow:function(a){a=a||{},c("closeWindow",{},a)},hideMenuItems:function(a){c("hideMenuItems",{menuList:a.menuList},a)},showMenuItems:function(a){c("showMenuItems",{menuList:a.menuList},a)},hideAllNonBaseMenuItem:function(a){c("hideAllNonBaseMenuItem",{},a)},showAllNonBaseMenuItem:function(a){c("showAllNonBaseMenuItem",{},a)},scanQRCode:function(a){a=a||{},c("scanQRCode",{needResult:a.needResult||0,scanType:a.scanType||["qrCode","barCode"]},function(){return a._complete=function(a){var b,c;y&&(b=a.resultStr,b&&(c=JSON.parse(b),a.resultStr=c&&c.scan_code&&c.scan_code.scan_result))},a}())},openProductSpecificView:function(a){c(o.openProductSpecificView,{pid:a.productId,view_type:a.viewType||0,ext_info:a.extInfo},a)},addCard:function(a){var e,f,g,h,b=a.cardList,d=[];for(e=0,f=b.length;f>e;++e)g=b[e],h={card_id:g.cardId,card_ext:g.cardExt},d.push(h);c(o.addCard,{card_list:d},function(){return a._complete=function(a){var c,d,e,b=a.card_list;if(b){for(b=JSON.parse(b),c=0,d=b.length;d>c;++c)e=b[c],e.cardId=e.card_id,e.cardExt=e.card_ext,e.isSuccess=e.is_succ?!0:!1,delete e.card_id,delete e.card_ext,delete e.is_succ;a.cardList=b,delete a.card_list}},a}())},chooseCard:function(a){c("chooseCard",{app_id:E.appId,location_id:a.shopId||"",sign_type:a.signType||"SHA1",card_id:a.cardId||"",card_type:a.cardType||"",card_sign:a.cardSign,time_stamp:a.timestamp+"",nonce_str:a.nonceStr},function(){return a._complete=function(a){a.cardList=a.choose_card_info,delete a.choose_card_info},a}())},openCard:function(a){var e,f,g,h,b=a.cardList,d=[];for(e=0,f=b.length;f>e;++e)g=b[e],h={card_id:g.cardId,code:g.code},d.push(h);c(o.openCard,{card_list:d},a)},chooseWXPay:function(a){c(o.chooseWXPay,f(a),a)}},b&&(a.wx=a.jWeixin=H),H}); -------------------------------------------------------------------------------- /src/assets/utils.js: -------------------------------------------------------------------------------- 1 | // 检测设备 2 | const ua = navigator.userAgent 3 | const isAndroid = /(Android);?[\s\/]+([\d.]+)?/.test(ua) 4 | const isIpad = /(iPad).*OS\s([\d_]+)/.test(ua) 5 | const isIpod = /(iPod)(.*OS\s([\d_]+))?/.test(ua) 6 | const isIphone = !isIpad && /(iPhone\sOS)\s([\d_]+)/.test(ua) 7 | const isWechat = /micromessenger/i.test(ua) 8 | 9 | Promise.prototype.done = Promise.prototype.done || function (onFulfilled, onRejected) { 10 | this.then(onFulfilled, onRejected) 11 | .catch(function (reason) { 12 | // 抛出一个全局错误 13 | setTimeout(() => { throw reason }, 0) 14 | }) 15 | } 16 | 17 | Promise.prototype.finally = Promise.prototype.finally || function (callback) { 18 | let P = this.constructor 19 | return this.then( 20 | value => P.resolve(callback()).then(() => value), 21 | reason => P.resolve(callback()).then(() => { throw reason }) 22 | ) 23 | } 24 | 25 | 26 | /*========本地存储===========*/ 27 | const STORE_PREFIX = '_yz_' 28 | export let storage = { 29 | getPrefix: () => STORE_PREFIX, 30 | cookies: { 31 | get(sKey) { 32 | if (!sKey) return null 33 | sKey = STORE_PREFIX + sKey 34 | return decodeURIComponent(document.cookie.replace(new RegExp('(?:(?:^|.*;)\\s*' + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, '\\$&') + '\\s*\\=\\s*([^;]*).*$)|^.*$'), '$1')) || null 35 | }, 36 | set(sKey, sValue, vEnd = 1800, sPath = '/', sDomain = '', bSecure = false) { 37 | if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) return false 38 | 39 | sKey = STORE_PREFIX + sKey 40 | let sExpires = '' 41 | if (vEnd) { 42 | switch (vEnd.constructor) { 43 | case Number: // 单位秒 44 | sExpires = vEnd === Infinity ? '; expires=Fri, 31 Dec 9999 23:59:59 GMT' : '; max-age=' + vEnd 45 | break 46 | case String: 47 | sExpires = '; expires=' + vEnd 48 | break 49 | case Date: 50 | sExpires = '; expires=' + vEnd.toUTCString() 51 | break 52 | } 53 | } 54 | document.cookie = encodeURIComponent(sKey) + '=' + encodeURIComponent(sValue) + sExpires + (sDomain ? '; domain=' + sDomain : '') + (sPath ? '; path=' + sPath : '') + (bSecure ? '; secure' : '') 55 | return true 56 | }, 57 | remove(sKey, sPath = '/', sDomain = '') { 58 | if (!this.has(sKey)) return false 59 | 60 | sKey = STORE_PREFIX + sKey 61 | document.cookie = encodeURIComponent(sKey) + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT' + (sDomain ? '; domain=' + sDomain : '') + (sPath ? '; path=' + sPath : '') 62 | return true 63 | }, 64 | has(sKey) { 65 | if (!sKey) return false 66 | return (new RegExp('(?:^|;\\s*)' + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, '\\$&') + '\\s*\\=')).test(document.cookie) 67 | }, 68 | keys() { 69 | let aKeys = document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g, '').split(/\s*(?:\=[^;]*)?;\s*/) 70 | for (let nLen = aKeys.length, nIdx = 0; nIdx < nLen; nIdx++) { aKeys[nIdx] = decodeURIComponent(aKeys[nIdx]) } 71 | return aKeys 72 | } 73 | }, 74 | session: { 75 | set(key, value) { 76 | if(!key) return false 77 | window.sessionStorage.setItem(STORE_PREFIX + key, JSON.stringify(value || {})) 78 | }, 79 | get(key) { 80 | if(!key) return null 81 | return JSON.parse(window.sessionStorage.getItem(STORE_PREFIX + key)) 82 | } 83 | }, 84 | local: { 85 | set(key, value, ms = 1000*3600*24*365) { 86 | if(!key) return false 87 | 88 | key = STORE_PREFIX + key 89 | let newValue = { 90 | value: value, 91 | expires: ms, 92 | time: new Date().getTime() 93 | } 94 | window.localStorage.setItem(key, JSON.stringify(newValue)) 95 | }, 96 | get(key) { 97 | if(!key) return null 98 | key = STORE_PREFIX + key 99 | 100 | let value = JSON.parse(window.localStorage.getItem(key)) 101 | if (value && (new Date().getTime() - value.time < value.expires)) { 102 | value = value.value 103 | }else{ 104 | value = null 105 | } 106 | return value 107 | } 108 | } 109 | } 110 | /*========utils小工具===========*/ 111 | // 参考jq源码 112 | const class2type = (function(){ 113 | let ret = {} 114 | 'Boolean Number String Function Array Date RegExp Object Error'.split(' ').forEach((name) => { 115 | ret[ '[object ' + name + ']' ] = name.toLowerCase(); 116 | }) 117 | return ret 118 | })() 119 | export let utils = { 120 | device: { 121 | isAndroid, 122 | isIpad, 123 | isIpod, 124 | isIphone, 125 | isWechat 126 | }, 127 | regexp: { 128 | mobile: /^\s*1\d{10}\s*$/ 129 | }, 130 | noop(){}, 131 | extend(target, ...objs) { 132 | if(!utils.isPlainObject(target)) return null 133 | objs.forEach((obj) => { 134 | if(utils.isPlainObject(obj)){ 135 | Object.keys(obj).forEach((key)=>{ 136 | if(obj[key] !== null && obj[key] !== undefined){ 137 | target[key] = obj[key] 138 | } 139 | }) 140 | } 141 | }) 142 | return target 143 | }, 144 | type(value) { 145 | //如果是null或者undefined,直接转成String返回 146 | if( value == null ) return String( value ) 147 | //RegExp,Array等都属于Object 148 | //为了精准判断类型,借由Object.prototype.toString跟class2type表 149 | //这里为什么要用core_toString而不用obj.toString的原因在刚刚试验中说明了 150 | return typeof value === 'object' || typeof value === 'function' ? 151 | class2type[ class2type.toString.call(value) ] || 'object' : typeof value 152 | }, 153 | isPlainObject(obj){ 154 | // Must be an Object. 155 | // Because of IE, we also have to check the presence of the constructor property. 156 | // Make sure that DOM nodes and window objects don't pass through, as well 157 | if ( !obj || utils.type(obj) !== "object" || obj.nodeType || utils.isWindow( obj ) ) { 158 | return false; 159 | } 160 | try { 161 | // Not own constructor property must be Object 162 | if ( obj.constructor && 163 | !class2type.hasOwnProperty.call(obj, "constructor") && 164 | !class2type.hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) { 165 | return false; 166 | } 167 | } catch ( e ) { 168 | // IE8,9 Will throw exceptions on certain host objects #9897 169 | return false; 170 | } 171 | // Own properties are enumerated firstly, so to speed up, 172 | // if last one is own, then all properties are own. 173 | let key = undefined 174 | for ( key in obj ) {} 175 | return key === undefined || class2type.hasOwnProperty.call( obj, key ); 176 | }, 177 | isEmptyObject(obj) { 178 | for ( let key in obj ) { 179 | return false 180 | } 181 | return true 182 | }, 183 | isFunction(obj){ 184 | return utils.type(obj) === 'function' 185 | }, 186 | isArray: Array.isArray || function(obj) { 187 | return utils.type(obj) === 'array' 188 | }, 189 | isWindow(obj) { 190 | return obj != null && obj == obj.window 191 | }, 192 | isString(value) { 193 | return typeof value === 'string' 194 | }, 195 | isNumber(value) { 196 | return !isNaN( parseFloat(value) ) && isFinite( value ) 197 | }, 198 | setTitle(title) { 199 | document.title = title || '艾臣安全智能门窗' 200 | // 判断是否为ios设备的微信浏览器,加载iframe来刷新title 201 | if (isWechat && isIphone) { 202 | let iframe = document.createElement('iframe') 203 | iframe.setAttribute('src', '/favicon.ico') 204 | iframe.addEventListener('load', function() { 205 | setTimeout(() => { 206 | iframe.removeEventListener('load') 207 | document.body.removeChild(iframe) 208 | }, 50) 209 | }) 210 | document.body.appendChild(iframe) 211 | } 212 | }, 213 | alert(msg) { 214 | // window.alert(msg) 215 | console.log(msg) 216 | }, 217 | debug(msg = '') { 218 | // window.alert(window.JSON.stringify(msg)) 219 | }, 220 | url: { 221 | getArgs(url) { 222 | if(typeof url !== 'string') url = window.location.href 223 | url = decodeURIComponent(url) 224 | let pos = url.indexOf('?'), 225 | pos2 = url.lastIndexOf('#'), 226 | qs = pos > -1 ? url.substring(pos+1, pos2 <= pos ? url.length : pos2) : '', 227 | items = qs.split('&') 228 | let args = {}, 229 | arg = null, 230 | name = null, 231 | value = null 232 | for(let i=0, splitPos = 0, item=null; i utils.isString(item)) 280 | .map((item) => { 281 | item = item.replace(/^\/+|\/+$/g, '') 282 | if(item){ 283 | passPath.push(item) 284 | } 285 | }) 286 | return passPath.join('/') 287 | } 288 | }, 289 | image: { 290 | thumb(src, width, height) { 291 | width = width || 320 292 | if(!src){ 293 | return '' 294 | return `http://placeholder.qiniudn.com/${width}/ebebeb/cccccc` 295 | } 296 | // return src += '?imageMogr2/gravity/Center/crop/'+width+'x'+height; 297 | src += `?imageMogr2/format/jpg/interlace/1/quality/60/gravity/Center/thumbnail/${width}x` 298 | if(height){ 299 | src += `/crop/x${height}` 300 | } 301 | 302 | return src 303 | }, 304 | wxHead(src) { 305 | if(!src) { 306 | let avatar = require('assets/imgs/avatar.png') 307 | return avatar 308 | } 309 | if(src.indexOf('wx.qlogo.cn') === -1){ 310 | return src 311 | } 312 | return src.replace(/\/0$/, '/64') 313 | } 314 | } 315 | 316 | } 317 | 318 | export default utils 319 | 320 | 321 | 322 | --------------------------------------------------------------------------------