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
0c78f968
Commit
0c78f968
authored
Dec 14, 2020
by
mqf_0707
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
浏览等页面更新接收数据返回参数
parent
d51c4044
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
41 additions
and
52 deletions
+41
-52
app.js
c_client/client/app.js
+1
-1
prizeModal.axml
c_client/client/components/prizeModal/prizeModal.axml
+10
-10
prizeModal.js
c_client/client/components/prizeModal/prizeModal.js
+3
-3
package-lock.json
c_client/client/package-lock.json
+5
-0
browseGoods.axml
c_client/client/pages/browseGoods/browseGoods.axml
+1
-1
browseGoods.js
c_client/client/pages/browseGoods/browseGoods.js
+6
-5
collectGoods.js
c_client/client/pages/collectGoods/collectGoods.js
+1
-1
myprize.js
c_client/client/pages/myprize/myprize.js
+6
-6
orderGoods.js
c_client/client/pages/orderGoods/orderGoods.js
+1
-1
capi.js
c_client/client/tbcc-sdk/lib/capi.js
+4
-4
constants.js
c_client/client/tbcc-sdk/lib/constants.js
+1
-18
utils.js
c_client/client/tbcc-sdk/lib/utils.js
+2
-2
No files found.
c_client/client/app.js
View file @
0c78f968
...
@@ -6,7 +6,7 @@ cloud.init({
...
@@ -6,7 +6,7 @@ cloud.init({
});
});
App
({
App
({
requestType
:
'
tornadoAPI
'
,
// cloud: 云函数, yapi: yapi 接口, ams: ams接口,tornadoAPI: 风驰台接口
requestType
:
'
yapi
'
,
// cloud: 云函数, yapi: yapi 接口, ams: ams接口,tornadoAPI: 风驰台接口
cloudName
:
'CommonToC'
,
// 主云函数项目名
cloudName
:
'CommonToC'
,
// 主云函数项目名
tornadoAPI
:
'https://tornado.duibadev.com.cn/tbServer/api?db=xxx&proxyIp=xxx'
,
// 新增:当requestType: 'tornadoAPI'时,找服务端提供地址
tornadoAPI
:
'https://tornado.duibadev.com.cn/tbServer/api?db=xxx&proxyIp=xxx'
,
// 新增:当requestType: 'tornadoAPI'时,找服务端提供地址
cloud
,
cloud
,
...
...
c_client/client/components/prizeModal/prizeModal.axml
View file @
0c78f968
...
@@ -11,31 +11,31 @@
...
@@ -11,31 +11,31 @@
<!-- 复制按钮 -->
<!-- 复制按钮 -->
<image class="my-prize-copy" data-text="{{item._id}}" onTap="handleCopyId" src="{{task.image.copyIcon}}" />
<image class="my-prize-copy" data-text="{{item._id}}" onTap="handleCopyId" src="{{task.image.copyIcon}}" />
</view>
</view>
<view class="my-prize-tip" a:if="{{item.drawStatus ===
PRIZE_DRAW_STATUS_MAP.FAILURE
}}">{{item.remark}}</view>
<view class="my-prize-tip" a:if="{{item.drawStatus ===
DRAW_STATUS.FAIL
}}">{{item.remark}}</view>
<view class="my-prize-tip" a:if="{{item.drawStatus ===
PRIZE_DRAW_STATUS_MAP.REPEAT || (item.drawStatus === PRIZE_DRAW_STATUS_MAP.RECEIVE
)}}">请于{{endTime}}前领取</view>
<view class="my-prize-tip" a:if="{{item.drawStatus ===
DRAW_STATUS.RETRY || (item.drawStatus === DRAW_STATUS.WAITAWARD
)}}">请于{{endTime}}前领取</view>
<view class="my-prize-tip" a:if="{{item.drawStatus ===
PRIZE_DRAW_STATUS_MAP.FINISH
ED }}">奖品已过期失效</view>
<view class="my-prize-tip" a:if="{{item.drawStatus ===
DRAW_STATUS.EXPIR
ED }}">奖品已过期失效</view>
</view>
</view>
<view class="prize-status" style="{{task.btnStyle}}">
<view class="prize-status" style="{{task.btnStyle}}">
<!-- 未领取 -->
<!-- 未领取 -->
<block a:if="{{item.drawStatus===
PRIZE_DRAW_STATUS_MAP.RECEIVE
}}">
<block a:if="{{item.drawStatus===
DRAW_STATUS.WAITAWARD
}}">
<!-- 实物填写地址 -->
<!-- 实物填写地址 -->
<image a:if="{{item.type === PRIZE_TYPE
_MAP.ENTITY
}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.addressBth}}" />
<image a:if="{{item.type === PRIZE_TYPE
.OBJECT
}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.addressBth}}" />
<!-- 优惠券立即领取 -->
<!-- 优惠券立即领取 -->
<image a:else onTap="handleClick" data-item="{{item}}" src="{{task.image.getBth}}" />
<image a:else onTap="handleClick" data-item="{{item}}" src="{{task.image.getBth}}" />
</block>
</block>
<!-- 已领取 -->
<!-- 已领取 -->
<block a:if="{{item.drawStatus===
PRIZE_DRAW_STATUS_MAP
.SUCCESS}}">
<block a:if="{{item.drawStatus===
DRAW_STATUS
.SUCCESS}}">
<!-- 实物查看物流 -->
<!-- 实物查看物流 -->
<image a:if="{{item.type === PRIZE_TYPE
_MAP.ENTITY
}}" onTap="handleView" data-item="{{item}}" src="{{task.image.logisticsBth}}" />
<image a:if="{{item.type === PRIZE_TYPE
.OBJECT
}}" onTap="handleView" data-item="{{item}}" src="{{task.image.logisticsBth}}" />
<!-- 优惠券去使用 -->
<!-- 优惠券去使用 -->
<image a:else onTap="handleTouse" data-item="{{item}}" src="{{task.image.useBtn}}" />
<image a:else onTap="handleTouse" data-item="{{item}}" src="{{task.image.useBtn}}" />
</block>
</block>
<!-- 重新领取 -->
<!-- 重新领取 -->
<image a:if="{{item.drawStatus===
PRIZE_DRAW_STATUS_MAP.REPEAT
}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.getAgainBtn}}" />
<image a:if="{{item.drawStatus===
DRAW_STATUS.RETRY
}}" onTap="handleClick" data-item="{{item}}" src="{{task.image.getAgainBtn}}" />
<!-- 已失效 -->
<!-- 已失效 -->
<image a:if="{{item.drawStatus===
PRIZE_DRAW_STATUS_MAP.FINISH
ED}}" src="{{task.image.invalidBtn}}" />
<image a:if="{{item.drawStatus===
DRAW_STATUS.EXPIR
ED}}" src="{{task.image.invalidBtn}}" />
<!-- 领取失败 -->
<!-- 领取失败 -->
<image a:if="{{item.drawStatus===
PRIZE_DRAW_STATUS_MAP.FAILURE
}}" src="{{task.image.failBth}}" />
<image a:if="{{item.drawStatus===
DRAW_STATUS.FAIL
}}" src="{{task.image.failBth}}" />
</view>
</view>
</view>
</view>
</view>
</view>
...
...
c_client/client/components/prizeModal/prizeModal.js
View file @
0c78f968
...
@@ -2,12 +2,12 @@
...
@@ -2,12 +2,12 @@
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
{
PRIZE_TYPE
_MAP
,
PRIZE_DRAW_STATUS_MAP
}
=
tbcc
.
constants
;
const
{
PRIZE_TYPE
,
DRAW_STATUS
}
=
tbcc
.
constants
;
Component
({
Component
({
mixins
:
[],
mixins
:
[],
data
:
{
data
:
{
PRIZE_TYPE
_MAP
,
PRIZE_TYPE
,
PRIZE_DRAW_STATUS_MAP
,
DRAW_STATUS
,
currentPrize
:
{},
currentPrize
:
{},
isLogistic
:
false
,
isLogistic
:
false
,
},
},
...
...
c_client/client/package-lock.json
View file @
0c78f968
...
@@ -7,6 +7,11 @@
...
@@ -7,6 +7,11 @@
"version"
:
"1.3.4"
,
"version"
:
"1.3.4"
,
"resolved"
:
"https://registry.npm.taobao.org/@tbmp/mp-cloud-sdk/download/@tbmp/mp-cloud-sdk-1.3.4.tgz"
,
"resolved"
:
"https://registry.npm.taobao.org/@tbmp/mp-cloud-sdk/download/@tbmp/mp-cloud-sdk-1.3.4.tgz"
,
"integrity"
:
"sha1-+1HCYryYfVc0kze0SOWv1oL6xgk="
"integrity"
:
"sha1-+1HCYryYfVc0kze0SOWv1oL6xgk="
},
"crypto"
:
{
"version"
:
"1.0.1"
,
"resolved"
:
"https://registry.npm.taobao.org/crypto/download/crypto-1.0.1.tgz"
,
"integrity"
:
"sha1-KvG3ytgXXSTIobB3glV5SiGAMDc="
}
}
}
}
}
}
c_client/client/pages/browseGoods/browseGoods.axml
View file @
0c78f968
...
@@ -6,5 +6,5 @@
...
@@ -6,5 +6,5 @@
onCompleteTask="onCompleteTask" />
onCompleteTask="onCompleteTask" />
<!-- 倒计时 -->
<!-- 倒计时 -->
<count-down-modal a:if="{{isShowCountdown}}" percent="{{percent}}" hasPercent="{{(10 - usePercent)}}" styleType="{{'01'}}" />
<count-down-modal a:if="{{isShowCountdown
&& completeType == 1
}}" percent="{{percent}}" hasPercent="{{(10 - usePercent)}}" styleType="{{'01'}}" />
</view>
</view>
\ No newline at end of file
c_client/client/pages/browseGoods/browseGoods.js
View file @
0c78f968
...
@@ -14,15 +14,16 @@
...
@@ -14,15 +14,16 @@
* color: //商品名称:文字颜色
* color: //商品名称:文字颜色
* }
* }
*/
*/
import
API
from
'../../api'
;
const
app
=
getApp
();
const
app
=
getApp
();
const
{
tbcc
}
=
app
;
const
{
tbcc
}
=
app
;
const
{
commonToast
}
=
tbcc
.
tb
;
const
{
commonToast
}
=
tbcc
.
tb
;
import
API
from
'../../api'
;
const
completeType
=
1
// 1 浏览完成 2 点击任意商品完成
Page
({
Page
({
completeType
:
'01'
,
//01:浏览完成 02点击任意商品完成
timer
:
null
,
timer
:
null
,
data
:
{
data
:
{
completeType
:
completeType
,
usePercent
:
0
,
// 已进行的进度条
usePercent
:
0
,
// 已进行的进度条
percent
:
0
,
// 进度条
percent
:
0
,
// 进度条
isShowCountdown
:
true
,
// 是否显示倒计时
isShowCountdown
:
true
,
// 是否显示倒计时
...
@@ -36,7 +37,7 @@ Page({
...
@@ -36,7 +37,7 @@ Page({
},
},
onShow
()
{
onShow
()
{
//重新回到页面开启倒计时
//重新回到页面开启倒计时
if
(
!
this
.
timer
&&
this
.
completeType
==
'01'
)
{
if
(
!
this
.
timer
&&
completeType
==
1
)
{
this
.
setData
({
usePercent
:
this
.
data
.
percent
})
this
.
setData
({
usePercent
:
this
.
data
.
percent
})
this
.
browseGoodsTimes
()
this
.
browseGoodsTimes
()
console
.
log
(
10
-
this
.
usePercent
)
console
.
log
(
10
-
this
.
usePercent
)
...
@@ -80,7 +81,7 @@ Page({
...
@@ -80,7 +81,7 @@ Page({
res
&&
commonToast
(
res
)
res
&&
commonToast
(
res
)
})
||
{}
})
||
{}
if
(
success
)
{
if
(
success
)
{
this
.
setData
({
goodsList
:
data
||
[]
})
this
.
setData
({
goodsList
:
data
.
list
||
[]
})
}
}
},
},
//任务完成
//任务完成
...
@@ -97,7 +98,7 @@ Page({
...
@@ -97,7 +98,7 @@ Page({
* 跳转商品详情页
* 跳转商品详情页
*/
*/
onOpenDetail
(
itemId
=
''
)
{
onOpenDetail
(
itemId
=
''
)
{
if
(
this
.
completeType
==
'01'
)
{
if
(
completeType
==
1
)
{
this
.
setData
({
this
.
setData
({
percent
:
this
.
data
.
usePercent
,
percent
:
this
.
data
.
usePercent
,
},
()
=>
{
},
()
=>
{
...
...
c_client/client/pages/collectGoods/collectGoods.js
View file @
0c78f968
...
@@ -57,7 +57,7 @@ Page({
...
@@ -57,7 +57,7 @@ Page({
res
&&
commonToast
(
res
)
res
&&
commonToast
(
res
)
})
||
{}
})
||
{}
if
(
success
)
{
if
(
success
)
{
this
.
setData
({
goodsList
:
data
||
[]
})
this
.
setData
({
goodsList
:
data
.
list
||
[]
})
}
}
},
},
//任务完成 616444374083
//任务完成 616444374083
...
...
c_client/client/pages/myprize/myprize.js
View file @
0c78f968
...
@@ -5,12 +5,12 @@ const app = getApp();
...
@@ -5,12 +5,12 @@ 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
,
throttleHandle
}
=
tbcc
.
utils
;
const
{
dateFormatter
,
throttleHandle
}
=
tbcc
.
utils
;
const
{
PRIZE_TYPE
_MAP
,
PRIZE_DRAW_STATUS_MAP
}
=
tbcc
.
constants
;
const
{
PRIZE_TYPE
,
DRAW_STATUS
}
=
tbcc
.
constants
;
Page
({
Page
({
data
:
{
data
:
{
PRIZE_TYPE
_MAP
,
PRIZE_TYPE
,
PRIZE_DRAW_STATUS_MAP
,
DRAW_STATUS
,
myPrizeList
:
null
,
//我的奖品
myPrizeList
:
null
,
//我的奖品
endTime
:
null
,
//到期时间
endTime
:
null
,
//到期时间
task
:
{
task
:
{
...
@@ -85,11 +85,11 @@ Page({
...
@@ -85,11 +85,11 @@ Page({
handleClick
:
throttleHandle
(
async
function
(
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
.
ENAME
)
return
this
.
handleGetEquity
(
e
)
// 领取实物
// 领取实物
if
(
item
.
type
===
PRIZE_TYPE
_MAP
.
ENTITY
)
return
this
.
handleGetEntity
(
e
)
if
(
item
.
type
===
PRIZE_TYPE
.
OBJECT
)
return
this
.
handleGetEntity
(
e
)
// 领取积分
// 领取积分
if
(
item
.
type
===
PRIZE_TYPE
_MAP
.
INTEGRATION
)
return
this
.
handleGetIntergation
(
e
)
if
(
item
.
type
===
PRIZE_TYPE
.
CREDITS
)
return
this
.
handleGetIntergation
(
e
)
},
1000
),
},
1000
),
// 优惠券
// 优惠券
async
handleGetEquity
(
e
)
{
async
handleGetEquity
(
e
)
{
...
...
c_client/client/pages/orderGoods/orderGoods.js
View file @
0c78f968
...
@@ -58,7 +58,7 @@ Page({
...
@@ -58,7 +58,7 @@ Page({
res
&&
commonToast
(
res
)
res
&&
commonToast
(
res
)
})
||
{}
})
||
{}
if
(
success
)
{
if
(
success
)
{
this
.
setData
({
goodsList
:
data
||
[]
})
this
.
setData
({
goodsList
:
data
.
list
||
[]
})
}
}
},
},
});
});
c_client/client/tbcc-sdk/lib/capi.js
View file @
0c78f968
...
@@ -8,10 +8,10 @@ const capi = {
...
@@ -8,10 +8,10 @@ const capi = {
receiveEnamePrize
:
{
method
:
'GET'
,
handle
:
'receiveEnamePrize'
},
receiveEnamePrize
:
{
method
:
'GET'
,
handle
:
'receiveEnamePrize'
},
getItemListByItemIds
:
{
method
:
'GET'
,
handle
:
'getItemListByItemIds'
},
getItemListByItemIds
:
{
method
:
'GET'
,
handle
:
'getItemListByItemIds'
},
getCollectGoodsList
:
{
method
:
'GET'
,
handle
:
'getCollectGoodsList'
},
getCollectGoodsList
:
{
method
:
'GET'
,
handle
:
'getCollectGoodsList'
},
doCollectGoodsTask
:
{
method
:
'GET'
,
handle
:
'doCompleteTask'
,
de
d
aultParams
:
{
taskType
:
'collectGoods'
}
},
doCollectGoodsTask
:
{
method
:
'GET'
,
handle
:
'doCompleteTask'
,
de
f
aultParams
:
{
taskType
:
'collectGoods'
}
},
doBrowseGoodsTask
:
{
method
:
'GET'
,
handle
:
'doCompleteTask'
,
de
d
aultParams
:
{
taskType
:
'browseGoods'
}
},
doBrowseGoodsTask
:
{
method
:
'GET'
,
handle
:
'doCompleteTask'
,
de
f
aultParams
:
{
taskType
:
'browseGoods'
}
},
doJumpLinkTask
:
{
method
:
'GET'
,
handle
:
'doCompleteTask'
,
de
d
aultParams
:
{
taskType
:
'jumpLink'
}
},
doJumpLinkTask
:
{
method
:
'GET'
,
handle
:
'doCompleteTask'
,
de
f
aultParams
:
{
taskType
:
'jumpLink'
}
},
doExchangeCreditsTask
:
{
method
:
'GET'
,
handle
:
'doCompleteTask'
,
de
d
aultParams
:
{
taskType
:
'exchangeCredits'
}
},
doExchangeCreditsTask
:
{
method
:
'GET'
,
handle
:
'doCompleteTask'
,
de
f
aultParams
:
{
taskType
:
'exchangeCredits'
}
},
getVipInfo
:
{
method
:
'GET'
,
handle
:
'getVipInfo'
}
getVipInfo
:
{
method
:
'GET'
,
handle
:
'getVipInfo'
}
};
};
...
...
c_client/client/tbcc-sdk/lib/constants.js
View file @
0c78f968
...
@@ -35,20 +35,3 @@ export const PRIZE_TYPE = {
...
@@ -35,20 +35,3 @@ export const PRIZE_TYPE = {
OBJECT
:
3
,
OBJECT
:
3
,
THANKS
:
5
THANKS
:
5
};
};
// 我的奖品状态
export
const
PRIZE_DRAW_STATUS_MAP
=
{
RECEIVE
:
1
,
// 待领取
DEALING
:
2
,
// 处理中
SUCCESS
:
3
,
// 领取成功
FAILURE
:
4
,
// 领取失败
FINISHED
:
5
,
// 已过期
REPEAT
:
6
,
// 重新领取
}
// 奖品类型
export
const
PRIZE_TYPE_MAP
=
{
EQUITY
:
1
,
// 权益
INTEGRATION
:
2
,
// 积分
ENTITY
:
3
,
// 实物
THANKS
:
5
// 谢谢参与
}
\ No newline at end of file
c_client/client/tbcc-sdk/lib/utils.js
View file @
0c78f968
...
@@ -68,11 +68,11 @@ export const getRequestParams = value => {
...
@@ -68,11 +68,11 @@ export const getRequestParams = value => {
ext
:
{}
ext
:
{}
}
}
}
else
if
(
typeof
value
===
'object'
)
{
}
else
if
(
typeof
value
===
'object'
)
{
const
{
handle
,
method
=
'POST'
,
de
d
aultParams
=
{},
...
ext
}
=
value
;
const
{
handle
,
method
=
'POST'
,
de
f
aultParams
=
{},
...
ext
}
=
value
;
return
{
return
{
handle
,
handle
,
method
,
method
,
de
d
aultParams
,
de
f
aultParams
,
ext
:
{
...
ext
}
ext
:
{
...
ext
}
}
}
}
else
{
}
else
{
...
...
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