Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
dd452f81
提交
dd452f81
authored
4月 10, 2019
作者:
sin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
解决选择订单列表,和订单之间的交互
上级
dad4d33d
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
48 行增加
和
24 行删除
+48
-24
package.json
mobile-web/package.json
+2
-1
order.vue
mobile-web/src/page/shipping/order.vue
+17
-18
list.vue
mobile-web/src/page/user/address/list.vue
+6
-5
order.js
mobile-web/src/store/order.js
+23
-0
没有找到文件。
mobile-web/package.json
浏览文件 @
dd452f81
...
...
@@ -12,7 +12,8 @@
"axios"
:
"^0.18.0"
,
"vant"
:
"^1.3.1"
,
"vue"
:
"^2.5.17"
,
"vue-router"
:
"^3.0.1"
"vue-router"
:
"^3.0.1"
,
"vuex"
:
"^3.1.0"
},
"devDependencies"
:
{
"@vue/cli-plugin-babel"
:
"^3.4.1"
,
...
...
mobile-web/src/page/shipping/order.vue
浏览文件 @
dd452f81
...
...
@@ -12,8 +12,8 @@
<strong>
选择地址
</strong>
</
template
>
<
template
v-else
>
<strong>
张三 138****6520
</strong>
<div>
广东省深圳市南山区科技园
</div>
<strong>
{{
addressData
.
name
}}
{{
addressData
.
mobile
}}
</strong>
<div>
{{
addressData
.
address
}}
</div>
</
template
>
</van-cell>
<div
style=
"height:15px;"
></div>
...
...
@@ -57,12 +57,16 @@
<
script
>
import
{
createOrder
}
from
'../../api/order'
;
import
orderStore
from
'../../store/order'
import
eventBus
from
'../eventBus'
;
export
default
{
data
()
{
return
{
type
:
"add1"
,
type
:
"add"
,
addressData
:
{
},
products
:
[
{
imageURL
:
...
...
@@ -105,7 +109,7 @@
onSubmit
()
{
this
.
$toast
(
"点击按钮"
);
const
{
skuId
,
quantity
}
=
this
.
$route
.
query
;
const
userAddressId
=
1
;
const
userAddressId
=
this
.
addressData
.
id
;
const
remark
=
''
;
const
orderItems
=
[{
...
...
@@ -120,23 +124,18 @@
})
},
},
mounted
:
function
()
{
if
(
this
.
$store
.
state
.
addressData
.
name
)
{
this
.
type
=
'add1'
;
}
else
{
this
.
type
=
'add'
;
}
this
.
addressData
=
this
.
$store
.
state
.
addressData
;
},
activated
()
{
console
.
log
(
'activated'
)
//根据key名获取传递回来的参数,data就是map
// eventBus.$on('selectaddress', function(data){
// //赋值给首页的附近医院数据模型
// console.log('selectaddress', data);
// }.bind(this));
//根据key名获取传递回来的参数,data就是map
this
.
$on
(
'selectaddress'
,
function
(
data
)
{
//赋值给首页的附近医院数据模型
console
.
log
(
'selectaddress'
,
data
);
}.
bind
(
this
));
},
store
:
orderStore
,
};
</
script
>
...
...
mobile-web/src/page/user/address/list.vue
浏览文件 @
dd452f81
...
...
@@ -18,6 +18,7 @@
import
{
GetAddressList
}
from
"../../../api/user.js"
;
import
{
AddressList
}
from
'vant'
;
import
eventBus
from
'../../eventBus'
;
import
orderStore
from
'../../../store/order'
export
default
{
components
:
{
...
...
@@ -43,9 +44,9 @@
if
(
!
this
.
isSelect
)
{
return
;
}
this
.
$
emit
(
'selectaddress'
,
item
);
//传递一个map,choiceHospital是key,hospital是value
// eventBus.$emit('selectaddress',item
);
this
.
$
store
.
commit
(
'changeAddressData'
,
{
...
item
}
);
this
.
$router
.
go
(
-
1
);
}
},
...
...
@@ -62,8 +63,8 @@
}
});
})
}
}
,
store
:
orderStore
,
}
</
script
>
...
...
mobile-web/src/store/order.js
0 → 100644
浏览文件 @
dd452f81
import
Vue
from
'vue'
import
Vuex
from
'vuex'
Vue
.
use
(
Vuex
);
// 挂载
export
default
new
Vuex
.
Store
({
state
:
{
addressData
:
{
},
},
mutations
:
{
changeAddressData
:
function
(
state
,
payload
)
{
state
.
addressData
=
payload
;
}
},
actions
:
{
},
getters
:
{
}
});
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论