|
|
@@ -40,6 +40,7 @@
|
|
|
<view>
|
|
|
<button class="button-com pay-wx" :class="[remainPayTime >0 ? 'green':'default']" :disabled="remainPayTime >0 ? false : true" @click="appWxPayFn">微信支付</button>
|
|
|
</view>
|
|
|
+ <button class="button-com pay-wx" :class="[remainPayTime >0 ? 'ali-btn':'default']" :disabled="remainPayTime >0 ? false : true" @click="appAliPayFn">支付宝支付</button>
|
|
|
<button class="button-com pay-wx" :class="[remainPayTime >0 ? 'green':'default']" :disabled="remainPayTime >0 ? false : true" @click="debtPay" v-if="hasDebtPay === '1'">赊账</button>
|
|
|
</div>
|
|
|
<!-- #endif -->
|
|
|
@@ -57,7 +58,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { purchaseBalancePay, purchaseDebtPay, purchaseWxPay,getDetail } from "@/api/purchase";
|
|
|
+import { purchaseBalancePay, purchaseDebtPay, purchaseWxPay,purchaseAliPay,getDetail } from "@/api/purchase";
|
|
|
import keyboardModule from './components/keyboard'
|
|
|
import { mapGetters } from "vuex";
|
|
|
import wexinPay from "@/utils/pay/wxPay";
|
|
|
@@ -141,6 +142,27 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ appAliPayFn(){
|
|
|
+ let that = this
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ uni.showLoading()
|
|
|
+ let id = this.option.id ? this.option.id : 0
|
|
|
+ purchaseAliPay({ orderSn: this.orderSn }).then(res => {
|
|
|
+ uni.hideLoading()
|
|
|
+ if(res.code == 1){
|
|
|
+ if(res.data.payUrl){
|
|
|
+ that.orderSn = res.data.orderSn
|
|
|
+ plus.runtime.openWeb(res.data.payUrl)
|
|
|
+ setTimeout(function(){
|
|
|
+ that.$util.confirmModal({content:'已付款成功?',okText:'是的',cancelText:'没有'},() => {
|
|
|
+ that.pageTo({ url: '/pagesPurchase/particulars?id=' + id, type: 2 })
|
|
|
+ })
|
|
|
+ },3000)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
appWxPayFn(){
|
|
|
let that = this
|
|
|
// #ifdef APP-PLUS
|
|
|
@@ -318,6 +340,11 @@ export default {
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.app-content {
|
|
|
+ .ali-btn{
|
|
|
+ background-color:#3385ff;
|
|
|
+ border:1upx solid #3385ff;
|
|
|
+ color:white;
|
|
|
+ }
|
|
|
.callback-wrap {
|
|
|
padding-top: 50upx;
|
|
|
background-repeat: no-repeat;
|