合并代码

This commit is contained in:
2024-10-24 15:47:06 +08:00
11 changed files with 133 additions and 459 deletions

View File

@@ -126,6 +126,48 @@ const model = {
return appCache.useType return appCache.useType
} }
}, },
// 缓存代客下单商品
cacheGoods: (val, isDelete = false) => {
if (isDelete) {
appCache.cacheGoods = ""
return uni.removeStorageSync('cacheGoods')
}
if (val) {
// 有值,为放置
appCache.cacheGoods = val
uni.setStorageSync('cacheGoods', val)
} else {
// 否则为获取
if (!appCache.cacheGoods) {
//缓存取不到,获取应用本地信息
appCache.cacheGoods = uni.getStorageSync('cacheGoods')
}
return appCache.cacheGoods
}
},
// 缓存代客下单商品节点信息缓存
cacheGoodsNode: (val, isDelete = false) => {
if (isDelete) {
appCache.cacheGoodsNode = ""
return uni.removeStorageSync('cacheGoodsNode')
}
if (val) {
// 有值,为放置
appCache.cacheGoodsNode = val
uni.setStorageSync('cacheGoodsNode', val)
} else {
// 否则为获取
if (!appCache.cacheGoodsNode) {
//缓存取不到,获取应用本地信息
appCache.cacheGoodsNode = uni.getStorageSync('cacheGoodsNode')
}
return appCache.cacheGoodsNode
}
},
// 已经登录的用户记录 // 已经登录的用户记录
loggedInUser: (addUserName = null, removeUserName = null) => { loggedInUser: (addUserName = null, removeUserName = null) => {
let key = "loggedInUserList" let key = "loggedInUserList"

View File

@@ -38,14 +38,15 @@ export function getCart(params) {
* 已上架商品列表 * 已上架商品列表
* @returns * @returns
*/ */
export function getGoodsLists(params) { export function getGoodsLists(params,showLoading=true) {
return request({ return request({
url: `/api/place/activate`, url: `/api/place/activate`,
method: "get", method: "get",
params:{ params:{
shopId: uni.getStorageSync("shopId"), shopId: uni.getStorageSync("shopId"),
...params ...params
} },
showLoading
}); });
} }

View File

@@ -16,10 +16,10 @@ import {
import infoBox from "@/commons/utils/infoBox.js" import infoBox from "@/commons/utils/infoBox.js"
import go from '@/commons/utils/go.js'; import go from '@/commons/utils/go.js';
// 测试服 // 测试服
let baseUrl = 'https://admintestpapi.sxczgkj.cn' // let baseUrl = 'https://admintestpapi.sxczgkj.cn'
//预发布 //预发布
// let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn' let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn'
// 王伟本地测 // 王伟本地测
// let baseUrl = '/ww' // let baseUrl = '/ww'

View File

@@ -1,6 +1,6 @@
{ {
"name" : "银收客", "name" : "银收客",
"appid" : "__UNI__66E7BD0", "appid" : "__UNI__02A31D8",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",
"versionCode" : 100, "versionCode" : 100,

View File

@@ -4,17 +4,7 @@
</view> </view>
</template> </template>
<script> <script setup>
export default {
data() {
return {
}
},
methods: {
}
}
</script> </script>
<style> <style>

View File

@@ -44,58 +44,10 @@
} }
}, },
{ {
"pageId": "PAGES_REGISTER", "pageId": "PAGES_ME",
"path": "pages/login/register", "path": "pages/user/user",
"style": { "style": {
"navigationBarTitleText": "注册(自定义导航)", "navigationBarTitleText": "我的(自定义导航)",
"navigationStyle": "custom"
}
},
{
"pageId": "PAGES_STATIC_AGREEMENT",
"path": "pages/login/serviceAgreement",
"style": {
"navigationBarTitleText": "服务协议"
}
},
{
"pageId": "PAGES_STATIC_POLICY",
"path": "pages/login/privacyPolicy",
"style": {
"navigationBarTitleText": "隐私政策"
}
},
{
"pageId": "PAGES_SCAN_LOGIN",
"path": "pages/index/scan",
"style": {
"navigationBarTitleText": "扫码登录中间页(自定义导航)",
"navigationStyle": "custom"
}
},
{
"pageId": "PAGES_PAY_ORDER",
"path": "pages/order/order",
"style": {
"navigationBarTitleText": "订单(自定义导航)",
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
"pageId": "PAGES_PAY_ORDER_DETAIL",
"path": "pages/order/orderDetail",
"style": {
"navigationBarTitleText": "订单详情(自定义导航)",
"navigationStyle": "custom"
}
},
{
"pageId": "PAGES_REFUND_ORDER",
"path": "pages/order/refund",
"style": {
"navigationBarTitleText": "退款(自定义导航)",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
@@ -126,323 +78,6 @@
"style": { "style": {
"navigationBarTitleText": "选择门店" "navigationBarTitleText": "选择门店"
} }
},
{
"pageId": "PAGES_USER_SETUP",
"path": "pages/userSetUp/userSetUp",
"style": {
"navigationBarTitleText": "设置"
}
},
{
"pageId": "PAGES_RESET_PAYPWD",
"path": "pages/userSetUp/payPassword",
"style": {
"navigationBarTitleText": "支付密码"
}
},
{
"pageId": "PAGES_RESET_PWD",
"path": "pages/userSetUp/accountPwd",
"style": {
"navigationBarTitleText": "账号密码"
}
},
{
"pageId": "PAGES_SYS_CONFIG",
"path": "pages/userSetUp/systemSetUp",
"style": {
"navigationBarTitleText": "系统设置"
}
},
{
"pageId": "PAGES_SAFE_CONFIG",
"path": "pages/userSetUp/safeSetUp",
"style": {
"navigationBarTitleText": "安全设置"
}
},
{
"pageId": "PAGES_ACCOUNTSETUP",
"path": "pages/userSetUp/accountSetUp",
"style": {
"navigationBarTitleText": "账号设置(自定义导航)",
"navigationStyle": "custom"
}
},
{
"pageId": "PAGES_ME",
"path": "pages/user/user",
"style": {
"navigationBarTitleText": "我的(自定义导航)",
"navigationStyle": "custom"
}
},
{
"pageId": "PAGES_ABOUTMCH",
"path": "pages/aboutMch/aboutMch",
"style": {
"navigationBarTitleText": "关于我们(自定义导航)",
"navigationStyle": "custom"
}
},
{
"pageId": "PAGES_QUICK_PAY",
"path": "pages/quickMoney/quickMoney",
"style": {
"navigationBarTitleText": "快捷收银"
}
},
{
"pageId": "PAGES_QR_CASHIER",
"path": "pages/quickMoney/qrCashier",
"style": {
"navigationBarTitleText": "聚合收款码"
}
},
{
"pageId": "PAGES_MCH_INFO",
"path": "pages/mchInfo/mchInfo",
"style": {
"navigationBarTitleText": "商户信息"
}
},
{
"pageId": "PAGES_NOTICE_USER",
"path": "pages/noticeManage/noticeManage",
"style": {
"navigationBarTitleText": "通知人管理(自定义导航)",
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
"pageId": "PAGES_NOTICE_BING_USER",
"path": "pages/noticeManage/bindUser",
"style": {
"navigationBarTitleText": "通知接收人管理",
"navigationBarBackgroundColor": "#fff"
}
},
{
"pageId": "PAGES_STAT",
"path": "pages/statPage/statPage",
"style": {
"navigationBarTitleText": "统计报表(自定义导航)",
"navigationStyle": "custom"
}
},
{
"pageId": "PAGES_NOTICE_LIST",
"path": "pages/noticePage/noticeList",
"style": {
"navigationBarTitleText": "全部公告",
"enablePullDownRefresh": true
}
},
{
"pageId": "PAGES_NOTICE_DETAIL",
"path": "pages/noticePage/noticeDetail",
"style": {
"navigationBarTitleText": "公告详情"
}
},
{
"pageId": "PAGES_APPLYMENT",
"path": "pages/applyment/list",
"style": {
"navigationBarTitleText": "进件管理",
"navigationBarBackgroundColor": "#f7f7f7",
"enablePullDownRefresh": true
}
},
{
"pageId": "PAGES_ADDAPP",
"path": "pages/applyment/addApp",
"style": {
"navigationBarTitleText": "添加应用",
"navigationBarBackgroundColor": "#f7f7f7"
}
},
{
"pageId": "PAGES_APPLYMENT_BUSINESS",
"path": "pages/applyment/business",
"style": {
"navigationBarTitleText": "商户管理",
"navigationBarBackgroundColor": "#f7f7f7",
"enablePullDownRefresh": true
}
},
{
"pageId": "PAGES_APPLYMENT_SELECETDPAY",
"path": "pages/applyment/selectedPay",
"style": {
"navigationBarTitleText": "选择进件渠道",
"navigationBarBackgroundColor": "#f7f7f7"
}
},
{
"pageId": "PAGES_APPLYMENT_H5_DETAIL",
"path": "pages/applyment/h5/applyDetail",
"style": {
"navigationBarTitleText": "进件详情",
"navigationBarBackgroundColor": "#F5F6FC"
}
},
{
"pageId": "PAGES_APPLYMENT_H5_OPTION",
"path": "pages/applyment/h5/applyOption",
"style": {
"navigationBarTitleText": "进件配置/签约开通",
"navigationBarBackgroundColor": "#F5F6FC"
}
},
{
"pageId": "PAGES_FORGET_PASSWORD",
"path": "pages/login/forgetPassword",
"style": {
"navigationBarTitleText": "找回密码"
}
},
{
"pageId": "PAGES_SET_NEW_PASSWORD",
"path": "pages/login/setNewPassword",
"style": {
"navigationBarTitleText": "设置新密码"
}
},
{
"pageId": "PAGES_EDIT_FORM",
"path": "pages/userSetUp/editForm",
"style": {
"navigationBarTitleText": "修改用户姓名",
"enablePullDownRefresh": false
}
},
{
"pageId": "PAGES_AD_H5",
"path": "pages/adH5/adH5",
"style": {
"navigationStyle": "custom"
}
},
{
"pageId": "PAGES_AD_ALIOPERATION",
"path": "pages/aliOperation/index",
"style": {
"navigationBarTitleText": "支付宝代运营授权(自定义)",
"navigationStyle": "custom"
}
},
{
"pageId": "PAGES_MEMBER_CENTER",
"path": "pages/memberCenter/index",
"style": {
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
"pageId": "PAGES_MEMBER",
"path": "pages/memberCenter/member/member",
"style": {
"navigationBarTitleText": "会员管理(自定义导航)",
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
"pageId": "PAGES_MEMBER_EDIT",
"path": "pages/memberCenter/member/edit",
"style": {
"navigationBarTitleText": "会员编辑(自定义导航)",
"navigationStyle": "custom"
}
},
{
"pageId": "PAGES_MEMBER_DETAIL",
"path": "pages/memberCenter/member/detail",
"style": {
"navigationBarTitleText": "会员详情(自定义导航)",
"navigationStyle": "custom"
}
},
{
"pageId": "PAGES_RECHARGE_RULE",
"path": "pages/memberCenter/rechargeRule/index",
"style": {
"navigationBarTitleText": "充值规则管理(自定义导航)",
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
"pageId": "PAGES_RECHARGE_RULE_EDIT",
"path": "pages/memberCenter/rechargeRule/edit",
"style": {
"navigationBarTitleText": "充值规则编辑(自定义导航)",
"navigationStyle": "custom"
}
},
{
"pageId": "PAGES_MEMBER_ACCOUNT_HISTORY",
"path": "pages/memberCenter/accountHistory/index",
"style": {
"navigationBarTitleText": "会员账户流水(自定义导航)",
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
"pageId": "PAGES_MEMBER_ACCOUNT_HISTORY_DETAIL",
"path": "pages/memberCenter/accountHistory/detail",
"style": {
"navigationBarTitleText": "流水详情"
}
},
{
"pageId": "PAGES_MEMBER_RECHARGE_RECORD",
"path": "pages/memberCenter/rechargeRecord/index",
"style": {
"navigationBarTitleText": "会员充值记录(自定义导航)",
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
"pageId": "PAGES_MEMBER_RECHARGE_RECORD_DETAIL",
"path": "pages/memberCenter/rechargeRecord/detail",
"style": {
"navigationBarTitleText": "充值记录详情"
}
},
{
"pageId": "PAGES_MEMBER_RECHARGE_MEMBERMANUAL",
"path": "pages/memberCenter/member/memberManual",
"style": {
"navigationBarTitleText": "会员调账"
}
},
{
"pageId": "PAGES_LIST_SEARCH",
"path": "pages/list/search",
"style": {
"navigationBarTitleText": "搜索"
}
}, {
"path": "pages/release/release",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, {
"pageId": "PAGES_WEBVIEW",
"path": "pages/webview/webview"
}, {
"pageId": "PAGES_INVOICE",
"path": "pages/invoice/invoice"
} }
], ],
"subPackages": [{ "subPackages": [{
@@ -1279,19 +914,18 @@
{ {
"root": "pageSalesSummary", "root": "pageSalesSummary",
"pages": [{ "pages": [{
"pageId": "PAGES_SALES_SUMMARY", "pageId": "PAGES_SALES_SUMMARY",
"path": "index", "path": "index",
"style": { "style": {
"navigationBarTitleText": "销售汇总" "navigationBarTitleText": "销售汇总"
}
}, {
"pageId": "PAGES_PRODUCT_SALES_RANKING",
"path": "productSalesRanking",
"style": {
"navigationBarTitleText": "商品销售排行"
}
} }
] }, {
"pageId": "PAGES_PRODUCT_SALES_RANKING",
"path": "productSalesRanking",
"style": {
"navigationBarTitleText": "商品销售排行"
}
}]
}, },
{ {
"root": "pageLineUp", "root": "pageLineUp",
@@ -1405,10 +1039,8 @@
"style": { "style": {
"navigationBarTitleText": "账单付款记录" "navigationBarTitleText": "账单付款记录"
} }
} }]
]
}, },
{ {
"root": "pagePrinter", "root": "pagePrinter",
"pages": [{ "pages": [{
@@ -1422,7 +1054,7 @@
"pageId": "PAGES_PRINTER_ADD", "pageId": "PAGES_PRINTER_ADD",
"path": "add-printer/add-printer", "path": "add-printer/add-printer",
"style": { "style": {
"navigationBarTitleText" : "添加/编辑云打印机" "navigationBarTitleText": "添加/编辑云打印机"
// "navigationBarTitleText": "" // "navigationBarTitleText": ""
} }
}, },
@@ -1454,10 +1086,9 @@
}, },
{ {
"pageId": "PAGES_GOODS_GROUP_EDIT_GOODS", "pageId": "PAGES_GOODS_GROUP_EDIT_GOODS",
"path" : "edit-group-goods/edit-group-goods", "path": "edit-group-goods/edit-group-goods",
"style" : "style": {
{ "navigationBarTitleText": "管理商品"
"navigationBarTitleText" : "管理商品"
} }
} }
] ]
@@ -1490,14 +1121,6 @@
"selectedIconPath": "static/tabImg/index-select.png", "selectedIconPath": "static/tabImg/index-select.png",
"text": "首页" "text": "首页"
} }
// ,
// {
// "pagePath": "pages/order/order",
// "iconPath": "static/tabImg/order.png",
// "selectedIconPath": "static/tabImg/order-select.png",
// "text": "订单"
// }
,
{ {
"pagePath": "pages/user/user", "pagePath": "pages/user/user",
"iconPath": "static/tabImg/user.png", "iconPath": "static/tabImg/user.png",

View File

@@ -111,21 +111,17 @@
console.log(props.goodsData.isStock); console.log(props.goodsData.isStock);
number.value = newval.suit || 1 number.value = newval.suit || 1
}) })
const isCanBuy=computed(()=>{ const isCanBuy = computed(() => {
if(!goods.value) { if (!goods.value) {
return false return false
} }
console.log(util.isCanBuy({ return util.isCanBuy(
...goods.value, goods.value,
isStock: props.goodsData.isStock props.goodsData
})); )
return util.isCanBuy({
...goods.value,
isStock: props.goodsData.isStock
})
}) })
//全部规格是否都无法使用 //全部规格是否都无法使用
@@ -169,11 +165,11 @@
function close() { function close() {
model.value.close() model.value.close()
} }
const isDisabled=computed(()=>{ const isDisabled = computed(() => {
return isAllDisabled.value || !isCanBuy.value return isAllDisabled.value || !isCanBuy.value
}) })
function reduce() { function reduce() {
if (isDisabled.value) { if (isDisabled.value) {
return return
@@ -194,7 +190,7 @@
number.value = newval number.value = newval
} }
function confirm() { function confirm() {
close() close()

View File

@@ -1,6 +1,8 @@
<template> <template>
<view class="u-relative u-flex item"> <view class="u-relative u-flex item">
<image lazy-load class="img" :src="data.coverImg" mode="aspectFill" :style="computedImgStyle()"></image>
<up-image :src="data.coverImg" mode="aspectFill" :width="img.width" :height="img.height"></up-image>
<!-- <image lazy-load class="img" :src="data.coverImg" mode="aspectFill" :style="computedImgStyle()"></image> -->
<view class="info u-flex u-row-between u-col-top u-flex-col" @tap="emitEvent('add')"> <view class="info u-flex u-row-between u-col-top u-flex-col" @tap="emitEvent('add')">
<view> <view>
<view> <view>
@@ -133,7 +135,7 @@
.btn-hover-class { .btn-hover-class {
opacity: .6; opacity: .6;
} }
image{will-change: transform}
.item { .item {
// width: 250rpx; // width: 250rpx;
// height: 272rpx; // height: 272rpx;

View File

@@ -76,9 +76,9 @@
</view> </view>
<view class="item-container"> <view class="item-container">
<view class="thumb-box" v-for="(goodsItem, goodsIndex) in item.foods" :key="goodsIndex"> <view class="thumb-box" v-for="(goodsItem, goodsIndex) in item.foods" :key="goodsIndex">
<goods-item @chooseGuige="chooseGuige($event,index)" <list-goods-item @chooseGuige="chooseGuige($event,index)"
@add="goodsUpdate($event,index,true)" @reduce="goodsUpdate($event,index,false)" @add="goodsUpdate($event,index,true)" @reduce="goodsUpdate($event,index,false)"
:index="goodsIndex" :data="goodsItem"></goods-item> :index="goodsIndex" :data="goodsItem"></list-goods-item>
</view> </view>
<!-- <template v-if="item.name==='附加费'"> <!-- <template v-if="item.name==='附加费'">
@@ -100,11 +100,11 @@
<view class="u-font-28 color-666 ">搜索</view> <view class="u-font-28 color-666 ">搜索</view>
<view class="u-flex u-m-t-20 u-flex-wrap u-row-between"> <view class="u-flex u-m-t-20 u-flex-wrap u-row-between">
<view class="u-m-b-30" v-for="(goodsItem, goodsIndex) in searchResult" :key="goodsIndex"> <view class="u-m-b-30" v-for="(goodsItem, goodsIndex) in searchResult" :key="goodsIndex">
<goods-item :img="{width:'330rpx',height:'330rpx'}" <list-goods-item :img="{width:'330rpx',height:'330rpx'}"
@chooseGuige="chooseGuige(goodsItem.goodsIndex,goodsItem.index)" @chooseGuige="chooseGuige(goodsItem.goodsIndex,goodsItem.index)"
@add="searchGoodsUpdate(goodsItem,goodsIndex,true)" @add="searchGoodsUpdate(goodsItem,goodsIndex,true)"
@reduce="searchGoodsUpdate(goodsItem,goodsIndex,false)" :index="goodsItem.goodsIndex" @reduce="searchGoodsUpdate(goodsItem,goodsIndex,false)" :index="goodsItem.goodsIndex"
:data="goodsItem"></goods-item> :data="goodsItem"></list-goods-item>
</view> </view>
</view> </view>
@@ -143,7 +143,7 @@
import util from './util.js'; import util from './util.js';
import color from '@/commons/color.js'; import color from '@/commons/color.js';
import guigeModel from './components/guige' import guigeModel from './components/guige'
import goodsItem from './components/goods-item' import listGoodsItem from './components/list-goods-item.vue'
import mySurcharge from './components/surcharge' import mySurcharge from './components/surcharge'
import { import {
onLoad, onLoad,
@@ -158,7 +158,7 @@
reactive, reactive,
ref, ref,
nextTick, nextTick,
watch watch,getCurrentInstance
} from 'vue'; } from 'vue';
import myCar from './components/car' import myCar from './components/car'
import go from '@/commons/utils/go.js'; import go from '@/commons/utils/go.js';
@@ -166,6 +166,7 @@
import { import {
getNowCart getNowCart
} from '@/pagesCreateOrder/util.js' } from '@/pagesCreateOrder/util.js'
import storageManage from '@/commons/utils/storageManage.js'
import { import {
$returnUseType $returnUseType
} from './util.js' } from './util.js'
@@ -173,6 +174,7 @@
tbShopInfo tbShopInfo
} from '@/http/yskApi/user.js' } from '@/http/yskApi/user.js'
import {hasPermission} from '@/commons/utils/hasPermission.js' import {hasPermission} from '@/commons/utils/hasPermission.js'
const instance = getCurrentInstance();
let canXiadan=ref(false) let canXiadan=ref(false)
async function xiadanClick(){ async function xiadanClick(){
canXiadan.value=await hasPermission('允许下单') canXiadan.value=await hasPermission('允许下单')
@@ -196,9 +198,9 @@
menuHeight: 0, // 左边菜单的高度 menuHeight: 0, // 左边菜单的高度
menuItemHeight: 0, // 左边菜单item的高度 menuItemHeight: 0, // 左边菜单item的高度
itemId: '', // 栏目右边scroll-view用于滚动的id itemId: '', // 栏目右边scroll-view用于滚动的id
tabbar: [], tabbar: storageManage.cacheGoods()||[],
menuItemPos: [], menuItemPos: [],
arr: [], arr: storageManage.cacheGoodsNode()||[],//左右联动布局节点信息
scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度 scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
timer: null, // 定时器 timer: null, // 定时器
topZhanwei: 136 + 24, topZhanwei: 136 + 24,
@@ -285,6 +287,8 @@
return v.foods.length return v.foods.length
}) })
data.tabbar = tabbar data.tabbar = tabbar
storageManage.cacheGoods(data.tabbar)
getMenuItemTop()
} }
@@ -301,7 +305,8 @@
page: 0, page: 0,
size: 300 size: 300
}) { }) {
return Api.getGoodsLists(par) const showLoading=data.tabbar.length<=0?true:false
return Api.getGoodsLists(par,showLoading)
} }
//获取购物车数据 //获取购物车数据
async function getCart(par = { async function getCart(par = {
@@ -395,12 +400,14 @@
//获取桌台信息 //获取桌台信息
async function getTableInfo() { async function getTableInfo() {
const res = await $table.get({ if(data.table.tableId){
qrcode: data.table.tableId const res = await $table.get({
}) qrcode: data.table.tableId
console.log(res); })
if (res && res.content[0]) { console.log(res);
// data.table=res.content[0] if (res && res.content[0]) {
// data.table=res.content[0]
}
} }
} }
let $originGoods = [] let $originGoods = []
@@ -433,6 +440,10 @@
$originGoods = goods $originGoods = goods
if (!data.table.tableId) { if (!data.table.tableId) {
//无桌台 //无桌台
const {
masterId
} = await getMasterId()
data.masterId = masterId
setTabBar(category, goods, []) setTabBar(category, goods, [])
return return
} }
@@ -580,7 +591,7 @@
return prve; return prve;
}, {}); }, {});
const canBudyGoods = specList const canBudyGoods = specList
.filter((v) => util.isCanBuy(v)) .filter((v) => util.isCanBuy(v,guigeModelData.chooseGoods.item))
.sort((a, b) => { .sort((a, b) => {
const aNumber = a.specSnap.split(",").reduce((prve, cur) => { const aNumber = a.specSnap.split(",").reduce((prve, cur) => {
return prve + skuMapNumber[cur]; return prve + skuMapNumber[cur];
@@ -669,7 +680,7 @@
prve[i] = matchArr prve[i] = matchArr
.filter((v) => v.specSnap.match(i)) .filter((v) => v.specSnap.match(i))
.every((v) => { .every((v) => {
return !util.isCanBuy(v) return !util.isCanBuy(v,guigeModelData.chooseGoods.item)
}); });
} }
} }
@@ -794,7 +805,8 @@
} }
function canAddGoods() { function canAddGoods() {
return data.table.tableId // return data.table.tableId
return true
} }
function searchGoodsUpdate(goodsItem,goodsIndex, isAdd) { function searchGoodsUpdate(goodsItem,goodsIndex, isAdd) {
@@ -806,11 +818,11 @@
} }
} }
async function goodsUpdate(foodsindex, index, isAdd,searchGoodsIndex) { async function goodsUpdate(foodsindex, index, isAdd,searchGoodsIndex) {
if (!canAddGoods()) { // if (!canAddGoods()) {
return infoBox.showToast('请先选择桌台', 0.5).then(res => { // return infoBox.showToast('请先选择桌台', 0.5).then(res => {
chooseTable() // chooseTable()
}) // })
} // }
const $goods = data.tabbar[index].foods[foodsindex] const $goods = data.tabbar[index].foods[foodsindex]
if ($goods.isDan) { if ($goods.isDan) {
//单规格 //单规格
@@ -961,6 +973,7 @@
rects.forEach((rect) => { rects.forEach((rect) => {
// 这里减去rects[0].top是因为第一项顶部可能不是贴到导航栏(比如有个搜索框的情况) // 这里减去rects[0].top是因为第一项顶部可能不是贴到导航栏(比如有个搜索框的情况)
data.arr.push(rect.top - rects[0].top); data.arr.push(rect.top - rects[0].top);
storageManage.cacheGoodsNode(data.arr)
resolve(); resolve();
}) })
}).exec() }).exec()
@@ -1000,7 +1013,7 @@
return; return;
} }
} }
}, 10) }, 100)
} }
function watchChooseuser() { function watchChooseuser() {

View File

@@ -18,8 +18,15 @@ export function $returnUseType(shop, useType) {
return result return result
} }
//判断商品是否可以下单 //判断商品是否可以下单
export function isCanBuy(goods, isStock) { export function isCanBuy(skuGoods,goods) {
return goods.isGrounding && goods.isPauseSale == 0 && (isStock ? goods.stockNumber > 0 : true); if(goods.typeEnum=='normal'){
//单规格
return goods.isGrounding&&goods.isPauseSale==0&&(goods.isStock?goods.stockNumber>0:true);
}else{
//多规格
return goods.isGrounding&&goods.isPauseSale==0&&skuGoods.isGrounding&&skuGoods.isPauseSale==0&&(goods.isStock?goods.stockNumber>0:true);
}
} }

View File

@@ -7,7 +7,7 @@
H5, 不影响。 H5, 不影响。
###apk下载地址 ###apk下载地址
* <https://mp-3b7dba1a-2dfb-4c7a-a239-2ab2157f829a.cdn.bspapp.com/cloudstorage/__UNI__66E7BD0_20241023141536.apk> * <https://mp-3b7dba1a-2dfb-4c7a-a239-2ab2157f829a.cdn.bspapp.com/cloudstorage/__UNI__66E7BD0_20241023161228.apk >
### 全局文件结构 ### 全局文件结构
* commons->utils>hasPermission.js 全局权限验证文件 * commons->utils>hasPermission.js 全局权限验证文件