Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
zhwy
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 3c1540d9
authored
Oct 07, 2023
by
杨北旺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复bug
1 parent
a1b7d371
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
33 deletions
api/env/index.js
packageEquity/pages/gCoupons/index.js
packageSaveMoney/pages/detail/detail.js
api/env/index.js
View file @
3c1540d
import
{
preReleaseAppId
}
from
'~/config'
import
{
preReleaseAppId
}
from
'~/config'
const
target
=
[
'ip'
,
'dev'
,
'uat'
,
'prod'
,
'preRelease'
]
const
target
=
[
'ip'
,
'dev'
,
'uat'
,
'prod'
,
'preRelease'
]
let
index
=
1
let
index
=
4
/**
/**
*
*
...
...
packageEquity/pages/gCoupons/index.js
View file @
3c1540d
import
{
IMG_URL
}
from
'~/config'
;
import
{
IMG_URL
}
from
'~/config'
;
import
NP
from
'number-precision'
Page
({
Page
({
data
:
{
data
:
{
IMGURL
:
IMG_URL
,
IMGURL
:
IMG_URL
,
handleStatus
:
0
handleStatus
:
0
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
if
(
options
.
id
)
{
if
(
options
.
couponId
)
{
this
.
getEquityCouponsDetail
(
options
.
i
d
)
this
.
getEquityCouponsDetail
(
options
.
couponI
d
)
}
}
},
},
// 查询优惠券详情
// 查询优惠券详情
getEquityCouponsDetail
(
id
){
getEquityCouponsDetail
(
id
)
{
wx
.
p
.
api
.
couponsApi
.
getEquityCouponsDetail
({
couponId
:
id
}).
then
(
res
=>
{
wx
.
p
.
api
.
couponsApi
.
getEquityCouponsDetail
({
couponId
:
id
}).
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
denomination
)
{
res
.
denomination
=
NP
.
divide
(
res
.
denomination
,
100
)
}
this
.
setData
({
this
.
setData
({
detailInfo
:
res
detailInfo
:
res
})
})
this
.
couponId
=
id
this
.
couponId
=
id
})
})
},
},
// 领取
// 领取
async
toGet
()
{
async
toGet
()
{
const
{
const
{
detailInfo
detailInfo
}
=
this
.
data
}
=
this
.
data
const
authStatus
=
await
wx
.
p
.
router
.
intercept
()
//
const authStatus = await wx.p.router.intercept()
if
(
authStatus
)
return
//
if (authStatus) return
wx
.
p
.
wxApi
.
showLoading
()
wx
.
p
.
wxApi
.
showLoading
()
wx
.
p
.
api
.
couponsApi
.
getEquityCoupons
({
couponId
:
this
.
couponId
,
merchantId
:
detailInfo
.
merchantId
}).
then
(
res
=>
{
wx
.
p
.
api
.
couponsApi
.
getEquityCoupons
({
couponId
:
this
.
couponId
,
merchantId
:
detailInfo
.
merchantId
}).
then
(
res
=>
{
console
.
log
(
res
);
wx
.
hideLoading
();
wx
.
hideLoading
();
if
(
res
)
{
this
.
setData
({
handleStatus
:
1
})
}
})
})
},
},
})
})
\ No newline at end of file
\ No newline at end of file
packageSaveMoney/pages/detail/detail.js
View file @
3c1540d
...
@@ -74,9 +74,9 @@ Page({
...
@@ -74,9 +74,9 @@ Page({
})
})
},
},
// 选择优惠券
// 选择优惠券
toSelectCoupons
(){
async
toSelectCoupons
(){
const
isLogin
=
this
.
checkLogin
()
const
isLogin
=
await
this
.
checkLogin
()
if
(
!
isLogin
)
{
if
(
isLogin
)
{
return
return
}
}
if
(
this
.
data
.
isGH
)
return
if
(
this
.
data
.
isGH
)
return
...
@@ -184,7 +184,7 @@ Page({
...
@@ -184,7 +184,7 @@ Page({
// url: '/packageShopmall/packageEquity/pages/allEquity/allEquity?showToast=1'
// url: '/packageShopmall/packageEquity/pages/allEquity/allEquity?showToast=1'
// })
// })
setTimeout
(()
=>
{
setTimeout
(()
=>
{
wx
.
$
router
.
back
(
e
=>
{
wx
.
p
.
router
.
back
(
e
=>
{
e
.
onLoad
({
showToast
:
1
})
e
.
onLoad
({
showToast
:
1
})
})
})
},
500
)
},
500
)
...
@@ -218,15 +218,17 @@ Page({
...
@@ -218,15 +218,17 @@ Page({
})
})
},
},
// 去购买
// 去购买
toBuyItem
()
{
async
toBuyItem
()
{
const
isLogin
=
this
.
checkLogin
()
const
isLogin
=
await
this
.
checkLogin
()
if
(
!
isLogin
)
{
if
(
isLogin
)
{
return
return
}
}
const
{
curentGoodsItem
,
isHaveInventory
,
isGameUse
}
=
this
.
data
const
{
curentGoodsItem
,
isHaveInventory
,
isGameUse
}
=
this
.
data
if
(
!
isHaveInventory
)
{
if
(
!
isHaveInventory
)
{
return
return
}
}
if
(
isGameUse
)
return
this
.
comfirmBuyItem
()
if
(
isGameUse
)
return
this
.
comfirmBuyItem
()
const
{
noMemberPrice
,
salesPrice
}
=
curentGoodsItem
const
{
noMemberPrice
,
salesPrice
}
=
curentGoodsItem
let
diffPrice
=
0
let
diffPrice
=
0
...
@@ -370,17 +372,9 @@ Page({
...
@@ -370,17 +372,9 @@ Page({
})
})
},
},
// 检测是否已经登录
// 检测是否已经登录
checkLogin
()
{
async
checkLogin
()
{
const
sessionId
=
wx
.
p
.
cache
.
storageApi
.
getSessionId
()
const
authStatus
=
await
wx
.
p
.
router
.
intercept
()
let
flag
=
true
return
authStatus
if
(
!
sessionId
)
{
flag
=
false
this
.
setData
({
showLogin
:
true
,
showComponent
:
false
})
}
return
flag
},
},
// 获取a标签链接
// 获取a标签链接
getALabel
(
str
)
{
getALabel
(
str
)
{
...
...
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