Browse Source

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

xuqiang 4 years ago
parent
commit
d0093e436f
30 changed files with 590 additions and 362 deletions
  1. 2 0
      src/main/java/com/izouma/nineth/config/AdapayProperties.java
  2. 17 0
      src/main/java/com/izouma/nineth/dto/Balance.java
  3. 12 0
      src/main/java/com/izouma/nineth/service/AdapayService.java
  4. 5 1
      src/main/java/com/izouma/nineth/service/AssetService.java
  5. 46 8
      src/main/java/com/izouma/nineth/service/GiftOrderService.java
  6. 87 3
      src/main/java/com/izouma/nineth/service/OrderService.java
  7. 5 6
      src/main/java/com/izouma/nineth/service/UserService.java
  8. 43 4
      src/main/java/com/izouma/nineth/web/OrderNotifyController.java
  9. 6 0
      src/main/java/com/izouma/nineth/web/UserController.java
  10. BIN
      src/main/nine-space/public/images/img_0.png
  11. BIN
      src/main/nine-space/public/images/img_1.png
  12. BIN
      src/main/nine-space/src/assets/01.png
  13. BIN
      src/main/nine-space/src/assets/02.png
  14. BIN
      src/main/nine-space/src/assets/creatorBg.png
  15. 21 0
      src/main/nine-space/src/components/ImgContent.vue
  16. 69 231
      src/main/nine-space/src/components/Loading.vue
  17. 8 1
      src/main/nine-space/src/components/product/ProductBanner.vue
  18. 6 37
      src/main/nine-space/src/components/product/productSmall.vue
  19. 4 3
      src/main/nine-space/src/main.js
  20. 2 2
      src/main/nine-space/src/styles/app.less
  21. 162 1
      src/main/nine-space/src/utils/data.json
  22. 3 9
      src/main/nine-space/src/views/Home.vue
  23. 8 5
      src/main/nine-space/src/views/Mine.vue
  24. 9 2
      src/main/nine-space/src/views/creator/Detail.vue
  25. 23 16
      src/main/nine-space/src/views/product/Detail.vue
  26. 0 3
      src/main/nine-space/src/views/user/Point.vue
  27. 4 1
      src/main/resources/application.yaml
  28. 0 25
      src/test/java/com/izouma/nineth/AdapayTest.java
  29. 3 3
      src/test/java/com/izouma/nineth/CommonTest.java
  30. 45 1
      src/test/java/com/izouma/nineth/service/AdapayServiceTest.java

+ 2 - 0
src/main/java/com/izouma/nineth/config/AdapayProperties.java

@@ -14,4 +14,6 @@ public class AdapayProperties {
     private String  publicKey;
     private String  privKey;
     private String  appPublicKey;
+    private String  wxAppId;
+    private String  notifyUrl;
 }

+ 17 - 0
src/main/java/com/izouma/nineth/dto/Balance.java

@@ -0,0 +1,17 @@
+package com.izouma.nineth.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class Balance {
+    private BigDecimal acct_balance;
+    private BigDecimal avl_balance;
+    private BigDecimal frz_balance;
+    private BigDecimal last_avl_balance;
+}

+ 12 - 0
src/main/java/com/izouma/nineth/service/AdapayService.java

@@ -6,6 +6,7 @@ import com.huifu.adapay.core.exception.BaseAdaPayException;
 import com.huifu.adapay.model.AdapayCommon;
 import com.huifu.adapay.model.SettleAccount;
 import com.izouma.nineth.config.AdapayProperties;
+import com.izouma.nineth.dto.Balance;
 import com.izouma.nineth.exception.BusinessException;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -66,6 +67,17 @@ public class AdapayService {
         checkSuccess(settleCount);
     }
 
+    public Balance queryBalance(String memberId, String settleAccountId) throws BaseAdaPayException {
+        Map<String, Object> queryParams = new HashMap<>();
+        queryParams.put("settle_account_id", settleAccountId);
+        queryParams.put("member_id", memberId);
+        queryParams.put("app_id", adapayProperties.getAppId());
+        Map<String, Object> settleCount = SettleAccount.balance(queryParams);
+        String json = JSON.toJSONString(settleCount, SerializerFeature.PrettyFormat);
+        log.info("queryBalance\n{}", JSON.toJSONString(settleCount, SerializerFeature.PrettyFormat));
+        checkSuccess(settleCount);
+        return JSON.parseObject(json, Balance.class);
+    }
 
     public void checkSuccess(Map<String, Object> map) {
         if (!"succeeded".equals(MapUtils.getString(map, "status"))) {

+ 5 - 1
src/main/java/com/izouma/nineth/service/AssetService.java

@@ -15,6 +15,7 @@ import com.izouma.nineth.utils.JpaUtils;
 import com.izouma.nineth.utils.SecurityUtils;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.context.ApplicationContext;
 import org.springframework.data.domain.Page;
@@ -135,6 +136,10 @@ public class AssetService {
 
     public void consignment(Long id, BigDecimal price) {
         Asset asset = assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+        User owner = userRepo.findById(asset.getUserId()).orElseThrow(new BusinessException("用户不存在"));
+        if (StringUtils.isBlank(owner.getSettleAccountId())) {
+            throw new BusinessException("请先绑定银行卡");
+        }
         if (asset.isConsignment()) {
             throw new BusinessException("已寄售,请勿重新操作");
         }
@@ -144,7 +149,6 @@ public class AssetService {
         if (asset.isPublicShow()) {
             cancelPublic(asset);
         }
-        User owner = userRepo.findById(asset.getUserId()).orElseThrow(new BusinessException("用户不存在"));
         Collection collection = Collection.builder()
                 .name(asset.getName())
                 .pic(asset.getPic())

+ 46 - 8
src/main/java/com/izouma/nineth/service/GiftOrderService.java

@@ -10,6 +10,9 @@ import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
 import com.github.binarywang.wxpay.constant.WxPayConstants;
 import com.github.binarywang.wxpay.exception.WxPayException;
 import com.github.binarywang.wxpay.service.WxPayService;
+import com.huifu.adapay.core.exception.BaseAdaPayException;
+import com.huifu.adapay.model.Payment;
+import com.izouma.nineth.config.AdapayProperties;
 import com.izouma.nineth.config.AlipayProperties;
 import com.izouma.nineth.config.WxPayProperties;
 import com.izouma.nineth.domain.Asset;
@@ -19,12 +22,14 @@ import com.izouma.nineth.enums.AssetStatus;
 import com.izouma.nineth.enums.OrderStatus;
 import com.izouma.nineth.enums.PayMethod;
 import com.izouma.nineth.exception.BusinessException;
-import com.izouma.nineth.repo.*;
+import com.izouma.nineth.repo.AssetRepo;
+import com.izouma.nineth.repo.GiftOrderRepo;
+import com.izouma.nineth.repo.UserRepo;
 import com.izouma.nineth.utils.SnowflakeIdWorker;
 import lombok.AllArgsConstructor;
 import org.apache.commons.codec.EncoderException;
 import org.apache.commons.codec.net.URLCodec;
-import org.springframework.context.ApplicationContext;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.core.env.Environment;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
@@ -32,9 +37,13 @@ import org.springframework.ui.Model;
 
 import javax.transaction.Transactional;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 @Service
 @AllArgsConstructor
@@ -42,20 +51,15 @@ public class GiftOrderService {
 
     private AssetRepo          assetRepo;
     private UserRepo           userRepo;
-    private NFTService         nftService;
-    private CollectionRepo     collectionRepo;
-    private ApplicationContext applicationContext;
-    private OrderRepo          orderRepo;
     private SysConfigService   sysConfigService;
     private GiftOrderRepo      giftOrderRepo;
-    private TokenHistoryRepo   tokenHistoryRepo;
     private AlipayProperties   alipayProperties;
     private AlipayClient       alipayClient;
     private WxPayProperties    wxPayProperties;
     private WxPayService       wxPayService;
     private Environment        env;
-    private AssetMintService   assetMintService;
     private AssetService       assetService;
+    private AdapayProperties   adapayProperties;
 
     @Transactional
     public GiftOrder gift(Long userId, Long assetId, Long toUserId) {
@@ -173,6 +177,40 @@ public class GiftOrderService {
         throw new BusinessException("不支持此付款方式");
     }
 
+    public Object payAdapay(Long id, String payChannel, String openId) throws BaseAdaPayException {
+        GiftOrder order = giftOrderRepo.findById(id).orElseThrow(new BusinessException("订单不存在"));
+        if (order.getStatus() != OrderStatus.NOT_PAID) {
+            throw new BusinessException("订单状态错误");
+        }
+
+        Map<String, Object> paymentParams = new HashMap<>();
+        paymentParams.put("order_no", String.valueOf(new SnowflakeIdWorker(0, 0).nextId()));
+        paymentParams.put("pay_amt", order.getGasPrice().setScale(2, RoundingMode.HALF_UP).toPlainString());
+        paymentParams.put("app_id", adapayProperties.getAppId());
+        paymentParams.put("pay_channel", payChannel);
+        paymentParams.put("goods_title", "转赠GAS费");
+        paymentParams.put("time_expire", DateTimeFormatter.ofPattern("yyyyMMddHHmmss")
+                .format(LocalDateTime.now().plusMinutes(5)));
+        paymentParams.put("notify_url", adapayProperties.getNotifyUrl() + "/giftOrder/" + order.getId());
+
+
+        if ("wx_pub".equals(payChannel) || "wx_lite".equals(payChannel)) {
+            if (StringUtils.isBlank(openId)) {
+                throw new BusinessException("缺少openId");
+            }
+            Map<String, Object> expend = new HashMap<>();
+            expend.put("open_id", openId);
+            expend.put("limit_pay", "1");
+            if ("wx_lite".equals(payChannel)) {
+                expend.put("wx_app_id", adapayProperties.getWxAppId());
+            }
+            paymentParams.put("expend", expend);
+        }
+
+        Map<String, Object> response = Payment.create(paymentParams);
+        return response;
+    }
+
     @Scheduled(fixedRate = 60000)
     public void batchCancel() {
         List<GiftOrder> orders = giftOrderRepo.findByStatusAndCreatedAtBeforeAndDelFalse(OrderStatus.NOT_PAID,

+ 87 - 3
src/main/java/com/izouma/nineth/service/OrderService.java

@@ -2,6 +2,7 @@ package com.izouma.nineth.service;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
 import com.alipay.api.AlipayClient;
 import com.alipay.api.request.AlipayTradeWapPayRequest;
 import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
@@ -11,8 +12,12 @@ import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
 import com.github.binarywang.wxpay.constant.WxPayConstants;
 import com.github.binarywang.wxpay.exception.WxPayException;
 import com.github.binarywang.wxpay.service.WxPayService;
+import com.huifu.adapay.core.exception.BaseAdaPayException;
+import com.huifu.adapay.model.Payment;
+import com.izouma.nineth.config.AdapayProperties;
 import com.izouma.nineth.config.AlipayProperties;
 import com.izouma.nineth.config.WxPayProperties;
+import com.izouma.nineth.domain.Collection;
 import com.izouma.nineth.domain.*;
 import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.enums.*;
@@ -26,6 +31,7 @@ import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.EncoderException;
 import org.apache.commons.codec.net.URLCodec;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.context.event.EventListener;
 import org.springframework.core.env.Environment;
 import org.springframework.data.domain.Page;
@@ -38,9 +44,8 @@ import javax.transaction.Transactional;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.time.LocalDateTime;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Optional;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Service
@@ -65,6 +70,7 @@ public class OrderService {
     private CollectionService             collectionService;
     private RedisTemplate<String, Object> redisTemplate;
     private CommissionRecordRepo          commissionRecordRepo;
+    private AdapayProperties              adapayProperties;
 
     public Page<Order> all(PageQuery pageQuery) {
         return orderRepo.findAll(JpaUtils.toSpecification(pageQuery, Order.class), JpaUtils.toPageRequest(pageQuery));
@@ -238,6 +244,84 @@ public class OrderService {
 
     }
 
+    public Object payAdapay(Long id, String payChannel, String openId) throws BaseAdaPayException {
+        Order order = orderRepo.findByIdAndDelFalse(id).orElseThrow(new BusinessException("订单不存在"));
+        Collection collection = collectionRepo.findById(order.getCollectionId())
+                .orElseThrow(new BusinessException("藏品不存在"));
+        User invitor = userRepo.findById(order.getInvitor()).orElse(null);
+        if (order.getStatus() != OrderStatus.NOT_PAID) {
+            throw new BusinessException("订单状态错误");
+        }
+
+        Map<String, Object> paymentParams = new HashMap<>();
+        paymentParams.put("order_no", String.valueOf(new SnowflakeIdWorker(0, 0).nextId()));
+        paymentParams.put("pay_amt", order.getTotalPrice().setScale(2, RoundingMode.HALF_UP).toPlainString());
+        paymentParams.put("app_id", adapayProperties.getAppId());
+        paymentParams.put("pay_channel", payChannel);
+        paymentParams.put("goods_title", collection.getName());
+        paymentParams.put("time_expire", DateTimeFormatter.ofPattern("yyyyMMddHHmmss")
+                .format(LocalDateTime.now().plusMinutes(5)));
+        paymentParams.put("notify_url", adapayProperties.getNotifyUrl() + "/order/" + order.getId());
+
+        List<Map<String, Object>> divMembers = new ArrayList<>();
+        BigDecimal restAmount = order.getTotalPrice().setScale(2, RoundingMode.HALF_UP);
+
+        if (collection.getSource().equals(CollectionSource.TRANSFER)) {
+            Asset asset = assetRepo.findById(collection.getAssetId()).orElseThrow(new BusinessException("无记录"));
+            User owner = userRepo.findById(asset.getUserId()).orElseThrow(new BusinessException("拥有者用户不存在"));
+
+            restAmount = divMoney(order.getTotalPrice(), restAmount, divMembers, "0",
+                    collection.getServiceCharge() + collection.getRoyalties(), true);
+            restAmount = divMoney(order.getTotalPrice(), restAmount, divMembers, owner.getMemberId(),
+                    -1, false);
+        } else {
+            if (invitor != null) {
+                restAmount = divMoney(order.getTotalPrice(), restAmount, divMembers, invitor.getMemberId(),
+                        invitor.getShareRatio().intValue(), false);
+            }
+            restAmount = divMoney(order.getTotalPrice(), restAmount, divMembers, "0",
+                    -1, true);
+        }
+        paymentParams.put("div_members", JSON.toJSONString(divMembers));
+        if (restAmount.compareTo(BigDecimal.ZERO) != 0) {
+            log.error("分账出错 {}", JSON.toJSONString(divMembers, SerializerFeature.PrettyFormat));
+            throw new BusinessException("分账出错");
+        }
+
+        if ("wx_pub".equals(payChannel) || "wx_lite".equals(payChannel)) {
+            if (StringUtils.isBlank(openId)) {
+                throw new BusinessException("缺少openId");
+            }
+            Map<String, Object> expend = new HashMap<>();
+            expend.put("open_id", openId);
+            expend.put("limit_pay", "1");
+            if ("wx_lite".equals(payChannel)) {
+                expend.put("wx_app_id", adapayProperties.getWxAppId());
+            }
+            paymentParams.put("expend", expend);
+        }
+
+        Map<String, Object> response = Payment.create(paymentParams);
+        return response;
+    }
+
+    public static BigDecimal divMoney(BigDecimal totalAmount, BigDecimal restAmount, List<Map<String, Object>> divMembers,
+                                String memberId, int ratio, boolean feeFlag) {
+        if (ratio == -1 || (ratio > 0 && ratio < 100)) {
+            BigDecimal divAmount = ratio == -1 ? restAmount :
+                    totalAmount.multiply(BigDecimal.valueOf(ratio))
+                            .divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP);
+            Map<String, Object> divMem = new HashMap<>();
+            divMem.put("member_id", memberId);
+            divMem.put("amount", divAmount.toPlainString());
+            divMem.put("fee_flag", feeFlag ? "Y" : "N");
+            divMembers.add(divMem);
+            return restAmount.subtract(divAmount);
+        } else {
+            throw new BusinessException("分账比例错误");
+        }
+    }
+
     @Transactional
     public void notifyOrder(Long orderId, PayMethod payMethod, String transactionId) {
         Order order = orderRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));

+ 5 - 6
src/main/java/com/izouma/nineth/service/UserService.java

@@ -410,18 +410,17 @@ public class UserService {
         IdentityAuth identityAuth = identityAuthRepo.findFirstByUserIdAndStatusAndDelFalseOrderByCreatedAtDesc(userId, AuthStatus.SUCCESS)
                 .orElseThrow(new BusinessException("用户未认证"));
         if (identityAuth.isOrg()) {
-            throw new BusinessException("请绑定对公账户");
+            //throw new BusinessException("企业认证用户请绑定对公账户");
         }
         if (StringUtils.isEmpty(user.getMemberId())) {
-            user.setMemberId(adapayService.createMember(userId, user.getPhone(), identityAuth.getRealName(), identityAuth.getIdNo()));
+            user.setMemberId(adapayService.createMember(userId, user.getPhone(), identityAuth.getRealName(),
+                    identityAuth.getIdNo()));
             userRepo.save(user);
         }
         smsService.verify(phone, code);
-        String accountId = adapayService.createSettleAccount(user.getMemberId(), identityAuth.getRealName(), identityAuth.getIdNo(),
-                phone, bankNo);
-
+        String accountId = adapayService.createSettleAccount(user.getMemberId(), identityAuth.getRealName(),
+                identityAuth.getIdNo(), phone, bankNo);
         user.setSettleAccountId(accountId);
         userRepo.save(user);
     }
-
 }

+ 43 - 4
src/main/java/com/izouma/nineth/web/OrderNotifyController.java

@@ -8,6 +8,8 @@ import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse;
 import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
 import com.github.binarywang.wxpay.exception.WxPayException;
 import com.github.binarywang.wxpay.service.WxPayService;
+import com.huifu.adapay.core.AdapayCore;
+import com.huifu.adapay.core.util.AdapaySign;
 import com.izouma.nineth.config.AlipayProperties;
 import com.izouma.nineth.enums.PayMethod;
 import com.izouma.nineth.service.AssetService;
@@ -17,10 +19,7 @@ import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections.MapUtils;
 import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.HashMap;
@@ -107,4 +106,44 @@ public class OrderNotifyController {
         }
         return WxPayNotifyResponse.success("OK");
     }
+
+    @PostMapping("/adapay/order/{orderId}")
+    @ResponseBody
+    public void adapayNotify(@PathVariable Long orderId, HttpServletRequest request) {
+        log.info("adapay notify: \n{}", JSON.toJSONString(request.getParameterMap(), PrettyFormat));
+        try {
+            String data = request.getParameter("data");
+            String sign = request.getParameter("sign");
+            boolean checkSign = AdapaySign.verifySign(data, sign, AdapayCore.PUBLIC_KEY);
+            log.info("checkSign {}", checkSign);
+            if (checkSign) {
+                JSONObject jsonObject = JSON.parseObject(data);
+                String channel = jsonObject.getString("pay_channel");
+                String id = jsonObject.getString("id");
+                orderService.notifyOrder(orderId, channel.startsWith("wx") ? PayMethod.WEIXIN : PayMethod.ALIPAY, id);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @PostMapping("/adapay/giftOrder/{orderId}")
+    @ResponseBody
+    public void adapayGiftNotify(@PathVariable Long orderId, HttpServletRequest request) {
+        log.info("adapay gift notify: \n{}", JSON.toJSONString(request.getParameterMap(), PrettyFormat));
+        try {
+            String data = request.getParameter("data");
+            String sign = request.getParameter("sign");
+            boolean checkSign = AdapaySign.verifySign(data, sign, AdapayCore.PUBLIC_KEY);
+            log.info("checkSign {}", checkSign);
+            if (checkSign) {
+                JSONObject jsonObject = JSON.parseObject(data);
+                String channel = jsonObject.getString("pay_channel");
+                String id = jsonObject.getString("id");
+                giftOrderService.giftNotify(orderId, channel.startsWith("wx") ? PayMethod.WEIXIN : PayMethod.ALIPAY, id);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
 }

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

@@ -1,5 +1,6 @@
 package com.izouma.nineth.web;
 
+import com.huifu.adapay.core.exception.BaseAdaPayException;
 import com.izouma.nineth.domain.User;
 import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.dto.UserBankCard;
@@ -214,6 +215,11 @@ public class UserController extends BaseController {
     public List<UserBankCard> myBankCard() {
         return userBankCardRepo.findByUserId(SecurityUtils.getAuthenticatedUser().getId());
     }
+
+    @PostMapping("/addBankCard")
+    public void addBankCard(@RequestParam String bankNo, @RequestParam String phone, @RequestParam String code) throws BaseAdaPayException {
+        userService.addBankCard(SecurityUtils.getAuthenticatedUser().getId(), bankNo, phone, code);
+    }
 }
 
 

BIN
src/main/nine-space/public/images/img_0.png


BIN
src/main/nine-space/public/images/img_1.png


BIN
src/main/nine-space/src/assets/01.png


BIN
src/main/nine-space/src/assets/02.png


BIN
src/main/nine-space/src/assets/creatorBg.png


+ 21 - 0
src/main/nine-space/src/components/ImgContent.vue

@@ -0,0 +1,21 @@
+<template>
+    <van-image :src="src" :fit="fit">
+        <template v-slot:loading>
+            <loading></loading>
+        </template>
+    </van-image>
+</template>
+
+<script>
+import { Image } from 'vant';
+import Loading from './Loading.vue';
+export default {
+    props: ['src', 'fit'],
+    components: {
+        'van-image': Image,
+        Loading
+    }
+};
+</script>
+
+<style lang="less" scoped></style>

+ 69 - 231
src/main/nine-space/src/components/Loading.vue

@@ -1,243 +1,81 @@
 <template>
-    <div class="loader">
-        <!-- <span class="text">Loading</span> -->
-        <span class="spinner"></span>
+    <div class="loading-content">
+        <div class="loading">
+            <img class="img1" src="../assets/01.png" alt="" />
+            <img class="img2" src="../assets/02.png" alt="" />
+        </div>
     </div>
 </template>
 
-<style lang="less" scoped>
-.loader {
-    position: absolute;
-    top: 50%;
-    left: 50%;
-    -webkit-transform: translate(-50%, -50%);
-    -moz-transform: translate(-50%, -50%);
-    -mos-transform: translate(-50%, -50%);
-    -o-transform: translate(-50%, -50%);
-    transform: translate(-50%, -50%);
-    text-align: center;
-    /* disable selection and cursor changes */
-    -webkit-touch-callout: none;
-    -webkit-user-select: none;
-    -khtml-user-select: none;
-    -moz-user-select: none;
-    -ms-user-select: none;
-    user-select: none;
-    cursor: default;
-}
+<script>
+export default {};
+</script>
 
-/* Text align it the center of screen and connect the looped animation for 2.5 seconds */
-.loader .text {
-    position: absolute;
-    top: 18px;
-    left: 4px;
-    z-index: 5;
-    font-size: 20px;
-    text-transform: uppercase;
-    -webkit-animation: text 2.5s cubic-bezier(0.75, 0, 0.5, 1) infinite normal;
-    -moz-animation: text 2.5s cubic-bezier(0.75, 0, 0.5, 1) infinite normal;
-    -ms-animation: text 2.5s cubic-bezier(0.75, 0, 0.5, 1) infinite normal;
-    -o-animation: text 2.5s cubic-bezier(0.75, 0, 0.5, 1) infinite normal;
-    animation: text 2.5s cubic-bezier(0.75, 0, 0.5, 1) infinite normal;
-}
-
-/* Create a container for animation*/
-.spinner {
-    position: relative;
-    width: 50px;
-    height: 50px;
-    color: #fff;
-}
-
-.spinner:before,
-.spinner:after {
-    content: '';
+<style lang="less" scoped>
+.loading-content {
+    display: flex;
+    justify-content: center;
+    width: 100%;
     position: relative;
-    display: block;
-}
-
-/* Create cube and set animation*/
-.spinner:before {
-    -webkit-animation: spinner 2.5s cubic-bezier(0.75, 0, 0.5, 1) infinite normal;
-    -moz-animation: spinner 2.5s cubic-bezier(0.75, 0, 0.5, 1) infinite normal;
-    -ms-animation: spinner 2.5s cubic-bezier(0.75, 0, 0.5, 1) infinite normal;
-    -o-animation: spinner 2.5s cubic-bezier(0.75, 0, 0.5, 1) infinite normal;
-    animation: spinner 2.5s cubic-bezier(0.75, 0, 0.5, 1) infinite normal;
-    width: 50px;
-    height: 50px;
-    background-color: #ffb178;
 }
 
-/* Create shadow and set animation*/
-.spinner:after {
-    -webkit-animation: shadow 2.5s cubic-bezier(0.75, 0, 0.5, 1) infinite normal;
-    -moz-animation: shadow 2.5s cubic-bezier(0.75, 0, 0.5, 1) infinite normal;
-    -ms-animation: shadow 2.5s cubic-bezier(0.75, 0, 0.5, 1) infinite normal;
-    -o-animation: shadow 2.5s cubic-bezier(0.75, 0, 0.5, 1) infinite normal;
-    animation: shadow 2.5s cubic-bezier(0.75, 0, 0.5, 1) infinite normal;
+.loading {
     position: relative;
-    bottom: -17.5px;
-    height: 2.5px;
-    border-radius: 50%;
-    background-color: #322b27;
-}
-
-/* Animation keys */
-/* from cube to circle */
-@-webkit-keyframes spinner {
-    50% {
-        -webkit-border-radius: 50%;
-        -webkit-transform: scale(0.5) rotate(360deg);
-        background-color: #fffecb;
-    }
-    100% {
-        -webkit-transform: scale(1) rotate(720deg);
-        background-color: #ffb178;
-    }
-}
-
-@-moz-keyframes spinner {
-    50% {
-        -moz-border-radius: 50%;
-        -moz-transform: scale(0.5) rotate(360deg);
-        background-color: #fffecb;
-    }
-    100% {
-        -moz-transform: scale(1) rotate(720deg);
-        background-color: #ffb178;
-    }
-}
-
-@-mos-keyframes spinner {
-    50% {
-        -mos-border-radius: 50%;
-        -mos-transform: scale(0.5) rotate(360deg);
-        background-color: #fffecb;
-    }
-    100% {
-        -mos-transform: scale(1) rotate(720deg);
-        background-color: #ffb178;
-    }
-}
-
-@-o-keyframes spinner {
-    50% {
-        -o-border-radius: 50%;
-        -o-transform: scale(0.5) rotate(360deg);
-        background-color: #fffecb;
-    }
-    100% {
-        -o-transform: scale(1) rotate(720deg);
-        background-color: #ffb178;
-    }
-}
-
-@keyframes spinner {
-    50% {
-        border-radius: 50%;
-        transform: scale(0.5) rotate(360deg);
-        background-color: #fffecb;
-    }
-    100% {
-        transform: scale(1) rotate(720deg);
-        background-color: #ffb178;
-    }
-}
-
-/* animation shadow */
-@-webkit-keyframes shadow {
-    50% {
-        -webkit-transform: scale(0.5);
-        background-color: #322b27;
-    }
-}
-
-@-moz-keyframes shadow {
-    50% {
-        -moz-transform: scale(0.5);
-        background-color: #322b27;
-    }
-}
-
-@-mos-keyframes shadow {
-    50% {
-        -mos-transform: scale(0.5);
-        background-color: #322b27;
-    }
-}
-
-@-o-keyframes shadow {
-    50% {
-        -o-transform: scale(0.5);
-        background-color: #322b27;
-    }
-}
-
-@keyframes shadow {
-    50% {
-        transform: scale(0.5);
-        background-color: #322b27;
-    }
-}
-
-/* animation text */
-@-webkit-keyframes text {
-    0% {
-        -webkit-transform: scale(1, 1);
-    }
-    50% {
-        -webkit-transform: scale(0.5, 0.5);
-    }
-    100% {
-        -webkit-transform: scale(1, 1);
-    }
-}
-
-@-moz-keyframes text {
-    0% {
-        -moz-transform: scale(1, 1);
-    }
-    50% {
-        -moz-transform: scale(0.5, 0.5);
-    }
-    100% {
-        -moz-transform: scale(1, 1);
-    }
-}
-
-@-mos-keyframes text {
-    0% {
-        -mos-transform: scale(1, 1);
-    }
-    50% {
-        -mos-transform: scale(0.5, 0.5);
-    }
-    100% {
-        -mos-transform: scale(1, 1);
-    }
-}
-
-@-o-keyframes text {
-    0% {
-        -o-transform: scale(1, 1);
-    }
-    50% {
-        -o-transform: scale(0.5, 0.5);
-    }
-    100% {
-        -o-transform: scale(1, 1);
-    }
-}
-
-@keyframes text {
-    0% {
-        transform: scale(1, 1);
-    }
-    50% {
-        transform: scale(0.5, 0.5);
-    }
-    100% {
-        transform: scale(1, 1);
+    overflow: hidden;
+    box-sizing: border-box;
+    border-width: 0;
+    width: 60%;
+    .img1 {
+        position: absolute;
+        left: -1px;
+        top: -1px;
+        right: -1px;
+        bottom: -1px;
+        z-index: 2;
+        display: block;
+        width: calc(100% + 4px);
+        height: calc(100% + 4px);
+    }
+
+    .img2 {
+        position: relative;
+        z-index: 0;
+        display: block;
+        width: 100%;
+        height: auto;
+    }
+
+    @keyframes flipYLight {
+        0% {
+            left: -40%;
+            opacity: 0.5;
+            width: 10px;
+        }
+        50% {
+            left: 20%;
+            opacity: 0;
+            width: 35px;
+        }
+        100% {
+            left: 90%;
+            opacity: 0.5;
+            width: 10px;
+        }
+    }
+
+    &::after {
+        content: '';
+        background-color: #fff;
+        position: absolute;
+        background: #fff;
+        width: 25px;
+        height: 100vw;
+        top: 0;
+        left: 45px;
+        opacity: 1;
+        transform: skewX(-25deg);
+        z-index: 1;
+        animation: flipYLight 1.5s linear infinite;
     }
 }
 </style>

+ 8 - 1
src/main/nine-space/src/components/product/ProductBanner.vue

@@ -22,7 +22,7 @@
                         :src="getImg(item.url, '', 1200)"
                         width="calc(100vw - 134px)"
                         height="calc(100vw - 134px)"
-                        fit="scale-down"
+                        fit="cover"
                     />
                 </swiper-slide>
             </swiper>
@@ -141,6 +141,7 @@ export default {
     .mySwiper {
         border-radius: @radius;
         border: 2px solid #ffffff;
+        padding: 5px;
         .detail-animate();
         .swiper-slide {
             display: flex;
@@ -156,6 +157,12 @@ export default {
     }
 }
 
+.swiper-video {
+    width: calc(100vw - 134px);
+    height: calc(100vw - 134px);
+    display: block;
+}
+
 .share-content {
     display: flex;
     margin-top: 20px;

+ 6 - 37
src/main/nine-space/src/components/product/productSmall.vue

@@ -1,30 +1,22 @@
 <template>
-    <router-link
-        :to="{
-            path: '/productDetail',
-            query: {
-                id: info.id
-            }
-        }"
-        class="product"
-    >
-        <van-image width="100%" height="140px" :radius="30" :src="getImg(changeImgs(info.pic))" fit="cover" />
+    <div class="product" @click="goNext(info)">
+        <van-image width="100%" height="140px" :radius="30" :src="getImg(info.pic)" fit="cover" />
 
         <div class="content">
             <div class="name van-ellipsis">
                 {{ info.name }}
             </div>
             <div class="text van-ellipsis">
-                {{ info.name }}
+                {{ info.remark }}
             </div>
         </div>
-    </router-link>
+    </div>
 </template>
 
 <script>
-import product from '../../mixins/product';
+import banner from '../../mixins/banner';
 export default {
-    mixins: [product],
+    mixins: [banner],
     props: {
         info: {
             type: Object,
@@ -32,29 +24,6 @@ export default {
                 return {};
             }
         }
-    },
-    methods: {
-        likeProduct() {
-            if (!this.info.liked) {
-                this.$http.get(`/collection/${this.info.id}/like`).then(() => {
-                    this.$emit('update:info', {
-                        ...this.info,
-                        liked: true,
-                        likes: this.info.likes + 1
-                    });
-                    this.$toast.success('收藏成功');
-                });
-            } else {
-                this.$http.get(`/collection/${this.info.id}/unlike`).then(() => {
-                    this.$emit('update:info', {
-                        ...this.info,
-                        liked: false,
-                        likes: this.info.likes - 1
-                    });
-                    this.$toast.success('取消收藏');
-                });
-            }
-        }
     }
 };
 </script>

+ 4 - 3
src/main/nine-space/src/main.js

@@ -17,10 +17,10 @@ import Driver from './components/Driver.vue';
 import common from './mixins/common';
 import VueClipboard from 'vue-clipboard2';
 import queryString from 'query-string';
-// import VConsole from 'vconsole';
-// const vConsole = new VConsole();
 store.commit('setFirstUrl', location.href);
 
+import ImgContent from './components/ImgContent.vue';
+
 http.http
     .get('/wx/jsapiSign', { url: location.href })
     .then(res => {
@@ -55,7 +55,7 @@ http.http
             });
         });
     })
-    .catch(e => {});
+    .catch(e => { });
 
 createApp(App)
     .use(Vant)
@@ -67,6 +67,7 @@ createApp(App)
     .component('page-title', PageTitle)
     .component('like-button', LikeButton)
     .component('driver', Driver)
+    .component('van-image', ImgContent)
     .use(store)
     .use(router)
     .mount('#app');

+ 2 - 2
src/main/nine-space/src/styles/app.less

@@ -30,7 +30,7 @@
     --van-uploader-upload-background-color: transparent;
     --van-uploader-file-background-color: transparent;
     --van-active-color: @bg3;
-    --van-image-placeholder-background-color: @bg3;
+    --van-image-placeholder-background-color: @bg2;
     --van-search-background-color: #181818;
     --van-search-content-background-color: #0f0f0f;
     // --van-picker-background-color: @bg;
@@ -169,4 +169,4 @@ input:-webkit-autofill {
             }
         }
     }
-}
+}

+ 162 - 1
src/main/nine-space/src/utils/data.json

@@ -1 +1,162 @@
-{"v":"5.5.8","fr":30,"ip":0,"op":75,"w":821,"h":444,"nm":"第九空间-加载","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":8,"nm":"第九空间-加载_[00000-00074].png","cl":"png","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[410.5,222,0],"ix":2},"a":{"a":0,"k":[410.5,222,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":75,"st":0,"bm":0}],"markers":[]}
+{
+  "v": "5.8.1",
+  "fr": 30,
+  "ip": 0,
+  "op": 75,
+  "w": 821,
+  "h": 444,
+  "nm": "第九空间-加载",
+  "ddd": 0,
+  "assets": [
+    {
+      "id": "image_0",
+      "w": 821,
+      "h": 444,
+      "u": "images/",
+      "p": "img_0.png",
+      "e": 0
+    },
+    {
+      "id": "image_1",
+      "w": 738,
+      "h": 269,
+      "u": "images/",
+      "p": "img_1.png",
+      "e": 0
+    },
+    {
+      "id": "comp_0",
+      "nm": "第九空间-加载 (1)",
+      "fr": 30,
+      "layers": [
+        {
+          "ddd": 0,
+          "ind": 1,
+          "ty": 2,
+          "nm": "圆角矩形 1",
+          "refId": "image_0",
+          "sr": 1,
+          "ks": {
+            "o": { "a": 0, "k": 100, "ix": 11 },
+            "r": { "a": 0, "k": 0, "ix": 10 },
+            "p": {
+              "a": 1,
+              "k": [
+                {
+                  "i": { "x": 0, "y": 1 },
+                  "o": { "x": 0.409, "y": 0 },
+                  "t": 0,
+                  "s": [155.5, 171, 0],
+                  "to": [3.79, 0, 0],
+                  "ti": [-124.71, 0, 0]
+                },
+                { "t": 74, "s": [988.5, 199, 0] }
+              ],
+              "ix": 2,
+              "l": 2
+            },
+            "a": { "a": 0, "k": [410.5, 222, 0], "ix": 1, "l": 2 },
+            "s": { "a": 0, "k": [100, 100, 100], "ix": 6, "l": 2 }
+          },
+          "ao": 0,
+          "hasMask": true,
+          "masksProperties": [
+            {
+              "inv": false,
+              "mode": "a",
+              "pt": {
+                "a": 0,
+                "k": {
+                  "i": [
+                    [-4.507, -3.192],
+                    [0, 0],
+                    [3.192, -4.507],
+                    [0, 0],
+                    [4.507, 3.192],
+                    [0, 0],
+                    [-3.192, 4.507],
+                    [0, 0]
+                  ],
+                  "o": [
+                    [0, 0],
+                    [4.507, 3.192],
+                    [0, 0],
+                    [-3.192, 4.507],
+                    [0, 0],
+                    [-4.507, -3.192],
+                    [0, 0],
+                    [3.192, -4.507]
+                  ],
+                  "v": [
+                    [316.435, 63.822],
+                    [380.086, 108.906],
+                    [382.466, 122.847],
+                    [81.901, 547.183],
+                    [67.961, 549.563],
+                    [4.31, 504.478],
+                    [1.93, 490.538],
+                    [302.495, 66.202]
+                  ],
+                  "c": true
+                },
+                "ix": 1
+              },
+              "o": { "a": 0, "k": 100, "ix": 3 },
+              "x": { "a": 0, "k": 0, "ix": 4 },
+              "nm": "蒙版 1"
+            }
+          ],
+          "ip": 0,
+          "op": 74,
+          "st": 0,
+          "bm": 0
+        },
+        {
+          "ddd": 0,
+          "ind": 2,
+          "ty": 2,
+          "nm": "图层 2",
+          "refId": "image_1",
+          "sr": 1,
+          "ks": {
+            "o": { "a": 0, "k": 100, "ix": 11 },
+            "r": { "a": 0, "k": 0, "ix": 10 },
+            "p": { "a": 0, "k": [404, 234.5, 0], "ix": 2, "l": 2 },
+            "a": { "a": 0, "k": [369, 134.5, 0], "ix": 1, "l": 2 },
+            "s": { "a": 0, "k": [100, 100, 100], "ix": 6, "l": 2 }
+          },
+          "ao": 0,
+          "ip": 0,
+          "op": 300,
+          "st": 0,
+          "bm": 0
+        }
+      ]
+    }
+  ],
+  "layers": [
+    {
+      "ddd": 0,
+      "ind": 4,
+      "ty": 0,
+      "nm": "图层 2",
+      "refId": "comp_0",
+      "sr": 1,
+      "ks": {
+        "o": { "a": 0, "k": 100, "ix": 11 },
+        "r": { "a": 0, "k": 0, "ix": 10 },
+        "p": { "a": 0, "k": [410.5, 222, 0], "ix": 2, "l": 2 },
+        "a": { "a": 0, "k": [410.5, 222, 0], "ix": 1, "l": 2 },
+        "s": { "a": 0, "k": [100, 100, 100], "ix": 6, "l": 2 }
+      },
+      "ao": 0,
+      "w": 821,
+      "h": 444,
+      "ip": 0,
+      "op": 300,
+      "st": 0,
+      "bm": 0
+    }
+  ],
+  "markers": []
+}

+ 3 - 9
src/main/nine-space/src/views/Home.vue

@@ -63,15 +63,9 @@ export default {
                 message: '加载中...',
                 forbidClick: true
             });
-            Promise.all([
-                this.getProduct().then(res => {
-                    this.banners = res;
-                }),
-                this.getProduct('LIST').then(res => {
-                    this.products = res;
-                })
-            ]).then(() => {
-                this.$toast.clear();
+            this.getBanner();
+            this.getProduct('LIST').then(res => {
+                this.products = res;
             });
         },
         getProduct(type = 'BANNER') {

+ 8 - 5
src/main/nine-space/src/views/Mine.vue

@@ -1,7 +1,14 @@
 <template>
     <div class="mine">
         <div class="userInfo" v-if="isLogin">
-            <van-image width="100%" height="35vw" :src="userInfo.bg" loading-icon="" fit="cover" class="top-img" />
+            <van-image
+                width="100%"
+                height="35vw"
+                :src="userInfo.bg || require('../assets/creatorBg.png')"
+                loading-icon=""
+                fit="cover"
+                class="top-img"
+            />
             <div class="userInfo-content">
                 <div class="userInfo-top">
                     <van-image
@@ -332,10 +339,6 @@ export default {
         top: 0;
         left: 0;
         z-index: 1;
-        /deep/.van-image__loading {
-            background: linear-gradient(131deg, #fffbb2 0%, #ffd5b7 100%);
-            filter: blur(0px);
-        }
     }
 }
 .userInfo-content {

+ 9 - 2
src/main/nine-space/src/views/creator/Detail.vue

@@ -1,7 +1,14 @@
 <template>
     <div class="mine">
         <div class="userInfo">
-            <van-image width="100%" height="35vw" loading-icon="" :src="info.bg" fit="cover" class="top-img" />
+            <van-image
+                width="100%"
+                height="35vw"
+                loading-icon=""
+                :src="info.bg || require('../../assets/creatorBg.png')"
+                fit="cover"
+                class="top-img"
+            />
             <div class="userInfo-content">
                 <div class="userInfo-top">
                     <van-image
@@ -237,7 +244,7 @@ export default {
         z-index: 1;
 
         /deep/.van-image__loading {
-            background: linear-gradient(131deg, #fffbb2 0%, #ffd5b7 100%);
+            // background: linear-gradient(131deg, #fffbb2 0%, #ffd5b7 100%);
             filter: blur(0px);
         }
     }

+ 23 - 16
src/main/nine-space/src/views/product/Detail.vue

@@ -13,14 +13,14 @@
 
             <div class="price-line" v-if="info.salable">
                 <div class="text" v-if="info.number">编号 {{ info.number }}</div>
-                <div class="text" v-if="info.salable && info.stock > 0">
-                    <span>已售 {{ info.sale }}</span>
-                    <span>剩余 {{ info.stock }}</span>
-                </div>
                 <div class="text total" v-if="info.total > 1">
                     <span>限量</span>
                     <span>{{ info.total }}份</span>
                 </div>
+                <div class="text" v-if="info.salable && info.stock > 0">
+                    <span>已售 {{ info.sale }}</span>
+                    <span>剩余 {{ info.stock }}</span>
+                </div>
             </div>
             <!-- <div class="title">{{ info.name }}</div> -->
             <div class="info-bottom">
@@ -252,6 +252,9 @@ import 'swiper/swiper-bundle.min.css';
 import SwiperCore, { Pagination } from 'swiper';
 
 SwiperCore.use([Pagination]);
+
+let inWeixin = /micromessenger/i.test(navigator.userAgent);
+
 export default {
     components: {
         HashCode,
@@ -271,7 +274,8 @@ export default {
             init: [],
             init2: null,
             list: [],
-            activeNames: ['1', '2', '3', '4', '5', '6', 'hashCode', '8']
+            activeNames: ['1', '2', '3', '4', '5', '6', 'hashCode', '8'],
+            inWeixin
         };
     },
     computed: {
@@ -329,17 +333,20 @@ export default {
                 .then(res => {
                     console.log(res);
                     this.info = res;
-                    wx.updateAppMessageShareData({
-                        title: '第九空间-' + res.name,
-                        desc: '全球首个基于区块链的游戏资产集换中心',
-                        link: location.origin + '/9th/productDetail?id=' + res.id,
-                        imgUrl: this.getImg(this.changeImgs(this.banners), '', 600)
-                    });
-                    wx.updateTimelineShareData({
-                        title: '第九空间-' + res.name,
-                        link: location.origin + '/9th/productDetail?id=' + res.id,
-                        imgUrl: this.getImg(this.changeImgs(this.banners), '', 600)
-                    });
+                    if (this.inWeixin) {
+                        wx.updateAppMessageShareData({
+                            title: '第九空间-' + res.name,
+                            desc: '全球首个基于区块链的游戏资产集换中心',
+                            link: location.origin + '/9th/productDetail?id=' + res.id,
+                            imgUrl: this.getImg(this.changeImgs(this.banners), '', 300)
+                        });
+                        wx.updateTimelineShareData({
+                            title: '第九空间-' + res.name,
+                            link: location.origin + '/9th/productDetail?id=' + res.id,
+                            imgUrl: this.getImg(this.changeImgs(this.banners), '', 300)
+                        });
+                        console.log(wx);
+                    }
                     if (res.assetId) {
                         this.$http.get('/asset/get/' + res.assetId).then(res => {
                             console.log(res);

+ 0 - 3
src/main/nine-space/src/views/user/Point.vue

@@ -41,7 +41,6 @@
                 </div>
                 <div class="text3">-320</div>
             </div> -->
-            <lottie :options="defaultOptions" :height="50" :width="400" v-on:animCreated="handleAnimation" />
             <van-empty :image="require('../../assets/kong_png_yongyoude  (1).png')" description="暂时没有任何记录哦~" />
         </div>
     </div>
@@ -49,10 +48,8 @@
 
 <script>
 import { ref } from 'vue';
-import Lottie from 'vue-lottie';
 const animationData = require('../../utils/data.json');
 export default {
-    components: { Lottie },
     setup() {
         const showPopover = ref(false);
 

+ 4 - 1
src/main/resources/application.yaml

@@ -140,6 +140,8 @@ adapay:
   public-key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApyGiKxT+ffKnH/7Nxal8TE461QHr539cOQgDHSanERb9Fr3SxJjUccagGEi5f4kPAMlOMqlcJMGKr5/2hDQYNIkOYeam6MW/E+sZq2S3LZPe04iLglMG3e0OTQRyV8x5WinNadSgb0wiQzMPPrdCYd7AZAb7u5dCj5YhEB7TywQ5Cr8tzQUA+gTMuO5D3q7I0lB+dxwbzaXI3D2RqVF/05i90jZEvfEZKHmxcbqKyuVHWs2Decb2q433GM4koSI1N1iGSW+dgxlMWFk5OrySmayYcOwIViBEKR+6icb5pfwfETEOILh3bad6I8cJBw7WXT1Pa2PIuhB8G2uKjmIKGwIDAQAB
   priv-key: MIIEuwIBADANBgkqhkiG9w0BAQEFAASCBKUwggShAgEAAoIBAQCnIaIrFP598qcf/s3FqXxMTjrVAevnf1w5CAMdJqcRFv0WvdLEmNRxxqAYSLl/iQ8AyU4yqVwkwYqvn/aENBg0iQ5h5qboxb8T6xmrZLctk97TiIuCUwbd7Q5NBHJXzHlaKc1p1KBvTCJDMw8+t0Jh3sBkBvu7l0KPliEQHtPLBDkKvy3NBQD6BMy47kPersjSUH53HBvNpcjcPZGpUX/TmL3SNkS98RkoebFxuorK5UdazYN5xvarjfcYziShIjU3WIZJb52DGUxYWTk6vJKZrJhw7AhWIEQpH7qJxvml/B8RMQ4guHdtp3ojxwkHDtZdPU9rY8i6EHwba4qOYgobAgMBAAECggEAT36L5/oAYl+8ZleIAHBxEspS6WYUkvPdJbNN59uus04/60U2rxQSWFulYmeU87h5TmJxs18i2MjF8msfkhpFORfHo4FV+nm0PQEiIIezKRagcfUMhlx/c6eBmdh3mpNDVUN01NWxyb5ovZXXtnjsNikBUZKQwdVcb3d1GnnPO0xtt6/0xwiduCkA2ihS1tgnsYYDhMHgukIdZ3eczn3stRPQ+QyCt1JWS6DDd1nS3S2RyPZw8P9Z1zzJFVKH8z3bGqk3/98Lw7Hw+rKFnKhIA6/H9ZVORKw5OuGC3Ozy6cVbmUn8tuw3sC0NdR7w56dedB+fjJB8od0nahX1Cc6eQQKBgQDckcenslWqjs2PbncwW1wqlw7FdJX9rzJAg7kp9ItpHCoNi/kSgXeLphHXWJmyj7a1BkWynmTGxO48X3dPXUrDPFKJc42fSbxMgAQdtc/A2z+v7Ga/oUpH8jajKfKmcgeRX026R7gd9W0yi0EW+C0WdFhrzNKKY4shvnYy9lc+QwKBgQDB+mHSllqLqYru0bLrtKOKJXaR3N3INxDBZKnRqba4tUKN35IVIexiEMkHmC51jtjoRyA5Y+fc/8P11i9FbuShtRVGHWeyDibKlwff5zrETveSLTpSULBKZ6MsFSm0Fo1krSUC1QTUGG5VX/wwWm9AB2UKJqG5cMDd3i3RiPeDSQKBgBs1ED+rS83iF5Eduy4H1vKZ94R7wRSty7ERjoGSXK/2fWl2Xp7dwXVEYucBUtQnzg2+XFKQHzY1jH19+SWdCF/UzQmPa2S+n6+ACwHvL1VGtjBpJLN2nccKJZsyzW+imTRhYSEdP6TSZUnay4idzFH8v/tsJHxVkw/ygnn+0PwpAn8uOHsWsrzgioWQYmc/wss1H7ghCX/PNU/IxTOxwb7IRGiXZa5pWqv4sgc0yA5J9L+6mTgUdLnK7ybCbUbWRJY18fAfxOHwi26y10oJEA/wtuBG9H/xHUjkcc1vs5s8TiNi2d73zcpYv3mK3lQ5MVNQ7nIk+Q+QIE3UkBxa0UgpAoGBAMDwg0ebzBEZsV2cr/Er2b25LsXteDJ+V67plBNrv+A1/omA9a52sWek4bY0D+Uu6zPTDaLj9BhHC2wJmThYl0eLRKyDKYQslBR3h253Gsn3If6RH9/tSyDsQ88iAEI1f6QH27bGHL9VDrsLGEFg5E7ZEzFQuJPqoUvBOoURNwa6
   app-public-key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwN6xgd6Ad8v2hIIsQVnbt8a3JituR8o4Tc3B5WlcFR55bz4OMqrG/356Ur3cPbc2Fe8ArNd/0gZbC9q56Eb16JTkVNA/fye4SXznWxdyBPR7+guuJZHc/VW2fKH2lfZ2P3Tt0QkKZZoawYOGSMdIvO+WqK44updyax0ikK6JlNQIDAQAB
+  wx-app-id:
+  notify-url: https://nfttest.9space.vip/notify/adapay
 ---
 
 spring:
@@ -164,4 +166,5 @@ wx:
 alipay:
   notify-url: https://nft.9space.vip/notify/order/alipay
   return-url: https://nft.9space.vip/9th/home
-
+adapay:
+  notify-url: https://nft.9space.vip/notify/adapay

+ 0 - 25
src/test/java/com/izouma/nineth/AdapayTest.java

@@ -1,25 +0,0 @@
-package com.izouma.nineth;
-
-import com.alibaba.fastjson.JSON;
-import com.huifu.adapay.core.exception.BaseAdaPayException;
-import com.huifu.adapay.model.Payment;
-import org.junit.Test;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class AdapayTest extends ApplicationTests {
-    @Test
-    public void testPay() throws BaseAdaPayException {
-        Map<String, Object> paymentParams = new HashMap<String, Object>(10);
-        paymentParams.put("app_id", "app_f8760acc-f4d8-46f6-8f70-d80e36517075");
-        paymentParams.put("order_no", "jsdk_payment" + System.currentTimeMillis());
-        paymentParams.put("pay_channel", "alipay_qr");
-        paymentParams.put("pay_amt", "0.01");
-        paymentParams.put("goods_title", "your goods title");
-        paymentParams.put("goods_desc", "your goods desc");
-        paymentParams.put("div_members", "");
-        Map<String, Object> payment = Payment.create(paymentParams);
-        System.out.println("payment result=" + JSON.toJSONString(payment));
-    }
-}

+ 3 - 3
src/test/java/com/izouma/nineth/CommonTest.java

@@ -1,12 +1,10 @@
 package com.izouma.nineth;
 
-import com.alipay.mychain.sdk.utils.ByteUtils;
 import com.github.kevinsawicki.http.HttpRequest;
 import com.izouma.nineth.config.Constants;
 import com.izouma.nineth.domain.BaseEntity;
 import com.izouma.nineth.domain.BlindBoxItem;
 import com.izouma.nineth.domain.User;
-import com.izouma.nineth.utils.HashUtils;
 import com.izouma.nineth.web.BaseController;
 import io.ipfs.api.IPFS;
 import io.ipfs.api.MerkleNode;
@@ -52,6 +50,8 @@ import java.awt.image.BufferedImage;
 import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.Method;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Paths;
@@ -369,6 +369,6 @@ public class CommonTest {
 
     @Test
     public void sfsdf() {
-        System.out.println(ByteUtils.hexStringToBytes(HashUtils.Keccak256(UUID.randomUUID().toString())));
+        System.out.println(BigDecimal.valueOf(11111110.5).setScale(2, RoundingMode.HALF_UP).toPlainString());
     }
 }

+ 45 - 1
src/test/java/com/izouma/nineth/service/AdapayServiceTest.java

@@ -1,16 +1,55 @@
 package com.izouma.nineth.service;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.serializer.SerializerFeature;
 import com.huifu.adapay.core.exception.BaseAdaPayException;
+import com.huifu.adapay.model.Payment;
 import com.izouma.nineth.ApplicationTests;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import static org.junit.Assert.*;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 public class AdapayServiceTest extends ApplicationTests {
     @Autowired
     private AdapayService adapayService;
 
+    @Test
+    public void testPay() throws BaseAdaPayException {
+        Map<String, Object> paymentParams = new HashMap<String, Object>(10);
+        List<Map<String, Object>> divMembers = new ArrayList<>();
+        divMembers.add(new HashMap<>() {{
+            put("member_id", "0");
+            put("amount", BigDecimal.valueOf(0.05));
+            put("fee_flag", "Y");
+        }});
+        divMembers.add(new HashMap<>() {{
+            put("member_id", "1110");
+            put("amount", BigDecimal.valueOf(0.05));
+        }});
+
+        paymentParams.put("app_id", "app_f8760acc-f4d8-46f6-8f70-d80e36517075");
+        paymentParams.put("order_no", "jsdk_payment" + System.currentTimeMillis());
+        paymentParams.put("pay_channel", "alipay_qr");
+        paymentParams.put("pay_amt", "0.10");
+        paymentParams.put("goods_title", "your goods title");
+        paymentParams.put("goods_desc", "your goods desc");
+        paymentParams.put("div_members", JSON.toJSONString(divMembers));
+        paymentParams.put("notify_url", "http://9th.frp.izouma.com/notify/adapay/order/1");
+        paymentParams.put("description", "orderId=1");
+
+        Map<String, Object> expend = new HashMap<>();
+        expend.put("open_id", "oWJG55wLnwdVzXoKka1-DzQKOd_Y");
+        paymentParams.put("expend", expend);
+
+        Map<String, Object> payment = Payment.create(paymentParams);
+        System.out.println("payment result=" + JSON.toJSONString(payment, SerializerFeature.PrettyFormat));
+    }
+
     @Test
     public void createMember() throws BaseAdaPayException {
         adapayService.createMember(99999999999999L, "15077886171", "熊竹", "321002199408304614");
@@ -26,4 +65,9 @@ public class AdapayServiceTest extends ApplicationTests {
     public void delSettleAccount() throws BaseAdaPayException {
         adapayService.delSettleAccount("99999999999999", "0288070028826880");
     }
+
+    @Test
+    public void queryBalance() throws BaseAdaPayException {
+        adapayService.queryBalance("1110", "0288514678171392");
+    }
 }