Authored by huzhiming

feat(second): 移除log reviewed by tao.huang

... ... @@ -52,18 +52,17 @@
</div>
<span class="iconfont iconright"></span>
</div>
</LayoutScroll>
<div class="fixed-footer">
<cube-button class="buy active" @click="buy">购买 <span class="price">¥{{info.price}}</span></cube-button>
</div>
</LayoutScroll>
</LayoutApp>
</template>
<script>
import { Button, Slide } from 'cube-ui';
import { mapState } from 'vuex'
import { mapState, mapActions } from 'vuex'
import ImgSize from '@/components/img-size';
// const info = {
// "brandName": "NIKE",
// "colorName": "黑色",
... ... @@ -115,6 +114,10 @@ export default {
// console.log('mounted', this.info);
},
activated() {
if (this.$refs.pageScroll) {
this.$refs.pageScroll.scrollTop = 0;
}
this.fetchDetailById({ skup: this.skup })
this.refresh();
},
deactivated() {},
... ... @@ -123,6 +126,8 @@ export default {
// beforeRouteLeave(to, from, next) {},
destroyed() {},
methods: {
...mapActions('second',['fetchDetailById']),
refresh() {
this.$refs.slide && this.$refs.slide.refresh && this.$refs.slide.refresh();
},
... ... @@ -155,7 +160,9 @@ export default {
/* 定义局部样式,添加外围容器,scss嵌套尽量不要超过三层,会影响查找器性能 */
<style rel='stylesheet/scss' lang='scss' scoped>
@import '@/pages/product/product-detail.scss';
/* .second-detail-wrap {} */
.second-detail-wrap {
padding-bottom: 120px;
}
.ellipsis {
white-space: nowrap;
... ... @@ -277,9 +284,10 @@ export default {
// fixed-footer
.fixed-footer {
position: sticky;
position: fixed;
bottom: 0;
display: flex;
width: 100%;
height: 120px;
padding: 16px 30px;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.08);
... ...
... ... @@ -39,11 +39,13 @@
<LayoutScroll
ref="scrolllist"
@pulling-up="fetchList(isMore)"
v-if="productsList.length"
class="list-scroll-bg"
:loading="{noMore: !isMore}"
v-if="productList.length"
class="product-list"
>
<SecondList :list="productsList"></SecondList>
<SecondList :list="productList"></SecondList>
</LayoutScroll>
<!-- <EmptyList class="empty-wrapper product-list" :tip="`暂无数据`" v-show="productList.isEmpty" /> -->
</LayoutApp>
<FilterList
:visible.sync="filterModalVisible"
... ... @@ -58,6 +60,7 @@
import { mapState, mapActions, createNamespacedHelpers } from "vuex";
import SecondList from "./components/second-list";
import FilterList from './components/filter-list';
import EmptyList from '@/components/ufo-no-item';
export default {
name: 'UfoSecondSellListPage',
... ... @@ -153,7 +156,7 @@ export default {
}
},
computed: {
...mapState('second', ["productsList", "isMore"]),
...mapState('second', ["productList", "isMore"]),
// 因为接口未返回pageTitle产品名称,从已有商品详情页state获取
...mapState('product', ["selectedProductInfo"]),
... ... @@ -165,6 +168,7 @@ export default {
components: {
SecondList,
FilterList,
EmptyList
}
};
</script>
... ... @@ -182,8 +186,7 @@ export default {
padding-right: 38px;
z-index: 999;
background: #fff;
position: sticky;
top: 0;
position: absolute;
}
.filter-tab {
display: flex;
... ...
... ... @@ -23,7 +23,7 @@ export function defaultState () {
// 筛选列表
filterData: [],
productsList: [],
productList: [],
page: 1,
pageTotal: 0,
isMore: false,
... ...
... ... @@ -44,15 +44,14 @@ export default {
}));
if (isReset) {
state.productsList = product_list;
state.productList = product_list;
} else {
state.productsList = state.productsList.push(...product_list);
state.productList = state.productList.push(...product_list);
}
}
},
[Types.UPDATE_PRODUCT_FILTER](state, { filter }) {
console.log(filter);
state.filterData = filter;
}
};
... ...