|
|
@@ -10,7 +10,7 @@
|
|
|
>
|
|
|
<swiper-item v-for="(item, index) in swiperList" :key="index">
|
|
|
<image
|
|
|
- :src="item.img"
|
|
|
+ :src="item.pic_path"
|
|
|
mode="aspectFill"
|
|
|
style="width: 100%; height: 100%"
|
|
|
></image>
|
|
|
@@ -19,7 +19,7 @@
|
|
|
</view>
|
|
|
<view class="input-box">
|
|
|
<image src="/static/policy/u377.png" alt="" />
|
|
|
- <input type="text" placeholder="请输入政策关键词搜索" />
|
|
|
+ <input type="text" placeholder="请输入政策关键词搜索" confirm-type="search" @confirm="searchPoliy()" v-model="searchVal"/>
|
|
|
</view>
|
|
|
<view class="policy-box">
|
|
|
<view class="policy-title"><p>最新政策</p></view>
|
|
|
@@ -29,7 +29,7 @@
|
|
|
:key="idx"
|
|
|
:class="{ active: active === idx }"
|
|
|
class="policy-item-name"
|
|
|
- @click="active = idx"
|
|
|
+ @click="changePolicyTabs(idx)"
|
|
|
>
|
|
|
{{ item }}
|
|
|
</view>
|
|
|
@@ -39,18 +39,18 @@
|
|
|
class="policy-content-item"
|
|
|
v-for="(item, idx) in policyData"
|
|
|
:key="idx"
|
|
|
- @click="enterPolicyDeatil(item)"
|
|
|
+ @click="enterPolicyDeatil(item.id)"
|
|
|
>
|
|
|
<view class="policy-content-item-left">
|
|
|
- <p class="policy-content-item-left-title">{{ item.title }}</p>
|
|
|
+ <p class="policy-content-item-left-title" style="height: 70rpx;">{{ item.title }}</p>
|
|
|
<view class="policy-content-item-left-time">
|
|
|
- <p class="moment">{{ item.moment }}</p>
|
|
|
- <p class="maxMony">{{ item.maxMony }}</p>
|
|
|
- <p class="leftDay">{{ item.leftDay }}</p>
|
|
|
+ <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.img" alt="" />
|
|
|
+ <image :src="item.pic_url" alt="" />
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -59,22 +59,23 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import md5 from "@/common/md5.js";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
swiperList: [
|
|
|
- {
|
|
|
- img: "/static/swiper/swiper1.jpg",
|
|
|
- },
|
|
|
- {
|
|
|
- img: "/static/swiper/swiper2.jpg",
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // img: "/static/swiper/swiper1.jpg",
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // img: "/static/swiper/swiper2.jpg",
|
|
|
+ // },
|
|
|
],
|
|
|
policyList: ["省级政策", "市级政策", "区级政策", "新城政策"],
|
|
|
active: 0,
|
|
|
+ searchVal:'',
|
|
|
policyData: new Array(5).fill({
|
|
|
- title:
|
|
|
- "工业金额信息化部办公厅 组织开2021念工业互联网平台创新互联网工业文化产业项目征集工作。",
|
|
|
+ title:"工业金额信息化部办公厅 组织开2021念工业互联网平台创新互联网工业文化产业项目征集工作。",
|
|
|
moment: "2021-07-12",
|
|
|
maxMony: "最高500.00万",
|
|
|
leftDay: "剩5天",
|
|
|
@@ -82,17 +83,138 @@ export default {
|
|
|
}),
|
|
|
};
|
|
|
},
|
|
|
- onLoad() {},
|
|
|
+ onLoad() {
|
|
|
+ this.getPolicySwiper()
|
|
|
+ this.getPolicyList()
|
|
|
+ },
|
|
|
methods: {
|
|
|
- enterPolicyDeatil(data) {
|
|
|
- let id = { data };
|
|
|
- if (!id) {
|
|
|
- id = "ILoveYou";
|
|
|
- }
|
|
|
+ enterPolicyDeatil(id) {
|
|
|
uni.navigateTo({
|
|
|
url: "/pages/policy/policy_deatil?id=" + id,
|
|
|
});
|
|
|
},
|
|
|
+ changePolicyTabs(idx){
|
|
|
+ let that = this;
|
|
|
+ that.active = idx;
|
|
|
+ switch (idx){
|
|
|
+ case 0:
|
|
|
+ that.getPolicyList('1')
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ that.getPolicyList('2')
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ that.getPolicyList('3')
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ that.getPolicyList('4')
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ searchPoliy(){
|
|
|
+ let md5Sign = md5(
|
|
|
+ "method=" +
|
|
|
+ "common" +
|
|
|
+ "×tamp=" +
|
|
|
+ getApp().globalData.globalTimestamp +
|
|
|
+ "&secret=" +
|
|
|
+ getApp().globalData.secret
|
|
|
+ );
|
|
|
+ let url = getApp().globalData.shareUrl +"api/api.php" +"?method=common&source=policy&action=list×tamp=" +getApp().globalData.globalTimestamp +"&sign=" +md5Sign;
|
|
|
+ uni.request({
|
|
|
+ url: url,
|
|
|
+ method: "POST",
|
|
|
+ header: {
|
|
|
+ "content-type": "application/x-www-form-urlencoded",
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ ss_content_text:this.searchVal //1.省 2.市 3.区 4.新城
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res);
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ console.log("连接失败");
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getPolicySwiper() {
|
|
|
+ let md5Sign = md5(
|
|
|
+ "method=" +
|
|
|
+ "common" +
|
|
|
+ "×tamp=" +
|
|
|
+ getApp().globalData.globalTimestamp +
|
|
|
+ "&secret=" +
|
|
|
+ getApp().globalData.secret
|
|
|
+ );
|
|
|
+ let url =
|
|
|
+ getApp().globalData.shareUrl +
|
|
|
+ "api/api.php" +
|
|
|
+ "?method=common&source=policy_pics&action=list×tamp=" +
|
|
|
+ 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,
|
|
|
+ // page: 1,
|
|
|
+ // page_size: 7,
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res);
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ res.data.data.list.forEach((item) => {
|
|
|
+ item.pic_path = getApp().globalData.shareUrl + item.pic_path;
|
|
|
+ });
|
|
|
+ this.swiperList = res.data.data.list;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ console.log("连接失败");
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getPolicyList(level) {
|
|
|
+ let md5Sign = md5(
|
|
|
+ "method=" +
|
|
|
+ "common" +
|
|
|
+ "×tamp=" +
|
|
|
+ getApp().globalData.globalTimestamp +
|
|
|
+ "&secret=" +
|
|
|
+ getApp().globalData.secret
|
|
|
+ );
|
|
|
+ let url = getApp().globalData.shareUrl +"api/api.php" +"?method=common&source=policy&action=list×tamp=" +getApp().globalData.globalTimestamp +"&sign=" +md5Sign;
|
|
|
+ uni.request({
|
|
|
+ url: url,
|
|
|
+ method: "POST",
|
|
|
+ header: {
|
|
|
+ "content-type": "application/x-www-form-urlencoded",
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ s_level:level || '1' //1.省 2.市 3.区 4.新城
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res);
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ res.data.data.list.forEach((item) => {
|
|
|
+ item.pic_url = getApp().globalData.shareUrl + item.pic_url;
|
|
|
+ });
|
|
|
+ this.policyData = res.data.data.list;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ console.log("连接失败");
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -115,8 +237,8 @@ export default {
|
|
|
image {
|
|
|
position: absolute;
|
|
|
left: 72rpx;
|
|
|
- width: 40rpx;
|
|
|
- height: 40rpx;
|
|
|
+ width: 30rpx;
|
|
|
+ height: 30rpx;
|
|
|
}
|
|
|
input {
|
|
|
background-color: #ffffff;
|
|
|
@@ -152,8 +274,7 @@ export default {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
margin: 0 20rpx;
|
|
|
- margin-top: 10rpx;
|
|
|
-
|
|
|
+ margin-top: 20rpx;
|
|
|
.policy-item-name {
|
|
|
padding-bottom: 10rpx;
|
|
|
font-size: 27rpx;
|
|
|
@@ -168,6 +289,7 @@ export default {
|
|
|
display: flex;
|
|
|
box-sizing: border-box;
|
|
|
flex-direction: column;
|
|
|
+ margin-top: 10rpx;
|
|
|
.policy-content-item {
|
|
|
margin: 0 20rpx;
|
|
|
display: flex;
|