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
92efc710
Commit
92efc710
authored
May 20, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
集点优化
parent
4f1b830f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
153 additions
and
18 deletions
+153
-18
imageDialog.js
src/component/imageDialog/imageDialog.js
+1
-3
index.js
src/config/index.js
+2
-2
pointDetail.js
src/pages/pointDetail/pointDetail.js
+114
-8
pointList.js
src/pages/pointList/pointList.js
+32
-2
pointList.wxml
src/pages/pointList/pointList.wxml
+1
-1
project.config.json
src/project.config.json
+2
-2
wxService.js
src/utils/wxService.js
+1
-0
No files found.
src/component/imageDialog/imageDialog.js
View file @
92efc710
...
...
@@ -56,9 +56,7 @@ Component({
//图片的点击
onTapPic
(){
this
.
triggerEvent
(
'dialogTap'
,
this
.
data
.
params
);
this
.
setData
({
showDialog
:
false
});
}
}
})
src/config/index.js
View file @
92efc710
const
PROJECT_ENV
=
'
test
'
// 生产 prod, 开发1 dev,开发2 dev2, 测试 test, 预生产 pre
const
PROJECT_ENV
=
'
prod
'
// 生产 prod, 开发1 dev,开发2 dev2, 测试 test, 预生产 pre
const
needMock
=
''
//
const
brandId
=
1002
;
//1002 测试 2711 生产
const
brandId
=
2711
;
//1002 测试 2711 生产
// appid_dev_wx wxc3b64b09b1d3dfc2
// appid_test_wx wxac09792264c49b5c
// appid_pre_711 wx358b56af62edbde1
...
...
src/pages/pointDetail/pointDetail.js
View file @
92efc710
...
...
@@ -41,13 +41,14 @@ wxService.page({
isAuthorization
:
false
,
donateImgUrl
:
''
,
showDonateImgUrl
:
false
,
showTempalteModal
:
tru
e
,
showTempalteModal
:
fals
e
,
userHasBaseInfo
:
false
,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
console
.
log
(
options
)
},
//
watch
:
{
...
...
@@ -60,8 +61,7 @@ wxService.page({
this
.
setData
({
isAuthorization
:
false
},
()
=>
{
const
option
=
this
.
options
||
{}
const
option
=
this
.
options
||
{};
const
{
scene
}
=
option
if
(
scene
)
{
let
idParam
=
decodeURIComponent
(
scene
).
split
(
'&'
)[
0
]
...
...
@@ -118,6 +118,7 @@ wxService.page({
this
.
setData
({
showTempalteModal
:
false
});
let
activityId
=
this
.
data
.
id
;
//查询订阅模板
let
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
wxService
.
post
(
`
${
'/merchant/message/wxSubMsgMapping/getListByParams'
}
`
,
{
...
...
@@ -140,7 +141,7 @@ wxService.page({
success
:
(
res
)
=>
{
for
(
let
i
=
0
;
i
<
tempArr
.
length
;
i
++
)
{
let
tempPromise
=
wxService
.
post
(
`
${
'/merchant/message/wxSubMsgSubscride/member/subscribe'
}
`
,
{
businessId
:
trade
Id
,
businessId
:
activity
Id
,
memberId
:
baseUserInfo
.
memberId
,
scenarioId
:
tempArr
[
i
].
scenarioId
,
templateId
:
tempArr
[
i
].
templateId
...
...
@@ -168,8 +169,20 @@ wxService.page({
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
let
dialog
=
this
.
data
.
dialog
wx
.
hideLoading
();
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
if
(
baseUserInfo
){
let
isUat
=
data
.
isUat
;
if
(
isUat
==
'y'
){
let
isTrial
=
baseUserInfo
.
member
.
trial
?
baseUserInfo
.
member
.
trial
:
false
;
if
(
!
isTrial
){
wxService
.
router
(
`/subPackage/page/pages/goToHome/goToHome`
);
}
}
}
let
dialog
=
data
.
dialog
dialog
.
show
=
false
// 弹框背景
dialog
.
image
=
data
.
popupImage
...
...
@@ -223,7 +236,9 @@ wxService.page({
})
}
}
})
});
this
.
showOrHideTemplateModal
(
id
);
},
//获取用户扫码进来是否需要弹出领取集点的
getUserShowRewardCollectionPoint
(
id
){
...
...
@@ -254,10 +269,34 @@ wxService.page({
//图片的点击事件
onDialogTap
(
e
){
//这里先去判断用户是否开卡
const
{
member
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
if
(
!
member
){
wx
.
showToast
({
title
:
'请先去登录'
,
icon
:
'none'
})
return
;
}
//判断是否开卡
if
(
!
member
.
cardNoWeixin
){
wx
.
showToast
({
title
:
'请先开卡后购买'
,
icon
:
'none'
});
wxService
.
openCard
()
return
;
}
this
.
setData
({
showDonateImgUrl
:
false
});
this
.
userConfirmGetCollectionPoint
(
this
.
data
.
id
);
},
//
//调用领取接口
userConfirmGetCollectionPoint
(
id
){
wxService
.
post
(
`/sale/touchpoints/pointConsumptionActivity/award?id=
${
id
}
`
).
then
(
res
=>
{
...
...
@@ -327,6 +366,7 @@ wxService.page({
}
})
},
handleCheckGoods
()
{
const
{
activityId
}
=
this
.
data
wxService
.
router
(
`/subPackage/page/pages/pointGoodsList/pointGoodsList`
).
search
({
activityId
})
...
...
@@ -405,10 +445,76 @@ wxService.page({
},
////授权订阅消息的弹出框一天弹出一次
showOrHideTemplateModal
(
activityId
){
if
(
this
.
todayHasGot
(
activityId
)){
return
;
}
else
{
this
.
setData
({
showTempalteModal
:
true
});
this
.
setLocalStorageByKey
(
activityId
);
}
},
//设置每天只能领取一次限制
setLocalStorageByKey
(
activityId
){
let
getCouponData
=
wx
.
getStorageSync
(
'userHasSubActivity'
);
let
key
=
`
${
activityId
}
_d_
${
this
.
getCurrentYearMonDay
()}
`
;
if
(
!
getCouponData
){
getCouponData
=
{};
getCouponData
[
key
]
=
true
;
wx
.
setStorageSync
(
'userHasSubActivity'
,
getCouponData
);
}
else
{
//先设置进去
getCouponData
[
key
]
=
true
;
//获取今天的当前也的key
let
expiredAllKey
=
[];
for
(
let
k
in
getCouponData
){
let
expiredKey
=
k
.
split
(
'_d_'
)[
1
];
if
(
parseInt
(
expiredKey
)
<
parseInt
(
this
.
getCurrentYearMonDay
())){
expiredAllKey
.
push
(
k
);
}
}
//移除今天一起的过期key
expiredAllKey
.
forEach
(
item
=>
{
delete
getCouponData
[
item
];
});
wx
.
setStorageSync
(
'userHasSubActivity'
,
getCouponData
);
}
},
//是否已经领取了
todayHasGot
(
activityId
){
let
getCouponData
=
wx
.
getStorageSync
(
'userHasSubActivity'
);
let
key
=
`
${
activityId
}
_d_
${
this
.
getCurrentYearMonDay
()}
`
;
if
(
!
getCouponData
){
return
false
;
}
if
(
getCouponData
[
key
]){
return
true
}
return
false
;
},
//获取当前年月日
getCurrentYearMonDay
(){
let
da
=
new
Date
();
return
`
${
da
.
getFullYear
()}${
da
.
getMonth
()}${
da
.
getDate
()}
`
;
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
},
/**
...
...
src/pages/pointList/pointList.js
View file @
92efc710
...
...
@@ -156,8 +156,38 @@ wxService.page({
})
},
handleDetail
(
e
)
{
const
{
id
}
=
e
.
currentTarget
.
dataset
wxService
.
router
(
`/pages/pointDetail/pointDetail`
).
search
({
id
})
const
{
id
,
item
}
=
e
.
currentTarget
.
dataset
;
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
if
(
!
baseUserInfo
){
wx
.
showToast
({
title
:
'请先登录'
,
icon
:
'none'
});
return
;
}
let
isUat
=
item
.
isUat
;
if
(
isUat
!=
'y'
){
wxService
.
router
(
`/pages/pointDetail/pointDetail`
).
search
({
id
})
}
else
{
let
isTrial
=
baseUserInfo
.
member
.
trial
?
baseUserInfo
.
member
.
trial
:
false
;
if
(
isTrial
){
wxService
.
router
(
`/pages/pointDetail/pointDetail`
).
search
({
id
})
}
else
{
wxService
.
router
(
`/subPackage/page/pages/goToHome/goToHome`
);
}
}
},
//根据用户id获取用户信息
getUserInfo
(){
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
if
(
baseUserInfo
){
let
memberId
=
baseUserInfo
.
memberId
;
}
},
/**
* 生命周期函数--监听页面隐藏
...
...
src/pages/pointList/pointList.wxml
View file @
92efc710
...
...
@@ -5,7 +5,7 @@
</view>
<view class="point-list border_box" wx:if="{{pointList.length}}">
<block wx:for="{{pointList}}" wx:key="item">
<view class="point border_box" data-id="{{item.id}}" bindtap="handleDetail">
<view class="point border_box" data-id="{{item.id}}"
data-item="{{item}}"
bindtap="handleDetail">
<status-img img="{{item.listImage}}" currentStatus="{{currentStatus}}" currentTimeStatus="{{currentTimeStatus}}"-/>
<view class="progress weui-flex df-j--bt">
<view class="rate">进度:
...
...
src/project.config.json
View file @
92efc710
...
...
@@ -13,7 +13,7 @@
},
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.8.2"
,
"appid"
:
"wx
ac09792264c49b5c
"
,
"appid"
:
"wx
700028bf32a3be66
"
,
"projectname"
:
"7-11"
,
"debugOptions"
:
{
"hidedInDevtools"
:
[]
...
...
@@ -142,7 +142,7 @@
"id"
:
15
,
"name"
:
"集点详情"
,
"pathName"
:
"pages/pointDetail/pointDetail"
,
"query"
:
"
id=71194125918234624
0"
,
"query"
:
"
scene=i%3DdYP6rbn10
0"
,
"scene"
:
null
},
{
...
...
src/utils/wxService.js
View file @
92efc710
...
...
@@ -493,6 +493,7 @@ class WXService extends Http {
const
page
=
this
_self
.
initAppGlobalDataSync
()
watch
.
setWatcher
(
page
);
console
.
log
(
args
)
//处理触点信息数据
//修改参数
let
pageIsFromShare
=
false
,
id
=
null
;
...
...
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