Skip to content

Commit 6a056d9

Browse files
committed
add order
1 parent 61040d8 commit 6a056d9

File tree

12 files changed

+1046
-91
lines changed

12 files changed

+1046
-91
lines changed

config/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ var path = require('path')
33

44
module.exports = {
55
build: {
6-
env: {NODE_ENV: '"production"'},
6+
env: {
7+
NODE_ENV: '"production"'
8+
},
79
index: path.resolve(__dirname, '../elm/index.html'),
810
assetsRoot: path.resolve(__dirname, '../elm'),
911
assetsSubDirectory: 'static',
@@ -17,7 +19,9 @@ module.exports = {
1719
productionGzipExtensions: ['js', 'css']
1820
},
1921
dev: {
20-
env: {NODE_ENV: '"development"'},
22+
env: {
23+
NODE_ENV: '"development"'
24+
},
2125
port: 8088,
2226
assetsSubDirectory: 'static',
2327
assetsPublicPath: '/',
@@ -28,6 +32,7 @@ module.exports = {
2832
'/v2',
2933
'/v3',
3034
'/v4',
35+
'/bos',
3136
],
3237
proxypath: 'https://mainsite-restapi.ele.me',
3338
// CSS Sourcemaps off by default because relative paths are "buggy"

src/components/common/mixin.js

Lines changed: 59 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,70 @@
1-
import {getStyle} from '../../config/mUtils'
2-
import {imgBaseUrl} from '../../config/env'
1+
import {
2+
getStyle
3+
} from '../../config/mUtils'
4+
import {
5+
imgBaseUrl
6+
} from '../../config/env'
37

48
export const loadMore = {
5-
directives:{
6-
'load-more':{
9+
directives: {
10+
'load-more': {
711
bind: (el, binding) => {
812
let windowHeight = window.screen.height;
913
let height;
1014
let setTop;
1115
let paddingBottom;
1216
let marginBottom;
13-
let requestFram;
14-
let oldScrollTop;
15-
let scrollEl;
16-
let heightEl;
17-
let scrollType = el.attributes.type.value;
18-
let scrollReduce = 2;
19-
if (scrollType == 1) {
20-
scrollEl = document.body;
21-
heightEl = el;
22-
}else{
23-
scrollEl = el;
24-
heightEl = el.children[0];
25-
}
17+
let requestFram;
18+
let oldScrollTop;
19+
let scrollEl;
20+
let heightEl;
21+
let scrollType = el.attributes.type && el.attributes.type.value;
22+
let scrollReduce = 2;
23+
if (scrollType == 2) {
24+
scrollEl = el;
25+
heightEl = el.children[0];
26+
} else {
27+
scrollEl = document.body;
28+
heightEl = el;
29+
}
2630

27-
el.addEventListener('touchstart',() => {
28-
height = heightEl.clientHeight;
29-
if (scrollType == 2) {
30-
height = height
31-
}
32-
setTop = el.offsetTop;
33-
paddingBottom = getStyle(el,'paddingBottom');
34-
marginBottom = getStyle(el,'marginBottom');
35-
},false)
31+
el.addEventListener('touchstart', () => {
32+
height = heightEl.clientHeight;
33+
if (scrollType == 2) {
34+
height = height
35+
}
36+
setTop = el.offsetTop;
37+
paddingBottom = getStyle(el, 'paddingBottom');
38+
marginBottom = getStyle(el, 'marginBottom');
39+
}, false)
3640

37-
el.addEventListener('touchmove',() => {
38-
loadMore();
39-
},false)
41+
el.addEventListener('touchmove', () => {
42+
loadMore();
43+
}, false)
4044

41-
el.addEventListener('touchend',() => {
42-
oldScrollTop = scrollEl.scrollTop;
43-
moveEnd();
44-
},false)
45-
46-
const moveEnd = () => {
47-
requestFram = requestAnimationFrame(() => {
48-
if (scrollEl.scrollTop != oldScrollTop) {
49-
oldScrollTop = scrollEl.scrollTop;
50-
moveEnd()
51-
}else{
52-
cancelAnimationFrame(requestFram);
53-
height = heightEl.clientHeight;
54-
loadMore();
55-
}
56-
})
57-
}
45+
el.addEventListener('touchend', () => {
46+
oldScrollTop = scrollEl.scrollTop;
47+
moveEnd();
48+
}, false)
5849

59-
const loadMore = () => {
60-
if (scrollEl.scrollTop + windowHeight >= height + setTop + paddingBottom + marginBottom - scrollReduce) {
61-
binding.value();
62-
}
63-
}
50+
const moveEnd = () => {
51+
requestFram = requestAnimationFrame(() => {
52+
if (scrollEl.scrollTop != oldScrollTop) {
53+
oldScrollTop = scrollEl.scrollTop;
54+
moveEnd()
55+
} else {
56+
cancelAnimationFrame(requestFram);
57+
height = heightEl.clientHeight;
58+
loadMore();
59+
}
60+
})
61+
}
62+
63+
const loadMore = () => {
64+
if (scrollEl.scrollTop + windowHeight >= height + setTop + paddingBottom + marginBottom - scrollReduce) {
65+
binding.value();
66+
}
67+
}
6468
}
6569
}
6670
}
@@ -69,17 +73,17 @@ export const loadMore = {
6973
export const getImgPath = {
7074
methods: {
7175
//传递过来的图片地址需要处理后才能正常使用
72-
getImgPath(path){
76+
getImgPath(path) {
7377
let suffix;
74-
if(!path){
78+
if (!path) {
7579
return 'http://test.fe.ptdev.cn/elm/elmlogo.jpeg'
7680
}
7781
if (path.indexOf('jpeg') !== -1) {
7882
suffix = '.jpeg'
79-
}else{
83+
} else {
8084
suffix = '.png'
8185
}
82-
let url = '/' + path.substr(0,1) + '/' + path.substr(1,2) + '/' + path.substr(3) + suffix;
86+
let url = '/' + path.substr(0, 1) + '/' + path.substr(1, 2) + '/' + path.substr(3) + suffix;
8387
return imgBaseUrl + url
8488
},
8589
}

src/components/footer/footGuide.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020

2121
</defs>
2222
</svg>
23-
<section @click = "gotoAddress('msite')" class="guide_item">
23+
<section @click = "gotoAddress({path: '/msite', query: {geohash}})" class="guide_item">
2424
<svg class="icon_style">
2525
<use xmlns:xlink="http://www.w3.org/1999/xlink" :xlink:href="$route.path.indexOf('msite') !== -1? '#msiteActive' : '#msite'"></use>
2626
</svg>
2727
<span>外卖</span>
2828
</section>
29-
<section @click = "gotoAddress('/find')" class="guide_item">
29+
<section @click = "gotoAddress({path: '/search/' + geohash})" class="guide_item">
3030
<svg class="icon_style">
31-
<use xmlns:xlink="http://www.w3.org/1999/xlink" :xlink:href="$route.path.indexOf('find') !== -1? '#findActive' : '#find'"></use>
31+
<use xmlns:xlink="http://www.w3.org/1999/xlink" :xlink:href="$route.path.indexOf('search') !== -1? '#findActive' : '#find'"></use>
3232
</svg>
3333
<span>发现</span>
3434
</section>
@@ -56,7 +56,7 @@
5656
}
5757
},
5858
created(){
59-
console.log(this.$route.path.indexOf('order'))
59+
6060
},
6161
mounted(){
6262
@@ -88,6 +88,7 @@
8888
bottom: 0;
8989
@include wh(100%, 1.95rem);
9090
display: flex;
91+
box-shadow: 0 -0.026667rem 0.053333rem rgba(0,0,0,.1);
9192
}
9293
.guide_item{
9394
flex: 1;

src/config/fetch.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default async(type = 'GET', url = '', data = {}, method = 'fetch') => {
2727
'Content-Type': 'application/json'
2828
},
2929
mode: "cors",
30-
cache: "only-if-cached"
30+
cache: "force-cache"
3131
}
3232

3333
if (type == 'POST') {
@@ -63,7 +63,6 @@ export default async(type = 'GET', url = '', data = {}, method = 'fetch') => {
6363
requestObj.onreadystatechange = () => {
6464
if (requestObj.readyState == 4) {
6565
if (requestObj.status == 200) {
66-
6766
let obj = requestObj.response
6867
if (typeof obj !== 'object') {
6968
obj = JSON.parse(obj);

src/page/confirmOrder/children/chooseAddress.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@
7272
created(){
7373
this.id = this.$route.query.id;
7474
this.sig = this.$route.query.sig;
75-
76-
// var date=new Date();
77-
// date.setTime(date.getTime()-10000);
78-
// document.cookie="USERID=186655961; expires=" + date.toGMTString() ;
79-
// document.cookie="SID=euYTx4hkmHEa1HdhpbkvaxXLvuR7lb2WjlwQ; expires=" + date.toGMTString();
8075
this.initData();
8176
},
8277
components: {

src/page/home/home.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ export default {
6969
groupcity().then(res => {
7070
this.groupcity = res;
7171
})
72+
73+
var date=new Date();
74+
date.setTime(date.getTime()-10000);
75+
document.cookie="USERID=186655961; expires=" + date.toGMTString() ;
76+
document.cookie="SID=euYTx4hkmHEa1HdhpbkvaxXLvuR7lb2WjlwQ; expires=" + date.toGMTString();
7277
},
7378
7479
components:{

src/page/login/login.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
},
9999
async getCaptchaCode(){
100100
let res = await getcaptchas();
101+
101102
this.captchaCodeImg = 'https://mainsite-restapi.ele.me/v1/captchas/' + res.code;
102103
},
103104
async getVerifyCode(){

0 commit comments

Comments
 (0)