Przeglądaj źródła

Merge branch 'master' of http://git.izouma.com/xiongzhu/9th

panhui 4 lat temu
rodzic
commit
db19dfc533

+ 0 - 2
pics2pic.sql

@@ -1,6 +1,4 @@
-alter table collection_info drop column pic;
 alter table collection_info change pics pic text null;
 
 
-alter table blind_box_item drop column pic;
 alter table blind_box_item change pics pic text null;

+ 14 - 0
src/main/java/com/izouma/nineth/service/OrderService.java

@@ -6,6 +6,7 @@ import com.alipay.api.AlipayClient;
 import com.alipay.api.request.AlipayTradeWapPayRequest;
 import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
 import com.github.binarywang.wxpay.bean.order.WxPayMwebOrderResult;
+import com.github.binarywang.wxpay.bean.request.WxPayRefundRequest;
 import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
 import com.github.binarywang.wxpay.constant.WxPayConstants;
 import com.github.binarywang.wxpay.exception.WxPayException;
@@ -411,4 +412,17 @@ public class OrderService {
             });
         }
     }
+
+    public void refund(Long id) throws WxPayException {
+        Order order = orderRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+        if (order.getStatus() != OrderStatus.FINISH) {
+            throw new BusinessException("订单未付款");
+        }
+        WxPayRefundRequest request = new WxPayRefundRequest();
+        request.setTransactionId(order.getTransactionId());
+        request.setTotalFee(order.getTotalPrice().multiply(BigDecimal.valueOf(100)).intValue());
+        request.setRefundFee(order.getTotalPrice().multiply(BigDecimal.valueOf(100)).intValue());
+        request.setOutRefundNo(String.valueOf(new SnowflakeIdWorker(0, 0).nextId()));
+        wxPayService.refund(request);
+    }
 }

+ 6 - 0
src/main/java/com/izouma/nineth/web/OrderController.java

@@ -1,5 +1,6 @@
 package com.izouma.nineth.web;
 
+import com.github.binarywang.wxpay.exception.WxPayException;
 import com.izouma.nineth.domain.Order;
 import com.izouma.nineth.dto.OrderDTO;
 import com.izouma.nineth.dto.PageQuery;
@@ -87,5 +88,10 @@ public class OrderController extends BaseController {
         order.setHide(true);
         orderRepo.save(order);
     }
+
+    @PostMapping("/refund")
+    public void refund(@RequestParam Long id) throws WxPayException {
+        orderService.refund(id);
+    }
 }
 

+ 9 - 5
src/main/pc-space/src/components/PageHeader.vue

@@ -269,16 +269,19 @@ export default {
     font-weight: bold;
     text-align: center;
 }
+/deep/ .el-tabs__item:hover {
+    color: #fdfb60 !important;
+}
 /deep/.menus {
-    padding: 15px 25px 0;
+    padding: 15px 24px 0;
     .el-tabs__item {
-        padding: 0 25px;
+        padding: 0 22px;
         color: #ffffff;
         font-size: 16px;
         font-weight: 400;
         // font-weight: bold;
         &.is-active {
-            color: #fff;
+            color: #fdfb60;
             font-weight: bold;
         }
         &:focus {
@@ -300,7 +303,7 @@ export default {
             position: absolute;
             left: 30%;
             right: 30%;
-            background-color: #fff;
+            background-color: #fdfb60;
             top: 0;
             bottom: 0;
         }
@@ -325,7 +328,7 @@ export default {
         align-items: center;
         justify-content: space-between;
         position: absolute;
-        right: 45px;
+        right: 52px;
         top: 0;
         .tabs {
             display: flex;
@@ -355,6 +358,7 @@ export default {
             }
         }
         .btn-list {
+            width: 83px;
             .img {
                 width: 34px;
                 height: 34px;

+ 0 - 2
src/main/pc-space/src/router/index.js

@@ -272,8 +272,6 @@ router.beforeEach((to, from, next) => {
     }
 });
 
-
-
 function backNext(to) {
     if (to.path === '/productDetail') {
         to.path = '/collectionDetail';

+ 1 - 1
src/main/pc-space/src/views/Casting.vue

@@ -55,7 +55,7 @@
                         round
                         :class="{ prim: !item.follow }"
                         size="mini"
-                        @click="like(item)"
+                        @click.prevent="like(item)"
                     >
                         {{ item.follow ? '已关注' : '关注' }}
                     </el-button>

+ 22 - 22
src/main/pc-space/src/views/Home.vue

@@ -8,12 +8,12 @@
             <div class="btnCon" @click="$router.push('/collection')"><span>立即探索</span></div>
         </div>
         <div class="back">
-            <!-- <swiper class="mySwiper imgBoxBack" ref="mySwiper" :options="swiperOptions">
-                    <swiper-slide>
+            <!-- <swiper class="mySwiper el-image" ref="mySwiper" :options="swiperOptions">
+                <swiper-slide>
                     <el-image :src="getImg(banners[0].pic, '', 800)" />
-                    </swiper-slide>
-                </swiper> -->
-            <img class="el-image" src="../assets/bg@3x.png" alt="" />
+                </swiper-slide>
+            </swiper> -->
+            <img class="el-image" :src="getImg(banners[0].pic, '', 1800)" alt="" />
         </div>
         <div class="hot1">铸造者</div>
         <div class="introduce center-content">
@@ -173,23 +173,23 @@ export default {
             .then(res => {
                 this.bannersList = res.content;
             });
-        // this.$http
-        //     .post(
-        //         '/banner/all',
-        //         {
-        //             query: {
-        //                 del: false,
-        //                 type: null
-        //             }
-        //         },
-        //         { body: 'json' }
-        //     )
-        //     .then(res => {
-
-        //         this.banners = res.content.filter(item => {
-        //             return item.name === '首页大图';
-        //         });
-        //     });
+        this.$http
+            .post(
+                '/banner/all',
+                {
+                    query: {
+                        del: false,
+                        type: null
+                    }
+                },
+                { body: 'json' }
+            )
+            .then(res => {
+                // console.log(res);
+                this.banners = res.content.filter(item => {
+                    return item.name === '首页大图';
+                });
+            });
     },
     methods: {
         getCreators() {

+ 53 - 46
src/main/pc-space/src/views/user/AccountData.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="container">
+    <div class="containers">
         <div class="top">
             <el-upload :action="uploadUrl" :show-file-list="false" :before-upload="beforeAvatarUpload2">
                 <img class="top" :src="userInfo.bg || require('../../assets/img/bg-moren@3x.png')" alt="" />
@@ -31,17 +31,17 @@
         <div class="userContent" v-if="active === '关注' || active === '粉丝'">
             <div class="border"></div>
             <el-empty v-if="empty" description="还没有哦~"></el-empty>
-            <div v-for="item in list" :key="item.id">
-                <div class="box">
+            <div style="margin-top: 30px" v-for="item in list" :key="item.id">
+                <div class="boxFollow">
                     <router-link :to="{ path: '/castingDetail?id=' + item.id }">
                         <div class="text">
                             <img class="img4" :src="item.avatar" alt="" />
                             <div class="box2">
-                                <div class="name">
+                                <div class="nickname">
                                     <div class="name1">{{ item.nickname }}</div>
                                     <img class="name2" src="../../assets/img/renzheng_icon@3x.png" alt="" />
                                 </div>
-                                <div class="text2">暂无</div>
+                                <div class="detail">{{ item.intro || '暂无' }}</div>
                                 <div class="box3">
                                     <div class="box4">
                                         <div class="text4">
@@ -51,16 +51,18 @@
                                             已售 <span>{{ item.sales }}</span>
                                         </div>
                                     </div>
-                                    <el-button
-                                        style="color: #939599"
-                                        plain
-                                        round
-                                        :class="{ prim: !item.follow }"
-                                        size="mini"
-                                        @click.prevent="like(item)"
-                                    >
-                                        {{ item.follow ? '已关注' : '关注' }}
-                                    </el-button>
+                                    <div class="btnFollow">
+                                        <el-button
+                                            style="color: #939599"
+                                            plain
+                                            round
+                                            :class="{ prim: !item.follow }"
+                                            size="mini"
+                                            @click.prevent="like(item)"
+                                        >
+                                            {{ item.follow ? '已关注' : '关注' }}
+                                        </el-button>
+                                    </div>
                                 </div>
                             </div>
                             <!-- <div class="imgBox" v-if="item.bg">
@@ -384,7 +386,7 @@ export default {
 }
 </style>
 <style lang="less" scoped>
-.container {
+.containers {
     .border2 {
         height: 1px;
         background: #494a4d;
@@ -397,21 +399,7 @@ export default {
         padding-top: 200px;
         margin: 0 auto;
     }
-    /deep/ .el-button {
-        position: absolute;
-        width: 90px;
-        height: 26px;
-        border-radius: 16px;
-        border: 1px solid #939599;
-        text-align: center;
-        font-size: 14px;
-        background: transparent;
-        color: #939599;
-        line-height: 6px;
-        cursor: pointer;
-        top: 20px;
-        right: 15px;
-    }
+
     /deep/ .el-empty__description {
         color: #ccc;
         margin: 10px 0 0 17px;
@@ -420,6 +408,21 @@ export default {
         height: 146px;
         width: 970px;
         position: relative;
+        .btn {
+            position: absolute;
+            width: 90px;
+            height: 26px;
+            border-radius: 16px;
+            border: 1px solid #939599;
+            text-align: center;
+            font-size: 14px;
+            background: transparent;
+            color: #939599;
+            line-height: 6px;
+            cursor: pointer;
+            top: 20px;
+            right: 15px;
+        }
     }
 
     .top1 {
@@ -464,7 +467,7 @@ export default {
     .userContent {
         padding: 0 16px;
 
-        .box {
+        .boxFollow {
             .flex();
             justify-content: space-between;
             margin-bottom: 20px;
@@ -480,9 +483,9 @@ export default {
                 .box2 {
                     width: 288px;
                     margin-right: 50px;
-                    .name {
+                    .nickname {
                         .flex();
-                        margin-top: 5px;
+                        // margin-top: 5px;
                         .name1 {
                             font-size: 16px;
                             font-weight: bold;
@@ -495,7 +498,7 @@ export default {
                             height: 18px;
                         }
                     }
-                    .text2 {
+                    .detail {
                         font-size: 14px;
                         font-weight: 400;
                         color: #939599;
@@ -521,18 +524,22 @@ export default {
                                 color: #fff;
                             }
                         }
-                        .el-button {
-                            background-color: transparent;
-                            min-width: 76px;
-                            height: 28px;
+                        .btnFollow {
+                            .el-button {
+                                background-color: transparent;
+                                min-width: 76px;
+                                height: 28px;
+
+                                &.prim {
+                                    .line(@radius: 28px);
+                                    border: 0;
+                                    text-align: center;
 
-                            &.prim {
-                                .line(@radius:28px);
-                                text-align: center;
-                                /deep/span {
-                                    color: @prim;
-                                    position: relative;
-                                    z-index: 1;
+                                    /deep/span {
+                                        color: @prim;
+                                        position: relative;
+                                        z-index: 1;
+                                    }
                                 }
                             }
                         }

+ 25 - 20
src/main/pc-space/src/views/user/Personal.vue

@@ -16,20 +16,20 @@
                         <img class="icon" src="../../assets/user/icon_yonghuxinxi@3x.png" alt="" />
                         <span>用户信息</span>
                     </template>
-                    <el-menu-item index="/accountdata">资料与账号</el-menu-item>
-                    <!-- <el-menu-item index="/address">地址管理</el-menu-item> -->
-                    <el-menu-item index="/give">我赞过的</el-menu-item>
                 </el-submenu>
+                <el-menu-item index="/accountdata">资料与账号</el-menu-item>
+                <!-- <el-menu-item index="/address">地址管理</el-menu-item> -->
+                <el-menu-item index="/give">我赞过的</el-menu-item>
                 <el-submenu index="2">
                     <template slot="title">
                         <img class="icon" src="../../assets/user/icon_jiaoyixinxi@3x.png" alt="" />
                         <span>交易信息</span>
                     </template>
-                    <el-menu-item index="/collectionorder">藏品订单</el-menu-item>
-                    <el-menu-item index="/payrecord">支付记录</el-menu-item>
-                    <el-menu-item index="/transactionordes">交易记录</el-menu-item>
-                    <el-menu-item index="/ordervalue">价值证明</el-menu-item>
                 </el-submenu>
+                <el-menu-item index="/collectionorder">藏品订单</el-menu-item>
+                <el-menu-item index="/payrecord">支付记录</el-menu-item>
+                <el-menu-item index="/transactionordes">交易记录</el-menu-item>
+                <el-menu-item index="/ordervalue">价值证明</el-menu-item>
                 <!-- <el-submenu index="3">
                     <template slot="title">
                         <img class="icon" src="../../assets/user/gongxu_icon_xuqiuxinxi@3x.png" alt="" />
@@ -66,7 +66,12 @@ export default {
             background: #1c1e26 !important;
             color: #ffffff !important;
             font-size: 18px !important;
-            margin-left: 24px !important;
+            margin-left: 4px !important;
+            .el-submenu__icon-arrow {
+                &::before {
+                    content: '';
+                }
+            }
         }
         .el-menu-item {
             height: 60px !important;
@@ -74,23 +79,23 @@ export default {
             margin-bottom: 10px !important;
             background: #1c1e26 !important;
             font-size: 16px;
-            padding-left: 78px !important;
+            padding-left: 56px !important;
             span {
                 color: #ffffff !important;
                 font-size: 18px !important;
             }
         }
-        .el-menu .is-active {
-            &::before {
-                width: 3px;
-                height: 36px;
-                background: linear-gradient(90deg, #fdfb60 0%, #fdfb60 0%, #ff8f3e 100%);
-                border-radius: 2px;
-                content: '';
-                position: absolute;
-                left: 0;
-                top: 12px;
-            }
+    }
+    .el-menu .is-active {
+        &::before {
+            width: 3px;
+            height: 36px;
+            background: linear-gradient(90deg, #fdfb60 0%, #fdfb60 0%, #ff8f3e 100%);
+            border-radius: 2px;
+            content: '';
+            position: absolute;
+            left: 0;
+            top: 12px;
         }
     }
     .icon {

+ 1 - 1
src/main/vue/src/views/RecommendList.vue

@@ -13,7 +13,7 @@
         </page-title>
         <div class="filters-container">
             <el-select v-model="type" clearable @change="getData">
-                <el-option v-for="item in typeOptions" :label="item.label" :value="item.value"></el-option>
+                <el-option v-for="item in typeOptions" :label="item.label" :value="item.value" :key="item.value"></el-option>
             </el-select>
             <el-input
                 placeholder="搜索..."

+ 5 - 0
src/test/java/com/izouma/nineth/service/OrderServiceTest.java

@@ -35,4 +35,9 @@ public class OrderServiceTest extends ApplicationTests {
     public void commission() {
         orderService.commission(orderRepo.findById(4437L).get());
     }
+
+    @Test
+    public void refund() throws WxPayException {
+        orderService.refund(4627L);
+    }
 }