mo-bai 3 years ago
parent
commit
458041b075
10 changed files with 376 additions and 52 deletions
  1. 3
      components/qn-select/qn-select.vue
  2. 8
      pages.json
  3. 6
      pages/device-operation/index.vue
  4. 223
      pages/device-production-info/index.vue
  5. 44
      pages/digital-workshops/DeviceItem.vue
  6. 1
      pages/digital-workshops/index.vue
  7. 26
      pages/factory-operation/index.vue
  8. 18
      pages/mine/index.vue
  9. 99
      pages/setting/index.vue
  10. BIN
      static/imgs/general/setting-icon.png

3
components/qn-select/qn-select.vue

@ -102,6 +102,9 @@ export default {
this.visible = false
},
isSelected(value) {
if (!this.value) {
return false
}
if (this.multiple) {
return this.value.indexOf(value) > -1
} else {

8
pages.json

@ -289,6 +289,14 @@
"navigationBarTitleText": "统一第三方页面",
"enablePullDownRefresh": false
}
},
{
"path": "pages/setting/index",
"style": {
"navigationBarTitleText": "设置",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
],
"globalStyle": {

6
pages/device-operation/index.vue

@ -238,7 +238,11 @@ export default {
Object.keys(this.form).forEach((key) => {
this.form[key] = res[key]
})
this.form.technicsTypeList = res.technicsTypeList.map((item) => item.id)
if (res.technicsTypeList) {
this.form.technicsTypeList = res.technicsTypeList.map((item) => item.id)
} else {
this.form.technicsTypeList = []
}
}
})
},

223
pages/device-production-info/index.vue

@ -1,6 +1,8 @@
<template>
<view class="content">
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="生产设备详情"></uni-nav-bar>
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="生产设备详情">
<view slot="right"><text class="text_4" @click="popupShow">分享</text></view>
</uni-nav-bar>
<view class="flex-col items-center group_1" v-if="info.videoUrl">
<image src="/static/imgs/digital-workshops/camera-tip-bg.png" class="image_2" @click="go2('video-play', { url: info.videoUrl })" />
</view>
@ -71,12 +73,59 @@
<text>暂无购置信息</text>
</view>
</view>
<uni-popup ref="popup" type="bottom">
<view class="flex-col group_10">
<view class="flex-col section_7">
<view class="flex-col section_8">
<text class="text_12">立即分享给好友</text>
<view class="flex-col group_11">
<view class="top-group flex-row">
<image src="/static/imgs/general/session-share-icon.png" class="image_8" @click="share('WXSceneSession')" />
<image src="/static/imgs/general/line-share-icon.png" class="image_9" @click="share('WXSceneTimeline')" />
</view>
<view class="top-group flex-row view_1">
<text>微信好友</text>
<text class="text_14">朋友圈</text>
</view>
<view class="divider"></view>
<view class="flex-col section_9">
<view class="justify-between group_12">
<view class="flex-row group_13" @click="selectMethod(true)">
<image :src="hasPassword ? '/static/imgs/general/selected-icon.png' : '/static/imgs/general/select-icon.png'" class="image_10" />
<text class="text_15">密码分享</text>
</view>
<view class="flex-row group_14" v-show="hasPassword">
<qn-easyinput
:maxlength="20"
v-model="password"
:inputBorder="false"
text="right"
placeholderStyle=" fontSize: 28rpx"
placeholder="请设置访问密码"
></qn-easyinput>
</view>
</view>
<text class="text_17" v-show="hasPassword">请提前告知用户访问密码以便及时查看信息</text>
<view class="flex-row group_15" @click="selectMethod(false)">
<image :src="hasPassword ? '/static/imgs/general/select-icon.png' : '/static/imgs/general/selected-icon.png'" class="image_10" />
<text class="text_18">公开访问</text>
</view>
</view>
</view>
</view>
</view>
<view class="flex-col items-center button" @click="popupHide">
<text>取消</text>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import { go2, back } from '@/utils/hook.js'
import { getEquipmentInfo } from '@/apis/deviceApi'
import { getEquipmentInfo, makeDeviceShare } from '@/apis/deviceApi'
import { H5_URL_DEVICE, isEncrypt } from '@/enums/index.js'
const tabList = [
{ name: '生产情况', key: 1 },
{ name: '维修保养', key: 2 },
@ -88,7 +137,9 @@ export default {
id: null,
info: {},
tabList: Object.freeze(tabList),
curTab: 1
curTab: 1,
hasPassword: true,
password: ''
}
},
onLoad(options) {
@ -130,6 +181,48 @@ export default {
},
selectTab(key) {
this.curTab = key
},
popupShow() {
this.$refs.popup.open('bottom')
},
popupHide() {
this.$refs.popup.close()
},
selectMethod(isPassword) {
this.hasPassword = isPassword
},
share(scene) {
//
if (this.hasPassword && !this.password) {
uni.showToast({
title: '请输入访问密码',
icon: 'none'
})
return
}
makeDeviceShare({
encryptOrNot: this.hasPassword ? isEncrypt.YES : isEncrypt.NO,
mechanicalEquipmentId: this.id,
password: this.password
}).then((res) => {
if (res) {
uni.share({
provider: 'weixin',
type: 0,
title: '设备展示',
summary: '机器进度实时查看',
scene: scene, // WXSceneTimeline,WXSceneSession
imageUrl: 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/wx-share-store.png',
href: H5_URL_DEVICE + `shareId=${res}`,
success: () => {
console.log('分享成功')
},
fail: (err) => {
console.log('err', err)
}
})
}
})
}
},
filters: {
@ -150,6 +243,10 @@ export default {
<style lang="scss" scoped>
.content {
width: 750rpx;
.text_4 {
color: rgb(0, 122, 255);
font-size: 28rpx;
}
.group_1 {
color: rgb(255, 255, 255);
font-size: 28rpx;
@ -295,4 +392,124 @@ export default {
overflow: hidden;
height: 148rpx;
}
.group_10 {
height: 637rpx;
.section_7 {
padding-bottom: 96rpx;
background-color: rgb(247, 248, 250);
border-radius: 40rpx 40rpx 0px 0px;
.section_8 {
padding-top: 40rpx;
overflow: hidden;
border-radius: 40rpx 40rpx 0px 0px;
background-color: rgb(255, 255, 255);
height: 520rpx;
.text_12 {
align-self: center;
color: rgb(51, 51, 51);
font-size: 28rpx;
font-weight: 500;
line-height: 40rpx;
white-space: nowrap;
}
.group_11 {
margin-top: 40rpx;
.top-group {
padding: 0 48rpx;
.image_8 {
border-radius: 50%;
width: 96rpx;
height: 96rpx;
}
.image_9 {
margin-left: 64rpx;
width: 96rpx;
height: 96rpx;
}
.text_14 {
margin-left: 76rpx;
}
}
.view_1 {
margin-top: 16rpx;
color: rgb(51, 51, 51);
font-size: 24rpx;
line-height: 33rpx;
white-space: nowrap;
}
.divider {
margin: 32rpx 32rpx 0;
background-color: rgb(235, 237, 240);
height: 1rpx;
}
.section_9 {
padding: 24rpx 32rpx 0;
background-color: rgb(255, 255, 255);
.image_10 {
margin: 4rpx 0;
width: 32rpx;
height: 32rpx;
}
.group_12 {
padding-left: 2rpx;
.group_13 {
color: rgb(51, 51, 51);
font-size: 28rpx;
line-height: 40rpx;
white-space: nowrap;
.text_15 {
margin-left: 18rpx;
}
}
.group_14 {
color: rgb(136, 136, 136);
font-size: 28rpx;
line-height: 40rpx;
white-space: nowrap;
}
}
.text_17 {
margin-top: 16rpx;
align-self: center;
color: rgb(136, 136, 136);
font-size: 24rpx;
line-height: 33rpx;
white-space: nowrap;
}
.group_15 {
margin-top: 22rpx;
padding: 26rpx 2rpx 20rpx;
color: rgb(51, 51, 51);
font-size: 28rpx;
line-height: 40rpx;
white-space: nowrap;
border-top: solid 2rpx rgb(235, 237, 240);
.image_12 {
margin: 4rpx 0;
}
.text_18 {
margin-left: 18rpx;
}
}
.image_4 {
margin-left: 17rpx;
align-self: center;
width: 20rpx;
height: 20rpx;
}
}
}
}
}
.button {
margin-top: -75rpx;
padding: 26rpx 0;
color: rgb(51, 51, 51);
font-size: 32rpx;
line-height: 45rpx;
white-space: nowrap;
background-color: rgb(255, 255, 255);
position: relative;
}
}
</style>

44
pages/digital-workshops/DeviceItem.vue

@ -12,12 +12,14 @@
<image class="avatar" :src="deviceInfo.licPicUrl || '/static/imgs/general/device-default.png'"></image>
</view>
<view class="right-group flex-col">
<view class="top-group flex-row">
<view class="top-group justify-between">
<text class="name text-ellipsis">{{ deviceInfo.name }}</text>
<image v-if="hasCamera" src="/static/imgs/digital-workshops/camera-icon.png" class="image_5" />
<image v-if="hasCloudBox" src="/static/imgs/digital-workshops/cloudBox-icon.png" class="image_5" />
<view>
<image v-if="hasCamera" src="/static/imgs/digital-workshops/camera-icon.png" class="image_5" />
<image v-if="hasCloudBox" src="/static/imgs/digital-workshops/cloudBox-icon.png" class="image_5" />
</view>
</view>
<view class="equal-division flex-row" v-if="hasCloudBox">
<view class="equal-division justify-between" v-if="hasCloudBox">
<view class="equal-division-item flex-col">
<text class="text_24">今日产能</text>
<view class="bottom-group_1 flex-row">
@ -25,18 +27,18 @@
<text class="text_28"></text>
</view>
</view>
<view class="equal-division-item_1 flex-col">
<text class="text_30">今日时长</text>
<view class="bottom-group_2 flex-row">
<text class="text_32">{{ deviceInfo.todayWorkHour }}</text>
<text class="text_34">h</text>
<view class="equal-division-item flex-col">
<text class="text_24">今日时长</text>
<view class="bottom-group_1 flex-row">
<text class="text_26">{{ deviceInfo.todayWorkHour }}</text>
<text class="text_28">h</text>
</view>
</view>
<view class="equal-division-item_2 flex-col">
<text class="text_36">开机率</text>
<view class="bottom-group_3 flex-row">
<text class="text_38">{{ deviceInfo.startupRate }}</text>
<text class="text_40">%</text>
<view class="equal-division-item flex-col">
<text class="text_24">开机率</text>
<view class="bottom-group_1 flex-row">
<text class="text_26">{{ deviceInfo.startupRate | translateRate }}</text>
<text class="text_28">%</text>
</view>
</view>
</view>
@ -92,6 +94,16 @@ export default {
}
return `最近开机 ${month}${day}${hour}:${minute}`
}
},
filters: {
translateRate(rate) {
if (!rate) {
rate = 0
} else {
rate = rate.toFixed(2)
}
return rate
}
}
}
</script>
@ -159,9 +171,9 @@ export default {
}
}
.equal-division {
margin-right: 24rpx;
margin-left: 26rpx;
.equal-division-item {
padding: 10rpx 13rpx 10rpx 26rpx;
padding: 10rpx 0;
flex: 1 1 146rpx;
.text_24 {
color: rgb(24, 16, 89);

1
pages/digital-workshops/index.vue

@ -132,7 +132,6 @@ export default {
this.getFactoryList()
},
onPullDownRefresh() {
console.log('下拉刷新')
this.getFactoryList()
uni.stopPullDownRefresh()
},

26
pages/factory-operation/index.vue

@ -134,30 +134,6 @@
</view>
</template>
<script>
import { go2, back } from '@/utils/hook.js'
export default {
data() {
return {
id: null,
operation: 'add',
title: '新增工厂'
}
},
onLoad(options) {
if (options.id) {
this.id = options.id
this.operation = 'edit'
this.title = '编辑工厂'
}
},
methods: {
go2,
back
}
}
</script>
<script>
import { getArea, getLicenseOcr } from '@/apis/commonApi.js'
import { uploadImage, uploadVideo, back } from '@/utils/hook.js'
@ -211,6 +187,7 @@ export default {
data() {
return {
id: null,
title: '新增工厂',
form: {
businessLicenseImg: '',
uniformSocialCreditCode: '',
@ -242,6 +219,7 @@ export default {
if (options.id) {
this.id = options.id
this.operation = 'edit'
this.title = '编辑工厂'
}
},
created() {

18
pages/mine/index.vue

@ -26,10 +26,11 @@
</view>
</view>
</view>
<view v-if="hasLogin" class="logout" @click="logout">
<image v-if="hasLogin" src="/static/imgs/general/setting-icon.png" @click="go2('setting')" class="image_3" />
<!-- <view class="logout" @click="logout">
<text class="text">退出登录</text>
<image class="icon" src="/static/imgs/mine/logout-icon.png"></image>
</view>
</view> -->
</view>
</view>
<view class="card-area" v-if="hasCompany">
@ -110,7 +111,7 @@
</template>
<script>
import { exit, go2, loginGo2 } from '@/utils/hook.js'
import { go2, loginGo2 } from '@/utils/hook.js'
import { fddEnterpriseStatus, fsAuditStatus, orderStatusEnum, enterpriseType } from '@/enums/index.js'
import { getVerifyUrl, getFsCredit, getBaseInfo, getFeisuanUrl, cancelAccount } from '@/apis/commonApi.js'
import { getDeviceStatistics } from '@/apis/mineApi'
@ -136,9 +137,6 @@ export default {
},
methods: {
loginGo2,
logout() {
exit()
},
cancelAccount() {
uni.showModal({
title: '提示',
@ -300,8 +298,14 @@ export default {
padding: 0 32rpx;
display: flex;
flex-direction: row;
align-items: center;
align-items: flex-start;
justify-content: space-between;
.image_3 {
margin-left: 24rpx;
width: 36rpx;
height: 40rpx;
z-index: 10;
}
.user {
max-width: 550rpx;
z-index: 5;

99
pages/setting/index.vue

@ -0,0 +1,99 @@
<template>
<view class="content">
<uni-nav-bar left-icon="back" @clickLeft="back" statusBar fixed title="设置"></uni-nav-bar>
<view class="flex-col group_4">
<view class="flex-col section_1">
<view class="top-group justify-between">
<text>关于我们</text>
<image src="/static/imgs/digital-workshops/right-arrow-icon.png" class="image_4" />
</view>
<view class="flex-col">
<view class="top-group justify-between">
<text>用户协议</text>
<image src="/static/imgs/digital-workshops/right-arrow-icon.png" class="image_4" />
</view>
<view class="justify-between group_6">
<text class="text_6">当前版本号</text>
<text class="text_7">印包客V1.1.0</text>
</view>
</view>
</view>
<view class="flex-col items-center button" @click="logout">
<text>退出登录</text>
</view>
</view>
</view>
</template>
<script>
import { go2, back, exit } from '@/utils/hook.js'
export default {
data() {
return {}
},
methods: {
go2,
back,
logout() {
exit()
}
}
}
</script>
<style lang="scss" scoped>
.content {
width: 750rpx;
.group_4 {
padding-bottom: 80rpx;
flex: 1 1 auto;
overflow-y: auto;
.section_1 {
background-color: rgb(255, 255, 255);
.top-group {
color: rgb(51, 51, 51);
font-size: 32rpx;
line-height: 45rpx;
white-space: nowrap;
padding: 27rpx 32rpx 26rpx;
border-bottom: solid 2rpx rgb(221, 221, 221);
.image_4 {
margin: 10rpx 9rpx 10rpx 0;
width: 14rpx;
height: 24rpx;
}
}
.group_6 {
padding: 27rpx 31rpx 26rpx 32rpx;
.text_6 {
color: rgb(51, 51, 51);
font-size: 32rpx;
line-height: 45rpx;
white-space: nowrap;
}
.text_7 {
color: rgb(136, 136, 136);
font-size: 28rpx;
line-height: 40rpx;
white-space: nowrap;
}
}
}
.button {
position: fixed;
bottom: 80rpx;
width: 686rpx;
left: 32rpx;
right: 32rpx;
padding: 23rpx 0;
color: rgb(51, 51, 51);
font-size: 30rpx;
font-weight: 500;
line-height: 42rpx;
white-space: nowrap;
background-color: rgb(232, 232, 232);
border-radius: 10rpx;
}
}
}
</style>

BIN
static/imgs/general/setting-icon.png

Before After
Width: 72  |  Height: 80  |  Size: 2.4 KiB
Loading…
Cancel
Save