Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
momo的小宝贝
vue2-elm
提交
734f742c
V
vue2-elm
项目概览
momo的小宝贝
/
vue2-elm
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue2-elm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
734f742c
编写于
2月 17, 2017
作者:
M
maguohua
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
upate scss
上级
b7e4051c
变更
29
展开全部
隐藏空白更改
内联
并排
Showing
29 changed file
with
1856 addition
and
86 deletion
+1856
-86
README.md
README.md
+2
-0
package.json
package.json
+1
-1
src/App.vue
src/App.vue
+2
-2
src/components/common/alertTip.vue
src/components/common/alertTip.vue
+2
-2
src/components/common/buyCart.vue
src/components/common/buyCart.vue
+10
-10
src/components/common/loading.vue
src/components/common/loading.vue
+1
-1
src/components/common/ratingStar.vue
src/components/common/ratingStar.vue
+1
-1
src/components/common/shoplist.vue
src/components/common/shoplist.vue
+1
-1
src/components/header/head.vue
src/components/header/head.vue
+1
-1
src/images/address_bottom.png
src/images/address_bottom.png
+0
-0
src/page/confirmOrder/confirmOrder.vue
src/page/confirmOrder/confirmOrder.vue
+303
-6
src/page/forget/forget.vue
src/page/forget/forget.vue
+1
-1
src/page/login/login.vue
src/page/login/login.vue
+1
-1
src/page/profile/children/balance.vue
src/page/profile/children/balance.vue
+1
-1
src/page/profile/children/benefit.vue
src/page/profile/children/benefit.vue
+1
-1
src/page/profile/children/info.vue
src/page/profile/children/info.vue
+1
-1
src/page/profile/children/points.vue
src/page/profile/children/points.vue
+1
-1
src/page/profile/children/service.vue
src/page/profile/children/service.vue
+1
-1
src/page/search/search.vue
src/page/search/search.vue
+1
-1
src/page/shop/children/foodDetail.vue
src/page/shop/children/foodDetail.vue
+1
-1
src/page/shop/children/shopDetail.vue
src/page/shop/children/shopDetail.vue
+1
-1
src/page/shop/children/shopSafe.vue
src/page/shop/children/shopSafe.vue
+1
-1
src/page/shop/shop.vue
src/page/shop/shop.vue
+2
-3
src/service/getData.js
src/service/getData.js
+41
-28
src/service/tempdata/confirm.js
src/service/tempdata/confirm.js
+1396
-0
src/service/tempdata/login.js
src/service/tempdata/login.js
+10
-0
src/store/mutations.js
src/store/mutations.js
+72
-19
src/style/common.less
src/style/common.less
+0
-0
src/style/mixin.less
src/style/mixin.less
+0
-0
未找到文件。
README.md
浏览文件 @
734f742c
...
@@ -29,6 +29,8 @@ vue2 + vue-rotuer2 + vuex + webpack + ES6/7 + fetch + sass + flex + svg + http-p
...
@@ -29,6 +29,8 @@ vue2 + vue-rotuer2 + vuex + webpack + ES6/7 + fetch + sass + flex + svg + http-p
-
[x] 修改密码 -- 完成
-
[x] 修改密码 -- 完成
-
[x] 个人中心 -- 完成
-
[x] 个人中心 -- 完成
-
[ ] 帐户信息
-
[ ] 帐户信息
-
[ ] 上传头像,修改用户名
-
[ ] 积分商城
-
[ ] 服务中心
-
[ ] 服务中心
-
[ ] 添加、删除、修改收货地址
-
[ ] 添加、删除、修改收货地址
-
[ ] 订单列表
-
[ ] 订单列表
...
...
package.json
浏览文件 @
734f742c
...
@@ -60,4 +60,4 @@
...
@@ -60,4 +60,4 @@
"node"
:
">= 4.0.0"
,
"node"
:
">= 4.0.0"
,
"npm"
:
">= 3.0.0"
"npm"
:
">= 3.0.0"
}
}
}
}
\ No newline at end of file
src/App.vue
浏览文件 @
734f742c
...
@@ -9,13 +9,13 @@
...
@@ -9,13 +9,13 @@
<
script
>
<
script
>
export
default
{
export
default
{
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
@import
'./style/common
.scss
'
;
@import
'./style/common'
;
.router-fade-enter-active
,
.router-fade-leave-active
{
.router-fade-enter-active
,
.router-fade-leave-active
{
transition
:
opacity
.4s
;
transition
:
opacity
.4s
;
}
}
...
...
src/components/common/alertTip.vue
浏览文件 @
734f742c
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../style/mixin
.scss
'
;
@import
'../../style/mixin'
;
@keyframes
tipMove
{
@keyframes
tipMove
{
0
%
{
transform
:
scale
(
1
)
}
0
%
{
transform
:
scale
(
1
)
}
35
%
{
transform
:
scale
(
.8
)
}
35
%
{
transform
:
scale
(
.8
)
}
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
margin-left
:
-6rem
;
margin-left
:
-6rem
;
width
:
12rem
;
width
:
12rem
;
animation
:
tipMove
.4s
;
animation
:
tipMove
.4s
;
background-color
:
#fff
;
background-color
:
rgba
(
255
,
255
,
255
,
1
)
;
border
:
1px
;
border
:
1px
;
padding-top
:
.6rem
;
padding-top
:
.6rem
;
display
:
flex
;
display
:
flex
;
...
...
src/components/common/buyCart.vue
浏览文件 @
734f742c
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
<section
class=
"cart_module"
>
<section
class=
"cart_module"
>
<section
v-if=
"!foods.specifications.length"
class=
"cart_button"
>
<section
v-if=
"!foods.specifications.length"
class=
"cart_button"
>
<transition
name=
"showReduce"
>
<transition
name=
"showReduce"
>
<svg
@
click=
"removeOutCart(foods.category_id, foods.item_id, foods.specfoods[0].food_id, foods.specfoods[0].name, foods.specfoods[0].price, '')"
v-if=
"foodNum"
>
<svg
@
click=
"removeOutCart(foods.category_id, foods.item_id, foods.specfoods[0].food_id, foods.specfoods[0].name, foods.specfoods[0].price, ''
, foods.specfoods[0].packing_fee, foods.specfoods[0].sku_id, foods.specfoods[0].stock
)"
v-if=
"foodNum"
>
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#cart-minus"
></use>
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#cart-minus"
></use>
</svg>
</svg>
</transition>
</transition>
<transition
name=
"fade"
>
<transition
name=
"fade"
>
<span
class=
"cart_num"
v-if=
"foodNum"
>
{{
foodNum
}}
</span>
<span
class=
"cart_num"
v-if=
"foodNum"
>
{{
foodNum
}}
</span>
</transition>
</transition>
<svg
@
click=
"addToCart(foods.category_id, foods.item_id, foods.specfoods[0].food_id, foods.specfoods[0].name, foods.specfoods[0].price, '', $event)"
>
<svg
@
click=
"addToCart(foods.category_id, foods.item_id, foods.specfoods[0].food_id, foods.specfoods[0].name, foods.specfoods[0].price, '',
foods.specfoods[0].packing_fee, foods.specfoods[0].sku_id, foods.specfoods[0].stock,
$event)"
>
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#cart-add"
></use>
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#cart-add"
></use>
</svg>
</svg>
<transition
<transition
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
<span>
¥
</span>
<span>
¥
</span>
<span>
{{
foods
.
specfoods
[
specsIndex
].
price
}}
</span>
<span>
{{
foods
.
specfoods
[
specsIndex
].
price
}}
</span>
</div>
</div>
<div
class=
"specs_addto_cart"
@
click=
"addSpecs(foods.category_id, foods.item_id, foods.specfoods[specsIndex].food_id, foods.specfoods[specsIndex].name, foods.specfoods[specsIndex].price, foods.specifications[0].values[specsIndex])"
>
加入购物车
</div>
<div
class=
"specs_addto_cart"
@
click=
"addSpecs(foods.category_id, foods.item_id, foods.specfoods[specsIndex].food_id, foods.specfoods[specsIndex].name, foods.specfoods[specsIndex].price, foods.specifications[0].values[specsIndex]
, foods.specfoods[specsIndex].packing_fee, foods.specfoods[specsIndex].sku_id, foods.specfoods[specsIndex].stock
)"
>
加入购物车
</div>
</footer>
</footer>
</div>
</div>
</transition>
</transition>
...
@@ -123,14 +123,14 @@
...
@@ -123,14 +123,14 @@
'
ADD_CART
'
,
'
REDUCE_CART
'
,
'
ADD_CART
'
,
'
REDUCE_CART
'
,
]),
]),
//移出购物车
//移出购物车
removeOutCart
(
category_id
,
item_id
,
food_id
,
name
,
price
,
specs
){
removeOutCart
(
category_id
,
item_id
,
food_id
,
name
,
price
,
specs
,
packing_fee
,
sku_id
,
stock
){
if
(
this
.
foodNum
>
0
)
{
if
(
this
.
foodNum
>
0
)
{
this
.
REDUCE_CART
({
shopid
:
this
.
shopId
,
category_id
,
item_id
,
food_id
,
name
,
price
,
specs
});
this
.
REDUCE_CART
({
shopid
:
this
.
shopId
,
category_id
,
item_id
,
food_id
,
name
,
price
,
specs
,
packing_fee
,
sku_id
,
stock
});
}
}
},
},
//加入购物车,计算按钮位置。
//加入购物车,计算按钮位置。
addToCart
(
category_id
,
item_id
,
food_id
,
name
,
price
,
specs
,
event
){
addToCart
(
category_id
,
item_id
,
food_id
,
name
,
price
,
specs
,
packing_fee
,
sku_id
,
stock
,
event
){
this
.
ADD_CART
({
shopid
:
this
.
shopId
,
category_id
,
item_id
,
food_id
,
name
,
price
,
specs
});
this
.
ADD_CART
({
shopid
:
this
.
shopId
,
category_id
,
item_id
,
food_id
,
name
,
price
,
specs
,
packing_fee
,
sku_id
,
stock
});
this
.
elLeft
=
event
.
target
.
getBoundingClientRect
().
left
;
this
.
elLeft
=
event
.
target
.
getBoundingClientRect
().
left
;
this
.
elBottom
=
event
.
target
.
getBoundingClientRect
().
bottom
;
this
.
elBottom
=
event
.
target
.
getBoundingClientRect
().
bottom
;
this
.
showMoveDot
.
push
(
true
);
this
.
showMoveDot
.
push
(
true
);
...
@@ -146,8 +146,8 @@
...
@@ -146,8 +146,8 @@
this
.
specsIndex
=
index
;
this
.
specsIndex
=
index
;
},
},
//多规格商品加入购物车
//多规格商品加入购物车
addSpecs
(
category_id
,
item_id
,
food_id
,
name
,
price
,
specs
){
addSpecs
(
category_id
,
item_id
,
food_id
,
name
,
price
,
specs
,
packing_fee
,
sku_id
,
stock
){
this
.
ADD_CART
({
shopid
:
this
.
shopId
,
category_id
,
item_id
,
food_id
,
name
,
price
,
specs
});
this
.
ADD_CART
({
shopid
:
this
.
shopId
,
category_id
,
item_id
,
food_id
,
name
,
price
,
specs
,
packing_fee
,
sku_id
,
stock
});
this
.
showChooseList
();
this
.
showChooseList
();
},
},
//点击多规格商品的减按钮,弹出提示
//点击多规格商品的减按钮,弹出提示
...
@@ -180,7 +180,7 @@
...
@@ -180,7 +180,7 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../style/mixin
.scss
'
;
@import
'../../style/mixin'
;
.cart_module
{
.cart_module
{
.cart_button
{
.cart_button
{
display
:
flex
;
display
:
flex
;
...
...
src/components/common/loading.vue
浏览文件 @
734f742c
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../style/mixin
.scss
'
;
@import
'../../style/mixin'
;
@keyframes
load
{
@keyframes
load
{
0
%
{
transform
:
translateY
(
0px
);}
0
%
{
transform
:
translateY
(
0px
);}
50
%
{
transform
:
translateY
(
-50px
);}
50
%
{
transform
:
translateY
(
-50px
);}
...
...
src/components/common/ratingStar.vue
浏览文件 @
734f742c
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../style/mixin
.scss
'
;
@import
'../../style/mixin'
;
.rating_container
{
.rating_container
{
position
:
relative
;
position
:
relative
;
@include
wh
(
2rem
,
.4rem
);
@include
wh
(
2rem
,
.4rem
);
...
...
src/components/common/shoplist.vue
浏览文件 @
734f742c
...
@@ -148,7 +148,7 @@ export default {
...
@@ -148,7 +148,7 @@ export default {
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../style/mixin
.scss
'
;
@import
'../../style/mixin'
;
.shoplist_container
{
.shoplist_container
{
background-color
:
#fff
;
background-color
:
#fff
;
}
}
...
...
src/components/header/head.vue
浏览文件 @
734f742c
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../style/mixin
.scss
'
;
@import
'../../style/mixin'
;
#head_top
{
#head_top
{
background-color
:
$blue
;
background-color
:
$blue
;
...
...
src/images/address_bottom.png
0 → 100644
浏览文件 @
734f742c
290 字节
src/page/confirmOrder/confirmOrder.vue
浏览文件 @
734f742c
<
template
>
<
template
>
<div>
<div
class=
"confirmOrderContainer"
>
<head-top
head-title=
"确认订单"
goBack=
"true"
></head-top>
<section
v-if=
"!showLoading"
>
<div
class=
"confirmOrderContainer"
>
确认订单页
</div>
<head-top
head-title=
"确认订单"
goBack=
"true"
signin-up=
'confirmOrder'
></head-top>
<section
class=
"address_container"
>
<div
class=
"address_empty_left"
>
<svg
class=
"location_icon"
>
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#location"
></use>
</svg>
<span
class=
"add_address"
>
请添加一个收获地址
</span>
</div>
<svg
class=
"address_empty_right"
>
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#arrow-right"
></use>
</svg>
</section>
<section
class=
"delivery_model container_style"
>
<p
class=
"deliver_text"
>
送达时间
</p>
<section
class=
"deliver_time"
>
<p>
尽快送达 | 预计
{{
checkoutData
.
delivery_reach_time
}}
</p>
<p
v-if=
"checkoutData.cart.is_deliver_by_fengniao"
>
蜂鸟专送
</p>
</section>
</section>
<section
class=
"pay_way container_style"
>
<header
class=
"header_style"
>
<span>
支付方式
</span>
<div
class=
"more_type"
>
<span>
在线支付
</span>
<svg
class=
"address_empty_right"
>
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#arrow-right"
></use>
</svg>
</div>
</header>
<section
class=
"hongbo"
>
<span>
红包
</span>
<span>
暂时只在饿了么 APP 中支持
</span>
</section>
</section>
<section
class=
"food_list"
>
<header>
<img
:src=
"imgBaseUrl + checkoutData.cart.restaurant_info.image_path"
>
<span>
{{
checkoutData
.
cart
.
restaurant_info
.
name
}}
</span>
</header>
<ul
class=
"food_list_ul"
>
<li
v-for=
"item in checkoutData.cart.groups[0]"
:key=
"item.id"
class=
"food_item_style"
>
<p
class=
"food_name ellipsis"
>
{{
item
.
name
}}
</p>
<div
class=
"num_price"
>
<span>
x
{{
item
.
quantity
}}
</span>
<span>
¥
{{
item
.
price
}}
</span>
</div>
</li>
</ul>
<div
class=
"food_item_style"
>
<p
class=
"food_name ellipsis"
>
{{
checkoutData
.
cart
.
extra
[
0
].
name
}}
</p>
<div
class=
"num_price"
>
<span></span>
<span>
¥
{{
checkoutData
.
cart
.
extra
[
0
].
price
}}
</span>
</div>
</div>
<div
class=
"food_item_style total_price"
>
<p
class=
"food_name ellipsis"
>
订单 ¥
{{
checkoutData
.
cart
.
total
}}
</p>
<div
class=
"num_price"
>
<span></span>
<span>
待支付 ¥
{{
checkoutData
.
cart
.
total
}}
</span>
</div>
</div>
</section>
<section
class=
"pay_way container_style"
>
<header
class=
"header_style"
>
<span>
订单备注
</span>
<div
class=
"more_type"
>
<span>
口味偏、好等
</span>
<svg
class=
"address_empty_right"
>
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#arrow-right"
></use>
</svg>
</div>
</header>
<section
class=
"hongbo"
>
<span>
发票抬头
</span>
<span>
商家不支持开发票
</span>
</section>
</section>
<section
class=
"confrim_order"
>
<p>
待支付 ¥
{{
checkoutData
.
cart
.
total
}}
</p>
<p>
确认下单
</p>
</section>
<transition
name=
"fade"
>
<div></div>
</transition>
</section>
<loading
v-if=
"showLoading"
></loading>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
mapState
,
mapMutations
}
from
'
vuex
'
import
headTop
from
'
../../components/header/head
'
import
headTop
from
'
../../components/header/head
'
import
alertTip
from
'
../../components/common/alertTip
'
import
loading
from
'
../../components/common/loading
'
import
{
checkout
}
from
'
../../service/getData
'
import
{
imgBaseUrl
}
from
'
../../config/env
'
export
default
{
export
default
{
data
(){
data
(){
return
{
return
{
geohash
:
''
,
//geohash位置信息
shopId
:
null
,
//商店id值
showLoading
:
true
,
checkoutData
:
null
,
shopCart
:
null
,
imgBaseUrl
,
}
}
},
},
created
(){
//获取上个页面传递过来的geohash值
this
.
geohash
=
this
.
$route
.
query
.
geohash
;
//获取上个页面传递过来的shopid值
this
.
shopId
=
this
.
$route
.
query
.
shopId
;
this
.
INIT_BUYCART
();
this
.
shopCart
=
this
.
cartList
[
this
.
shopId
];
},
mounted
(){
this
.
initData
();
},
components
:
{
components
:
{
headTop
,
headTop
,
alertTip
,
loading
,
},
computed
:
{
...
mapState
([
'
cartList
'
]),
},
},
methods
:
{
...
mapMutations
([
'
INIT_BUYCART
'
]),
async
initData
(){
let
newArr
=
new
Array
;
Object
.
values
(
this
.
shopCart
).
forEach
(
categoryItem
=>
{
Object
.
values
(
categoryItem
).
forEach
(
itemValue
=>
{
Object
.
values
(
itemValue
).
forEach
(
item
=>
{
newArr
.
push
({
attrs
:
[],
extra
:
{},
id
:
item
.
id
,
name
:
item
.
name
,
packing_fee
:
item
.
packing_fee
,
price
:
item
.
price
,
quantity
:
item
.
num
,
sku_id
:
item
.
sku_id
,
specs
:
[
item
.
specs
],
stock
:
item
.
stock
,
})
})
})
})
this
.
checkoutData
=
await
checkout
(
this
.
geohash
,
[
newArr
]);
this
.
showLoading
=
false
;
},
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../style/mixin
.scss
'
;
@import
'../../style/mixin'
;
.confirmOrderContainer
{
.confirmOrderContainer
{
padding-top
:
1
.95rem
;
padding-top
:
1
.95rem
;
padding-bottom
:
3rem
;
p
,
span
{
font-family
:
Helvetica
Neue
,
Tahoma
,
Arial
;
}
}
.container_style
{
background-color
:
#fff
;
margin-top
:
.4rem
;
padding
:
0
.7rem
;
}
.address_container
{
min-height
:
3
.5rem
;
@include
fj
;
align-items
:
center
;
padding
:
0
0
.6rem
;
background
:
url(../../images/address_bottom.png)
left
bottom
repeat-x
;
background-color
:
#fff
;
background-size
:
auto
.12rem
;
.address_empty_left
{
display
:
flex
;
align-items
:
center
;
.location_icon
{
@include
wh
(
.8rem
,
.8rem
);
fill
:
$blue
;
margin-right
:
.2rem
;
}
.add_address
{
@include
sc
(
.7rem
,
#333
);
}
}
.address_empty_right
{
@include
wh
(
.6rem
,
.6rem
);
fill
:
#999
;
}
}
.delivery_model
{
border-left
:
.2rem
solid
$blue
;
min-height
:
4rem
;
@include
fj
;
align-items
:
center
;
.deliver_text
{
@include
sc
(
.8rem
,
#333
);
font-weight
:
bold
;
padding-left
:
.3rem
;
}
.deliver_time
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
flex-end
;
p
:nth-of-type
(
1
)
{
@include
sc
(
.7rem
,
$blue
);
}
p
:nth-of-type
(
2
)
{
@include
sc
(
.5rem
,
#fff
);
background-color
:
$blue
;
width
:
2
.4rem
;
margin-top
:
.5rem
;
text-align
:
center
;
border-radius
:
0
.12rem
;
padding
:
.1rem
;
}
}
}
.pay_way
{
.header_style
{
@include
fj
;
line-height
:
2rem
;
span
:nth-of-type
(
1
)
{
@include
sc
(
.7rem
,
#666
);
}
.more_type
{
span
:nth-of-type
(
1
)
{
@include
sc
(
.6rem
,
#aaa
);
}
svg
{
@include
wh
(
.5rem
,
.5rem
);
fill
:
#ccc
;
}
}
}
.hongbo
{
@include
fj
;
border-top
:
0
.025rem
solid
#f5f5f5
;
span
{
@include
sc
(
.6rem
,
#ccc
);
line-height
:
2rem
;
}
}
}
.food_list
{
background-color
:
#fff
;
margin-top
:
.4rem
;
header
{
padding
:
.7rem
;
border-bottom
:
0
.025rem
solid
#f5f5f5
;
img
{
@include
wh
(
1
.2rem
,
1
.2rem
);
vertical-align
:
middle
;
}
span
{
@include
sc
(
.8rem
,
#333
);
}
}
.food_list_ul
{
padding-top
:
.5rem
;
}
.food_item_style
{
@include
fj
;
line-height
:
1
.8rem
;
padding
:
0
.7rem
;
span
,
p
{
@include
sc
(
.65rem
,
#666
);
}
.food_name
{
width
:
11rem
;
}
.num_price
{
flex
:
1
;
@include
fj
;
span
:nth-of-type
(
2
)
{
color
:
#f60
;
}
}
}
.total_price
{
border-top
:
0
.025rem
solid
#f5f5f5
;
}
}
.confrim_order
{
display
:
flex
;
position
:
fixed
;
bottom
:
0
;
width
:
100%
;
height
:
2rem
;
p
{
line-height
:
2rem
;
@include
sc
(
.75rem
,
#fff
);
}
p
:nth-of-type
(
1
)
{
background-color
:
#3c3c3c
;
flex
:
5
;
padding-left
:
.7rem
;
}
p
:nth-of-type
(
2
)
{
flex
:
2
;
background-color
:
#56d176
;
text-align
:
center
;
}
}
.fade-enter-active
,
.fade-leave-active
{
transition
:
opacity
.5s
;
}
.fade-enter
,
.fade-leave-active
{
opacity
:
0
;
}
}
</
style
>
</
style
>
src/page/forget/forget.vue
浏览文件 @
734f742c
...
@@ -123,7 +123,7 @@
...
@@ -123,7 +123,7 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../style/mixin
.scss
'
;
@import
'../../style/mixin'
;
.restContainer
{
.restContainer
{
padding-top
:
1
.95rem
;
padding-top
:
1
.95rem
;
...
...
src/page/login/login.vue
浏览文件 @
734f742c
...
@@ -176,7 +176,7 @@
...
@@ -176,7 +176,7 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../style/mixin
.scss
'
;
@import
'../../style/mixin'
;
.loginContainer
{
.loginContainer
{
padding-top
:
1
.95rem
;
padding-top
:
1
.95rem
;
...
...
src/page/profile/children/balance.vue
浏览文件 @
734f742c
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../../style/mixin
.scss
'
;
@import
'../../../style/mixin'
;
.rating_page
{
.rating_page
{
position
:
absolute
;
position
:
absolute
;
...
...
src/page/profile/children/benefit.vue
浏览文件 @
734f742c
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../../style/mixin
.scss
'
;
@import
'../../../style/mixin'
;
.rating_page
{
.rating_page
{
position
:
absolute
;
position
:
absolute
;
...
...
src/page/profile/children/info.vue
浏览文件 @
734f742c
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../../style/mixin
.scss
'
;
@import
'../../../style/mixin'
;
.rating_page
{
.rating_page
{
position
:
absolute
;
position
:
absolute
;
...
...
src/page/profile/children/points.vue
浏览文件 @
734f742c
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../../style/mixin
.scss
'
;
@import
'../../../style/mixin'
;
.rating_page
{
.rating_page
{
position
:
absolute
;
position
:
absolute
;
...
...
src/page/profile/children/service.vue
浏览文件 @
734f742c
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../../style/mixin
.scss
'
;
@import
'../../../style/mixin'
;
.rating_page
{
.rating_page
{
position
:
absolute
;
position
:
absolute
;
...
...
src/page/search/search.vue
浏览文件 @
734f742c
...
@@ -142,7 +142,7 @@ export default {
...
@@ -142,7 +142,7 @@ export default {
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../style/mixin
.scss
'
;
@import
'../../style/mixin'
;
.search_form
{
.search_form
{
background-color
:
#fff
;
background-color
:
#fff
;
...
...
src/page/shop/children/foodDetail.vue
浏览文件 @
734f742c
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../../style/mixin
.scss
'
;
@import
'../../../style/mixin'
;
.rating_page
{
.rating_page
{
position
:
absolute
;
position
:
absolute
;
...
...
src/page/shop/children/shopDetail.vue
浏览文件 @
734f742c
...
@@ -110,7 +110,7 @@
...
@@ -110,7 +110,7 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../../style/mixin
.scss
'
;
@import
'../../../style/mixin'
;
.rating_page
{
.rating_page
{
position
:
absolute
;
position
:
absolute
;
...
...
src/page/shop/children/shopSafe.vue
浏览文件 @
734f742c
...
@@ -128,7 +128,7 @@
...
@@ -128,7 +128,7 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../../style/mixin
.scss
'
;
@import
'../../../style/mixin'
;
.safe_shop
{
.safe_shop
{
position
:
absolute
;
position
:
absolute
;
...
...
src/page/shop/shop.vue
浏览文件 @
734f742c
...
@@ -140,7 +140,7 @@
...
@@ -140,7 +140,7 @@
</section>
</section>
<section
class=
"gotopay"
:class=
"
{gotopay_acitvity: minimumOrderAmount
<
0}"
>
<section
class=
"gotopay"
:class=
"
{gotopay_acitvity: minimumOrderAmount
<
0}"
>
<span
class=
"gotopay_button_style"
v-if=
"minimumOrderAmount > 0"
>
还差¥
{{
minimumOrderAmount
}}
起送
</span>
<span
class=
"gotopay_button_style"
v-if=
"minimumOrderAmount > 0"
>
还差¥
{{
minimumOrderAmount
}}
起送
</span>
<router-link
to=
"/confirmOrder
"
class=
"gotopay_button_style"
v-else
>
去结算
</router-link>
<router-link
:to=
"
{path:'/confirmOrder', query:{geohash, shopId}}
" class="gotopay_button_style" v-else >去结算
</router-link>
</section>
</section>
</section>
</section>
<transition
name=
"toggle-cart"
>
<transition
name=
"toggle-cart"
>
...
@@ -253,7 +253,6 @@
...
@@ -253,7 +253,6 @@
<
script
>
<
script
>
import
{
mapState
,
mapMutations
}
from
'
vuex
'
import
{
mapState
,
mapMutations
}
from
'
vuex
'
import
{
imgBaseUrl
}
from
'
../../config/env
'
import
{
msiteAdress
,
shopDetails
,
foodMenu
,
getRatingList
,
ratingScores
,
ratingTags
}
from
'
../../service/getData
'
import
{
msiteAdress
,
shopDetails
,
foodMenu
,
getRatingList
,
ratingScores
,
ratingTags
}
from
'
../../service/getData
'
import
loading
from
'
../../components/common/loading
'
import
loading
from
'
../../components/common/loading
'
import
buyCart
from
'
../../components/common/buyCart
'
import
buyCart
from
'
../../components/common/buyCart
'
...
@@ -556,7 +555,7 @@
...
@@ -556,7 +555,7 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../style/mixin
.scss
'
;
@import
'../../style/mixin'
;
@keyframes
mymove
{
@keyframes
mymove
{
0
%
{
transform
:
scale
(
1
)
}
0
%
{
transform
:
scale
(
1
)
}
25
%
{
transform
:
scale
(
.8
)
}
25
%
{
transform
:
scale
(
.8
)
}
...
...
src/service/getData.js
浏览文件 @
734f742c
...
@@ -6,6 +6,7 @@ import * as search from './tempdata/search'
...
@@ -6,6 +6,7 @@ import * as search from './tempdata/search'
import
*
as
food
from
'
./tempdata/food
'
import
*
as
food
from
'
./tempdata/food
'
import
*
as
shop
from
'
./tempdata/shop
'
import
*
as
shop
from
'
./tempdata/shop
'
import
*
as
login
from
'
./tempdata/login
'
import
*
as
login
from
'
./tempdata/login
'
import
*
as
confirm
from
'
./tempdata/confirm
'
/**
/**
* 获取首页默认地址
* 获取首页默认地址
...
@@ -120,16 +121,16 @@ export const foodActivity = (latitude, longitude) => fetch('GET', '/shopping/v1/
...
@@ -120,16 +121,16 @@ export const foodActivity = (latitude, longitude) => fetch('GET', '/shopping/v1/
/**
/**
* 获取shop页面商铺详情
* 获取shop页面商铺详情
*/
*/
export
const
shopDetails
=
(
shopid
,
latitude
,
longitude
)
=>
fetch
(
'
GET
'
,
'
/shopping/restaurant/
'
+
shopid
,
{
//
export const shopDetails = (shopid, latitude, longitude) => fetch('GET', '/shopping/restaurant/' + shopid, {
latitude
,
//
latitude,
longitude
:
longitude
+
'
&extras[]=activities&extras[]=album&extras[]=license&extras[]=identification&extras[]=statistics
'
//
longitude: longitude + '&extras[]=activities&extras[]=album&extras[]=license&extras[]=identification&extras[]=statistics'
});
//
});
/**
/**
* 获取food页面的商家属性活动列表
* 获取food页面的商家属性活动列表
*/
*/
export
const
foodMenu
=
restaurant_id
=>
fetch
(
'
GET
'
,
'
/shopping/v2/menu
'
,
{
//
export const foodMenu = restaurant_id => fetch('GET', '/shopping/v2/menu', {
restaurant_id
//
restaurant_id
});
//
});
/**
/**
* 获取商铺评价列表
* 获取商铺评价列表
*/
*/
...
@@ -150,11 +151,11 @@ export const ratingTags = shopid => fetch('GET', '/ugc/v2/restaurants/' + shopid
...
@@ -150,11 +151,11 @@ export const ratingTags = shopid => fetch('GET', '/ugc/v2/restaurants/' + shopid
/**
/**
* 获取短信验证码
* 获取短信验证码
*/
*/
export
const
mobileCode
=
phone
=>
fetch
(
'
POST
'
,
'
/v4/mobile/verify_code/send
'
,
{
//
export const mobileCode = phone => fetch('POST', '/v4/mobile/verify_code/send', {
mobile
:
phone
,
//
mobile: phone,
scene
:
'
login
'
,
//
scene: 'login',
type
:
'
sms
'
//
type: 'sms'
});
//
});
/**
/**
* 手机号登陆
* 手机号登陆
*/
*/
...
@@ -170,21 +171,30 @@ export const getcaptchas = () => fetch('POST', '/v1/captchas', {});
...
@@ -170,21 +171,30 @@ export const getcaptchas = () => fetch('POST', '/v1/captchas', {});
/**
/**
* 检测帐号是否存在
* 检测帐号是否存在
*/
*/
export
const
checkExsis
=
(
checkNumber
,
type
)
=>
fetch
(
'
GET
'
,
'
/v1/users/exists
'
,
{
//
export const checkExsis = (checkNumber, type) => fetch('GET', '/v1/users/exists', {
[
type
]:
checkNumber
,
//
[type]: checkNumber,
type
//
type
});
//
});
/**
/**
* 发送帐号
* 发送帐号
*/
*/
export
const
sendMobile
=
(
sendData
,
captcha_code
,
type
,
password
)
=>
fetch
(
'
POST
'
,
'
/v1/mobile/verify_code/send
'
,
{
// export const sendMobile = (sendData, captcha_code, type, password) => fetch('POST', '/v1/mobile/verify_code/send', {
action
:
"
send
"
,
// action: "send",
captcha_code
,
// captcha_code,
[
type
]:
sendData
,
// [type]: sendData,
type
:
"
sms
"
,
// type: "sms",
way
:
type
,
// way: type,
password
,
// password,
});
// });
/**
* 确认订单
*/
// export const checkout = (geohash, entities) => fetch('POST', '/v1/carts/checkout', {
// come_from: "web",
// geohash,
// entities,
// });
...
@@ -209,11 +219,14 @@ const setpromise = data => {
...
@@ -209,11 +219,14 @@ const setpromise = data => {
// export const foodCategory = (latitude, longitude) => setpromise(food.category);
// export const foodCategory = (latitude, longitude) => setpromise(food.category);
// export const foodDelivery = (latitude, longitude) => setpromise(food.delivery);
// export const foodDelivery = (latitude, longitude) => setpromise(food.delivery);
// export const foodActivity = (latitude, longitude) => setpromise(food.activity);
// export const foodActivity = (latitude, longitude) => setpromise(food.activity);
//
export const shopDetails = (shopid, latitude, longitude) => setpromise(shop.shopDetails);
export
const
shopDetails
=
(
shopid
,
latitude
,
longitude
)
=>
setpromise
(
shop
.
shopDetails
);
//
export const foodMenu = restaurant_id => setpromise(shop.shopMenu);
export
const
foodMenu
=
restaurant_id
=>
setpromise
(
shop
.
shopMenu
);
// export const getRatingList = (offset, tag_name = '') => setpromise(shop.ratingList);
// export const getRatingList = (offset, tag_name = '') => setpromise(shop.ratingList);
// export const ratingScores = shopid => setpromise(shop.scores);
// export const ratingScores = shopid => setpromise(shop.scores);
// export const ratingTags = shopid => setpromise(shop.tage);
// export const ratingTags = shopid => setpromise(shop.tage);
//
export const mobileCode = phone => setpromise(login.validate_token);
export
const
mobileCode
=
phone
=>
setpromise
(
login
.
validate_token
);
export
const
sendLogin
=
(
code
,
mobile
,
validate_token
)
=>
setpromise
(
login
.
userInfo
);
export
const
sendLogin
=
(
code
,
mobile
,
validate_token
)
=>
setpromise
(
login
.
userInfo
);
export
const
accountLogin
=
(
username
,
password
,
captcha_code
)
=>
setpromise
(
login
.
userInfo
);
export
const
accountLogin
=
(
username
,
password
,
captcha_code
)
=>
setpromise
(
login
.
userInfo
);
\ No newline at end of file
export
const
checkExsis
=
(
checkNumber
,
type
)
=>
setpromise
(
login
.
checkExsis
);
export
const
sendMobile
=
(
sendData
,
captcha_code
,
type
,
password
)
=>
setpromise
(
login
.
send
);
export
const
checkout
=
(
geohash
,
entities
)
=>
setpromise
(
confirm
.
checkout
);
\ No newline at end of file
src/service/tempdata/confirm.js
0 → 100644
浏览文件 @
734f742c
此差异已折叠。
点击以展开。
src/service/tempdata/login.js
浏览文件 @
734f742c
...
@@ -26,4 +26,14 @@ export const userInfo = {
...
@@ -26,4 +26,14 @@ export const userInfo = {
"
point
"
:
960
,
"
point
"
:
960
,
"
user_id
"
:
109065163
,
"
user_id
"
:
109065163
,
"
username
"
:
"
cangdu
"
"
username
"
:
"
cangdu
"
};
export
const
checkExsis
=
{
"
message
"
:
"
\
u8bf7
\
u68c0
\
u67e5
\
u624b
\
u673a
\
u53f7
\
u7801
\
u683c
\
u5f0f
\
u662f
\
u5426
\
u6709
\
u8bef
"
,
"
name
"
:
"
VALIDATION_FAILED
"
};
export
const
send
=
{
"
message
"
:
"
\
u9a8c
\
u8bc1
\
u7801
\
u9519
\
u8bef
\
uff0c
\
u8bf7
\
u91cd
\
u65b0
\
u586b
\
u5199
"
,
"
name
"
:
"
CAPTCHA_CODE_ERROR
"
};
};
\ No newline at end of file
src/store/mutations.js
浏览文件 @
734f742c
import
{
RECORD_ADDRESS
,
ADD_CART
,
REDUCE_CART
,
INIT_BUYCART
,
CLEAR_CART
,
RECORD_SHOPDETAIL
,
RECORD_USERINFO
,
GET_USERINFO
}
from
'
./mutation-types.js
'
import
{
import
{
setStore
,
getStore
}
from
'
../config/mUtils
'
RECORD_ADDRESS
,
ADD_CART
,
REDUCE_CART
,
INIT_BUYCART
,
CLEAR_CART
,
RECORD_SHOPDETAIL
,
RECORD_USERINFO
,
GET_USERINFO
,
}
from
'
./mutation-types.js
'
import
{
setStore
,
getStore
,
}
from
'
../config/mUtils
'
export
default
{
export
default
{
// 记录当前经度纬度
// 记录当前经度纬度
[
RECORD_ADDRESS
]
(
state
,
{
latitude
,
longitude
})
{
[
RECORD_ADDRESS
](
state
,
{
latitude
,
longitude
})
{
state
.
latitude
=
latitude
;
state
.
latitude
=
latitude
;
state
.
longitude
=
longitude
;
state
.
longitude
=
longitude
;
},
},
[
RECORD_SHOPDETAIL
](
state
,
detail
){
[
RECORD_SHOPDETAIL
](
state
,
detail
)
{
state
.
shopDetail
=
detail
;
state
.
shopDetail
=
detail
;
},
},
// 加入购物车
// 加入购物车
[
ADD_CART
]
(
state
,
{
shopid
,
category_id
,
item_id
,
food_id
,
name
,
price
,
specs
})
{
[
ADD_CART
](
state
,
{
shopid
,
category_id
,
item_id
,
food_id
,
name
,
price
,
specs
,
packing_fee
,
sku_id
,
stock
})
{
let
cart
=
state
.
cartList
;
let
cart
=
state
.
cartList
;
if
(
cart
[
shopid
]
&&
cart
[
shopid
][
category_id
]
&&
cart
[
shopid
][
category_id
][
item_id
]
&&
cart
[
shopid
][
category_id
][
item_id
][
food_id
])
{
if
(
cart
[
shopid
]
&&
cart
[
shopid
][
category_id
]
&&
cart
[
shopid
][
category_id
][
item_id
]
&&
cart
[
shopid
][
category_id
][
item_id
][
food_id
])
{
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
num
'
]
++
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
num
'
]
++
;
}
else
if
(
cart
[
shopid
]
&&
cart
[
shopid
][
category_id
]
&&
cart
[
shopid
][
category_id
][
item_id
])
{
}
else
if
(
cart
[
shopid
]
&&
cart
[
shopid
][
category_id
]
&&
cart
[
shopid
][
category_id
][
item_id
])
{
cart
[
shopid
][
category_id
][
item_id
][
food_id
]
=
{};
cart
[
shopid
][
category_id
][
item_id
][
food_id
]
=
{};
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
num
'
]
=
1
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
num
'
]
=
1
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
id
'
]
=
food_id
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
name
'
]
=
name
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
name
'
]
=
name
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
price
'
]
=
price
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
price
'
]
=
price
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
specs
'
]
=
specs
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
specs
'
]
=
specs
;
}
else
if
(
cart
[
shopid
]
&&
cart
[
shopid
][
category_id
]){
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
packing_fee
'
]
=
packing_fee
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
sku_id
'
]
=
sku_id
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
stock
'
]
=
stock
;
}
else
if
(
cart
[
shopid
]
&&
cart
[
shopid
][
category_id
])
{
cart
[
shopid
][
category_id
][
item_id
]
=
{};
cart
[
shopid
][
category_id
][
item_id
]
=
{};
cart
[
shopid
][
category_id
][
item_id
][
food_id
]
=
{};
cart
[
shopid
][
category_id
][
item_id
][
food_id
]
=
{};
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
num
'
]
=
1
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
num
'
]
=
1
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
id
'
]
=
food_id
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
name
'
]
=
name
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
name
'
]
=
name
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
price
'
]
=
price
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
price
'
]
=
price
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
specs
'
]
=
specs
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
specs
'
]
=
specs
;
}
else
if
(
cart
[
shopid
]){
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
packing_fee
'
]
=
packing_fee
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
sku_id
'
]
=
sku_id
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
stock
'
]
=
stock
;
}
else
if
(
cart
[
shopid
])
{
cart
[
shopid
][
category_id
]
=
{};
cart
[
shopid
][
category_id
]
=
{};
cart
[
shopid
][
category_id
][
item_id
]
=
{};
cart
[
shopid
][
category_id
][
item_id
]
=
{};
cart
[
shopid
][
category_id
][
item_id
][
food_id
]
=
{};
cart
[
shopid
][
category_id
][
item_id
][
food_id
]
=
{};
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
num
'
]
=
1
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
num
'
]
=
1
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
id
'
]
=
food_id
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
name
'
]
=
name
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
name
'
]
=
name
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
price
'
]
=
price
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
price
'
]
=
price
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
specs
'
]
=
specs
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
specs
'
]
=
specs
;
}
else
{
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
packing_fee
'
]
=
packing_fee
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
sku_id
'
]
=
sku_id
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
stock
'
]
=
stock
;
}
else
{
cart
[
shopid
]
=
{};
cart
[
shopid
]
=
{};
cart
[
shopid
][
category_id
]
=
{};
cart
[
shopid
][
category_id
]
=
{};
cart
[
shopid
][
category_id
][
item_id
]
=
{};
cart
[
shopid
][
category_id
][
item_id
]
=
{};
cart
[
shopid
][
category_id
][
item_id
][
food_id
]
=
{};
cart
[
shopid
][
category_id
][
item_id
][
food_id
]
=
{};
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
num
'
]
=
1
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
num
'
]
=
1
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
id
'
]
=
food_id
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
name
'
]
=
name
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
name
'
]
=
name
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
price
'
]
=
price
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
price
'
]
=
price
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
specs
'
]
=
specs
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
specs
'
]
=
specs
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
packing_fee
'
]
=
packing_fee
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
sku_id
'
]
=
sku_id
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
stock
'
]
=
stock
;
}
}
//返回一个新的对象,否则计算属性无法监听到数据的变化
//返回一个新的对象,否则计算属性无法监听到数据的变化
state
.
cartList
=
Object
.
assign
({},
cart
);
state
.
cartList
=
Object
.
assign
({},
cart
);
...
@@ -52,39 +95,49 @@ export default {
...
@@ -52,39 +95,49 @@ export default {
setStore
(
'
buyCart
'
,
state
.
cartList
);
setStore
(
'
buyCart
'
,
state
.
cartList
);
},
},
// 移出购物车
// 移出购物车
[
REDUCE_CART
]
(
state
,
{
shopid
,
category_id
,
item_id
,
food_id
,
name
,
price
,
specs
})
{
[
REDUCE_CART
](
state
,
{
shopid
,
category_id
,
item_id
,
food_id
,
name
,
price
,
specs
})
{
let
cart
=
state
.
cartList
;
let
cart
=
state
.
cartList
;
if
(
cart
[
shopid
]
&&
cart
[
shopid
][
category_id
]
&&
cart
[
shopid
][
category_id
][
item_id
]
&&
cart
[
shopid
][
category_id
][
item_id
][
food_id
])
{
if
(
cart
[
shopid
]
&&
cart
[
shopid
][
category_id
]
&&
cart
[
shopid
][
category_id
][
item_id
]
&&
cart
[
shopid
][
category_id
][
item_id
][
food_id
])
{
if
(
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
num
'
]
>
0
)
{
if
(
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
num
'
]
>
0
)
{
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
num
'
]
--
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
][
'
num
'
]
--
;
//返回一个新的对象,否则计算属性无法监听到数据的变化
//返回一个新的对象,否则计算属性无法监听到数据的变化
state
.
cartList
=
Object
.
assign
({},
cart
);
state
.
cartList
=
Object
.
assign
({},
cart
);
//存入localStorage
//存入localStorage
setStore
(
'
buyCart
'
,
state
.
cartList
);
setStore
(
'
buyCart
'
,
state
.
cartList
);
}
else
{
}
else
{
//商品数量为0,则清空当前商品的信息
//商品数量为0,则清空当前商品的信息
cart
[
shopid
][
category_id
][
item_id
][
food_id
]
=
null
;
cart
[
shopid
][
category_id
][
item_id
][
food_id
]
=
null
;
}
}
}
}
},
},
//网页初始化时从本地缓存获取购物车数据
//网页初始化时从本地缓存获取购物车数据
[
INIT_BUYCART
](
state
){
[
INIT_BUYCART
](
state
)
{
let
initCart
=
getStore
(
'
buyCart
'
);
let
initCart
=
getStore
(
'
buyCart
'
);
if
(
initCart
)
{
if
(
initCart
)
{
state
.
cartList
=
JSON
.
parse
(
initCart
);
state
.
cartList
=
JSON
.
parse
(
initCart
);
}
}
},
},
//清空当前商品的购物车信息
//清空当前商品的购物车信息
[
CLEAR_CART
](
state
,
shopid
)
{
[
CLEAR_CART
](
state
,
shopid
)
{
state
.
cartList
[
shopid
]
=
null
;
state
.
cartList
[
shopid
]
=
null
;
state
.
cartList
=
Object
.
assign
({},
state
.
cartList
);
state
.
cartList
=
Object
.
assign
({},
state
.
cartList
);
setStore
(
'
buyCart
'
,
state
.
cartList
);
setStore
(
'
buyCart
'
,
state
.
cartList
);
},
},
[
RECORD_USERINFO
](
state
,
info
){
[
RECORD_USERINFO
](
state
,
info
)
{
state
.
userInfo
=
info
;
state
.
userInfo
=
info
;
setStore
(
'
useInfo
'
,
info
);
setStore
(
'
useInfo
'
,
info
);
},
},
[
GET_USERINFO
](
state
){
[
GET_USERINFO
](
state
)
{
let
info
=
getStore
(
'
useInfo
'
);
let
info
=
getStore
(
'
useInfo
'
);
if
(
info
)
{
if
(
info
)
{
state
.
userInfo
=
JSON
.
parse
(
info
);
state
.
userInfo
=
JSON
.
parse
(
info
);
...
...
src/style/common.
sc
ss
→
src/style/common.
le
ss
浏览文件 @
734f742c
文件已移动
src/style/mixin.
sc
ss
→
src/style/mixin.
le
ss
浏览文件 @
734f742c
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录