diff --git a/App.vue b/App.vue
index 44e7001..2116817 100644
--- a/App.vue
+++ b/App.vue
@@ -72,4 +72,5 @@ export default {
// .uni-page-refresh__icon {
// fill: #007aff !important; /* 改成你想要的颜色,比如红色 #ff0000 */
// }
+
diff --git a/common/api/feedback.js b/common/api/feedback.js
index 74b8ad6..e90ade0 100644
--- a/common/api/feedback.js
+++ b/common/api/feedback.js
@@ -11,6 +11,7 @@ export function addFeedBack(params) {
console.log(files.length);
let data = JSON.parse(JSON.stringify(params));
delete data.files
+ console.log("🚀 ~ addFeedBack ~ files.length:", files.length)
if (files.length) {
return uni.uploadFile({
url: config.domain + '/cs-system-boot/feedback/addFeedBack', //仅为示例,非真实的接口地址
diff --git a/common/js/config.js b/common/js/config.js
index ad3033a..d028cad 100644
--- a/common/js/config.js
+++ b/common/js/config.js
@@ -2,6 +2,7 @@ const debug = true // true 是连地服务端本地,false 是连接线上
const development = {
domain: 'http://192.168.1.103:10215',
+ // domain: 'http://192.168.1.102:27707/api',
}
const production = {
diff --git a/common/js/mqtt.js b/common/js/mqtt.js
index c736771..659692c 100644
--- a/common/js/mqtt.js
+++ b/common/js/mqtt.js
@@ -1,5 +1,6 @@
-// export const MQTT_IP = 'pqmcn.com:8085/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
-export const MQTT_IP = '192.168.1.103:38083/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
+export const MQTT_IP = 'pqmcn.com:8085/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
+// export const MQTT_IP = '192.168.1.103:38083/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
+// export const MQTT_IP = '192.168.1.103:38083/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
const MQTT_USERNAME = 't_user'//mqtt用户名
const MQTT_PASSWORD = 'njcnpqs'//密码
diff --git a/common/js/request.js b/common/js/request.js
index 286df41..932f255 100644
--- a/common/js/request.js
+++ b/common/js/request.js
@@ -83,7 +83,10 @@ function errHandler(res) {
break
default:
uni.showToast({
- title: res.message || res.msg || '网络异常,请稍后再试',
+ title:
+ res.message.substring(res.message.indexOf(',') + 1) ||
+ res.msg.substring(msg.indexOf(',') + 1) ||
+ '网络异常,请稍后再试',
duration: 2000,
icon: 'none',
})
diff --git a/common/js/update.js b/common/js/update.js
index 01cfe1e..1d81cef 100644
--- a/common/js/update.js
+++ b/common/js/update.js
@@ -34,7 +34,7 @@ const isCustomDebugBase = (appName = '') => {
export const checkAppUpdate = () => {
// #ifndef APP-PLUS
- return
+ // return
// #endif
// 开发环境跳过检查
@@ -225,7 +225,7 @@ const downloadAndInstallApk = (url) => {
const percent = ((task.downloadedSize / task.totalSize) * 100).toFixed(0)
console.log('🚀 ~ downloadAndInstallApk ~ percent:', percent)
// 直接更新 waiting 的标题,不会闪烁
- progressWaiting.setTitle(`正在下载更新 ${percent}%`)
+ progressWaiting.setTitle(`正在下载更新...`)
}
})
diff --git a/common/js/util.js b/common/js/util.js
index 33c1f79..f617d4c 100644
--- a/common/js/util.js
+++ b/common/js/util.js
@@ -183,35 +183,6 @@ const validatePhoneNumber = (phone) => {
return testReg.test(phone)
}
-const getUserLocation = (call) => {
- uni.getLocation({
- type: 'wgs84',
- success: function (address) {
- call(address)
- },
- fail: (err) => {
- uni.showModal({
- title: '提示',
- content: '定位失败,请打开定位权限',
- success: function (res) {
- if (res.confirm) {
- uni.openSetting({
- success: (resSett) => {
- if (resSett.authSetting['scope.userLocation']) {
- uni.getLocation({
- success: (address) => {
- call && call(address)
- },
- })
- }
- },
- })
- }
- },
- })
- },
- })
-}
// 加载用户配置
var globalConfigIsLoading = false,
@@ -349,7 +320,6 @@ export default {
formatTime,
parseTime,
h5Helper,
- getUserLocation,
loadConfig,
prePage,
loginSuccess,
diff --git a/components/Cn-qianTree/Cn-qianTree.vue b/components/Cn-qianTree/Cn-qianTree.vue
index 12974b1..2c28da2 100644
--- a/components/Cn-qianTree/Cn-qianTree.vue
+++ b/components/Cn-qianTree/Cn-qianTree.vue
@@ -12,7 +12,7 @@
:style="{ color: confirmColor }"
hover-class="hover-c"
@tap="_confirm"
- >确定完成
diff --git a/hover-menu/components/hover-menu/hover-menu.vue b/hover-menu/components/hover-menu/hover-menu.vue
index 463e5dc..9132393 100644
--- a/hover-menu/components/hover-menu/hover-menu.vue
+++ b/hover-menu/components/hover-menu/hover-menu.vue
@@ -1,201 +1,222 @@
-
-
-
-
-
-
-
-
- <
-
-
-
-
-
-
- {{ btn.text }}
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ btn.text }}
+
+
+
+
+
+
+
+
+
+
diff --git a/manifest.json b/manifest.json
index c46f855..2cc9eff 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,7 +2,7 @@
"name" : "灿能物联",
"appid" : "__UNI__88BC25B",
"description" : "",
- "versionName" : "1.6.82",
+ "versionName" : "1.6.83",
"versionCode" : 170,
"transformPx" : false,
"sassImplementationName" : "node-sass",
@@ -143,6 +143,7 @@
"/api" : {
"https" : true,
// "target" : "https://pqmcn.com:8092/api",
+ // "target" : "http://192.168.1.102:27707/api",
"target" : "http://192.168.1.103:10215",
"changOrigin" : true,
"pathRewrite" : {
diff --git a/pages.json b/pages.json
index dfffeab..9c3d5bc 100644
--- a/pages.json
+++ b/pages.json
@@ -125,7 +125,7 @@
{
"path": "pages/index/comp/monitoringPoint",
"style": {
- "navigationBarTitleText": "监测点电能质量信息",
+ "navigationBarTitleText": "关键指标概览",
"enablePullDownRefresh": true,
"pullToRefresh": {
"support":true,
@@ -234,13 +234,13 @@
{
"path": "pages/device/APF/about",
"style": {
- "navigationBarTitleText": "关于"
+ "navigationBarTitleText": "详情"
}
},
{
"path": "pages/device/DVR/about",
"style": {
- "navigationBarTitleText": "关于"
+ "navigationBarTitleText": "详情"
}
},
{
@@ -446,12 +446,7 @@
"navigationBarTitleText": "服务内容配置"
}
},
- {
- "path": "pages/mine/transientSetting",
- "style": {
- "navigationBarTitleText": "暂态事件配置"
- }
- },
+
{
"path": "pages/user/erweima",
"style": {
diff --git a/pages/device/APF/comp/IO.vue b/pages/device/APF/comp/IO.vue
index 665e7e1..82e94a1 100644
--- a/pages/device/APF/comp/IO.vue
+++ b/pages/device/APF/comp/IO.vue
@@ -1,86 +1,70 @@
-
-
-
- 温度
-
-
-
- {{ item[0].clDid }}
- (°C)
+
+
+
+
+
+ 温度
+
+
+
+
+
+
+ {{ child.name }}
+
+
+ {{ child.value }}
+
- {{ item[1].clDid }}
- (°C)
-
- {{ item[2].clDid }}
- (°C)
-
- {{ item[3].clDid }}
- (°C)
-
- {{ item[0].clDid ? Math.round(item[0].value) || '-' : '' }}
- {{ item[1].clDid ? Math.round(item[1].value) || '-' : '' }}
- {{ item[2].clDid ? Math.round(item[2].value) || '-' : '' }}
- {{ item[3].clDid ? Math.round(item[3].value) || '-' : '' }}
-
+
-
-
-
-
- 状态
+
+
+
+
+
+ 状态
+
-
-
- {{ item[0].moduleName }}
-
+
+
+
+
+ {{ child.name }}
+
+
+ {{ child.value }}
+
- {{ item[1].moduleName }}
-
-
- {{ item[2].moduleName }}
-
-
- {{ item[3].moduleName }}
-
-
-
- {{ item[0].moduleState }}
- {{ item[1].moduleState }}
- {{ item[2].moduleState }}
- {{ item[3].moduleState }}
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/pages/device/APF/comp/oscillogram.vue b/pages/device/APF/comp/oscillogram.vue
index 0f38c52..48e4337 100644
--- a/pages/device/APF/comp/oscillogram.vue
+++ b/pages/device/APF/comp/oscillogram.vue
@@ -1,119 +1,119 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/device/APF/comp/power.vue b/pages/device/APF/comp/power.vue
index 6e536fa..544c04b 100644
--- a/pages/device/APF/comp/power.vue
+++ b/pages/device/APF/comp/power.vue
@@ -1,64 +1,92 @@
-
-
-
-
- 电网侧
-
-
- 名称
- 有功功率(kW)
- 无功功率(kVar)
- 视在功率(kVA)
- 功率因数
-
- {{ item.phase }}
- {{ item['Apf_P_Sys(W)'] == '-' ? '-' : (item['Apf_P_Sys(W)'] /
- 1000).toFixed(2) }}
+
+
+
+
+
+
+ {{ section.title }}
+
+
+
+
+ {{ phase.name }}
- {{ item['Apf_Q_Sys(Var)'] == '-' ? '-' : (item['Apf_Q_Sys(Var)'] /
- 1000).toFixed(2) }}
-
- {{ item['Apf_S_Sys(VA)'] == '-' ? '-' : (item['Apf_S_Sys(VA)'] /
- 1000).toFixed(2) }}
-
- {{ item['Apf_PF_Sys(null)'] || '-' }}
-
+
-
-
-
- 负载侧
-
-
- 名称
- 有功功率(kW)
- 无功功率(kVar)
- 视在功率(kVA)
- 功率因数
-
- {{ item.phase }}
- {{ item['Apf_P_Load(W)'] == '-' ? '-' : (item['Apf_P_Load(W)'] /
- 1000).toFixed(2) }}
+
+
+
+
+ {{ child.name }}
+
+
+
+ {{
+ child.A
+ }}
+
+
+
+ {{
+ child.B
+ }}
+
+
+
+ {{
+ child.C
+ }}
+
+
- {{
- item['Apf_Q_Load(Var)'] == '-' ? '-' : (item['Apf_Q_Load(Var)'] / 1000).toFixed(2)
- }}
- {{ item['Apf_S_Load(VA)'] == '-' ? '-' : (item['Apf_S_Load(VA)'] /
- 1000).toFixed(2) }}
-
- {{ item['Apf_PF_Load(null)'] || '-' }}
-
+
-
diff --git a/pages/device/APF/comp/xieBo.vue b/pages/device/APF/comp/xieBo.vue
index 3412c4d..c9aae52 100644
--- a/pages/device/APF/comp/xieBo.vue
+++ b/pages/device/APF/comp/xieBo.vue
@@ -1,24 +1,14 @@
-
-
+
+
@@ -54,6 +44,7 @@ export default {
value: 1,
},
],
+ loading: true,
parity: 2,
time: '',
dataOptions: [],
@@ -216,7 +207,6 @@ export default {
watch: {
basicData: {
handler(newVal, oldVal) {
- console.log(this.basicData)
let basicData = JSON.parse(JSON.stringify(this.basicData))
// this.dataRadio = 0
this.renderData = {
@@ -284,9 +274,9 @@ export default {
})
})
this.dataOptions = dataOptions
- console.log(dataOptions)
+
this.initEcharts()
-
+ this.loading = false
this.time = this.$util.parseTime(this.dataTime - 8 * 60 * 60)
},
deep: true,
@@ -365,13 +355,29 @@ export default {
}, 100)
},
},
+ mounted() {
+ this.loading = true
+ setTimeout(() => {
+ this.loading = false
+ }, 5000)
+
+ },
}
+
diff --git a/pages/device/new.vue b/pages/device/new.vue
index a4c1cdc..1526c0d 100644
--- a/pages/device/new.vue
+++ b/pages/device/new.vue
@@ -107,7 +107,7 @@
@change="positionChange" disabled :clear="false">
-
@@ -369,7 +369,7 @@ export default {
},
changeAuth() {
uni.scanCode({
- onlyFromCamera: true,
+ onlyFromCamera: false,
success: (res) => {
console.log('条码类型:' + res.scanType)
console.log('条码内容:' + res.result)
diff --git a/pages/device/realTime/index.vue b/pages/device/realTime/index.vue
index b7f9c5a..45b8f26 100644
--- a/pages/device/realTime/index.vue
+++ b/pages/device/realTime/index.vue
@@ -21,7 +21,10 @@
所属工程:{{ device.engineeringName }}
- 所属项目:{{ device.equipmentName }}
+ 所属项目:{{ device.projectName }}
+
+
+ 所属设备:{{ device.equipmentName }}
@@ -42,7 +45,7 @@
{{ disabled ? `刷新(${countdown}s)` : '刷新' }}
-
+
@@ -87,9 +90,14 @@
-
-
-
+
+
+
+
+ {{ phase.name }}
+
+
+
@@ -135,7 +143,11 @@ export default {
data() {
return {
loading: true,
-
+ phaseColors: [
+ { name: 'A相', color: '#F1B22E' },
+ { name: 'B相', color: '#2BA471' },
+ { name: 'C相', color: '#D54941' },
+ ],
deviceInfo: {},
// 使用上面定义的图表配置项
option: {},
@@ -190,7 +202,7 @@ export default {
},
{
iconPath: '/static/about.png',
- text: '关于',
+ text: '详情',
},
],
device: {},
@@ -969,7 +981,7 @@ export default {
url: '/pages/index/message1',
})
// uni.navigateTo({ url: '/pages/device/APF/report?id=' + this.device.equipmentId })
- } else if (e.text === '关于') {
+ } else if (e.text === '详情') {
uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.device.equipmentId })
} else if (e.text === '移交') {
uni.navigateTo({ url: '/pages/device/transfer?id=' + this.device.equipmentId })
@@ -1191,4 +1203,29 @@ export default {
height: 45rpx;
line-height: 45rpx;
}
+
+.legend-row {
+ display: flex;
+ gap: 20rpx;
+ align-items: center;
+ justify-content: end;
+ padding: 16rpx 20rpx;
+}
+
+.legend-item {
+ display: flex;
+ align-items: center;
+ gap: 8rpx;
+}
+
+.legend-dot {
+ width: 16rpx;
+ height: 16rpx;
+ border-radius: 50%;
+}
+
+.legend-text {
+ font-size: 24rpx;
+ color: #666666;
+}
diff --git a/pages/engineering/list.vue b/pages/engineering/list.vue
index e234255..07b0e49 100644
--- a/pages/engineering/list.vue
+++ b/pages/engineering/list.vue
@@ -10,35 +10,32 @@
-
-
-
-
-
-
- 区域
- {{ item.provinceName + item.cityName }}
-
-
- 创建时间
- {{ item.createTime }}
-
+
+
+
+
+
+
+ 区域
+ {{ item.provinceName + item.cityName }}
- 置顶
-
-
-
+
+ 创建时间
+ {{ item.createTime }}
+
+
+
+
+
-
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 提交
+
+
+
+
+
+
+
diff --git a/pages/engineering/setting.vue b/pages/engineering/setting.vue
index 5ccb3aa..6a49b33 100644
--- a/pages/engineering/setting.vue
+++ b/pages/engineering/setting.vue
@@ -25,11 +25,8 @@
{{ item.engineerName }}
-
+
@@ -74,8 +71,9 @@ export default {
init() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
queryAllEnginner().then((res) => {
- this.list = res.data
- console.log(this.list)
+ this.list = (res.data || []).slice().sort((a, b) =>
+ (a.engineerName || '').localeCompare(b.engineerName || '', 'zh', { sensitivity: 'accent' }),
+ )
this.selectList = res.data.filter((item) => item.isSelect === '1').map((item) => item.engineerId)
console.log(this.selectList)
this.loading = false
diff --git a/pages/gateway/new.vue b/pages/gateway/new.vue
index f12e3b4..cba1513 100644
--- a/pages/gateway/new.vue
+++ b/pages/gateway/new.vue
@@ -1,219 +1,219 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 发起注册
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 提交
-
-
-
-
-
-
-
- 取消
- 确定
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/gateway/newDevice.vue b/pages/gateway/newDevice.vue
index 3844310..7143967 100644
--- a/pages/gateway/newDevice.vue
+++ b/pages/gateway/newDevice.vue
@@ -1,403 +1,403 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 添加
- 提交
-
-
-
-
-
-
- 取消
- 确定
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 请拖动图中的蓝色定位图标选择监测点位置(左上角)
-
-
-
-
- 取消
- 确定
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/home/feedback.vue b/pages/home/feedback.vue
index 64fd767..09e9f34 100644
--- a/pages/home/feedback.vue
+++ b/pages/home/feedback.vue
@@ -8,10 +8,10 @@
-->
-
+
-
+
@@ -23,9 +23,9 @@
提交
-
+
@@ -83,6 +83,7 @@ export default {
})
return
}
+ console.log("🚀 ~ this.formData:", this.formData)
addFeedBack(this.formData).then(res => {
console.log(res)
console.log(this.formData.files.length)
diff --git a/pages/index/comp/apply.vue b/pages/index/comp/apply.vue
index 8ff34f0..cd781b0 100644
--- a/pages/index/comp/apply.vue
+++ b/pages/index/comp/apply.vue
@@ -9,11 +9,11 @@
-
+
已选择 {{ checkedTotal }} 条事件
diff --git a/pages/index/comp/device.vue b/pages/index/comp/device.vue
index a07d9e5..f04e8bc 100644
--- a/pages/index/comp/device.vue
+++ b/pages/index/comp/device.vue
@@ -4,7 +4,7 @@
-
-
+
设置
diff --git a/pages/message/feedbackDetail.vue b/pages/message/feedbackDetail.vue
index cbd5e19..03aeaaa 100644
--- a/pages/message/feedbackDetail.vue
+++ b/pages/message/feedbackDetail.vue
@@ -6,34 +6,33 @@
{{ pageData.title }}
{{ pageData.createTime }}
{{ pageData.description }}
-
+
进度
-
-
-
-
-
-
-
-
+
+ 解决
+ 关闭
+
+
+ 关闭
+
+
+ v-for="(item, index) in pageData.csFeedbackChatPOList" :key="index" />
-
-
+
+
@@ -41,7 +40,7 @@
-
\ No newline at end of file
diff --git a/pages/mine/setup.vue b/pages/mine/setup.vue
index 93e9c58..8fbce97 100644
--- a/pages/mine/setup.vue
+++ b/pages/mine/setup.vue
@@ -48,7 +48,7 @@
版本信息
- 当前版本V{{ version }}
+ V{{ version }}
diff --git a/pages/mine/setupMessage.vue b/pages/mine/setupMessage.vue
index f159d2d..fa24804 100644
--- a/pages/mine/setupMessage.vue
+++ b/pages/mine/setupMessage.vue
@@ -1,41 +1,25 @@
-
+
暂态事件
-
+
稳态事件
-
+
-
+
运行告警
-
+
-
+
运行事件
-
+
@@ -49,6 +33,7 @@ export default {
return {
loading: true,
config: {},
+ flag: false,
}
},
methods: {
@@ -106,6 +91,9 @@ export default {
},
},
onLoad() {
+ if (uni.getStorageSync(this.$cacheKey.userInfo).authorities === 'operation_manager') {
+ this.flag = true
+ }
this.init()
},
}
diff --git a/pages/mine/transientSetting.vue b/pages/mine/transientSetting.vue
deleted file mode 100644
index eb3a999..0000000
--- a/pages/mine/transientSetting.vue
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
-
-
- ITIC
-
-
-
- F47
-
-
-
-
-
-
-
-
-
diff --git a/pages/mine/userDetail.vue b/pages/mine/userDetail.vue
index 79f1c88..0386b68 100644
--- a/pages/mine/userDetail.vue
+++ b/pages/mine/userDetail.vue
@@ -1,77 +1,77 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/project/new.vue b/pages/project/new.vue
index 7c8cd0b..4a1249e 100644
--- a/pages/project/new.vue
+++ b/pages/project/new.vue
@@ -1,464 +1,444 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 从模版库选择拓扑图
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 提交
-
-
-
-
-
-
- {{ item.name }}
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 从模版库选择拓扑图
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 提交
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+
diff --git a/pages/user/changeName.vue b/pages/user/changeName.vue
index f183556..029a744 100644
--- a/pages/user/changeName.vue
+++ b/pages/user/changeName.vue
@@ -3,7 +3,7 @@
-
+
提交
diff --git a/pages/user/forget.vue b/pages/user/forget.vue
index 67ce0a5..b9b199f 100644
--- a/pages/user/forget.vue
+++ b/pages/user/forget.vue
@@ -4,33 +4,18 @@
-
+
-
-
+ {{ waitTime + 's后重新获取' }}
+ " v-if="waitTime > 0">{{ waitTime + 's后重新获取' }}
@@ -41,7 +26,8 @@
-
+
说明:密码长度为6-18位
@@ -71,6 +57,7 @@ export default {
password: '',
password2: '',
},
+ loadingButton: false,
rules: {
phone: {
rules: [
@@ -107,7 +94,7 @@ export default {
},
}
},
- onLoad() {},
+ onLoad() { },
methods: {
getCode() {
if (!this.formData.phone) {
@@ -151,6 +138,7 @@ export default {
})
return
}
+ this.loadingButton = true
let loginName = encrypt(this.formData.phone)
gongkey({ loginName }).then((response) => {
let publicKey = response.data
@@ -169,9 +157,13 @@ export default {
}, 1000)
})
.catch((err) => {
- uni.hideLoading()
console.log(err)
})
+ .finally(() => {
+ this.loadingButton = false
+ })
+ }).finally(() => {
+ this.loadingButton = false
})
})
},
diff --git a/pages/user/register.vue b/pages/user/register.vue
index d8f9e59..07fd5d6 100644
--- a/pages/user/register.vue
+++ b/pages/user/register.vue
@@ -5,32 +5,18 @@
-
+
-
-
+ {{ waitTime + 's后重新获取' }}
+ " v-if="waitTime > 0">{{ waitTime + 's后重新获取' }}
-
+
-
- 我已阅读并同意
+
+
+ 我已阅读并同意
+
《用户协议》
《隐私政策》
@@ -61,7 +44,8 @@
-
+
说明:密码长度为6-18位
@@ -82,6 +66,7 @@ export default {
loading: false,
waitTime: 0,
inter: null,
+ loadingButton: false,
// 表单数据
formData: {
phone: '',
@@ -125,7 +110,7 @@ export default {
},
}
},
- onLoad() {},
+ onLoad() { },
methods: {
getCode() {
if (!this.checkbox) {
@@ -163,7 +148,9 @@ export default {
if (!this.checkbox) {
return this.$util.toast('请先阅读并同意用户协议和隐私政策!')
}
+
this.$refs.form.validate().then((valid, errors) => {
+ this.loadingButton = true
apiRegister({
phone: this.formData.phone,
code: this.formData.code,
@@ -176,11 +163,14 @@ export default {
autoLogin(this.formData.phone).then((res) => {
this.$util.loginSuccess(res.data)
})
+ }).finally(() => {
+ this.loadingButton = false
})
})
},
secondSubmit() {
this.$refs.form.validate().then((valid, errors) => {
+ this.loadingButton = true
console.log(this.formData.password.length)
if (this.formData.password.length < 6 || this.formData.password.length > 18) {
return this.$util.toast('密码长度为6-18位')
@@ -197,6 +187,8 @@ export default {
uni.reLaunch({
url: '/pages/user/login',
})
+ }).finally(() => {
+ this.loadingButton = false
})
})
},
diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js b/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js
index 9c4af20..1f0b4f0 100644
--- a/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js
+++ b/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js
@@ -221,4 +221,4 @@ function chooseAndUploadFile(opts = {
export {
chooseAndUploadFile,
uploadCloudFiles
-};
+};
diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue b/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue
index 023b33e..dfbc273 100644
--- a/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue
+++ b/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue
@@ -35,7 +35,7 @@
@delFile="delFile"
>
-
+
@@ -354,7 +354,7 @@ export default {
icon: 'none',
})
return
- }
+ }
this.chooseFiles(type)
},
@@ -363,13 +363,13 @@ export default {
* 选择文件并上传
*/
chooseFiles(type) {
- const _extname = get_extname(this.fileExtname)
+ const _extname = get_extname(this.fileExtname)
// 获取后缀
uniCloud
.chooseAndUploadFile({
type: this.fileMediatype,
- compressed: false,
+ compressed: false,
sourceType: [type],//type? :this.sourceType ,
sizeType: this.sizeType,
// TODO 如果为空,video 有问题
@@ -380,12 +380,13 @@ export default {
this.setProgress(progressEvent, progressEvent.index)
},
})
- .then((result) => {
- console.log('选择失败', result)
- this.setSuccessAndError(result.tempFiles)
+ .then((result) => {
+ if (this.autoUpload && !this.noSpace) {
+ this.setSuccessAndError(result.tempFiles)
+ }
})
.catch((err) => {
- console.log('选择失败', err)
+ console.log('选择文件失败', err)
})
},
diff --git a/uni_modules/uni-file-picker/components/uni-file-picker/utils.js b/uni_modules/uni-file-picker/components/uni-file-picker/utils.js
index 60aaa3e..6d94b1a 100644
--- a/uni_modules/uni-file-picker/components/uni-file-picker/utils.js
+++ b/uni_modules/uni-file-picker/components/uni-file-picker/utils.js
@@ -1,109 +1,109 @@
-/**
- * 获取文件名和后缀
- * @param {String} name
- */
-export const get_file_ext = (name) => {
- const last_len = name.lastIndexOf('.')
- const len = name.length
- return {
- name: name.substring(0, last_len),
- ext: name.substring(last_len + 1, len)
- }
-}
-
-/**
- * 获取扩展名
- * @param {Array} fileExtname
- */
-export const get_extname = (fileExtname) => {
- if (!Array.isArray(fileExtname)) {
- let extname = fileExtname.replace(/(\[|\])/g, '')
- return extname.split(',')
- } else {
- return fileExtname
- }
- return []
-}
-
-/**
- * 获取文件和检测是否可选
- */
-export const get_files_and_is_max = (res, _extname) => {
- let filePaths = []
- let files = []
- if(!_extname || _extname.length === 0){
- return {
- filePaths,
- files
- }
- }
- res.tempFiles.forEach(v => {
- let fileFullName = get_file_ext(v.name)
- const extname = fileFullName.ext.toLowerCase()
- if (_extname.indexOf(extname) !== -1) {
- files.push(v)
- filePaths.push(v.path)
- }
- })
- if (files.length !== res.tempFiles.length) {
- uni.showToast({
- title: `当前选择了${res.tempFiles.length}个文件 ,${res.tempFiles.length - files.length} 个文件格式不正确`,
- icon: 'none',
- duration: 5000
- })
- }
-
- return {
- filePaths,
- files
- }
-}
-
-
-/**
- * 获取图片信息
- * @param {Object} filepath
- */
-export const get_file_info = (filepath) => {
- return new Promise((resolve, reject) => {
- uni.getImageInfo({
- src: filepath,
- success(res) {
- resolve(res)
- },
- fail(err) {
- reject(err)
- }
- })
- })
-}
-/**
- * 获取封装数据
- */
-export const get_file_data = async (files, type = 'image') => {
- // 最终需要上传数据库的数据
- let fileFullName = get_file_ext(files.name)
- const extname = fileFullName.ext.toLowerCase()
- let filedata = {
- name: files.name,
- uuid: files.uuid,
- extname: extname || '',
- cloudPath: files.cloudPath,
- fileType: files.fileType,
- url: files.path || files.path,
- size: files.size, //单位是字节
- image: {},
- path: files.path,
- video: {}
- }
- if (type === 'image') {
- const imageinfo = await get_file_info(files.path)
- delete filedata.video
- filedata.image.width = imageinfo.width
- filedata.image.height = imageinfo.height
- filedata.image.location = imageinfo.path
- } else {
- delete filedata.image
- }
- return filedata
-}
+/**
+ * 获取文件名和后缀
+ * @param {String} name
+ */
+export const get_file_ext = (name) => {
+ const last_len = name.lastIndexOf('.')
+ const len = name.length
+ return {
+ name: name.substring(0, last_len),
+ ext: name.substring(last_len + 1, len)
+ }
+}
+
+/**
+ * 获取扩展名
+ * @param {Array} fileExtname
+ */
+export const get_extname = (fileExtname) => {
+ if (!Array.isArray(fileExtname)) {
+ let extname = fileExtname.replace(/(\[|\])/g, '')
+ return extname.split(',')
+ } else {
+ return fileExtname
+ }
+ return []
+}
+
+/**
+ * 获取文件和检测是否可选
+ */
+export const get_files_and_is_max = (res, _extname) => {
+ let filePaths = []
+ let files = []
+ if(!_extname || _extname.length === 0){
+ return {
+ filePaths,
+ files
+ }
+ }
+ res.tempFiles.forEach(v => {
+ let fileFullName = get_file_ext(v.name)
+ const extname = fileFullName.ext.toLowerCase()
+ if (_extname.indexOf(extname) !== -1) {
+ files.push(v)
+ filePaths.push(v.path)
+ }
+ })
+ if (files.length !== res.tempFiles.length) {
+ uni.showToast({
+ title: `当前选择了${res.tempFiles.length}个文件 ,${res.tempFiles.length - files.length} 个文件格式不正确`,
+ icon: 'none',
+ duration: 5000
+ })
+ }
+
+ return {
+ filePaths,
+ files
+ }
+}
+
+
+/**
+ * 获取图片信息
+ * @param {Object} filepath
+ */
+export const get_file_info = (filepath) => {
+ return new Promise((resolve, reject) => {
+ uni.getImageInfo({
+ src: filepath,
+ success(res) {
+ resolve(res)
+ },
+ fail(err) {
+ reject(err)
+ }
+ })
+ })
+}
+/**
+ * 获取封装数据
+ */
+export const get_file_data = async (files, type = 'image') => {
+ // 最终需要上传数据库的数据
+ let fileFullName = get_file_ext(files.name)
+ const extname = fileFullName.ext.toLowerCase()
+ let filedata = {
+ name: files.name,
+ uuid: files.uuid,
+ extname: extname || '',
+ cloudPath: files.cloudPath,
+ fileType: files.fileType,
+ url: files.path || files.path,
+ size: files.size, //单位是字节
+ image: {},
+ path: files.path,
+ video: {}
+ }
+ if (type === 'image') {
+ const imageinfo = await get_file_info(files.path)
+ delete filedata.video
+ filedata.image.width = imageinfo.width
+ filedata.image.height = imageinfo.height
+ filedata.image.location = imageinfo.path
+ } else {
+ delete filedata.image
+ }
+ return filedata
+}