Browse Source

锦水印象banner优化;一键服务增加众创卫生城,安全360模块;签到入口移至首页;

feature/optimise
ZhaoTongYao 5 years ago
parent
commit
468b8d2b7c
  1. BIN
      images/home/signin.png
  2. BIN
      images/home/signined.png
  3. 52
      pages/indexNew/indexNew.js
  4. 3
      pages/indexNew/indexNew.json
  5. 9
      pages/indexNew/indexNew.wxml
  6. 24
      pages/indexNew/indexNew.wxss
  7. 58
      pages/mine/mine.js
  8. 4
      pages/mine/mine.wxml
  9. 6
      project.config.json
  10. 8
      subpages/oneKeyService/pages/index/index.js
  11. 10
      subpages/oneKeyService/pages/noticeDetail/noticeDetail.js
  12. 44
      subpages/oneKeyService/pages/warning/warning.js
  13. 5
      subpages/oneKeyService/pages/warning/warning.wxml
  14. 4
      subpages/oneKeyService/pages/warning/warning.wxss
  15. 14
      subpages/understandJs/pages/noticeDetail/noticeDetail.js
  16. 17
      subpages/understandJs/pages/noticeDetail/noticeDetail.wxml
  17. 4
      utils/config.js

BIN
images/home/signin.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

BIN
images/home/signined.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

52
pages/indexNew/indexNew.js

@ -75,11 +75,16 @@ Page({
workGridId:'', //工作网格7.08
completeInfoDialogVisible: false, //完善信息
homePagePhone: {},
fromprogram: '' //来自工作端=work 或者 数据分析端=leader 的跳转
fromprogram: '', //来自工作端=work 或者 数据分析端=leader 的跳转,
visible: false,
signMsg: '',
signCode: 0,
isSignUp: 0
},
onShow: function () {
if (wx.getStorageSync("token") != "" && wx.getStorageSync("token") != undefined && wx.getStorageSync("token") != null) {
if (!this.data.first) {
this.getUserInfo()
this.loadGridList()
this.getBannerList()
this.getFirstInfo()
@ -361,6 +366,7 @@ Page({
}
that.getResidentConfig()
that.getHomePhone()
that.getUserInfo()
that.loadGridList()
that.getBannerList()
that.getFirstInfo()
@ -630,5 +636,49 @@ Page({
} else {
return false
}
},
// 获取用户信息
getUserInfo () {
api.getUserInfo().then(res => {
console.log("用户信息", res)
this.setData({
isSignUp: res.data.isSignUp
})
}).catch(err => {
this.setData({
isSignUp: 0
})
console.log(err)
})
},
//签到 2020.07.31
toSignIn () {
if (this.data.isSignUp == 1) {
return
}
api.userInfoSignUp().then(res => {
console.log(res.data)
if (res.code === 0) {
// 显示提醒
this.setData({
signCode: res.code,
signMsg: res.data,
visible: true
});
} else {
this.setData({
signCode: res.code,
signMsg: res.msg,
visible: true
});
}
})
},
// 关闭签到提醒
onClose() {
this.getUserInfo()
this.setData({
visible: false
});
}
})

3
pages/indexNew/indexNew.json

@ -5,6 +5,7 @@
"usingComponents": {
"nav-bar": "/components/navbar/index",
"load-more": "../../components/loadMore/loadMore",
"complete-info-dialog": "../../components/completeInfoDialog/completeInfoDialog"
"complete-info-dialog": "../../components/completeInfoDialog/completeInfoDialog",
"wux-popup": "../../dist/popup/index"
}
}

9
pages/indexNew/indexNew.wxml

@ -15,6 +15,10 @@
<view class="grid-name">{{departmentName}}</view>
<image class="more-grid" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716nk3uAAMMcAAADckZSIh0279.png" />
</view>
<view class="signin-btn" bindtap="toSignIn">
<image src="../../images/home/signin.png" wx:if="{{isSignUp == 0}}" />
<image src="../../images/home/signined.png" wx:else />
</view>
<view class="my-and-news">
<image wx:if="{{infoObj.title == ''}}" bindtap="noMore" class="news" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/05/rBAB716nk4yASWCrAAAKA-kIkt0142.png" />
<image wx:else bindtap="toInfoList" class="news" src="https://epdc-kongcun.elinkit.com.cn/epdcFile/M00/00/07/rBAB7161EWKAIXwXAAAD4DwRkd4543.png" />
@ -170,3 +174,8 @@
</view>
<complete-info-dialog completeInfoDialogVisible="{{completeInfoDialogVisible}}"></complete-info-dialog>
<!-- 签到后提醒 -->
<wux-popup visible="{{visible}}" title="{{signCode === 0 ? '签到成功' : '签到失败'}}" content="{{signMsg}}" bind:close="onClose">
<view slot="footer" class="popup__button" bindtap="onClose">确定</view>
</wux-popup>

24
pages/indexNew/indexNew.wxss

@ -60,9 +60,22 @@ page {
z-index: 10;
}
.belong-grid .newbelong-grid .signin-btn {
width: 140rpx;
height: 44rpx;
position: absolute;
z-index: 99;
right: 80rpx;
}
.belong-grid .newbelong-grid .signin-btn image {
width: 100%;
height: 100%;
}
.belong-grid .newbelong-grid .grid {
/* width: 90%; */
width: calc(100% - 129rpx);
width: calc(100% - 240rpx);
height: 34rpx;
position: relative;
z-index: 100;
@ -89,7 +102,7 @@ page {
}
.belong-grid .newbelong-grid .my-and-news {
width: 129rpx;
width: 80rpx;
height: 34rpx;
position: relative;
z-index: 100;
@ -631,3 +644,10 @@ page {
height: 100%;
width: 100%;
}
.popup__button {
width: 100%;
text-align: center;
font-size: 36rpx;
color: #04BCA0;
}

58
pages/mine/mine.js

@ -336,33 +336,33 @@ Page({
},
// 签到 2020.07.24
toSignUp () {
if (this.data.userInfo.isSignUp == 1) {
return
}
api.userInfoSignUp().then(res => {
console.log(res.data)
if (res.code === 0) {
// 显示提醒
this.setData({
signCode: res.code,
signMsg: res.data,
visible: true
});
} else {
this.setData({
signCode: res.code,
signMsg: res.msg,
visible: true
});
}
})
},
// 关闭签到提醒
onClose() {
this.getUserInfo()
this.setData({
visible: false
});
}
// toSignUp () {
// if (this.data.userInfo.isSignUp == 1) {
// return
// }
// api.userInfoSignUp().then(res => {
// console.log(res.data)
// if (res.code === 0) {
// // 显示提醒
// this.setData({
// signCode: res.code,
// signMsg: res.data,
// visible: true
// });
// } else {
// this.setData({
// signCode: res.code,
// signMsg: res.msg,
// visible: true
// });
// }
// })
// },
// // 关闭签到提醒
// onClose() {
// this.getUserInfo()
// this.setData({
// visible: false
// });
// }
})

4
pages/mine/mine.wxml

@ -26,14 +26,14 @@
<image class="rightsword" src="../../images/mine/mine-rightsword.png" />
</view>
</view>
<view class="complete-info" bindtap="toSignUp">
<!-- <view class="complete-info" bindtap="toSignUp">
<image class="complete-image" src="../../images/mine/signup.png"/>
<view class="complete-content">
<view wx:if="{{userInfo.isSignUp == 0}}" class="tip">签 到</view>
<view wx:else class="tip" style="color:rgba(255,255,255,0.5);">已签到</view>
<image class="rightsword" style="{{userInfo.isSignUp == 1 ? 'opacity:0.5;' : ''}}" src="../../images/mine/mine-rightsword.png" />
</view>
</view>
</view> -->
</view>
</view>
<view class="bottom">

6
project.config.json

@ -17,15 +17,15 @@
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": true,
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false
"userConfirmedUseCompilerModuleSwitch": false,
"compileHotReLoad": false,
"useIsolateContext": true
},
"compileType": "miniprogram",
"libVersion": "2.8.2",

8
subpages/oneKeyService/pages/index/index.js

@ -59,6 +59,14 @@ Page({
wx.navigateTo({
url: `../directTo/directTo?modulecode=${e.currentTarget.dataset.modulecode}`
})
} else if (e.currentTarget.dataset.modulecode == 'notice_zcwsc') {
wx.navigateTo({
url: `../warning/warning?modulecode=${e.currentTarget.dataset.modulecode}`
})
} else if (e.currentTarget.dataset.modulecode == 'notice_aq') {
wx.navigateTo({
url: `../warning/warning?modulecode=${e.currentTarget.dataset.modulecode}`
})
}
}
})

10
subpages/oneKeyService/pages/noticeDetail/noticeDetail.js

@ -26,6 +26,16 @@ Page({
title: '锦水警事'
})
this.noticeDetail(options.id)
} else if(options.modulecode == 'notice_zcwsc'){
wx.setNavigationBarTitle({
title: '众创卫生城'
})
this.noticeDetail(options.id)
} else if(options.modulecode == 'notice_aq'){
wx.setNavigationBarTitle({
title: '安全360'
})
this.noticeDetail(options.id)
}
},

44
subpages/oneKeyService/pages/warning/warning.js

@ -18,7 +18,7 @@ Page({
indicatorDots: false, //指示点
autoplay: true, //true,//自动播放
circular: true, //衔接滑动
interval: 3000, //自动播放间隔时长(ms)
interval: 5000, //自动播放间隔时长(ms)
duration: 500, //幻灯片切换时长(ms)
currentSwiper: 0,
},
@ -34,14 +34,24 @@ Page({
wx.setNavigationBarTitle({
title: '锦水印象'
})
}else if(options.modulecode == 'notice_zcwsc'){
this.getBannerList('4')
wx.setNavigationBarTitle({
title: '众创卫生城'
})
}else if(options.modulecode == 'notice_aq'){
this.getBannerList('5')
wx.setNavigationBarTitle({
title: '安全360'
})
}else{
this.getBannerList('2')
wx.setNavigationBarTitle({
title: '锦水警事'
})
}
this.noticelist()
this.getBannerList()
},
/**
@ -105,9 +115,9 @@ Page({
})
},
getBannerList: function() {
getBannerList: function(bannerNum) {
let that = this
api.bannerList('2').then(function(res) {
api.bannerList(bannerNum).then(function(res) {
// console.log('res==', res.data)
that.setData({
swiperBannerList: res.data
@ -115,8 +125,32 @@ Page({
})
},
swiperChange: function(e) {
wx.createVideoContext('video'+this.data.currentSwiper).pause()
this.setData({
currentSwiper: e.detail.current,
autoplay: true
})
},
bindplay() {
this.setData({
autoplay: false
})
wx.getNetworkType({
success (res) {
const networkType = res.networkType
if (res.networkType != 'wifi') {
wx.showToast({
title: '当前为非WI-FI环境,请注意流量消耗',
icon: 'none',
duration: 3000
})
}
}
})
},
bindended() {
this.setData({
currentSwiper: e.detail.current
autoplay: true
})
},
// swiperChange2: function(e) {

5
subpages/oneKeyService/pages/warning/warning.wxml

@ -1,5 +1,5 @@
<!-- banner swiperBannerList -->
<view class="banner">
<view class="banner" wx:if="{{swiperBannerList.length>0}}">
<view class="page-section page-section-spacing swiper">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" circular="{{circular}}" interval="{{interval}}" duration="{{duration}}" bindchange="swiperChange">
<block wx:for="{{swiperBannerList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
@ -9,7 +9,8 @@
<!-- <view class="altitle">
<view class="altitle-name">{{item.title}}</view>
</view> -->
<image class="banner" src='{{item.imgUrl}}' mode="aspectFill" />
<image wx:if="{{item.imgUrl!=''}}" class="banner" src='{{item.imgUrl}}' mode="aspectFill" />
<video wx:elif="{{item.videoUrl!=''}}" id="video{{index}}" class="banner" src="{{item.videoUrl}}" bindplay='bindplay' bindended='bindended'/>
</view>
</view>
</swiper-item>

4
subpages/oneKeyService/pages/warning/warning.wxss

@ -164,6 +164,10 @@ page {
swiper {
height: 300rpx;
box-shadow: 0px 4px 29px 0px rgba(63, 63, 63, 0.1);
border-radius: 16rpx;
overflow: hidden;
-webkit-backface-visibility: hidden;
-webkit-transform: translate3d(0, 0, 0);
}
/* 轮播图end */

14
subpages/understandJs/pages/noticeDetail/noticeDetail.js

@ -65,8 +65,10 @@ Page({
},
swiperChange: function(e) {
wx.createVideoContext('video'+this.data.currentSwiper).pause()
this.setData({
currentSwiper: e.detail.current
currentSwiper: e.detail.current,
autoplay: true
})
},
bindplay() {
@ -91,16 +93,6 @@ Page({
autoplay: true
})
},
bindVideoEnterPictureInPicture() {
console.log('进入小窗模式')
},
bindVideoLeavePictureInPicture() {
console.log('退出小窗模式')
},
videoErrorCallback(e) {
console.log('视频错误信息:')
console.log(e.detail.errMsg)
},
videoBannerList () {
api.videoBannerList('3').then( res => {
this.setData({

17
subpages/understandJs/pages/noticeDetail/noticeDetail.wxml

@ -9,20 +9,9 @@
<view class="swiper-item" data-id="{{item.id}}">
<!-- <view class="altitle">
<view class="altitle-name">{{item.title}}</view>
</view>
<image class="banner" src='{{item.imgUrl}}' mode="aspectFill" />-->
<video
id="myVideo"
src="{{item.videoUrl}}"
binderror="videoErrorCallback"
show-center-play-btn='{{true}}'
show-play-btn="{{true}}"
picture-in-picture-mode="{{['push', 'pop']}}"
bindplay='bindplay'
bindended='bindended'
bindenterpictureinpicture='bindVideoEnterPictureInPicture'
bindleavepictureinpicture='bindVideoLeavePictureInPicture'
></video>
</view> -->
<image wx:if="{{item.imgUrl!=''}}" class="banner" src='{{item.imgUrl}}' mode="aspectFill" />
<video wx:elif="{{item.videoUrl!=''}}" id="video{{index}}" src="{{item.videoUrl}}" show-center-play-btn='{{true}}' bindplay='bindplay' bindended='bindended'></video>
</view>
</view>
</swiper-item>

4
utils/config.js

@ -6,13 +6,13 @@ module.exports = {
};
function BASEURL() {
// return 'https://eug-test.elinkit.com.cn/js/epdc-api/api/' // 锦水测试环境
return 'https://eug-test.elinkit.com.cn/js/epdc-api/api/' // 锦水测试环境
// return 'https://eug-test.elinkit.com.cn/epdc-api/api/' // 测试环境 接口地址
// return "http://219.146.91.110:9094/epdc-api/api/" // 测试环境 ip接口地址
// return "https://epdc.elinkservice.cn/epdc-api/api/" // 正式环境 接口地址
// return 'https://epdc-app.qingdaoshibei.cn/epdc-api/api/' // 电政办 正式环境 接口地址
// return 'https://epdc-shibei.elinkservice.cn/epdc-api/api/' // 电政办 正式环境 接口地址
return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水正式环境接口地址
// return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水正式环境接口地址
// return 'http://192.168.43.19:9094/epdc-api/api/'
}

Loading…
Cancel
Save