瀏覽代碼

党员申请

tt0101 1 周之前
父節點
當前提交
a8c2652c2a
共有 4 個文件被更改,包括 102 次插入14 次删除
  1. 3 0
      src/api/home.js
  2. 11 2
      src/views/Apply.vue
  3. 87 11
      src/views/home/index.vue
  4. 1 1
      vue.config.js

+ 3 - 0
src/api/home.js

@@ -24,3 +24,6 @@ export const getTong = (data) => request({ url: "index/gettong", method: "post",
 
 // 参与项目 
 export const getChongInfo = (params) => request({ url: "index/get_chong_info", method: "get", params,loading:true });
+// 党员申请 
+export const applyDangyuan = (data) => request({ url: "user/apply_dangyuan", method: "post", data,loading:true });
+

+ 11 - 2
src/views/Apply.vue

@@ -13,13 +13,15 @@
       <div class="apply-desc">
         国家平台总部招募党员团队主管,团队总人数达到100人即可成为党员主管,每月可享受60000元党员团队奖励金直接到账银行卡。加入中国共产党那一刻起,都必须无一例外地履行党员义务!
       </div>
-      <button class="apply-btn">我要参党</button>
+      <button class="apply-btn" @click="applyDan">我要参党</button>
     </div>
   </div>
   </div>
 </template>
 
 <script>
+import {applyDangyuan} from '@/api/home.js'
+import { Toast } from 'vant';
 export default {
   name: 'InvitePeople',
   data() {
@@ -56,7 +58,14 @@ export default {
     goBack() {
       this.$router.go(-1)
     },
-  }
+    async applyDan() {
+      const res = await applyDangyuan();
+      if(res.cooe === 1){
+        Toast.success('申请成功');
+      }
+    },
+  },
+  
 }
 </script>
 

+ 87 - 11
src/views/home/index.vue

@@ -43,7 +43,13 @@
           <span>5%</span>
         </div>
       </div>
-      <button class="party-btn" @click="toApply">党员申请</button>
+      <button 
+        class="party-btn" 
+        :class="{ 'is-member': userInfo.isdangyuan === 1 }"
+        @click="userInfo.isdangyuan === 0 && toApply()"
+      >
+        {{ userInfo.isdangyuan === 1 ? '已是党员' : '党员申请' }}
+      </button>
     </div>
     <div class="news-title">新闻中心</div>
     <div
@@ -51,24 +57,35 @@
       v-if="newsList[2]"
       v-html="newsList[2].content"
     ></div>
-    <!-- <iframe
-      class="news-iframe"
-      src="https://www.nongfuspring.com/en/aboutus/management.html"
-      frameborder="0"
-    ></iframe> -->
+    <van-dialog
+      v-model="showAuthDialog"
+      :show-confirm-button="false"
+      :show-cancel-button="false"
+      :close-on-click-overlay="true"
+      class="auth-dialog"
+      v-if="userInfo.if_real === 0"
+    >
+      <div class="close-icon-wrapper">
+        <van-icon name="cross" class="close-icon" @click="showAuthDialog = false" />
+      </div>
+      <div class="auth-content">
+        <p class="auth-text">你还未进行实名认证</p>
+        <button class="auth-btn" @click="toAuth">去认证</button>
+      </div>
+    </van-dialog>
     <van-dialog
       v-model="showDialog"
       :show-confirm-button="false"
       :show-cancel-button="false"
       :close-on-click-overlay="true"
       class="welcome-dialog"
+      v-if="userInfo.gonggao"
     >
       <div class="close-icon-wrapper">
         <van-icon name="cross" class="close-icon" @click="showDialog = false" />
       </div>
       <div class="dialog-title">{{userInfo.gonggao.title}}</div>
-      <div class="dialog-content" v-html="userInfo.gonggao.value">
-      </div>
+      <div class="dialog-content" v-html="userInfo.gonggao.value"></div>
     </van-dialog>
   </div>
 </template>
@@ -83,9 +100,14 @@ export default {
   data() {
     return {
       banners: [],
-      userInfo: {},
+      userInfo: {
+        gonggao: null,
+        if_real: 0,
+        link: []
+      },
       newsList: [],
       showDialog: true,
+      showAuthDialog: false,
     };
   },
   components: {
@@ -105,12 +127,15 @@ export default {
     async getUserInfo() {
       const res = await getUserInfo();
       this.userInfo = res.data;
+      if (this.userInfo.if_real === 0) {
+        this.showAuthDialog = true;
+      }
     },
     async getBanners() {
       const formData = new FormData();
       formData.append('cid', 5);
       const res = await getBanners(formData);
-      this.banners = res.data.map(url => url.replace(/^https:/, 'http:'));
+      this.banners = res.data
     },
      async getNewsDetail() {
         const res = await getNews()
@@ -130,6 +155,10 @@ export default {
     },
     toApply(){
       this.$router.push('/Apply');
+    },
+    toAuth() {
+      this.$router.push('/user-center');
+      this.showAuthDialog = false;
     }
   }
 };
@@ -247,10 +276,20 @@ export default {
     font-weight: 500;
     margin-left: 12px;
     cursor: pointer;
-    transition: background 0.2s;
+    transition: all 0.2s;
+    
     &:hover {
       background: #c9301c;
     }
+
+    &.is-member {
+      background: #999;
+      cursor: not-allowed;
+      
+      &:hover {
+        background: #999;
+      }
+    }
   }
 }
 
@@ -312,4 +351,41 @@ export default {
     color: #333;
   }
 }
+
+.auth-dialog {
+  :deep(.van-dialog__content) {
+    padding: 30px 20px;
+    position: relative;
+  }
+}
+
+.auth-content {
+  text-align: center;
+  height: 120px;
+  
+  .auth-text {
+    font-size: 16px;
+    color: #333;
+    margin-bottom: 20px;
+    margin-top:12px;
+  }
+  
+  .auth-btn {
+    width: 83%;
+    height: 36px;
+    background: #ed4b39;
+    color: #fff;
+    border: none;
+    border-radius: 18px;
+    font-size: 14px;
+    font-weight: 500;
+    cursor: pointer;
+    transition: background 0.2s;
+    margin-top:20px;
+    
+    &:hover {
+      background: #c9301c;
+    }
+  }
+}
 </style>

+ 1 - 1
vue.config.js

@@ -37,7 +37,7 @@ module.exports = {
     https: false,
     proxy: {
       "/api": {
-        target: "http://18.163.50.191:19005/api",
+        target: "https://www.gametty.cc/api",
         changeOrigin: true,
         pathRewrite: {
           "^/api": "",