Commit 4db924a7 by 李嘉林

商品列表一个接口

parent 2bc21767
import { requestPOST, requestGET } from "@/utils/request.js";
export default {
queryProductInfo(data) {
return requestPOST(`${process.env.OLSHOP_URL}/product/query_product_info`, data);
},
queryBriefProductInfo(data) {
return requestPOST(`${process.env.OLSHOP_URL}/product/query_brief_product_info`, data);
},
queryMoreProductInfo(data) {
return requestPOST(`${process.env.OLSHOP_URL}/product/query_more_product_info`, data);
}
};
...@@ -2,6 +2,8 @@ import Vue from 'vue' ...@@ -2,6 +2,8 @@ import Vue from 'vue'
import App from './App' import App from './App'
import Store from './store/index' import Store from './store/index'
import "../static/nicon/iconfont.css" import "../static/nicon/iconfont.css"
import goodsApi from "./api/goods"
import { DFSImg } from "@/utils/index";
Vue.config.productionTip = false Vue.config.productionTip = false
App.mpType = 'app' App.mpType = 'app'
...@@ -31,3 +33,5 @@ mpApp.shopCallBack=function() {} ...@@ -31,3 +33,5 @@ mpApp.shopCallBack=function() {}
mpApp.pageCallBack=function() {} mpApp.pageCallBack=function() {}
// 底部栏 // 底部栏
mpApp.footerCallBack=function() {} mpApp.footerCallBack=function() {}
mpApp.goodsApi = goodsApi;
mpApp.DFSImg = DFSImg;
<template> <template>
<div class="domain"> <div class="domain">
<div v-for="item in pageData" :key="item.id"> <!-- <goods-list id="goodsList"></goods-list> -->
<div v-for="(item,index) in pageData" :key="index">
<div v-if="item.componentCode=='banner'"> <div v-if="item.componentCode=='banner'">
<banner :datas="item"></banner> <banner :datas="item"></banner>
1
</div> </div>
<div v-else-if="item.componentCode=='goods-list'">
<goods-list :datas="item"></goods-list>
</div> </div>
<image </div>
<!-- <image
src="http://cdn.mayi888.com/public/jpg/33ff0efc-96b5-4044-a65a-07799dfe98e1.jpg?x-oss-process=image/resize,limit_1,w_750" src="http://cdn.mayi888.com/public/jpg/33ff0efc-96b5-4044-a65a-07799dfe98e1.jpg?x-oss-process=image/resize,limit_1,w_750"
></image> ></image>
<van-button type="primary">按钮</van-button> <van-button type="primary">按钮</van-button>
<view class="ant-bofang">1</view> <view class="ant-bofang">1</view> -->
----瀑布流开始---- <!-- ----瀑布流开始---- -->
<waterfall-flow id="waterfallFlow"></waterfall-flow> <!-- <waterfall-flow id="waterfallFlow"></waterfall-flow> -->
----瀑布流结束---- <!-- ----瀑布流结束---- -->
<!-- <banner id="banner" :datas="componentsList[0]"></banner> <!-- <banner id="banner" :datas="componentsList[0]"></banner>
<div class="domain">abc <div class="domain">abc
...@@ -31,10 +34,10 @@ export default { ...@@ -31,10 +34,10 @@ export default {
}; };
}, },
onLoad() { onLoad() {
let that = this;
if (this.mpApp.globalData.pageList) { if (this.mpApp.globalData.pageList) {
that.init(this.mpApp.globalData.pageList); that.init(this.mpApp.globalData.pageList);
} else { } else {
let that = this;
this.mpApp.pageCallBack = function (params) { this.mpApp.pageCallBack = function (params) {
that.init(params); that.init(params);
}; };
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<view class="merchantsEntrance flex" wx:if="{{datas.componentData['merchantsEntrance'] && datas.componentData['merchantsEntranceType'] == 0}}"> <view class="merchantsEntrance flex" wx:if="{{datas.componentData['merchantsEntrance'] && datas.componentData['merchantsEntranceType'] == 0}}">
<view class="left flex" wx:if="{{items != null}}"> <view class="left flex" wx:if="{{items != null}}">
<view class="logo"> <view class="logo">
<image mode='widthFix' src="http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com/product/ppefWK8BS6.png?x-oss-process=image/resize,limit_1,w_150,h_150" /> <image mode='widthFix' src="{{items.shopLogoUrl}}" />
</view> </view>
<view class="name">{{items.orgName}}</view> <view class="name">{{items.orgName}}</view>
</view> </view>
...@@ -30,14 +30,23 @@ ...@@ -30,14 +30,23 @@
style="width:{{datas.componentData.angleSignSize}}%;height:{{datas.componentData.angleSignSize}}%;" style="width:{{datas.componentData.angleSignSize}}%;height:{{datas.componentData.angleSignSize}}%;"
wx:if="{{datas.componentData['angleSign'] && datas.componentData['angleSignImg']}}" wx:if="{{datas.componentData['angleSign'] && datas.componentData['angleSignImg']}}"
> >
<image mode="widthFix" src="http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com/product/ppefWK8BS6.png?x-oss-process=image/resize,limit_1,w_150,h_150" /> <image mode="widthFix" src="{{datas.componentData['angleSignImg']}}" />
</view> </view>
<!-- 商品主图 --> <!-- 商品主图 -->
<image mode="widthFix" src="https://test-bucket-ant.oss-cn-shanghai.aliyuncs.com/product/yWDmitPPmD.jpg?x-oss-process=image/resize,limit_1,w_700" /> <image
mode="widthFix"
wx:if="{{datas.componentData.goodsImgType == 1}}"
src="{{items.productImgUrl}}"
/>
<image
mode="widthFix"
wx:else
src="{{items.coverImage}}"
/>
<!-- 售罄遮罩 --> <!-- 售罄遮罩 -->
<view class="whiteBg" wx:if="{{items&&items.oversoldFlag==0&&items.totalQty-0<=0}}"> <view class="whiteBg" wx:if="{{items&&items.oversoldFlag==0&&items.totalQty-0<=0}}">
<view class="cover"> <view class="cover">
<image mode="widthFix" src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/f254fe62-6dda-46f6-a2f4-a7b2aa0474df.png" /> <image mode="aspectFit" src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/png/f254fe62-6dda-46f6-a2f4-a7b2aa0474df.png" />
</view> </view>
</view> </view>
</view> </view>
...@@ -50,7 +59,7 @@ ...@@ -50,7 +59,7 @@
</view> </view>
<view class="follower-wrap" wx:if="{{datas.componentData['followerShow']}}"> <view class="follower-wrap" wx:if="{{datas.componentData['followerShow']}}">
<view class="follower-num" style="color:{{datas.componentData['followerColor']?datas.componentData['followerColor']:'#ff9933'}};"> <view class="follower-num" style="color:{{datas.componentData['followerColor']?datas.componentData['followerColor']:'#ff9933'}};">
{{items!=null?Number(items['totalCollectionCount']) ? Number(items['totalCollectionCount']) : 0:0}} {{items!=null? items['totalCollectionCount']:0}}
</view> </view>
<view class="follower-text">关注人数</view> <view class="follower-text">关注人数</view>
</view> </view>
...@@ -59,8 +68,8 @@ ...@@ -59,8 +68,8 @@
<view class="Sold"> <view class="Sold">
<text wx:if="{{datas.componentData['alSaleShow']}}">已售{{items!=null ? items['totalSalesCount'] :0}}件</text> <text wx:if="{{datas.componentData['alSaleShow']}}">已售{{items!=null ? items['totalSalesCount'] :0}}件</text>
<text wx:if="{{datas.componentData['alSaleShow'] && datas.componentData['collectShow']}}">/</text> <text wx:if="{{datas.componentData['alSaleShow'] && datas.componentData['collectShow']}}">/</text>
<text wx:if="{{datas.componentData['collectShow']}}">剩余{{items!=null && items['qty']!=undefined ? (Number(items['qty']) > 0 ? Number(items['qty'] ): items.oversoldFlag==1?'数量充足':'数量不足') : ''}}</text> <text wx:if="{{datas.componentData['collectShow']}}">剩余{{items!=null && items['qty']!=undefined ? (items['qty'] > 0 ? items['qty']: items.oversoldFlag==1?'数量充足':'数量不足') : ''}}</text>
<text wx:if="{{items!=null && (Number(items['qty']) ? Number(items['qty']) >= 0 : Number(items['saleQty']) >= 0)}}">件</text> <text wx:if="{{items!=null && (items['qty'] ? items['qty'] >= 0 : items['qty'] >= 0)}}">件</text>
</view> </view>
<!-- 标签 --> <!-- 标签 -->
<view class="marketing flex" wx:if="{{datas.componentData['marketingTag']&&datas.componentData['marketingStyle']==0&&items.marketingTag}}"> <view class="marketing flex" wx:if="{{datas.componentData['marketingTag']&&datas.componentData['marketingStyle']==0&&items.marketingTag}}">
...@@ -90,7 +99,7 @@ ...@@ -90,7 +99,7 @@
</view> </view>
<view class="vipPrice2 flex"> <view class="vipPrice2 flex">
<view class="left" wx:if="{{showVipPrice(index)==true}}"> <view class="left" wx:if="{{showVipPrice(index)==true}}">
¥{{Number(items['minPriceAfterRecommendedCardPriceTable']).toFixed(2)}} ¥{{items['minPriceAfterRecommendedCardPriceTable']}}
</view> </view>
<view class="vipIcon line-clamp1" wx:if="{{showVipTag(index)==true}}"> <view class="vipIcon line-clamp1" wx:if="{{showVipTag(index)==true}}">
{{items["recommendedCardMinPricePriceTableName"]}} {{items["recommendedCardMinPricePriceTableName"]}}
...@@ -102,7 +111,7 @@ ...@@ -102,7 +111,7 @@
<view class="showCommission" wx:if="{{datas.componentData.commissionStyle==0}}"> <view class="showCommission" wx:if="{{datas.componentData.commissionStyle==0}}">
<view class="commission-box"> <view class="commission-box">
<text>收益</text> <text>收益</text>
<text>¥{{Number(items['minProductGoodsCommission']).toFixed(2)}}</text> <text>¥{{items['minProductGoodsCommission']}}</text>
</view> </view>
</view> </view>
</block> </block>
...@@ -144,7 +153,7 @@ ...@@ -144,7 +153,7 @@
<text class="iconfont-common common-iconfenxiang"> <text class="iconfont-common common-iconfenxiang">
赚¥ 赚¥
<text style="font-size:32rpx;"> <text style="font-size:32rpx;">
{{Number(items['minProductGoodsCommission']).toFixed(2)}} {{items['minProductGoodsCommission']}}
</text> </text>
</text> </text>
</view> </view>
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<!-- 头部 --> <!-- 头部 -->
<view class="tops flex" style="padding:{{(datas.componentData['titleIcon'] || (datas.componentData['moreShow'] && datas.componentData.moreButtonSite=='top')) ?'0rpx 0rpx 0rpx 10rpx' : ''}};margin-bottom:{{datas.componentData['titleCardGap']*2}}rpx"> <view class="tops flex" style="padding:{{(datas.componentData['titleIcon'] || (datas.componentData['moreShow'] && datas.componentData.moreButtonSite=='top')) ?'0rpx 0rpx 0rpx 10rpx' : ''}};margin-bottom:{{datas.componentData['titleCardGap']*2}}rpx">
<view class="left flex"> <view class="left flex">
<view class="img" wx:if="{{datas.componentData['titleIcon']}}"> <view class="img" wx:if="{{titleIcon}}">
<image mode="widthFix" src="http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com/product/ppefWK8BS6.png?x-oss-process=image/resize,limit_1,w_150,h_150" /> <image mode="widthFix" src="{{titleIcon}}" />
</view> </view>
<view class="title">{{datas.componentData['titles']}}</view> <view class="title">{{datas.componentData['titles']}}</view>
</view> </view>
......
{ {
"components":true "component":true
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment