This commit is contained in:
parent
815b6e0a25
commit
e00feb82ec
|
|
@ -2,16 +2,16 @@
|
||||||
ENV = production
|
ENV = production
|
||||||
|
|
||||||
# 正式ws
|
# 正式ws
|
||||||
VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client'
|
# VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client'
|
||||||
|
|
||||||
#测试ws
|
#测试ws
|
||||||
# VITE_API_WSS = 'wss://wxcashiertest.sxczgkj.cn/client'
|
VITE_API_WSS = 'wss://wxcashiertest.sxczgkj.cn/client'
|
||||||
|
|
||||||
# 测试 php
|
# 测试 php
|
||||||
VITE_API_PHP_URL = 'http://192.168.2.33:1666/index.php/api'
|
VITE_API_PHP_URL = 'http://192.168.2.33:1666/index.php/api'
|
||||||
|
|
||||||
# 测试
|
# 测试
|
||||||
# VITE_API_URL = 'https://cashier-client.sxczgkj.cn/cashier-client'
|
VITE_API_URL = 'https://cashier-client.sxczgkj.cn/cashier-client'
|
||||||
|
|
||||||
# 线上环境接口地址
|
# 线上环境接口地址
|
||||||
VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client/'
|
# VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client/'
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "vite-electron",
|
"name": "vite-electron",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.3.53",
|
"version": "1.3.54",
|
||||||
"main": "dist-electron/main.js",
|
"main": "dist-electron/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "chcp 65001 && vite",
|
"dev": "chcp 65001 && vite",
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="number_wrap">
|
<div class="number_wrap">
|
||||||
<div class="menus">
|
<div class="menus">
|
||||||
<div
|
<div class="item" :class="{ active: payActive == index }" v-for="(item, index) in payList" :key="item.id"
|
||||||
class="item"
|
@click="payTypeChange(index, item)">
|
||||||
:class="{ active: payActive == index }"
|
|
||||||
v-for="(item, index) in payList"
|
|
||||||
:key="item.id"
|
|
||||||
@click="payTypeChange(index, item)"
|
|
||||||
>
|
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<el-image :src="item.icon" class="img"></el-image>
|
<el-image :src="item.icon" class="img"></el-image>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -46,12 +41,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="keybord_wrap">
|
<div class="keybord_wrap">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<div
|
<div class="item" v-for="item in 9" :key="item" @click="amountInput(`${item}`)">
|
||||||
class="item"
|
|
||||||
v-for="item in 9"
|
|
||||||
:key="item"
|
|
||||||
@click="amountInput(`${item}`)"
|
|
||||||
>
|
|
||||||
{{ item }}
|
{{ item }}
|
||||||
</div>
|
</div>
|
||||||
<div class="item" @click="amountInput('.')">.</div>
|
<div class="item" @click="amountInput('.')">.</div>
|
||||||
|
|
@ -69,22 +59,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<scanModal
|
<scanModal ref="scanModalRef" fast :amount="money" :selecttype="props.type" :orderId="props.userInfo.id"
|
||||||
ref="scanModalRef"
|
@success="scanCodeSuccess" />
|
||||||
fast
|
<takeFoodCode ref="takeFoodCodeRef" title="支付密码" :type="2" input-type="password" placeholder="请输入支付密码"
|
||||||
:amount="money"
|
@success="passwordSuccess" />
|
||||||
:selecttype="props.type"
|
|
||||||
:orderId="props.userInfo.id"
|
|
||||||
@success="scanCodeSuccess"
|
|
||||||
/>
|
|
||||||
<takeFoodCode
|
|
||||||
ref="takeFoodCodeRef"
|
|
||||||
title="支付密码"
|
|
||||||
:type="2"
|
|
||||||
input-type="password"
|
|
||||||
placeholder="请输入支付密码"
|
|
||||||
@success="passwordSuccess"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
@ -157,7 +135,7 @@ async function passwordSuccess(e) {
|
||||||
shopId: store.userInfo.shopId,
|
shopId: store.userInfo.shopId,
|
||||||
memberId: props.userInfo.id,
|
memberId: props.userInfo.id,
|
||||||
amount: money.value,
|
amount: money.value,
|
||||||
pwd: md5(e),
|
// pwd: md5(e),
|
||||||
});
|
});
|
||||||
payLoading.value = false;
|
payLoading.value = false;
|
||||||
ElMessage.success("支付成功");
|
ElMessage.success("支付成功");
|
||||||
|
|
@ -197,7 +175,8 @@ async function confirmOrder() {
|
||||||
emit("paySuccess");
|
emit("paySuccess");
|
||||||
} else {
|
} else {
|
||||||
// 会员充值
|
// 会员充值
|
||||||
takeFoodCodeRef.value.show();
|
// takeFoodCodeRef.value.show();
|
||||||
|
passwordSuccess()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -387,9 +366,7 @@ onMounted(() => {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr 1fr;
|
grid-template-columns: 1fr 1fr 1fr;
|
||||||
grid-template-rows: var(--item-height) var(--item-height) var(--item-height) var(
|
grid-template-rows: var(--item-height) var(--item-height) var(--item-height) var(--item-height);
|
||||||
--item-height
|
|
||||||
);
|
|
||||||
gap: var(--el-font-size-base);
|
gap: var(--el-font-size-base);
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import _ from "lodash";
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { useUser } from "@/store/user.js";
|
import { useUser } from "@/store/user.js";
|
||||||
import { usePrint } from "@/store/print.js";
|
import { usePrint } from "@/store/print.js";
|
||||||
|
|
@ -31,10 +32,19 @@ export const useSocket = defineStore({
|
||||||
// 关闭ws
|
// 关闭ws
|
||||||
close() {
|
close() {
|
||||||
console.log("关闭ws");
|
console.log("关闭ws");
|
||||||
this.ws.close();
|
this.ws.close(1000);
|
||||||
this.ws = null;
|
// this.ws = null;
|
||||||
this.clearHeartBeat();
|
this.clearHeartBeat();
|
||||||
},
|
},
|
||||||
|
wsReconnect: _.throttle(
|
||||||
|
function () {
|
||||||
|
if (this.ws.readyState == ReconnectingWebSocket.OPEN) return;
|
||||||
|
this.ws.reconnect();
|
||||||
|
console.log("11111");
|
||||||
|
},
|
||||||
|
2000,
|
||||||
|
{ leading: true, trailing: false }
|
||||||
|
),
|
||||||
// 初始化
|
// 初始化
|
||||||
init(wsUrl = import.meta.env.VITE_API_WSS) {
|
init(wsUrl = import.meta.env.VITE_API_WSS) {
|
||||||
this.createUUID();
|
this.createUUID();
|
||||||
|
|
@ -45,7 +55,11 @@ export const useSocket = defineStore({
|
||||||
printStore.init();
|
printStore.init();
|
||||||
|
|
||||||
if (this.ws == null) {
|
if (this.ws == null) {
|
||||||
|
console.log("创建新的ws连接");
|
||||||
this.ws = new ReconnectingWebSocket(wsUrl);
|
this.ws = new ReconnectingWebSocket(wsUrl);
|
||||||
|
} else {
|
||||||
|
console.log("重新连接ws");
|
||||||
|
this.wsReconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.ws.addEventListener("open", (event) => {
|
this.ws.addEventListener("open", (event) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue