Browse Source

Merge branch 'master' of http://121.40.40.223:3000/zizhong.wang/konggang-city-miniprogram

306132416@qq.com 4 years ago
parent
commit
0adabd3262
5 changed files with 556 additions and 170 deletions
  1. 13 6
      components/foot-tabs/footTabs.vue
  2. 8 0
      pages.json
  3. 314 0
      pages/selfCenter/collection.vue
  4. 220 164
      pages/selfCenter/index.vue
  5. 1 0
      pages/supply/mySupply.vue

+ 13 - 6
components/foot-tabs/footTabs.vue

@@ -9,7 +9,7 @@
         @tap="click(i, menu.pagePath)"
       >
         <view class="iconBox">
-          <span class="iconfont" :class="[menu.icon, selectedIndex == i? '' : 'hover']"></span>
+          <span class="iconfont" :class="[menu.icon, (selectedIndex == i)? 'hoverd' : 'hover']"></span>
         </view>
       </view>
     </view>
@@ -40,7 +40,7 @@
       height: 60rpx;
       border-radius: 50%;
       left: 14%;
-      transition: all 0.3s;
+      transition: all 0.1s;
       background: rgb(14, 92, 246);
       &.hover {
         left: 14%;
@@ -48,6 +48,7 @@
       }
       &.hoverd {
         left: 61%;
+        background: rgb(14, 92, 246);
       }
     }
     .menu_icon {
@@ -69,6 +70,9 @@
           &.hover{
             color: rgb(187, 187, 187);
           }
+          &.hoverd{
+            color: #fff;
+          }
         }
       }
     }
@@ -76,12 +80,13 @@
 }
 </style>
 <script>
+import app from '../../App'
 export default {
   data() {
     return {
-      selectedIndex: getApp().globalData.selectedIndex,
+      selectedIndex: app.globalData.selectedIndex,
       showselected: false,
-      isSider: getApp().globalData.isSider,
+      isSider: app.globalData.isSider,
       menus: [
         {
           pagePath: "pages/index/index",
@@ -98,12 +103,14 @@ export default {
   },
   methods: {
     click(index, src) {
+     this.selectedIndex = index
+     app.globalData.selectedIndex = index
       if (index == 0) {
         this.isSider = false;
-        getApp().globalData.isSider = false
+        app.globalData.isSider = false
       } else {
         this.isSider = true;
-        getApp().globalData.isSider = true
+        app.globalData.isSider = true
       }
       uni.redirectTo({
         url: "/" + src,

+ 8 - 0
pages.json

@@ -23,6 +23,14 @@
 			}
 		},
 		{
+			"path": "pages/selfCenter/collection",
+			"style": {
+				"navigationBarTitleText": "我的收藏",
+				"navigationBarBackgroundColor": "#02A7F0",
+				"navigationBarTextStyle":"white"
+			}
+		},
+		{
 			"path": "pages/appeal/index",
 			"style": {
 				"navigationBarTitleText": "提建议",	

+ 314 - 0
pages/selfCenter/collection.vue

@@ -0,0 +1,314 @@
+<template>
+  <view class="content">
+    <view class="supply-box">
+      <view class="supply-item-box">
+        <view
+          v-for="(item, idx) in titleList"
+          :key="idx"
+          :class="{ active: active === idx }"
+          class="supply-item-name"
+          @click="active = idx"
+        >
+          {{ item }}
+        </view>
+      </view>
+      <view class="policy-content" v-if="active == 0">
+        <view
+          class="policy-content-item"
+          v-for="(item, idx) in policyData"
+          :key="idx"
+          @click="enterPolicyDeatil(item.id)"
+        >
+          <view class="policy-content-item-left">
+            <p class="policy-content-item-left-title" style="height: 70rpx">
+              {{ item.title }}
+            </p>
+            <view class="policy-content-item-left-time">
+              <p class="moment">{{ item.publish_time | globalTime }}</p>
+              <p class="maxMony">{{ item.project_money }}</p>
+              <p class="leftDay">
+                <!-- {{ item.project_end_date | globalTime || "长期可申报" }} -->
+                {{ "长期可申报" }}
+              </p>
+            </view>
+          </view>
+          <view class="policy-content-item-img">
+            <image :src="item.pic_url" alt="" />
+          </view>
+        </view>
+      </view>
+      <view class="companys" v-if="active == 1">
+        <view
+          class="company"
+          v-for="(company, index) in companyList"
+          :key="index"
+          @tap="toDetail(index)"
+        >
+          <view class="title">
+            <view class="logo">
+              <img :src="company.logo" alt="" />
+            </view>
+            <view class="name">
+              {{ company.name }}
+            </view>
+          </view>
+          <view class="info">
+            <view class="view">
+              <view class="info_t">法定代表人</view>
+              <view class="name">
+                {{ company.info.person }}
+              </view>
+            </view>
+            <view class="line"></view>
+            <view class="view">
+              <view class="info_t">注册资本</view>
+              {{ company.info.money }}
+            </view>
+            <view class="line"></view>
+            <view class="view">
+              <view class="info_t">成立日期</view>
+              {{ company.info.time }}
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      titleList: ["政策", "企业"],
+      active: 0,
+      searchVal: "",
+      policyData: new Array(5).fill({
+        title:
+          "工业金额信息化部办公厅 组织开2021念工业互联网平台创新互联网工业文化产业项目征集工作。",
+        moment: "2021-07-12",
+        maxMony: "最高500.00万",
+        leftDay: "剩5天",
+        img: "/static/policy/u388.jpg",
+      }),
+      companyList: new Array(5).fill({
+        logo: "/static/enterprise/logo.png",
+        name: "康拓科技有限责任公司",
+        info: {
+          person: "马须伦",
+          money: "1,776,759.3万(元)",
+          time: "1995-03-25",
+        },
+      }),
+    };
+  },
+  onLoad() {},
+  methods: {
+    toDetail(index) {
+      uni.navigateTo({
+        url: "/pages/enterprise/enterprise_detail?id=" + index,
+      });
+    },
+    enterPolicyDeatil(id) {
+      uni.navigateTo({
+        url: "/pages/policy/policy_deatil?id=" + id,
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss">
+.content {
+  padding: 4%;
+  .supply-box {
+    width: 100%;
+    display: flex;
+    flex-direction: column;
+    .supply-title {
+      width: 100%;
+      p {
+        background-color: #02a7f0;
+        width: 190rpx;
+        height: 70rpx;
+        color: #ffffff;
+        border-radius: 0 40rpx 40rpx 0rpx;
+        font-size: 28rpx;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+      }
+    }
+    .supply-item-box {
+      display: flex;
+      justify-content: space-evenly;
+      margin: 0 20rpx;
+      margin-top: 10rpx;
+
+      .supply-item-name {
+        padding-bottom: 10rpx;
+        font-size: 27rpx;
+      }
+      .active {
+        font-weight: 600;
+        border-bottom: 7rpx solid #02a7f0;
+      }
+    }
+    .supply-content {
+      width: 100%;
+      display: flex;
+      box-sizing: border-box;
+      flex-direction: column;
+      font-size: 25rpx;
+      .supplyCard {
+        display: flex;
+        width: 92%;
+        margin: 2% 0;
+        padding: 2% 4%;
+        height: 5%;
+        border-radius: 30rpx;
+        box-shadow: rgba(100, 100, 111, 0.2) 0rpx 14rpx 50rpx 0rpx;
+        .image_content {
+          margin-right: 5%;
+          image {
+            width: 100rpx;
+            height: 100rpx;
+            border-radius: 20rpx;
+            background-color: rgb(228, 228, 228);
+          }
+        }
+        .state {
+          margin-left: 100rpx;
+          image {
+            width: 100rpx;
+            height: 80rpx;
+          }
+        }
+        .info {
+          display: flex;
+          flex-flow: column;
+          justify-content: space-around;
+          .time {
+            font-weight: 100;
+            font-size: 25rpx;
+          }
+        }
+      }
+    }
+  }
+  .policy-content {
+    width: 100%;
+    display: flex;
+    box-sizing: border-box;
+    flex-direction: column;
+    margin-top: 10rpx;
+    .policy-content-item {
+      margin: 0 20rpx;
+      display: flex;
+      overflow: hidden;
+      box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
+      border-radius: 32rpx;
+      padding-bottom: 10rpx;
+      margin-top: 20rpx;
+      padding: 30rpx;
+      justify-content: space-between;
+      .policy-content-item-left {
+        display: flex;
+        flex-direction: column;
+        width: 70%;
+        .policy-content-item-left-title {
+          text-overflow: -o-ellipsis-lastline;
+          overflow: hidden;
+          text-overflow: ellipsis;
+          display: -webkit-box;
+          -webkit-line-clamp: 2;
+          line-clamp: 2;
+          -webkit-box-orient: vertical;
+          font-size: 25rpx;
+          margin-bottom: 10rpx;
+        }
+        .policy-content-item-left-time {
+          width: 100%;
+          display: flex;
+          align-items: center;
+          .moment {
+            color: #c1c1c1;
+            font-size: 20rpx;
+            margin-right: 20rpx;
+          }
+          .maxMony {
+            font-size: 20rpx;
+            color: #00bfbf;
+            border: 1px solid #00bfbf;
+            padding: 10rpx;
+            margin-right: 20rpx;
+            border-radius: 12rpx;
+          }
+          .leftDay {
+            font-size: 20rpx;
+            background: #f7bbc3;
+            color: #e32579;
+            padding: 10rpx;
+            border: 1px solid #f7bbc3;
+            border-radius: 12rpx;
+          }
+        }
+      }
+      .policy-content-item-img {
+        image {
+          width: 180rpx;
+          height: 120rpx;
+          border-radius: 12rpx;
+        }
+      }
+    }
+  }
+  .companys {
+    margin-top: 3%;
+    padding: 0 4%;
+    font-size: 30rpx;
+    .company {
+      border-radius: 20rpx;
+      box-shadow: rgba(0, 0, 0, 0.35) 0rpx 5rpx 15rpx;
+      padding: 1%;
+      margin: 2% 0;
+      .title {
+        display: flex;
+        align-items: center;
+        .logo {
+          image {
+            width: 100rpx;
+            height: 70rpx;
+            margin-right: 30rpx;
+          }
+        }
+      }
+      .line {
+        width: 3rpx;
+        height: 70rpx;
+        background: rgb(175, 186, 197);
+      }
+      .info {
+        font-size: 19rpx;
+        font-weight: 100;
+        display: flex;
+        text-align: center;
+        justify-content: space-between;
+        align-items: center;
+        padding: 0 2%;
+        margin-top: 1%;
+        .view {
+          margin-top: 2%;
+          .name {
+            color: #02a7f0;
+          }
+          .info_t {
+            margin-bottom: 10rpx;
+            font-size: 25rpx;
+          }
+        }
+      }
+    }
+  }
+}
+</style>

+ 220 - 164
pages/selfCenter/index.vue

@@ -2,18 +2,28 @@
   <view class="content">
     <foot-tabs></foot-tabs>
     <div class="self-inf">
-		<div class="img-name-box" v-if="isAuth">
-		  <image :src="userHeadImg" alt="" class="heade-img" mode="aspectFill"></image>
-		  <p  class="nickname">{{userNickName}}</p>
-		</div>
-	   <view class="img-name-box" v-if="!isAuth">
-		   <button  @click="goAuthPage()" class="auth-btn">点击去授权</button>
-	   </view>
+      <div class="img-name-box" v-if="isAuth">
+        <image
+          :src="userHeadImg"
+          alt=""
+          class="heade-img"
+          mode="aspectFill"
+        ></image>
+        <p class="nickname">{{ userNickName }}</p>
+      </div>
+      <view class="img-name-box" v-if="!isAuth">
+        <button @click="goAuthPage()" class="auth-btn">点击去授权</button>
+      </view>
       <image class="bg-img" :src="swiperBackground" mode="aspectFill"></image>
-	  <image src="../../static/Intersect.svg" class="groove-img"></image>
+      <image src="../../static/Intersect.svg" class="groove-img"></image>
     </div>
     <div class="options">
-      <div v-for="(item, idx) in list" :key="idx" class="options-item" @click="goDetailFn(idx)">
+      <div
+        v-for="(item, idx) in list"
+        :key="idx"
+        class="options-item"
+        @click="goDetailFn(idx, item.url)"
+      >
         <div class="img-box">
           <img :src="item.icoin" alt="" class="options-item-img" /><span></span>
         </div>
@@ -29,155 +39,201 @@
 </template>
 
 <script>
-import md5 from '@/common/md5.js';
+import md5 from "@/common/md5.js";
 export default {
   data() {
     return {
       message: "我的",
-	  isAuth:true,
-	  userHeadImg:'',
-	  userNickName:'',
+      isAuth: true,
+      userHeadImg: "",
+      userNickName: "",
       list: [
         { icoin: "/static/selfCenter/suggest.png", name: "我的建议" },
         { icoin: "/static/selfCenter/sign.png", name: "我的报名" },
-        { icoin: "/static/selfCenter/collection.png", name: "我的收藏" },
+        {
+          icoin: "/static/selfCenter/collection.png",
+          name: "我的收藏",
+          url: "/pages/selfCenter/collection",
+        },
         { icoin: "/static/selfCenter/back.png", name: "退出登录" },
       ],
-	  swiperBackground:'',
+      swiperBackground: "",
     };
   },
   onLoad() {
-	  this.getSwiperList();
-	  
+    this.getSwiperList();
   },
   onShow() {
-  // 	 this.isAuth = getApp().globalData.isAuth;
-	 // if(this.isAuth){
-		//  this.userHeadImg = getApp().globalData.user_headUrl;
-		//  this.userNickName = getApp().globalData.user_name;
-	 // }
-	 this.getUserInfo()
+    // 	 this.isAuth = getApp().globalData.isAuth;
+    // if(this.isAuth){
+    //  this.userHeadImg = getApp().globalData.user_headUrl;
+    //  this.userNickName = getApp().globalData.user_name;
+    // }
+    this.getUserInfo();
   },
   methods: {
-	  goAuthPage(){
-		  uni.navigateTo({
-		  	url:'../auth/index'
-		  })
-	  },
-	  goDetailFn(index){
-		  let that = this;
-		  switch (index){
-		  	case 0:  //我的建议
-		  		break;
-		  	case 1:  //我的报名
-		  		break;
-		  	case 2:  //我的收藏
-		  		break;
-		  	case 3:  //退出登录
-			 if(that.isAuth){
-				uni.showModal({
-					title:'确定退出登录吗?',
-					success(res) {
-						if(res.confirm){
-							that.loginOut(); 	
-						}else if (res.cancel){
-							console.log('用户点击取消');
-						}
-					}
-				})
-			 }else{
-				 uni.showToast({
-				 	title:'您还没有登录',
-					duration:2500,
-					icon:'none'
-				 })
-			 }
-		  		break;												
-		  }
-	  },
-	  loginOut(){
-		  let md5Sign = md5("method="+'user'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
-		  let url = getApp().globalData.shareUrl+'api/api.php'+'?method=user&action=logout&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign
-		  uni.request({
-		  	url:url,
-		  	method: 'POST',
-		  	header: {
-		  		'content-type': 'application/x-www-form-urlencoded'
-		  	},
-		  	data: {
-		  		openId:getApp().globalData.open_id
-		  	},
-		  	success: (res) => {
-		  		if(res.data.code === 200){
-					this.isAuth = false;
-					getApp().globalData.isAuth = false;
-					getApp().globalData.user_headUrl = '';
-					getApp().globalData.user_name = '';
-					getApp().globalData.user_phone = '';
-					uni.showToast({
-						title:'退出登录成功',
-						duration:2500,
-						icon:'none'
-					})
-		  		}
-		  	},
-		  	fail: () => {
-		  		console.log("连接失败");
-		  	}
-		  });
-	  },
-	  getUserInfo(){
-	  	let md5Sign = md5("method="+'user'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
-	  	let url = getApp().globalData.shareUrl+'api/api.php'+'?method=user&action=info_by_openid&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign
-	  	uni.request({
-	  		url:url,
-	  		method: 'POST',
-	  		header: {
-	  			'content-type': 'application/x-www-form-urlencoded'
-	  		},
-	  		data: {
-				openId:getApp().globalData.open_id
-	  		},
-	  		success: (res) => {
-	  			if(res.data.code === 200){
-					if(res.data.data.nickname){
-						this.isAuth = true;
-						this.userHeadImg = res.data.data.headimg;
-						this.userNickName = res.data.data.nickname;
-						getApp().globalData.user_phone = res.data.data.phone;
-					}else{
-						this.isAuth = false;
-					}
-	  			}
-	  		},
-	  		fail: () => {
-	  			console.log("连接失败");
-	  		}
-	  	});
-	  }, 
-	  getSwiperList(){
-	  	let md5Sign = md5("method="+'common'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
-	  	let url = getApp().globalData.shareUrl+'api/api.php'+'?method=common&source=main_pics&action=list&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign
-	  	uni.request({
-	  		url:url,
-	  		method: 'POST',
-	  		header: {
-	  			'content-type': 'application/x-www-form-urlencoded'
-	  		},
-	  		data: {
-	  			order_by:"weight desc",
-	  			s_status:1,
-	  		},
-	  		success: (res) => {
-	  			if(res.data.code === 200){
-	  				this.swiperBackground = getApp().globalData.shareUrl + res.data.data.list[0].pic_path
-	  			}
-	  		},
-	  		fail: () => {
-	  			console.log("连接失败");
-	  		}
-	  	});
-	  },
+    goAuthPage() {
+      uni.navigateTo({
+        url: "../auth/index",
+      });
+    },
+    goDetailFn(index, url) {
+      uni.navigateTo({
+        url,
+      });
+      let that = this;
+      switch (index) {
+        case 0: //我的建议
+          break;
+        case 1: //我的报名
+          break;
+        case 2: //我的收藏
+          break;
+        case 3: //退出登录
+          if (that.isAuth) {
+            uni.showModal({
+              title: "确定退出登录吗?",
+              success(res) {
+                if (res.confirm) {
+                  that.loginOut();
+                } else if (res.cancel) {
+                  console.log("用户点击取消");
+                }
+              },
+            });
+          } else {
+            uni.showToast({
+              title: "您还没有登录",
+              duration: 2500,
+              icon: "none",
+            });
+          }
+          break;
+      }
+    },
+    loginOut() {
+      let md5Sign = md5(
+        "method=" +
+          "user" +
+          "&timestamp=" +
+          getApp().globalData.globalTimestamp +
+          "&secret=" +
+          getApp().globalData.secret
+      );
+      let url =
+        getApp().globalData.shareUrl +
+        "api/api.php" +
+        "?method=user&action=logout&timestamp=" +
+        getApp().globalData.globalTimestamp +
+        "&sign=" +
+        md5Sign;
+      uni.request({
+        url: url,
+        method: "POST",
+        header: {
+          "content-type": "application/x-www-form-urlencoded",
+        },
+        data: {
+          openId: getApp().globalData.open_id,
+        },
+        success: (res) => {
+          if (res.data.code === 200) {
+            this.isAuth = false;
+            getApp().globalData.isAuth = false;
+            getApp().globalData.user_headUrl = "";
+            getApp().globalData.user_name = "";
+            getApp().globalData.user_phone = "";
+            uni.showToast({
+              title: "退出登录成功",
+              duration: 2500,
+              icon: "none",
+            });
+          }
+        },
+        fail: () => {
+          console.log("连接失败");
+        },
+      });
+    },
+    getUserInfo() {
+      let md5Sign = md5(
+        "method=" +
+          "user" +
+          "&timestamp=" +
+          getApp().globalData.globalTimestamp +
+          "&secret=" +
+          getApp().globalData.secret
+      );
+      let url =
+        getApp().globalData.shareUrl +
+        "api/api.php" +
+        "?method=user&action=info_by_openid&timestamp=" +
+        getApp().globalData.globalTimestamp +
+        "&sign=" +
+        md5Sign;
+      uni.request({
+        url: url,
+        method: "POST",
+        header: {
+          "content-type": "application/x-www-form-urlencoded",
+        },
+        data: {
+          openId: getApp().globalData.open_id,
+        },
+        success: (res) => {
+          if (res.data.code === 200) {
+            if (res.data.data.nickname) {
+              this.isAuth = true;
+              this.userHeadImg = res.data.data.headimg;
+              this.userNickName = res.data.data.nickname;
+              getApp().globalData.user_phone = res.data.data.phone;
+            } else {
+              this.isAuth = false;
+            }
+          }
+        },
+        fail: () => {
+          console.log("连接失败");
+        },
+      });
+    },
+    getSwiperList() {
+      let md5Sign = md5(
+        "method=" +
+          "common" +
+          "&timestamp=" +
+          getApp().globalData.globalTimestamp +
+          "&secret=" +
+          getApp().globalData.secret
+      );
+      let url =
+        getApp().globalData.shareUrl +
+        "api/api.php" +
+        "?method=common&source=main_pics&action=list&timestamp=" +
+        getApp().globalData.globalTimestamp +
+        "&sign=" +
+        md5Sign;
+      uni.request({
+        url: url,
+        method: "POST",
+        header: {
+          "content-type": "application/x-www-form-urlencoded",
+        },
+        data: {
+          order_by: "weight desc",
+          s_status: 1,
+        },
+        success: (res) => {
+          if (res.data.code === 200) {
+            this.swiperBackground =
+              getApp().globalData.shareUrl + res.data.data.list[0].pic_path;
+          }
+        },
+        fail: () => {
+          console.log("连接失败");
+        },
+      });
+    },
   },
 };
 </script>
@@ -199,13 +255,13 @@ export default {
       margin-top: 70rpx;
       display: flex;
       align-items: center;
-	  .auth-btn {
-		  margin-left: 80rpx;
-		  margin-top: 50rpx;
-		  font-size: 28rpx;
-		  background-color: #02A7F0;
-		  color: #fff;
-	  } 
+      .auth-btn {
+        margin-left: 80rpx;
+        margin-top: 50rpx;
+        font-size: 28rpx;
+        background-color: #02a7f0;
+        color: #fff;
+      }
       .heade-img {
         z-index: 1;
         width: 100rpx;
@@ -222,19 +278,19 @@ export default {
       height: 100%;
       // border-radius: 0rpx 0rpx 70rpx 70rpx;
     }
-	.groove-img {
-		width: 100%;
-		height: 100rpx;
-		bottom: -22rpx;
-		position: absolute;
-	}
+    .groove-img {
+      width: 100%;
+      height: 100rpx;
+      bottom: -22rpx;
+      position: absolute;
+    }
     .nickname {
       font-weight: 600;
-	  font-size: 28rpx;
-	  margin-left: 30rpx;
-	  margin-top: 20rpx;
-	  color: #ffffff;
-	  letter-spacing: 1rpx;
+      font-size: 28rpx;
+      margin-left: 30rpx;
+      margin-top: 20rpx;
+      color: #ffffff;
+      letter-spacing: 1rpx;
     }
   }
   .options {
@@ -258,10 +314,10 @@ export default {
         }
       }
       .options-item-name {
-			margin-left: 40rpx;
-			font-weight: 600;
-			font-size: 30rpx;
-			margin-bottom: 10rpx;
+        margin-left: 40rpx;
+        font-weight: 600;
+        font-size: 30rpx;
+        margin-bottom: 10rpx;
       }
     }
   }

+ 1 - 0
pages/supply/mySupply.vue

@@ -108,6 +108,7 @@ export default {
       display: flex;
       box-sizing: border-box;
       flex-direction: column;
+      font-size: 25rpx;
       .supplyCard {
         display: flex;
         width: 92%;