提交 79b9ae2a 作者: wk

外联模式处理

父级 113c73bc
...@@ -3,11 +3,13 @@ const $date = { ...@@ -3,11 +3,13 @@ const $date = {
var dateTime = new Date(); var dateTime = new Date();
var end = new Date(time); var end = new Date(time);
var dateDiff = 0 var dateDiff = 0
console.log("结束时间", end + "------" + dateTime);
if (isBefore) { if (isBefore) {
dateDiff = dateTime.getTime() - end.getTime(); //时间差的毫秒数 dateDiff = dateTime.getTime() - end.getTime(); //时间差的毫秒数
} else { } else {
dateDiff = end.getTime() - dateTime.getTime(); //时间差的毫秒数 dateDiff = end.getTime() - dateTime.getTime(); //时间差的毫秒数
} }
console.log("时间差", dateDiff);
if (dateDiff > 0) { if (dateDiff > 0) {
return this.formatDuring(dateDiff) return this.formatDuring(dateDiff)
} else { } else {
...@@ -28,8 +30,14 @@ const $date = { ...@@ -28,8 +30,14 @@ const $date = {
} else if (seconds > 0) { } else if (seconds > 0) {
return seconds + "秒"; return seconds + "秒";
} }
}, },
getEndTime(startTime) {
var start = new Date(startTime).getTime();
var end = start + 72 * 60 * 60 * 1000
var endDate = new Date(end)
console.log(endDate);
return `${endDate.getFullYear()}-${endDate.getMonth() + 1}-${endDate.getDate()} ${endDate.getHours()}:${endDate.getMinutes()}:${endDate.getSeconds()}`
}
} }
export default $date export default $date
...@@ -502,6 +502,15 @@ ...@@ -502,6 +502,15 @@
} }
} }
,{
"path" : "pages/gallery/outPage/outPage",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
......
...@@ -171,9 +171,7 @@ ...@@ -171,9 +171,7 @@
url: `/pages/gallery/app/modeFormList/modeFormList?check_tpl_id=${model.source_id}&business_type=${result.data.business_type}&title=${result.data.tpl_name}&showCfg=${JSON.stringify(this.models[0].show_cfg)}` url: `/pages/gallery/app/modeFormList/modeFormList?check_tpl_id=${model.source_id}&business_type=${result.data.business_type}&title=${result.data.tpl_name}&showCfg=${JSON.stringify(this.models[0].show_cfg)}`
}) })
} else if (result.data.business_type == 5) { } else if (result.data.business_type == 5) {
this.currentModel = result.data.tpl_config[0] this.toOutPage(result.data.tpl_config[0])
console.log(this.currentModel);
this.$refs.bottomDialog.handleShow()
} else { //之前的默认 } else { //之前的默认
uni.navigateTo({ uni.navigateTo({
url: `/pages/gallery/app/originalIndex/originalIndex?check_tpl_id=${model.source_id}&title=${result.data.tpl_name}` url: `/pages/gallery/app/originalIndex/originalIndex?check_tpl_id=${model.source_id}&title=${result.data.tpl_name}`
...@@ -186,6 +184,37 @@ ...@@ -186,6 +184,37 @@
this.$toast.showToast(err.msg) this.$toast.showToast(err.msg)
}) })
}, },
toOutPage(currentModel) {
var url = this.currentModel.url
var params = ""
if (url.indexOf("?") != -1) { //有参数
params = url.split("?")[1]
url = url.split("?")[0]
}
let objParams = {}
if (params != "") {
if (params.indexOf("&") != -1) {
var arr = params.split("&")
arr.forEach((item) => {
objParams[item.split("=")[0]] = item.split("=")[1];
})
} else {
objParams[params.split("=")[0]] = params.split("=")[1];
}
// params = `{${params.replaceAll("=",":").replaceAll("&",",")}}`
}
console.log(params);
let data = {
project_id: uni.getStorageSync("project_id") || "",
account: this.currentModel.user_name,
password: this.currentModel.user_pw,
url: url
}
console.log(JSON.stringify(data));
uni.navigateTo({
url: `/pages/gallery/outPage/outPage?param=${JSON.stringify(data)}&paramStr=${JSON.stringify(objParams)}`
})
},
toAlone(model, info) { toAlone(model, info) {
this.models = info.tpl_config this.models = info.tpl_config
if (this.models.length == 1) { if (this.models.length == 1) {
......
<template>
<view>
<web-view :src="webUrl">
</web-view>
</view>
</template>
<script>
export default {
data() {
return {
webUrl: ""
}
},
onLoad(options) {
console.log("参数", options);
let params = JSON.parse(options.param)
this.webUrl =
`${params.url}?project_id=${params.project_id}&account=${params.account}&password=${params.password}&option=${options.paramStr}`
console.log(this.webUrl);
},
methods: {
}
}
</script>
<style>
</style>
...@@ -4,15 +4,17 @@ ...@@ -4,15 +4,17 @@
<view class="search-content"> <view class="search-content">
<image src="../../../static/ic-search.png" class="image"></image> <image src="../../../static/ic-search.png" class="image"></image>
<input placeholder="搜索" placeholder-class="placeholderStyle" @input="search" class="inputStyle" /> <input placeholder="搜索" placeholder-class="placeholderStyle" @input="search" class="inputStyle" />
</view> </view>
<view class="list-content"> <view class="list-content">
<view v-for="(item,index) in list" :key="index" class="list-item" @click="itemClick(item)"> <view v-for="(item,index) in list" :key="index" class="list-item" @click="itemClick(item)">
<image class="image" src="../../../static/ic-jrdb.png"></image> <image class="image" src="../../../static/ic-jrdb.png"></image>
<view class="item-content"> <view class="item-content">
<view class="title">张三发起了隐患整改,请于2022/12/13 15:37:56前完成隐患整改。</view> <view class="title">{{item.created_by_name}}发起了{{item.app_name}},请于{{item.expect_end_date}}前完成。
</view>
<view class="time-content"> <view class="time-content">
<view class="create-time">2022/12/13 15:39:56</view> <view class="create-time">{{item.end_opt_time}}</view>
<view class="leave-time">处理倒计时:0天20小时23分</view> <view class="leave-time">处理倒计时:{{timeSpace(item.end_opt_time)}}</view>
</view> </view>
<view class="line" style="margin: 30rpx 0;"></view> <view class="line" style="margin: 30rpx 0;"></view>
</view> </view>
...@@ -112,6 +114,7 @@ ...@@ -112,6 +114,7 @@
margin-left: 20rpx; margin-left: 20rpx;
color: #333; color: #333;
} }
} }
......
...@@ -692,9 +692,7 @@ ...@@ -692,9 +692,7 @@
url: `/pages/gallery/app/modeFormList/modeFormList?check_tpl_id=${model.source_id}&business_type=${result.data.business_type}&title=${result.data.tpl_name}&showCfg=${JSON.stringify(this.models[0].show_cfg)}` url: `/pages/gallery/app/modeFormList/modeFormList?check_tpl_id=${model.source_id}&business_type=${result.data.business_type}&title=${result.data.tpl_name}&showCfg=${JSON.stringify(this.models[0].show_cfg)}`
}) })
} else if (result.data.business_type == 5) { } else if (result.data.business_type == 5) {
this.currentModel = result.data.tpl_config[0] this.toOutPage(result.data.tpl_config[0])
console.log(this.currentModel);
this.$refs.bottomDialog.handleShow()
} else { //之前的默认 } else { //之前的默认
uni.navigateTo({ uni.navigateTo({
url: `/pages/gallery/app/originalIndex/originalIndex?check_tpl_id=${model.source_id}&title=${result.data.tpl_name}` url: `/pages/gallery/app/originalIndex/originalIndex?check_tpl_id=${model.source_id}&title=${result.data.tpl_name}`
...@@ -707,6 +705,37 @@ ...@@ -707,6 +705,37 @@
this.$toast.showToast(err.msg) this.$toast.showToast(err.msg)
}) })
}, },
toOutPage(currentModel) {
var url = this.currentModel.url
var params = ""
if (url.indexOf("?") != -1) { //有参数
params = url.split("?")[1]
url = url.split("?")[0]
}
let objParams = {}
if (params != "") {
if (params.indexOf("&") != -1) {
var arr = params.split("&")
arr.forEach((item) => {
objParams[item.split("=")[0]] = item.split("=")[1];
})
} else {
objParams[params.split("=")[0]] = params.split("=")[1];
}
// params = `{${params.replaceAll("=",":").replaceAll("&",",")}}`
}
console.log(params);
let data = {
project_id: this.project_id,
account: this.currentModel.user_name,
password: this.currentModel.user_pw,
url: url
}
console.log(JSON.stringify(data));
uni.navigateTo({
url: `/pages/gallery/outPage/outPage?param=${JSON.stringify(data)}&paramStr=${JSON.stringify(objParams)}`
})
},
toAlone(model, info) { toAlone(model, info) {
this.models = info.tpl_config this.models = info.tpl_config
if (this.models.length == 1) { if (this.models.length == 1) {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<view class="btn-content" @click="toLogin"> <view class="btn-content" @click="toLogin">
<view class="auth-text">工地一点通授权登录</view> <view class="auth-text">工地一点通授权登录</view>
</view> </view>
<view class="cancel-content" @click="toCancel"> <view class="cancel-content" @click="toCancel" v-if="false">
<text class="text">暂不使用</text> <text class="text">暂不使用</text>
</view> </view>
</view> </view>
......
<template> <template>
<view> <view>
<titleBar title="我的审批"></titleBar> <titleBar title="我的审批"></titleBar>
<view class="search">
<view class="search-content">
<image src="../../../static/ic-search.png" class="image"></image>
<input placeholder="搜索" placeholder-class="placeholderStyle" @input="search" class="inputStyle" />
</view>
<view class="order-content" @click="orderSearch">
<text class="text">时间排序</text>
<image :src="arrowIcon" class="image"></image>
</view>
</view>
<view class="column-list-root"> <view class="column-list-root">
<view v-for="(item,index) in mDatas" :key="index" class="column-list-item"> <view v-for="(item,index) in mDatas" :key="index" class="column-list-item">
<text class="text-black-normal">{{item.user_name}}申请加入你的单位</text> <view class="item">业务状态:{{statusText(item.status)}}</view>
<text class="text-grey" style="margin-top: 10rpx;">{{item.create_time}}</text> <view class="item">审批发起人:{{item.user_name}}</view>
<view style="display: flex;flex-direction: row-reverse;margin-top: 32rpx;"> <view class="item">审批内容:{{item.user_name}}申请加入你的组织</view>
<view @click="reject(index)" <view class="item">截止时间:{{endeTime(item.create_time)}}</view>
style="font-size: 24rpx;color: #FF0000;border: 1rpx solid #FF0000;padding: 8rpx 28rpx;border-radius: 8rpx;margin-left: 32rpx;"> <view class="bottom-line">
驳回</view> <view class="leave-time">剩余时间:{{leaveTime(item.create_time)}}</view>
<view @click="pass(index)" <view class="btn" @click="pass(index)">审批通过</view>
style="border: 1rpx solid #3B73FE;background-color: #3B73FE;font-size: 24rpx;color: #FFFFFF;padding: 8rpx 28rpx;border-radius: 8rpx;">
批准</view>
</view> </view>
<view class="line"></view>
</view> </view>
</view> </view>
</view> </view>
...@@ -26,7 +35,9 @@ ...@@ -26,7 +35,9 @@
page: 1, page: 1,
pageSize: 20, pageSize: 20,
totalPage: 1, totalPage: 1,
mDatas: [] mDatas: [],
order: "desc",
arrowIcon: "../../../static/icon_drop_arrow.png"
} }
}, },
onLoad: function() { onLoad: function() {
...@@ -43,6 +54,37 @@ ...@@ -43,6 +54,37 @@
} }
}, },
methods: { methods: {
search(e) {
},
endeTime(time) {
return this.$date.getEndTime(time)
},
leaveTime(time) {
return this.$date.timeDiff(this.$date.getEndTime(time), false)
},
orderSearch() {
if (this.order == 'desc') {
this.order = 'asc'
this.arrowIcon = "../../../static/icon_up_arrow.png"
} else {
this.order = 'desc'
this.arrowIcon = '../../../static/icon_drop_arrow.png'
}
this.page = 1
this.getApplyList()
},
statusText(status) {
if (status == '2') {
return '待审批'
} else if (status == '3') {
return '审批通过'
} else if (status == '4') {
return '审批拒绝'
} else if (status == '5') {
return '通过但移除'
}
},
reject: function(index) { reject: function(index) {
this.showTip(index, 4) this.showTip(index, 4)
}, },
...@@ -87,7 +129,8 @@ ...@@ -87,7 +129,8 @@
dept_type: 1, dept_type: 1,
is_page: 1, is_page: 1,
page: this.page, page: this.page,
page_size: this.pageSize page_size: this.pageSize,
order_by: this.order
}, },
}).then((result) => { }).then((result) => {
console.log("申请列表", result); console.log("申请列表", result);
...@@ -108,18 +151,114 @@ ...@@ -108,18 +151,114 @@
} }
</script> </script>
<style> <style lang="scss">
.column-list-root { .column-list-root {
background-color: #F5F5F5; background-color: #FFFFFF;
margin: 30rpx;
border-radius: 30rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.search {
display: flex;
flex-direction: row;
align-items: center;
margin: 30rpx;
.search-content {
display: flex;
flex-direction: row;
border: 1rpx solid #656565;
height: 30px;
width: 440rpx;
border-radius: 30rpx;
align-items: center;
image {
width: 24rpx;
margin-left: 30rpx;
height: 24rpx;
}
.placeholderStyle {
font-size: 24rpx;
color: #999;
}
.inputStyle {
font-size: 24rpx;
margin-left: 20rpx;
color: #333;
}
}
.order-content {
display: flex;
flex-direction: row;
align-items: center;
margin: 0 30rpx;
text {
font-weight: 400;
font-size: 14px;
line-height: 20px;
text-align: center;
color: #656565;
}
image {
width: 28px;
height: 14px;
}
}
}
.column-list-item { .column-list-item {
background-color: #FFFFFF; background-color: #FFFFFF;
display: flex; display: flex;
margin-bottom: 20rpx; margin-bottom: 20rpx;
border-radius: 30rpx;
flex-direction: column; flex-direction: column;
padding: 32rpx; padding: 30rpx;
.item {
font-weight: 400;
font-size: 14px;
margin-top: 20rpx;
text-align: left;
color: #333;
}
.bottom-line {
display: flex;
flex-direction: row;
margin-top: 20rpx;
align-items: center;
.leave-time {
font-weight: 400;
font-size: 14px;
text-align: left;
flex: 1;
color: #333;
}
.btn {
font-weight: 400;
font-size: 14px;
line-height: 20px;
text-align: center;
color: #3b73fe;
}
}
.line {
width: 630rpx;
margin: 30rpx 0;
height: 0.5px;
background: rgba(0, 0, 0, 0.2);
}
} }
</style> </style>
...@@ -11,23 +11,29 @@ ...@@ -11,23 +11,29 @@
url: "", url: "",
tab: "1", tab: "1",
province_no: "", province_no: "",
city_no: "" city_no: "",
type: "project",
project_id: "",
project_name: ""
} }
}, },
onLoad: function() { onLoad: function(option) {
let short_token = uni.getStorageSync("short_token") let short_token = uni.getStorageSync("short_token")
console.log(short_token); console.log(short_token);
this.type = option.type
this.project_id = option.project_id
this.project_name = option.project_name
this.url = this.url =
`${this.webUrl}/mobileLaborScreen?token_id=${short_token}&tab=1&province_no=${this.province_no}&city_no=${this.city_no}` `${this.webUrl}/mobileLaborScreen?token_id=${short_token}&tab=1&type=${this.type}&project_id=${this.project_id}&project_name=${this.project_name}`
}, },
onShow: function() { onShow: function() {
uni.$once("refresh", (res) => { // uni.$once("refresh", (res) => {
let short_token = uni.getStorageSync("short_token") // let short_token = uni.getStorageSync("short_token")
this.province_no = res.province_no // this.province_no = res.province_no
this.city_no = res.city_no // this.city_no = res.city_no
this.url = // this.url =
`${this.webUrl}/mobileLaborScreen?token_id=${short_token}&tab=2&province_no=${this.province_no}&city_no=${this.city_no}` // `${this.webUrl}/mobileLaborScreen?token_id=${short_token}&tab=1&type=${this.type}&project_id=${this.project_id}&project_name=${this.project_name}`
}) // })
}, },
methods: { methods: {
......
<template> <template>
<view class="content"> <view class="content">
<titleBar title="欢迎您访问工地一点通"></titleBar> <view class="header-content">
<image src="../../static/home-head.png" class="header-image"></image>
<navbar :title="title" :showBack="false"></navbar>
</view>
<view class="org-name">{{orgName||""}}</view>
<view class="list-content" v-if="isHasAuth">
<view class="item-content" v-for="(app,index) in apps" :key="index">
<image class="image" src="../../static/lwkb-bg-image.png"></image>
<view class="bottom-content">
<view class="name">
{{app.app_des||""}}
</view>
<text class="btn" @click="toIndex(index)">进入</text>
</view>
</view>
</view>
<view class="default-content" v-if="!isHasAuth"> <view class="default-content" v-if="!isHasAuth">
<image src="../../static/ic-gth.png" class="image"></image> <image src="../../static/ic-gth.png" class="image"></image>
<view class="default-text">当前无监控台权限</view> <view class="default-text">当前无监控台权限</view>
</view> </view>
<view>
</view>
<uni-tabbar currentPage="2"></uni-tabbar> <uni-tabbar currentPage="2"></uni-tabbar>
</view> </view>
</template> </template>
...@@ -26,9 +38,14 @@ ...@@ -26,9 +38,14 @@
showed: 1, showed: 1,
app_endpoint: 2, app_endpoint: 2,
is_publish: 1, is_publish: 1,
app_sort: 2 app_sort: 2,
publish_target: "ydt"
}, },
apps: [], apps: [{}],
currentJob: {},
project_id: "",
orgName: "",
isProject: false
} }
}, },
onLoad() { onLoad() {
...@@ -37,6 +54,26 @@ ...@@ -37,6 +54,26 @@
onShow() { onShow() {
this.userInfo = getApp().globalData.userInfo this.userInfo = getApp().globalData.userInfo
this.isHasAuth = this.userInfo.identity.code == "PM" this.isHasAuth = this.userInfo.identity.code == "PM"
if (this.isHasAuth) {
this.project_id = uni.getStorageSync("project_id")
if (!this.project_id) {
this.isProject = false
console.log("用户信息", this.userInfo);
let jobs = this.userInfo.user.job_list
console.log("岗位列表", jobs);
let currentComId = this.userInfo.user.comp_id
let job = jobs.find(item =>
item.company_id == currentComId
)
console.log("当前岗位", job);
this.currentJob = job
this.orgName = this.currentJob.org_name
} else {
this.isProject = true
this.orgName = uni.getStorageSync("org_name")
}
}
}, },
methods: { methods: {
// 获取app列表数据 // 获取app列表数据
...@@ -94,6 +131,19 @@ ...@@ -94,6 +131,19 @@
} }
} }
.org-name {
font-weight: 500;
width: 408rpx;
margin: 15px 30rpx;
z-index: 999;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 24rpx;
text-align: left;
color: #fff;
}
.default-content { .default-content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -115,11 +165,62 @@ ...@@ -115,11 +165,62 @@
.list-content { .list-content {
display: flex; display: flex;
z-index: 999;
flex-direction: column; flex-direction: column;
.item-content { .item-content {
position: relative; position: relative;
width: 690rpx;
height: 172px;
border-radius: 30rpx;
margin: 0 30rpx 30rpx 30rpx;
image {
width: 690rpx;
height: 172px;
border-radius: 30rpx;
position: absolute;
top: 0;
left: 0;
} }
.bottom-content {
position: absolute;
bottom: 0;
left: 0;
width: 690rpx;
height: 54px;
border-radius: 0 0 30rpx 30rpx;
background: #3b73fe;
opacity: 0.85;
.name {
position: absolute;
top: 15px;
left: 30rpx;
font-weight: 600;
font-size: 34rpx;
color: #fff;
} }
.btn {
position: absolute;
right: 30rpx;
top: 15px;
width: 120rpx;
font-weight: 600;
font-size: 13px;
text-align: center;
line-height: 24px;
justify-content: center;
color: #3b73fe;
height: 24px;
border-radius: 24rpx;
background: #fff;
}
}
}
}
} }
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
Please register or to comment