Jelajahi Sumber

修复PC端

wbspool 3 tahun lalu
induk
melakukan
ee52ff557d

+ 3 - 0
src/common/config/api.js

@@ -46,6 +46,9 @@ const api = {
         confirmProductOrder:`${root}/mzUser/confirmProductOrder`,
         myVipSmOrders:`${root}/mzUser/myVipSmOrders`,
         myProductOrders:`${root}/mzUser/myProductOrders`,
+        vipSmOrder:`${root}/mzUser/vipSmOrder`,
+        uploadOrderPayPic:`${root}/mzUser/uploadOrderPayPic`,
+        prodcutOrder:`${root}/mzUser/prodcutOrder`,
     },
     common:{
         uploadFile:`${root}/common/uploadFile`,

+ 2 - 0
src/pc/App.vue

@@ -3,10 +3,12 @@
         <!-- <div style="width: 960px; backgroundcolor: black">12</div> -->
         <RouterView/>
         <login-box></login-box>
+        <pay-box></pay-box>
     </div>
 </template>
 <script>
     export default {
+        components: {},
         async created() {
 
 

+ 2 - 0
src/pc/components.d.ts

@@ -18,6 +18,7 @@ declare module '@vue/runtime-core' {
     LayoutUserMenu: typeof import('./components/layout-user/layout-user-menu.vue')['default']
     LoginBox: typeof import('./components/login-box/login-box.vue')['default']
     Navbar: typeof import('./components/Navbar.vue')['default']
+    PayBox: typeof import('./components/pay-box/pay-box.vue')['default']
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']
     UiBanner: typeof import('./components/ui-banner/ui-banner.vue')['default']
@@ -37,6 +38,7 @@ declare module '@vue/runtime-core' {
     UiVipArticle: typeof import('./components/ui-vip-article/ui-vip-article.vue')['default']
     UiVipMagazine: typeof import('./components/ui-vip-magazine/ui-vip-magazine.vue')['default']
     UiVipPreset: typeof import('./components/ui-vip-preset/ui-vip-preset.vue')['default']
+    UploadPayPicBox: typeof import('./components/upload-pay-pic-box/upload-pay-pic-box.vue')['default']
     UserAccountSettingInfoItem: typeof import('./pages/user/_components/user-account-setting-info-item.vue')['default']
     VipSrvBox: typeof import('./components/vip-srv-box/vip-srv-box.vue')['default']
   }

+ 196 - 0
src/pc/components/pay-box/pay-box.vue

@@ -0,0 +1,196 @@
+<template>
+    <div v-if="$store.state.showPayBox" class="pay-box-wrapper">
+        <div class="pay-box shadow-2xl">
+
+            <div class="pb-header">
+                <img @click="$store.commit('HIDE_PAY_BOX')" class="w-30px h-30px" src="/imgs/logion-close.png">
+            </div>
+
+            <div class="pb-body">
+                <template v-if="$store.state.payBoxType === 'vip'">
+                    <div class="order-num">订单号:{{$store.state.vipPayData.number}}</div>
+                    <table class="order-table">
+                        <thead>
+                        <tr>
+                            <th>套餐名称</th>
+                            <th>会员时长</th>
+                            <th>金额</th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        <tr>
+                            <td>{{$store.state.vipPayData.refVipSmName}}</td>
+                            <td>{{$store.state.vipPayData.expire}}</td>
+                            <td>{{$store.state.vipPayData.sum}}</td>
+                        </tr>
+                        </tbody>
+                    </table>
+                </template>
+
+
+                <table v-if="$store.state.payBoxType === 'product'" class="order-table">
+                    <thead>
+                    <tr>
+                        <th>产品图</th>
+                        <th>产品名称</th>
+                        <th>单价</th>
+                        <th>数量</th>
+                        <th>金额</th>
+                    </tr>
+                    </thead>
+                    <tbody>
+                    <tr>
+                        <td class="text-center">
+                            <div class="flex justify-center"><img :src="$store.state.productPayData.coverUrl" class="w-100px h-100px object-contain" /></div>
+                        </td>
+                        <td>{{$store.state.productPayData.productName}}</td>
+                        <td>{{$store.state.productPayData.price}}</td>
+                        <td>{{$store.state.productPayData.num}}</td>
+                        <td>{{$store.state.productPayData.sum}}</td>
+                    </tr>
+
+                    </tbody>
+                </table>
+                <div class="pay-info">
+                    <div v-if="$store.state.payBoxType === 'vip'" class="sum">应付金额(含税): <span class="text-[#FF0000]">¥{{$store.state.vipPayData.sum}}</span></div>
+                    <div v-if="$store.state.payBoxType === 'product'" class="sum">应付金额(含税): <span class="text-[#FF0000]">¥{{$store.state.productPayData.sum}}</span>
+                    </div>
+                    <div class="tips">*有任何支付问题请联系官方客服:400-0000-000</div>
+                    <div class="pay-type">请选择支付方式</div>
+                    <div>
+                        <el-radio-group>
+                            <el-radio>线下汇款(银行账户或银行卡汇款)</el-radio>
+                        </el-radio-group>
+                    </div>
+                    <div class="pt-60px">
+                        <el-button @click="handlePay" type="primary" class="w-200px h-60px">立即支付</el-button>
+                    </div>
+                </div>
+            </div>
+
+
+        </div>
+    </div>
+</template>
+
+<script>
+    export default {
+        name: "pay-box",
+        data() {
+            return {
+                show: false,
+            }
+        },
+        methods: {
+            handlePay() {
+                this.$store.commit('HIDE_PAY_BOX');
+                if(this.$store.state.payBoxType === 'vip'){
+                    this.$router.push('/upload-pay-pic?code=' + this.$store.state.vipPayData.code + '&type=' + this.$store.state.payBoxType)
+                }else{
+                    this.$router.push('/upload-pay-pic?code=' + this.$store.state.productPayData.code + '&type=' + this.$store.state.payBoxType)
+
+                }
+            }
+        },
+        async created() {
+
+
+
+        }
+    }
+</script>
+
+<style scoped>
+    .pay-box-wrapper {
+        position: fixed;
+        width: 100vw;
+        height: 100vh;
+        left: 0;
+        top: 0;
+        z-index: 99;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+    }
+
+    .pay-box {
+        width: 1200px;
+        background-color: white;
+        padding-bottom: 30px;
+    }
+
+
+    .pb-header {
+        padding: 30px;
+        display: flex;
+        justify-content: flex-end;
+    }
+
+
+    .order-table {
+        width: 100%;
+    }
+
+
+    .pb-body {
+        padding-left: 60px;
+        padding-right: 60px;
+    }
+
+    .pb-body > table {
+        width: 100%;
+        font-size: 20px;
+        font-weight: 400 !important;
+        color: #000000;
+        background-color: #F6F7F9;
+        border: 1px solid #EEEEEE;
+        margin-top: 32px;
+    }
+
+    .pd-body table th, td {
+        border: 1px solid #EEEEEE;
+    }
+
+    .pb-body table td {
+        color: #707070;
+        line-height: 70px;
+        text-align: center;
+    }
+
+    .pb-body table th {
+        font-weight: normal;
+        border: 1px solid #EEEEEE;
+        line-height: 70px;
+        text-align: center;
+    }
+
+    .order-num {
+        font-size: 20px;
+        font-weight: bold;
+    }
+
+    .pay-info {
+        border-radius: 10px;
+        margin-top: 40px;
+        background: #F6F7F9;
+        padding: 48px 64px;
+    }
+
+    .sum {
+        font-size: 30px;
+    }
+
+    .tips {
+        padding-top: 30px;
+        font-size: 16px;
+        color: #707070;
+    }
+
+    .pay-type {
+        font-size: 20px;
+        padding-top: 10px;
+        padding-bottom: 10px;
+    }
+
+
+</style>

+ 94 - 0
src/pc/components/upload-pay-pic-box/upload-pay-pic-box.vue

@@ -0,0 +1,94 @@
+<template>
+    <div v-if="visable" class="upload-pay-pic-wrapper">
+         <template v-if="!success">
+             <div class="upload-pay-pic-box bg-[#ffffff] w-1200px pb-36px">
+                 <div class="flex justify-between pt-36px pb-36px text-size-30px border-b-1px">
+                     <span class="ml-36px">上传汇款凭证:{{number}}</span>
+                     <img class="w-30px h-30px mr-36px cursor-pointer" @click="visable=false" src="/imgs/logion-close.png">
+                 </div>
+                 <div class="flex justify-center pt-65px pb-65px flex-col items-center">
+                     <img width="200px" class="mb-32px" v-if="payPicUrl" :src="payPicUrl">
+                     <div @click="handleUpload"  class="w-300px h-60px border-1px border-[#707070] rounded-30px text-center leading-60px cursor-pointer">{{payPicUrl ? '重新上传' : '选择上传文件'}}</div>
+                 </div>
+                 <div class="text-size-20px pl-36px pr-36px leading-30px">
+                     1. 请您将汇款底单拍照或者扫描底单上传;<br>
+                     2. 请保证上传内容清晰可辨认;<br>
+                     3. 请上传文件是JPG、PNG或者PDF,大小不能超过5mb<br>
+                 </div>
+             </div>
+         </template>
+        <template v-else>
+            <div class="upload-pay-pic-box bg-[#ffffff] w-1200px pb-36px">
+                <div class="flex justify-between pt-36px pb-36px text-size-30px border-b-1px">
+                    <span class="ml-36px">上传汇款凭证成功</span>
+                    <img @click="visable=false" class="w-30px h-30px mr-36px" src="/imgs/logion-close.png">
+                </div>
+                <div class="flex justify-center pt-65px pb-65px  text-size-30px items-center text-[#02A388]">
+                     <i class="el-icon-check   text-size-52px"></i><span >上传成功</span>
+                </div>
+                <div class="text-size-20px pl-36px pr-36px leading-30px">
+                    1. 客服确认后会给您开通会员权限;<br>
+                    2. 开通后会跟您电话确认或者邮箱联系;;<br>
+                    3. 您也可以联系在线客服,或拨打客服热线400-000-000;<br>
+                </div>
+            </div>
+        </template>
+    </div>
+
+</template>
+
+<script>
+    export default {
+        name: "upload-pay-pic-box",
+        data(){
+            return {
+                success:false,
+                visable:false,
+                number:'',
+                sum:'',
+                payPicUrl:''
+            }
+        },
+        methods:{
+            show(param){
+                this.number = param.number;
+                this.sum = param.sum;
+                this.payPicUrl = param.payPicUrl;
+                this.visable = true;
+            },
+            handleUpload() {
+
+                let input = document.createElement("input")
+                input.type = 'file';
+                input.onchange = async (e) => {
+                    let formData = new FormData();
+                    formData.append("file", input.files[0])
+                    formData.append("category", 'AVATAR')
+                    let resp = await this.$http.post(this.$api.common.uploadFile, formData);
+                    if (resp.data.status === 200) {
+                       let r =  await  this.$http.post(this.$api.mzUser.uploadOrderPayPic,this.$qs.stringify(Object.assign(this.$route.query,{pic:resp.data.data.code})))
+                        if(r.data.status === 200){
+                            this.success = true;
+                        }
+                    }
+                }
+                input.click();
+
+            },
+        }
+    }
+</script>
+
+<style scoped>
+.upload-pay-pic-wrapper{
+    position: fixed;
+    width: 100vw;
+    height: 100vh;
+    background: rgba(0,0,0,0.3);
+    left: 0;
+    top: 0;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+</style>

+ 14 - 11
src/pc/components/vip-srv-box/vip-srv-box.vue

@@ -46,18 +46,21 @@
 
                 let resp = await this.$http.post(this.$api.mzUser.createVipOrder,this.$qs.stringify({vipCode:vipSmeal.code}))
                 if(resp.data.status === 200){
-                    await this.$confirm(this.$t('请在弹出的窗口完成付款操作?'), this.$t('提示'), {
-                        confirmButtonText:this.$t( '已完成付款'),
-                        cancelButtonText:this.$t( '取消') ,
-                        type: 'warning'
-                    })
-                    resp = await this.$http.post(this.$api.mzUser.confirmVipOrder,this.$qs.stringify({orderCode:resp.data.data.vipSmOrder.code}))
+                    this.$store.dispatch('SHOW_PAY_BOX',{type:'vip',vipPayData:resp.data.data.vipSmOrder});
+                    this.close();
+                    // await this.$confirm(this.$t('请在弹出的窗口完成付款操作?'), this.$t('提示'), {
+                    //     confirmButtonText:this.$t( '已完成付款'),
+                    //     cancelButtonText:this.$t( '取消') ,
+                    //     type: 'warning'
+                    // })
+                    // resp = await this.$http.post(this.$api.mzUser.confirmVipOrder,this.$qs.stringify({orderCode:resp.data.data.vipSmOrder.code}))
+                    //
+                    // if(resp.data.status === 200){
+                    //     this.$message.success(this.$t( '开通成功'));
+                    //     this.loadData();
+                    //     this.close();
+                    // }
 
-                    if(resp.data.status === 200){
-                        this.$message.success(this.$t( '开通成功'));
-                        this.loadData();
-                        this.close();
-                    }
 
                 }
 

+ 14 - 10
src/pc/pages/product/order-detail.vue

@@ -84,17 +84,21 @@ export default {
     async handleSubmit(){
       let resp = await this.$http.post(this.$api.mzUser.createProductOrder,this.$qs.stringify(this.form))
       if(resp.data.status === 200){
-        await this.$confirm(this.$t('请在弹出的窗口完成付款操作?'), this.$t('提示'), {
-          confirmButtonText: this.$t('已完成付款'),
-          cancelButtonText: this.$t('取消'),
-          type: 'warning'
-        })
-        resp = await this.$http.post(this.$api.mzUser.confirmProductOrder,this.$qs.stringify({orderCode:resp.data.data.productOrder.code}))
 
-        if(resp.data.status === 200){
-          this.$message.success("购买成功");
-          this.$router.push('/user/order?type=product')
-        }
+
+        this.$store.dispatch('SHOW_PAY_BOX',{type:'product',productPayData:resp.data.data.productOrder});
+        this.close();
+        // await this.$confirm(this.$t('请在弹出的窗口完成付款操作?'), this.$t('提示'), {
+        //   confirmButtonText: this.$t('已完成付款'),
+        //   cancelButtonText: this.$t('取消'),
+        //   type: 'warning'
+        // })
+        // resp = await this.$http.post(this.$api.mzUser.confirmProductOrder,this.$qs.stringify({orderCode:resp.data.data.productOrder.code}))
+        //
+        // if(resp.data.status === 200){
+        //   this.$message.success("购买成功");
+        //   this.$router.push('/user/order?type=product')
+        // }
 
       }else{
         this.$message.warning(resp.data.desc);

+ 76 - 0
src/pc/pages/upload-pay-pic/upload-pay-pic.vue

@@ -0,0 +1,76 @@
+<template>
+    <div class="upload-pay-pic pt-60px w-1200px">
+        <upload-pay-pic-box ref="uppb"></upload-pay-pic-box>
+        <div class="text-size-30px mb-20px">线下汇款</div>
+
+
+        <div class="mb-20px text-size-20px leading-relaxed">
+                您的订单号是:<span class="text-[#FF0000]">{{number}}</span>,订单金额<span class="text-[#FF0000]">¥{{sum}}元</span><br>
+            汇款时请备注您的账户名或订单号,汇款完成请联系客服,我们确认后会马上给您开通。
+        </div>
+
+        <div class="info border-1px border-[#DEDEDE] !bg-[#ffffff] pt-48px pb-48px pl-48px pr-48px">
+            <div>
+                <div> 1.请汇款至以下银行账户:</div>
+                <div class="h-24px"></div>
+                账户名:xxxxxxx有限公司<br>
+                账   号:0000 0000 0000 000<br>
+                开户行:中国银行XXX支行<br>
+            </div>
+            <hr class="mt-48px mb-48px">
+            <div>
+                <div>1.完成后请联系客服:</div>
+                <div class="h-24px"></div>
+                客服电话:400-0000-000<br>
+            </div>
+
+            <div class="pt-80px">
+                <el-button @click="$refs.uppb.show({number:number,sum:sum,data:data,payPicUrl:data.payPicUrl})" class="!bg-[#F05941] !border-[#F05941]" type="primary">上传汇款凭证</el-button>
+                <el-button  class="!bg-[#02A388] !border-[#02A388]" type="primary">在线客服</el-button>
+            </div>
+
+        </div>
+
+    </div>
+</template>
+
+<script>
+    export default {
+        name: "upload-pay-pic",
+        components: {},
+        data(){
+            return {
+                show:false,
+                number:'',
+                sum:'',
+                data:''
+            }
+        },
+        async created() {
+            if(this.$route.query.type === 'vip'){
+                let resp = await this.$http.post(this.$api.mzUser.vipSmOrder,this.$qs.stringify(this.$route.query));
+                if(resp.data.status === 200){
+                    let vipSmOrder = resp.data.data.vipSmOrder;
+                    this.number = vipSmOrder.number;
+                    this.sum = vipSmOrder.sum;
+                    this.data = vipSmOrder;
+                }
+            }
+
+
+            if(this.$route.query.type === 'product'){
+                let resp = await this.$http.post(this.$api.mzUser.prodcutOrder,this.$qs.stringify(this.$route.query));
+                if(resp.data.status === 200){
+                    let productOrder = resp.data.data.productOrder;
+                    this.number = productOrder.number;
+                    this.sum = productOrder.sum;
+                    this.data = productOrder;
+                }
+            }
+        }
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 24 - 1
src/pc/pages/user/user-order.vue

@@ -5,7 +5,14 @@
         <div class="pl-27px">
             <el-tabs v-model="activeName" @tab-click="handleClick">
                 <el-tab-pane :label="$t('会员订单')" name="first">
-                    <ui-order-table :data="vipOrdersData" :columns="vipOrders"></ui-order-table>
+                    <ui-order-table :data="vipOrdersData" :columns="vipOrders">
+                        <template v-slot:5="{ row }">
+                            <div  v-if="row.status !== '1'" class="flex">
+                                <el-link @click="$store.dispatch('SHOW_PAY_BOX',{type:'vip',vipPayData:row})" type="warning mr-12px" >去支付</el-link>
+<!--                                <el-link type="danger">取消</el-link>-->
+                            </div>
+                        </template>
+                    </ui-order-table>
                 </el-tab-pane>
                 <el-tab-pane :label="$t('商品订单')" name="second">
                     <ui-order-table :data="goodsOrdersData" :columns="goodsOrders">
@@ -19,6 +26,12 @@
                                 <span>{{$t('地址')}}:{{row.address}}</span>
                             </div>
                         </template>
+                        <template v-slot:7="{ row }">
+                            <div  v-if="row.status !== '1'" class="flex">
+                                <el-link @click="$store.dispatch('SHOW_PAY_BOX',{type:'product',productPayData:row})" type="warning mr-12px" >去支付</el-link>
+<!--                               <el-link type="danger">取消</el-link>-->
+                            </div>
+                        </template>
                     </ui-order-table>
                 </el-tab-pane>
             </el-tabs>
@@ -58,6 +71,11 @@
                         label: this.$t("支付方式"),
                         align: "center",
                     },
+                    {
+                        prop: "action",
+                        label: this.$t("操作"),
+                        align: "center",
+                    },
                 ],
                 goodsOrdersData: [],
                 goodsOrders: [
@@ -97,6 +115,11 @@
                         label: this.$t("支付方式"),
                         align: "center",
                     },
+                    {
+                        prop: "action",
+                        label: this.$t("操作"),
+                        align: "center",
+                    },
                 ],
             };
         },

+ 13 - 11
src/pc/pages/user/user-personal-center.vue

@@ -73,17 +73,19 @@
 
                 let resp = await this.$http.post(this.$api.mzUser.createVipOrder,this.$qs.stringify({vipCode:vipSmeal.code}))
                 if(resp.data.status === 200){
-                    await this.$confirm('请在弹出的窗口完成付款操作?', '提示', {
-                        confirmButtonText: '已完成付款',
-                        cancelButtonText: '取消',
-                        type: 'warning'
-                    })
-                    resp = await this.$http.post(this.$api.mzUser.confirmVipOrder,this.$qs.stringify({orderCode:resp.data.data.vipSmOrder.code}))
-
-                    if(resp.data.status === 200){
-                         this.$message.success("开通成功");
-                         this.loadData();
-                    }
+                  this.$store.dispatch('SHOW_PAY_BOX',{type:'vip',vipPayData:resp.data.data.vipSmOrder});
+                  this.close();
+                    // await this.$confirm('请在弹出的窗口完成付款操作?', '提示', {
+                    //     confirmButtonText: '已完成付款',
+                    //     cancelButtonText: '取消',
+                    //     type: 'warning'
+                    // })
+                    // resp = await this.$http.post(this.$api.mzUser.confirmVipOrder,this.$qs.stringify({orderCode:resp.data.data.vipSmOrder.code}))
+                    //
+                    // if(resp.data.status === 200){
+                    //      this.$message.success("开通成功");
+                    //      this.loadData();
+                    // }
 
                 }
 

+ 2 - 0
src/pc/router/index.ts

@@ -30,6 +30,7 @@ import Zfsm from "@pc/pages/zfsm/zfsm.vue";
 import Publish from "@pc/pages/publish/publish.vue";
 import yssn from "@pc/pages/yssm/yssn.vue";
 import zfsm from "@pc/pages/zfsm/zfsm.vue";
+import UploadPayPic from "@pc/pages/upload-pay-pic/upload-pay-pic.vue";
 
 Vue.use(VueRouter);
 
@@ -59,6 +60,7 @@ export const routes: RouteConfig[] = [
       { path: "/yssm", component: yssn },
       { path: "/zfsm", component: zfsm },
       { path: "/publish", component: Publish },
+      { path: "/upload-pay-pic", component: UploadPayPic },
       {
         path: "/user",
         name: "user",

+ 18 - 2
src/pc/store.js

@@ -8,7 +8,11 @@ export default new Vuex.Store({
       showLoginBox:false,
       userinfo:'',
       banners:[],
-      cart:[]
+      cart:[],
+      showPayBox:false,
+      payBoxType:'',
+      vipPayData:'',
+      productPayData:'',
   },
   mutations: {
       UPDATE_LOGIN_INFO(state,param){
@@ -25,9 +29,21 @@ export default new Vuex.Store({
       },
       SHOW_LOGIN_BOX(state,param){
           state.showLoginBox = true;
+      },
+      HIDE_PAY_BOX(state){
+          state.showPayBox = false;
+      },
+      SHOW_PAY_BOX(state,param){
+          state.showPayBox = param.show;
+          state.payBoxType = param.type;
+          state.vipPayData = param.vipPayData;
+          state.productPayData = param.productPayData;
       }
   },
   actions: {
-
+      SHOW_PAY_BOX(ctx,param){
+          ctx.commit('SHOW_PAY_BOX',{show:true,type:param.type,vipPayData:param.vipPayData,productPayData:param.productPayData})
+          console.log(param);
+      }
   }
 })

+ 2 - 1
vite.config.pc.ts

@@ -31,7 +31,8 @@ const config = defineConfig(({ command, mode, ssrBuild }) => {
             port: 3333,
             proxy: {
                 '/api': {
-                    target: 'http://www.apdmagazine.com/', //测试服务器的
+                    // target: 'http://www.apdmagazine.com/', //测试服务器的
+                    target: 'http://127.0.0.1:9011/', //测试服务器的
                     changeOrigin: true,
                     ws: true,
                     pathRewrite: {