5 Commits

9 changed files with 152 additions and 81 deletions

View File

@@ -1,3 +1,76 @@
//当前环境 test,prod
export const ENV = 'prod'
export const ENV_BASE_URL = {
java: {
prod: 'https://cashier.sxczgkj.com/',
test: 'http://192.168.1.42/',
h5ProdProxy: '/prodJavaApi/',
h5TestProxy: '/testJavaApi/',
},
php: {
prod: 'https://cashier.sxczgkj.com/',
test: 'http://192.168.1.42:8787/',
h5ProdProxy: '/prodPhpApi/api/',
h5TestProxy: '/testPhpApi/api/',
}
}
/**
* @param {String} env 环境,测试或者正式
* @param {String} apiType 语言java或者php
*/
export function returnBaseUrl(param) {
let {
env,
apiType
} = param
if(!env){
env=ENV
}
console.log('env', env);
console.log('apiType', apiType);
if (env === 'prod') {
//正式环境
// #ifdef H5
if (apiType === 'php') {
return ENV_BASE_URL.php.h5ProdProxy
}
if (apiType === 'java') {
return ENV_BASE_URL.java.h5ProdProxy
}
// #endif
if (apiType === 'php') {
return ENV_BASE_URL.php.prod
}
if (apiType === 'java') {
return ENV_BASE_URL.java.prod
}
} else {
//测试环境
// #ifdef H5
if (apiType === 'php') {
return ENV_BASE_URL.php.h5TestProxy
}
if (apiType === 'java') {
return ENV_BASE_URL.java.h5TestProxy
}
// #endif
if (apiType === 'php') {
return ENV_BASE_URL.php.test
}
if (apiType === 'java') {
return ENV_BASE_URL.java.test
}
}
}
const appConfig = {
// 项目名称
@@ -20,10 +93,16 @@ const appConfig = {
PRODUCTION: 'production' // 生产环境
},
returnBaseUrl: returnBaseUrl,
storeEnvEnumKey: 'currentEnvEnum', // 本地存储的envkey的值
encryptKey: '1234567890123456' // http数据加解密的key
encryptKey: '1234567890123456', // http数据加解密的key
baseUrl: "",
}
export default appConfig;

View File

@@ -16,22 +16,9 @@ import go from "@/commons/utils/go.js";
import { reject } from "lodash";
// 设置node环境
// envConfig.changeEnv(storageManage.env('production')) //正式
envConfig.changeEnv(storageManage.env("development")); //测试
// 测试服
// #ifdef H5
let baseUrl = "/javaapi/";
// #endif
// #ifndef H5
// let baseUrl = 'https://tapi.cashier.sxczgkj.cn/'
//预发布
// let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn'
//正式
// let baseUrl = 'https://cashier.sxczgkj.com/'
let baseUrl = appConfig.env.JEEPAY_BASE_URL;
// #endif
// envConfig.changeEnv(storageManage.env("development")); //测试
let baseUrl = appConfig.returnBaseUrl({apiType:'java'});
const loadingShowTime = 200;
function getHeader() {

View File

@@ -2,7 +2,7 @@
// const baseURL : string = 'https://newblockwlx.sxczgkj.cn/index.php/api/'
let baseURL: string = "http://192.168.1.42:8787/api/";
// #ifdef H5
baseURL = "/phpapi/api/";
baseURL = "/prodPhpApi/api/";
// #endif
import go from "@/commons/utils/go.js";

View File

@@ -14,23 +14,7 @@ import storageManage from '@/commons/utils/storageManage.js'
import infoBox from "@/commons/utils/infoBox.js"
import go from '@/commons/utils/go.js';
import { reject } from 'lodash';
// 设置node环境
// envConfig.changeEnv(storageManage.env('production'))
// 测试服
// #ifdef H5
let baseUrl = '/api/'
// #endif
// #ifndef H5
// let baseUrl = 'https://tapi.cashier.sxczgkj.cn/'
//预发布
// let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn'
//正式
// let baseUrl = 'https://cashier.sxczgkj.com/'
let baseUrl = appConfig.env.JEEPAY_BASE_URL
// #endif
let baseUrl = appConfig.returnBaseUrl({apiType:'php'});
const loadingShowTime = 200
function getHeader(){

View File

@@ -23,11 +23,11 @@
<view class="u-flex-1 u-p-l-30 u-text-left">
<view class="u-flex">
<view class="u-line-1 u-font-36 font-bold" style="width: 80%;">{{shopInfo.shopName}}</view>
<view class="u-font-28 color-fff change-shop u-flex u-row-center" @click="changeShop">
<!-- <view class="u-font-28 color-fff change-shop u-flex u-row-center" @click="changeShop">
<image src="/static/change.png" class="u-m-t-2" style="width: 20rpx;height: 20rpx;"
mode=""></image>
<text class="u-m-l-6">切换店铺</text>
</view>
</view> -->
</view>
<view class="u-m-t-16">
<view style="color: rgba(255,255,255,0.83);" v-if="shopStaff">

View File

@@ -239,6 +239,7 @@
discount_sale_amount: form.price, //数量
pack_number: 0, //数量
is_gift: 0,
remark:form.note,
is_temporary: 1, //是否是临时菜
}
websocketUtil.send(JSON.stringify(params))
@@ -247,6 +248,7 @@
name: form.name,
lowPrice: form.price,
number: form.num,
remark:form.note,
is_temporary: 1, //是否是临时菜
})
clearInterval(timer)

View File

@@ -436,6 +436,7 @@
websocketUtil.offMessage();
websocketUtil.onMessage(async (res) => {
let msg = JSON.parse(res);
console.log('收到消息',msg)
let cartItem;
let cartArr = [];
// console.log("onMessage===",msg)
@@ -1349,13 +1350,13 @@
if (fileRes) {
uni.setStorageSync('stickData',{
table:data.table,
orderInfo:data.orderInfo
orderInfo:data.orderInfo,
limitTimeDiscount:data.limitTimeDiscount
})
go.to("PAGES_CREATE_ORDER_STICK", {
tableCode: data.table.tableCode,
number:fileRes,
isCreateOrderToDetail:isCreateOrderToDetail.value,
limitTimeDiscount:data.limitTimeDiscount
});

View File

@@ -37,10 +37,22 @@
</view>
<view class="u-flex u-row-between u-m-t-24 u-col-top">
<view class="no-wrap">商家备注</view>
<view class="u-p-l-32 " style="max-width: 522rpx; word-wrap: break-word;">
<view class="u-p-l-32" style="max-width: 522rpx; word-wrap: break-word">
{{ data.remark }}
</view>
</view>
<view class="u-flex u-row-between u-m-t-24 u-col-top">
<view class="no-wrap">打印状态</view>
<view class="u-p-l-32" style="max-width: 522rpx; word-wrap: break-word; color: red">
<template v-if="JSON.parse(data.printStatus).length > 0">
打印失败{{
JSON.parse(data.printStatus)
.map((item) => item.name)
.join('、')
}}
</template>
</view>
</view>
</view>
</template>
@@ -59,12 +71,10 @@
seatFee: {
type: Object,
default: () => {
totalNumber: 0
totalNumber: 0;
}
}
})
});
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>

View File

@@ -7,17 +7,25 @@ export default defineConfig({
],
server: {
proxy: {
'/javaapi': {
// target: 'https://cashier.sxczgkj.com', // 目标服务器地址
'/prodJavaApi': {
target: 'https://cashier.sxczgkj.com', // 目标服务器地址
changeOrigin: true, // 是否更改请求源
rewrite: path => path.replace(/^\/prodJavaApi/, '')
},
'/testJavaApi': {
target: 'http://192.168.1.42/', // 目标服务器地址
changeOrigin: true, // 是否更改请求源
rewrite: path => path.replace(/^\/javaapi/, '')
rewrite: path => path.replace(/^\/testJavaApi/, '')
},
'/phpapi': {
// target: 'https://cashier.sxczgkj.com', // 目标服务器地址
'/prodPhpApi': {
target: 'https://cashier.sxczgkj.com', // 目标服务器地址
changeOrigin: true, // 是否更改请求源
rewrite: path => path.replace(/^\/prodPhpApi/, '')
},
'/testPhpApi': {
target: 'http://192.168.1.42:8787/', // 目标服务器地址
changeOrigin: true, // 是否更改请求源
rewrite: path => path.replace(/^\/phpapi/, '')
rewrite: path => path.replace(/^\/testPhpApi/, '')
}
}
}