Ver código fonte

Merge branch 'master' of http://154.209.4.10:3001/tt0101/zhunong-h5

cc0011 1 semana atrás
pai
commit
2e9a4625f4

+ 2 - 2
.env.production

@@ -1,5 +1,5 @@
-# 生产环境配置
+# 生产环境配置 1
 ENV = 'production'
 
 # 生产环境
-VUE_APP_BASE_API = 'http://18.163.50.191:19005/api'
+VUE_APP_BASE_API = 'https://www.gametty.cc/api'

+ 4 - 1
src/api/home.js

@@ -1,7 +1,7 @@
 import request from "@/utils/request";
 //获取轮播图
 export const getBanners = (data) => request({ url: "index/get_banners", method: "post", data,loading:true });
-export const getUserInfo = (data) => request({ url: "user/get_userinfo", method: "post", data,loading:true });
+export const getUserInfo = (data) => request({ url: "user/get_userinfo", method: "post", data,loading:false });
 
 // 领取邀请奖励
 export function getShareReward(renshu) {
@@ -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 });
+

+ 8 - 2
src/router/index.js

@@ -60,7 +60,10 @@ const routes = [
   {
     path: "/register",
     name: "Register",
-    component: Register
+    component: Register,
+    meta: {
+      hideTabBar: true
+    }
   },
   {
     path: "/charges",
@@ -106,7 +109,10 @@ const routes = [
     path: "/login",
     name: "login",
     component: () =>
-      import(/* webpackChunkName: "login" */ "../views/login.vue")
+      import(/* webpackChunkName: "login" */ "../views/login.vue"),
+    meta: {
+      hideTabBar: true
+    }
   },
   {
     path: "/forget",

+ 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>
 

+ 1 - 1
src/views/Mall.vue

@@ -18,7 +18,7 @@
       <div class="plan-table-row">
         <div class="plan-col">
           <div class="plan-label">参与金额</div>
-          <div class="plan-value">{{ item.money }}</div>
+          <div class="plan-value">{{ item.money }}红旗资产</div>
         </div>
         <div class="plan-col">
           <div class="plan-label">退休金</div>

+ 9 - 3
src/views/Mention.vue

@@ -74,7 +74,6 @@
 <script>
 import { getUserInfo } from '@/api/home';
 import { withdrawCoin } from '@/api/profile';
-
 export default {
   name: 'Mention',
   data() {
@@ -148,8 +147,15 @@ export default {
           payPwd: this.password
         };
         
-        await withdrawCoin(params);
-        alert('提现申请已提交');
+        let res = await withdrawCoin(params);
+        
+        if(res.code == 1){
+        alert('提现申请已提交')
+        }else{
+          
+        alert(res.msg)
+          
+        }
         // 刷新用户信息
         await this.getUserInfo();
       } catch (error) {

+ 2 - 2
src/views/Profile.vue

@@ -228,7 +228,7 @@ export default {
     // 党员薪资提现
     handlePartySalaryWithdraw() {
       const minAmount = 60000; // 6万起提
-      if (parseFloat(this.userInfo.coins) < minAmount) {
+      if (parseFloat(this.userInfo.dyxz) < minAmount) {
         alert('余额不足,最低提现金额为6万元');
         return;
       }
@@ -237,7 +237,7 @@ export default {
     // 每日现金提现
     handleDailyCashWithdraw() {
       const minAmount = 20; // 20元起提
-      if (parseFloat(this.userInfo.xianjin) < minAmount) {
+      if (parseFloat(this.userInfo.dayred) < minAmount) {
         alert('余额不足,满20元可提现');
         return;
       }

+ 150 - 12
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,30 +57,66 @@
       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>
+    </van-dialog>
   </div>
 </template>
 
 <script>
-import { getBanners, getUserInfo,getNews } from '@/api/home';
-import { Swipe, SwipeItem } from 'vant';
+import { getBanners, getUserInfo, getNews } from '@/api/home';
+import { Swipe, SwipeItem, Dialog, Icon } from 'vant';
+import Vue from 'vue';
+
 export default {
   name: "Home",
   data() {
     return {
       banners: [],
-      userInfo: {},
+      userInfo: {
+        gonggao: null,
+        if_real: 0,
+        link: []
+      },
       newsList: [],
+      showDialog: true,
+      showAuthDialog: false,
     };
   },
   components: {
     [Swipe.name]: Swipe,
     [SwipeItem.name]: SwipeItem,
+    [Icon.name]: Icon,
+  },
+  created() {
+    Vue.use(Dialog);
   },
   mounted() {
     this.getBanners();
@@ -85,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()
@@ -110,6 +155,10 @@ export default {
     },
     toApply(){
       this.$router.push('/Apply');
+    },
+    toAuth() {
+      this.$router.push('/user-center');
+      this.showAuthDialog = false;
     }
   }
 };
@@ -227,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;
+      }
+    }
   }
 }
 
@@ -250,4 +309,83 @@ export default {
   border-radius: 8px;
   background: #fff;
 }
+
+.close-icon-wrapper {
+  position: absolute;
+  top: 16px;
+  right: 16px;
+  z-index: 1;
+  
+  .close-icon {
+    font-size: 20px;
+    color: #969799;
+    cursor: pointer;
+    padding: 4px;
+    
+    &:hover {
+      color: #323233;
+    }
+  }
+}
+
+.dialog-title {
+  text-align: center;
+  font-size: 18px;
+  font-weight: bold;
+  padding: 16px 0;
+  margin-top: 8px;
+}
+
+.welcome-dialog {
+  :deep(.van-dialog__content) {
+    padding: 20px;
+    position: relative;
+  }
+}
+
+.dialog-content {
+  text-align: center;
+  p {
+    margin: 10px 0;
+    font-size: 16px;
+    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": "",