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
9e4b8e02
Commit
9e4b8e02
authored
Sep 10, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getAssPath
parent
beb87ed7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
82 additions
and
42 deletions
+82
-42
app.js
src/app.js
+2
-2
index.js
src/config/index.js
+4
-3
userCenter.js
src/pages/userCenter/userCenter.js
+55
-24
project.config.json
src/project.config.json
+1
-1
currentAccessiblePath.js
src/utils/currentAccessiblePath.js
+9
-0
helper.js
src/utils/helper.js
+0
-11
wxService.js
src/utils/wxService.js
+11
-1
No files found.
src/app.js
View file @
9e4b8e02
...
@@ -110,9 +110,9 @@ App({
...
@@ -110,9 +110,9 @@ App({
imageUrl
:
envInfo
.
imgCtx
,
//图片地址
imageUrl
:
envInfo
.
imgCtx
,
//图片地址
isFullSucreen
:
false
,
// 当前设备是否为 FullSucreen
isFullSucreen
:
false
,
// 当前设备是否为 FullSucreen
commonFunc
:
commonFunc
,
commonFunc
:
commonFunc
,
brandId
:
2711
,
//
brandId: 2711,
// brandId: 2005,
// brandId: 2005,
//
brandId: 1001,
brandId
:
1001
,
// brandId: 1002,
// brandId: 1002,
}
}
})
})
src/config/index.js
View file @
9e4b8e02
const
PROJECT_ENV
=
'
prod'
// 生产 prod, 开发 dev,
测试 test, 预生产 pre
const
PROJECT_ENV
=
'
dev'
// 生产 prod, 开发1 dev,开发2 dev2,
测试 test, 预生产 pre
const
needMock
=
''
//
const
needMock
=
''
//
// appid_dev_wx wxc3b64b09b1d3dfc2
// appid_dev_wx wxc3b64b09b1d3dfc2
...
@@ -9,8 +9,8 @@ const needMock = '' //
...
@@ -9,8 +9,8 @@ const needMock = '' //
// 1 2 3 步!!!!!!!!!!!!!!!!!!!!!! prod appid brandId
// 1 2 3 步!!!!!!!!!!!!!!!!!!!!!! prod appid brandId
// const devCtx = 'http://111.231.86.64'
const
devCtx
=
'http://buyer.devapi.bigaka.net'
// 开发环境 1
const
devCtx
=
'http://buyer.devapi.bigaka.net'
// 开发环境
const
devCtx
2
=
'http://dev-sellerapi.bigaka.net'
// 开发环境 2
const
testCtx
=
'https://crm-b.bigaka.net/api'
// 发测试时解开此注释
const
testCtx
=
'https://crm-b.bigaka.net/api'
// 发测试时解开此注释
const
preCtx
=
'https://crm-b.bigaka.com/api'
// 发预生产时解开此注释
const
preCtx
=
'https://crm-b.bigaka.com/api'
// 发预生产时解开此注释
const
prodCtx
=
'https://crm-b.bigaka.com/api'
// 发生产时解开此注释
const
prodCtx
=
'https://crm-b.bigaka.com/api'
// 发生产时解开此注释
...
@@ -23,6 +23,7 @@ const prodImgCtx = 'http://testimg3.bigaka.com' // 预生产环境图片地址
...
@@ -23,6 +23,7 @@ const prodImgCtx = 'http://testimg3.bigaka.com' // 预生产环境图片地址
const
config
=
{
const
config
=
{
dev
:
devCtx
,
dev
:
devCtx
,
dev2
:
devCtx2
,
test
:
testCtx
,
test
:
testCtx
,
pre
:
preCtx
,
pre
:
preCtx
,
prod
:
prodCtx
prod
:
prodCtx
...
...
src/pages/userCenter/userCenter.js
View file @
9e4b8e02
...
@@ -14,28 +14,30 @@ wxService.page({
...
@@ -14,28 +14,30 @@ wxService.page({
* 页面的初始数据
* 页面的初始数据
*/
*/
data
:
{
data
:
{
pages
:[],
pages
:
[],
render
:
null
,
// 渲染页面数据对象(安全渲染)
render
:
null
,
// 渲染页面数据对象(安全渲染)
renderPageOver
:
false
,
// 渲染页面结束
renderPageOver
:
false
,
// 渲染页面结束
integralNum
:
0
,
integralNum
:
0
,
couponNum
:
0
,
couponNum
:
0
,
// isAllScreen: fullSucreen.isAllScreen
// isAllScreen: fullSucreen.isAllScreen
isAllScreen
:
config
.
isAllScreen
,
isAllScreen
:
config
.
isAllScreen
,
token
:
''
,
token
:
''
,
isAuthorization
:
false
,
isAuthorization
:
false
,
pageId
:
3
,
pageId
:
3
,
baseUserInfo
:
null
,
baseUserInfo
:
null
,
cardMember
:
null
,
cardMember
:
null
,
curMemberTrial
:
false
,
// 当前会员是不是体验者
curAccessiblePathArr
:
[]
// 当前体验版本对应的路径
},
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
()
{
},
onLoad
()
{
},
/**
/**
* 监听子组件事件
* 监听子组件事件
* */
* */
updatePage
(
ev
)
{
updatePage
(
ev
)
{
const
{
pageId
}
=
ev
.
detail
const
{
pageId
}
=
ev
.
detail
console
.
log
(
'pageId'
,
pageId
)
console
.
log
(
'pageId'
,
pageId
)
// this.setData({
// this.setData({
// pages: [],
// pages: [],
...
@@ -43,12 +45,12 @@ wxService.page({
...
@@ -43,12 +45,12 @@ wxService.page({
// },()=>{
// },()=>{
// this.initPage(pageId)
// this.initPage(pageId)
// })
// })
wxService
.
router
(
`/subPackage/page/pages/subPage/subPage`
).
search
({
pageId
})
wxService
.
router
(
`/subPackage/page/pages/subPage/subPage`
).
search
({
pageId
})
},
},
/**
/**
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
onShow
()
{
onShow
()
{
// 取会员卡号
// 取会员卡号
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
cardMember
=
wx
.
getStorageSync
(
'_cardMember'
)
const
cardMember
=
wx
.
getStorageSync
(
'_cardMember'
)
...
@@ -74,7 +76,6 @@ wxService.page({
...
@@ -74,7 +76,6 @@ wxService.page({
handlerDataOnPage
.
init
(
this
,
'pages'
)
handlerDataOnPage
.
init
(
this
,
'pages'
)
this
.
initPage
(
this
.
data
.
pageId
)
this
.
initPage
(
this
.
data
.
pageId
)
// _cardMemebr
// _cardMemebr
// if (baseUserInfo){
// if (baseUserInfo){
// this.setData({
// this.setData({
...
@@ -93,20 +94,32 @@ wxService.page({
...
@@ -93,20 +94,32 @@ wxService.page({
// })
// })
// }
// }
if
(
baseUserInfo
&&
!
reLoginErrFlag
){
if
(
baseUserInfo
&&
!
reLoginErrFlag
)
{
this
.
setData
({
this
.
setData
({
token
:
wx
.
getStorageSync
(
'token'
),
token
:
wx
.
getStorageSync
(
'token'
),
baseUserInfo
,
baseUserInfo
,
cardMember
,
cardMember
,
isAuthorization
:
false
isAuthorization
:
false
},
()
=>
{
},
()
=>
{
// 积分数量
// 积分数量
this
.
getMemberPointInfo
()
this
.
getMemberPointInfo
()
// 优惠券数量
// 优惠券数量
this
.
getMemberCouponInfo
()
this
.
getMemberCouponInfo
()
// 获取当前会员是否是体验者
const
{
member
}
=
baseUserInfo
const
curMemberTrial
=
member
.
trial
||
true
console
.
log
(
'curMemberTrial'
,
curMemberTrial
)
if
(
curMemberTrial
)
{
this
.
setData
({
curMemberTrial
},
()
=>
{
// 获取当前体验版信息
this
.
trialList
()
})
}
})
})
}
}
else
if
(
!
baseUserInfo
&&
reLoginErrFlag
)
{
else
if
(
!
baseUserInfo
&&
reLoginErrFlag
)
{
this
.
setData
({
this
.
setData
({
isAuthorization
:
true
isAuthorization
:
true
})
})
...
@@ -117,13 +130,31 @@ wxService.page({
...
@@ -117,13 +130,31 @@ wxService.page({
})
})
}
}
},
},
trialList
()
{
console
.
log
(
'wxService.getAssPath()'
,
wxService
.
getAssPath
())
wx
.
showLoading
({
title
:
'加载中'
})
wxService
.
get
(
`/member/trial/list`
).
then
(
res
=>
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
wx
.
hideLoading
()
console
.
log
(
'res'
,
res
)
this
.
setData
({
curAccessiblePathArr
:
data
})
}
}
})
},
// 查询积分信息
// 查询积分信息
getMemberPointInfo
(){
getMemberPointInfo
()
{
wx
.
showLoading
({
wx
.
showLoading
({
title
:
'加载中'
title
:
'加载中'
})
})
wxService
.
get
(
`/member/memberPoint/getMyPointInfo`
).
then
(
res
=>
{
wxService
.
get
(
`/member/memberPoint/getMyPointInfo`
).
then
(
res
=>
{
if
(
res
)
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
if
(
result
==
0
)
{
wx
.
hideLoading
()
wx
.
hideLoading
()
...
@@ -134,13 +165,13 @@ wxService.page({
...
@@ -134,13 +165,13 @@ wxService.page({
}
}
})
})
},
},
// 查询优惠券数量
// 查询优惠券数量
getMemberCouponInfo
(){
getMemberCouponInfo
()
{
wx
.
showLoading
({
wx
.
showLoading
({
title
:
'加载中'
title
:
'加载中'
})
})
wxService
.
post
(
`/coupon/coupon/memberCouponCount`
).
then
(
res
=>
{
wxService
.
post
(
`/coupon/coupon/memberCouponCount`
).
then
(
res
=>
{
if
(
res
)
{
if
(
res
)
{
const
{
result
,
data
}
=
res
&&
res
.
data
const
{
result
,
data
}
=
res
&&
res
.
data
if
(
result
==
0
)
{
if
(
result
==
0
)
{
wx
.
hideLoading
()
wx
.
hideLoading
()
...
@@ -157,7 +188,7 @@ wxService.page({
...
@@ -157,7 +188,7 @@ wxService.page({
})
})
},
},
// page 信息
// page 信息
initPage
(
pageId
){
initPage
(
pageId
)
{
this
.
setData
({
this
.
setData
({
products
:
[]
products
:
[]
})
})
...
@@ -167,20 +198,20 @@ wxService.page({
...
@@ -167,20 +198,20 @@ wxService.page({
// wxService.post(`/merchant/modelPage/getDetailById?pageId=${pageId}&brandId=${app.globalData.brandId}`).then(res => {
// wxService.post(`/merchant/modelPage/getDetailById?pageId=${pageId}&brandId=${app.globalData.brandId}`).then(res => {
// 动态页面
// 动态页面
wxService
.
post
(
`/merchant/modelPage/mainSetting?brandId=
${
app
.
globalData
.
brandId
}
`
).
then
(
res
=>
{
wxService
.
post
(
`/merchant/modelPage/mainSetting?brandId=
${
app
.
globalData
.
brandId
}
`
).
then
(
res
=>
{
if
(
!
res
)
return
false
if
(
!
res
)
return
false
const
{
result
,
data
}
=
res
.
data
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
if
(
result
==
0
)
{
// 动态设置title
// 动态设置title
wx
.
setNavigationBarTitle
({
wx
.
setNavigationBarTitle
({
title
:
data
.
page
.
title
title
:
data
.
page
.
title
})
})
// 段落
// 段落
const
products
=
data
.
paragraphs
const
products
=
data
.
paragraphs
const
filterResult
=
products
.
map
((
res
,
index
)
=>
{
const
filterResult
=
products
.
map
((
res
,
index
)
=>
{
return
{
return
{
...
res
,
index
...
res
,
index
}
}
}).
filter
(
item
=>
{
}).
filter
(
item
=>
{
// wx.hideLoading()
// wx.hideLoading()
})
})
...
@@ -201,13 +232,13 @@ wxService.page({
...
@@ -201,13 +232,13 @@ wxService.page({
* @param isLastPage
* @param isLastPage
* @param now
* @param now
*/
*/
renderPageFunc
({
products
})
{
renderPageFunc
({
products
})
{
let
productData
=
handlerDataOnPage
.
handlerArray
(
products
)
let
productData
=
handlerDataOnPage
.
handlerArray
(
products
)
logger
.
log
(
'productData.keysNum'
,
productData
.
keysNum
(),
productData
)
logger
.
log
(
'productData.keysNum'
,
productData
.
keysNum
(),
productData
)
this
.
setData
({
this
.
setData
({
...
productData
...
productData
},()
=>
{
},
()
=>
{
wx
.
hideLoading
()
wx
.
hideLoading
()
})
})
...
...
src/project.config.json
View file @
9e4b8e02
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
},
},
"compileType"
:
"miniprogram"
,
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.6.6"
,
"libVersion"
:
"2.6.6"
,
"appid"
:
"wx
700028bf32a3be66
"
,
"appid"
:
"wx
c3b64b09b1d3dfc2
"
,
"projectname"
:
"7-Eleven"
,
"projectname"
:
"7-Eleven"
,
"debugOptions"
:
{
"debugOptions"
:
{
"hidedInDevtools"
:
[]
"hidedInDevtools"
:
[]
...
...
src/utils/currentAccessiblePath.js
0 → 100644
View file @
9e4b8e02
var
pathJson
=
{
'7.1'
:
[
// 版本对应路径
'pages/pointList/pointList'
,
'pages/pointDetail/pointDetail'
]
}
module
.
exports
=
pathJson
\ No newline at end of file
src/utils/helper.js
View file @
9e4b8e02
...
@@ -88,18 +88,7 @@ export function getAppUserInfo () {
...
@@ -88,18 +88,7 @@ export function getAppUserInfo () {
}
}
}
}
export
default
{
export
default
{
c1C2Map
,
c1C2Map
,
c2C3Map
c2C3Map
}
}
export
function
checkOpenCard
()
{
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
let
isMember
=
'0'
if
(
baseUserInfo
&&
baseUserInfo
.
isMember
===
'1'
)
{
isMember
=
'1'
}
const
pass
=
isMember
===
'1'
return
pass
}
src/utils/wxService.js
View file @
9e4b8e02
...
@@ -14,6 +14,7 @@ const Promise = require('../lib/bluebird')
...
@@ -14,6 +14,7 @@ const Promise = require('../lib/bluebird')
const
config
=
require
(
'../config/index'
).
envInfo
const
config
=
require
(
'../config/index'
).
envInfo
import
utils
from
'./util'
import
utils
from
'./util'
let
openCardLister
=
null
let
openCardLister
=
null
const
pathData
=
require
(
'./currentAccessiblePath.js'
)
/**
/**
* 单例
* 单例
*/
*/
...
@@ -285,7 +286,16 @@ class WXService extends Http {
...
@@ -285,7 +286,16 @@ class WXService extends Http {
})
})
}
}
getAssPath
()
{
const
paths
=
pathData
let
pathArr
=
[]
for
(
const
key
in
paths
){
if
(
paths
.
hasOwnProperty
(
key
))
{
pathArr
.
push
(
key
)
}
}
return
pathArr
}
// handlerPage (page) {
// handlerPage (page) {
// const AccreditWhitePages = [
// const AccreditWhitePages = [
// 'pages/welcome/welcome'
// 'pages/welcome/welcome'
...
...
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