This commit is contained in:
duan 2024-10-17 10:10:42 +08:00
commit c8633cd925
27 changed files with 329 additions and 176 deletions

View File

@ -397,3 +397,10 @@ text {
.u-primary-light { .u-primary-light {
color: $my-main-color; color: $my-main-color;
} }
::v-deep .u-border{
border-width: 1px!important;
}
::v-deep .u-m-t-16 .u-textarea{
border-width: 1px!important;
}

View File

@ -1,5 +1,6 @@
<template> <template>
<uni-file-picker v-model="imgList" file-mediatype="image" mode="grid" :limit="limit" @progress="FileUploadprogress" <uni-file-picker v-model="imgList" file-mediatype="image" mode="grid" :limit="limit" @progress="FileUploadprogress"
:image-styles="imageStyles"
@delete="fileDelete" @success="FileUploadsuccess" @fail="FileUploadail" @select="FileUploadselect" /> @delete="fileDelete" @success="FileUploadsuccess" @fail="FileUploadail" @select="FileUploadselect" />
</template> </template>
@ -8,6 +9,7 @@
$uploadFile $uploadFile
} from '@/http/yskApi/file.js' } from '@/http/yskApi/file.js'
import { import {
reactive,
ref, ref,
watch watch
} from 'vue'; } from 'vue';
@ -21,6 +23,16 @@
limit: { limit: {
type: Number, type: Number,
default: 10 default: 10
},
imageStyles:{
type:Object,
default:()=>{
return {
border:{
radius:'12rpx'
}
}
}
} }
}) })
const emits = defineEmits(['change']) const emits = defineEmits(['change'])

View File

@ -92,7 +92,7 @@ console.log(httpData,'调试1')
return Promise.reject(bodyData) // 跳转到catch函数 return Promise.reject(bodyData) // 跳转到catch函数
} }
// 业务响应异常 // // 业务响应异常
// if (bodyData.hasOwnProperty('code') && bodyData.code != 200) { // if (bodyData.hasOwnProperty('code') && bodyData.code != 200) {
// isShowErrorToast = true // isShowErrorToast = true
// infoBox.showToast(bodyData.msg) // infoBox.showToast(bodyData.msg)

View File

@ -13,13 +13,13 @@
</view> </view>
<view class=""> <view class="">
<uni-forms-item label="分类名称" required name="name"> <uni-forms-item label="分类名称" required name="name">
<uni-easyinput :placeholderStyle="placeholderStyle" :inputBorder="inputBorder" <uni-easyinput padding-none="true" :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
v-model="category.name" placeholder="输入分类名称" /> v-model="category.name" placeholder="输入分类名称" />
</uni-forms-item> </uni-forms-item>
</view> </view>
<template v-if="option.type==='edit'"> <template v-if="option.type==='edit'">
<uni-forms-item label="排序" required name="sort"> <uni-forms-item label="排序" required name="sort">
<uni-easyinput :placeholderStyle="placeholderStyle" :inputBorder="inputBorder" <uni-easyinput padding-none="true" :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
v-model="category.sort" type="number" placeholder="排序越小越靠前" /> v-model="category.sort" type="number" placeholder="排序越小越靠前" />
</uni-forms-item> </uni-forms-item>
</template> </template>
@ -72,18 +72,18 @@
</view> </view>
<template v-if="option.type==='edit'"> <template v-if="option.type==='edit'">
<view class="font-bold u-m-t-32 u-m-b-32">子分类</view> <view class="font-bold u-m-t-32 u-m-b-32">子分类</view>
<view class="block u-p-t-30" v-if=" category.childrenList.length"> <view class="block u-p-t-32 u-p-b-32" v-if=" category.childrenList.length">
<view class="u-flex u-text-center font-bold"> <view class="u-flex u-text-center u-font-24">
<view class="u-flex-1">名称</view> <view class="u-flex-1 ">名称</view>
<view class="u-flex-1">图片</view> <view class="u-flex-1">图片</view>
<view class="u-flex-1">状态</view> <view class="u-flex-1">状态</view>
<view class="u-flex-1">颜色</view> <view class="u-flex-1">颜色</view>
<view class="u-flex-1">操作</view> <view class="u-flex-1">操作</view>
</view> </view>
<view class="bg-gray u-p-t-20"> <view class="bg-gray u-p-t-20 u-m-t-24">
<view class="u-flex u-p-t-10 u-p-b-10" v-for="(item,index) in category.childrenList" <view class="u-flex u-p-t-10 u-p-b-10" v-for="(item,index) in category.childrenList"
:key="index"> :key="index">
<view class="u-flex-1 u-flex u-row-center"> <view class="u-flex-1 u-flex u-p-l-24 ">
{{item.name}} {{item.name}}
</view> </view>
<view class="u-flex-1 u-flex u-row-center"> <view class="u-flex-1 u-flex u-row-center">
@ -96,7 +96,7 @@
<view class="u-flex-1 u-flex u-row-center"> <view class="u-flex-1 u-flex u-row-center">
{{item.style}} {{item.style}}
</view> </view>
<view class="u-flex-1 u-flex u-row-center"> <view class="u-flex-1 u-flex u-row-right u-p-r-24 u-flex ">
<my-button @tap="moreShow(item,index)" :width="100" :height="40"> <my-button @tap="moreShow(item,index)" :width="100" :height="40">
<view class="u-font-24 no-wrap">更多</view> <view class="u-font-24 no-wrap">更多</view>
</my-button> </my-button>
@ -747,13 +747,15 @@
.lh40 { .lh40 {
line-height: 40rpx; line-height: 40rpx;
} }
::v-deep .uni-forms-item.is-direction-top .uni-forms-item__label{
padding-bottom: 24rpx;
}
.box { .box {
font-size: 28rpx; font-size: 28rpx;
.block { .block {
background: #FFFFFF; background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx; border-radius: 6px 18rpx 0 18rpx;
padding: 12rpx 24rpx; padding: 12rpx 24rpx;
margin-bottom: 32rpx; margin-bottom: 32rpx;
} }

View File

@ -8,7 +8,8 @@
:checked="data.checked" /><text></text> :checked="data.checked" /><text></text>
</label> </label>
</view> </view>
<image mode="aspectFill" :src="data.pic" class="img"></image> <up-image width="126rpx" height="126rpx" :src="data.pic" :radius="6"></up-image>
<!-- <image mode="aspectFill" :src="data.pic" class="img"></image> -->
<view class=" u-p-l-16 u-flex u-p-r-16 u-flex-1 u-col-top"> <view class=" u-p-l-16 u-flex u-p-r-16 u-flex-1 u-col-top">
<view class="u-flex-1"> <view class="u-flex-1">
<view class="color-333 font-bold">{{data.name}}</view> <view class="color-333 font-bold">{{data.name}}</view>
@ -24,7 +25,7 @@
</view> </view>
<view class="u-m-t-24 u-flex u-row-between"> <view class="u-m-t-24 u-flex u-row-between">
<view > <view>
<!-- <template v-if="data.childrenList.length"> <!-- <template v-if="data.childrenList.length">
<view class="u-flex color-999 u-flex u-col-center" @tap="useTypeClick"> <view class="u-flex color-999 u-flex u-col-center" @tap="useTypeClick">
<text class="u-font-24">{{computedUserType}} </text> <text class="u-font-24">{{computedUserType}} </text>
@ -33,16 +34,19 @@
</view> </view>
</view> </view>
</template> --> </template> -->
<view class="u-flex"> <view class="u-flex">
<view class="u-m-r-18 color-999">开关</view> <view class="u-m-r-18 color-999">是否启用</view>
<my-switch v-model="isShow" @change="isShowChange"></my-switch> <my-switch v-model="isShow" @change="isShowChange"></my-switch>
</view> </view>
</view> </view>
<view class="u-m-t-24 u-flex u-row-right">
<view class="u-flex no-wrap">
<view class="btn-default btn" @click="del">删除</view> <view class="btn-default btn" @click="del">删除</view>
<view class="btn-primary btn u-m-l-38" @click="toEdit">编辑</view> <view class="btn-primary btn u-m-l-38" @click="toEdit">编辑</view>
</view> </view>
<!-- <view class="u-flex no-wrap">
<view class="btn-default btn" @click="del">删除</view>
<view class="btn-primary btn u-m-l-38" @click="toEdit">编辑</view>
</view> -->
</view> </view>
</view> </view>
@ -61,7 +65,7 @@
ColorMain ColorMain
} from '@/commons/color.js' } from '@/commons/color.js'
const emits = defineEmits(['radioClick', 'changeClick', 'useTypeClick', 'del','isShowChange']) const emits = defineEmits(['radioClick', 'changeClick', 'useTypeClick', 'del', 'isShowChange'])
const props = defineProps({ const props = defineProps({
index: { index: {
@ -71,7 +75,7 @@
type: Object, type: Object,
default: () => { default: () => {
return { return {
isShow:true isShow: true
} }
} }
}, },
@ -80,13 +84,17 @@
default: false default: false
} }
}) })
let isShow=ref(props.data.isShow) let isShow = ref(props.data.isShow)
watch(()=>props.data.isShow,(newval)=>{ watch(() => props.data.isShow, (newval) => {
isShow.value=newval isShow.value = newval
}) })
function isShowChange(){
function isShowChange() {
console.log(isShow.value); console.log(isShow.value);
emits('isShowChange',{...props.data,isShow:isShow.value}) emits('isShowChange', {
...props.data,
isShow: isShow.value
})
} }
const computedUserType = computed(() => { const computedUserType = computed(() => {
const len = props.data.useTypes.length const len = props.data.useTypes.length
@ -132,7 +140,7 @@
//type edittype //type edittype
function toEdit() { function toEdit() {
uni.setStorageSync('cateItem',props.data) uni.setStorageSync('cateItem', props.data)
go.to('PAGES_CATEGORY_EDIT', { go.to('PAGES_CATEGORY_EDIT', {
type: 'edit', type: 'edit',
}) })
@ -144,19 +152,19 @@
$price-color: #F02C45; $price-color: #F02C45;
.btn { .btn {
padding: 10rpx 40rpx; padding: 6rpx 28rpx;
border-radius: 100rpx; border-radius: 100rpx;
border: 2rpx solid transparent; font-size: 24rpx;
border: 1px solid transparent;
} }
.btn-primary { .btn-primary {
border-color: $my-main-color; border-color: $my-main-color;
;
color: $my-main-color; color: $my-main-color;
} }
.btn-default { .btn-default {
border-color: #F4F4F4; border-color: #999;
color: #999; color: #999;
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="safe-page min-page"> <view class="safe-page min-page">
<up-sticky> <up-sticky>
<view class="bg-fff u-p-l-30 u-p-r-30 u-p-b-30"> <view class="bg-fff u-p-l-30 u-p-b-24">
<!-- <view class="myTabs "> <!-- <view class="myTabs ">
<myTabs :list="tabsList" @change="tabsChange"></myTabs> <myTabs :list="tabsList" @change="tabsChange"></myTabs>
</view> --> </view> -->
@ -20,7 +20,9 @@
<image src="@/static/iconImg/icon-search.svg" class="input-icon" /> <image src="@/static/iconImg/icon-search.svg" class="input-icon" />
</template> </template>
</uni-easyinput> </uni-easyinput>
<button type="text" @click="searchFunc">搜索</button> <view class="u-m-l-4">
<button type="text" @click="searchFunc"><text class="color-333">搜索</text></button>
</view>
</view> </view>
</view> </view>
<view class="u-flex states1 u-row-between u-font-28"> <view class="u-flex states1 u-row-between u-font-28">

View File

@ -5,10 +5,12 @@
<uni-forms :model="category" :rules="rules" err-show-type="toast" ref="form" :border="true" <uni-forms :model="category" :rules="rules" err-show-type="toast" ref="form" :border="true"
label-position="top" label-width="350"> label-position="top" label-width="350">
<view class="block"> <view class="block">
<view class=""> <view class="input-padding-b-0 ">
<uni-forms-item label="分类名称" required name="name"> <uni-forms-item label="分类名称" required name="name">
<uni-easyinput paddingNone :placeholderStyle="placeholderStyle" <view class="u-m-t-16 u-m-b-24">
:inputBorder="inputBorder" v-model="category.name" placeholder="输入分类名称" /> <uni-easyinput paddingNone :placeholderStyle="placeholderStyle"
:inputBorder="inputBorder" v-model="category.name" placeholder="输入分类名称" />
</view>
</uni-forms-item> </uni-forms-item>
</view> </view>
<template v-if="option.type=='edit'"> <template v-if="option.type=='edit'">
@ -53,7 +55,9 @@
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="分组排序" required name="name"> <uni-forms-item label="分组排序" required name="name">
<uni-number-box :value="category.sort" /> <view class="u-m-t-24">
<uni-number-box :value="category.sort" />
</view>
</uni-forms-item> </uni-forms-item>
</view> </view>
</uni-forms> </uni-forms>
@ -547,13 +551,26 @@
.lh40 { .lh40 {
line-height: 40rpx; line-height: 40rpx;
} }
::v-deep .uni-forms-item.is-direction-top .uni-forms-item__label{
padding: 0;
}
::v-deep .uni-forms-item{
min-height: inherit;
}
::v-deep .input-padding-b-0 .uni-forms-item--border{
padding-bottom: 0;
padding-top: 0;
}
::v-deep .uni-forms-item--border{
padding-top: 12px;
padding-bottom: 16px;
}
.box { .box {
font-size: 28rpx; font-size: 28rpx;
.block { .block {
background: #FFFFFF; background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx; border-radius: 12rpx 18rpx 0 18rpx;
padding: 12rpx 24rpx; padding: 12rpx 24rpx;
margin-bottom: 32rpx; margin-bottom: 32rpx;
} }
@ -561,6 +578,8 @@
.save-btn-box { .save-btn-box {
position: fixed; position: fixed;
font-size: 16px;
font-weight: 700;
left: 30rpx; left: 30rpx;
right: 30rpx; right: 30rpx;
bottom: 60rpx; bottom: 60rpx;

View File

@ -19,7 +19,7 @@
<!-- 删除弹窗 --> <!-- 删除弹窗 -->
<my-model desc="请确保此分类下没有任何商品确认删除?" ref="delModel" @confirm="delModelConfirm"></my-model> <my-model desc="请确保此分类下没有任何商品确认删除?" ref="delModel" @confirm="delModelConfirm"></my-model>
<view class="fixed-b"> <view class="fixed-b">
<my-button :height="80" shape="circle" showShadow @tap="toAddCategory">新建分组</my-button> <my-button :height="80" shape="circle" font-weight="700" @tap="toAddCategory">新建分组</my-button>
</view> </view>
</view> </view>

View File

@ -44,11 +44,10 @@
const emits = defineEmits(['update:modelValue'], ) const emits = defineEmits(['update:modelValue'], )
const selText = computed(() => { const selText = computed(() => {
const item = props.list.filter(ele => ele.value == props.modelValue)[0] const item = props.list.filter(ele => ele.value == props.modelValue)[0]
if (item) { if(!item){
return item.name
} else {
return '' return ''
} }
return item.name
}) })
watch(() => index.value, (newval) => { watch(() => index.value, (newval) => {

View File

@ -10,27 +10,31 @@
<uni-forms :model="FormData" :rules="rules" :border="true" label-position="top" <uni-forms :model="FormData" :rules="rules" :border="true" label-position="top"
err-show-type="toast" validateTrigger="submit" label-width="350" ref="Forms"> err-show-type="toast" validateTrigger="submit" label-width="350" ref="Forms">
<view class="block"> <view class="block">
<uni-forms-item label="商品类型" required showRequired> <view class="border-top-0">
<up-radio-group v-model="FormData.typeEnum" placement="row"> <uni-forms-item label="商品类型" required showRequired>
<up-radio :customStyle="{marginRight: '30px'}" <up-radio-group v-model="FormData.typeEnum" placement="row">
v-for="(item, index) in pageData.types" :key="index" :label="item.name" <up-radio :customStyle="{marginRight: '30px'}"
:name="item.value"> v-for="(item, index) in pageData.types" :key="index" :label="item.name"
</up-radio> :name="item.value">
</up-radio-group> </up-radio>
<!-- <view class="u-flex u-flex-wrap types " :class="{disabled:option.productId!==''}"> </up-radio-group>
<view class="item" @tap="changeFormData('typeEnum',item.value)" <!-- <view class="u-flex u-flex-wrap types " :class="{disabled:option.productId!==''}">
:class="{active:FormData.typeEnum===item.value}" <view class="item" @tap="changeFormData('typeEnum',item.value)"
v-for="(item,index) in pageData.types" :key="index"> :class="{active:FormData.typeEnum===item.value}"
<view class="title">{{item.title}}</view> v-for="(item,index) in pageData.types" :key="index">
<view class="u-font-24 color-999 u-m-t-10"> <view class="title">{{item.title}}</view>
{{item.desc}} <view class="u-font-24 color-999 u-m-t-10">
{{item.desc}}
</view>
</view> </view>
</view> </view> -->
</view> -->
</uni-forms-item>
</view>
</uni-forms-item>
<uni-forms-item ref="fileItem" label="图片" required showRequired> <uni-forms-item ref="fileItem" label="图片" required showRequired>
<my-upload-file ref="refFile" :images="FormData.images"></my-upload-file> <my-upload-file ref="refFile" :images="FormData.images"
:imageStyles="imageStyles"></my-upload-file>
<view class="u-m-t-16 color-999 u-font-24"> <view class="u-m-t-16 color-999 u-font-24">
:第一张图为商品封面图图片尺寸为750x750 :第一张图为商品封面图图片尺寸为750x750
</view> </view>
@ -39,7 +43,7 @@
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle" <uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
:inputBorder="inputBorder" v-model="FormData.name" placeholder="请输入商品名称" /> :inputBorder="inputBorder" v-model="FormData.name" placeholder="请输入商品名称" />
</uni-forms-item> </uni-forms-item>
<view class="border-top-0"> <view class="">
<uni-forms-item label="商品描述"> <uni-forms-item label="商品描述">
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle" <uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
type="textarea" v-model="FormData.shortTitle" placeholder="请填写商品简述" /> type="textarea" v-model="FormData.shortTitle" placeholder="请填写商品简述" />
@ -109,7 +113,7 @@
</template> </template>
</view> </view>
<template v-if="FormData.typeEnum=='sku' "> <template v-if="FormData.typeEnum=='sku' ">
<view class="block border-top-0"> <view class="block border-top-0 u-p-t-0">
<uni-forms-item label=" "> <uni-forms-item label=" ">
<view class="u-flex u-row-between " @tap="toGuige"> <view class="u-flex u-row-between " @tap="toGuige">
<view class="color-333 font-bold"> <view class="color-333 font-bold">
@ -120,17 +124,17 @@
</view> </view>
</uni-forms-item> </uni-forms-item>
<template v-if="skuList.list.length"> <template v-if="skuList.list.length">
<view class="u-text-center"> <view class="u-text-left">
<view class="u-flex font-bold u-m-b-12"> <view class="u-flex font-bold u-m-b-12">
<view class="u-flex-1 u-text-left">组合名称</view> <view class="u-flex-1 ">组合名称</view>
<view class="u-flex-1">售价</view> <view class="u-flex-1 ">售价</view>
<view class="u-flex-1">库存数量</view> <!-- <view class="u-flex-1">库存数量</view> -->
</view> </view>
<view class="u-flex u-p-b-12 u-p-t-12" v-for="(item,index) in skuList.list" <view class="u-flex u-p-b-12 u-p-t-12" v-for="(item,index) in skuList.list"
:key="index"> :key="index">
<view class="u-flex-1 u-text-left">{{item.specSnap}}</view> <view class="u-flex-1 ">{{item.specSnap}}</view>
<view class="u-flex-1">{{item.salePrice}}</view> <view class="u-flex-1 ">{{item.salePrice}}</view>
<view class="u-flex-1">{{item.stockNumber||0}}</view> <!-- <view class="u-flex-1">{{item.stockNumber||0}}</view> -->
</view> </view>
</view> </view>
@ -390,7 +394,7 @@
</template> </template>
<template v-if="FormData.typeEnum!='group'"> <template v-if="FormData.typeEnum!='group'">
<view class="block"> <view class="block ">
<!-- <view class="border-top-0"> <!-- <view class="border-top-0">
<uni-forms-item label="上架区域"> <uni-forms-item label="上架区域">
<view class="u-flex"> <view class="u-flex">
@ -420,13 +424,13 @@
<template v-if="FormData.isStock"> <template v-if="FormData.isStock">
<view class="u-relative"> <view class="u-relative">
<uni-forms-item label="库存数量"> <uni-forms-item label="库存数量">
<uni-easyinput <uni-easyinput @blur="priceFormat(FormData,'stockNumber')"
@blur="priceFormat(FormData,'stockNumber')" :paddingNone="inputPaddingNone" :disabled="disabledStock"
:paddingNone="inputPaddingNone" :disabled="disabledStock"
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder" :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
v-model="FormData.stockNumber" type="digit" placeholder="请输入库存数量" /> v-model="FormData.stockNumber" type="digit" placeholder="请输入库存数量" />
</uni-forms-item> </uni-forms-item>
<view class="u-absolute position-all" v-if="disabledStock" @click="canEditGoodsStock(true)"> <view class="u-absolute position-all" v-if="disabledStock"
@click="canEditGoodsStock(true)">
</view> </view>
</view> </view>
</template> </template>
@ -437,13 +441,13 @@
<my-switch v-model="FormData.isHot"></my-switch> <my-switch v-model="FormData.isHot"></my-switch>
</view> </view>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label=""> <!-- <uni-forms-item label="">
<view class="u-flex u-row-between"> <view class="u-flex u-row-between">
<view class="label-title">标签打印</view> <view class="label-title">标签打印</view>
<my-switch v-model="FormData.enableLabel"></my-switch> <my-switch v-model="FormData.enableLabel"></my-switch>
</view> </view>
<view class="color-999 u-m-t-16 u-font-24">开启后: 收银完成后会自动打印对应数量的标签数</view> <view class="color-999 u-m-t-16 u-font-24">开启后: 收银完成后会自动打印对应数量的标签数</view>
</uni-forms-item> </uni-forms-item> -->
<uni-forms-item label="打包费"> <uni-forms-item label="打包费">
<uni-easyinput @blur="priceFormat(FormData,'packFee')" <uni-easyinput @blur="priceFormat(FormData,'packFee')"
:paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle" :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
@ -572,7 +576,13 @@
watch, watch,
nextTick nextTick
} from 'vue'; } from 'vue';
const imageStyles = reactive({
width: 82,
height: 82,
border: {
radius: '4px'
}
})
async function upDateGoods(par) { async function upDateGoods(par) {
const res = await $updateProductData([{ const res = await $updateProductData([{
id: FormData.id, id: FormData.id,
@ -1385,7 +1395,7 @@
if (suit <= 0) { if (suit <= 0) {
return infoBox.showToast('起售数量不能小于0') return infoBox.showToast('起售数量不能小于0')
} }
if(stockNumber===''){ if (stockNumber === '') {
return infoBox.showToast('请输入库存数量!') return infoBox.showToast('请输入库存数量!')
} }
} }
@ -1404,9 +1414,20 @@
// //
if (option.type === 'edit') { if (option.type === 'edit') {
return $updateProduct(submitData).then(res => { return $updateProduct(submitData).then(res => {
infoBox.showSuccessToast('更新成功') $updateProductData([{
settimeoutBack(1500) id: FormData.id,
isSku: 0,
shopId: uni.getStorageSync('shopId'),
key: 'grounding',
value: FormData.isGrounding
}]).then(() => {
infoBox.showSuccessToast('更新成功')
settimeoutBack(1500)
})
}) })
} }
submitData.selectSpec = submitData.selectSpec =
$addProduct(submitData).then(res => { $addProduct(submitData).then(res => {
@ -1474,7 +1495,7 @@
uni.setStorageSync('guige', FormData.specificationsGroup) uni.setStorageSync('guige', FormData.specificationsGroup)
go.to('PAGES_PRODUCT_GUIGE_CHOOSE', { go.to('PAGES_PRODUCT_GUIGE_CHOOSE', {
emitName: 'emitspecificationsSave', emitName: 'emitspecificationsSave',
type:option.type, type: option.type,
productId: option.productId productId: option.productId
}) })
// go.to('PAGES_PRODUCT_GUIGE_ADD', { // go.to('PAGES_PRODUCT_GUIGE_ADD', {
@ -1619,6 +1640,9 @@
onReady(() => { onReady(() => {
Forms.value && Forms.value.setRules(rules) Forms.value && Forms.value.setRules(rules)
}) })
onBeforeUnmount(() => {
clearTimeout(timer)
})
</script> </script>
<style scoped> <style scoped>
page { page {
@ -1639,6 +1663,11 @@
// z-index: 999; // z-index: 999;
} }
::v-deep .uni-forms-item--border {
padding-top: 12px;
padding-bottom: 12px;
}
.stick-bottom { .stick-bottom {
top: 0; top: 0;
z-index: 10; z-index: 10;
@ -1694,12 +1723,12 @@
} }
.box { .box {
margin-top: 36rpx; margin-top: 32rpx;
font-size: 28rpx; font-size: 28rpx;
.block { .block {
background: #FFFFFF; background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx; border-radius: 8rpx 18rpx 8rpx 18rpx;
padding: 12rpx 24rpx; padding: 12rpx 24rpx;
margin-bottom: 32rpx; margin-bottom: 32rpx;
} }

View File

@ -3,12 +3,12 @@
<view class="default-box-padding bg-fff border-r-18"> <view class="default-box-padding bg-fff border-r-18">
<view class="u-flex u-row-between"> <view class="u-flex u-row-between">
<view>商品名称</view> <view>商品名称</view>
<template v-if="isSku"> <!-- <template v-if="isSku"> -->
<view class="u-flex u-font-24 color-666"> <view class="u-flex u-font-24 color-666">
<view class="u-m-r-20">绑定至规格</view> <view class="u-m-r-20">绑定至规格</view>
<up-switch :size="18" v-model="isBindGuige" :disabled="!isSku">绑定至规格</up-switch> <up-switch :size="18" v-model="isBindGuige" :disabled="!isSku">绑定至规格</up-switch>
</view> </view>
</template> <!-- </template> -->
</view> </view>
<view class="border-bottom u-m-t-16 u-p-b-32">{{goods.name}}</view> <view class="border-bottom u-m-t-16 u-p-b-32">{{goods.name}}</view>
<view class=""> <view class="">
@ -41,7 +41,7 @@
</view> </view>
<view class="u-flex input"> <view class="u-flex input">
<up-input border="none" v-model="item.surplusStock"></up-input> <up-input border="none" v-model="item.surplusStock"></up-input>
<up-icon @click="delGuigeHaocao(index,haocaiIndex)" color="#EB4F4F" <up-icon @click="delGuigeHaocao(index,haocaiIndex)" color="#EA4025"
:size="16" name="minus-circle-fill"></up-icon> :size="16" name="minus-circle-fill"></up-icon>
</view> </view>
</view> </view>
@ -101,7 +101,7 @@
<view class="u-flex-1 "> <view class="u-flex-1 ">
<view class="u-flex input"> <view class="u-flex input">
<up-input border="none" v-model="item.surplusStock"></up-input> <up-input border="none" v-model="item.surplusStock"></up-input>
<up-icon @click="delHaocai(index)" color="#EB4F4F" :size="16" <up-icon @click="delHaocai(index)" color="#EA4025" :size="16"
name="minus-circle-fill"></up-icon> name="minus-circle-fill"></up-icon>
</view> </view>
</view> </view>
@ -140,7 +140,7 @@
</view> --> </view> -->
</view> </view>
<view class="bottom"> <view class="bottom">
<my-button type="primary" shape="circle" @click="save">保存</my-button> <my-button type="primary" shape="circle" font-weight="700" font-size="32" @click="save">保存</my-button>
<my-button bgColor="#F9F9F9" shape="circle" color="#999" @click="cancel">取消</my-button> <my-button bgColor="#F9F9F9" shape="circle" color="#999" @click="cancel">取消</my-button>
</view> </view>

View File

@ -13,8 +13,8 @@
</uni-data-picker> </uni-data-picker>
</uni-forms-item> </uni-forms-item>
</view> </view>
<view class=""> <view class="u-p-b-20">
<view class="u-m-t-32" v-for="(item,index) in FormData.selectSpec" :key="index"> <view class="u-m-t-12" v-for="(item,index) in FormData.selectSpec" :key="index">
<view class="font-bold"> <view class="font-bold">
{{item.name}} {{item.name}}
@ -39,7 +39,7 @@
validateTrigger="blur" :border="true" :label-width="130"> validateTrigger="blur" :border="true" :label-width="130">
<view class=""> <view class="">
<view class="u-m-t-16" v-for="(val,key) in item.names" :key="key"> <view class="u-m-t-20" v-for="(val,key) in item.names" :key="key">
<text class="font-bold u-m-r-12"> <text class="font-bold u-m-r-12">
{{key}} {{key}}
</text> </text>
@ -398,31 +398,31 @@
salePrice: { salePrice: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '必填' errorMessage: '售价必填'
}] }]
}, },
memberPrice: { memberPrice: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '必填' errorMessage: '会员价必填'
}] }]
}, },
costPrice: { costPrice: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '必填' errorMessage: '成本价必填'
}] }]
}, },
originPrice: { originPrice: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '必填' errorMessage: '原价必填'
}] }]
}, },
suit: { suit: {
rules: [{ rules: [{
required: true, required: true,
errorMessage: '必填' errorMessage: '起售数量必填'
}, },
{ {
validateFunction: function(rule, value, data, callback) { validateFunction: function(rule, value, data, callback) {

View File

@ -81,13 +81,13 @@
{ {
text: '起售数量', text: '起售数量',
key: 'suit', key: 'suit',
value: '' value: 1
},
{
text: '库存数量',
key: 'stockNumber',
value: ''
}, },
// {
// text: '',
// key: 'stockNumber',
// value: ''
// },
{ {
text: '分销金额', text: '分销金额',
key: 'firstShared', key: 'firstShared',

View File

@ -9,7 +9,7 @@
</view> </view>
<view class="u-m-t-48"> <view class="u-m-t-48">
<view>商品名称</view> <view>商品名称</view>
<view class="u-m-t-16">{{data.name}}</view> <view class="u-m-t-16 color-999" style="">{{data.name}}</view>
<view class="u-m-t-38"> <view class="u-m-t-38">
<view class="u-m-b-32"> <view class="u-m-b-32">
<view class="u-flex "> <view class="u-flex ">
@ -129,6 +129,9 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .u-m-t-16 .u-textarea{
border-width: 1px!important;
}
.box { .box {
width: 556rpx; width: 556rpx;
border-radius: 18rpx 18rpx 18rpx 18rpx; border-radius: 18rpx 18rpx 18rpx 18rpx;

View File

@ -2,7 +2,7 @@
<view class="control" :style="getComputedStyle()"> <view class="control" :style="getComputedStyle()">
<view class="u-flex control1" v-if="showControl1"> <view class="u-flex control1" v-if="showControl1">
<!-- <view class="btn" @click="changeShowControl1">批量管理</view> --> <!-- <view class="btn" @click="changeShowControl1">批量管理</view> -->
<view class="btn" @tap="go.to('PAGES_PRODUCT_ADD')">商品添加</view> <view class="btn add" @tap="go.to('PAGES_PRODUCT_ADD')">商品添加</view>
<!-- <view class="color-999 btn u-flex u-row-center" @click="emitToggleCategory"> <!-- <view class="color-999 btn u-flex u-row-center" @click="emitToggleCategory">
<text class="u-m-r-10">{{categoryName||'选择分类'}}</text> <text class="u-m-r-10">{{categoryName||'选择分类'}}</text>
<view class="arrow-down" :class="{'up':categoryShow}"> <view class="arrow-down" :class="{'up':categoryShow}">
@ -96,7 +96,11 @@
.scale7 { .scale7 {
transform: scale(0.7); transform: scale(0.7);
} }
.add{
background-color: $my-main-color;
border-radius: 100rpx;
overflow: hidden;
}
.borde-r { .borde-r {
position: relative; position: relative;
@ -119,6 +123,7 @@
z-index: 100; z-index: 100;
background: #3E3A3A; background: #3E3A3A;
border-radius: 100rpx; border-radius: 100rpx;
overflow: hidden;
.btn{ .btn{
color: #fff; color: #fff;
} }

View File

@ -74,7 +74,7 @@
}], }],
}) })
// //
const isPauseSale = ref(false) const isPauseSale = ref(0)
// //
const isGrounding = ref(1) const isGrounding = ref(1)
const data = ref(props.goods) const data = ref(props.goods)
@ -88,7 +88,7 @@
if (newval) { if (newval) {
console.log(props.goods); console.log(props.goods);
data.value = props.goods data.value = props.goods
isPauseSale.value = props.goods.isPauseSale ? true : false isPauseSale.value = props.goods.isPauseSale
isGrounding.value = props.goods.isGrounding isGrounding.value = props.goods.isGrounding
} }
}) })

View File

@ -125,6 +125,7 @@
import { import {
$tbShopUnit,$getProductStockDetail $tbShopUnit,$getProductStockDetail
} from '@/http/yskApi/goods.js' } from '@/http/yskApi/goods.js'
import go from '@/commons/utils/go.js'
const refForm = ref(null) const refForm = ref(null)
const props = defineProps({ const props = defineProps({
show: { show: {
@ -152,6 +153,9 @@
] ]
}) })
function toRecodes(){ function toRecodes(){
go.to('PAGES_PRODUCT_INVOICING_LIST',{
productId:props.goods.id
})
} }
function changeShowRecoders(show) { function changeShowRecoders(show) {
recoders.show = show recoders.show = show
@ -259,6 +263,6 @@
} }
.number { .number {
color: #EE4646; color: #F0465B;
} }
</style> </style>

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="safe-page"> <view class="safe-page">
<up-sticky> <up-sticky>
<view class="bg-fff u-p-l-30 u-p-r-30 u-p-b-30"> <view class="bg-fff u-p-l-30 u-p-b-30">
<!-- <view class="myTabs "> <!-- <view class="myTabs ">
<myTabs :list="tabsList" @change="tabsChange"></myTabs> <myTabs :list="tabsList" @change="tabsChange"></myTabs>
</view> --> </view> -->
@ -21,10 +21,12 @@
<image src="@/static/iconImg/icon-search.svg" class="input-icon" /> <image src="@/static/iconImg/icon-search.svg" class="input-icon" />
</template> </template>
</uni-easyinput> </uni-easyinput>
<button type="text" @click="searchFunc()">搜索</button> <view class="u-m-l-4">
<button class="" type="text" @click="searchFunc()"> <text class="color-333">搜索</text></button>
</view>
</view> </view>
</view> </view>
<view class="u-flex states1 u-row-between u-font-28"> <view class="u-flex states1 u-row-between u-p-r-28 u-font-28">
<view class="u-flex"> <view class="u-flex">
<view class="u-p-l-16 item u-p-r-16 u-p-t-6 u-p-b-6 tranistion u-text-center color-333" <view class="u-p-l-16 item u-p-r-16 u-p-t-6 u-p-b-6 tranistion u-text-center color-333"
:class="{'active':pageData.stateCurrent==index}" @tap="statesTableClick(index)" :class="{'active':pageData.stateCurrent==index}" @tap="statesTableClick(index)"

View File

@ -4,14 +4,14 @@
<view>#{{index+1}} {{data.name}}</view> <view>#{{index+1}} {{data.name}}</view>
<view class="color-666 u-font-24 id">ID:{{data.id}}</view> <view class="color-666 u-font-24 id">ID:{{data.id}}</view>
</view> </view>
<view class="u-m-t-16 color-666 u-font-24 u-p-b-20 border-bottom"> <view class="u-m-t-16 color-666 u-font-24 u-p-b-24 border-bottom">
添加时间 添加时间
<uni-dateformat :date="data.createdAt"></uni-dateformat> <uni-dateformat :date="data.createdAt"></uni-dateformat>
</view> </view>
<view class="u-m-t-20"> <view class="u-m-t-24">
<view v-for="(spec,specIndex) in data.specList" :key="specIndex"> <view v-for="(spec,specIndex) in data.specList" :key="specIndex">
<view class="font-bold"> {{spec.name}}</view> <view class="font-bold " :class="{'u-m-t-32':specIndex>0}"> {{spec.name}}</view>
<view class="u-m-t-16 bg-gray u-flex u-flex-wrap options u-p-20"> <view class="u-m-t-24 bg-gray u-flex u-flex-wrap options u-p-24">
<view class="u-flex option" v-for="(option,optionIndex) in spec.value" :key="optionIndex" @tap="statusClick(optionIndex)"> <view class="u-flex option" v-for="(option,optionIndex) in spec.value" :key="optionIndex" @tap="statusClick(optionIndex)">
{{option}} {{option}}
<!-- <view class="sellout" v-if="option.sellOut">已售罄</view> <!-- <view class="sellout" v-if="option.sellOut">已售罄</view>
@ -70,13 +70,13 @@ import { reactive, ref } from 'vue';
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.btns{ .btns{
gap: 0 20rpx; gap: 0 20rpx;
} }
.item{ .item{
background: #FFFFFF; background: #FFFFFF;
padding: 30rpx; padding: 32rpx 24rpx;
border-radius: 18rpx 18rpx 18rpx 18rpx; border-radius: 18rpx 18rpx 18rpx 18rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
.id{ .id{
@ -87,9 +87,10 @@ import { reactive, ref } from 'vue';
.options{ .options{
gap: 10rpx 50rpx; gap: 10rpx 50rpx;
.option{ .option{
padding: 24rpx 40rpx; padding: 12rpx 40rpx;
background: #F0F2F5; background: #F0F2F5;
border-radius: 4rpx; border-radius: 4rpx;
font-size: 24rpx;
position: relative; position: relative;
color: #666; color: #666;
overflow: hidden; overflow: hidden;

View File

@ -46,11 +46,12 @@
uni.hideTabBar() uni.hideTabBar()
onLoad((options) => {}); onLoad((options) => {});
// //
const navList = [{ const navList = [
title: '收银', // {
icon: '/static/indexImg/icon-cashier.svg', // title: '',
pageUrl: 'PAGES_QUICK_PAY', // icon: '/static/indexImg/icon-cashier.svg',
}, // pageUrl: 'PAGES_QUICK_PAY',
// },
{ {
title: '销售汇总', title: '销售汇总',
icon: '/static/indexImg/PAGE_SALES_SUMMARY.svg', icon: '/static/indexImg/PAGE_SALES_SUMMARY.svg',

View File

@ -23,7 +23,7 @@
</view> </view>
<view class="list "> <view class="list ">
<view class="u-m-t-32 bg-fff box bg-fff"> <view class=" bg-fff box bg-fff">
<view class="u-flex item u-row-between" v-for="(item,index) in tables.list" :key="index" <view class="u-flex item u-row-between" v-for="(item,index) in tables.list" :key="index"
@tap="chooseTable(index,item)"> @tap="chooseTable(index,item)">
<view class="u-flex"> <view class="u-flex">
@ -219,16 +219,17 @@
} }
.area { .area {
padding: 2px 28rpx 24rpx 10px; padding: 2px 28rpx 24rpx 28rpx;
} }
.scale7 { .scale7 {
transform: scale(0.7); transform: scale(0.7);
} }
::v-deep .uni-searchbar{
padding: 0!important;
}
.search { .search {
padding-right: 28rpx; padding: 20rpx 28rpx 20rpx 28rpx;
.icon-saoma { .icon-saoma {
margin-left: 20rpx; margin-left: 20rpx;
width: 34rpx; width: 34rpx;
@ -238,7 +239,6 @@
.list { .list {
padding: 32rpx 24rpx; padding: 32rpx 24rpx;
.no-choose { .no-choose {
padding: 36rpx 30rpx 36rpx 24rpx; padding: 36rpx 30rpx 36rpx 24rpx;
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<my-model ref="model" :title="title" iconColor="#000" @close="resetForm"> <my-model ref="model" :title="title" iconColor="#000" @close="resetForm">
<template #desc> <template #desc>
<view class="u-text-left u-p-30 "> <view class="u-text-left u-p-l-30 u-p-r-30 u-p-t-30 ">
<view class="u-m-t-32 u-flex "> <view class="u-m-t-32 u-flex ">
<uni-easyinput type="textarea" v-model="form.remark" placeholder="自定义内容"></uni-easyinput> <uni-easyinput type="textarea" v-model="form.remark" placeholder="自定义内容"></uni-easyinput>
</view> </view>
@ -15,9 +15,9 @@
</view> </view>
</template> </template>
<template #btn> <template #btn>
<view class="u-p-30"> <view class="u-p-l-30 u-p-r-30 u-m-t-28 u-p-b-30">
<view class="u-m-t-10"> <view class="">
<my-button @tap="confirm" shape="circle" showShadow>确认</my-button> <my-button @tap="confirm" shape="circle" fontWeight="700">确认</my-button>
<view class="u-m-t-10"> <view class="u-m-t-10">
<my-button type="cancel" bgColor="#fff" @tap="confirm">取消</my-button> <my-button type="cancel" bgColor="#fff" @tap="confirm">取消</my-button>
</view> </view>

View File

@ -130,7 +130,7 @@
</view> </view>
<view class="goods u-m-t-32"> <view class="goods u-m-t-32">
<view class="item u-p-b-32" @click="changeGoodsSel(index)" v-for="(item,index) in goods.list" <view class="item u-m-b-48" @click="changeGoodsSel(index)" v-for="(item,index) in goods.list"
:key="index"> :key="index">
<view class="u-flex u-row-between "> <view class="u-flex u-row-between ">
<view class="u-flex"> <view class="u-flex">
@ -197,7 +197,6 @@
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<view class="border-top u-m-t-48 " v-if="index==goods.sel"></view>
</view> </view>
</view> </view>
<view class="border-bottom"> <view class="border-bottom">
@ -245,7 +244,7 @@
<view class="btn "> <view class="btn ">
<my-button shape="circle" @click="createOrder"> <my-button shape="circle" @click="createOrder">
<view class="font-bold u-font-32"> <view class="font-bold u-font-32">
{{$shop.registerType=='munchies'?'结算': '下单'}} {{($shop.registerType=='munchies'||eatTypes.active=='takeout')?'结算': '下单'}}
</view> </view>
</my-button> </my-button>
</view> </view>
@ -366,6 +365,7 @@
isPack,isGift isPack,isGift
} = item } = item
const par = { const par = {
cartId:id,
isPack, isPack,
isGift, isGift,
masterId: option.masterId, masterId: option.masterId,
@ -375,7 +375,7 @@
skuId skuId
} }
par[key] = !item[key] par[key] = !item[key]
const res = await Api.addCart(par) const res = await Api.$updateCart(par)
goods.list[index][key] = returnBoolean(res[key]) goods.list[index][key] = returnBoolean(res[key])
if(key=='isPack'){ if(key=='isPack'){
getCart() getCart()
@ -469,8 +469,7 @@
sel: 0 sel: 0
}) })
const goodsNumber = computed(() => { const goodsNumber = computed(() => {
let result = 0 const result = goods.list.reduce((prve, cur) => {
result = goods.list.reduce((prve, cur) => {
return prve + cur.number return prve + cur.number
}, 0) }, 0)
return result return result
@ -567,7 +566,7 @@
uni.$emit('update:createOrderIndex') uni.$emit('update:createOrderIndex')
console.log($shop.value); console.log($shop.value);
console.log(res); console.log(res);
if ($shop.value.registerType == 'munchies') { if ($shop.value.registerType == 'munchies'||eatTypes.active=='takeout') {
// //
return go.to('PAGES_ORDER_PAY', { return go.to('PAGES_ORDER_PAY', {
orderId: res.id, orderId: res.id,
@ -716,9 +715,8 @@
} }
.goods { .goods {
padding-bottom: 30rpx; // padding-bottom: 30rpx;
border-bottom: 1px dashed #E5E5E5; border-bottom: 1px dashed #E5E5E5;
.item { .item {
.img { .img {
width: 84rpx; width: 84rpx;

View File

@ -19,7 +19,7 @@
</image> </image>
</view> </view>
</view> </view>
<template v-if="type&&userShow"> <!-- <template v-if="type&&userShow">
<view class="u-p-l-28 u-flex u-p-r-28 u-p-t-10 bg-gray" v-if="userShow"> <view class="u-p-l-28 u-flex u-p-r-28 u-p-t-10 bg-gray" v-if="userShow">
<view class="time-area u-font-24 color-main u-flex"> <view class="time-area u-font-24 color-main u-flex">
<up-avatar :size="22" :src="user.headImg"></up-avatar> <up-avatar :size="22" :src="user.headImg"></up-avatar>
@ -39,16 +39,16 @@
<up-icon name="close-circle-fill" :color="color.ColorMain" @click="userShowClose"></up-icon> <up-icon name="close-circle-fill" :color="color.ColorMain" @click="userShowClose"></up-icon>
</view> </view>
</view> </view>
</template> </template> -->
<view class="u-p-l-28 u-flex u-p-r-28 u-p-t-10 bg-gray" v-if="time.length"> <!-- <view class="u-p-l-28 u-flex u-p-r-28 u-p-t-10 bg-gray" v-if="time.length">
<view class="time-area u-font-24 color-main u-flex"> <view class="time-area u-font-24 color-main u-flex">
<uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="time[0]"></uni-dateformat> <uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="time[0]"></uni-dateformat>
<text class="u-p-l-10 u-p-r-10"></text> <text class="u-p-l-10 u-p-r-10"></text>
<uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="time[1]"></uni-dateformat> <uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="time[1]"></uni-dateformat>
</view> </view>
</view> </view> -->
<my-date-pickerview @confirm="datePickerConfirm" ref="datePicker"></my-date-pickerview> <my-date-pickerview @confirm="datePickerConfirm" ref="datePicker"></my-date-pickerview>
<!-- 更多状态选择筛选 --> <!-- 更多状态选择筛选 -->
<up-popup :round="10" :show="statusData.moreShow" :closeable="true" @close="moreShowHide"> <up-popup :round="10" :show="statusData.moreShow" :closeable="true" @close="moreShowHide">

View File

@ -1,15 +1,21 @@
<template> <template>
<view class="bg-fff item" @click="toDetail"> <view class="bg-fff item" @click="toDetail">
<view class="u-flex u-p-b-22 border-bottom u-col-bottom u-row-between"> <view class="u-flex u-p-b-22 border-bottom u-row-between u-col-center">
<view class="u-flex u-col-bottom"> <view class="u-flex u-col-bottom">
<view class="u-font-40 color-333">{{data.tableName}}</view> <template v-if="data.tableName">
<view class="u-m-l-22">{{data.masterId}}</view> <view class="u-flex u-col-center">
<view class="u-font-40 color-333">{{data.tableName}}</view>
<view class="line" style="height: 16px;"></view>
</view>
</template>
<view class="">{{data.masterId}}</view>
</view> </view>
<view class="u-flex"> <view class="u-flex">
<view> <view>
<text :class="[data.status]">{{returnStatus(data.status)}}</text> <text :class="[data.status]">{{returnStatus(data.status)}}</text>
</view> </view>
<view class="color-main u-m-l-24"> <view class="line"></view>
<view class=" color-main">
<text> <text>
{{sendTypeFilter(data.sendType)}} {{sendTypeFilter(data.sendType)}}
</text> </text>
@ -24,7 +30,8 @@
<view class="u-m-t-32"> <view class="u-m-t-32">
<view class="u-font-32">{{goosZhonglei}}种商品{{goodsNumber}}</view> <view class="u-font-32">{{goosZhonglei}}种商品{{goodsNumber}}</view>
<view class="border-bottom u-p-b-32"> <view class="border-bottom u-p-b-32">
<view class="u-flex u-row-between u-m-t-24" v-for="(item,index) in data.detailList" :key="index"> <view class="u-flex u-row-between u-col-top u-m-t-24" v-for="(item,index) in data.detailList"
:key="index">
<view> <view>
<view class="color-666"> {{item.productName}}</view> <view class="color-666"> {{item.productName}}</view>
<view class="color-999 u-font-24 u-m-t-8"> <view class="color-999 u-font-24 u-m-t-8">
@ -33,7 +40,7 @@
</view> </view>
<view class="u-flex"> <view class="u-flex">
<view>×{{item.num}}</view> <view>×{{item.num}}</view>
<view class="u-m-l-24">{{item.price}}</view> <view class="u-m-l-24 u-text-right" :style="computedPriceStyle()">{{item.price}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -66,7 +73,7 @@
ref, ref,
watch watch
} from 'vue'; } from 'vue';
const emits=defineEmits(['printOrder']) const emits = defineEmits(['printOrder'])
const props = defineProps({ const props = defineProps({
data: { data: {
type: Object, type: Object,
@ -80,24 +87,41 @@
} }
}) })
let $goodsMap = {} let $goodsMap = {}
let goosZhonglei =ref(0) let goosZhonglei = ref(0)
let goodsNumber = ref(0) let goodsNumber = ref(0)
function goodsMapInit(){
const priceSize = 9
function computedPriceStyle() {
const item = props.data.detailList.reduce((prev, current) => (`${prev.price}`.length > `${current.price}`
.length) ? prev : current)
if (!item) {
return ''
}
return {
width: `${item.price}`.length * priceSize + 'px'
}
}
// const computedPriceStyle = computed(() => {
// })
function goodsMapInit() {
for (let i in props.data.detailList) { for (let i in props.data.detailList) {
const goods = props.data.detailList[i] const goods = props.data.detailList[i]
if ($goodsMap.hasOwnProperty(goods.productId)) { if ($goodsMap.hasOwnProperty(goods.productId)) {
$goodsMap[goods.productId] += goods.num*1 $goodsMap[goods.productId] += goods.num * 1
goodsNumber.value+=goods.num*1 goodsNumber.value += goods.num * 1
} else { } else {
$goodsMap[goods.productId] = goods.num*1 $goodsMap[goods.productId] = goods.num * 1
goosZhonglei.value+=1 goosZhonglei.value += 1
goodsNumber.value+=goods.num*1 goodsNumber.value += goods.num * 1
} }
} }
} }
goodsMapInit() goodsMapInit()
watch(() => props.data.detailList.length, (newval) => { watch(() => props.data.detailList.length, (newval) => {
goodsNumber.value=0 goodsNumber.value = 0
goodsMapInit() goodsMapInit()
}) })
@ -114,8 +138,8 @@
function sendTypeFilter(t) { function sendTypeFilter(t) {
console.log(t); console.log(t);
if (t) { if (t) {
const item=orderEnum.sendType.find(item => item.key == t) const item = orderEnum.sendType.find(item => item.key == t)
return item?item.label:''; return item ? item.label : '';
} else { } else {
return t; return t;
} }
@ -126,8 +150,9 @@
id: props.data.id id: props.data.id
}) })
} }
function print(item) { function print(item) {
emits('printOrder',props.data) emits('printOrder', props.data)
} }
</script> </script>
@ -157,4 +182,33 @@
font-size: 24rpx; font-size: 24rpx;
border-radius: 100rpx; border-radius: 100rpx;
} }
.line {
height: 14px;
width: 1px;
background-color: #E5E5E5;
margin: 0 12rpx;
}
.row {
.top {
display: flex;
.name {
width: 50%;
}
.num {
width: 20%;
display: flex;
justify-content: flex-end;
}
.price {
width: 30%;
display: flex;
justify-content: flex-end;
}
}
}
</style> </style>

View File

@ -10,7 +10,7 @@
<text class=" ">{{order.amount}}</text> <text class=" ">{{order.amount}}</text>
</view> </view>
<view class="u-m-t-10 u-flex u-row-center color-main"> <view class="u-m-t-10 u-flex u-row-center color-main">
<view @click="showModel('editMoney',true)">修改</view> <view @click="discountShow">修改</view>
</view> </view>
</view> </view>
<view class="content bg-fff border-r-12"> <view class="content bg-fff border-r-12">
@ -119,9 +119,16 @@
import { import {
queryAllShopUser queryAllShopUser
} from '@/http/yskApi/shop-user.js' } from '@/http/yskApi/shop-user.js'
import {hasPermission} from '@/commons/utils/hasPermission.js'
import * as orderApi from '@/http/yskApi/order.js' import * as orderApi from '@/http/yskApi/order.js'
import infoBox from '@/commons/utils/infoBox.js' import infoBox from '@/commons/utils/infoBox.js'
import editDiscount from '@/components/my-components/edit-discount.vue' import editDiscount from '@/components/my-components/edit-discount.vue'
async function discountShow(){
const bol=await hasPermission('yun_xu_da_zhe')
if(bol){
showModel('editMoney',true)
}
}
let option = {isNowPay:false} let option = {isNowPay:false}
let payFinish=ref(false) let payFinish=ref(false)
onBackPress(() => { onBackPress(() => {

View File

@ -548,7 +548,7 @@ export default {
.is-required { .is-required {
// color: $uni-color-error; // color: $uni-color-error;
color: #dd524d; color: #EA4025;
font-weight: bold; font-weight: bold;
} }
} }