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 77c4dd84
authored
Jul 18, 2023
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v1.0.0' of
http://192.168.3.233:8090/saas/mini-program/hmd
into v1.0.0
2 parents
2cddd324
1c61e5a8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
79 deletions
packageEquity/pages/directional/directional.js
packageEquity/pages/freecard/freecard.js
packageEquity/pages/freecard/freecard.wxml
packageEquity/pages/package/package.js
packageEquity/pages/package/package.wxml
packageEquity/pages/directional/directional.js
View file @
77c4dd8
...
...
@@ -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 @
77c4dd8
...
...
@@ -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 @
77c4dd8
...
...
@@ -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/package/package.js
View file @
77c4dd8
...
...
@@ -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 @
77c4dd8
...
...
@@ -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
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