YuJian
/
Storyofvue
Archived
1
0
Fork 0
Browse Source

storyofvue finish

gh-pages
遇见 5 years ago
parent
commit
723011431b
  1. 1
      .gitignore
  2. 22
      package-lock.json
  3. 1
      package.json
  4. 3866
      public/mock/city.json
  5. 25
      public/mock/detail.json
  6. 107
      public/mock/index.json
  7. 1
      src/main.js
  8. 6
      src/pages/city/components/Alphabet.vue
  9. 9
      src/router/index.js

1
.gitignore vendored

@ -1,7 +1,6 @@
.DS_Store .DS_Store
node_modules node_modules
/dist /dist
public/mock
# local env files # local env files
.env.local .env.local

22
package-lock.json generated

@ -2128,6 +2128,28 @@
"object.assign": "^4.1.0" "object.assign": "^4.1.0"
} }
}, },
"babel-polyfill": {
"version": "6.26.0",
"resolved": "https://registry.npm.taobao.org/babel-polyfill/download/babel-polyfill-6.26.0.tgz",
"integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=",
"requires": {
"babel-runtime": "^6.26.0",
"core-js": "^2.5.0",
"regenerator-runtime": "^0.10.5"
},
"dependencies": {
"core-js": {
"version": "2.6.11",
"resolved": "https://registry.npm.taobao.org/core-js/download/core-js-2.6.11.tgz?cache=0&sync_timestamp=1578957006406&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-2.6.11.tgz",
"integrity": "sha1-OIMUafmSK97Y7iHJ3EaYXgOZMIw="
},
"regenerator-runtime": {
"version": "0.10.5",
"resolved": "https://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.10.5.tgz",
"integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg="
}
}
},
"babel-runtime": { "babel-runtime": {
"version": "6.26.0", "version": "6.26.0",
"resolved": "https://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz", "resolved": "https://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz",

1
package.json

@ -9,6 +9,7 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.19.2", "axios": "^0.19.2",
"babel-polyfill": "^6.26.0",
"better-scroll": "^1.15.2", "better-scroll": "^1.15.2",
"core-js": "^3.6.4", "core-js": "^3.6.4",
"fastclick": "^1.0.6", "fastclick": "^1.0.6",

3866
public/mock/city.json

File diff suppressed because it is too large Load Diff

25
public/mock/detail.json

@ -0,0 +1,25 @@
{
"ret": true,
"data": {
"sightName": "大连圣亚海洋世界(AAAA景区)",
"bannerImg": "http://img1.qunarzz.com/sight/p0/201404/23/04b92c99462687fa1ba45c1b5ba4ad77.jpg_600x330_bf9c4904.jpg",
"gallaryImgs": ["http://img1.qunarzz.com/sight/p0/201404/23/04b92c99462687fa1ba45c1b5ba4ad77.jpg_800x800_70debc93.jpg", "http://img1.qunarzz.com/sight/p0/1709/76/7691528bc7d7ad3ca3.img.png_800x800_9ef05ee7.png"],
"categoryList": [{
"title": "成人票",
"children": [{
"title": "成人三馆联票",
"children": [{
"title": "成人三馆联票 - 某一连锁店销售"
}]
},{
"title": "成人五馆联票"
}]
}, {
"title": "学生票"
}, {
"title": "儿童票"
}, {
"title": "特惠票"
}]
}
}

107
public/mock/index.json

@ -0,0 +1,107 @@
{
"ret": true,
"data": {
"swiperList": [{
"id": "0001",
"imgUrl": "http://img1.qunarzz.com/piao/fusion/1801/1a/94428c6dea109402.jpg_640x200_2cf590d8.jpg"
},{
"id": "0002",
"imgUrl": "http://img1.qunarzz.com/piao/fusion/1802/42/7c92b9a381e46402.jpg_640x200_1cdce2a4.jpg"
},{
"id": "0003",
"imgUrl": "http://img1.qunarzz.com/piao/fusion/1802/51/e78f936a5b404102.jpg_640x200_c14f0b3a.jpg"
},{
"id": "0004",
"imgUrl": "http://img1.qunarzz.com/piao/fusion/1712/91/a275569091681d02.jpg_640x200_0519ccb9.jpg"
}],
"iconList": [{
"id": "0001",
"imgUrl": "https://imgs.qunarzz.com/piao/fusion/1803/95/f3dd6c383aeb3b02.png",
"desc": "景点门票"
}, {
"id": "0002",
"imgUrl": "https://imgs.qunarzz.com/piao/fusion/1803/fc/b10a6b2e4f0fe102.png",
"desc": "万龙滑雪"
}, {
"id": "0003",
"imgUrl": "https://imgs.qunarzz.com/piao/fusion/1803/6c/9e54a8540fee0102.png",
"desc": "故宫"
}, {
"id": "0004",
"imgUrl": "https://imgs.qunarzz.com/piao/fusion/1803/fc/b10a6b2e4f0fe102.png",
"desc": "静之湖滑雪"
}, {
"id": "0005",
"imgUrl": "https://imgs.qunarzz.com/piao/fusion/1804/5a/13ceb38dcf262f02.png",
"desc": "一日游"
}, {
"id": "0006",
"imgUrl": "https://imgs.qunarzz.com/piao/fusion/1803/67/9a1678221b8e0e02.png",
"desc": "古北水镇"
}, {
"id": "0007",
"imgUrl": "https://imgs.qunarzz.com/piao/fusion/1803/fc/b10a6b2e4f0fe102.png",
"desc": "陶然亭冰雪"
}, {
"id": "0008",
"imgUrl": "https://imgs.qunarzz.com/piao/fusion/1803/ab/6f7d6e44963c9302.png",
"desc": "泡温泉"
}, {
"id": "0009",
"imgUrl": "https://imgs.qunarzz.com/piao/fusion/1803/47/c2b659e048b11602.png",
"desc": "中国马镇"
}],
"recommendList": [{
"id": "0001",
"imgUrl": "http://img1.qunarzz.com/sight/p0/1409/19/adca619faaab0898245dc4ec482b5722.jpg_140x140_80f63803.jpg",
"title": "故宫",
"desc": "东方宫殿建筑代表,世界宫殿建筑典范"
}, {
"id": "0002",
"imgUrl": "http://img1.qunarzz.com/sight/p0/1511/d2/d2aec2dfc5aa771290.water.jpg_140x140_abb362a7.jpg",
"title": "南山滑雪场",
"desc": "北京专业级滑雪圣地"
}, {
"id": "0003",
"imgUrl": "http://img1.qunarzz.com/sight/p0/1501/f4/f467729126949c3a.water.jpg_140x140_ef235b1c.jpg",
"title": "天安门广场",
"desc": "我爱北京天安门,天安门上太阳升"
}, {
"id": "0004",
"imgUrl": "http://img1.qunarzz.com/sight/p0/1501/40/40b2b6c951b28fdd.water.jpg_140x140_1c863e5c.jpg",
"title": "水立方",
"desc": "中国的荣耀,阳光下的晶莹水滴"
}, {
"id": "0005",
"imgUrl": "http://img1.qunarzz.com/sight/p0/201308/23/b283071686e64dfec8d65eac.jpg_140x140_8c5a7c49.jpg",
"title": "温都水城养生馆",
"desc": "各种亚热带植物掩映其间仿佛置身热带雨林"
}],
"weekendList": [{
"id": "0001",
"imgUrl": "http://img1.qunarzz.com/sight/source/1510/6e/1ea71e2f04e.jpg_r_640x214_aa6f091d.jpg",
"title": "北京温泉排行榜",
"desc": "细数北京温泉,温暖你的冬天"
}, {
"id": "0002",
"imgUrl": "http://img1.qunarzz.com/sight/source/1505/aa/7baaf8a851d221.jpg_r_640x214_1431200f.jpg",
"title": "北京必游TOP10",
"desc": "来北京必去的景点非这些地方莫属"
}, {
"id": "0003",
"imgUrl": "http://img1.qunarzz.com/sight/source/1505/9e/21df651e19af5d.jpg_r_640x214_3ea5bb38.jpg",
"title": "寻找北京的皇城范儿",
"desc": "数百年的宫廷庙宇,至今依旧威严霸气"
}, {
"id": "0004",
"imgUrl": "http://img1.qunarzz.com/sight/source/1505/ce/bc89bc2f0e33ea.jpg_r_640x214_3e408453.jpg",
"title": "学生最爱的博物馆",
"desc": "周末干嘛?北京很多博物馆已经免费开放啦"
}, {
"id": "0005",
"imgUrl": "http://img1.qunarzz.com/sight/source/1505/b2/fde1bfcd057a52.jpg_r_640x214_bbf3fa44.jpg",
"title": "儿童剧场,孩子的乐园",
"desc": "带宝贝观看演出,近距离体验艺术的无穷魅力"
}]
}
}

1
src/main.js

@ -4,6 +4,7 @@ import router from "./router";
import fastClick from "fastclick"; import fastClick from "fastclick";
import VueAwesomeSwiper from "vue-awesome-swiper"; import VueAwesomeSwiper from "vue-awesome-swiper";
import store from "./store"; import store from "./store";
import "babel-polyfill";
// CSS文件引入 // CSS文件引入
import "styles/reset.css"; import "styles/reset.css";
import "styles/border.css"; import "styles/border.css";

6
src/pages/city/components/Alphabet.vue

@ -5,7 +5,7 @@
v-for="item of letters" v-for="item of letters"
:key="item" :key="item"
:ref="item" :ref="item"
@touchstart="handleTouchStart" @touchstart.prevent="handleTouchStart"
@touchmove="handleTouchMove" @touchmove="handleTouchMove"
@touchend="handleTouchEnd" @touchend="handleTouchEnd"
@click="handleLetterClick" @click="handleLetterClick"
@ -72,8 +72,8 @@ export default {
@import '~styles/variable.styl' @import '~styles/variable.styl'
// CSS touch-action: none; touch // CSS touch-action: none; touch
// https://blog.csdn.net/lijingshan34/article/details/88350456 // https://blog.csdn.net/lijingshan34/article/details/88350456
* // *
touch-action: none // touch-action: none
.list .list
display flex display flex
flex-direction column flex-direction column

9
src/router/index.js

@ -1,8 +1,5 @@
import Vue from "vue"; import Vue from "vue";
import Router from "vue-router"; import Router from "vue-router";
import Home from "@/pages/home/home";
import City from "@/pages/city/City";
import Detail from "@/pages/detail/Detail";
Vue.use(Router); Vue.use(Router);
@ -11,17 +8,17 @@ export default new Router({
{ {
path: "/", path: "/",
name: "Home", name: "Home",
component: Home component: () => import("@/pages/home/home")
}, },
{ {
path: "/city", path: "/city",
name: "City", name: "City",
component: City component: () => import("@/pages/city/City")
}, },
{ {
path: "/detail/:id", path: "/detail/:id",
name: "Detail", name: "Detail",
component: Detail component: () => import("@/pages/detail/Detail")
} }
], ],
scrollBehavior(to, from, savedPosition) { scrollBehavior(to, from, savedPosition) {