Compare commits
5 Commits
410b0501af
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
| 23ccde5250 | |||
| 24d7345056 | |||
| 38e26fed3e | |||
| f3bd7637b5 | |||
| 85354f6296 |
1
App.vue
1
App.vue
@@ -9,6 +9,7 @@ import appConfig from '@/config/appConfig.js';
|
||||
import { provide, onMounted } from 'vue';
|
||||
import WebsocketUtil from '@/commons/utils/websocket.js';
|
||||
|
||||
console.log('appConfig.wss',appConfig.wss);
|
||||
const websocketUtil = new WebsocketUtil(appConfig.wss, 5000); // 创建 WebSocket 工具类实例
|
||||
provide('websocketUtil', websocketUtil); // 提供给所有子组件
|
||||
onMounted(() => {});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//当前环境 test,prod
|
||||
export const ENV = 'prod'
|
||||
export const ENV = 'test'
|
||||
export const ENV_BASE_URL = {
|
||||
java: {
|
||||
prod: 'https://cashier.sxczgkj.com/',
|
||||
@@ -25,8 +25,8 @@ export function returnBaseUrl(param) {
|
||||
env,
|
||||
apiType
|
||||
} = param
|
||||
if(!env){
|
||||
env=ENV
|
||||
if (!env) {
|
||||
env = ENV
|
||||
}
|
||||
console.log('env', env);
|
||||
console.log('apiType', apiType);
|
||||
@@ -70,6 +70,23 @@ export function returnBaseUrl(param) {
|
||||
|
||||
}
|
||||
|
||||
function returnWss(env) {
|
||||
// #ifdef H5
|
||||
if (env === 'test') {
|
||||
return 'http://192.168.1.42:2348'
|
||||
} else {
|
||||
return 'https://czgeatws.sxczgkj.com/wss'
|
||||
}
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
if (env === 'test') {
|
||||
return 'ws://192.168.1.42:2348'
|
||||
} else {
|
||||
return 'wss://czgeatws.sxczgkj.com/wss'
|
||||
}
|
||||
// #endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
const appConfig = {
|
||||
@@ -85,7 +102,7 @@ const appConfig = {
|
||||
env: {},
|
||||
|
||||
// wss: "wss://sockets.sxczgkj.com/wss", //测试环境
|
||||
wss: "wss://czgeatws.sxczgkj.com/wss", //正式环境
|
||||
wss: returnWss(ENV), //正式环境
|
||||
// 环境变量常量
|
||||
ENV_ENUM: {
|
||||
DEVELOPMENT: 'development', // 本地调试地址
|
||||
|
||||
2
env/config.js
vendored
2
env/config.js
vendored
@@ -30,7 +30,7 @@ const processEnv = process.env.NODE_ENV
|
||||
// 改变env环境
|
||||
function changeEnv(envMode){
|
||||
appConfig.env = allEnvMap[envMode || processEnv]
|
||||
appConfig.wss = allEnvMap[envMode || processEnv].JEEPAY_BASE_URL_WSS
|
||||
// appConfig.wss = allEnvMap[envMode || processEnv].JEEPAY_BASE_URL_WSS
|
||||
}
|
||||
|
||||
export default { changeEnv: changeEnv }
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
placeholder-class="color-999 u-font-28"
|
||||
type="digit"
|
||||
@input="checkNumberCommission($event,index)"
|
||||
v-model="item.levelOneCommission"
|
||||
v-model="item.commission"
|
||||
/>
|
||||
<view class="unit">%</view>
|
||||
</view>
|
||||
@@ -144,7 +144,7 @@ function toggle(index) {
|
||||
const allCommission=()=>{
|
||||
let sum=0
|
||||
for(let item of form.levelConfigList){
|
||||
sum+=parseFloat(item.levelOneCommission)
|
||||
sum+=parseFloat(item.commission)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
@@ -162,7 +162,7 @@ function checkNumberCommission(e,index){
|
||||
icon:'none'
|
||||
})
|
||||
timer= setTimeout(()=>{
|
||||
form.levelConfigList[index].levelOneCommission=''
|
||||
form.levelConfigList[index].commission=''
|
||||
},30)
|
||||
|
||||
return false
|
||||
@@ -172,7 +172,7 @@ function checkNumberCommission(e,index){
|
||||
const arr=value.split('.')
|
||||
if(arr[1].length>2){
|
||||
timer= setTimeout(()=>{
|
||||
form.levelConfigList[index].levelOneCommission=arr[0]+'.'+arr[1].substring(0,2)
|
||||
form.levelConfigList[index].commission=arr[0]+'.'+arr[1].substring(0,2)
|
||||
},30)
|
||||
}
|
||||
}
|
||||
@@ -200,7 +200,7 @@ function remove(index){
|
||||
function addLevelConfig(){
|
||||
form.levelConfigList.push({
|
||||
name:'',
|
||||
levelOneCommission:'',
|
||||
commission:'',
|
||||
inviteCount:'',
|
||||
costAmount:''
|
||||
})
|
||||
@@ -217,7 +217,7 @@ function addLevelConfig(){
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(!item.levelOneCommission){
|
||||
if(!item.commission){
|
||||
uni.showToast({
|
||||
title:'请输入分成比例',
|
||||
icon:'none'
|
||||
@@ -279,7 +279,7 @@ onLoad(()=>{
|
||||
const levelConfigList=[...distributionStore.config.levelConfigList||[]]
|
||||
form.levelConfigList=levelConfigList.length?levelConfigList:[
|
||||
{ name:'',
|
||||
levelOneCommission:'',
|
||||
commission:'',
|
||||
inviteCount:0,
|
||||
costAmount:0}
|
||||
]
|
||||
|
||||
@@ -274,6 +274,7 @@ onLoad((opt) => {
|
||||
);
|
||||
optiopns.index = index;
|
||||
const item = superVipStore.vipLevelList.find((item) => item.id == opt.id);
|
||||
item.cycleRewardCouponList=item.cycleRewardCouponList||[]
|
||||
Object.assign(form, item);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</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">
|
||||
<view class="u-p-l-32" style="max-width: 522rpx; word-wrap: break-word; color: red" v-if="data.printStatus">
|
||||
<template v-if="JSON.parse(data.printStatus).length > 0">
|
||||
打印失败({{
|
||||
JSON.parse(data.printStatus)
|
||||
|
||||
Reference in New Issue
Block a user