Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
xianyu-ufo-app-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
zhangwenxue
5 years ago
Commit
5e7b53919db3a17427b65aa7c5b48537ddaf6cc8
1 parent
cc50203d
商品详情: 删除活动
request of PM
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
136 deletions
apps/pages/product/components/activity-list-sheet.vue
apps/pages/product/product-detail.vue
apps/store/product/actions.js
apps/store/product/index.js
config/product-api-map.js
apps/pages/product/components/activity-list-sheet.vue
deleted
100644 → 0
View file @
cc50203
<template>
<action-sheet @hidden="onHidden" ref="popup">
<div class="activity-sheet">
<h3>活动详情</h3>
<div class="list" >
<cube-scroll ref="activityListScroll">
<ul>
<li v-for="(item, idx) in list" :key="idx">
<div><span>{{item.promotionTypeStr}}</span> {{item.activityName}}</div>
<div class="sub">{{item.startTimeStr}}-{{item.endTimeStr}}</div>
</li>
</ul>
</cube-scroll>
</div>
</div>
</action-sheet>
</template>
<script>
import { Scroll } from 'cube-ui';
import ActionSheet from './action-sheet';
export default {
name: 'ActivityListSheet',
props: {
list: {
type: Array,
required: true,
},
},
components: {
'cube-scroll': Scroll,
'action-sheet': ActionSheet,
},
mounted() {
this.$refs.popup.show(() => {
this.$refs.activityListScroll.refresh();
});
},
methods: {
onHidden() {
this.$emit('hidden');
},
}
};
</script>
<style lang="scss" scoped>
.activity-sheet {
display: flex;
flex-direction: column;
height: 50vh;
h3 {
text-align: center;
font-size: 32px;
line-height: 3;
font-weight: normal;
color: #333;
}
.list {
flex: 1;
padding: 20px;
overflow: scroll;
}
span {
font-size: 0.7em;
line-height: 1.4;
border: 1px solid #f00;;
color: #f00;
text-align: center;
padding: 0 0.9em;
margin-right: 0.8em;
display: inline-block;
position: relative;
top: -2px;
}
ul {
list-style: none;
line-height: 2;
color: #333;
}
li {
padding: 15px 0;
border-bottom: 1px solid #ccc;
}
.sub {
color: #999;
font-size: 0.8em;
}
}
</style>
apps/pages/product/product-detail.vue
View file @
5e7b539
...
...
@@ -27,18 +27,11 @@
<div class="info-price">¥{{productDetail.least_price||''}}</div>
<div class="info-name">{{productDetail.product_name}}</div>
</div>
<a class="banner" v-if="resource" :href="resource.url">
<img-size :src="sizeImg(resource.src)" :width="300" :height="60"/>
</a>
<a class="banner" v-if="resource" :href="resource.url">
<img-size :src="sizeImg(resource.src)" :width="300" :height="60"/>
</a>
<div class="info">
<div class="info-list">
<div class="info-list-item" v-if="activity && activity.length !== 0" @click="showActivity">
<div class="info-list-name">促销</div>
<div class="info-list-value info-promote">
<span>{{activity[0].promotionTypeStr}}</span>
<i class="cubeic-arrow"></i>
</div>
</div>
<div class="info-list-item" v-for="(desc, index) in productDec" :key="index">
<div class="info-list-name">{{desc.text}}</div>
<div class="info-list-value">{{desc.value}}</div>
...
...
@@ -74,7 +67,6 @@
<cube-button class="sell" @click="sell">出售</cube-button>
<cube-button class="buy active" @click="buy">购买</cube-button>
</div>
<activity-list-sheet v-if="showActivitySheet" :list="activity" @hidden="onActivitySheetHidden"/>
<size-select-sheet v-if="showSizeSelectSheet"
:list="sizeList"
:product="productDetail"
...
...
@@ -97,7 +89,6 @@ import ImgSize from '../../components/img-size';
import { getImgUrl } from '../../common/utils';
import ProductList from '../list/components/productList';
import ActivityListSheet from './components/activity-list-sheet';
import prdDetailTip from '../../statics/image/product/prdDetailTip.png';
import prdDetailImage from '../../statics/image/product/prdDetailImage.png';
import SizeSelectSheet from './components/size-select-sheet';
...
...
@@ -111,7 +102,6 @@ export default {
name: 'ProductDetail',
components: {
SizeSelectSheet,
ActivityListSheet,
SizeRequestSheet,
BuySheet,
ImgSize,
...
...
@@ -134,8 +124,6 @@ export default {
prdDetailImage,
headThumbnailVisible: false,
showActivitySheet: false,
showBuySheet: false,
showSizeSelectSheet: false,
...
...
@@ -144,7 +132,7 @@ export default {
};
},
computed: {
...mapGetters(['productDetail', 'isFav', 'topList', 'imageList', 'resource', '
activity', '
recommend']),
...mapGetters(['productDetail', 'isFav', 'topList', 'imageList', 'resource', 'recommend']),
productDec() {
const goods = get(this.productDetail, 'goods_list[0]', {});
...
...
@@ -254,12 +242,6 @@ export default {
query,
});
},
showActivity() {
this.showActivitySheet = true;
},
onActivitySheetHidden() {
this.showActivitySheet = false;
},
onSizeSelectSheetHidden() {
this.showSizeSelectSheet = false;
},
...
...
apps/store/product/actions.js
View file @
5e7b539
...
...
@@ -4,7 +4,7 @@ import Vue from 'vue';
export
default
{
async
fetchProductInfo
({
commit
},
{
productId
})
{
const
queryTasks
=
[
''
,
'/resource'
,
'/
activity'
,
'/
recommend'
].
map
(
path
=>
{
const
queryTasks
=
[
''
,
'/resource'
,
'/recommend'
].
map
(
path
=>
{
return
this
.
$api
.
get
(
`
/
api
/
ufo
/
product$
{
path
}
`
,
{
product_id
:
productId
}).
then
(
result
=>
{
if
(
result
.
code
===
200
)
{
return
result
.
data
;
...
...
@@ -14,11 +14,10 @@ export default {
});
});
const
[
detail
,
resource
,
activity
,
recommend
]
=
await
Promise
.
all
(
queryTasks
);
const
[
detail
,
resource
,
recommend
]
=
await
Promise
.
all
(
queryTasks
);
commit
(
Types
.
UPDATE_PRODUCT_DETAIL
,
Object
.
assign
(
detail
.
product_info
,
{
resource
:
get
(
resource
,
'[0].data[0]'
,
null
),
activity
:
activity
||
[],
recommend
:
recommend
&&
recommend
.
product_list
||
[],
}));
},
...
...
apps/store/product/index.js
View file @
5e7b539
...
...
@@ -32,7 +32,6 @@ export function defaultState() {
series_name
:
null
,
shelve_status
:
null
,
resource
:
null
,
activity
:
[],
recommend
:
[],
top3
:
[],
},
...
...
@@ -73,9 +72,6 @@ export default function() {
resource
(
state
)
{
return
state
.
product
.
resource
;
},
activity
(
state
)
{
return
state
.
product
.
activity
;
},
isFav
(
state
)
{
return
state
.
fav
[
state
.
product
.
product_id
];
},
...
...
config/product-api-map.js
View file @
5e7b539
...
...
@@ -49,16 +49,6 @@ module.exports = {
},
},
// 对应商品的活动
'/api/ufo/product/activity'
:
{
ufo
:
true
,
auth
:
false
,
api
:
'ufo.promotion.activityListForProduct'
,
params
:
{
product_id
:
{
type
:
Number
},
// 商品id
},
},
// 限制出售
'/api/ufo/product/limit'
:
{
ufo
:
true
,
...
...
Please
register
or
login
to post a comment