Commit 82fb1f5172d2a10cd809335b41163cc5caba9f12
1 parent
53cd7057
赤峰分支
Showing
1 changed file
with
116 additions
and
28 deletions
src/components/home.vue
| 1 | 1 | <template> |
| 2 | 2 | <div class="wrap"> |
| 3 | - <Pay :title="title" :money="money"/> | |
| 4 | - <Loading v-show="_getshowflag"/> | |
| 3 | + <div class="pay-wrap"> | |
| 4 | + <div class="title">订单支付</div> | |
| 5 | + <div class="tipstext">{{ title }}</div> | |
| 6 | + <div class="money">{{ money }}</div> | |
| 7 | + <div class="choosetext">选择支付方式</div> | |
| 8 | + <ul class="pay-way"> | |
| 9 | + <li v-for="(item, index) in payArr" :key="index" :class="{checkedClass : index===currentId}" @click="currentId = index"> | |
| 10 | + <span></span> | |
| 11 | + {{ item }} | |
| 12 | + </li> | |
| 13 | + </ul> | |
| 14 | + <div class="commit-btn" @click="commitsure">确认支付</div> | |
| 15 | + </div> | |
| 16 | + <Loading v-show="showflag"/> | |
| 5 | 17 | </div> |
| 6 | 18 | </template> |
| 7 | 19 | |
| 8 | 20 | <script> |
| 9 | 21 | import Loading from './Loading' |
| 10 | -import InOut from './InOut' | |
| 11 | -import Pay from './Pay' | |
| 12 | -import { mapGetters, mapActions } from 'vuex' | |
| 13 | 22 | |
| 14 | 23 | export default { |
| 15 | - name: 'HelloWorld', | |
| 24 | + name: 'Home', | |
| 16 | 25 | components: { |
| 17 | - Loading, InOut, Pay | |
| 26 | + Loading | |
| 18 | 27 | }, |
| 19 | 28 | data() { |
| 20 | 29 | return { |
| 21 | - payFlag: false, | |
| 22 | - inOutVal: this.$route.query.id, | |
| 23 | - // isShow: '' | |
| 30 | + showflag: true, | |
| 24 | 31 | title: '', |
| 25 | - money: '' | |
| 32 | + money: '', | |
| 33 | + payArr: ['支付宝支付', '微信支付'], | |
| 34 | + currentId: 0 | |
| 26 | 35 | } |
| 27 | 36 | }, |
| 28 | 37 | computed: { |
| 29 | - ...mapGetters([ | |
| 30 | - '_getshowflag', '_getPayFlag' | |
| 31 | - ]) | |
| 38 | + // ...mapGetters([ | |
| 39 | + // '_getshowflag', '_getPayFlag' | |
| 40 | + // ]) | |
| 32 | 41 | }, |
| 33 | 42 | created() { |
| 34 | 43 | this.$http.get('http://39.98.54.240:8090/hmQrCodeInOutPark/noCarQRcodeInOutPark') |
| ... | ... | @@ -39,7 +48,7 @@ export default { |
| 39 | 48 | console.log(error) |
| 40 | 49 | }) |
| 41 | 50 | setTimeout(() => { |
| 42 | - this.handleHide() | |
| 51 | + this.showflag = false | |
| 43 | 52 | |
| 44 | 53 | // $http.post('/user', { |
| 45 | 54 | // firstName: 'Fred', |
| ... | ... | @@ -58,31 +67,110 @@ export default { |
| 58 | 67 | // }) |
| 59 | 68 | // }, |
| 60 | 69 | // this.handlePayFlag() |
| 61 | - console.log(this._getPayFlag) | |
| 62 | - // this.title = '手机: 13911137584' | |
| 63 | - // this.money = '¥100.00' | |
| 70 | + this.title = '手机: 13911137584' | |
| 71 | + this.money = '¥100.00' | |
| 64 | 72 | }, 2000) |
| 65 | 73 | }, |
| 66 | 74 | methods: { |
| 67 | - ...mapActions([ | |
| 68 | - 'handleHide', | |
| 69 | - 'handleShow', | |
| 70 | - 'handlePayFlag' | |
| 71 | - ]), | |
| 72 | - transmit(data) { | |
| 73 | - console.log(data) | |
| 74 | - this.title = data.title | |
| 75 | - this.money = data.money | |
| 75 | + commitsure() { | |
| 76 | + alert(this.currentId) | |
| 76 | 77 | } |
| 77 | 78 | } |
| 78 | 79 | } |
| 79 | 80 | </script> |
| 80 | 81 | |
| 81 | 82 | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| 82 | -<style scoped> | |
| 83 | +<style lang="scss" scoped> | |
| 83 | 84 | .wrap { |
| 84 | 85 | width: 100%; |
| 85 | 86 | height: 100%; |
| 86 | 87 | position: relative; |
| 88 | + .pay-wrap { | |
| 89 | + width: 100%; | |
| 90 | + height: 100%; | |
| 91 | + background-color: #eff4f5; | |
| 92 | + text-align: center; | |
| 93 | + .title { | |
| 94 | + height: 42px; | |
| 95 | + line-height: 42px; | |
| 96 | + background-color: rgba(255, 255, 255, .9); | |
| 97 | + font-size: 17px; | |
| 98 | + color: #4A4A4A; | |
| 99 | + font-weight: 500; | |
| 100 | + } | |
| 101 | + .tipstext { | |
| 102 | + margin: 35px auto 35px; | |
| 103 | + font-size: 18px; | |
| 104 | + font-weight: bold; | |
| 105 | + color: rgba(255, 7, 7, 1); | |
| 106 | + } | |
| 107 | + .money { | |
| 108 | + height: 48px; | |
| 109 | + line-height: 48px; | |
| 110 | + font-size: 48px; | |
| 111 | + font-weight: 400; | |
| 112 | + color: rgba(74, 74, 74, 1); | |
| 113 | + } | |
| 114 | + .choosetext { | |
| 115 | + padding-left: 10px; | |
| 116 | + margin: 60px 0 10px; | |
| 117 | + text-align: left; | |
| 118 | + font-size: 17px; | |
| 119 | + font-weight: 400; | |
| 120 | + color: rgba(74, 74, 74, 1); | |
| 121 | + } | |
| 122 | + .pay-way { | |
| 123 | + padding-left: 10px; | |
| 124 | + padding-right: 18px; | |
| 125 | + background-color: #fff; | |
| 126 | + text-align: left; | |
| 127 | + cursor: pointer; | |
| 128 | + li { | |
| 129 | + height: 43px; | |
| 130 | + line-height: 43px; | |
| 131 | + font-size: 14px; | |
| 132 | + font-weight: 400; | |
| 133 | + color: rgba(74, 74, 74, 1); | |
| 134 | + background-image: url("../assets/unchecked-icon.png"); | |
| 135 | + background-repeat: no-repeat ; | |
| 136 | + background-position: right center ; | |
| 137 | + background-size: 18px 18px; | |
| 138 | + span { | |
| 139 | + width: 24px; | |
| 140 | + height: 24px; | |
| 141 | + display: inline-block; | |
| 142 | + margin-right: 11px; | |
| 143 | + vertical-align: middle; | |
| 144 | + } | |
| 145 | + &:nth-of-type(1) { | |
| 146 | + border-bottom: 1px solid rgba(240, 244, 245, 1); | |
| 147 | + span { | |
| 148 | + background: url("../assets/ali-icon.png") no-repeat; | |
| 149 | + background-size: 100% 100%; | |
| 150 | + } | |
| 151 | + } | |
| 152 | + &:nth-of-type(2) { | |
| 153 | + span { | |
| 154 | + background: url("../assets/wechat-icon.png") no-repeat; | |
| 155 | + background-size: 100% 100%; | |
| 156 | + } | |
| 157 | + } | |
| 158 | + } | |
| 159 | + .checkedClass{ | |
| 160 | + background-image: url("../assets/checked-icon.png"); | |
| 161 | + } | |
| 162 | + } | |
| 163 | + .commit-btn { | |
| 164 | + width: 80%; | |
| 165 | + height: 42px; | |
| 166 | + line-height: 42px; | |
| 167 | + margin: 120px auto 0; | |
| 168 | + border-radius: 21px; | |
| 169 | + background-color: #75CBBE; | |
| 170 | + font-size: 18px; | |
| 171 | + font-weight: 400; | |
| 172 | + color: rgba(255, 255, 255, 1); | |
| 173 | + } | |
| 174 | + } | |
| 87 | 175 | } |
| 88 | 176 | </style> | ... | ... |