From 704fee1e2d72ea51e7bc1c463a2977f9d4eeb183 Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Tue, 19 Nov 2024 14:35:25 +0800
Subject: [PATCH 01/29] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=B4=E6=97=B6?=
=?UTF-8?q?=E8=8F=9C=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pageProduct/add-Product/add-Product.vue | 30 +++---
.../add-Product/components/choose-goods.vue | 93 +++++++++++--------
2 files changed, 71 insertions(+), 52 deletions(-)
diff --git a/pageProduct/add-Product/add-Product.vue b/pageProduct/add-Product/add-Product.vue
index dad2fe6..65e0cbb 100644
--- a/pageProduct/add-Product/add-Product.vue
+++ b/pageProduct/add-Product/add-Product.vue
@@ -43,17 +43,12 @@
-
-
-
-
-
+
-
+
@@ -64,18 +59,23 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -114,7 +114,7 @@
-
+
选择规格
编辑规格
@@ -1475,7 +1475,7 @@
uni.$on('emitspecificationsSave', function(data) {
FormData.specificationsGroup = data
FormData.specId = data.specId
- FormData.specsInfoName=data.specsInfoName
+ FormData.specsInfoName = data.specsInfoName
skuList.list = data.result.map(v => {
return {
...v.skus,
diff --git a/pageProduct/add-Product/components/choose-goods.vue b/pageProduct/add-Product/components/choose-goods.vue
index 407158a..ba98819 100644
--- a/pageProduct/add-Product/components/choose-goods.vue
+++ b/pageProduct/add-Product/components/choose-goods.vue
@@ -15,7 +15,7 @@
-
+
重置
@@ -30,7 +30,8 @@
-
+
商品信息
规格
@@ -53,16 +54,17 @@
¥{{ item.lowPrice }}
- {{ item.realSalesNumber }}/{{ item.stockNumber }}
+ {{ item.realSalesNumber }}/{{ item.stockNumber }}
- {{item.categoryName}}
+ {{item.categoryName}}
-
+
取消
@@ -81,7 +83,7 @@
import myRadio from '@/components/my-components/my-radio';
import myPagination from '@/components/my-components/my-pagination'
import {
- $tbProduct
+ $tbProductV2
} from '@/http/yskApi/goods.js';
import {
reactive,
@@ -114,20 +116,20 @@
function open(arr) {
show.value = true
- if(arr){
- for(let i in goods.list){
+ if (arr) {
+ for (let i in goods.list) {
console.log(arr.includes(goods.list[i].id));
- goods.list[i].checked=arr.includes(goods.list[i].id)
+ goods.list[i].checked = arr.includes(goods.list[i].id)
}
}
-
+
}
function close() {
show.value = false
}
-
+
function resetQuery() {
Object.assign(goods.query, $quey)
@@ -137,51 +139,67 @@
return `height:${typeof props.height==='string'?props.height:props.height+'rpx'};`
}
- const emits = defineEmits(['update:modelValue','confirm'])
-
+ const emits = defineEmits(['update:modelValue', 'confirm'])
+
const $quey = {
- categoryId: '',
- name: '',
+ categoryId: "",
+ createdAt: [],
+ id: "",
+ name: "",
+ sort: "createdAt,desc",
+ type: "",
page: 0,
size: 10,
}
const query = reactive({
...$quey
})
- const goods=reactive({
- list:[],
- allChecked:false,
- totalElements:0,
- query:{
+ const goods = reactive({
+ list: [],
+ allChecked: false,
+ totalElements: 0,
+ query: {
...$quey
}
})
+
function getGoods() {
- $tbProduct(goods.query).then(res=>{
- goods.list=res.content.map(v=>{
- return {...v,checked:false}
+ $tbProductV2(goods.query).then(res => {
+ goods.list = res.content.map(v => {
+ return {
+ ...v,
+ checked: false
+ }
})
- goods.allChecked=false
- goods.totalElements=res.totalElements
+ goods.allChecked = false
+ goods.totalElements = res.totalElements
})
}
getGoods()
-
- function pageChange(page){
- goods.query.page=page-1
+
+ function pageChange(page) {
+ goods.query.page = page - 1
getGoods()
}
- function radioChange(newval){
- goods.allChecked=goods.list.filter(v=>v.checked).length!=0
+
+ function radioChange(newval) {
+ goods.allChecked = goods.list.filter(v => v.checked).length != 0
}
- function radioAllChange(newval){
- goods.list.forEach(i=>{i.checked=newval})
+
+ function radioAllChange(newval) {
+ goods.list.forEach(i => {
+ i.checked = newval
+ })
}
- function confrim(){
- const arr= goods.list.filter(v=>v.checked)
- emits('confirm',arr)
+
+ function confrim() {
+ const arr = goods.list.filter(v => v.checked)
+ emits('confirm', arr)
}
- defineExpose({open,close})
+ defineExpose({
+ open,
+ close
+ })
\ No newline at end of file
diff --git a/pageProduct/add-Product/components/choose-guige.vue b/pageProduct/add-Product/components/choose-guige.vue
new file mode 100644
index 0000000..29bfa51
--- /dev/null
+++ b/pageProduct/add-Product/components/choose-guige.vue
@@ -0,0 +1,164 @@
+
+
+
+
+ 选择规格
+
+
+
+
+
+
+ {{item.specSnap||item.name}}
+ 上架中
+ 已售罄
+ 已下架
+
+
+
+
+
+
+
+
+ 取消
+
+
+ 确定
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pageProduct/add-Product/components/price-number-box.vue b/pageProduct/add-Product/components/price-number-box.vue
new file mode 100644
index 0000000..d67f3b3
--- /dev/null
+++ b/pageProduct/add-Product/components/price-number-box.vue
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pageProduct/add-Product/timer - 副本.vue b/pageProduct/add-Product/timer - 副本.vue
new file mode 100644
index 0000000..3e0c104
--- /dev/null
+++ b/pageProduct/add-Product/timer - 副本.vue
@@ -0,0 +1,224 @@
+
+
+
+
+
+
+
+ 周期
+
+ {{isAllChecked?'取消全选':'全选'}}
+
+
+
+
+
+
+
+ 上架时间:
+
+
+
+ {{item.listingTime.value}}
+
+
+
+
+
+ 下架时间:
+
+
+
+ {{item.offShelf.value}}
+
+
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pageProduct/add-Product/timer.vue b/pageProduct/add-Product/timer.vue
index 1e7fdd2..dd7a8bf 100644
--- a/pageProduct/add-Product/timer.vue
+++ b/pageProduct/add-Product/timer.vue
@@ -1,42 +1,45 @@
-
-
+
+
-
+
+
周期
- 全选
+
+ {{isAllChecked?'取消全选':'全选'}}
+
-
-
+
+
-
+
上架时间:
-
+
- {{item.listingTime.value}}
+ {{item.startTime.value}}
-
+
下架时间:
-
+
- {{item.offShelf.value}}
+ {{item.endTime.value}}
@@ -58,19 +61,23 @@
onReady
} from '@dcloudio/uni-app';
import {
+ computed,
ref
} from 'vue';
import go from '@/commons/utils/go.js';
- import myButton from '@/components/my-components/my-button.vue'
+ import color from '@/commons/color.js'
+ import {
+ $getProductDetail,
+ } from '@/http/yskApi/goods.js'
//返回一天的时间 时分格式
function returnDayTime() {
- return new Array(2).fill(1).map((v, index) => {
+ return new Array(3).fill(1).map((v, index) => {
if (index === 0) {
return new Array(24).fill(1).map((hour, index) => {
return `0${index}`.slice(-2)
})
}
- if (index === 1) {
+ if (index === 1 || index === 2) {
return new Array(60).fill(1).map((hour, index) => {
return `0${index}`.slice(-2)
})
@@ -83,7 +90,8 @@
function getTime(indexArr) {
const hour = times.value[0][indexArr[0]]
const month = times.value[1][indexArr[1]]
- return `${hour}:${month}`
+ const s = times.value[2][indexArr[2]]
+ return `${hour}:${month}:${s}`
}
//获取$event.detail.value
function getEnentDetailValue(e) {
@@ -94,66 +102,67 @@
list.value[index][key].value = time
}
- function listingTimeChange(e, index) {
+ function startTimeChange(e, index) {
const indexArr = getEnentDetailValue(e)
const time = getTime(indexArr)
- setListTimeValue(index, 'listingTime', time)
+ setListTimeValue(index, 'startTime', time)
}
- function offShelfChange(e, index) {
+ function endTimeChange(e, index) {
const indexArr = getEnentDetailValue(e)
const time = getTime(indexArr)
- setListTimeValue(index, 'offShelf', time)
+ setListTimeValue(index, 'endTime', time)
}
const cycle = [{
- value: 0,
+ value: 'Monday',
text: '星期一'
},
{
- value: 1,
+ value: 'Tuesday',
text: '星期二'
},
{
- value: 2,
+ value: 'Wednesday',
text: '星期三'
},
{
- value: 3,
+ value: 'Thursday',
text: '星期四'
},
{
- value: 4,
+ value: 'Friday',
text: '星期五'
},
{
- value: 5,
+ value: 'Saturday',
text: '星期六'
},
{
- value: 6,
+ value: 'Sunday',
text: '星期日'
}
]
const ListDataconstructor = {
- cycleChecked: [0, 1, 2, 3, 4, 5, 6],
+ cycleChecked: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
}
function returnBasicTimeConstructor() {
return {
- listingTime: {
- value: '09:00',
- index: [9, 0]
+ startTime: {
+ value: '00:00:00',
+ index: [0, 0, 0]
},
- offShelf: {
- value: '18:00',
- index: [18, 0]
+ endTime: {
+ value: '00:00:00',
+ index: [0, 0, 0]
}
}
}
const list = ref([returnBasicDataConstructor()])
+
function returnBasicDataConstructor() {
return {
...ListDataconstructor,
@@ -164,25 +173,68 @@
function addTimer() {
list.value.push(returnBasicDataConstructor())
}
+
function delTimer(index) {
- list.value.splice(index,1)
+ list.value.splice(index, 1)
}
- function selectAllClick(index){
- list.value[index].cycleChecked=ListDataconstructor.cycleChecked
+ const isAllChecked = computed(() => {
+ return list.value[0].cycleChecked.length == cycle.length ? true : false
+ })
+
+ function selectAllClick(index) {
+ if (isAllChecked.value) {
+ list.value[index].cycleChecked = []
+ } else {
+ list.value[index].cycleChecked = ListDataconstructor.cycleChecked
+ }
}
// 触发定时器保存事件将数据给到添加商品页面
- function emitTimerSave(){
- uni.$emit('timerSave',list.value)
+ function emitTimerSave() {
+ 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)
go.back()
}
- function save(){
- console.log(list.value);
+
+ function save() {
emitTimerSave()
}
- onLoad(()=>{
- const arr=uni.getStorageSync('timer')
- if(arr.length){
- list.value=arr
+ let goodsDetail = ref({})
+
+ function returnTimeIndex(time) {
+ console.log(time);
+ return time.split(':').map(v=>{
+ return v*1
+ })
+ }
+
+ function returnTimer(res) {
+ return [{
+ cycleChecked: res.days ? res.days.split(',').filter(v=>v) : [],
+ startTime: res.startTime ? {
+ value: res.startTime,
+ index: returnTimeIndex(res.startTime)
+ } : returnBasicTimeConstructor.startTime,
+ endTime: res.endTime ? {
+ value: res.endTime,
+ index: returnTimeIndex(res.endTime)
+ } : returnBasicTimeConstructor.endTime
+ }]
+ }
+ onLoad(async (opt) => {
+ let res = null
+ if (opt.productId) {
+ res = await $getProductDetail(opt.productId)
+ goodsDetail.value = res
+ }
+ const arr = res ? returnTimer(res) : [];
+ console.log(arr);
+ if (arr.length) {
+ list.value = arr
}
})
@@ -195,7 +247,7 @@
.block {
background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx;
- padding: 30rpx;
- margin-bottom: 20rpx;
+ padding: 32rpx 28rpx;
+ margin-bottom: 32rpx;
}
\ No newline at end of file
From fb2ac1f7c17e02df9db105d15c6f60648bd78b72 Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Fri, 29 Nov 2024 13:32:28 +0800
Subject: [PATCH 06/29] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=90=88=E5=B9=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
http/yskApi/goods.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/http/yskApi/goods.js b/http/yskApi/goods.js
index 18e1587..9c369bf 100644
--- a/http/yskApi/goods.js
+++ b/http/yskApi/goods.js
@@ -119,7 +119,10 @@ export const $productSpec=new $API('/api/tbProductSpec',http.req)
// v2 api start
-
+// 商品列表 后台查询
+export function $tbProductList(data) {
+ return http.req('/api/tbProduct/list', {...data,shopId:uni.getStorageSync('shopId')}, 'GET')
+}
/* 商品列表 V2 */
export function $tbProductV2(data) {
return http.req('/api/tbProduct/list/v2', {...data,shopId:uni.getStorageSync('shopId')}, 'post')
From 735afd564c9af41513d20daff7c994a6087c3b65 Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Fri, 29 Nov 2024 13:53:00 +0800
Subject: [PATCH 07/29] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86?=
=?UTF-8?q?=E6=96=B9=E6=B3=95=E4=B8=A2=E5=A4=B1=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
http/yskApi/goods.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/http/yskApi/goods.js b/http/yskApi/goods.js
index 18e1587..5fa897f 100644
--- a/http/yskApi/goods.js
+++ b/http/yskApi/goods.js
@@ -119,6 +119,9 @@ export const $productSpec=new $API('/api/tbProductSpec',http.req)
// v2 api start
+export function $tbProductList(data) {
+ return http.req('/api/tbProduct/list', {...data,shopId:uni.getStorageSync('shopId')}, 'get')
+}
/* 商品列表 V2 */
export function $tbProductV2(data) {
From a8d482edb11d86beea92c7c916e659c93f49aba6 Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Fri, 29 Nov 2024 13:53:15 +0800
Subject: [PATCH 08/29] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A5=97=E9=A4=90?=
=?UTF-8?q?=E5=95=86=E5=93=81=E4=B8=8D=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pageProduct/add-Product/add-Product.vue | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/pageProduct/add-Product/add-Product.vue b/pageProduct/add-Product/add-Product.vue
index 44d1412..d2f0b00 100644
--- a/pageProduct/add-Product/add-Product.vue
+++ b/pageProduct/add-Product/add-Product.vue
@@ -92,9 +92,9 @@
-->
-
+
+ v-if=" (FormData.groupType==1&&FormData.proGroupVo.length)||(FormData.groupType==0&&FormData.proGroupVo.length&&FormData.proGroupVo[0].goods.length) ">
@@ -915,6 +915,9 @@
function proGroupVoAddGoods(index, arr) {
proGroupVoIndex = index
+ if(!FormData.proGroupVo){
+ initDefaultProGroupVo()
+ }
if (FormData.groupType == 0) {
const goods = FormData.proGroupVo[0].goods
refChooseGoods.value.open(goods)
@@ -971,7 +974,9 @@
}
})
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) {
@@ -1924,7 +1929,11 @@
watch(() => FormData.type, (newval) => {
if (option.type == 'edit') {
if (newval == $goodsData.type) {
- FormData.proGroupVo = $goodsData.proGroupVo
+ if($goodsData.proGroupVo){
+ FormData.proGroupVo = $goodsData.proGroupVo||[]
+ }else{
+ initDefaultProGroupVo()
+ }
}
} else {
if (newval == 'package') {
@@ -1941,6 +1950,7 @@
number: 1,
goods: []
}]
+ console.log(FormData.proGroupVo);
}
watch(() => FormData.groupType, (newval) => {
if (newval == 0) {
From e17d36bc88bb69f9023fdb784d7e3e77e6b93cf6 Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Fri, 29 Nov 2024 14:00:00 +0800
Subject: [PATCH 09/29] =?UTF-8?q?=E9=83=A8=E5=88=86=E6=A0=B7=E5=BC=8F?=
=?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pageProduct/add-Product/add-Product.vue | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/pageProduct/add-Product/add-Product.vue b/pageProduct/add-Product/add-Product.vue
index d2f0b00..1cfc1c3 100644
--- a/pageProduct/add-Product/add-Product.vue
+++ b/pageProduct/add-Product/add-Product.vue
@@ -658,7 +658,7 @@
-
+
@@ -2100,8 +2100,7 @@
position: fixed;
left: 110rpx;
right: 110rpx;
- bottom: 140rpx;
- padding-bottom: env(safe-area-inset-bottom);
+ bottom: 60px;
}
.minus {}
From 854ea15071d0ea286a9efb382216c657c02ba1be Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Fri, 29 Nov 2024 14:08:14 +0800
Subject: [PATCH 10/29] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=95=86=E5=93=81?=
=?UTF-8?q?=E7=BC=96=E8=BE=91=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=97=A0=E6=B3=95?=
=?UTF-8?q?=E8=BE=93=E5=85=A5=E5=B0=8F=E6=95=B0=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pageProduct/add-Product/add-Product.vue | 2 +-
pageProduct/add-Product/components/price-number-box.vue | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/pageProduct/add-Product/add-Product.vue b/pageProduct/add-Product/add-Product.vue
index 1cfc1c3..31b6d2d 100644
--- a/pageProduct/add-Product/add-Product.vue
+++ b/pageProduct/add-Product/add-Product.vue
@@ -330,7 +330,7 @@
起售数量
-
diff --git a/pageProduct/add-Product/components/price-number-box.vue b/pageProduct/add-Product/components/price-number-box.vue
index d67f3b3..7b00a90 100644
--- a/pageProduct/add-Product/components/price-number-box.vue
+++ b/pageProduct/add-Product/components/price-number-box.vue
@@ -1,7 +1,7 @@
-
+
@@ -24,6 +24,10 @@
watch,nextTick
} from 'vue';
const props = defineProps({
+ inputType:{
+ type:String,
+ default:'digit'
+ },
modelValue: {
type: [String, Number]
},
From 63981c945259a60ed1482fa6b14b7f141c20c3f6 Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Mon, 2 Dec 2024 09:38:03 +0800
Subject: [PATCH 11/29] =?UTF-8?q?=E9=A2=84=E5=87=86=E5=A4=87=EF=BC=9A?=
=?UTF-8?q?=E8=A1=A8=E5=8D=95=E7=BB=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/my-components/my-popup-table.vue | 268 ++++++++++++++++++
components/my-components/my-table-col.vue | 8 +
components/my-components/my-table.vue | 76 +++++
pageProduct/add-Product/add-Product.vue | 4 +-
.../add-Product/components/choose-goods.vue | 12 +-
5 files changed, 361 insertions(+), 7 deletions(-)
create mode 100644 components/my-components/my-popup-table.vue
create mode 100644 components/my-components/my-table-col.vue
create mode 100644 components/my-components/my-table.vue
diff --git a/components/my-components/my-popup-table.vue b/components/my-components/my-popup-table.vue
new file mode 100644
index 0000000..bcd3b0e
--- /dev/null
+++ b/components/my-components/my-popup-table.vue
@@ -0,0 +1,268 @@
+
+
+
+
+ 选择商品
+
+
+
+
+ {{goods.query.categoryId||'分类' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 商品信息
+ 规格
+
+
+ 售价
+ 销量/库存
+ 分类名称
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+ {{item.typeEnum}}
+
+
+ ¥{{ item.lowPrice }}
+
+
+
+ {{ item.stockNumber }}
+
+
+ {{item.categoryName}}
+
+
+
+
+
+
+
+
+ 取消
+
+
+ 确定
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/my-components/my-table-col.vue b/components/my-components/my-table-col.vue
new file mode 100644
index 0000000..02409e3
--- /dev/null
+++ b/components/my-components/my-table-col.vue
@@ -0,0 +1,8 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/my-components/my-table.vue b/components/my-components/my-table.vue
new file mode 100644
index 0000000..77cb15b
--- /dev/null
+++ b/components/my-components/my-table.vue
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+ 商品信息
+ 规格
+ 售价
+ 销量/库存
+ 分类名称
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+ {{item.typeEnum}}
+
+
+ ¥{{ item.lowPrice }}
+
+
+
+ {{ item.stockNumber }}
+
+
+ {{item.categoryName}}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pageProduct/add-Product/add-Product.vue b/pageProduct/add-Product/add-Product.vue
index 31b6d2d..349ac0e 100644
--- a/pageProduct/add-Product/add-Product.vue
+++ b/pageProduct/add-Product/add-Product.vue
@@ -702,6 +702,8 @@
+
+
@@ -1500,7 +1502,7 @@
},
{
name: '称重商品',
- value: 'weight'
+ value: 'weigh'
}
],
typeEnums: [{
diff --git a/pageProduct/add-Product/components/choose-goods.vue b/pageProduct/add-Product/components/choose-goods.vue
index c11c6c9..bcd3b0e 100644
--- a/pageProduct/add-Product/components/choose-goods.vue
+++ b/pageProduct/add-Product/components/choose-goods.vue
@@ -47,14 +47,15 @@
-->
{{item.name}}
-
+
{{item.typeEnum}}
¥{{ item.lowPrice }}
- {{ item.realSalesNumber }}/{{ item.stockNumber }}
+
+ {{ item.stockNumber }}
{{item.categoryName}}
@@ -79,9 +80,6 @@
diff --git a/pagesCreateOrder/confirm-order/components/discount.vue b/pagesCreateOrder/confirm-order/components/discount.vue
index 478f954..231ffae 100644
--- a/pagesCreateOrder/confirm-order/components/discount.vue
+++ b/pagesCreateOrder/confirm-order/components/discount.vue
@@ -1,9 +1,9 @@
-
+
@@ -46,19 +46,22 @@
-
- 打折原因
- *
-
+
+ 当前单品价格:{{price}}
+
+
+ 打折原因
+ *
+
-
-
+
@@ -86,7 +89,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 +101,10 @@
default: []
}
})
-
-
-
- function changeCauses(item) {
- item.checked = !item.checked
- }
+
+
+
+
const discounts = [95, 90, 85, 80]
const causes = reactive([{
@@ -120,6 +121,11 @@
}
])
+ function changeCauses(item, index) {
+ item.checked = !item.checked
+ form.notes = causes
+ }
+
function discountInput(e) {
if (e.detail.value >= 100) {
nextTick(() => {
@@ -127,8 +133,9 @@
})
}
}
+
function discountMoneyInput(e) {
- const max=100
+ const max = 100
if (e.detail.value >= max) {
nextTick(() => {
form.discountMoney = 100
@@ -142,7 +149,7 @@
const tabs = ['打折', '减免']
- let current = ref(0)
+ let current = ref(1)
function tabsChange(i) {
console.log(i);
@@ -158,11 +165,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 +190,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,
diff --git a/pagesCreateOrder/confirm-order/confirm-order.vue b/pagesCreateOrder/confirm-order/confirm-order.vue
index c7d7939..f2f258d 100644
--- a/pagesCreateOrder/confirm-order/confirm-order.vue
+++ b/pagesCreateOrder/confirm-order/confirm-order.vue
@@ -154,6 +154,11 @@
custom-style="background-color: #E6F0FF; border-color: #E6F0FF; color: #318AFE;"
size="small" text="打包" inverted type="success" />
+
+
+
{{item.name}}
@@ -174,7 +179,8 @@
¥{{formatPrice(item.salePrice*item.number) }}
- ¥{{formatPrice(item.memberPrice*item.number) }}
+ ¥{{formatPrice(item.memberPrice*item.number) }}
@@ -196,9 +202,10 @@
-
+
+
+
-
+
+
+
+
@@ -251,7 +262,7 @@
¥{{formatPrice(youhui) }}
-
+
实收金额
¥{{formatPrice(allPrice) }}
@@ -278,8 +289,7 @@
-
-
+
@@ -351,7 +361,24 @@
return Number(n).toFixed(2)
}
-
+ // 单品打折
+ async function discountconfirm(form) {
+ console.log(form, '调试111111')
+ 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)
+ }
//用餐人数
const userNumbers = reactive({
@@ -423,11 +450,40 @@
}
}
//等叫
- function toggleWait(item) {
+ async function toggleWait(item) {
item.isWait = !item.isWait
+ let obj = {
+ cartId: item.id,
+ isGift: item.isGift,
+ isPack: item.isPack,
+ isPrint: item.isPrint,
+ isWaitCall: item.isWait,
+ 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.isWait,
+ 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 +535,6 @@
function watchChooseuser() {
uni.$off('choose-user')
uni.$on('choose-user', (data) => {
- console.log(data);
user.value = data
setUser()
})
@@ -520,20 +575,26 @@
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);
+ console.log(goodsPrice.value,'调试2121');
const n = goodsPrice.value * 1 + $seatFee.totalAmount
return n.toFixed(2)
// const goodsTotalPrice = goods.list.reduce((prve, cur) => {
@@ -541,18 +602,19 @@
// }, 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 {
+ return (discountSaleAmount.value)
}
- return goodsTotalPrice
+ return (goodsTotalPrice+discountSaleAmount.value*1).toFixed(2)
})
function setGoodsItem(key, val) {
@@ -573,16 +635,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) {
diff --git a/pagesCreateOrder/index/index.vue b/pagesCreateOrder/index/index.vue
index daf891d..4886329 100644
--- a/pagesCreateOrder/index/index.vue
+++ b/pagesCreateOrder/index/index.vue
@@ -671,7 +671,7 @@
}
function toLinshi() {
- go.to('PAGES_ADD_TEMP_CUISINE',{
+ go.to('PAGES_CHOOSE_ADD_TEMP_CUISINE',{
masterId:data.masterId,
tableId:data.table.tableId,
vipUserId:option.vipUserId?option.vipUserId:'',
From ff1e6f60e08d6acd7154a55c047b386d972b8e28 Mon Sep 17 00:00:00 2001
From: duan <1004387497@qq.com>
Date: Wed, 4 Dec 2024 09:38:18 +0800
Subject: [PATCH 19/29] =?UTF-8?q?=E4=BB=A3=E8=AF=BE=E4=B8=8B=E5=8D=95bug?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../confirm-order/components/discount.vue | 6 ++-
.../confirm-order/confirm-order.vue | 45 ++++++++++---------
2 files changed, 28 insertions(+), 23 deletions(-)
diff --git a/pagesCreateOrder/confirm-order/components/discount.vue b/pagesCreateOrder/confirm-order/components/discount.vue
index 231ffae..863cffe 100644
--- a/pagesCreateOrder/confirm-order/components/discount.vue
+++ b/pagesCreateOrder/confirm-order/components/discount.vue
@@ -34,7 +34,6 @@
-
元
@@ -70,7 +69,10 @@
确认
- 取消
+
+
+
+
diff --git a/pagesCreateOrder/confirm-order/confirm-order.vue b/pagesCreateOrder/confirm-order/confirm-order.vue
index f2f258d..8d34752 100644
--- a/pagesCreateOrder/confirm-order/confirm-order.vue
+++ b/pagesCreateOrder/confirm-order/confirm-order.vue
@@ -136,10 +136,15 @@
:key="index">
-
+
+
+ 临时菜
+
-
+
@@ -217,7 +222,7 @@
+ @tap="toggleWait(item)">{{item.isWaitCall?'取消等叫':'等叫'}}
-
+
@@ -363,7 +369,6 @@
// 单品打折
async function discountconfirm(form) {
- console.log(form, '调试111111')
let str = ''
if (form.notes) {
form.notes.forEach(ele => {
@@ -378,6 +383,7 @@
cartId: modelData.data.id
}
const res = await Api.$updatePrice(obj)
+ getCart()
}
//用餐人数
@@ -445,19 +451,17 @@
par[key] = !item[key]
const res = await Api.$updateCart(par)
goods.list[index][key] = returnBoolean(res[key])
- if (key == 'isPack') {
- getCart()
- }
+
}
//等叫
async function toggleWait(item) {
- item.isWait = !item.isWait
+ item.isWaitCall = !item.isWaitCall
let obj = {
cartId: item.id,
isGift: item.isGift,
isPack: item.isPack,
isPrint: item.isPrint,
- isWaitCall: item.isWait,
+ isWaitCall: item.isWaitCall,
masterId: option.masterId,
num: item.number, // 0会删除此商品
productId: item.productId,
@@ -467,7 +471,6 @@
let res = await Api.$updateCart(obj)
}
// 打印
-
async function toggisPrint(item) {
item.isPrint = !item.isPrint
let obj = {
@@ -475,7 +478,7 @@
isGift: item.isGift,
isPack: item.isPack,
isPrint: item.isPrint,
- isWaitCall: item.isWait,
+ isWaitCall: item.isWaitCall,
masterId: option.masterId,
num: item.number, // 0会删除此商品
productId: item.productId,
@@ -578,11 +581,11 @@
const isVip = computed(() => {
return $shop.value.isMemberPrice && user.value && user.value.id && user.value.isVip
})
- const discountSaleAmount=computed(()=>{
+ const discountSaleAmount = computed(() => {
return goods.list.filter((v) => v.discountSaleAmount && v.discountSaleAmount > 0)
- .reduce((a, b) => {
- return a + b.number * b.discountSaleAmount;
- }, 0);
+ .reduce((a, b) => {
+ return a + b.number * b.discountSaleAmount;
+ }, 0);
})
const goodsPrice = computed(() => {
const goodsTotalPrice = goods.list.reduce((prve, cur) => {
@@ -591,10 +594,10 @@
const tpackFee = cur.isPack ? cur.packFee * 1 : 0
return prve + (cur.isGift ? 0 : tPrice) + tpackFee
}, 0)
- return ((goodsTotalPrice-discountSaleAmount.value) || 0).toFixed(2)
+ return ((goodsTotalPrice - discountSaleAmount.value) || 0).toFixed(2)
})
const allPrice = computed(() => {
- console.log(goodsPrice.value,'调试2121');
+ console.log(goodsPrice.value, '调试2121');
const n = goodsPrice.value * 1 + $seatFee.totalAmount
return n.toFixed(2)
// const goodsTotalPrice = goods.list.reduce((prve, cur) => {
@@ -603,9 +606,9 @@
// return (goodsTotalPrice + ($seatFee.totalAmount || 0)).toFixed(2)
})
const youhui = computed(() => {
- let goodsTotalPrice=0
+ let goodsTotalPrice = 0
if (user.value && user.value.id && user.value.isVip) {
- goodsTotalPrice = goods.list.reduce((prve, cur) => {
+ goodsTotalPrice = goods.list.reduce((prve, cur) => {
const tPrice = cur.salePrice * cur.number
const tpackFee = cur.isPack ? cur.packFee * 1 : 0
return prve + tPrice + tpackFee
@@ -614,7 +617,7 @@
} else {
return (discountSaleAmount.value)
}
- return (goodsTotalPrice+discountSaleAmount.value*1).toFixed(2)
+ return (goodsTotalPrice + discountSaleAmount.value * 1).toFixed(2)
})
function setGoodsItem(key, val) {
From 4dfa7d627ee3bb69f246d47d3107aa2e67575dc3 Mon Sep 17 00:00:00 2001
From: duan <1004387497@qq.com>
Date: Wed, 4 Dec 2024 10:44:25 +0800
Subject: [PATCH 20/29] =?UTF-8?q?=E4=BB=A3=E5=AE=A2=E4=B8=8B=E5=8D=95bug?=
=?UTF-8?q?=E4=BF=AE=E6=94=B92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../confirm-order/confirm-order.vue | 37 +++++++++++--------
pagesCreateOrder/index/components/car.vue | 2 +-
2 files changed, 22 insertions(+), 17 deletions(-)
diff --git a/pagesCreateOrder/confirm-order/confirm-order.vue b/pagesCreateOrder/confirm-order/confirm-order.vue
index 8d34752..bf01677 100644
--- a/pagesCreateOrder/confirm-order/confirm-order.vue
+++ b/pagesCreateOrder/confirm-order/confirm-order.vue
@@ -369,21 +369,23 @@
// 单品打折
async function discountconfirm(form) {
- let str = ''
- if (form.notes) {
- form.notes.forEach(ele => {
- if (ele.checked) {
- str = str + ele.name + ','
- }
- })
+ 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()
}
- let obj = {
- saleAmount: form.discountMoney,
- note: str + form.note,
- cartId: modelData.data.id
- }
- const res = await Api.$updatePrice(obj)
- getCart()
}
//用餐人数
@@ -449,9 +451,11 @@
skuId
}
par[key] = !item[key]
+
+
const res = await Api.$updateCart(par)
goods.list[index][key] = returnBoolean(res[key])
-
+ getCart()
}
//等叫
async function toggleWait(item) {
@@ -597,7 +601,6 @@
return ((goodsTotalPrice - discountSaleAmount.value) || 0).toFixed(2)
})
const allPrice = computed(() => {
- console.log(goodsPrice.value, '调试2121');
const n = goodsPrice.value * 1 + $seatFee.totalAmount
return n.toFixed(2)
// const goodsTotalPrice = goods.list.reduce((prve, cur) => {
@@ -615,8 +618,10 @@
}, 0)
return goodsTotalPrice - allPrice.value
} else {
+ console.log(discountSaleAmount.value,'优惠金额')
return (discountSaleAmount.value)
}
+ console.log(discountSaleAmount.value,'优惠金额1')
return (goodsTotalPrice + discountSaleAmount.value * 1).toFixed(2)
})
diff --git a/pagesCreateOrder/index/components/car.vue b/pagesCreateOrder/index/components/car.vue
index 65f5681..44f0f26 100644
--- a/pagesCreateOrder/index/components/car.vue
+++ b/pagesCreateOrder/index/components/car.vue
@@ -6,7 +6,7 @@
- 已添加{{goodsNumber}}件商品
+ 已添加{{goodsNumber.toFixed(0)}}件商品
清空
From 9df5bc0e46ac862b4816f4a89a205136fe8e65f1 Mon Sep 17 00:00:00 2001
From: duan <1004387497@qq.com>
Date: Wed, 4 Dec 2024 17:46:51 +0800
Subject: [PATCH 21/29] =?UTF-8?q?=E5=A5=97=E9=A4=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../confirm-order/confirm-order.vue | 2 +-
.../index/components/list-goods-item.vue | 7 +-
.../index/components/taocanModel.vue | 174 ++++++++++++++++++
pagesCreateOrder/index/index.vue | 92 ++++++---
4 files changed, 241 insertions(+), 34 deletions(-)
create mode 100644 pagesCreateOrder/index/components/taocanModel.vue
diff --git a/pagesCreateOrder/confirm-order/confirm-order.vue b/pagesCreateOrder/confirm-order/confirm-order.vue
index bf01677..25b4c9a 100644
--- a/pagesCreateOrder/confirm-order/confirm-order.vue
+++ b/pagesCreateOrder/confirm-order/confirm-order.vue
@@ -207,7 +207,7 @@
-
+
diff --git a/pagesCreateOrder/index/components/list-goods-item.vue b/pagesCreateOrder/index/components/list-goods-item.vue
index bd15f0b..f5648ff 100644
--- a/pagesCreateOrder/index/components/list-goods-item.vue
+++ b/pagesCreateOrder/index/components/list-goods-item.vue
@@ -3,10 +3,11 @@
-
+
- {{data.name}}
+ {{data.name}}
+
¥{{data.price}}
@@ -14,7 +15,7 @@
-
+
diff --git a/pagesCreateOrder/index/components/taocanModel.vue b/pagesCreateOrder/index/components/taocanModel.vue
new file mode 100644
index 0000000..07480de
--- /dev/null
+++ b/pagesCreateOrder/index/components/taocanModel.vue
@@ -0,0 +1,174 @@
+
+
+
+
+
+
+ {{item.title}} ({{item.count}}选{{item.number}})
+
+
+
+ {{skd.proName}}
+
+
+
+
+
+
+
+
+
+ ¥
+ {{datas.price}}
+
+
+
+ 添加
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pagesCreateOrder/index/index.vue b/pagesCreateOrder/index/index.vue
index 4886329..67b5509 100644
--- a/pagesCreateOrder/index/index.vue
+++ b/pagesCreateOrder/index/index.vue
@@ -105,7 +105,6 @@
@add="searchGoodsUpdate(goodsItem,goodsIndex,true)"
@reduce="searchGoodsUpdate(goodsItem,goodsIndex,false)"
:index="goodsItem.goodsIndex" :data="goodsItem">
-
@@ -120,7 +119,8 @@
-
+
+
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) {
//移除
@@ -1000,16 +1029,19 @@
$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)
+ // 套餐和单规格
+ if ($goods.groupType != 1) {
+ //增加
+ const num = suit
+ const cartGoods = await addCart({
+ num,
+ productId,
+ skuId
+ })
+ infoBox.showToast('添加成功')
+ $goods.chooseNumber = num
+ cars.push(cartGoods)
+ }
}
return
}
@@ -1188,7 +1220,7 @@
setTabBar($category, $originGoods, cars)
}
onBeforeUnmount(() => {})
-
+
function watchUpdate() {
uni.$off('update:createOrderIndex')
uni.$off('get:table')
@@ -1201,7 +1233,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
From e6ccfdafd636ccb063657854ed663c1e9ffa1770 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com>
Date: Thu, 5 Dec 2024 10:48:11 +0800
Subject: [PATCH 22/29] =?UTF-8?q?=E6=A0=B8=E9=94=80=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.vscode/settings.json | 6 +
http/php/api.ts | 33 +++
http/php/request.ts | 80 ++++++
pageProduct/add-Product/timer.vue | 23 +-
pages.json | 97 ++++---
pages/index/index.vue | 8 +-
pagewriteoff/components/commodity.vue | 255 ++++++++++++++++++
pagewriteoff/components/dialogs.vue | 155 +++++++++++
pagewriteoff/index/index.vue | 267 +++++++++++++++++++
pagewriteoff/index/record.vue | 360 ++++++++++++++++++++++++++
static/indexImg/pagewriteoff.svg | 20 ++
11 files changed, 1248 insertions(+), 56 deletions(-)
create mode 100644 .vscode/settings.json
create mode 100644 http/php/api.ts
create mode 100644 http/php/request.ts
create mode 100644 pagewriteoff/components/commodity.vue
create mode 100644 pagewriteoff/components/dialogs.vue
create mode 100644 pagewriteoff/index/index.vue
create mode 100644 pagewriteoff/index/record.vue
create mode 100644 static/indexImg/pagewriteoff.svg
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..684d827
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,6 @@
+{
+ "files.associations": {
+ "*.ttml": "xml",
+ "*.ttss": "css"
+ }
+}
\ No newline at end of file
diff --git a/http/php/api.ts b/http/php/api.ts
new file mode 100644
index 0000000..b42ecd9
--- /dev/null
+++ b/http/php/api.ts
@@ -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)
+}
diff --git a/http/php/request.ts b/http/php/request.ts
new file mode 100644
index 0000000..f0ae0a2
--- /dev/null
+++ b/http/php/request.ts
@@ -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 }
\ No newline at end of file
diff --git a/pageProduct/add-Product/timer.vue b/pageProduct/add-Product/timer.vue
index dd7a8bf..0556a3b 100644
--- a/pageProduct/add-Product/timer.vue
+++ b/pageProduct/add-Product/timer.vue
@@ -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)
diff --git a/pages.json b/pages.json
index 7b19f3b..cd90984 100644
--- a/pages.json
+++ b/pages.json
@@ -8,8 +8,7 @@
"^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue"
}
},
- "pages": [
- {
+ "pages": [{
"pageId": "PAGES_INDEX",
"path": "pages/index/index",
"style": {
@@ -760,13 +759,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 +891,10 @@
}
},
{
- "path" : "quan/quan",
+ "path": "quan/quan",
"pageId": "PAGES_ORDER_QUAN",
- "style" :
- {
- "navigationBarTitleText" : "券包"
+ "style": {
+ "navigationBarTitleText": "券包"
}
}
@@ -1094,44 +1107,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",
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 00559e2..e42a5a2 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -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;
diff --git a/pagewriteoff/components/commodity.vue b/pagewriteoff/components/commodity.vue
new file mode 100644
index 0000000..8d09884
--- /dev/null
+++ b/pagewriteoff/components/commodity.vue
@@ -0,0 +1,255 @@
+
+
+
+
+
+
+
+
+
+
+ 请选择商品
+
+
+
+
+ {{item.title}}
+
+
+ ¥{{item.amount}}
+
+
+
+
+
+
+
+
+
+
+ 确定核销
+
+
+ 取消
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pagewriteoff/components/dialogs.vue b/pagewriteoff/components/dialogs.vue
new file mode 100644
index 0000000..23c74c2
--- /dev/null
+++ b/pagewriteoff/components/dialogs.vue
@@ -0,0 +1,155 @@
+
+
+
+
+
+
+
+
+
+
+ 绑定门店
+
+
+
+
+ 名称qqqqqqqqq
+
+
+ 地址:qqqqqqq
+
+
+
+ 操作
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pagewriteoff/index/index.vue b/pagewriteoff/index/index.vue
new file mode 100644
index 0000000..88805bb
--- /dev/null
+++ b/pagewriteoff/index/index.vue
@@ -0,0 +1,267 @@
+
+
+
+ 扫码核销
+
+
+
+
+
+ 美团记录
+
+
+
+
+
+ 抖音记录
+
+
+
+
+
+
+
+
+
+ 团购卷核销
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 确认
+
+
+ 取消
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 请进行手机扫码
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pagewriteoff/index/record.vue b/pagewriteoff/index/record.vue
new file mode 100644
index 0000000..8c0172e
--- /dev/null
+++ b/pagewriteoff/index/record.vue
@@ -0,0 +1,360 @@
+
+
+
+
+
+
+
+
+ {{item.d_order_id}}
+
+
+ {{item.title}}
+
+
+
+
+ {{item1.create_time}}
+
+
+ 撤销核销
+
+
+ 等待验券
+
+
+ 失败
+
+
+
+
+ {{item1.title}}
+
+
+
+ {{item1.pay_amount}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.couponUseTime}}
+
+
+ {{item.type ? item.couponStatusDesc:'撤销核销'}}
+
+
+
+
+ {{item.dealTitle}}
+
+
+
+ ¥{{item.couponBuyPrice}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/static/indexImg/pagewriteoff.svg b/static/indexImg/pagewriteoff.svg
new file mode 100644
index 0000000..a3ee822
--- /dev/null
+++ b/static/indexImg/pagewriteoff.svg
@@ -0,0 +1,20 @@
+
+
+
From de90f1249efb6dccf2cf581b236ce8bf14ebe9b5 Mon Sep 17 00:00:00 2001
From: duan <1004387497@qq.com>
Date: Thu, 5 Dec 2024 11:23:39 +0800
Subject: [PATCH 23/29] =?UTF-8?q?=E5=A5=97=E9=A4=90=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../index/components/taocanModel.vue | 32 +++++++++++--------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/pagesCreateOrder/index/components/taocanModel.vue b/pagesCreateOrder/index/components/taocanModel.vue
index 07480de..859e83d 100644
--- a/pagesCreateOrder/index/components/taocanModel.vue
+++ b/pagesCreateOrder/index/components/taocanModel.vue
@@ -8,7 +8,7 @@
style="color:#999">({{item.count}}选{{item.number}})
-
{{skd.proName}}
@@ -62,7 +62,6 @@
title: "",
price: "",
skus: [],
- selectData: [],
// 几选几,的和
selectNumber: 0,
})
@@ -80,6 +79,9 @@
// 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
@@ -90,22 +92,23 @@
})
const emits = defineEmits(['confirm', 'updateSku'])
- let number = ref(1)
- function chooseSkd(skd, number) {
- if (datas.selectData.includes(skd.proId)) {
+ function chooseSkd(skd, item) {
+ if (item.selectData.includes(skd.proId)) {
skd.select = false
- let indexs = datas.selectData.indexOf(skd.proId)
- datas.selectData.splice(indexs, 1)
+ let indexs = item.selectData.indexOf(skd.proId)
+ item.selectData.splice(indexs, 1)
} else {
- if (datas.selectData.length < number) {
+ if (item.selectData.length < item.number) {
skd.select = true
- datas.selectData.push(skd.proId)
+ item.selectData.push(skd.proId)
}
}
+
}
+
const model = ref(null)
function open() {
@@ -118,10 +121,13 @@
const instance = getCurrentInstance();
function confirm() {
- console.log(datas.selectData.length)
- console.log(datas.selectNumber,'调试1111')
- if (datas.selectData.length == datas.selectNumber) {
- emits('confirm', datas.selectData,datas.item)
+ // 将数据保存进对应的值
+ 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()
From 51f3953459c6fd89955160a429773a2f453292aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com>
Date: Fri, 6 Dec 2024 10:05:06 +0800
Subject: [PATCH 24/29] =?UTF-8?q?=E7=A7=B0=E9=87=8D=E5=A2=9E=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../index/components/list-goods-item.vue | 75 +++--
pagesCreateOrder/index/components/weigh.vue | 289 ++++++++++++++++++
pagesCreateOrder/index/index.vue | 33 +-
3 files changed, 362 insertions(+), 35 deletions(-)
create mode 100644 pagesCreateOrder/index/components/weigh.vue
diff --git a/pagesCreateOrder/index/components/list-goods-item.vue b/pagesCreateOrder/index/components/list-goods-item.vue
index f5648ff..b641210 100644
--- a/pagesCreateOrder/index/components/list-goods-item.vue
+++ b/pagesCreateOrder/index/components/list-goods-item.vue
@@ -1,17 +1,20 @@
-
-
+
+
-
+
- {{data.name}}
-
+ {{data.name}}
+
¥{{data.price}}
+
+ 称重
+
@@ -20,7 +23,7 @@
-
+
@@ -56,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,
@@ -80,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)
}
}
@@ -134,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;
diff --git a/pagesCreateOrder/index/components/weigh.vue b/pagesCreateOrder/index/components/weigh.vue
new file mode 100644
index 0000000..bc9b08b
--- /dev/null
+++ b/pagesCreateOrder/index/components/weigh.vue
@@ -0,0 +1,289 @@
+
+
+
+
+
+
+
+ 标题
+
+
+
+
+
+
+
+ 单价
+ ¥{{form.goods.lowPrice}}/{{form.goods.unitName}}
+
+
+ 重量
+
+ {{ currentInput }}
+ {{ form.goods.unitName }}
+
+
+
+
+
+
+
+
+ ¥ {{ form.goods.lowPrice * currentInput }}
+
+
+ 确认
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pagesCreateOrder/index/index.vue b/pagesCreateOrder/index/index.vue
index 67b5509..70259cc 100644
--- a/pagesCreateOrder/index/index.vue
+++ b/pagesCreateOrder/index/index.vue
@@ -78,7 +78,8 @@
+ @tapweigh="tapweigh($event,index)" :index="goodsIndex"
+ :data="goodsItem">
-
-
+
+
{
+ console.log(foodsindex, index)
+ const goods = data.tabbar[index].foods[foodsindex]
+ refweighitem.value.open(foodsindex, index, goods)
+ }
+
function chooseGuige(foodsindex, index) {
if (!canAddGoods()) {
return infoBox.showToast('请先选择桌台', 0.5).then(res => {
@@ -979,6 +990,7 @@
}
function searchGoodsUpdate(goodsItem, goodsIndex, isAdd) {
+ console.log(goodsItem.goodsIndex, goodsItem.index, isAdd, goodsIndex, 111111)
goodsUpdate(goodsItem.goodsIndex, goodsItem.index, isAdd, goodsIndex)
}
@@ -987,7 +999,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()
@@ -1001,13 +1014,17 @@
});
const productId = $goods.id
const skuId = $goods.specList[0].id
- const suit = $goods.specList[0].suit || 1
+ let suit = $goods.specList[0].suit || 1
+ // 不影响之前的代码 称重suit单独处理
+ if ($goods.type == 'weigh' && showCurrentInput) {
+ suit = showCurrentInput
+ }
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)
@@ -1017,6 +1034,10 @@
cartId
})
}
+ // 不影响之前的代码 称重num单独处理
+ if ($goods.type == 'weigh' && showCurrentInput) {
+ num = carGoods.number * 1 + Number(showCurrentInput)
+ }
const {
number
} = await updateCartGoods({
From 38b640e82bd620f314617d9ca42dbbcd152da2a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com>
Date: Fri, 6 Dec 2024 10:35:56 +0800
Subject: [PATCH 25/29] =?UTF-8?q?=E7=A7=B0=E9=87=8D=E9=92=B1=E4=BF=9D?=
=?UTF-8?q?=E7=95=99=E5=90=8E=E4=B8=A4=E4=BD=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pagesCreateOrder/index/components/weigh.vue | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/pagesCreateOrder/index/components/weigh.vue b/pagesCreateOrder/index/components/weigh.vue
index bc9b08b..2e706b3 100644
--- a/pagesCreateOrder/index/components/weigh.vue
+++ b/pagesCreateOrder/index/components/weigh.vue
@@ -31,7 +31,7 @@
- ¥ {{ form.goods.lowPrice * currentInput }}
+ ¥ {{ (form.goods.lowPrice * currentInput).toFixed(2) }}
确认
@@ -90,8 +90,10 @@
// 首位不能输入0
if (currentInput.value === '') {
uni.showToast({
- title: '请输入'
+ title: '请输入',
+ icon:'none'
})
+ return false;
}
emit('weighgoodsUpdate', form.foodsindex, form.index, true, '', currentInput.value)
overlayshow.value = false
From b4dcfe7879775452f639f1c621b95ac57b39751a Mon Sep 17 00:00:00 2001
From: duan <1004387497@qq.com>
Date: Fri, 6 Dec 2024 14:56:37 +0800
Subject: [PATCH 26/29] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81?=
=?UTF-8?q?=E5=87=A0=E9=80=89=E5=87=A0=E6=80=BB=E5=80=BC=E6=B2=A1=E4=BC=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pageProduct/add-Product/add-Product.vue | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pageProduct/add-Product/add-Product.vue b/pageProduct/add-Product/add-Product.vue
index 636d879..dc0b605 100644
--- a/pageProduct/add-Product/add-Product.vue
+++ b/pageProduct/add-Product/add-Product.vue
@@ -540,7 +540,7 @@
-->
-
+
@@ -1693,6 +1693,7 @@
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
From 3616caac21f0172852bfa553e95591183720d1e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com>
Date: Fri, 6 Dec 2024 15:49:15 +0800
Subject: [PATCH 27/29] =?UTF-8?q?=E7=A7=B0=E9=87=8D=EF=BC=8C=E9=BB=98?=
=?UTF-8?q?=E8=AE=A4=E9=80=89=E6=8B=A9=E8=90=A5=E4=B8=9A=E6=97=B6=E9=97=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pageProduct/add-Product/add-Product.vue | 80 ++++++++++++-------
pagesCreateOrder/index/components/car.vue | 2 +-
.../index/components/list-goods-item.vue | 2 +-
pagesCreateOrder/index/components/weigh.vue | 5 +-
pagesCreateOrder/index/index.vue | 12 ++-
pagewriteoff/index/index.vue | 2 +-
6 files changed, 60 insertions(+), 43 deletions(-)
diff --git a/pageProduct/add-Product/add-Product.vue b/pageProduct/add-Product/add-Product.vue
index 636d879..00defca 100644
--- a/pageProduct/add-Product/add-Product.vue
+++ b/pageProduct/add-Product/add-Product.vue
@@ -12,14 +12,15 @@
-
+
-
+
-
+
-
+
@@ -90,7 +91,7 @@
-->
-
+
@@ -515,12 +516,12 @@
*
- 重量
+ 单位
- 千克
+ {{activeinHouseList}}
用于快递或配送运费计重
@@ -543,8 +544,7 @@
是否允许临时改价
-
+
@@ -577,14 +577,16 @@
-
+
+ *
定时上下架
{{returnTimerDayText()}}
- {{returnTimerTimeText()}}
+ {{returnTimerTimeText()}}
+
@@ -701,8 +703,8 @@
-
-
+
+
@@ -916,7 +918,7 @@
function proGroupVoAddGoods(index, arr) {
proGroupVoIndex = index
- if(!FormData.proGroupVo){
+ if (!FormData.proGroupVo) {
initDefaultProGroupVo()
}
if (FormData.groupType == 0) {
@@ -1230,13 +1232,13 @@
//表单边框
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'],
specsInfoName: '',
@@ -1364,7 +1366,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') {
@@ -1572,6 +1574,12 @@
getTbShopUnit()
getTbProductSpec()
})
+ const changeFormDatatype = (e) => {
+ console.log(e)
+ console.log(FormData)
+ // 当是称重商品时 默认是单规格
+ FormData.typeEnum = 'normal'
+ }
onShow(() => {
// if (option.type === 'edit') {
@@ -1685,7 +1693,7 @@
}
}
if (type == 'package') {
- if (groupType == 0&& FormData.proGroupVo[0].goods.length<=0) {
+ if (groupType == 0 && FormData.proGroupVo[0].goods.length <= 0) {
// 固定套餐
return infoBox.showToast('套餐组合至少需要包含一种商品,请添加商品')
}
@@ -1718,7 +1726,7 @@
}
const submitData = {
...FormData,
- showType:FormData.showType.join(','),
+ showType: FormData.showType.join(','),
proGroupVo: type != 'package' ? '' : FormData.proGroupVo,
images: images,
coverImg: images[0] || '',
@@ -1767,7 +1775,6 @@
return result.replace(/.$/, "")
}
})
-
/**
* 监听规格保存,拿到数据
*/
@@ -1931,14 +1938,14 @@
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
+ if (FormData.groupType == null) {
+ FormData.groupType = 0
}
} else {
if (newval == 'package') {
@@ -2005,11 +2012,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)
})
@@ -2020,6 +2038,7 @@
onReady(() => {
Forms.value && Forms.value.setRules(rules)
})
+
onBeforeUnmount(() => {
clearTimeout(timer)
})
@@ -2133,7 +2152,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;
}
diff --git a/pagesCreateOrder/index/components/car.vue b/pagesCreateOrder/index/components/car.vue
index 44f0f26..13e5a36 100644
--- a/pagesCreateOrder/index/components/car.vue
+++ b/pagesCreateOrder/index/components/car.vue
@@ -36,7 +36,7 @@
- {{item.number}}
+ {{(item.number).toFixed(2)}}
diff --git a/pagesCreateOrder/index/components/list-goods-item.vue b/pagesCreateOrder/index/components/list-goods-item.vue
index b641210..6cc9830 100644
--- a/pagesCreateOrder/index/components/list-goods-item.vue
+++ b/pagesCreateOrder/index/components/list-goods-item.vue
@@ -28,7 +28,7 @@
- {{data.chooseNumber}}
+ {{(data.chooseNumber).toFixed(2)}}
diff --git a/pagesCreateOrder/index/components/weigh.vue b/pagesCreateOrder/index/components/weigh.vue
index 2e706b3..1c44866 100644
--- a/pagesCreateOrder/index/components/weigh.vue
+++ b/pagesCreateOrder/index/components/weigh.vue
@@ -91,11 +91,11 @@
if (currentInput.value === '') {
uni.showToast({
title: '请输入',
- icon:'none'
+ icon: 'none'
})
return false;
}
- emit('weighgoodsUpdate', form.foodsindex, form.index, true, '', currentInput.value)
+ emit('weighgoodsUpdate', form.foodsindex, form.index, true, undefined, currentInput.value)
overlayshow.value = false
}
//显示
@@ -108,7 +108,6 @@
index,
goods
})
- console.log(form)
overlayshow.value = true
}
defineExpose({
diff --git a/pagesCreateOrder/index/index.vue b/pagesCreateOrder/index/index.vue
index 70259cc..8374b7b 100644
--- a/pagesCreateOrder/index/index.vue
+++ b/pagesCreateOrder/index/index.vue
@@ -862,7 +862,6 @@
// 称重
const refweighitem = ref(null)
const tapweigh = (foodsindex, index) => {
- console.log(foodsindex, index)
const goods = data.tabbar[index].foods[foodsindex]
refweighitem.value.open(foodsindex, index, goods)
}
@@ -990,7 +989,6 @@
}
function searchGoodsUpdate(goodsItem, goodsIndex, isAdd) {
- console.log(goodsItem.goodsIndex, goodsItem.index, isAdd, goodsIndex, 111111)
goodsUpdate(goodsItem.goodsIndex, goodsItem.index, isAdd, goodsIndex)
}
@@ -1015,10 +1013,6 @@
const productId = $goods.id
const skuId = $goods.specList[0].id
let suit = $goods.specList[0].suit || 1
- // 不影响之前的代码 称重suit单独处理
- if ($goods.type == 'weigh' && showCurrentInput) {
- suit = showCurrentInput
- }
if (goodsInCarIndex !== -1) {
//更新
const carGoods = cars[goodsInCarIndex]
@@ -1050,6 +1044,10 @@
$goods.chooseNumber = number
setSearchGoods(searchGoodsIndex, number)
} else {
+ // 不影响之前的代码 称重suit单独处理
+ if ($goods.type == 'weigh' && showCurrentInput) {
+ suit = showCurrentInput
+ }
// 套餐和单规格
if ($goods.groupType != 1) {
//增加
@@ -1060,7 +1058,7 @@
skuId
})
infoBox.showToast('添加成功')
- $goods.chooseNumber = num
+ $goods.chooseNumber = Number(num)
cars.push(cartGoods)
}
}
diff --git a/pagewriteoff/index/index.vue b/pagewriteoff/index/index.vue
index 88805bb..3d05a55 100644
--- a/pagewriteoff/index/index.vue
+++ b/pagewriteoff/index/index.vue
@@ -1,6 +1,6 @@
-
+
扫码核销
From 8c15aadf219b778cfa7e03ee91721b4d768f67cc Mon Sep 17 00:00:00 2001
From: duan <1004387497@qq.com>
Date: Fri, 6 Dec 2024 16:42:58 +0800
Subject: [PATCH 28/29] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81?=
=?UTF-8?q?=E5=A6=82=E6=9E=9C=E5=A5=97=E9=A4=90=E6=B2=A1=E9=80=89=E6=8B=A9?=
=?UTF-8?q?=E8=A7=84=E6=A0=BC,=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD?=
=?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=9D=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pageProduct/add-Product/add-Product.vue | 56 ++++++++++++++-----------
1 file changed, 32 insertions(+), 24 deletions(-)
diff --git a/pageProduct/add-Product/add-Product.vue b/pageProduct/add-Product/add-Product.vue
index dc0b605..010c7a0 100644
--- a/pageProduct/add-Product/add-Product.vue
+++ b/pageProduct/add-Product/add-Product.vue
@@ -68,12 +68,12 @@
-
+
-
+
@@ -90,7 +90,7 @@
-->
-
+
@@ -540,7 +540,7 @@
-->
-
-
-
+
+
@@ -896,13 +897,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
@@ -916,7 +917,7 @@
function proGroupVoAddGoods(index, arr) {
proGroupVoIndex = index
- if(!FormData.proGroupVo){
+ if (!FormData.proGroupVo) {
initDefaultProGroupVo()
}
if (FormData.groupType == 0) {
@@ -945,7 +946,6 @@
}
function refChooseGoodsConfirm(arr) {
- console.log(arr);
refChooseGoodsClose()
arr = arr.map(v => {
const {
@@ -974,10 +974,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) {
@@ -1235,8 +1233,8 @@
endTime: '',
//每日销量上限,
dayLimit: 0,
- singleOrderLimit:0,
- singlePeopleLimit:0,
+ singleOrderLimit: 0,
+ singlePeopleLimit: 0,
type: 'normal',
showType: ['table'],
specsInfoName: '',
@@ -1364,7 +1362,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') {
@@ -1685,7 +1683,7 @@
}
}
if (type == 'package') {
- if (groupType == 0&& FormData.proGroupVo[0].goods.length<=0) {
+ if (groupType == 0 && FormData.proGroupVo[0].goods.length <= 0) {
// 固定套餐
return infoBox.showToast('套餐组合至少需要包含一种商品,请添加商品')
}
@@ -1719,7 +1717,7 @@
}
const submitData = {
...FormData,
- showType:FormData.showType.join(','),
+ showType: FormData.showType.join(','),
proGroupVo: type != 'package' ? '' : FormData.proGroupVo,
images: images,
coverImg: images[0] || '',
@@ -1745,6 +1743,15 @@
})
})
}
+ // 如果套餐没选择规格,默认选中第一条
+ 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('添加成功')
@@ -1932,14 +1939,14 @@
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
+ if (FormData.groupType == null) {
+ FormData.groupType = 0
}
} else {
if (newval == 'package') {
@@ -2134,7 +2141,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;
}
From 6d8284e78fbeb5172176cd65eea1c3965d280394 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com>
Date: Sat, 7 Dec 2024 14:15:04 +0800
Subject: [PATCH 29/29] 1
---
pageProduct/add-Product/add-Product.vue | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/pageProduct/add-Product/add-Product.vue b/pageProduct/add-Product/add-Product.vue
index f9c46ec..dbc6850 100644
--- a/pageProduct/add-Product/add-Product.vue
+++ b/pageProduct/add-Product/add-Product.vue
@@ -1751,14 +1751,18 @@
})
}
// 如果套餐没选择规格,默认选中第一条
- 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
- }
+ 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('添加成功')