Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
qinhaitao
taobao-mini-template
Commits
9530cf30
Commit
9530cf30
authored
Oct 21, 2020
by
zhaofei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'c_client' of gitlab2.dui88.com:qinhaitao/taobao-mini-template into c_client
parents
c8cec2df
b567d582
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
52 additions
and
32 deletions
+52
-32
.DS_Store
.DS_Store
+0
-0
app.json
c_client/client/app.json
+2
-1
goodsModal.axml
c_client/client/components/goodsModal/goodsModal.axml
+4
-2
goodsModal.js
c_client/client/components/goodsModal/goodsModal.js
+9
-2
prizeModal.axml
c_client/client/components/prizeModal/prizeModal.axml
+1
-1
browseGoods.js
c_client/client/pages/browseGoods/browseGoods.js
+12
-0
collectGoods.js
c_client/client/pages/collectGoods/collectGoods.js
+1
-1
myprize.js
c_client/client/pages/myprize/myprize.js
+3
-24
utils.js
c_client/client/tbcc-sdk/lib/utils.js
+20
-1
No files found.
.DS_Store
View file @
9530cf30
No preview for this file type
c_client/client/app.json
View file @
9530cf30
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
"pages/endPage/endPage"
"pages/endPage/endPage"
],
],
"window"
:
{
"window"
:
{
"defaultTitle"
:
"C端模板"
"defaultTitle"
:
"C端模板"
,
"enableSkia"
:
"true"
}
}
}
}
c_client/client/components/goodsModal/goodsModal.axml
View file @
9530cf30
<view class="goods-modal-container" style="{{{'background':`url(${task.image.bg}) no-repeat`}}}">
<view class="goods-modal-container" style="{{{'background':`url(${task.image.bg}) no-repeat`
,'backgroundSize': '750rpx 1624rpx'
}}}">
<view a:if="{{task.type == '01'}}"
<view a:if="{{task.type == '01'}}"
style="{{{'background':`url(${task.image.title}) no-repeat`,'backgroundSize': '100% 100%'}}}" class="goods-modal-container__title"></view>
style="{{{'background':`url(${task.image.title}) no-repeat`,'backgroundSize': '100% 100%'}}}"
class="goods-modal-container__title">
</view>
<view a:else class="goods-modal-container__banner" style="{{{'background':`url(${task.image.banner}) no-repeat`,'backgroundSize': '100% 100%','height':task.bannerHeight+'rpx'}}}"></view>
<view a:else class="goods-modal-container__banner" style="{{{'background':`url(${task.image.banner}) no-repeat`,'backgroundSize': '100% 100%','height':task.bannerHeight+'rpx'}}}"></view>
<view class="goods-modal-container__content" style="{{{'top':task.type == '02'?task.bannerHeight+'rpx':'209rpx'}}}">
<view class="goods-modal-container__content" style="{{{'top':task.type == '02'?task.bannerHeight+'rpx':'209rpx'}}}">
<scroll-view scroll-y="{{true}}" class="goods-modal-container__scroll">
<scroll-view scroll-y="{{true}}" class="goods-modal-container__scroll">
...
...
c_client/client/components/goodsModal/goodsModal.js
View file @
9530cf30
...
@@ -53,14 +53,21 @@ Component({
...
@@ -53,14 +53,21 @@ Component({
* 收藏商品
* 收藏商品
*/
*/
async
goToCollectGoods
(
e
)
{
async
goToCollectGoods
(
e
)
{
cons
t
{
itemId
,
collected
}
=
e
.
target
.
dataset
.
item
le
t
{
itemId
,
collected
}
=
e
.
target
.
dataset
.
item
const
{
taskType
}
=
this
.
props
.
task
const
{
taskType
}
=
this
.
props
.
task
if
(
collected
)
{
if
(
collected
)
{
commonToast
(
'您已收藏过该商品了'
)
commonToast
(
'您已收藏过该商品了'
)
return
;
return
;
}
}
let
result
=
await
collectGoods
(
+
itemId
)
//判断是否活动外已收藏商品
let
isCollected
=
await
checkGoodsCollectedStatus
(
+
itemId
)
if
(
isCollected
)
{
this
.
props
.
onCompleteTask
(
taskType
,
itemId
)
return
;
}
let
result
=
await
collectGoods
(
+
itemId
)
if
(
result
)
{
if
(
result
)
{
this
.
props
.
onCompleteTask
(
taskType
,
itemId
)
this
.
props
.
onCompleteTask
(
taskType
,
itemId
)
}
}
...
...
c_client/client/components/prizeModal/prizeModal.axml
View file @
9530cf30
<view class="my-prize-page" style="{{{'background':`url(${task.image.bg}) no-repeat center top/cover`}}}">
<view class="my-prize-page" style="{{{'background':`url(${task.image.bg}) no-repeat center top/cover`}}}">
<view class="my-prize-wrap">
<view class="my-prize-wrap">
<view class="my-prize-label"></view>
<view class="my-prize-label"
style="{{{'background':`url(${task.image.title}) no-repeat`,'backgroundSize':'100% 100%'}}}"
></view>
<view class="my-prize-list" a:if="{{myPrizeList && myPrizeList.length > 0}}">
<view class="my-prize-list" a:if="{{myPrizeList && myPrizeList.length > 0}}">
<view class="my-prize-item" a:for="{{myPrizeList}}">
<view class="my-prize-item" a:for="{{myPrizeList}}">
<image class="my-prize-avatar" src="{{item.image}}"/>
<image class="my-prize-avatar" src="{{item.image}}"/>
...
...
c_client/client/pages/browseGoods/browseGoods.js
View file @
9530cf30
...
@@ -42,6 +42,18 @@ Page({
...
@@ -42,6 +42,18 @@ Page({
console
.
log
(
10
-
this
.
usePercent
)
console
.
log
(
10
-
this
.
usePercent
)
}
}
},
},
onHide
()
{
// 页面隐藏
if
(
this
.
timer
)
{
clearInterval
(
this
.
timer
)
}
},
onUnload
()
{
// 页面被关闭
if
(
this
.
timer
)
{
clearInterval
(
this
.
timer
)
}
},
init
()
{
init
()
{
this
.
setData
({
this
.
setData
({
task
:
{
task
:
{
...
...
c_client/client/pages/collectGoods/collectGoods.js
View file @
9530cf30
...
@@ -56,7 +56,7 @@ Page({
...
@@ -56,7 +56,7 @@ Page({
const
{
success
,
data
}
=
await
API
.
getCollectGoodsList
({
activityId
,
itemIds
}).
catch
(
res
=>
{
const
{
success
,
data
}
=
await
API
.
getCollectGoodsList
({
activityId
,
itemIds
}).
catch
(
res
=>
{
res
&&
commonToast
(
res
)
res
&&
commonToast
(
res
)
})
||
{}
})
||
{}
if
(
!
success
||
success
)
{
if
(
success
)
{
this
.
setData
({
goodsList
:
data
||
[]
})
this
.
setData
({
goodsList
:
data
||
[]
})
}
}
},
},
...
...
c_client/client/pages/myprize/myprize.js
View file @
9530cf30
...
@@ -4,11 +4,9 @@ import API from "/api";
...
@@ -4,11 +4,9 @@ import API from "/api";
const
app
=
getApp
();
const
app
=
getApp
();
const
{
tbcc
}
=
app
;
const
{
tbcc
}
=
app
;
const
{
commonToast
,
navigateToOutside
,
getUserAddress
,
setClipboard
}
=
tbcc
.
tb
;
const
{
commonToast
,
navigateToOutside
,
getUserAddress
,
setClipboard
}
=
tbcc
.
tb
;
const
{
dateFormatter
}
=
tbcc
.
utils
;
const
{
dateFormatter
,
throttleHandle
}
=
tbcc
.
utils
;
const
{
PRIZE_TYPE_MAP
,
PRIZE_DRAW_STATUS_MAP
}
=
tbcc
.
constants
;
const
{
PRIZE_TYPE_MAP
,
PRIZE_DRAW_STATUS_MAP
}
=
tbcc
.
constants
;
let
flag
=
false
;
Page
({
Page
({
data
:
{
data
:
{
PRIZE_TYPE_MAP
,
PRIZE_TYPE_MAP
,
...
@@ -41,7 +39,6 @@ Page({
...
@@ -41,7 +39,6 @@ Page({
}
}
},
},
onShow
()
{
onShow
()
{
flag
=
false
this
.
getMyPrize
();
this
.
getMyPrize
();
},
},
// 到期时间
// 到期时间
...
@@ -85,7 +82,7 @@ Page({
...
@@ -85,7 +82,7 @@ Page({
},
},
//领取奖品
//领取奖品
async
handleClick
(
e
)
{
handleClick
:
throttleHandle
(
async
function
(
e
)
{
const
{
item
}
=
e
.
target
.
dataset
;
const
{
item
}
=
e
.
target
.
dataset
;
// 领取权益
// 领取权益
if
(
item
.
type
===
PRIZE_TYPE_MAP
.
EQUITY
)
return
this
.
handleGetEquity
(
e
)
if
(
item
.
type
===
PRIZE_TYPE_MAP
.
EQUITY
)
return
this
.
handleGetEquity
(
e
)
...
@@ -93,13 +90,9 @@ Page({
...
@@ -93,13 +90,9 @@ Page({
if
(
item
.
type
===
PRIZE_TYPE_MAP
.
ENTITY
)
return
this
.
handleGetEntity
(
e
)
if
(
item
.
type
===
PRIZE_TYPE_MAP
.
ENTITY
)
return
this
.
handleGetEntity
(
e
)
// 领取积分
// 领取积分
if
(
item
.
type
===
PRIZE_TYPE_MAP
.
INTEGRATION
)
return
this
.
handleGetIntergation
(
e
)
if
(
item
.
type
===
PRIZE_TYPE_MAP
.
INTEGRATION
)
return
this
.
handleGetIntergation
(
e
)
},
},
1000
),
// 优惠券
// 优惠券
async
handleGetEquity
(
e
)
{
async
handleGetEquity
(
e
)
{
if
(
flag
)
{
return
}
flag
=
true
;
const
{
activityId
}
=
app
;
const
{
activityId
}
=
app
;
const
{
item
}
=
e
.
target
.
dataset
;
const
{
item
}
=
e
.
target
.
dataset
;
console
.
log
(
item
,
'领取权益'
)
console
.
log
(
item
,
'领取权益'
)
...
@@ -111,17 +104,10 @@ Page({
...
@@ -111,17 +104,10 @@ Page({
commonToast
(
'领取成功'
)
commonToast
(
'领取成功'
)
this
.
getMyPrize
()
this
.
getMyPrize
()
}
}
setTimeout
(()
=>
{
flag
=
false
},
500
)
},
},
// 领取实物前询问
// 领取实物前询问
async
handleGetEntity
(
e
)
{
async
handleGetEntity
(
e
)
{
if
(
flag
)
{
return
}
my
.
showLoading
();
my
.
showLoading
();
flag
=
true
;
const
{
activityId
}
=
app
;
const
{
activityId
}
=
app
;
const
{
item
}
=
e
.
target
.
dataset
;
const
{
item
}
=
e
.
target
.
dataset
;
const
userAddress
=
await
getUserAddress
().
catch
(
err
=>
{
const
userAddress
=
await
getUserAddress
().
catch
(
err
=>
{
...
@@ -160,7 +146,6 @@ Page({
...
@@ -160,7 +146,6 @@ Page({
}
}
},
},
});
});
flag
=
false
},
},
// 领取实物
// 领取实物
async
receiveObjectPrize
(
params
)
{
async
receiveObjectPrize
(
params
)
{
...
@@ -174,10 +159,6 @@ Page({
...
@@ -174,10 +159,6 @@ Page({
},
},
// 积分
// 积分
async
handleGetIntergation
(
e
)
{
async
handleGetIntergation
(
e
)
{
if
(
flag
)
{
return
}
flag
=
true
;
// 判断是否为会员
// 判断是否为会员
await
this
.
getUserInfo
()
await
this
.
getUserInfo
()
const
{
isVip
,
vipLink
}
=
app
;
const
{
isVip
,
vipLink
}
=
app
;
...
@@ -186,7 +167,6 @@ Page({
...
@@ -186,7 +167,6 @@ Page({
setTimeout
(()
=>
{
setTimeout
(()
=>
{
navigateToOutside
(
vipLink
)
navigateToOutside
(
vipLink
)
},
1000
)
},
1000
)
flag
=
false
return
return
}
}
const
{
activityId
}
=
app
;
const
{
activityId
}
=
app
;
...
@@ -198,7 +178,6 @@ Page({
...
@@ -198,7 +178,6 @@ Page({
if
(
success
&&
data
)
{
if
(
success
&&
data
)
{
commonToast
(
'领取成功'
)
commonToast
(
'领取成功'
)
}
}
flag
=
false
this
.
getMyPrize
()
this
.
getMyPrize
()
},
},
...
...
c_client/client/tbcc-sdk/lib/utils.js
View file @
9530cf30
...
@@ -93,3 +93,22 @@ export const generateAPI = (apiList, request) => {
...
@@ -93,3 +93,22 @@ export const generateAPI = (apiList, request) => {
api
.
fn
=
capiFn
(
apiList
,
request
);
api
.
fn
=
capiFn
(
apiList
,
request
);
return
api
;
return
api
;
};
};
/**
* 防连点
* @param {fn} fn 函数
* @param {wait} wait 时间
*/
export
const
throttleHandle
=
(
fn
,
wait
=
500
)
=>
{
let
lastTime
=
0
return
function
cb
(...
args
)
{
let
nowTime
=
Date
.
now
()
if
(
nowTime
-
lastTime
>
wait
)
{
fn
.
call
(
this
,...
args
)
lastTime
=
nowTime
}
}
}
\ No newline at end of file
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