更新首页接口

main
JING 11 months ago
parent 3ac7ee1737
commit 97c3cb6532
  1. 76
      pages/index/index.vue
  2. 13
      pages/user/account/index.vue

@ -4,7 +4,7 @@
<view class="bannerBox"> <view class="bannerBox">
<u-swiper <u-swiper
:list="banner" :list="banner"
keyName="adImg" keyName="image"
:showTitle="false" :showTitle="false"
:autoplay="true" :autoplay="true"
circular circular
@ -187,11 +187,12 @@
data() { data() {
return { return {
banner: [ banner: [
{ // {
adImg:'/static/img/index/banner.png', // adImg:'/static/img/index/banner.png',
} // }
], ],
notice:'', sceneList:[], //
hotList:[],//
} }
}, },
computed:{ computed:{
@ -199,8 +200,12 @@
}, },
onLoad() { onLoad() {
var _this = this; var _this = this;
// //banner
_this.getHomeInfo(); _this.getBannerList();
//
_this.getSceneMenu();
//
_this.getHotList();
//1 //1
setTimeout(function(res){ setTimeout(function(res){
_this.getUploadConfig(); _this.getUploadConfig();
@ -227,31 +232,58 @@
url: url, url: url,
}); });
}, },
// //banner
getHomeInfo(){ getBannerList(){
var _this =this; var _this =this;
//post _this.$api.get('api/home/banner/list', {},function(res){
/* _this.$api.post('ycl/home', {},function(res){ console.log('banner原始',res);
console.log(res); var banner = res;
var d = res; banner.forEach((item, index) => {
var banner = d.adList banner[index].image = _this.$api.ossurl(item.image);
banner.forEach((item, index) => { });
item.title = item.adName; console.log('banner修正',banner);
}) _this.banner = banner;
_this.banner = banner;
_this.notice = d.notice; });
_this.$user.session('servicePhone',d.servicePhone);
}); */
}, },
// //
getUploadConfig(){ getUploadConfig(){
var _this = this; var _this = this;
var post = {}; var post = {};
_this.$api.get('/api/fileDeploy', post,function(res){ _this.$api.get('api/fileDeploy', post,function(res){
console.log(res); console.log(res);
_this.$user.session('app_config',res); _this.$user.session('app_config',res);
}); });
}, },
//
getSceneMenu(){
var _this =this;
_this.$api.get('api/photo/scene_list', {},function(res){
console.log('场景原始',res);
var sceneList = res;
sceneList.forEach((item, index) => {
sceneList[index].image = _this.$api.ossurl(item.image);
});
console.log('场景修正',sceneList);
_this.sceneList = sceneList;
});
},
//
getHotList(){
var _this =this;
_this.$api.get('api/photo/hot_list', {},function(res){
console.log('热门原始',res);
var hotList = res;
hotList.forEach((item, index) => {
hotList[index].image = _this.$api.ossurl(item.image);
});
console.log('热门修正',hotList);
_this.hotList = hotList;
});
},
// //

@ -51,7 +51,6 @@
maxlength="10" maxlength="10"
v-model="info.nick_name" v-model="info.nick_name"
@focus="showEdit" @focus="showEdit"
@change="nameChange"
></u--input> ></u--input>
</view> </view>
<view class='i_box_5'> <view class='i_box_5'>
@ -131,12 +130,17 @@
修改昵称 修改昵称
</view> </view>
<view class="popupDesc1"> <view class="popupDesc1">
<u--input
placeholder="请输入昵称"
color="#999999"
maxlength="10"
v-model="info.nick_name"
></u--input>
</view> </view>
<view class="popupBtn"> <view class="popupBtn">
<view class="sbtnBox1 a1" @click="close1">取消</view> <view class="sbtnBox1 a1" @click="close1">取消</view>
<view class="sbtnBox1 a2" @click="yes">确认</view> <view class="sbtnBox1 a2" @click="nameChange">确认</view>
</view> </view>
</view> </view>
</u-popup> </u-popup>
@ -239,6 +243,7 @@
{ {
console.log(e); console.log(e);
this.updateUserInfo(); this.updateUserInfo();
this.name_show = false;
}, },
// //
updateUserInfo() updateUserInfo()
@ -329,7 +334,7 @@ border-radius: 15rpx; margin: 0rpx auto; color:#3D3D3D;}
/*特殊的 改变部分*/ /*特殊的 改变部分*/
.i_box_3x{height: 100rpx;min-width: 65.7%; width: auto;font-size: 26rpx;} .i_box_3x{height: 100rpx;min-width: 65.7%; width: auto;font-size: 26rpx;}
::v-deep .u-input{ border:none !important; color:#3D3D3D !important; margin-top: 20rpx;} ::v-deep .i_box_3x .u-input{ border:none !important; color:#3D3D3D !important; margin-top: 20rpx;}
.up{ width: 100%; height: auto; display: flex; margin-top: 20rpx;} .up{ width: 100%; height: auto; display: flex; margin-top: 20rpx;}
.up .img{width:80%; overflow: hidden; } .up .img{width:80%; overflow: hidden; }
.up .img .u-upload{ margin-left: 80rpx;} .up .img .u-upload{ margin-left: 80rpx;}

Loading…
Cancel
Save