Skip to content

Commit

Permalink
add pay V1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
fancymax committed Dec 1, 2016
1 parent 3ce2041 commit 967035b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 26 deletions.
4 changes: 2 additions & 2 deletions 12306ForMac/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.2</string>
<string>1.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>10</string>
<string>11</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
6 changes: 3 additions & 3 deletions 12306ForMac/OrderViewControllers/PayWindowController.xib
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="910" height="680"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1057"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1080"/>
<view key="contentView" wantsLayer="YES" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="910" height="680"/>
<autoresizingMask key="autoresizingMask"/>
Expand All @@ -33,7 +33,7 @@
<rect key="frame" x="20" y="17" width="168" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="仅支持支付宝这种付款方式!" id="yAO-EJ-CkM">
<font key="font" size="13" name=".PingFangSC-Regular"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
Expand Down Expand Up @@ -69,6 +69,7 @@
</button>
</subviews>
<constraints>
<constraint firstItem="9mL-0q-rg8" firstAttribute="centerY" secondItem="6ej-fa-RAh" secondAttribute="centerY" id="07e-5Q-SKm"/>
<constraint firstAttribute="trailing" secondItem="eqi-HC-GFK" secondAttribute="trailing" constant="20" id="1ht-5O-bfd"/>
<constraint firstItem="6ej-fa-RAh" firstAttribute="leading" secondItem="9mL-0q-rg8" secondAttribute="trailing" constant="20" id="2Rh-cy-Avj"/>
<constraint firstItem="Wmr-Wp-yp9" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" id="GAH-2P-w9L"/>
Expand All @@ -81,7 +82,6 @@
<constraint firstAttribute="bottom" secondItem="6ej-fa-RAh" secondAttribute="bottom" constant="15" id="baB-SH-1Mj"/>
<constraint firstItem="9mL-0q-rg8" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="22" id="cfs-uH-loo"/>
<constraint firstAttribute="trailing" secondItem="Wmr-Wp-yp9" secondAttribute="trailing" id="d1v-e3-Af3"/>
<constraint firstAttribute="bottom" secondItem="9mL-0q-rg8" secondAttribute="bottom" constant="17" id="qKS-4l-KwY"/>
</constraints>
</view>
<connections>
Expand Down
9 changes: 5 additions & 4 deletions 12306ForMac/Sheets/SubmitWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ class SubmitWindowController: NSWindowController{
return "SubmitWindowController"
}

@IBAction func clickPay(_ sender: NSButton) {
NSWorkspace.shared().open(URL(string: "https://kyfw.12306.cn/otn/login/init")!)
}

@IBAction func clickCheckOrder(_ sender: NSButton) {
self.switchViewFrom(orderInfoView, to: preOrderView)
}
Expand Down Expand Up @@ -175,6 +171,11 @@ class SubmitWindowController: NSWindowController{
dismissWithModalResponse(NSModalResponseCancel)
}

@IBAction func clickRateInAppstore(_ button:NSButton){
NSWorkspace.shared().open(URL(string: "macappstore://itunes.apple.com/us/app/ding-piao-zhu-shou/id1163682213?l=zh&ls=1&mt=12")!)
dismissWithModalResponse(NSModalResponseCancel)
}

func dismissWithModalResponse(_ response:NSModalResponse)
{
window!.sheetParent!.endSheet(window!,returnCode: response)
Expand Down
55 changes: 38 additions & 17 deletions 12306ForMac/Sheets/SubmitWindowController.xib
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="390" height="370"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1057"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1080"/>
<view key="contentView" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="390" height="370"/>
<autoresizingMask key="autoresizingMask"/>
Expand All @@ -40,7 +40,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="myB-rD-1e5">
<rect key="frame" x="133" y="84" width="134" height="17"/>
<rect key="frame" x="133" y="61" width="134" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Label" id="5Oa-qb-hRe">
<font key="font" metaFont="system"/>
Expand All @@ -49,32 +49,21 @@
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="eXq-pb-kjT">
<rect key="frame" x="102" y="14" width="82" height="32"/>
<rect key="frame" x="189" y="11" width="82" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="稍后付款" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="A0D-4d-sCi">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="clickCancel:" target="-2" id="WTb-VF-s08"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="y6G-Ou-4py">
<rect key="frame" x="189" y="14" width="82" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="立刻付款" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="RrL-4R-XMZ">
<buttonCell key="cell" type="push" title="给予鼓励" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="A0D-4d-sCi">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
DQ
</string>
</buttonCell>
<connections>
<action selector="clickPay:" target="-2" id="QCh-TE-xj5"/>
<action selector="clickRateInAppstore:" target="-2" id="fEF-VO-Z05"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="tT3-bH-J5C">
<rect key="frame" x="25" y="85" width="43" height="17"/>
<rect key="frame" x="25" y="62" width="43" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="订单号" id="tJu-aH-KNS">
<font key="font" metaFont="system"/>
Expand All @@ -91,6 +80,15 @@ DQ
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wSv-NO-Zpp">
<rect key="frame" x="107" y="113" width="65" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="订单查询" id="8ML-n2-8X4">
<font key="font" metaFont="system"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LG1-yb-srF">
<rect key="frame" x="25" y="141" width="242" height="77"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
Expand All @@ -100,6 +98,29 @@ DQ
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8Vb-8r-26J">
<rect key="frame" x="25" y="91" width="242" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="您可以选择在 页面付款, 也可以其他方式付款。" id="gDu-Rw-7pk">
<font key="font" size="13" name=".PingFangSC-Regular"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Tj8-O6-LYt">
<rect key="frame" x="101" y="11" width="82" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="返回" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="HJ6-wN-flv">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
CA
</string>
</buttonCell>
<connections>
<action selector="clickCancel:" target="-2" id="5qd-zR-NIg"/>
</connections>
</button>
</subviews>
<point key="canvasLocation" x="791.5" y="-59"/>
</customView>
Expand Down

0 comments on commit 967035b

Please sign in to comment.