Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jd-vx-app
Project
Project
Details
Activity
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
Administrator
jd-vx-app
Commits
ca9b2b6e
Commit
ca9b2b6e
authored
May 26, 2022
by
lijiongliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
逻辑修改
parent
d21ca06c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
238 additions
and
138 deletions
+238
-138
api.js
common/api/api.js
+1
-1
home.vue
pages/home.vue
+22
-3
config.js
pages/login/config.js
+1
-1
main.vue
pages/main.vue
+23
-10
transitionPage.vue
pages/transitionPage.vue
+1
-2
getCoupon.vue
pagesA/pages/index/getCoupon.vue
+187
-119
loveCar.vue
pagesB/pages/move-car/loveCar.vue
+3
-2
No files found.
common/api/api.js
View file @
ca9b2b6e
const
baseUrl
=
'https://
jduniapp.uzosp.com/
/test-api'
;
const
baseUrl
=
'https://
r.ucaret.cn
/test-api'
;
// const baseUrl = 'http://nrucci.natappfree.cc';
// const baseUrl = 'http://nrucci.natappfree.cc';
const
httpRequest
=
(
opts
,
data
)
=>
{
const
httpRequest
=
(
opts
,
data
)
=>
{
let
httpDefaultOpts
=
{
let
httpDefaultOpts
=
{
...
...
pages/home.vue
View file @
ca9b2b6e
...
@@ -140,6 +140,16 @@
...
@@ -140,6 +140,16 @@
}
else
{
}
else
{
this
.
pooupCoupon
=
false
this
.
pooupCoupon
=
false
this
.
timerNum
=
3
this
.
timerNum
=
3
uni
.
navigateToMiniProgram
({
appId
:
'wx91d27dbf599dff74'
,
// 跳转目标小程序的id
path
:
'pages/item/detail/detail?sku=100023585323'
,
// 目标小程序的页面路径
extraData
:
{
// 需要携带的参数
},
success
(
res
)
{
// 打开成功
}
})
clearInterval
(
timer
)
clearInterval
(
timer
)
}
}
},
1000
)
},
1000
)
...
@@ -158,8 +168,17 @@
...
@@ -158,8 +168,17 @@
},
},
// 已领取优惠券按钮
// 已领取优惠券按钮
goBuy
(){
goBuy
(){
this
.
pooupCoupon
=
false
uni
.
navigateToMiniProgram
({
console
.
log
(
"去购买11111"
)
appId
:
'wx91d27dbf599dff74'
,
// 跳转目标小程序的id
path
:
'pages/item/detail/detail?sku=100023585323'
,
// 目标小程序的页面路径
extraData
:
{
// 需要携带的参数
},
success
(
res
)
{
// 打开成功
this
.
pooupCoupon
=
false
}
})
},
},
getMoveCode
()
{
getMoveCode
()
{
let
opts
=
{
let
opts
=
{
...
@@ -216,9 +235,9 @@
...
@@ -216,9 +235,9 @@
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'/pages/transitionPage'
url
:
'/pages/transitionPage'
});
});
uni
.
setStorageSync
(
'firstCoupon'
,
true
)
// let url = "car.m.jd.com/h5/list.html?final-action=closewebview&source=licenseprocedure"
// let url = "car.m.jd.com/h5/list.html?final-action=closewebview&source=licenseprocedure"
// util.redirectToH5({page:url})
// util.redirectToH5({page:url})
// uni.setStorageSync('firstCoupon',true)
}
else
{
}
else
{
// uni.navigateTo({
// uni.navigateTo({
// url: '/pagesA/pages/index/getPrice?orderId=' + this.freeCode.id
// url: '/pagesA/pages/index/getPrice?orderId=' + this.freeCode.id
...
...
pages/login/config.js
View file @
ca9b2b6e
...
@@ -27,7 +27,7 @@ export let config = {
...
@@ -27,7 +27,7 @@ export let config = {
// 微信快捷登录按钮样式
// 微信快捷登录按钮样式
userPlaceholder
:
''
,
userPlaceholder
:
''
,
// 帐密登录的 placeholder
// 帐密登录的 placeholder
loginBtnStyle
:
'color:
red
'
,
loginBtnStyle
:
'color:
#fff
'
,
// 帐密登录界面登录按钮样式
// 帐密登录界面登录按钮样式
tabStyle
:
'color:green'
,
tabStyle
:
'color:green'
,
//帐密和手机号登录tab样式
//帐密和手机号登录tab样式
...
...
pages/main.vue
View file @
ca9b2b6e
...
@@ -54,16 +54,29 @@
...
@@ -54,16 +54,29 @@
// 领券判断
// 领券判断
let
firstCoupon
=
uni
.
getStorageSync
(
'firstCoupon'
)
||
false
let
firstCoupon
=
uni
.
getStorageSync
(
'firstCoupon'
)
||
false
if
(
firstCoupon
){
if
(
firstCoupon
){
let
opts
=
{
url
:
'/app/user/send/coupon'
,
method
:
'post'
};
// let opts = { url: '/app/user/send/coupon', method: 'post' };
this
.
http
.
httpTokenRequest
(
opts
,
{}).
then
(
res
=>
{
// this.http.httpTokenRequest(opts, {}).then(res => {
if
(
res
.
data
.
code
==
200
){
// if(res.data.code == 200){
uni
.
removeStorageSync
(
'firstCoupon'
)
uni
.
showToast
({
// }
title
:
"领取成功!"
,
// })
icon
:
'none'
,
uni
.
removeStorageSync
(
'firstCoupon'
)
});
uni
.
showToast
({
}
title
:
"领取成功!"
,
})
icon
:
'none'
,
});
setTimeout
(()
=>
{
uni
.
navigateToMiniProgram
({
appId
:
'wx91d27dbf599dff74'
,
// 跳转目标小程序的id
path
:
'pages/item/detail/detail?sku=100023585323'
,
// 目标小程序的页面路径
extraData
:
{
// 需要携带的参数
},
success
(
res
)
{
// 打开成功
}
})
},
600
)
}
}
},
},
onReachBottom
()
{
onReachBottom
()
{
...
...
pages/transitionPage.vue
View file @
ca9b2b6e
...
@@ -10,9 +10,8 @@
...
@@ -10,9 +10,8 @@
}
}
},
},
onLoad
(){
onLoad
(){
let
url
=
"car.m.jd.com/h5/list.html?final-action=closewebview&source=licenseprocedure"
let
url
=
"
https://
car.m.jd.com/h5/list.html?final-action=closewebview&source=licenseprocedure"
util
.
redirectToH5
({
page
:
url
})
util
.
redirectToH5
({
page
:
url
})
uni
.
setStorageSync
(
'firstCoupon'
,
true
)
}
}
}
}
</
script
>
</
script
>
...
...
pagesA/pages/index/getCoupon.vue
View file @
ca9b2b6e
<
template
>
<
template
>
<view
class=
"appCotent"
>
<view
class=
"appCotent"
>
<!-- 我的订单 -->
<!-- 我的订单 -->
<view
class=
"get-coupon"
>
<view
class=
"get-coupon"
>
<view
class=
"box"
>
<view
class=
"box"
>
<image
src=
"../../../static/index/coupon1.png"
></image>
<image
src=
"../../../static/index/coupon1.png"
></image>
<view
class=
"title"
>
<view
class=
"title"
>
<view
style=
"margin-bottom:20rpx;"
>
<view
style=
"margin-bottom:20rpx;"
>
领取优惠券
领取优惠券
</view>
<view>
免费购买京东挪车牌
</view>
</view>
</view>
<view>
免费购买京东挪车牌
<view
class=
"btn"
@
click=
"getCoupon"
>
点击领取优惠券
</view>
</view>
</view>
</view>
<view
class=
"btn"
@
click=
"getCoupon"
>
<!-- 领取成功后弹框 -->
点击领取优惠券
<view
class=
"pooup-success"
v-if=
"pooupSuccess"
>
</view>
<view
class=
"success-box"
>
</view>
<image
src=
"../../../static/index/coupon2.png"
></image>
<view
class=
"title"
>
<!-- 领取成功后弹框 -->
<view
style=
"margin-bottom:10rpx;font-weight: bold;"
>
<view
class=
"pooup-success"
v-if=
"pooupSuccess"
>
优惠券领取成功
<view
class=
"success-box"
>
</view>
<image
src=
"../../../static/index/coupon2.png"
></image>
<view
class=
""
>
<view
class=
"title"
>
正在跳转中......(
{{
timerNum
}}
秒)
<view
style=
"margin-bottom:10rpx;font-weight: bold;"
>
</view>
优惠券领取成功
</view>
</view>
<view
class=
""
>
<view
class=
"
success-btn"
@
click=
"goUseCoupon
"
>
正在跳转中......(
{{
timerNum
}}
秒)
去使用
</view>
</view>
</view>
<view
class=
"success-btn"
@
click=
"goUseCoupon"
>
去使用
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
data
(){
data
()
{
return
{
return
{
pooupSuccess
:
false
,
pooupSuccess
:
false
,
timerNum
:
3
timerNum
:
3
}
}
},
},
methods
:{
methods
:
{
getCoupon
(){
getCoupon
()
{
// let opts = { url: '/app/user/send/coupon', method: 'post' };
let
opts
=
{
url
:
'/app/user/send/coupon'
,
method
:
'post'
};
// this.http.httpTokenRequest(opts, {}).then(res => {
// this.http.httpTokenRequest(opts, {}).then(res => {
// console.log(res.data,1111111)
// console.log(res.data,
1111111)
// if
(res.data.code == 200)
{
// if
(res.data.code == 200)
{
// uni.showToast({
// uni.showToast({
// title: "领取成功!",
// title: "领取成功!",
// icon: 'none',
// icon: 'none',
// });
// });
// this.pooupSuccess = true
// let timer = setInterval(() => {
// if (this.timerNum > 0) {
// this.timerNum--
// } else {
// this.pooupSuccess = false
// this.timerNum = 3
// uni.navigateToMiniProgram({
// appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
// path: 'pages/item/detail/detail?sku=100023585323', // 目标小程序的页面路径
// extraData: { // 需要携带的参数
// },
// success(res) {
// // 打开成功
// }
// })
// clearInterval(timer)
// }
// }, 1000)
// }
// }
// })
// })
// uni.showToast({
// title: "领取成功!",
// icon: 'none',
// });
this
.
pooupSuccess
=
true
this
.
pooupSuccess
=
true
let
timer
=
setInterval
(()
=>
{
let
timer
=
setInterval
(()
=>
{
if
(
this
.
timerNum
>
0
)
{
if
(
this
.
timerNum
>
0
)
{
this
.
timerNum
--
this
.
timerNum
--
}
else
{
}
else
{
this
.
pooupSuccess
=
false
this
.
pooupSuccess
=
false
this
.
timerNum
=
3
this
.
timerNum
=
3
uni
.
navigateToMiniProgram
({
appId
:
'wx91d27dbf599dff74'
,
// 跳转目标小程序的id
path
:
'pages/item/detail/detail?sku=100023585323'
,
// 目标小程序的页面路径
extraData
:
{
// 需要携带的参数
},
success
(
res
)
{
// 打开成功
}
})
clearInterval
(
timer
)
clearInterval
(
timer
)
}
}
},
1000
)
},
1000
)
console
.
log
(
"已领取优惠券111111"
)
},
},
goUseCoupon
(){
goUseCoupon
()
{
console
.
log
(
"去使用优惠券222222"
)
uni
.
navigateToMiniProgram
({
appId
:
'wx91d27dbf599dff74'
,
// 跳转目标小程序的id
path
:
'pages/item/detail/detail?sku=100023585323'
,
// 目标小程序的页面路径
extraData
:
{
// 需要携带的参数
},
success
(
res
)
{
// 打开成功
this
.
pooupSuccess
=
false
}
})
}
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.get-coupon
{
.get-coupon
{
width
:
100%
;
height
:
100vh
;
width
:
100%
;
display
:
flex
;
height
:
100vh
;
align-items
:
center
;
justify-content
:
center
;
.box
{
width
:
584rpx
;
height
:
664rpx
;
position
:
relative
;
top
:
-120rpx
;
text-align
:
center
;
.title
{
width
:
100%
;
font-size
:
40rpx
;
font-weight
:
bold
;
position
:
absolute
;
top
:
80rpx
;
left
:
0
;
z-index
:
10
;
color
:
#9A4315
;
}
image
{
width
:
100%
;
height
:
100%
;
position
:
absolute
;
top
:
0
;
left
:
0
;
}
.btn
{
width
:
400rpx
;
line-height
:
80rpx
;
position
:
absolute
;
bottom
:
80rpx
;
left
:
50%
;
margin-left
:
-190rpx
;
z-index
:
10
;
text-align
:
center
;
color
:
#853116
;
font-weight
:
bold
;
font-size
:
32rpx
;
border-radius
:
50rpx
;
background
:
linear-gradient
(
180deg
,
#FFE0B2
,
#FFCB78
);
box-shadow
:
0
6rpx
13rpx
1
rgba
(
175
,
10
,
17
,
0
.17
)
,
-3rpx
-4rpx
7rpx
0
rgba
(
173
,
28
,
14
,
0
.35
);
}
}
.pooup-success
{
position
:
fixed
;
top
:
0
;
right
:
0
;
bottom
:
0
;
left
:
0
;
background-color
:
rgba
(
0
,
0
,
0
,.
5
);
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
z-index
:
100
;
.success-box
{
.box
{
width
:
580rpx
;
height
:
700rpx
;
width
:
584rpx
;
border-radius
:
20rpx
;
height
:
664rpx
;
text-align
:
center
;
position
:
relative
;
position
:
relative
;
top
:
-120rpx
;
top
:
-120rpx
;
image
{
text-align
:
center
;
.title
{
width
:
100%
;
font-size
:
40rpx
;
font-weight
:
bold
;
position
:
absolute
;
position
:
absolute
;
top
:
0
;
left
:
0
;
top
:
80rpx
;
width
:
100%
;
height
:
100%
;
left
:
0
;
z-index
:
-11
;
z-index
:
10
;
color
:
#9A4315
;
}
}
.title
{
width
:
100%
;
image
{
color
:
#fff
;
width
:
100%
;
height
:
100%
;
position
:
absolute
;
position
:
absolute
;
bottom
:
220rpx
;
left
:
0
;
top
:
0
;
font-size
:
32rpx
;
left
:
0
;
}
}
.success-btn
{
width
:
360rpx
;
height
:
80rpx
;
.btn
{
line-height
:
80rpx
;
width
:
400rpx
;
line-height
:
80rpx
;
position
:
absolute
;
position
:
absolute
;
bottom
:
64rpx
;
left
:
50%
;
bottom
:
80rpx
;
margin-left
:
-170rpx
;
left
:
50%
;
border-radius
:
50rpx
;
margin-left
:
-190rpx
;
font-size
:
36rpx
;
z-index
:
10
;
background
:
linear-gradient
(
0deg
,
#F3AA37
,
#F37A37
);
text-align
:
center
;
color
:
#fff
;
color
:
#853116
;
font-weight
:
bold
;
font-size
:
32rpx
;
border-radius
:
50rpx
;
background
:
linear-gradient
(
180deg
,
#FFE0B2
,
#FFCB78
);
box-shadow
:
0
6rpx
13rpx
1
rgba
(
175
,
10
,
17
,
0
.17
)
,
-3rpx
-4rpx
7rpx
0
rgba
(
173
,
28
,
14
,
0
.35
);
}
}
.pooup-success
{
position
:
fixed
;
top
:
0
;
right
:
0
;
bottom
:
0
;
left
:
0
;
background-color
:
rgba
(
0
,
0
,
0
,
.5
);
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
z-index
:
100
;
.success-box
{
width
:
580rpx
;
height
:
700rpx
;
border-radius
:
20rpx
;
text-align
:
center
;
position
:
relative
;
top
:
-120rpx
;
image
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
z-index
:
-11
;
}
.title
{
width
:
100%
;
color
:
#fff
;
position
:
absolute
;
bottom
:
220rpx
;
left
:
0
;
font-size
:
32rpx
;
}
.success-btn
{
width
:
360rpx
;
height
:
80rpx
;
line-height
:
80rpx
;
position
:
absolute
;
bottom
:
64rpx
;
left
:
50%
;
margin-left
:
-170rpx
;
border-radius
:
50rpx
;
font-size
:
36rpx
;
background
:
linear-gradient
(
0deg
,
#F3AA37
,
#F37A37
);
color
:
#fff
;
}
}
}
}
}
}
}
}
</
style
>
</
style
>
\ No newline at end of file
pagesB/pages/move-car/loveCar.vue
View file @
ca9b2b6e
...
@@ -69,8 +69,9 @@ export default {
...
@@ -69,8 +69,9 @@ export default {
// uni.navigateTo({
// uni.navigateTo({
// url: '/pagesB/pages/move-car/addCar'
// url: '/pagesB/pages/move-car/addCar'
// })
// })
let
url
=
"car.m.jd.com/h5/list.html?final-action=closewebview&source=licenseprocedure"
uni
.
navigateTo
({
util
.
redirectToH5
({
page
:
url
})
url
:
'/pages/transitionPage'
});
},
},
editCar
(
id
)
{
editCar
(
id
)
{
uni
.
navigateTo
({
uni
.
navigateTo
({
...
...
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