更新
This commit is contained in:
parent
e843437054
commit
33a80b53cd
@ -67,7 +67,7 @@
|
|||||||
|
|
||||||
<view class='recommendList' :class="indexP?'on':''">
|
<view class='recommendList' :class="indexP?'on':''">
|
||||||
<WaterfallsFlow v-if="hostProduct.length>0" :wfList='hostProduct' @itemTap="goDetail" :type="0" :sale_type="sale_type"/>
|
<WaterfallsFlow v-if="hostProduct.length>0" :wfList='hostProduct' @itemTap="goDetail" :type="0" :sale_type="sale_type"/>
|
||||||
<view class='pictrue' v-else>
|
<view class='pictrue' v-if="!loading&&hostProduct.length==0">
|
||||||
<image :src="`${domain}/static/images/noCart.png`"></image>
|
<image :src="`${domain}/static/images/noCart.png`"></image>
|
||||||
<view>暂无商品,看点别的吧</view>
|
<view>暂无商品,看点别的吧</view>
|
||||||
</view>
|
</view>
|
||||||
@ -123,7 +123,11 @@
|
|||||||
sale_type:{
|
sale_type:{
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
default: 1
|
default: 1
|
||||||
}
|
},
|
||||||
|
loading:{
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
"name" : "惠农生活",
|
"name" : "惠农生活",
|
||||||
"appid" : "__UNI__3A527D1",
|
"appid" : "__UNI__3A527D1",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "2.0.18",
|
"versionName" : "2.0.21",
|
||||||
"versionCode" : 2018,
|
"versionCode" : 2021,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
@ -89,7 +89,7 @@
|
|||||||
<view v-if="recommend_switch == 1" class="index-product-wrapper">
|
<view v-if="recommend_switch == 1" class="index-product-wrapper">
|
||||||
<!-- 首发新品 -->
|
<!-- 首发新品 -->
|
||||||
<recommend ref="recommendRef" :hostProduct="hostProduct[hostIndex]"
|
<recommend ref="recommendRef" :hostProduct="hostProduct[hostIndex]"
|
||||||
@changeRecommedTab="changeRecommedTab" showTab :indexP="true" :isLogin="isLogin">
|
@changeRecommedTab="changeRecommedTab" showTab :indexP="true" :isLogin="isLogin" :loading="loading">
|
||||||
</recommend>
|
</recommend>
|
||||||
<view class="loadingicon acea-row row-center-wrapper"
|
<view class="loadingicon acea-row row-center-wrapper"
|
||||||
v-if="hostProduct[hostIndex].length > 0 || hotLoading[hostIndex]">
|
v-if="hostProduct[hostIndex].length > 0 || hotLoading[hostIndex]">
|
||||||
@ -170,7 +170,7 @@
|
|||||||
<image :src="`${domain}/static/images/noCart.png`"></image>
|
<image :src="`${domain}/static/images/noCart.png`"></image>
|
||||||
<view>暂无商品,去看点什么吧</view>
|
<view>暂无商品,去看点什么吧</view>
|
||||||
</view>
|
</view>
|
||||||
<recommend :hostProduct="hostProduct[hostIndex]"></recommend>
|
<recommend :hostProduct="hostProduct[hostIndex]" :loading="loading"></recommend>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
@ -441,7 +441,6 @@
|
|||||||
privacyStatus: false,
|
privacyStatus: false,
|
||||||
errorNetwork: false,
|
errorNetwork: false,
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
loading: false,
|
|
||||||
statusBarHeight: statusBarHeight,
|
statusBarHeight: statusBarHeight,
|
||||||
navIndex: 0,
|
navIndex: 0,
|
||||||
navTop: [],
|
navTop: [],
|
||||||
@ -1049,6 +1048,7 @@
|
|||||||
that.hotLoading[e] = true;
|
that.hotLoading[e] = true;
|
||||||
that.hotTitle = '加载中';
|
that.hotTitle = '加载中';
|
||||||
getProductHot(that.hotPage, that.hotLimit, 1, 1).then(res => {
|
getProductHot(that.hotPage, that.hotLimit, 1, 1).then(res => {
|
||||||
|
res.data.list = this.shuffleArray(res.data.list);
|
||||||
let list = res.data.list;
|
let list = res.data.list;
|
||||||
let productList = that.hostProduct;
|
let productList = that.hostProduct;
|
||||||
if (!productList[e]) productList[e] = [];
|
if (!productList[e]) productList[e] = [];
|
||||||
@ -1082,6 +1082,7 @@
|
|||||||
getProductslist({
|
getProductslist({
|
||||||
...query
|
...query
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
res.data.list = this.shuffleArray(res.data.list);
|
||||||
let list = res.data.list;
|
let list = res.data.list;
|
||||||
let productList = that.hostProduct;
|
let productList = that.hostProduct;
|
||||||
if (!productList[e]) productList[e] = [];
|
if (!productList[e]) productList[e] = [];
|
||||||
@ -1097,6 +1098,15 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 数组乱序
|
||||||
|
shuffleArray(array) {
|
||||||
|
for (let i = array.length - 1; i > 0; i--) {
|
||||||
|
const j = Math.floor(Math.random() * (i + 1));
|
||||||
|
[array[i], array[j]] = [array[j], array[i]];
|
||||||
|
}
|
||||||
|
return array;
|
||||||
|
},
|
||||||
|
|
||||||
getCateData() {
|
getCateData() {
|
||||||
getCateData().then(res => {
|
getCateData().then(res => {
|
||||||
res.data.unshift({
|
res.data.unshift({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user