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
7cef625b
Commit
7cef625b
authored
Sep 02, 2019
by
赵雅纹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改触点流程
parent
f5e7318f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
88 additions
and
16 deletions
+88
-16
productListStyleOne.wxml
src/component/productListStyleOne/productListStyleOne.wxml
+1
-1
productListStyleTwo.wxml
src/component/productListStyleTwo/productListStyleTwo.wxml
+1
-1
productDetail.js
src/pages/productDetail/productDetail.js
+11
-4
productDetail.wxml
src/pages/productDetail/productDetail.wxml
+2
-1
productDetail.wxss
src/pages/productDetail/productDetail.wxss
+3
-1
wantToBuyDetail.js
src/pages/wantToBuyDetail/wantToBuyDetail.js
+23
-0
wantToBuyDetail.wxml
src/pages/wantToBuyDetail/wantToBuyDetail.wxml
+3
-3
Http.js
src/utils/Http.js
+7
-3
wxService.js
src/utils/wxService.js
+37
-2
No files found.
src/component/productListStyleOne/productListStyleOne.wxml
View file @
7cef625b
...
...
@@ -12,7 +12,7 @@
</view>
</view>
<template name="water-list">
<navigator hover-class="none" url="/pages/productDetail/productDetail?
productI
d={{productId}}">
<navigator hover-class="none" url="/pages/productDetail/productDetail?
i
d={{productId}}">
<view class="item">
<image class="item-img" src="{{indexUrl}}" mode="widthFix"></image>
<view class="item-title-box">
...
...
src/component/productListStyleTwo/productListStyleTwo.wxml
View file @
7cef625b
<!--component/productListStyleTwo/productListStyleTwo.wxml-->
<block wx:for="{{imageData}}" wx:key="{{index}}">
<navigator hover-class="none" url="/pages/productDetail/productDetail?
productI
d={{menuSec.productId}}">
<navigator hover-class="none" url="/pages/productDetail/productDetail?
i
d={{menuSec.productId}}">
<view class="hot-item border_box" >
<view class="hot-img-box">
<image class="hot-img" src="{{item.indexUrl}}" mode="widthFix" lazy-load="false" binderror="" bindload="" />
...
...
src/pages/productDetail/productDetail.js
View file @
7cef625b
...
...
@@ -22,17 +22,24 @@ wxService.page({
openPlusStatus
:
false
,
memberLevel
:
false
,
showCardModal
:
false
,
currentShareContent
:
null
currentShareContent
:
null
,
pageForm
:
true
,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
if
(
options
&&
options
.
productI
d
)
{
if
(
options
&&
options
.
i
d
)
{
this
.
setData
({
productId
:
options
.
productId
})
productId
:
options
.
id
,
pageForm
:
options
.
fromZc
!=
1
});
//不是从种草过来的, 需要清除本地临时的触点信息
if
(
!
options
.
fromZc
){
wx
.
removeStorageSync
(
'TEMP_TENTACLE_INFO'
);
wx
.
removeStorageSync
(
'TIME_EXPIRATION'
);
}
}
},
...
...
src/pages/productDetail/productDetail.wxml
View file @
7cef625b
...
...
@@ -127,8 +127,9 @@
bindsubmit="addCart"
report-submit
name='nav'
wx:if="{{pageForm}}"
>
<button class="cart-button get-formId--btn" formType="submit">加入购物车</button>
<button class="cart-button get-formId--btn" formType="submit"
>加入购物车</button>
</form>
<form
class='get-formId get-formId--form'
...
...
src/pages/productDetail/productDetail.wxss
View file @
7cef625b
...
...
@@ -201,7 +201,9 @@ page{
.product-footer .footer-buttons {
flex: 1;
display: flex;
height: 100rpx; }
height: 100rpx;
justify-content: flex-end;
}
.product-footer .footer-buttons button {
flex: 1;
...
...
src/pages/wantToBuyDetail/wantToBuyDetail.js
View file @
7cef625b
...
...
@@ -39,6 +39,29 @@ wxService.page({
this
.
data
.
currentShareContent
=
null
;
},
//跳转商品详情
onTapToGoodsInfo
(
e
){
console
.
log
(
e
)
let
item
=
e
.
currentTarget
.
dataset
.
item
;
let
productId
=
e
.
currentTarget
.
dataset
.
productid
;
//组装一个临时触点信息对象到本地
let
tempObj
=
{
memberId
:
item
.
userId
?
item
.
userId
:
'-99'
,
obj
:
{
id
:
item
.
tentacleObjectId
,
tentacleType
:
item
.
tentacleType
,
tentacleId
:
item
.
tentacleId
,
contentType
:
item
.
contentType
,
contentId
:
item
.
contentId
}
};
//存储
var
timestamp
=
Date
.
parse
(
new
Date
())
var
expiration
=
timestamp
+
1800000
wx
.
setStorageSync
(
'TEMP_TENTACLE_INFO'
,
tempObj
);
wx
.
setStorageSync
(
'TIME_EXPIRATION'
,
expiration
);
wxService
.
router
(
`/pages/productDetail/productDetail?id=
${
productId
}
&fromZc=1`
);
},
// 分享
onTapShare
()
{
...
...
src/pages/wantToBuyDetail/wantToBuyDetail.wxml
View file @
7cef625b
...
...
@@ -17,8 +17,8 @@
<view class="buy-product-wrap">
<view class="buy-product-content">
<block wx:for="{{proList}}" wx:key="{{index}}">
<
navigator hover-class="none" url="/pages/productDetail/productDetail?productId={{item.productId}}"
>
<view class="buy-list">
<
!-- <navigator hover-class="none" url="/pages/productDetail/productDetail?productId={{item.productId}}"> --
>
<view class="buy-list"
bindtap="onTapToGoodsInfo" data-item="{{contentInfo}}" data-productid="{{item.productId}}"
>
<view class="prod-img">
<image src="{{item.indexUrl}}" />
</view>
...
...
@@ -32,7 +32,7 @@
</view>
</view>
</view>
<
/navigator
>
<
!-- </navigator> --
>
</block>
</view>
</view>
...
...
src/utils/Http.js
View file @
7cef625b
...
...
@@ -177,10 +177,14 @@ class Http {
getTentacle
(){
let
time
=
Date
.
parse
(
new
Date
())
let
TIME_EXPIRATION
=
wx
.
getStorageSync
(
'TIME_EXPIRATION'
)
let
TENTACLE_CONTENT
=
JSON
.
stringify
(
wx
.
getStorageSync
(
'TENTACLE_CONTENT'
))
if
(
TENTACLE_CONTENT
&&
TIME_EXPIRATION
>
time
){
let
storage
=
wx
.
getStorageSync
(
'TENTACLE_CONTENT'
)
,
tentacle
=
null
;
if
(
storage
){
tentacle
=
storage
.
obj
;
}
if
(
tentacle
&&
TIME_EXPIRATION
>
time
){
wx
.
setStorageSync
(
'TIME_EXPIRATION'
,
time
)
return
TENTACLE_CONTENT
return
JSON
.
stringify
(
tentacle
);
}
else
{
wx
.
removeStorageSync
(
'TENTACLE_CONTENT'
)
wx
.
removeStorageSync
(
'TIME_EXPIRATION'
)
...
...
src/utils/wxService.js
View file @
7cef625b
...
...
@@ -266,17 +266,52 @@ class WXService extends Http {
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'
,
TENTACLE_CONTENT
)
wx
.
setStorageSync
(
'TENTACLE_CONTENT'
,
storageObj
)
wx
.
setStorageSync
(
'TIME_EXPIRATION'
,
expiration
)
}
}).
finally
(()
=>
{
})
}
//更新本地触点对象信息
updateLocalTentacleInfo
(){
//先获取本地触点对象信息
let
tentacleInfo
=
wx
.
getStorageSync
(
'TENTACLE_CONTENT'
);
//获取从种草详情商品购买时存储的临时触点对象信息
let
tempTentacleInfo
=
wx
.
getStorageSync
(
'TEMP_TENTACLE_INFO'
);
//格式
/**
* tempTentacleInfo = {
* memberId : '',
* obj : {}
}
*
*/
//判断tentacleInfo是否为空
if
(
!
tentacleInfo
){
wx
.
setStorageSync
(
'TENTACLE_CONTENT'
,
tempTentacleInfo
);
return
;
}
//tentacleInfo 不为空
//判断先获取本地触点对象信息 中memberid 是否为空
let
memberId
=
tentacleInfo
.
memberId
;
// 若memberId 为空 表示从分享过来的链接 此时不能更新wx.getStorageSync('TENTACLE_CONTENT') 信息
if
(
!
memberId
){
return
;
}
//不为空 则表示 之前从种草详情中的商品直接购买过 直接更新本地TENTACLE_CONTENT
wx
.
setStorageSync
(
'TENTACLE_CONTENT'
,
tempTentacleInfo
);
}
getManageDate
()
{
return
manageDate
...
...
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