This commit is contained in:
cclu 2024-02-23 16:51:39 +08:00
parent 052710886b
commit f3ff6b4c44
5 changed files with 69 additions and 65 deletions

35
App.vue
View File

@ -7,12 +7,12 @@
mapMutations
} from 'vuex'
export default {
computed:{
...mapGetters({'user':'getUser'})
},
methods: {
...mapActions(['memberLogin','getLoginCode']),
...mapMutations(['setVisitChannels']),
},
@ -27,26 +27,27 @@
Vue.prototype.CustomBar = e.statusBarHeight + 45;
};
// #endif
// #ifdef MP-WEIXIN
Vue.prototype.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
Vue.prototype.Custom = custom;
Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
Vue.prototype.pageWindowHeight = e.screenHeight-custom.bottom - custom.top + e.statusBarHeight;;
// #endif
// #endif
}
})
let _this = this
console.log('app',this.user.WeChat_MiniProToken)
if (this.user.WeChat_MiniProToken) {
this.memberLogin() //
} else {
this.getLoginCode()
}
this.setVisitChannels(options.scene)
const updateManager = uni.getUpdateManager()
updateManager.onUpdateReady(function(res) {
@ -63,10 +64,10 @@
});
this.$util.addUserBehavior( {intoRoute: '/'+options.path, outtoRoute: ''}) //
},
onShow: function() {
// var pages = getCurrentPages() //
// let len = pages.length
// if (len > 0) {
@ -78,7 +79,7 @@
},
onHide: function(options) {
let pages = getCurrentPages() //
let len = pages.length
if (len > 0) {
let currentPage = pages[len - 1] //
@ -92,7 +93,7 @@
<style>
@import url("./common/uni.css");
/*每个页面公共css */
page {
font-size: 26rpx;
@ -157,7 +158,7 @@
}
/* #ifdef MP-WEIXIN */
/*
/*
checkbox .wx-checkbox-input {
border-radius: 20%;
border: 1rpx solid #91A6D7;
@ -165,7 +166,7 @@
height: 42rpx;
}
checkbox .wx-checkbox-input.wx-checkbox-input-checked {
background-color: #91A6D7;
color: #fff !important;
@ -174,7 +175,7 @@
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
font-size: 30rpx;
} */
checkbox .wx-checkbox-input {
border-radius: 50% ;
background-color: #D8DFEE ;
@ -182,13 +183,13 @@
height: 38rpx ;
color: #fff;
}
checkbox .wx-checkbox-input.wx-checkbox-input-checked {
background-color: #2E6CF6;
border-color: #2E6CF6 ;
color: #fff !important;
}
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
font-size: 30rpx;
}

View File

@ -45,7 +45,7 @@ export default {
loadMore(){
if(!this.pageData.isEnd) {
this.pageData.pageIndex += 1
this.getList()
this.getData()
}
},
goDetail(item) {
@ -58,10 +58,10 @@ export default {
QueryType:"0",
SearchParameter:{
Operation_Type: "10",
BusinessProcessState: "2000,3000,9000,9999",
BusinessProcess_StateSearch: "2000,2010,2020,2030,2040,2050,2060,2070,2080,2090,3000,9000,9999",
},
ShowWholePower: true,
PageIndex:1,
PageIndex:this.pageData.pageIndex,
PageSize: 10,
SortStr:'BUSINESSAPPROVAL_STATE,BUSINESS_STARTDATE desc'
// SortStr: 'BusinessProcess_State,BusinessProcess_StartDate desc'
@ -94,7 +94,7 @@ export default {
uni.showLoading({
title:'正在加载'
})
this.getList()
this.getData()
setTimeout(function() {
uni.stopPullDownRefresh()
}, 1000)
@ -110,7 +110,7 @@ export default {
})
_this.pageData.pageIndex = 1
_this.pageData.isEnd = false
// _this.getList()
// _this.getData()
console.log('onShow')
_this.getData()
this.shouldReLoadingList(false)
@ -124,7 +124,7 @@ export default {
uni.showLoading({
title:'正在加载'
})
// this.getList()
// this.getData()
this.getData()
},
onUnload() {

View File

@ -12,14 +12,14 @@
<image src="/static/images/tab_down.png" mode="aspectFit"></image>
</picker>
<button type="primary" size="mini" class="search-button" @tap="searchList">查询</button>
</div>
</div>
<view v-if="!pageData.isLoading && pageList.length>0">
<div class="box-card" v-for="(item,i) in pageList" :key="i" @tap="goDetail(item)">
<div class="box-top-title">
<span class="title-clock">{{$util.cutDate(item.ENDACCOUNT_DATE,'YYYY年MM月DD日')}}</span>
<span class="title-fn">{{item.SERVERPART_NAME}}</span>
</div>
<div class="box-bottom-tab">
<div class="tab-unit">
<i class="tab-icon1"></i>
@ -28,7 +28,7 @@
</div>
</div>
</div>
</view>
<view v-else-if="pageData.isLoading===false" >
<noFound :nodata="pageList.length>0 ? false : true"/>
@ -45,11 +45,11 @@
export default {
data() {
let now = new Date()
let nowTime = this.$util.cutDate(now, 'YYYY/MM/DD')
let sTime = this.$util.cutDate(now, 'YYYY/MM/DD', -2)
return {
pageData: {
pageIndex: 1,
pageSize: 99,
@ -70,7 +70,7 @@
methods: {
...mapMutations(['shouldReLoadingList']),
bindDateChange(e,index){
this.pageData.searchTime[index] = e.detail.value
this.$forceUpdate()
},
@ -85,33 +85,33 @@
},
getList () {
let _this = this
console.log('this')
_this.$request.$get('GetEndaccountTotalList',{
// action_record: this.searchTime,
Page_Index: this.pageData.pageIndex,
Page_Size: this.pageData.pageSize,
Statistical_Date: `${this.pageData.searchTime[0]},${this.pageData.searchTime[1]}`, // '2019/12/27'
}).then(res=>{
uni.hideLoading()
_this.pageData.isLoading = false
if(!res.Result_Code ||res.Result_Code!='100') return
let list = res.Result_Data.List
_this.pageList = _this.pageData.pageIndex ==1 ? list :[..._this.pageList,...list]
// _this.showList = list.slice(0,_this.pageData.pageSize)
if (list.length < _this.pageData.pageSize) {
_this.pageData.isEnd = true
}
}
this.$forceUpdate()
})
},
goDetail(item){
this.$util.toNextRoute('navigateTo', '/pages/dataSummary/dayDetail?seviceId='+item.SERVERPART_ID+'&date='+item.ENDACCOUNT_DATE)
}
},
onPullDownRefresh() {
@ -132,7 +132,7 @@
})
},
onReachBottom(){
if(!this.pageData.isEnd) {
// uni.showLoading({
// title:''
@ -141,10 +141,10 @@
// let showList = this.showList
// let pageList = this.pageList
// let maxLen = pageList.length
// let startArrIndex = pageIndex*pageSize - 1
// let endArrIndex = startArrIndex+pageSize
// if(endArrIndex < maxLen) {
// this.showList = showList.concat(pageList.slice(startArrIndex,endArrIndex))
// } else{
@ -170,13 +170,13 @@
_this.getList()
_this.shouldReLoadingList(false)
}
},
onUnload() {
this.$util.addUserBehavior()
},
onHide() {
}
}
</script>
@ -218,7 +218,7 @@
}
/* 内容卡片 */
.box-card {
margin: 30upx 24upx;
background-color: #fff;
box-shadow: 0px 0upx 8upx 0.4upx #e2e2e2;
@ -242,7 +242,7 @@
color: #636363;
display: flex;
align-items: center;
}
}
.title-fn:before {
content: '';
display: block;
@ -251,9 +251,9 @@
height: 20upx;
background-repeat: no-repeat;
background-size: contain;
}
.title-clock:before {
content: '';
display: inline-block;
@ -271,7 +271,7 @@
.box-bottom-tab{
display: flex;
align-items: center;
padding: 24upx 24upx;
}
.tab-unit {
@ -299,7 +299,7 @@
height: 32upx;
background-repeat: no-repeat;
background-size: contain;
}
.tab-icon1:before {
background-image: url(../../static/images/mbwa/rw.png);

View File

@ -452,6 +452,7 @@
},
async initData() { //
let _this = this
console.log('theRequest',this.theRequest)
const [reginList, totalData, busniessTypePie, busniessTradePie, busniessAreaPie, bayonetPie] =
await anhuiYestodayRevenueData.getData(this.theRequest) //

View File

@ -16,10 +16,10 @@ const state = {
};
const getters = {
getUser(state) {
return state.userData
},
},
getMenu(state) {
return state.userData.AuthorityInfo
},
@ -35,7 +35,7 @@ const getters = {
shouldReLoadingList (state) {
return state.shouldReLoadingList
},
};
const mutations = {
@ -46,12 +46,12 @@ const mutations = {
setVisitChannels (state, data) {
state.visitChannels = data
},
shouldReLoadingList (state, data){
state.shouldReLoadingList = data
},
isConnect(state,value) {
state.isConnect = value
},
setUserTodoList(state,value){
@ -67,24 +67,26 @@ const actions = {
})
},
getTodoList({ dispatch, state,commit}){ // 获取用户待办事项
let _user = state.userData
let _user = state.userData
request.$get("ToDoList", {
userId: _user.UserId,
userName: _user.UserName || ''
}).then(res => {
commit('setUserTodoList', res.Data)
commit('setUserTodoList', res.Data)
})
},
memberLogin({ dispatch, state,commit},_code) {
let _user = state.userData
let _user = state.userData
request.$get('WeChat_Login',{
// request.$webGet('WebAPI_Push/WeChat/Login',{
WeChat_Code: _code || '',
}).then(data=>{
console.log('memberLogin',data)
if (data.Result_Code === 100) {
let user = data.Result_Data
if (user.Membership_Id) {
commit('setUser', user)
dispatch('updateUser',data.Result_Data)
// _this.addUserBehavior(1002) // 记录用户行为
}else{
@ -94,9 +96,7 @@ const actions = {
content: '请您授权登录后再操作。',
success(res) {
if(res.confirm){
util.toNextRoute('navigateTo', '/pages/register/register')
}
}
})
@ -106,31 +106,33 @@ const actions = {
} else {
console.log(data)
}
})
},
async updateUser ({dispatch, commit, state},user){
let _user = user || state.userData
let _id = _user.Membership_Id
console.log('_user',_user)
if(!_id) return
// console.log(_user)
request.$get('WeChat_GetBusinessMemberInfo',{Membership_Id:_id}).then(res=>{
console.log('updateUser',res)
// request.$webGet('WebAPI_Push/Member/GetMemberInfo',{Membership_Id:_id,memberShipId:_id}).then(res=>{
if(res.Result_Code==100) {
let data = res.Result_Data
data.WeChat_MiniProToken = _user.WeChat_MiniProToken
data.WeChat_UserId = _user.WeChat_UserId
data.WeChat_UserName = _user.WeChat_UserName
commit('setUser', data)
commit('setUser', data)
dispatch('getTodoList')
}
})
}
}
export default new Vuex.Store({
state,
mutations,
getters,
@ -144,4 +146,4 @@ export default new Vuex.Store({
}
})
]
});
});