提交 d6099fbb 作者: wk

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

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