PaymentType.qml 2.14 KB
Newer Older
1 2 3
import QtQuick 2.6
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.0
4 5
import App 1.0

6 7 8 9


Item
{
10
    id: root
11 12
    width: 300
    height: 300
13 14 15 16
    signal cardPayment()
    signal cashPayment()

    property bool paymentEnabled: true
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

    Rectangle
    {
        anchors.fill: parent
        color: "#0e1531"
        radius: 40
        opacity: 0.6
    }

    ButtonGroup { id: radioGroup }

    GridLayout {
        anchors.horizontalCenter: parent.horizontalCenter
        y: 20

        rows: 2
        columns: 3

        PaymentCard
        {
            checked: true
            imageName: "Assets/Payment/amex.png"
            ButtonGroup.group: radioGroup
40 41
            enabled: root.paymentEnabled;
            onClicked: root.cardPayment()
42 43 44 45 46
        }

        PaymentCard {
            imageName: "Assets/Payment/discover.png"
            ButtonGroup.group: radioGroup
47 48
            enabled: root.paymentEnabled;
            onClicked: root.cardPayment()
49 50 51 52 53
        }

        PaymentCard {
            imageName: "Assets/Payment/jcb.png"
            ButtonGroup.group: radioGroup
54 55
            enabled: root.paymentEnabled;
            onClicked: root.cardPayment()
56 57 58 59 60
        }

        PaymentCard {
            imageName: "Assets/Payment/mastercard.png"
            ButtonGroup.group: radioGroup
61 62
            enabled: root.paymentEnabled;
            onClicked: root.cardPayment()
63 64 65 66 67
        }

        PaymentCard {
            imageName: "Assets/Payment/money.png"
            ButtonGroup.group: radioGroup
68 69
            enabled: root.paymentEnabled;
            onClicked: root.cashPayment()
70 71 72 73 74
        }

        PaymentCard {
            imageName: "Assets/Payment/visa.png"
            ButtonGroup.group: radioGroup
75 76
            enabled: root.paymentEnabled;
            onClicked: root.cardPayment()
77 78 79 80 81 82
        }
    }
    Text
    {
        color: "#ffffff"
        text: qsTr("Total cost")
83
        font.pixelSize: Variables.fontTotalCost
84 85 86 87 88 89 90 91
        x: 30
        y: 150
    }

    Text
    {
        color: "#ffffff"
        text: Number(Variables.currentPrice / 100).toLocaleString(locale, 'f', 2) + " \u20ac"
92
        font.pixelSize: Variables.fontPaymentCost
93 94 95 96
        x: 30
        y: 190
    }
}