Authored by huzhiming

feat(second): 详情按钮已售出、全新xx省xx回显、后端字段名不一致容错

... ... @@ -6,12 +6,20 @@
* @后台人员:
* @version: v1.0.0
* @path: 页面访问路径及参数说明
* @调用示例说明:
@调用示例:
import FilterList from './components/filter-list';
<FilterList
:visible.sync="filterModalVisible"
:storage_id="storage_id"
@submit="handleFilterSubmit"
></FilterList>
components: {
FilterList,
}
!-->
<template>
<!-- <LayoutApp :show-back="true" title="筛选"> -->
<div
class="container"
v-show="visible"
... ... @@ -73,10 +81,9 @@
>确定</div>
</div>
</div>
<!-- </LayoutApp> -->
</template>
<script>
import { mapState, mapActions, createNamespacedHelpers } from 'vuex';
import { mapState, mapActions } from 'vuex';
// const filterData = [
// {
... ... @@ -125,7 +132,7 @@ export default {
data () {
return {
selected: {
// second_type: null // 注意:null是默认值
// second_type: null // 注意:null是默认值, 点击对应item 会根据 filterData[x].filterId值 动态创建此对象
}
};
},
... ... @@ -180,19 +187,10 @@ export default {
*/
submit() {
if (Object.keys(this.selected).length!==0) {
this.$emit('update:visible', !this.visible);
this.$emit('submit', this.selected);
}
this.$emit('update:visible', !this.visible);
}
// yas (param) {
// this.$store.dispatch('reportYas', {
// params: {
// param,
// appop: 'XY_UFO_PRD_LIST_SCREEN_C'
// }
// });
// }
}
};
</script>
... ...
... ... @@ -32,16 +32,16 @@
</cube-slide>
<div class="primary">
<div>
<p class="price">¥{{info.price}}</p>
<p class="price">¥{{info.price}} <span>全新¥{{info.newProductPrice}}</span><span class="red"> 省¥{{info.savePrice}}</span></p>
<p class="size">{{info.sizeName}}</p>
</div>
<p class="name">{{info.productName}} {{info.colorName}} {{info.describeInfo}}</p>
<p class="name">{{info.productName}} {{info.colorName}} {{info.productCode}}</p>
</div>
<div class="other-info">
<p>{{info.gender}} {{info.brandName}}</p>
<p>状况:{{ info.shoeQualityDesc }}</p>
<p>鞋盒:{{ info.shoeBoxDesc }}</p>
<p>售出时间:{{ info.soldTime }}</p>
<p v-show="info.soldTime">售出时间:{{ info.soldTime }}</p>
<p>{{ info.describeInfo }}</p>
</div>
<div class="extra-card" @click="$router.push({name: 'ProductDetail', params: { productId: info.productId } })">
... ... @@ -54,7 +54,8 @@
</div>
</LayoutScroll>
<div class="fixed-footer">
<cube-button class="buy active" @click="buy">购买 <span class="price">¥{{info.price}}</span></cube-button>
<cube-button v-if="info.status===1" class="active" @click="buy">购买 <span class="price">¥{{info.price}}</span></cube-button>
<cube-button v-else class="disable">商品已售出</cube-button>
</div>
</LayoutApp>
</template>
... ... @@ -94,7 +95,12 @@ export default {
name: 'UfoSecondProductDetail',
mixins: [],
props: {
skup: Number
skup: Number,
yasParams: {
TAB_ID: '',
TAB_NAME: '',
PRD_ID: '',
}
},
// 服务端渲染函数
asyncData({store, router}) {
... ... @@ -112,11 +118,11 @@ export default {
created() {},
mounted() {},
activated() {
// console.log('mounted', this.info);
console.log(this.info);
this.fetchDetailById({ skup: this.skup })
this.refresh();
/*
[二手商品详情页打开时]
1.FP_NAME:来源页面名称;eg:XY_UFO...
... ... @@ -126,16 +132,18 @@ export default {
5.PRD_ID:商品id;
6.PRD_TYPE:1-二手,2-全新瑕疵;
*/
// let { TAB_ID, TAB_NAME, PRD_ID } = this.yasParams;
this.$store.dispatch('reportYas', {
params: {
appop: 'XY_UFO_PRD_DT_INFO',
param:{
FP_NAME: `XY_UFO${this.$route.name}`,
FP_PARAM: this.skup,
TAB_ID: '',
TAB_NAME: '',
PRD_ID: this.$route.query.pid,
PRD_TYPE: this.info.describeInfo
TAB_ID: this.yasParams?.TAB_ID,
TAB_NAME: this.yasParams?.TAB_NAME,
PRD_ID: this.yasParams?.PRD_ID,
PRD_TYPE: this.info.sechondHandTypeName == '全新瑕疵' ? 2 :1
}
}
});
... ... @@ -168,9 +176,9 @@ export default {
appop: 'XY_UFO_PRD_DT_BUY_SEL_C',
param:{
P_NAME: `XY_UFO${this.$route.name}`,
PRD_ID: this.$route.query.pid,
PRD_ID: this.yasParams?.pid,
PRD_SIZE: this.info.sizeName,
ORD_TYPE: this.info.describeInfo
ORD_TYPE: this.info.sechondHandTypeName == '全新瑕疵' ? 2 :1
}
}
});
... ... @@ -190,7 +198,7 @@ export default {
PRD_ID: this.info.productId,
PRD_SKU: this.skup,
PRD_SIZE: this.info.size_name,
ORD_TYPE: this.info.sechondHandTypeName === '二手' ? 5 : 6,
ORD_TYPE: this.info.sechondHandTypeName == '全新瑕疵' ? 2 :1
},
},
});
... ... @@ -282,6 +290,13 @@ export default {
font-size: 36px;
letter-spacing: 2px;
}
& > span {
font-size: 24px;
color: #000;
&.red {
color: #D0021B;
}
}
}
.size {
font-size: 32px;
... ... @@ -365,6 +380,12 @@ export default {
letter-spacing: 2px;
}
}
.disable {
background: #ddd;
color: #999;
border-color: #ddd;
font-size: 32px;
}
}
</style>
... ...
... ... @@ -4,6 +4,7 @@ export default [{
component: () => import(/* webpackChunkName: "second" */ './detail'),
props({params}) {
return {
...params,
skup: parseInt(params.skup, 10),
};
},
... ...
... ... @@ -43,7 +43,7 @@
v-if="productList.length"
class="product-list"
>
<SecondList :list="productList"></SecondList>
<SecondList :list="productList" :yasParams="yasParams"></SecondList>
</LayoutScroll>
<!-- <EmptyList class="empty-wrapper product-list" :tip="`暂无数据`" v-show="productList.isEmpty" /> -->
</LayoutApp>
... ... @@ -137,6 +137,7 @@ export default {
}
if (type==='shaixuanConfirm') {
queryOptions.second_type = sort;
console.log(queryOptions.second_type);
}
this.$set(this.queryOptions, 'sort', queryOptions.sort);
... ... @@ -202,7 +203,7 @@ export default {
*/
let yasParam = {
// P_NAME: `XY_UFO${this.$route.name}`,
P_NAME: `XY_UFO${this.$route.name}`,
TYPE_ID: 5,
P_PARAM: this.$route.query.pid,
TAB_ID: null,
... ... @@ -236,6 +237,38 @@ export default {
...mapState('product', ["selectedProductInfo"]),
computePageTitle() {
return this.selectedProductInfo.product.product_name
},
yasParams() {
/*
1.P_NAME:页面名称,XY_UFO...
2.TYPE_ID:列表页入口类型,1-搜索结果页,2-系列,3-品牌,4-商品池;5-二手;
3.P_PARAM:列表入口页面参数,搜索关键词,系列ID,品牌ID,商品池ID;
4.TAB_ID:tab切id,2-价格,4-推荐;
5.TAB_NAME:tab切名称,价格,推荐;
6.I_INDEX:曝光顺序;
7.PRD_ID:商品id;
8.PRD_TYPE:1-二手,2-全新瑕疵;
*/
let _yasParams = {
P_NAME: `XY_UFO${this.$route.name}`,
TYPE_ID: 5,
P_PARAM: null,
TAB_ID: null,
TAB_NAME: null,
I_INDEX: null,
PRD_ID: this.$route.query.pid,
PRD_TYPE: this.queryOptions.second_type===5 ? 2 : 1
}
if (this.queryOptions.sort===null) {
_yasParams.TAB_ID = 5
_yasParams.TAB_NAME = '推荐'
} else {
_yasParams.TAB_ID = 2
_yasParams.TAB_NAME = '价格'
}
return _yasParams;
}
},
watch: {},
... ...