|
@@ -23,7 +23,30 @@
|
|
|
<block v-if="orderTime>0">
|
|
<block v-if="orderTime>0">
|
|
|
<button v-if="getPayType == 1" class="button-com green pay-wx" @click="wxPayFn(1)" >微信支付</button>
|
|
<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 v-else class="button-com green pay-wx" @click="wxPayFn(0)" >微信支付</button>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- #ifdef MP-WEIXIN -->
|
|
|
|
|
+ <view style="margin-top:30upx;text-align: center;">
|
|
|
|
|
+ <block v-if="hasRenew == 0">
|
|
|
|
|
+ <view style="width:290upx;height:290upx;margin:0 auto;position: relative;" @click="openAliPay()">
|
|
|
|
|
+ <image :src="aliPayCodeImg" mode="heightFix" style="width:290upx;height:290upx;margin:0 auto;"></image>
|
|
|
|
|
+ <view style="font-size:32upx;width:290upx;height:140upx;line-height:140upx;background-color: white;z-index: 9999;position: absolute;top:70upx;left:0upx;font-weight: bold;color:#3385ff;">
|
|
|
|
|
+ 点此显示完整
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </block>
|
|
|
|
|
+ <block v-else>
|
|
|
|
|
+ <image :src="aliPayCodeImg" mode="heightFix" style="width:290upx;height:290upx;margin:0 auto;"></image>
|
|
|
|
|
+ </block>
|
|
|
|
|
+ <view style="margin-top:10upx;font-size:32upx;">支付宝扫此二维码付款</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <button class="button-com ali-btn" @click="savePayCode" style="margin-top:10upx;">保存二维码</button>
|
|
|
|
|
+ <button class="button-com ali-btn" @click="goDetail" style="margin-top:10upx;">我已经付款</button>
|
|
|
|
|
+ <view style="margin-top:25upx;font-size:32upx;text-decoration: underline;" @click="teachPayFn()">不会用支付宝付款?点这里教您</view>
|
|
|
|
|
+ <!-- #endif -->
|
|
|
|
|
+
|
|
|
|
|
+ <!-- #ifdef APP-PLUS -->
|
|
|
<button class="button-com green pay-wx ali-btn" @click="aliPay()">支付宝支付</button>
|
|
<button class="button-com green pay-wx ali-btn" @click="aliPay()">支付宝支付</button>
|
|
|
|
|
+ <!-- #endif -->
|
|
|
</block>
|
|
</block>
|
|
|
<block v-else>
|
|
<block v-else>
|
|
|
<button class="button-com disable pay-wx">微信支付</button>
|
|
<button class="button-com disable pay-wx">微信支付</button>
|
|
@@ -37,6 +60,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
import { purchaseClearWxPay,purchaseClearAliPay } from "@/api/purchase";
|
|
import { purchaseClearWxPay,purchaseClearAliPay } from "@/api/purchase";
|
|
|
|
|
+import { getAliPayClearCode,detail } from "@/api/clear";
|
|
|
import wexinPay from "@/utils/pay/wxPay";
|
|
import wexinPay from "@/utils/pay/wxPay";
|
|
|
import { mapGetters } from "vuex";
|
|
import { mapGetters } from "vuex";
|
|
|
import { postWxCode } from '@/api/mini'
|
|
import { postWxCode } from '@/api/mini'
|
|
@@ -55,7 +79,9 @@ export default {
|
|
|
actPrice: '',
|
|
actPrice: '',
|
|
|
getPayType:1,
|
|
getPayType:1,
|
|
|
hasRequestApi:false,
|
|
hasRequestApi:false,
|
|
|
- needCheck:0
|
|
|
|
|
|
|
+ needCheck:0,
|
|
|
|
|
+ aliPayCodeImg:'',
|
|
|
|
|
+ hasRenew:0
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onLoad (options) {
|
|
onLoad (options) {
|
|
@@ -64,7 +90,16 @@ export default {
|
|
|
this.actPrice = options.actPrice
|
|
this.actPrice = options.actPrice
|
|
|
this.getPayType = options.getPayType
|
|
this.getPayType = options.getPayType
|
|
|
this.orderTime = options.remainSecond - 10 > 0 ? (options.remainSecond - 10) : 0
|
|
this.orderTime = options.remainSecond - 10 > 0 ? (options.remainSecond - 10) : 0
|
|
|
- this.orderTimeFun();
|
|
|
|
|
|
|
+ this.orderTimeFun()
|
|
|
|
|
+ this.aliPayCodeImg = `${this.$constant.imgUrl}/default-img.png`
|
|
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
|
|
+ this.getPayCodeFn(this.orderSn)
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ detail({id:this.id}).then(res => {
|
|
|
|
|
+ if(res.code == 1){
|
|
|
|
|
+ this.hasRenew = res.data.hasRenew ? res.data.hasRenew : 0
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
...mapGetters(["getLoginInfo", 'getDictionariesInfo']),
|
|
...mapGetters(["getLoginInfo", 'getDictionariesInfo']),
|
|
@@ -79,9 +114,42 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ openAliPay(){
|
|
|
|
|
+ this.$msg('商家还未开通此功能')
|
|
|
|
|
+ },
|
|
|
init(){
|
|
init(){
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
|
|
+ getPayCodeFn(orderSn){
|
|
|
|
|
+ getAliPayClearCode({orderSn:orderSn}).then(res=>{
|
|
|
|
|
+ if(res.code == 1){
|
|
|
|
|
+ if(res.data.imgUrl){
|
|
|
|
|
+ this.aliPayCodeImg = res.data.imgUrl
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ savePayCode(){
|
|
|
|
|
+ let url = this.aliPayCodeImg
|
|
|
|
|
+ uni.downloadFile({
|
|
|
|
|
+ url: url,
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ if (res.statusCode === 200) {
|
|
|
|
|
+ uni.saveImageToPhotosAlbum({
|
|
|
|
|
+ filePath: res.tempFilePath,
|
|
|
|
|
+ success: function (data) {
|
|
|
|
|
+ uni.showToast({title:'下载成功'})
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ goDetail(){
|
|
|
|
|
+ this.$util.pageTo({url: "/admin/clear/info?id="+this.id,type:2})
|
|
|
|
|
+ },
|
|
|
|
|
+ teachPayFn() {
|
|
|
|
|
+ this.pageTo({ url: "/admin/ghs/teachPay"})
|
|
|
|
|
+ },
|
|
|
orderTimeFun(){
|
|
orderTimeFun(){
|
|
|
if(this.orderTime==0)return;
|
|
if(this.orderTime==0)return;
|
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
@@ -91,11 +159,6 @@ export default {
|
|
|
},
|
|
},
|
|
|
aliPay(){
|
|
aliPay(){
|
|
|
let that = this
|
|
let that = this
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
|
|
- this.$util.confirmModal({content:'支付宝付款,请到【应用市场】下载花掌柜,登录即可支付'},() => { })
|
|
|
|
|
- return false
|
|
|
|
|
- // #endif
|
|
|
|
|
-
|
|
|
|
|
//解决重复提交问题
|
|
//解决重复提交问题
|
|
|
if(this.hasRequestApi == true){
|
|
if(this.hasRequestApi == true){
|
|
|
this.$msg('正在请求,请5秒后重试')
|
|
this.$msg('正在请求,请5秒后重试')
|
|
@@ -163,6 +226,7 @@ export default {
|
|
|
purchaseClearWxPay({ orderSn: this.orderSn,currentMiniOpenId:currentMiniOpenId }).then(res => {
|
|
purchaseClearWxPay({ orderSn: this.orderSn,currentMiniOpenId:currentMiniOpenId }).then(res => {
|
|
|
that.orderSn = res.data.orderSn
|
|
that.orderSn = res.data.orderSn
|
|
|
wexinPay(res.data, this.getSuccess, this.getError)
|
|
wexinPay(res.data, this.getSuccess, this.getError)
|
|
|
|
|
+ that.getPayCodeFn(that.orderSn)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
confirmWxPayFnOld() {
|
|
confirmWxPayFnOld() {
|
|
@@ -205,7 +269,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
-
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.app-content {
|
|
.app-content {
|
|
|
.ali-btn{
|
|
.ali-btn{
|
|
@@ -250,7 +313,7 @@ export default {
|
|
|
// 一个按钮
|
|
// 一个按钮
|
|
|
.call-one-btn {
|
|
.call-one-btn {
|
|
|
.button-com {
|
|
.button-com {
|
|
|
- width: 80%;
|
|
|
|
|
|
|
+ width: 70%;
|
|
|
padding-top: 22upx;
|
|
padding-top: 22upx;
|
|
|
padding-bottom: 22upx;
|
|
padding-bottom: 22upx;
|
|
|
font-size: 32upx;
|
|
font-size: 32upx;
|