Commit 8d5fddc2 authored by jiangjiantao's avatar jiangjiantao

合并代码

parents eb04515b c4f9beb1
.tea
.tea/*
.DS_Store
/.tea
.tea/layout.json
......
{"layout":{"left":{"currentId":"scm_container","size":371},"right":{"currentId":""},"bottom":{"currentId":"devtools","size":215}},"storageVersion":"1.5.5"}
\ No newline at end of file
......@@ -8,19 +8,38 @@ App({
TEST_URL: "https://cashier.test.miyahub.net/",
RELEASE_URL: "https://cashier.miyahub.com/",
BASE_URL: null,
appId:"1542075029346",
appId: "1542075029346",
//小程序容器版本
containerVersionCode: null,
localAccountInfo:null,
sn:""
},
onLaunch(options) {
// 第一次打开
// options.query == {number:1}
console.info('App onLaunch');
//初始化baseUrl
this.globalData.BASE_URL = this.globalData.TEST_URL;
//获取容器版本信息
my.ix.getVersion({
success: (r) => {
console.log("getVersion success==>" + JSON.stringify(r));
getApp().globalData.containerVersionCode = r.versionCode;
}
});
//添加后屏小程序
my.ix.addExtensionApp({
appId: "****************",
// 填入后屏小程序的 AppID
type: "screen",
success: (res) => {
console.log("addExtensionApp success:", res)
},
fail: (res) => {
console.log("addExtensionApp fail:", res)
},
})
},
onShow(options) {
// 从后台被 scheme 重新打开
......
{
"pages": [
"pages/login/login",
"pages/scan/scan",
"pages/paysuccess/paysuccess",
"pages/balance/balance",
"pages/scan/scan",
"pages/home/home",
"pages/login/login",
"pages/index/index"
],
"window": {
......
page {
display: flex;
flex-direction: column;
/* background-color: #ff7f30; */
width: 100%;
height: 100%;
}
.dialog {
width: 750rpx;
height: 76%;
color: white;
font-size: 66rpx;
background-color: white;
/* border: 2px solid red; */
}
.scanRemindIcon {
width: 659rpx;
height: 604rpx;
margin-top: 192rpx;
margin-left: 34rpx;
}
.scanRemindText {
font-size: 38rpx;
color: #D9000000;
}
.close{
width: 28rpx;
height: 28rpx;
}
\ No newline at end of file
<popup show="{{showBottom}}" position="bottom" onClose="onPopupClose" >
<view class="dialog">
<!-- 图片 -->
<view class="scanRemindIcon">
<image mode="scaleToFill" src="/images/icon_scan_remind"/>
</view>
<!-- x -->
<view class="close">
<image mode="scaleToFill" src="/images/icon_dialog_cancel"/>
</view>
<view class="scanRemindText">请扫描会员码支付</view>
<view class="scanRemindError">该付款码无法识别,请重新扫描</view>
<view class=""> </view>
</view>
</popup>
Component({
mixins: [],// minxin 方便复用代码
data: {
},// 组件内部数据
props: {
remindText: "",
warningText:"",
loadingText: "",
resultSuccessText:"",
resultFailureText:"",
resultText:"",
statusIdle: 1,//初始状态
statusProgress:2,//loading状态
statusSuccessResult:3,//成功状态
statusFailedResult:4,//失败状态
currentStatus:1 //当前状态
},// 可给外部传入的属性添加默认值
didMount() {
},// 生命周期函数,加载成功
didUpdate() {},//刷新
didUnmount() {},//生命周期
methods: {// 自定义方法
},
});
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
page{
display: flex;
flex-direction: column;
background-color: #ffffff;
width: 100%;
height: 100%;
align-items: center;
}
.goodsRemind{
color: #ffffff;
position:relative;
margin-top: 91rpx;
}
.payPrice{
color: #ffffff;
font-size: 94rpx;
margin-top: 8rpx;
}
.priceDetailRow{
display: flex;
flex-direction: row;
justify-content:space-between;
box-sizing: border-box;/*为元素设定的任何内边距和边框都发生在已设定的宽度和高度内部*/
width:750rpx;
color: rgba(255, 255, 255, 0.65);
padding-left: 47rpx;
padding-right: 47rpx;
}
.payWayContainer{
display: flex;
flex-direction: column;
width: 234rpx;
padding: 40rpx;
box-sizing: border-box;
}
.payWayText{
font-size:34rpx;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(0,0,0,0.85);
line-height:34rpx;
margin-top: 28rpx;
text-align: center;
}
\ No newline at end of file
<view class="page">
<image mode="aspectFit" src="/images/bg_balance.png" style="width:750rpx;height:504rpx"/>
<view style="position:absolute;width:100%;height:auto;left:0rpx;top:0rpx;display:flex;flex-direction:column;align-items:center">
<view class="goodsRemind">共计{{goodsNum}}件商品,应付总额</view>
<view class="payPrice">¥{{payPrice}}</view>
<view class="priceDetailRow" style="margin-top:58rpx;">
<view>订单总金额</view>
<view>¥{{totalPrice}}</view>
</view>
<view class="priceDetailRow" style="margin-top:30rpx;">
<view>商家活动优惠</view>
<view>¥{{couponPrice}}</view>
</view>
</view>
<view style="font-size:38rpx;width:300rpx;color:rgba(0,0,0,0.85);font-weight:500;font-family:PingFangSC-Medium,PingFang SC;opacity:0.85;margin:75rpx auto;">请选择支付方式</view>
<view style="width:750rpx;margin-top:78rpx;justify-content:space-between;display:flex;flex-direction:row;box-sizing:border-box;padding-left:96rpx;padding-right:96rpx;">
<view class="payWayContainer">
<image mode="aspectFit" src="/images/icon_facepay.png" style="width:134rpx;height:131rpx;margin:10rpx 10rpx 10rpx 10rpx;"/>
<view class="payWayText">刷脸支付</view>
</view>
<view class="payWayContainer">
<image mode="aspectFit" src="/images/icon_qrpay.png" style="width:134rpx;height:131rpx;margin:10rpx 10rpx 10rpx 10rpx;"/>
<view class="payWayText">扫码支付</view>
</view>
</view>
<!-- 测试popup是否好用,能用,适合用。 -->
<popup show="{{qrPayShow}}" position="bottom">
<!-- 图片 -->
<view class="scanRemindIcon">
<image mode="scaleToFill" src="/images/icon_scan_remind"/>
</view>
<!-- x -->
<view class="close">
<image mode="scaleToFill" src="/images/icon_dialog_cancel"/>
</view>
<view class="scanRemindText">请扫描会员码支付</view>
<view class="scanRemindError">该付款码无法识别,请重新扫描</view>
<view class=""> </view>
</popup>
</view>
\ No newline at end of file
Page({
data: {
goodsNum:"--",
payPrice:"--",
totalPrice:"--",
couponPrice:"--",
qrPayShow:false,
},
onLoad() {},
facePay(){
},
qrPay(){
//todo 这里增加唤起弹窗的逻辑
this.setData({
qrPayShow:true,
});
}
});
{}
\ No newline at end of file
page{
display: flex;
flex-direction: column;
background: url("/images/bg_home.png")no-repeat fixed top;
background-size: 100% 100%;
width: 100%;
height: 100%;
align-items: center;
}
.container{
position: relative;
width: 750rpx;
height: 430rpx;
margin: 0 auto;
margin-top: 38rpx;
}
\ No newline at end of file
<view class="page" onTap="homeTap">
</view>
\ No newline at end of file
Page({
data: {
},
onLoad() {
},
onReady(){
if (my.canIUse('hideBackHome')) {
my.hideBackHome();
}
},
scanDialog(ref){
// if(ref.getAttribute("id") == "drawbackDialog"){
// }else if(ref.getAttribute("id") == ""){
// }
},
homeTap(){
//FIXME 这里是跳转到新的界面
my.navigateTo({
url: "/pages/balance/balance"
});
}
});
{
"usingComponents":{
"scandialog":"/custom_widgets/scandialog/scandialog"
}
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ page {
width: 100%;
height: 100%;
background: url(/images/bg_login.png) no-repeat fixed top;
background-size: 100% 100%;
}
.welcomeText {
......
......@@ -137,7 +137,7 @@ Page({
getApp().globalData.localAccountInfo = res.data;
//todo 临时跳转到扫商品页面 跳转广告页
my.reLaunch({
url: "/pages/scan/scan"
url: "/pages/home/home"
});
my.showToast({
type: 'success',
......
......@@ -78,13 +78,12 @@ page {
/* border: 2px solid red; */
}
.voucher{
display: flex;
.voucher {
display: absolute;
position: fixed;
flex-direction: column;
width: 662rpx;
align-content: center;
height: 100%;
margin-bottom: 0rpx;
border: 2px solid red;
margin-top: 43rpx;
/* border: 2px solid red; */
}
\ No newline at end of file
......@@ -12,15 +12,15 @@
<view style="position:absolute;left:0rpx;top:0rpx;width:624rpx;height:430rpx;">
<view class="orderPrice">
<text style="float:left;">订单总额</text>
<text style="font-weight:bold;float:right;">¥--.--</text>
<text style="font-weight:bold;float:right;">¥{{orderPriceYuan}}</text>
</view>
<view class="discount">
<text style="float:left;">商家优惠</text>
<text style="font-weight:bold;float:right;">-¥--.--</text>
<text style="font-weight:bold;float:right;">-¥{{couponPriceYuan}}</text>
</view>
<view class="payPrice">
<text style="float:left;" decode=true>共计 {{}} 件&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;实付:</text>
<text style="font-weight:bold;float:right;color:#F72911;">-¥--.--</text>
<text style="float:left;" decode=true>共计 {{totalCount}} 件&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;实付:</text>
<text style="font-weight:bold;float:right;color:#F72911;">-¥{{payPriceYuan}}</text>
</view>
</view>
</view>
......@@ -28,11 +28,30 @@
<i-spin></i-spin>
<view style="position:absolute;width:100%;height:100%;left:0rpx;top:0rpx;color:#000000;font-weight:bold;">
<view style="display: absolute;margin:0 auto;align-content: center;align-items: center;text-align:center;line-height:186rpx;">
<text>{{}}</text>
<text>{{printerStatus}}</text>
</view>
</view>
</view>
<view class="voucher">
<view class="voucher" hidden="{{!isShowCoupon}}">
<image mode="aspectFit" style="width:100%;height:229rpx;" src="/images/bg_coupon.png"/>
<view style="display: absolute;position: absolute;left:0rpx;top:0rpx;width:209rpx;height:229rpx;">
<view style="position: absolute;color:#ffffff;left:10rpx;top:103rpx;font-size:43rpx;">
<text >¥</text>
</view>
<view style="position: absolute;color:#ffffff;text-align:center;left:68rpx;font-weight:bold;top:80rpx;font-size:66rpx;">
<text>{{couponPriceYuan}}</text>
</view>
<view style="position: absolute;color:#ffffff;text-align:center;left:23rpx;top:145rpx;font-size:23rpx;">
<text>{{couponHint}}</text>
</view>
</view>
<view style="position: absolute;left:209rpx;top:0rpx;width:453rpx;height:229rpx;">
<view style="position: absolute;color:#ffffff;left:32rpx;top:32rpx;font-size:34rpx;width:352rpx;">
<text >{{couponName}}</text>
</view>
<view style="position: absolute;color:#ffffff;left:32rpx;bottom:32rpx;font-size:34rpx;width:352rpx;">
<text >{{couponDateDuration}}</text>
</view>
</view>
</view>
</view>
\ No newline at end of file
Page({
data: {},
onLoad() {},
data: {
orderPriceYuan: "--.--",
couponPriceYuan: "--.--",
payPriceYuan: "--.--",
totalCount: "0",
printerStatus: "小票打印中",
couponPriceYuan: "--.--",
couponHint: "xxxxxx",
couponName: "xxxxxxxx",
couponDateDuration: "xxxx.xx.xx-xxxx.xx.xx",
isShowCoupon: true
},
onLoad(query) {
console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
},
print() {
//发起打印
var printer = require("../../utils/printer.js");
var printCallbackTemp = this.printCallback.bind(this);
var cmds = [
printer.setAlign(printer.ALIGN_CENTER),
printer.printText("storeName"),
printer.printDivide("-"),
printer.setAlign(printer.ALIGN_LEFT),
printer.printText("门店号:"),
printer.printText("收银员账号:"),
printer.printText("订单号:"),
printer.printNowDate(),
printer.printDivide("-"),
printer.printText("活动商品"),
printer.printText("活动名称 " + " 编码 " + " 数量"),
];
for (var i = 0; i < 10; i++) {
//循环取出商品数据
// cmds.push();
}
cmds.push(printer.printDivide("-"));
cmds.push(printer.printText("应收金额:"));
cmds.push(printer.printText("支付方式实付:"));
for (var i = 0; i < 4; i++) {
cmds.push(printer.feedPaper());
}
printer.print({
isCheckStatus: getApp().globalData.containerVersionCode > 20,
cmds: cmds,
callback: printCallbackTemp
});
},
printCallback(res) {
//通知后屏打印结果
my.ix.sendBuddyMessage({
target: "****************",
// 填入目标小程序的 AppID
data: res,
success: (res) => {
console.info(`sendBuddyMessage success: ${JSON.stringify(res)}`);
},
fail: (res) => {
console.info(`sendBuddyMessage failed: ${JSON.stringify(res)}`);
}
});
},
onShow() {
//开启后屏监听
my.ix.onBuddyMessage({
success: (res) => {
console.info(`onBuddyMessage success: ${JSON.stringify(res)}`);
if ("") {
//重新打印
} else {
//未知指令
}
}
});
},
onHide() {
//关闭后屏监听
my.ix.offBuddyMessage();
}
});
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