Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
hmd
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 d8e4c1d5
authored
Jul 18, 2023
by
杨北旺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
权益提交
1 parent
1fc672bc
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
66 additions
and
86 deletions
mixins/kfMixin.js
packageEquity/pages/allEquity/allEquity.js
packageEquity/pages/directional/directional.js
packageEquity/pages/freecard/freecard.js
packageEquity/pages/freecard/freecard.wxml
packageEquity/pages/open/open.js
packageEquity/pages/package/package.js
packageEquity/pages/package/package.wxml
packageMine/pages/coupon/detail/detail.js
packageMine/pages/order/complete/complete.js
pages/loading/loading.js
mixins/kfMixin.js
View file @
d8e4c1d
...
...
@@ -48,7 +48,7 @@ module.exports = Behavior({
},
fail
({
errMsg
})
{
console
.
log
(
errMsg
)
wx
.
$a
pi
.
showToast
(
errMsg
)
wx
.
p
.
wxA
pi
.
showToast
(
errMsg
)
}
})
else
...
...
packageEquity/pages/allEquity/allEquity.js
View file @
d8e4c1d
...
...
@@ -22,7 +22,7 @@ Page({
})
if
(
options
.
showToast
)
{
setTimeout
(()
=>
{
wx
.
$a
pi
.
showToast
(
'原商品及品牌均已下架,您可查看其他权益商品'
)
wx
.
p
.
wxA
pi
.
showToast
(
'原商品及品牌均已下架,您可查看其他权益商品'
)
},
500
)
}
},
...
...
packageEquity/pages/directional/directional.js
View file @
d8e4c1d
...
...
@@ -46,7 +46,7 @@ Page({
}
},
// 领取定向礼包
toRecivedGifts
()
{
async
toRecivedGifts
()
{
const
{
giftsData
}
=
this
.
data
const
mPattern
=
/^
[
1
]([
3-9
])[
0-9
]{9}
$/
const
{
merchantId
}
=
wx
.
p
.
storage
.
get
(
'merchant_info'
)
...
...
@@ -68,6 +68,9 @@ Page({
if
(
this
.
staff
)
{
Object
.
assign
(
para
,
this
.
staff
)
}
// 先判断登录
const
loginStatus
=
await
wx
.
p
.
router
.
intercept
()
if
(
loginStatus
)
return
wx
.
p
.
wxApi
.
showLoading
(
'领取中'
)
wx
.
p
.
api
.
couponsApi
.
giftsRecive
(
para
).
then
(
res
=>
{
wx
.
hideLoading
();
...
...
packageEquity/pages/freecard/freecard.js
View file @
d8e4c1d
...
...
@@ -60,64 +60,29 @@ Page({
}
})
},
tofreeReceive
()
{
// if(this.op){
// wx.p.wxApi.showLoading()
// this.freeLogin()
// return
// }
let
{
loginInfo
}
=
this
.
data
let
{
merchantId
,
phone
}
=
loginInfo
async
tofreeReceive
()
{
// 先判断登录
const
loginStatus
=
await
wx
.
p
.
router
.
intercept
()
if
(
loginStatus
)
return
const
userInfo
=
wx
.
p
.
storage
.
get
(
'userInfo'
)
let
{
merchantId
,
phone
}
=
userInfo
if
(
!
phone
)
{
return
}
wx
.
p
.
wxApi
.
showLoading
()
this
.
toPostFreeCard
(
merchantId
,
phone
,
loginInfo
)
},
login
()
{
wx
.
p
.
api
.
userApi
.
login
().
then
(
res
=>
{
if
(
res
.
data
)
{
console
.
log
(
res
.
data
)
let
{
phone
,
sessionId
}
=
res
.
data
wx
.
p
.
authStatus
=
phone
?
false
:
true
if
(
res
.
data
.
isLogin
)
{
wx
.
p
.
cache
.
storageApi
.
setUserInfo
(
res
.
data
)
wx
.
p
.
cache
.
storageApi
.
setSessionId
(
res
.
data
.
sessionId
)
// this.handlerCustomerId()
}
this
.
setData
({
loginInfo
:
res
.
data
,
showAuthBtn
:
phone
?
false
:
true
,
sessionId
})
}
})
},
getPhoneNumber
({
detail
})
{
const
{
sessionId
}
=
this
.
data
if
(
!
sessionId
)
return
wx
.
p
.
api
.
userApi
.
authUserPhone
(
detail
,
sessionId
).
then
(({
data
,
code
,
message
})
=>
{
wx
.
hideLoading
()
if
(
code
==
'0'
)
{
wx
.
p
.
authStatus
=
false
wx
.
p
.
cache
.
storageApi
.
setUserInfo
(
data
)
wx
.
p
.
cache
.
storageApi
.
setSessionId
(
data
.
sessionId
)
let
{
merchantId
,
phone
}
=
data
this
.
toPostFreeCard
(
merchantId
,
phone
,
data
)
// this.handlerCustomerId()
}
else
wx
.
p
.
wxApi
.
showToast
(
message
)
})
this
.
toPostFreeCard
(
merchantId
,
phone
,
userInfo
)
},
onLoad
(
options
)
{
let
system
=
wx
.
getSystemInfoSync
()
const
{
merchantId
}
=
wx
.
p
.
storage
.
get
(
'merchant_info'
)
if
(
options
&&
options
.
scene
)
{
this
.
getLiveActivityId
(
decodeURIComponent
(
options
.
scene
))
}
else
{
this
.
toGetFreeCardDay
(
merchantId
)
this
.
login
()
}
const
{
merchantId
}
=
wx
.
p
.
storage
.
get
(
'merchant_info'
)
// if (options && options.scene) {
// this.getLiveActivityId(decodeURIComponent(options.scene))
// } else {
// this.toGetFreeCardDay(merchantId)
// }
this
.
toGetFreeCardDay
(
merchantId
)
this
.
setData
({
paddingH
:
system
.
windowHeight
*
0.11
,
textpadding
:
system
.
windowHeight
*
0.31
...
...
packageEquity/pages/freecard/freecard.wxml
View file @
d8e4c1d
...
...
@@ -9,9 +9,9 @@
</view>
<view class="wrapper1">
<!-- <view class="btnText" bind:tap="tofreeReceive">免费领取</view> -->
<block wx:if="{{showAuthBtn}}">
<
!-- <
block wx:if="{{showAuthBtn}}">
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="auth-button"></button>
</block>
</block>
-->
<glsx-image webp bind:tap="tofreeReceive" webp class="bottomIcon animaiton" mode="widthFix" src="equity/freecard_btn_icon_new.png" />
</view>
<view style="height:22rpx"></view>
...
...
packageEquity/pages/open/open.js
View file @
d8e4c1d
...
...
@@ -58,8 +58,8 @@ Page({
},
// 去购买会员
async
openMemberFn
()
{
const
loginStatu
=
await
wx
.
p
.
router
.
intercept
()
if
(
loginStatu
)
return
const
loginStatu
s
=
await
wx
.
p
.
router
.
intercept
()
if
(
loginStatu
s
)
return
const
{
memberInfo
}
=
this
.
data
...
...
packageEquity/pages/package/package.js
View file @
d8e4c1d
...
...
@@ -15,13 +15,14 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
onLoad
:
async
function
(
options
)
{
this
.
setNaviTitle
()
// decodeUrlLink(options)
if
(
!
options
.
id
)
{
return
}
this
.
getPackageDetail
(
options
.
id
)
this
.
packageId
=
options
.
id
// this.getPackageDetail(options.id)
// if (options.shareStaffUuid) {
// this.data.shareStaff = {
// shareStaffUuid: options.shareStaffUuid,
...
...
@@ -38,6 +39,12 @@ Page({
// wx.p.cache.storageApi.reportData(options, true, false)
// }
},
async
onShow
()
{
this
.
getPackageDetail
(
this
.
packageId
)
this
.
setData
({
showAuthBtn
:
false
})
const
loginStatus
=
await
wx
.
p
.
router
.
intercept
(
false
)
if
(
loginStatus
)
return
this
.
setData
({
showAuthBtn
:
true
})
},
// 登录
// login() {
// wx.p.api.userApi.login().then(res => {
...
...
@@ -58,31 +65,33 @@ Page({
// },
// 设置标题名称
setNaviTitle
(
tile
)
{
const
{
merchantName
}
=
wx
.
p
.
storage
.
get
(
'merchant_info'
)
const
{
merchantName
}
=
wx
.
p
.
storage
.
get
(
'merchant_info'
)
wx
.
setNavigationBarTitle
({
title
:
merchantName
})
},
getPhoneNumber
({
detail
})
{
const
{
sessionId
}
=
this
.
data
if
(
!
sessionId
)
return
wx
.
p
.
api
.
userApi
.
authUserPhone
(
detail
,
sessionId
).
then
(({
data
,
code
,
message
})
=>
{
wx
.
hideLoading
()
if
(
code
==
'0'
)
{
// wx.$Track.setTrack({}, 3)
wx
.
p
.
authStatus
=
false
wx
.
p
.
cache
.
storageApi
.
setUserInfo
(
data
)
wx
.
p
.
cache
.
storageApi
.
setSessionId
(
data
.
sessionId
)
this
.
toCreatePackageNum
()
// this.handlerCustomerId()
}
else
wx
.
p
.
wxApi
.
showToast
(
message
)
title
:
merchantName
})
},
// getPhoneNumber({ detail }) {
// const { sessionId } = this.data
// if (!sessionId) return
// wx.p.api.userApi.authUserPhone(detail, sessionId).then(({ data, code, message }) => {
// wx.hideLoading()
// if (code == '0') {
// // wx.$Track.setTrack({}, 3)
// wx.p.authStatus = false
// wx.p.cache.storageApi.setUserInfo(data)
// wx.p.cache.storageApi.setSessionId(data.sessionId)
// this.toCreatePackageNum()
// // this.handlerCustomerId()
// } else wx.p.wxApi.showToast(message)
// })
// },
// 获取套餐详情
getPackageDetail
(
id
)
{
const
{
merchantId
}
=
wx
.
p
.
storage
.
get
(
'merchant_info'
)
wx
.
p
.
api
.
couponsApi
.
packageInfo
({
id
id
,
merchantId
})
.
then
(
res
=>
{
if
(
res
.
couponsDetailList
.
length
)
{
...
...
@@ -99,7 +108,9 @@ Page({
})
},
// 获取门店单号
toCreatePackageNum
()
{
async
toCreatePackageNum
()
{
const
loginStatus
=
await
wx
.
p
.
router
.
intercept
()
if
(
loginStatus
)
return
wx
.
p
.
wxApi
.
showLoading
()
wx
.
p
.
api
.
couponsApi
.
createOrderNum
().
then
(
res
=>
{
wx
.
hideLoading
()
...
...
packageEquity/pages/package/package.wxml
View file @
d8e4c1d
...
...
@@ -44,13 +44,13 @@
</view>
</block> -->
<view class="fixed-button-wrap">
<block wx:if="{{showAuthBtn}}">
<
!-- <
block wx:if="{{showAuthBtn}}">
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="auth-button"></button>
</block>
<view wx:if="{{packageInfo.isPayFlag}}" class="button-item" bind:tap="toCreatePackageNum">
</block>
-->
<view wx:if="{{packageInfo.isPayFlag
|| showAuthBtn
}}" class="button-item" bind:tap="toCreatePackageNum">
限时特价仅需¥{{packageInfo.packagePrice }},点击购买
</view>
<view wx:if="{{!packageInfo.isPayFlag}}" class="button-item grey-btn">非指定用户不可购买</view>
<view wx:if="{{!packageInfo.isPayFlag
&&!showAuthBtn
}}" class="button-item grey-btn">非指定用户不可购买</view>
</view>
<view style="height: 164rpx"></view>
</view>
\ No newline at end of file
packageMine/pages/coupon/detail/detail.js
View file @
d8e4c1d
...
...
@@ -24,7 +24,7 @@ Page({
let
para
=
{
userCouponId
:
id
}
wx
.
$a
pi
.
showLoading
(
'加载中...'
)
wx
.
p
.
wxA
pi
.
showLoading
(
'加载中...'
)
wx
.
p
.
api
.
couponsApi
.
couponsDetail
(
para
).
then
(
res
=>
{
wx
.
hideLoading
()
let
qrcodeURL
=
QR
.
createQrCodeImg
(
`t=2&c=
${
res
.
verificationCode
}
`
)
...
...
packageMine/pages/order/complete/complete.js
View file @
d8e4c1d
...
...
@@ -47,7 +47,7 @@ Page({
},
fail
(
res
)
{
if
(
res
.
errMsg
==
'requestPayment:fail cancel'
)
{
wx
.
$a
pi
.
showToast
(
'取消支付'
)
wx
.
p
.
wxA
pi
.
showToast
(
'取消支付'
)
}
}
})
...
...
pages/loading/loading.js
View file @
d8e4c1d
...
...
@@ -22,8 +22,9 @@ Page({
if
(
options
.
url
)
{
return
this
.
login
(
options
)
}
this
.
login
()
},
async
login
(
options
)
{
async
login
(
options
=
{}
)
{
if
(
options
.
merchantId
)
wx
.
$merchant_id
=
options
.
merchantId
try
{
const
{
...
...
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