Authored by lea guo

yohood原价购接口调试

... ... @@ -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>
... ...
... ... @@ -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;
... ...
... ... @@ -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 {
... ...
... ... @@ -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 => {
... ...
... ... @@ -81,7 +81,7 @@
"id": 6,
"name": "YOHOOD LOTTERY",
"pathName": "pages/zeroSell/originalPriceSell",
"query": "actPrizeId=224",
"query": "",
"scene": null
},
{
... ...