| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- /**
- * 穴位编辑与自定义模式 mixin
- * 负责:穴位图交互、时间选择、方案管理
- */
- export default {
- data() {
- return {
- picMode: 1, // 1设备 2穴位
- acupointIndex: -1,
- acupointList: [],
- curCase: [],
- curCaseIndex: 0,
- isShowTimeDrawer: false,
- timeRange: [[0, 1, 2, 3], [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55]],
- selectedHour: 0,
- selectedMinute: 0
- }
- },
- methods: {
- picModeChange(value) {
- if (value === 2) {
- // 穴位编辑跳转到独立vue页面(支持更灵活的坐标渲染)
- const profileId = this.profileId || ''
- uni.navigateTo({
- url: '/pages/device/acupointEdit/acupointEdit?profileId=' + encodeURIComponent(profileId)
- })
- return
- }
- this.picMode = value
- },
- showTimeDraw(inx) {
- this.acupointIndex = inx
- this.isShowTimeDrawer = true
- },
- bindTimeChange(e) {
- const val = e.detail.value
- this.selectedHour = this.timeRange[0][val[0]]
- this.selectedMinute = this.timeRange[1][val[1]]
- },
- cancelAijiuTime(val) {
- this.isShowTimeDrawer = false
- if (val == 1 && this.acupointIndex >= 0) {
- const sumMinutes = this.selectedHour * 60 + this.selectedMinute
- const point = this.acupointList[this.acupointIndex]
- this.curCase = [{
- id: point.id,
- time: sumMinutes,
- _x: point._x || 0,
- _y: point._y || 0
- }]
- this.curCaseIndex = this.acupointIndex
- }
- }
- }
- }
|