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
5985997f
Commit
5985997f
authored
Apr 21, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化功能
parent
21ff127a
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
79 additions
and
17 deletions
+79
-17
app.js
src/app.js
+20
-1
index.js
src/config/index.js
+2
-2
cart.js
src/pages/cart/cart.js
+31
-8
cart.json
src/pages/cart/cart.json
+1
-0
cart.wxml
src/pages/cart/cart.wxml
+1
-1
category.wxml
src/pages/category/category.wxml
+1
-1
confirmOrder.js
src/pages/confirmOrder/confirmOrder.js
+9
-0
couponCenterInfo.js
...ubPackage/page/pages/couponCenterInfo/couponCenterInfo.js
+0
-1
scratch.js
src/subPackageMarketing/page/components/scratch/scratch.js
+1
-1
scratch.js
src/subPackageMarketing/page/pages/scratch/scratch.js
+13
-2
No files found.
src/app.js
View file @
5985997f
...
...
@@ -171,5 +171,24 @@ App({
isPlusVip
:
isPlusVip
,
cityJson
:
cityJson
,
brandId
:
envInfo
.
brandId
,
}
},
//跳转10级
navigateTo
(
routerObj
){
//参数object : {url : ''}
if
(
!
routerObj
){
console
.
error
(
'跳转页面需要路径'
);
return
;
}
if
(
Object
.
keys
(
routerObj
).
length
==
0
){
console
.
error
(
'跳转页面需要路径'
);
return
;
}
if
(
getCurrentPages
().
length
>
9
){
wx
.
redirectTo
(
routerObj
);
}
else
{
wx
.
navigateTo
(
routerObj
)
}
},
})
src/config/index.js
View file @
5985997f
...
...
@@ -6,7 +6,7 @@
// 修改 BRANCH_ID 为对应的商户id
// app.js 中brandId 修改为对应
const
PROJECT_ENV
=
'
prod
'
// 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
const
PROJECT_ENV
=
'
test
'
// 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
//仅生产环境时 配置 :
//3001 3001 , wx313ec36b710125d4 有直播
//2006 泰华 , wx40fec8944623c8b3 有直播
...
...
@@ -25,7 +25,7 @@ const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门
//2992 山东盛联微商城 wx53dedc202ae0d0c2
//2002 巴黎贝甜 wx21968cb3a486d4ab
const
BRANCH_ID
=
3001
const
BRANCH_ID
=
1002
const
isMall
=
true
// const needMock = '' //
...
...
src/pages/cart/cart.js
View file @
5985997f
...
...
@@ -64,7 +64,7 @@ wxService.page({
},
// 查询 /trolley/query
getCartList
()
{
getCartList
(
refresh
)
{
wx
.
showLoading
({
title
:
'加载中'
})
...
...
@@ -91,9 +91,18 @@ wxService.page({
this
.
setData
({
cartList
:
validateCarts
,
invalidCarts
:
invalidCarts
,
checkAll
:
false
,
shopCartTotalFee
:
0
,
})
}
}
if
(
refresh
){
wx
.
showToast
({
title
:
'刷新成功'
,
});
wx
.
stopPullDownRefresh
();
}
})
},
minusNumChange
(
e
)
{
...
...
@@ -442,14 +451,24 @@ wxService.page({
//清空有效宝贝
onTapEmptyValidCarts
(){
let
self
=
this
;
let
checked
=
self
.
data
.
cartList
.
filter
(
item
=>
item
.
checked
);
if
(
checked
.
length
==
0
){
wx
.
showToast
({
title
:
'请先勾选需要删除的商品'
,
icon
:
'none'
});
return
;
}
wx
.
showModal
({
title
:
'提示'
,
content
:
'确认
清空购物车中所有有效
宝贝?'
,
content
:
'确认
删除购物车中勾选的
宝贝?'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
wx
.
showLoading
(
'清除中...'
);
let
promiseArr
=
[];
self
.
data
.
cartList
.
forEach
(
item
=>
{
checked
.
forEach
(
item
=>
{
let
skuId
=
item
.
skuId
;
let
tempPromise
=
wxService
.
post
(
`/sale/trolley/remove?skuId=
${
skuId
}
`
);
promiseArr
.
push
(
tempPromise
);
...
...
@@ -460,11 +479,7 @@ wxService.page({
wx
.
showToast
({
title
:
'清除成功'
,
});
self
.
setData
({
cartList
:
[],
checkAll
:
false
,
shopCartTotalFee
:
0
,
});
self
.
getCartList
();
}).
catch
(
err
=>
{
wx
.
hideLoading
();
wx
.
showToast
({
...
...
@@ -593,4 +608,11 @@ wxService.page({
}
else
{
}
},
//
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
this
.
getCartList
(
true
);
},
})
\ No newline at end of file
src/pages/cart/cart.json
View file @
5985997f
{
"navigationBarTitleText"
:
"购物车"
,
"enablePullDownRefresh"
:
true
,
"usingComponents"
:
{
"scroll-del"
:
"/component/scrollDel/scrollDel"
,
"go-home"
:
"/component/goHome/goHome"
,
...
...
src/pages/cart/cart.wxml
View file @
5985997f
...
...
@@ -3,7 +3,7 @@
<view class="cart-content" wx:if="{{cartList.length}}">
<view class="invalid-title">
<label>有效宝贝</label>
<text class="theme-text-color" bindtap="onTapEmptyValidCarts">
清空
</text>
<text class="theme-text-color" bindtap="onTapEmptyValidCarts">
删除
</text>
</view>
<!-- 购物车列表 -->
<scroll-del
...
...
src/pages/category/category.wxml
View file @
5985997f
...
...
@@ -32,7 +32,7 @@
hover-class="none"
class="sec-menu-image"
open-type="navigate"
url="/subPackage/page/pages/
fun/fun
?id={{menuSec.id}}&name={{menuSec.label}}"
url="/subPackage/page/pages/
categoryPro/categoryPro
?id={{menuSec.id}}&name={{menuSec.label}}"
>
<image src="{{menuSec.image}}" mode="widthFix" />
</navigator>
...
...
src/pages/confirmOrder/confirmOrder.js
View file @
5985997f
...
...
@@ -100,12 +100,16 @@ wxService.page({
title
:
'没有可用积分抵扣'
,
icon
:
'none'
});
return
;
}
this
.
data
.
deductCheckStatus
=
!
this
.
data
.
deductCheckStatus
;
this
.
setData
({
deductCheckStatus
:
this
.
data
.
deductCheckStatus
});
//需要计算显示订单价格
},
//显示积分抵扣规则
onTapShowDeductRule
(){
...
...
@@ -354,6 +358,7 @@ wxService.page({
// 实付款
this
.
setPayPrice
();
},
//计算显示订单价格
setPayPrice
()
{
const
{
currentCoupon
,
...
...
@@ -369,6 +374,10 @@ wxService.page({
let
calCouponPrice
=
orderCoupon
?
orderCoupon
:
defalutCoupon
//获取计算优惠后的价格
let
promotionPrice
=
(
orderInitPrice
-
calCouponPrice
)
>
0
?
(
orderInitPrice
-
calCouponPrice
)
:
0
;
//看一下积分是否勾选了
if
(
this
.
data
.
deductCheckStatus
){
promotionPrice
=
parseFloat
(
promotionPrice
-
this
.
data
.
pointDeductMoney
).
toString
(
2
);
}
// 实际价格 - 优惠价 + plus
this
.
setData
({
// orderPrice: Math.round(orderInitPrice - orderCoupon)
...
...
src/subPackage/page/pages/couponCenterInfo/couponCenterInfo.js
View file @
5985997f
...
...
@@ -32,7 +32,6 @@ wxService.page({
if
(
res
){
let
obj
=
res
.
data
.
data
?
res
.
data
.
data
:
null
;
if
(
obj
){
console
.
log
(
obj
)
let
arr
=
obj
.
definition
?
JSON
.
parse
(
obj
.
definition
)
:
[];
obj
.
desc
=
arr
.
filter
(
item
=>
item
.
type
==
2
);
obj
.
hasExpDate
=
arr
.
filter
(
item
=>
item
.
type
==
1
).
length
>
0
;
...
...
src/subPackageMarketing/page/components/scratch/scratch.js
View file @
5985997f
...
...
@@ -173,7 +173,7 @@ class Scratch {
if
(
!
this
.
isStart
)
return
// 自动清楚采用点范围值方式判断
const
{
canvasWidth
,
canvasHeight
,
minX
,
minY
,
maxX
,
maxY
}
=
this
if
(
maxX
-
minX
>
.
3
*
canvasWidth
&&
maxY
-
minY
>
.
3
*
canvasHeight
)
{
if
(
maxX
-
minX
>
.
2
*
canvasWidth
&&
maxY
-
minY
>
.
2
*
canvasHeight
)
{
this
.
ctx
.
draw
()
this
.
endCallBack
&&
this
.
endCallBack
()
this
.
isStart
=
false
...
...
src/subPackageMarketing/page/pages/scratch/scratch.js
View file @
5985997f
...
...
@@ -42,8 +42,19 @@ wxService.page({
let
data
=
res
.
data
.
data
?
res
.
data
.
data
:
null
;
if
(
data
){
if
(
data
.
type
==
3
){
let
memberId
=
data
.
tentacleId
;
this
.
markShareRecords
(
memberId
,
this
.
data
.
activityId
);
//判断打开着是不是自己
let
currentLogginUser
=
wx
.
getStorageSync
(
'_baseUserInfo'
);
if
(
!
currentLogginUser
){
let
memberId
=
data
.
tentacleId
;
this
.
markShareRecords
(
memberId
,
this
.
data
.
activityId
);
}
else
{
let
curLoginMemberId
=
currentLogginUser
.
memberId
;
if
(
curLoginMemberId
!=
memberId
){
// 不是自己打开的分享链接时才调用分享成功的接口 防止自己刷次数
let
memberId
=
data
.
tentacleId
;
this
.
markShareRecords
(
memberId
,
this
.
data
.
activityId
);
}
}
}
}
}
...
...
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