Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SuperMan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
罗超
SuperMan
Commits
4f9a83d5
Commit
4f9a83d5
authored
Sep 11, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增页面
parent
3991e9e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
329 additions
and
11 deletions
+329
-11
payMall.vue
src/components/commonPage/payMall.vue
+313
-0
goodlist.vue
src/components/mall/goodlist.vue
+16
-11
No files found.
src/components/commonPage/payMall.vue
0 → 100644
View file @
4f9a83d5
<
template
>
<div
class=
"templatePayURL"
style=
"display: inline-block; float: right; margin-right: 10px;"
>
<el-popover
width=
"320"
trigger=
"manual"
v-model=
"visible"
>
<div>
<p
style=
"margin:0 0 15px 0;"
>
二维码收款
<i
class=
"el-icon-circle-close-outline fr"
style=
"cursor: pointer; margin: 3px 0 0 0;"
@
click=
"closePic()"
></i>
</p>
<div
style=
"margin: 15px 0;"
>
<el-input
placeholder=
"请输入金额"
v-model=
"payMoney"
@
input=
"payMoney=/^\d+\.?\d
{0,2}$/.test(payMoney)||payMoney == '' ? payMoney : payMoney=''">
<el-select
class=
'fz12 w120'
v-model=
"payType"
slot=
"prepend"
placeholder=
"请选择费用类型"
filterable
:readonly=
"false"
>
<el-option
v-for=
'item in fylxList'
:label=
"item.Name"
:value=
"item.ID"
:key=
'item.ID'
>
</el-option>
</el-select>
</el-input>
<p
style=
"margin: 15px 0; text-indent:5px;"
>
<el-radio
v-model=
"payWay"
label=
"3"
>
支付宝
</el-radio>
<el-radio
v-model=
"payWay"
label=
"1"
>
微信
</el-radio>
</p>
<p>
<input
type=
"button"
@
click=
"getPayPic(item)"
class=
"normalBtn w280"
value=
"生成收款码"
/>
</p>
</div>
<div
>
<img
:src=
"payPic"
style=
"float: left; margin-right: 15px; width: 150px; height: 150px; border: 1px solid #ccc;"
/>
<p
style=
"padding-right: 10px; font-size: 12px; line-height: 20px; margin-bottom: 10px;"
>
<span
style=
"color: #E95252;"
>
{{
payWay
==
"1"
?
'微信'
:
'支付宝'
}}
</span>
二维码有效时间为5分钟,为了不影响客户支付,请及时转发,以免失效
</p>
<p
class=
"fz12 color333"
>
倒计时
</p>
<p
style=
"color: #E95252; font-weight: bold; font-size: 12px; margin: 8px 0;"
>
{{
descMin
}}
分
{{
descSecond
}}
秒
</p>
</div>
</div>
</el-popover>
</div>
</
template
>
<
script
>
export
default
{
props
:
[
"item"
,
"showID"
],
data
()
{
return
{
value
:
''
,
visible
:
false
,
payObj
:
{},
payWay
:
'3'
,
minpay
:
'0'
,
payMoney
:
'0'
,
payType
:
''
,
lastTime
:
''
,
isShowPic
:
true
,
payPic
:
''
,
isDesc
:
false
,
descMin
:
0
,
descSecond
:
0
,
descHour
:
0
,
fylxList
:
[],
isShowId
:
-
1
,
checkValue
:
''
,
begin
:
0
,
nowDate
:
new
Date
(),
timer
:
null
,
chaTime
:
0
};
},
watch
:
{
showID
:
{
handler
:
function
(
val
,
oldVal
)
{
this
.
isShowId
=
val
;
if
(
val
!=
this
.
item
.
orderId
)
{
this
.
visible
=
false
;
this
.
value
=
''
;
if
(
this
.
timer
)
{
clearInterval
(
this
.
timer
)
}
}
},
deep
:
true
}
},
mounted
()
{
this
.
getFylx
()
},
methods
:
{
closePic
()
{
this
.
visible
=
false
this
.
value
=
''
if
(
this
.
timer
)
{
clearInterval
(
this
.
timer
)
}
},
chanceType
(
obj
)
{
let
TCIDARR
=
[]
TCIDARR
.
push
(
obj
.
tcid
)
if
(
this
.
value
===
'1'
)
{
this
.
visible
=
true
this
.
getPayDetail
(
obj
,
2
)
this
.
$emit
(
"childByValue"
,
obj
.
orderId
)
}
else
if
(
this
.
value
===
'2'
)
{
this
.
visible
=
false
let
orderObj
=
{
OrderID
:
obj
.
orderId
,
OrderSource
:
8
,
Obj
:
{},
SourceID
:
obj
.
ID
,
TCIDList
:
TCIDARR
}
this
.
$router
.
push
({
name
:
'ChoiceAddFinancialDocuments'
,
query
:
{
"Type"
:
1
,
"companyID"
:
obj
.
outBranchId
,
"path"
:
""
,
'blank'
:
'y'
,
'orderObj'
:
JSON
.
stringify
(
orderObj
),
'tradeWay'
:
obj
.
tradeWay
,
'platformAccount'
:
obj
.
platformAccount
}
});
}
else
if
(
this
.
value
===
'3'
)
{
if
(
this
.
item
.
oP_Remarks
&&
this
.
item
.
oP_Remarks
!=
""
)
{
this
.
visible
=
false
let
orderObj
=
{
OrderID
:
obj
.
orderId
,
//订单号
OrderSource
:
8
,
//12
Obj
:
{},
SourceID
:
obj
.
ID
,
//机票id
TCIDList
:
TCIDARR
}
this
.
$router
.
push
({
name
:
'ChoiceAddFinancialDocuments'
,
query
:
{
"Type"
:
2
,
"companyID"
:
obj
.
outBranchId
,
//公司id
"path"
:
""
,
'blank'
:
'y'
,
'orderObj'
:
JSON
.
stringify
(
orderObj
)
}
});
}
else
{
this
.
Error
(
"请让OP先填写OP备注,说明退款情况"
);
}
}
else
if
(
this
.
value
===
'4'
)
{
this
.
visible
=
false
let
orderObj
=
{
OrderID
:
obj
.
orderId
,
OrderSource
:
8
,
CallType
:
1
,
Obj
:
{},
SourceID
:
obj
.
ID
,
TCIDList
:
TCIDARR
}
this
.
$router
.
push
({
name
:
'ChoiceAddFinancialDocuments'
,
query
:
{
"Type"
:
1
,
"companyID"
:
obj
.
outBranchId
,
"path"
:
""
,
'blank'
:
'y'
,
'orderObj'
:
JSON
.
stringify
(
orderObj
)
}
});
}
else
if
(
this
.
value
===
'5'
)
{
this
.
visible
=
false
let
orderObj
=
{
OrderID
:
obj
.
orderId
,
OrderSource
:
8
,
CallType
:
2
,
Obj
:
{},
TCIDList
:
[]
}
this
.
$router
.
push
({
name
:
'ChoiceAddFinancialDocuments'
,
query
:
{
"Type"
:
1
,
"companyID"
:
49
,
"templateID"
:
JSON
.
stringify
([
79
]),
"path"
:
""
,
'blank'
:
'y'
,
'orderObj'
:
JSON
.
stringify
(
orderObj
)
}
});
}
this
.
value
=
''
},
getPayDetail
(
obj
,
Type
)
{
let
nowTime
=
new
Date
()
let
ExpireDate
=
''
this
.
apipost
(
'OnlinePay_post_GetURL'
,
{
OrderID
:
obj
.
orderId
,
OrderSource
:
8
},
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
if
(
Object
.
keys
(
res
.
data
.
data
).
length
==
0
)
{
if
(
Type
==
2
)
{
this
.
getCodeUrl
(
obj
)
}
else
{
this
.
$message
.
warning
(
'未生成二维码'
)
}
}
else
{
this
.
lastTime
=
new
Date
(
res
.
data
.
data
.
ExpireDate
)
this
.
nowDate
=
new
Date
(
res
.
data
.
data
.
NowDate
)
this
.
chaTime
=
this
.
lastTime
-
this
.
nowDate
ExpireDate
=
new
Date
(
res
.
data
.
data
.
ExpireDate
)
this
.
timer
=
setInterval
(()
=>
{
this
.
descTime
(
this
.
chaTime
)
},
1000
);
this
.
payPic
=
res
.
data
.
data
.
CodeURL
this
.
isShowPic
=
true
}
}
},
err
=>
{})
},
getCodeUrl
(
obj
)
{
this
.
apipost
(
'Financial_post_GetLowPrice'
,
{
OrderID
:
obj
.
orderId
,
OrderResource
:
8
},
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
if
(
res
.
data
.
data
.
LowDeposit
!=
-
1
)
{
this
.
minpay
=
res
.
data
.
data
.
LowDeposit
this
.
payMoney
=
res
.
data
.
data
.
LowDeposit
>
this
.
item
.
preferPrice
?
this
.
item
.
preferPrice
:
res
.
data
.
data
.
LowDeposit
}
}
},
err
=>
{})
},
getPayPic
(
obj
)
{
let
msg
=
{}
msg
.
OrderSource
=
8
msg
.
body
=
obj
.
description
msg
.
attach
=
this
.
payType
+
'|'
+
obj
.
contactName
+
'|'
+
obj
.
orderId
+
'|'
+
obj
.
customerId
+
'|'
+
obj
.
outBranchId
msg
.
total_fee
=
this
.
payMoney
msg
.
payway
=
this
.
payWay
if
(
this
.
payType
==
''
)
{
this
.
$message
.
warning
(
'请选择费用类型!'
)
return
;
}
this
.
apipost
(
'OnlinePay_post_GetCodeUrl'
,
msg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
payPic
=
res
.
data
.
data
.
CodeURL
this
.
lastTime
=
new
Date
(
res
.
data
.
data
.
ExpireDate
)
this
.
nowDate
=
new
Date
(
res
.
data
.
data
.
NowDate
)
this
.
chaTime
=
this
.
lastTime
-
this
.
nowDate
this
.
begin
=
this
.
nowDate
.
getSeconds
()
this
.
timer
=
setInterval
(()
=>
{
this
.
descTime
(
this
.
chaTime
)
},
1000
);
this
.
isShowPic
=
true
}
else
{
this
.
$message
.
error
(
res
.
data
.
message
)
}
},
err
=>
{})
},
descTime
()
{
let
day
=
parseInt
(
this
.
chaTime
/
1000
/
60
/
60
/
24
)
let
hr
=
parseInt
(
this
.
chaTime
/
1000
/
60
/
60
%
24
)
let
min
=
parseInt
(
this
.
chaTime
/
1000
/
60
%
60
)
let
sec
=
parseInt
(
this
.
chaTime
/
1000
%
60
)
// 个位数前补零
hr
=
hr
>
9
?
hr
:
'0'
+
hr
min
=
min
>
9
?
min
:
'0'
+
min
sec
=
sec
>
9
?
sec
:
'0'
+
sec
// 控制台打印
if
(
this
.
chaTime
>
0
)
{
if
(
hr
>
0
)
{
this
.
descHour
=
hr
;
}
this
.
descMin
=
min
+
this
.
descHour
*
60
;
this
.
descSecond
=
sec
;
}
else
{
this
.
isShowPic
=
false
this
.
descMin
=
0
this
.
descSecond
=
0
this
.
descHour
=
0
clearInterval
(
this
.
timer
)
}
this
.
chaTime
-=
1000
// 一秒后递归
},
getFylx
()
{
this
.
apipost
(
'Financial_post_GetByOrderCostTypeList'
,
{
Type
:
1
},
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
fylxList
=
res
.
data
.
data
}
else
{}
},
err
=>
{})
},
},
};
</
script
>
<
style
>
.templatePayURL
.el-input--suffix
.el-input__inner
{
padding
:
0
10px
0
8px
!important
;
font-size
:
12px
;
}
.templatePayURL
.el-input__suffix
{
right
:
0
!important
;
}
</
style
>
src/components/mall/goodlist.vue
View file @
4f9a83d5
...
...
@@ -113,10 +113,10 @@
</
template
>
</td>
<td>
<el-button
type=
"primary"
size=
"small"
icon=
"iconfont icon-beizhu"
style=
"background:#AD9AF6; border-color:#AD9AF6; border-radius: 0;padding:4px;"
@
click=
"clreaMsg(),currentGoodsObj={},currentGoodsObj=item,calcTotalPrice(),orderDialog=true;"
>
下单
</el-button>
<el-button
type=
"primary"
size=
"small"
icon=
"iconfont icon-beizhu"
style=
"background:#AD9AF6; border-color:#AD9AF6; border-radius: 0;padding:4px;"
@
click=
"clreaMsg(),currentGoodsObj={},currentGoodsObj=item,calcTotalPrice(),orderDialog=true;"
>
下单
</el-button>
</td>
</tr>
</tbody>
...
...
@@ -196,7 +196,7 @@
</span>
</el-dialog>
<el-dialog
title=
"立即支付"
:visible
.
sync=
"payVisible"
width=
"400px"
>
<pay
urlItem1></payurlItem1
>
<pay
Mall
:item=
"payObj"
></payMall
>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"small"
@
click=
"payVisible = false"
>
取 消
</el-button>
</span>
...
...
@@ -204,10 +204,15 @@
</div>
</template>
<
script
>
import
pay
URL1
from
"../commonPage/payURL1
.vue"
;
import
pay
Mall
from
"../commonPage/payMall
.vue"
;
export
default
{
data
()
{
return
{
payObj
:
{
orderId
:
1
,
OrderSource
:
16
,
TotalPrice
:
0
,
},
statusValue
:
0
,
//请选择
//数据列表
DataList
:
[],
...
...
@@ -289,13 +294,13 @@
trigger
:
'change'
}],
},
orderDialog
:
false
,
orderDialog
:
false
,
goodVisible
:
false
,
payVisible
:
true
,
payVisible
:
true
,
};
},
components
:
{
pay
urlItem1
:
payURL1
,
pay
Mall
:
payMall
,
},
methods
:
{
...
...
@@ -426,7 +431,7 @@
res
=>
{
this
.
loading
=
false
;
if
(
res
.
data
.
resultCode
==
1
)
{
console
.
log
(
res
,
'数据'
);
console
.
log
(
res
,
'数据'
);
var
tempArray
=
res
.
data
.
data
.
pageData
;
if
(
tempArray
&&
tempArray
.
length
>
0
)
{
tempArray
.
forEach
(
item
=>
{
...
...
@@ -526,7 +531,7 @@
this
.
Success
(
"下单成功!"
);
this
.
clreaMsg
();
this
.
getGoodList
();
this
.
orderDialog
=
false
;
this
.
orderDialog
=
false
;
}
else
{
this
.
Error
(
res
.
data
.
message
);
}
...
...
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