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/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/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/http/yskApi/Instead.js b/http/yskApi/Instead.js
index d964201..9839f3b 100644
--- a/http/yskApi/Instead.js
+++ b/http/yskApi/Instead.js
@@ -389,4 +389,27 @@ export function $calcDeDuctionPoints(data) {
...data
}
});
-}
\ No newline at end of file
+}
+
+//购物车-临时菜添加
+export function $temporaryDishes(data) {
+ return request({
+ url: '/api/place/temporaryDishes',
+ method: "post",
+ data:{
+ shopId: uni.getStorageSync("shopId"),
+ ...data
+ }
+ });
+}
+//单品改价
+export function $updatePrice(data) {
+ return request({
+ url: '/api/place/updatePrice',
+ method: "put",
+ data:{
+ shopId: uni.getStorageSync("shopId"),
+ ...data
+ }
+ });
+}
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')
diff --git a/pageProduct/add-Product/add-Product.vue b/pageProduct/add-Product/add-Product.vue
index dad2fe6..dbc6850 100644
--- a/pageProduct/add-Product/add-Product.vue
+++ b/pageProduct/add-Product/add-Product.vue
@@ -10,28 +10,40 @@
-
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -39,36 +51,29 @@
注:第一张图为商品封面图,图片尺寸为750x750
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+ 套餐名称
+
+
+
+
+ 删除套餐组
+
+
+
+
+
+
+ 添加商品
+
+
+
+
+
+
+
+ 名称
+ 规格
+ 价格
+
+ 数量
+
+
+
+
+
+ {{product.name||product.proName}}
+
+
+
+
+
+ 设置规格
+
+
+ {{product.skuName}}
+
+
+
+
+
+ {{product.lowPrice||product.price}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+ 几选几
+
+
+
+
+
+
+
+
+
+
+
+
+ 添加套餐组
+
+
+
+
+
+ 添加商品
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -111,10 +260,11 @@
+
-
+
选择规格
编辑规格
@@ -148,82 +298,64 @@
-
-
- 套餐商品
-
-
-
-
-
-
-
- 商品信息
-
-
- 名称
- 数量
- 操作
-
-
-
-
- {{product.name}}
-
-
-
-
- x1
-
-
-
-
-
-
-
-
- 添加商品
-
-
-
-
-
-
-
-
-
-
- 删除分组
-
-
-
-
-
-
- 添加分组
-
-
-
-
+
+ 规格属性
+
+
+
+ *
+ 售价
+
+
+
+
+
+
+
+ 会员价
+
+
+
+
+
+
+
+
+
+ *
+ 起售数量
+
+
+
+
+
+
+
+ 分销金额
+
+
+
+
+
+
+
+
+ 商品条形码
+
+
+ {{sku.barCode}}
+
+
+
+
+
-
-
+ -->
@@ -397,6 +512,23 @@
+
+
+
+ *
+ 单位
+
+
+
+
+ {{activeinHouseList}}
+
+
+ 用于快递或配送运费计重
+
+
+
+
-
+
+
+
+
+
+ *
+ 定时上下架
+
+
+
+ {{returnTimerDayText()}}
+
+ {{returnTimerTimeText()}}
+
+
+
+
+
+
+
+
上架
@@ -475,7 +659,7 @@
-
+
@@ -515,8 +699,12 @@
+
+
+
+
@@ -535,8 +723,12 @@
import color from '@/commons/color.js';
import chooseGoods from './components/choose-goods'
+ import chooseGuige from './components/choose-guige'
import editHaocai from './components/edit-haocai.vue'
import chooseGroupCategory from './components/choose-coupon-category'
+ import priceNumberBox from './components/price-number-box'
+
+
import infoBox from "@/commons/utils/infoBox.js"
import {
@@ -701,18 +893,44 @@
refChooseGroupCategory.value.close()
}
+ //规格选择
+ const refChooseGuige = ref(null)
+ let proGroupVoGoodsIndex = undefined
+
+ function refChooseGuigeOpen(skuList, groupIndex, goodsIndex) {
+ console.log(groupIndex, goodsIndex)
+ proGroupVoIndex = groupIndex
+ proGroupVoGoodsIndex = goodsIndex
+ refChooseGuige.value.open(skuList)
+ }
+
+ function refChooseGuigeConfirm(sku) {
+ FormData.proGroupVo[proGroupVoIndex].goods[proGroupVoGoodsIndex].skuName = sku.specSnap || sku.name
+ FormData.proGroupVo[proGroupVoIndex].goods[proGroupVoGoodsIndex].skuId = sku.id
+ proGroupVoIndex = undefined
+ proGroupVoGoodsIndex = undefined
+ }
+
+
//套餐商品选择
const refChooseGoods = ref(null)
- let groupSnapIndex = undefined
+ let proGroupVoIndex = undefined
- function groupSnapAddGoods(index, arr) {
- console.log(arr);
- groupSnapIndex = index
- refChooseGoods.value.open(arr.map(v => v.id))
+ function proGroupVoAddGoods(index, arr) {
+ proGroupVoIndex = index
+ if (!FormData.proGroupVo) {
+ initDefaultProGroupVo()
+ }
+ if (FormData.groupType == 0) {
+ const goods = FormData.proGroupVo[0].goods
+ refChooseGoods.value.open(goods)
+ } else {
+ refChooseGoods.value.open(arr)
+ }
}
function refChooseGoodsOpen() {
- groupSnapIndex = undefined
+ proGroupVoIndex = undefined
refChooseGoods.value.open()
}
@@ -720,41 +938,63 @@
refChooseGoods.value.close()
}
+ function proGroupVoPush() {
+ FormData.proGroupVo.push({
+ title: '',
+ number: 1,
+ goods: []
+ })
+ }
+
function refChooseGoodsConfirm(arr) {
- console.log(arr);
refChooseGoodsClose()
arr = arr.map(v => {
const {
+ proId,
id,
name,
- groupNum,
unitName,
- categoryId
+ lowPrice,
+ type,
+ typeEnum,
+ skuList
} = v
+ if (proId) {
+ return v
+ }
return {
- id,
- name,
- groupNum,
+ proId: id,
+ proName: name,
unitName,
- categoryId
+ price: lowPrice,
+ number: 1,
+ type,
+ typeEnum,
+ skuList,
+ skuId: '',
+ skuName: ''
}
})
- if (groupSnapIndex !== undefined) {
- return FormData.groupSnap[groupSnapIndex].goods = arr
+
+ if (FormData.groupType == 0) {
+ return FormData.proGroupVo[0].goods = arr
}
- FormData.groupSnap.push({
+ if (FormData.groupType == 1 && proGroupVoIndex !== undefined) {
+ return FormData.proGroupVo[proGroupVoIndex].goods = arr
+ }
+ FormData.proGroupVo.push({
title: '',
number: 1,
goods: arr
})
}
- function groupSnapGoodsDel(index, goodsIndex) {
- FormData.groupSnap[index].goods.splice(goodsIndex, 1)
+ function proGroupVoGoodsDel(index, goodsIndex) {
+ FormData.proGroupVo[index].goods.splice(goodsIndex, 1)
}
- function delGroupSnap(index) {
- FormData.groupSnap.splice(index, 1)
+ function delproGroupVo(index) {
+ FormData.proGroupVo.splice(index, 1)
}
@@ -790,6 +1030,9 @@
const min = 0;
const max = 100000000;
console.log(item[key]);
+ if (item[key] === '') {
+ return
+ }
const newval = formatPrice(item[key], min, max, true)
console.log(newval)
if (typeof newval !== 'number') {
@@ -805,7 +1048,17 @@
})
}
-
+ //套餐商品类型
+ const packageType = reactive({
+ list: [{
+ name: '固定套餐',
+ value: 0
+ }, {
+ name: '可选套餐',
+ value: 1
+ }],
+ sel: 0
+ })
// 库存模式
const InventoryModeData = [{
text: '传统模式',
@@ -975,44 +1228,16 @@
let myTest = ref(false)
//表单边框
const inputBorder = ref(false)
- //商品表单数据
- // const FormData = reactive({
- // images: [],
- // name: '',
- // goodsCode: '',
- // shortTitle: '',
- // goodsDetail: '',
- // goodsDetail: '',
- // categoryId: '',
- // salesMethod: 0,
- // startTime: '',
- // isStock: false,
- // isVipDiscount: false,
- // packagingFee: 0,
- // weight: 0,
- // integral: 0,
- // openDailySalesLimit: false,
- // dailySalesLimit: '',
- // openOrderBuyLimit: false,
- // orderBuyLimit: 0,
- // openEveryoneBuyLimit: false,
- // everyoneBuyLimit: 0,
- // minBuyLimit: 0,
- // specificationsPattern: '',
- // specificationsGroup: '',
- // paySuccessAfterDay: '',
- // openDiscount: false,
- // discountPrice: 0,
- // isVipDiscount: false,
- // vipPrice: 0,
- // packagingFee: 0,
- // virtualSales: 0,
- // isRecommend: false,
- // timer: [],
- // isShowCash: 1,
- // isShowMall: 1,
- // })
const FormData = reactive({
+ days: "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
+ endTime: "23:59",
+ startTime: "00:00",
+ //每日销量上限,
+ dayLimit: 0,
+ singleOrderLimit: 0,
+ singlePeopleLimit: 0,
+ type: 'normal',
+ showType: ['table'],
specsInfoName: '',
id: "",
typeEnum: "normal",
@@ -1025,18 +1250,24 @@
coverImg: "",
images: [],
shopId: uni.getStorageSync('shopId'),
+ groupType: 0,
+ weight: '',
+ //套餐组合
+ proGroupVo: [],
lowPrice: "",
skuList: [],
isShowMall: 1,
isShowCash: 1,
isStock: 0,
isStock: 0,
+ //是否允许临时改价
+ isTempPrice: 1,
isHot: 0,
packFee: 0,
specId: "",
// baseSalesNumber: 0,
sort: 0,
- groupSnap: [],
+ proGroupVo: [],
specInfo: [],
selectSpec: [],
specTableHeaders: [],
@@ -1057,6 +1288,16 @@
usageRules: ""
}
})
+
+ //添加套餐组
+ function addProGroupVo() {
+ FormData.addProGroupVo.push({
+ title: '',
+ goods: [],
+ number: 0,
+ count: 0
+ })
+ }
const skuList = reactive({
list: [{
...$defaultSku,
@@ -1122,6 +1363,7 @@
res.specsInfoName = specsInfoName
$goodsData = res
skuList.list = res.skuList
+ res.showType = res.showType.split(',')
Object.assign(FormData, res)
//多规格
if (res.typeEnum === 'sku') {
@@ -1249,6 +1491,19 @@
// 商品类型
// types: $types,
types: [{
+ name: '普通商品',
+ value: 'normal'
+ },
+ {
+ name: '套餐商品',
+ value: 'package'
+ },
+ {
+ name: '称重商品',
+ value: 'weigh'
+ }
+ ],
+ typeEnums: [{
name: '单规格',
value: 'normal'
},
@@ -1264,7 +1519,25 @@
// 规格
specList: [],
//库存
- skuList: []
+ skuList: [],
+ //显示
+ showTypes: [{
+ name: '堂食',
+ value: 'table'
+ },
+ {
+ name: '自取',
+ value: 'dine'
+ },
+ {
+ name: '配送',
+ value: 'delivery'
+ },
+ {
+ name: '快递',
+ value: 'express'
+ }
+ ]
})
//查询商品库存
function getProductSku() {
@@ -1298,6 +1571,12 @@
getTbShopUnit()
getTbProductSpec()
})
+ const changeFormDatatype = (e) => {
+ console.log(e)
+ console.log(FormData)
+ // 当是称重商品时 默认是单规格
+ FormData.typeEnum = 'normal'
+ }
onShow(() => {
// if (option.type === 'edit') {
@@ -1334,11 +1613,12 @@
if (!bol) {
return
}
-
Forms.value.validate().then(res => {
const {
typeEnum,
- groupCategoryId
+ groupType,
+ groupCategoryId,
+ type
} = FormData
if (typeEnum === 'group' && !groupCategoryId.length) {
return infoBox.showToast('请选择团购券分类')
@@ -1409,9 +1689,43 @@
return infoBox.showToast('请输入库存数量!')
}
}
-
+ if (type == 'package') {
+ 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
+ tips = '套餐组合至少需要包含一种商品,请添加商品'
+ break
+ }
+ if (!item.title) {
+ ispase = false
+ tips = '请输入套餐名称'
+ break
+ }
+ }
+ if (!ispase) {
+ return infoBox.showToast(tips)
+ }
+ // 可选套餐
+ }
+ }
+ if (type == 'weigh') {
+ if (!FormData.weight) {
+ return infoBox.showToast('请输入重量')
+ }
+ }
const submitData = {
...FormData,
+ showType: FormData.showType.join(','),
+ proGroupVo: type != 'package' ? '' : FormData.proGroupVo,
images: images,
coverImg: images[0] || '',
skuList: submitSkuList,
@@ -1435,10 +1749,20 @@
settimeoutBack(1500)
})
})
-
-
-
}
+ // 如果套餐没选择规格,默认选中第一条
+ 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('添加成功')
@@ -1462,7 +1786,6 @@
return result.replace(/.$/, "")
}
})
-
/**
* 监听规格保存,拿到数据
*/
@@ -1475,7 +1798,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,
@@ -1519,27 +1842,46 @@
* @param {Boolean} open //控制开启或关闭监听
*/
function watchTimerSave(open = true) {
- if (open) {
- uni.$on('timerSave', function(timer) {
- console.log('timerSave get');
- console.log(timer);
- FormData.timer = timer
- })
- } else {
- uni.$off('timerSave', function(data) {
- console.log('timerSave remove');
- })
- }
+ uni.$off('timerSave')
+ uni.$on('timerSave', function(timer) {
+ Object.assign(FormData, timer)
+ })
}
function toTimerPage() {
- uni.setStorageSync('timer', FormData.timer)
- go.to('PAGES_PRODUCT_TIMER')
+ go.to('PAGES_PRODUCT_TIMER', {
+ productId: option.productId
+ })
}
- function returnTimerText() {
- return FormData.timer.length ? `当前有${FormData.timer.length}个定时器` : '没有定时器'
+ const ListDataconstructor = {
+ cycleChecked: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
+ }
+ const $week = {
+ Monday: '周一',
+ Tuesday: '周二',
+ Wednesday: '周三',
+ Thursday: '周四',
+ Friday: '周无',
+ Saturday: '周六',
+ Sunday: '周日',
+ }
+
+ function returnTimerDayText() {
+ if (!FormData.days) {
+ return ''
+ }
+ return FormData.days.split(',').filter(v => v).map(v => $week[v]).join(',')
+ // return FormData.timer.length ? `当前有${FormData.timer.length}个定时器` : '没有定时器'
+ }
+
+ function returnTimerTimeText() {
+ if (!FormData.startTime || !FormData.endTime) {
+ return ''
+ }
+ return FormData.startTime + '-' + FormData.endTime
+ // return FormData.timer.length ? `当前有${FormData.timer.length}个定时器` : '没有定时器'
}
@@ -1602,6 +1944,50 @@
skuList.list = []
}
}
+ })
+
+ watch(() => FormData.type, (newval) => {
+ if (option.type == 'edit') {
+ if (newval == $goodsData.type) {
+ if ($goodsData.proGroupVo) {
+ FormData.proGroupVo = $goodsData.proGroupVo || []
+ } else {
+ initDefaultProGroupVo()
+ }
+ }
+ if (FormData.groupType == null) {
+ FormData.groupType = 0
+ }
+ } else {
+ if (newval == 'package') {
+ initDefaultProGroupVo()
+ }
+ }
+
+ })
+
+ function initDefaultProGroupVo() {
+ FormData.proGroupVo = [{
+ title: '',
+ count: '',
+ number: 1,
+ goods: []
+ }]
+ console.log(FormData.proGroupVo);
+ }
+ watch(() => FormData.groupType, (newval) => {
+ if (newval == 0) {
+ return initDefaultProGroupVo()
+ }
+ if (option.type == 'edit') {
+ if (newval == $goodsData.groupType) {
+ FormData.proGroupVo = $goodsData.proGroupVo
+ } else {
+
+ }
+ return
+ }
+ initDefaultProGroupVo()
})
@@ -1637,20 +2023,33 @@
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)
})
onShow(() => {
watchSpecificationsSave()
+ watchTimerSave()
})
onReady(() => {
Forms.value && Forms.value.setRules(rules)
})
+
onBeforeUnmount(() => {
clearTimeout(timer)
})
@@ -1661,6 +2060,13 @@
}
\ 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..7b00a90
--- /dev/null
+++ b/pageProduct/add-Product/components/price-number-box.vue
@@ -0,0 +1,109 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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..0556a3b 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,6 +90,8 @@
function getTime(indexArr) {
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}`
}
//获取$event.detail.value
@@ -94,66 +103,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',
+ index: [0, 0, 0]
},
- offShelf: {
- value: '18:00',
- index: [18, 0]
+ endTime: {
+ value: '23:59',
+ index: [0, 0, 0]
}
}
}
const list = ref([returnBasicDataConstructor()])
+
function returnBasicDataConstructor() {
return {
...ListDataconstructor,
@@ -164,25 +174,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 +248,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
diff --git a/pages.json b/pages.json
index 7b19f3b..27aed3f 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": {
@@ -639,7 +638,7 @@
}
},
{
- "pageId": "PAGES_ADD_TEMP_CUISINE",
+ "pageId": "PAGES_CHOOSE_ADD_TEMP_CUISINE",
"path": "add-temp-cuisine/add-temp-cuisine",
"style": {
"navigationBarTitleText": "添加临时菜"
@@ -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/pagesCreateOrder/add-temp-cuisine/add-temp-cuisine.vue b/pagesCreateOrder/add-temp-cuisine/add-temp-cuisine.vue
index 4d364ea..e7536a8 100644
--- a/pagesCreateOrder/add-temp-cuisine/add-temp-cuisine.vue
+++ b/pagesCreateOrder/add-temp-cuisine/add-temp-cuisine.vue
@@ -1,5 +1,5 @@
-
+
*
将临时菜添加至购物车,不会影响总商品库
@@ -14,20 +14,20 @@
*
-
+
-
+
菜品分类
*
-
+
@@ -34,7 +34,6 @@
-
元
@@ -46,19 +45,22 @@
-
- 打折原因
- *
-
+
+ 当前单品价格:{{price}}
+
+
+ 打折原因
+ *
+
-
-
+
@@ -67,7 +69,10 @@
确认
- 取消
+
+
+
+
@@ -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,
diff --git a/pagesCreateOrder/confirm-order/confirm-order.vue b/pagesCreateOrder/confirm-order/confirm-order.vue
index c7d7939..25b4c9a 100644
--- a/pagesCreateOrder/confirm-order/confirm-order.vue
+++ b/pagesCreateOrder/confirm-order/confirm-order.vue
@@ -136,10 +136,15 @@
:key="index">
-
+
+
+ 临时菜
+
-
+
@@ -154,6 +159,11 @@
custom-style="background-color: #E6F0FF; border-color: #E6F0FF; color: #318AFE;"
size="small" text="打包" inverted type="success" />
+
+
+
{{item.name}}
@@ -174,7 +184,8 @@
¥{{formatPrice(item.salePrice*item.number) }}
- ¥{{formatPrice(item.memberPrice*item.number) }}
+ ¥{{formatPrice(item.memberPrice*item.number) }}
@@ -196,9 +207,10 @@
-
+
+
+
-
+ @tap="toggleWait(item)">{{item.isWaitCall?'取消等叫':'等叫'}}
+
+
+
+
@@ -251,7 +267,7 @@
¥{{formatPrice(youhui) }}
-
+
实收金额
¥{{formatPrice(allPrice) }}
@@ -278,8 +294,8 @@
-
-
+
@@ -351,7 +367,26 @@
return Number(n).toFixed(2)
}
-
+ // 单品打折
+ 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 +451,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 +542,6 @@
function watchChooseuser() {
uni.$off('choose-user')
uni.$on('choose-user', (data) => {
- console.log(data);
user.value = data
setUser()
})
@@ -520,20 +582,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 +608,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 +643,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/components/car.vue b/pagesCreateOrder/index/components/car.vue
index 65f5681..13e5a36 100644
--- a/pagesCreateOrder/index/components/car.vue
+++ b/pagesCreateOrder/index/components/car.vue
@@ -6,7 +6,7 @@
- 已添加{{goodsNumber}}件商品
+ 已添加{{goodsNumber.toFixed(0)}}件商品
清空
@@ -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 bd15f0b..6cc9830 100644
--- a/pagesCreateOrder/index/components/list-goods-item.vue
+++ b/pagesCreateOrder/index/components/list-goods-item.vue
@@ -1,30 +1,34 @@
-
-
+
+
-
+
- {{data.name}}
+ {{data.name}}
+
¥{{data.price}}
+
+ 称重
+
-
+
-
+
- {{data.chooseNumber}}
+ {{(data.chooseNumber).toFixed(2)}}
@@ -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;
diff --git a/pagesCreateOrder/index/components/taocanModel.vue b/pagesCreateOrder/index/components/taocanModel.vue
new file mode 100644
index 0000000..859e83d
--- /dev/null
+++ b/pagesCreateOrder/index/components/taocanModel.vue
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+ {{item.title}} ({{item.count}}选{{item.number}})
+
+
+
+ {{skd.proName}}
+
+
+
+
+
+
+
+
+
+ ¥
+ {{datas.price}}
+
+
+
+ 添加
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pagesCreateOrder/index/components/weigh.vue b/pagesCreateOrder/index/components/weigh.vue
new file mode 100644
index 0000000..1c44866
--- /dev/null
+++ b/pagesCreateOrder/index/components/weigh.vue
@@ -0,0 +1,290 @@
+
+
+
+
+
+
+
+ 标题
+
+
+
+
+
+
+
+ 单价
+ ¥{{form.goods.lowPrice}}/{{form.goods.unitName}}
+
+
+ 重量
+
+ {{ currentInput }}
+ {{ form.goods.unitName }}
+
+
+
+
+
+
+
+
+ ¥ {{ (form.goods.lowPrice * currentInput).toFixed(2) }}
+
+
+ 确认
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pagesCreateOrder/index/index.vue b/pagesCreateOrder/index/index.vue
index 241dba9..8374b7b 100644
--- a/pagesCreateOrder/index/index.vue
+++ b/pagesCreateOrder/index/index.vue
@@ -60,7 +60,7 @@
-
+
临时菜
@@ -78,7 +78,8 @@
+ @tapweigh="tapweigh($event,index)" :index="goodsIndex"
+ :data="goodsItem">
+
-
-
+
+
{
+ const goods = data.tabbar[index].foods[foodsindex]
+ refweighitem.value.open(foodsindex, index, goods)
+ }
function chooseGuige(foodsindex, index) {
if (!canAddGoods()) {
@@ -838,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) {
@@ -897,10 +939,15 @@
categoryId,
skuId
} = goods
+
const cartId = goods.id
const tabbarIndex = data.tabbar.findIndex(v => v.id == categoryId)
- const $goods = data.tabbar[tabbarIndex].foods.find(v => v.id == productId)
- const $sku = $goods.specList.find(v => v.id == skuId)
+ //临时菜没有对应商品数据
+ 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)
if (num === 0 || num < $sku.suit) {
//移除
@@ -950,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()
@@ -964,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)
@@ -980,6 +1028,10 @@
cartId
})
}
+ // 不影响之前的代码 称重num单独处理
+ if ($goods.type == 'weigh' && showCurrentInput) {
+ num = carGoods.number * 1 + Number(showCurrentInput)
+ }
const {
number
} = await updateCartGoods({
@@ -992,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
}
@@ -1129,7 +1188,7 @@
}
if (e.detail.scrollTop == 0) {
isTabClickOver = true
- return swichMenu(0)
+ // return swichMenu(0)
}
setTimeout(() => { // 节流
data.timer = null;
@@ -1184,6 +1243,7 @@
function watchUpdate() {
uni.$off('update:createOrderIndex')
uni.$off('get:table')
+ uni.$off('add:cashCai')
uni.$on('update:createOrderIndex', () => {
// data.table = {
// tableId: ""
@@ -1192,6 +1252,15 @@
console.log('update:createOrderIndex');
init()
})
+ uni.$on('add:cashCai', async () => {
+ console.log('add:cashCai');
+ const cartRes = await getCart()
+ cars.length = 0
+ const cartArr = getNowCart(cartRes.records)
+ for (let i in cartArr) {
+ cars.push(cartArr[i])
+ }
+ })
uni.$on('get:table', () => {
console.log('get:table');
if (data.table.tableId) {
diff --git a/pagesCreateOrder/util.js b/pagesCreateOrder/util.js
index d584538..4ce76a5 100644
--- a/pagesCreateOrder/util.js
+++ b/pagesCreateOrder/util.js
@@ -9,7 +9,10 @@ export function getNowCart(records) {
const arr = []
for (let i in Cart) {
const item=Cart[i]
- const key = item.productId + '_' + item.skuId
+ const productId=item.productId
+ const skuId=item.skuId
+ const isLinShiCai=!productId&&!skuId?true:false
+ const key =isLinShiCai?item.name: (item.productId + '_' + item.skuId)
if (goodsMap.hasOwnProperty(key)) {
const index = goodsMap[key]
arr[index].number = arr[index].number * 1 + item.number
diff --git a/pagesOrder/detail/detail.vue b/pagesOrder/detail/detail.vue
index 4ba1343..710f27b 100644
--- a/pagesOrder/detail/detail.vue
+++ b/pagesOrder/detail/detail.vue
@@ -219,7 +219,8 @@
tableId: options.tableId || orderDetail.info.tableId,
name: options.name || orderDetail.info.tableName,
masterId:orderDetail.info.masterId,
- type: 'add'
+ type: 'add',
+ vipUserId:orderDetail.memberId?orderDetail.memberId:''
})
}
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..3d05a55
--- /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 @@
+
+
+