app验收反馈
This commit is contained in:
17
App.vue
17
App.vue
@@ -1,6 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { queryDictDataCache } from './common/api/dictionary.js'
|
import { queryDictDataCache } from './common/api/dictionary.js'
|
||||||
import encrypt from './common/js/aes.js'
|
import { getImageUrl } from '@/common/api/basic'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
console.log(window)
|
console.log(window)
|
||||||
@@ -14,14 +15,24 @@ export default {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (!uni.getStorageSync(this.$cacheKey.userInfo)) {
|
if (!uni.getStorageSync(this.$cacheKey.access_token)) {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/login/login',
|
url: '/pages/user/login',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 查询字典
|
||||||
queryDictDataCache().then((res) => {
|
queryDictDataCache().then((res) => {
|
||||||
uni.setStorageSync(this.$cacheKey.dictData, res.data)
|
uni.setStorageSync(this.$cacheKey.dictData, res.data)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 更新用户头像
|
||||||
|
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
|
if (userInfo.headSculpture) {
|
||||||
|
getImageUrl(userInfo.headSculpture).then((res) => {
|
||||||
|
userInfo.avatar = res.data
|
||||||
|
uni.setStorageSync(this.$cacheKey.userInfo, userInfo)
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onHide: function () {
|
onHide: function () {
|
||||||
console.log('App Hide')
|
console.log('App Hide')
|
||||||
|
|||||||
25
common/api/basic.js
Normal file
25
common/api/basic.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import request from '../js/request'
|
||||||
|
import config from '../js/config'
|
||||||
|
|
||||||
|
// 上传图片
|
||||||
|
export const uploadImage = (filePath) => {
|
||||||
|
return uni.uploadFile({
|
||||||
|
url: config.domain + '/user-boot/user/uploadImage',
|
||||||
|
filePath,
|
||||||
|
name: 'issuesFile',
|
||||||
|
header: {
|
||||||
|
Authorization: uni.getStorageSync('access_token'),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取图片url
|
||||||
|
export const getImageUrl = (headSculpture) => {
|
||||||
|
return request({
|
||||||
|
url: '/user-boot/user/getUrl',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
headSculpture,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -33,3 +33,7 @@ export const queryAppInfoByType = (type) => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
@@ -168,7 +168,7 @@ export function apiPwdLogin(params) {
|
|||||||
|
|
||||||
//登录获取公钥
|
//登录获取公钥
|
||||||
export function gongkey(data) {
|
export function gongkey(data) {
|
||||||
console.log(data);
|
console.log(data)
|
||||||
return request({
|
return request({
|
||||||
url: '/user-boot/user/generateSm2Key',
|
url: '/user-boot/user/generateSm2Key',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
@@ -191,3 +191,16 @@ export function apiModifyPsd(params) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更改用户信息
|
||||||
|
export function apiUpdateUser(params) {
|
||||||
|
return request({
|
||||||
|
url: '/user-boot/user/updateAppUser',
|
||||||
|
data: {
|
||||||
|
...params,
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
method: 'PUT',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ page {
|
|||||||
margin: 0 20rpx;
|
margin: 0 20rpx;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-gap: 20rpx;
|
grid-gap: 20rpx;
|
||||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
grid-template-columns: 1fr 1fr 1fr ;
|
||||||
.header-item {
|
.header-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -161,7 +161,7 @@ page {
|
|||||||
background: $uni-theme-color;
|
background: $uni-theme-color;
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
.header-item-value {
|
.header-item-value {
|
||||||
font-size: 32rpx;
|
font-size: 44rpx;
|
||||||
}
|
}
|
||||||
.header-item-label {
|
.header-item-label {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import request from './request'
|
import request from './request'
|
||||||
import cache from './cacheKey.js'
|
import cache from './cacheKey.js'
|
||||||
|
import { getImageUrl } from '@/common/api/basic'
|
||||||
import { queryDictDataCache } from '../api/dictionary.js'
|
import { queryDictDataCache } from '../api/dictionary.js'
|
||||||
import cacheKey from './cacheKey.js'
|
import cacheKey from './cacheKey.js'
|
||||||
const toast = (title, duration = 1500, call, mask = false, icon = 'none') => {
|
const toast = (title, duration = 1500, call, mask = false, icon = 'none') => {
|
||||||
@@ -207,7 +208,14 @@ const loginSuccess = (data) => {
|
|||||||
console.log(escape, atob)
|
console.log(escape, atob)
|
||||||
var userInfo = JSON.parse(decodeURIComponent(escape(atob(strings[1].replace(/-/g, '+').replace(/_/g, '/')))))
|
var userInfo = JSON.parse(decodeURIComponent(escape(atob(strings[1].replace(/-/g, '+').replace(/_/g, '/')))))
|
||||||
userInfo.authorities = userInfo.authorities[0]
|
userInfo.authorities = userInfo.authorities[0]
|
||||||
uni.setStorageSync('userInfo', userInfo)
|
if (userInfo.headSculpture) {
|
||||||
|
getImageUrl(userInfo.headSculpture).then((res) => {
|
||||||
|
userInfo.avatar = res.data
|
||||||
|
uni.setStorageSync(cache.userInfo, userInfo)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync(cache.userInfo, userInfo)
|
||||||
|
}
|
||||||
console.log('reLaunch')
|
console.log('reLaunch')
|
||||||
queryDictDataCache().then((res) => {
|
queryDictDataCache().then((res) => {
|
||||||
uni.setStorageSync(cacheKey.dictData, res.data)
|
uni.setStorageSync(cacheKey.dictData, res.data)
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
"name" : "灿能物联",
|
"name" : "灿能物联",
|
||||||
"appid" : "__UNI__88BC25B",
|
"appid" : "__UNI__88BC25B",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.7",
|
"versionName" : "1.0.8",
|
||||||
"versionCode" : 107,
|
"versionCode" : 108,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
@@ -132,7 +132,7 @@
|
|||||||
"/api" : {
|
"/api" : {
|
||||||
"https" : true,
|
"https" : true,
|
||||||
// "target" : "https://china.indpecker.com",
|
// "target" : "https://china.indpecker.com",
|
||||||
"target" : "http://192.168.1.139:10215",
|
"target" : "http://192.168.1.115:10215",
|
||||||
"changOrigin" : true,
|
"changOrigin" : true,
|
||||||
"pathRewrite" : {
|
"pathRewrite" : {
|
||||||
"/api" : ""
|
"/api" : ""
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
v-for="(item, index) in projectList"
|
v-for="(item, index) in projectList"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="jump(item)"
|
@click="jump(item)"
|
||||||
thumbnail="/static/device.png"
|
:thumbnail="deviceIcon(item.runStatus)"
|
||||||
>
|
>
|
||||||
</uni-card>
|
</uni-card>
|
||||||
<uni-load-more status="nomore"></uni-load-more>
|
<uni-load-more status="nomore"></uni-load-more>
|
||||||
@@ -40,12 +40,27 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
deviceIcon(e) {
|
||||||
|
let str = ''
|
||||||
|
switch (e) {
|
||||||
|
case 1:
|
||||||
|
str = '/static/device_bad.png'
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
str = '/static/device.png'
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
str = '/static/device.png'
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return str
|
||||||
|
},
|
||||||
onClickItem(e) {
|
onClickItem(e) {
|
||||||
this.current = e.currentIndex
|
this.current = e.currentIndex
|
||||||
},
|
},
|
||||||
jump(item) {
|
jump(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/device/APF/detail?id=' + item.equipmentId + '&isPrimaryUser=' + item.isPrimaryUser,
|
url: '/pages/device/APF/detail?id=' + item.id + '&isPrimaryUser=0',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
trigger(e) {
|
trigger(e) {
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
<view slot="body">
|
<view slot="body">
|
||||||
<view class="transfer">
|
<view class="transfer">
|
||||||
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
||||||
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" :options="{ margin: 10 }"></uqrcode>
|
<!-- <uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" :options="{ margin: 10 }"></uqrcode> -->
|
||||||
|
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" :options="{ margin: 10 }" :loading="false"></uqrcode>
|
||||||
|
|
||||||
<canvas id="qrcode" width="200" height="200"></canvas>
|
<canvas id="qrcode" width="200" height="200"></canvas>
|
||||||
<view class="transfer-text">请让接收人员扫码接收</view>
|
<view class="transfer-text">请让接收人员扫码接收</view>
|
||||||
<view class="transfer-btn">
|
<view class="transfer-btn">
|
||||||
|
|||||||
@@ -6,14 +6,32 @@
|
|||||||
</view> -->
|
</view> -->
|
||||||
<picker
|
<picker
|
||||||
@change="projectNameChange"
|
@change="projectNameChange"
|
||||||
|
@cancel="selectProject = false"
|
||||||
:value="select.projectNameIndex"
|
:value="select.projectNameIndex"
|
||||||
:range="projectList"
|
:range="projectList"
|
||||||
range-key="text"
|
range-key="text"
|
||||||
v-if="store.params.engineerId"
|
v-if="store.params.engineerId"
|
||||||
>
|
>
|
||||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }">
|
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }" @click="selectProject = true">
|
||||||
{{ select.projectName || '项目' }}
|
{{
|
||||||
<uni-icons type="bottom" size="14" color="#666"></uni-icons>
|
select.projectName
|
||||||
|
? select.projectName.length > 4
|
||||||
|
? select.projectName.substring(0, 4) + '...'
|
||||||
|
: select.projectName
|
||||||
|
: '全部项目'
|
||||||
|
}}
|
||||||
|
<uni-icons
|
||||||
|
type="top"
|
||||||
|
size="14"
|
||||||
|
:color="select.projectName ? '#376cf3' : '#666'"
|
||||||
|
v-if="selectProject"
|
||||||
|
></uni-icons>
|
||||||
|
<uni-icons
|
||||||
|
type="bottom"
|
||||||
|
size="14"
|
||||||
|
:color="select.projectName ? '#376cf3' : '#666'"
|
||||||
|
v-else
|
||||||
|
></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
<view style="flex: 1"></view>
|
<view style="flex: 1"></view>
|
||||||
@@ -101,6 +119,7 @@ export default {
|
|||||||
projectType: [],
|
projectType: [],
|
||||||
navHeight: 0,
|
navHeight: 0,
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
|
selectProject: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -231,6 +250,7 @@ export default {
|
|||||||
this.select.projectType = this.projectType[e.detail.value].text
|
this.select.projectType = this.projectType[e.detail.value].text
|
||||||
},
|
},
|
||||||
projectNameChange(e) {
|
projectNameChange(e) {
|
||||||
|
this.selectProject = false
|
||||||
console.log(e)
|
console.log(e)
|
||||||
this.select.projectNameIndex = e.detail.value
|
this.select.projectNameIndex = e.detail.value
|
||||||
if (e.detail.value === 0) {
|
if (e.detail.value === 0) {
|
||||||
|
|||||||
@@ -105,6 +105,14 @@ export default {
|
|||||||
// e的返回格式为json对象:{"text":"测试","index":0}
|
// e的返回格式为json对象:{"text":"测试","index":0}
|
||||||
this.drawer = !this.drawer
|
this.drawer = !this.drawer
|
||||||
if (this.drawer) {
|
if (this.drawer) {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
var webView = this.$mp.page.$getAppWebview()
|
||||||
|
// 修改buttons
|
||||||
|
webView.setTitleNViewButtonStyle(0, {
|
||||||
|
text: '取消',
|
||||||
|
select: false,
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
this.openDrawer()
|
this.openDrawer()
|
||||||
} else {
|
} else {
|
||||||
this.closeDrawer()
|
this.closeDrawer()
|
||||||
@@ -141,11 +149,29 @@ export default {
|
|||||||
// #endif
|
// #endif
|
||||||
getDevCount(this.select.engineeringId).then((res) => {
|
getDevCount(this.select.engineeringId).then((res) => {
|
||||||
this.devCount = res.data
|
this.devCount = res.data
|
||||||
|
this.devCount.currentOffLineDevs.forEach((item) => {
|
||||||
|
item.runStatus = 1
|
||||||
|
})
|
||||||
|
this.devCount.offLineDevs.forEach((item) => {
|
||||||
|
item.runStatus = 1
|
||||||
|
})
|
||||||
})
|
})
|
||||||
this.$refs.device && this.$refs.device.init()
|
this.$refs.device && this.$refs.device.init()
|
||||||
},
|
},
|
||||||
closeDrawer(e) {
|
closeDrawer(e) {
|
||||||
if (!e) {
|
if (!e) {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
var webView = this.$mp.page.$getAppWebview()
|
||||||
|
// 修改buttons
|
||||||
|
webView.setTitleNViewButtonStyle(0, {
|
||||||
|
text: this.select.engineeringName
|
||||||
|
? this.select.engineeringName.length > 7
|
||||||
|
? this.select.engineeringName.substring(0, 7) + '...'
|
||||||
|
: this.select.engineeringName
|
||||||
|
: '请选择工程',
|
||||||
|
select: true,
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
this.$refs.showRight.close()
|
this.$refs.showRight.close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -160,7 +186,11 @@ export default {
|
|||||||
var webView = this.$mp.page.$getAppWebview()
|
var webView = this.$mp.page.$getAppWebview()
|
||||||
// 修改buttons
|
// 修改buttons
|
||||||
webView.setTitleNViewButtonStyle(0, {
|
webView.setTitleNViewButtonStyle(0, {
|
||||||
text: this.select.engineeringName,
|
text:
|
||||||
|
this.select.engineeringName.length > 7
|
||||||
|
? this.select.engineeringName.substring(0, 7) + '...'
|
||||||
|
: this.select.engineeringName,
|
||||||
|
select: true,
|
||||||
})
|
})
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
<view :loading="loading">
|
<view :loading="loading">
|
||||||
<view class="mine">
|
<view class="mine">
|
||||||
<view class="mine-header" @click="jump('basic')">
|
<view class="mine-header" @click="jump('basic')">
|
||||||
<image mode="aspectFill" class="mine-header-head" src="/static/head.png" />
|
<image mode="aspectFill" class="mine-header-head" :src="userInfo.avatar" v-if="userInfo.avatar" />
|
||||||
|
<image mode="aspectFill" class="mine-header-head" src="/static/head.png" v-else />
|
||||||
<view class="mine-header-name hide-txt">
|
<view class="mine-header-name hide-txt">
|
||||||
<view>{{ userInfo.nickname }}</view>
|
<view>{{ userInfo.nickname }}</view>
|
||||||
<view></view>
|
<view></view>
|
||||||
@@ -45,7 +46,11 @@
|
|||||||
<view class="mine-nav-label">工程列表</view>
|
<view class="mine-nav-label">工程列表</view>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="mine-nav" @click="jump('engineering/setting')" v-if="userInfo.authorities === 'engineering_user'">
|
<view
|
||||||
|
class="mine-nav"
|
||||||
|
@click="jump('engineering/setting')"
|
||||||
|
v-if="userInfo.authorities === 'engineering_user'"
|
||||||
|
>
|
||||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/like.png" />
|
<image mode="aspectFill" class="mine-nav-icon" src="/static/like.png" />
|
||||||
<view class="mine-nav-label">关注工程配置</view>
|
<view class="mine-nav-label">关注工程配置</view>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
@@ -90,6 +95,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { roleUpdate } from '@/common/api/user'
|
import { roleUpdate } from '@/common/api/user'
|
||||||
import { transferDevice } from '@/common/api/device'
|
import { transferDevice } from '@/common/api/device'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -124,9 +130,7 @@ export default {
|
|||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {},
|
||||||
this.loading = false
|
|
||||||
},
|
|
||||||
upgrade(code) {
|
upgrade(code) {
|
||||||
console.log(code)
|
console.log(code)
|
||||||
roleUpdate({
|
roleUpdate({
|
||||||
@@ -210,7 +214,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
console.log(this.userInfo)
|
this.loading = false
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.login-box-input-btn {
|
.login-box-input-btn {
|
||||||
width: 200rpx;
|
padding:0 40rpx;
|
||||||
margin-left: 40rpx;
|
margin-left: 40rpx;
|
||||||
background: $uni-theme-color;
|
background: $uni-theme-color;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
:key="item.equipmentId"
|
:key="item.equipmentId"
|
||||||
@click="goDevice(item)"
|
@click="goDevice(item)"
|
||||||
padding="0"
|
padding="0"
|
||||||
thumbnail="/static/device.png"
|
:thumbnail="deviceIcon(item.runStatus)"
|
||||||
>
|
>
|
||||||
</uni-card>
|
</uni-card>
|
||||||
<Cn-empty v-if="store.empty"></Cn-empty>
|
<Cn-empty v-if="store.empty"></Cn-empty>
|
||||||
@@ -45,10 +45,6 @@
|
|||||||
thumb="/static/head.png"
|
thumb="/static/head.png"
|
||||||
thumb-size="lg"
|
thumb-size="lg"
|
||||||
>
|
>
|
||||||
<template v-slot:footer>
|
|
||||||
<view class="footer-btn mt20" style="background: #e47470" @click="del">移除</view>
|
|
||||||
<!-- <view class="footer-btn mt20 ml10" @click="goUserDetail">查看</view> -->
|
|
||||||
</template>
|
|
||||||
</uni-list-item>
|
</uni-list-item>
|
||||||
<uni-list-item
|
<uni-list-item
|
||||||
title="李四"
|
title="李四"
|
||||||
@@ -56,10 +52,6 @@
|
|||||||
thumb="/static/head.png"
|
thumb="/static/head.png"
|
||||||
thumb-size="lg"
|
thumb-size="lg"
|
||||||
>
|
>
|
||||||
<template v-slot:footer>
|
|
||||||
<view class="footer-btn mt20" style="background: #e47470" @click="del">移除</view>
|
|
||||||
<!-- <view class="footer-btn mt20 ml10" @click="goUserDetail">查看</view> -->
|
|
||||||
</template>
|
|
||||||
</uni-list-item>
|
</uni-list-item>
|
||||||
</uni-list>
|
</uni-list>
|
||||||
</view>
|
</view>
|
||||||
@@ -130,6 +122,21 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
deviceIcon(e) {
|
||||||
|
let str = ''
|
||||||
|
switch (e) {
|
||||||
|
case 1:
|
||||||
|
str = '/static/device_bad.png'
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
str = '/static/device.png'
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
str = '/static/device.png'
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return str
|
||||||
|
},
|
||||||
addAppTopologyDiagram(e) {
|
addAppTopologyDiagram(e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
addAppTopologyDiagram(
|
addAppTopologyDiagram(
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ export default {
|
|||||||
},
|
},
|
||||||
chooseLocation() {
|
chooseLocation() {
|
||||||
uni.chooseLocation({
|
uni.chooseLocation({
|
||||||
success: function (res) {
|
success: (res) => {
|
||||||
this.formData.area = res.name
|
this.formData.area = res.name
|
||||||
this.formData.lat = res.latitudeame
|
this.formData.lat = res.latitudeame
|
||||||
this.formData.lng = res.longitude
|
this.formData.lng = res.longitude
|
||||||
|
|||||||
@@ -1,23 +1,33 @@
|
|||||||
<template>
|
<template>
|
||||||
<Cn-page :loading='loading'>
|
<Cn-page :loading="loading">
|
||||||
<view slot='body'>
|
<view slot="body">
|
||||||
<view class='index'>
|
<view class="index">
|
||||||
<view class="mine-nav" @click="jump('head')" style=" box-shadow: 0 4rpx 8rpx #e7e7e74c;">
|
<view class="mine-nav" @click="jump('head')" style="box-shadow: 0 4rpx 8rpx #e7e7e74c">
|
||||||
<view class="mine-nav-label">头像</view>
|
<view class="mine-nav-label">头像</view>
|
||||||
<image style="height: 120rpx;width: 120rpx;border-radius:12rpx" src="/static/head.png"
|
<image
|
||||||
mode="scaleToFill" />
|
style="height: 120rpx; width: 120rpx; border-radius: 12rpx"
|
||||||
|
:src="userInfo.avatar"
|
||||||
|
mode="scaleToFill"
|
||||||
|
v-if="userInfo.avatar"
|
||||||
|
/>
|
||||||
|
<image
|
||||||
|
style="height: 120rpx; width: 120rpx; border-radius: 12rpx"
|
||||||
|
src="/static/head.png"
|
||||||
|
mode="scaleToFill"
|
||||||
|
v-else
|
||||||
|
/>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="mine-nav" @click="jump('changeName')" >
|
<view class="mine-nav" @click="jump('changeName')">
|
||||||
<view class="mine-nav-label">名字</view>
|
<view class="mine-nav-label">名字</view>
|
||||||
<view class="mine-nav-des">灿能电力</view>
|
<view class="mine-nav-des">{{ userInfo.nickname }}</view>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="mine-nav" @click="jump('erweima')" style="border-bottom: none; ">
|
<view class="mine-nav" @click="jump('erweima')" style="border-bottom: none">
|
||||||
<view class="mine-nav-label">我的二维码</view>
|
<view class="mine-nav-label">我的二维码</view>
|
||||||
<image
|
<image
|
||||||
src="/static/erweima.png"
|
src="/static/erweima.png"
|
||||||
style="height: 50rpx;width: 50rpx;border-radius:12rpx"
|
style="height: 50rpx; width: 50rpx; border-radius: 12rpx"
|
||||||
mode="scaleToFill"
|
mode="scaleToFill"
|
||||||
/>
|
/>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
@@ -28,25 +38,29 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false
|
loading: false,
|
||||||
|
userInfo: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
jump(type){
|
jump(type) {
|
||||||
console.log(type);
|
console.log(type)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/user/${type}`,
|
url: `/pages/user/${type}`,
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.log(err);
|
console.log(err)
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
|
onShow() {
|
||||||
|
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss'>
|
<style lang="scss">
|
||||||
.index {
|
.index {
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<Cn-page :loading='loading'>
|
<Cn-page :loading="loading">
|
||||||
<view slot='body'>
|
<view slot="body">
|
||||||
<view class='change-name'>
|
<view class="change-name">
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<uni-easyinput type="text" v-model="name" placeholder="请输入昵称" />
|
<uni-easyinput type="text" v-model="name" placeholder="请输入昵称" />
|
||||||
</view>
|
</view>
|
||||||
<view class="btn-wrap">
|
<view class="btn-wrap">
|
||||||
<view class="btn-wrap-item " @click="submit"> 提交 </view>
|
<view class="btn-wrap-item" @click="submit"> 提交 </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</Cn-page>
|
</Cn-page>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { apiUpdateUser } from '@/common/api/user'
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
// 表单数据
|
// 表单数据
|
||||||
@@ -22,14 +23,30 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
submit () {
|
submit() {
|
||||||
console.log(this.name)
|
apiUpdateUser({
|
||||||
|
name: this.name,
|
||||||
|
}).then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
uni.showToast({
|
||||||
|
title: '修改成功',
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
|
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
|
userInfo.nickname = this.name
|
||||||
|
uni.setStorageSync(this.$cacheKey.userInfo, userInfo)
|
||||||
|
setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
|
}, 1500)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.name = uni.getStorageSync(this.$cacheKey.userInfo).nickname
|
||||||
},
|
},
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss'>
|
<style lang="scss">
|
||||||
.change-name {
|
.change-name {
|
||||||
padding: 34rpx;
|
padding: 34rpx;
|
||||||
|
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.login-box-input-btn {
|
.login-box-input-btn {
|
||||||
width: 200rpx;
|
padding:0 40rpx;
|
||||||
margin-left: 40rpx;
|
margin-left: 40rpx;
|
||||||
background: $uni-theme-color;
|
background: $uni-theme-color;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.login-box-input-btn {
|
.login-box-input-btn {
|
||||||
width: 200rpx;
|
padding:0 40rpx;
|
||||||
margin-left: 40rpx;
|
margin-left: 40rpx;
|
||||||
background: $uni-theme-color;
|
background: $uni-theme-color;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|||||||
@@ -1,25 +1,84 @@
|
|||||||
<template>
|
<template>
|
||||||
<Cn-page :loading='loading'>
|
<Cn-page :loading="loading">
|
||||||
<view slot='body'>
|
<view slot="body">
|
||||||
<view class='erweima'>
|
<view class="transfer">
|
||||||
二维码
|
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
||||||
|
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" :options="{ margin: 10 }" :loading="false"></uqrcode>
|
||||||
|
<canvas id="qrcode" width="200" height="200"></canvas>
|
||||||
|
<view class="transfer-text">{{ userInfo.nickname }}</view>
|
||||||
|
<!-- <view class="transfer-btn">
|
||||||
|
<button class="transfer-btn-item" style="background-color: #fff; color: #111" @click="back">
|
||||||
|
返回
|
||||||
|
</button>
|
||||||
|
<button class="transfer-btn-item ml20" @click="home">转移成功</button>
|
||||||
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</Cn-page>
|
</Cn-page>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
// import QRCode from 'qrcodejs2'
|
||||||
|
// import UQRCode from '@/uni_modules/Sansnn-uQRCode/js_sdk/uqrcode/uqrcode.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false
|
loading: false,
|
||||||
|
content: '',
|
||||||
|
userInfo: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
}
|
back() {
|
||||||
|
this.$util.refreshPrePage(2)
|
||||||
|
},
|
||||||
|
home() {
|
||||||
|
this.$util.refreshPrePage(2)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
|
this.content = JSON.stringify({
|
||||||
|
type: 'userId',
|
||||||
|
id: this.userInfo.userIndex,
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss'>
|
<style lang="scss">
|
||||||
.index {
|
.transfer {
|
||||||
padding: 20rpx;
|
padding: 200rpx 34rpx 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.transfer-img {
|
||||||
|
}
|
||||||
|
|
||||||
|
.transfer-text {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.transfer-btn {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-top: 100rpx;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.transfer-btn-item {
|
||||||
|
flex: 1;
|
||||||
|
height: 80rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
background-color: $uni-theme-color;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #fff;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -202,7 +202,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.login-box-input-btn {
|
.login-box-input-btn {
|
||||||
width: 200rpx;
|
padding:0 40rpx;
|
||||||
margin-left: 40rpx;
|
margin-left: 40rpx;
|
||||||
background: $uni-theme-color;
|
background: $uni-theme-color;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<Cn-page :loading='loading'>
|
<Cn-page :loading="loading">
|
||||||
<view slot='body'>
|
<view slot="body">
|
||||||
<view class='head'>
|
<view class="head">
|
||||||
<image class="head-img" src="/static/head.png"></image>
|
<image class="head-img" :src="userInfo.avatar" v-if="userInfo.avatar"></image>
|
||||||
|
<image class="head-img" src="/static/head.png" v-else></image>
|
||||||
<view class="head-setup">
|
<view class="head-setup">
|
||||||
<view class="head-setup-item" @click="take('album')">从相册选一张</view>
|
<view class="head-setup-item" @click="take('album')">从相册选一张</view>
|
||||||
<view class="head-setup-item" @click="take('camera')">拍一张照片</view>
|
<view class="head-setup-item" @click="take('camera')">拍一张照片</view>
|
||||||
@@ -12,29 +13,52 @@
|
|||||||
</Cn-page>
|
</Cn-page>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { uploadImage, getImageUrl } from '@/common/api/basic'
|
||||||
|
import { apiUpdateUser } from '@/common/api/user'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false
|
loading: false,
|
||||||
|
userInfo: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
take (type) {
|
take(type) {
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
count: 1,
|
count: 1,
|
||||||
sizeType: ['original', 'compressed'],
|
sizeType: ['original', 'compressed'],
|
||||||
sourceType: [type],
|
sourceType: [type],
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
}
|
uploadImage(res.tempFilePaths[0]).then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
let result = JSON.parse(res[1].data)
|
||||||
|
apiUpdateUser({
|
||||||
|
headSculpture: result.data.minFileUrl,
|
||||||
|
}).then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
getImageUrl(result.data.minFileUrl).then((url) => {
|
||||||
|
console.log(url.data)
|
||||||
|
this.userInfo.headSculpture = result.data.minFileUrl
|
||||||
|
this.userInfo.avatar = url.data
|
||||||
|
console.warn(this.userInfo)
|
||||||
|
uni.setStorageSync(this.$cacheKey.userInfo, this.userInfo)
|
||||||
|
this.$forceUpdate()
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
}
|
})
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss'>
|
<style lang="scss">
|
||||||
.head {
|
.head {
|
||||||
|
|
||||||
.head-img {
|
.head-img {
|
||||||
height: 750rpx;
|
height: 750rpx;
|
||||||
width: 750rpx;
|
width: 750rpx;
|
||||||
@@ -48,7 +72,7 @@ export default {
|
|||||||
padding-bottom: 60rpx;
|
padding-bottom: 60rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
|
||||||
.head-setup-item{
|
.head-setup-item {
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
line-height: 100rpx;
|
line-height: 100rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
@@ -111,6 +111,9 @@ export default {
|
|||||||
components: {},
|
components: {},
|
||||||
methods: {
|
methods: {
|
||||||
getCode() {
|
getCode() {
|
||||||
|
if (!this.checkbox) {
|
||||||
|
return this.$util.toast('请先阅读并同意用户协议和个人信息保护政策!')
|
||||||
|
}
|
||||||
if (!this.phone) {
|
if (!this.phone) {
|
||||||
return this.$util.toast('请输入手机号!')
|
return this.$util.toast('请输入手机号!')
|
||||||
}
|
}
|
||||||
@@ -249,7 +252,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.login-box-input-btn {
|
.login-box-input-btn {
|
||||||
width: 200rpx;
|
padding: 0 40rpx;
|
||||||
margin-left: 40rpx;
|
margin-left: 40rpx;
|
||||||
background: $uni-theme-color;
|
background: $uni-theme-color;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|||||||
@@ -104,6 +104,9 @@ export default {
|
|||||||
onLoad() {},
|
onLoad() {},
|
||||||
methods: {
|
methods: {
|
||||||
getCode() {
|
getCode() {
|
||||||
|
if (!this.checkbox) {
|
||||||
|
return this.$util.toast('请先阅读并同意用户协议和个人信息保护政策!')
|
||||||
|
}
|
||||||
if (!this.formData.phone) {
|
if (!this.formData.phone) {
|
||||||
return this.$util.toast('请输入手机号!')
|
return this.$util.toast('请输入手机号!')
|
||||||
}
|
}
|
||||||
@@ -210,7 +213,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.login-box-input-btn {
|
.login-box-input-btn {
|
||||||
width: 200rpx;
|
padding:0 40rpx;
|
||||||
margin-left: 40rpx;
|
margin-left: 40rpx;
|
||||||
background: $uni-theme-color;
|
background: $uni-theme-color;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|||||||
Reference in New Issue
Block a user