合并代码

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

View File

@ -126,6 +126,48 @@ const model = {
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) => {
let key = "loggedInUserList"

View File

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

View File

@ -16,10 +16,10 @@ import {
import infoBox from "@/commons/utils/infoBox.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'

View File

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

View File

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

View File

@ -44,58 +44,10 @@
}
},
{
"pageId": "PAGES_REGISTER",
"path": "pages/login/register",
"pageId": "PAGES_ME",
"path": "pages/user/user",
"style": {
"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": "退款(自定义导航)",
"navigationBarTitleText": "我的(自定义导航)",
"navigationStyle": "custom"
}
},
@ -126,323 +78,6 @@
"style": {
"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": [{
@ -1279,19 +914,18 @@
{
"root": "pageSalesSummary",
"pages": [{
"pageId": "PAGES_SALES_SUMMARY",
"path": "index",
"style": {
"navigationBarTitleText": "销售汇总"
}
}, {
"pageId": "PAGES_PRODUCT_SALES_RANKING",
"path": "productSalesRanking",
"style": {
"navigationBarTitleText": "商品销售排行"
}
"pageId": "PAGES_SALES_SUMMARY",
"path": "index",
"style": {
"navigationBarTitleText": "销售汇总"
}
]
}, {
"pageId": "PAGES_PRODUCT_SALES_RANKING",
"path": "productSalesRanking",
"style": {
"navigationBarTitleText": "商品销售排行"
}
}]
},
{
"root": "pageLineUp",
@ -1405,10 +1039,8 @@
"style": {
"navigationBarTitleText": "账单付款记录"
}
}
]
}]
},
{
"root": "pagePrinter",
"pages": [{
@ -1422,7 +1054,7 @@
"pageId": "PAGES_PRINTER_ADD",
"path": "add-printer/add-printer",
"style": {
"navigationBarTitleText" : "添加/编辑云打印机"
"navigationBarTitleText": "添加/编辑云打印机"
// "navigationBarTitleText": ""
}
},
@ -1454,10 +1086,9 @@
},
{
"pageId": "PAGES_GOODS_GROUP_EDIT_GOODS",
"path" : "edit-group-goods/edit-group-goods",
"style" :
{
"navigationBarTitleText" : "管理商品"
"path": "edit-group-goods/edit-group-goods",
"style": {
"navigationBarTitleText": "管理商品"
}
}
]
@ -1490,14 +1121,6 @@
"selectedIconPath": "static/tabImg/index-select.png",
"text": "首页"
}
// ,
// {
// "pagePath": "pages/order/order",
// "iconPath": "static/tabImg/order.png",
// "selectedIconPath": "static/tabImg/order-select.png",
// "text": "订单"
// }
,
{
"pagePath": "pages/user/user",
"iconPath": "static/tabImg/user.png",

View File

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

View File

@ -1,6 +1,8 @@
<template>
<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>
<view>
@ -133,7 +135,7 @@
.btn-hover-class {
opacity: .6;
}
image{will-change: transform}
.item {
// width: 250rpx;
// height: 272rpx;

View File

@ -76,9 +76,9 @@
</view>
<view class="item-container">
<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)"
:index="goodsIndex" :data="goodsItem"></goods-item>
:index="goodsIndex" :data="goodsItem"></list-goods-item>
</view>
<!-- <template v-if="item.name==='附加费'">
@ -100,11 +100,11 @@
<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-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)"
@add="searchGoodsUpdate(goodsItem,goodsIndex,true)"
@reduce="searchGoodsUpdate(goodsItem,goodsIndex,false)" :index="goodsItem.goodsIndex"
:data="goodsItem"></goods-item>
:data="goodsItem"></list-goods-item>
</view>
</view>
@ -143,7 +143,7 @@
import util from './util.js';
import color from '@/commons/color.js';
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 {
onLoad,
@ -158,7 +158,7 @@
reactive,
ref,
nextTick,
watch
watch,getCurrentInstance
} from 'vue';
import myCar from './components/car'
import go from '@/commons/utils/go.js';
@ -166,6 +166,7 @@
import {
getNowCart
} from '@/pagesCreateOrder/util.js'
import storageManage from '@/commons/utils/storageManage.js'
import {
$returnUseType
} from './util.js'
@ -173,6 +174,7 @@
tbShopInfo
} from '@/http/yskApi/user.js'
import {hasPermission} from '@/commons/utils/hasPermission.js'
const instance = getCurrentInstance();
let canXiadan=ref(false)
async function xiadanClick(){
canXiadan.value=await hasPermission('允许下单')
@ -196,9 +198,9 @@
menuHeight: 0, //
menuItemHeight: 0, // item
itemId: '', // scroll-viewid
tabbar: [],
tabbar: storageManage.cacheGoods()||[],
menuItemPos: [],
arr: [],
arr: storageManage.cacheGoodsNode()||[],//
scrollRightTop: 0, // scroll-view
timer: null, //
topZhanwei: 136 + 24,
@ -285,6 +287,8 @@
return v.foods.length
})
data.tabbar = tabbar
storageManage.cacheGoods(data.tabbar)
getMenuItemTop()
}
@ -301,7 +305,8 @@
page: 0,
size: 300
}) {
return Api.getGoodsLists(par)
const showLoading=data.tabbar.length<=0?true:false
return Api.getGoodsLists(par,showLoading)
}
//
async function getCart(par = {
@ -395,12 +400,14 @@
//
async function getTableInfo() {
const res = await $table.get({
qrcode: data.table.tableId
})
console.log(res);
if (res && res.content[0]) {
// data.table=res.content[0]
if(data.table.tableId){
const res = await $table.get({
qrcode: data.table.tableId
})
console.log(res);
if (res && res.content[0]) {
// data.table=res.content[0]
}
}
}
let $originGoods = []
@ -433,6 +440,10 @@
$originGoods = goods
if (!data.table.tableId) {
//
const {
masterId
} = await getMasterId()
data.masterId = masterId
setTabBar(category, goods, [])
return
}
@ -580,7 +591,7 @@
return prve;
}, {});
const canBudyGoods = specList
.filter((v) => util.isCanBuy(v))
.filter((v) => util.isCanBuy(v,guigeModelData.chooseGoods.item))
.sort((a, b) => {
const aNumber = a.specSnap.split(",").reduce((prve, cur) => {
return prve + skuMapNumber[cur];
@ -669,7 +680,7 @@
prve[i] = matchArr
.filter((v) => v.specSnap.match(i))
.every((v) => {
return !util.isCanBuy(v)
return !util.isCanBuy(v,guigeModelData.chooseGoods.item)
});
}
}
@ -794,7 +805,8 @@
}
function canAddGoods() {
return data.table.tableId
// return data.table.tableId
return true
}
function searchGoodsUpdate(goodsItem,goodsIndex, isAdd) {
@ -806,11 +818,11 @@
}
}
async function goodsUpdate(foodsindex, index, isAdd,searchGoodsIndex) {
if (!canAddGoods()) {
return infoBox.showToast('请先选择桌台', 0.5).then(res => {
chooseTable()
})
}
// if (!canAddGoods()) {
// return infoBox.showToast('', 0.5).then(res => {
// chooseTable()
// })
// }
const $goods = data.tabbar[index].foods[foodsindex]
if ($goods.isDan) {
//
@ -961,6 +973,7 @@
rects.forEach((rect) => {
// rects[0].top()
data.arr.push(rect.top - rects[0].top);
storageManage.cacheGoodsNode(data.arr)
resolve();
})
}).exec()
@ -1000,7 +1013,7 @@
return;
}
}
}, 10)
}, 100)
}
function watchChooseuser() {

View File

@ -18,8 +18,15 @@ export function $returnUseType(shop, useType) {
return result
}
//判断商品是否可以下单
export function isCanBuy(goods, isStock) {
return goods.isGrounding && goods.isPauseSale == 0 && (isStock ? goods.stockNumber > 0 : true);
export function isCanBuy(skuGoods,goods) {
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, 不影响。
###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 全局权限验证文件