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({
...
@@ -48,7 +48,7 @@ module.exports = Behavior({
},
},
fail
({
errMsg
})
{
fail
({
errMsg
})
{
console
.
log
(
errMsg
)
console
.
log
(
errMsg
)
wx
.
$a
pi
.
showToast
(
errMsg
)
wx
.
p
.
wxA
pi
.
showToast
(
errMsg
)
}
}
})
})
else
else
...
...
packageEquity/pages/allEquity/allEquity.js
View file @
d8e4c1d
...
@@ -22,7 +22,7 @@ Page({
...
@@ -22,7 +22,7 @@ Page({
})
})
if
(
options
.
showToast
)
{
if
(
options
.
showToast
)
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
wx
.
$a
pi
.
showToast
(
'原商品及品牌均已下架,您可查看其他权益商品'
)
wx
.
p
.
wxA
pi
.
showToast
(
'原商品及品牌均已下架,您可查看其他权益商品'
)
},
500
)
},
500
)
}
}
},
},
...
...
packageEquity/pages/directional/directional.js
View file @
d8e4c1d
...
@@ -46,7 +46,7 @@ Page({
...
@@ -46,7 +46,7 @@ Page({
}
}
},
},
// 领取定向礼包
// 领取定向礼包
toRecivedGifts
()
{
async
toRecivedGifts
()
{
const
{
giftsData
}
=
this
.
data
const
{
giftsData
}
=
this
.
data
const
mPattern
=
/^
[
1
]([
3-9
])[
0-9
]{9}
$/
const
mPattern
=
/^
[
1
]([
3-9
])[
0-9
]{9}
$/
const
{
merchantId
}
=
wx
.
p
.
storage
.
get
(
'merchant_info'
)
const
{
merchantId
}
=
wx
.
p
.
storage
.
get
(
'merchant_info'
)
...
@@ -68,6 +68,9 @@ Page({
...
@@ -68,6 +68,9 @@ Page({
if
(
this
.
staff
)
{
if
(
this
.
staff
)
{
Object
.
assign
(
para
,
this
.
staff
)
Object
.
assign
(
para
,
this
.
staff
)
}
}
// 先判断登录
const
loginStatus
=
await
wx
.
p
.
router
.
intercept
()
if
(
loginStatus
)
return
wx
.
p
.
wxApi
.
showLoading
(
'领取中'
)
wx
.
p
.
wxApi
.
showLoading
(
'领取中'
)
wx
.
p
.
api
.
couponsApi
.
giftsRecive
(
para
).
then
(
res
=>
{
wx
.
p
.
api
.
couponsApi
.
giftsRecive
(
para
).
then
(
res
=>
{
wx
.
hideLoading
();
wx
.
hideLoading
();
...
...
packageEquity/pages/freecard/freecard.js
View file @
d8e4c1d
...
@@ -60,64 +60,29 @@ Page({
...
@@ -60,64 +60,29 @@ Page({
}
}
})
})
},
},
tofreeReceive
()
{
async
tofreeReceive
()
{
// if(this.op){
// 先判断登录
// wx.p.wxApi.showLoading()
const
loginStatus
=
await
wx
.
p
.
router
.
intercept
()
// this.freeLogin()
if
(
loginStatus
)
return
// return
// }
const
userInfo
=
wx
.
p
.
storage
.
get
(
'userInfo'
)
let
{
loginInfo
}
=
this
.
data
let
{
merchantId
,
phone
}
=
userInfo
let
{
merchantId
,
phone
}
=
loginInfo
if
(
!
phone
)
{
if
(
!
phone
)
{
return
return
}
}
wx
.
p
.
wxApi
.
showLoading
()
wx
.
p
.
wxApi
.
showLoading
()
this
.
toPostFreeCard
(
merchantId
,
phone
,
loginInfo
)
this
.
toPostFreeCard
(
merchantId
,
phone
,
userInfo
)
},
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
)
})
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
let
system
=
wx
.
getSystemInfoSync
()
let
system
=
wx
.
getSystemInfoSync
()
const
{
merchantId
}
=
wx
.
p
.
storage
.
get
(
'merchant_info'
)
const
{
merchantId
}
=
wx
.
p
.
storage
.
get
(
'merchant_info'
)
// if (options && options.scene) {
if
(
options
&&
options
.
scene
)
{
// this.getLiveActivityId(decodeURIComponent(options.scene))
this
.
getLiveActivityId
(
decodeURIComponent
(
options
.
scene
))
// } else {
}
else
{
// this.toGetFreeCardDay(merchantId)
this
.
toGetFreeCardDay
(
merchantId
)
// }
this
.
login
()
this
.
toGetFreeCardDay
(
merchantId
)
}
this
.
setData
({
this
.
setData
({
paddingH
:
system
.
windowHeight
*
0.11
,
paddingH
:
system
.
windowHeight
*
0.11
,
textpadding
:
system
.
windowHeight
*
0.31
textpadding
:
system
.
windowHeight
*
0.31
...
...
packageEquity/pages/freecard/freecard.wxml
View file @
d8e4c1d
...
@@ -9,9 +9,9 @@
...
@@ -9,9 +9,9 @@
</view>
</view>
<view class="wrapper1">
<view class="wrapper1">
<!-- <view class="btnText" bind:tap="tofreeReceive">免费领取</view> -->
<!-- <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>
<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" />
<glsx-image webp bind:tap="tofreeReceive" webp class="bottomIcon animaiton" mode="widthFix" src="equity/freecard_btn_icon_new.png" />
</view>
</view>
<view style="height:22rpx"></view>
<view style="height:22rpx"></view>
...
...
packageEquity/pages/open/open.js
View file @
d8e4c1d
...
@@ -58,8 +58,8 @@ Page({
...
@@ -58,8 +58,8 @@ Page({
},
},
// 去购买会员
// 去购买会员
async
openMemberFn
()
{
async
openMemberFn
()
{
const
loginStatu
=
await
wx
.
p
.
router
.
intercept
()
const
loginStatu
s
=
await
wx
.
p
.
router
.
intercept
()
if
(
loginStatu
)
return
if
(
loginStatu
s
)
return
const
{
const
{
memberInfo
memberInfo
}
=
this
.
data
}
=
this
.
data
...
...
packageEquity/pages/package/package.js
View file @
d8e4c1d
...
@@ -15,13 +15,14 @@ Page({
...
@@ -15,13 +15,14 @@ Page({
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
:
function
(
options
)
{
onLoad
:
async
function
(
options
)
{
this
.
setNaviTitle
()
this
.
setNaviTitle
()
// decodeUrlLink(options)
// decodeUrlLink(options)
if
(
!
options
.
id
)
{
if
(
!
options
.
id
)
{
return
return
}
}
this
.
getPackageDetail
(
options
.
id
)
this
.
packageId
=
options
.
id
// this.getPackageDetail(options.id)
// if (options.shareStaffUuid) {
// if (options.shareStaffUuid) {
// this.data.shareStaff = {
// this.data.shareStaff = {
// shareStaffUuid: options.shareStaffUuid,
// shareStaffUuid: options.shareStaffUuid,
...
@@ -38,6 +39,12 @@ Page({
...
@@ -38,6 +39,12 @@ Page({
// wx.p.cache.storageApi.reportData(options, true, false)
// 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() {
// login() {
// wx.p.api.userApi.login().then(res => {
// wx.p.api.userApi.login().then(res => {
...
@@ -58,31 +65,33 @@ Page({
...
@@ -58,31 +65,33 @@ Page({
// },
// },
// 设置标题名称
// 设置标题名称
setNaviTitle
(
tile
)
{
setNaviTitle
(
tile
)
{
const
{
merchantName
}
=
wx
.
p
.
storage
.
get
(
'merchant_info'
)
const
{
merchantName
}
=
wx
.
p
.
storage
.
get
(
'merchant_info'
)
wx
.
setNavigationBarTitle
({
wx
.
setNavigationBarTitle
({
title
:
merchantName
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
)
})
})
},
},
// 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
)
{
getPackageDetail
(
id
)
{
const
{
merchantId
}
=
wx
.
p
.
storage
.
get
(
'merchant_info'
)
wx
.
p
.
api
.
couponsApi
wx
.
p
.
api
.
couponsApi
.
packageInfo
({
.
packageInfo
({
id
id
,
merchantId
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
couponsDetailList
.
length
)
{
if
(
res
.
couponsDetailList
.
length
)
{
...
@@ -99,7 +108,9 @@ Page({
...
@@ -99,7 +108,9 @@ Page({
})
})
},
},
// 获取门店单号
// 获取门店单号
toCreatePackageNum
()
{
async
toCreatePackageNum
()
{
const
loginStatus
=
await
wx
.
p
.
router
.
intercept
()
if
(
loginStatus
)
return
wx
.
p
.
wxApi
.
showLoading
()
wx
.
p
.
wxApi
.
showLoading
()
wx
.
p
.
api
.
couponsApi
.
createOrderNum
().
then
(
res
=>
{
wx
.
p
.
api
.
couponsApi
.
createOrderNum
().
then
(
res
=>
{
wx
.
hideLoading
()
wx
.
hideLoading
()
...
...
packageEquity/pages/package/package.wxml
View file @
d8e4c1d
...
@@ -44,13 +44,13 @@
...
@@ -44,13 +44,13 @@
</view>
</view>
</block> -->
</block> -->
<view class="fixed-button-wrap">
<view class="fixed-button-wrap">
<block wx:if="{{showAuthBtn}}">
<
!-- <
block wx:if="{{showAuthBtn}}">
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="auth-button"></button>
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="auth-button"></button>
</block>
</block>
-->
<view wx:if="{{packageInfo.isPayFlag}}" class="button-item" bind:tap="toCreatePackageNum">
<view wx:if="{{packageInfo.isPayFlag
|| showAuthBtn
}}" class="button-item" bind:tap="toCreatePackageNum">
限时特价仅需¥{{packageInfo.packagePrice }},点击购买
限时特价仅需¥{{packageInfo.packagePrice }},点击购买
</view>
</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>
<view style="height: 164rpx"></view>
<view style="height: 164rpx"></view>
</view>
</view>
\ No newline at end of file
\ No newline at end of file
packageMine/pages/coupon/detail/detail.js
View file @
d8e4c1d
...
@@ -24,7 +24,7 @@ Page({
...
@@ -24,7 +24,7 @@ Page({
let
para
=
{
let
para
=
{
userCouponId
:
id
userCouponId
:
id
}
}
wx
.
$a
pi
.
showLoading
(
'加载中...'
)
wx
.
p
.
wxA
pi
.
showLoading
(
'加载中...'
)
wx
.
p
.
api
.
couponsApi
.
couponsDetail
(
para
).
then
(
res
=>
{
wx
.
p
.
api
.
couponsApi
.
couponsDetail
(
para
).
then
(
res
=>
{
wx
.
hideLoading
()
wx
.
hideLoading
()
let
qrcodeURL
=
QR
.
createQrCodeImg
(
`t=2&c=
${
res
.
verificationCode
}
`
)
let
qrcodeURL
=
QR
.
createQrCodeImg
(
`t=2&c=
${
res
.
verificationCode
}
`
)
...
...
packageMine/pages/order/complete/complete.js
View file @
d8e4c1d
...
@@ -47,7 +47,7 @@ Page({
...
@@ -47,7 +47,7 @@ Page({
},
},
fail
(
res
)
{
fail
(
res
)
{
if
(
res
.
errMsg
==
'requestPayment:fail cancel'
)
{
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({
...
@@ -22,8 +22,9 @@ Page({
if
(
options
.
url
)
{
if
(
options
.
url
)
{
return
this
.
login
(
options
)
return
this
.
login
(
options
)
}
}
this
.
login
()
},
},
async
login
(
options
)
{
async
login
(
options
=
{}
)
{
if
(
options
.
merchantId
)
wx
.
$merchant_id
=
options
.
merchantId
if
(
options
.
merchantId
)
wx
.
$merchant_id
=
options
.
merchantId
try
{
try
{
const
{
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