Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
momo的小宝贝
vue2-elm
提交
b6a87f72
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,发现更多精彩内容 >>
提交
b6a87f72
编写于
2月 19, 2017
作者:
M
maguohua
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
confrim
上级
a8df5a43
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
1131 addition
and
107 deletion
+1131
-107
README.md
README.md
+11
-4
src/components/common/alertTip.vue
src/components/common/alertTip.vue
+1
-1
src/components/header/head.vue
src/components/header/head.vue
+7
-5
src/config/fetch.js
src/config/fetch.js
+16
-14
src/images/add_address.png
src/images/add_address.png
+0
-0
src/images/add_phone.png
src/images/add_phone.png
+0
-0
src/images/search.png
src/images/search.png
+0
-0
src/page/confirmOrder/children/children/addAddress.vue
src/page/confirmOrder/children/children/addAddress.vue
+213
-0
src/page/confirmOrder/children/children/children/searchAddress.vue
...confirmOrder/children/children/children/searchAddress.vue
+118
-0
src/page/confirmOrder/children/chooseAddress.vue
src/page/confirmOrder/children/chooseAddress.vue
+224
-0
src/page/confirmOrder/children/invoice.vue
src/page/confirmOrder/children/invoice.vue
+87
-0
src/page/confirmOrder/confirmOrder.vue
src/page/confirmOrder/confirmOrder.vue
+87
-18
src/page/login/login.vue
src/page/login/login.vue
+1
-1
src/page/shop/children/children/shopSafe.vue
src/page/shop/children/children/shopSafe.vue
+6
-5
src/router/router.js
src/router/router.js
+54
-23
src/service/getData.js
src/service/getData.js
+53
-13
src/service/tempdata/confirm.js
src/service/tempdata/confirm.js
+186
-1
src/service/tempdata/login.js
src/service/tempdata/login.js
+7
-7
src/store/action.js
src/store/action.js
+13
-7
src/store/index.js
src/store/index.js
+6
-1
src/store/mutation-types.js
src/store/mutation-types.js
+5
-1
src/store/mutations.js
src/store/mutations.js
+36
-6
未找到文件。
README.md
浏览文件 @
b6a87f72
...
@@ -66,7 +66,13 @@ vue2 + vue-rotuer2 + vuex + webpack + ES6/7 + fetch + sass + flex + svg + http-p
...
@@ -66,7 +66,13 @@ vue2 + vue-rotuer2 + vuex + webpack + ES6/7 + fetch + sass + flex + svg + http-p
| |-- city // 当前城市页
| |-- city // 当前城市页
| |-- food // 食品筛选排序页
| |-- food // 食品筛选排序页
| |-- confirmOrder // 确认订单页
| |-- confirmOrder // 确认订单页
| |--children
| |--children
| |--chooseAddress // 选择地址页
| |--children
| |--addAddress // 添加地址页
| |--children
| |--searchAddress // 搜索地址页
| |--invoice // 选择发票页
| |--remark // 订单备注页
| |--remark // 订单备注页
| |-- forget // 忘记密码,修改密码页
| |-- forget // 忘记密码,修改密码页
| |-- home // 首页
| |-- home // 首页
...
@@ -83,9 +89,10 @@ vue2 + vue-rotuer2 + vuex + webpack + ES6/7 + fetch + sass + flex + svg + http-p
...
@@ -83,9 +89,10 @@ vue2 + vue-rotuer2 + vuex + webpack + ES6/7 + fetch + sass + flex + svg + http-p
| |-- search // 搜索页
| |-- search // 搜索页
| |-- shop // 商铺筛选页
| |-- shop // 商铺筛选页
| |-- children
| |-- children
| |-- foodDetail // 单个商铺信息页
| |-- foodDetail // 单个商铺信息页
| |-- shopDetail // 商铺信息页
| |-- children
| |-- shopSafe // 商铺认证信息页
| |-- shopSafe // 商铺认证信息页
| |-- shopDetail // 商铺信息页
| |-- vipcard // vip办理页
| |-- vipcard // vip办理页
|
|
| |-- plugins // 引用的插件
| |-- plugins // 引用的插件
...
...
src/components/common/alertTip.vue
浏览文件 @
b6a87f72
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
mounted
(){
mounted
(){
},
},
props
:
[
'
showHide
'
,
'
alertText
'
],
props
:
[
'
alertText
'
],
methods
:
{
methods
:
{
closeTip
(){
closeTip
(){
this
.
$emit
(
'
closeTip
'
)
this
.
$emit
(
'
closeTip
'
)
...
...
src/components/header/head.vue
浏览文件 @
b6a87f72
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
mapState
,
map
Muta
tions
}
from
'
vuex
'
import
{
mapState
,
map
Ac
tions
}
from
'
vuex
'
export
default
{
export
default
{
data
(){
data
(){
return
{
return
{
...
@@ -33,10 +33,12 @@
...
@@ -33,10 +33,12 @@
},
},
created
(){
created
(){
//获取本地存储的用户信息
//获取本地存储的用户信息
this
.
GET_USERINFO
();
if
(
this
.
signinUp
)
{
this
.
getUserInfo
();
}
},
},
mounted
(){
mounted
(){
},
},
props
:
[
'
signinUp
'
,
'
headTitle
'
,
'
goBack
'
],
props
:
[
'
signinUp
'
,
'
headTitle
'
,
'
goBack
'
],
computed
:
{
computed
:
{
...
@@ -45,8 +47,8 @@
...
@@ -45,8 +47,8 @@
]),
]),
},
},
methods
:
{
methods
:
{
...
map
Muta
tions
([
...
map
Ac
tions
([
'
GET_USERINFO
'
,
'
getUserInfo
'
]),
]),
},
},
...
...
src/config/fetch.js
浏览文件 @
b6a87f72
import
{
baseUrl
}
from
'
./env
'
import
{
baseUrl
}
from
'
./env
'
export
default
async
(
type
=
'
GET
'
,
url
=
''
,
data
=
{}
)
=>
{
export
default
async
(
type
=
'
GET
'
,
url
=
''
,
data
=
{},
method
=
'
fetch
'
)
=>
{
type
=
type
.
toUpperCase
();
type
=
type
.
toUpperCase
();
url
=
baseUrl
+
url
;
url
=
baseUrl
+
url
;
...
@@ -16,16 +18,16 @@ export default async (type = 'GET', url = '', data = {}) => {
...
@@ -16,16 +18,16 @@ export default async (type = 'GET', url = '', data = {}) => {
}
}
}
}
if
(
window
.
fetch
)
{
if
(
window
.
fetch
&&
method
==
'
fetch
'
)
{
let
requestConfig
=
{
let
requestConfig
=
{
credentials
:
'
include
'
,
credentials
:
'
include
'
,
method
:
type
,
method
:
type
,
headers
:
{
headers
:
{
'
Accept
'
:
'
application/json
'
,
'
Accept
'
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
'
Content-Type
'
:
'
application/json
'
},
},
mode
:
"
cors
"
,
mode
:
"
cors
"
,
cache
:
"
only-if-cached
"
cache
:
"
only-if-cached
"
}
}
if
(
type
==
'
POST
'
)
{
if
(
type
==
'
POST
'
)
{
...
@@ -37,12 +39,11 @@ export default async (type = 'GET', url = '', data = {}) => {
...
@@ -37,12 +39,11 @@ export default async (type = 'GET', url = '', data = {}) => {
try
{
try
{
var
response
=
await
fetch
(
url
,
requestConfig
);
var
response
=
await
fetch
(
url
,
requestConfig
);
var
responseJson
=
await
response
.
json
();
var
responseJson
=
await
response
.
json
();
}
catch
(
error
)
{
}
catch
(
error
)
{
throw
new
Error
(
error
)
throw
new
Error
(
error
)
}
}
return
responseJson
return
responseJson
}
else
{
}
else
{
let
requestObj
;
let
requestObj
;
if
(
window
.
XMLHttpRequest
)
{
if
(
window
.
XMLHttpRequest
)
{
requestObj
=
new
XMLHttpRequest
();
requestObj
=
new
XMLHttpRequest
();
...
@@ -62,12 +63,13 @@ export default async (type = 'GET', url = '', data = {}) => {
...
@@ -62,12 +63,13 @@ export default async (type = 'GET', url = '', data = {}) => {
requestObj
.
onreadystatechange
=
()
=>
{
requestObj
.
onreadystatechange
=
()
=>
{
if
(
requestObj
.
readyState
==
4
)
{
if
(
requestObj
.
readyState
==
4
)
{
if
(
requestObj
.
status
==
200
)
{
if
(
requestObj
.
status
==
200
)
{
let
obj
=
requestObj
.
response
let
obj
=
requestObj
.
response
if
(
typeof
obj
!==
'
object
'
)
{
if
(
typeof
obj
!==
'
object
'
)
{
obj
=
JSON
.
parse
(
obj
);
obj
=
JSON
.
parse
(
obj
);
}
}
return
obj
return
obj
}
else
{
}
else
{
throw
new
Error
(
requestObj
)
throw
new
Error
(
requestObj
)
}
}
}
}
...
...
src/images/add_address.png
0 → 100644
浏览文件 @
b6a87f72
1.1 KB
src/images/add_phone.png
0 → 100644
浏览文件 @
b6a87f72
186 字节
src/images/search.png
0 → 100644
浏览文件 @
b6a87f72
1019 字节
src/page/confirmOrder/children/children/addAddress.vue
0 → 100644
浏览文件 @
b6a87f72
<
template
>
<div
class=
"address_page"
>
<head-top
head-title=
"添加地址"
go-back=
'true'
></head-top>
<section
class=
"page_text_container"
>
<section
class=
"section_list"
>
<span
class=
"section_left"
>
联系人
</span>
<section
class=
"section_right"
>
<input
type=
"text"
name=
"name"
placeholder=
"你的名字"
v-model=
"name"
class=
"input_style"
>
<div
class=
"choose_sex"
>
<span
class=
"choose_option"
>
<svg
class=
"address_empty_right"
@
click=
"chooseSex(1)"
:class=
"
{choosed: sex == 1}">
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#select"
></use>
</svg>
<span>
先生
</span>
</span>
<span
class=
"choose_option"
>
<svg
class=
"address_empty_right"
@
click=
"chooseSex(2)"
:class=
"
{choosed: sex == 2}">
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#select"
></use>
</svg>
<span>
女士
</span>
</span>
</div>
</section>
</section>
<section
class=
"section_list"
>
<span
class=
"section_left"
>
联系电话
</span>
<section
class=
"section_right"
>
<div
class=
"phone_add"
>
<input
type=
"text"
name=
"phone"
placeholder=
"你的手机号"
v-model=
"phone"
class=
"input_style"
>
<img
src=
"../../../../images/add_phone.png"
height=
"20"
width=
"20"
@
click=
"phone_bk = true"
>
</div>
<input
v-if=
"phone_bk"
type=
"text"
name=
"anntherPhoneNumber"
placeholder=
"备选电话"
v-model=
"anntherPhoneNumber"
class=
"input_style phone_bk"
>
</section>
</section>
<section
class=
"section_list"
>
<span
class=
"section_left"
>
送餐地址
</span>
<section
class=
"section_right"
>
<router-link
to=
"/confirmOrder/chooseAddress/addAddress/searchAddress"
tag=
"div"
class=
"choose_address"
>
{{
searchAddress
?
searchAddress
.
name
:
'
小区/写字楼/学校等
'
}}
</router-link>
<input
type=
"text"
name=
"address_detail"
placeholder=
"详细地址(如门牌号等)"
v-model=
"address_detail"
class=
"input_style"
>
</section>
</section>
<section
class=
"section_list"
>
<span
class=
"section_left"
>
标签
</span>
<section
class=
"section_right"
>
<input
type=
"text"
name=
"tag"
placeholder=
"无/家/学校/公司"
v-model=
"tag"
class=
"input_style"
>
</section>
</section>
</section>
<div
class=
"determine"
@
click=
"addAddress"
>
确定
</div>
<alert-tip
v-if=
"showAlert"
@
closeTip=
"showAlert = false"
:alertText=
"alertText"
></alert-tip>
<transition
name=
"router-slid"
>
<router-view></router-view>
</transition>
</div>
</
template
>
<
script
>
import
headTop
from
'
../../../../components/header/head
'
import
{
mapState
,
mapMutations
}
from
'
vuex
'
import
{
getAddress
,
getUser
,
postAddAddress
}
from
'
../../../../service/getData
'
import
alertTip
from
'
../../../../components/common/alertTip
'
export
default
{
data
(){
return
{
name
:
null
,
sex
:
1
,
phone
:
null
,
address_detail
:
null
,
tag
:
''
,
tag_type
:
1
,
phone_bk
:
false
,
anntherPhoneNumber
:
''
,
showAlert
:
false
,
alertText
:
null
,
poi_type
:
0
,
}
},
created
(){
},
components
:
{
headTop
,
alertTip
,
},
computed
:
{
...
mapState
([
'
searchAddress
'
,
'
geohash
'
,
'
userInfo
'
,
]),
},
methods
:
{
...
mapMutations
([
]),
chooseSex
(
sex
){
this
.
sex
=
sex
;
},
async
addAddress
(){
if
(
!
(
this
.
userInfo
&&
this
.
userInfo
.
user_id
))
{
this
.
showAlert
=
true
;
this
.
alertText
=
'
请登陆
'
}
else
if
(
!
this
.
name
){
this
.
showAlert
=
true
;
this
.
alertText
=
'
请输入姓名
'
}
else
if
(
!
this
.
phone
){
this
.
showAlert
=
true
;
this
.
alertText
=
'
请输入电话号码
'
}
else
if
(
!
this
.
searchAddress
){
this
.
showAlert
=
true
;
this
.
alertText
=
'
请选择地址
'
}
else
if
(
!
this
.
address_detail
){
this
.
showAlert
=
true
;
this
.
alertText
=
'
请输入详细地址
'
}
if
(
this
.
tag
==
'
家
'
)
{
this
.
tag_type
=
2
;
}
else
if
(
this
.
tag
==
'
学校
'
){
this
.
tag_type
=
3
;
}
else
if
(
this
.
tag
==
'
公司
'
){
this
.
tag_type
=
4
;
}
let
res
=
await
postAddAddress
(
this
.
userInfo
.
user_id
,
this
.
searchAddress
.
name
,
this
.
address_detail
,
this
.
geohash
,
this
.
name
,
this
.
phone
,
this
.
anntherPhoneNumber
,
0
,
this
.
sex
,
this
.
tag
,
this
.
tag_type
);
this
.
$router
.
go
(
-
1
);
},
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
@import
'../../../../style/mixin'
;
.address_page
{
position
:
fixed
;
top
:
0
;
left
:
0
;
right
:
0
;
bottom
:
0
;
background-color
:
#f5f5f5
;
z-index
:
204
;
padding-top
:
1
.95rem
;
p
,
span
,
input
{
font-family
:
Helvetica
Neue
,
Tahoma
,
Arial
;
}
}
.page_text_container
{
background-color
:
#fff
;
padding
:
0
.7rem
;
}
.section_list
{
display
:
flex
;
border-bottom
:
0
.025rem
solid
#f5f5f5
;
.section_left
{
@include
sc
(
.7rem
,
#333
);
flex
:
2
;
line-height
:
2
.5rem
;
}
.section_right
{
flex
:
5
;
.input_style
{
width
:
100%
;
height
:
2
.5rem
;
@include
sc
(
.7rem
,
#999
);
}
.phone_bk
{
border-top
:
0
.025rem
solid
#f5f5f5
;
}
.phone_add
{
@include
fj
;
align-items
:
center
;
}
.choose_sex
{
display
:
flex
;
line-height
:
2
.5rem
;
border-top
:
0
.025rem
solid
#f5f5f5
;
.choose_option
{
@include
sc
(
.7rem
,
#333
);
display
:
flex
;
align-items
:
center
;
margin-right
:
.8rem
;
svg
{
margin-right
:
.3rem
;
@include
wh
(
.8rem
,
.8rem
);
fill
:
#ccc
;
}
.choosed
{
fill
:
#4cd964
;
}
}
}
.choose_address
{
@include
sc
(
.7rem
,
#999
);
line-height
:
2
.5rem
;
border-bottom
:
0
.025rem
solid
#f5f5f5
;
}
}
}
.determine
{
background-color
:
#4cd964
;
@include
sc
(
.7rem
,
#fff
);
text-align
:
center
;
margin
:
0
.7rem
;
line-height
:
1
.8rem
;
border-radius
:
0
.2rem
;
margin-top
:
.6rem
;
}
.router-slid-enter-active
,
.router-slid-leave-active
{
transition
:
all
.4s
;
}
.router-slid-enter
,
.router-slid-leave-active
{
transform
:
translateX
(
100%
);
}
</
style
>
src/page/confirmOrder/children/children/children/searchAddress.vue
0 → 100644
浏览文件 @
b6a87f72
<
template
>
<div
class=
"search_address_page"
>
<section>
<head-top
head-title=
"搜索"
go-back=
'true'
></head-top>
<form
class=
"search_form"
>
<input
type=
"search"
name=
"search"
placeholder=
"请输入小区/写字楼/学校等"
v-model=
"searchValue"
>
<button
@
click.prevent=
"searchPlace()"
>
搜索
</button>
</form>
<ul
class=
"address_list"
v-if=
"searchData"
>
<li
v-for=
"(item, index) in searchData"
:key=
"index"
@
click=
"choooedAddress(item)"
>
<h4>
{{
item
.
name
}}
</h4>
<p>
{{
item
.
address
}}
</p>
</li>
</ul>
<div
v-else
class=
"empty_tips"
>
<p>
找不到地址?
</p>
<p>
尝试输入小区、写字楼或学校名
</p>
<p>
详细地址(如门牌号等)可稍后输入哦
</p>
</div>
</section>
</div>
</
template
>
<
script
>
import
headTop
from
'
../../../../../components/header/head
'
import
{
searchNearby
}
from
'
../../../../../service/getData
'
import
{
mapMutations
}
from
'
vuex
'
export
default
{
data
(){
return
{
searchValue
:
null
,
searchData
:
null
,
}
},
components
:
{
headTop
,
},
props
:[],
methods
:
{
...
mapMutations
([
'
CHOOSE_SEARCH_ADDRESS
'
]),
async
searchPlace
(){
if
(
this
.
searchValue
)
{
this
.
searchData
=
await
searchNearby
(
this
.
searchValue
);
}
},
choooedAddress
(
item
){
this
.
CHOOSE_SEARCH_ADDRESS
(
item
);
this
.
$router
.
go
(
-
1
);
},
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
@import
'../../../../../style/mixin'
;
.search_address_page
{
position
:
fixed
;
top
:
0
;
left
:
0
;
right
:
0
;
bottom
:
0
;
background-color
:
#fff
;
z-index
:
204
;
overflow-y
:
auto
;
padding-top
:
1
.95rem
;
p
,
span
{
font-family
:
Helvetica
Neue
,
Tahoma
,
Arial
;
}
}
.search_form
{
display
:
flex
;
padding
:
.7rem
;
input
{
@include
sc
(
.65rem
,
#999
);
flex
:
4
;
background-color
:
#f1f1f1
;
margin-right
:
.6rem
;
height
:
1
.5rem
;
border-radius
:
0
.15rem
;
padding
:
0
.4rem
;
}
button
{
flex
:
1
;
@include
sc
(
.65rem
,
#fff
);
background-color
:
$blue
;
border-radius
:
0
.15rem
;
}
}
.address_list
{
padding
:
.7rem
;
li
{
padding
:
.7rem
0
;
border-bottom
:
0
.025rem
solid
#f5f5f5
;
line-height
:
1rem
;
h4
{
@include
sc
(
.75rem
,
#555
);
}
p
{
@include
sc
(
.65rem
,
#999
);
}
}
}
.empty_tips
{
@include
center
;
width
:
100%
;
p
{
@include
sc
(
.5rem
,
#aaa
);
line-height
:
.7rem
;
text-align
:
center
;
}
}
</
style
>
src/page/confirmOrder/children/chooseAddress.vue
0 → 100644
浏览文件 @
b6a87f72
<
template
>
<div
class=
"rating_page"
>
<head-top
head-title=
"选择地址"
go-back=
'true'
></head-top>
<router-link
to=
"/confirmOrder/chooseAddress/addAddress"
class=
"add_icon_footer"
>
<img
src=
"../../../images/add_address.png"
height=
"24"
width=
"24"
>
<span>
新增收货地址
</span>
</router-link>
<ul
class=
"deliverable_address"
>
<li
v-for=
"(item,index) in deliverable"
@
click=
"chooseAddress(item, index)"
>
<svg
class=
"choosed_address"
:class=
"
{default_address: defaultIndex == index}">
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#select"
></use>
</svg>
<div>
<header>
<span>
{{
item
.
name
}}
</span>
<span>
{{
item
.
sex
==
1
?
'
先生
'
:
'
女士
'
}}
</span>
<span>
{{
item
.
phone
}}
</span>
</header>
<div
class=
"address_detail ellipsis"
>
<span
:style=
"
{backgroundColor: iconColor(item.tag)}">
{{
item
.
tag
}}
</span>
<p>
{{
item
.
address_detail
}}
</p>
</div>
</div>
</li>
</ul>
<section
id=
"out_delivery"
v-if=
"deliverdisable.length"
>
<header
class=
"out_header"
>
以下地址超出配送范围
</header>
<ul
class=
"deliverable_address"
>
<li
v-for=
"(item,index) in deliverdisable"
>
<svg
class=
"choosed_address"
>
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#select"
></use>
</svg>
<div>
<header>
<span>
{{
item
.
name
}}
</span>
<span>
{{
item
.
sex
==
1
?
'
先生
'
:
'
女士
'
}}
</span>
<span>
{{
item
.
phone
}}
</span>
</header>
<div
class=
"address_detail ellipsis"
>
<span
v-if=
"item.tag"
:style=
"
{backgroundColor: '#ccc'}">
{{
item
.
tag
}}
</span>
<p>
{{
item
.
address_detail
}}
</p>
</div>
</div>
</li>
</ul>
</section>
<alert-tip
v-if=
"showAlert"
@
closeTip=
"showAlert = false"
:alertText=
"alertText"
></alert-tip>
<transition
name=
"router-slid"
>
<router-view></router-view>
</transition>
</div>
</
template
>
<
script
>
import
headTop
from
'
../../../components/header/head
'
import
{
mapState
,
mapMutations
}
from
'
vuex
'
import
{
getAddress
}
from
'
../../../service/getData
'
import
alertTip
from
'
../../../components/common/alertTip
'
export
default
{
data
(){
return
{
addressList
:
[],
deliverable
:
[],
deliverdisable
:
[],
id
:
null
,
sig
:
null
,
showAlert
:
false
,
alertText
:
null
,
}
},
created
(){
this
.
id
=
this
.
$route
.
query
.
id
;
this
.
sig
=
this
.
$route
.
query
.
sig
;
// var date=new Date();
// date.setTime(date.getTime()-10000);
// document.cookie="USERID=186655961; expires=" + date.toGMTString() ;
// document.cookie="SID=euYTx4hkmHEa1HdhpbkvaxXLvuR7lb2WjlwQ; expires=" + date.toGMTString();
this
.
initData
();
},
components
:
{
headTop
,
alertTip
,
},
props
:[],
computed
:
{
...
mapState
([
'
userInfo
'
,
'
addressIndex
'
]),
defaultIndex
:
function
(){
if
(
this
.
addressIndex
)
{
return
this
.
addressIndex
;
}
else
{
return
0
;
}
}
},
methods
:
{
...
mapMutations
([
'
CHOOSE_ADDRESS
'
]),
async
initData
(){
if
(
!
(
this
.
userInfo
&&
this
.
userInfo
.
user_id
))
{
this
.
showAlert
=
true
;
this
.
alertText
=
'
请登陆
'
return
}
this
.
addressList
=
await
getAddress
(
this
.
id
,
this
.
sig
);
this
.
addressList
.
forEach
(
item
=>
{
if
(
item
.
is_deliverable
)
{
this
.
deliverable
.
push
(
item
);
}
else
{
this
.
deliverdisable
.
push
(
item
);
}
})
},
iconColor
(
name
){
switch
(
name
){
case
'
公司
'
:
return
'
#4cd964
'
;
case
'
学校
'
:
return
'
#3190e8
'
;
}
},
chooseAddress
(
address
,
index
){
this
.
CHOOSE_ADDRESS
({
address
,
index
});
this
.
$router
.
go
(
-
1
);
},
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
@import
'../../../style/mixin'
;
.rating_page
{
position
:
fixed
;
top
:
0
;
left
:
0
;
right
:
0
;
bottom
:
0
;
background-color
:
#f5f5f5
;
z-index
:
204
;
padding-top
:
1
.95rem
;
p
,
span
{
font-family
:
Helvetica
Neue
,
Tahoma
,
Arial
;
}
}
.add_icon_footer
{
position
:
fixed
;
bottom
:
0
;
left
:
0
;
right
:
0
;
height
:
2
.5rem
;
background-color
:
#fff
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
z-index
:
204
;
span
{
@include
sc
(
.7rem
,
$blue
);
margin-left
:
.3rem
;
}
}
.deliverable_address
{
background-color
:
#fff
;
li
{
display
:
flex
;
align-items
:
center
;
border-bottom
:
0
.025rem
solid
#f5f5f5
;
padding
:
.7rem
;
line-height
:
1rem
;
.choosed_address
{
@include
wh
(
.8rem
,
.8rem
);
fill
:
#4cd964
;
margin-right
:
.4rem
;
opacity
:
0
;
}
.default_address
{
opacity
:
1
;
}
header
{
@include
sc
(
.75rem
,
#333
);
span
:nth-of-type
(
1
)
{
font-size
:
.85rem
;
font-weight
:
bold
;
}
}
.address_detail
{
width
:
100%
;
display
:
flex
;
align-items
:
center
;
span
{
@include
sc
(
.5rem
,
#fff
);
border-radius
:
.15rem
;
background-color
:
#ff5722
;
height
:
.65rem
;
line-height
:
.65rem
;
padding
:
0
.3rem
;
margin-right
:
.3rem
;
}
p
{
@include
sc
(
.65rem
,
#777
);
}
}
}
}
#out_delivery
{
.out_header
{
@include
sc
(
.6rem
,
#666
);
line-height
:
1
.5rem
;
padding-left
:
.5rem
;
}
*
{
color
:
#ccc
;
}
}
.router-slid-enter-active
,
.router-slid-leave-active
{
transition
:
all
.4s
;
}
.router-slid-enter
,
.router-slid-leave-active
{
transform
:
translateX
(
100%
);
}
</
style
>
src/page/confirmOrder/children/invoice.vue
0 → 100644
浏览文件 @
b6a87f72
<
template
>
<div
class=
"rating_page"
>
<head-top
head-title=
"选择发票抬头"
go-back=
'true'
></head-top>
<section
class=
"choose_invoice"
>
<span>
不需要开发票
</span>
<svg
@
click=
"chooseInvoice"
:class=
"
{choosed: invoice}">
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#select"
></use>
</svg>
</section>
<div
class=
"determine"
@
click=
"confrimInvoice"
>
确定
</div>
</div>
</
template
>
<
script
>
import
headTop
from
'
../../../components/header/head
'
import
{
mapMutations
}
from
'
vuex
'
export
default
{
data
(){
return
{
invoice
:
false
,
//是否需要发票
}
},
components
:
{
headTop
,
},
props
:[],
methods
:
{
...
mapMutations
([
'
CONFIRM_INVOICE
'
]),
chooseInvoice
(){
this
.
invoice
=
!
this
.
invoice
;
},
confrimInvoice
(){
this
.
CONFIRM_INVOICE
(
this
.
invoice
);
this
.
$router
.
go
(
-
1
);
},
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
@import
'../../../style/mixin'
;
.rating_page
{
position
:
fixed
;
top
:
0
;
left
:
0
;
right
:
0
;
bottom
:
0
;
background-color
:
#f5f5f5
;
z-index
:
204
;
padding-top
:
1
.95rem
;
p
,
span
{
font-family
:
Helvetica
Neue
,
Tahoma
,
Arial
;
}
}
.choose_invoice
{
@include
fj
;
align-items
:
center
;
background-color
:
#fff
;
line-height
:
2
.5rem
;
margin-top
:
0
.5rem
;
padding
:
0
.7rem
;
span
{
@include
sc
(
.75rem
,
#333
);
}
svg
{
@include
wh
(
.8rem
,
.8rem
);
fill
:
#999
;
}
.choosed
{
fill
:
#4cd964
;
}
}
.determine
{
background-color
:
#4cd964
;
@include
sc
(
.7rem
,
#fff
);
text-align
:
center
;
margin
:
0
.7rem
;
line-height
:
1
.8rem
;
border-radius
:
0
.2rem
;
margin-top
:
0
.5rem
;
}
</
style
>
src/page/confirmOrder/confirmOrder.vue
浏览文件 @
b6a87f72
...
@@ -2,17 +2,28 @@
...
@@ -2,17 +2,28 @@
<div
class=
"confirmOrderContainer"
>
<div
class=
"confirmOrderContainer"
>
<section
v-if=
"!showLoading"
>
<section
v-if=
"!showLoading"
>
<head-top
head-title=
"确认订单"
goBack=
"true"
signin-up=
'confirmOrder'
></head-top>
<head-top
head-title=
"确认订单"
goBack=
"true"
signin-up=
'confirmOrder'
></head-top>
<
section
class=
"address_container"
>
<
router-link
:to=
'
{path: "/confirmOrder/chooseAddress", query: {id: checkoutData.cart.id, sig: checkoutData.sig}}'
class="address_container">
<div
class=
"address_empty_left"
>
<div
class=
"address_empty_left"
>
<svg
class=
"location_icon"
>
<svg
class=
"location_icon"
>
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#location"
></use>
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#location"
></use>
</svg>
</svg>
<span
class=
"add_address"
>
请添加一个收获地址
</span>
<div
class=
"add_address"
v-if=
"!choosedAddress"
>
请添加一个收获地址
</div>
<div
v-else
class=
"address_detail_container"
>
<header>
<span>
{{
choosedAddress
.
name
}}
</span>
<span>
{{
choosedAddress
.
sex
==
1
?
'
先生
'
:
'
女士
'
}}
</span>
<span>
{{
choosedAddress
.
phone
}}
</span>
</header>
<div
class=
"address_detail ellipsis"
>
<span
:style=
"
{backgroundColor: iconColor(choosedAddress.tag)}">
{{
choosedAddress
.
tag
}}
</span>
<p>
{{
choosedAddress
.
address_detail
}}
</p>
</div>
</div>
</div>
</div>
<svg
class=
"address_empty_right"
>
<svg
class=
"address_empty_right"
>
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#arrow-right"
></use>
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#arrow-right"
></use>
</svg>
</svg>
</
section
>
</
router-link
>
<section
class=
"delivery_model container_style"
>
<section
class=
"delivery_model container_style"
>
<p
class=
"deliver_text"
>
送达时间
</p>
<p
class=
"deliver_text"
>
送达时间
</p>
<section
class=
"deliver_time"
>
<section
class=
"deliver_time"
>
...
@@ -68,16 +79,21 @@
...
@@ -68,16 +79,21 @@
<router-link
:to=
'
{path: "/confirmOrder/remark", query: {id: checkoutData.cart.id, sig: checkoutData.sig}}' class="header_style">
<router-link
:to=
'
{path: "/confirmOrder/remark", query: {id: checkoutData.cart.id, sig: checkoutData.sig}}' class="header_style">
<span>
订单备注
</span>
<span>
订单备注
</span>
<div
class=
"more_type"
>
<div
class=
"more_type"
>
<span
class=
"ellipsis"
>
{{
remarkText
||
inputText
?
remarklist
:
'
口味
偏、
好等
'
}}
</span>
<span
class=
"ellipsis"
>
{{
remarkText
||
inputText
?
remarklist
:
'
口味
、偏
好等
'
}}
</span>
<svg
class=
"address_empty_right"
>
<svg
class=
"address_empty_right"
>
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#arrow-right"
></use>
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#arrow-right"
></use>
</svg>
</svg>
</div>
</div>
</router-link>
</router-link>
<
section
class=
"hongbo
"
>
<
router-link
:to=
"checkoutData.invoice.is_available? '/confirmOrder/invoice': ''"
class=
"hongbo"
:class=
"
{support_is_available: checkoutData.invoice.is_available}
">
<span>
发票抬头
</span>
<span>
发票抬头
</span>
<span>
商家不支持开发票
</span>
<span>
</section>
{{
checkoutData
.
invoice
.
status_text
}}
<svg
class=
"address_empty_right"
>
<use
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xlink:href=
"#arrow-right"
></use>
</svg>
</span>
</router-link>
</section>
</section>
<section
class=
"confrim_order"
>
<section
class=
"confrim_order"
>
<p>
待支付 ¥
{{
checkoutData
.
cart
.
total
}}
</p>
<p>
待支付 ¥
{{
checkoutData
.
cart
.
total
}}
</p>
...
@@ -137,7 +153,10 @@
...
@@ -137,7 +153,10 @@
this
.
shopCart
=
this
.
cartList
[
this
.
shopId
];
this
.
shopCart
=
this
.
cartList
[
this
.
shopId
];
},
},
mounted
(){
mounted
(){
this
.
initData
();
if
(
this
.
geohash
)
{
this
.
initData
();
this
.
SAVE_GEOHASH
(
this
.
geohash
);
}
},
},
components
:
{
components
:
{
headTop
,
headTop
,
...
@@ -146,21 +165,25 @@
...
@@ -146,21 +165,25 @@
},
},
computed
:
{
computed
:
{
...
mapState
([
...
mapState
([
'
cartList
'
,
'
remarkText
'
,
'
inputText
'
'
cartList
'
,
'
remarkText
'
,
'
inputText
'
,
'
invoice
'
,
'
choosedAddress
'
]),
]),
remarklist
:
function
(){
remarklist
:
function
(){
if
(
this
.
remarkText
&&
this
.
inputText
)
{
let
str
=
new
String
;
let
str
=
new
String
;
if
(
this
.
remarkText
)
{
Object
.
values
(
this
.
remarkText
).
forEach
(
item
=>
{
Object
.
values
(
this
.
remarkText
).
forEach
(
item
=>
{
str
+=
item
[
1
]
+
'
,
'
;
str
+=
item
[
1
]
+
'
,
'
;
})
})
}
if
(
this
.
inputText
)
{
return
str
+
this
.
inputText
;
return
str
+
this
.
inputText
;
}
else
{
return
str
.
substr
(
0
,
str
.
lastIndexOf
(
'
,
'
))
;
}
}
}
}
,
},
},
methods
:
{
methods
:
{
...
mapMutations
([
...
mapMutations
([
'
INIT_BUYCART
'
'
INIT_BUYCART
'
,
'
SAVE_GEOHASH
'
]),
]),
async
initData
(){
async
initData
(){
let
newArr
=
new
Array
;
let
newArr
=
new
Array
;
...
@@ -194,6 +217,12 @@
...
@@ -194,6 +217,12 @@
this
.
payWayId
=
id
;
this
.
payWayId
=
id
;
}
}
},
},
iconColor
(
name
){
switch
(
name
){
case
'
公司
'
:
return
'
#4cd964
'
;
case
'
学校
'
:
return
'
#3190e8
'
;
}
},
}
}
}
}
...
@@ -233,12 +262,39 @@
...
@@ -233,12 +262,39 @@
.add_address
{
.add_address
{
@include
sc
(
.7rem
,
#333
);
@include
sc
(
.7rem
,
#333
);
}
}
}
.address_detail_container
{
.address_empty_right
{
margin-left
:
.2rem
;
@include
wh
(
.6rem
,
.6rem
);
header
{
fill
:
#999
;
@include
sc
(
.75rem
,
#333
);
span
:nth-of-type
(
1
)
{
font-size
:
.85rem
;
font-weight
:
bold
;
}
}
.address_detail
{
width
:
100%
;
display
:
flex
;
align-items
:
center
;
span
{
@include
sc
(
.5rem
,
#fff
);
border-radius
:
.15rem
;
background-color
:
#ff5722
;
height
:
.65rem
;
line-height
:
.65rem
;
padding
:
0
.3rem
;
margin-right
:
.3rem
;
}
p
{
@include
sc
(
.65rem
,
#777
);
}
}
}
}
}
}
}
.address_empty_right
{
@include
wh
(
.6rem
,
.6rem
);
fill
:
#999
;
}
.delivery_model
{
.delivery_model
{
border-left
:
.2rem
solid
$blue
;
border-left
:
.2rem
solid
$blue
;
min-height
:
4rem
;
min-height
:
4rem
;
...
@@ -292,8 +348,21 @@
...
@@ -292,8 +348,21 @@
@include
fj
;
@include
fj
;
border-top
:
0
.025rem
solid
#f5f5f5
;
border-top
:
0
.025rem
solid
#f5f5f5
;
span
{
span
{
@include
sc
(
.6rem
,
#
ccc
);
@include
sc
(
.6rem
,
#
aaa
);
line-height
:
2rem
;
line-height
:
2rem
;
svg
{
@include
wh
(
.5rem
,
.5rem
);
vertical-align
:
middle
;
fill
:
#ccc
;
}
}
span
:nth-of-type
(
2
)
{
color
:
#aaa
;
}
}
.support_is_available
{
span
{
color
:
#666
;
}
}
}
}
}
}
...
...
src/page/login/login.vue
浏览文件 @
b6a87f72
...
@@ -109,7 +109,7 @@
...
@@ -109,7 +109,7 @@
clearInterval
(
this
.
timer
)
clearInterval
(
this
.
timer
)
}
}
},
1000
)
},
1000
)
let
exsis
=
await
checkExsis
(
this
.
phoneNumber
,
this
.
accountType
);
let
exsis
=
await
checkExsis
(
this
.
phoneNumber
,
'
mobile
'
);
if
(
exsis
.
message
)
{
if
(
exsis
.
message
)
{
this
.
showAlert
=
true
;
this
.
showAlert
=
true
;
this
.
alertText
=
exsis
.
message
;
this
.
alertText
=
exsis
.
message
;
...
...
src/page/shop/children/shopSafe.vue
→
src/page/shop/children/
children/
shopSafe.vue
浏览文件 @
b6a87f72
...
@@ -97,8 +97,8 @@
...
@@ -97,8 +97,8 @@
<
script
>
<
script
>
import
{
mapState
}
from
'
vuex
'
import
{
mapState
}
from
'
vuex
'
import
headTop
from
'
../../../components/header/head
'
import
headTop
from
'
../../../
../
components/header/head
'
import
{
getImgPath
}
from
'
../../../components/common/mixin
'
import
{
getImgPath
}
from
'
../../../
../
components/common/mixin
'
export
default
{
export
default
{
data
(){
data
(){
...
@@ -128,16 +128,17 @@
...
@@ -128,16 +128,17 @@
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
@import
'../../../style/mixin'
;
@import
'../../../
../
style/mixin'
;
.safe_shop
{
.safe_shop
{
position
:
absolute
;
position
:
fixed
;
top
:
0
;
top
:
0
;
left
:
0
;
left
:
0
;
right
:
0
;
bottom
:
0
;
padding-top
:
1
.95rem
;
padding-top
:
1
.95rem
;
background-color
:
#ebebeb
;
background-color
:
#ebebeb
;
z-index
:
102
;
z-index
:
102
;
}
}
ul
{
ul
{
...
...
src/router/router.js
浏览文件 @
b6a87f72
...
@@ -13,9 +13,13 @@ const vipcard = r => require.ensure([], () => r(require('../page/vipcard/vipcard
...
@@ -13,9 +13,13 @@ const vipcard = r => require.ensure([], () => r(require('../page/vipcard/vipcard
const
food
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/food/food
'
)),
'
food
'
)
const
food
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/food/food
'
)),
'
food
'
)
const
confirmOrder
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/confirmOrder/confirmOrder
'
)),
'
confirmOrder
'
)
const
confirmOrder
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/confirmOrder/confirmOrder
'
)),
'
confirmOrder
'
)
const
remark
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/confirmOrder/children/remark
'
)),
'
remark
'
)
const
remark
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/confirmOrder/children/remark
'
)),
'
remark
'
)
const
invoice
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/confirmOrder/children/invoice
'
)),
'
invoice
'
)
const
chooseAddress
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/confirmOrder/children/chooseAddress
'
)),
'
chooseAddress
'
)
const
addAddress
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/confirmOrder/children/children/addAddress
'
)),
'
addAddress
'
)
const
searchAddress
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/confirmOrder/children/children/children/searchAddress
'
)),
'
searchAddress
'
)
const
foodDetail
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/shop/children/foodDetail
'
)),
'
foodDetail
'
)
const
foodDetail
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/shop/children/foodDetail
'
)),
'
foodDetail
'
)
const
shopDetail
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/shop/children/shopDetail
'
)),
'
shopDetail
'
)
const
shopDetail
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/shop/children/shopDetail
'
)),
'
shopDetail
'
)
const
shopSafe
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/shop/children/shopSafe
'
)),
'
shopSafe
'
)
const
shopSafe
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/shop/children/
children/
shopSafe
'
)),
'
shopSafe
'
)
const
info
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/profile/children/info
'
)),
'
info
'
)
const
info
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/profile/children/info
'
)),
'
info
'
)
const
balance
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/profile/children/balance
'
)),
'
balance
'
)
const
balance
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/profile/children/balance
'
)),
'
balance
'
)
const
benefit
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/profile/children/benefit
'
)),
'
benefit
'
)
const
benefit
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'
../page/profile/children/benefit
'
)),
'
benefit
'
)
...
@@ -28,88 +32,115 @@ export default [{
...
@@ -28,88 +32,115 @@ export default [{
path
:
'
/
'
,
path
:
'
/
'
,
component
:
App
,
//顶层路由,对应index.html
component
:
App
,
//顶层路由,对应index.html
children
:
[
//二级路由。对应App.vue
children
:
[
//二级路由。对应App.vue
//地址为空时跳转home页面
{
{
path
:
''
,
path
:
''
,
redirect
:
'
/home
'
redirect
:
'
/home
'
},
//地址为空时跳转home页面
},
//首页城市列表页
{
{
path
:
'
/home
'
,
path
:
'
/home
'
,
component
:
home
component
:
home
},
//首页城市列表页
},
//当前选择城市页
{
{
path
:
'
/city/:cityid
'
,
path
:
'
/city/:cityid
'
,
component
:
city
component
:
city
},
//当前选择城市页
},
//所有商铺列表页
{
{
path
:
'
/msite
'
,
path
:
'
/msite
'
,
component
:
msite
,
component
:
msite
,
},
//所有商铺列表页
},
//特色商铺列表页
{
{
path
:
'
/food
'
,
path
:
'
/food
'
,
component
:
food
component
:
food
},
//特色商铺列表页
},
//搜索页
{
{
path
:
'
/search/:geohash
'
,
path
:
'
/search/:geohash
'
,
component
:
search
component
:
search
},
//搜索页
},
//商铺详情页
{
{
path
:
'
/shop
'
,
path
:
'
/shop
'
,
component
:
shop
,
component
:
shop
,
children
:
[{
children
:
[{
path
:
'
foodDetail
'
,
path
:
'
foodDetail
'
,
//食品详情页
component
:
foodDetail
,
component
:
foodDetail
,
},
{
},
{
path
:
'
shopDetail
'
,
path
:
'
shopDetail
'
,
//商铺详情页
component
:
shopDetail
,
component
:
shopDetail
,
children
:
[{
children
:
[{
path
:
'
shopSafe
'
,
path
:
'
shopSafe
'
,
//商铺安全认证页
component
:
shopSafe
,
component
:
shopSafe
,
},
]
},
]
}]
}]
},
//商铺详情页
},
//确认订单页
{
{
path
:
'
/confirmOrder
'
,
path
:
'
/confirmOrder
'
,
component
:
confirmOrder
,
component
:
confirmOrder
,
children
:
[{
children
:
[{
path
:
'
remark
'
,
path
:
'
remark
'
,
//订单备注
component
:
remark
,
component
:
remark
,
},
{
path
:
'
invoice
'
,
//发票抬头
component
:
invoice
,
},
{
path
:
'
chooseAddress
'
,
//选择地址
component
:
chooseAddress
,
children
:
[{
path
:
'
addAddress
'
,
//添加地址
component
:
addAddress
,
children
:
[{
path
:
'
searchAddress
'
,
//搜索地址
component
:
searchAddress
,
}]
},
]
},
]
},
]
},
//确认订单页
},
//登陆注册页
{
{
path
:
'
/login
'
,
path
:
'
/login
'
,
component
:
login
component
:
login
},
//登陆注册页
},
//个人信息页
{
{
path
:
'
/profile
'
,
path
:
'
/profile
'
,
component
:
profile
,
component
:
profile
,
children
:
[{
children
:
[{
path
:
'
info
'
,
path
:
'
info
'
,
//个人信息详情页
component
:
info
,
component
:
info
,
},
{
},
{
path
:
'
balance
'
,
path
:
'
balance
'
,
//余额
component
:
balance
,
component
:
balance
,
},
{
},
{
path
:
'
benefit
'
,
path
:
'
benefit
'
,
//我的优惠页
component
:
benefit
,
component
:
benefit
,
},
{
},
{
path
:
'
points
'
,
path
:
'
points
'
,
//我的积分页
component
:
points
,
component
:
points
,
},
{
},
{
path
:
'
service
'
,
path
:
'
service
'
,
//服务中心
component
:
service
,
component
:
service
,
}]
}]
},
//个人信息页
},
//修改密码页
{
{
path
:
'
/forget
'
,
path
:
'
/forget
'
,
component
:
forget
component
:
forget
},
//修改密码页
},
//订单列表页
{
{
path
:
'
/order
'
,
path
:
'
/order
'
,
component
:
order
component
:
order
},
//订单列表页
},
//vip卡页
{
{
path
:
'
/vipcard
'
,
path
:
'
/vipcard
'
,
component
:
vipcard
component
:
vipcard
},
//vip卡页
},
]
]
}]
}]
\ No newline at end of file
src/service/getData.js
浏览文件 @
b6a87f72
...
@@ -151,15 +151,19 @@ export const ratingTags = shopid => fetch('GET', '/ugc/v2/restaurants/' + shopid
...
@@ -151,15 +151,19 @@ 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
'
//
});
});
/**
/**
* 手机号登陆
* 手机号登陆
*/
*/
//export const sendLogin = (code, mobile, validate_token) => fetch('POST', '/v1/login/app_mobile', {code, mobile, validate_token});
// export const sendLogin = (code, mobile, validate_token) => fetch('POST', '/v1/login/app_mobile', {
// code,
// mobile,
// validate_token
// });
/**
/**
* 获取图片验证码
* 获取图片验证码
*/
*/
...
@@ -171,10 +175,10 @@ export const getcaptchas = () => fetch('POST', '/v1/captchas', {});
...
@@ -171,10 +175,10 @@ 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
//
});
});
/**
/**
* 发送帐号
* 发送帐号
*/
*/
...
@@ -201,6 +205,38 @@ export const getcaptchas = () => fetch('POST', '/v1/captchas', {});
...
@@ -201,6 +205,38 @@ export const getcaptchas = () => fetch('POST', '/v1/captchas', {});
// export const getRemark = (id, sig) => fetch('GET', '/v1/carts/' + id + '/remarks', {
// export const getRemark = (id, sig) => fetch('GET', '/v1/carts/' + id + '/remarks', {
// sig
// sig
// });
// });
/**
* 获取地址列表
*/
// export const getAddress = (id, sig) => fetch('GET', '/v1/carts/' + id + '/addresses', {
// sig
// });
/**
* 获取用户信息
*/
//export const getUser = () => fetch('GET', '/v1/user', {});
/**
* 搜索地址
*/
// export const searchNearby = keyword => fetch('GET', '/v1/pois', {
// type: 'nearby',
// keyword
// });
/**
* 添加地址
*/
export
const
postAddAddress
=
(
userId
,
address
,
address_detail
,
geohash
,
name
,
phone
,
phone_bk
,
poi_type
,
sex
,
tag
,
tag_type
)
=>
fetch
(
'
POST
'
,
'
/v1/users/
'
+
userId
+
'
/addresses
'
,
{
address
,
address_detail
,
geohash
,
name
,
phone
,
phone_bk
,
poi_type
,
sex
,
tag
,
tag_type
,
});
...
@@ -230,10 +266,14 @@ export const foodMenu = restaurant_id => setpromise(shop.shopMenu);
...
@@ -230,10 +266,14 @@ 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
);
export
const
checkExsis
=
(
checkNumber
,
type
)
=>
setpromise
(
login
.
checkExsis
);
//
export const checkExsis = (checkNumber, type) => setpromise(login.checkExsis);
export
const
sendMobile
=
(
sendData
,
captcha_code
,
type
,
password
)
=>
setpromise
(
login
.
send
);
export
const
sendMobile
=
(
sendData
,
captcha_code
,
type
,
password
)
=>
setpromise
(
login
.
send
);
export
const
checkout
=
(
geohash
,
entities
)
=>
setpromise
(
confirm
.
checkout
);
export
const
checkout
=
(
geohash
,
entities
)
=>
setpromise
(
confirm
.
checkout
);
export
const
getRemark
=
(
id
,
sig
)
=>
setpromise
(
confirm
.
remark
);
export
const
getRemark
=
(
id
,
sig
)
=>
setpromise
(
confirm
.
remark
);
\ No newline at end of file
export
const
getAddress
=
(
id
,
sig
)
=>
setpromise
(
confirm
.
addressList
);
export
const
getUser
=
()
=>
setpromise
(
login
.
userInfo
);
export
const
searchNearby
=
keyword
=>
setpromise
(
confirm
.
searchAddress
);
// export const postAddAddress = (userId, address, address_detail, geohash, name, phone, phone_bk, poi_type, sex, tag, tag_type) => setpromise(confirm.addAddress);
\ No newline at end of file
src/service/tempdata/confirm.js
浏览文件 @
b6a87f72
...
@@ -1403,4 +1403,189 @@ export const remark = {
...
@@ -1403,4 +1403,189 @@ export const remark = {
[
"
\
u591a
\
u70b9
\
u918b
"
],
[
"
\
u591a
\
u70b9
\
u918b
"
],
[
"
\
u591a
\
u70b9
\
u8471
"
]
[
"
\
u591a
\
u70b9
\
u8471
"
]
]
]
}
}
\ No newline at end of file
export
const
searchAddress
=
[{
"
name
"
:
"
\
u4eba
\
u6c11
\
u5e7f
\
u573a[
\
u5730
\
u94c1
\
u7ad9] [
\
u5730
\
u94c1
\
u7ad9]
"
,
"
address
"
:
"
\
u5730
\
u94c11
\
u53f7
\
u7ebf,
\
u5730
\
u94c12
\
u53f7
\
u7ebf,
\
u5730
\
u94c18
\
u53f7
\
u7ebf
"
,
"
latitude
"
:
31.23283
,
"
longitude
"
:
121.472789
,
"
geohash
"
:
"
wtw3sjvb3js2
"
},
{
"
name
"
:
"
\
u4e0a
\
u6d77
\
u4eba
\
u6c11
\
u5e7f
\
u573a
"
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u4eba
\
u6c11
\
u5927
\
u9053120
\
u53f7
"
,
"
latitude
"
:
31.22967
,
"
longitude
"
:
121.4762
,
"
geohash
"
:
"
wtw3sm0q087
"
},
{
"
name
"
:
"
\
u4eba
\
u6c11
\
u5e7f
\
u573a[
\
u516c
\
u4ea4
\
u7ad9] [
\
u516c
\
u4ea4
\
u7ad9]
"
,
"
address
"
:
"
112
\
u533a
\
u95f4,112,123,123(
\
u533a
\
u95f4),145,312,46
\
u533a
\
u95f4,49,952
\
u7b4912
\
u6761
\
u7ebf
\
u8def
"
,
"
latitude
"
:
31.229015
,
"
longitude
"
:
121.476929
,
"
geohash
"
:
"
wtw3sm0f1w76
"
},
{
"
name
"
:
"
\
u4eba
\
u6c11
\
u516c
\
u56ed
"
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u5357
\
u4eac
\
u897f
\
u8def231
\
u53f7
"
,
"
latitude
"
:
31.23223
,
"
longitude
"
:
121.47322
,
"
geohash
"
:
"
wtw3sjwhgjt
"
},
{
"
name
"
:
"
\
u4eba
\
u6c11
\
u5e7f
\
u573a-
\
u5317
\
u5e7f
\
u573a
"
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u4eba
\
u6c11
\
u5e7f
\
u573a
\
u5185
"
,
"
latitude
"
:
31.23407
,
"
longitude
"
:
121.47379
,
"
geohash
"
:
"
wtw3sjyx8kw
"
},
{
"
name
"
:
"
CAFE LUGO
\
u4eba
\
u6c11
\
u5e7f
\
u573a
\
u5e97
"
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u897f
\
u85cf
\
u4e2d
\
u8def336
\
u53f7
\
u534e
\
u65ed
\
u56fd
\
u9645
\
u5927
\
u53a6
"
,
"
latitude
"
:
31.23379
,
"
longitude
"
:
121.47602
,
"
geohash
"
:
"
wtw3smbnh2m
"
},
{
"
name
"
:
"
\
u4eba
\
u6c11
\
u5927
\
u821e
\
u53f0
"
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u4e5d
\
u6c5f
\
u8def663~669
"
,
"
latitude
"
:
31.23427
,
"
longitude
"
:
121.47797
,
"
geohash
"
:
"
wtw3sq18ccg
"
},
{
"
name
"
:
"
\
u4eba
\
u6c11
\
u5e7f
\
u573a(
\
u5e7f
\
u4e1c
\
u8def)[
\
u516c
\
u4ea4
\
u7ad9] [
\
u516c
\
u4ea4
\
u7ad9]
"
,
"
address
"
:
"
454,108(
\
u533a
\
u95f4),167,312,318,108,537,
\
u96a7
\
u9053
\
u4e09
\
u7ebf,930,980,
\
u96a7
\
u9053
\
u591c
\
u5bb5
\
u7ebf
"
,
"
latitude
"
:
31.23075
,
"
longitude
"
:
121.476868
,
"
geohash
"
:
"
wtw3sm2u21vb
"
},
{
"
name
"
:
"
\
u4eba
\
u6c11
\
u5e7f
\
u573a(
\
u798f
\
u5dde
\
u8def)[
\
u516c
\
u4ea4
\
u7ad9] [
\
u516c
\
u4ea4
\
u7ad9]
"
,
"
address
"
:
"
805,18,312,318,451,49,
\
u96a7
\
u9053
\
u4e09
\
u7ebf,930,
\
u96a7
\
u9053
\
u591c
\
u5bb5
\
u7ebf,
\
u65b0
\
u5ddd
\
u4e13
\
u7ebf
"
,
"
latitude
"
:
31.232605
,
"
longitude
"
:
121.475833
,
"
geohash
"
:
"
wtw3sm8p05d1
"
},
{
"
name
"
:
"
YUMMIE HOUSE(
\
u4eba
\
u6c11
\
u5e7f
\
u573a
\
u5e97)
"
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u4eba
\
u6c11
\
u5927
\
u90539-99
\
u53f7
\
u9999
\
u6e2f
\
u540d
\
u5e97
\
u885775
\
u53f7
\
u5e97
\
u94fa
"
,
"
latitude
"
:
31.23011
,
"
longitude
"
:
121.47568
,
"
geohash
"
:
"
wtw3sjrbsd2
"
},
{
"
name
"
:
"
SHOW SHOWS(
\
u4eba
\
u6c11
\
u5e7f
\
u573a
\
u5e97)
"
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u4eba
\
u6c11
\
u5927
\
u90539-99
\
u53f7
\
u9999
\
u6e2f
\
u540d
\
u5e97
\
u8857B1
\
u5c42
"
,
"
latitude
"
:
31.23038
,
"
longitude
"
:
121.47596
,
"
geohash
"
:
"
wtw3sm245hb
"
},
{
"
name
"
:
"
\
u660e
\
u5802
\
u4eba
\
u6c11
\
u5e7f
\
u573a
\
u9752
\
u5e74
\
u65c5
\
u820d
"
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u6c38
\
u5bff
\
u8def35
\
u53f7(
\
u5730
\
u94c11
\
u53f7
\
u7ebf
\
u5927
\
u4e16
\
u754c
\
u7ad9
\
u5411
\
u897f350
\
u7c73)
"
,
"
latitude
"
:
31.22928
,
"
longitude
"
:
121.48132
,
"
geohash
"
:
"
wtw3sm5gxzt
"
},
{
"
name
"
:
"
\
u4e0a
\
u6d77
\
u4eba
\
u6c11
\
u5e7f
\
u573a
\
u4e0b
\
u6c89
\
u5f0f
\
u5e7f
\
u573a
"
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u5357
\
u4eac
\
u897f
\
u8def19
"
,
"
latitude
"
:
31.23404
,
"
longitude
"
:
121.47384
,
"
geohash
"
:
"
wtw3sjyx3xh
"
},
{
"
name
"
:
"
\
u7f8e
\
u8054
\
u793e(
\
u4eba
\
u6c11
\
u5e7f
\
u573a
\
u5e97)
"
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u5e7f
\
u897f
\
u5317
\
u8def248
\
u53f73
\
u697c338
"
,
"
latitude
"
:
31.23329
,
"
longitude
"
:
121.47863
,
"
geohash
"
:
"
wtw3smf515r
"
},
{
"
name
"
:
"
\
u9ebb
\
u8fa3
\
u8bf1
\
u60d1(
\
u4eba
\
u6c11
\
u5e7f
\
u573a
\
u5e97)
"
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u5357
\
u4eac
\
u897f
\
u8def58
\
u53f7
\
u65b0
\
u4e16
\
u754c
\
u57ce9
\
u5c42
"
,
"
latitude
"
:
31.23468
,
"
longitude
"
:
121.47383
,
"
geohash
"
:
"
wtw3snne1qk
"
},
{
"
name
"
:
"
dermes
\
u5149
\
u5b66
\
u8131
\
u6bdb(
\
u4eba
\
u6c11
\
u5e7f
\
u573a
\
u5e97)
"
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u897f
\
u85cf
\
u4e2d
\
u8def336
\
u53f7
\
u534e
\
u65ed
\
u56fd
\
u9645
\
u5927
\
u53a65
\
u697c(
\
u8fd1
\
u4e5d
\
u6c5f
\
u8def)
"
,
"
latitude
"
:
31.2338
,
"
longitude
"
:
121.47616
,
"
geohash
"
:
"
wtw3smbnpdq
"
},
{
"
name
"
:
"
\
u9c9c
\
u5899
\
u623f(
\
u4eba
\
u6c11
\
u5e7f
\
u573a
\
u5e97)
"
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u4e5d
\
u6c5f
\
u8def600
\
u53f7
\
u6c38
\
u5b89
\
u767e
\
u8d274
\
/5
\
u5c42
"
,
"
latitude
"
:
31.23459
,
"
longitude
"
:
121.47814
,
"
geohash
"
:
"
wtw3sq1dtvd
"
},
{
"
name
"
:
"
\
u5609
\
u5ef7
\
u9152
\
u5e97(
\
u4eba
\
u6c11
\
u5e7f
\
u573a
\
u5e97)
"
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u65b0
\
u95f8
\
u8def126
\
u53f7(
\
u8fd1
\
u5730
\
u94c1
\
u4eba
\
u6c11
\
u5e7f
\
u573a
\
u7ad9)
"
,
"
latitude
"
:
31.23875
,
"
longitude
"
:
121.47132
,
"
geohash
"
:
"
wtw3snudyvj
"
},
{
"
name
"
:
"
\
u7ea2
\
u76d4
\
u7532(
\
u4eba
\
u6c11
\
u5e7f
\
u573a
\
u5e97)
"
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u91d1
\
u9675
\
u4e1c
\
u8def500
\
u53f7
\
u4e9a
\
u9f99
\
u56fd
\
u9645
\
u5e7f
\
u573a2
\
u697c(
\
u8fd18
\
u53f7
\
u7ebf
\
u5927
\
u4e16
\
u754c
\
u7ad92
\
u53f7
\
u51fa
\
u53e3)
"
,
"
latitude
"
:
31.22695
,
"
longitude
"
:
121.47989
,
"
geohash
"
:
"
wtw3skdynt7
"
},
{
"
name
"
:
"
Moo Moo Cake(
\
u4eba
\
u6c11
\
u5e7f
\
u573a
\
u84dd
\
u5929
\
u767d
\
u5496
\
u5561
\
u5e97)
"
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u798f
\
u5dde
\
u8def523
\
u9644
\
u8fd1
"
,
"
latitude
"
:
31.23312
,
"
longitude
"
:
121.4807
,
"
geohash
"
:
"
wtw3smgd17x
"
}];
export
const
addAddress
=
{
"
address_id
"
:
275304983
};
export
const
addressList
=
[{
"
id
"
:
275355683
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u4eba
\
u6c11
\
u5e7f
\
u573a
"
,
"
phone
"
:
"
13681711259
"
,
"
is_valid
"
:
1
,
"
created_at
"
:
"
2017-02-18T19:51:39+0800
"
,
"
phone_bk
"
:
""
,
"
name
"
:
"
\
u84dd
"
,
"
st_geohash
"
:
"
wtw3sm0q087
"
,
"
address_detail
"
:
"
907
\
u53f7
"
,
"
poi_type
"
:
0
,
"
sex
"
:
1
,
"
city_id
"
:
1
,
"
tag
"
:
"
\
u5bb6
"
,
"
agent_fee
"
:
5
,
"
deliver_amount
"
:
20
,
"
is_deliverable
"
:
true
,
"
phone_had_bound
"
:
true
,
"
is_brand_member
"
:
false
},
{
"
id
"
:
275304983
,
"
address
"
:
"
\
u4e0a
\
u6d77
\
u4eba
\
u6c11
\
u5e7f
\
u573a
"
,
"
phone
"
:
"
13681711289
"
,
"
is_valid
"
:
1
,
"
created_at
"
:
"
2017-02-18T18:40:03+0800
"
,
"
phone_bk
"
:
""
,
"
name
"
:
"
\
u9ec4
"
,
"
st_geohash
"
:
"
wtw3sm0q087
"
,
"
address_detail
"
:
"
\
u4e0a
\
u6d77
\
u5e02
\
u9ec4
\
u6d66
\
u533a
\
u4eba
\
u6c11
\
u5927
\
u9053120
\
u53f7
"
,
"
poi_type
"
:
0
,
"
sex
"
:
2
,
"
city_id
"
:
1
,
"
tag
"
:
"
\
u5bb6
"
,
"
agent_fee
"
:
5
,
"
deliver_amount
"
:
20
,
"
is_deliverable
"
:
true
,
"
phone_had_bound
"
:
true
,
"
is_brand_member
"
:
false
},
{
"
id
"
:
275190634
,
"
address
"
:
"
563
\
u53f7
"
,
"
phone
"
:
"
13681711255
"
,
"
is_valid
"
:
1
,
"
created_at
"
:
"
2017-02-18T15:58:36+0800
"
,
"
phone_bk
"
:
""
,
"
name
"
:
"
\
u767e
"
,
"
st_geohash
"
:
"
wtw34e4ymr8q
"
,
"
address_detail
"
:
"
\
u83b2
\
u82b1
\
u8def[
\
u5730
\
u94c1
\
u7ad9] [
\
u5730
\
u94c1
\
u7ad9]
"
,
"
poi_type
"
:
0
,
"
sex
"
:
0
,
"
city_id
"
:
1
,
"
tag
"
:
""
,
"
agent_fee
"
:
5
,
"
deliver_amount
"
:
20
,
"
is_deliverable
"
:
false
,
"
phone_had_bound
"
:
true
,
"
is_brand_member
"
:
false
}];
\ No newline at end of file
src/service/tempdata/login.js
浏览文件 @
b6a87f72
...
@@ -17,15 +17,15 @@ export const userInfo = {
...
@@ -17,15 +17,15 @@ export const userInfo = {
"
current_invoice_id
"
:
0
,
"
current_invoice_id
"
:
0
,
"
delivery_card_expire_days
"
:
0
,
"
delivery_card_expire_days
"
:
0
,
"
email
"
:
""
,
"
email
"
:
""
,
"
gift_amount
"
:
1
,
"
gift_amount
"
:
0
,
"
id
"
:
1
08758383
,
"
id
"
:
1
86335200
,
"
is_active
"
:
1
,
"
is_active
"
:
1
,
"
is_email_valid
"
:
false
,
"
is_email_valid
"
:
false
,
"
is_mobile_valid
"
:
tru
e
,
"
is_mobile_valid
"
:
fals
e
,
"
mobile
"
:
"
13681711254
"
,
"
mobile
"
:
""
,
"
point
"
:
96
0
,
"
point
"
:
0
,
"
user_id
"
:
1
09065163
,
"
user_id
"
:
1
86655961
,
"
username
"
:
"
cangdu
"
"
username
"
:
"
cangdu
666
"
};
};
export
const
checkExsis
=
{
export
const
checkExsis
=
{
...
...
src/store/action.js
浏览文件 @
b6a87f72
import
{
cityGuess
}
from
'
../service/getData
'
import
{
import
{
GET_DATA
}
from
'
./mutation-types.js
'
getUser
}
from
'
../service/getData
'
import
{
GET_USERINFO
}
from
'
./mutation-types.js
'
export
default
{
export
default
{
getData
({
commit
,
state
})
{
async
getUserInfo
({
cityGuess
().
then
(
res
=>
{
commit
,
commit
(
GET_DATA
,
{
data
:
res
})
state
})
})
{
},
let
res
=
await
getUser
();
commit
(
GET_USERINFO
,
res
)
},
}
}
\ No newline at end of file
src/store/index.js
浏览文件 @
b6a87f72
...
@@ -13,7 +13,12 @@ const state = {
...
@@ -13,7 +13,12 @@ const state = {
shopDetail
:
null
,
//商家详情信息
shopDetail
:
null
,
//商家详情信息
userInfo
:
null
,
//用户信息
userInfo
:
null
,
//用户信息
remarkText
:
null
,
remarkText
:
null
,
inputText
:
null
,
inputText
:
''
,
invoice
:
false
,
searchAddress
:
null
,
geohash
:
null
,
choosedAddress
:
null
,
addressIndex
:
null
,
}
}
export
default
new
Vuex
.
Store
({
export
default
new
Vuex
.
Store
({
...
...
src/store/mutation-types.js
浏览文件 @
b6a87f72
...
@@ -6,4 +6,8 @@ export const CLEAR_CART = 'CLEAR_CART'
...
@@ -6,4 +6,8 @@ export const CLEAR_CART = 'CLEAR_CART'
export
const
RECORD_SHOPDETAIL
=
'
RECORD_SHOPDETAIL
'
export
const
RECORD_SHOPDETAIL
=
'
RECORD_SHOPDETAIL
'
export
const
RECORD_USERINFO
=
'
RECORD_USERINFO
'
export
const
RECORD_USERINFO
=
'
RECORD_USERINFO
'
export
const
GET_USERINFO
=
'
GET_USERINFO
'
export
const
GET_USERINFO
=
'
GET_USERINFO
'
export
const
CONFIRM_REMARK
=
'
CONFIRM_REMARK
'
export
const
CONFIRM_REMARK
=
'
CONFIRM_REMARK
'
\ No newline at end of file
export
const
CONFIRM_INVOICE
=
'
CONFIRM_INVOICE
'
export
const
CHOOSE_SEARCH_ADDRESS
=
'
CHOOSE_SEARCH_ADDRESS
'
export
const
SAVE_GEOHASH
=
'
SAVE_GEOHASH
'
export
const
CHOOSE_ADDRESS
=
'
CHOOSE_ADDRESS
'
\ No newline at end of file
src/store/mutations.js
浏览文件 @
b6a87f72
...
@@ -8,6 +8,10 @@ import {
...
@@ -8,6 +8,10 @@ import {
RECORD_USERINFO
,
RECORD_USERINFO
,
GET_USERINFO
,
GET_USERINFO
,
CONFIRM_REMARK
,
CONFIRM_REMARK
,
CONFIRM_INVOICE
,
CHOOSE_SEARCH_ADDRESS
,
SAVE_GEOHASH
,
CHOOSE_ADDRESS
,
}
from
'
./mutation-types.js
'
}
from
'
./mutation-types.js
'
import
{
import
{
setStore
,
setStore
,
...
@@ -135,13 +139,19 @@ export default {
...
@@ -135,13 +139,19 @@ export default {
// 记录用户信息
// 记录用户信息
[
RECORD_USERINFO
](
state
,
info
)
{
[
RECORD_USERINFO
](
state
,
info
)
{
state
.
userInfo
=
info
;
state
.
userInfo
=
info
;
setStore
(
'
useInfo
'
,
info
);
let
validity
=
30
;
let
now
=
new
Date
();
now
.
setTime
(
now
.
getTime
()
+
validity
*
24
*
60
*
60
*
1000
);
document
.
cookie
=
"
USERID=
"
+
info
.
user_id
+
"
;expires=
"
+
now
.
toGMTString
();
document
.
cookie
=
"
SID=huRyTRd9QLij7NkbpHJoj3PQrx1eRiO6bAiw
"
+
"
;expires=
"
+
now
.
toGMTString
();
},
},
//从本地获取用户信息
//获取用户信息存入vuex
[
GET_USERINFO
](
state
)
{
[
GET_USERINFO
](
state
,
info
)
{
let
info
=
getStore
(
'
useInfo
'
);
if
(
!
info
.
message
)
{
if
(
info
)
{
state
.
userInfo
=
info
;
state
.
userInfo
=
JSON
.
parse
(
info
);
}
else
{
state
.
userInfo
=
null
;
}
}
},
},
//记录订单页面用户选择的备注, 传递给订单确认页面
//记录订单页面用户选择的备注, 传递给订单确认页面
...
@@ -151,5 +161,25 @@ export default {
...
@@ -151,5 +161,25 @@ export default {
})
{
})
{
state
.
remarkText
=
remarkText
;
state
.
remarkText
=
remarkText
;
state
.
inputText
=
inputText
;
state
.
inputText
=
inputText
;
},
//是否开发票
[
CONFIRM_INVOICE
](
state
,
invoice
)
{
state
.
invoice
=
invoice
;
},
//选择搜索的地址
[
CHOOSE_SEARCH_ADDRESS
](
state
,
place
)
{
state
.
searchAddress
=
place
;
},
//保存geohash
[
SAVE_GEOHASH
](
state
,
geohash
)
{
state
.
geohash
=
geohash
;
},
//选择的地址
[
CHOOSE_ADDRESS
](
state
,
{
address
,
index
})
{
state
.
choosedAddress
=
address
;
state
.
addressIndex
=
index
;
}
}
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录