Browse Source

修改主页

master
vee 2 years ago
parent
commit
92b47e67ff
  1. 45
      App.vue
  2. 4
      manifest.json
  3. 192
      pages/home/index.vue
  4. 2
      pages/login/index.vue
  5. 2
      utils/axios.js

45
App.vue

@ -21,12 +21,57 @@
},
onShow: function() {
console.log('App Show')
// // #ifdef APP-PLUS
// this.appVersion()
// // #endif
},
onHide: function() {
console.log('App Hide')
},
methods: {
// APP
appVersion() {
console.log("校验APP应用版本", uni.getSystemInfoSync().platform)
// console.log('ss' + JSON.stringify(uni.getSystemInfoSync()))
// const response = await this.$api.appVersion(param)
// console.log(response)
plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
console.log('当前版本号' + wgtinfo.versionCode)
console.log(wgtinfo)
let param = {
'appId': 'android',
'versionCode': wgtinfo.version
}
console.log(param)
this.$api.appVersion(param).then(response => {
console.log(response)
if (wgtinfo.version < response.versionCode) {
console.log('更新了吗')
let that = this;
this.conInfo = response
this.showLogOut=true
// uni.showModal({
// title: this.$t("login").Versionupdate,
// content: response.info,
// showCancel: false,
// confirmText: this.$t("login").Confirm,
// success: function(res) {
// if (res.confirm) {
// plus.runtime.openURL(response.appUrl);
// }
// }
// })
}
})
});
},
}
}

4
manifest.json

@ -110,7 +110,7 @@
"proxy" : {
"/api" : {
"ws" : false,
"target" : "https://sapi.payairs.com",
"target" : "https://api.gream.ltd",
"changeOrigin" : true,
"secure" : false,
"pathRewrite" : {
@ -119,7 +119,7 @@
},
"/market" : {
"ws" : false,
"target" : "https://market.acefinex.com",
"target" : "https://market.gream.ltd",
"changeOrigin" : true,
"secure" : false,
"pathRewrite" : {

192
pages/home/index.vue

@ -7,8 +7,10 @@
<!-- #ifdef H5 -->
<view class="nav-head-H5">
<!-- #endif -->
<u-button class="serviceButton" color="#323045" @click="getContact">{{ i18n.customerService }}
</u-button>
<!-- <u-button class="serviceButton" color="#323045" @click="getContact">{{ i18n.customerService }}
</u-button> -->
<a class="serviceButton" target="_blank" :href="href" color="#323045" >{{ i18n.customerService }}
</a>
<view class="languageBtn" @click.stop="languageShow = true">
{{ langTrue }}
</view>
@ -30,7 +32,7 @@
<!-- #endif -->
</u-swiper>
<!-- 消息 -->
<view class="message" @click="go('/pages/me/notification')">
<view class="message" @click="go('inner','/pages/me/notification')">
<u-icon class="icon" name="../../static/home/ic_proclamation.png" size="60rpx" width="60rpx">
</u-icon>
<!-- <view class="text">{{ i18n.homeMessage }}</view> -->
@ -62,33 +64,20 @@
</view>
</view>
<!-- 步数 -->
<view class="steps">
<view class="content">
<view class="title">{{ i18n.TodaySteps }}</view>
<view id="chart" :stepsNum="stepsNum" :stepTarget="stepTarget"
:change:stepTarget="echarts.stepTargetReceive" :change:stepsNum="echarts.receive"
style="width: 280rpx;height:280rpx; font-size: 40rpx;">
</view>
<!-- <canvas id="chart" ref="chart" style="width: 280rpx;height:280rpx; font-size: 40rpx;"></canvas> -->
<u-button class="button" color="#00E8A2" @click="closeModalShow=true">{{ i18n.ReceiveEarnings }}
</u-button>
<view v-for="(item, index) in middleList" :key="index">
<view class="steps" >
<image :src="baseURL+item.adImgPath" @click="go(item.content,item.adUrl)"></image>
</view>
</view>
<!-- close确认框 -->
<u-modal :show="closeModalShow" :confirmText="i18n.Confirm" :cancelText="i18n.Cancel"
:showCancelButton="true" :title="i18n.WarmTips" :content='i18n.WarmTipsText' @confirm="closeConfirm"
@cancel="closeModalShow = false" confirmColor="#00E8A2" cancelColor="#96959E">
</u-modal>
<!-- 播放器 -->
<view class="videoList" v-for="(item, index) in videoList" :key="index" @click="playVideo(item.adText)">
<view class="videoImage" :style="`background-image: url(${baseURL+item.adImgPath});background-repeat: no-repeat;
<view v-show="item.adText!=''" class="videoImage" :style="`background-image: url(${baseURL+item.adImgPath});background-repeat: no-repeat;
background-size: cover;`">
<view class="VideoBg">
<view class="VideoLogo"></view>
@ -113,8 +102,6 @@
</view>
</u-popup>
</view>
<!-- <view class="" @click="startStep">
开始记步
</view>
@ -185,16 +172,19 @@
stepsNum: 0, //
stepTarget: 5000, //
myChart: null,
middleList:null,
href:""
}
},
onLoad() {
this.baseURL = constant.BASE_URL
this.getbanner();
this.getMiddle();
this.noticeList();
this.getUserInfoBalance();
// #ifdef APP-PLUS
// this.appVersion()
this.appVersion()
// #endif
},
@ -224,6 +214,7 @@
this.stepsNum = 5000;
this.updateSteps();
// #endif
this.getContact();
},
onHide() {
@ -235,11 +226,17 @@
}
},
methods: {
logOut() {
plus.runtime.openURL(this.conInfo.appUrl);
},
getMiddle(){
api.indexBanner({
'mark': 'APP_INDEX_MIDDLE'
}).then(res => {
this.middleList=res
})
},
// APP
appVersion() {
console.log("校验APP应用版本", uni.getSystemInfoSync().platform)
@ -253,7 +250,7 @@
// console.log(wgtinfo.versionCode, response.versionCode)
let param = {
'appId': uni.getSystemInfoSync().platform,
'versionCode': '1.0.0'
'versionCode': wgtinfo.version
}
console.log(param)
this.$api.appVersion(param).then(response => {
@ -292,7 +289,6 @@
// console.log(today)
// console.log(uni.getStorageSync("stepsNumDate"))
// console.log(stepsNum_date)
if (stepsNum_date) {
if (today != stepsNum_date.date) {
uni.setStorageSync("stepsNumDate", null);
@ -335,13 +331,21 @@
},
bannerClick(i) {
// #ifdef APP-PLUS
plus.runtime.openURL(this.bannerList[i])
// #endif
// #ifdef H5
var href = this.bannerList[i]
window.open(href, '_blank');
// #endif
if(this.bannerList[i].content=='inner'){
uni.navigateTo({
url: this.bannerList[i].adUrl
})
}else{
// #ifdef APP-PLUS
plus.runtime.openURL(this.bannerList[i].adUrl)
// #endif
// #ifdef H5
var href = this.bannerList[i].adUrl
window.open(href, '_blank');
// #endif
}
},
//
@ -417,18 +421,25 @@
if (res.errCode == 'SYS.0012') {
uni.$u.toast(res.errMsg);
} else {
// #ifdef APP-PLUS
// console.log(res.url)
plus.runtime.openURL(res.url)
// #endif
// #ifdef H5
var href = res.url
window.open(href, '_blank');
// #endif
this.href=res.url;
// // #ifdef APP-PLUS
// // console.log(res.url)
// plus.runtime.openURL(res.url)
// // #endif
// // #ifdef H5
// var href = res.url
// window.open(href, '_blank');
// // #endif
}
})
},
getCharity() {
uni.navigateTo({
url: '/pages/home/caringwomen'
})
},
//
getNoReadNotice() {
@ -457,10 +468,21 @@
},
go(url) {
uni.navigateTo({
url: url
})
go(type,url) {
if(type=='inner'){
uni.navigateTo({
url: url
})
}else{
// #ifdef APP-PLUS
plus.runtime.openURL(url)
// #endif
// #ifdef H5
var href = url
window.open(href, '_blank');
// #endif
}
},
@ -487,7 +509,10 @@
// this.bannerList = res
for (var i = 0; i < res.length; i++) {
this.swiperList.push(this.baseURL + res[i].adImgPath)
this.bannerList.push(res[i].adUrl)
this.bannerList.push({
content:res[i].content,
adUrl:res[i].adUrl
})
}
this.videoList = res
// banner
@ -612,7 +637,6 @@
// }else{
// this.myChart.setOption(this.option)
// }
},
stepTargetReceive(newValue, oldValue, ownerVm, vm) {
@ -723,7 +747,6 @@
.main {
padding-bottom: 198rpx; // TabBar
.nav-head-H5 {
position: fixed;
top: 0rpx;
@ -746,6 +769,12 @@
padding: 0;
margin: 20rpx 180rpx 0 48rpx;
vertical-align: top;
background-color: rgb(50, 48, 69);
border-color: rgb(50, 48, 69);
border-width: 1px;
border-style: solid;
text-align: center;
text-decoration: none;
}
.languageBtn {
@ -921,26 +950,50 @@
.steps {
margin: 0 32rpx;
width: 686rpx;
height: 472rpx;
background-color: #211F32;
background-image: url(../../static/home/img_People.png);
background-repeat: no-repeat;
background-size: contain;
border-radius: 16px;
margin-top: 32rpx;
image{
width: 100%;
border-radius: 16px;
}
.content {
margin-left: 246rpx;
//margin-left: 246rpx;
height: 100%;
display: flex;
justify-content: space-evenly;
align-items: center;
align-items: center;
flex-direction: column;
.title {
font-size: 48rpx;
height: 64rpx;
line-height: 64rpx;
width: 100%;
padding-left: 10rpx;
display: flex;
flex-direction: column;
overflow: hidden; //
background-image: linear-gradient(to right,transparent,#00E8A2,transparent);
align-items: center;
font-size: 34rpx;
height: 72rpx;
line-height: 72rpx;
}
.slogan{
margin-left: 28%;
width: 72%;
display: flex;
flex-direction: column;
padding-top:80rpx;
font-weight: bold;
text-align: center;
padding-right:20rpx;
align-items: center;
font-size: 36rpx;
height:150rpx;
line-height: 50rpx;
}
.chart {
@ -949,12 +1002,13 @@
}
.button {
width: 386rpx;
height: 60rpx;
width: 326rpx;
height: 70rpx;
line-height: 60rpx;
border-radius: 40rpx;
font-size: 24rpx;
color: #15141F !important;
border-radius: 100rpx;
font-size: 30rpx;
font-weight: bold;
color: #FFF !important;
padding: 0;
margin-right: 24rpx;
}
@ -1035,4 +1089,4 @@
}
}
</style>
</style>

2
pages/login/index.vue

@ -272,4 +272,4 @@
}
}
}
</style>
</style>

2
utils/axios.js

@ -29,7 +29,7 @@ service.interceptors.request.use(
// mask: true
// })
}
console.log(config.data)
//console.log(config.data)
if (config.url.indexOf("/api/index/register") !== -1 ||
config.url.indexOf("/api/user/login") !== -1 ||
config.url.indexOf("/api/user/forgotPassword") !== -1 ||

Loading…
Cancel
Save