fix
This commit is contained in:
parent
d436a235a2
commit
8c7ee72f40
|
@ -199,7 +199,7 @@
|
|||
"path": "manageGoods",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商品管理",
|
||||
"enablePullDownRefresh": true
|
||||
"enablePullDownRefresh": false
|
||||
},
|
||||
"meta": {
|
||||
"auth": false
|
||||
|
|
|
@ -74,6 +74,7 @@ const bgStyle = {
|
|||
imageType: 'local',
|
||||
backgroundColor: '#fff',
|
||||
description: '',
|
||||
height: '580rpx'
|
||||
}
|
||||
|
||||
const state = ref({
|
||||
|
|
|
@ -57,6 +57,7 @@ const bgStyle = {
|
|||
backgroundImage: '/static/bg-page.png',
|
||||
imageType: 'local',
|
||||
backgroundColor: '#fff',
|
||||
height: '580rpx'
|
||||
}
|
||||
|
||||
const state = ref({
|
||||
|
|
|
@ -1,58 +1,26 @@
|
|||
<template>
|
||||
<pb-layout
|
||||
class="product-list"
|
||||
title="产品"
|
||||
navbar="normal"
|
||||
tabbar="/pages/index/product"
|
||||
:bgStyle="bgStyle"
|
||||
opacityBgUi="bg-white"
|
||||
color="black"
|
||||
:leftIcon="''"
|
||||
>
|
||||
<pb-layout class="product-list" title="产品" navbar="normal" tabbar="/pages/index/product" :bgStyle="bgStyle"
|
||||
opacityBgUi="bg-white" color="black" :leftIcon="''">
|
||||
<pb-sticky>
|
||||
<view class="top-search">
|
||||
<uni-search-bar
|
||||
v-model="state.searchContent"
|
||||
radius="5"
|
||||
placeholder="请输入商品名称"
|
||||
bgColor="#fff"
|
||||
clearButton="auto"
|
||||
cancelButton="none"
|
||||
@clear="onSearch"
|
||||
@confirm="onSearch"
|
||||
/>
|
||||
<uni-search-bar v-model="state.searchContent" radius="5" placeholder="请输入商品名称" bgColor="#fff" clearButton="auto"
|
||||
cancelButton="none" @clear="onSearch" @confirm="onSearch" />
|
||||
</view>
|
||||
</pb-sticky>
|
||||
<view v-if="state.pagination.total > 0" class="goods-list">
|
||||
<view class="ss-p-l-20 ss-p-r-20 ss-m-b-20" v-for="item in state.pagination.list" :key="item.id">
|
||||
<p-goods-column
|
||||
size="lg"
|
||||
:data="item"
|
||||
:topRadius="10"
|
||||
:bottomRadius="10"
|
||||
@refresh="refresh"
|
||||
@click="peach.$router.go('/pages/product/manageGoods', { id: item.id, mark: 'detail' })"
|
||||
/>
|
||||
<p-goods-column size="lg" :data="item" :topRadius="10" :bottomRadius="10" @refresh="refresh"
|
||||
@click="peach.$router.go('/pages/product/manageGoods', { id: item.id, mark: 'detail' })" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<uni-load-more
|
||||
v-if="state.pagination.total > 0"
|
||||
:status="state.loadStatus"
|
||||
:content-text="{
|
||||
contentdown: '上拉加载更多',
|
||||
}"
|
||||
@click="loadMore"
|
||||
/>
|
||||
<uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" :content-text="{
|
||||
contentdown: '上拉加载更多',
|
||||
}" @click="loadMore" />
|
||||
|
||||
<view class="_icon-add-round add-product" @click="addGoods"></view>
|
||||
|
||||
<p-empty
|
||||
v-if="state.pagination.total === 0"
|
||||
icon="/static/soldout-empty.png"
|
||||
text="暂无产品"
|
||||
bgColor="transparent"
|
||||
/>
|
||||
<p-empty v-if="state.pagination.total === 0" icon="/static/soldout-empty.png" text="暂无产品" bgColor="transparent" />
|
||||
</pb-layout>
|
||||
</template>
|
||||
|
||||
|
@ -112,6 +80,7 @@ function addGoods() {
|
|||
goodsInfo: null,
|
||||
skus: null,
|
||||
specType: false,
|
||||
canEdit: true
|
||||
})
|
||||
peach.$router.go('/pages/product/manageGoods', {
|
||||
title: '添加商品',
|
||||
|
@ -156,6 +125,7 @@ onPullDownRefresh(() => {
|
|||
.top-search {
|
||||
background-color: var(--ui-BG-1);
|
||||
}
|
||||
|
||||
.add-product {
|
||||
position: fixed;
|
||||
color: var(--ui-BG-Main);
|
||||
|
|
|
@ -1,83 +1,35 @@
|
|||
<template>
|
||||
<pb-layout
|
||||
class="manage-goods"
|
||||
:title="goodsTitle"
|
||||
leftIcon="leftIcon"
|
||||
navbar="normal"
|
||||
:bgStyle="bgStyle"
|
||||
opacityBgUi="bg-white"
|
||||
color="black"
|
||||
>
|
||||
<pb-layout class="manage-goods" :title="goodsTitle" leftIcon="leftIcon" navbar="normal" :bgStyle="bgStyle"
|
||||
opacityBgUi="bg-white" color="black">
|
||||
<view class="goods-form">
|
||||
<uni-forms ref="formRef" v-model="formData" :rules="rules" label-position="top" label-width="160">
|
||||
<uni-forms-item label="商品封面图" name="picUrl" required>
|
||||
<p-uploader
|
||||
v-model:url="formData.picUrl"
|
||||
:readonly="!canEdit"
|
||||
fileMediatype="image"
|
||||
limit="1"
|
||||
mode="grid"
|
||||
:imageStyles="{ width: '168rpx', height: '168rpx' }"
|
||||
/>
|
||||
<p-uploader v-model:url="formData.picUrl" :readonly="!canEdit" fileMediatype="image" limit="1" mode="grid"
|
||||
:imageStyles="{ width: '168rpx', height: '168rpx' }" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="商品轮播图" name="sliderPicUrls" required>
|
||||
<p-uploader
|
||||
v-model:url="formData.sliderPicUrls"
|
||||
:readonly="!canEdit"
|
||||
fileMediatype="image"
|
||||
limit="6"
|
||||
mode="grid"
|
||||
:imageStyles="{ width: '168rpx', height: '168rpx' }"
|
||||
/>
|
||||
<p-uploader v-model:url="formData.sliderPicUrls" :readonly="!canEdit" fileMediatype="image" limit="6"
|
||||
mode="grid" :imageStyles="{ width: '168rpx', height: '168rpx' }" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="商品名称" name="name" required>
|
||||
<uni-easyinput
|
||||
type="text"
|
||||
trim="all"
|
||||
v-model="formData.name"
|
||||
:disabled="!canEdit"
|
||||
placeholder="请输入商品名称"
|
||||
/>
|
||||
<uni-easyinput type="text" trim="all" v-model="formData.name" :disabled="!canEdit" placeholder="请输入商品名称" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item
|
||||
label="商品分类"
|
||||
@tap="openPicker('category', 'multiple')"
|
||||
name="categoryId"
|
||||
label-position="left"
|
||||
required
|
||||
>
|
||||
<uni-easyinput
|
||||
type="text"
|
||||
v-model="formData.categoryText"
|
||||
:styles="selfStyles"
|
||||
placeholderStyle="color:#8a8a8a"
|
||||
:clearable="false"
|
||||
:inputBorder="false"
|
||||
placeholder="请选择商品分类"
|
||||
disabled
|
||||
>
|
||||
<uni-forms-item label="商品分类" name="categoryId" label-position="left" required>
|
||||
<view style="width: 100%; height: 100%; position: absolute; z-index: 1"
|
||||
@tap="openPicker('category', 'multiple')"></view>
|
||||
|
||||
<uni-easyinput type="text" v-model="formData.categoryText" :styles="selfStyles"
|
||||
placeholderStyle="color:#8a8a8a" :clearable="false" :inputBorder="false" placeholder="请选择商品分类" disabled>
|
||||
<template v-slot:right>
|
||||
<uni-icons type="right" />
|
||||
</template>
|
||||
</uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item
|
||||
label="商品品牌"
|
||||
name="brandId"
|
||||
label-position="left"
|
||||
required
|
||||
@tap="openPicker('brand', 'single')"
|
||||
>
|
||||
<uni-easyinput
|
||||
type="text"
|
||||
v-model="formData.brandText"
|
||||
:styles="selfStyles"
|
||||
placeholderStyle="color:#8a8a8a"
|
||||
:clearable="false"
|
||||
:inputBorder="false"
|
||||
placeholder="请选择商品品牌"
|
||||
disabled
|
||||
>
|
||||
<uni-forms-item label="商品品牌" name="brandId" label-position="left" required>
|
||||
<view style="width: 100%; height: 100%; position: absolute; z-index: 1" @tap="openPicker('brand', 'single')">
|
||||
</view>
|
||||
<uni-easyinput type="text" v-model="formData.brandText" :styles="selfStyles" placeholderStyle="color:#8a8a8a"
|
||||
:clearable="false" :inputBorder="false" placeholder="请选择商品品牌" disabled>
|
||||
<template v-slot:right>
|
||||
<uni-icons type="right" />
|
||||
</template>
|
||||
|
@ -92,54 +44,27 @@
|
|||
<uni-easyinput type="text" v-model="formData.keyword" :disabled="!canEdit" placeholder="请输入商品关键词" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="商品简介" name="introduction" required>
|
||||
<uni-easyinput
|
||||
type="textarea"
|
||||
:disabled="!canEdit"
|
||||
trim="all"
|
||||
autoHeight
|
||||
v-model="formData.introduction"
|
||||
placeholder="请输入商品简介"
|
||||
/>
|
||||
<uni-easyinput type="textarea" :disabled="!canEdit" trim="all" autoHeight v-model="formData.introduction"
|
||||
placeholder="请输入商品简介" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item
|
||||
label="物流设置"
|
||||
@tap="openPicker('delivery', 'single')"
|
||||
name="deliveryTypes"
|
||||
label-position="left"
|
||||
required
|
||||
>
|
||||
<uni-easyinput
|
||||
type="text"
|
||||
:clearable="false"
|
||||
:styles="selfStyles"
|
||||
placeholderStyle="color:#8a8a8a"
|
||||
:inputBorder="false"
|
||||
v-model="formData.deliveryText"
|
||||
placeholder="请选择配送方式"
|
||||
disabled
|
||||
>
|
||||
<uni-forms-item label="物流设置" name="deliveryTypes" label-position="left" required>
|
||||
<view style="width: 100%; height: 100%; position: absolute; z-index: 1"
|
||||
@tap="openPicker('delivery', 'single')">
|
||||
</view>
|
||||
<uni-easyinput type="text" :clearable="false" :styles="selfStyles" placeholderStyle="color:#8a8a8a"
|
||||
:inputBorder="false" v-model="formData.deliveryText" placeholder="请选择配送方式" disabled>
|
||||
<template v-slot:right>
|
||||
<uni-icons type="right" />
|
||||
</template>
|
||||
</uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="虚拟销量" name="virtualSalesCount" required>
|
||||
<uni-easyinput
|
||||
v-model="formData.virtualSalesCount"
|
||||
type="number"
|
||||
:disabled="!canEdit"
|
||||
placeholder="请输入虚拟销量"
|
||||
/>
|
||||
<uni-easyinput v-model="formData.virtualSalesCount" type="number" :disabled="!canEdit"
|
||||
placeholder="请输入虚拟销量" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="商品详情" required>
|
||||
<piaoyiEditor
|
||||
:values="richValues"
|
||||
@changes="saveContens"
|
||||
:maxlength="3000"
|
||||
:readOnly="richReadOnly"
|
||||
:photoUrl="photoUrl"
|
||||
:api="richApi"
|
||||
/>
|
||||
<piaoyiEditor :values="richValues" @changes="saveContens" :maxlength="3000" :readOnly="richReadOnly"
|
||||
:photoUrl="photoUrl" :api="richApi" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<view @tap="onSubmit" v-if="canEdit">
|
||||
|
|
|
@ -1,26 +1,13 @@
|
|||
<template>
|
||||
<pb-layout
|
||||
class="goods-property"
|
||||
title="商品属性"
|
||||
leftIcon="leftIcon"
|
||||
navbar="normal"
|
||||
:bgStyle="bgStyle"
|
||||
opacityBgUi="bg-white"
|
||||
color="black"
|
||||
>
|
||||
<pb-layout class="goods-property" title="商品属性" leftIcon="leftIcon" navbar="normal" :bgStyle="bgStyle"
|
||||
opacityBgUi="bg-white" color="black">
|
||||
<view class="property">
|
||||
<uni-forms ref="formRef" v-model="formData" :rules="rules" label-position="top" label-width="160">
|
||||
<uni-forms-item label="商品规格" @tap="pickerProperty" name="specType" label-position="left" required>
|
||||
<uni-easyinput
|
||||
type="text"
|
||||
:clearable="false"
|
||||
:styles="selfStyles"
|
||||
placeholderStyle="color:#8a8a8a"
|
||||
:inputBorder="false"
|
||||
v-model="formData.specText"
|
||||
placeholder="请选择商品规格"
|
||||
disabled
|
||||
>
|
||||
<uni-forms-item label="商品规格" name="specType" label-position="left" required>
|
||||
<view style="width: 100%; height: 100%; position: absolute; z-index: 1" @tap="pickerProperty">
|
||||
</view>
|
||||
<uni-easyinput type="text" :clearable="false" :styles="selfStyles" placeholderStyle="color:#8a8a8a"
|
||||
:inputBorder="false" v-model="formData.specText" placeholder="请选择商品规格" disabled>
|
||||
<template v-slot:right>
|
||||
<uni-icons type="right" />
|
||||
</template>
|
||||
|
@ -32,12 +19,8 @@
|
|||
<!-- 添加商品 -->
|
||||
<button v-if="canEdit" class="ss-reset-button add-property" @tap="showPropertyList">选择规格</button>
|
||||
<!-- 商品属性展示 -->
|
||||
<property-detail
|
||||
v-if="propertyList.length > 0"
|
||||
v-model="propertyList"
|
||||
:goodsPropertyList="goodsPropertyList"
|
||||
@changeSubProperty="changeSubProperty"
|
||||
></property-detail>
|
||||
<property-detail v-if="propertyList.length > 0" v-model="propertyList" :goodsPropertyList="goodsPropertyList"
|
||||
@changeSubProperty="changeSubProperty"></property-detail>
|
||||
<!-- 多规格商品 -->
|
||||
<mutiple-sku :skus="skus"></mutiple-sku>
|
||||
</template>
|
||||
|
@ -56,12 +39,8 @@
|
|||
<p-picker ref="pickerRef" mode="single" :options-cols="SPEC_TYPE" @confirm="onRDPickerConfirm"></p-picker>
|
||||
|
||||
<!-- 商品属性列表 -->
|
||||
<PropertyList
|
||||
ref="propertyListRef"
|
||||
v-model="propertyList"
|
||||
:goodsPropertyList="goodsPropertyList"
|
||||
@confirm="onPropertyConfirm"
|
||||
/>
|
||||
<PropertyList ref="propertyListRef" v-model="propertyList" :goodsPropertyList="goodsPropertyList"
|
||||
@confirm="onPropertyConfirm" />
|
||||
</pb-layout>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,31 +1,22 @@
|
|||
<!-- 全局 - 快捷入口 -->
|
||||
<template>
|
||||
<uni-popup
|
||||
ref="popupRef"
|
||||
type="top"
|
||||
borderRadius="0 0 20px 20px"
|
||||
backgroundColor="#F0F0F0"
|
||||
@close="closeMenuTools"
|
||||
@maskClick="closeMenuTools"
|
||||
>
|
||||
<pb-status-bar />
|
||||
<view class="tools-wrap ss-m-x-30 ss-m-b-16">
|
||||
<view class="title ss-m-b-34 ss-p-t-20">快捷菜单</view>
|
||||
<view class="container-list ss-flex ss-flex-wrap">
|
||||
<view class="list-item ss-m-b-24" v-for="item in list" :key="item.title">
|
||||
<view class="ss-flex-col ss-col-center">
|
||||
<button
|
||||
class="ss-reset-button list-image ss-flex ss-row-center ss-col-center"
|
||||
@tap="onClick(item)"
|
||||
>
|
||||
<image v-if="show" :src="peach.$url.static(item.icon, 'local')" class="list-icon" />
|
||||
</button>
|
||||
<view class="list-title ss-m-t-20">{{ item.title }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<uni-popup ref="popupRef" type="top" borderRadius="0 0 20px 20px" backgroundColor="#F0F0F0" @close="closeMenuTools"
|
||||
@maskClick="closeMenuTools">
|
||||
<pb-status-bar />
|
||||
<view class="tools-wrap ss-m-x-30 ss-m-b-16">
|
||||
<view class="title ss-m-b-34 ss-p-t-20">快捷菜单</view>
|
||||
<view class="container-list ss-flex ss-flex-wrap">
|
||||
<view class="list-item ss-m-b-24" v-for="item in list" :key="item.title">
|
||||
<view class="ss-flex-col ss-col-center">
|
||||
<button class="ss-reset-button list-image ss-flex ss-row-center ss-col-center" @tap="onClick(item)">
|
||||
<image v-if="show" :src="peach.$url.static(item.icon, 'local')" class="list-icon" />
|
||||
</button>
|
||||
<view class="list-title ss-m-t-20">{{ item.title }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
@ -37,78 +28,78 @@ const popupRef = ref()
|
|||
const show = computed(() => peach.$store('modal').menu)
|
||||
|
||||
watch(show, (newVal) => {
|
||||
if (newVal) {
|
||||
popupRef.value.open()
|
||||
} else {
|
||||
popupRef.value.close()
|
||||
}
|
||||
if (newVal) {
|
||||
popupRef.value.open()
|
||||
} else {
|
||||
popupRef.value.close()
|
||||
}
|
||||
})
|
||||
|
||||
function onClick(item) {
|
||||
closeMenuTools()
|
||||
if (item.url) peach.$router.redirect(item.url)
|
||||
closeMenuTools()
|
||||
if (item.url) peach.$router.redirect(item.url)
|
||||
}
|
||||
|
||||
const list = [
|
||||
{
|
||||
url: '/pages/user/point/share',
|
||||
icon: '/static/dispensecent.png',
|
||||
title: '分发积分',
|
||||
},
|
||||
{
|
||||
url: '/pages/user/point/buy',
|
||||
icon: '/static/buycent.png',
|
||||
title: '购买积分',
|
||||
},
|
||||
{
|
||||
url: '/pages/user/wallet/withdraw',
|
||||
icon: '/static/withdraw.png',
|
||||
title: '余额提现',
|
||||
},
|
||||
{
|
||||
url: '/pages/user/point/share',
|
||||
icon: '/static/dispensecent.png',
|
||||
title: '分发积分',
|
||||
},
|
||||
// {
|
||||
// url: '/pages/user/point/buy',
|
||||
// icon: '/static/buycent.png',
|
||||
// title: '购买积分',
|
||||
// },
|
||||
{
|
||||
url: '/pages/user/wallet/withdraw',
|
||||
icon: '/static/withdraw.png',
|
||||
title: '余额提现',
|
||||
},
|
||||
]
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tools-wrap {
|
||||
// background: #F0F0F0;
|
||||
// box-shadow: 0px 0px 28rpx 7rpx rgba(0, 0, 0, 0.13);
|
||||
// opacity: 0.98;
|
||||
// border-radius: 0 0 20rpx 20rpx;
|
||||
// background: #F0F0F0;
|
||||
// box-shadow: 0px 0px 28rpx 7rpx rgba(0, 0, 0, 0.13);
|
||||
// opacity: 0.98;
|
||||
// border-radius: 0 0 20rpx 20rpx;
|
||||
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
width: calc(25vw - 20rpx);
|
||||
|
||||
.list-image {
|
||||
width: 104rpx;
|
||||
height: 104rpx;
|
||||
border-radius: 52rpx;
|
||||
background: var(--ui-BG);
|
||||
|
||||
.list-icon {
|
||||
width: 54rpx;
|
||||
height: 54rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.list-item {
|
||||
width: calc(25vw - 20rpx);
|
||||
|
||||
.list-image {
|
||||
width: 104rpx;
|
||||
height: 104rpx;
|
||||
border-radius: 52rpx;
|
||||
background: var(--ui-BG);
|
||||
|
||||
.list-icon {
|
||||
width: 54rpx;
|
||||
height: 54rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.list-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
.list-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.uni-popup {
|
||||
top: 0 !important;
|
||||
top: 0 !important;
|
||||
}
|
||||
|
||||
:deep(.button-hover) {
|
||||
background: #fafafa !important;
|
||||
background: #fafafa !important;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue