| | |
| | | <view class="status_bar"> |
| | | <!-- 这里是状态栏 --> |
| | | </view> |
| | | <uni-nav-bar left-icon="left" title="甲方单位" @clickLeft="back" @clickRight="scan" :fixed="true" |
| | | <uni-nav-bar left-icon="left" title="信息公海" @clickLeft="back" @clickRight="scan" :fixed="true" |
| | | :border="false" rightWidth="160rpx" leftWidth="160rpx" |
| | | > |
| | | <block slot="right"> |
| | |
| | | </uni-nav-bar> |
| | | <!-- 搜索框 --> |
| | | <view class="search-bg"> |
| | | <uni-search-bar placeholder="客户代号/名称" bgColor="#f4f4f4" @confirm="search" /> |
| | | <!-- <uni-search-bar placeholder="客户代号/名称" bgColor="#f4f4f4" @confirm="search" /> --> |
| | | <u-search placeholder="客户代号/名称" v-model="keyword" :clearabled="true" @custom="search()"></u-search> |
| | | </view> |
| | | |
| | | |
| | | <view> |
| | | <!-- 客户列表 --> |
| | | <view class="c-list" @click="getDetails(item.id)" v-for="(item,index) in csmtrList" :key="index"> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | keyword: '', |
| | | csmtrList: [], |
| | | last_id: '', |
| | | user: { |
| | | username: '', |
| | | id: 0, |
| | | type: '' |
| | | type: 'user_id' |
| | | }, |
| | | userid: 0, |
| | | reload: false, |
| | |
| | | } |
| | | }, |
| | | onShow() { |
| | | |
| | | let that = this |
| | | uni.$on('isRefresh',function(data){ |
| | | console.log(data); |
| | | that.user.username = data.title |
| | | that.user.id = data.id |
| | | that.user.type = data.key |
| | | that.falg = false |
| | | }) |
| | | |
| | | setTimeout(()=> { |
| | | this.getCsmtr1() |
| | | },50) |
| | | if (this.falg) { |
| | | this.getDetail() |
| | | } |
| | | setTimeout(()=> { |
| | | this.getCsmtr1() |
| | | },50) |
| | | }, |
| | | onReachBottom() { |
| | | this.status = 'more'; |
| | |
| | | async getDetail() { |
| | | let res = await user.getDetail() |
| | | if (res.code === 200) { |
| | | console.log(res); |
| | | this.user.username = res.data.username |
| | | this.user.id = res.data.id |
| | | this.type = res.data.type |
| | | |
| | | } else if (res.code === 403) { |
| | | this.backLogin(res) |
| | | } |
| | |
| | | }, |
| | | open() { |
| | | this.show = true |
| | | console.log(this.columns); |
| | | }, |
| | | getUserTree() { |
| | | let _this = this |
| | |
| | | getCsmtr1(e) { |
| | | let that = this |
| | | that.csmtrList = [] |
| | | uni.showLoading({}) |
| | | let param = {curr:1,limit:4,dept_id: 0,user_id: 67} |
| | | if (this.user.type == 'user_id') { |
| | | param = {curr:1,limit:4,user_id: that.user.id} |
| | |
| | | data: param, |
| | | method:'GET', |
| | | success(result) { |
| | | console.log(result); |
| | | if (result.statusCode === 404) { |
| | | uni.showToast({title: '请重新登录', icon: "none", position: 'top'}) |
| | | return |
| | |
| | | }); |
| | | }, 1000); |
| | | }, |
| | | complete() { |
| | | uni.hideLoading() |
| | | } |
| | | }) |
| | | }, |
| | | getCsmtr() { |
| | | let that = this |
| | | uni.showLoading({}) |
| | | let param = {curr:that.curr,limit:4,dept_id: 0,user_id: 67} |
| | | if (this.user.type == 'user_id') { |
| | | param = {curr:1,limit:4,user_id: that.user.id} |
| | | param = {curr:that.curr,limit:4,user_id: that.user.id} |
| | | } else if(this.user.type == 'dept_id') { |
| | | param = {curr:1,limit:4,dept_id: that.user.id} |
| | | param = {curr:that.curr,limit:4,dept_id: that.user.id} |
| | | } else { |
| | | param = {curr:1,limit:4} |
| | | param = {curr:that.curr,limit:4} |
| | | } |
| | | uni.request({ |
| | | url: that.baseUrl + '/cstmr/page/auth', |
| | |
| | | }); |
| | | }, 1000); |
| | | }, |
| | | complete() { |
| | | uni.hideLoading() |
| | | } |
| | | }) |
| | | }, |
| | | getDetails(id) { |
| | |
| | | }, |
| | | // --- |
| | | search() { |
| | | |
| | | let _this = this |
| | | let param = {curr:1,limit:100,conditionName: 'name'} |
| | | if (this.user.type == 'user_id') { |
| | | param['user_id'] = _this.user.id |
| | | param['condition'] = _this.keyword |
| | | } else if(this.user.type == 'dept_id') { |
| | | param['dept_id'] = _this.user.id |
| | | param['condition'] = _this.keyword |
| | | } else { |
| | | param['condition'] = _this.keyword |
| | | } |
| | | uni.request({ |
| | | url: `${_this.baseUrl}/cstmr/page/auth`, |
| | | header: {'token' : uni.getStorageSync('token'),}, |
| | | data: param, |
| | | success(res) { |
| | | res = res.data |
| | | console.log(res); |
| | | _this.csmtrList = res.data.records |
| | | } |
| | | }) |
| | | }, |
| | | backLogin(res) { |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | |
| | | height: var(--status-bar-height); |
| | | width: 100%; |
| | | background-color: #FFF; |
| | | position: sticky; |
| | | top: 0; |
| | | } |
| | | |
| | | .uni-nav-bar-text { |