开关
This commit is contained in:
parent
c8911af8f1
commit
960523e7e5
110
components/da-tree-vue2/changelog.md
Normal file
110
components/da-tree-vue2/changelog.md
Normal file
|
@ -0,0 +1,110 @@
|
|||
# 1.4.1
|
||||
|
||||
## 版本调整
|
||||
|
||||
建议更新,但需要注意,异步数据的时候,后台需返回 leaf 字段来判断是否末项数据
|
||||
|
||||
1. **调整数据项格式,新增 `leaf` 字段,来判断是否为末节点**
|
||||
2. **调整数据项格式,新增 `sort` 字段,来排序节点位置**
|
||||
3. **注意:异步加载数据,当为末项的时候,需要服务端数据返回 `leaf` 字段**
|
||||
4. 新增 `alwaysFirstLoad` ,即异步数据总会在第一次展开节点时,拉取一次后台数据,来比对是否一致
|
||||
5. 拆分 `field` 属性,**注意: 1.5.0 版本后将移除 `field` 属性**
|
||||
6. 新增 `labelField` 同 `field.label`,指定节点对象中某个属性为**标签**字段,默认`label`
|
||||
7. 新增 `valueField` 同 `field.key`,指定节点对象中某个属性为**值**字段,默认`value`
|
||||
8. 新增 `childrenField` 同 `field.children`,指定节点对象中某个属性为**子树节点**字段,默认`children`
|
||||
9. 新增 `disabledField` 同 `field.disabled`,指定节点对象中某个属性为**禁用**字段,默认`disabled`
|
||||
10. 新增 `appendField` 同 `field.append`,指定节点对象中某个属性为**副标签**字段,默认`append`
|
||||
11. 新增 `leafField` 同 `field.label`,指定节点对象中某个属性为**末级节点**字段,默认`leaf`
|
||||
12. 新增 `sortField` 同 `field.label`,指定节点对象中某个属性为**排序**字段,默认`sort`
|
||||
13. 新增 `isLeafFn` ,用来自定义控制数据项的末项
|
||||
14. 更多的项目示例
|
||||
15. 支持单选取消选中
|
||||
16. 修复节点展开时可能存在的 bug
|
||||
17. 修复节点选择可能存在的 bug
|
||||
18. 调整为子节点默认继承父节点禁用属性
|
||||
19. `setExpandedKeys` 添加参数一为 `all` 即可支持一键展开/收起全部节点
|
||||
20. 其它更多优化
|
||||
|
||||
# 1.3.4
|
||||
|
||||
优化
|
||||
|
||||
1. 优化图标字体命名
|
||||
|
||||
# 1.3.3
|
||||
|
||||
版本同步于 Vue3 版,[查看 Vue3 版更新日志](https://ext.dcloud.net.cn/plugin?id=12384&update_log)
|
||||
|
||||
# 1.3.2
|
||||
|
||||
版本同步于 Vue3 版,[查看 Vue3 版更新日志](https://ext.dcloud.net.cn/plugin?id=12384&update_log)
|
||||
|
||||
# 1.3.1.1
|
||||
|
||||
修复
|
||||
|
||||
1. 修复 APP 兼容性引起的报错
|
||||
|
||||
# 1.3.1
|
||||
|
||||
## 建议更新
|
||||
|
||||
### 1.2.2~1.3.1 更新预览
|
||||
|
||||
1. 新增支持主题换色
|
||||
2. 新增支持点击标签也能选中节点
|
||||
3. 新增`field`字段 `append` 用于在标签后面显示小提示
|
||||
4. 方法`setExpandedKeys`支持加载动态数据
|
||||
5. 支持单选的`onlyRadioLeaf`为`true`时可点父节点展开/收起
|
||||
6. 新增 `expandChecked`,控制选择时是否展开当前已选的所有下级节点
|
||||
7. 新增 `checkedDisabled`,支持渲染禁用值
|
||||
8. 新增 `packDisabledkey`,支持返回已选中的禁用的 key
|
||||
9. 更多细节修复、优化请移步 Vue3 版的更新日志
|
||||
|
||||
后续版本仍不会实时同步 Vue3 版本,如急需新功能,请移步 Vue3 版
|
||||
|
||||
版本同步于 Vue3 版,[查看 Vue3 版更新日志](https://ext.dcloud.net.cn/plugin?id=12384&update_log)
|
||||
|
||||
# 1.2.2
|
||||
|
||||
## 建议更新,优化诸多问题
|
||||
|
||||
版本同步于 Vue3 版,[查看 Vue3 版更新日志](https://ext.dcloud.net.cn/plugin?id=12384&update_log)
|
||||
|
||||
# 1.2.1
|
||||
|
||||
版本同步于 Vue3 版,[查看 Vue3 版更新日志](https://ext.dcloud.net.cn/plugin?id=12384&update_log)
|
||||
|
||||
# 1.2.0.1
|
||||
|
||||
优化
|
||||
|
||||
1. 优化小程序兼容
|
||||
|
||||
# 1.2.0
|
||||
|
||||
版本同步于 Vue3 版,[查看 Vue3 版更新日志](https://ext.dcloud.net.cn/plugin?id=12384&update_log)
|
||||
|
||||
# 1.1.1.1
|
||||
|
||||
修复
|
||||
|
||||
1. 修复同步版本的错误写法引起的报错
|
||||
|
||||
# 1.1.1
|
||||
|
||||
版本同步于 Vue3 版,[查看 Vue3 版更新日志](https://ext.dcloud.net.cn/plugin?id=12384&update_log)
|
||||
|
||||
# 1.1.0
|
||||
|
||||
版本同步于 Vue3 版,[查看 Vue3 版更新日志](https://ext.dcloud.net.cn/plugin?id=12384&update_log)
|
||||
|
||||
# 1.0.6
|
||||
|
||||
新增
|
||||
|
||||
版本同步于 Vue3 版,[查看 Vue3 版更新日志](https://ext.dcloud.net.cn/plugin?id=12384&update_log)
|
||||
|
||||
# 1.0.5
|
||||
|
||||
版本同步于 Vue3 版,[查看 Vue3 版更新日志](https://ext.dcloud.net.cn/plugin?id=12384),基于 Vue2 进行开发,支持单选、多选,全平台兼容。
|
1108
components/da-tree-vue2/index.vue
Normal file
1108
components/da-tree-vue2/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
183
components/da-tree-vue2/props.js
Normal file
183
components/da-tree-vue2/props.js
Normal file
|
@ -0,0 +1,183 @@
|
|||
// @ts-nocheck
|
||||
export default {
|
||||
/**
|
||||
* 树的数据
|
||||
*/
|
||||
data: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
/**
|
||||
* 主题色
|
||||
*/
|
||||
themeColor: {
|
||||
type: String,
|
||||
default: '#007aff',
|
||||
},
|
||||
/**
|
||||
* 是否开启多选,默认单选
|
||||
*/
|
||||
showCheckbox: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
/**
|
||||
* 默认选中的节点,注意单选时为单个key,多选时为key的数组
|
||||
*/
|
||||
defaultCheckedKeys: {
|
||||
type: [Array, String, Number],
|
||||
default: null,
|
||||
},
|
||||
/**
|
||||
* 选择框的位置,可选 left/right
|
||||
*/
|
||||
checkboxPlacement: {
|
||||
type: String,
|
||||
default: 'left',
|
||||
},
|
||||
/**
|
||||
* 是否默认展开全部
|
||||
*/
|
||||
defaultExpandAll: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
/**
|
||||
* 默认展开的节点
|
||||
*/
|
||||
defaultExpandedKeys: {
|
||||
type: Array,
|
||||
default: null,
|
||||
},
|
||||
/**
|
||||
* 是否自动展开到选中的节点,默认不展开
|
||||
*/
|
||||
expandChecked: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
/**
|
||||
* 子项缩进距离,默认40,单位rpx
|
||||
*/
|
||||
indent: {
|
||||
type: Number,
|
||||
default: 40,
|
||||
},
|
||||
/**
|
||||
* (旧)字段对应内容,默认为 {label: 'label',key: 'key', children: 'children', disabled: 'disabled', append: 'append'}
|
||||
* 注意:1.5.0版本后不再兼容
|
||||
*/
|
||||
field: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
/**
|
||||
* 标签字段(新,拆分了)
|
||||
*/
|
||||
labelField: {
|
||||
type: String,
|
||||
default: 'label',
|
||||
},
|
||||
/**
|
||||
* 值字段(新,拆分了)
|
||||
*/
|
||||
valueField: {
|
||||
type: String,
|
||||
default: 'value',
|
||||
},
|
||||
/**
|
||||
* 下级字段(新,拆分了)
|
||||
*/
|
||||
childrenField: {
|
||||
type: String,
|
||||
default: 'children',
|
||||
},
|
||||
/**
|
||||
* 禁用字段(新,拆分了)
|
||||
*/
|
||||
disabledField: {
|
||||
type: String,
|
||||
default: 'disabled',
|
||||
},
|
||||
/**
|
||||
* 末级节点字段(新,拆分了)
|
||||
*/
|
||||
leafField: {
|
||||
type: String,
|
||||
default: 'leaf',
|
||||
},
|
||||
/**
|
||||
* 副标签字段(新,拆分了)
|
||||
*/
|
||||
appendField: {
|
||||
type: String,
|
||||
default: 'append',
|
||||
},
|
||||
/**
|
||||
* 排序字段(新,拆分了)
|
||||
*/
|
||||
sortField: {
|
||||
type: String,
|
||||
default: 'sort',
|
||||
},
|
||||
isLeafFn: {
|
||||
type: Function,
|
||||
default: null,
|
||||
},
|
||||
/**
|
||||
* 是否显示单选图标,默认显示
|
||||
*/
|
||||
showRadioIcon: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
/**
|
||||
* 单选时只允许选中末级,默认可随意选中
|
||||
*/
|
||||
onlyRadioLeaf: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
/**
|
||||
* 多选时,是否执行父子不关联的任意勾选,默认父子关联
|
||||
*/
|
||||
checkStrictly: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
/**
|
||||
* 为 true 时,空的 children 数组会显示展开图标
|
||||
*/
|
||||
loadMode: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
/**
|
||||
* 异步加载接口
|
||||
*/
|
||||
loadApi: {
|
||||
type: Function,
|
||||
default: null,
|
||||
},
|
||||
/**
|
||||
* 是否总在首次的时候加载一下内容,来比对是否一致
|
||||
*/
|
||||
alwaysFirstLoad: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
/**
|
||||
* 是否渲染(操作)禁用值
|
||||
*/
|
||||
checkedDisabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
/**
|
||||
* 是否返回已禁用的但已选中的key
|
||||
*/
|
||||
packDisabledkey: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
}
|
303
components/da-tree-vue2/readme.md
Normal file
303
components/da-tree-vue2/readme.md
Normal file
|
@ -0,0 +1,303 @@
|
|||
# da-tree-vue2
|
||||
|
||||
一个基于 Vue2 的 tree(树)组件,同时支持主题换色,可能是最适合你的 tree(树)组件
|
||||
|
||||
`内容同步于 Vue3 版本,在此查看 ===>` **[Vue3 版](https://ext.dcloud.net.cn/plugin?id=12384)**
|
||||
|
||||
_与 Vue3 版本版本不同的是,此版本兼容更全面,比如 360 小程序、快应用等均支持_
|
||||
|
||||
### 关于使用
|
||||
|
||||
可在右侧的`使用 HBuilderX 导入插件`或`下载示例项目ZIP`,方便快速上手。
|
||||
|
||||
可通过下方的示例及文档说明,进一步了解使用组件相关细节参数。
|
||||
|
||||
插件地址:https://ext.dcloud.net.cn/plugin?id=12692
|
||||
|
||||
### 组件示例
|
||||
|
||||
```jsx
|
||||
<template>
|
||||
<view>
|
||||
<view>多选</view>
|
||||
<view><button @click="doCheckedTree(['2'],true)">全选</button></view>
|
||||
<view><button @click="doCheckedTree(['2'],false)">取消全选</button></view>
|
||||
<view><button @click="doCheckedTree(['211','222'],true)">选中指定节点</button></view>
|
||||
<view><button @click="doCheckedTree(['211','222'],false)">取消选中指定节点</button></view>
|
||||
<view><button @click="doExpandTree('all',true)">展开全部节点</button></view>
|
||||
<view><button @click="doExpandTree('all',false)">收起全部节点</button></view>
|
||||
<view><button @click="doExpandTree(['22','23'],true)">展开节点</button></view>
|
||||
<view><button @click="doExpandTree(['22','23'],false)">收起节点</button></view>
|
||||
<DaTreeVue2
|
||||
ref="DaTreeRef"
|
||||
:data="roomTreeData"
|
||||
labelField="name"
|
||||
valueField="id"
|
||||
defaultExpandAll
|
||||
showCheckbox
|
||||
:defaultCheckedKeys="defaultCheckedKeysValue"
|
||||
@change="handleTreeChange"
|
||||
@expand="handleExpandChange" />
|
||||
|
||||
<view>单选</view>
|
||||
<DaTreeVue2
|
||||
:data="roomTreeData"
|
||||
labelField="name"
|
||||
valueField="id"
|
||||
defaultExpandAll
|
||||
:defaultCheckedKeys="defaultCheckedKeysValue2"
|
||||
@change="handleTreeChange"
|
||||
@expand="handleExpandChange" />
|
||||
<view>默认展开指定节点</view>
|
||||
<DaTreeVue2
|
||||
:data="roomTreeData"
|
||||
labelField="name"
|
||||
valueField="id"
|
||||
showCheckbox
|
||||
:defaultExpandedKeys="defaultExpandKeysValue3"
|
||||
@change="handleTreeChange"
|
||||
@expand="handleExpandChange" />
|
||||
<view>异步加载数据</view>
|
||||
<DaTreeVue2
|
||||
:data="roomTreeData"
|
||||
labelField="name"
|
||||
valueField="id"
|
||||
showCheckbox
|
||||
loadMode
|
||||
:loadApi="GetApiData"
|
||||
defaultExpandAll
|
||||
@change="handleTreeChange"
|
||||
@expand="handleExpandChange" />
|
||||
</view>
|
||||
</template>
|
||||
```
|
||||
|
||||
```js
|
||||
/**
|
||||
* 模拟创建一个接口数据
|
||||
*/
|
||||
function GetApiData(currentNode) {
|
||||
const { key } = currentNode
|
||||
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
// 模拟返回空数据
|
||||
if (key.indexOf('-') > -1) {
|
||||
return resolve(null)
|
||||
// return resolve([])
|
||||
}
|
||||
|
||||
return resolve([
|
||||
{
|
||||
id: `${key}-1`,
|
||||
name: `行政部X${key}-1`,
|
||||
},
|
||||
{
|
||||
id: `${key}-2`,
|
||||
name: `财务部X${key}-2`,
|
||||
append: '定义了末项数据',
|
||||
leaf: true,
|
||||
},
|
||||
{
|
||||
id: `${key}-3`,
|
||||
name: `资源部X${key}-3`,
|
||||
},
|
||||
{
|
||||
id: `${key}-4`,
|
||||
name: `资源部X${key}-3`,
|
||||
append: '被禁用,无展开图标',
|
||||
disabled: true,
|
||||
},
|
||||
])
|
||||
}, 2000)
|
||||
})
|
||||
}
|
||||
|
||||
import DaTreeVue2 from '@/components/da-tree-vue2/index.vue'
|
||||
export default {
|
||||
components: { DaTreeVue2 },
|
||||
data() {
|
||||
return {
|
||||
GetApiData,
|
||||
// key的类型必须对应树数据key的类型
|
||||
defaultCheckedKeysValue: ['211', '222'],
|
||||
defaultCheckedKeysValue2: '222',
|
||||
defaultExpandKeysValue3: ['212', '231'],
|
||||
roomTreeData: [
|
||||
{
|
||||
id: '2',
|
||||
name: '行政中心',
|
||||
children: [
|
||||
{
|
||||
id: '21',
|
||||
name: '行政部',
|
||||
children: [
|
||||
{
|
||||
id: '211',
|
||||
name: '行政一部',
|
||||
children: null,
|
||||
},
|
||||
{
|
||||
id: '212',
|
||||
name: '行政二部',
|
||||
children: [],
|
||||
disabled: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: '22',
|
||||
name: '财务部',
|
||||
children: [
|
||||
{
|
||||
id: '221',
|
||||
name: '财务一部',
|
||||
children: [],
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
id: '222',
|
||||
name: '财务二部',
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: '23',
|
||||
name: '人力资源部',
|
||||
children: [
|
||||
{
|
||||
id: '231',
|
||||
name: '人力一部',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
id: '232',
|
||||
name: '人力二部',
|
||||
append: '更多示例,请下载示例项目查看',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doExpandTree(keys, expand) {
|
||||
this.$refs.DaTreeRef?.setExpandedKeys(keys, expand)
|
||||
|
||||
const gek = this.$refs.DaTreeRef?.getExpandedKeys()
|
||||
console.log('当前已展开的KEY ==>', gek)
|
||||
},
|
||||
doCheckedTree(keys, checked) {
|
||||
this.$refs.DaTreeRef?.setCheckedKeys(keys, checked)
|
||||
|
||||
const gek = this.$refs.DaTreeRef?.getCheckedKeys()
|
||||
console.log('当前已选中的KEY ==>', gek)
|
||||
},
|
||||
handleTreeChange(allSelectedKeys, currentItem) {
|
||||
console.log('handleTreeChange ==>', allSelectedKeys, currentItem)
|
||||
},
|
||||
handleExpandChange(expand, currentItem) {
|
||||
console.log('handleExpandChange ==>', expand, currentItem)
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
** 更多示例请下载/导入示例项目 ZIP 查看 **
|
||||
|
||||
### 组件参数
|
||||
|
||||
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|
||||
| :------------------ | :------------------------------ | :--------- | :--- | :--------------------------------------------------------------------------- |
|
||||
| data | `Array` | - | 是 | 树的数据 |
|
||||
| themeColor | `String` | `#007aff` | 否 | 主题色,十六进制 |
|
||||
| defaultCheckedKeys | `Array` \| `Number` \| `String` | - | 否 | 默认选中的节点,单选为单个 key,多选为 key 的数组 |
|
||||
| showCheckbox | `Boolean` | `false` | 否 | 是否开启多选,默认单选 |
|
||||
| checkStrictly | `Boolean` | `false` | 否 | 多选时,是否执行父子不关联的任意勾选,默认父子关联 |
|
||||
| showRadioIcon | `Boolean` | `true` | 否 | 是否显示单选图标,默认显示 |
|
||||
| onlyRadioLeaf | `Boolean` | `true` | 否 | 单选时只允许选中末级,默认可随意选中 |
|
||||
| defaultExpandAll | `Boolean` | `false` | 否 | 是否默认展开全部 |
|
||||
| defaultExpandedKeys | `Array` | - | 否 | 默认展开的节点 |
|
||||
| indent | `Number` | `40` | 否 | 子项缩进距离,单位 rpx |
|
||||
| checkboxPlacement | `String` | `left` | 否 | 选择框的位置,可选 left/right |
|
||||
| loadMode | `Boolean` | `false` | 否 | 为 true 时,空的 children 数组会显示展开图标 |
|
||||
| loadApi | `Function` | - | 否 | 选择框的位置,可选 left/right |
|
||||
| checkedDisabled | `Boolean` | `false` | 否 | 是否渲染禁用值,默认不渲染 |
|
||||
| packDisabledkey | `Boolean` | `true` | 否 | 是否返回已禁用的但已选中的 key,默认返回禁用已选值 |
|
||||
| expandChecked | `Boolean` | `false` | 否 | 是否自动展开到选中的节点,默认不展开 |
|
||||
| alwaysFirstLoad | `Boolean` | `false` | 否 | 是否总在首次的时候加载一下内容,默认不加载,否则只有展开末级节点才会加载数据 |
|
||||
| isLeafFn | `Function` | - | 否 | 自定义函数返回来控制数据项的末项 |
|
||||
| field | `Object` | - | 否 | 字段对应内容,格式参考下方(1.5.0 后移除,请用单独的字段匹配) |
|
||||
| labelField | `String` | `label` | 否 | 指定节点对象中某个属性为标签字段,默认`label` |
|
||||
| valueField | `String` | `value` | 否 | 指定节点对象中某个属性为值字段,默认`value` |
|
||||
| childrenField | `String` | `children` | 否 | 指定节点对象中某个属性为子树节点字段,默认`children` |
|
||||
| disabledField | `String` | `disabled` | 否 | 指定节点对象中某个属性为禁用字段,默认`disabled` |
|
||||
| appendField | `String` | `append` | 否 | 指定节点对象中某个属性为副标签字段,默认`append` |
|
||||
| leafField | `String` | `leaf` | 否 | 指定节点对象中某个属性为末级节点字段,默认`leaf` |
|
||||
| sortField | `String` | `sort` | 否 | 指定节点对象中某个属性为排序字段,默认`sort` |
|
||||
|
||||
**field 格式(1.5.0 后移除,请用单独的字段匹配)**
|
||||
|
||||
```js
|
||||
{
|
||||
label: 'label',
|
||||
key: 'key',
|
||||
children: 'children',
|
||||
disabled: 'disabled',
|
||||
append: 'append'
|
||||
}
|
||||
```
|
||||
|
||||
### 组件事件
|
||||
|
||||
| 事件名称 | 回调参数 | 说明 |
|
||||
| :------- | :-------------------------------------- | :-------------- |
|
||||
| change | `(allCheckedKeys, currentItem) => void` | 选中时回调 |
|
||||
| expand | `(expandState, currentItem) => void` | 展开/收起时回调 |
|
||||
|
||||
### 组件方法
|
||||
|
||||
| 方法名称 | 参数 | 说明 |
|
||||
| :------------------ | :--------------- | :------------------------------------------------------------------------------------------------ |
|
||||
| setCheckedKeys | `(keys,checked)` | 设置指定 key 的节点选中/取消选中的状态。注: keys 单选时为 key,多选时为 key 的数组 |
|
||||
| setExpandedKeys | `(keys,expand)` | 设置指定 key 的节点展开/收起的状态,当 keys 为 all 时即代表展开/收起全部。注:keys 为数组或 `all` |
|
||||
| getCheckedKeys | - | 返回已选的 key |
|
||||
| getHalfCheckedKeys | - | 返回半选的 key |
|
||||
| getUncheckedKeys | - | 返回未选的 key |
|
||||
| getCheckedNodes | - | 返回已选的节点 |
|
||||
| getUncheckedNodes | - | 返回未选的节点 |
|
||||
| getHalfCheckedNodes | - | 返回半选的节点 |
|
||||
| getExpandedKeys | - | 返回已展开的 key |
|
||||
| getUnexpandedKeys | - | 返回未展开的 key |
|
||||
| getExpandedNodes | - | 返回已展开的节点 |
|
||||
| getUnexpandedNodes | - | 返回未展开的节点 |
|
||||
|
||||
### 组件版本
|
||||
|
||||
v1.4.1
|
||||
|
||||
### 差异化
|
||||
|
||||
已通过测试
|
||||
|
||||
> - H5 页面
|
||||
> - 微信小程序
|
||||
> - 支付宝、钉钉小程序
|
||||
> - 字节跳动、抖音、今日头条小程序
|
||||
> - 百度小程序
|
||||
> - 飞书小程序
|
||||
> - QQ 小程序
|
||||
> - 京东小程序
|
||||
> - 快应用
|
||||
> - 360 小程序
|
||||
|
||||
未测试
|
||||
|
||||
> - 快手小程序由于非企业用户暂无演示
|
||||
|
||||
### 开发组
|
||||
|
||||
[@CRLANG](https://crlang.com)
|
151
components/da-tree-vue2/utils.js
Normal file
151
components/da-tree-vue2/utils.js
Normal file
|
@ -0,0 +1,151 @@
|
|||
// @ts-nocheck
|
||||
/** 未选 */
|
||||
export const unCheckedStatus = 0
|
||||
/** 半选 */
|
||||
export const halfCheckedStatus = 1
|
||||
/** 选中 */
|
||||
export const isCheckedStatus = 2
|
||||
|
||||
/**
|
||||
* 深拷贝内容
|
||||
* @param originData 拷贝对象
|
||||
* @author crlang(https://crlang.com)
|
||||
*/
|
||||
export function deepClone(originData) {
|
||||
const type = Object.prototype.toString.call(originData)
|
||||
let data
|
||||
if (type === '[object Array]') {
|
||||
data = []
|
||||
for (let i = 0; i < originData.length; i++) {
|
||||
data.push(deepClone(originData[i]))
|
||||
}
|
||||
} else if (type === '[object Object]') {
|
||||
data = {}
|
||||
for (const prop in originData) {
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
if (originData.hasOwnProperty(prop)) { // 非继承属性
|
||||
data[prop] = deepClone(originData[prop])
|
||||
}
|
||||
}
|
||||
} else {
|
||||
data = originData
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有指定的节点
|
||||
* @param type
|
||||
* @param value
|
||||
* @author crlang(https://crlang.com)
|
||||
*/
|
||||
export function getAllNodes(list, type, value, packDisabledkey = true) {
|
||||
if (!list || list.length === 0) {
|
||||
return []
|
||||
}
|
||||
|
||||
const res = []
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const item = list[i]
|
||||
if (item[type] === value) {
|
||||
if ((packDisabledkey && item.disabled) || !item.disabled) {
|
||||
res.push(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有指定的key值
|
||||
* @param type
|
||||
* @param value
|
||||
* @author crlang(https://crlang.com)
|
||||
*/
|
||||
export function getAllNodeKeys(list, type, value, packDisabledkey = true) {
|
||||
if (!list || list.length === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
const res = []
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const item = list[i]
|
||||
if (item[type] === value) {
|
||||
if ((packDisabledkey && item.disabled) || !item.disabled) {
|
||||
res.push(item.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res.length ? res : null
|
||||
}
|
||||
|
||||
/**
|
||||
* 错误输出
|
||||
*
|
||||
* @param msg
|
||||
*/
|
||||
export function logError(msg, ...args) {
|
||||
console.error(`DaTree: ${msg}`, ...args)
|
||||
}
|
||||
|
||||
const toString = Object.prototype.toString
|
||||
|
||||
export function is(val, type) {
|
||||
return toString.call(val) === `[object ${type}]`
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否对象(Object)
|
||||
* @param val
|
||||
|
||||
*/
|
||||
export function isObject(val) {
|
||||
return val !== null && is(val, 'Object')
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否数字(Number)
|
||||
* @param val
|
||||
|
||||
*/
|
||||
export function isNumber(val) {
|
||||
return is(val, 'Number')
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否字符串(String)
|
||||
* @param val
|
||||
|
||||
*/
|
||||
export function isString(val) {
|
||||
return is(val, 'String')
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否函数方法(Function)
|
||||
* @param val
|
||||
|
||||
*/
|
||||
export function isFunction(val) {
|
||||
return typeof val === 'function'
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否布尔(Boolean)
|
||||
* @param val
|
||||
|
||||
*/
|
||||
export function isBoolean(val) {
|
||||
return is(val, 'Boolean')
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否数组(Array)
|
||||
* @param val
|
||||
|
||||
*/
|
||||
export function isArray(val) {
|
||||
return val && Array.isArray(val)
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<view class="pages">
|
||||
<u-navbar :custom-back="btnback" title="实名认证" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff'
|
||||
title-size='36' height='44'></u-navbar>
|
||||
<u-navbar :custom-back="btnback" title="实名认证" :border-bottom="false" :background="bgc" back-icon-color="#fff"
|
||||
title-color='#fff' title-size='36' height='44'></u-navbar>
|
||||
<!-- 未有实名认证 -->
|
||||
<view class="" v-if="flags">
|
||||
<view class="listval">
|
||||
<view class="tit"> 真实姓名</view>
|
||||
<view class="but"> <input type="text" placeholder="请输入真实姓名" v-model="name"/> </view>
|
||||
<view class="but"> <input type="text" placeholder="请输入真实姓名" v-model="name" /> </view>
|
||||
</view>
|
||||
<view class="listval">
|
||||
<view class="tit"> 身份证号</view>
|
||||
|
@ -18,6 +18,8 @@
|
|||
<view class="yz" v-else>
|
||||
</view>
|
||||
</view>
|
||||
<image :src="upLoadPositiveImg" @click="uploadpicone" class="sfz" mode=""></image>
|
||||
<image :src="upLoadReverseImg" @click="uploadpictwo" class="sfz" mode=""></image>
|
||||
<view class="" style="width: 100%;margin-top: 50rpx;color: red;text-align: center;">
|
||||
提现需实名认证,请输入真实有效实名信息!
|
||||
</view>
|
||||
|
@ -25,7 +27,7 @@
|
|||
<view class="" v-else>
|
||||
<view class="listval">
|
||||
<view class="tit"> 真实姓名</view>
|
||||
<view class="but"> <input type="text" placeholder="请输入真实姓名" disabled="true" v-model="name"/> </view>
|
||||
<view class="but"> <input type="text" placeholder="请输入真实姓名" disabled="true" v-model="name" /> </view>
|
||||
</view>
|
||||
<view class="listval">
|
||||
<view class="tit"> 身份证号</view>
|
||||
|
@ -42,17 +44,17 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- 已有实名认证 -->
|
||||
|
||||
|
||||
|
||||
|
||||
<view class="baocun" @click="btnyanz" v-if="flag">
|
||||
进行人脸验证
|
||||
</view>
|
||||
<view class="baocun" @click="btnyz" v-else>
|
||||
进行人脸验证
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -60,6 +62,8 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
upLoadPositiveImg: 'https://api.ccttiot.com/smartmeter/img/static/u8j3NbBd9djM3nMwaekr', // 正面身份证
|
||||
upLoadReverseImg: 'https://api.ccttiot.com/smartmeter/img/static/uDKPwhqXwacrKSKIuPr9', //反面
|
||||
bgc: {
|
||||
backgroundColor: "#8883f0",
|
||||
},
|
||||
|
@ -68,14 +72,16 @@
|
|||
tel: '',
|
||||
flag: false,
|
||||
yzflag: true,
|
||||
type:'',
|
||||
user:{},
|
||||
flags:false
|
||||
type: '',
|
||||
user: {},
|
||||
flags: false,
|
||||
token: ''
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.type = option.type
|
||||
this.type = option.type
|
||||
this.getuserinfo()
|
||||
this.getQiniuToken()
|
||||
},
|
||||
// 分享到好友(会话)
|
||||
onShareAppMessage: function() {
|
||||
|
@ -94,24 +100,76 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
// 上传身份证正面照
|
||||
uploadpicone() {
|
||||
let that = this
|
||||
that.btnshangchuan((url) => {
|
||||
that.upLoadPositiveImg = url
|
||||
that.$u.post(`/common/idcardOcr?url=${encodeURIComponent(that.upLoadPositiveImg)}`).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.name = res.data.name
|
||||
this.names = res.data.number
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 上传身份证反面照
|
||||
uploadpictwo() {
|
||||
this.btnshangchuan((url) => {
|
||||
this.upLoadReverseImg = url
|
||||
})
|
||||
},
|
||||
btnshangchuan(callback) {
|
||||
let _this = this;
|
||||
let math = 'static/' + _this.$u.guid(20);
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
type: 'all',
|
||||
success(res) {
|
||||
const tempFilePaths = res.tempFiles;
|
||||
wx.uploadFile({
|
||||
url: 'https://up-z2.qiniup.com',
|
||||
name: 'file',
|
||||
filePath: tempFilePaths[0].path,
|
||||
formData: {
|
||||
token: _this.token,
|
||||
key: 'smartmeter/img/' + math
|
||||
},
|
||||
success: function(uploadRes) {
|
||||
let str = JSON.parse(uploadRes.data)
|
||||
let finalUrl = 'https://api.ccttiot.com/' + str.key
|
||||
callback(finalUrl); // 调用回调函数,并传递 URL
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取上传图片token
|
||||
getQiniuToken() {
|
||||
this.$u.get("/common/qiniu/uploadInfo").then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.token = res.token
|
||||
}
|
||||
})
|
||||
},
|
||||
getuserinfo() {
|
||||
this.$u.get("/app/user/userInfo").then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.name = res.data.realName
|
||||
this.names = res.data.realIdCard
|
||||
if(res.data.isReal == true){
|
||||
if (res.data.isReal == true) {
|
||||
this.flags = false
|
||||
this.flag = true
|
||||
}else{
|
||||
} else {
|
||||
this.flags = true
|
||||
this.flag = false
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 直接进行验证
|
||||
btnyanz(){
|
||||
btnyanz() {
|
||||
this.$u.put("/app/user/riskRealName").then((res) => {
|
||||
if (res.code == 200) {
|
||||
let https = encodeURIComponent(res.data.jumpUrl)
|
||||
|
@ -127,55 +185,55 @@
|
|||
}
|
||||
})
|
||||
},
|
||||
|
||||
btnback(){
|
||||
|
||||
btnback() {
|
||||
uni.reLaunch({
|
||||
url:'/page_user/yetx'
|
||||
url: '/page_user/yetx'
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
btnyz() {
|
||||
function isAgeOver18(idCard) {
|
||||
// 提取出生年份
|
||||
const birthYear = idCard.substr(6, 4); // 身份证号码的第7到第10位是出生年份
|
||||
// 获取当前年份
|
||||
const currentYear = new Date().getFullYear();
|
||||
// 计算年龄
|
||||
const age = currentYear - parseInt(birthYear, 10);
|
||||
// 判断是否年满18岁
|
||||
return age >= 18;
|
||||
}
|
||||
const idCard = this.names
|
||||
// 调用函数并输出结果
|
||||
if (isAgeOver18(idCard)) {
|
||||
console.log('身份证对应的用户已年满18岁');
|
||||
let data = {
|
||||
realName: this.name,
|
||||
realIdCard: this.names,
|
||||
type:this.type
|
||||
}
|
||||
this.$u.put('/app/user/realName', data).then(res => {
|
||||
if (res.code == 200) {
|
||||
let https = encodeURIComponent(res.data.jumpUrl)
|
||||
uni.navigateTo({
|
||||
url: '/pages/sjshiming?https=' + https
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('身份证对应的用户未满18岁');
|
||||
function isAgeOver18(idCard) {
|
||||
// 提取出生年份
|
||||
const birthYear = idCard.substr(6, 4); // 身份证号码的第7到第10位是出生年份
|
||||
// 获取当前年份
|
||||
const currentYear = new Date().getFullYear();
|
||||
// 计算年龄
|
||||
const age = currentYear - parseInt(birthYear, 10);
|
||||
// 判断是否年满18岁
|
||||
return age >= 18;
|
||||
}
|
||||
const idCard = this.names
|
||||
// 调用函数并输出结果
|
||||
if (isAgeOver18(idCard)) {
|
||||
console.log('身份证对应的用户已年满18岁');
|
||||
let data = {
|
||||
realName: this.name,
|
||||
realIdCard: this.names,
|
||||
type: this.type
|
||||
}
|
||||
this.$u.put('/app/user/realName', data).then(res => {
|
||||
if (res.code == 200) {
|
||||
let https = encodeURIComponent(res.data.jumpUrl)
|
||||
uni.navigateTo({
|
||||
url: '/pages/sjshiming?https=' + https
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('身份证对应的用户未满18岁');
|
||||
uni.showToast({
|
||||
title: '实名认证需年满18岁',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -191,6 +249,13 @@
|
|||
padding-bottom: 15rpx;
|
||||
}
|
||||
|
||||
.sfz {
|
||||
width: 100%;
|
||||
height: 410rpx;
|
||||
margin: auto;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.pages {
|
||||
background-color: #F7FAFE !important;
|
||||
height: 100vh;
|
||||
|
|
|
@ -11,11 +11,14 @@
|
|||
<view class="card" @click="btnxq(item.deviceId)">
|
||||
<view class="card_left">
|
||||
<view class="card_left_tit">
|
||||
{{item.deviceName}}
|
||||
{{item.deviceName.length > 5 ? item.deviceName.slice(0,5) + '...' : item.deviceName}}
|
||||
</view>
|
||||
<view class="card_left_sta">
|
||||
<view class="" style="color: #95989D;" v-if="item.modelTags.some(tag => tag == 1) && !item.modelTags.some(tag => tag == 2) && !item.modelTags.some(tag => tag == 3)">
|
||||
蓝牙版
|
||||
</view>
|
||||
<view class="card_left_sta" v-else>
|
||||
网络:<view class="" style="width: 10rpx;"></view>
|
||||
<text v-if="item.wifi == null && !item.modelTags.some(tag => tag == 3) || item.wifi == '创特物联TP'" style="color: red;" @click.stop="btnwifi(item.mac)">未配网</text>
|
||||
<text v-if="item.wifi == null && !item.modelTags.some(tag => tag == 3)" style="color: red;" @click.stop="btnwifi(item.mac)">未配网</text>
|
||||
<text v-else>
|
||||
<text v-if="item.onlineStatus == 0" style="color: red;">离线</text>
|
||||
<text v-else style="color: #00BA88;">在线</text>
|
||||
|
@ -23,7 +26,7 @@
|
|||
<view class="" style="width: 20rpx;"></view>
|
||||
状态:<view class="" style="width: 10rpx;"></view>
|
||||
<view class="sta_txt" v-if="item.status==3">
|
||||
维修中
|
||||
调试中
|
||||
</view>
|
||||
<view class="sta_txt" v-if="item.status==2" style="color:red;">
|
||||
使用中
|
||||
|
@ -35,6 +38,9 @@
|
|||
<view class="card_left_no">
|
||||
S/N码:{{item.deviceNo}}
|
||||
</view>
|
||||
<view class="card_left_no">
|
||||
店铺:{{item.storeName.length > 5 ? item.storeName.slice(0,5) + '...' : item.storeName}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="card_right">
|
||||
<image v-if="item.customPicture" :src="item.customPicture" mode="aspectFit"></image>
|
||||
|
@ -135,8 +141,11 @@
|
|||
}
|
||||
},
|
||||
btnxq(id) {
|
||||
// uni.navigateTo({
|
||||
// url: '/page_user/sbdetail?id=' + id
|
||||
// })
|
||||
uni.navigateTo({
|
||||
url: '/page_user/sbdetail?id=' + id
|
||||
url:'/page_fenbao/hehuoren/shebeixq?id=' + id
|
||||
})
|
||||
},
|
||||
}
|
||||
|
@ -175,15 +184,15 @@
|
|||
|
||||
.card {
|
||||
display: flex;
|
||||
margin-top: 20rpx;
|
||||
// margin-top: 20rpx;
|
||||
width: 658rpx;
|
||||
height: 250rpx;
|
||||
height: 280rpx;
|
||||
background: #fff;
|
||||
box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(255, 255, 255, 0);
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
|
||||
.card_left {
|
||||
width: 310rpx;
|
||||
// width: 310rpx;
|
||||
margin-top: 46rpx;
|
||||
margin-left: 50rpx;
|
||||
|
||||
|
|
2164
page_fenbao/hehuoren/shebeixq.vue
Normal file
2164
page_fenbao/hehuoren/shebeixq.vue
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -18,7 +18,7 @@
|
|||
src="https://api.ccttiot.com/smartmeter/img/static/uZSiz7XWpxcXEkl6sTwj"
|
||||
mode="aspectFit"></image>
|
||||
<view class="sta_txt" v-if="item.status==3">
|
||||
维修中
|
||||
调试中
|
||||
</view>
|
||||
<view class="sta_txt" v-if="item.status==2" style="color:greenyellow;">
|
||||
使用中
|
||||
|
|
|
@ -112,6 +112,10 @@
|
|||
<view class="tit"> 是否允许在非营业时间使用</view>
|
||||
<u-switch v-model="checkeds" active-color="#8883F0"></u-switch>
|
||||
</view>
|
||||
<view class="listval">
|
||||
<view class="tit"> 店铺描述</view>
|
||||
<view class="but"> <input type="text" v-model="miaoshu" placeholder="请输入您的店铺描述"/> </view>
|
||||
</view>
|
||||
<view class="baocun" @click="btncreat">
|
||||
提交修改
|
||||
</view>
|
||||
|
@ -152,27 +156,7 @@
|
|||
regionshow: false,
|
||||
regiontext: '请选择省市区',
|
||||
regionvalue: '',
|
||||
selector: [{
|
||||
value: 1,
|
||||
label: '商场'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '学校'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '娱乐场所'
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
label: '出租房'
|
||||
},
|
||||
{
|
||||
value: 5,
|
||||
label: '其他'
|
||||
},
|
||||
],
|
||||
selector: [],
|
||||
latitude: '请输入纬度',
|
||||
longitude: '请输入经度',
|
||||
shopname: '',
|
||||
|
@ -189,14 +173,18 @@
|
|||
listobj: {},
|
||||
storeId: '',
|
||||
url:'',
|
||||
jtdz:''
|
||||
jtdz:'',
|
||||
miaoshu:'',
|
||||
leixinglist:[]
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.getleixing()
|
||||
let obj = JSON.parse(option.obj)
|
||||
this.listobj = obj
|
||||
console.log(this.listobj);
|
||||
this.shopname = this.listobj.name
|
||||
this.miaoshu = this.listobj.description
|
||||
this.ksyy = this.listobj.businessTimeStart
|
||||
this.jsyy = this.listobj.businessTimeEnd
|
||||
this.regiontext = this.listobj.province + this.listobj.city + this.listobj.county
|
||||
|
@ -205,7 +193,7 @@
|
|||
this.latitude = this.listobj.lat
|
||||
this.longitude = this.listobj.lng
|
||||
this.xqdz = this.listobj.address
|
||||
this.selectorvalue = this.listobj.type
|
||||
this.selectorvalue = this.listobj.typeId
|
||||
this.imglist = this.listobj.picture.split(',')
|
||||
this.province = this.listobj.province
|
||||
this.city = this.listobj.city
|
||||
|
@ -213,18 +201,18 @@
|
|||
this.storeId = this.listobj.storeId
|
||||
this.checked = this.listobj.show
|
||||
this.checkeds = this.listobj.useOutTime
|
||||
if (this.selectorvalue == 1) {
|
||||
this.selectortext = '商场'
|
||||
this.updateTime = this.listobj.updateTime
|
||||
} else if (this.selectorvalue == 2) {
|
||||
this.selectortext = '学校'
|
||||
} else if (this.selectorvalue == 3) {
|
||||
this.selectortext = '娱乐场所'
|
||||
} else if (this.selectorvalue == 4) {
|
||||
this.selectortext = '出租房'
|
||||
} else {
|
||||
this.selectortext = '其他'
|
||||
}
|
||||
// if (this.selectorvalue == 1) {
|
||||
// this.selectortext = '商场'
|
||||
// this.updateTime = this.listobj.updateTime
|
||||
// } else if (this.selectorvalue == 2) {
|
||||
// this.selectortext = '学校'
|
||||
// } else if (this.selectorvalue == 3) {
|
||||
// this.selectortext = '娱乐场所'
|
||||
// } else if (this.selectorvalue == 4) {
|
||||
// this.selectortext = '出租房'
|
||||
// } else {
|
||||
// this.selectortext = '其他'
|
||||
// }
|
||||
this.getQiniuToken()
|
||||
},
|
||||
// 分享到好友(会话)
|
||||
|
@ -244,6 +232,21 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
getleixing() {
|
||||
this.$u.get("/app/storeType/listAll").then(res => {
|
||||
this.leixinglist = res.data.map(item => ({
|
||||
value: item.id,
|
||||
label: item.name
|
||||
}))
|
||||
this.selector = this.leixinglist
|
||||
// console.log(this.listobj.typeId,this.leixinglist);
|
||||
this.leixinglist.forEach(item =>{
|
||||
if(item.value == this.selectorvalue){
|
||||
this.selectortext = item.label
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
handleLongPress(index) {
|
||||
let that = this
|
||||
uni.showModal({
|
||||
|
@ -382,10 +385,11 @@
|
|||
specificAddress: this.jtdz,
|
||||
contactName: this.lxname,
|
||||
contactMobile: this.lxphone,
|
||||
type: this.selectorvalue,
|
||||
typeId: this.selectorvalue,
|
||||
storeId: this.storeId,
|
||||
show:this.checked,
|
||||
useOutTime:this.checkeds
|
||||
useOutTime:this.checkeds,
|
||||
description:this.miaoshu
|
||||
}
|
||||
this.$u.put("/app/store", data).then(res => {
|
||||
if (res.code == 500) {
|
||||
|
@ -434,7 +438,7 @@
|
|||
this.latitude = res.latitude;
|
||||
this.longitude = res.longitude;
|
||||
this.xqdz = res.name
|
||||
this.jtdz = res.address
|
||||
this.jtdz = res.name
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log('选择位置失败', err);
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
src="https://api.ccttiot.com/smartmeter/img/static/uZSiz7XWpxcXEkl6sTwj"
|
||||
mode="aspectFit"></image>
|
||||
<view class="sta_txt" v-if="item.status==3">
|
||||
维修中
|
||||
调试中
|
||||
</view>
|
||||
<view class="sta_txt" v-if="item.status==2" style="color:greenyellow;">
|
||||
使用中
|
||||
|
|
|
@ -52,24 +52,18 @@
|
|||
<view class="tit"> 店铺名称</view>
|
||||
<view class="but"> <input type="text" placeholder="请输入店铺名称" v-model="shopname" /> </view>
|
||||
</view>
|
||||
|
||||
<view class="listvals" @click="btnlx">
|
||||
<view class="tit"> 店铺类型</view>
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<view style="line-height: 70rpx;padding-left: 40rpx;width: 462rpx;
|
||||
height: 70rpx;
|
||||
background: #F0F0F0;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;" @click="btnlx">
|
||||
<text style="color: #ccc;font-size: 32rpx;">{{selectortext == '' ? '请选择商铺类型' : selectortext}}</text>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="but">
|
||||
<input disabled="false" type="text" :placeholder="selectortext" /> <u-icon
|
||||
name="arrow-down" style="position: absolute;top: 30%;right: 14rpx;"></u-icon>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
<view class="listval">
|
||||
<view class="tit"> 营业时间</view>
|
||||
<view class="but"
|
||||
|
@ -117,6 +111,13 @@
|
|||
<view class="tit"> 是否允许在非营业时间使用</view>
|
||||
<u-switch v-model="checkeds" active-color="#8883F0"></u-switch>
|
||||
</view>
|
||||
<view class="listval">
|
||||
<view class="tit"> 店铺描述</view>
|
||||
<view class="but"> <input type="text" v-model="miaoshu" placeholder="请输入您的店铺描述"/> </view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view class="baocun" @click="btncreat">
|
||||
提交创建
|
||||
</view>
|
||||
|
@ -139,6 +140,7 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
bgc: {
|
||||
backgroundColor: " #8883F0",
|
||||
},
|
||||
|
@ -160,27 +162,7 @@
|
|||
regionshow: false,
|
||||
regiontext: '请选择省市区',
|
||||
regionvalue: '',
|
||||
selector: [{
|
||||
value: 1,
|
||||
label: '商场'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '学校'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '娱乐场所'
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
label: '出租房'
|
||||
},
|
||||
{
|
||||
value: 5,
|
||||
label: '其他'
|
||||
},
|
||||
],
|
||||
selector: [],
|
||||
latitude: '请输入纬度',
|
||||
longitude: '请输入经度',
|
||||
shopname: '',
|
||||
|
@ -196,7 +178,8 @@
|
|||
area: '',
|
||||
url:'',
|
||||
id:'',
|
||||
jtdz:''
|
||||
jtdz:'',
|
||||
miaoshu:''
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
|
@ -207,8 +190,21 @@
|
|||
},
|
||||
onShow() {
|
||||
this.getQiniuToken()
|
||||
this.getleixing()
|
||||
},
|
||||
methods: {
|
||||
btnlx() {
|
||||
this.selectorshow = true
|
||||
},
|
||||
|
||||
getleixing() {
|
||||
this.$u.get("/app/storeType/listAll").then(res => {
|
||||
this.selector = res.data.map(item => ({
|
||||
value: item.id,
|
||||
label: item.name
|
||||
}))
|
||||
})
|
||||
},
|
||||
handleLongPress(index) {
|
||||
let that = this
|
||||
uni.showModal({
|
||||
|
@ -356,9 +352,10 @@
|
|||
specificAddress: this.xqdz,
|
||||
contactName: this.shopname,
|
||||
contactMobile: this.lxphone,
|
||||
type: this.selectorvalue,
|
||||
typeId: this.selectorvalue,
|
||||
show:this.checked,
|
||||
useOutTime:this.checkeds
|
||||
useOutTime:this.checkeds,
|
||||
description:this.miaoshu
|
||||
}
|
||||
this.$u.post("/app/store", data).then(res => {
|
||||
if (res.code == 200) {
|
||||
|
@ -409,9 +406,7 @@
|
|||
}
|
||||
},
|
||||
|
||||
btnlx() {
|
||||
this.selectorshow = true
|
||||
},
|
||||
|
||||
btnselector(e) {
|
||||
this.selectorvalue = e[0].value
|
||||
this.selectortext = e[0].label
|
||||
|
@ -432,7 +427,7 @@
|
|||
this.latitude = res.latitude
|
||||
this.longitude = res.longitude
|
||||
this.xqdz = res.name
|
||||
this.jtdz = res.address
|
||||
this.jtdz = res.name
|
||||
},
|
||||
fail: function(err) {
|
||||
// 检查错误消息,看是否是用户取消了位置选择
|
||||
|
@ -448,8 +443,6 @@
|
|||
},
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
getQiniuToken() {
|
||||
this.$u.get("/common/qiniu/uploadInfo").then((res) => {
|
||||
if (res.code == 200) {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
src="https://api.ccttiot.com/smartmeter/img/static/uZSiz7XWpxcXEkl6sTwj"
|
||||
mode="aspectFit"></image>
|
||||
<view class="sta_txt" v-if="item.status==3">
|
||||
维修中
|
||||
调试中
|
||||
</view>
|
||||
<view class="sta_txt" v-if="item.status==2" style="color:greenyellow;">
|
||||
使用中
|
||||
|
|
|
@ -229,6 +229,15 @@
|
|||
this.mac = device.name.slice(5, 17)
|
||||
}
|
||||
})
|
||||
let uniqueDevicesList = Array.from(new Set(this.devicesList));
|
||||
this.devicesLists = uniqueDevicesList.map(device => {
|
||||
const deviceId = device.name.slice(-12)
|
||||
const newDevice = {
|
||||
...device,
|
||||
xuanz: "请选择",
|
||||
}; // 直接在复制时添加 xuanz 字段
|
||||
return newDevice
|
||||
})
|
||||
}
|
||||
break;
|
||||
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
|
||||
|
@ -262,15 +271,15 @@
|
|||
break;
|
||||
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP:
|
||||
if (options.result) {
|
||||
let uniqueDevicesList = Array.from(new Set(this.devicesList));
|
||||
this.devicesLists = uniqueDevicesList.map(device => {
|
||||
const deviceId = device.name.slice(-12)
|
||||
const newDevice = {
|
||||
...device,
|
||||
xuanz: "请选择",
|
||||
}; // 直接在复制时添加 xuanz 字段
|
||||
return newDevice
|
||||
})
|
||||
// let uniqueDevicesList = Array.from(new Set(this.devicesList));
|
||||
// this.devicesLists = uniqueDevicesList.map(device => {
|
||||
// const deviceId = device.name.slice(-12)
|
||||
// const newDevice = {
|
||||
// ...device,
|
||||
// xuanz: "请选择",
|
||||
// }; // 直接在复制时添加 xuanz 字段
|
||||
// return newDevice
|
||||
// })
|
||||
let devicesarr = options.data
|
||||
this.devicesList.forEach(device => {
|
||||
if (device.name.substring(0, 4) == "CCYK") {
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
src="https://api.ccttiot.com/smartmeter/img/static/uZSiz7XWpxcXEkl6sTwj"
|
||||
mode="aspectFit"></image>
|
||||
<view class="sta_txt" v-if="item.status==3">
|
||||
维修中
|
||||
调试中
|
||||
</view>
|
||||
<view class="sta_txt" v-if="item.status==2" style="color:greenyellow;">
|
||||
使用中
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view class="page">
|
||||
<u-navbar :title="tittxt" :border-bottom="false" :background="bgc" back-icon-color="#000" title-color='#000'
|
||||
title-size='36' height='50' id="navbar" >
|
||||
title-size='36' height='50' id="navbar" :custom-back="btns">
|
||||
<!-- :custom-back="btns" -->
|
||||
</u-navbar>
|
||||
<view class="zhuhu">
|
||||
|
@ -217,6 +217,13 @@
|
|||
<view class="bot">解除绑定</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont" @click="jiaozhunflag = true">
|
||||
<view class="top">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uIIu0awWVaCskkQMyJYp" mode="aspectFit"
|
||||
style="width: 44rpx;height: 40rpx;"></image>
|
||||
<view class="bot">电量校准</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="cont" @click="topage(4)">
|
||||
<view class="top" style="border: 0;">
|
||||
<image style="width: 44rpx;height: 44rpx;"
|
||||
|
@ -315,6 +322,20 @@
|
|||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
<!-- 电量校准 -->
|
||||
<view class="dianliang" v-if="jiaozhunflag">
|
||||
<image class="bj" src="https://api.ccttiot.com/smartmeter/img/static/uvJFkqJb264nOgRunshs" mode=""></image>
|
||||
<view class="shuru">
|
||||
<image @click="btnjian" src="https://api.ccttiot.com/smartmeter/img/static/umGCPelSgd4GAwClNYcN" mode=""></image>
|
||||
<input type="text" v-model="wxs" :disabled="true"/>
|
||||
<image @click="btnadd" src="https://api.ccttiot.com/smartmeter/img/static/uyHk8ogQq0MPOURwPXbT" mode=""></image>
|
||||
</view>
|
||||
<view class="anniu" @click="btndian">
|
||||
确认校准
|
||||
</view>
|
||||
</view>
|
||||
<view class="mask" v-if="jiaozhunflag" @click="jiaozhunflag = false"></view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
@ -391,7 +412,11 @@
|
|||
userTpye_userid:'',
|
||||
ver_dataflag:2,
|
||||
showshop: false,
|
||||
devicesarr:[]
|
||||
devicesarr:[],
|
||||
fanhui:'',
|
||||
xishu:1,
|
||||
wxs:'',
|
||||
jiaozhunflag:false
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
|
@ -400,6 +425,9 @@
|
|||
let id = option.id
|
||||
this.id = id
|
||||
this.gettanc()
|
||||
if(option.fanhui){
|
||||
this.fanhui = option.fanhui
|
||||
}
|
||||
if (option.flag) {
|
||||
this.opflag = false
|
||||
} else {
|
||||
|
@ -487,6 +515,38 @@
|
|||
this.drawCanvas()
|
||||
},
|
||||
methods: {
|
||||
// 点击减电量系数
|
||||
btnjian() {
|
||||
const value = Number(this.wxs.slice(0, -1)) - 0.05
|
||||
this.wxs = value.toFixed(2) + '%'
|
||||
},
|
||||
btnadd() {
|
||||
const value = Number(this.wxs.slice(0, -1)) + 0.05
|
||||
this.wxs = value.toFixed(2) + '%'
|
||||
},
|
||||
// 点击校准电量
|
||||
btndian(){
|
||||
let data = {
|
||||
deviceId: this.id,
|
||||
wxs: this.wxs.slice(0,-1) / 100,
|
||||
}
|
||||
this.$u.put('/mch/device/setWxs', data).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.jiaozhunflag = false
|
||||
uni.showToast({
|
||||
title: '校准成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 点击修改名称
|
||||
btnxgname(){
|
||||
this.xgname = this.deviceInfo.deviceName
|
||||
|
@ -581,9 +641,13 @@
|
|||
},
|
||||
// 自定义返回
|
||||
btns(){
|
||||
uni.reLaunch({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
// if(this.fanhui == 1){
|
||||
uni.reLaunch({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
// }else{
|
||||
// uni.navigateBack()
|
||||
// }
|
||||
},
|
||||
// 商户跳转进行中订单
|
||||
btnshdd(){
|
||||
|
@ -955,6 +1019,11 @@
|
|||
getDevice(id) {
|
||||
this.$u.get("/app/device/" + id).then((res) => {
|
||||
if (res.code == 200) {
|
||||
if(res.data.wxs != null){
|
||||
this.wxs = (res.data.wxs * 100).toFixed(2) + '%'
|
||||
}else{
|
||||
this.wxs = 100 + '%'
|
||||
}
|
||||
this.deviceInfo = res.data
|
||||
this.qrResult = res.data.mac
|
||||
this.modelId = res.data.modelTags
|
||||
|
@ -1665,7 +1734,71 @@
|
|||
page {
|
||||
background-color: #F9F8FF;
|
||||
}
|
||||
|
||||
.dianliang{
|
||||
position: fixed;
|
||||
top: 30%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
z-index: 3;
|
||||
width: 680rpx;
|
||||
height: 733rpx;
|
||||
.anniu{
|
||||
width: 636rpx;
|
||||
height: 114rpx;
|
||||
line-height: 114rpx;
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
font-size: 40rpx;
|
||||
color: #FFFFFF;
|
||||
background: #8883F0;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
position: absolute;
|
||||
top: 570rpx;
|
||||
left: 50%;
|
||||
transform:translateX(-50%);
|
||||
z-index: 2;
|
||||
}
|
||||
.shuru{
|
||||
position: absolute;
|
||||
top: 400rpx;
|
||||
left: 50%;
|
||||
transform:translateX(-50%);
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
input{
|
||||
width: 386rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 15rpx 15rpx 15rpx 15rpx;
|
||||
border: 1rpx solid #808080;
|
||||
text-align: center;
|
||||
line-height: 88rpx;
|
||||
margin: 0 27rpx;
|
||||
}
|
||||
image{
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
}
|
||||
}
|
||||
.bj{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
.mask {
|
||||
width: 750rpx;
|
||||
height: 100vh;
|
||||
background: #000000;
|
||||
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
||||
opacity: 0.2;
|
||||
z-index: 1;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.maskss {
|
||||
width: 750rpx;
|
||||
height: 100vh;
|
||||
|
|
11
pages.json
11
pages.json
|
@ -532,6 +532,17 @@
|
|||
"transparentTitle": "always", //支付宝
|
||||
"titlePenetrate": "YES" //支付宝
|
||||
}
|
||||
},{
|
||||
"path": "hehuoren/shebeixq",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#8883F0",
|
||||
"navigationBarTextStyle": "#FFFFFF",
|
||||
"navigationStyle": "custom",
|
||||
"transparentTitle": "always", //支付宝
|
||||
"titlePenetrate": "YES" //支付宝
|
||||
}
|
||||
},{
|
||||
"path": "hehuoren/hhrtx",
|
||||
"style": {
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
<view class="" style="width: 20rpx;"></view>
|
||||
状态:<view class="" style="width: 10rpx;"></view>
|
||||
<view class="sta_txt" v-if="item.status==3">
|
||||
维修中
|
||||
调试中
|
||||
</view>
|
||||
<view class="sta_txt" v-if="item.status==2" style="color:red;">
|
||||
使用中
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
<view class="page">
|
||||
<u-navbar :is-back="false" title="设备列表" :border-bottom="false" :background="bgc" title-color='#fff'
|
||||
title-size='36' height='44' id="navbar">
|
||||
</u-navbar>
|
||||
</u-navbar>
|
||||
|
||||
|
||||
<u-mask :show="showtip" @click="show = false" :z-index='1000' />
|
||||
<view class="tip_box" v-if="showtip">
|
||||
|
@ -106,17 +107,19 @@
|
|||
<view class="" style="font-size: 28rpx;color: #808080;margin-top: 30rpx;">该店铺暂无设备...</view>
|
||||
</view>
|
||||
<view class="swiper_item">
|
||||
<view class="card_box" v-for="(item,indexs) in items.wateringList" :key="indexs">
|
||||
<view class="card_box" v-for="(item,indexs) in items.wateringList" :key="indexs" @click="todetail(item.deviceId)">
|
||||
<text v-if="item.onlineStatus == 1" class="yuan" style="background-color: #00BA88;"></text>
|
||||
<text v-if="item.onlineStatus == 0" class="yuan"></text>
|
||||
<view class="card">
|
||||
<view class="card_right" @click="todetail(item.deviceId)">
|
||||
<view class="card_right">
|
||||
<image v-if="item.customPicture" :src="item.customPicture" mode="aspectFit"
|
||||
style="border-radius: 20rpx;"></image>
|
||||
<image v-else :src="item.picture" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="card_left">
|
||||
<view class="card_left_tit" @click="todetail(item.deviceId)">
|
||||
{{item.deviceName}}
|
||||
<view class="card_left_sta" @click="todetail(item.deviceId)">
|
||||
<view class="card_left_tit">
|
||||
{{item.deviceName.length > 5 ? item.deviceName.slice(0,5) + '...' : item.deviceName}}
|
||||
<view class="card_left_sta">
|
||||
<text v-if="item.modelTags.some(tag => tag == 1)" style="margin-left: 20rpx;background-color: #0f5fe4d4;border: 1px solid #0f5fe4d4;">
|
||||
蓝牙
|
||||
</text>
|
||||
|
@ -129,14 +132,14 @@
|
|||
<text v-if="item.modelTags.some(tag => tag == 3) && item.onlineStatus1 == 1 || item.modelTags.some(tag => tag == 3) && item.onlineStatus2 == 1">
|
||||
4G
|
||||
</text>
|
||||
<text v-if="item.modelTags.includes(3) && item.onlineStatus1 == 0 && item.onlineStatus2 == 0" style="background-color: #ccc;border: 1px solid #ccc;">
|
||||
<text v-if="item.modelTags.some(tag => tag == 3) && item.onlineStatus1 == 0 && item.onlineStatus2 == 0" style="background-color: #ccc;border: 1px solid #ccc;">
|
||||
4G
|
||||
</text>
|
||||
<text v-if="item.wifi == null && !item.modelTags.some(tag => tag == 3) && !item.modelTags.some(tag => tag == 1)" style="background-color: red;color: #fff;border: 1px solid red;">未配网</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sta_txt" v-if="item.status==3" style="color:#fff;background-color: red;">
|
||||
维修中
|
||||
调试中
|
||||
</view>
|
||||
<view class="sta_txt" v-if="item.status==2" style="color:#fff;background-color: #ffba00;">
|
||||
使用中
|
||||
|
@ -147,16 +150,16 @@
|
|||
|
||||
<view class="" style="display: flex;align-items: center;">
|
||||
<view class="card_left_no" :class="item.onlineStatus == 0 ? 'activewzgl' : ''"
|
||||
@click="todetail(item.deviceId)">
|
||||
@clic.stop="todetail(item.deviceId)">
|
||||
S/N码:{{item.deviceNo}}
|
||||
</view>
|
||||
<view @click="sremakes(item)" v-if="item.storeId == null" class="dianpu"
|
||||
<view @click.stop="sremakes(item)" v-if="item.storeId == null" class="dianpu"
|
||||
style="border: 1px solid #ccc;padding: 5rpx;font-size:26rpx: border-box;width: 180rpx;border-radius: 20rpx;color: #ccc;text-align: center;margin-top: 10rpx;">
|
||||
未分配店铺
|
||||
</view>
|
||||
<view v-else :class="item.onlineStatus == 0 ? 'activewzgl' : ''"
|
||||
style="color: #95989D;padding-top: 20rpx;font-size: 26rpx;"
|
||||
@click="todetail(item.deviceId)">
|
||||
@click.stop="todetail(item.deviceId)">
|
||||
店铺:{{item.storeName.length > 5 ? item.storeName.slice(0,5) + '...' : item.storeName}}
|
||||
</view>
|
||||
</view>
|
||||
|
@ -334,7 +337,9 @@
|
|||
groupListone:[],
|
||||
groupListsone:[],
|
||||
shoplistone:[],
|
||||
wateringListone:[]
|
||||
wateringListone:[],
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
@ -404,6 +409,8 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
getlists() {
|
||||
this.$u.get(`/app/device/list?pageNum=${this.pagenum - 1}&pageSize=${this.pagesize}&orderByColumn=${this.pxzt}&isAsc=${this.pxdaoxu}&storeId=${this.storeId == null ? '' : this.storeId}&keyword=${this.keyword}`).then((res) => {
|
||||
if (res.code == 200) {
|
||||
|
@ -1418,7 +1425,7 @@
|
|||
},
|
||||
todetail(id) {
|
||||
uni.navigateTo({
|
||||
url: '/page_user/sbdetail?id=' + id
|
||||
url: '/page_user/sbdetail?id=' + id + '&fanhui=' + 1
|
||||
})
|
||||
},
|
||||
// 跳转到抄表
|
||||
|
@ -1433,6 +1440,8 @@
|
|||
|
||||
<style lang="scss">
|
||||
|
||||
|
||||
|
||||
.shuaxin {
|
||||
width: 100%;
|
||||
height: 110rpx;
|
||||
|
@ -2225,7 +2234,17 @@
|
|||
margin-top: 34rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
position: relative;
|
||||
.yuan{
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
left: 20rpx;
|
||||
display: inline-block;
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
border-radius: 50%;
|
||||
background-color: red;
|
||||
}
|
||||
.card {
|
||||
display: flex;
|
||||
width: 680rpx;
|
||||
|
|
49
pages/my.vue
49
pages/my.vue
|
@ -6,7 +6,7 @@
|
|||
|
||||
<view class="fdpage">
|
||||
<view class="top_box">
|
||||
<view class="userinfo">
|
||||
<!-- <view class="userinfo">
|
||||
<view class="info" @click="topage(5)">
|
||||
<view class="username">
|
||||
{{userinfo.userName == null ? '' : userinfo.userName}}
|
||||
|
@ -15,7 +15,7 @@
|
|||
共{{userinfo.deviceCount == null ? 0 : userinfo.deviceCount}}台设备
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="tit">
|
||||
我的钱包
|
||||
</view> -->
|
||||
|
@ -27,12 +27,12 @@
|
|||
<view class="bot">
|
||||
钱包余额
|
||||
</view>
|
||||
<view class="top" style="font-size: 24rpx;color: #FFFFFF;margin-top: 16rpx;">
|
||||
<!-- <view class="top" style="font-size: 24rpx;color: #FFFFFF;margin-top: 16rpx;">
|
||||
<view class="txt" style="font-size: 24rpx;">
|
||||
¥
|
||||
</view>
|
||||
{{userinfo.balance == undefined ? '' : Number(userinfo.balance) + Number(userinfo.waitBonusAmount)}}
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
<view class="cont" @click="topage(6)">
|
||||
|
@ -42,9 +42,9 @@
|
|||
<view class="bot">
|
||||
收款账户
|
||||
</view>
|
||||
<view class="" style="font-size: 24rpx;color: #FFFFFF;margin-top: 16rpx;">
|
||||
<!-- <view class="" style="font-size: 24rpx;color: #FFFFFF;margin-top: 16rpx;">
|
||||
微信收款
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="cont" @click="topage(7)">
|
||||
<view class="top" >
|
||||
|
@ -53,9 +53,9 @@
|
|||
<view class="bot">
|
||||
收支明细
|
||||
</view>
|
||||
<view class="" style="font-size: 24rpx;color: #FFFFFF;margin-top: 16rpx;">
|
||||
<!-- <view class="" style="font-size: 24rpx;color: #FFFFFF;margin-top: 16rpx;">
|
||||
近30天
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -78,7 +78,7 @@
|
|||
</view>
|
||||
<view style="margin-top:40rpx" class="botcard" @click="topage(4)">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uTZBKfNX9FO1iwFosYI8" mode="aspectFit"></image>
|
||||
<view class="txt">安全中心</view>
|
||||
<view class="txt">设置中心</view>
|
||||
</view>
|
||||
<view style="margin-top:40rpx" class="botcard" @click="btnbangzhu">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uyRB5Kph6fn7DBMqmaYI" mode="aspectFit"></image>
|
||||
|
@ -244,11 +244,14 @@
|
|||
// uni.navigateTo({
|
||||
// url:'/page_fenbao/statulist/fault/index'
|
||||
// })
|
||||
uni.showToast({
|
||||
title:'该功能暂未开放',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
uni.navigateTo({
|
||||
url:'/page_user/userSet'
|
||||
})
|
||||
// uni.showToast({
|
||||
// title:'该功能暂未开放',
|
||||
// icon: 'none',
|
||||
// duration: 2000
|
||||
// })
|
||||
}else if(num==5){
|
||||
uni.navigateTo({
|
||||
url:'/page_user/userSet'
|
||||
|
@ -348,14 +351,14 @@ page{
|
|||
.page{
|
||||
width: 750rpx;
|
||||
height: 100vh;
|
||||
.userpage{
|
||||
.top_box{
|
||||
padding-top: 40rpx;
|
||||
width: 750rpx;
|
||||
height: 352rpx;
|
||||
background-color: #8883F0;
|
||||
}
|
||||
}
|
||||
// .userpage{
|
||||
// .top_box{
|
||||
// padding-top: 40rpx;
|
||||
// width: 750rpx;
|
||||
// height: 352rpx;
|
||||
// background-color: #8883F0;
|
||||
// }
|
||||
// }
|
||||
.anniu{
|
||||
width: 300rpx;
|
||||
height: 120rpx;
|
||||
|
@ -370,9 +373,9 @@ page{
|
|||
}
|
||||
.fdpage{
|
||||
.top_box{
|
||||
padding-top: 40rpx;
|
||||
// padding-top: 40rpx;
|
||||
width: 750rpx;
|
||||
height: 470rpx;
|
||||
max-height: 470rpx;
|
||||
background-color: #F0EFFF;
|
||||
.userinfo{
|
||||
margin-left: 56rpx;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<template>
|
||||
<view class="page" style="width: 100%;height: 88vh;overflow: scroll;">
|
||||
<u-navbar :title="tittxt" :border-bottom="false" :background="bgc" back-icon-color="#fff" title-color='#fff'
|
||||
:custom-back="btns" title-size='36' height='50' id="navbar">
|
||||
title-size='36' height='50' id="navbar">
|
||||
</u-navbar>
|
||||
|
||||
<!-- :custom-back="btns" -->
|
||||
<view class="dltop">
|
||||
<view class="dian_list">
|
||||
<view class="">
|
||||
|
@ -678,9 +678,10 @@
|
|||
},
|
||||
// 点击默认返回首页
|
||||
btns() {
|
||||
uni.reLaunch({
|
||||
url: '/pages/shouye/index'
|
||||
})
|
||||
uni.navigateBack()
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/shouye/index'
|
||||
// })
|
||||
},
|
||||
// 点击结束订单
|
||||
btnjieshu() {
|
||||
|
|
|
@ -299,7 +299,7 @@
|
|||
},
|
||||
// 获取最新公告
|
||||
getgonggao(){
|
||||
this.$u.get("/app/notice/new").then(res =>{
|
||||
this.$u.get("/app/notice/new?noticeType=1").then(res =>{
|
||||
if(res.code == 200){
|
||||
this.announcements = res.data
|
||||
this.$u.get(`/app/notice/${res.data.noticeId}`).then(resp =>{
|
||||
|
|
170
pages/tj.vue
170
pages/tj.vue
|
@ -9,6 +9,32 @@
|
|||
@click="btnshouye"></image>
|
||||
<text>运营</text>
|
||||
</view>
|
||||
<view class="gonggao" @click="btntopgg">
|
||||
<u-icon name="volume-fill" color="#fff" style="position: absolute;left: 20rpx;" size="32"></u-icon>
|
||||
<view class="container">
|
||||
<view class="scroll-text">
|
||||
<view class="scroll-item">
|
||||
{{announcements.noticeTitle == null ? '暂无最新公告!!!' : announcements.noticeTitle}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#fff" style="position: absolute;right: 10rpx;" size="32"></u-icon>
|
||||
</view>
|
||||
<!-- 公告弹窗 -->
|
||||
<view class="noticetc" v-if="gonggaoflag">
|
||||
<view class="name">
|
||||
创想物联公告
|
||||
</view>
|
||||
<view class="biaoti">
|
||||
{{gonggaoxq.noticeTitle}}
|
||||
</view>
|
||||
<u-parse :html="gonggaoxq.noticeContent" style="width: 100%;height: 620rpx;background-color: #efefef;padding: 10rpx;box-sizing: border-box;margin-top: 20rpx;"></u-parse>
|
||||
<view class="btn" @click="btnggtc">
|
||||
我知道了
|
||||
</view>
|
||||
</view>
|
||||
<view class="mask" v-if="gonggaoflag"></view>
|
||||
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/u3f8ZWoJQnnXNHEaXC2N" class="imgbj" mode=""></image>
|
||||
<view class="box">
|
||||
<view class="topding">
|
||||
|
@ -201,7 +227,11 @@
|
|||
formattedThirtyDaysAgo:'',
|
||||
zongprice:'',
|
||||
zongnum:'',
|
||||
userobj:{}
|
||||
userobj:{},
|
||||
|
||||
announcements: {},
|
||||
gonggaoxq:{},
|
||||
gonggaoflag:false,
|
||||
}
|
||||
},
|
||||
// 分享到好友(会话)
|
||||
|
@ -224,6 +254,7 @@
|
|||
|
||||
},
|
||||
onShow() {
|
||||
this.getgonggao()
|
||||
this.tabindex = 1
|
||||
this.shoururiqilist =[]
|
||||
this.revenuelist =[]
|
||||
|
@ -240,6 +271,38 @@
|
|||
this.gettj()
|
||||
},
|
||||
methods: {
|
||||
// 点击头部滚动通知
|
||||
btntopgg(){
|
||||
this.$u.get(`/app/notice/${this.announcements.noticeId}`).then(resp =>{
|
||||
if(resp.code == 200){
|
||||
this.gonggaoxq = resp.data
|
||||
this.gonggaoflag = true
|
||||
}
|
||||
})
|
||||
},
|
||||
// 点击公告我知道了
|
||||
btnggtc(){
|
||||
this.gonggaoflag = false
|
||||
uni.setStorageSync('noticeId', this.announcements.noticeId)
|
||||
},
|
||||
// 获取最新公告
|
||||
getgonggao(){
|
||||
this.$u.get("/app/notice/new?noticeType=2").then(res =>{
|
||||
if(res.code == 200){
|
||||
this.announcements = res.data
|
||||
this.$u.get(`/app/notice/${res.data.noticeId}`).then(resp =>{
|
||||
if(resp.code == 200){
|
||||
this.gonggaoxq = resp.data
|
||||
if(resp.data.noticeId != uni.getStorageSync('noticeId')){
|
||||
this.gonggaoflag = true
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 点击导航栏回到首页
|
||||
btnshouye() {
|
||||
uni.reLaunch({
|
||||
|
@ -418,11 +481,111 @@
|
|||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.mask {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background-color: #000;
|
||||
opacity: .6;
|
||||
}
|
||||
.gonggao{
|
||||
width: 680rpx;
|
||||
height: 60rpx;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10rpx;
|
||||
background-color: rgba(255, 255, 255, .1);
|
||||
margin: auto;
|
||||
}
|
||||
.container {
|
||||
width: 560rpx;
|
||||
height: 60rpx; /* 根据需要调整高度 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: auto;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
color: #fff;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.scroll-text {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
animation: scroll 8s linear infinite;
|
||||
}
|
||||
.scroll-item {
|
||||
display: inline-block;
|
||||
padding: 0 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
@keyframes scroll {
|
||||
0% {
|
||||
transform: translateX(100%);
|
||||
}
|
||||
100% {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
}
|
||||
.noticetc{
|
||||
width: 680rpx;
|
||||
height: 950rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
position: fixed;
|
||||
top: 340rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
z-index: 2;
|
||||
.btn{
|
||||
width: 600rpx;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
border-radius: 50rpx;
|
||||
background-color: #8883F0;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
margin: auto;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
.name{
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
.biaoti{
|
||||
font-size: 32rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.cont{
|
||||
width: 100%;
|
||||
height: 620rpx;
|
||||
overflow: scroll;
|
||||
background-color: #ececec;
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/deep/ .u-title{
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
/deep/ .u-icon__icon{
|
||||
padding-bottom: 20rpx;
|
||||
// padding-bottom: 20rpx;
|
||||
}
|
||||
.uni-ec-canvas {
|
||||
width: 100%;
|
||||
|
@ -475,6 +638,9 @@
|
|||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
padding-bottom: 50rpx;
|
||||
box-sizing: barcode;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.imgbj{
|
||||
width: 100%;
|
||||
|
|
Loading…
Reference in New Issue
Block a user