|
|
@@ -23,9 +23,11 @@
|
|
|
<block v-if="orderTime>0">
|
|
|
<button v-if="getPayType == 1" class="button-com green pay-wx" @click="wxPayFn(1)" >微信支付</button>
|
|
|
<button v-else class="button-com green pay-wx" @click="wxPayFn(0)" >微信支付</button>
|
|
|
+ <button class="button-com green pay-wx ali-btn" @click="aliPay()">支付宝支付</button>
|
|
|
</block>
|
|
|
<block v-else>
|
|
|
<button class="button-com disable pay-wx">微信支付</button>
|
|
|
+ <button class="button-com disable pay-wx">支付宝支付</button>
|
|
|
</block>
|
|
|
</div>
|
|
|
</block>
|
|
|
@@ -34,7 +36,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { purchaseClearWxPay } from "@/api/purchase/index";
|
|
|
+import { purchaseClearWxPay,purchaseClearAliPay } from "@/api/purchase";
|
|
|
import wexinPay from "@/utils/pay/wxPay";
|
|
|
import { mapGetters } from "vuex";
|
|
|
import { postWxCode } from '@/api/mini'
|
|
|
@@ -51,7 +53,8 @@ export default {
|
|
|
orderSn: '',
|
|
|
actPrice: '',
|
|
|
getPayType:1,
|
|
|
- hasRequestApi:false
|
|
|
+ hasRequestApi:false,
|
|
|
+ needCheck:0
|
|
|
};
|
|
|
},
|
|
|
onLoad (options) {
|
|
|
@@ -64,7 +67,14 @@ export default {
|
|
|
computed: {
|
|
|
...mapGetters(["getLoginInfo", 'getDictionariesInfo']),
|
|
|
},
|
|
|
- mounted () {
|
|
|
+ onShow(){
|
|
|
+ let that = this
|
|
|
+ if(that.needCheck == 1){
|
|
|
+ that.needCheck = 0
|
|
|
+ that.$util.confirmModal({content:'已付款成功?',okText:'是的',cancelText:'没有'},() => {
|
|
|
+ that.pageTo({ url: '/pagesPurchase/gatherResult', type: 2 })
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
init(){
|
|
|
@@ -77,8 +87,12 @@ export default {
|
|
|
this.orderTimeFun();
|
|
|
},1000)
|
|
|
},
|
|
|
- wxPayFn(type){
|
|
|
+ aliPay(){
|
|
|
let that = this
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ this.$util.confirmModal({content:'请到【应用市场】下载花掌柜,登录即可支付'},() => { })
|
|
|
+ return false
|
|
|
+ // #endif
|
|
|
|
|
|
//解决重复提交问题
|
|
|
if(this.hasRequestApi == true){
|
|
|
@@ -90,11 +104,34 @@ export default {
|
|
|
that.hasRequestApi = false
|
|
|
},7000)
|
|
|
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ that.$util.confirmModal({content:'确认收到花材没有问题?结清后订单无法再售后'},() => {
|
|
|
+ purchaseClearAliPay({ orderSn: this.orderSn}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ that.orderSn = res.data.orderSn
|
|
|
+ that.needCheck = 1
|
|
|
+ plus.runtime.openWeb(res.data.payUrl)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
+ wxPayFn(type){
|
|
|
+ let that = this
|
|
|
+ //解决重复提交问题
|
|
|
+ if(this.hasRequestApi == true){
|
|
|
+ this.$msg('正在请求,请5秒后重试')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ that.hasRequestApi = true
|
|
|
+ setTimeout(() => {
|
|
|
+ that.hasRequestApi = false
|
|
|
+ },7000)
|
|
|
// #ifdef APP-PLUS
|
|
|
this.$msg('请用小程序打开,再支付')
|
|
|
return false
|
|
|
// #endif
|
|
|
- that.$util.confirmModal({content:'确认收到花材且无需售后?结清后订单不能再申请售后'},() => {
|
|
|
+ that.$util.confirmModal({content:'确认收到花材没有问题?结清后订单无法再售后'},() => {
|
|
|
if(type == 1){
|
|
|
that.confirmWxPayFn()
|
|
|
}else{
|
|
|
@@ -169,6 +206,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-image: url("../../src/static/images/callback/bg.png");
|