diff --git a/packageB/subsidy/subsidy.json b/packageB/subsidy/subsidy.json index 5177fb0..66c5ea9 100644 --- a/packageB/subsidy/subsidy.json +++ b/packageB/subsidy/subsidy.json @@ -1,5 +1,7 @@ { - "usingComponents": {}, + "usingComponents": { + "van-icon":"../../miniprogram_npm/@vant/weapp/icon/index" + }, "navigationBarTitleText": "采暖补贴", "navigationBarBackgroundColor": "#f8f8f8" } \ No newline at end of file diff --git a/packageB/subsidy/subsidy.json b/packageB/subsidy/subsidy.json index 5177fb0..66c5ea9 100644 --- a/packageB/subsidy/subsidy.json +++ b/packageB/subsidy/subsidy.json @@ -1,5 +1,7 @@ { - "usingComponents": {}, + "usingComponents": { + "van-icon":"../../miniprogram_npm/@vant/weapp/icon/index" + }, "navigationBarTitleText": "采暖补贴", "navigationBarBackgroundColor": "#f8f8f8" } \ No newline at end of file diff --git a/packageB/subsidy/subsidy.wxml b/packageB/subsidy/subsidy.wxml index 97c36a5..39f9148 100644 --- a/packageB/subsidy/subsidy.wxml +++ b/packageB/subsidy/subsidy.wxml @@ -6,9 +6,13 @@ 补贴政策 - + + + 北京自采暖补贴二次报数开启 ****** + + diff --git a/packageB/subsidy/subsidy.json b/packageB/subsidy/subsidy.json index 5177fb0..66c5ea9 100644 --- a/packageB/subsidy/subsidy.json +++ b/packageB/subsidy/subsidy.json @@ -1,5 +1,7 @@ { - "usingComponents": {}, + "usingComponents": { + "van-icon":"../../miniprogram_npm/@vant/weapp/icon/index" + }, "navigationBarTitleText": "采暖补贴", "navigationBarBackgroundColor": "#f8f8f8" } \ No newline at end of file diff --git a/packageB/subsidy/subsidy.wxml b/packageB/subsidy/subsidy.wxml index 97c36a5..39f9148 100644 --- a/packageB/subsidy/subsidy.wxml +++ b/packageB/subsidy/subsidy.wxml @@ -6,9 +6,13 @@ 补贴政策 - + + + 北京自采暖补贴二次报数开启 ****** + + diff --git a/packageB/subsidy/subsidy.wxss b/packageB/subsidy/subsidy.wxss index 2588c6d..bd61588 100644 --- a/packageB/subsidy/subsidy.wxss +++ b/packageB/subsidy/subsidy.wxss @@ -30,11 +30,16 @@ } .content-item{ - padding: 20rpx 130rpx; + display: flex; + justify-content: space-between; + padding: 20rpx 20rpx 20rpx 70rpx; border-bottom: 2rpx solid #eee; } .content-item-top{ font-weight: 500; margin-bottom: 14rpx; +} +.content-item-bottom{ + color: rgb(124, 119, 119); } \ No newline at end of file diff --git a/packageB/subsidy/subsidy.json b/packageB/subsidy/subsidy.json index 5177fb0..66c5ea9 100644 --- a/packageB/subsidy/subsidy.json +++ b/packageB/subsidy/subsidy.json @@ -1,5 +1,7 @@ { - "usingComponents": {}, + "usingComponents": { + "van-icon":"../../miniprogram_npm/@vant/weapp/icon/index" + }, "navigationBarTitleText": "采暖补贴", "navigationBarBackgroundColor": "#f8f8f8" } \ No newline at end of file diff --git a/packageB/subsidy/subsidy.wxml b/packageB/subsidy/subsidy.wxml index 97c36a5..39f9148 100644 --- a/packageB/subsidy/subsidy.wxml +++ b/packageB/subsidy/subsidy.wxml @@ -6,9 +6,13 @@ 补贴政策 - + + + 北京自采暖补贴二次报数开启 ****** + + diff --git a/packageB/subsidy/subsidy.wxss b/packageB/subsidy/subsidy.wxss index 2588c6d..bd61588 100644 --- a/packageB/subsidy/subsidy.wxss +++ b/packageB/subsidy/subsidy.wxss @@ -30,11 +30,16 @@ } .content-item{ - padding: 20rpx 130rpx; + display: flex; + justify-content: space-between; + padding: 20rpx 20rpx 20rpx 70rpx; border-bottom: 2rpx solid #eee; } .content-item-top{ font-weight: 500; margin-bottom: 14rpx; +} +.content-item-bottom{ + color: rgb(124, 119, 119); } \ No newline at end of file diff --git a/pages/guide/index.js b/pages/guide/index.js index 1444e20..7d8fcfd 100644 --- a/pages/guide/index.js +++ b/pages/guide/index.js @@ -4,7 +4,7 @@ login } from '../../utils/request'; import { judgeMyApi } from '../../utils/util/index' -import {getBanner} from '../../utils/api/index' +import {getBanner,getRecommend} from '../../utils/api/index' Page({ data: { isLogin: false, @@ -38,7 +38,8 @@ id: 'subsidy', name: '采暖补贴' }, - ], + ], + RecommendList:[],//推荐列表 gridTwoList: [ { id: 'kefu', @@ -53,11 +54,32 @@ ] }, onLoad: async function (options) { - await this.wxLogin(); - const res = await getBanner({bannerName:'',bannerModule:''}) - console.log(res) + await this.wxLogin(); + const baseUrl = 'https://kitchen.smartlog.work' + //获取到轮播图 + const getBannerList = await getBanner({bannerName:'',bannerModule:''}) + //获取到推荐列表 + const getRecommendList = await getRecommend({recommendTitle:'',recommendType:''}) + //拼接轮播图url + let backgroundList = getBannerList.rows.map(item=>{ + if(item.bannerPicture !== ''){ + item.bannerPicture = `${baseUrl}/static/${item.bannerPicture}` + } + return item + }) + //对没有图片的数据筛选掉 + backgroundList = backgroundList.filter(item=>item.bannerPicture !== '') + let RecommendList = getRecommendList.rows.map(item=>{ + if(item.recommendPicture !== ''){ + item.recommendPicture = `${baseUrl}/static/${item.recommendPicture}` + } + return item + }) + RecommendList = RecommendList.filter(item=>item.recommendPicture !== '') this.setData({ - isLogin: true + isLogin: true, + background:backgroundList, + RecommendList }); let access_token = await wx.getStorageSync('access_token'); if(!access_token) return; diff --git a/packageB/subsidy/subsidy.json b/packageB/subsidy/subsidy.json index 5177fb0..66c5ea9 100644 --- a/packageB/subsidy/subsidy.json +++ b/packageB/subsidy/subsidy.json @@ -1,5 +1,7 @@ { - "usingComponents": {}, + "usingComponents": { + "van-icon":"../../miniprogram_npm/@vant/weapp/icon/index" + }, "navigationBarTitleText": "采暖补贴", "navigationBarBackgroundColor": "#f8f8f8" } \ No newline at end of file diff --git a/packageB/subsidy/subsidy.wxml b/packageB/subsidy/subsidy.wxml index 97c36a5..39f9148 100644 --- a/packageB/subsidy/subsidy.wxml +++ b/packageB/subsidy/subsidy.wxml @@ -6,9 +6,13 @@ 补贴政策 - + + + 北京自采暖补贴二次报数开启 ****** + + diff --git a/packageB/subsidy/subsidy.wxss b/packageB/subsidy/subsidy.wxss index 2588c6d..bd61588 100644 --- a/packageB/subsidy/subsidy.wxss +++ b/packageB/subsidy/subsidy.wxss @@ -30,11 +30,16 @@ } .content-item{ - padding: 20rpx 130rpx; + display: flex; + justify-content: space-between; + padding: 20rpx 20rpx 20rpx 70rpx; border-bottom: 2rpx solid #eee; } .content-item-top{ font-weight: 500; margin-bottom: 14rpx; +} +.content-item-bottom{ + color: rgb(124, 119, 119); } \ No newline at end of file diff --git a/pages/guide/index.js b/pages/guide/index.js index 1444e20..7d8fcfd 100644 --- a/pages/guide/index.js +++ b/pages/guide/index.js @@ -4,7 +4,7 @@ login } from '../../utils/request'; import { judgeMyApi } from '../../utils/util/index' -import {getBanner} from '../../utils/api/index' +import {getBanner,getRecommend} from '../../utils/api/index' Page({ data: { isLogin: false, @@ -38,7 +38,8 @@ id: 'subsidy', name: '采暖补贴' }, - ], + ], + RecommendList:[],//推荐列表 gridTwoList: [ { id: 'kefu', @@ -53,11 +54,32 @@ ] }, onLoad: async function (options) { - await this.wxLogin(); - const res = await getBanner({bannerName:'',bannerModule:''}) - console.log(res) + await this.wxLogin(); + const baseUrl = 'https://kitchen.smartlog.work' + //获取到轮播图 + const getBannerList = await getBanner({bannerName:'',bannerModule:''}) + //获取到推荐列表 + const getRecommendList = await getRecommend({recommendTitle:'',recommendType:''}) + //拼接轮播图url + let backgroundList = getBannerList.rows.map(item=>{ + if(item.bannerPicture !== ''){ + item.bannerPicture = `${baseUrl}/static/${item.bannerPicture}` + } + return item + }) + //对没有图片的数据筛选掉 + backgroundList = backgroundList.filter(item=>item.bannerPicture !== '') + let RecommendList = getRecommendList.rows.map(item=>{ + if(item.recommendPicture !== ''){ + item.recommendPicture = `${baseUrl}/static/${item.recommendPicture}` + } + return item + }) + RecommendList = RecommendList.filter(item=>item.recommendPicture !== '') this.setData({ - isLogin: true + isLogin: true, + background:backgroundList, + RecommendList }); let access_token = await wx.getStorageSync('access_token'); if(!access_token) return; diff --git a/pages/guide/index.wxml b/pages/guide/index.wxml index 4e4e997..64ec597 100644 --- a/pages/guide/index.wxml +++ b/pages/guide/index.wxml @@ -3,7 +3,7 @@ - + @@ -35,4 +35,15 @@ {{item.name}} + + + + 精选好物 + 更多 + + + + + + \ No newline at end of file diff --git a/packageB/subsidy/subsidy.json b/packageB/subsidy/subsidy.json index 5177fb0..66c5ea9 100644 --- a/packageB/subsidy/subsidy.json +++ b/packageB/subsidy/subsidy.json @@ -1,5 +1,7 @@ { - "usingComponents": {}, + "usingComponents": { + "van-icon":"../../miniprogram_npm/@vant/weapp/icon/index" + }, "navigationBarTitleText": "采暖补贴", "navigationBarBackgroundColor": "#f8f8f8" } \ No newline at end of file diff --git a/packageB/subsidy/subsidy.wxml b/packageB/subsidy/subsidy.wxml index 97c36a5..39f9148 100644 --- a/packageB/subsidy/subsidy.wxml +++ b/packageB/subsidy/subsidy.wxml @@ -6,9 +6,13 @@ 补贴政策 - + + + 北京自采暖补贴二次报数开启 ****** + + diff --git a/packageB/subsidy/subsidy.wxss b/packageB/subsidy/subsidy.wxss index 2588c6d..bd61588 100644 --- a/packageB/subsidy/subsidy.wxss +++ b/packageB/subsidy/subsidy.wxss @@ -30,11 +30,16 @@ } .content-item{ - padding: 20rpx 130rpx; + display: flex; + justify-content: space-between; + padding: 20rpx 20rpx 20rpx 70rpx; border-bottom: 2rpx solid #eee; } .content-item-top{ font-weight: 500; margin-bottom: 14rpx; +} +.content-item-bottom{ + color: rgb(124, 119, 119); } \ No newline at end of file diff --git a/pages/guide/index.js b/pages/guide/index.js index 1444e20..7d8fcfd 100644 --- a/pages/guide/index.js +++ b/pages/guide/index.js @@ -4,7 +4,7 @@ login } from '../../utils/request'; import { judgeMyApi } from '../../utils/util/index' -import {getBanner} from '../../utils/api/index' +import {getBanner,getRecommend} from '../../utils/api/index' Page({ data: { isLogin: false, @@ -38,7 +38,8 @@ id: 'subsidy', name: '采暖补贴' }, - ], + ], + RecommendList:[],//推荐列表 gridTwoList: [ { id: 'kefu', @@ -53,11 +54,32 @@ ] }, onLoad: async function (options) { - await this.wxLogin(); - const res = await getBanner({bannerName:'',bannerModule:''}) - console.log(res) + await this.wxLogin(); + const baseUrl = 'https://kitchen.smartlog.work' + //获取到轮播图 + const getBannerList = await getBanner({bannerName:'',bannerModule:''}) + //获取到推荐列表 + const getRecommendList = await getRecommend({recommendTitle:'',recommendType:''}) + //拼接轮播图url + let backgroundList = getBannerList.rows.map(item=>{ + if(item.bannerPicture !== ''){ + item.bannerPicture = `${baseUrl}/static/${item.bannerPicture}` + } + return item + }) + //对没有图片的数据筛选掉 + backgroundList = backgroundList.filter(item=>item.bannerPicture !== '') + let RecommendList = getRecommendList.rows.map(item=>{ + if(item.recommendPicture !== ''){ + item.recommendPicture = `${baseUrl}/static/${item.recommendPicture}` + } + return item + }) + RecommendList = RecommendList.filter(item=>item.recommendPicture !== '') this.setData({ - isLogin: true + isLogin: true, + background:backgroundList, + RecommendList }); let access_token = await wx.getStorageSync('access_token'); if(!access_token) return; diff --git a/pages/guide/index.wxml b/pages/guide/index.wxml index 4e4e997..64ec597 100644 --- a/pages/guide/index.wxml +++ b/pages/guide/index.wxml @@ -3,7 +3,7 @@ - + @@ -35,4 +35,15 @@ {{item.name}} + + + + 精选好物 + 更多 + + + + + + \ No newline at end of file diff --git a/pages/guide/index.wxss b/pages/guide/index.wxss index 94d1c2d..62f724f 100644 --- a/pages/guide/index.wxss +++ b/pages/guide/index.wxss @@ -71,4 +71,32 @@ .grid-text { color: rgba(0, 0, 0, 1) !important; font-size: 36rpx !important; +} +.recommend{ + padding: 20rpx; + margin-bottom: 120rpx; +} +.recommend-top{ + display: flex; + justify-content: space-between; +} +.recommend-title{ + font-size: 38rpx; +} +.recommend-right{ + margin-top: 10rpx; + font-size: 28rpx; + color: #ccc; +} +.recommend-content{ + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} +.content-item{ + width: 320rpx; + margin-top: 55rpx; +} +.item-image{ + width: 100%; } \ No newline at end of file diff --git a/packageB/subsidy/subsidy.json b/packageB/subsidy/subsidy.json index 5177fb0..66c5ea9 100644 --- a/packageB/subsidy/subsidy.json +++ b/packageB/subsidy/subsidy.json @@ -1,5 +1,7 @@ { - "usingComponents": {}, + "usingComponents": { + "van-icon":"../../miniprogram_npm/@vant/weapp/icon/index" + }, "navigationBarTitleText": "采暖补贴", "navigationBarBackgroundColor": "#f8f8f8" } \ No newline at end of file diff --git a/packageB/subsidy/subsidy.wxml b/packageB/subsidy/subsidy.wxml index 97c36a5..39f9148 100644 --- a/packageB/subsidy/subsidy.wxml +++ b/packageB/subsidy/subsidy.wxml @@ -6,9 +6,13 @@ 补贴政策 - + + + 北京自采暖补贴二次报数开启 ****** + + diff --git a/packageB/subsidy/subsidy.wxss b/packageB/subsidy/subsidy.wxss index 2588c6d..bd61588 100644 --- a/packageB/subsidy/subsidy.wxss +++ b/packageB/subsidy/subsidy.wxss @@ -30,11 +30,16 @@ } .content-item{ - padding: 20rpx 130rpx; + display: flex; + justify-content: space-between; + padding: 20rpx 20rpx 20rpx 70rpx; border-bottom: 2rpx solid #eee; } .content-item-top{ font-weight: 500; margin-bottom: 14rpx; +} +.content-item-bottom{ + color: rgb(124, 119, 119); } \ No newline at end of file diff --git a/pages/guide/index.js b/pages/guide/index.js index 1444e20..7d8fcfd 100644 --- a/pages/guide/index.js +++ b/pages/guide/index.js @@ -4,7 +4,7 @@ login } from '../../utils/request'; import { judgeMyApi } from '../../utils/util/index' -import {getBanner} from '../../utils/api/index' +import {getBanner,getRecommend} from '../../utils/api/index' Page({ data: { isLogin: false, @@ -38,7 +38,8 @@ id: 'subsidy', name: '采暖补贴' }, - ], + ], + RecommendList:[],//推荐列表 gridTwoList: [ { id: 'kefu', @@ -53,11 +54,32 @@ ] }, onLoad: async function (options) { - await this.wxLogin(); - const res = await getBanner({bannerName:'',bannerModule:''}) - console.log(res) + await this.wxLogin(); + const baseUrl = 'https://kitchen.smartlog.work' + //获取到轮播图 + const getBannerList = await getBanner({bannerName:'',bannerModule:''}) + //获取到推荐列表 + const getRecommendList = await getRecommend({recommendTitle:'',recommendType:''}) + //拼接轮播图url + let backgroundList = getBannerList.rows.map(item=>{ + if(item.bannerPicture !== ''){ + item.bannerPicture = `${baseUrl}/static/${item.bannerPicture}` + } + return item + }) + //对没有图片的数据筛选掉 + backgroundList = backgroundList.filter(item=>item.bannerPicture !== '') + let RecommendList = getRecommendList.rows.map(item=>{ + if(item.recommendPicture !== ''){ + item.recommendPicture = `${baseUrl}/static/${item.recommendPicture}` + } + return item + }) + RecommendList = RecommendList.filter(item=>item.recommendPicture !== '') this.setData({ - isLogin: true + isLogin: true, + background:backgroundList, + RecommendList }); let access_token = await wx.getStorageSync('access_token'); if(!access_token) return; diff --git a/pages/guide/index.wxml b/pages/guide/index.wxml index 4e4e997..64ec597 100644 --- a/pages/guide/index.wxml +++ b/pages/guide/index.wxml @@ -3,7 +3,7 @@ - + @@ -35,4 +35,15 @@ {{item.name}} + + + + 精选好物 + 更多 + + + + + + \ No newline at end of file diff --git a/pages/guide/index.wxss b/pages/guide/index.wxss index 94d1c2d..62f724f 100644 --- a/pages/guide/index.wxss +++ b/pages/guide/index.wxss @@ -71,4 +71,32 @@ .grid-text { color: rgba(0, 0, 0, 1) !important; font-size: 36rpx !important; +} +.recommend{ + padding: 20rpx; + margin-bottom: 120rpx; +} +.recommend-top{ + display: flex; + justify-content: space-between; +} +.recommend-title{ + font-size: 38rpx; +} +.recommend-right{ + margin-top: 10rpx; + font-size: 28rpx; + color: #ccc; +} +.recommend-content{ + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} +.content-item{ + width: 320rpx; + margin-top: 55rpx; +} +.item-image{ + width: 100%; } \ No newline at end of file diff --git a/pages/mine/mine.js b/pages/mine/mine.js index 00f02f6..56258c7 100644 --- a/pages/mine/mine.js +++ b/pages/mine/mine.js @@ -78,15 +78,21 @@ onLoad(options) { }, - //点我授权 - handleSq() { - getUserProfile(this.onAuthSuccess); - }, + onChooseAvatar(e) { + console.log(e) + const { avatarUrl } = e.detail + this.setData({ + avatarUrl, + isShow:false + }) + }, getUserProfile(e) { + console.log(e) // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 wx.getUserProfile({ desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 success: (res) => { + console.log(res) this.setData({ avatarUrl: res.userInfo.avatarUrl, isShow:false, diff --git a/packageB/subsidy/subsidy.json b/packageB/subsidy/subsidy.json index 5177fb0..66c5ea9 100644 --- a/packageB/subsidy/subsidy.json +++ b/packageB/subsidy/subsidy.json @@ -1,5 +1,7 @@ { - "usingComponents": {}, + "usingComponents": { + "van-icon":"../../miniprogram_npm/@vant/weapp/icon/index" + }, "navigationBarTitleText": "采暖补贴", "navigationBarBackgroundColor": "#f8f8f8" } \ No newline at end of file diff --git a/packageB/subsidy/subsidy.wxml b/packageB/subsidy/subsidy.wxml index 97c36a5..39f9148 100644 --- a/packageB/subsidy/subsidy.wxml +++ b/packageB/subsidy/subsidy.wxml @@ -6,9 +6,13 @@ 补贴政策 - + + + 北京自采暖补贴二次报数开启 ****** + + diff --git a/packageB/subsidy/subsidy.wxss b/packageB/subsidy/subsidy.wxss index 2588c6d..bd61588 100644 --- a/packageB/subsidy/subsidy.wxss +++ b/packageB/subsidy/subsidy.wxss @@ -30,11 +30,16 @@ } .content-item{ - padding: 20rpx 130rpx; + display: flex; + justify-content: space-between; + padding: 20rpx 20rpx 20rpx 70rpx; border-bottom: 2rpx solid #eee; } .content-item-top{ font-weight: 500; margin-bottom: 14rpx; +} +.content-item-bottom{ + color: rgb(124, 119, 119); } \ No newline at end of file diff --git a/pages/guide/index.js b/pages/guide/index.js index 1444e20..7d8fcfd 100644 --- a/pages/guide/index.js +++ b/pages/guide/index.js @@ -4,7 +4,7 @@ login } from '../../utils/request'; import { judgeMyApi } from '../../utils/util/index' -import {getBanner} from '../../utils/api/index' +import {getBanner,getRecommend} from '../../utils/api/index' Page({ data: { isLogin: false, @@ -38,7 +38,8 @@ id: 'subsidy', name: '采暖补贴' }, - ], + ], + RecommendList:[],//推荐列表 gridTwoList: [ { id: 'kefu', @@ -53,11 +54,32 @@ ] }, onLoad: async function (options) { - await this.wxLogin(); - const res = await getBanner({bannerName:'',bannerModule:''}) - console.log(res) + await this.wxLogin(); + const baseUrl = 'https://kitchen.smartlog.work' + //获取到轮播图 + const getBannerList = await getBanner({bannerName:'',bannerModule:''}) + //获取到推荐列表 + const getRecommendList = await getRecommend({recommendTitle:'',recommendType:''}) + //拼接轮播图url + let backgroundList = getBannerList.rows.map(item=>{ + if(item.bannerPicture !== ''){ + item.bannerPicture = `${baseUrl}/static/${item.bannerPicture}` + } + return item + }) + //对没有图片的数据筛选掉 + backgroundList = backgroundList.filter(item=>item.bannerPicture !== '') + let RecommendList = getRecommendList.rows.map(item=>{ + if(item.recommendPicture !== ''){ + item.recommendPicture = `${baseUrl}/static/${item.recommendPicture}` + } + return item + }) + RecommendList = RecommendList.filter(item=>item.recommendPicture !== '') this.setData({ - isLogin: true + isLogin: true, + background:backgroundList, + RecommendList }); let access_token = await wx.getStorageSync('access_token'); if(!access_token) return; diff --git a/pages/guide/index.wxml b/pages/guide/index.wxml index 4e4e997..64ec597 100644 --- a/pages/guide/index.wxml +++ b/pages/guide/index.wxml @@ -3,7 +3,7 @@ - + @@ -35,4 +35,15 @@ {{item.name}} + + + + 精选好物 + 更多 + + + + + + \ No newline at end of file diff --git a/pages/guide/index.wxss b/pages/guide/index.wxss index 94d1c2d..62f724f 100644 --- a/pages/guide/index.wxss +++ b/pages/guide/index.wxss @@ -71,4 +71,32 @@ .grid-text { color: rgba(0, 0, 0, 1) !important; font-size: 36rpx !important; +} +.recommend{ + padding: 20rpx; + margin-bottom: 120rpx; +} +.recommend-top{ + display: flex; + justify-content: space-between; +} +.recommend-title{ + font-size: 38rpx; +} +.recommend-right{ + margin-top: 10rpx; + font-size: 28rpx; + color: #ccc; +} +.recommend-content{ + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} +.content-item{ + width: 320rpx; + margin-top: 55rpx; +} +.item-image{ + width: 100%; } \ No newline at end of file diff --git a/pages/mine/mine.js b/pages/mine/mine.js index 00f02f6..56258c7 100644 --- a/pages/mine/mine.js +++ b/pages/mine/mine.js @@ -78,15 +78,21 @@ onLoad(options) { }, - //点我授权 - handleSq() { - getUserProfile(this.onAuthSuccess); - }, + onChooseAvatar(e) { + console.log(e) + const { avatarUrl } = e.detail + this.setData({ + avatarUrl, + isShow:false + }) + }, getUserProfile(e) { + console.log(e) // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 wx.getUserProfile({ desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 success: (res) => { + console.log(res) this.setData({ avatarUrl: res.userInfo.avatarUrl, isShow:false, diff --git a/pages/mine/mine.wxml b/pages/mine/mine.wxml index a120e6d..41f1960 100644 --- a/pages/mine/mine.wxml +++ b/pages/mine/mine.wxml @@ -3,14 +3,12 @@ - - {{nickname}} + - - diff --git a/packageB/subsidy/subsidy.json b/packageB/subsidy/subsidy.json index 5177fb0..66c5ea9 100644 --- a/packageB/subsidy/subsidy.json +++ b/packageB/subsidy/subsidy.json @@ -1,5 +1,7 @@ { - "usingComponents": {}, + "usingComponents": { + "van-icon":"../../miniprogram_npm/@vant/weapp/icon/index" + }, "navigationBarTitleText": "采暖补贴", "navigationBarBackgroundColor": "#f8f8f8" } \ No newline at end of file diff --git a/packageB/subsidy/subsidy.wxml b/packageB/subsidy/subsidy.wxml index 97c36a5..39f9148 100644 --- a/packageB/subsidy/subsidy.wxml +++ b/packageB/subsidy/subsidy.wxml @@ -6,9 +6,13 @@ 补贴政策 - + + + 北京自采暖补贴二次报数开启 ****** + + diff --git a/packageB/subsidy/subsidy.wxss b/packageB/subsidy/subsidy.wxss index 2588c6d..bd61588 100644 --- a/packageB/subsidy/subsidy.wxss +++ b/packageB/subsidy/subsidy.wxss @@ -30,11 +30,16 @@ } .content-item{ - padding: 20rpx 130rpx; + display: flex; + justify-content: space-between; + padding: 20rpx 20rpx 20rpx 70rpx; border-bottom: 2rpx solid #eee; } .content-item-top{ font-weight: 500; margin-bottom: 14rpx; +} +.content-item-bottom{ + color: rgb(124, 119, 119); } \ No newline at end of file diff --git a/pages/guide/index.js b/pages/guide/index.js index 1444e20..7d8fcfd 100644 --- a/pages/guide/index.js +++ b/pages/guide/index.js @@ -4,7 +4,7 @@ login } from '../../utils/request'; import { judgeMyApi } from '../../utils/util/index' -import {getBanner} from '../../utils/api/index' +import {getBanner,getRecommend} from '../../utils/api/index' Page({ data: { isLogin: false, @@ -38,7 +38,8 @@ id: 'subsidy', name: '采暖补贴' }, - ], + ], + RecommendList:[],//推荐列表 gridTwoList: [ { id: 'kefu', @@ -53,11 +54,32 @@ ] }, onLoad: async function (options) { - await this.wxLogin(); - const res = await getBanner({bannerName:'',bannerModule:''}) - console.log(res) + await this.wxLogin(); + const baseUrl = 'https://kitchen.smartlog.work' + //获取到轮播图 + const getBannerList = await getBanner({bannerName:'',bannerModule:''}) + //获取到推荐列表 + const getRecommendList = await getRecommend({recommendTitle:'',recommendType:''}) + //拼接轮播图url + let backgroundList = getBannerList.rows.map(item=>{ + if(item.bannerPicture !== ''){ + item.bannerPicture = `${baseUrl}/static/${item.bannerPicture}` + } + return item + }) + //对没有图片的数据筛选掉 + backgroundList = backgroundList.filter(item=>item.bannerPicture !== '') + let RecommendList = getRecommendList.rows.map(item=>{ + if(item.recommendPicture !== ''){ + item.recommendPicture = `${baseUrl}/static/${item.recommendPicture}` + } + return item + }) + RecommendList = RecommendList.filter(item=>item.recommendPicture !== '') this.setData({ - isLogin: true + isLogin: true, + background:backgroundList, + RecommendList }); let access_token = await wx.getStorageSync('access_token'); if(!access_token) return; diff --git a/pages/guide/index.wxml b/pages/guide/index.wxml index 4e4e997..64ec597 100644 --- a/pages/guide/index.wxml +++ b/pages/guide/index.wxml @@ -3,7 +3,7 @@ - + @@ -35,4 +35,15 @@ {{item.name}} + + + + 精选好物 + 更多 + + + + + + \ No newline at end of file diff --git a/pages/guide/index.wxss b/pages/guide/index.wxss index 94d1c2d..62f724f 100644 --- a/pages/guide/index.wxss +++ b/pages/guide/index.wxss @@ -71,4 +71,32 @@ .grid-text { color: rgba(0, 0, 0, 1) !important; font-size: 36rpx !important; +} +.recommend{ + padding: 20rpx; + margin-bottom: 120rpx; +} +.recommend-top{ + display: flex; + justify-content: space-between; +} +.recommend-title{ + font-size: 38rpx; +} +.recommend-right{ + margin-top: 10rpx; + font-size: 28rpx; + color: #ccc; +} +.recommend-content{ + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} +.content-item{ + width: 320rpx; + margin-top: 55rpx; +} +.item-image{ + width: 100%; } \ No newline at end of file diff --git a/pages/mine/mine.js b/pages/mine/mine.js index 00f02f6..56258c7 100644 --- a/pages/mine/mine.js +++ b/pages/mine/mine.js @@ -78,15 +78,21 @@ onLoad(options) { }, - //点我授权 - handleSq() { - getUserProfile(this.onAuthSuccess); - }, + onChooseAvatar(e) { + console.log(e) + const { avatarUrl } = e.detail + this.setData({ + avatarUrl, + isShow:false + }) + }, getUserProfile(e) { + console.log(e) // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 wx.getUserProfile({ desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 success: (res) => { + console.log(res) this.setData({ avatarUrl: res.userInfo.avatarUrl, isShow:false, diff --git a/pages/mine/mine.wxml b/pages/mine/mine.wxml index a120e6d..41f1960 100644 --- a/pages/mine/mine.wxml +++ b/pages/mine/mine.wxml @@ -3,14 +3,12 @@ - - {{nickname}} + - - diff --git a/pages/mine/mine.wxss b/pages/mine/mine.wxss index acc87cc..1d52479 100644 --- a/pages/mine/mine.wxss +++ b/pages/mine/mine.wxss @@ -21,10 +21,14 @@ } .nickname { margin-top: 20rpx; + text-align: center; +} +.nickname-placeholder{ + text-align: center; } .head-button{ width: 190rpx ; - height: 190rpx ; + height: 190rpx ; border-radius: 50%; padding: 0 !important; } diff --git a/packageB/subsidy/subsidy.json b/packageB/subsidy/subsidy.json index 5177fb0..66c5ea9 100644 --- a/packageB/subsidy/subsidy.json +++ b/packageB/subsidy/subsidy.json @@ -1,5 +1,7 @@ { - "usingComponents": {}, + "usingComponents": { + "van-icon":"../../miniprogram_npm/@vant/weapp/icon/index" + }, "navigationBarTitleText": "采暖补贴", "navigationBarBackgroundColor": "#f8f8f8" } \ No newline at end of file diff --git a/packageB/subsidy/subsidy.wxml b/packageB/subsidy/subsidy.wxml index 97c36a5..39f9148 100644 --- a/packageB/subsidy/subsidy.wxml +++ b/packageB/subsidy/subsidy.wxml @@ -6,9 +6,13 @@ 补贴政策 - + + + 北京自采暖补贴二次报数开启 ****** + + diff --git a/packageB/subsidy/subsidy.wxss b/packageB/subsidy/subsidy.wxss index 2588c6d..bd61588 100644 --- a/packageB/subsidy/subsidy.wxss +++ b/packageB/subsidy/subsidy.wxss @@ -30,11 +30,16 @@ } .content-item{ - padding: 20rpx 130rpx; + display: flex; + justify-content: space-between; + padding: 20rpx 20rpx 20rpx 70rpx; border-bottom: 2rpx solid #eee; } .content-item-top{ font-weight: 500; margin-bottom: 14rpx; +} +.content-item-bottom{ + color: rgb(124, 119, 119); } \ No newline at end of file diff --git a/pages/guide/index.js b/pages/guide/index.js index 1444e20..7d8fcfd 100644 --- a/pages/guide/index.js +++ b/pages/guide/index.js @@ -4,7 +4,7 @@ login } from '../../utils/request'; import { judgeMyApi } from '../../utils/util/index' -import {getBanner} from '../../utils/api/index' +import {getBanner,getRecommend} from '../../utils/api/index' Page({ data: { isLogin: false, @@ -38,7 +38,8 @@ id: 'subsidy', name: '采暖补贴' }, - ], + ], + RecommendList:[],//推荐列表 gridTwoList: [ { id: 'kefu', @@ -53,11 +54,32 @@ ] }, onLoad: async function (options) { - await this.wxLogin(); - const res = await getBanner({bannerName:'',bannerModule:''}) - console.log(res) + await this.wxLogin(); + const baseUrl = 'https://kitchen.smartlog.work' + //获取到轮播图 + const getBannerList = await getBanner({bannerName:'',bannerModule:''}) + //获取到推荐列表 + const getRecommendList = await getRecommend({recommendTitle:'',recommendType:''}) + //拼接轮播图url + let backgroundList = getBannerList.rows.map(item=>{ + if(item.bannerPicture !== ''){ + item.bannerPicture = `${baseUrl}/static/${item.bannerPicture}` + } + return item + }) + //对没有图片的数据筛选掉 + backgroundList = backgroundList.filter(item=>item.bannerPicture !== '') + let RecommendList = getRecommendList.rows.map(item=>{ + if(item.recommendPicture !== ''){ + item.recommendPicture = `${baseUrl}/static/${item.recommendPicture}` + } + return item + }) + RecommendList = RecommendList.filter(item=>item.recommendPicture !== '') this.setData({ - isLogin: true + isLogin: true, + background:backgroundList, + RecommendList }); let access_token = await wx.getStorageSync('access_token'); if(!access_token) return; diff --git a/pages/guide/index.wxml b/pages/guide/index.wxml index 4e4e997..64ec597 100644 --- a/pages/guide/index.wxml +++ b/pages/guide/index.wxml @@ -3,7 +3,7 @@ - + @@ -35,4 +35,15 @@ {{item.name}} + + + + 精选好物 + 更多 + + + + + + \ No newline at end of file diff --git a/pages/guide/index.wxss b/pages/guide/index.wxss index 94d1c2d..62f724f 100644 --- a/pages/guide/index.wxss +++ b/pages/guide/index.wxss @@ -71,4 +71,32 @@ .grid-text { color: rgba(0, 0, 0, 1) !important; font-size: 36rpx !important; +} +.recommend{ + padding: 20rpx; + margin-bottom: 120rpx; +} +.recommend-top{ + display: flex; + justify-content: space-between; +} +.recommend-title{ + font-size: 38rpx; +} +.recommend-right{ + margin-top: 10rpx; + font-size: 28rpx; + color: #ccc; +} +.recommend-content{ + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} +.content-item{ + width: 320rpx; + margin-top: 55rpx; +} +.item-image{ + width: 100%; } \ No newline at end of file diff --git a/pages/mine/mine.js b/pages/mine/mine.js index 00f02f6..56258c7 100644 --- a/pages/mine/mine.js +++ b/pages/mine/mine.js @@ -78,15 +78,21 @@ onLoad(options) { }, - //点我授权 - handleSq() { - getUserProfile(this.onAuthSuccess); - }, + onChooseAvatar(e) { + console.log(e) + const { avatarUrl } = e.detail + this.setData({ + avatarUrl, + isShow:false + }) + }, getUserProfile(e) { + console.log(e) // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 wx.getUserProfile({ desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 success: (res) => { + console.log(res) this.setData({ avatarUrl: res.userInfo.avatarUrl, isShow:false, diff --git a/pages/mine/mine.wxml b/pages/mine/mine.wxml index a120e6d..41f1960 100644 --- a/pages/mine/mine.wxml +++ b/pages/mine/mine.wxml @@ -3,14 +3,12 @@ - - {{nickname}} + - - diff --git a/pages/mine/mine.wxss b/pages/mine/mine.wxss index acc87cc..1d52479 100644 --- a/pages/mine/mine.wxss +++ b/pages/mine/mine.wxss @@ -21,10 +21,14 @@ } .nickname { margin-top: 20rpx; + text-align: center; +} +.nickname-placeholder{ + text-align: center; } .head-button{ width: 190rpx ; - height: 190rpx ; + height: 190rpx ; border-radius: 50%; padding: 0 !important; } diff --git a/utils/api/index.js b/utils/api/index.js index 4d7824e..d4f783e 100644 --- a/utils/api/index.js +++ b/utils/api/index.js @@ -1,8 +1,16 @@ import fetch from '../common/fetch' const baseUrl = 'https://kitchen.smartlog.work' -const getBannerUrl = baseUrl + '/appBannerInfo/mini/listPage' +const getBannerUrl = baseUrl + '/appBannerInfo/listPage' +const getRecommendInfo = baseUrl + '/appRecommendInfo/listPage' + + // 获取banner轮播图 export function getBanner(params) { return fetch.post(getBannerUrl, params).then(res => res); } +// 获取列表推荐详情 +export function getRecommend(params) { + return fetch.post(getRecommendInfo, params).then(res => res); + } +