Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
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
高淑倩
7-Eleven
Commits
508f25c2
You need to sign in or sign up before continuing.
Commit
508f25c2
authored
Feb 21, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化功能
parent
001cff5c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
130 additions
and
51 deletions
+130
-51
app.wxss
src/app.wxss
+19
-0
project.config.json
src/project.config.json
+10
-4
valueCard.js
src/subPackage/page/pages/valueCard/valueCard.js
+2
-2
valueCardInfo.js
src/subPackage/page/pages/valueCardInfo/valueCardInfo.js
+60
-0
valueCardInfo.wxml
src/subPackage/page/pages/valueCardInfo/valueCardInfo.wxml
+9
-2
Http.js
src/utils/Http.js
+29
-43
wxService.js
src/utils/wxService.js
+1
-0
No files found.
src/app.wxss
View file @
508f25c2
...
...
@@ -17,4 +17,22 @@ page {
box-sizing: border-box;
}
.positionRe{
position: relative;
}
.positionAbs{
position: absolute;
z-index: 2;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.clear-btn{
appearance: none;
border: none;
background: transparent;
margin: 0;
}
\ No newline at end of file
src/project.config.json
View file @
508f25c2
...
...
@@ -38,6 +38,10 @@
"currentL"
:
-1
,
"list"
:
[]
},
"gamePlugin"
:
{
"current"
:
-1
,
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
-1
,
"list"
:
[
...
...
@@ -187,10 +191,11 @@
"query"
:
""
},
{
"id"
:
-1
,
"id"
:
23
,
"name"
:
"超值卡详情"
,
"pathName"
:
"subPackage/page/pages/valueCardInfo/valueCardInfo"
,
"query"
:
""
"query"
:
"id=679090161396621312"
,
"scene"
:
null
},
{
"id"
:
-1
,
...
...
@@ -199,10 +204,11 @@
"query"
:
""
},
{
"id"
:
-1
,
"id"
:
25
,
"name"
:
"我的超值卡详情"
,
"pathName"
:
"subPackage/page/pages/myValueCardInfo/myValueCardInfo"
,
"query"
:
""
"query"
:
""
,
"scene"
:
null
},
{
"id"
:
-1
,
...
...
src/subPackage/page/pages/valueCard/valueCard.js
View file @
508f25c2
...
...
@@ -22,7 +22,7 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
},
//跳转卡详情
onTapToCardInfo
(
e
){
...
...
@@ -37,7 +37,7 @@ wxService.page({
title
:
'加载中..'
,
});
wxService
.
post
(
`/merchant/superValueCardActivity/miniProgram/getPageList`
).
then
(
res
=>
{
wxService
.
post
(
`/merchant/superValueCardActivity/miniProgram/getPageList`
,{},
null
,
true
).
then
(
res
=>
{
if
(
res
){
let
list
=
res
.
data
.
data
?
res
.
data
.
data
:
[];
this
.
data
.
cardList
=
list
;
...
...
src/subPackage/page/pages/valueCardInfo/valueCardInfo.js
View file @
508f25c2
...
...
@@ -12,6 +12,7 @@ wxService.page({
showModal
:
false
,
valueCardInfo
:
{},
buyType
:
'2'
,
//现金支付 2 积分兑换
userHasBaseInfo
:
false
},
/**
...
...
@@ -28,7 +29,66 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
this
.
userHasLogin
();
},
//获取当前用户是否登录
userHasLogin
(){
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
if
(
baseUserInfo
){
this
.
setData
({
userHasBaseInfo
:
true
})
}
else
{
this
.
setData
({
userHasBaseInfo
:
false
})
}
},
//授权
_getUserInfo
(
res
=
{})
{
const
userInfo
=
res
.
detail
||
{}
if
(
res
.
detail
.
userInfo
)
{
utils
.
getUserInfoByBtn
(
userInfo
).
then
((
data
=
{})
=>
{
const
{
token
}
=
data
wx
.
setStorageSync
(
'_accreditUserInfo'
,
userInfo
)
if
(
token
)
{
wx
.
setStorageSync
(
'token'
,
token
)
}
else
{
wx
.
setStorageSync
(
'token'
,
''
)
}
wx
.
setStorageSync
(
'_baseUserInfo'
,
data
)
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
// 获取当前会员是否是体验者
const
{
member
}
=
baseUserInfo
const
curMemberTrial
=
member
&&
member
.
trial
||
false
wx
.
setStorageSync
(
'isExperiencer'
,
curMemberTrial
)
this
.
setUserInfo
()
}).
catch
(
err
=>
{
if
(
err
)
{
wx
.
showToast
({
title
:
`会员系统异常请稍后重试!`
,
icon
:
'none'
})
}
})
}
},
setUserInfo
()
{
// 判断有无开卡
const
userInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
// 新用户去激活领卡
if
(
userInfo
&&
userInfo
.
member
&&
!
userInfo
.
member
.
mobile
)
{
wxService
.
openCard
()
return
false
}
// 跳转
setTimeout
(()
=>
{
this
.
onShow
();
// this.getValueCardActivityInfo();
},
200
)
},
//获取活动详情
...
...
src/subPackage/page/pages/valueCardInfo/valueCardInfo.wxml
View file @
508f25c2
<!--subPackage/page/pages/valueCardInfo/valueCardInfo.wxml-->
<image src='{{valueCardInfo.infoUrl}}' class='card-info' mode='widthFix'></image>
<image src='{{valueCardInfo.infoUrl
? valueCardInfo.infoUrl : valueCardInfo.listUrl
}}' class='card-info' mode='widthFix'></image>
<view class='card-info-body'>
<view class='card-title'>{{valueCardInfo.activityName}}</view>
<view class='card-desc-item' wx:if="{{valueCardInfo.hasDate}}">
...
...
@@ -39,7 +39,14 @@
<text bindtap='onTapViewRule'>《超值卡规则》</text>
</view>
</view>
<view class='rg-button {{checked ? "" : "disabled"}}' bindtap='onTapBuy'>{{buyType == 1 ? "立即购买" : "立即兑换"}}</view>
<view class='rg-button positionRe {{checked ? "" : "disabled"}}' wx:if="{{!userHasBaseInfo}}">
<button class="positionAbs clear-btn"
bindgetuserinfo="_getUserInfo" open-type='getUserInfo'></button>
{{buyType == 1 ? "立即购买" : "立即兑换"}}
</view>
<view class='rg-button {{checked ? "" : "disabled"}}'
wx:if="{{userHasBaseInfo}}" bindtap='onTapBuy'>{{buyType == 1 ? "立即购买" : "立即兑换"}}</view>
</view>
<!-- 超值卡规则 -->
...
...
src/utils/Http.js
View file @
508f25c2
...
...
@@ -78,33 +78,7 @@ class Http {
})
.
catch
(
this
.
fail
)
}
// get (url, parmas) {
// return this.request({
// url,
// method: 'GET',
// header: {
// 'buyer-token': this.getToken()
// // 'buyer-token': '3e15b819c551713ae210adc525da028b'
// // 'seller-token': 'f80d09122733517ea4a0c2628c4eb0e9'
// },
// data: parmas
// })
// }
// post (url, parmas, channel) {
// return this.request({
// url,
// method: 'POST',
// header: {
// 'buyer-token': this.getToken()
// // 'buyer-token':'3e15b819c551713ae210adc525da028b'
// // 'seller-token': 'f80d09122733517ea4a0c2628c4eb0e9'
// },
// data: parmas,
// channel: channel
// })
// }
//get
get
(
url
,
parmas
)
{
let
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
if
(
baseUserInfo
){
...
...
@@ -130,26 +104,38 @@ class Http {
}
}
post
(
url
,
parmas
,
channel
)
{
let
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
if
(
baseUserInfo
){
return
this
.
request
({
url
,
method
:
'POST'
,
header
:
{
'buyer-token'
:
this
.
getToken
()
},
data
:
parmas
,
channel
:
channel
})
}
else
{
post
(
url
,
parmas
,
channel
,
needLogin
)
{
//needLogin 调用接口需需不需要使用buyer-token
if
(
!
needLogin
){
let
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
if
(
baseUserInfo
)
{
return
this
.
request
({
url
,
method
:
'POST'
,
header
:
{
'buyer-token'
:
this
.
getToken
()
},
data
:
parmas
,
channel
:
channel
})
}
else
{
return
this
.
request
({
url
,
method
:
'POST'
,
header
:
{
'tunnel-token'
:
'4c8d641cb2b8a576317ee5f6ead1f36474463041d61fb5d4289364565b0c6c63'
,
// 生产 2711
},
data
:
parmas
,
channel
:
channel
})
}
}
else
{
return
this
.
request
({
url
,
method
:
'POST'
,
header
:
{
// 'tunnel-token': 'aa8a1bfb7f6c5031d172d94b6574293ef954a6f2d4e16657da008e0cc15588feD', // 测试
// 'tunnel-token' : 'd6db651f8b9c7db4176465accfc1c913843fd9ad328cd5f4fe201d918072c9e8', // 生产 3001
'tunnel-token'
:
'4c8d641cb2b8a576317ee5f6ead1f36474463041d61fb5d4289364565b0c6c63'
,
// 生产 2711
'tunnel-token'
:
'4c8d641cb2b8a576317ee5f6ead1f36474463041d61fb5d4289364565b0c6c63'
,
// 生产 2711
},
data
:
parmas
,
channel
:
channel
...
...
src/utils/wxService.js
View file @
508f25c2
...
...
@@ -415,6 +415,7 @@ class WXService extends Http {
const
_self
=
this
const
{
sr
}
=
this
.
getApp
()
config
.
data
.
experAccessible
;
config
.
data
.
currentHasUserInfo
=
false
;
// wx.removeStorageSync('isExperiencer')
// const baseUserInfo = wx.getStorageSync('_baseUserInfo')
...
...
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