Commit 69110abc authored by gaodapeng's avatar gaodapeng

新增了系统信息和应用设置

parent fc4e6667
App({
globalData: {
version: "1.0.0.20200226",
TEST_URL: "https://cashier.test.miyahub.net/",
RELEASE_URL: "https://cashier.miyahub.com/",
appId: "2021001107617164",
frontScreenAppId:"2021001107603212",
frontScreenAppId: "2021001107603212",
},
onLaunch(options) {
......
......@@ -31,9 +31,6 @@ export const ACTION_ON_PAY_FAILED = "ACTION_ON_PAY_FAILED";
//跳转首页
export const ACTION_GO_HOME = "ACTION_GO_HOME";
//获取账户信息
export const ACTION_GET_ACCOUNT = "ACTION_GET_ACCOUNT";
//直接收款
export const ACTION_DIRECT_PAYMENT = "ACTION_DIRECT_PAYMENT";
......
......@@ -1161,4 +1161,100 @@
.posterSelected image{
border-radius: 5rpx;
border: 0rpx solid white;
/* 关于系统 */
.about-system-top {
position: relative;
width: 750rpx;
height: 60rpx;
display: flex;
flex-direction: row;
align-items: center;
box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16);
}
.about-system-back-icon {
width: 9rpx;
height: 18rpx;
}
.about-system-back {
width: 95rpx;
height: 60rpx;
justify-content: center;
align-items: center;
display: flex;
flex-direction: row
}
.about-system-back-text {
font-size: 19rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(51, 51, 51, 1);
line-height: 22rpx;
margin-left: 5rpx
}
.about-system-title {
font-size: 21px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 21px;
position: absolute;
width: 100%;
text-align: center;
}
.about-system-body {
width: 750rpx;
height: 363rpx;
position: relative;
display: flex;
flex-direction: column;
}
.about-system-item {
margin-left: 282rpx;
width: auto;
margin-top: 23rpx;
display: flex;
flex-direction: row;
}
.about-system-item-title {
font-size: 21rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(91, 105, 129, 1);
line-height: 21rpx;
}
.about-system-item-desc {
font-size: 21rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(91, 105, 129, 1);
line-height: 21rpx;
}
/* 应用设置 */
.app-setting-item {
margin-left: 38rpx;
width: auto;
margin-top: 44rpx;
display: flex;
flex-direction: row;
align-items: center;
}
.app-setting-print-text {
font-size: 23rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(91, 105, 129, 1);
line-height: 21rpx;
margin-right: 6rpx;
}
\ No newline at end of file
......@@ -386,9 +386,7 @@
</view>
</view>
</view>
<!-- 键盘 -->
<land-keybord scene="{{scene}}" onKeyBordFinished="onKeyBordFinished" onKeyBordClose="onKeyBordClose">
</land-keybord>
<!-- 等待前屏登录 -->
<view class="login-waiting-page" a:if="{{!isFrontScreenLoginOK}}">
<image class="login-waiting-left" mode="aspectFill" src="/images/login_wait_left.png"/>
......@@ -398,7 +396,7 @@
</view>
<!-- 操作结果页 -->
<view hidden="{{!pageShow['operateResult']}}">
<view hidden="{{!pageShow['operateresult']}}">
<view class="operateTopView"></view>
<view class="operateBodyView">
<block a:if="{{operateSuccess}}">
......@@ -426,6 +424,62 @@
</block>
</view>
</view>
<!-- 关于系统 -->
<view hidden="{{!pageShow['aboutsystem']}}" style="background:#ffffff">
<view class="about-system-top">
<view class="about-system-back" catchTap="goHome">
<image class="about-system-back-icon" mode="aspectFit" src="/images/icon_back.png"/>
<text class="about-system-back-text">返回</text>
</view>
<view class="about-system-title">关于系统</view>
</view>
<view class="about-system-body">
<view class="about-system-item" style="margin-top:60rpx;">
<view class="about-system-item-title">门店:</view>
<view class="about-system-item-desc">{{storeName}}</view>
</view>
<view class="about-system-item">
<view class="about-system-item-title">门店号:</view>
<view class="about-system-item-desc">{{storeId}}</view>
</view>
<view class="about-system-item">
<view class="about-system-item-title">SN码:</view>
<view class="about-system-item-desc">{{serialNo}}</view>
</view>
<view class="about-system-item">
<view class="about-system-item-title">登录账号:</view>
<view class="about-system-item-desc">{{userName}}</view>
</view>
<view class="about-system-item">
<view class="about-system-item-title">容器版本:</view>
<view class="about-system-item-desc">{{containerVersion}}</view>
</view>
<view class="about-system-item">
<view class="about-system-item-title">版本号:</view>
<view class="about-system-item-desc">{{version}}</view>
</view>
</view>
</view>
<!-- 应用设置 -->
<view hidden="{{!pageShow['appsetting']}}" style="background:#ffffff">
<view class="about-system-top">
<view class="about-system-back" catchTap="goHome">
<image class="about-system-back-icon" mode="aspectFit" src="/images/icon_back.png"/>
<text class="about-system-back-text">返回</text>
</view>
<view class="about-system-title">应用设置</view>
</view>
<view class="about-system-body">
<view class="app-setting-item">
<view class="app-setting-print-text">打印小票:</view>
<switch color="rgba(24,144,255,1)" checked="{{printEnabled}}" onChange="onPrintEnabledSwitch"/>
</view>
</view>
</view>
<!-- 以下是控件部分 -->
<!-- 键盘 -->
<land-keybord scene="{{scene}}" onKeyBordFinished="onKeyBordFinished" onKeyBordClose="onKeyBordClose">
</land-keybord>
<!-- 重新检查弹窗 -->
<view class="recheckPage" hidden="{{!recheckShow}}">
<view class="recheckDialog">
......
......@@ -19,14 +19,25 @@ Page({
"landscan": false,
"waitoperate": false,
"payresult": false,
"operateResult": false,
"operateresult": false,
"printlastorder": false,
"poster": false
"poster": false,
"aboutsystem": false,
"appsetting": false,
},
// 前屏是否完成登录
isFrontScreenLoginOK: false,
flowType: "", //流程类型:用于区分易混淆的流程,以及共同界面使用时用该标识位作为区分
/**账号信息 */
storeName: "--",
storeId: "--",
userName: "--",
serialNo: "--",
containerVersion: "--",
version: "--",
printEnabled: true,
/**支付结果页相关参数 */
payFailedReason: "xxxxxxxxxxx",
isPaySuccess: true,
......@@ -122,6 +133,30 @@ Page({
},
onReady() {
// 页面加载完成
//获取基础信息
let context = this;
//小程序版本号
this.setData({
version: getApp().globalData.version
})
my.getStorage({
key: 'printEnabled',
success: function (res) {
if (res == null || res.enabled == null) {
res = { enabled: true };
}
context.setData({
printEnabled: res.enabled
})
},
fail: function (res) {
console.log("打印标识位获取失败");
}
});
},
onShow() {
// 页面显示
......@@ -196,10 +231,6 @@ Page({
});
context.goPage('payresult');
} else if (res.action == ACTION_GET_ACCOUNT) {
context.setData({
storeName: res.data.storeName
});
} else if (res.action == ACTION_DIRECT_PAYMENT) {
//直接收款
if (res.data != null) {
......@@ -214,7 +245,18 @@ Page({
}
} else if (res.action == ACTION_LOGIN_OK) {
//前屏登录完成
context.setData({ isFrontScreenLoginOK: true, storeName: res.data })
var loginOptions = res.data;
var sn = loginOptions.sn;
var account = loginOptions.account;
var version = loginOptions.containerVersion;
context.setData({
isFrontScreenLoginOK: true,
storeName: account.storeName,
storeId: account.storeId,
userName: account.userName,
serialNo: sn,
containerVersion: version,
})
} else if (res.action == ACTION_REFUND_SUCCESS) {
//跳转到成功页面
context.setData({
......@@ -340,22 +382,6 @@ Page({
};
},
getAccountInfo() {
my.ix.sendBuddyMessage({
target: getApp().globalData.frontScreenAppId,
data: {
action: ACTION_GET_ACCOUNT,
data: null
},
success: (res) => {
console.log("发送收银事件到前屏小程序 成功 ===》" + JSON.stringify(res));
},
fail: (res) => {
console.log("发送收银事件到前屏小程序 失败 ===》 " + JSON.stringify(res));
},
});
},
/**首页相关 */
/**立即收款 */
onHomeCashierImmediatelyClicked() {
......@@ -406,6 +432,9 @@ Page({
* 打印上一单
*/
onHomePrintLastOrderClicked() {
if (this.data.printEnabled != true) {
return;
}
//发送指令至前屏
//通知前屏重新打印
my.ix.sendBuddyMessage({
......@@ -447,25 +476,28 @@ Page({
/**关于系统(实际上是关于应用) */
onHomeAboutAppClicked() {
this.goPage("aboutsystem");
},
/**
* 系统设置
*/
onHomeSysSettingClicked() {
},
/**
* 应用设置
*/
onHomeAppSettingClicked() {
this.goPage("appsetting");
},
/**payresult页面逻辑方法 */
onReprint() {
if (this.data.printEnabled != true) {
return;
}
//通知前屏重新打印
my.ix.sendBuddyMessage({
// 填入目标小程序的 AppID
......@@ -521,7 +553,7 @@ Page({
var commonRequest = {
action: ACTION_GO_SCAN,
data: null
data: { printEnabled: this.data.printEnabled }
};
var context = this;
my.ix.sendBuddyMessage({
......@@ -1105,6 +1137,23 @@ Page({
console.log("event==>" + JSON.stringify(event));
//回首页
this.goPage('home');
}
},
//打印标识位
onPrintEnabledSwitch(e) {
this.setData({
printEnabled: e.detail.value
})
console.log("checked changed,printEnabled:" + e.detail.value)
my.setStorage({
key: 'printEnabled',
data: { enabled: e.detail.value },
success: function () {
console.log("本地数据设置完毕,printEnabled:" + e.detail.value)
}
});
},
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment