Procházet zdrojové kódy

Merge branch 'master' of http://116.63.33.55/git/nazw

elis před 1 rokem
rodič
revize
cdc5894d69

+ 4 - 3
nngkxxdp/src/main/java/com/example/nngkxxdp/program/controller/QrCodeController.java

@@ -44,11 +44,13 @@ public class QrCodeController {
         String userId = Blank.isNotEmpty(token) ? MiniTokenUtil.getId(token).asString() : null;
         if (StrUtil.isEmpty(userId)) {
             response.setStatus(401);
+            return;
         }
         //根据二维码标记和用户id判断用户此次活动二维码是否已经核销
         QrcodeWriteoff qrcodeWriteoff = qrcodeWriteoffService.queryOneByQrcodeSignAndUserId(userId, qrcodeSign);
         if (qrcodeWriteoff != null && qrcodeWriteoff.getWriteoffStatus() == 2) {
             response.setStatus(400);
+            return;
         }
         if (qrcodeWriteoff == null) {
             qrcodeWriteoff = new QrcodeWriteoff();
@@ -63,7 +65,6 @@ public class QrCodeController {
                 BarcodeFormat.QR_CODE, 350, 350
         );
         MatrixToImageWriter.writeToStream(bitMatrix, "PNG", response.getOutputStream());
-        response.setStatus(200);
     }
 
     /**
@@ -79,12 +80,12 @@ public class QrCodeController {
             return SendUtil.send(false, ConstStr.REQUEST_WRONGPARAMS);
         }
         if (qrcodeWriteoff.getWriteoffStatus() == 2) {
-            response.sendRedirect("https://www.cqna.gov.cn/mnazw/applet/writeOff-fail.png" );
+            response.sendRedirect("https://www.cqna.gov.cn/mnazw/writeOff/index.html?result=fail" );
             return SendUtil.send(false, "该二维码已核销:" + recordId);
         }
 
         Boolean result = qrcodeWriteoffService.writeoff(recordId);
-        response.sendRedirect(result ? "https://www.cqna.gov.cn/mnazw/applet/writeOff-success.png" : "https://www.cqna.gov.cn/mnazw/applet/writeOff-fail.png");
+        response.sendRedirect(result ? "https://www.cqna.gov.cn/mnazw/writeOff/index.html?result=success" : "https://www.cqna.gov.cn/mnazw/writeOff/index.html?result=fail");
         return SendUtil.send(result, result ? "二维码核销成" : "二维码核销失败");
     }
 }

+ 49 - 0
nngkxxdp/src/main/resources/static/writeOff/index.html

@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+  <meta charset="UTF-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width" />
+  <title>核销结果</title>
+</head>
+<style>
+  #resultImg{
+    width: 70vw;
+    height: 70vw;
+    margin-left: 15vw;
+    margin-top: 15vw;
+  }
+</style>
+
+<body>
+  <img id="resultImg" src="./writeOff-success.png"/>
+</body>
+
+<script type="text/javascript">
+  let result = getQueryVariable("result")
+  switch (result){
+    case 'success':
+      document.getElementById("resultImg").setAttribute('src','./writeOff-success.png')
+      break;
+    case 'fail':
+      document.getElementById("resultImg").setAttribute('src','./writeOff-fail.png')
+      break;
+    default:
+      document.getElementById("resultImg").setAttribute('src','./writeOff-success.png')
+      break;
+  }
+  function getQueryVariable(variable) {
+    let query = window.location.search.substring(1);
+    let vars = query.split("&");
+    for (let i = 0; i < vars.length; i++) {
+      let pair = vars[i].split("=");
+      if (pair[0] == variable) {
+        return pair[1];
+      }
+    }
+    return "";
+  }
+</script>
+
+</html>

binární
nngkxxdp/src/main/resources/static/writeOff/writeOff-fail.png


binární
nngkxxdp/src/main/resources/static/writeOff/writeOff-success.png


+ 1 - 1
nnzwminiapp/pages/api/request.js

@@ -98,7 +98,7 @@ function islogin(data) {
 	}
 
 }
-var noNeedLoginList = ["login", "getGoodOrBadByYearAndArea", "getOfficeNumberByAreaInfo"]
+var noNeedLoginList = ["login", "getGoodOrBadByYearAndArea", "getOfficeNumberByAreaInfo","getSubscribeNumber"]
 
 function noNeedLogin(data) {
 	for (const element of noNeedLoginList) {

+ 22 - 0
nnzwminiapp/pages/doings/doings.js

@@ -83,6 +83,28 @@ Page({
                         'mini-token':cacheGet('token')
                     },
                     success: function(res){
+                        try{
+                            let str = String.fromCharCode.apply(null, new Uint8Array(res.data));
+                            str = decodeURIComponent(escape((str)));
+                            let result = JSON.parse(str)
+                            if (result.msg == '请重新登录' && !result.result) {
+                                wx.showModal({
+                                    title: '掌新南岸欢迎您!',
+                                    content: '使用完整服务需要登录!',
+                                    showCancel: false,
+                                    confirmText: '登录',
+                                    success: function (res) {
+                                        wx.navigateTo({
+                                            url: '/pages/login/login',
+                                        });
+                                    },
+                                });
+                                return
+                            }
+                        }catch(e){
+                            console.log(e);
+                        }
+
                         console.log(res);
                         if(res.statusCode == 200){
                             let url ="data:image/png;base64," + wx.arrayBufferToBase64(res.data)

+ 2 - 24
nnzwminiapp/pages/doings/doings.wxml

@@ -1,35 +1,13 @@
 <!--pages/doings/doings.wxml-->
-<view style="height: 1972rpx;">
+<view style="height: 1972rpx;background-image: url('{{imgUrl}}hd-bg.jpg');background-size: cover;" >
     <modal hidden="{{hidden}}" title="" confirm-text="关闭" bindconfirm="confirm" no-cancel="{{true}}">
         <view>
             <image style="width: 620rpx;height: 540rpx;margin-left: -33rpx;" src="{{codeImg}}" mode='aspectFill'></image>
         </view>
         <view style="text-align: center;">凭此二维码领取礼品</view>
     </modal>
-    <view class="title" style="background-image: url('{{imgUrl}}nnzzditembg.png');">
-        <view class="titleTitle">
-        </view>
-        <view class="tips" > 
-            <view class="tips-left">
-                <image class="tips-icon" src="https://img1.imgtp.com/2023/07/12/jLlqS9XQ.png" />
-                <view class="tips-text">南岸最新资讯</view>
-            </view>
-            <view class="tips-right">
-                <image class="tips-icon" src="https://img1.imgtp.com/2023/07/12/SpLoEPXM.png" />
-                <view class="tips-text">动态掌握全面</view>
-            </view>
-            <view ></view>
-        </view>
+    <view style="padding-top: 220rpx;">
         <view class="dy" bindtap="dy"></view>
-        <view class="dyrs"><view class="dysl1">已订阅人数</view><view class="dys2">{{dyrs}}↑</view></view>
-    </view>
-    <view class="news" style="background-image: url('{{imgUrl}}nnzzdtitlebg.png'); margin-top: -102rpx;">
-        <view class="newsbg">
-
-            <include src="doings-item.wxml"/>
-        </view>
-        
     </view>
-    
 </view>
 

+ 0 - 151
nnzwminiapp/pages/doings/doings.wxss

@@ -1,71 +1,5 @@
 /* pages/doings/doings.wxss */
 
-.title{
-    width: 100%;
-    height: 900rpx;
-    
-    background-size: contain;
-    background-repeat: no-repeat;
-    padding-top: 60rpx;
-}
-.news{
-    width: 100%;
-    height: 1120rpx;
-    background-size: contain;
-    background-repeat: no-repeat;
-}
-.newsbg{
-    width: 86.5%;
-    height: 100%;
-    margin: 0 auto;
-    position: relative;
-    background: #efefef;
-}
-.titleTitle{
-    background-image: url(https://img1.imgtp.com/2023/07/12/9nTrRBU3.png);
-    width: 450rpx;
-    height: 100rpx;
-    background-size: contain;
-    background-repeat: no-repeat;
-    margin: 0 auto 0;
-}
-.tips{
-    width: 60%;
-    height: 40rpx;
-    margin: 0 auto;
-}
-.tips-left{
-    width: 50%;
-    height: 40rpx;
-    line-height: 40rpx;
-    text-align: center;
-    float: left;
-    color: #f0f4fa;
-}
-
-.tips-right{
-    width: 50%;
-    height: 40rpx;
-    line-height: 40rpx;
-    text-align: center;
-    float: left;
-    color: #f0f4fa;
-    text-align: center;
-	display: table-cell;
-	vertical-align: middle;
-}
-.tips-icon{
-    /* display: block; */
-    width:  28rpx;
-    height: 28rpx;
-    /* float: left; */
-    /* margin: auto 0; */
-}
-.tips-text{
-    margin-top: -4rpx;
-    font-size: 28rpx;
-    float: right;
-}
 .dy{
     width: 300rpx;
     height: 80rpx;
@@ -73,89 +7,4 @@
     background-size: contain;
     background-repeat: no-repeat;
     margin: 30rpx auto 0;
-}
-.dyrs{
-    width: 600rpx;
-    height: 50rpx;
-    margin: 30rpx auto 0;
-    font-size: 30rpx;
-    text-align: center;
-    color: #fff;
-    
-}
-.dysl1{
-    width: 50%;
-    float: left;
-    height: 50rpx;
-    line-height: 50rpx;
-    text-align: right;
-}
-.dys2{
-    width: 45%;
-    float: left;
-    height: 50rpx;
-    line-height: 50rpx;
-    text-align: left;
-    font-size: 38rpx;
-    font-weight: bold;
-    background: linear-gradient(to top,#fff3e8, #f1d2ab);
-    -webkit-background-clip: text;
-    color: transparent;
-}
-.dyicon{
-    width: 30rpx;
-    height: 50rpx;
-}
-.item-he{
-    height: 1120rpx; 
-}
-.item-main{
-    width: 95%;
-    min-height:300rpx;
-    margin: 0 auto;
-    /* background-color: #d1ddf8; */
-}
-.item-title{
-    width: 525rpx;
-    height: 65rpx;
-    margin: 0 auto;
-    text-align: center;
-    color: #fff;
-    font-weight: bold;
-    background-size: contain;
-    background-repeat: no-repeat;
-    margin-bottom: 12rpx;
-
-}
-.item-right{
-    width: 90%;
-    /* min-height: 334rpx; */
-    margin: 0 auto 40rpx;
-    
-}
-.item-c{
-    width: 100%;
-    /* border-radius: 10rpx; */
-    min-height: 334rpx;
-    background: #fff;
-    padding-top: 20rpx;
-}
-.item-context{
-    width: 93%;
-    min-height: 334rpx;
-    margin: 0 auto;
-    color: #666666;
-}
-.itemitme{
-    width: 100%;
-}
-
-.key{
-    width: 30%;
-    float: left;
-}
-
-.value{
-    width: 70%;
-    float: left;
 }