34 Commits
dev ... dwb

Author SHA1 Message Date
duan
8df341ff9e 修改套餐添加问题 2024-12-24 11:04:58 +08:00
duan
13a4e21be5 订单详情,退菜,小计和优惠 2024-12-20 14:01:33 +08:00
duan
db6b1af326 合并桌问题与称重退款 2024-12-19 18:08:44 +08:00
duan
f7a9a2b567 并合桌 2024-12-17 09:44:48 +08:00
duan
daa0d18501 Merge branch 'test' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into dwb 2024-12-12 17:25:45 +08:00
duan
06e17a74b3 并转桌子 2024-12-12 17:25:16 +08:00
GaoHao
973450b37a Merge branch 'test' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into test 2024-12-11 10:41:26 +08:00
GaoHao
7376e40fe3 app升级更新添加 2024-12-11 10:41:13 +08:00
魏啾
6d8284e78f 1 2024-12-07 14:15:04 +08:00
duan
cfb461829f Merge branch 'test' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into dwb 2024-12-06 16:43:11 +08:00
duan
8c15aadf21 添加商品如果套餐没选择规格,默认选中第一条 2024-12-06 16:42:58 +08:00
魏啾
65745d3033 Merge branch 'test' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into wwz 2024-12-06 15:50:57 +08:00
魏啾
3616caac21 称重,默认选择营业时间 2024-12-06 15:49:15 +08:00
duan
b4dcfe7879 添加商品几选几总值没传 2024-12-06 14:56:37 +08:00
魏啾
38b640e82b 称重钱保留后两位 2024-12-06 10:35:56 +08:00
魏啾
85d5d59863 Merge branch 'test' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into wwz 2024-12-06 10:06:05 +08:00
魏啾
51f3953459 称重增加 2024-12-06 10:05:06 +08:00
duan
b1e90ff1a9 Merge branch 'test' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into dwb 2024-12-05 11:23:48 +08:00
duan
de90f1249e 套餐优化 2024-12-05 11:23:39 +08:00
魏啾
3a5460894b Merge branch 'test' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into wwz 2024-12-05 10:48:31 +08:00
魏啾
e6ccfdafd6 核销管理 2024-12-05 10:48:11 +08:00
duan
9df5bc0e46 套餐 2024-12-04 17:46:51 +08:00
duan
4dfa7d627e 代客下单bug修改2 2024-12-04 10:44:25 +08:00
duan
ff1e6f60e0 代课下单bug修改 2024-12-04 09:38:18 +08:00
duan
c4f43a0626 单品改价 2024-12-03 16:19:48 +08:00
74d644c46b 修复套餐商品展示问题 2024-12-03 10:27:18 +08:00
3400c9422d 增加固定套餐提交时的套餐商品验证 2024-12-03 10:02:42 +08:00
b88b0b548f 修复商品编辑套餐商品保存问题 2024-12-03 09:53:11 +08:00
005c6336c0 Merge branch 'ymf' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into test 2024-12-03 09:27:32 +08:00
1582bb85f1 商品编辑修改称重商品也展示分类 2024-12-03 09:25:27 +08:00
c36717a059 Merge branch 'ymf' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into test 2024-12-02 15:49:36 +08:00
3f2ea98977 修复是否允许临时改价点击无反应问题 2024-12-02 15:49:16 +08:00
0d298f8413 Merge branch 'ymf' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into test 2024-12-02 15:44:20 +08:00
f6b0db3a70 修复商品类型称重type改为weigh 2024-12-02 15:40:03 +08:00
32 changed files with 2668 additions and 355 deletions

6
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"files.associations": {
"*.ttml": "xml",
"*.ttss": "css"
}
}

143
App.vue
View File

@@ -6,8 +6,9 @@ App.vue本身不是页面这里不能编写视图元素也就是没有<tem
import {
onLaunch
} from '@dcloudio/uni-app';
import { getFindBySource } from '@/http/yskApi/version.js'
onLaunch(() => {
let that = this
uni.hideTabBar()
// #ifdef MP-WEIXIN
const updateManager = wx.getUpdateManager() // 小程序版本更新管理器
@@ -23,6 +24,146 @@ App.vue本身不是页面这里不能编写视图元素也就是没有<tem
// 新版本下载失败
})
// #endif
//#ifdef APP-PLUS
//获取当前系统版本信息
plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
//请求后台接口 解析数据 对比版本
console.log("widgetInfo==",widgetInfo)
getFindBySource({source:'APP'}).then(res => {
console.log("selectNewApp==",res)
console.log("version===",res.url && widgetInfo.version < res.version)
if (res.url && widgetInfo.version < res.version) {
console.log("version===222")
let downloadLink = res.url;
// let downloadLink = "https://short-video.hnsiyao.cn/app/sy-duanju.apk";
console.log(downloadLink)
// let androidLink = res.androidWgtUrl;
// let iosLink = res.iosWgtUrl;
let ready = false;
// 校验是否强制升级
if (res.isUp == 1) {
uni.showModal({
showCancel: false,
title: '发现新版本',
confirmText: '立即更新',
content: res.message,
success: res => {
if (res.confirm) {
uni.showLoading('下载中...');
if (uni.getSystemInfoSync().platform ==
'android') {
uni.downloadFile({
url: downloadLink,
success: downloadResult => {
if (downloadResult.statusCode === 200) {
plus.io.resolveLocalFileSystemURL(downloadResult.tempFilePath, entry => {
entry.getParent(_oldFile=>{
entry.moveTo(_oldFile,'.apk',newFilePath=>{
console.log('newFilePath',newFilePath.fullPath)
plus.runtime
.install(newFilePath.fullPath, { force: false },
d => {
console
.log(
'install success...'
);
plus.runtime
.restart();
},
e => {
console.log(e)
console
.error(
'install fail...'
);
}
);
})
})
})
}
}
});
}
if (uni.getSystemInfoSync().platform ==
'ios') {
plus.runtime.openURL(downloadLink, function(
res) {});
}
} else if (res.cancel) {
console.log('取消');
}
}
});
} else {
uni.showModal({
title: '发现新版本',
confirmText: '立即更新',
cancelText: '下次更新',
content: res.message,
success: res => {
if (res.confirm) {
uni.showLoading('下载中...');
if (uni.getSystemInfoSync().platform ==
'android') {
uni.downloadFile({
url: downloadLink,
success: downloadResult => {
if (downloadResult
.statusCode ===
200) {
plus.io.resolveLocalFileSystemURL(downloadResult.tempFilePath, entry => {
entry.getParent(_oldFile=>{
entry.moveTo(_oldFile,'.apk',newFilePath=>{
console.log('newFilePath',newFilePath.fullPath)
plus.runtime
.install(newFilePath.fullPath, { force: false },
d => {
console
.log(
'install success...'
);
plus.runtime
.restart();
},
e => {
console.log(e)
console
.error(
'install fail...'
);
}
);
})
})
})
}
}
});
}
if (uni.getSystemInfoSync().platform ==
'ios') {
plus.runtime.openURL(downloadLink, function(
res) {});
}
} else if (res.cancel) {
console.log('取消');
}
}
});
}
}
}).catch((res)=>{
console.log(res)
})
});
// #endif
});
</script>

33
http/php/api.ts Normal file
View File

@@ -0,0 +1,33 @@
import { request } from './request'
// 会员签入 登录
export const douyincheckIn = (data : object | any) => {
return request('douyin/checkIn', 'POST', data, true)
}
// 登出
export const userlogout = () => {
return request('user/logout', 'POST', '', true)
}
// 查询绑定状态
export const searchstorestatus = (data : object) => {
return request('meituan/searchstorestatus', 'POST', data, true)
}
// 团购核销准备
export const fulfilmentcertificateprepare = (data : object) => {
return request('douyin/fulfilmentcertificateprepare', 'POST', data, true)
}
// 获取uisdk 绑定 链接
export const getuisdk = (data : object) => {
return request('douyin/getuisdk', 'POST', data, true)
}
// 团购核销
export const certificateprepares = (data : object) => {
return request('douyin/certificateprepare', 'POST', data, true)
}
// 团购核销记录
export const orderlist = (data : object) => {
return request('douyin/orderlist', 'POST', data, true)
}
// 团购核销撤销
export const fulfilmentcertificatecanceles = (data : object) => {
return request('douyin/fulfilmentcertificatecancel', 'POST', data, true)
}

80
http/php/request.ts Normal file
View File

@@ -0,0 +1,80 @@
//服务器接口地址
const baseURL : string = 'https://czgdoumei.sxczgkj.com/index.php/api/'
// 封装公共请求方法
function request(url : string, method : "GET" | "POST" | undefined, data : object | any, toast : boolean) {
let networkType = ''
uni.getNetworkType({
success: (res) => {
networkType = res.networkType
}
});
if (networkType == 'none') {
uni.showToast({
title: '网络异常,请检查网络',
icon: 'none'
})
return false;
}
if (toast) {
uni.showLoading({
title: '加载中',
mask: true
})
}
return new Promise(async (resolve, reject) => {
let header : any
header = {
'content-type': 'application/json',
'clinttype':uni.getStorageSync('clint_type'),
'bausertoken': uni.getStorageSync('phpuserinfo').token
};
uni.request({
url: baseURL + url,
method: method,
data: data,
header: header,
success(res : any) {
if (res.data.code != 1) {
//是否提示错误
if (toast) {
uni.showToast({
title: res.data.msg || res.data.message,
icon: 'none'
})
setTimeout(() => {
uni.hideLoading()
}, 1000)
}
if (res.data.code == 401) {
uni.showToast({
title: res.message || res.msg,
icon: "none",
success: () => {
// uni.removeStorageSync('logintoken');
// uni.removeStorageSync('token');
uni.reLaunch({
url: '/pages/index/index'
})
}
})
}
uni.hideLoading()
reject(res.message | res.msg);
} else {
uni.hideLoading()
resolve(res.data.data);
}
},
fail(err) {
uni.hideLoading()
//请求失败
uni.showToast({
title: '无法连接到服务器',
icon: 'none'
})
reject(err)
}
})
})
}
export { request, baseURL }

View File

@@ -202,6 +202,7 @@ function request(args) {
method: method,
header: getHeader()
}, extParams)
)
})
}

View File

@@ -24,6 +24,17 @@ export function $bind(data) {
}
});
}
// 转/并桌
export function tableswitch(data) {
return request({
url: '/api/place/switch',
method: "put",
data: {
shopId: uni.getStorageSync('shopId'),
...data
}
});
}
//获取台桌详情状态
export function $returnTableDetail(data) {
return request({

15
http/yskApi/version.js Normal file
View File

@@ -0,0 +1,15 @@
import http from './http.js'
const request=http.request
/**
* 查询所属渠道升级版本
* @returns
*/
export function getFindBySource(params) {
return request({
url: `/api/tbVersion/findBySource`,
method: 'get',
params
})
}

View File

@@ -51,6 +51,9 @@
} from 'vue';
import color from '@/commons/color.js';
import go from '@/commons/utils/go.js';
import {
onLoad,
} from '@dcloudio/uni-app';
import {
tbShopPurveyorput
} from '@/http/yskApi/requestAll.js';
@@ -62,17 +65,15 @@
type: String
}
})
onMounted(() => {
datas.form = JSON.parse(props.item)
onLoad((d)=>{
datas.form = JSON.parse(d.item)
})
function sumbit() {
tbShopPurveyorput({
shopId: uni.getStorageSync("shopId"),
...datas.form
}).then(res => {
// go.to('PAGES_SUPPLIER')
go.back()
})
}

View File

@@ -12,14 +12,15 @@
<view class="block">
<view class="border-top-0 typeEnum">
<uni-forms-item label="商品类型" required showRequired>
<up-radio-group v-model="FormData.type" placement="row">
<up-radio-group v-model="FormData.type" placement="row"
@change="changeFormDatatype">
<up-radio v-for="(item, index) in pageData.types" :key="index"
:label="item.name" :name="item.value">
</up-radio>
</up-radio-group>
</uni-forms-item>
</view>
<view class="" v-if="FormData.type!='package'">
<view class="" v-if="FormData.type!='package' && FormData.type!='weigh'">
<uni-forms-item label="商品规格" required showRequired>
<up-radio-group v-model="FormData.typeEnum" placement="row">
<up-radio :custom-style="{marginRight:'30px'}"
@@ -39,6 +40,10 @@
</up-radio-group>
</uni-forms-item>
</view>
<uni-forms-item required name="name" label="商品名称" showRequired>
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
:inputBorder="inputBorder" v-model="FormData.name" placeholder="请输入商品名称" />
</uni-forms-item>
<uni-forms-item ref="fileItem" label="图片" required showRequired>
<my-upload-file ref="refFile" :images="FormData.images"
:imageStyles="imageStyles"></my-upload-file>
@@ -55,33 +60,27 @@
</up-checkbox-group>
</uni-forms-item>
</view>
<template v-if="FormData.type!='package'">
<uni-forms-item required name="name" label="商品名称" showRequired>
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
:inputBorder="inputBorder" v-model="FormData.name" placeholder="请输入商品名称" />
<view class="u-relative">
<uni-forms-item label="商品分类" required showRequired name="categoryId">
<uni-data-picker :clear-icon="false" :map="{text:'name',value:'id'}"
placeholder="请选择商品分类" popup-title="请选择商品分类" :localdata="pageData.category"
v-model="FormData.categoryId">
</uni-data-picker>
</uni-forms-item>
<view class="u-relative">
<uni-forms-item label="商品分类" required showRequired name="categoryId">
<uni-data-picker :clear-icon="false" :map="{text:'name',value:'id'}"
placeholder="请选择商品分类" popup-title="请选择商品分类" :localdata="pageData.category"
v-model="FormData.categoryId">
</uni-data-picker>
</uni-forms-item>
<view class="zhezhao u-absolute position-all" @click="canEditGoodsCategory(true)"
v-if="option.type=='edit'&&disabledChangeCategory">
<view class="zhezhao u-absolute position-all" @click="canEditGoodsCategory(true)"
v-if="option.type=='edit'&&disabledChangeCategory">
</view>
</view>
<view class="border-top-0">
<uni-forms-item label="单位" required showRequired name="units">
</view>
<view class="">
<uni-forms-item label="单位" required showRequired name="units">
<uni-data-picker :clear-icon="false" @change="unitIdChange"
:map="{text:'name',value:'id'}" placeholder="请选择单位" popup-title="请选择单位"
:localdata="pageData.units" v-model="FormData.unitId">
</uni-data-picker>
</uni-forms-item>
</view>
</template>
<uni-data-picker :clear-icon="false" @change="unitIdChange"
:map="{text:'name',value:'id'}" placeholder="请选择单位" popup-title="请选择单位"
:localdata="pageData.units" v-model="FormData.unitId">
</uni-data-picker>
</uni-forms-item>
</view>
<template v-if="FormData.type==='package'">
<!-- <view class="block border-top-0">
<uni-forms-item label="选择规格" required name="categoryId">
@@ -92,7 +91,8 @@
</uni-data-picker>
</uni-forms-item>
</view> -->
<view class="border-top" >
<view class="border-top" v-if="FormData.proGroupVo">
<view class=""
v-if=" (FormData.groupType==1&&FormData.proGroupVo.length)||(FormData.groupType==0&&FormData.proGroupVo.length&&FormData.proGroupVo[0].goods.length) ">
<view class="border-bottom u-p-b-32"
@@ -512,16 +512,16 @@
</view>
</template>
<template v-if="FormData.type=='weight'">
<template v-if="FormData.type=='weigh'">
<view class="block u-p-t-32 u-p-b-32">
<view class="font-bold">
<text class="color-red">*</text>
<text>重量</text>
<text>单位</text>
</view>
<view class=" u-m-t-16">
<up-input v-model="FormData.weight">
<template #suffix>
<view class="bg-gray">千克</view>
<view class="bg-gray">{{activeinHouseList}}</view>
</template>
</up-input>
<view class="u-m-t-16 color-999 u-font-24">用于快递或配送运费计重</view>
@@ -541,11 +541,10 @@
</view>
</uni-forms-item>
</view> -->
<view class="border-top-0">
<!-- <view class="border-top-0">
<view class="u-flex u-row-between u-p-b-24 u-p-t-20">
<view class="label-title">是否允许临时改价</view>
<my-switch disabled :openDisabledClass="false"
v-model="FormData.isTempPrice"></my-switch>
<my-switch v-model="FormData.isTempPrice"></my-switch>
</view>
</view>
<view class="u-p-t-24 u-p-b-24 border-top u-flex u-row-between">
@@ -574,18 +573,20 @@
<price-number-box placeholder="请输入每人限购"
v-model="FormData.singlePeopleLimit"></price-number-box>
</view>
</view>
</view> -->
<view>
<uni-forms-item label="">
<view class="u-flex u-row-between" @tap="toTimerPage">
<view>
<view style="display: flex;">
<text class="color-red">*</text>
<view class="label-title">定时上下架</view>
</view>
<view class="u-flex u-font-24">
<view>
<view class="color-666">{{returnTimerDayText()}}</view>
<view class="color-666 u-m-t-4" v-if="FormData.days">
{{returnTimerTimeText()}}</view>
{{returnTimerTimeText()}}
</view>
</view>
<uni-icons type="right"></uni-icons>
</view>
@@ -702,8 +703,8 @@
<choose-guige ref="refChooseGuige" @confirm="refChooseGuigeConfirm"></choose-guige>
<!-- 更多操作 -->
<my-action-sheet @itemClick="actionSheetClick" ref="refMoreSheet" :list="actionSheet.list"></my-action-sheet>
</view>
@@ -897,13 +898,13 @@
let proGroupVoGoodsIndex = undefined
function refChooseGuigeOpen(skuList, groupIndex, goodsIndex) {
console.log(groupIndex, goodsIndex)
proGroupVoIndex = groupIndex
proGroupVoGoodsIndex = goodsIndex
refChooseGuige.value.open(skuList)
}
function refChooseGuigeConfirm(sku) {
console.log(sku);
FormData.proGroupVo[proGroupVoIndex].goods[proGroupVoGoodsIndex].skuName = sku.specSnap || sku.name
FormData.proGroupVo[proGroupVoIndex].goods[proGroupVoGoodsIndex].skuId = sku.id
proGroupVoIndex = undefined
@@ -917,7 +918,7 @@
function proGroupVoAddGoods(index, arr) {
proGroupVoIndex = index
if(!FormData.proGroupVo){
if (!FormData.proGroupVo) {
initDefaultProGroupVo()
}
if (FormData.groupType == 0) {
@@ -946,7 +947,6 @@
}
function refChooseGoodsConfirm(arr) {
console.log(arr);
refChooseGoodsClose()
arr = arr.map(v => {
const {
@@ -975,10 +975,8 @@
skuName: ''
}
})
console.log(arr);
console.log(FormData.groupType);
if (FormData.groupType == 0) {
console.log(FormData.proGroupVo[0]);
return FormData.proGroupVo[0].goods = arr
}
if (FormData.groupType == 1 && proGroupVoIndex !== undefined) {
@@ -1231,15 +1229,15 @@
//表单边框
const inputBorder = ref(false)
const FormData = reactive({
days: '',
startTime: '',
endTime: '',
days: "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
endTime: "23:59",
startTime: "00:00",
//每日销量上限,
dayLimit: 0,
singleOrderLimit:0,
singlePeopleLimit:0,
singleOrderLimit: 0,
singlePeopleLimit: 0,
type: 'normal',
showType: 'table',
showType: ['table'],
specsInfoName: '',
id: "",
typeEnum: "normal",
@@ -1365,7 +1363,7 @@
res.specsInfoName = specsInfoName
$goodsData = res
skuList.list = res.skuList
res.showType=res.showType.split(',')
res.showType = res.showType.split(',')
Object.assign(FormData, res)
//多规格
if (res.typeEnum === 'sku') {
@@ -1573,6 +1571,12 @@
getTbShopUnit()
getTbProductSpec()
})
const changeFormDatatype = (e) => {
console.log(e)
console.log(FormData)
// 当是称重商品时 默认是单规格
FormData.typeEnum = 'normal'
}
onShow(() => {
// if (option.type === 'edit') {
@@ -1686,13 +1690,15 @@
}
}
if (type == 'package') {
if (groupType == 0) {
if (groupType == 0 && FormData.proGroupVo[0].goods.length <= 0) {
// 固定套餐
return infoBox.showToast('套餐组合至少需要包含一种商品,请添加商品')
}
if (groupType == 1) {
let ispase = FormData.proGroupVo.length > 0 ? true : false
let tips = ispase ? '' : '请添加至少一种套餐'
for (let i in FormData.proGroupVo) {
FormData.proGroupVo[i].count = FormData.proGroupVo[i].goods.length
const item = FormData.proGroupVo[i]
if (item.goods.length <= 0) {
ispase = false
@@ -1711,14 +1717,14 @@
// 可选套餐
}
}
if (type == 'weight') {
if (type == 'weigh') {
if (!FormData.weight) {
return infoBox.showToast('请输入重量')
}
}
const submitData = {
...FormData,
showType:FormData.showType.join(','),
showType: FormData.showType.join(','),
proGroupVo: type != 'package' ? '' : FormData.proGroupVo,
images: images,
coverImg: images[0] || '',
@@ -1744,6 +1750,19 @@
})
})
}
// 如果套餐没选择规格,默认选中第一条
console.log(submitData.proGroupVo)
if (submitData.proGroupVo) {
submitData.proGroupVo.forEach((res, index) => {
submitData.proGroupVo[index].goods.forEach(ele => {
if (!ele.skuId) {
ele.skuId = ele.skuList[0].id
ele.skuName = ele.skuList[0].specSnap || ele.skuList[0].name
}
})
})
}
submitData.selectSpec =
$addProduct(submitData).then(res => {
infoBox.showSuccessToast('添加成功')
@@ -1767,7 +1786,6 @@
return result.replace(/.$/, "")
}
})
/**
* 监听规格保存,拿到数据
*/
@@ -1931,12 +1949,15 @@
watch(() => FormData.type, (newval) => {
if (option.type == 'edit') {
if (newval == $goodsData.type) {
if($goodsData.proGroupVo){
FormData.proGroupVo = $goodsData.proGroupVo||[]
}else{
if ($goodsData.proGroupVo) {
FormData.proGroupVo = $goodsData.proGroupVo || []
} else {
initDefaultProGroupVo()
}
}
if (FormData.groupType == null) {
FormData.groupType = 0
}
} else {
if (newval == 'package') {
initDefaultProGroupVo()
@@ -2002,11 +2023,22 @@
disabledChangeCategory.value = !res
}
}
const activeinHouseList = computed(() => {
try {
return pageData.units.filter((item) => {
if (item.id == FormData.unitId) {
return item.name
}
})[0].name
} catch (error) {
//TODO handle the exception
}
});
/**
* 权限end
*/
watch(() => pageData.types, (newval) => {
Forms.value.setRules(rules)
})
@@ -2017,6 +2049,7 @@
onReady(() => {
Forms.value && Forms.value.setRules(rules)
})
onBeforeUnmount(() => {
clearTimeout(timer)
})
@@ -2130,7 +2163,8 @@
flex-wrap: nowrap;
justify-content: space-between;
}
::v-deep .typeEnum .u-checkbox-group--row{
::v-deep .typeEnum .u-checkbox-group--row {
flex-wrap: nowrap;
justify-content: space-between;
}

View File

@@ -91,7 +91,8 @@
const hour = times.value[0][indexArr[0]]
const month = times.value[1][indexArr[1]]
const s = times.value[2][indexArr[2]]
return `${hour}:${month}:${s}`
// return `${hour}:${month}:${s}`
return `${hour}:${month}`
}
//获取$event.detail.value
function getEnentDetailValue(e) {
@@ -152,11 +153,11 @@
function returnBasicTimeConstructor() {
return {
startTime: {
value: '00:00:00',
value: '00:00',
index: [0, 0, 0]
},
endTime: {
value: '00:00:00',
value: '23:59',
index: [0, 0, 0]
}
}
@@ -190,13 +191,13 @@
}
// 触发定时器保存事件将数据给到添加商品页面
function emitTimerSave() {
const par={
days:list.value[0].cycleChecked.join(','),
startTime:list.value[0].startTime.value,
endTime:list.value[0].endTime.value
const par = {
days: list.value[0].cycleChecked.join(','),
startTime: list.value[0].startTime.value,
endTime: list.value[0].endTime.value
}
console.log(par);
uni.$emit('timerSave',par)
uni.$emit('timerSave', par)
go.back()
}
@@ -207,14 +208,14 @@
function returnTimeIndex(time) {
console.log(time);
return time.split(':').map(v=>{
return v*1
return time.split(':').map(v => {
return v * 1
})
}
function returnTimer(res) {
return [{
cycleChecked: res.days ? res.days.split(',').filter(v=>v) : [],
cycleChecked: res.days ? res.days.split(',').filter(v => v) : [],
startTime: res.startTime ? {
value: res.startTime,
index: returnTimeIndex(res.startTime)

View File

@@ -11,7 +11,7 @@
<!-- 不需要label, 需要修改 label-width="0" -->
<uni-forms ref="loginFormRef" label-width="0" :model="vdata.formData" :rules="rules">
<view >
<view>
<uni-forms-item name="username">
<uni-easyinput class='jeepay-easyinput' placeholder="请输入登录名/手机号"
v-model="vdata.formData.username" :clearable="false">
@@ -29,7 +29,8 @@
</template>
<template #suffixIcon>
<view class='show-tips' @tap="vdata.isShowPwd = !vdata.isShowPwd ">
{{ vdata.isShowPwd ? '隐藏' : '显示' }}</view>
{{ vdata.isShowPwd ? '隐藏' : '显示' }}
</view>
</template>
</uni-easyinput>
</uni-forms-item>
@@ -55,7 +56,6 @@
</view>
</template>
<script setup>
import {
login
} from '@/http/businessApiManger.js';
@@ -107,12 +107,11 @@
function loginFunc() {
// 表单验证
formUtil.validate(loginFormRef.value).then(() => {
login(vdata.formData).then((res) => {
console.log(res);
useStorage.set('token', res.data.token);
useStorage.set('userInfo', res.data.user);
uni.showToast({

View File

@@ -8,8 +8,7 @@
"^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue"
}
},
"pages": [
{
"pages": [{
"pageId": "PAGES_INDEX",
"path": "pages/index/index",
"style": {
@@ -631,6 +630,13 @@
"navigationBarTitleText": "确认订单"
}
},
{
"pageId": "PAGES_ROTATING_TABLES",
"path": "confirm-order/rotatingTables",
"style": {
"navigationBarTitleText": "转桌/并桌"
}
},
{
"pageId": "PAGES_CHOOSE_TABLE",
"path": "choose-table/choose-table",
@@ -639,7 +645,7 @@
}
},
{
"pageId": "PAGES_ADD_TEMP_CUISINE",
"pageId": "PAGES_CHOOSE_ADD_TEMP_CUISINE",
"path": "add-temp-cuisine/add-temp-cuisine",
"style": {
"navigationBarTitleText": "添加临时菜"
@@ -760,13 +766,28 @@
{
"root": "pageBwc",
"pages": [{
"pageId": "PAGES_BWC",
"path": "index/index",
"style": {
"navigationBarTitleText": "霸王餐"
}
"pageId": "PAGES_BWC",
"path": "index/index",
"style": {
"navigationBarTitleText": "霸王餐"
}
]
}]
},
{
"root": "pagewriteoff",
"pages": [{
"pageId": "PAGES_WEITEOFF",
"path": "index/index",
"style": {
"navigationBarTitleText": "核销列表"
}
}, {
"pageId": "PAGES_WEITEOFF_RECORD",
"path": "index/record",
"style": {
"navigationBarTitleText": "核销记录"
}
}]
},
{
"root": "pageBooking",
@@ -877,11 +898,10 @@
}
},
{
"path" : "quan/quan",
"path": "quan/quan",
"pageId": "PAGES_ORDER_QUAN",
"style" :
{
"navigationBarTitleText" : "券包"
"style": {
"navigationBarTitleText": "券包"
}
}
@@ -1094,44 +1114,42 @@
{
"root": "pageNotification",
"pages": [{
"pageId": "PAGES_NOTIFICATION_INDEX",
"path": "index",
"style": {
"navigationBarTitleText": "订阅通知"
}
"pageId": "PAGES_NOTIFICATION_INDEX",
"path": "index",
"style": {
"navigationBarTitleText": "订阅通知"
}
]
}]
},
{
"root": "pageCreditBuyer",
"pages": [{
"pageId": "PAGES_CREDIT_BUYER_INDEX",
"path": "index",
"style": {
"navigationBarTitleText": "挂账管理"
}
},{
"pageId": "PAGES_CREDIT_BUYER_ADDDEBTOR",
"path": "addDebtor",
"style": {
"navigationBarTitleText": "挂账人"
}
},{
"pageId": "PAGES_CREDIT_BUYER_REPAYMENTRECORD",
"path": "rePaymentRecord",
"style": {
"navigationBarTitleText": "账单付款记录"
}
},{
"pageId": "PAGES_CREDIT_BUYER_DETAIL",
"path": "creditDetail",
"style": {
"navigationBarTitleText": "查看明细"
}
"pageId": "PAGES_CREDIT_BUYER_INDEX",
"path": "index",
"style": {
"navigationBarTitleText": "挂账管理"
}
]
}, {
"pageId": "PAGES_CREDIT_BUYER_ADDDEBTOR",
"path": "addDebtor",
"style": {
"navigationBarTitleText": "挂账人"
}
}, {
"pageId": "PAGES_CREDIT_BUYER_REPAYMENTRECORD",
"path": "rePaymentRecord",
"style": {
"navigationBarTitleText": "账单付款记录"
}
}, {
"pageId": "PAGES_CREDIT_BUYER_DETAIL",
"path": "creditDetail",
"style": {
"navigationBarTitleText": "查看明细"
}
}]
}
],
"globalStyle": {
"navigationBarTextStyle": "black",

View File

@@ -284,8 +284,11 @@
// pageUrl: 'PAGES_RED_INDEX',
// entId: 'ENT_MCH_MEMBER'
// },
{
title: '核销管理',
icon: '/static/indexImg/pagewriteoff.svg',
pageUrl: 'PAGES_WEITEOFF'
},
{
title: '退出登录',
icon: '/static/indexImg/icon-login-out.svg',
@@ -373,6 +376,7 @@
/* #endif */
/* #ifndef H5 */
padding-top: calc(84rpx + 44px);
/* #endif */
>view {
text-align: center;

View File

@@ -109,7 +109,7 @@
</view>
</uni-forms>
<view class="agreement-policy">
<JeepayCheckbox v-model:checked="vdata.isSelectedAgreement" />
同意
@@ -117,8 +117,8 @@
<text></text>
<text class="policy" @click="toPrivacy">隐私政策</text>
</view>
<!-- <view class="agreement-policy">
<JeepayCheckbox v-model:checked="vdata.isSelectedAgreement" />
同意
@@ -173,6 +173,7 @@
import timer from '@/commons/utils/timer.js'
import formUtil from '@/commons/utils/formUtil.js'
import EnvChangeTips from './components/EnvChangeTips.vue'
import dayjs from 'dayjs' //时间格式库
import {
getExtStoreId
} from "@/commons/utils/versionManage.js"
@@ -249,7 +250,7 @@
})
// #ifdef H5
vdata.formData.username = '17792050546'
vdata.formData.pwd = 'sy666888'
vdata.formData.pwd = 'qwer1234'
// #endif
// #ifdef MP-WEIXIN
// vdata.formData.username = '15699991111'
@@ -258,11 +259,11 @@
function accountTypeChange(e) {
// #ifdef H5
if(e==1){
if (e == 1) {
vdata.formData.merchantName = '18049104914'
vdata.formData.username = '13666666666'
vdata.formData.pwd = '123456'
}else{
} else {
vdata.formData.pwd = 'qwer1234'
}
// #endif
@@ -301,6 +302,7 @@
}
function loginFunc() {
// 表单验证
formUtil.validate(loginFormRef.value).then(() => {
if (!vdata.isSelectedAgreement) {
@@ -375,11 +377,21 @@
storageManage.shopId(loginBizData.shopId)
storageManage.shopUserId(loginBizData.user.user.id)
storageManage.userInfo(loginBizData)
var time1 = new Date();
var time2 = new Date(loginBizData.expireDate);
let les = (time1.getTime() - time2.getTime()) / 86400000;
uni.showToast({
title: '店铺账号有限期至' + loginBizData.expireDate + ',店铺账号到期剩余' + Math.abs(les.toFixed(0)) + '天!',
icon: 'none'
});
setTimeout(() => {
// 跳转到首页
go.to("PAGES_INDEX", {
isGetCid: true
}, go.GO_TYPE_RELAUNCH)
}, 1000)
// 跳转到首页
go.to("PAGES_INDEX", {
isGetCid: true
}, go.GO_TYPE_RELAUNCH)
}
// 点击发送验证码的函数

View File

@@ -125,9 +125,12 @@
reactive,
onMounted,
ref,
onBeforeMount
onBeforeMount,
} from 'vue';
import {onLoad} from '@dcloudio/uni-app'
import {
onLoad,
onShow
} from '@dcloudio/uni-app'
const units = reactive({
list: [],
current: ''
@@ -187,11 +190,12 @@
}]
},
}
let timer=null
let timer = null
function submit() {
refform.value.validate(res => {
console.log(res)
if(!res){
if (!res) {
$temporaryDishes({
"useType": option.useType,
"masterId": option.masterId,
@@ -200,15 +204,15 @@
"categoryId": category[categoryCurrent.value].id,
"price": form.price,
"num": form.num,
unit:units.list[units.current].id,
unit: units.list[units.current].id,
"note": form.note,
"vipUserId": option.vipUserId
}).then(r=>{
}).then(r => {
uni.$emit('add:cashCai')
clearInterval(timer)
timer=setTimeout(()=>{
timer = setTimeout(() => {
uni.navigateBack()
},500)
}, 500)
})
}
}).catch(err => {
@@ -234,7 +238,7 @@
page: 0,
size: 600
})
const arr = returnAllCategory(res.content).map(v => {
const arr = forList(res.content).map(v => {
return {
...v,
value: v.id
@@ -244,23 +248,39 @@
for (let i in arr) {
category[i] = arr[i]
}
console.log(category);
}
function forList(arr) {
let arrs = []
arr.forEach(ele => {
arrs.push(ele)
if (ele.childrenList.length) {
ele.childrenList.forEach(res => {
arrs.push(res)
})
}
})
return arrs
}
async function init() {
getTbShopUnit()
getCategory()
}
onMounted(() => {
init()
// onMounted(() => {
// init()
// })
onLoad((opt) => {
Object.assign(option, opt)
setTimeout(() => {
init()
}, 600)
})
onBeforeMount(()=>{
onBeforeMount(() => {
clearInterval(timer)
})
const option=reactive({
})
onLoad((opt)=>{
Object.assign(option,opt)
const option = reactive({
})
</script>

View File

@@ -1,9 +1,9 @@
<template>
<my-model ref="model" :title="title" iconColor="#000" @close="resetForm">
<template #desc>
<view class="u-m-t-48 tab">
<!-- <view class="u-m-t-48 tab">
<my-tabs :list="tabs" @change="tabsChange"></my-tabs>
</view>
</view> -->
<view class="u-text-left u-p-30 ">
<template v-if="!current">
<view>
@@ -34,7 +34,6 @@
<view class="u-flex-1">
<input @input="discountMoneyInput" v-model="form.discountMoney" type="digit"
placeholder-class="placeholder-class" placeholder="减8.55元请输入8.55" />
</view>
<view class="color-999 u-p-l-48 u-p-r-48 u-flex u-row-center u-col-center">
<view></view>
@@ -46,19 +45,22 @@
</view>
</template>
<view class="u-m-t-48">
<view class="u-font-24">
<text class="color-999">打折原因</text>
<text class="color-red">*</text>
</view>
<view class="u-font-24">
<text class="color-999">当前单品价格{{price}}</text>
</view>
<view class="u-font-24">
<text class="color-999">打折原因</text>
<text class="color-red">*</text>
</view>
<view class="u-flex u-m-t-24">
<view class="u-flex" v-for="(item,index) in causes" :key="index">
<button @tap="changeCauses(item)" class="tag u-m-r-20"
<button @tap="changeCauses(item,index)" class="tag u-m-r-20"
:class="{active:item.checked}">{{item.name}}</button>
</view>
</view>
</view>
<view class="u-m-t-32 u-flex ">
<uni-easyinput type="textarea" v-model="value" placeholder="自定义内容"></uni-easyinput>
<uni-easyinput type="textarea" v-model="form.note" placeholder="自定义内容"></uni-easyinput>
</view>
</view>
@@ -67,7 +69,10 @@
<view class="u-p-30">
<view class="u-m-t-10">
<my-button @tap="confirm" shape="circle" showShadow>确认</my-button>
<my-button type="cancel" bgColor="#fff" @tap="confirm">取消</my-button>
<view style="height: 20rpx;">
</view>
<!-- <my-button type="cancel" bgColor="#fff" @tap="confirm">取消</my-button> -->
</view>
</view>
</template>
@@ -86,7 +91,7 @@
import myTabs from '@/components/my-components/my-tabs.vue'
const props = defineProps({
price: {
type: [Number,String],
type: [Number, String],
default: 0
},
title: {
@@ -98,12 +103,10 @@
default: []
}
})
function changeCauses(item) {
item.checked = !item.checked
}
const discounts = [95, 90, 85, 80]
const causes = reactive([{
@@ -120,6 +123,11 @@
}
])
function changeCauses(item, index) {
item.checked = !item.checked
form.notes = causes
}
function discountInput(e) {
if (e.detail.value >= 100) {
nextTick(() => {
@@ -127,8 +135,9 @@
})
}
}
function discountMoneyInput(e) {
const max=100
const max = 100
if (e.detail.value >= max) {
nextTick(() => {
form.discountMoney = 100
@@ -142,7 +151,7 @@
const tabs = ['打折', '减免']
let current = ref(0)
let current = ref(1)
function tabsChange(i) {
console.log(i);
@@ -158,11 +167,12 @@
const form = reactive({
...$form
})
watch(()=>props.price,(newval)=>{
watch(() => props.price, (newval) => {
console.log(newval);
form.price=newval
form.currentPrice=newval
form.price = newval
form.currentPrice = newval
})
function resetForm() {
Object.assign(form, {
...$form
@@ -182,22 +192,23 @@
function confirm() {
const {
discount,discountMoney
discount,
discountMoney
} = form
if (current.value===0&& discount==='') {
if (current.value === 0 && discount === '') {
return uni.showToast({
icon: 'none',
title: '请输入有效折扣!'
})
}
if (current.value===1&& discountMoney==='') {
if (current.value === 1 && discountMoney === '') {
return uni.showToast({
icon: 'none',
title: '请输入有效减免价格!'
})
}
close()
emits('confirm', form)
close()
}
defineExpose({
open,

View File

@@ -112,6 +112,14 @@
</view>
</view>
</template>
<!-- <template v-if="goods.list[0].tableId&&goods.list[0].orderId">
<view class="block" @tap="rotatingTables"
style="display: flex;align-items: center;justify-content: space-between;">
<view>转桌/并桌</view>
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</template> -->
</template>
<view class="block">
@@ -136,10 +144,15 @@
:key="index">
<view class="u-flex u-row-between ">
<view class="u-flex">
<image class="img" :src="item.coverImg" mode=""></image>
<image class="img" v-if="item.coverImg" :src="item.coverImg" mode=""></image>
<view
style="background-color: #3f9eff; width: 84rpx;height: 84rpx;line-height: 84rpx;text-align: center;color: #fff;"
v-else>
临时菜
</view>
<view class="u-m-l-32">
<view class="u-flex">
<view class="u-flex u-m-r-20" v-if="item.isWait">
<view class="u-flex u-m-r-20" v-if="item.isWaitCall">
<uni-tag text="等叫"
custom-style="background-color: #FFF0DF; border-color: #FFF0DF; color: #FF9F2E;">
</uni-tag>
@@ -154,6 +167,11 @@
custom-style="background-color: #E6F0FF; border-color: #E6F0FF; color: #318AFE;"
size="small" text="打包" inverted type="success" />
</view>
<view class="u-m-r-20 u-flex" v-if="item.isPrint">
<uni-tag
custom-style="background-color: #E6F0FF; border-color: #E6F0FF; color: #318AFE;"
size="small" text="打印" inverted type="success" />
</view>
<view>
{{item.name}}
</view>
@@ -174,7 +192,8 @@
<text
class="line-th color-999">{{formatPrice(item.salePrice*item.number) }}</text>
<view class="u-absolute" style="right: 0;bottom: 100%;">
<text class="font-bold">{{formatPrice(item.memberPrice*item.number) }}</text>
<text
class="font-bold">{{formatPrice(item.memberPrice*item.number) }}</text>
</view>
</template>
<template v-else>
@@ -196,9 +215,10 @@
</template>
<scroll-view class="u-m-t-32" scroll-x="true" v-if="index==goods.sel">
<view class=" u-flex no-wrap ">
<!-- <view class="u-flex u-m-r-20 u-m-b-20">
<button class="tag" hover-class="hover-class" @tap="showModel('discount')">单品打折</button>
</view> -->
<view class="u-flex u-m-r-20 " v-if="!item.isGift">
<button class="tag" hover-class="hover-class"
@tap="showModel('discount',index)">单品打折</button>
</view>
<view class="u-flex u-m-r-20 ">
<!-- <button class="tag" hover-class="hover-class" @tap="showModel('giveFood')">赠菜</button> -->
<button class="tag" hover-class="hover-class"
@@ -208,10 +228,14 @@
<button class="tag" hover-class="hover-class"
@tap="toggleGoodsItemKey(item,index,'isPack')">{{item.isPack?'取消打包':'打包'}}</button>
</view>
<!-- <view class="u-flex u-m-r-20 u-m-b-20">
<view class="u-flex u-m-r-20 ">
<button class="tag" hover-class="hover-class"
@tap="toggleWait(item)">{{item.isWait?'取消等叫':'等叫'}}</button>
</view> -->
@tap="toggleWait(item)">{{item.isWaitCall?'取消等叫':'等叫'}}</button>
</view>
<view class="u-flex u-m-r-20 ">
<button class="tag" hover-class="hover-class"
@tap="toggisPrint(item)">{{item.isPrint?'免厨打':'打印'}}</button>
</view>
<view class="u-flex u-m-r-20 ">
<button class="tag" hover-class="hover-class"
@tap="showModel('remark',index)">单品备注</button>
@@ -251,7 +275,7 @@
<view class="font-bold u-font-32">{{formatPrice(youhui) }}</view>
</view>
</view>
<view class="u-flex price u-m-l-32">
<view class="">实收金额</view>
<view class="font-bold u-font-32">{{formatPrice(allPrice) }}</view>
@@ -278,8 +302,8 @@
</view>
</view>
<model-discount title="菜品打折/减免" :ref="setModel" name="discount" :price="allPrice"></model-discount>
<model-discount title="菜品减免" :ref="setModel" name="discount" :price="modelData.data.salePrice"
@confirm="discountconfirm"></model-discount>
<give-food title="赠菜" :ref="setModel" name="giveFood"></give-food>
<one-remark @confirm="goodsOneRemarkConfirm" title="单品备注" :ref="setModel" name="remark"></one-remark>
<edit-discount title="优惠金额" :ref="setModel" name="editMoney" :price="allPrice"></edit-discount>
@@ -351,7 +375,31 @@
return Number(n).toFixed(2)
}
function rotatingTables() {
uni.navigateTo({
url: '/pagesCreateOrder/confirm-order/rotatingTables?item='+JSON.stringify(goods.list),
})
}
// 单品打折
async function discountconfirm(form) {
if (form.discountMoney != '.') {
let str = ''
if (form.notes) {
form.notes.forEach(ele => {
if (ele.checked) {
str = str + ele.name + ','
}
})
}
let obj = {
saleAmount: form.discountMoney,
note: str + form.note,
cartId: modelData.data.id
}
const res = await Api.$updatePrice(obj)
getCart()
}
}
//用餐人数
const userNumbers = reactive({
@@ -416,18 +464,46 @@
skuId
}
par[key] = !item[key]
const res = await Api.$updateCart(par)
goods.list[index][key] = returnBoolean(res[key])
if (key == 'isPack') {
getCart()
}
getCart()
}
//等叫
function toggleWait(item) {
item.isWait = !item.isWait
async function toggleWait(item) {
item.isWaitCall = !item.isWaitCall
let obj = {
cartId: item.id,
isGift: item.isGift,
isPack: item.isPack,
isPrint: item.isPrint,
isWaitCall: item.isWaitCall,
masterId: option.masterId,
num: item.number, // 0会删除此商品
productId: item.productId,
skuId: item.skuId,
vipUserId: '',
}
let res = await Api.$updateCart(obj)
}
// 打印
async function toggisPrint(item) {
item.isPrint = !item.isPrint
let obj = {
cartId: item.id,
isGift: item.isGift,
isPack: item.isPack,
isPrint: item.isPrint,
isWaitCall: item.isWaitCall,
masterId: option.masterId,
num: item.number, // 0会删除此商品
productId: item.productId,
skuId: item.skuId,
vipUserId: '',
}
let res = await Api.$updateCart(obj)
}
const eatTypes = reactive({
list: [{
@@ -479,7 +555,6 @@
function watchChooseuser() {
uni.$off('choose-user')
uni.$on('choose-user', (data) => {
console.log(data);
user.value = data
setUser()
})
@@ -520,20 +595,25 @@
totalNumber: 0,
totalAmount: 0,
})
const isVip=computed(()=>{
return $shop.value.isMemberPrice&& user.value&&user.value.id&&user.value.isVip
const isVip = computed(() => {
return $shop.value.isMemberPrice && user.value && user.value.id && user.value.isVip
})
const discountSaleAmount = computed(() => {
return goods.list.filter((v) => v.discountSaleAmount && v.discountSaleAmount > 0)
.reduce((a, b) => {
return a + b.number * b.discountSaleAmount;
}, 0);
})
const goodsPrice = computed(() => {
const goodsTotalPrice = goods.list.reduce((prve, cur) => {
const memberPrice=cur.memberPrice?cur.memberPrice:cur.salePrice
const tPrice = (isVip.value? memberPrice:cur.salePrice) * cur.number
const memberPrice = cur.memberPrice ? cur.memberPrice : cur.salePrice
const tPrice = (isVip.value ? memberPrice : cur.salePrice) * cur.number
const tpackFee = cur.isPack ? cur.packFee * 1 : 0
return prve + (cur.isGift ? 0 : tPrice) + tpackFee
}, 0)
return (goodsTotalPrice || 0).toFixed(2)
return ((goodsTotalPrice - discountSaleAmount.value) || 0).toFixed(2)
})
const allPrice = computed(() => {
console.log(goodsPrice.value);
const n = goodsPrice.value * 1 + $seatFee.totalAmount
return n.toFixed(2)
// const goodsTotalPrice = goods.list.reduce((prve, cur) => {
@@ -541,18 +621,21 @@
// }, 0)
// return (goodsTotalPrice + ($seatFee.totalAmount || 0)).toFixed(2)
})
const youhui=computed(()=>{
if(user.value&&user.value.id&&user.value.isVip){
const goodsTotalPrice = goods.list.reduce((prve, cur) => {
const youhui = computed(() => {
let goodsTotalPrice = 0
if (user.value && user.value.id && user.value.isVip) {
goodsTotalPrice = goods.list.reduce((prve, cur) => {
const tPrice = cur.salePrice * cur.number
const tpackFee = cur.isPack ? cur.packFee * 1 : 0
return prve + tPrice + tpackFee
}, 0)
return goodsTotalPrice-allPrice.value
}else{
return 0
return goodsTotalPrice - allPrice.value
} else {
console.log(discountSaleAmount.value, '优惠金额')
return (discountSaleAmount.value)
}
return goodsTotalPrice
console.log(discountSaleAmount.value, '优惠金额1')
return (goodsTotalPrice + discountSaleAmount.value * 1).toFixed(2)
})
function setGoodsItem(key, val) {
@@ -573,16 +656,16 @@
records,
seatFee
} = await Api.getCart(par)
let useType=''
let useType = ''
if (seatFee && seatFee.useType) {
useType=seatFee.useType
useType = seatFee.useType
$storageManage.useType(useType)
}else{
useType=records[0].info[0].useType
} else {
useType = records[0].info[0].useType
$storageManage.useType(useType)
}
console.log(useType);
eatTypes.active =useType == 'takeout' ? useType : useType.replace(
eatTypes.active = useType == 'takeout' ? useType : useType.replace(
/-after|-before/g, '');
goods.list = getNowCart(records)
if (seatFee && seatFee.totalNumber) {

View File

@@ -0,0 +1,203 @@
<template>
<view style="padding: 20rpx;">
<view class="uni-padding-wrap uni-common-mt">
<uni-segmented-control :current="datas.current" :values=" ['转桌', '并桌']" style-type="button"
active-color="#007aff" @clickItem="onClickItem" />
</view>
<view class="u-m-t-48">
请选择其他桌
</view>
<view class="uni-list">
<radio-group @change="radioChange" v-if="datas.tableList.length">
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in datas.tableList" :key="index">
<view class="u-m-t-48 u-m-b-48">
<radio :value="item.tableId" /> {{item.name}}
</view>
</label>
</radio-group>
<view v-else>
暂无数据
</view>
</view>
<view class="uni-list" v-if="datas.current==0">
<view class="u-m-t-48">
请选择需要转桌的菜品
</view>
<checkbox-group @change="checkboxChange">
<label class="uni-list-cell uni-list-cell-pd" v-for="(item,index) in datas.item" :key="index">
<view class="u-flex u-m-t-48 u-m-b-48" style="justify-content: space-between;align-items: center;">
<view class="u-flex">
<checkbox :value="item.cartId" />
<image class="img" v-if="item.coverImg" :src="item.coverImg" mode=""></image>
&nbsp;&nbsp;
{{item.name}}
</view>
<view class="">
<view class=" u-relative">
<template v-if="item.isGift">
<text class="line-th color-999">{{formatPrice(item.salePrice*item.number) }}</text>
<view class="u-absolute" style="right: 0;bottom: 100%;">
<text class="font-bold">0</text>
</view>
</template>
<template v-else>
<template v-if="isVip&&item.memberPrice&&item.memberPrice*1!=item.salePrice*1">
<text
class="line-th color-999">{{formatPrice(item.salePrice*item.number) }}</text>
<view class="u-absolute" style="right: 0;bottom: 100%;">
<text
class="font-bold">{{formatPrice(item.memberPrice*item.number) }}</text>
</view>
</template>
<template v-else>
<view class="font-bold">
<text></text>
<text class="">{{formatPrice(item.salePrice*item.number) }}</text>
</view>
</template>
</template>
</view>
<view class="color-999 u-text-right u-font-24 u-m-t-12">×{{item.number}}</view>
</view>
<!-- <text class=" color-999">{{formatPrice(item.salePrice*item.number) }}</text> -->
</view>
</label>
</checkbox-group>
</view>
<my-button shape="circle" @tap="confirm">确定</my-button>
</view>
</template>
<script setup>
import {
reactive,
defineProps
} from 'vue';
import {
onLoad,
onShow
} from '@dcloudio/uni-app';
import go from '@/commons/utils/go.js';
import {
$table,
tableswitch
} from '@/http/yskApi/table.js'
let datas = reactive({
current: 0,
item: "",
// 桌台列表
tableList: [],
// 并桌选中
selecttableList: '',
// 转桌数据
changeTable: []
})
const props = defineProps({
item: {
type: Array
},
tableId: {
type: String
}
})
onLoad((opt) => {
datas.item = JSON.parse(opt.item)
})
onShow(() => {
gettableList()
})
async function confirm() {
// 是否选择其他桌
if (datas.selecttableList) {
if (datas.current == 0) {
// 转桌是否选择菜品
if (datas.changeTable.length) {
let res = await tableswitch({
masterId: datas.item[0].masterId,
useType: datas.item[0].useType,
cartIds: datas.changeTable,
currentTableId: datas.item[0].tableId,
targetTableId: datas.selecttableList
})
if (res) {
uni.navigateBack({
delta: 2
})
}
} else {
uni.showToast({
title: '请选择菜品或桌号!',
icon: 'none'
});
}
} else {
let res = await tableswitch({
masterId: datas.item[0].masterId,
useType: datas.item[0].useType,
isFull: true,
currentTableId: datas.item[0].tableId,
targetTableId: datas.selecttableList
})
if (res) {
uni.navigateBack({
delta: 2
})
}
}
} else {
uni.showToast({
title: '请选择菜品或桌号!',
icon: 'none'
});
}
}
function radioChange(d) {
datas.selecttableList = d.detail.value
}
// 切换转/并桌
function onClickItem(e) {
if (datas.current !== e.currentIndex) {
datas.current = e.currentIndex
}
}
// 获取桌台
async function gettableList() {
const res = await $table.get({
page: 1,
size: 999
})
let arr = []
res.content.forEach((ele) => {
if (ele.status == 'using' && props.tableId != ele.tableId) {
arr.push(ele)
}
});
datas.tableList = arr
}
function formatPrice(n) {
return Number(n).toFixed(2)
}
function checkboxChange(e) {
datas.changeTable = e.detail.value
}
</script>
<style scoped lang="scss">
.goods {
// padding-bottom: 30rpx;
border-bottom: 1px dashed #E5E5E5;
.item {}
}
.img {
width: 84rpx;
height: 84rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx;
}
</style>

View File

@@ -6,7 +6,7 @@
<view class="u-absolute goods bg-fff">
<view
class="u-p-t-32 color-666 border-bottom bg-fff u-absolute total u-p-r-28 u-p-b-32 u-p-l-28 u-flex u-row-between">
<view>已添加{{goodsNumber}}件商品</view>
<view>已添加{{goodsNumber.toFixed(0)}}件商品</view>
<view class="color-666">
<uni-icons color="#666" type="trash"></uni-icons>
<text class="u-m-l-10" @tap="setModalShow('clear',true)">清空</text>
@@ -36,7 +36,7 @@
</image>
</view>
<view class="u-m-l-30 u-m-r-30 color-333">
{{item.number}}
{{(item.number).toFixed(2)}}
</view>
<view class="u-flex" @tap="updateNumber(true,index,item)">
<image src="/pagesCreateOrder/static/images/icon-add-black.svg" class="icon" mode="">

View File

@@ -1,30 +1,34 @@
<template>
<view class="u-relative u-flex item">
<up-image :src="data.coverImg" mode="aspectFill" :width="img.width" :height="img.height"></up-image>
<up-image :src="data.coverImg" mode="aspectFill" :width="img.width" :height="img.height"></up-image>
<!-- <image lazy-load class="img" :src="data.coverImg" mode="aspectFill" :style="computedImgStyle()"></image> -->
<view class="info u-flex u-row-between u-col-top u-flex-col" @tap="emitEvent('add')">
<view class="info u-flex u-row-between u-col-top u-flex-col">
<view>
<view>
<text class="u-line-2">{{data.name}}</text>
<text class="u-line-2">{{data.name}}
</text>
</view>
<view class="u-font-32 font-bold u-m-t-16">
{{data.price}}
</view>
<template v-if="data.type=='weigh'">
<view class="btnweigh">称重</view>
</template>
</view>
<view class="u-flex">
<template v-if="!isSellout">
<template v-if="!data.isDan">
<template v-if="!data.isDan||data.groupType==1">
<button class="btn" hover-class="btn-hover-class" @tap="emitEvent('chooseGuige')">选规格</button>
</template>
<template v-else>
<view class="u-flex icon-btn">
<view class="u-flex" @tap.stop="emitEvent('add')">
<view class="u-flex" @tap.stop="emitEvent(data.type=='weigh'?'tapweigh':'add')">
<image src="/pagesCreateOrder/static/images/icon-add.svg" class="icon" mode=""></image>
</view>
<template v-if="data.chooseNumber">
<view class="u-font-32">
{{data.chooseNumber}}
{{(data.chooseNumber).toFixed(2)}}
</view>
<view class="u-flex" @tap.stop="emitEvent('reduce')">
<image src="/pagesCreateOrder/static/images/icon-reduce.svg" class="icon" mode="">
@@ -55,20 +59,20 @@
} from 'vue';
import util from '../util.js';
const props = defineProps({
img:{
type:Object,
default:{
width:'250rpx',
height:'272rpx'
img: {
type: Object,
default: {
width: '250rpx',
height: '272rpx'
}
},
index: {
type: [Number,String],
type: [Number, String],
},
isSeatFee:{
isSeatFee: {
//是否为餐位费
type:Boolean,
default:false
type: Boolean,
default: false
},
data: {
type: Object,
@@ -79,36 +83,36 @@
}
}
})
function computedImgStyle(){
function computedImgStyle() {
return {
width:props.img.width,
height:props.img.height
width: props.img.width,
height: props.img.height
}
}
//判断是否是菜品
function isGoods(){
function isGoods() {
return props.data.hasOwnProperty('id')
}
//判断商品是否售尽
const isSellout = computed(() => {
const item = props.data
if(!isGoods()){
if (!isGoods()) {
return false
}
return (
item.isPauseSale ||
(item.typeEnum !== "sku" && item.isStock==1&& item.stockNumber <= 0)
(item.typeEnum !== "sku" && item.isStock == 1 && item.stockNumber <= 0)
);
})
const emits = defineEmits(['add', 'reduce', 'chooseGuige'])
function emitEvent(emitName){
if(isGoods()){
const emits = defineEmits(['add', 'reduce', 'chooseGuige','tapweigh'])
function emitEvent(emitName) {
if (isGoods()) {
emits(emitName, props.index)
}
}
@@ -133,10 +137,24 @@
color: #fff;
}
.btnweigh {
margin: 5rpx 0;
width: 100rpx;
background: linear-gradient(124deg, #73c969 6%, #27921b 93%);
border-radius: 10rpx;
font-size: 24rpx;
padding: 6rpx 0;
text-align: center;
}
.btn-hover-class {
opacity: .6;
}
image{will-change: transform}
image {
will-change: transform
}
.item {
// width: 250rpx;
// height: 272rpx;

View File

@@ -0,0 +1,181 @@
<template>
<my-model ref="model" borderRadius="12" :title="datas.title">
<template #desc>
<scroll-view scroll-y="true" style="height: 50vh;" class="u-p-30 guigeModel">
<view class="u-m-b-40" v-for="(item,index) in datas.skus" :key="index">
<view class="u-text-left">
<view class="color-333">{{item.title}} <text
style="color:#999">({{item.count}}{{item.number}})</text> </view>
</view>
<view class="u-flex u-m-t-20 u-flex-wrap">
<view class="item" @tap="chooseSkd(skd,item)" :class="{active:skd.select==true}"
v-for="(skd,skdIndex) in item.goods" :key="skdIndex">
{{skd.proName}}
</view>
</view>
</view>
</scroll-view>
</template>
<template #btn>
<view class="u-p-30 border-top ">
<view class="u-flex u-p-b-30 u-row-between">
<view class="price">
<text></text>
<text>{{datas.price}}</text>
</view>
</view>
<view class="u-m-t-10">
<my-button @tap="confirm">添加</my-button>
</view>
</view>
</template>
</my-model>
<uni-popup ref="popup" type="message">
<uni-popup-message type="info" message="请选择套餐" :duration="2000"></uni-popup-message>
</uni-popup>
</template>
<script setup>
import {
computed,
getCurrentInstance,
reactive,
ref,
watch
} from 'vue';
import util from '../util.js';
import infobox from '@/commons/utils/infoBox.js'
import myModel from '@/components/my-components/my-model.vue'
import myButton from '@/components/my-components/my-button.vue'
import {
onShow,
} from '@dcloudio/uni-app';
const props = defineProps({
goodsData: {
type: Object,
default: () => {}
},
})
let datas = reactive({
item: "",
title: "",
price: "",
skus: [],
// 几选几,的和
selectNumber: 0,
})
// const selSku = computed(() => {
// return props.skus.reduce((prve, cur) => {
// prve.push(cur.sel)
// return prve
// }, []).join()
// })
// const goods = computed(() => {
// return props.skuMap[selSku.value]
// })
watch(() => props.goodsData, (newval) => {
newval.proGroupVo.forEach(ele => {
ele.selectData = []
})
datas.item = newval
datas.title = newval.name
datas.price = newval.price
datas.skus = newval.proGroupVo
datas.skus.forEach(ele => {
datas.selectNumber += ele.number
})
})
const emits = defineEmits(['confirm', 'updateSku'])
function chooseSkd(skd, item) {
if (item.selectData.includes(skd.proId)) {
skd.select = false
let indexs = item.selectData.indexOf(skd.proId)
item.selectData.splice(indexs, 1)
} else {
if (item.selectData.length < item.number) {
skd.select = true
item.selectData.push(skd.proId)
}
}
}
const model = ref(null)
function open() {
model.value.open()
}
function close() {
datas.selectNumber = 0
model.value.close()
}
const instance = getCurrentInstance();
function confirm() {
// 将数据保存进对应的值
let arr = []
datas.item.proGroupVo.forEach(ele => {
arr.push(...ele.selectData)
})
if (arr.length == datas.selectNumber) {
emits('confirm', arr, datas.item)
close()
} else {
instance.ctx.$refs.popup.open()
}
}
defineExpose({
open,
close
})
</script>
<style lang="scss">
.border-top {}
.icon {
width: 40rpx;
height: 40rpx;
}
.guigeModel {
.item {
color: #666;
font-size: 24rpx;
padding: 4rpx 28rpx;
border: 1px solid #E5E5E5;
border-radius: 8rpx;
margin-right: 20rpx;
margin-bottom: 20rpx;
transition: all .2s ease-in-out;
&.active {
border-color: $my-main-color;
color: $my-main-color;
}
&.disabled {
color: #ccc;
border-color: #eee;
}
}
}
.price {
color: #EB4F4F;
}
.border-top {
border-top: 1px solid #E5E5E5;
}
</style>

View File

@@ -0,0 +1,290 @@
<template>
<view class="">
<up-overlay :show="overlayshow" @click="overlayshow = false">
<view class="boxoverlay">
<view class="rect" @tap.stop>
<view class="title">
<view>
标题
</view>
<view class="" @click="overlayshow = false">
<up-icon name="close" color="#93969b" size="20"></up-icon>
</view>
</view>
<view class="inputtop">
<view class="dj">
<view class="text">单价</view>
<view class="jg">{{form.goods.lowPrice}}/{{form.goods.unitName}}</view>
</view>
<view class="inputdj">
<view>重量</view>
<view class="inputdjbox">
<view class="inputdisplay">{{ currentInput }}</view>
<text>{{ form.goods.unitName }}</text>
</view>
</view>
</view>
<view class="keyboard">
<button v-for="(num, index) in numberButtons" :key="index" @click="handleClick(num)">
{{ num }}
</button>
<button @click="deleteLast"></button>
</view>
<view class="classmoney">
{{ (form.goods.lowPrice * currentInput).toFixed(2) }}
</view>
<view class="classconfirm" @click="clickconfirm">
确认
</view>
</view>
</view>
</up-overlay>
</view>
</template>
<script setup>
import {
onLoad,
onShow,
onReachBottom
} from '@dcloudio/uni-app';
import {
computed,
reactive,
ref,
watch,
defineExpose,
defineEmits
} from 'vue';
const emit = defineEmits(['refresh'])
const currentInput = ref('');
const numberButtons = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '.'];
const handleClick = (value) => {
// 首位不能输入0
if (currentInput.value === '') {
if (value === '0') {
return;
}
}
if (value === '.' && currentInput.value.indexOf('.') !== -1) {
return; // 如果已经存在小数点,不再添加
}
if (value === '.' && currentInput.value === '') {
currentInput.value = '0.';
} else {
currentInput.value += value;
}
// 限制小数点后两位
const parts = currentInput.value.split('.');
if (parts.length > 1 && parts[1].length > 2) {
currentInput.value = currentInput.value.slice(0, -1);
}
};
const deleteLast = () => {
currentInput.value = currentInput.value.slice(0, -1);
};
const clickconfirm = () => {
// 首位不能输入0
if (currentInput.value === '') {
uni.showToast({
title: '请输入',
icon: 'none'
})
return false;
}
emit('weighgoodsUpdate', form.foodsindex, form.index, true, undefined, currentInput.value)
overlayshow.value = false
}
//显示
const overlayshow = ref(false);
const form = reactive({})
const open = (foodsindex, index, goods) => {
currentInput.value = ''
Object.assign(form, {
foodsindex,
index,
goods
})
overlayshow.value = true
}
defineExpose({
open
})
</script>
<style lang="scss" scoped>
page {
background: #F9F9F9;
}
.boxoverlay {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
.rect {
padding: 32rpx 28rpx;
width: 80%;
background-color: #fff;
border-radius: 18rpx;
.title {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 20rpx;
font-size: 40rpx;
border-bottom: 1rpx solid #ccc;
}
.inputtop {
margin-top: 20rpx;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
.dj {
width: 32%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
.text {
font-weight: 300;
font-size: 24rpx;
}
.jg {
margin-top: 16rpx;
background-color: #e8f4ff;
color: #1890ff;
height: 60rpx;
line-height: 60rpx;
padding: 0 20rpx;
font-size: 24rpx;
color: #1890ff;
border-radius: 10rpx;
}
}
.inputdj {
width: 66%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
font-weight: 300;
font-size: 24rpx;
.inputdjbox {
margin-top: 16rpx;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
border: 1rpx solid #ccc;
border-radius: 10rpx;
padding-left: 20rpx;
height: 60rpx;
line-height: 60rpx;
background: #fff;
.inputdisplay {
width: auto;
}
text {
border: 1rpx solid #ccc;
border-radius: 10rpx;
border-radius: 10rpx;
padding: 0 20rpx;
background: #f5f7fa;
color: #a7aaaf;
}
}
}
}
.keyboard {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
button {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 28%;
margin: 10rpx;
}
.keyboard-button {
width: 28%;
margin: 10rpx;
border: none;
border-radius: 5rpx;
box-shadow: 0 0 5rpx rgba(0, 0, 0, 0.3), 0 0 10rpx rgba(0, 0, 0, 0.2);
cursor: pointer;
transition: all 0.3s ease;
}
// .keyboard-button:hover {
// box-shadow: 0 0 10rpx rgba(255, 0, 0, 0.5), 0 0 20px rgba(255, 0, 0, 0.3);
// transform: translateY(-2rpx);
// }
.dot-button {
// background-color: #FFC107;
}
.clear-button {
// background-color: #FF5733;
}
.clear-button:hover {
box-shadow: 0 0 10px rgba(255, 87, 51, 0.5), 0 0 20px rgba(255, 87, 51, 0.3);
}
.delete-button {
// background-color: #33FF57;
}
.delete-button:hover {
// box-shadow: 0 0 10px rgba(51, 255, 87, 0.5), 0 0 20px rgba(51, 255, 87, 0.3);
}
}
.classmoney {
margin-top: 16rpx;
width: 100%;
font-size: 40rpx;
text-align: left;
color: #ff5152;
font-weight: 600;
}
.classconfirm {
width: 100%;
margin: 30rpx auto 0 auto;
border-radius: 16rpx;
text-align: center;
background: #1890ff;
color: #fff;
padding: 10rpx 0;
}
}
}
</style>

View File

@@ -78,7 +78,8 @@
<view class="thumb-box" v-for="(goodsItem, goodsIndex) in item.foods" :key="goodsIndex">
<list-goods-item @chooseGuige="chooseGuige($event,index)"
@add="goodsUpdate($event,index,true)" @reduce="goodsUpdate($event,index,false)"
:index="goodsIndex" :data="goodsItem"></list-goods-item>
@tapweigh="tapweigh($event,index)" :index="goodsIndex"
:data="goodsItem"></list-goods-item>
</view>
<!-- <template v-if="item.name==='附加费'">
@@ -104,8 +105,8 @@
@chooseGuige="chooseGuige(goodsItem.goodsIndex,goodsItem.index)"
@add="searchGoodsUpdate(goodsItem,goodsIndex,true)"
@reduce="searchGoodsUpdate(goodsItem,goodsIndex,false)"
@tapweigh="tapweigh(goodsItem.goodsIndex,goodsItem.index)"
:index="goodsItem.goodsIndex" :data="goodsItem"></list-goods-item>
</view>
</view>
<my-img-empty v-if="!searchResult.length" tips="未搜索到相关商品"></my-img-empty>
@@ -120,15 +121,16 @@
<my-car :isCreateOrderToDetail="isCreateOrderToDetail" @updateNumber="carsNumberChange" :user="data.vipUser"
:masterId="data.masterId" :table="data.table" :data="cars" @clear="onClearCart"></my-car>
</view>
<!-- 套餐选择规格 -->
<taocanModel ref="taocanModelRef" @confirm="taocanConfirm" :goodsData="selGoods"></taocanModel>
<!-- 选择规格 -->
<guige-model @update-sku="updateSkuSel" @confirm="guigeConfirm" ref="chooseGuigeModel" :goodsData="selGoods"
:title="guigeModelData.title" :sku-map="guigeModelData.chooseGoods.skuMap"
:skus="guigeModelData.chooseGoods.skus"></guige-model>
<!-- 添加附加费 -->
<my-surcharge @confirm="surchargeConfirm" ref="surcharge" title="添加附加费"></my-surcharge>
<!-- 称重 -->
<weigh-item ref="refweighitem" @weighgoodsUpdate='goodsUpdate'></weigh-item>
</view>
<up-modal title="提示" content="该台桌购物车里有商品,是否清除该台桌里的商品?" :show="modal.clear" showCancelButton closeOnClickOverlay
@confirm="confirmModelConfirm" @cancel="confirmModelConfirm('cancel')" @close="setModalShow('clear',false)"
@@ -150,6 +152,8 @@
import util from './util.js';
import color from '@/commons/color.js';
import guigeModel from './components/guige'
import taocanModel from './components/taocanModel.vue'
import weighItem from './components/weigh.vue'
import listGoodsItem from './components/list-goods-item.vue'
import mySurcharge from './components/surcharge'
import {
@@ -277,6 +281,26 @@
}
return obj
}
// 添加套餐
async function taocanConfirm(d, item) {
const cartGoods = await addCart({
num: 1,
groupProductIdList: d,
productId: item.id,
skuId: item.specList[0].id
})
infoBox.showToast('添加成功')
// guigeConfirm(item, 1)
// updateCartGoods({
// productId: item.id,
// skuId: item.specList[0].id,
// cartId: cartGoods.id
// })
cars.push({
...cartGoods,
specSnap: item.specSnap
})
}
function scanCode() {
// 只允许通过相机扫码
@@ -671,11 +695,11 @@
}
function toLinshi() {
go.to('PAGES_ADD_TEMP_CUISINE',{
masterId:data.masterId,
tableId:data.table.tableId,
vipUserId:option.vipUserId?option.vipUserId:'',
useType:uni.getStorageSync('useType')
go.to('PAGES_CHOOSE_ADD_TEMP_CUISINE', {
masterId: data.masterId,
tableId: data.table.tableId,
vipUserId: option.vipUserId ? option.vipUserId : '',
useType: uni.getStorageSync('useType')
})
}
@@ -833,7 +857,14 @@
}
let selGoods = ref({})
let selGoods = ref({});
// 称重
const refweighitem = ref(null)
const tapweigh = (foodsindex, index) => {
const goods = data.tabbar[index].foods[foodsindex]
refweighitem.value.open(foodsindex, index, goods)
}
function chooseGuige(foodsindex, index) {
if (!canAddGoods()) {
@@ -843,13 +874,19 @@
}
const $goods = data.tabbar[index].foods[foodsindex]
selGoods.value = $goods
guigeModelData.title = $goods.name
const specList = $goods.specList;
const tagSnap = JSON.parse($goods.skuResult.tagSnap)
const skuMap = returnSelGoodsSkuMap(specList)
const skuList = returnSelGoodsSkuList(tagSnap)
setSkugoodsDefaultInit($goods, skuList, skuMap, specList)
chooseGuigeModel.value.open()
if ($goods.groupType == 1) {
instance.ctx.$refs.taocanModelRef.open()
} else {
guigeModelData.title = $goods.name
const specList = $goods.specList;
const skuMap = returnSelGoodsSkuMap(specList)
// 多规格,和套餐规格区分.groupType=1 套餐多规格
let tagSnap = JSON.parse($goods.skuResult.tagSnap)
const skuList = returnSelGoodsSkuList(tagSnap)
setSkugoodsDefaultInit($goods, skuList, skuMap, specList)
chooseGuigeModel.value.open()
}
}
async function guigeConfirm(sku, num) {
@@ -902,13 +939,15 @@
categoryId,
skuId
} = goods
const cartId = goods.id
const tabbarIndex = data.tabbar.findIndex(v => v.id == categoryId)
//临时菜没有对应商品数据
const $goods =!productId?undefined:data.tabbar[tabbarIndex].foods.find(v => v.id == productId)
const $goods = !productId ? undefined : data.tabbar[tabbarIndex].foods.find(v => v.id == productId)
//临时菜没有skuList
const $sku =!productId?{suit:1}:$goods.specList.find(v => v.id == skuId)
const $sku = !productId ? {
suit: 1
} : $goods.specList.find(v => v.id == skuId)
if (num === 0 || num < $sku.suit) {
//移除
@@ -958,7 +997,8 @@
searchResult.value[index].chooseNumber = chooseNumber
}
}
async function goodsUpdate(foodsindex, index, isAdd, searchGoodsIndex) {
async function goodsUpdate(foodsindex, index, isAdd, searchGoodsIndex, showCurrentInput) { // showCurrentInput 称重才会传的参数
// if (!canAddGoods()) {
// return infoBox.showToast('请先选择桌台', 0.5).then(res => {
// chooseTable()
@@ -972,13 +1012,13 @@
});
const productId = $goods.id
const skuId = $goods.specList[0].id
const suit = $goods.specList[0].suit || 1
let suit = $goods.specList[0].suit || 1
if (goodsInCarIndex !== -1) {
//更新
const carGoods = cars[goodsInCarIndex]
const cartId = carGoods.id
const step = isAdd ? 1 : -1
const num = carGoods.number * 1 + step
let num = carGoods.number * 1 + step
if (num === 0 || num < suit) {
//移除
cars.splice(goodsInCarIndex, 1)
@@ -988,6 +1028,10 @@
cartId
})
}
// 不影响之前的代码 称重num单独处理
if ($goods.type == 'weigh' && showCurrentInput) {
num = carGoods.number * 1 + Number(showCurrentInput)
}
const {
number
} = await updateCartGoods({
@@ -1000,16 +1044,23 @@
$goods.chooseNumber = number
setSearchGoods(searchGoodsIndex, number)
} else {
//增加
const num = suit
const cartGoods = await addCart({
num,
productId,
skuId
})
infoBox.showToast('添加成功')
$goods.chooseNumber = num
cars.push(cartGoods)
// 不影响之前的代码 称重suit单独处理
if ($goods.type == 'weigh' && showCurrentInput) {
suit = showCurrentInput
}
// 套餐和单规格
if ($goods.groupType != 1) {
//增加
const num = suit
const cartGoods = await addCart({
num,
productId,
skuId
})
infoBox.showToast('添加成功')
$goods.chooseNumber = Number(num)
cars.push(cartGoods)
}
}
return
}
@@ -1188,7 +1239,7 @@
setTabBar($category, $originGoods, cars)
}
onBeforeUnmount(() => {})
function watchUpdate() {
uni.$off('update:createOrderIndex')
uni.$off('get:table')
@@ -1201,7 +1252,7 @@
console.log('update:createOrderIndex');
init()
})
uni.$on('add:cashCai', async() => {
uni.$on('add:cashCai', async () => {
console.log('add:cashCai');
const cartRes = await getCart()
cars.length = 0

View File

@@ -4,6 +4,13 @@
<text class="">桌号</text>
<text class="">{{orderInfo.tableName||""}}</text>
</view>
<view class=" font-bold u-p-b-32 border-bottom u-m-b-24" v-if="orderInfo.tableName">
<view class="block" @tap="rotatingTables"
style="display: flex;align-items: center;justify-content: space-between;">
<view>转桌/并桌</view>
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</view>
<view class=" color-999 border-bottom u-p-b-24">
<text></text>
<text class="color-333 "> {{goodsNumber}}</text>
@@ -180,7 +187,7 @@
<text class="font-bold u-font-32">{{orderInfo.amount}}</text>
</view>
</template>
</view>
<!-- <view class="u-flex u-row-between u-m-t-20" v-if="orderInfo.status=='closed'">
<view></view>
@@ -347,57 +354,58 @@
}
const canTuiKuanPrice = computed(() => {
const goodsTotal= props.data.reduce((prve, cur) => {
// const curTotal=cur.info.filter(v=>!v.userCouponId).reduce((a,b)=>{
// return a+b.priceAmount*1
// },0)
const curTotal = cur.info.filter(v => !isTui(v)&& !v.userCouponId)
.reduce((a, b) => {
return a + b.priceAmount * 1
}, 0)
return prve + curTotal
}, 0)
console.log(goodsTotal);
console.log(seatFeePrice.value);
return (goodsTotal+seatFeePrice.value*1).toFixed(2)
const goodsTotal = props.data.reduce((prve, cur) => {
// const curTotal=cur.info.filter(v=>!v.userCouponId).reduce((a,b)=>{
// return a+b.priceAmount*1
// },0)
const curTotal = cur.info.filter(v => !isTui(v) && !v.userCouponId)
.reduce((a, b) => {
return a + b.priceAmount * 1
}, 0)
return prve + curTotal
}, 0)
console.log(goodsTotal);
console.log(seatFeePrice.value);
return (goodsTotal + seatFeePrice.value * 1).toFixed(2)
})
const TuiKuanPrice = computed(() => {
return props.data.reduce((prve, cur) => {
// const curTotal=cur.info.filter(v=>!v.userCouponId).reduce((a,b)=>{
// return a+b.priceAmount*1
// },0)
const curTotal = cur.info.filter(v => isTui(v)&&!v.userCouponId)
.reduce((a, b) => {
return a + b.priceAmount * 1
}, 0)
return prve + curTotal
}, 0)
})
const noTuiKuanPrice=computed(()=>{
return props.data.reduce((prve, cur) => {
const curTotal = cur.info.filter(v => !isTui(v)&&!v.userCouponId)
// const curTotal=cur.info.filter(v=>!v.userCouponId).reduce((a,b)=>{
// return a+b.priceAmount*1
// },0)
const curTotal = cur.info.filter(v => isTui(v) && !v.userCouponId)
.reduce((a, b) => {
return a + b.priceAmount * 1
}, 0)
return prve + curTotal
}, 0)
})
const cantuiSeatFee=computed(()=>{
let seatFee=props.orderInfo.seatInfo?(props.orderInfo.seatInfo.priceAmount):0
const noTuiKuanPrice = computed(() => {
return props.data.reduce((prve, cur) => {
const curTotal = cur.info.filter(v => !isTui(v) && !v.userCouponId)
.reduce((a, b) => {
return a + b.priceAmount * 1
}, 0)
return prve + curTotal
}, 0)
})
const cantuiSeatFee = computed(() => {
let seatFee = props.orderInfo.seatInfo ? (props.orderInfo.seatInfo.priceAmount) : 0
const bili = Math.floor((seatFee / canTuiKuanPrice.value) * 100) / 100
seatFee= Math.floor((props.orderInfo.amount-props.orderInfo.refundAmount) * bili * 100) / 100
seatFee = Math.floor((props.orderInfo.amount - props.orderInfo.refundAmount) * bili * 100) / 100
return seatFee
})
function returnCanTuiMoney(item) {
return props.orderInfo.status == 'unpaid'? item.priceAmount: item.canReturnAmount
return props.orderInfo.status == 'unpaid' ? item.priceAmount : item.canReturnAmount
if (props.orderInfo.status == 'unpaid') {
return returnTotalMoney(item)
} else {
if(props.orderInfo.pointsDiscountAmount>0||props.orderInfo.fullCouponDiscountAmount>0){
if (props.orderInfo.pointsDiscountAmount > 0 || props.orderInfo.fullCouponDiscountAmount > 0) {
return item.canReturnAmount
// const bili=Math.floor((item.priceAmount/canTuiKuanPrice.value )*100)/100
// return Math.floor((allPrice.value)*bili*100)/100
}else{
} else {
return item.priceAmount
}
}
@@ -503,8 +511,8 @@
})
const youhuiAllPrice = computed(() => {
const n= props.orderInfo.originAmount-props.orderInfo.amount+vipDiscountPrice.value*1
return (n<0?0:n).toFixed(2)
const n = props.orderInfo.originAmount - props.orderInfo.amount + vipDiscountPrice.value * 1
return (n < 0 ? 0 : n).toFixed(2)
// if(props.orderInfo.status!='unpaid'){
// const seatfee=(props.orderInfo.amount==0&&allPrice.value==0)?seatFeePrice.value:0
// return (goodsOriginAllPrice.value-allPrice.value+seatfee*1).toFixed(2)
@@ -528,26 +536,52 @@
})
const allPrice = computed(() => {
const goodsPrice = props.data.reduce((prve, cur) => {
const curTotal = cur.info.reduce((a,
b) => {
return a +(props.orderInfo.status == 'unpaid'?b.priceAmount:b.canReturnAmount*1)
return a + (b.status == 'unpaid' ? b.priceAmount : b.status == 'return' ? 0 : b.canReturnAmount * 1)
}, 0)
return prve + curTotal
}, 0)
return goodsPrice.toFixed(2)
if (props.orderInfo.status == 'unpaid') {
const n = goodsOriginAllPrice.value - youhuiAllPrice.value
return (n < 0 ? 0 : n).toFixed(2)
}
const returnAmount=props.orderInfo.seatInfo&&props.orderInfo.seatInfo.returnAmount?props.orderInfo.seatInfo.returnAmount:0
const canReturnAmount=props.orderInfo.seatInfo&&props.orderInfo.seatInfo.canReturnAmount?props.orderInfo.seatInfo.canReturnAmount:0
const total=props.orderInfo.amount-(returnAmount?returnAmount:canReturnAmount)
return (total<=0?0:total).toFixed(2)
const returnAmount = props.orderInfo.seatInfo && props.orderInfo.seatInfo.returnAmount ? props.orderInfo
.seatInfo.returnAmount : 0
const canReturnAmount = props.orderInfo.seatInfo && props.orderInfo.seatInfo.canReturnAmount ? props
.orderInfo.seatInfo.canReturnAmount : 0
const total = props.orderInfo.amount - (returnAmount ? returnAmount : canReturnAmount)
return (total <= 0 ? 0 : total).toFixed(2)
})
function rotatingTables() {
let arr = []
props.data.forEach(ele => {
ele.info.forEach(res => {
// 头像 coverImg
res.coverImg = res.productImg
// 名字 name
res.name = res.productName
// 金额 salePrice
res.salePrice = res.price
// 数量 number
res.number = res.num
res.masterId = props.orderInfo.masterId
res.useType = props.orderInfo.useType
res.tableId = props.orderInfo.tableId
arr.push(res)
})
})
uni.navigateTo({
url: '/pagesCreateOrder/confirm-order/rotatingTables?item=' + JSON.stringify(arr) + '&tableId=' + props
.orderInfo.tableId
})
}
const goodsNumber = computed(() => {
let result = 0
result = props.data.reduce((a, b) => {

View File

@@ -6,22 +6,23 @@
{{data.productName}}
</view>
<view class="u-flex u-m-t-32" :class="{'gray':data.productId=='-999'}">
<up-number-box :min="1" :max="data.num" :buttonSize="44" v-model="number" integer :disabled="data.productId=='-999'">
<up-number-box :min="0" :max="data.num" :buttonSize="44" v-model="number" integer
:disabled="data.productId=='-999'">
<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
:disabled="data.productId=='-999'"
@change="parseIntNumber($event,false)" @blur="parseIntNumber($event,true)"
v-model="number" border="none" type="number"></up-input>
<up-input :disabled="data.productId=='-999'" @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 v-if="data.productId=='-999'" name="plus" color="#ccc" size="16" bold></up-icon>
<up-icon v-if="data.productId=='-999'" name="plus" color="#ccc" size="16"
bold></up-icon>
<up-icon v-else name="plus" color="#999" size="16" bold></up-icon>
</view>
</template>
@@ -50,8 +51,7 @@
<view class="u-p-t-18 u-p-l-30 u-p-r-30 u-p-b-10">
<my-button box-shadow shape="circle" @tap="confirm">确认退菜</my-button>
<view class="u-m-t-10">
<my-button @tap="onModelClose" shape="circle" bgColor="#fff" type="cancel"
box-shadow>取消</my-button>
<my-button @tap="onModelClose" shape="circle" bgColor="#fff" type="cancel" box-shadow>取消</my-button>
</view>
</view>
@@ -71,7 +71,7 @@
type: Object,
default: () => {
return {
productId:'-999'
productId: '-999'
}
}
},
@@ -86,7 +86,7 @@
const emits = defineEmits(['update:show', 'confirm'])
let model = ref(null)
let modelShow = ref(props.show)
let number = ref(1)
let number = ref(0)
const tags = ref([{
label: "点错",
checked: false
@@ -108,8 +108,11 @@
if (newval > props.data.num) {
newval = props.data.num
}
if (newval < 1) {
newval = 1
// 判断是否是称重商品。如果是可以输入小数
if (props.data.isWeight != 1) {
if (newval < 1) {
newval = 1
}
}
if (isNow) {
number.value = parseInt(newval)
@@ -138,10 +141,10 @@
function toggleModelShow(show) {
modelShow.value = show ? true : false
}
function onModelClose() {
number.value=1
number.value = 1
modelShow.value = false
}
@@ -151,17 +154,17 @@
function open() {
model.value.open()
if(props.data.productId=='-999'){
number.value=props.data.num
if (props.data.productId == '-999') {
number.value = props.data.num
}
}
function close() {
model.value.close()
tags.value.map(v=>{
v.checked=false
tags.value.map(v => {
v.checked = false
})
form.note=''
form.note = ''
}
function confirm() {
@@ -206,12 +209,14 @@
::v-deep .uni-input-input {
text-align: center;
}
.gray{
.minus::after{
.gray {
.minus::after {
border-color: #ccc;
}
}
.minus {
&::after {
content: '';

View File

@@ -124,19 +124,22 @@
}
function onTuiCai(goods, index) {
console.log(goods);
tuicai.show = true
tuicai.selGoods = goods
}
async function tuicaiConfirm(e) {
console.log(tuicai.selGoods);
const res = await Api.$returnCart({
...e,
cartId: tuicai.selGoods.hasOwnProperty('cartId') ? tuicai.selGoods.cartId : tuicai.selGoods.id,
tableId: orderDetail.info.tableId,
})
tuicai.show = false
if(res){
go.back()
}else{
init()
}
}
@@ -307,6 +310,7 @@
}))
console.log(orderDetail.goodsList);
}
console.log(res,'debug121')
orderDetail.info = res
}

View File

@@ -0,0 +1,255 @@
<template>
<view class="">
<up-overlay :show="overlayshow" @click="overlayshow = false">
<view class="boxoverlay">
<view class="rect" @tap.stop>
<!-- 抖音 -->
<view class="bottomconstant">
<view class="itemlist">
<!-- <view class="ordernumber">
订单号111
</view> -->
<view class="title">
请选择商品
</view>
<view class="itemlists" v-for="(item,index) in form.goods" :key="index">
<view class="top">
<view class="tag">
{{item.title}}
</view>
<view class="date">
¥{{item.amount}}
</view>
</view>
<!-- <view class="bottom">
核销
</view> -->
<view v-if="item.type" @click="item.type =!item.type">
<up-icon name="checkmark-circle" color="#2979ff" size="22"></up-icon>
</view>
<view class="icon" v-else @click="item.type =!item.type"></view>
</view>
<view class="bouttonbox">
<view class="keep" @click="confirms">
确定核销
</view>
<view class="cancel" @click="overlayshow = false">
取消
</view>
</view>
</view>
</view>
</view>
</view>
</up-overlay>
</view>
</template>
<script setup>
import {
onLoad,
onShow,
onReachBottom
} from '@dcloudio/uni-app';
import {
computed,
reactive,
ref,
watch,
defineExpose
} from 'vue';
const form = reactive({
id: "",
number: '',
sum_pay_amount: '',
goods: [],
verify_token: '',
});
import {
certificateprepares
} from '@/http/php/api.ts';
//显示
const overlayshow = ref(false);
const open = (val) => {
Object.assign(form, val)
form.goods.map((item) => {
item.type = true
})
overlayshow.value = true
}
let confirms = async () => {
// 判断是否选择商品
if (form.goods.filter(i => i.type).length == 0) {
uni.showToast({
title: '请选择商品',
icon: 'none'
})
return false
}
let data = null
if (uni.getStorageSync('clint_type') == 1) {
data = {
couponCode: form.couponCode,
num: form.goods.length
}
} else {
let encrypted_codes = form.goods.filter(i => i.type).map((obj, index) => {
return obj.encrypted_code;
})
data = {
verify_token: form.verify_token,
encrypted_codes: encrypted_codes.toString(),
id: form.id
}
}
await certificateprepares(data)
uni.showToast({
title: '验证成功',
icon: 'none'
})
overlayshow.value = false
}
defineExpose({
open
})
</script>
<style lang="scss" scoped>
page {
background: #F9F9F9;
}
.boxoverlay {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
.rect {
padding: 32rpx 28rpx;
width: 80%;
background-color: #fff;
border-radius: 18rpx;
.bottomconstant {
padding: 0 28rpx;
width: 100%;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.itemlist:nth-child(1) {
margin-top: 0;
}
.itemlist {
// margin-top: 16rpx;
width: 100%;
background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.ordernumber {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.title {
margin-top: 16rpx;
padding-bottom: 16rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 28rpx;
color: #333333;
border-bottom: 1rpx solid #E5E5E5;
}
.itemlists {
padding-top: 16rpx;
display: flex;
justify-content: space-between;
align-items: center;
.top {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
.date {
margin-top: 10rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.tag {
width: 350rpx;
overflow: hidden; //超出的文本隐藏
text-overflow: ellipsis; //溢出用省略号显示
white-space: nowrap; //溢出不换行
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
}
.icon {
width: 40rpx;
height: 40rpx;
border: 1px solid #909399;
border-radius: 50%;
}
.bottom {
background: #EAF4FD;
border-radius: 4rpx 4rpx 4rpx 4rpx;
padding: 6rpx 12rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 20rpx;
color: #318AFE;
}
}
.bouttonbox {
margin-top: 80rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.keep {
width: 490rpx;
height: 80rpx;
background: #318AFE;
border-radius: 40rpx 40rpx 40rpx 40rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
line-height: 80rpx;
}
.cancel {
text-align: center;
width: 490rpx;
height: 80rpx;
background: #ffffff;
border-radius: 40rpx 40rpx 40rpx 40rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
line-height: 80rpx;
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,155 @@
<template>
<view class="">
<up-overlay :show="overlayshow" @click="overlayshow = false">
<view class="boxoverlay">
<view class="rect" @tap.stop>
<!-- 抖音 -->
<view class="bottomconstant">
<view class="itemlist">
<!-- <view class="ordernumber">
订单号111
</view> -->
<view class="title">
绑定门店
</view>
<view class="itemlists" v-for="(item,index) in 4" :key="index">
<view class="top">
<view class="tag">
名称qqqqqqqqq
</view>
<view class="date">
地址qqqqqqq
</view>
</view>
<view class="bottom">
操作
</view>
</view>
</view>
</view>
</view>
</view>
</up-overlay>
</view>
</template>
<script setup>
import {
onLoad,
onShow,
onReachBottom
} from '@dcloudio/uni-app';
import {
computed,
reactive,
ref,
watch,
defineExpose
} from 'vue';
//显示
const overlayshow = ref(false);
const open = () => {
overlayshow.value = true
}
defineExpose({
open
})
</script>
<style lang="scss" scoped>
page {
background: #F9F9F9;
}
.boxoverlay {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
.rect {
padding: 32rpx 28rpx;
width: 80%;
background-color: #fff;
border-radius: 18rpx;
.bottomconstant {
padding: 0 28rpx;
width: 100%;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.itemlist:nth-child(1) {
margin-top: 0;
}
.itemlist {
// margin-top: 16rpx;
width: 100%;
background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.ordernumber {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.title {
margin-top: 16rpx;
padding-bottom: 16rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 28rpx;
color: #333333;
border-bottom: 1rpx solid #E5E5E5;
}
.itemlists {
padding-top: 16rpx;
display: flex;
justify-content: space-between;
align-items: center;
.top {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
.date {
margin-top: 10rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.tag {
width: 350rpx;
overflow: hidden; //超出的文本隐藏
text-overflow: ellipsis; //溢出用省略号显示
white-space: nowrap; //溢出不换行
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
}
.bottom {
background: #EAF4FD;
border-radius: 4rpx 4rpx 4rpx 4rpx;
padding: 6rpx 12rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 20rpx;
color: #318AFE;
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,267 @@
<template>
<view class="constant">
<view class="constantitem" @click="object_id =null,overlayshow = true">
<view>扫码核销</view>
<view>
<up-icon name="arrow-right" color="#909399" size="20"></up-icon>
</view>
</view>
<view class="constantitem" @click="clickpath('PAGES_WEITEOFF_RECORD',1)">
<view>美团记录</view>
<view>
<up-icon name="arrow-right" color="#909399" size="20"></up-icon>
</view>
</view>
<view class="constantitem" @click="clickpath('PAGES_WEITEOFF_RECORD',2)">
<view>抖音记录</view>
<view>
<up-icon name="arrow-right" color="#909399" size="20"></up-icon>
</view>
</view>
<!-- 核销准备 -->
<up-overlay :show="overlayshow">
<view class="boxoverlay">
<view class="rect" @tap.stop>
<view class="top">
团购卷核销
</view>
<view class="subsection">
<up-subsection :list="subsectionlist" :current="subsectioncurrent" @change="sectionChange">
</up-subsection>
</view>
<view class="search">
<up-search :show-action="false" searchIcon="scan" :clearabled="true" @clickIcon='clickIcon'
placeholder="请扫码或者输入卷码" v-model="object_id"></up-search>
</view>
<view class="search">
<up-alert fontSize='10' :show-icon="true" title="请使用相机识别扫码" type="warning"
:closable="true"></up-alert>
</view>
<view class="bouttonbox">
<view class="keep" @click="confirms">
确认
</view>
<view class="cancel" @click="overlayshow = false">
取消
</view>
</view>
</view>
</view>
</up-overlay>
<!-- 绑定门店 -->
<dialogs ref="dialogsref"></dialogs>
<!-- 选择商品 -->
<commodity ref="refcommodity"></commodity>
<!-- 二维码 -->
<up-overlay :show="qrcodes.show" @click="qrcodes.show = false">
<view class="boxoverlay">
<view class="rect" @tap.stop
style="display: flex; flex-direction: column; align-items: center; justify-content: center;">
<!-- <view>{{subsectioncurrent==0?'请用美团':'抖音'}}</view> -->
<view style="padding-bottom:40rpx;font-weight: 600;">请进行手机扫码</view>
<!-- <up-qrcode :size="200" :val="qrcodes.val" :icon='qrcodes.icon'></up-qrcode> -->
<up-qrcode :size="200" :val="qrcodes.val"></up-qrcode>
</view>
</view>
</up-overlay>
</view>
</template>
<script setup>
import {
onLoad,
onShow,
onUnload,
} from '@dcloudio/uni-app';
import {
computed,
reactive,
ref,
watch
} from 'vue';
import {
userlogout,
douyincheckIn,
fulfilmentcertificateprepare, //准备核销
searchstorestatus, //状态查询
getuisdk //获取uisdk 绑定 链接
} from '@/http/php/api.ts';
import go from '@/commons/utils/go.js'
import dialogs from '../components/dialogs.vue'
import commodity from '../components/commodity.vue'
onLoad(async () => {
// 登录 会员入签
let res = await douyincheckIn({
token: uni.getStorageSync("iToken"),
loginName: uni.getStorageSync("shopId"),
clientType: 'ADMIN'
})
uni.setStorageSync('phpuserinfo', res.userInfo)
uni.setStorageSync('clint_type', 1)
})
//显示
const overlayshow = ref(false);
// 切换
const subsectioncurrent = ref(0);
const subsectionlist = ref(['美团', '抖音']);
const sectionChange = (index) => {
subsectioncurrent.value = index;
uni.setStorageSync('clint_type', index + 1)
}
// 二维码或者条形码
const object_id = ref(null)
// 扫码
const clickIcon = () => {
uni.scanCode({ // 允许从相机和相册扫码
success: (res) => {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
object_id.value = res.result
}
});
}
// 二维码
const qrcodes = reactive({
val: 'www.baidu.com',
icon: '@/static/logo.png',
show: false
})
// 首先获取状态
let confirms = async () => {
if (object_id.value == null) {
uni.showToast({
title: '请扫码或者输入卷码',
icon: 'none'
})
return false;
}
let res = await searchstorestatus()
// status == 0 则需要显示二维码 ==1 去核销
if (res.status == 0) {
qrcodes.val = await getuisdk()
overlayshow.value = false
qrcodes.show = true
} else {
clickkeep()
}
}
// 点击确定
const clickkeep = async () => {
let data = null
if (uni.getStorageSync('clint_type') == 1) {
data = {
code: object_id.value
}
} else {
data = {
object_id: object_id.value
}
}
let res = await fulfilmentcertificateprepare(data)
overlayshow.value = false
refcommodity.value.open(res)
}
// 这是选择门店
// const dialogsref = ref(null)
// const dialogconfirm = () => {
// dialogsref.value.open()
// }
// 选择商品
const refcommodity = ref(null)
// 跳转
const clickpath = (URL, title) => {
uni.setStorageSync('clint_type', title)
go.to(URL)
}
onShow(async () => {})
// 销毁组件
onUnload(async () => {
// 退出
await userlogout()
})
</script>
<style lang="scss" scoped>
page {
background: #F9F9F9;
}
.constant {
.constantitem {
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
padding: 24rpx 32rpx;
}
.boxoverlay {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
.rect {
padding: 32rpx 28rpx;
width: 80%;
background-color: #fff;
border-radius: 18rpx;
.top {
font-size: 32rpx;
font-weight: 600;
}
.subsection {
margin-top: 24rpx;
}
.search {
margin-top: 24rpx;
}
.bouttonbox {
margin-top: 80rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.keep {
width: 490rpx;
height: 80rpx;
background: #318AFE;
border-radius: 40rpx 40rpx 40rpx 40rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
line-height: 80rpx;
}
.cancel {
text-align: center;
width: 490rpx;
height: 80rpx;
background: #ffffff;
border-radius: 40rpx 40rpx 40rpx 40rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
line-height: 80rpx;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,360 @@
<template>
<view class="constant">
<!-- <view class="topbox">
<view class="left">
<view class="">
筛选
</view>
<view class=""></view>
</view>
<view class="right">
<up-input class="input" placeholder="搜索订单号" v-model="value"
@change="change"></up-input>
</view>
</view> -->
<!-- 抖音 -->
<view v-if="form.type == 2">
<view class="bottomconstant" v-for="(item,index) in form.list" :key="index">
<view class="itemlist">
<view class="ordernumber">
{{item.d_order_id}}
</view>
<view class="title">
{{item.title}}
</view>
<view class="itemlists" v-for="(item1,index1) in item.douyinCodeGoods" :key="item1.id">
<view class="top">
<view class="date">
{{item1.create_time}}
</view>
<view class="tag" v-if="item1.status == 1" @click="clickcancel(item1)"
style="background: #318AFE;color: #fff; border-radius: 10rpx;">
撤销核销
</view>
<view class="tag" v-if="item1.status == 0">
等待验券
</view>
<view class="tag" v-if="item1.status == 2">
失败
</view>
</view>
<view class="bottom">
<view class="bottomtitle">
{{item1.title}}
</view>
<view class="price">
<view class="prices">
{{item1.pay_amount}}
</view>
<!-- <view class="pricees">
{{item1.market_price}}
</view> -->
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 美团 -->
<view class="bottomconstant" v-else>
<view class="itemlist" v-for="(item,index) in form.list" :key="index">
<view class="itemlists" style="padding: 0;">
<view class="top">
<view class="date">
{{item.couponUseTime}}
</view>
<view class="tag" :style="!item.type?'background: #318AFE;color: #fff; border-radius: 10rpx;':''"
@click="clickcancel(item)">
{{item.type ? item.couponStatusDesc:'撤销核销'}}
</view>
</view>
<view class="bottom">
<view class="bottomtitle">
{{item.dealTitle}}
</view>
<view class="price">
<view class="prices">
¥{{item.couponBuyPrice}}
</view>
<!-- <view class="pricees">
156
</view> -->
</view>
</view>
</view>
</view>
</view>
<up-loadmore :status="form.status" />
</view>
</template>
<script setup>
import {
onLoad,
onShow,
onReachBottom
} from '@dcloudio/uni-app';
import {
computed,
reactive,
ref,
watch
} from 'vue';
import dayjs from "dayjs";
import {
orderlist,
fulfilmentcertificatecanceles
} from '@/http/php/api.ts';
// 下拉加载
onReachBottom(() => {
if (form.status != 'nomore') {
form.page = ++form.page;
getlist()
}
})
onLoad(async (e) => {
form.type = uni.getStorageSync('clint_type')
initial()
})
const dropdownvalue = ref(1)
const optionsdropdown = [{
label: '等待验证',
value: 1,
},
{
label: '成功',
value: 2,
},
{
label: '失败',
value: 3,
}
]
// 初始化
const initial = () => {
form.page = 1
form.status = 'loadmore'
form.d_order_id = ''
form.querystatus = ''
getlist()
}
//
const form = reactive({
type: '',
d_order_id: '',
querystatus: '',
page: 1,
status: '',
list: [],
count: '',
date: ''
});
const getlist = async () => {
let data = null
if (uni.getStorageSync('clint_type') == 1) {
data = {
page: form.page,
date: form.date
}
} else {
data = {
page: form.page,
status: form.querystatus,
d_order_id: form.d_order_id
}
}
let res = await orderlist(data)
form.count = res.count
form.status = 'loading';
if (form.page == 1 && res.list.length == 0) {
form.status = 'nomore'
return false;
} else {
setTimeout(() => {
if (form.page == 1) {
form.list = res.list
} else {
form.list = [...form.list, ...res.list];
}
if (form.list.length >= form.count && res.list.length < 10) {
form.status = 'nomore';
} else {
form.status = 'loadmore';
}
// 这是美团处理的数据
if (uni.getStorageSync('clint_type') == 1) {
form.list = form.list.map(item => {
// 计算60天后
item.couponUseTimes = dayjs(item.couponUseTime).add(60, 'day').format(
'YYYY-MM-DD HH:mm:ss')
item.type = dayjs().isAfter(dayjs(item.couponUseTime).add(60, 'day'),
'year')
return item
});
}
}, 500)
}
}
const clickcancel = async (item) => {
uni.showModal({
title: '确认撤销吗?',
success: async (res) => {
if (res.confirm) {
let data = null
if (uni.getStorageSync('clint_type') == 1) {
data = {
couponCode: item.couponCode
}
} else {
data = {
verify_id: item.verify_id,
certificate_id: item.certificate_id
}
}
await fulfilmentcertificatecanceles(data)
uni.showToast({
title: '撤销核销成功',
icon: 'success'
})
setTimeout(() => {
initial()
}, 1000)
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
</script>
<style lang="scss" scoped>
page {
background: #F9F9F9;
}
.constant {
padding-bottom: 32rpx;
.topbox {
width: 100%;
padding: 32rpx 28rpx;
background: #fff;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
.left {}
.right {
width: 80%;
.input {
width: 100%;
}
}
}
.bottomconstant {
padding: 0 28rpx;
width: 100%;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.itemlist {
margin-top: 32rpx;
padding: 32rpx 24rpx;
width: 100%;
background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.ordernumber {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.title {
margin-top: 16rpx;
padding-bottom: 24rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 28rpx;
color: #333333;
border-bottom: 1rpx solid #E5E5E5;
}
.itemlists {
padding-top: 24rpx;
.top {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
.date {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.tag {
background: #EAF4FD;
border-radius: 4rpx 4rpx 4rpx 4rpx;
padding: 6rpx 12rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 20rpx;
color: #318AFE;
}
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
.bottomtitle {
width: 350rpx;
overflow: hidden; //超出的文本隐藏
text-overflow: ellipsis; //溢出用省略号显示
white-space: nowrap; //溢出不换行
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
.price {
margin-top: 16rpx;
display: flex;
justify-content: flex-start;
align-items: center;
.prices {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
.pricees {
margin-left: 12rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #999999;
text-decoration-line: line-through;
}
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="96px" height="96px" viewBox="0 0 96 96" enable-background="new 0 0 96 96" xml:space="preserve"> <image id="image0" width="96" height="96" x="0" y="0"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAIGNIUk0AAHomAACAhAAA+gAAAIDo
AAB1MAAA6mAAADqYAAAXcJy6UTwAAABRUExURQAAAFCf/0uZ/0yZ/kyY/kuY/UyZ/0yZ/kuY/k2Z
/0yZ/UqX/0uZ/0uY/kuZ/kyZ/kyY/UuZ/UiX/0uZ/kuZ/UyX/0yY/kqa/0uZ/kyZ/v///7LMcjEA
AAAZdFJOUwAQX6+/n3/v31CAYHCwz8CQoCDwj0DQMODQpj2tAAAAAWJLR0QadWfkMgAAAAd0SU1F
B+gMBQIoEmmNJfAAAAHtSURBVGje7ZnZloMgDEChm63RKlK3///RsXVciTUBOmdmDnkF7wVTSU4R
IgQr5OF4ap3idD684V8iN3of19vW8o8+8M844wJv/A1D7I/ftoC8IC/vf4hIGoLEJx/bQupXkBqC
u19BZgj88ts2CH5KkEoh8w8K1OtR1OBF0PNF8SmBevesB8HI/9AORr5Ai6CzYOKf0XFXwR7fVbDL
pwp0ZsknChKBllICnyaIXyNgw6cJvgsrWPBpgmEM+HyaoEAMRD5NcBSGgcon/opgbSDzqd/BykDn
k7/khYHBpx8VMwOHzziLkD6WwOccdmDDZ52mYMHnHdfA5zPrAbD53IIDXD67ogGTzy+Zl26OpPMt
avL18bjS+X+muw6CIAiC3y5QJTmUjQAp9tsBfEHF4QtRsQUxT5CzBSlPkLIFUcHh1xFb0N5rBt+s
dfuCrkieiIGVUorAKYIgCIIgCILgnwneXk9VjaNAq0LU2RZEJ11H1DgIdNz/75holJH1fUGZWQqa
qbcrEIaehmub1jFb3grDehPp4rayyPWeYLlGVa7H5SLZjXEpLeNFMsybwNnzz8wicZsIucQmzPNt
NoZjfzxk1ozhQqspNybM8p2Yg9U6sxjgucbNBczyXSFzZFytM4tO2usou3w3SooQIfzFFziLPvqM
MV6wAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTA1VDAyOjQwOjE4KzAwOjAwFHedYwAAACV0
RVh0ZGF0ZTptb2RpZnkAMjAyNC0xMi0wNVQwMjo0MDoxOCswMDowMGUqJd8AAAAodEVYdGRhdGU6
dGltZXN0YW1wADIwMjQtMTItMDVUMDI6NDA6MTgrMDA6MDAyPwQAAAAAAElFTkSuQmCC" />
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.