Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-h5-ailipay
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 14df3b3d
authored
Mar 22, 2023
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'dev_v4.17.0' into 'develop'
Dev v4.17.0 See merge request
!4
2 parents
1f0b0e7c
17b0476d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
133 additions
and
161 deletions
src/main.js
src/router/router.js
src/router/routes.js
src/views/alipay/index.vue
src/main.js
View file @
14df3b3
...
...
@@ -41,12 +41,12 @@ Vue.prototype.to = function (name, params) {
// import 'lib-flexible/flexible.js'
import
VConsole
from
'vconsole'
var
baseConfig
=
{
axios
:
{
appkey
:
'd7ffc3346fc9a45bccaaa35300d59022'
,
secret
:
'4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
}
}
//
var baseConfig = {
//
axios: {
//
appkey: 'd7ffc3346fc9a45bccaaa35300d59022',
//
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
//
}
//
}
import
*
as
Sentry
from
'@sentry/vue'
import
{
BrowserTracing
}
from
'@sentry/tracing'
...
...
@@ -66,6 +66,38 @@ process.env.NODE_ENV === 'production' &&
// We recommend adjusting this value in production
tracesSampleRate
:
1.0
})
let
baseConfig
=
{
// 系统名字
sysName
:
'嘀加支付宝h5系统'
,
// // 系统说明
// "subName": '让你的生意慧简单',
// 是否需要注册-true;false
hasReg
:
false
,
// 是否需要配置账号权限;true-有权限,从后台获取权限信息;false-无需权限
hasAuth
:
false
,
vconsole
:
false
,
env
:
'production'
,
appId
:
'2021003142677540'
,
// "appId": "2016081500252788",
// "css_url": 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/index.css',
axios
:
{
// "baseURL": "http://192.168.3.226:9203/rop-dj-smartcarlife/router",
// "baseURL": "https://dj.dev.glsx.com.cn",
// "baseURL": "http://192.168.3.226:9711",
baseURL
:
'https://dj.glsx.com.cn'
,
appkey
:
'd7ffc3346fc9a45bccaaa35300d59022'
,
secret
:
'4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
,
timeout
:
50000
,
result
:
{
data_key
:
'data'
,
message_key
:
'message'
,
code_key
:
'code'
,
code_success_value
:
0
,
code_message_map
:
{}
}
}
}
window
.
$fetchConfig
=
baseConfig
// const isMock = ['prod', 'production'].includes(process.env.NODE_ENV)
// 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
...
...
@@ -82,37 +114,46 @@ fetch('https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-c
)
.
then
(
response
=>
{
console
.
log
(
response
)
const
{
code
,
data
}
=
response
code
==
'200'
&&
((
baseConfig
=
data
),
(
window
.
$fetchConfig
=
data
))
if
(
code
==
'200'
)
{
console
.
log
(
data
)
baseConfig
=
data
console
.
log
(
'baseConfig'
,
baseConfig
)
window
.
$fetchConfig
=
data
}
else
{
baseConfig
=
response
window
.
$fetchConfig
=
response
}
// && ((baseConfig = data), (window.$fetchConfig = data))
})
.
catch
(
el
=>
{
// console.log(el)
baseConfig
=
{
sysName
:
'嘀加支付宝h5系统'
,
hasReg
:
false
,
hasAuth
:
false
,
vconsole
:
true
,
env
:
'develop'
,
axios
:
{
baseURL
:
'http://192.168.3.226:9711'
,
appkey
:
'48e5e13229b82c1b4e6e8c96151f0637'
,
secret
:
'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
,
timeout
:
50000
,
result
:
{
data_key
:
'data'
,
message_key
:
'message'
,
code_key
:
'code'
,
code_success_value
:
0
,
code_message_map
:
{}
}
}
}
//
baseConfig = {
//
sysName: '嘀加支付宝h5系统',
//
hasReg: false,
//
hasAuth: false,
//
vconsole: true,
//
env: 'develop',
//
axios: {
//
baseURL: 'http://192.168.3.226:9711',
//
appkey: '48e5e13229b82c1b4e6e8c96151f0637',
//
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
//
timeout: 50000,
//
result: {
//
data_key: 'data',
//
message_key: 'message',
//
code_key: 'code',
//
code_success_value: 0,
//
code_message_map: {}
//
}
//
}
//
}
})
.
finally
(()
=>
{
init
()
})
function
init
()
{
console
.
log
(
baseConfig
,
'baseConfig'
)
baseConfig
.
vconsole
&&
new
VConsole
()
new
Vue
({
router
,
...
...
src/router/router.js
View file @
14df3b3
...
...
@@ -39,7 +39,8 @@ router.beforeEach((to, from, next) => {
// console.log(AlipayClient)
// 开发调试用可以先把这个逻辑取消
if
(
!
AlipayClient
&&
to
.
path
!==
'/tipsPage'
)
return
next
(
'/tipsPage'
)
const
isDev
=
process
.
env
.
NODE_ENV
==
'development'
if
(
!
isDev
&&
!
AlipayClient
&&
to
.
path
!==
'/tipsPage'
)
return
next
(
'/tipsPage'
)
// if (/MicroMessenger/.test(window.navigator.userAgent)) {
// alert('微信客户端')
...
...
src/router/routes.js
View file @
14df3b3
// const pages = {
// coupon: [{
// name: 'index',
// meta: {
// isTab: true
// }
// },
// {
// name: 'verificationList',
// meta: {
// title: '核销列表',
// keepAlive: true
// }
// },
// {
// name: 'verificationDetail',
// meta: {
// title: '核销详情',
// keepAlive: true
// }
// },
// {
// name: 'goodsVerification',
// meta: {
// title: '核销订单',
// keepAlive: true
// }
// }
// ],
// activity: [
// {
// name: 'index',
// meta: {
// isTab: true,
// keepAlive: true,
// backgroundColor: '#F7F7F7'
// },
// }
// ],
// merchant: [
// {
// name: 'index',
// meta: {
// keepAlive: true,
// isIndex: true,
// backgroundColor: '#F7F7F7',
// title: '店铺中心'
// }
// }
// ],
// gift:[
// {
// name:'index',
// meta: {
// title:'定向礼包',
// backgroundColor: '#F7F7F7'
// }
// },
// {
// name:'detail',
// meta: {
// title:'定向礼包',
// backgroundColor: '#F7F7F7'
// }
// },
// {
// name:'create',
// meta: {
// title:'定向礼包',
// backgroundColor: '#F7F7F7'
// }
// }
// ]
// }
const
routes
=
[
// {
// path:'/',
...
...
src/views/alipay/index.vue
View file @
14df3b3
<
template
>
<div>
<div
v-if=
"unpaid"
>
<div
class=
"pay-container"
@
click
.
stop=
"handleHiddenKey"
>
<div
class=
"pay-container"
@
click
.
stop=
"handleHiddenKey"
>
<div
class=
"pay-header payCompanyInfo"
>
<img
class=
"shopIcon"
src=
"../images/shopIcon.png"
/>
<div
class=
"company"
>
<img
class=
"shopIcon"
src=
"../images/shopIcon.png"
/>
<div
class=
"company"
v-if=
"isYqType"
>
<div
class=
"company-name"
>
深圳市嘀加智慧云服务有限公司
</div>
<div
class=
"company-yqd"
>
{{
merchantName
}}
</div>
<div
class=
"company-yqd"
>
{{
merchantName
}}
</div>
</div>
<div
class=
"company center"
v-else
>
<!--
<div
class=
""
>
深圳市嘀加智慧云服务有限公司
</div>
-->
<div
class=
"company-name"
>
{{
shopMerchantName
}}
</div>
</div>
</div>
<div
class=
"pay-main"
>
<div
class=
"pay-input-wrapper"
@
click
.
stop=
"handleShowKey"
>
<div
class=
"pay-input-wrapper"
@
click
.
stop=
"handleShowKey"
>
<span
class=
"pay-icon"
>
金额
</span>
<div
v-show=
"payMoney"
class=
"pay-money"
>
{{
payMoney
}}
</div>
<div
v-show=
"!keyHidden"
class=
"pay-cursor"
/>
<div
v-show=
"payMoney"
class=
"pay-money"
>
{{
payMoney
}}
</div>
<div
v-show=
"!keyHidden"
class=
"pay-cursor"
/>
<div
class=
"pay-after-icon"
>
元
</div>
</div>
<div
class=
"userCollaborationContainer"
v-if=
"userCollaborationName"
>
<div
class=
"userCollaborationContainer"
v-if=
"userCollaborationName"
>
<!--
<label
class=
"radio"
>
value="
{{
userCollaborationCheck
}}
" -->
<input
type=
"radio"
class=
"radio"
@
click=
"handleRadio"
:checked=
"userCollaborationCheck"
/>
<div
class=
"label"
@
click=
"handleRadio"
>
我已阅读并同意
</div>
<input
type=
"radio"
class=
"radio"
@
click=
"handleRadio"
hold-keyboard
:checked=
"userCollaborationCheck"
/>
<div
class=
"label"
@
click=
"handleRadio"
>
我已阅读并同意
</div>
<!--
</label>
-->
<div
class=
"linkText"
@
click=
"navToUserCollaboration"
>
《
{{
userCollaborationName
}}
》
</div>
<div
class=
"linkText"
@
click=
"navToUserCollaboration"
>
《
{{
userCollaborationName
}}
》
</div>
</div>
</div>
</div>
<div
class=
"keyboard "
:class=
"
{ 'hind_box': !keyHidden }">
<div
class=
"keyboard "
:class=
"
{ 'hind_box': !keyHidden }">
<div
class=
"key-box"
>
<div
class=
"number-box clearfix"
>
<!-- data-key="
{{
item
}}
" -->
<div
v-for=
"(item,index) in KeyboardKeys"
:key=
"index"
class=
"key"
:class=
"
{ 'key-zero':index == 9 }"
hover-class="number-box-hover"
@click="handleKey(item)">
{{
item
}}
<div
v-for=
"(item, index) in KeyboardKeys"
:key=
"index"
class=
"key"
:class=
"
{ 'key-zero': index == 9 }"
hover-class="number-box-hover" @click="handleKey(item)">
{{
item
}}
</div>
</div>
<div
class=
"btn-box"
>
<!-- data-key="" -->
<div
class=
"key deletKey"
hover-class=
"number-box-hover"
@
click=
"handleKey('X')"
>
<img
class=
"deletIcon"
src=
"../images/deleteIcon.png"
/>
<div
class=
"key deletKey"
hover-class=
"number-box-hover"
@
click=
"handleKey('X')"
>
<img
class=
"deletIcon"
src=
"../images/deleteIcon.png"
/>
</div>
<div
class=
"key pay_btn "
:class=
"
{ 'pay-btn-display':!payMoney
&&
canPay}"
hover-class="pay-btn-hover"
@click="handlePay">
<div
class=
"key pay_btn "
:class=
"
{ 'pay-btn-display': !payMoney
&&
canPay }" hover-class="pay-btn-hover"
@click="handlePay">
付款
</div>
</div>
...
...
@@ -70,10 +53,9 @@
</div>
<div
v-if=
"!unpaid"
>
<div
class=
"success-Container"
>
<div
class=
"amountOfMoney"
>
¥
{{
payMoney
}}
</div>
<div
class=
"amountOfMoney"
>
¥
{{
payMoney
}}
</div>
<div
class=
"success-tips"
>
<img
class=
"successIcon"
src=
"../images/successIcon.png"
/>
<img
class=
"successIcon"
src=
"../images/successIcon.png"
/>
支付成功
</div>
<div
class=
"line"
/>
...
...
@@ -83,18 +65,17 @@
</div>
<div
class=
"orderInfo"
>
<div
class=
"label"
>
商户名称
</div>
<div
class=
"info"
>
{{
merchantName
}}
</div>
<div
class=
"info"
>
{{
merchantName
}}
</div>
</div>
<div
class=
"orderInfo"
>
<div
class=
"label"
>
支付订单号
</div>
<div
class=
"info"
>
{{
outTradeNo
}}
</div>
<div
class=
"info"
>
{{
outTradeNo
}}
</div>
</div>
<div
class=
"orderInfo"
>
<div
class=
"label"
>
支付时间
</div>
<div
class=
"info"
>
{{
dataTime
}}
</div>
<div
class=
"info"
>
{{
dataTime
}}
</div>
</div>
<img
class=
"logoIcon"
src=
"../images/djLogin.png"
/>
<img
class=
"logoIcon"
src=
"../images/djLogin.png"
/>
</div>
</div>
</div>
...
...
@@ -110,6 +91,8 @@ export default {
KeyboardKeys
:
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
0
,
'.'
],
merchantId
:
''
,
merchantName
:
''
,
shopMerchantId
:
''
,
shopMerchantName
:
''
,
payMoney
:
''
,
// 支付金额
unPayMoneyList
:
[
'0'
,
'0.'
,
'0.0'
,
'0.00'
],
canPay
:
false
,
...
...
@@ -131,7 +114,8 @@ export default {
tradeNO
:
''
,
// 测试用数据
// tradeNO: '2022083122001417721446143547'// 测试用数据
userCollaborationName
:
''
,
userCollaborationCheck
:
false
userCollaborationCheck
:
false
,
isYqType
:
true
}
},
mounted
()
{
...
...
@@ -139,19 +123,24 @@ export default {
console
.
log
(
baseConfig
)
const
{
appId
}
=
baseConfig
// console.log(appId)
const
{
merchantName
,
merchantId
}
=
this
.
getHrefParams
()
this
.
merchantId
=
merchantId
this
.
merchantName
=
merchantName
const
{
merchantName
,
merchantId
,
shopMerchantId
,
shopMerchantName
}
=
this
.
getHrefParams
()
// 区分是流量方还是导流方
if
(
merchantId
)
{
this
.
merchantId
=
merchantId
this
.
merchantName
=
merchantName
}
else
{
this
.
shopMerchantId
=
shopMerchantId
this
.
shopMerchantName
=
shopMerchantName
this
.
isYqType
=
false
}
console
.
log
(
appId
,
'appId'
)
// console.log('ap.getAuthCode', ap.getAuthCode)
// ap.alert(appId)
// 请求用户授权
ap
.
getAuthCode
({
// appId: '${appId}',
appId
,
// scopes: ['auth_user']
// 主动授权:auth_user,静默授权:auth_base。或者其它scope
scopes
:
[
'auth_base'
]
scopes
:
[
'auth_base'
]
// 主动授权:auth_user,静默授权:auth_base。或者其它scope
},
function
(
res
)
{
// ap.alert(JSON.stringify(res))
console
.
log
(
JSON
.
stringify
(
res
))
...
...
@@ -266,7 +255,7 @@ export default {
// 支付
handlePay
()
{
// const _this = this
const
{
payMoney
,
merchantId
,
unPayMoneyList
,
userId
,
userCollaborationName
,
userCollaborationCheck
}
=
this
const
{
payMoney
,
unPayMoneyList
,
userId
,
userCollaborationName
,
userCollaborationCheck
}
=
this
if
(
payMoney
===
''
||
unPayMoneyList
.
includes
(
payMoney
))
return
if
(
userCollaborationName
&&
!
userCollaborationCheck
)
{
return
this
.
showToast
(
`请先阅读并勾选《
${
userCollaborationName
}
》`
)
...
...
@@ -276,8 +265,9 @@ export default {
// if (userId) {
// return
// }
const
params
=
{
merchantId
,
//
merchantId,
// openId,
isMinipg
:
1
,
appid
:
baseConfig
.
appId
,
...
...
@@ -286,6 +276,11 @@ export default {
receivedMoney
:
payMoney
*
100
,
payType
:
4
}
if
(
this
.
isYqType
)
{
params
.
merchantId
=
this
.
merchantId
}
else
{
params
.
shopMerchantId
=
this
.
shopMerchantId
}
this
.
$toast
.
loading
({
message
:
'加载中...'
,
forbidClick
:
true
,
...
...
@@ -339,6 +334,7 @@ export default {
-ms-user-select
:
none
;
user-select
:
none
;
}
.clearfix
::after
{
content
:
''
;
display
:
table
;
...
...
@@ -358,15 +354,18 @@ export default {
/* flex-direction: column; */
/* flex-wrap: wrap; */
}
.userCollaborationContainer
{
display
:
flex
;
//
align-items
:
center
;
align-items
:
flex-start
;
margin-top
:
30px
;
//
font-size
:
28px
;
.radio
{
margin-top
:
9px
;
}
.label
{
margin-left
:
10px
;
min-width
:
240px
;
...
...
@@ -377,6 +376,7 @@ export default {
.linkText
{
color
:
#3582ee
;
}
.pay-header
.shopIcon
{
height
:
88px
;
width
:
88px
;
...
...
@@ -390,6 +390,10 @@ export default {
margin-left
:
20px
;
}
.pay-header
.company.center
{
justify-content
:
center
;
}
.company-name
{
font-size
:
32px
;
color
:
#333
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment