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
c82e10b7
Commit
c82e10b7
authored
Sep 11, 2019
by
赵雅纹
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fixbug-ZYW' into 'dev_7.1.0'
Fixbug zyw See merge request
!122
parents
dd43fccb
056a36a3
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
291 additions
and
185 deletions
+291
-185
category.js
src/pages/category/category.js
+24
-16
extendProduct.js
src/pages/extendProduct/extendProduct.js
+25
-34
myShare.js
src/pages/myShare/myShare.js
+25
-19
pointDetail.js
src/pages/pointDetail/pointDetail.js
+28
-16
pointList.js
src/pages/pointList/pointList.js
+24
-17
productDetail.js
src/pages/productDetail/productDetail.js
+1
-0
wantToBuyDetail.js
src/pages/wantToBuyDetail/wantToBuyDetail.js
+36
-26
categoryPro.js
src/subPackage/page/pages/categoryPro/categoryPro.js
+24
-17
myRelease.js
src/subPackage/page/pages/myRelease/myRelease.js
+25
-16
myReleaseDetail.js
src/subPackage/page/pages/myReleaseDetail/myReleaseDetail.js
+35
-23
wxService.js
src/utils/wxService.js
+44
-1
No files found.
src/pages/category/category.js
View file @
c82e10b7
...
...
@@ -2,6 +2,7 @@
const
app
=
getApp
()
const
wxService
=
require
(
'../../utils/wxService'
)
import
{
Integer
}
from
'../../utils/integerDigitalConvertion'
const
{
memberId
,
member
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
wxService
.
page
({
...
...
@@ -18,7 +19,18 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
let
memberId
=
options
.
memberId
;
if
(
memberId
)
{
let
tentacleInfo
=
{
content
:
'分类'
,
title
:
'分类'
,
tentacleId
:
memberId
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
CLASSIFY
,
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
this
.
generatePointObject
(
tentacleInfo
);
}
},
/**
...
...
@@ -116,20 +128,15 @@ wxService.page({
* 用户点击右上角分享
*/
onShareAppMessage
:
function
(
res
)
{
let
tentacleInfo
=
{
content
:
'分类'
,
title
:
'分类'
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
CLASSIFY
,
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
wxService
.
getTentacleContent
(
tentacleInfo
).
then
(
res
=>
{
if
(
res
&&
res
.
tentacleId
)
{
let
tentacleId
=
Integer
.
digit
(
res
.
tentacleId
,
10
,
64
);
var
path
=
`pages/category/category?t=
${
tentacleId
}
`
;
return
{
path
:
path
}
}
});
//修改为参数memberId
var
path
=
`pages/category/category`
;
if
(
memberId
)
{
let
m
=
Integer
.
digit
(
memberId
,
10
,
64
);
path
=
`pages/category/category?m=
${
m
}
`
;
}
return
{
path
:
path
}
}
})
\ No newline at end of file
src/pages/extendProduct/extendProduct.js
View file @
c82e10b7
...
...
@@ -4,6 +4,7 @@ const wxService = require('../../utils/wxService')
const
utils
=
require
(
'../../utils/util'
)
const
envInfo
=
require
(
'../../config/index'
).
envInfo
import
{
Integer
}
from
'../../utils/integerDigitalConvertion'
const
{
memberId
,
member
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
wxService
.
page
({
...
...
@@ -31,9 +32,20 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
let
memberId
=
options
.
memberId
;
if
(
memberId
){
let
tentacleInfo
=
{
content
:
'推广商品'
,
tentacleId
:
memberId
,
title
:
'推广商品'
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
PRODUCTS_PROMOTION
,
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
this
.
generatePointObject
(
tentacleInfo
);
}
},
// 点击切换
clickTab
:
function
(
e
)
{
const
{
current
}
=
e
.
target
.
dataset
...
...
@@ -309,12 +321,8 @@ wxService.page({
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
console
.
log
(
'onReachBottom'
)
console
.
log
(
this
.
data
.
currentTab
)
if
(
this
.
data
.
currentTab
==
0
){
console
.
log
(
'11111'
)
if
(
this
.
data
.
pageNo
<
this
.
data
.
totalPages
){
console
.
log
(
'22222'
)
this
.
setData
({
pageNo
:
this
.
data
.
pageNo
+
1
,
},
()
=>
{
...
...
@@ -323,7 +331,6 @@ wxService.page({
}
}
else
{
if
(
this
.
data
.
pageNum
<
this
.
data
.
myTotalPages
)
{
console
.
log
(
'333'
)
this
.
setData
({
pageNum
:
this
.
data
.
pageNum
+
1
,
},
()
=>
{
...
...
@@ -332,47 +339,32 @@ wxService.page({
}
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
:
function
(
res
)
{
console
.
log
(
res
)
if
(
res
.
from
!=
'menu'
)
{
let
id
=
Integer
.
digit
(
this
.
data
.
currentShareContent
.
id
,
10
,
64
);
let
tentacleId
=
Integer
.
digit
(
this
.
data
.
currentShareContent
.
tentacleId
,
10
,
64
);
var
path
=
'subPackage/page/pages/friendShareList/friendShareList?i='
+
id
+
'&t='
+
tentacleId
;
console
.
log
(
'
id
'
,
this
.
data
.
currentShareContent
.
id
)
console
.
log
(
'
用户点击右上角分享
'
,
this
.
data
.
currentShareContent
.
id
)
console
.
log
(
path
)
return
{
path
:
path
,
imageUrl
:
this
.
data
.
proData
[
0
].
productImgUrl
,
// 可以更换分享的图片
}
}
else
{
var
path
=
''
let
tentacleInfo
=
{
content
:
'推广商品'
,
title
:
'推广商品'
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
PRODUCTS_PROMOTION
,
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
wxService
.
getTentacleContent
(
tentacleInfo
).
then
(
res
=>
{
if
(
res
&&
res
.
tentacleId
)
{
let
tentacleId
=
Integer
.
digit
(
res
.
tentacleId
,
10
,
64
);
path
=
`pages/extendProduct/extendProduct?t=
${
tentacleId
}
`
;
console
.
log
(
'222'
)
console
.
log
(
'-------------'
,
path
)
return
{
path
:
path
,
imageUrl
:
this
.
data
.
extendProList
[
0
].
productImgUrl
,
}
}
});
//修改为参数memberId
var
path
=
`pages/extendProduct/extendProduct`
;
if
(
memberId
){
let
m
=
Integer
.
digit
(
memberId
,
10
,
64
);
path
=
`pages/extendProduct/extendProduct?m=
${
m
}
`
;
}
return
{
path
:
path
,
imageUrl
:
this
.
data
.
extendProList
[
0
].
productImgUrl
,
}
}
}
})
\ No newline at end of file
src/pages/myShare/myShare.js
View file @
c82e10b7
...
...
@@ -42,8 +42,19 @@ wxService.page({
/**
* 生命周期函数--监听页面加载
*/
onLoad
()
{
onLoad
(
options
)
{
let
memberId
=
options
.
memberId
;
if
(
memberId
)
{
let
tentacleInfo
=
{
content
:
'内容列表'
,
title
:
'内容列表'
,
tentacleId
:
memberId
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
CONTENTS_LIST
,
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
this
.
generatePointObject
(
tentacleInfo
);
}
},
/**
* 生命周期函数--监听页面显示
...
...
@@ -230,23 +241,17 @@ wxService.page({
path
:
path
,
imageUrl
:
this
.
data
.
cardUrl
,
// 可以更换分享的图片
}
}
let
tentacleInfo
=
{
content
:
'内容列表'
,
title
:
'内容列表'
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
CONTENTS_LIST
,
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
wxService
.
getTentacleContent
(
tentacleInfo
).
then
(
res
=>
{
if
(
res
&&
res
.
tentacleId
)
{
this
.
data
.
currentShareContent
.
tentacleId
=
res
.
tentacleId
;
let
tentacleId
=
Integer
.
digit
(
res
.
tentacleId
,
10
,
64
);
var
path
=
`pages/myShare/myShare?t=
${
tentacleId
}
`
;
return
{
path
:
path
}
}
else
{
//修改为参数memberId
var
path
=
`pages/myShare/myShare`
;
if
(
memberId
)
{
let
m
=
Integer
.
digit
(
memberId
,
10
,
64
);
path
=
`pages/myShare/myShare?m=
${
m
}
`
;
}
return
{
path
:
path
}
});
}
}
})
\ No newline at end of file
src/pages/pointDetail/pointDetail.js
View file @
c82e10b7
...
...
@@ -3,6 +3,7 @@ const app = getApp()
const
wxService
=
require
(
'../../utils/wxService'
)
const
utils
=
require
(
'../../utils/util'
)
import
{
Integer
}
from
'../../utils/integerDigitalConvertion'
const
{
memberId
,
member
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
wxService
.
page
({
/**
...
...
@@ -43,7 +44,23 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
let
tentacleInfo
=
{
content
:
'集点详情页面'
,
title
:
'集点详情页面'
,
tentacleId
:
memberId
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
SET_POINT_DETAILS
,
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
let
memberId
=
options
.
memberId
;
if
(
memberId
)
{
let
tentacleInfo
=
{
content
:
'集点列表页面'
,
title
:
'集点列表'
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
SET_POINT_ACTIVITY
,
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
this
.
generatePointObject
(
tentacleInfo
);
}
},
// 集点详情
getPointDetail
(
id
)
{
...
...
@@ -310,20 +327,14 @@ wxService.page({
* 用户点击右上角分享
*/
onShareAppMessage
:
function
()
{
let
tentacleInfo
=
{
content
:
'集点详情页面'
,
title
:
'集点详情页面'
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
SET_POINT_DETAILS
,
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
wxService
.
getTentacleContent
(
tentacleInfo
).
then
(
res
=>
{
if
(
res
&&
res
.
tentacleId
)
{
let
tentacleId
=
Integer
.
digit
(
res
.
tentacleId
,
10
,
64
);
var
path
=
`pages/pointList/pointList?t=
${
tentacleId
}
`
;
return
{
path
:
path
}
}
});
//修改为参数memberId
var
path
=
`pages/pointDetail/pointDetail`
;
if
(
memberId
)
{
let
m
=
Integer
.
digit
(
memberId
,
10
,
64
);
path
=
`pages/pointDetail/pointDetail?m=
${
m
}
`
;
}
return
{
path
:
path
}
}
})
\ No newline at end of file
src/pages/pointList/pointList.js
View file @
c82e10b7
...
...
@@ -3,7 +3,7 @@ const app = getApp()
const
wxService
=
require
(
'../../utils/wxService'
)
const
utils
=
require
(
'../../utils/util'
)
import
{
Integer
}
from
'../../utils/integerDigitalConvertion'
const
{
memberId
,
member
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
wxService
.
page
({
/**
...
...
@@ -18,7 +18,19 @@ wxService.page({
/**
* 生命周期函数--监听页面加载
*/
onLoad
()
{
},
onLoad
(
options
)
{
let
memberId
=
options
.
memberId
;
if
(
memberId
)
{
let
tentacleInfo
=
{
content
:
'集点列表页面'
,
title
:
'集点列表'
,
tentacleId
:
memberId
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
SET_POINT_ACTIVITY
,
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
this
.
generatePointObject
(
tentacleInfo
);
}
},
/**
* 生命周期函数--监听页面初次渲染完成
...
...
@@ -157,20 +169,14 @@ wxService.page({
* 用户点击右上角分享
*/
onShareAppMessage
:
function
()
{
let
tentacleInfo
=
{
content
:
'集点列表页面'
,
title
:
'集点列表'
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
SET_POINT_ACTIVITY
,
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
wxService
.
getTentacleContent
(
tentacleInfo
).
then
(
res
=>
{
if
(
res
&&
res
.
tentacleId
)
{
let
tentacleId
=
Integer
.
digit
(
res
.
tentacleId
,
10
,
64
);
var
path
=
`pages/pointList/pointList?t=
${
tentacleId
}
`
;
return
{
path
:
path
}
}
});
//修改为参数memberId
var
path
=
`pages/pointList/pointList`
;
if
(
memberId
)
{
let
m
=
Integer
.
digit
(
memberId
,
10
,
64
);
path
=
`pages/pointList/pointList?m=
${
m
}
`
;
}
return
{
path
:
path
}
}
})
\ No newline at end of file
src/pages/productDetail/productDetail.js
View file @
c82e10b7
...
...
@@ -3,6 +3,7 @@ var app = getApp()
const
wxService
=
require
(
'../../utils/wxService'
)
import
{
Integer
}
from
'../../utils/integerDigitalConvertion'
const
utils
=
require
(
'../../utils/util'
)
const
{
memberId
,
member
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
wxService
.
page
({
/**
...
...
src/pages/wantToBuyDetail/wantToBuyDetail.js
View file @
c82e10b7
...
...
@@ -4,6 +4,7 @@ const wxService = require('../../utils/wxService')
const
utils
=
require
(
'../../utils/util'
)
const
envInfo
=
require
(
'../../config/index'
).
envInfo
import
{
Integer
}
from
'../../utils/integerDigitalConvertion'
const
{
memberId
,
member
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
wxService
.
page
({
/**
...
...
@@ -30,6 +31,27 @@ wxService.page({
id
:
options
.
id
})
}
let
memberId
=
options
.
memberId
;
if
(
memberId
)
{
let
content
=
{
title
:
this
.
data
.
contentInfo
.
headline
,
id
:
this
.
data
.
contentInfo
.
id
,
article
:
this
.
data
.
contentInfo
.
article
,
url
:
this
.
data
.
contentInfo
.
shareShowPictureRESDTOList
[
0
].
url
}
let
tentacleInfo
=
{
content
:
JSON
.
stringify
(
content
),
contentId
:
this
.
data
.
contentInfo
.
id
,
tentacleId
:
memberId
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
DETAILS_OF_THE_CONTENT
,
//内容类型
title
:
this
.
data
.
contentInfo
.
headline
,
//标题
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
this
.
generatePointObject
(
tentacleInfo
);
}
},
/**
* 生命周期函数--监听页面显示
...
...
@@ -187,33 +209,20 @@ wxService.page({
path
:
path
,
imageUrl
:
this
.
data
.
cardUrl
,
// 可以更换分享的图片
}
}
let
content
=
{
title
:
this
.
data
.
contentInfo
.
headline
,
id
:
this
.
data
.
contentInfo
.
id
,
article
:
this
.
data
.
contentInfo
.
article
,
url
:
this
.
data
.
contentInfo
.
shareShowPictureRESDTOList
[
0
].
url
}
let
tentacleInfo
=
{
content
:
JSON
.
stringify
(
content
),
contentId
:
this
.
data
.
contentInfo
.
id
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
DETAILS_OF_THE_CONTENT
,
//内容类型
title
:
this
.
data
.
contentInfo
.
headline
,
//标题
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
wxService
.
getTentacleContent
(
tentacleInfo
).
then
(
res
=>
{
if
(
res
&&
res
.
tentacleId
)
{
let
id
=
Integer
.
digit
(
this
.
data
.
currentShareContent
.
id
,
10
,
64
);
this
.
data
.
currentShareContent
.
tentacleId
=
res
.
tentacleId
;
let
tentacleId
=
Integer
.
digit
(
res
.
tentacleId
,
10
,
64
);
var
path
=
'pages/wantToBuyDetail/wantToBuyDetail?i='
+
id
+
'&t='
+
tentacleId
;
return
{
path
:
path
,
imageUrl
:
this
.
data
.
cardUrl
,
// 可以更换分享的图片
}
}
else
{
//修改为参数memberId
var
path
=
`pages/wantToBuyDetail/wantToBuyDetail`
;
console
.
log
(
'--------------------memberId-=---'
,
memberId
)
if
(
memberId
)
{
let
m
=
Integer
.
digit
(
memberId
,
10
,
64
);
let
contentId
=
Integer
.
digit
(
this
.
data
.
contentInfo
.
id
,
10
,
64
);
path
=
`pages/wantToBuyDetail/wantToBuyDetail?i=
${
contentId
}
&m=
${
m
}
`
;
}
});
return
{
path
:
path
,
imageUrl
:
this
.
data
.
cardUrl
}
}
}
})
\ No newline at end of file
src/subPackage/page/pages/categoryPro/categoryPro.js
View file @
c82e10b7
...
...
@@ -2,7 +2,7 @@
var
app
=
getApp
()
const
wxService
=
require
(
'../../../../utils/wxService'
)
import
{
Integer
}
from
'../../../../utils/integerDigitalConvertion'
const
{
memberId
,
member
}
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
wxService
.
page
({
...
...
@@ -52,6 +52,18 @@ wxService.page({
'form.mallCategoryId'
:
options
.
id
})
}
let
memberId
=
options
.
memberId
;
if
(
memberId
)
{
let
tentacleInfo
=
{
content
:
'商品列表'
,
title
:
'商品列表'
,
tentacleId
:
memberId
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
PRODUCT_LIST
,
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
this
.
generatePointObject
(
tentacleInfo
);
}
},
/**
...
...
@@ -156,21 +168,15 @@ wxService.page({
* 用户点击右上角分享
*/
onShareAppMessage
:
function
(
res
)
{
let
tentacleInfo
=
{
content
:
'商品列表'
,
title
:
'商品列表'
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
PRODUCT_LIST
,
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
wxService
.
getTentacleContent
(
tentacleInfo
).
then
(
res
=>
{
if
(
res
&&
res
.
tentacleId
)
{
let
tentacleId
=
Integer
.
digit
(
res
.
tentacleId
,
10
,
64
);
var
path
=
`subPackage/page/pages/categoryPro/categoryPro?t=
${
tentacleId
}
`
;
console
.
log
(
path
)
return
{
path
:
path
}
}
});
//修改为参数memberId
var
path
=
`subPackage/page/pages/categoryPro/categoryPro`
;
if
(
memberId
)
{
let
m
=
Integer
.
digit
(
memberId
,
10
,
64
);
path
=
`subPackage/page/pages/categoryPro/categoryPro?m=
${
m
}
`
;
}
return
{
path
:
path
}
}
})
\ No newline at end of file
src/subPackage/page/pages/myRelease/myRelease.js
View file @
c82e10b7
...
...
@@ -31,7 +31,19 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
let
memberId
=
options
.
memberId
;
if
(
memberId
)
{
let
tentacleInfo
=
{
content
:
'我的发布页面'
,
title
:
'我的发布'
,
tentacleId
:
memberId
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
CONTENTS_LIST
,
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
this
.
generatePointObject
(
tentacleInfo
);
}
},
/**
* 生命周期函数--监听页面显示
...
...
@@ -226,21 +238,17 @@ wxService.page({
imageUrl
:
this
.
data
.
cardUrl
// 可以更换分享的图片
}
}
let
tentacleInfo
=
{
content
:
'我的发布页面'
,
title
:
'我的发布'
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
CONTENTS_LIST
,
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
wxService
.
getTentacleContent
(
tentacleInfo
).
then
(
res
=>
{
if
(
res
&&
res
.
tentacleId
)
{
let
tentacleId
=
Integer
.
digit
(
res
.
tentacleId
,
10
,
64
);
var
path
=
`subPackage/page/pages/myRelease/myRelease?t=
${
tentacleId
}
`
;
return
{
path
:
path
}
else
{
//修改为参数memberId
var
path
=
`subPackage/page/pages/myRelease/myRelease`
;
if
(
memberId
)
{
let
m
=
Integer
.
digit
(
memberId
,
10
,
64
);
path
=
`subPackage/page/pages/myRelease/myRelease?m=
${
m
}
`
;
}
return
{
path
:
path
}
});
}
}
})
\ No newline at end of file
src/subPackage/page/pages/myReleaseDetail/myReleaseDetail.js
View file @
c82e10b7
...
...
@@ -23,7 +23,7 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
console
.
log
(
options
)
console
.
log
(
'mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm'
,
options
)
if
(
options
&&
options
.
id
)
{
this
.
setData
({
id
:
options
.
id
...
...
@@ -31,6 +31,25 @@ wxService.page({
this
.
getContentDetail
()
})
}
let
memberId
=
options
.
memberId
;
if
(
memberId
)
{
let
content
=
{
title
:
this
.
data
.
contentInfo
.
headline
,
id
:
this
.
data
.
contentInfo
.
id
,
article
:
this
.
data
.
contentInfo
.
article
,
url
:
this
.
data
.
contentInfo
.
sspList
[
0
].
url
}
let
tentacleInfo
=
{
content
:
JSON
.
stringify
(
content
),
contentId
:
this
.
data
.
contentInfo
.
id
,
tentacleId
:
memberId
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
DETAILS_OF_THE_CONTENT
,
//内容类型
title
:
this
.
data
.
contentInfo
.
headline
,
//标题
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
this
.
generatePointObject
(
tentacleInfo
);
}
},
handleDel
()
{
this
.
setData
({
...
...
@@ -209,29 +228,21 @@ wxService.page({
path
:
path
,
imageUrl
:
this
.
data
.
contentInfo
.
sspList
[
0
].
url
}
}
}
else
{
//修改为参数memberId
var
path
=
`pages/wantToBuyDetail/wantToBuyDetail`
;
console
.
log
(
'--------------------memberId-=---'
,
memberId
)
if
(
memberId
)
{
let
m
=
Integer
.
digit
(
memberId
,
10
,
64
);
let
contentId
=
Integer
.
digit
(
this
.
data
.
contentInfo
.
id
,
10
,
64
);
path
=
`pages/wantToBuyDetail/wantToBuyDetail?i=
${
contentId
}
&m=
${
m
}
`
;
}
return
{
path
:
path
,
imageUrl
:
this
.
data
.
contentInfo
.
sspList
[
0
].
url
}
let
content
=
{
title
:
this
.
data
.
contentInfo
.
headline
,
id
:
this
.
data
.
contentInfo
.
id
,
article
:
this
.
data
.
contentInfo
.
article
,
url
:
this
.
data
.
contentInfo
.
sspList
[
0
].
url
}
let
tentacleInfo
=
{
content
:
JSON
.
stringify
(
content
),
contentId
:
this
.
data
.
contentInfo
.
id
,
contentType
:
app
.
globalData
.
contants
.
SHARE_TYPE
.
DETAILS_OF_THE_CONTENT
,
//内容类型
title
:
this
.
data
.
contentInfo
.
headline
,
//标题
type
:
3
// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
wxService
.
getTentacleContent
(
tentacleInfo
).
then
(
res
=>
{
if
(
res
&&
res
.
tentacleId
)
{
let
tentacleId
=
Integer
.
digit
(
res
.
tentacleId
,
10
,
64
);
var
path
=
'pages/wantToBuyDetail/wantToBuyDetail?i='
+
id
+
'&t='
+
tentacleId
;
return
{
path
:
path
}
}
});
}
})
\ No newline at end of file
src/utils/wxService.js
View file @
c82e10b7
...
...
@@ -575,6 +575,12 @@ class WXService extends Http {
item
[
'id'
]
=
Integer
.
digit
(
item
[
'i'
],
64
,
10
);
}
}
if
(
item
[
'm'
]){
item
[
'memberId'
]
=
Integer
.
digit
(
item
[
'm'
],
64
,
10
);
if
(
item
[
'i'
])
{
item
[
'id'
]
=
Integer
.
digit
(
item
[
'i'
],
64
,
10
);
}
}
});
//如果打开的是分享界面则进行触点对象信息请求并存储到本地 放到后续的header中
if
(
pageIsFromShare
)
{
...
...
@@ -640,7 +646,44 @@ class WXService extends Http {
//统一处理用户授权获取用户信息回调
_getUserInfo
(
res
)
{
_self
.
getAuthUserInfo
(
res
.
detail
)
}
},
//处理分享页面打开时参数为memberId时生成触点对象信息
generatePointObject
(
tentacleInfo
){
console
.
log
(
'---call 生成触点接口----'
)
console
.
log
(
tentacleInfo
)
_self
.
getTentacleContent
(
tentacleInfo
).
then
(
res
=>
{
console
.
log
(
'-----处理分享页面打开时参数为memberId时生成触点对象信息------'
)
console
.
log
(
'-----成功返回是------'
,
res
);
if
(
res
&&
res
.
tentacleId
)
{
let
data
=
res
;
let
TENTACLE_CONTENT
=
{
id
:
data
.
id
,
tentacleType
:
data
.
type
,
tentacleId
:
data
.
tentacleId
,
contentType
:
data
.
contentType
,
contentId
:
data
.
contentId
}
let
storageObj
=
{
memberId
:
''
,
obj
:
TENTACLE_CONTENT
}
if
(
data
.
status
==
1
)
{
var
timestamp
=
Date
.
parse
(
new
Date
())
var
expiration
=
timestamp
+
1800000
wx
.
setStorageSync
(
'TENTACLE_CONTENT'
,
storageObj
)
wx
.
setStorageSync
(
'TIME_EXPIRATION'
,
expiration
)
}
else
{
wx
.
removeStorageSync
(
'TENTACLE_CONTENT'
)
wx
.
removeStorageSync
(
'TIME_EXPIRATION'
)
}
}
});
},
}
Page
(
Object
.
assign
({},
config
,
CONFIG_PAPGE
))
}
...
...
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