Pārlūkot izejas kodu

支付宝支付

panhui 4 gadi atpakaļ
vecāks
revīzija
9687c6c7ba

+ 13 - 1
src/main/nine-space/src/views/Submit.vue

@@ -68,6 +68,7 @@ import product from '../mixins/product';
 import coupon from '../mixins/coupon';
 import { mapState } from 'vuex';
 let inWeixin = /micromessenger/i.test(navigator.userAgent);
+let inApp = /#cordova#/i.test(navigator.userAgent);
 export default {
     name: 'Submit',
     mixins: [product, coupon],
@@ -97,6 +98,7 @@ export default {
             orderId: 0,
             gas: 1,
             inWeixin,
+            inApp,
             couponList: [],
             collectionId: 0
         };
@@ -204,7 +206,17 @@ export default {
                         this.$router.replace('/submit?orderId=' + res.id);
                         this.$nextTick(() => {
                             if (this.payType === 'ALIPAY') {
-                                document.location.replace(path.resolve(this.$baseUrl, 'payOrder/alipay?id=' + res.id));
+                                if (this.inWeixin) {
+                                    document.location.replace(
+                                        path.resolve(this.$baseUrl, '/payOrder/alipay_wx?id=' + res.id)
+                                    );
+                                } else {
+                                    this.$http.get(`/payOrder/${inApp ? 'alipay_app' : 'alipay_h5'}`).then(res => {
+                                        document.location.replace(
+                                            'alipays://platformapi/startapp?saId=10000007&qrcode=' + res
+                                        );
+                                    });
+                                }
                             } else if (this.payType === 'WEIXIN') {
                                 if (this.inWeixin) {
                                     this.$toast.loading('加载中');

+ 9 - 1
src/main/vue/src/router.js

@@ -391,6 +391,14 @@ const router = new Router({
             meta: {
                 title: '登录'
             }
+        },
+        {
+            path: '/photoProcessing',
+            name: 'photoProcessing',
+            component: () => import('@/views/PhotoProcessing'),
+            meta: {
+                title: '图片处理'
+            }
         }
     ]
 });
@@ -413,7 +421,7 @@ router.beforeEach((to, from, next) => {
         window.open(url);
         return;
     }
-    if (!store.state.userInfo && to.path !== '/login') {
+    if (!store.state.userInfo && to.path !== '/login' && to.path!=='/photoProcessing') {
         http.axios
             .get('/user/my')
             .then(res => {

+ 21 - 0
src/main/vue/src/views/PhotoProcessing.vue

@@ -0,0 +1,21 @@
+<template>
+    <div>
+        <el-upload action="" class="upload-demo" drag :http-request="onProgress">
+            <i class="el-icon-upload"></i>
+            <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+            <div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div>
+        </el-upload>
+    </div>
+</template>
+
+<script>
+export default {
+    methods: {
+        onProgress(event, file, fileList) {
+            console.log(event);
+        }
+    }
+};
+</script>
+
+<style lang="less" scoped></style>