douzhuo 2 年前
父节点
当前提交
a80dd3e4b2
共有 3 个文件被更改,包括 92 次插入3 次删除
  1. +11
    -1
      pages.json
  2. +5
    -2
      pages/index/index.vue
  3. +76
    -0
      pages/mine/selectBuilding.vue

+ 11
- 1
pages.json 查看文件

@@ -207,7 +207,17 @@
"navigationBarTextStyle": "black"
}
}
]
,{
"path" : "selectBuilding",
"style" :
{
"navigationBarTitleText": "切换客户",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black"
}
}
]
},
{
"root": "pages/learning",//学习


+ 5
- 2
pages/index/index.vue 查看文件

@@ -6,7 +6,7 @@
</view>
<view class="Switching2">客户:</view>
<view class="Switching3">{{buildingname}}</view>
<view class="Switching4" v-if="buildingishow" @click="piskbuilding()">切换客户</view>
<view class="Switching4" v-if="buildingishow" @click="piskbuilding()">切换项目</view>
</view>

<view class="title" style="margin-top: 30rpx;" v-if="Myworkcard">我的工牌</view>
@@ -464,7 +464,10 @@
},
//选择客户弹框
piskbuilding() {
this.Showhiddenunits = true;
// this.Showhiddenunits = true;
uni.navigateTo({
url:"../mine/selectBuilding"
})
},
// 客户选择确认
confirm(e) {


+ 76
- 0
pages/mine/selectBuilding.vue 查看文件

@@ -0,0 +1,76 @@
<template>
<view class="selectBuilding">
<view class="searchStyle">
<u-search placeholder="输入客户名称" v-model="search" @search="s" @custom="s"></u-search>
</view>
<view class="searchResultStyle">
<view class="searchList" v-for="(item,index) in list" :key="index" @click="okSelect(item.id,item.propertyName)">
{{item.propertyName}}
</view>
</view>
</view>
</template>
<script>
var config = require("@/config");
export default {
name: "selectBuilding",
data() {
return {
search: "",
list: [],
};
},
methods:{
s(e){
this.init(e)
},
okSelect(id,name){
let lopan = {
id,
name
}
uni.setStorageSync("buildingID", lopan);
uni.navigateBack({
delta:-1
})
},
init(e){
let data = {houseName:decodeURI(e)||''}
uni.request({
url: config.service.getUser,
method: "GET",
data,
header: {
'content-type': 'application/json',
'Access-Token': uni.getStorageSync('weapp_session_login_data').token
},
success: (res) => {
this.list = res.data.data.zkProperties
}
})
}
},
onLoad() {
this.init("")
}
}
</script>
<style lang="scss" scoped>
.selectBuilding {
.searchStyle {
padding: 20rpx;
}
.searchResultStyle {
padding: 0 30rpx;
.searchList{
border-bottom: 1rpx solid #E0E0E0;
padding: 30rpx 0;
font-size: 30rpx;
}
}
}
</style>

正在加载...
取消
保存