Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
new-sing
admin-base
Commits
028d86f2
Commit
028d86f2
authored
Sep 05, 2018
by
王
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单列表
parent
39b3c095
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23024 additions
and
6 deletions
+23024
-6
index.js
config/index.js
+2
-2
Address.vue
src/components/framework/address-picker/Address.vue
+185
-0
addr.js
src/components/framework/address-picker/addr.js
+22329
-0
dialog.vue
src/components/order/dialog.vue
+90
-0
index.vue
src/components/order/index.vue
+307
-2
refundDialog.vue
src/components/order/refundDialog.vue
+109
-0
api.js
src/service/api.js
+2
-2
No files found.
config/index.js
View file @
028d86f2
...
@@ -12,8 +12,8 @@ module.exports = {
...
@@ -12,8 +12,8 @@ module.exports = {
//本地代理设置
//本地代理设置
proxyTable
:
{
proxyTable
:
{
'/api'
:
{
'/api'
:
{
//
target: 'http://local.base-api.sing.com', // 接口的域名
target
:
'http://local.base-api.sing.com'
,
// 接口的域名
target
:
'https://admin_test.changchangenglish.com/'
,
//
target: 'https://admin_test.changchangenglish.com/',
changeOrigin
:
true
,
// 如果接口跨域,需要进行这个参数配置
changeOrigin
:
true
,
// 如果接口跨域,需要进行这个参数配置
}
}
},
},
...
...
src/components/framework/address-picker/Address.vue
0 → 100644
View file @
028d86f2
<
template
>
<div
class=
"address"
>
<section
style=
"width:100%; height: 100%;"
>
<el-form
:model=
'form'
class=
'demo-ruleForm'
ref=
'form'
label-width=
"100px"
:rules=
'rules'
>
<el-row
:gutter=
'20'
>
<el-col
:span=
'20'
>
<el-form-item
prop=
'name'
label=
"收货人"
>
<el-input
v-model=
"form.name"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
'20'
>
<el-col
:span=
'20'
>
<el-form-item
prop=
'mobile'
label=
"手机号"
>
<el-input
v-model=
"form.mobile"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
'20'
class=
'address'
>
<el-col
:span=
'20'
>
<el-form-item
prop=
'province'
label=
"省"
>
<el-select
v-model=
'form.province'
placeholder=
'请选择省'
@
change=
'proChange'
>
<el-option
v-for=
'item in provinces'
:key=
'item.value'
:value=
'item.value'
:label=
"item.label"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
'20'
class=
'address'
>
<el-col
:span=
'20'
>
<el-form-item
prop=
'city'
label=
"市"
>
<el-select
v-model=
'form.city'
placeholder=
'请选择市'
@
change=
'cityChange'
>
<el-option
v-for=
'item in cities'
:key=
'item.value'
:value=
'item.value'
:label=
"item.label"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
'20'
class=
'address'
>
<el-col
:span=
'20'
>
<el-form-item
prop=
'district'
label=
"县/区"
>
<el-select
v-model=
'form.district'
placeholder=
'请选择区/县'
@
change=
'districtChange'
>
<el-option
v-for=
'item in districts'
:key=
'item.value'
:value=
'item.value'
:label=
"item.label"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
'20'
class=
'address'
>
<el-col
:span=
'20'
>
<el-form-item
prop=
'detail'
label=
"详细地址"
>
<el-input
placeholder=
'请填写详细地址'
:number=
'true'
v-model=
'form.detail'
>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</section>
</div>
</
template
>
<
script
>
import
Address
from
'./addr.js'
let
type
=
1
// let provinceValue = 2
// let cityValue = 52
//根据apid查找对象
function
findcity
(
item
)
{
return
item
.
type
==
type
;
}
function
findChildren
(
list
,
value
)
{
let
filtered
=
list
.
filter
((
item
)
=>
{
return
item
.
value
===
value
})
return
filtered
[
0
].
children
}
//筛选出各省级对象
let
pObj
=
Address
.
filter
(
findcity
)
export
default
{
name
:
'vueAddress'
,
props
:
[
'province'
,
'city'
,
'district'
,
'detail'
,
'name'
,
'mobile'
],
created
()
{
},
mounted
()
{
let
vm
=
this
vm
.
show
=
vm
.
showAddressPicker
},
computed
:
{
cities
:
function
()
{
if
(
this
.
form
.
province
){
return
findChildren
(
pObj
,
this
.
form
.
province
)
}
else
{
return
[]
}
},
districts
:
function
()
{
if
(
this
.
form
.
city
){
return
findChildren
(
this
.
cities
,
this
.
form
.
city
)
}
else
{
return
[]
}
}
},
data
()
{
return
{
rules
:
{
province
:
[{
required
:
true
,
message
:
'请选择省份'
,
trigger
:
'change'
}],
city
:
[{
required
:
true
,
message
:
'请选择城市'
,
trigger
:
'change'
}],
district
:
[{
required
:
true
,
message
:
'请选择区/县'
,
trigger
:
'change'
}],
detail
:
[{
required
:
true
,
message
:
'请填写详细地址'
,
trigger
:
'change'
}],
name
:
[{
required
:
true
,
message
:
'请填写收货人'
,
trigger
:
'change'
}],
mobile
:
[{
required
:
true
,
message
:
'请填写手机号'
,
trigger
:
'change'
}]
},
form
:
{
province
:
this
.
province
,
city
:
this
.
city
,
district
:
this
.
district
,
detail
:
this
.
detail
,
name
:
this
.
name
,
mobile
:
this
.
mobile
},
provinces
:
pObj
}
},
watch
:
{
form
:
{
handler
:
function
(
val
)
{
this
.
$emit
(
'change'
,
val
);
},
deep
:
true
}
},
methods
:
{
proChange
:
function
(
val
,
oldVal
)
{
if
(
oldVal
)
{
this
.
form
.
city
=
''
;
this
.
form
.
detail
=
''
;
}
this
.
form
.
city
=
this
.
cities
[
0
].
value
;
},
cityChange
:
function
(
val
,
oldVal
)
{
this
.
form
.
district
=
this
.
districts
[
0
].
value
;
},
districtChange
:
function
(
val
,
oldVal
)
{
if
(
oldVal
)
{
this
.
form
.
detail
=
''
;
}
},
detailChange
:
function
(
val
)
{
console
.
log
(
val
);
}
}
}
</
script
>
<
style
scoped
>
.mint-popup
{
width
:
100%
;
}
.footer-btn
{
box-sizing
:
border-box
;
position
:
fixed
;
width
:
100%
;
z-index
:
2
;
left
:
0
;
bottom
:
3rem
;
}
.input
{
border
:
none
;
}
.padding
{
padding
:
1.5rem
;
font-size
:
1.4rem
;
}
.float-right
{
float
:
right
;
}
</
style
>
src/components/framework/address-picker/addr.js
0 → 100644
View file @
028d86f2
This diff is collapsed.
Click to expand it.
src/components/order/dialog.vue
0 → 100644
View file @
028d86f2
<
template
>
<el-dialog
title=
"编辑收货地址"
center
append-to-body
:visible
.
sync=
"dialogObj.show"
width=
"800px"
>
<vue-address
:province=
"dialogObj.province"
:city=
"dialogObj.city"
:district=
"dialogObj.district"
:detail=
"dialogObj.detail"
:mobile=
"dialogObj.receive_mobile"
:name=
"dialogObj.receive_name"
@
change=
"handlerAddressChange"
>
</vue-address>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogObj.show = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"saveAddress"
>
保 存
</el-button>
</div>
</el-dialog>
</
template
>
<
script
>
// import {getCategoryApi} from "../../service/api";
import
vueAddress
from
'../framework/address-picker/Address'
import
AddressArray
from
'../framework/address-picker/addr'
export
default
{
name
:
"dialogObj"
,
props
:[
'dialogObj'
],
data
(){
return
{
}
},
methods
:{
handlerAddressChange
(
val
)
{
if
(
!
val
.
province
||
!
val
.
city
||
!
val
.
district
){
return
}
this
.
dialogObj
.
detail
=
val
.
detail
;
this
.
dialogObj
.
province
=
val
.
province
;
this
.
dialogObj
.
city
=
val
.
city
;
this
.
dialogObj
.
district
=
val
.
district
;
this
.
dialogObj
.
receive_mobile
=
val
.
mobile
;
this
.
dialogObj
.
receive_name
=
val
.
name
;
let
provinceObj
=
AddressArray
.
filter
((
item
)
=>
{
return
item
.
value
===
val
.
province
})
let
cityObj
=
provinceObj
[
0
].
children
.
filter
((
city
)
=>
{
return
city
.
value
===
val
.
city
})
let
districtObj
=
cityObj
[
0
].
children
.
filter
((
district
)
=>
{
return
district
.
value
===
val
.
district
})
this
.
dialogObj
.
province_name
=
provinceObj
[
0
].
label
;
this
.
dialogObj
.
city_name
=
cityObj
[
0
].
label
;
this
.
dialogObj
.
district_name
=
districtObj
.
length
>
0
?
districtObj
[
0
].
label
:
''
;
},
saveAddress
()
{
let
json
=
{
province_id
:
this
.
dialogObj
.
province
,
province_name
:
this
.
dialogObj
.
province_name
,
city_id
:
this
.
dialogObj
.
city
,
city
:
this
.
dialogObj
.
city_name
,
area
:
this
.
dialogObj
.
district_name
,
area_id
:
this
.
dialogObj
.
district
,
address
:
this
.
dialogObj
.
detail
,
receive_name
:
this
.
dialogObj
.
receive_name
,
receive_mobile
:
this
.
dialogObj
.
receive_mobile
};
this
.
$emit
(
"reflash"
);
// Service.updateUserAddress(json, this.dialogObj.user_id, this.dialogObj.pay_id).then(res=>{
// if(res.data.result=='success'){
// this.$message.success(res.data.message);
// this.$emit("reflash");
// }else{
// this.$message.error(res.data.message);
// }
// })
},
},
components
:{
vueAddress
},
mounted
(){
}
}
</
script
>
<
style
scoped
lang=
"less"
>
.dialog-footer{
display: block;
text-align: center;
}
</
style
>
src/components/order/index.vue
View file @
028d86f2
This diff is collapsed.
Click to expand it.
src/components/order/refundDialog.vue
0 → 100644
View file @
028d86f2
<
template
>
<el-dialog
title=
"退款"
center
append-to-body
:visible
.
sync=
"show"
width=
"800px"
>
<div
v-loading=
"loading"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
>
<el-row>
<el-col
:span=
"4"
><label>
退款金额
</label></el-col>
<el-col
:span=
"8"
>
<el-form-item
prop=
"key"
>
<el-input
v-model=
"form.money"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"4"
><label>
退款原因
</label></el-col>
<el-col
:span=
"8"
>
<el-form-item>
<el-input
v-model=
"form.desc"
type=
"textarea"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"show = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"save"
>
确 定
</el-button>
</span>
</div>
</el-dialog>
</
template
>
<
script
>
import
{
refundApi
}
from
"../../service/api"
;
export
default
{
name
:
"dialogObj"
,
props
:[
'dialogObj'
],
data
(){
return
{
show
:
false
,
id
:
''
,
loading
:
true
,
form
:{
money
:
0
,
desc
:
''
},
rules
:{
money
:[
{
required
:
true
,
message
:
'请输入退款金额'
,
trigger
:
'change'
}
],
desc
:[
{
required
:
true
,
message
:
'请输入退款原因'
,
trigger
:
'change'
}
]
}
}
},
methods
:{
save
(){
if
(
this
.
dialogObj
.
id
){
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
){
let
json
=
{
refund_money
:
parseFloat
(
this
.
form
.
money
)
*
100
,
desc
:
this
.
form
.
desc
}
refundApi
(
this
.
dialogObj
.
id
,
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'退款成功!'
});
this
.
$emit
(
"reflash"
);
this
.
show
=
false
;
})
}
});
}
},
initDialog
(){
console
.
log
(
'initDialog'
)
this
.
show
=
this
.
dialogObj
.
show
;
if
(
this
.
dialogObj
.
id
)
{
this
.
id
=
this
.
dialogObj
.
id
;
}
this
.
form
.
money
=
parseFloat
(
this
.
dialogObj
.
money
/
100
);
this
.
form
.
desc
=
this
.
dialogObj
.
desc
;
this
.
loading
=
false
}
},
watch
:{
dialogObj
:{
handler
:
function
()
{
this
.
initDialog
()
},
deep
:
true
},
show
(
value
){
this
.
$emit
(
"changeShow"
,
value
);
}
}
}
</
script
>
<
style
scoped
lang=
"less"
>
</
style
>
src/service/api.js
View file @
028d86f2
...
@@ -439,8 +439,8 @@ export const editOrderDescApi = function (orderId, type) {
...
@@ -439,8 +439,8 @@ export const editOrderDescApi = function (orderId, type) {
};
};
// 给用户退款
// 给用户退款
const
refundUrl
=
`
${
_baseUrl
}
api/admin/bill/refund/`
;
const
refundUrl
=
`
${
_baseUrl
}
api/admin/bill/refund/`
;
export
const
refundApi
=
function
(
id
)
{
export
const
refundApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$post
(
`
${
refundUrl
}${
id
}
`
)
return
Vue
.
prototype
.
$post
(
`
${
refundUrl
}${
id
}
`
,
json
)
}
;
}
;
// 修改订单收货地址
// 修改订单收货地址
const
editAddressUrl
=
`
${
_baseUrl
}
api/admin/order/address/`
;
const
editAddressUrl
=
`
${
_baseUrl
}
api/admin/order/address/`
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment