提交 d6099fbb 作者: wk

1、登录注册UI优化 问题修复

2、项目信息地图标记
3、工作台应用分组处理优化
4、工人权限菜单放开
父级 051db0bf
import StringUtils from "./stringUtils.js"
const $date = { const $date = {
timeDiff(time, isBefore) { timeDiff(time, isBefore) {
var dateTime = new Date(); var dateTime = new Date();
...@@ -37,7 +38,13 @@ const $date = { ...@@ -37,7 +38,13 @@ const $date = {
var end = start + 72 * 60 * 60 * 1000 var end = start + 72 * 60 * 60 * 1000
var endDate = new Date(end) var endDate = new Date(end)
console.log(endDate); console.log(endDate);
return `${endDate.getFullYear()}-${endDate.getMonth() + 1}-${endDate.getDate()} ${endDate.getHours()}:${endDate.getMinutes()}:${endDate.getSeconds()}` return `${endDate.getFullYear()}-${StringUtils.add0(endDate.getMonth() + 1)}-${StringUtils.add0(endDate.getDate())} ${StringUtils.add0(endDate.getHours())}:${StringUtils.add0(endDate.getMinutes())}:${StringUtils.add0(endDate.getSeconds())}`
},
stampToDate(time) {
var date = new Date(time)
return date.getFullYear() + "-" + StringUtils.add0(date.getMonth() + 1) + "-" + StringUtils.add0(date
.getDate()) + " " + StringUtils.add0(date.getHours()) + ":" + StringUtils.add0(date.getMinutes()) +
":" + StringUtils.add0(date.getSeconds())
} }
} }
......
...@@ -8,7 +8,13 @@ const stringUtils = { ...@@ -8,7 +8,13 @@ const stringUtils = {
} }
} }
return "" return ""
} },
add0(text) {
if (text < 10) {
return "0" + text
}
return text
},
} }
export default stringUtils export default stringUtils
...@@ -6,8 +6,9 @@ ...@@ -6,8 +6,9 @@
<swiper-item v-for="(item,index) in list" :key='index' @click="$emit('clickItem',item)"> <swiper-item v-for="(item,index) in list" :key='index' @click="$emit('clickItem',item)">
<view v-if="list && list.length>0" class="item" <view v-if="list && list.length>0" class="item"
:class="[!crown ? '' : current==index ? 'crown-active':'crown']"> :class="[!crown ? '' : current==index ? 'crown-active':'crown']">
<image v-if="!slots" class="item-img" :class="[imgShadow?'imgShadow':'']" :src="httpToHttps(item[imgKey])" <image v-if="!slots" class="item-img" :class="[imgShadow?'imgShadow':'']"
:style="{ borderRadius: imgRadius + 'px',width:imgWidth}" mode=""></image> :src="httpToHttps(item[imgKey])" :style="{ borderRadius: imgRadius + 'px',width:imgWidth}"
mode=""></image>
<slot v-else :data='item'></slot> <slot v-else :data='item'></slot>
</view> </view>
</swiper-item> </swiper-item>
...@@ -122,7 +123,7 @@ ...@@ -122,7 +123,7 @@
}, },
httpToHttps(url) { httpToHttps(url) {
return this.$imageUtils.httpToHttps(url) return this.$imageUtils.httpToHttps(url)
} },
} }
} }
</script> </script>
......
...@@ -128,6 +128,8 @@ ...@@ -128,6 +128,8 @@
url: `/pages/gallery/formDetailPage/formDetailPage?${param}` url: `/pages/gallery/formDetailPage/formDetailPage?${param}`
}) })
} }
} else {
that.$toast.showToast("二维码格式不正确")
} }
}, },
fail() { fail() {
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<view class="app-content"> <view class="app-content">
<v-tabs :tabs="tabs" :scroll="true" :value="current" @change="tabChange"></v-tabs> <v-tabs :tabs="tabs" :scroll="true" :value="current" @change="tabChange"></v-tabs>
<view class="app-group-content"> <view class="app-group-content">
<view class="app-group-item" v-for="(item,index) in apps[current].list" :key="index"> <view class="app-group-item" v-for="(item,index) in getMenuApps()" :key="index">
<view class="title">{{item.group_name||"其他"}}</view> <view class="title">{{item.group_name||"其他"}}</view>
<uni-grid column="4" class="grid-container"> <uni-grid column="4" class="grid-container">
<uni-grid-item class="grid-item" v-for="(model,modelIndex) in item.data" :key="modelIndex"> <uni-grid-item class="grid-item" v-for="(model,modelIndex) in item.data" :key="modelIndex">
...@@ -107,6 +107,13 @@ ...@@ -107,6 +107,13 @@
this.getMostUsed() this.getMostUsed()
}, },
methods: { methods: {
getMenuApps() {
var menuApps = this.apps.find(item => item.app_menu == this.current + 1)
if (menuApps) {
return menuApps.list
}
return []
},
getMostUsed() { getMostUsed() {
Api.getMostUsed().then((result) => { Api.getMostUsed().then((result) => {
if (result.code == 0) { if (result.code == 0) {
......
...@@ -294,7 +294,7 @@ ...@@ -294,7 +294,7 @@
return text return text
}, },
clickItem() { clickItem() {
if (role == 'VISITOR' || this.banners.length == 0) { if (this.role == 'VISITOR' || this.banners.length == 0) {
return return
} }
uni.navigateTo({ uni.navigateTo({
...@@ -367,10 +367,16 @@ ...@@ -367,10 +367,16 @@
} }
}).then((result) => { }).then((result) => {
if (result.code == 0) { if (result.code == 0) {
this.banners = []
if (result.data.list.length > 0) { if (result.data.list.length > 0) {
this.banners = result.data.list result.data.list.forEach((item) => {
if (!item.coverImg || item.coverImg == 'null') {
item.coverImg = "../../static/banner-content.png"
}
this.banners.push(item)
})
console.log("banner", this.banners);
} else { } else {
this.banners = []
if (this.role == 'VISITOR') { if (this.role == 'VISITOR') {
this.banners.push({ this.banners.push({
"coverImg": "../../static/banner-authority.png" "coverImg": "../../static/banner-authority.png"
...@@ -513,27 +519,37 @@ ...@@ -513,27 +519,37 @@
}, },
isCompShow(comNo, objNo) { isCompShow(comNo, objNo) {
let show = false let show = false
this.pageTemplateComponent.forEach((item) => { var com = this.pageTemplateComponent.find(item => item.com_no == comNo)
if (item.com_no == "onepoint-weather") { if (com) {
show = true show = this.isHasAuth(objNo)
} }
}) return show
if (show) { },
if (this.menus && this.menus.length > 0) { isHasAuth(obj) {
var children = this.menus.children_list if (this.menus && this.menus.length > 0) {
if (children) { //是否有小程序权限
//是否有首页权限 var app = this.menus.find(item => item.object_no == 'gdydt')
var home = this.$authMenu.getAuthMenu("syqx", children) console.log("app");
if (home) { if (app) {
var com = this.$authMenu.getAuthMenu(objNo, children) var mainAuthMenus = app.children_list
if (com) { console.log("mainAuthMenus", mainAuthMenus);
show = true if (mainAuthMenus && mainAuthMenus.length > 0) {
var mineMenus = mainAuthMenus.find(item => item.object_no == 'ydtsy')
console.log("mineMenus", mineMenus);
if (mineMenus) {
var childMenus = mineMenus.children_list
console.log("childMenus", childMenus);
if (childMenus && childMenus.length > 0) {
var child = childMenus.find(item => item.object_no == obj)
if (child) {
return true
}
} }
} }
} }
} }
} }
return show return false
}, },
getUserInfo() { getUserInfo() {
Api.getUserInfo().then((result) => { Api.getUserInfo().then((result) => {
...@@ -845,6 +861,7 @@ ...@@ -845,6 +861,7 @@
font-family: "MicrosoftYaHei-Bold "; font-family: "MicrosoftYaHei-Bold ";
font-weight: 400; font-weight: 400;
font-size: 20rpx; font-size: 20rpx;
flex-wrap: nowrap;
margin-top: 8rpx; margin-top: 8rpx;
text-align: left; text-align: left;
color: #fff; color: #fff;
......
...@@ -7,11 +7,12 @@ ...@@ -7,11 +7,12 @@
</view> </view>
<view class="author-content"> <view class="author-content">
<text class="text">{{newDetail.createdUserName}}</text> <text class="text">{{newDetail.createdUserName}}</text>
<text class="text" style="margin-left: 30rpx;">{{newDetail.articleTime}}</text> <text class="text" style="margin-left: 30rpx;">{{timeChange(newDetail.articleTime)}}</text>
</view> </view>
<image :src="newDetail.articleImg" class="image" v-if="newDetail.articleImg"></image> <image :src="newDetail.articleImg" class="image" v-if="newDetail.articleImg"></image>
<view class="text-content"> <view class="text-content">
<rich-text :nodes="newDetail.content" style="font-size: 28rpx;color: #333;"></rich-text> <rich-text :nodes="newDetail.content" style="font-size: 28rpx;color: #333;width: 630rpx;">
</rich-text>
</view> </view>
</view> </view>
<view class="other-content"> <view class="other-content">
...@@ -20,7 +21,7 @@ ...@@ -20,7 +21,7 @@
<view v-for="(item,index) in list" :key="index" class="list-item" @click="toLinkDetail(item)"> <view v-for="(item,index) in list" :key="index" class="list-item" @click="toLinkDetail(item)">
<view class="new-content"> <view class="new-content">
<view class="title">{{item.title}}</view> <view class="title">{{item.title}}</view>
<view class="user">{{item.createdUserName}} {{item.articleTime}}</view> <view class="user">{{item.createdUserName}} {{timeChange(item.articleTime)}}</view>
</view> </view>
<image class="image" :src="dealImage(item.coverImg)"></image> <image class="image" :src="dealImage(item.coverImg)"></image>
</view> </view>
...@@ -42,14 +43,24 @@ ...@@ -42,14 +43,24 @@
content: "" content: ""
}, },
id: "", id: "",
text: "" text: "",
clientId: ""
} }
}, },
onLoad(options) { onLoad(options) {
this.id = options.id this.id = options.id
this.clientId = options.clientId
this.getNewDetail() this.getNewDetail()
}, },
methods: { methods: {
dealRichText(content) {
const regex = new RegExp('width:auto', 'gi');
var richtext = content.replace(regex, `width:100%`)
return richtext;
},
timeChange(time) {
return this.$date.stampToDate(time)
},
toLinkDetail(item) { toLinkDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/index/newDetail/newDetail?id=" + item.articleLibraryId url: "/pages/index/newDetail/newDetail?id=" + item.articleLibraryId
...@@ -86,7 +97,8 @@ ...@@ -86,7 +97,8 @@
Api.getNewDetail({ Api.getNewDetail({
data: { data: {
articleLibraryId: this.id, articleLibraryId: this.id,
projectId: uni.getStorageSync("project_id") || "" projectId: uni.getStorageSync("project_id") || "",
clientId: this.clientId
} }
}).then((result) => { }).then((result) => {
if (result.code == 0) { if (result.code == 0) {
...@@ -94,7 +106,9 @@ ...@@ -94,7 +106,9 @@
let data = result.data let data = result.data
data.forEach(item => { data.forEach(item => {
if (item.articleLibraryId == this.id) { if (item.articleLibraryId == this.id) {
item.content = this.dealRichText(item.content)
this.newDetail = item this.newDetail = item
console.log("处理后富文本", this.newDetail);
} else { } else {
this.list.push(item) this.list.push(item)
} }
...@@ -161,6 +175,7 @@ ...@@ -161,6 +175,7 @@
.text-content { .text-content {
display: flex; display: flex;
width: 630rpx;
flex-direction: column; flex-direction: column;
margin: 30rpx; margin: 30rpx;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<view v-for="(item,index) in list" :key="index" class="list-item" @click="toLinkDetail(item)"> <view v-for="(item,index) in list" :key="index" class="list-item" @click="toLinkDetail(item)">
<view class="new-content"> <view class="new-content">
<view class="title">{{item.title}}</view> <view class="title">{{item.title}}</view>
<view class="user">{{item.createdUserName}} {{item.articleTime}}</view> <view class="user">{{item.createdUserName}} {{timeChange(item.articleTime)}}</view>
</view> </view>
<image class="image" :src="httpToHttps(item.coverImg)"></image> <image class="image" :src="httpToHttps(item.coverImg)"></image>
</view> </view>
...@@ -57,6 +57,9 @@ ...@@ -57,6 +57,9 @@
} }
}, },
methods: { methods: {
timeChange(time) {
return this.$date.stampToDate(time)
},
httpToHttps(url) { httpToHttps(url) {
return this.$imageUtils.httpToHttps(url) return this.$imageUtils.httpToHttps(url)
}, },
...@@ -80,7 +83,8 @@ ...@@ -80,7 +83,8 @@
}, },
toLinkDetail(item) { toLinkDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/index/newDetail/newDetail?id=" + item.articleLibraryId url: "/pages/index/newDetail/newDetail?id=" + item.articleLibraryId + "&clientId=" + this
.clientId
}) })
}, },
search(e) { search(e) {
......
...@@ -4,36 +4,36 @@ ...@@ -4,36 +4,36 @@
<form @submit="formSubmit"> <form @submit="formSubmit">
<view class="form-item"> <view class="form-item">
<view class="star">*</view> <view class="star">*</view>
<view class="text-black-normal">账号</view> <view class="text-black-normal" style="min-width: 100rpx;">账号</view>
<input class="text-black-normal" style="margin-left: 32rpx;flex: 1;" name="account" <input class="text-black-normal" style="margin-left: 32rpx;flex: 1;" name="account"
placeholder="请输入账号(数字字母组合)" /> placeholder="请输入账号(数字字母组合)" />
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="star">*</view> <view class="star">*</view>
<view class="text-black-normal">姓名</view> <view class="text-black-normal" style="min-width: 100rpx;">姓名</view>
<input class="text-black-normal" style="margin-left: 32rpx;" name="username" placeholder="请输入姓名" /> <input class="text-black-normal" style="margin-left: 32rpx;" name="username" placeholder="请输入姓名" />
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="star">*</view> <view class="star">*</view>
<view class="text-black-normal">密码</view> <view class="text-black-normal" style="min-width: 100rpx;">密码</view>
<input class="text-black-normal" style="margin-left: 32rpx;" name="password" placeholder="请输入密码" <input class="text-black-normal" style="margin-left: 32rpx;" name="password" placeholder="请输入密码"
type="password" /> type="password" />
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="star">*</view> <view class="star">*</view>
<view class="text-black-normal">确认密码</view> <view class="text-black-normal" style="min-width: 100rpx;">确认密码</view>
<input class="text-black-normal" style="margin-left: 32rpx;" name="confirmpassword" <input class="text-black-normal" style="margin-left: 32rpx;" name="confirmpassword"
placeholder="请再次输入密码" type="password" /> placeholder="请再次输入密码" type="password" />
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="star">*</view> <view class="star">*</view>
<view class="text-black-normal">手机号</view> <view class="text-black-normal" style="min-width: 100rpx;">手机号</view>
<input class="text-black-normal" style="margin-left: 32rpx;" name="phone" placeholder="请输入手机号" <input class="text-black-normal" style="margin-left: 32rpx;" name="phone" placeholder="请输入手机号"
v-model="phone" type="number" /> v-model="phone" type="number" />
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="star">*</view> <view class="star">*</view>
<view class="text-black-normal">验证码</view> <view class="text-black-normal" style="min-width: 100rpx;">验证码</view>
<input class="text-black-normal" style="margin-left: 32rpx;flex: 1;" name="code" placeholder="请输入验证码" <input class="text-black-normal" style="margin-left: 32rpx;flex: 1;" name="code" placeholder="请输入验证码"
type="number" /> type="number" />
<view class="text-blue" @click="getCode">{{codeText}}</view> <view class="text-blue" @click="getCode">{{codeText}}</view>
...@@ -120,12 +120,8 @@ ...@@ -120,12 +120,8 @@
password: data.password, password: data.password,
confirm_password: data.confirmpassword, confirm_password: data.confirmpassword,
audit_status: 2 audit_status: 2
},
header: {
key: key
} }
}).then((res) => { }).then((result) => {
let result = res.data
if (result.code == 0) { if (result.code == 0) {
this.$toast.showToast("注册成功!") this.$toast.showToast("注册成功!")
// if (this.type == "bind") { // if (this.type == "bind") {
...@@ -147,16 +143,10 @@ ...@@ -147,16 +143,10 @@
"password": password, "password": password,
"login_type": 1, "login_type": 1,
"system_no": this.$config.systemCode "system_no": this.$config.systemCode
},
header: {
"key": key,
"Content-Type": "application/json"
} }
}).then((res) => { }).then((result) => {
let result = res.data
console.log("登录用户信息:", result); console.log("登录用户信息:", result);
if (result.code === 0) { if (result.code === 0) {
uni.setStorageSync('isCanUse', false); //记录是否第一次授权 false:表示不是第一次授权
uni.setStorageSync("short_token", result.data.short_token) uni.setStorageSync("short_token", result.data.short_token)
uni.setStorageSync("token", result.data.access_token) uni.setStorageSync("token", result.data.access_token)
uni.setStorageSync("user_info", result.data) uni.setStorageSync("user_info", result.data)
...@@ -224,10 +214,9 @@ ...@@ -224,10 +214,9 @@
header: { header: {
"Content-Type": "application/json" "Content-Type": "application/json"
} }
}).then((res) => { }).then((result) => {
console.log(res);
let result = res.data
if (result.code === 0) { if (result.code === 0) {
uni.setStorageSync("key", result.data.key)
this.register(result.data.key, data) this.register(result.data.key, data)
} else { } else {
uni.showToast({ uni.showToast({
...@@ -313,6 +302,7 @@ ...@@ -313,6 +302,7 @@
.register-root { .register-root {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background-color: #FFFFFF;
padding: 32rpx; padding: 32rpx;
} }
......
...@@ -10,37 +10,37 @@ ...@@ -10,37 +10,37 @@
<view class="line"></view> <view class="line"></view>
<view class="item" @click="showQrcode"> <view class="item" @click="showQrcode">
<view class="item-name">项目二维码:</view> <view class="item-name">项目二维码:</view>
<view class="item-value-blue">二维码下载</view> <view class="item-value-blue" v-if="projectId">二维码下载</view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="item"> <view class="item">
<view class="item-name">计划开工日期:</view> <view class="item-name">计划开工日期:</view>
<view class="item-value">{{project.contract_start_date}}</view> <view class="item-value">{{project.contract_start_date||""}}</view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="item"> <view class="item">
<view class="item-name">计划竣工日期:</view> <view class="item-name">计划竣工日期:</view>
<view class="item-value">{{project.contract_end_date}}</view> <view class="item-value">{{project.contract_end_date||""}}</view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="item"> <view class="item">
<view class="item-name">项目地址:</view> <view class="item-name">项目地址:</view>
<view class="item-value" <view class="item-value"
style="width: 488rpx;display: flex;flex-direction: column;align-items: flex-end;"> style="width: 488rpx;display: flex;flex-direction: column;align-items: flex-end;">
{{project.province}}{{project.city}}{{project.area}} {{project.province||""}}{{project.city||""}}{{project.area||""}}
</view> </view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="item"> <view class="item">
<view class="item-name">详细地址:</view> <view class="item-name">详细地址:</view>
<view class="item-value" style="width: 488rpx;">{{project.address}}</view> <view class="item-value" style="width: 488rpx;">{{project.address||""}}</view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="item"> <view class="item">
<view class="item-name">项目地图:</view> <view class="item-name">项目地图:</view>
</view> </view>
</view> </view>
<map class="map-content" :longitude="project.lon" :latitude="project.lat"></map> <map class="map-content" :longitude="project.lon" :latitude="project.lat" :markers="markers" scale="16"></map>
<view class="jj-content"> <view class="jj-content">
<view class="item"> <view class="item">
<view class="item-name">项目简介:</view> <view class="item-name">项目简介:</view>
...@@ -75,7 +75,8 @@ ...@@ -75,7 +75,8 @@
qrcodeSrc: "", qrcodeSrc: "",
curTitle: "", curTitle: "",
role: "PM", role: "PM",
projectId: "" projectId: "",
markers: []
} }
}, },
onLoad() { onLoad() {
...@@ -98,6 +99,15 @@ ...@@ -98,6 +99,15 @@
console.log("项目信息", result); console.log("项目信息", result);
if (result.code == 0) { if (result.code == 0) {
this.project = result.data this.project = result.data
this.markers.push({
id: this.project.project_id,
width: 20,
height: 20,
//将经纬度进行重新赋值,不覆盖将默认latitude: 39.909,longitude: 116.39742,时地图移动到标点位置
latitude: this.project.lat,
longitude: this.project.lon,
iconPath: '../../../static/flag-ic.png' //给每一个坐标添加图片
})
} else { } else {
this.$toast.showToast(result.msg) this.$toast.showToast(result.msg)
} }
......
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
.wx-image { .wx-image {
width: 48rpx; width: 48rpx;
top: 10px; top: 12px;
pointer-events: none; pointer-events: none;
left: 98px; left: 98px;
height: 48rpx; height: 48rpx;
...@@ -182,7 +182,7 @@ ...@@ -182,7 +182,7 @@
} }
.wx-text { .wx-text {
top: 10px; top: 12px;
left: 129px; left: 129px;
pointer-events: none; pointer-events: none;
color: #FFFFFF; color: #FFFFFF;
...@@ -209,13 +209,14 @@ ...@@ -209,13 +209,14 @@
height: 48rpx; height: 48rpx;
pointer-events: none; pointer-events: none;
left: 98px; left: 98px;
top: 12px;
position: absolute; position: absolute;
} }
text { text {
font-weight: 400; font-weight: 400;
color: #4972f5; color: #4972f5;
top: 10px; top: 12px;
left: 129px; left: 129px;
pointer-events: none; pointer-events: none;
font-size: 34rpx; font-size: 34rpx;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
Please register or to comment