|
|
@ -1,66 +1,97 @@ |
|
|
|
<template> |
|
|
|
<view class="list"> |
|
|
|
<view class="item" |
|
|
|
v-for="(item, index) in productList" |
|
|
|
@click="$utils.navigateTo(`/pages_order/product/productDetail?id=${item.id}&pay=${pay}`)" |
|
|
|
:key="index"> |
|
|
|
<image |
|
|
|
class="image" |
|
|
|
:src="item.image ? item.image.split(',')[0] : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg'" mode="aspectFill"></image> |
|
|
|
<view class="info"> |
|
|
|
<view class="title text-ellipsis"> |
|
|
|
{{ item.name }} |
|
|
|
</view> |
|
|
|
<!-- <view class="price"> |
|
|
|
<text>¥{{ item.originalPrice }}</text>元/起 |
|
|
|
</view> |
|
|
|
<view class="favorable" v-if="item.goodsSku"> |
|
|
|
<view class="t"> |
|
|
|
限时优惠 |
|
|
|
<view class="product-list-container"> |
|
|
|
<view class="list"> |
|
|
|
<view class="item" |
|
|
|
v-for="(item, index) in productList" |
|
|
|
@click="$utils.navigateTo('/pages_order/product/productDetail?id=' + item.id + '&pay=' + pay)" |
|
|
|
:key="index"> |
|
|
|
<image |
|
|
|
class="image" |
|
|
|
:src="item.image ? item.image.split(',')[0] : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg'" mode="aspectFill"></image> |
|
|
|
<view class="info"> |
|
|
|
<view class="title text-ellipsis"> |
|
|
|
{{ item.name }} |
|
|
|
</view> |
|
|
|
<view class="p"> |
|
|
|
¥{{ item.goodsSku.price }} |
|
|
|
<!-- <view class="price"> |
|
|
|
<text>¥{{ item.originalPrice }}</text>元/起 |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
<view class="price" |
|
|
|
v-if="isProductPrice(item)"> |
|
|
|
现价<text>¥{{ item.price }}</text>元 |
|
|
|
</view> |
|
|
|
<view class="del" |
|
|
|
v-if="isProductPrice(item)"> |
|
|
|
原价¥{{ item.oldPrice }} |
|
|
|
</view> |
|
|
|
<!-- <view class="favorable" v-if="item.oldPrice"> |
|
|
|
<view class="t"> |
|
|
|
原价 |
|
|
|
<view class="favorable" v-if="item.goodsSku"> |
|
|
|
<view class="t"> |
|
|
|
限时优惠 |
|
|
|
</view> |
|
|
|
<view class="p"> |
|
|
|
¥{{ item.goodsSku.price }} |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
<view class="price" |
|
|
|
v-if="isProductPrice(item)"> |
|
|
|
现价<text>¥{{ item.price }}</text>元 |
|
|
|
</view> |
|
|
|
<view class="del" |
|
|
|
v-if="isProductPrice(item)"> |
|
|
|
原价¥{{ item.oldPrice }} |
|
|
|
</view> |
|
|
|
<view class="p"> |
|
|
|
¥{{ item.oldPrice }} |
|
|
|
<!-- <view class="favorable" v-if="item.oldPrice"> |
|
|
|
<view class="t"> |
|
|
|
原价 |
|
|
|
</view> |
|
|
|
<view class="p"> |
|
|
|
¥{{ item.oldPrice }} |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
<view class="favorable" |
|
|
|
v-if="item.points |
|
|
|
&& isProductPoint(item)"> |
|
|
|
<view class="t"> |
|
|
|
积分兑换 |
|
|
|
</view> |
|
|
|
<view class="p"> |
|
|
|
{{ item.points }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
<view class="favorable" |
|
|
|
v-if="item.points |
|
|
|
&& isProductPoint(item)"> |
|
|
|
<view class="t"> |
|
|
|
积分兑换 |
|
|
|
|
|
|
|
<view class="num"> |
|
|
|
{{ item.shopId }} |
|
|
|
</view> |
|
|
|
<view class="p"> |
|
|
|
{{ item.points }} |
|
|
|
|
|
|
|
<!-- 编辑和删除按钮 --> |
|
|
|
<view class="edit-actions" v-if="edit"> |
|
|
|
<uv-icon |
|
|
|
name="edit-pen-fill" |
|
|
|
size="40rpx" |
|
|
|
@click.stop="toEdit(item)" |
|
|
|
color="#5baaff" |
|
|
|
/> |
|
|
|
|
|
|
|
<uv-icon |
|
|
|
name="trash-fill" |
|
|
|
size="40rpx" |
|
|
|
@click.stop="del(item)" |
|
|
|
color="#5baaff" |
|
|
|
/> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- <view class="num"> |
|
|
|
已售卖{{ item.soldNum || 0 }}+件 |
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="num"> |
|
|
|
{{ item.shopId }} |
|
|
|
<view class="btn"> |
|
|
|
<uv-icon name="shopping-cart" |
|
|
|
color="#fff"></uv-icon> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- <view class="num"> |
|
|
|
已售卖{{ item.soldNum || 0 }}+件 |
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
<view class="btn"> |
|
|
|
<uv-icon name="shopping-cart" |
|
|
|
color="#fff"></uv-icon> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 添加商品按钮 --> |
|
|
|
<view class="createDetail" |
|
|
|
v-if="edit"> |
|
|
|
<view |
|
|
|
@click="$utils.navigateTo('/pages_order/product/addProduct?shopId=' + shopId)"> |
|
|
|
<uv-icon |
|
|
|
size="40rpx" |
|
|
|
color="#fff" |
|
|
|
name="plus"></uv-icon> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -71,19 +102,66 @@ |
|
|
|
export default { |
|
|
|
mixins : [productMixins], |
|
|
|
name:"productList", |
|
|
|
props : ['productList', 'pay'], |
|
|
|
props : { |
|
|
|
productList: { |
|
|
|
type: Array, |
|
|
|
default: function() { |
|
|
|
return [] |
|
|
|
} |
|
|
|
}, |
|
|
|
pay: { |
|
|
|
type: String, |
|
|
|
default: '' |
|
|
|
}, |
|
|
|
edit: { |
|
|
|
type: Boolean, |
|
|
|
default: false |
|
|
|
}, |
|
|
|
shopId: { |
|
|
|
type: [String, Number], |
|
|
|
default: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
|
|
|
|
}; |
|
|
|
}, |
|
|
|
methods : { |
|
|
|
// 修改商品 |
|
|
|
toEdit: function(item){ |
|
|
|
this.$utils.navigateTo('/pages_order/product/addProduct?id=' + item.id) |
|
|
|
}, |
|
|
|
|
|
|
|
// 下架商品 |
|
|
|
del: function(item){ |
|
|
|
var self = this; |
|
|
|
uni.showModal({ |
|
|
|
title: '您确认要下架吗?', |
|
|
|
content: '您正在下架 ' + item.name, |
|
|
|
success : function(res) { |
|
|
|
if(res.confirm){ |
|
|
|
self.$api('orderUpdate', { |
|
|
|
id : item.id, |
|
|
|
isOpen : 'N', |
|
|
|
}, function(res) { |
|
|
|
if(res.code == 200){ |
|
|
|
self.$emit('getData') |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
.product-list-container { |
|
|
|
position: relative; |
|
|
|
} |
|
|
|
|
|
|
|
.list{ |
|
|
|
display: flex; |
|
|
|
flex-wrap: wrap; |
|
|
@ -146,6 +224,16 @@ |
|
|
|
font-size: 22rpx; |
|
|
|
color: #888; |
|
|
|
} |
|
|
|
|
|
|
|
.edit-actions{ |
|
|
|
display: flex; |
|
|
|
margin-top: 10rpx; |
|
|
|
justify-content: flex-start; |
|
|
|
|
|
|
|
/deep/ .uv-icon { |
|
|
|
margin-right: 20rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.btn{ |
|
|
|
position: absolute; |
|
|
@ -157,4 +245,28 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.createDetail { |
|
|
|
position: fixed; |
|
|
|
top: 60vh; |
|
|
|
right: 50rpx; |
|
|
|
z-index: 999; |
|
|
|
button{ |
|
|
|
all : unset; |
|
|
|
} |
|
|
|
button::after{ |
|
|
|
all : unset; |
|
|
|
} |
|
|
|
& > view{ |
|
|
|
width: 100rpx; |
|
|
|
height: 100rpx; |
|
|
|
background-color: $uni-color; |
|
|
|
border-radius: 50rpx; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
box-shadow: 0 0 10rpx 10rpx rgba(0, 0, 0, 0.1); |
|
|
|
margin-bottom: 30rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |