This commit is contained in:
YeMingfei666 2024-10-18 16:56:19 +08:00
commit df3cf998c3
29 changed files with 598 additions and 326 deletions

View File

@ -0,0 +1,6 @@
::v-deep .uni-easyinput__content-input{
height: initial;
}
::v-deep .uni-forms-item{
min-height: initial;
}

View File

@ -55,12 +55,12 @@ const $PermissionObj = {
], ],
vip:[ vip:[
{ {
key: '允许管理会员信息', text: '允许管理会员信息',
text: 'yun_xu_guan_li_hui_yuan_xin_xi' key: 'yun_xu_guan_li_hui_yuan_xin_xi'
}, },
{ {
key: 'yun_xu_xiu_gai_hui_yuan_yu_e', text: 'yun_xu_xiu_gai_hui_yuan_yu_e',
text: '允许修改会员余额' key: '允许修改会员余额'
} }
], ],
stock:[ stock:[

View File

@ -17,6 +17,7 @@ import infoBox from "@/commons/utils/infoBox.js"
import go from '@/commons/utils/go.js'; import go from '@/commons/utils/go.js';
// 测试服 // 测试服
let baseUrl = 'https://admintestpapi.sxczgkj.cn' let baseUrl = 'https://admintestpapi.sxczgkj.cn'
// let baseUrl = 'http://192.168.1.15:8000'
// 王伟本地测 // 王伟本地测
// let baseUrl = '/ww' // let baseUrl = '/ww'
// let baseUrl = 'http://192.168.1.15:8000' // let baseUrl = 'http://192.168.1.15:8000'
@ -64,7 +65,6 @@ function commonsProcess(showLoading, httpReqCallback) {
return httpReqCallback().then((httpData) => { return httpReqCallback().then((httpData) => {
reqFinishFunc(); // 请求完毕的动作 reqFinishFunc(); // 请求完毕的动作
console.log(httpData,'调试1')
// 从http响应数据中解构响应数据 [ 响应码、 bodyData ] // 从http响应数据中解构响应数据 [ 响应码、 bodyData ]
let { let {
statusCode, statusCode,

View File

@ -2,8 +2,8 @@
<view class="page min-page"> <view class="page min-page">
<view class="box"> <view class="box">
<view> <view>
<uni-forms :model="category" :rules="rules" err-show-type="toast" ref="form" <uni-forms :model="category" :rules="rules" err-show-type="toast" ref="form" :border="true"
:border="true" label-position="top" label-width="350"> label-position="top" label-width="350">
<view class="block"> <view class="block">
<view class="border-top-0"> <view class="border-top-0">
<uni-forms-item label="图标"> <uni-forms-item label="图标">
@ -13,14 +13,15 @@
</view> </view>
<view class=""> <view class="">
<uni-forms-item label="分类名称" required name="name"> <uni-forms-item label="分类名称" required name="name">
<uni-easyinput padding-none="true" :placeholderStyle="placeholderStyle" :inputBorder="inputBorder" <uni-easyinput padding-none :placeholderStyle="placeholderStyle"
v-model="category.name" placeholder="输入分类名称" /> :inputBorder="inputBorder" 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 padding-none="true" :placeholderStyle="placeholderStyle" :inputBorder="inputBorder" <uni-easyinput padding-none :placeholderStyle="placeholderStyle"
v-model="category.sort" type="number" placeholder="排序越小越靠前" /> :inputBorder="inputBorder" v-model="category.sort" type="number"
placeholder="排序越小越靠前" />
</uni-forms-item> </uni-forms-item>
</template> </template>
<uni-forms-item label=""> <uni-forms-item label="">
@ -190,58 +191,59 @@
</view> </view>
<view class="bottom" ref="bottom"></view> <view class="bottom" ref="bottom"></view>
<!-- 更多操作 --> <!-- 更多操作 -->
<my-action-sheet @itemClick="actionSheetClick" ref="refMoreSheet" <my-action-sheet @itemClick="actionSheetClick" ref="refMoreSheet" :list="actionSheet.list"></my-action-sheet>
:list="actionSheet.list"></my-action-sheet> <!-- 添加/编辑子分类 -->
<my-model ref="refAddChilCate" :title="refAddChilCateTitle">
<template #desc>
<view class="u-p-l-32 u-m-t-8 u-p-r-32 u-text-left">
<uni-forms :model="categoryChild" :rules="rules" err-show-type="toast" :border="true"
label-position="top" label-width="350">
<view class="border-top-0">
<uni-forms-item label="图标">
<my-upload-file ref="refFile" :limit="1"
@change="onfileChange($event,categoryChild,'pic')"
:images="categoryChild.pic"></my-upload-file>
</uni-forms-item>
</view>
<view class="">
<uni-forms-item label="分类名称" required name="name">
<uni-easyinput padding-none :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
v-model="categoryChild.name" placeholder="输入分类名称" />
</uni-forms-item>
</view>
<template v-if="option.type==='edit'">
<uni-forms-item label="排序" required name="sort">
<uni-easyinput padding-none :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
v-model="categoryChild.sort" type="number" placeholder="排序越小越靠前" />
</uni-forms-item>
</template>
<uni-forms-item label="">
<view class="u-flex u-row-between u-col-center">
<view class="label-title">开关</view>
<view class="u-flex">
<my-switch v-model="categoryChild.isShow"></my-switch>
</view>
</view>
</uni-forms-item>
</uni-forms>
</view>
</template>
<template #btn>
<view class="u-flex u-p-30">
<view class="u-flex-1 u-p-r-16">
<my-button shape="circle" type="default" @tap="refAddChilCateClose">取消</my-button>
</view>
<view class="u-flex-1 u-p-l-16">
<my-button shape="circle" @tap="refAddChilCateConfirm">确认</my-button>
</view>
</view>
</template>
</my-model>
</view> </view>
<!-- 添加/编辑子分类 -->
<my-model ref="refAddChilCate" :title="refAddChilCateTitle">
<template #desc>
<view class="u-p-40 u-text-left">
<uni-forms :model="categoryChild" :rules="rules" err-show-type="toast"
:border="true" label-position="top" label-width="350">
<view class="border-top-0">
<uni-forms-item label="图标">
<my-upload-file ref="refFile" :limit="1" @change="onfileChange($event,categoryChild,'pic')"
:images="categoryChild.pic"></my-upload-file>
</uni-forms-item>
</view>
<view class="">
<uni-forms-item label="分类名称" required name="name">
<uni-easyinput :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
v-model="categoryChild.name" placeholder="输入分类名称" />
</uni-forms-item>
</view>
<template v-if="option.type==='edit'">
<uni-forms-item label="排序" required name="sort">
<uni-easyinput :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
v-model="categoryChild.sort" type="number" placeholder="排序越小越靠前" />
</uni-forms-item>
</template>
<uni-forms-item label="">
<view class="u-flex u-row-between u-col-center">
<view class="label-title">开关</view>
<view class="u-flex">
<my-switch v-model="categoryChild.isShow"></my-switch>
</view>
</view>
</uni-forms-item>
</uni-forms>
</view>
</template>
<template #btn>
<view class="u-flex u-p-30">
<view class="u-flex-1 u-p-r-16">
<my-button shape="circle" type="default" @tap="refAddChilCateClose">取消</my-button>
</view>
<view class="u-flex-1 u-p-l-16">
<my-button shape="circle" @tap="refAddChilCateConfirm">确认</my-button>
</view>
</view>
</template>
</my-model>
</template> </template>
<script setup> <script setup>
@ -274,7 +276,7 @@
function refAddChilCateClose() { function refAddChilCateClose() {
refAddChilCate.value.close() refAddChilCate.value.close()
categoryChild.value ={ categoryChild.value = {
...categoryBasicData ...categoryBasicData
} }
} }
@ -293,16 +295,22 @@
if (result.length) { if (result.length) {
return infoBox.showToast(result[0].errMeessage) return infoBox.showToast(result[0].errMeessage)
} }
let res='' let res = ''
if( refAddChilCateTitle.value ==='编辑子分类'){ if (refAddChilCateTitle.value === '编辑子分类') {
res= await $productCategory.update({...categoryChild.value,pid:category.id}) res = await $productCategory.update({
categoryChild[selItem.index]=res ...categoryChild.value,
}else{ pid: category.id
res= await $productCategory.add({...categoryChild.value,pid:category.id}) })
categoryChild[selItem.index] = res
} else {
res = await $productCategory.add({
...categoryChild.value,
pid: category.id
})
category.childrenList.push(res) category.childrenList.push(res)
} }
uni.setStorageSync('cateItem',category) uni.setStorageSync('cateItem', category)
infoBox.showToast( refAddChilCateTitle.value==='编辑子分类'?'修改成功':'添加成功') infoBox.showToast(refAddChilCateTitle.value === '编辑子分类' ? '修改成功' : '添加成功')
refAddChilCateClose() refAddChilCateClose()
} }
@ -313,7 +321,7 @@
index: '' index: ''
} }
const actionSheet = reactive({ const actionSheet = reactive({
list: ['编辑', '删除'] list: ['编辑', '删除']
}) })
function moreShow(item, index) { function moreShow(item, index) {
@ -324,9 +332,9 @@
function actionSheetClick(index) { function actionSheetClick(index) {
console.log(index); console.log(index);
if(index===0){ if (index === 0) {
refAddChilCateTitle.value='编辑子分类' refAddChilCateTitle.value = '编辑子分类'
categoryChild.value=selItem.data categoryChild.value = selItem.data
refAddChilCate.value.open() refAddChilCate.value.open()
return return
} }
@ -339,7 +347,7 @@
$productCategory.del([selItem.data.id]).then(res => { $productCategory.del([selItem.data.id]).then(res => {
category.childrenList.splice(selItem.index, 1) category.childrenList.splice(selItem.index, 1)
infoBox.showToast('删除成功') infoBox.showToast('删除成功')
uni.setStorageSync('cateItem',category) uni.setStorageSync('cateItem', category)
}) })
} }
} }
@ -667,7 +675,14 @@
$icon-size: 34rpx; $icon-size: 34rpx;
$icon-line-width: 20rpx; $icon-line-width: 20rpx;
$icon-line-height: 4rpx; $icon-line-height: 4rpx;
@import '@/commons/style/reset-uni-form.scss';
::v-deep .uni-forms-item--border{
padding-top: 24rpx ;
padding-bottom: 24rpx ;
}
::v-deep .uni-forms-item.is-direction-top .uni-forms-item__label{
padding-bottom: 16rpx;
}
.category-icon { .category-icon {
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;
@ -682,7 +697,9 @@
.my-switch { .my-switch {
transform: scale(0.7); transform: scale(0.7);
} }
::v-deep .uni-forms-item__content{
min-height: inherit;
}
::v-deep .uni-forms-item__error { ::v-deep .uni-forms-item__error {
display: none !important; display: none !important;
} }
@ -747,16 +764,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: 6px 18rpx 0 18rpx; border-radius: 18rpx;
padding: 12rpx 24rpx; padding: 8rpx 24rpx;
margin-bottom: 32rpx; margin-bottom: 32rpx;
} }
} }
@ -766,7 +782,6 @@
left: 30rpx; left: 30rpx;
right: 30rpx; right: 30rpx;
bottom: 60rpx; bottom: 60rpx;
} }
::v-deep.uni-forms-item { ::v-deep.uni-forms-item {
@ -789,6 +804,7 @@
color: #fff; color: #fff;
border-radius: 12rpx; border-radius: 12rpx;
font-size: 28rpx; font-size: 28rpx;
border-radius: 100rpx;
} }
.btn-hover-class { .btn-hover-class {

View File

@ -37,7 +37,7 @@
<template #btn> <template #btn>
<view class="stock-btns u-p-b-40"> <view class="stock-btns u-p-b-40">
<my-button shape="circle" @tap="goodsSortModelSave">确认修改</my-button> <my-button shape="circle" @tap="goodsSortModelSave">确认修改</my-button>
<my-button shape="circle" type="default" @tap="goodsSortModelCancel">取消</my-button> <my-button shape="circle" bgColor="#fff" type="default" @tap="goodsSortModelCancel">取消</my-button>
</view> </view>
</template> </template>
</my-model> </my-model>

View File

@ -16,7 +16,7 @@
</view> </view>
<view class="u-m-t-32 u-flex u-col-top u-relative"> <view class="u-m-t-24 u-flex u-col-top u-relative">
<view v-if="props.showChecked"> <view v-if="props.showChecked">
<label class="radio"> <label class="radio">
<radio :color="ColorMain" style="transform: scale(0.7);" @click="radioClick" <radio :color="ColorMain" style="transform: scale(0.7);" @click="radioClick"
@ -31,8 +31,9 @@
<view class="u-flex"> <view class="u-flex">
<text class="u-m-r-24">{{data.name}}</text> <text class="u-m-r-24">{{data.name}}</text>
</view> </view>
<view class="u-font-32"> <view class="u-font-32 u-m-r-8">
<text v-if="data.typeEnum=='单规格'||data.typeEnum=='normal'">¥</text> <!-- <text v-if="data.typeEnum=='单规格'||data.typeEnum=='normal'">¥</text> -->
<text >¥</text>
<text>{{data.lowPrice}}</text> <text>{{data.lowPrice}}</text>
</view> </view>
</view> </view>
@ -233,7 +234,7 @@
.goods { .goods {
border-radius: 10rpx 10rpx 10rpx 10rpx; border-radius: 10rpx 10rpx 10rpx 10rpx;
background-color: #fff; background-color: #fff;
padding: 24rpx 28rpx 16rpx 28rpx; padding: 32rpx 28rpx 32rpx 28rpx;
font-size: 28rpx; font-size: 28rpx;
.skus { .skus {

View File

@ -35,7 +35,7 @@
<my-switch v-model="category.useTime"></my-switch> <my-switch v-model="category.useTime"></my-switch>
</view> </view>
</view> </view>
<view v-if="category.useTime" class="u-flex u-row-between u-col-center u-m-t-30 u-p-b-12"> <view v-if="category.useTime" class="u-flex u-row-between u-col-center u-m-t-16 ">
<view class="u-flex timesel" @click="changeTime('start')"> <view class="u-flex timesel" @click="changeTime('start')">
<up-icon name="clock" size="14"></up-icon> <up-icon name="clock" size="14"></up-icon>
<view class="u-m-l-20"> <view class="u-m-l-20">
@ -468,6 +468,7 @@
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/commons/style/reset-uni-form.scss';
$icon-size: 34rpx; $icon-size: 34rpx;
$icon-line-width: 20rpx; $icon-line-width: 20rpx;
$icon-line-height: 4rpx; $icon-line-height: 4rpx;
@ -563,7 +564,7 @@
} }
::v-deep .uni-forms-item--border{ ::v-deep .uni-forms-item--border{
padding-top: 12px; padding-top: 12px;
padding-bottom: 16px; padding-bottom: 12px;
} }
.box { .box {
font-size: 28rpx; font-size: 28rpx;
@ -571,7 +572,7 @@
.block { .block {
background: #FFFFFF; background: #FFFFFF;
border-radius: 12rpx 18rpx 0 18rpx; border-radius: 12rpx 18rpx 0 18rpx;
padding: 12rpx 24rpx; padding: 32rpx 24rpx 8rpx 24rpx;
margin-bottom: 32rpx; margin-bottom: 32rpx;
} }
} }

View File

@ -113,32 +113,36 @@
</template> </template>
</view> </view>
<template v-if="FormData.typeEnum=='sku' "> <template v-if="FormData.typeEnum=='sku' ">
<view class="block border-top-0 u-p-t-0"> <view class="block border-top-0 u-p-t-32 u-p-b-32">
<uni-forms-item label=" "> <view class="u-flex u-row-between " >
<view class="u-flex u-row-between " @tap="toGuige"> <view class="color-333 font-bold">
<view class="color-333 font-bold"> <text v-if="!skuList.list.length">选择规格</text>
<text v-if="!skuList.list.length">选择规格</text> <text v-else>编辑规格</text>
<text v-else>编辑规格</text>
</view>
<uni-icons type="right"></uni-icons>
</view> </view>
</uni-forms-item> <view class="u-flex u-col-center" @tap="toGuige">
<template v-if="skuList.list.length"> <view>
<text v-if="FormData.specsInfoName">{{FormData.specsInfoName}}</text>
<text class="color-999" v-else>请选择</text>
</view>
<view class="u-flex u-p-t-2">
<uni-icons type="right" :size="14" color="#999"></uni-icons>
</view>
</view>
</view>
<!-- <template >
<view class="u-text-left"> <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 ">组合名称</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 ">{{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> </view>
</view> </view>
</template> </template> -->
</view> </view>
@ -480,7 +484,7 @@
</view> </view>
<view class="bootom"> <view class="bootom">
<view class="save-btn-box"> <view class="save-btn-box">
<my-button shape="circle" @tap="save">保存</my-button> <my-button fontWeight="700" shape="circle" @tap="save">保存</my-button>
</view> </view>
</view> </view>
@ -1009,6 +1013,7 @@
// isShowMall: 1, // isShowMall: 1,
// }) // })
const FormData = reactive({ const FormData = reactive({
specsInfoName: '',
id: "", id: "",
typeEnum: "normal", typeEnum: "normal",
specificationsGroup: '', specificationsGroup: '',
@ -1110,6 +1115,11 @@
} }
} }
res.skuList = (res.skuList.length ? res.skuList : []) res.skuList = (res.skuList.length ? res.skuList : [])
let specsInfoName = ''
for (let i in res.specsInfo) {
specsInfoName = i
}
res.specsInfoName = specsInfoName
$goodsData = res $goodsData = res
skuList.list = res.skuList skuList.list = res.skuList
Object.assign(FormData, res) Object.assign(FormData, res)
@ -1767,9 +1777,11 @@
padding: 0 !important; padding: 0 !important;
min-height: initial !important; min-height: initial !important;
} }
::v-deep .uni-easyinput__content-input{
::v-deep .uni-easyinput__content-input {
height: inherit; height: inherit;
} }
::v-deep .none-label .uni-forms-item .uni-forms-item__label { ::v-deep .none-label .uni-forms-item .uni-forms-item__label {
padding: 0 !important; padding: 0 !important;
} }

View File

@ -5,7 +5,8 @@
<up-icon :size="10" name="arrow-down-fill"></up-icon> <up-icon :size="10" name="arrow-down-fill"></up-icon>
</view> --> </view> -->
<view class="input u-flex" > <view class="input u-flex" >
<up-input @blur="blur" disabled="true" @change="filterHaocaiList" border="none" v-model="text" placeholder="请选择"></up-input> <view>{{text||''}}</view>
<!-- <up-input @blur="blur" disabled="true" @change="filterHaocaiList" border="none" v-model="text" placeholder="请选择"></up-input> -->
</view> </view>
<view class="u-absolute" v-if="popShow"> <view class="u-absolute" v-if="popShow">
<scroll-view scroll-y="true" class="scroll"> <scroll-view scroll-y="true" class="scroll">

View File

@ -140,7 +140,7 @@
</view> --> </view> -->
</view> </view>
<view class="bottom"> <view class="bottom">
<my-button type="primary" shape="circle" font-weight="700" font-size="32" @click="save">保存</my-button> <my-button type="primary" shape="circle" font-weight="700" @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

@ -1,11 +1,11 @@
<template> <template>
<view class="page"> <view class="page min-page">
<view class="box"> <view class="box">
<view class="block border-top-0"> <view class="block border-top-0 u-p-t-32 u-p-b-32">
<uni-forms ref="nameFormRef" :model="specifications" :rules="rules" :label-width="350" <uni-forms ref="nameFormRef" :model="specifications" :rules="rules" :label-width="350"
label-position="top" validateTrigger="blur"> label-position="top" validateTrigger="blur">
<uni-forms-item label="模版名称" required name="name"> <uni-forms-item label="模版名称" required name="name">
<uni-easyinput :placeholderStyle="placeholderStyle" :inputBorder="inputBorder" <uni-easyinput padding-none :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
v-model="specifications.name" placeholder="模版名称,如:衣服" /> v-model="specifications.name" placeholder="模版名称,如:衣服" />
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
@ -17,71 +17,81 @@
<view class="block"> <view class="block">
<view class="border-top-0"> <view class="border-top-0">
<uni-forms-item label="规格组名" required name="name"> <uni-forms-item label="规格组名" required name="name">
<uni-easyinput :placeholderStyle="placeholderStyle" :inputBorder="inputBorder" <uni-easyinput padding-none :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
v-model="item.name" placeholder="规格组名,如:尺码" /> v-model="item.name" placeholder="规格组名,如:尺码" />
</uni-forms-item> </uni-forms-item>
</view> </view>
<uni-forms-item label="规格值"> <view class="u-p-b-8">
<view class="option"> <uni-forms-item label="规格值">
<view class=""> <view class="option ">
<view class="u-flex option-item" v-for="(option,optionIndex) in item.options" <view class="">
:key="optionIndex"> <view class="u-flex option-item u-m-t-8" v-for="(option,optionIndex) in item.options"
<view class="u-flex-1"> :key="optionIndex">
<uni-forms-item :key="optionIndex" :name="['options',optionIndex,'name']" <view class="u-flex-1">
:ref="setFormInputRef(index,optionIndex)" <uni-forms-item :key="optionIndex" :name="['options',optionIndex,'name']"
:rules="[{'required': true,errorMessage: '必填'}]" label-width="0" :ref="setFormInputRef(index,optionIndex)"
label="" required :showRequired="false"> :rules="[{'required': true,errorMessage: '必填'}]" label-width="0"
<uni-easyinput label="" required :showRequired="false">
v-model="specifications.list[index].options[optionIndex].name" <view class="bg-fff u-p-t-12 u-p-b-12" style="border-radius: 8rpx;">
@input="inpuChange(index,optionIndex)" <uni-easyinput
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder" v-model="specifications.list[index].options[optionIndex].name"
placeholder="请输入规格值,如:S、M" /> @input="inpuChange(index,optionIndex)"
</uni-forms-item> :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
placeholder="请输入规格值,如:S、M" />
</view>
<view class=" u-flex" v-if="item.options.length>1">
<uni-forms-item :key="optionIndex" label-width="0" label=""
:showRequired="false">
<view class="u-flex">
<!-- <uni-easyinput v-model="specifications.list[index].options[optionIndex].optionPrice"
@input="inpuChange(index,optionIndex)"
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
type="digit" placeholder="填写价格" /> -->
<view class="icon icon-reduce u-m-l-38"
@click="delOption(index,optionIndex)">
</view> </view>
</view>
</uni-forms-item> </uni-forms-item>
</view>
<view class=" u-flex" v-if="item.options.length>1">
<uni-forms-item :key="optionIndex" label-width="0" label=""
:showRequired="false">
<view class="u-flex">
<!-- <uni-easyinput v-model="specifications.list[index].options[optionIndex].optionPrice"
@input="inpuChange(index,optionIndex)"
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
type="digit" placeholder="填写价格" /> -->
<view class="icon icon-reduce u-m-l-38"
@click="delOption(index,optionIndex)">
</view>
</view>
</uni-forms-item>
</view>
</view> </view>
</view> </view>
<view class="u-flex u-m-t-24 " @click="addOptions(index)">
<view class="icon icon-add u-m-r-22 ">
</view>
<view class="color-main">添加规格</view>
</view>
</view> </view>
<view class="u-flex" @click="addOptions(index)"> </uni-forms-item>
<view class="icon icon-add u-m-r-22 "> </view>
<template v-if="specifications.list.length>1">
<view class="u-p-b-32">
<view class="u-flex " @click="delSpecificationsGroup(index)">
<view class="icon icon-reduce u-m-r-22 ">
</view> </view>
<view class="color-main">添加规格</view> <view class="color-red">删除规格组</view>
</view> </view>
</view> </view>
</uni-forms-item>
<template v-if="specifications.list.length>1">
<view class="u-flex u-m-t-48 u-m-b-24" @click="delSpecificationsGroup(index)">
<view class="icon icon-reduce u-m-r-22 ">
</view>
<view class="color-red">删除规格组</view>
</view>
</template> </template>
</view> </view>
</uni-forms> </uni-forms>
</view> </view>
<view class="u-flex block u-p-l-20 u-p-r-20 u-p-t-28 u-p-b-28" @click="addSpecificationsGroup"> <view class="u-flex block u-p-l-20 u-p-r-20 u-p-t-28 u-p-b-28" @click="addSpecificationsGroup">
<view class="icon icon-add u-m-r-22 "> <view class="icon icon-add u-m-r-22 ">
@ -90,7 +100,7 @@
</view> </view>
<view class="save-btn-box"> <view class="save-btn-box">
<button class="save-btn" hover-class="btn-hover-class" @click="save">保存</button> <button class="save-btn " hover-class="btn-hover-class" @click="save">保存</button>
</view> </view>
</view> </view>
<view class="bottom" ref="bottom"></view> <view class="bottom" ref="bottom"></view>
@ -366,14 +376,25 @@
.page { .page {
background: #F9F9F9; background: #F9F9F9;
padding: 30rpx; padding: 32rpx 30rpx 0 30rpx;
padding-bottom: 200rpx; padding-bottom: 200rpx;
} }
::v-deep .uni-forms-item--border {
padding-top: 12px;
padding-bottom: 12px;
}
.my-switch { .my-switch {
transform: scale(0.7); transform: scale(0.7);
} }
::v-deep .uni-forms-item.is-direction-top .uni-forms-item__label{
padding-bottom: 8px;
}
::v-deep .uni-easyinput__content-input{
height: inherit;
}
::v-deep.uni-forms-item {
min-height: inherit;
}
::v-deep .uni-forms-item__error { ::v-deep .uni-forms-item__error {
display: none !important; display: none !important;
} }
@ -440,13 +461,11 @@
} }
.box { .box {
margin-top: 70rpx;
font-size: 28rpx; font-size: 28rpx;
.block { .block {
background: #FFFFFF; background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx; border-radius: 18rpx 18rpx 18rpx 18rpx;
padding: 12rpx 24rpx; padding: 0 24rpx;
margin-bottom: 32rpx; margin-bottom: 32rpx;
} }
} }
@ -479,6 +498,7 @@
color: #fff; color: #fff;
border-radius: 12rpx; border-radius: 12rpx;
font-size: 28rpx; font-size: 28rpx;
border-radius: 100rpx;
} }
.btn-hover-class { .btn-hover-class {
@ -497,11 +517,10 @@
} }
.option { .option {
padding: 26rpx 30rpx 24rpx 24rpx; padding: 8rpx 24rpx 32rpx 24rpx;
background: #F9F9F9; background: #F9F9F9;
} }
.option-item { .option-item {
margin-bottom: 34rpx;
} }
</style> </style>

View File

@ -4,25 +4,44 @@
<view> <view>
<uni-forms :model="FormData" :rules="rules" err-show-type="undertext" validateTrigger="blur" ref="form" <uni-forms :model="FormData" :rules="rules" err-show-type="undertext" validateTrigger="blur" ref="form"
:border="true" :label-width="130"> :border="true" :label-width="130">
<view class="block"> <view class="block u-p-b-16">
<view class="border-top-0">
<view class="">
<view class="u-m-t-20">选择规格</view>
<view class="u-m-t-16">
<uni-data-picker :clear-icon="false" @change="specIdChange"
:map="{text:'name',value:'id'}" placeholder="请选择规格" popup-title="请选择规格"
:localdata="FormData.specList" v-model="FormData.specId">
</uni-data-picker>
</view>
</view>
<!-- <view class="border-top-0">
<uni-forms-item label="选择规格" required name="categoryId"> <uni-forms-item label="选择规格" required name="categoryId">
<uni-data-picker :clear-icon="false" @change="specIdChange" <uni-data-picker :clear-icon="false" @change="specIdChange"
:map="{text:'name',value:'id'}" placeholder="请选择规格" popup-title="请选择规格" :map="{text:'name',value:'id'}" placeholder="请选择规格" popup-title="请选择规格"
:localdata="FormData.specList" v-model="FormData.specId"> :localdata="FormData.specList" v-model="FormData.specId">
</uni-data-picker> </uni-data-picker>
</uni-forms-item> </uni-forms-item>
</view> </view> -->
<view class="u-p-b-20"> <view class=" u-m-t-32">
<view class="u-m-t-12" v-for="(item,index) in FormData.selectSpec" :key="index"> <view class="u-m-t-16" v-for="(item,index) in FormData.selectSpec" :key="index">
<view class="font-bold"> <view class="font-bold">
{{item.name}} {{item.name}}
</view> </view>
<view class="u-m-t-24"> <view class="u-m-t-16">
<uni-data-checkbox @change="createResult" multiple :selectedColor="color.ColorMain" <up-checkbox-group :labelSize="12" :size="14" :activeColor="color.ColorMain"
v-model="item.selectSpecResult" :localdata="item.value"></uni-data-checkbox> shape="circle" v-model="item.selectSpecResult" placement="row"
@change="createResult">
<up-checkbox :customStyle="{marginRight: '60rpx',marginBottom:'16rpx'}"
v-for="(item, index) in item.value" :key="index" :label="item.text"
:name="item.value">
</up-checkbox>
</up-checkbox-group>
<!-- <uni-data-checkbox @change="createResult" multiple :selectedColor="color.ColorMain"
v-model="item.selectSpecResult" :localdata="item.value">
</uni-data-checkbox> -->
</view> </view>
@ -34,16 +53,17 @@
</uni-forms> </uni-forms>
<view> <view>
<view class="block u-m-b-32" v-for="(item,index) in FormData.result" :key="index"> <view class="block u-m-b-0 u-m-t-32" v-for="(item,index) in FormData.result" :key="index">
<uni-forms :model="item.skus" :rules="rules" :ref="setFormRef(index)" err-show-type="undertext" <uni-forms :model="item.skus" :rules="rules" :ref="setFormRef(index)" err-show-type="undertext"
validateTrigger="blur" :border="true" :label-width="130"> validateTrigger="blur" :border="true" :label-width="130">
<view class=""> <view class="">
<view class="u-m-t-20" v-for="(val,key) in item.names" :key="key"> <view class="u-m-t-20 u-p-b-24 border-bottom" v-for="(val,key) in item.names"
<text class="font-bold u-m-r-12"> :key="key">
<view class="font-bold u-m-r-12">
{{key}} {{key}}
</text> </view>
<text class="color-999">{{val}}</text> <view class="u-m-t-16 color-666 u-font-24">{{val}}</view>
</view> </view>
</view> </view>
<view class="u-m-t-24"> <view class="u-m-t-24">
@ -51,13 +71,14 @@
<view class="font-bold"> <view class="font-bold">
图片 图片
</view> </view>
<view class="u-m-t-24"> <view class="u-m-t-16">
<my-upload-file @change="changeResultCover($event,index)" :limit="1" <my-upload-file @change="changeResultCover($event,index)" :limit="1"
:ref="setRefFile(index)" :images="item.coverImg"></my-upload-file> :imageStyles="imageStyles" :ref="setRefFile(index)"
:images="item.coverImg"></my-upload-file>
</view> </view>
</view> </view>
</view> </view>
<view class="skus u-m-t-32"> <view class="skus u-m-t-24">
<view class=""> <view class="">
<uni-forms-item label="售价" required name="salePrice"> <uni-forms-item label="售价" required name="salePrice">
<uni-easyinput @blur="priceFormat(item.skus,'salePrice')" <uni-easyinput @blur="priceFormat(item.skus,'salePrice')"
@ -109,9 +130,12 @@
placeholder="请输入分销金额" /> placeholder="请输入分销金额" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="商品条码" required> <uni-forms-item label="商品条码" required>
<uni-easyinput disabled :paddingNone="inputPaddingNone" <view class="bg-gray u-flex u-col-center u-col-center u-p-l-24" style="height: 72rpx;background: #F6F6F6;border-radius: 8rpx ;">
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder" <uni-easyinput disabled :paddingNone="inputPaddingNone"
v-model="item.skus.barCode" placeholder="请输入商品条码" /> :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
v-model="item.skus.barCode" placeholder="请输入商品条码" />
</view>
</uni-forms-item> </uni-forms-item>
</view> </view>
@ -120,8 +144,17 @@
</view> </view>
</view> </view>
<view class="save-btn-box"> </view>
<button class="save-btn" hover-class="btn-hover-class" @click="save">保存</button>
<view :style="{height:bottomHeight+'px'}"></view>
<view class="safe-bottom fixed">
<view class="btn">
<up-button @click="save" shape="circle" type="primary" >
<view class=" font-bold">
保存
</view>
</up-button>
<!-- <button class="save-btn" hover-class="btn-hover-class" @click="save">保存</button> -->
<view class="u-m-t-20"> <view class="u-m-t-20">
<button class="save-btn edit-btn" hover-class="btn-hover-class" @click="fastEditShow"> <button class="save-btn edit-btn" hover-class="btn-hover-class" @click="fastEditShow">
<view class="u-flex u-row-center"> <view class="u-flex u-row-center">
@ -130,15 +163,17 @@
</view> </view>
</button> </button>
</view> </view>
</view> </view>
</view> </view>
<view class="bottom" ref="bottom"></view>
<pop-fast-edit @update="updateSkuKey" v-model:show="fastEdit.show"></pop-fast-edit> <pop-fast-edit @update="updateSkuKey" v-model:show="fastEdit.show"></pop-fast-edit>
</view> </view>
</template> </template>
<script setup> <script setup>
import {
getSafeBottomHeight
} from '@/commons/utils/safe-bottom.js'
import { import {
formatPrice formatPrice
} from "@/commons/utils/format.js"; } from "@/commons/utils/format.js";
@ -169,7 +204,22 @@
import { import {
hasPermission hasPermission
} from '@/commons/utils/hasPermission.js'; } from '@/commons/utils/hasPermission.js';
let bottomHeight = ref(100)
onReady(() => {
getSafeBottomHeight('safe-bottom').then(res => {
console.log(res);
bottomHeight.value = res
})
})
const refFiles = ref([]); const refFiles = ref([]);
const imageStyles = reactive({
width: 82,
height: 82,
border: {
radius: '4px'
}
})
// //
function setRefFile(index) { function setRefFile(index) {
refFiles.value[index] = null; refFiles.value[index] = null;
@ -334,6 +384,7 @@
let arr = [] let arr = []
for (let k of FormData.selectSpec) { for (let k of FormData.selectSpec) {
if (k.selectSpecResult.length) { if (k.selectSpecResult.length) {
console.log(k);
arr.push({ arr.push({
value: k.selectSpecResult, value: k.selectSpecResult,
name: k.name name: k.name
@ -341,7 +392,7 @@
} }
} }
const spes = combineSpecs(arr) const spes = combineSpecs(arr)
FormData.result = spes.filter(v => { const result = spes.filter(v => {
return !Array.isArray(v) return !Array.isArray(v)
}).map(v => { }).map(v => {
const specSnap = returnSpecSnap(v) const specSnap = returnSpecSnap(v)
@ -354,7 +405,7 @@
} }
return data || newdata return data || newdata
}) })
console.log(FormData.result); FormData.result = result
} }
@ -526,8 +577,8 @@
}) })
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
if(err.length>=1){ if (err.length >= 1) {
infoBox.showToast(err[0].errorMessage) infoBox.showToast(err[0].errorMessage)
} }
resolve({ resolve({
sucees: false sucees: false
@ -549,6 +600,8 @@
} }
// //
console.log('pass'); console.log('pass');
const item = FormData.specList.find(v => v.id === FormData.specId)
FormData.specsInfoName = item ? item.name : ''
console.log(FormData); console.log(FormData);
emitspecificationsSave() emitspecificationsSave()
@ -568,14 +621,32 @@
margin: auto; margin: auto;
} }
::v-deep .uni-forms-item--border {
padding-top: 24rpx;
padding-bottom: 24rpx;
}
::v-deep.uni-forms-item { ::v-deep.uni-forms-item {
min-height: inherit; min-height: inherit;
} }
.page { .page {
background: #F9F9F9; background: #F9F9F9;
padding: 30rpx; padding: 30rpx 30rpx 0 30rpx;
padding-bottom: 200rpx; }
.safe-bottom {
padding: 34rpx 28rpx;
position: fixed;
background-color: #fff;
left: 0;
right: 0;
bottom: 0;
z-index: 10;
.btn {
padding: 0 88rpx 56rpx 88rpx;
}
} }
.my-switch { .my-switch {
@ -626,6 +697,10 @@
} }
} }
::v-deep .uni-easyinput__content-input {
height: inherit;
}
.icon-reduce { .icon-reduce {
background-color: $my-red-color; background-color: $my-red-color;

View File

@ -9,9 +9,9 @@
</view> </view>
<view class="u-m-t-36"> <view class="u-m-t-36">
<scroll-view scroll-y="true" style="max-height: 70vh;"> <scroll-view scroll-y="true" style="max-height: 70vh;">
<view class="u-m-b-24" v-for="(item,index) in list" :key="index"> <view class="u-m-b-32" v-for="(item,index) in list" :key="index">
<view>{{item.text}}</view> <view>{{item.text}}</view>
<view class="u-m-t-24"> <view class="u-m-t-16">
<up-input v-model="item.value"> <up-input v-model="item.value">
<template #suffix> <template #suffix>
<up-button @click="itemClick(item)" type="primary" text="修改" size="mini"></up-button> <up-button @click="itemClick(item)" type="primary" text="修改" size="mini"></up-button>

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 add" @tap="go.to('PAGES_PRODUCT_ADD')">商品添加</view> <view class="btn add font-bold u-font-28 color-fff" @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}">

View File

@ -139,7 +139,10 @@
goods: { goods: {
type: Object, type: Object,
default: () => { default: () => {
skuList: [] return{
id:'',
skuList: []
}
} }
} }
}) })
@ -153,6 +156,7 @@
] ]
}) })
function toRecodes(){ function toRecodes(){
console.log(props.goods.id);
go.to('PAGES_PRODUCT_INVOICING_LIST',{ go.to('PAGES_PRODUCT_INVOICING_LIST',{
productId:props.goods.id productId:props.goods.id
}) })

View File

@ -83,7 +83,6 @@
</template> </template>
<script setup> <script setup>
import myButton from '@/components/my-components/my-button';
import go from '@/commons/utils/go.js' import go from '@/commons/utils/go.js'
import color from '@/commons/color.js' import color from '@/commons/color.js'
@ -108,7 +107,7 @@
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.text-ming-w{ .text-ming-w{
min-width: calc(28rpx * 5); min-width: calc(28rpx * 5);
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="color-333 u-font-28"> <view class="color-333 u-font-28">
<up-sticky offset-top="0"> <up-sticky :offset-top="0">
<view class=" bg-fff u-flex u-p-l-30 u-row-between"> <view class=" bg-fff u-flex u-p-l-30 u-row-between">
<view class="u-flex "> <view class="u-flex ">
<view class="u-flex u-p-t-30 u-p-b-30 u-flex-1 u-row-center" @tap="timeToggle"> <view class="u-flex u-p-t-30 u-p-b-30 u-flex-1 u-row-center" @tap="timeToggle">
@ -18,16 +18,6 @@
</view> </view>
</view> </view>
<!-- <view style="width: 164rpx;"></view> -->
<!-- <view class="search-box">
<view class="search-btn u-flex" @tap="showSearch" :style="{width:search.show?'694rpx':'164rpx'}">
<image src="@/static/iconImg/icon-search.svg" class="input-icon" />
<view class="u-flex-1 u-p-l-10"><input v-model="search.keyword" @confirm="searchConfirm" type="text"
placeholder-style="font-size:28rpx;" placeholder="搜索" /></view>
<view @tap.stop="hideSearch" v-if="search.show">取消</view>
</view>
</view> -->
<view :style="{height:types.show?typesHeight:0}" class="tranistion types overflow-hide"> <view :style="{height:types.show?typesHeight:0}" class="tranistion types overflow-hide">
<view @tap="changeTypesActive(index)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between" <view @tap="changeTypesActive(index)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
v-for="(item,index) in types.list" :key="index"> v-for="(item,index) in types.list" :key="index">
@ -63,7 +53,7 @@
</view> --> </view> -->
<template v-if="pageData.list.length"> <template v-if="pageData.list.length">
<view class="u-m-b-28 " v-for="(item,index) in pageData.list" :key="index"> <view class="u-m-b-28 " v-for="(item,index) in pageData.list" :key="index">
<list-item :data="item"></list-item> <my-list-item :data="item" ></my-list-item>
</view> </view>
<my-pagination :size="pageData.size" :totalElements="pageData.totalElements" <my-pagination :size="pageData.size" :totalElements="pageData.totalElements"
@change="pageChange"></my-pagination> @change="pageChange"></my-pagination>
@ -77,12 +67,10 @@
</view> </view>
</view>
<my-date-pickerview @confirm="datePickerConfirm" ref="datePicker"></my-date-pickerview> <my-date-pickerview @confirm="datePickerConfirm" ref="datePicker"></my-date-pickerview>
<my-mask ref="mask" @close="hideType"></my-mask> <my-mask ref="mask" @close="hideType"></my-mask>
</view>
</template> </template>
<script setup> <script setup>
@ -94,9 +82,7 @@
onPullDownRefresh onPullDownRefresh
} from '@dcloudio/uni-app'; } from '@dcloudio/uni-app';
import color from '@/commons/color'; import color from '@/commons/color';
import listItem from './components/list-item'; import myListItem from './components/list-item.vue';
import myMask from '@/components/my-components/my-mask'
import myDatePickerview from '@/components/my-components/my-date-pickerview'
import { import {
ref, ref,
reactive, reactive,
@ -218,7 +204,6 @@
shopId:uni.getStorageSync('shopId'), shopId:uni.getStorageSync('shopId'),
createdAt:[] createdAt:[]
}, },
productId:'',
totalElements: 0, totalElements: 0,
list: [], list: [],
status: 'noMore', status: 'noMore',
@ -229,7 +214,6 @@
const createdAt=(filters.time.start&&filters.time.end)?[filters.time.start,filters.time.end ]:[] const createdAt=(filters.time.start&&filters.time.end)?[filters.time.start,filters.time.end ]:[]
const res = await $getProductStockDetail({ const res = await $getProductStockDetail({
...pageData.query, ...pageData.query,
productId: pageData.productId,
type:types.active!==''?types.list[types.active].value:'', type:types.active!==''?types.list[types.active].value:'',
createdAt createdAt
}) })
@ -239,7 +223,7 @@
} }
async function getSum(){ async function getSum(){
const res = await $getProductStockDetailSum({ const res = await $getProductStockDetailSum({
productId: pageData.productId, productId: pageData.query.productId
}) })
pageData.changeSum = res.exchange pageData.changeSum = res.exchange
} }
@ -249,7 +233,8 @@
}) })
onLoad(opt => { onLoad(opt => {
pageData.query.productId = opt ? opt.productId : '' console.log(opt);
Object.assign(pageData.query,opt)
init() init()
// getSum() // getSum()
}) })

View File

@ -54,18 +54,20 @@
onLoad onLoad
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import { import {
reactive, reactive,onBeforeMount,
ref ref
} from 'vue'; } from 'vue';
let nouser = ref(false) let nouser = ref(false)
let timer=null
function emitChooser(data) { function emitChooser(data) {
uni.$emit('choose-user', data) uni.$emit('choose-user', data)
setTimeout(() => { timer=setTimeout(() => {
uni.navigateBack() uni.navigateBack()
}, 100) }, 100)
} }
onBeforeMount(()=>{
clearInterval(timer)
})
function chooseUser(index, item) { function chooseUser(index, item) {
if (index === undefined || item === undefined) { if (index === undefined || item === undefined) {
nouser.value = true nouser.value = true

View File

@ -169,7 +169,7 @@
</view> </view>
</view> </view>
<template v-if="item.note"> <template v-if="item.note">
<view class="u-p-20 bg-gray u-m-t-10"> <view class="u-p-20 bg-gray u-m-t-16">
{{item.note}} {{item.note}}
</view> </view>
</template> </template>

View File

@ -1,20 +1,24 @@
<template> <template>
<view class="default-box-padding bg-fff border-r-24 u-m-t-32" v-if="data.length"> <view class="default-box-padding bg-fff border-r-24 u-m-t-32" v-if="data.length">
<view class="u-font-32 color-999 border-bottom u-p-b-24"> <view class=" font-bold u-p-b-32 border-bottom u-m-b-24" v-if="orderInfo.tableName">
<text class="">桌号</text>
<text class="">{{orderInfo.tableName||""}}</text>
</view>
<view class=" color-999 border-bottom u-p-b-24">
<text></text> <text></text>
<text class="color-333 "> {{goodsNumber}}</text> <text class="color-333 "> {{goodsNumber}}</text>
<text>份菜品</text> <text>份菜品</text>
</view> </view>
<view class="u-m-b-20 u-m-t-20" v-for="(order,orderIndex) in data" :key="orderIndex"> <view class="u-m-b-20 " v-for="(order,orderIndex) in data" :key="orderIndex">
<view class="u-font-32"> {{ order.placeNum }}次下单 <view class="u-p-t-24"> {{ order.placeNum }}次下单
</view> </view>
<view class="u-m-t-24 list"> <view class="u-m-t-24 list">
<view class="item u-m-b-20" v-for="(item,index) in order.info" :key="index"> <view class="item u-m-b-32" v-for="(item,index) in order.info" :key="index">
<view class="u-flex u-col-top"> <view class="u-flex u-col-top">
<view> <view class="u-flex">
<image class="img" :src="item.coverImg||item.productImg" mode=""></image> <image class="img" :src="item.coverImg||item.productImg" mode=""></image>
</view> </view>
<view class="u-p-l-30 u-flex-1"> <view class="u-p-l-32 u-flex-1">
<view class="u-flex u-row-between u-col-top"> <view class="u-flex u-row-between u-col-top">
<view class=""> <view class="">
@ -25,9 +29,12 @@
<view :class="{'line-th':item.status=='return'}">{{item.name||item.productName}} <view :class="{'line-th':item.status=='return'}">{{item.name||item.productName}}
</view> </view>
</view> </view>
<view class="color-999 u-font-24 u-m-t-10">{{item.productSkuName||''}}</view> <view class="color-999 u-font-24 u-m-t-8">{{item.productSkuName||''}}</view>
<view class="u-m-t-12 color-666 u-font-24" v-if="item.note">
备注{{item.note}}
</view>
</view> </view>
<view class="u-text-right"> <view class="u-text-right u-m-t-28">
<template v-if="item.status=='return'"> <template v-if="item.status=='return'">
<view>0.00</view> <view>0.00</view>
<view class="line-th color-666 ">{{item.salePrice||item.price}}</view> <view class="line-th color-666 ">{{item.salePrice||item.price}}</view>
@ -35,30 +42,30 @@
<template v-else> <template v-else>
<view>{{item.salePrice||item.price}}</view> <view>{{item.salePrice||item.price}}</view>
</template> </template>
<view class="u-m-t-10 color-999 u-font-24">X{{item.number||item.num}}</view> <view class="u-m-t-22 color-999 u-font-24">X{{item.number||item.num}}</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<template v-if="orderInfo.status=='unpaid'"> <template v-if="orderInfo.status=='unpaid'">
<view class="u-flex u-row-right gap-20 u-m-t-20" v-if="item.status!='return'"> <view class="u-flex u-row-right gap-20 u-m-t-24" v-if="item.status!='return'">
<!-- <my-button :height="60" color="#333" plain type="cancel" shape="circle">更多操作</my-button> --> <!-- <my-button :height="60" color="#333" plain type="cancel" shape="circle">更多操作</my-button> -->
<my-button :width="168" :height="60" plain shape="circle" <my-button :width="128" :height="48" plain shape="circle"
@tap="tuicai(item,index)">退菜</my-button> @tap="tuicai(item,index)"><text class="no-wrap">退菜</text></my-button>
</view> </view>
</template> </template>
<template v-if="orderInfo.status=='closed'"> <template v-if="orderInfo.status=='closed'">
<view class="u-flex u-row-right gap-20 u-m-t-20" v-if="item.status!='return'"> <view class="u-flex u-row-right gap-20 u-m-t-20" v-if="item.status!='return'">
<my-button :width="168" :height="60" plain shape="circle" <my-button :width="128" :height="48" plain shape="circle"
@tap="tuikuan(item,index)">退款</my-button> @tap="tuikuan(item,index)"><text class="no-wrap">退款</text> </my-button>
</view> </view>
</template> </template>
</view> </view>
</view> </view>
<view class="bg-gray u-p-20 u-m-t-20" v-if="orderInfo.remark"> <!-- <view class="bg-gray u-p-20 u-m-t-20" v-if="orderInfo.remark">
<view>备注</view> <view>备注</view>
<view class="u-m-t-10">{{orderInfo.remark}}</view> <view class="u-m-t-10">{{orderInfo.remark}}</view>
</view> </view> -->
</view> </view>
<view class="u-m-t-32"> <view class="u-m-t-32">
@ -109,7 +116,7 @@
<text class="font-bold u-font-32">{{to2(allPrice*1+seatFeePrice*1) }}</text> <text class="font-bold u-font-32">{{to2(allPrice*1+seatFeePrice*1) }}</text>
</view> </view>
</view> </view>
<view class="u-m-t-30"> <view class="u-m-t-24">
<my-button @tap="printOrder" type="cancel" :color="color.ColorMain">重新打印</my-button> <my-button @tap="printOrder" type="cancel" :color="color.ColorMain">重新打印</my-button>
</view> </view>
</view> </view>

View File

@ -1,41 +1,44 @@
<template> <template>
<view class="default-box-padding bg-fff border-r-12 u-m-t-20"> <view class="default-box-padding bg-fff border-r-12 u-m-t-24">
<view class="u-flex u-row-between"> <view class="u-flex u-row-between">
<view>订单状态</view> <view>订单状态</view>
<view>{{returnStatus(data.status)}}</view> <view>{{returnStatus(data.status)}}</view>
</view> </view>
<view class="u-flex u-row-between u-m-t-20"> <view class="u-flex u-row-between u-m-t-24">
<view>订单类型</view> <view>订单类型</view>
<view>{{returnUseType(data.useType)}}</view> <view>{{returnUseType(data.useType)}}</view>
</view> </view>
<view class="u-flex u-row-between u-m-t-20"> <view class="u-flex u-row-between u-m-t-24">
<view>桌位号</view> <view>桌位号</view>
<view>{{table.name||data.tableName}}</view> <view>{{table.name||data.tableName}}</view>
</view> </view>
<view class="u-flex u-row-between u-m-t-20" v-if="seatFee.number"> <view class="u-flex u-row-between u-m-t-24" v-if="seatFee.number">
<view>就餐人数</view> <view>就餐人数</view>
<view>{{seatFee.number||''}}</view> <view>{{seatFee.number||''}}</view>
</view> </view>
<view class="u-flex u-row-between u-m-t-20"> <view class="u-flex u-row-between u-m-t-24">
<view>支付方式</view> <view>支付方式</view>
<view>{{data.payType||''}}</view> <view>{{data.payType||''}}</view>
</view> </view>
<!-- <view class="u-flex u-row-between u-m-t-20"> <!-- <view class="u-flex u-row-between u-m-t-24">
<view>预约时间</view> <view>预约时间</view>
<view></view> <view></view>
</view> --> </view> -->
<view class="u-flex u-row-between u-m-t-20"> <view class="u-flex u-row-between u-m-t-24">
<view>下单时间</view> <view>下单时间</view>
<view><up-text v-if="data.createdAt" mode="date" format="yyyy-mm-dd hh:MM:ss" :text="data.createdAt"></up-text></view> <view><up-text v-if="data.createdAt" mode="date" format="yyyy-mm-dd hh:MM:ss" :text="data.createdAt"></up-text></view>
</view> </view>
<view class="u-flex u-row-between u-m-t-20"> <view class="u-flex u-row-between u-m-t-24">
<view>订单编号</view> <view>订单编号</view>
<view>{{data.orderNo}}</view> <view>{{data.orderNo}}</view>
</view> </view>
<!-- <view class="u-flex u-row-between u-m-t-20"> <view class="u-flex u-row-between u-m-t-24 u-col-top">
<view>商家备注</view> <view class="no-wrap">商家备注</view>
<my-button plain shape="circle" :width="160" :height="60">编辑</my-button> <view class="u-p-l-32 " style="max-width: 522rpx; word-wrap: break-word;">
</view> --> {{data.remark}}
</view>
<!-- <my-button plain shape="circle" :width="160" :height="60">编辑</my-button> -->
</view>
</view> </view>
</template> </template>

View File

@ -6,7 +6,23 @@
{{data.productName}} {{data.productName}}
</view> </view>
<view class="u-flex u-m-t-32"> <view class="u-flex u-m-t-32">
<up-number-box :buttonSize="44" :inputWidth="220" v-model="number"></up-number-box> <up-number-box :min="1" :max="data.num" :buttonSize="44" v-model="number" integer>
<template #minus>
<view class="minus number-box-btn">
</view>
</template>
<template #input>
<view class="u-flex-1 u-row-center u-text-center input">
<up-input @change="parseIntNumber($event,false)" @blur="parseIntNumber($event,true)"
v-model="number" border="none" type="number"></up-input>
</view>
</template>
<template #plus>
<view class="plus number-box-btn">
<up-icon name="plus" color="#999" size="16" bold></up-icon>
</view>
</template>
</up-number-box>
</view> </view>
<view class="u-m-t-32"> <view class="u-m-t-32">
<view class="u-font-24"> <view class="u-font-24">
@ -14,13 +30,15 @@
<text class="color-red">*</text> <text class="color-red">*</text>
</view> </view>
<view class="u-flex u-flex-wrap u-m-t-24"> <view class="u-flex u-flex-wrap u-m-t-24">
<view class="u-flex u-m-r-16 u-m-b-16" v-for="(item,index) in tags" :key="index"> <view class="u-flex u-m-r-16 u-m-b-16" v-for="(item,index) in tags" :key="index">
<up-tag @click="changeTagSel(item)" :text="item.label" plain borderColor="#E6FOFF" color="#318AFE" v-if="item.checked"> </up-tag> <up-tag @click="changeTagSel(item)" :text="item.label" plain borderColor="#E6FOFF"
<up-tag @click="changeTagSel(item)" borderColor="#E5E5E5" color="#666" :text="item.label" plain v-else> </up-tag> color="#318AFE" v-if="item.checked"> </up-tag>
<up-tag @click="changeTagSel(item)" borderColor="#E5E5E5" color="#666" :text="item.label"
plain v-else> </up-tag>
</view> </view>
</view> </view>
<view class="u-m-t-24"> <view class="u-m-t-24">
<up-input placeholder="备注"></up-input> <up-textarea v-model="form.note" placeholder="备注"></up-textarea>
</view> </view>
</view> </view>
</view> </view>
@ -29,7 +47,8 @@
<view class="u-p-t-18 u-p-l-30 u-p-r-30 u-p-b-30"> <view class="u-p-t-18 u-p-l-30 u-p-r-30 u-p-b-30">
<my-button box-shadow shape="circle" @tap="confirm">确认退菜</my-button> <my-button box-shadow shape="circle" @tap="confirm">确认退菜</my-button>
<view class="u-m-t-10"> <view class="u-m-t-10">
<my-button @tap="toggleModelShow" shape="circle" bgColor="#fff" type="cancel" box-shadow>取消</my-button> <my-button @tap="toggleModelShow" shape="circle" bgColor="#fff" type="cancel"
box-shadow>取消</my-button>
</view> </view>
</view> </view>
@ -39,9 +58,11 @@
<script setup> <script setup>
import { import {
reactive,
ref, ref,
watch watch
} from 'vue'; } from 'vue';
import infoBox from '@/commons/utils/infoBox.js'
const props = defineProps({ const props = defineProps({
data: { data: {
type: Object, type: Object,
@ -52,13 +73,48 @@
default: false default: false
} }
}) })
const emits = defineEmits(['update:show','confirm']) const form = reactive({
note: ''
})
const emits = defineEmits(['update:show', 'confirm'])
let model = ref(null) let model = ref(null)
let modelShow = ref(props.show) let modelShow = ref(props.show)
let number = ref(1) let number = ref(1)
const tags=ref([{label:"点错",checked:false},{label:"不想要了",checked:false} ,{label:"食材不足",checked:false} ,{label:"等待时间过长",checked:false}]) const tags = ref([{
function changeTagSel(item){ label: "点错",
item.checked=!item.checked checked: false
}, {
label: "不想要了",
checked: false
}, {
label: "食材不足",
checked: false
}, {
label: "等待时间过长",
checked: false
}])
let timer = null
function parseIntNumber(val, isNow) {
console.log(val);
let newval = parseInt(val)
if (newval > props.data.num) {
newval = props.data.num
}
if (newval < 1) {
newval = 1
}
if (isNow) {
number.value = parseInt(newval)
return
}
timer = setTimeout(() => {
number.value = newval
}, 100)
}
function changeTagSel(item) {
item.checked = !item.checked
} }
watch(() => props.show, (newval) => { watch(() => props.show, (newval) => {
modelShow.value = newval modelShow.value = newval
@ -72,8 +128,8 @@
} }
}) })
function toggleModelShow(show){ function toggleModelShow(show) {
modelShow.value=show?true:false modelShow.value = show ? true : false
} }
function onModelClose() { function onModelClose() {
@ -91,13 +147,65 @@
function close() { function close() {
model.value.close() model.value.close()
} }
function confirm(){
emits('confirm') function confirm() {
const selTag = tags.value.filter(item => item.checked).map(item => item.label).join(",")
const note = selTag + (form.note.length > 0 ? "," + form.note : "");
console.log({
note,
num: number.value
});
if (!note) {
return infoBox.showToast("请输入退菜原因");
}
emits('confirm', {
note,
num: number.value
})
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .u-border{ .number-box-btn {
border-width: 1px!important; position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 122rpx;
height: 84rpx;
background: #F7F7FA;
border-radius: 8rpx 0rpx 0rpx 8rpx;
border: 2rpx solid #F9F9F9;
box-sizing: border-box;
}
.input {
border: 2rpx solid #F9F9F9;
}
::v-deep .u-input__content__field-wrapper__field {
height: 84rpx;
}
::v-deep .uni-input-input {
text-align: center;
}
.minus {
&::after {
content: '';
display: block;
width: 28rpx;
height: 0rpx;
border: 1px solid #999999;
}
}
::v-deep .u-border {
border-width: 1px !important;
}
::v-deep .u-number-box {
width: 100%;
} }
</style> </style>

View File

@ -15,28 +15,30 @@
</view> </view>
</template> </template>
<template v-else> <template v-else>
<view class="u-flex u-row-between u-m-t-20 border-bottom u-p-b-20"> <view class="u-flex u-row-between u-m-t-20 border-bottom u-p-b-24">
<view class="u-flex"> <view class="u-flex">
<up-avatar :size="30" :src="user.headImg"></up-avatar> <up-avatar :size="30" :src="user.headImg"></up-avatar>
<view class="color-666 u-m-l-30">{{'服务员下单'}}</view> <view class="color-666 u-m-l-30">{{'服务员下单'}}</view>
</view> </view>
<view> <view>
<my-button @click="toOrder" :height="60" plain shape="circle">他的订单</my-button> <my-button width="128" height="48" @click="toOrder" :height="60" plain shape="circle">
<text class="u-font-24 no-wrap">他的订单</text>
</my-button>
</view> </view>
</view> </view>
</template> </template>
<view class="u-flex u-m-t-20 u-row-between u-font-28"> <view class="u-flex u-m-t-24 u-row-between u-font-28">
<view class=""> <view class="">
<view class="font-bold ">{{user.amount}}</view> <view class="font-bold ">{{user.amount}}</view>
<view class="color-666 u-m-t-10 u-font-24">余额</view> <view class="color-666 u-m-t-8 u-font-24">余额</view>
</view> </view>
<view class=""> <view class="">
<view class="font-bold">{{user.totalScore}}</view> <view class="font-bold">{{user.totalScore}}</view>
<view class="color-666 u-m-t-10 u-font-24">积分</view> <view class="color-666 u-m-t-8 u-font-24">积分</view>
</view> </view>
<view class=""> <view class="">
<view class="font-bold">0.00</view> <view class="font-bold">0.00</view>
<view class="color-666 u-m-t-10 u-font-24">已消费</view> <view class="color-666 u-m-t-8 u-font-24">已消费</view>
</view> </view>
</view> </view>
</view> </view>

View File

@ -1,10 +1,10 @@
<template> <template>
<view class="min-page bg-gray u-font-28 u-p-30"> <view class="min-page bg-gray u-font-28 u-p-30">
<user-vue :orderInfo="orderDetail.info" :user="user"></user-vue> <user-vue :orderInfo="orderDetail.info" :user="user"></user-vue>
<view class="default-box-padding bg-fff border-r-12 u-m-t-32"> <!-- <view class="default-box-padding bg-fff border-r-12 u-m-t-32">
<text class="">桌位号</text> <text class="">桌位号</text>
<text class="">{{orderDetail.info.tableName}}</text> <text class="">{{orderDetail.info.tableName}}</text>
</view> </view> -->
<goods-list @printOrder="onPrintOrder" @tuikuan="onTuikuan" :orderInfo="orderDetail.info" <goods-list @printOrder="onPrintOrder" @tuikuan="onTuikuan" :orderInfo="orderDetail.info"
:data="orderDetail.goodsList" :seatFee="orderDetail.seatFee" @tuicai="onTuiCai"></goods-list> :data="orderDetail.goodsList" :seatFee="orderDetail.seatFee" @tuicai="onTuiCai"></goods-list>
<template v-if="orderDetail.seatFee.totalNumber&&orderDetail.seatFee.totalAmount"> <template v-if="orderDetail.seatFee.totalNumber&&orderDetail.seatFee.totalAmount">
@ -17,7 +17,7 @@
<view class="u-fixed bottom bg-fff "> <view class="u-fixed bottom bg-fff ">
<view class="u-flex u-abso"> <view class="u-flex u-abso">
<template v-if="orderDetail.info.useType=='takeout'"> <template v-if="orderDetail.info.useType=='takeout'">
<view class="u-flex-1"> <view class="u-flex-1" v-if="orderDetail.info.status=='unpaid'">
<my-button @tap="toPay" borderRadius="100rpx" shape="circle" <my-button @tap="toPay" borderRadius="100rpx" shape="circle"
type="primary">结账</my-button> type="primary">结账</my-button>
</view> </view>
@ -25,11 +25,11 @@
<template v-else> <template v-else>
<template v-if="orderDetail.info.status=='unpaid'"> <template v-if="orderDetail.info.status=='unpaid'">
<view class="u-flex-1"> <view class="u-flex-1">
<my-button @tap="diancan" color="#fff" bgColor="rgb(57,53,52)" borderRadius="100rpx 0 0 100rpx" fontWeight="700" fontSize="32" <my-button @tap="diancan" color="#fff" bgColor="rgb(57,53,52)" borderRadius="100rpx 0 0 100rpx" fontWeight="700"
shape="circle" plain type="primary">加菜</my-button> shape="circle" plain type="primary">加菜</my-button>
</view> </view>
<view class="u-flex-1"> <view class="u-flex-1">
<my-button @tap="toPay" borderRadius="0 100rpx 100rpx 0" shape="circle" fontWeight="700" fontSize="32" <my-button @tap="toPay" borderRadius="0 100rpx 100rpx 0" shape="circle" fontWeight="700"
type="primary">结账</my-button> type="primary">结账</my-button>
</view> </view>
</template> </template>
@ -120,9 +120,10 @@
tuicai.show = true tuicai.show = true
tuicai.selGoods = goods tuicai.selGoods = goods
} }
async function tuicaiConfirm() { async function tuicaiConfirm(e) {
console.log(tuicai.selGoods); console.log(tuicai.selGoods);
const res = await Api.$returnCart({ const res = await Api.$returnCart({
...e,
cartId: tuicai.selGoods.hasOwnProperty('cartId') ? tuicai.selGoods.cartId : tuicai.selGoods.id, cartId: tuicai.selGoods.hasOwnProperty('cartId') ? tuicai.selGoods.cartId : tuicai.selGoods.id,
tableId: orderDetail.info.tableId, tableId: orderDetail.info.tableId,
}) })
@ -199,6 +200,7 @@
}, 1500) }, 1500)
function diancan() { function diancan() {
clearEmit()
go.to('PAGES_CREATE_ORDER', { go.to('PAGES_CREATE_ORDER', {
tableId: options.tableId || orderDetail.info.tableId, tableId: options.tableId || orderDetail.info.tableId,
name: options.name || orderDetail.info.tableName, name: options.name || orderDetail.info.tableName,
@ -208,6 +210,7 @@
function toPay() { function toPay() {
const userId=orderDetail.info.userId||'' const userId=orderDetail.info.userId||''
clearEmit()
go.to('PAGES_ORDER_PAY', { go.to('PAGES_ORDER_PAY', {
tableId: options.tableId|| orderDetail.info.tableId, tableId: options.tableId|| orderDetail.info.tableId,
tableName: options.name, tableName: options.name,
@ -311,6 +314,12 @@
return Api.$setUser(submitPar) return Api.$setUser(submitPar)
} }
function clearEmit(){
uni.$off('choose-user')
uni.$off('orderDetail:update')
}
function watchChooseuser() { function watchChooseuser() {
uni.$off('choose-user') uni.$off('choose-user')
uni.$on('choose-user', (data) => { uni.$on('choose-user', (data) => {

View File

@ -30,15 +30,15 @@
<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-col-top u-m-t-24" v-for="(item,index) in data.detailList" <view class="u-flex u-row-between u-col-top u-m-t-32" v-for="(item,index) in data.detailList"
:key="index"> :key="index">
<view> <view>
<view class="color-666"> {{item.productName}}</view> <view class=""> {{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">
{{item.productSkuName}} {{item.productSkuName}}
</view> </view>
</view> </view>
<view class="u-flex"> <view class="u-flex u-flex-1 u-row-right">
<view>×{{item.num}}</view> <view>×{{item.num}}</view>
<view class="u-m-l-24 u-text-right" :style="computedPriceStyle()">{{item.price}}</view> <view class="u-m-l-24 u-text-right" :style="computedPriceStyle()">{{item.price}}</view>
</view> </view>
@ -46,8 +46,8 @@
</view> </view>
</view> </view>
<view class="u-flex u-row-between border-bottom u-m-t-32 u-p-b-32"> <view class="u-flex u-row-between border-bottom u-m-t-32 u-p-b-32 u-col-top">
<view>订单备注</view> <view class="no-wrap u-m-r-32">订单备注</view>
<view>{{data.remark||'无'}}</view> <view>{{data.remark||'无'}}</view>
</view> </view>
<view class="u-m-t-32"> <view class="u-m-t-32">
@ -99,7 +99,7 @@
return '' return ''
} }
return { return {
width: `${item.price}`.length * priceSize + 'px' 'min-width': `${item.price}`.length * priceSize + 'px'
} }
} }
// const computedPriceStyle = computed(() => { // const computedPriceStyle = computed(() => {

View File

@ -1,11 +1,14 @@
<template> <template>
<view class="min-page bg-gray u-font-28"> <view class="min-page bg-gray u-font-28">
<view class="top"> <up-sticky offset-top="0">
<view class="search bg-fff u-p-t-32 u-p-l-28 u-p-r-28 u-p-b-32"> <view class="top">
<up-search v-bind="search" v-model="search.val"></up-search> <view class="search bg-fff u-p-t-32 u-p-l-28 u-p-r-28 u-p-b-32">
<up-search v-bind="search" v-model="search.val" @search="searchConfirm" @clear="searchConfirm" @custom="searchConfirm"></up-search>
</view>
<filter-vue @clearUser="clearQueryUser" @updateStatus="updateQuery('status',$event)" v-model:time="order.data.query.createdAt" :user="user" :type="option.type"></filter-vue>
</view> </view>
<filter-vue @clearUser="clearQueryUser" @updateStatus="updateQuery('status',$event)" v-model:time="order.data.query.createdAt" :user="user" :type="option.type"></filter-vue> </up-sticky>
</view>
<order-list @printOrder="onPrintOrder" :hasAjax="order.data.hasAjax" :list="order.data.list"></order-list> <order-list @printOrder="onPrintOrder" :hasAjax="order.data.hasAjax" :list="order.data.list"></order-list>
<template v-if="order.data.list.length>0"> <template v-if="order.data.list.length>0">
<my-pagination @change="pageChange" :totalElements="order.data.total"></my-pagination> <my-pagination @change="pageChange" :totalElements="order.data.total"></my-pagination>
@ -31,7 +34,7 @@
import {getTodayTimestamps} from '@/commons/utils/dayjs-time.js'; import {getTodayTimestamps} from '@/commons/utils/dayjs-time.js';
const search = reactive({ const search = reactive({
val: '', val: '',
placeholder: '搜索单号/昵称/姓名/手机号码/商品名称', placeholder: '搜索单号/商品名称',
shape: 'square', shape: 'square',
inputStyle: { inputStyle: {
borderRadius: '12rpx' borderRadius: '12rpx'
@ -49,7 +52,7 @@
id: "", id: "",
orderNo: "", orderNo: "",
orderType: "0", orderType: "0",
page: 1, page: 0,
pageSize: 10, pageSize: 10,
payType: "", payType: "",
productName: "", productName: "",
@ -62,10 +65,9 @@
order.setQuery('userId','') order.setQuery('userId','')
} }
function pageChange(e){ function pageChange(e){
order.setVal('page',e) const newPage=e-1
order.setQuery('page',e) order.setVal('page',newPage)
console.log(e); order.setQuery('page',newPage)
console.log(order.data.page);
init() init()
} }
function updateQuery(key,e){ function updateQuery(key,e){
@ -80,9 +82,13 @@
watch(()=>order.data.query.userId,(newval)=>{ watch(()=>order.data.query.userId,(newval)=>{
init() init()
}) })
function searchConfirm(){
order.setQuery('page',0)
init()
}
async function init() { async function init() {
console.log(order.data.query); console.log(order.data.query);
const {content,totalElements}=await Api.tbOrderInfoData({...order.data.query,page:order.data.query.page-1}) const {content,totalElements}=await Api.tbOrderInfoData({...order.data.query,page:order.data.query.page,searchText:search.val})
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
order.setVal('list',content) order.setVal('list',content)
console.log(order.data.list); console.log(order.data.list);

View File

@ -113,8 +113,9 @@
} from 'vue'; } from 'vue';
import { import {
onLoad, onLoad,
onBackPress onBackPress,onShow
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import go from '@/commons/utils/go.js'
import * as Api from '@/http/yskApi/Instead.js' import * as Api from '@/http/yskApi/Instead.js'
import { import {
queryAllShopUser queryAllShopUser
@ -132,6 +133,7 @@
let option = {isNowPay:false} let option = {isNowPay:false}
let payFinish=ref(false) let payFinish=ref(false)
onBackPress(() => { onBackPress(() => {
uni.$emit('orderDetail:update')
console.log('onBackPress'); console.log('onBackPress');
// uni.$emit('update:createOrderIndex') // uni.$emit('update:createOrderIndex')
// if (option.isNowPay&&!payFinish.value) { // if (option.isNowPay&&!payFinish.value) {
@ -172,11 +174,11 @@
go.to('PAGES_CHOOSE_USER') go.to('PAGES_CHOOSE_USER')
} }
// //
function setUser(par) { function setUser(par) {
console.log(option); console.log(option);
const submitPar = { const submitPar = {
masterId: option.masterId, masterId: option.masterId,
tableId: table.value.tableId, tableId: option.tableId,
vipUserId: user.value.id ? user.value.id : '', vipUserId: user.value.id ? user.value.id : '',
type: user.value.id ? 0 : 1 //0 1 type: user.value.id ? 0 : 1 //0 1
} }
@ -187,11 +189,17 @@
uni.$off('choose-user') uni.$off('choose-user')
uni.$on('choose-user', (data) => { uni.$on('choose-user', (data) => {
console.log(data); console.log(data);
user.value = data setUser({
setUser() vipUserId: data.id ? data.id : '',
type: data.id ? 0 : 1 //0 1
}).then(res=>{
user.value = data
})
}) })
} }
onShow(()=>{
watchChooseuser()
})
watch(() => pays.selIndex, (newval) => { watch(() => pays.selIndex, (newval) => {
clearInterval(timer) clearInterval(timer)
@ -238,10 +246,10 @@
} }
function changePayType(i, item) { function changePayType(i, item) {
if (item.payType == 'vipPay' && user.value.amount * 1 < order.amount * 1) {
return infoBox.showToast('余额不足')
}
pays.payTypes.selIndex = i pays.payTypes.selIndex = i
if (item.payType == 'vipPay' ) {
chooseUser()
}
} }
// //
function paySuccess() { function paySuccess() {
@ -250,6 +258,7 @@
// uni.$emit('orderDetail:update') // uni.$emit('orderDetail:update')
payFinish.value=true payFinish.value=true
uni.$emit('get:table') uni.$emit('get:table')
uni.$emit('update:orderDetail')
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
@ -266,6 +275,10 @@
} }
async function payOrder() { async function payOrder() {
const payType = pays.payTypes.list[pays.payTypes.selIndex].payType const payType = pays.payTypes.list[pays.payTypes.selIndex].payType
if (payType == 'vipPay' && user.value.amount * 1 < order.amount * 1) {
infoBox.showToast('余额不足')
return
}
await Api.$payOrder({ await Api.$payOrder({
tableId: order.tableId, tableId: order.tableId,
masterId: order.masterId, masterId: order.masterId,
@ -328,7 +341,9 @@
queryAllShopUser({ queryAllShopUser({
id: order.userId id: order.userId
}).then(res => { }).then(res => {
user.value = res.content[0] || opt if(res.content[0]){
user.value =res.content[0]
}
}) })
} }
getPayUrl() getPayUrl()
@ -348,7 +363,6 @@
Object.assign(order, opt) Object.assign(order, opt)
const payTypeList = await Api.$getPayType() const payTypeList = await Api.$getPayType()
pays.payTypes.list = payTypeList pays.payTypes.list = payTypeList
init() init()
}) })

View File

@ -387,7 +387,6 @@ class SchemaValidator extends RuleValidator {
} }
async validateUpdate(data, allData) { async validateUpdate(data, allData) {
console.log(allData);
let result = this._checkFieldInSchema(data) let result = this._checkFieldInSchema(data)
if (!result) { if (!result) {
result = await this.invokeValidateUpdate(data, false, allData) result = await this.invokeValidateUpdate(data, false, allData)

View File

@ -25,7 +25,10 @@ H5, 不影响。
* 分包内组件路径为 /分包目录/*/组件名称; 使用@/分包目录/*/组件名称会报错。 * 分包内组件路径为 /分包目录/*/组件名称; 使用@/分包目录/*/组件名称会报错。
* 分包只能使用分包内的图路径或者static目录下 分包使用别的分包下图片会导致图片未找到 * 分包只能使用分包内的图路径或者static目录下 分包使用别的分包下图片会导致图片未找到
* uni tabBar 配置项 请参考 [tabBar配置网址]<https://uniapp.dcloud.net.cn/collocation/pages.html#tabbar> * uni tabBar 配置项 请参考 [tabBar配置网址]<https://uniapp.dcloud.net.cn/collocation/pages.html#tabbar>
*
### 兼容行考虑
* 组件只能有一个根元素,组件内所有元素鼻血在根元素里
### 打包注意事项 ### 打包注意事项
* 准备资料: * 准备资料: