|
@@ -5,19 +5,19 @@
|
|
<!-- 轮播 -->
|
|
<!-- 轮播 -->
|
|
<view class="shop-search">
|
|
<view class="shop-search">
|
|
<text class="iconfont icon-sousuo"></text>
|
|
<text class="iconfont icon-sousuo"></text>
|
|
- <input class="input" type="text" value="" placeholder="搜索本店铺商品"/>
|
|
|
|
|
|
+ <input class="input" maxlength="20" type="text" value="" v-model.trim="listQuery.keyword" confirm-type="search" @confirm="SubMitSearch()" placeholder="搜索本店铺商品" />
|
|
</view>
|
|
</view>
|
|
<view class="product-supplier" @click="goSupplier">
|
|
<view class="product-supplier" @click="goSupplier">
|
|
- <view class="logo"><img src="https://img.caimei365.com/group1/M00/03/4B/Cmis210DQ_qAIoyoAAKD15t_iQc959.png" alt=""></view>
|
|
|
|
|
|
+ <view class="logo"><img :src="shopLogo" alt=""></view>
|
|
<view class="main">
|
|
<view class="main">
|
|
- <view class="name">北京恩盛众成国际贸易有限公司</view>
|
|
|
|
|
|
+ <view class="name">{{ shopName }}</view>
|
|
<view class="massgs">
|
|
<view class="massgs">
|
|
<view class="label">满意度:</view>
|
|
<view class="label">满意度:</view>
|
|
<view class="p-stars">
|
|
<view class="p-stars">
|
|
<uni-stars :stars="6" :iconClass="iconClass" :iconColor="iconColor" :fontSize="36" :widthInfo="176"></uni-stars>
|
|
<uni-stars :stars="6" :iconClass="iconClass" :iconColor="iconColor" :fontSize="36" :widthInfo="176"></uni-stars>
|
|
</view>
|
|
</view>
|
|
<view class="acount">
|
|
<view class="acount">
|
|
- <text>50</text>件商品
|
|
|
|
|
|
+ <text> {{ normalNum }} </text>件商品
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -28,50 +28,66 @@
|
|
<view class="container-section tui-skeleton">
|
|
<view class="container-section tui-skeleton">
|
|
<view class="tab-title">主推商品</view>
|
|
<view class="tab-title">主推商品</view>
|
|
<view class="section-product clearfix">
|
|
<view class="section-product clearfix">
|
|
- <view class="floor-item" v-for="(item, index) in organizeProducts" :key="index" @click.stop="navToDetailPage(item.productID)">
|
|
|
|
- <image class="tui-skeleton-fillet" :src="item.mainImage" mode="aspectFill"></image>
|
|
|
|
|
|
+ <view class="floor-item" v-for="(item, index) in recommendList" :key="index" @click.stop="navToDetailPage(item.id)">
|
|
|
|
+ <image class="item-img tui-skeleton-fillet" :src="item.image" mode="aspectFill"></image>
|
|
<view class="floor-item-content">
|
|
<view class="floor-item-content">
|
|
<view class="title tui-skeleton-rect">
|
|
<view class="title tui-skeleton-rect">
|
|
<text class="mclap">{{item.name}}</text>
|
|
<text class="mclap">{{item.name}}</text>
|
|
</view>
|
|
</view>
|
|
- <!-- <view class="floor-item-act">
|
|
|
|
- <template v-if="item.actStatus==1">
|
|
|
|
- <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
|
|
|
|
- {{item.promotions.name}}<text v-if="hasLogin && item.price1TextFlag != '1'">:¥{{item.price | NumFormat}}</text>
|
|
|
|
- </view>
|
|
|
|
- <view class="floor-tags" v-else>{{item.promotions.name}}</view>
|
|
|
|
- </template>
|
|
|
|
- <template v-if="item.actStatus ==0 && item.ladderPriceFlag==1">
|
|
|
|
- <view class="floor-tags">阶梯价格</view>
|
|
|
|
- </template>
|
|
|
|
- </view> -->
|
|
|
|
<view class="" v-if="hasLogin">
|
|
<view class="" v-if="hasLogin">
|
|
<view v-if="userIdentity == 4">
|
|
<view v-if="userIdentity == 4">
|
|
- <view class="title-none" v-show="item.price1TextFlag == '1'">
|
|
|
|
|
|
+ <view class="title-none" v-show="item.priceFlag == '1'">
|
|
<text class="p big">¥未公开价格</text>
|
|
<text class="p big">¥未公开价格</text>
|
|
</view>
|
|
</view>
|
|
- <view class="title-none" v-show="item.price1TextFlag == '2'">
|
|
|
|
|
|
+ <view class="title-none" v-show="item.priceFlag == '2'">
|
|
<text class="p big">¥价格仅会员可见</text>
|
|
<text class="p big">¥价格仅会员可见</text>
|
|
</view>
|
|
</view>
|
|
- <view class="price tui-skeleton-rect" v-show="item.price1TextFlag == '0'" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
|
|
|
|
+ <view class="price tui-skeleton-rect" v-show="item.priceFlag == '0'" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
<text class="p sm">¥</text>
|
|
<text class="p sm">¥</text>
|
|
<text class="p big">{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price ) | NumFormat}}</text>
|
|
<text class="p big">{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price ) | NumFormat}}</text>
|
|
|
|
+ <template v-if="item.actStatus==1">
|
|
|
|
+ <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
|
|
|
|
+ {{item.promotions.name}}<text v-if="hasLogin && item.priceFlag != '1'">:¥{{item.price | NumFormat}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="floor-tags" v-else>{{item.promotions.name}}</view>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-if="item.actStatus ==0 && item.ladderPriceFlag==1">
|
|
|
|
+ <view class="floor-tags">阶梯价格</view>
|
|
|
|
+ </template>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view v-else>
|
|
<view v-else>
|
|
- <view class="title-none" v-if="item.price1TextFlag == '1'">
|
|
|
|
|
|
+ <view class="title-none" v-if="item.priceFlag == '1'">
|
|
<text class="p big">未公开价格</text>
|
|
<text class="p big">未公开价格</text>
|
|
</view>
|
|
</view>
|
|
<view class="price tui-skeleton-rect" v-else :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
<view class="price tui-skeleton-rect" v-else :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
<text class="p sm">¥</text>
|
|
<text class="p sm">¥</text>
|
|
<text class="p big">{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price ) | NumFormat}}</text>
|
|
<text class="p big">{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price ) | NumFormat}}</text>
|
|
|
|
+ <template v-if="item.actStatus==1">
|
|
|
|
+ <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
|
|
|
|
+ {{item.promotions.name}}<text v-if="hasLogin && item.priceFlag != '1'">:¥{{item.price | NumFormat}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="floor-tags" v-else>{{item.promotions.name}}</view>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-if="item.actStatus ==0 && item.ladderPriceFlag==1">
|
|
|
|
+ <view class="floor-tags">阶梯价格</view>
|
|
|
|
+ </template>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view v-else class="no-price">
|
|
<view v-else class="no-price">
|
|
<view class="p-stars">
|
|
<view class="p-stars">
|
|
<text class="p-no">¥</text>
|
|
<text class="p-no">¥</text>
|
|
- <uni-stars :stars="parseInt(item.price1Grade)" :fontSize="36" :widthInfo="180"></uni-stars>
|
|
|
|
|
|
+ <uni-grader :grade="Number(item.priceGrade)"></uni-grader>
|
|
|
|
+ <template v-if="item.actStatus==1">
|
|
|
|
+ <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
|
|
|
|
+ {{item.promotions.name}}<text v-if="hasLogin && item.priceFlag != '1'">:¥{{item.price | NumFormat}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="floor-tags" v-else>{{item.promotions.name}}</view>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-if="item.actStatus ==0 && item.ladderPriceFlag==1">
|
|
|
|
+ <view class="floor-tags">阶梯价格</view>
|
|
|
|
+ </template>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -81,50 +97,57 @@
|
|
<view class="container-section tui-skeleton">
|
|
<view class="container-section tui-skeleton">
|
|
<view class="tab-title">全部商品</view>
|
|
<view class="tab-title">全部商品</view>
|
|
<view class="section-product clearfix">
|
|
<view class="section-product clearfix">
|
|
- <view class="floor-item" v-for="(item, index) in organizeProducts" :key="index" @click.stop="navToDetailPage(item.productID)">
|
|
|
|
- <image class="tui-skeleton-fillet" :src="item.mainImage" mode="aspectFill"></image>
|
|
|
|
|
|
+ <view class="floor-item" v-for="(item, index) in productList" :key="index" @click.stop="navToDetailPage(item.p_id)">
|
|
|
|
+ <image class="item-img tui-skeleton-fillet" :src="item.p_image" mode="aspectFill"></image>
|
|
<view class="floor-item-content">
|
|
<view class="floor-item-content">
|
|
<view class="title tui-skeleton-rect">
|
|
<view class="title tui-skeleton-rect">
|
|
- <text class="mclap">{{item.name}}</text>
|
|
|
|
|
|
+ <text class="mclap">{{item.p_name}}</text>
|
|
</view>
|
|
</view>
|
|
- <!-- <view class="floor-item-act">
|
|
|
|
- <template v-if="item.actStatus==1">
|
|
|
|
- <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
|
|
|
|
- {{item.promotions.name}}<text v-if="hasLogin && item.price1TextFlag != '1'">:¥{{item.price | NumFormat}}</text>
|
|
|
|
- </view>
|
|
|
|
- <view class="floor-tags" v-else>{{item.promotions.name}}</view>
|
|
|
|
- </template>
|
|
|
|
- <template v-if="item.actStatus ==0 && item.ladderPriceFlag==1">
|
|
|
|
- <view class="floor-tags">阶梯价格</view>
|
|
|
|
- </template>
|
|
|
|
- </view> -->
|
|
|
|
<view class="" v-if="hasLogin">
|
|
<view class="" v-if="hasLogin">
|
|
<view v-if="userIdentity == 4">
|
|
<view v-if="userIdentity == 4">
|
|
- <view class="title-none" v-show="item.price1TextFlag == '1'">
|
|
|
|
|
|
+ <view class="title-none" v-show="item.p_price_flag == '1'">
|
|
<text class="p big">¥未公开价格</text>
|
|
<text class="p big">¥未公开价格</text>
|
|
</view>
|
|
</view>
|
|
- <view class="title-none" v-show="item.price1TextFlag == '2'">
|
|
|
|
|
|
+ <view class="title-none" v-show="item.p_price_flag == '2'">
|
|
<text class="p big">¥价格仅会员可见</text>
|
|
<text class="p big">¥价格仅会员可见</text>
|
|
</view>
|
|
</view>
|
|
- <view class="price tui-skeleton-rect" v-show="item.price1TextFlag == '0'" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
|
|
|
|
+ <view class="price tui-skeleton-rect" v-show="item.p_price_flag == '0'" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
<text class="p sm">¥</text>
|
|
<text class="p sm">¥</text>
|
|
<text class="p big">{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price ) | NumFormat}}</text>
|
|
<text class="p big">{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price ) | NumFormat}}</text>
|
|
|
|
+ <template v-if="item.actStatus==1">
|
|
|
|
+ <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
|
|
|
|
+ {{item.promotions.name}}<text v-if="hasLogin && item.p_price_flag != '1'">:¥{{item.price | NumFormat}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="floor-tags" v-else>{{item.promotions.name}}</view>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-if="item.actStatus ==0 && item.ladderPriceFlag==1">
|
|
|
|
+ <view class="floor-tags">阶梯价格</view>
|
|
|
|
+ </template>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view v-else>
|
|
<view v-else>
|
|
- <view class="title-none" v-if="item.price1TextFlag == '1'">
|
|
|
|
|
|
+ <view class="title-none" v-if="item.p_price_flag == '1'">
|
|
<text class="p big">未公开价格</text>
|
|
<text class="p big">未公开价格</text>
|
|
</view>
|
|
</view>
|
|
<view class="price tui-skeleton-rect" v-else :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
<view class="price tui-skeleton-rect" v-else :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
<text class="p sm">¥</text>
|
|
<text class="p sm">¥</text>
|
|
<text class="p big">{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price ) | NumFormat}}</text>
|
|
<text class="p big">{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price ) | NumFormat}}</text>
|
|
|
|
+ <template v-if="item.actStatus==1">
|
|
|
|
+ <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
|
|
|
|
+ {{item.promotions.name}}<text v-if="hasLogin && item.p_price_flag != '1'">:¥{{item.price | NumFormat}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="floor-tags" v-else>{{item.promotions.name}}</view>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-if="item.actStatus ==0 && item.ladderPriceFlag==1">
|
|
|
|
+ <view class="floor-tags">阶梯价格</view>
|
|
|
|
+ </template>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view v-else class="no-price">
|
|
<view v-else class="no-price">
|
|
<view class="p-stars">
|
|
<view class="p-stars">
|
|
<text class="p-no">¥</text>
|
|
<text class="p-no">¥</text>
|
|
- <uni-stars :stars="parseInt(item.price1Grade)" :fontSize="36" :widthInfo="180"></uni-stars>
|
|
|
|
|
|
+ <uni-grader :grade="Number(item.p_price_grade)"></uni-grader>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -139,30 +162,41 @@
|
|
<script>
|
|
<script>
|
|
import { mapState,mapMutations} from 'vuex';
|
|
import { mapState,mapMutations} from 'vuex';
|
|
import banner from '@/components/cm-module/supplier/banner.vue'
|
|
import banner from '@/components/cm-module/supplier/banner.vue'
|
|
- import uniStars from '@/components/uni-stars/uni-stars.vue'
|
|
|
|
|
|
+ import uniGrader from '@/components/uni-grade/uni-grade.vue'
|
|
import authorize from '@/common/config/authorize.js'
|
|
import authorize from '@/common/config/authorize.js'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
components:{
|
|
components:{
|
|
banner,
|
|
banner,
|
|
- uniStars
|
|
|
|
|
|
+ uniGrader
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
userID:0,
|
|
userID:0,
|
|
|
|
+ shopId:0,
|
|
iconClass:'icon-aixin',
|
|
iconClass:'icon-aixin',
|
|
iconColor:'#ff9100',
|
|
iconColor:'#ff9100',
|
|
isScrollTop:false,
|
|
isScrollTop:false,
|
|
- bannerImageList:[
|
|
|
|
- {image:'https://m.360buyimg.com/mobilecms/s700x280_jfs/t1/114550/12/7437/102254/5ec3971fE78db18f4/438d4775f9d653ee.jpg!q70.jpg.dpg'},
|
|
|
|
- {image:'https://m.360buyimg.com/mobilecms/s700x280_jfs/t1/126187/19/17323/149042/5fa13ef1E6bc65f5b/8fbecafdbf0e4736.jpg!q70.jpg.dpg'},
|
|
|
|
- {image:'https://m.360buyimg.com/mobilecms/s700x280_jfs/t1/126522/38/16493/151268/5f9940bfE9bf4ce43/b9a09e36102a9667.jpg!q70.jpg.dpg'}
|
|
|
|
- ],
|
|
|
|
- organizeProducts:[]
|
|
|
|
|
|
+ shopName:'',
|
|
|
|
+ shopLogo:'',
|
|
|
|
+ normalNum:0,
|
|
|
|
+ bannerImageList:[],
|
|
|
|
+ recommendList:[],
|
|
|
|
+ productList:[],
|
|
|
|
+ listQuery:{
|
|
|
|
+ keyword: '',
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ id:0
|
|
|
|
+ },
|
|
|
|
+ total:0
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- onLoad() {
|
|
|
|
-
|
|
|
|
|
|
+ onLoad(option) {
|
|
|
|
+ this.listQuery.id = this.shopId = option.shopId
|
|
|
|
+ console.log(this.shopId)
|
|
|
|
+ console.log(this.listQuery.id)
|
|
|
|
+ this.InitShopDataInfo()
|
|
},
|
|
},
|
|
filters: {
|
|
filters: {
|
|
NumFormat:function(text) {//处理金额
|
|
NumFormat:function(text) {//处理金额
|
|
@@ -174,39 +208,125 @@
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapMutations(['login','logout']),
|
|
...mapMutations(['login','logout']),
|
|
- getOrganizeProducts(){//获取模块三商品
|
|
|
|
- this.ProductService.queryProductPreferred({userId:this.userID,preferredFlag:100,pageNum:1,pageSize:4}).then(res =>{
|
|
|
|
- this.organizeProducts = res.data.results
|
|
|
|
- this.getProductPrice()
|
|
|
|
|
|
+ InitShopDataInfo(){//初始化请求数据
|
|
|
|
+ this.GetSupplierHomeBanner()
|
|
|
|
+ this.GetSupplierHomeDeatils()
|
|
|
|
+ this.GetSupplierHomeProduct()
|
|
|
|
+ this.GetSupplierHomeProductList()
|
|
|
|
+ },
|
|
|
|
+ GetSupplierHomeBanner(){//轮播图
|
|
|
|
+ this.ShopService.GetSupplierHomeBanner({supplierId:this.shopId}).then(response =>{
|
|
|
|
+ this.bannerImageList = response.data;
|
|
|
|
+ }).catch(error =>{
|
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ GetSupplierHomeDeatils(){//商铺详情
|
|
|
|
+ this.ShopService.GetSupplierHomeDeatils({supplierId:this.shopId}).then(response =>{
|
|
|
|
+ let data = response.data
|
|
|
|
+ this.normalNum = data.normalNum
|
|
|
|
+ this.shopName = data.name
|
|
|
|
+ this.shopLogo = data.logo
|
|
|
|
+ }).catch(error =>{
|
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ GetSupplierHomeProduct(){//主推商品
|
|
|
|
+ this.ShopService.GetSupplierHomeProduct({supplierId:this.shopId}).then(response =>{
|
|
|
|
+ let data = response.data
|
|
|
|
+ this.QueryProductPrice(data)
|
|
|
|
+ }).catch(error =>{
|
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ GetSupplierHomeProductList(){//全部商品
|
|
|
|
+ this.ShopService.GetSupplierHomeProductList(this.listQuery).then(response =>{
|
|
|
|
+ let data = JSON.parse(response.data)
|
|
|
|
+ let dataList = data.items
|
|
|
|
+ console.log(data)
|
|
|
|
+ this.total = data.total
|
|
|
|
+ this.productList = dataList
|
|
|
|
+ this.QueryProductPrice1(this.productList)
|
|
|
|
+ }).catch(error =>{
|
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ GetMoreSupplierHomeProductList(){//加载分页
|
|
|
|
+ this.listQuery.pageNum +=1
|
|
|
|
+ this.ShopService.GetSupplierHomeProductList(this.listQuery).then(response =>{
|
|
|
|
+ let data = JSON.parse(response.data)
|
|
|
|
+ console.log(data)
|
|
|
|
+ this.total = data.total
|
|
|
|
+ this.productList = this.productList.concat(data.items)
|
|
|
|
+ this.QueryProductPrice1(this.productList)
|
|
}).catch(error =>{
|
|
}).catch(error =>{
|
|
this.$util.msg(error.msg,2000)
|
|
this.$util.msg(error.msg,2000)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- getProductPrice(){//获取商品或者活动价格
|
|
|
|
|
|
+ QueryProductPrice(data){//处理主推商品商品或者活动价格
|
|
let productIdArr = [];
|
|
let productIdArr = [];
|
|
let productIds ='';
|
|
let productIds ='';
|
|
- this.organizeProducts.map(item=>{// 0公开价格 1不公开价格 2仅对会员机构公开
|
|
|
|
- productIdArr.push(item.productID)
|
|
|
|
|
|
+ data.map(item=>{// 0公开价格 1不公开价格 2仅对会员机构公开
|
|
|
|
+ productIdArr.push(item.id)
|
|
})
|
|
})
|
|
productIds = productIdArr.join(",");
|
|
productIds = productIdArr.join(",");
|
|
this.ProductService.querySearchProductPrice({userId: this.userID,productIds:productIds}).then(response =>{
|
|
this.ProductService.querySearchProductPrice({userId: this.userID,productIds:productIds}).then(response =>{
|
|
- this.organizeProducts = this.ReturnNewProducts(this.organizeProducts,response.data);
|
|
|
|
- this.skeletonShow = false;
|
|
|
|
|
|
+ this.recommendList = this.ReturnNewProducts(data,response.data);
|
|
|
|
+ console.log(this.recommendList)
|
|
}).catch(error =>{
|
|
}).catch(error =>{
|
|
this.$util.msg(error.msg,2000)
|
|
this.$util.msg(error.msg,2000)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- ReturnNewProducts(Array,list){
|
|
|
|
|
|
+ QueryProductPrice1(data){//获取商品或者活动价格
|
|
|
|
+ let productIdArr = [];
|
|
|
|
+ let productIds ='';
|
|
|
|
+ data.map(item=>{// 0公开价格 1不公开价格 2仅对会员机构公开
|
|
|
|
+ productIdArr.push(item.p_id)
|
|
|
|
+ })
|
|
|
|
+ productIds = productIdArr.join(",");
|
|
|
|
+ this.ProductService.querySearchProductPrice({userId: this.userID,productIds:productIds}).then(response =>{
|
|
|
|
+ this.productList = this.ReturnNewProducts1(data,response.data);
|
|
|
|
+ console.log(this.productList)
|
|
|
|
+ }).catch(error =>{
|
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ ReturnNewProducts(listA,listB){
|
|
let NewArray = []
|
|
let NewArray = []
|
|
- Array.map(item=>{
|
|
|
|
- for (let i = 0; i < list.length; i++) {
|
|
|
|
- if( item.productID == list[i].productId ){
|
|
|
|
- NewArray.push(Object.assign(item,list[i]))
|
|
|
|
|
|
+ listA.map(item=>{
|
|
|
|
+ for (let i = 0; i < listB.length; i++) {
|
|
|
|
+ if( item.id == listB[i].productId ){
|
|
|
|
+ NewArray.push(Object.assign(item,listB[i]))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
return NewArray
|
|
return NewArray
|
|
},
|
|
},
|
|
|
|
+ ReturnNewProducts1(listA,listB){
|
|
|
|
+ let NewArray = []
|
|
|
|
+ listA.map(item=>{
|
|
|
|
+ for (let i = 0; i < listB.length; i++) {
|
|
|
|
+ if( item.p_id == listB[i].productId ){
|
|
|
|
+ NewArray.push(Object.assign(item,listB[i]))
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return NewArray
|
|
|
|
+ },
|
|
|
|
+ SubMitSearch() {//搜索
|
|
|
|
+ if (this.searchInputVal == '') {
|
|
|
|
+ this.$util.msg('请输入商品关键词',2000);
|
|
|
|
+ }else{
|
|
|
|
+ this.listQuery.pageNum = 1
|
|
|
|
+ this.GetSupplierHomeProductList()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ goSupplier(){//跳供应商资料页
|
|
|
|
+ this.$api.navigateTo('/supplier/pages/user/supplier?shopId='+this.shopId)
|
|
|
|
+ },
|
|
|
|
+ navToDetailPage(id) {//跳转商品详情页
|
|
|
|
+ this.$api.navigateTo(`/pages/goods/product?id=${id}`)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
onPageScroll(e){//实时获取到滚动的值
|
|
onPageScroll(e){//实时获取到滚动的值
|
|
if(e.scrollTop>400){
|
|
if(e.scrollTop>400){
|
|
@@ -216,11 +336,20 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onPullDownRefresh() {//下拉刷新
|
|
onPullDownRefresh() {//下拉刷新
|
|
- this.getHomeInformation()
|
|
|
|
|
|
+ this.listQuery.pageNum = 1
|
|
|
|
+ this.productList =[]
|
|
|
|
+ this.InitShopDataInfo()
|
|
uni.stopPullDownRefresh()
|
|
uni.stopPullDownRefresh()
|
|
},
|
|
},
|
|
|
|
+ onReachBottom() {//上滑加载分页
|
|
|
|
+ if(this.total > this.productList.length){
|
|
|
|
+ this.loadding = true
|
|
|
|
+ this.pullUpOn = true
|
|
|
|
+ this.GetMoreSupplierHomeProductList()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
onShow(){
|
|
onShow(){
|
|
- this.getOrganizeProducts()
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -368,7 +497,7 @@
|
|
&:nth-child(2n){
|
|
&:nth-child(2n){
|
|
margin-right: 0;
|
|
margin-right: 0;
|
|
}
|
|
}
|
|
- image{
|
|
|
|
|
|
+ .item-img{
|
|
width: 341rpx;
|
|
width: 341rpx;
|
|
height: 341rpx;
|
|
height: 341rpx;
|
|
border-radius: 2rpx 2rpx 0 0;
|
|
border-radius: 2rpx 2rpx 0 0;
|