Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uniapp_vedio
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
android
uniapp_vedio
Commits
e409bc2a
Commit
e409bc2a
authored
Dec 19, 2024
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
dd4daf8e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
496 deletions
+35
-496
coin-popup.vue
vedio/components/coin-popup/coin-popup.vue
+16
-74
vipback-popup.vue
vedio/components/vipback-popup/vipback-popup.vue
+18
-66
warehouse.vue
vedio/components/warehouse/warehouse.vue
+1
-3
bean-pop.vue
vedio/page-subs/sub_A/book-content/components/bean-pop.vue
+0
-353
No files found.
vedio/components/coin-popup/coin-popup.vue
View file @
e409bc2a
<
template
>
<
template
>
<uni-popup
type=
"bottom"
ref=
"coinPop"
:maskClick=
"false"
:safe-area=
'false'
:isMaskClick=
"false"
>
<uni-popup
type=
"bottom"
ref=
"coinPop"
:maskClick=
"false"
:safe-area=
'false'
:isMaskClick=
"false"
>
<view
class=
"body"
style=
"width: 100%;height: 100%;background-color: white;"
>
<view
class=
"body"
style=
"width: 100%;height: 100%;background-color: white;"
>
<scroll-view
scroll-y
>
<scroll-view
scroll-y
>
<view
style=
"display: flex;flex-direction: column;align-items: flex-end;margin-bottom: 10rpx;"
>
<view
style=
"display: flex;flex-direction: column;align-items: flex-end;margin-bottom: 10rpx;"
>
...
@@ -17,17 +14,12 @@
...
@@ -17,17 +14,12 @@
<view
class=
"pack-item"
:class=
"[
{active: index==selectedIndex}]"
<view
class=
"pack-item"
:class=
"[
{active: index==selectedIndex}]"
v-for='(item, index) in vipList' :key='index' @click="choosePack(item, index)">
v-for='(item, index) in vipList' :key='index' @click="choosePack(item, index)">
<view
style=
"display: flex;flex-direction: column;padding-left: 4rpx;"
>
<view
style=
"display: flex;flex-direction: column;padding-left: 4rpx;"
>
<view
class=
"price row"
>
<view
class=
"price row"
>
¥
{{
item
.
firstPayPrice
}}
元
¥
{{
item
.
firstPayPrice
}}
元
</view>
</view>
<view
class=
"name row"
v-if=
"item.title!=null&&item.title!=''"
>
<view
class=
"name row"
v-if=
"item.title!=null&&item.title!=''"
>
{{
item
.
title
}}
{{
item
.
title
}}
</view>
</view>
<view
class=
"origin row"
v-if=
"item.remarks!=null&&item.remarks!=''"
>
<view
class=
"origin row"
v-if=
"item.remarks!=null&&item.remarks!=''"
>
{{
item
.
remarks
}}
{{
item
.
remarks
}}
</view>
</view>
...
@@ -131,6 +123,7 @@
...
@@ -131,6 +123,7 @@
handleShow
()
{
handleShow
()
{
let
that
=
this
;
let
that
=
this
;
this
.
$refs
.
coinPop
.
open
(
'bottom'
);
this
.
$refs
.
coinPop
.
open
(
'bottom'
);
// 内容重置
// 内容重置
if
(
this
.
vipList
.
length
>
0
)
{
if
(
this
.
vipList
.
length
>
0
)
{
this
.
vipList
=
[];
this
.
vipList
=
[];
...
@@ -144,7 +137,6 @@
...
@@ -144,7 +137,6 @@
this
.
post
({
this
.
post
({
url
:
'/vip/getVipProductsV1'
,
url
:
'/vip/getVipProductsV1'
,
data
:
{
data
:
{
bookId
:
that
.
vedioId
bookId
:
that
.
vedioId
},
},
...
@@ -215,90 +207,40 @@
...
@@ -215,90 +207,40 @@
let
that
=
this
;
let
that
=
this
;
let
vipBean
=
this
.
vipList
[
this
.
selectedIndex
];
let
vipBean
=
this
.
vipList
[
this
.
selectedIndex
];
//
抖音
支付
//
快手
支付
this
.
post
({
this
.
post
({
url
:
'/vip/getVipPayParams/
douyin
'
,
url
:
'/vip/getVipPayParams/
kuaishou
'
,
data
:
{
data
:
{
bookId
:
that
.
vedioId
,
vedioId
:
that
.
point
<=
0
?
null
:
that
.
vedioId
,
os
:
that
.
os
,
pid
:
vipBean
.
pid
pid
:
vipBean
.
pid
},
},
showLoading
:
true
,
showLoading
:
true
,
success
:
({
success
:
({
data
data
})
=>
{
})
=>
{
that
.
ttPre
Pay
(
data
,
vipBean
.
largeType
);
that
.
ks
Pay
(
data
,
vipBean
.
largeType
);
}
}
});
});
},
},
ttPrePay
(
ttData
,
largeType
)
{
ksPay
(
ksData
,
largeType
)
{
// if (!ks.canIUse('requestOrder')) {
// message.notify('请升级抖音APP版本.');
// return
// }
uni
.
showLoading
({
title
:
'加载中...'
});
let
that
=
this
;
let
that
=
this
;
ks
.
requestOrder
({
ks
.
pay
({
data
:
ttData
.
params
.
data
,
serviceId
:
ksData
.
params
.
serviceId
,
byteAuthorization
:
ttData
.
params
.
byteAuthorization
,
orderInfo
:
ksData
.
params
.
orderInfo
,
success
(
res
)
{
paymentChannel
:
ksData
.
params
.
paymentChannel
,
that
.
ttPay
(
largeType
,
res
.
orderId
,
ttData
);
success
()
{
that
.
queryOrderStatus
(
largeType
,
ksData
.
tidStr
)
},
},
fail
(
res
)
{
fail
()
{
uni
.
hideLoading
();
message
.
notify
(
'支付失败'
);
console
.
log
(
'ttPrePay'
,
res
.
errMsg
);
// message.notify(res.errMsg);
},
},
});
})
},
ttPay
(
largeType
,
oid
,
ttData
)
{
uni
.
hideLoading
();
// if (!ks.canIUse('getOrderPayment')) {
// message.notify('请升级抖音APP版本!');
// return
// }
let
that
=
this
;
if
(
this
.
os
==
'ios'
)
{
// if (!ks.canIUse('getOrderPayment.object.imId')) {
// message.notify('请升级抖音APP版本~');
// return
// }
ks
.
getOrderPayment
({
orderId
:
oid
,
imId
:
ttData
.
imId
,
success
(
res
)
{
that
.
queryOrderStatus
(
largeType
,
ttData
.
tidStr
);
},
fail
(
res
)
{
console
.
log
(
'ios pay'
,
res
.
errMsg
);
// message.notify(res.errMsg);
},
});
}
else
{
tt
.
getOrderPayment
({
orderId
:
oid
,
success
(
res
)
{
that
.
queryOrderStatus
(
largeType
,
ttData
.
tidStr
);
},
fail
(
res
)
{
console
.
log
(
'android pay'
,
res
.
errMsg
);
// message.notify(res.errMsg);
},
});
}
},
},
queryOrderStatus
(
largeType
,
tid
)
{
queryOrderStatus
(
largeType
,
tid
)
{
let
that
=
this
;
let
that
=
this
;
this
.
post
({
this
.
post
({
data
:
{
data
:
{
tid
:
tid
tid
},
},
url
:
'/vip/queryVipOrder'
,
url
:
'/vip/queryVipOrder'
,
showLoading
:
true
,
showLoading
:
true
,
...
...
vedio/components/vipback-popup/vipback-popup.vue
View file @
e409bc2a
...
@@ -8,7 +8,8 @@
...
@@ -8,7 +8,8 @@
</text>
</text>
<view
style=
"display: flex;flex-direction: row;margin-top: 30rpx;"
>
<view
style=
"display: flex;flex-direction: row;margin-top: 30rpx;"
>
<view
style=
"font-size: 42rpx;color: #333232;margin-top: 18rpx;"
>
充
</view>
<view
style=
"font-size: 42rpx;color: #333232;margin-top: 18rpx;"
>
充
</view>
<view
style=
"font-size: 60rpx;color: #F32E2E;font-weight: 777;"
>
{{
vipBean2
.
firstPayPrice
}}
</view>
<view
style=
"font-size: 60rpx;color: #F32E2E;font-weight: 777;"
>
{{
vipBean2
.
firstPayPrice
}}
</view>
<view
style=
"font-size: 42rpx;color: #333232;margin-top: 18rpx;"
>
元
</view>
<view
style=
"font-size: 42rpx;color: #333232;margin-top: 18rpx;"
>
元
</view>
</view>
</view>
<text
style=
"margin-top: 30rpx; font-size: 38rpx; color: #F32E2E"
>
<text
style=
"margin-top: 30rpx; font-size: 38rpx; color: #F32E2E"
>
...
@@ -74,7 +75,7 @@
...
@@ -74,7 +75,7 @@
showdialog
()
{
showdialog
()
{
this
.
$refs
.
vipback
.
open
();
this
.
$refs
.
vipback
.
open
();
console
.
log
(
'vipback-'
,
this
.
vipBean
);
console
.
log
(
'vipback-'
,
this
.
vipBean
);
if
(
tt
.
getSystemInfoSync
().
platform
===
'ios'
)
{
if
(
ks
.
getSystemInfoSync
().
platform
===
'ios'
)
{
this
.
os
=
'ios'
;
this
.
os
=
'ios'
;
}
}
},
},
...
@@ -86,83 +87,34 @@
...
@@ -86,83 +87,34 @@
let
that
=
this
;
let
that
=
this
;
//
抖音
支付
//
快手
支付
this
.
post
({
this
.
post
({
url
:
'/vip/getVipPayParams/
douyin
'
,
url
:
'/vip/getVipPayParams/
kuaishou
'
,
data
:
{
data
:
{
os
:
that
.
os
,
vedioId
:
that
.
point
<=
0
?
null
:
that
.
vedioId
,
pid
:
that
.
vipBean
.
pid
pid
:
vipBean
.
pid
},
},
showLoading
:
true
,
showLoading
:
true
,
success
:
({
success
:
({
data
data
})
=>
{
})
=>
{
that
.
ttPrePay
(
data
,
that
.
vipBean
.
largeType
);
that
.
ksPay
(
data
,
vipBean
.
largeType
);
}
}
});
});
},
},
ttPrePay
(
ttData
,
largeType
)
{
ksPay
(
ksData
,
largeType
)
{
if
(
!
tt
.
canIUse
(
'requestOrder'
))
{
message
.
notify
(
'请升级抖音APP版本.'
);
return
}
tt
.
showLoading
({
title
:
'加载中...'
});
let
that
=
this
;
let
that
=
this
;
tt
.
requestOrder
({
ks
.
pay
({
data
:
ttData
.
params
.
data
,
serviceId
:
ksData
.
params
.
serviceId
,
byteAuthorization
:
ttData
.
params
.
byteAuthorization
,
orderInfo
:
ksData
.
params
.
orderInfo
,
success
(
res
)
{
paymentChannel
:
ksData
.
params
.
paymentChannel
,
that
.
ttPay
(
largeType
,
res
.
orderId
,
ttData
);
success
()
{
that
.
queryOrderStatus
(
largeType
,
ksData
.
tidStr
)
},
},
fail
(
res
)
{
fail
()
{
tt
.
hideLoading
();
message
.
notify
(
'支付失败'
);
console
.
log
(
'ttPrePay'
,
res
.
errMsg
);
// message.notify(res.errMsg);
},
},
});
})
},
ttPay
(
largeType
,
oid
,
ttData
)
{
tt
.
hideLoading
();
if
(
!
tt
.
canIUse
(
'getOrderPayment'
))
{
message
.
notify
(
'请升级抖音APP版本!'
);
return
}
let
that
=
this
;
if
(
this
.
os
==
'ios'
)
{
if
(
!
tt
.
canIUse
(
'getOrderPayment.object.imId'
))
{
message
.
notify
(
'请升级抖音APP版本~'
);
return
}
tt
.
getOrderPayment
({
orderId
:
oid
,
imId
:
ttData
.
imId
,
success
(
res
)
{
that
.
queryOrderStatus
(
largeType
,
ttData
.
tidStr
);
},
fail
(
res
)
{
console
.
log
(
'ios pay'
,
res
.
errMsg
);
// message.notify(res.errMsg);
},
});
}
else
{
tt
.
getOrderPayment
({
orderId
:
oid
,
success
(
res
)
{
that
.
queryOrderStatus
(
largeType
,
ttData
.
tidStr
);
},
fail
(
res
)
{
console
.
log
(
'android pay'
,
res
.
errMsg
);
// message.notify(res.errMsg);
},
});
}
},
},
queryOrderStatus
(
largeType
,
tid
)
{
queryOrderStatus
(
largeType
,
tid
)
{
let
that
=
this
;
let
that
=
this
;
...
...
vedio/components/warehouse/warehouse.vue
View file @
e409bc2a
...
@@ -87,9 +87,7 @@
...
@@ -87,9 +87,7 @@
},
},
readyCategory
()
{
readyCategory
()
{
setTimeout
(()
=>
{
this
.
initHeight
()
this
.
initHeight
()
},
300
)
},
},
getCategoryData
()
{
getCategoryData
()
{
getCategorys
((
success
,
data
)
=>
{
getCategorys
((
success
,
data
)
=>
{
...
...
vedio/page-subs/sub_A/book-content/components/bean-pop.vue
deleted
100644 → 0
View file @
dd4daf8e
<
template
>
<uni-popup
ref=
'beanpop'
type=
"bottom"
:is-mask-click=
'false'
:safe-area=
'false'
@
maskClick=
'tapMask'
>
<view
class=
"setting-box"
>
<view
class=
"section"
>
<view
class=
"title"
>
充值书豆,订阅全本
</view>
<view
class=
"pack-box"
>
<view
class=
"pack-item"
:class=
"[
{active: index==selectedIndex}]" v-for='(item, index) in packData'
:key='index' @click="choosePack(item, index)">
<view
class=
"name row"
>
{{
item
.
title
}}
</view>
<view
class=
"price row"
>
¥
{{
item
.
price
}}
</view>
<view
class=
"cut-down"
v-if=
'item.giveNumber'
>
赠送
{{
item
.
giveNumber
}}
书豆
</view>
</view>
</view>
</view>
<view
class=
"section"
>
<button
class=
"c-button_clear c-button-size_lg c-button-width_full apply-button"
:disabled=
"loading"
:loading=
"loading"
@
click=
"tapPay"
>
立即购买
</button>
</view>
<view
class=
"safe-placeholder"
:style=
"[safePlacehoderStyle]"
>
</view>
</view>
</uni-popup>
</
template
>
<
script
>
import
SystemInfoMixin
from
"../../../../common/mixins/system-info-mixin.js"
;
import
BookBeanPack
from
"../../../../common/models/BookBeanPack.js"
import
{
getBookBeanPackData
,
getOpenId
,
getPayInfo
,
ENUM_PAY_TYPE
}
from
"../../../../common/services/index.js"
;
import
PayInfo
from
"../../../../common/models/PayInfo.js"
import
{
watchUserInfoChange
,
removeUserInfoChangeWatch
,
showLoginView
,
refreshUserInfo
}
from
"../../../../common/services/userServices.js"
import
{
toastMessage
}
from
"../../../../common/utils/toastUtil.js"
;
import
{
px2rpx
}
from
"../../../../common/utils/util.js"
;
export
default
{
mixins
:
[
SystemInfoMixin
],
props
:
{
show
:
{
type
:
Boolean
,
default
:
false
}
},
data
:
function
()
{
return
{
showPop
:
false
,
userInfo
:
null
,
packData
:
[],
selectedIndex
:
0
,
loading
:
false
}
},
computed
:
{
safePlacehoderStyle
:
function
()
{
let
height
=
0
;
if
(
this
.
bottomSafeHeight
)
{
height
=
height
+
px2rpx
(
this
.
bottomSafeHeight
)
}
return
{
height
:
`
${
height
}
rpx`
}
},
beanCount
:
function
()
{
if
(
this
.
userInfo
)
return
this
.
userInfo
.
bookLegumes
;
return
0
;
}
},
watch
:
{
show
:
function
(
n
)
{
this
.
showPop
=
n
;
},
showPop
:
function
(
n
,
o
)
{
if
(
n
==
o
)
return
;
if
(
n
)
{
this
.
open
();
}
else
{
this
.
close
();
}
}
},
onReady
()
{
watchUserInfoChange
((
info
)
=>
{
this
.
userInfo
=
info
.
userInfo
;
},
this
)
},
onUnload
()
{
removeUserInfoChangeWatch
(
this
);
},
mounted
()
{
this
.
requestPackData
();
},
methods
:
{
open
()
{
this
.
$refs
.
beanpop
.
open
();
},
close
()
{
this
.
$emit
(
'close'
)
this
.
$refs
.
beanpop
.
close
();
},
tapMask
()
{
this
.
showPop
=
false
;
},
requestPackData
()
{
getBookBeanPackData
((
success
,
data
)
=>
{
uni
.
stopPullDownRefresh
()
if
(
success
)
{
this
.
packData
=
data
.
map
(
item
=>
{
return
new
BookBeanPack
(
item
)
})
}
})
},
choosePack
(
item
,
index
)
{
this
.
selectedIndex
=
index
;
},
tapPay
()
{
let
isIOS
=
uni
.
getSystemInfoSync
().
platform
==
"ios"
&&
false
if
(
isIOS
)
{
uni
.
showModal
({
title
:
"提示"
,
content
:
"由于相关规范,iOS功能暂不可用"
})
}
else
{
if
(
!
this
.
userInfo
)
{
uni
.
showModal
({
title
:
"登录"
,
content
:
"购买前请前往登录系统"
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
showLoginView
()
}
}
})
return
;
}
if
(
this
.
loading
)
return
;
let
pack
=
this
.
packData
[
this
.
selectedIndex
];
this
.
loading
=
true
;
let
sysLoginFn
=
(
successCB
)
=>
{
uni
.
login
({
provider
:
"weixin"
,
onlyAuthorize
:
true
,
success
:
(
res
)
=>
{
if
(
res
)
{
if
(
typeof
successCB
==
'function'
)
successCB
(
res
);
}
else
{
this
.
loading
=
false
;
}
},
fail
:
(
error
)
=>
{
this
.
loading
=
false
;
}
})
}
let
getOpenIdFn
=
(
code
,
successCB
)
=>
{
getOpenId
(
code
,
(
success
,
data
)
=>
{
if
(
success
)
{
if
(
typeof
successCB
==
'function'
)
successCB
(
data
);
}
else
{
this
.
loading
=
false
;
}
})
}
let
getPayInfoFn
=
(
openId
,
successCB
)
=>
{
getPayInfo
(
pack
.
id
,
pack
.
price
,
openId
,
(
success
,
data
)
=>
{
if
(
success
)
{
if
(
typeof
successCB
==
'function'
)
successCB
(
new
PayInfo
(
data
));
}
else
{
this
.
loading
=
false
;
}
},
ENUM_PAY_TYPE
.
BEAN
.
value
)
}
let
payOrderFn
=
(
payInfo
,
successCB
)
=>
{
// uni.requestPayment({
// timeStamp: payInfo.timeStamp,
// nonceStr: payInfo.nonceStr,
// package: payInfo.packageStr,
// signType: payInfo.signType,
// paySign: payInfo.paySign,
// success: (res) => {
// if (typeof successCB == 'function') successCB(res);
// },
// fail: (error) => {
// this.loading = false;
// }
// })
// 头条支付
if
(
!
tt
.
canIUse
(
'requestOrder'
))
{
toastMessage
(
'请升级抖音APP版本!'
)
return
}
if
(
!
tt
.
canIUse
(
'getOrderPayment'
))
{
toastMessage
(
'请升级抖音APP版本~'
)
return
}
tt
.
requestOrder
({
data
:
payInfo
.
params
.
data
,
byteAuthorization
:
payInfo
.
params
.
byteAuthorization
,
success
(
res
)
{
tt
.
getOrderPayment
({
orderId
:
res
.
oid
,
success
(
res2
)
{
if
(
typeof
successCB
==
'function'
)
successCB
(
res2
);
},
fail
(
res2
)
{
console
.
log
(
'android=ttPay res.errMsg'
,
res2
)
},
});
},
fail
(
res
)
{
console
.
log
(
'requestOrder res.errMsg'
,
res
)
},
});
}
sysLoginFn
((
code
)
=>
{
getOpenIdFn
(
code
.
code
,
(
openId
)
=>
{
getPayInfoFn
(
openId
,
(
payInfo
)
=>
{
payOrderFn
(
payInfo
,
(
data
)
=>
{
this
.
loading
=
false
;
toastMessage
(
'购买成功'
)
refreshUserInfo
();
})
})
})
})
}
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.setting-box
{
display
:
flex
;
flex-direction
:
column
;
background
:
#fff
;
padding-top
:
20rpx
;
border-top-left-radius
:
15rpx
;
border-top-right-radius
:
15rpx
;
.section
{
padding
:
0
30rpx
;
display
:
flex
;
flex-direction
:
column
;
background
:
#fff
;
.title
{
margin
:
10rpx
auto
;
font-size
:
32rpx
;
font-weight
:
700
;
color
:
#333
;
}
.pack-box
{
margin-top
:
25rpx
;
margin-left
:
40rpx
;
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
flex-wrap
:
wrap
;
.active
{
border
:
6rpx
solid
#fd5350
!
important
;
}
.pack-item
{
margin-bottom
:
25rpx
;
margin-right
:
40rpx
;
width
:
calc
(
31%
-
40rpx
);
height
:
200rpx
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
space-around
;
background
:
#f5f5f5
;
border
:
6rpx
solid
#f5f5f5
;
border-radius
:
10rpx
;
position
:
relative
;
.row
{
margin
:
8rpx
15rpx
0
15rpx
;
}
.row
:last-child
{
margin-bottom
:
8rpx
;
}
.name
{
font-size
:
26rpx
;
font-weight
:
700
;
color
:
#333
;
}
.price
{
font-size
:
30rpx
;
color
:
#fd5350
;
font-weight
:
700
;
}
.origin
{
font-size
:
22rpx
;
color
:
#333
;
text-decoration
:
line-through
;
}
.cut-down
{
position
:
absolute
;
top
:
0
;
right
:
0
;
color
:
#fff
;
background
:
#ff502f
;
font-size
:
22rpx
;
border-radius
:
15rpx
;
height
:
30rpx
;
line-height
:
30rpx
;
padding
:
0
10rpx
;
transform
:
translate
(
0
,
-50%
);
}
}
}
.apply-button
{
border-radius
:
50rpx
;
background
:
#e8c8ae
;
color
:
#8d5a29
;
margin
:
30rpx
auto
;
}
}
}
</
style
>
\ No newline at end of file
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