22
This commit is contained in:
@ -27,7 +27,8 @@
|
|||||||
<view class="item" :class="nows ? 'font-color-red' : ''" @click="set_where(3)">新品</view>
|
<view class="item" :class="nows ? 'font-color-red' : ''" @click="set_where(3)">新品</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'" ref="container" v-if="isIntegral == 'false'">
|
<view class="list acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'" ref="container" v-if="isIntegral == 'false'">
|
||||||
<view @click="goGoodsCon(item)" class="item" :class="Switch === true ? '' : 'on'" v-for="(item, productListIndex) in productList" :key="productListIndex" :title="item.storeName">
|
<view @click="goGoodsCon(item)" class="item" :class="Switch === true ? '' : 'on'" v-for="(item, productListIndex) in productList"
|
||||||
|
:key="productListIndex" :title="item.storeName">
|
||||||
<view class="pictrue" :class="Switch === true ? '' : 'on'">
|
<view class="pictrue" :class="Switch === true ? '' : 'on'">
|
||||||
<image :src="item.image" :class="Switch === true ? '' : 'on'" />
|
<image :src="item.image" :class="Switch === true ? '' : 'on'" />
|
||||||
</view>
|
</view>
|
||||||
@ -45,7 +46,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'" ref="container" v-if="isIntegral == 'true'">
|
<view class="list acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'" ref="container" v-if="isIntegral == 'true'">
|
||||||
<view @click="goGoodsCon(item)" class="item" :class="Switch === true ? '' : 'on'" v-for="(item, productListIndex) in productList" :key="productListIndex" :title="item.storeName">
|
<view @click="goGoodsCon(item)" class="item" :class="Switch === true ? '' : 'on'" v-for="(item, productListIndex) in productList"
|
||||||
|
:key="productListIndex" :title="item.storeName">
|
||||||
<view class="pictrue" :class="Switch === true ? '' : 'on'">
|
<view class="pictrue" :class="Switch === true ? '' : 'on'">
|
||||||
<image :src="item.image" :class="Switch === true ? '' : 'on'" />
|
<image :src="item.image" :class="Switch === true ? '' : 'on'" />
|
||||||
</view>
|
</view>
|
||||||
@ -67,22 +69,26 @@
|
|||||||
<image src="@/static/images/noGood.png" class="image" />
|
<image src="@/static/images/noGood.png" class="image" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<Recommend v-if="productList.length === 0 && where.page > 1" :recommendLoading="recommendLoading" @changeRecommendLoading="changeRecommendLoading"></Recommend>
|
<Recommend v-if="productList.length === 0 && where.page > 1" :recommendLoading="recommendLoading"
|
||||||
|
@changeRecommendLoading="changeRecommendLoading"></Recommend>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Recommend from '@/components/Recommend'
|
import Recommend from '@/components/Recommend'
|
||||||
import { getProducts, getProductsIntegral } from '@/api/store'
|
import {
|
||||||
import Loading from '@/components/Loading'
|
getProducts,
|
||||||
|
getProductsIntegral
|
||||||
|
} from '@/api/store'
|
||||||
|
import Loading from '@/components/Loading'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'GoodsList',
|
name: 'GoodsList',
|
||||||
components: {
|
components: {
|
||||||
Recommend,
|
Recommend,
|
||||||
Loading,
|
Loading,
|
||||||
},
|
},
|
||||||
props: {},
|
props: {},
|
||||||
data: function () {
|
data: function() {
|
||||||
// const { s = "", id = 0, title = "" } = this.$yroute.query;
|
// const { s = "", id = 0, title = "" } = this.$yroute.query;
|
||||||
const s = '',
|
const s = '',
|
||||||
id = 0,
|
id = 0,
|
||||||
@ -117,6 +123,18 @@ export default {
|
|||||||
title() {
|
title() {
|
||||||
this.updateTitle()
|
this.updateTitle()
|
||||||
},
|
},
|
||||||
|
isIntegral() {
|
||||||
|
if (this.isIntegral) {
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: '积分商品'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: '商品列表'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
$yroute(to) {
|
$yroute(to) {
|
||||||
// if (to.name !== "GoodsList") return;
|
// if (to.name !== "GoodsList") return;
|
||||||
// const { s = "", id = 0, title = "" } = to.query;
|
// const { s = "", id = 0, title = "" } = to.query;
|
||||||
@ -135,8 +153,11 @@ export default {
|
|||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function() {
|
||||||
const { s = '', id = 0, title = '', isIntegral = false } = this.$yroute.query
|
const {
|
||||||
|
s = '', id = 0, title = '', isIntegral = false
|
||||||
|
} = this.$yroute.query;
|
||||||
|
|
||||||
this.where.keyword = s
|
this.where.keyword = s
|
||||||
this.where.isIntegral = isIntegral == 'true' ? 1 : 0
|
this.where.isIntegral = isIntegral == 'true' ? 1 : 0
|
||||||
this.isIntegral = isIntegral
|
this.isIntegral = isIntegral
|
||||||
@ -144,7 +165,7 @@ export default {
|
|||||||
this.getProductList()
|
this.getProductList()
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
this.recommendLoading = true
|
this.recommendLoading = true;
|
||||||
!this.loading && this.getProductList()
|
!this.loading && this.getProductList()
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
@ -181,13 +202,18 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateTitle() {
|
updateTitle() {
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: this.title
|
||||||
|
});
|
||||||
// document.title = this.title || this.$yroute.meta.title;
|
// document.title = this.title || this.$yroute.meta.title;
|
||||||
},
|
},
|
||||||
getProductList() {
|
getProductList() {
|
||||||
var that = this
|
var that = this
|
||||||
this.setWhere()
|
this.setWhere()
|
||||||
// if (to.name !== "GoodsList") return;
|
// if (to.name !== "GoodsList") return;
|
||||||
const { s = '', id = 0, title = '' } = this.$yroute.query
|
const {
|
||||||
|
s = '', id = 0, title = ''
|
||||||
|
} = this.$yroute.query
|
||||||
if (s !== this.where.keyword || id !== this.where.sid) {
|
if (s !== this.where.keyword || id !== this.where.sid) {
|
||||||
this.loadend = false
|
this.loadend = false
|
||||||
this.loading = false
|
this.loading = false
|
||||||
@ -214,7 +240,7 @@ export default {
|
|||||||
that.where.page = that.where.page + 1
|
that.where.page = that.where.page + 1
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
submitForm: function () {
|
submitForm: function() {
|
||||||
this.$set(this, 'productList', [])
|
this.$set(this, 'productList', [])
|
||||||
this.where.page = 1
|
this.where.page = 1
|
||||||
this.loadend = false
|
this.loadend = false
|
||||||
@ -222,7 +248,7 @@ export default {
|
|||||||
this.getProductList()
|
this.getProductList()
|
||||||
},
|
},
|
||||||
//点击事件处理
|
//点击事件处理
|
||||||
set_where: function (index) {
|
set_where: function(index) {
|
||||||
let that = this
|
let that = this
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -255,7 +281,7 @@ export default {
|
|||||||
that.getProductList()
|
that.getProductList()
|
||||||
},
|
},
|
||||||
//设置where条件
|
//设置where条件
|
||||||
setWhere: function () {
|
setWhere: function() {
|
||||||
let that = this
|
let that = this
|
||||||
if (that.price === 0) {
|
if (that.price === 0) {
|
||||||
that.where.priceOrder = ''
|
that.where.priceOrder = ''
|
||||||
@ -273,16 +299,16 @@ export default {
|
|||||||
}
|
}
|
||||||
that.where.news = that.nows ? '1' : '0'
|
that.where.news = that.nows ? '1' : '0'
|
||||||
},
|
},
|
||||||
switchTap: function () {
|
switchTap: function() {
|
||||||
let that = this
|
let that = this
|
||||||
that.Switch = !that.Switch
|
that.Switch = !that.Switch
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
.noCommodity {
|
.noCommodity {
|
||||||
border-top: 3px solid #f5f5f5;
|
border-top: 3px solid #f5f5f5;
|
||||||
padding-bottom: 1px;
|
padding-bottom: 1px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -10,7 +10,6 @@
|
|||||||
<view class="money font-color-red">
|
<view class="money font-color-red">
|
||||||
<text class="num">{{ attr.productSelect.integral || storeInfo.integral }}积分</text>
|
<text class="num">{{ attr.productSelect.integral || storeInfo.integral }}积分</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="introduce">{{ storeInfo.storeName }}</view>
|
<view class="introduce">{{ storeInfo.storeName }}</view>
|
||||||
<view class="label acea-row row-between-wrapper">
|
<view class="label acea-row row-between-wrapper">
|
||||||
@ -55,7 +54,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="bnt in-bnt acea-row">
|
<view class="bnt in-bnt acea-row">
|
||||||
<view class="buy" @click="tapBuy">
|
<view class="buy" @click="tapBuy">
|
||||||
<text>立即购买</text>
|
<text>立即兑换</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Reference in New Issue
Block a user