Browse Source

添加规上页面

306132416@qq.com 4 years ago
parent
commit
cf315c9143

+ 12 - 0
pages.json

@@ -217,6 +217,18 @@
 			"style": {
 				"navigationBarTitleText": "工信局经济指标数据"
 			}
+		},
+		{
+			"path": "pages/metrics/largeScale/index",
+			"style": {
+				"navigationBarTitleText": "规上工业企业"
+			}
+		},
+		{
+			"path": "pages/metrics/largeScale/detail",
+			"style": {
+				"navigationBarTitleText": "企业详情"
+			}
 		}
 	],
 	"globalStyle": {

+ 2 - 12
pages/enterprise/index.vue

@@ -12,20 +12,10 @@
     </view>
     <view class="companys">
       <view>推荐企业</view>
-      <view
-        v-for="(company, index) in companyList"
-        :key="index"
-        @tap="toDetail(company.id)"
-        class="company"
-      >
+      <view  v-for="(company, index) in companyList" :key="index" @tap="toDetail(company.id)" class="company">
         <view class="title">
           <view class="logo">
-            <image
-              :src="globalUrl + company.pic_url"
-              alt=""
-              class="logo-img"
-              mode="aspectFit"
-            />
+            <image :src="globalUrl + company.pic_url" alt="" class="logo-img" mode="aspectFit"/>
           </view>
           <view class="name">
             {{ company.name }}

+ 6 - 1
pages/metrics/index.vue

@@ -15,7 +15,7 @@
 	
 		<qiun-title-bar title="规上工业企业"/>
 	    <view class="block-box display-wrap items-center" style="justify-content: space-evenly;height: 340rpx;">
-			 <view class="block-box-content" style="background-color: #77AFCA;">
+			 <view class="block-box-content" style="background-color: #77AFCA;" @click="goScale()">
 				 <view>规上工业企业</view>
 				 <view>21</view>
 			 </view>
@@ -217,6 +217,11 @@
 		  },
 		  bindDateCityChange(){
 			  this.sortSelect = this.arrayNewCity[e.target.value]
+		  },
+		  goScale(){
+			  uni.navigateTo({
+			  	url:'./largeScale/index'
+			  })
 		  }
 	  }
 	};

+ 8 - 0
pages/metrics/largeScale/detail.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 216 - 0
pages/metrics/largeScale/index.vue

@@ -0,0 +1,216 @@
+<template>
+	<view class="content-box">
+		
+		<view class="uni-list title-date-box" style="border: none;">
+			<view class="uni-list-cell">
+				<view class="uni-list-cell-db display-flex-start" style="padding-left: 10rpx;">
+					<picker :range="arraySort" :value="sortSelect"  @change="bindSortChange" class="picker-class" style="width: 35%;">
+						<view class="uni-input display-between items-center" style="color: #707070;">{{sortSelect}}<image src="/static/arrow_down.svg" mode="aspectFit"></image></view>
+					</picker>
+				</view>
+			</view>
+		</view>
+		
+		<view class="companys">
+		  <!-- <view>推荐企业</view> -->
+		  <view  v-for="(company, index) in companyList" :key="index" @tap="toDetail(company.id)" class="company">
+			<image src="/static/selfCenter/add-icon.png" mode="aspectFit" class="addIcon"></image> 
+		    <view class="title">
+		      <view class="logo">
+		        <!-- <image :src="globalUrl + company.pic_url" alt="" class="logo-img" mode="aspectFit"/> -->
+				<image src="/static/nodata.svg" alt="" class="logo-img" mode="aspectFit"/>
+		      </view>
+		      <view class="name">
+		        {{ company.name }}
+		      </view>
+		    </view>
+		    <view class="info">
+		      <view class="view">
+		        <view class="info_t">亩均排序</view>
+		        <view class="name">
+		          {{ company.representative }}
+		        </view>
+		      </view>
+		      <view class="line"></view>
+		      <view class="view">
+		        <view class="info_t">总产值</view>
+		        {{ company.capital }}(亿元)
+			<!-- 	 <text v-if="company.capital_type == '1'">美元</text>
+				 <text v-else>人民币</text> -->
+		      </view>
+		      <view class="line"></view>
+		      <view class="view">
+		        <view class="info_t">产值增速</view>
+		        {{ company.found_date }}
+		      </view>
+		    </view>
+		  </view>
+		</view>
+		
+		
+		
+	</view>
+</template>
+
+<script>
+	import md5 from "@/common/md5.js";
+	export default {
+	  data() {
+		  return{
+			  arraySort:['全部','一至当月产值','当月产值','一至当月产值增速','当月产值增速','亩均排序'],
+			  sortSelect:'全部',
+			  companyList: [],
+			  globalUrl:getApp().globalData.shareUrl,
+		 }
+	  },
+	  onLoad() {
+	    this.getCompany();
+	  },
+	  methods:{
+		  bindSortChange(e){
+			  this.sortSelect = this.arraySort[e.target.value]
+		  },
+		  goScale(){
+			  uni.navigateTo({
+			  	url:'./largeScale/index'
+			  })
+		  },
+		  getCompany() {
+		    let md5Sign = md5(
+		      "method=" +
+		        "common" +
+		        "&timestamp=" +
+		        getApp().globalData.globalTimestamp +
+		        "&secret=" +
+		        getApp().globalData.secret
+		    );
+		    let url =
+		      getApp().globalData.shareUrl +
+		      "api/api.php" +
+		      "?method=common&source=company&action=list&timestamp=" +
+		      getApp().globalData.globalTimestamp +
+		      "&sign=" +
+		      md5Sign;
+		    let postData = {
+		      s_pub: "1",
+		  	order_by : "weight desc,id desc"
+		    };
+		    uni.request({
+		      url: url,
+		      method: "POST",
+		      header: {
+		        "content-type": "application/x-www-form-urlencoded",
+		      },
+		      data: postData,
+		      success: (res) => {
+		        if (res.data.code === 200) {
+		          let list = res.data.data.list;
+		          console.log(res.data.data.list);
+		          list.forEach((e, i) => {
+		            let { pic_url, name, representative, capital, capital_type, found_date, id } = e;
+		            list[i] = {
+		              pic_url,
+		              name,
+		              representative,
+		              capital,
+		  			capital_type,
+		              found_date,
+		              id,
+		            };
+		          });
+		          this.companyList = list;
+		        }
+		      },
+		      fail: () => {
+		        console.log("连接失败");
+		      },
+		    });
+		  },
+	  }
+	};
+</script>
+
+<style lang="scss">
+	.content-box {
+		display: flex;
+		flex-direction: column;
+		flex: 1;
+	}
+	.title-date-box {
+		margin-top: 10px;
+		border-bottom: 1px solid #d7d7d7;
+		padding-bottom: 10px;
+	}
+	.picker-class {
+		border-radius: 10rpx;
+		padding: 10rpx;
+		width: 180rpx;
+		font-size: 28rpx;
+		background: #f5f5f5;
+		margin-left: 20rpx;
+	}
+	.picker-class image {
+		width: 26rpx;
+		height: 26rpx;
+	}
+	.companys {
+	  // margin-top: 3%;
+	  padding: 0 4%;
+	  .company {
+	    border-radius: 20rpx;
+	    box-shadow: rgba(0, 0, 0, 0.35) 0rpx 5rpx 15rpx;
+	    padding: 2%;
+	    margin: 3% 0;
+		position: relative;
+		.addIcon{
+			 width: 60rpx;
+			 height: 60rpx;
+			 position: absolute;
+			 right: 20rpx;
+		 }
+	    .title {
+	      display: flex;
+	      align-items: center;
+	      .logo {
+	        margin-right: 30rpx;
+	        display: flex;
+	        justify-content: center;
+	        align-items: center;
+	        overflow: hidden;
+	        width: 150rpx;
+	        height: 100rpx;
+	        overflow: hidden;
+	        .logo-img {
+	          max-width: 100%;
+	          max-height: 100%;
+	        }
+	      }
+	    }
+	    .line {
+	      width: 2rpx;
+	      height: 70rpx;
+	      background: rgb(175, 186, 197);
+	    }
+	    .info {
+	      font-size: 24rpx;
+	      font-weight: 100;
+	      display: flex;
+	      text-align: center;
+	      justify-content: space-around;
+	      align-items: center;
+	      padding: 0 2%;
+	      margin-top: 2%;
+	      .view {
+	        margin-top: 2%;
+	        font-size: 26rpx;
+	        // .name {
+	        //   color: #02a7f0;
+	        // }
+	        .info_t {
+	          margin-bottom: 10rpx;
+	        }
+	      }
+	    }
+	  }
+	}
+</style>

BIN
static/selfCenter/add-icon.png