Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-luck
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
lea guo
6 years ago
Commit
b2dcf36dd86c02fea6c688cce32bd2b2da39001b
1 parent
ed9ceadc
yohood原价购接口调试
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
15 deletions
pages/zeroSell/components/yohoodLottery/product-detail-header.wxml
pages/zeroSell/originalPriceSell.js
pages/zeroSell/service/service.js
pages/zeroSell/service/zero-sell.js
project.config.json
pages/zeroSell/components/yohoodLottery/product-detail-header.wxml
View file @
b2dcf36
...
...
@@ -28,7 +28,7 @@
<view class="product_lucky_bg">
<view class="product_lucky">
<text>原价</text>
<text class="price-info">{{product.price}}</text>
<text class="price-info">{{product.
lottery_
price}}</text>
</view>
<view class="product_price">
<text>市场参考价</text>
...
...
pages/zeroSell/originalPriceSell.js
View file @
b2dcf36
...
...
@@ -231,7 +231,7 @@ Page(
},
_getMineCode
()
{
if
(
this
.
data
.
uid
)
{
if
(
this
.
data
.
uid
&&
this
.
data
.
actPrizeId
)
{
this
.
service
.
fetchMyPrizeList
({
uid
:
this
.
data
.
uid
,
...
...
@@ -324,13 +324,14 @@ Page(
let
params
=
{
actPrizeId
:
this
.
data
.
actPrizeId
,
};
return
Promise
.
all
([
this
.
service
.
getDetail
(
params
),
this
.
service
.
getRecommend
(
params
),
this
.
service
.
getRecentAvatars
(
params
),
])
.
then
(([
r1
,
r2
,
r3
])
=>
{
const
promises
=
[
this
.
service
.
getYohoodDetail
(
params
)];
if
(
this
.
data
.
actPrizeId
)
{
promises
.
push
(
this
.
service
.
getRecentAvatars
(
params
))
}
else
{
promises
.
push
(
Promise
.
resolve
({}))
}
return
Promise
.
all
(
promises
)
.
then
(([
r1
,
r2
])
=>
{
wx
.
hideLoading
();
if
(
r1
.
code
===
200
&&
r1
.
data
)
{
let
product
=
r1
.
data
;
...
...
@@ -349,8 +350,7 @@ Page(
this
.
setData
({
product
:
product
,
recommends
:
r2
.
code
===
200
?
r2
.
data
:
[],
avatars
:
(
r3
.
code
===
200
?
r3
.
data
:
[]).
map
(
i
=>
{
avatars
:
(
r2
.
code
===
200
?
r2
.
data
:
[]).
map
(
i
=>
{
i
.
user_name
=
wrapperName
(
i
.
user_name
);
i
.
user_thumb
=
formatImageUrl
(
i
.
user_thumb
,
200
,
200
);
return
i
;
...
...
pages/zeroSell/service/service.js
View file @
b2dcf36
...
...
@@ -6,8 +6,8 @@ import iconfSwitch from '../../../libs/switch';
import
md5
from
'../../../vendors/md5'
;
//注:g_sourceApiArry与g_toJavaApiArry的length要相等,且一一对应
const
g_sourceApiArry
=
[
'/list'
,
'/content'
,
'/list/recommend'
,
'/code/recent'
,
'/list/mine'
,
'/code/gain'
,
'/code/mine'
];
const
g_toJavaApiArry
=
[
'app.yoluck.activityList'
,
'app.yoluck.getContent'
,
'app.yoluck.recommendList'
,
'app.yoluck.recent'
,
'app.yoluck.participationList'
,
'app.yoluck.getCode'
,
'app.yoluck.userCode'
];
const
g_sourceApiArry
=
[
'/list'
,
'/content'
,
'/list/recommend'
,
'/code/recent'
,
'/list/mine'
,
'/code/gain'
,
'/code/mine'
,
'/yohood/content'
];
const
g_toJavaApiArry
=
[
'app.yoluck.activityList'
,
'app.yoluck.getContent'
,
'app.yoluck.recommendList'
,
'app.yoluck.recent'
,
'app.yoluck.participationList'
,
'app.yoluck.getCode'
,
'app.yoluck.userCode'
,
'app.yohood.getContent'
];
const
app
=
getApp
();
...
...
@@ -32,7 +32,7 @@ class Service {
//适配服务器更换Java接口,开关控制是否切换
if
(
app
.
globalData
.
switch_javaApiEnable
&&
pathIndex
>=
0
)
{
if
(
result
.
data
.
list
)
{
if
(
result
.
data
&&
result
.
data
.
list
)
{
let
newList
=
Humps
.
decamelizeKeys
(
Object
.
values
(
result
.
data
.
list
));
result
.
data
.
list
=
newList
;
}
else
{
...
...
pages/zeroSell/service/zero-sell.js
View file @
b2dcf36
...
...
@@ -49,6 +49,23 @@ class ZeroSellService extends Service {
});
}
getYohoodDetail
(
data
)
{
return
this
.
_get
(
'/yohood/content'
,
data
).
then
(
result
=>
{
if
(
result
.
code
===
200
)
{
Object
.
keys
(
result
.
data
).
forEach
(
item
=>
{
if
(
item
===
'my_code_num'
)
{
result
.
data
[
'myCodeNum'
]
=
result
.
data
[
item
];
}
})
productTime
(
result
.
data
)
return
result
;
}
return
result
;
});
}
getRecommend
(
data
)
{
data
.
channel
=
0
return
this
.
_get
(
'/list/recommend'
,
data
).
then
(
result
=>
{
...
...
project.config.json
View file @
b2dcf36
...
...
@@ -81,7 +81,7 @@
"id"
:
6
,
"name"
:
"YOHOOD LOTTERY"
,
"pathName"
:
"pages/zeroSell/originalPriceSell"
,
"query"
:
"
actPrizeId=224
"
,
"query"
:
""
,
"scene"
:
null
},
{
...
...
Please
register
or
login
to post a comment