|
@@ -11,12 +11,16 @@
|
|
<group>
|
|
<group>
|
|
<a href="javascript:void(0)" class="pay-option checked" data-value="wx_pub"> <i class="icon-weixin"></i> 微信支付 </a>
|
|
<a href="javascript:void(0)" class="pay-option checked" data-value="wx_pub"> <i class="icon-weixin"></i> 微信支付 </a>
|
|
</group>
|
|
</group>
|
|
- <div class="btn">确认支付</div>
|
|
|
|
|
|
+ <div class="btn" @click="btnPay">确认支付</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import {CheckIcon, Group} from 'vux'
|
|
import {CheckIcon, Group} from 'vux'
|
|
|
|
+ import axios from 'axios'
|
|
|
|
+ import config from '../config/config'
|
|
|
|
+ // import api from '../config/api'
|
|
|
|
+ import qs from 'qs'
|
|
export default {
|
|
export default {
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
@@ -29,9 +33,33 @@
|
|
Group
|
|
Group
|
|
},
|
|
},
|
|
created () {
|
|
created () {
|
|
- console.log(this.$route.query.payRecharge)
|
|
|
|
- this.orderType = this.$route.query.payRecharge.products
|
|
|
|
- this.payType = this.$route.query.payRecharge.final_price
|
|
|
|
|
|
+ console.log(this.$route.query.payRecharge !== {})
|
|
|
|
+ if (this.$route.query.payRecharge !== {}) {
|
|
|
|
+ this.orderType = this.$route.query.payRecharge.products
|
|
|
|
+ this.payType = this.$route.query.payRecharge.final_price
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ btnPay () {
|
|
|
|
+ if (this.$route.query.payRecharge !== {}) {
|
|
|
|
+ let payRecharge = {
|
|
|
|
+ user_id: config.userId,
|
|
|
|
+ order_id: this.$route.query.payRecharge.order_id,
|
|
|
|
+ pay_channel: 'wx_pub'
|
|
|
|
+ }
|
|
|
|
+ axios.post('o2o/recharge/payRecharge', qs.stringify(payRecharge)).then(res => {
|
|
|
|
+ console.log(res.data.data.credential.wx_pub)
|
|
|
|
+// window.location.href = 'http://common.yiguanjia.me/webapp/o2o/module/pay/index.html?appId=' +
|
|
|
|
+// option.appId + '&nonceStr=' + option.nonceStr +
|
|
|
|
+// '&package=' + prepay + '&signType=' +
|
|
|
|
+// option.signType + '&timeStamp=' +
|
|
|
|
+// option.timeStamp + '&paySign=' +
|
|
|
|
+// option.paySign + '&amount=' + wxPay.amount +
|
|
|
|
+// '&created=' + wxPay.created + '&body=' +
|
|
|
|
+// wxPay.body + '&bookingTime=' + bookingTime
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|