|
@ -1,7 +1,7 @@ |
|
|
const QQMapWX = require("../../utils/qqmap-wx-jssdk") |
|
|
const QQMapWX = require("../../utils/qqmap-wx-jssdk") |
|
|
import { $wuxActionSheet } from "../../../../dist/index" |
|
|
import { $wuxActionSheet } from "../../../../dist/index" |
|
|
const config = require("../../../../utils/config") |
|
|
const config = require("../../../../utils/config") |
|
|
import { addIssue } from "../../utils/api" |
|
|
import { addIssue, getEventTagList } from "../../utils/api" |
|
|
|
|
|
|
|
|
Page({ |
|
|
Page({ |
|
|
data: { |
|
|
data: { |
|
@ -17,9 +17,12 @@ Page({ |
|
|
focus: false, |
|
|
focus: false, |
|
|
isBlock: true, |
|
|
isBlock: true, |
|
|
violationsCount: 0, |
|
|
violationsCount: 0, |
|
|
isConReview: false |
|
|
isConReview: false, |
|
|
|
|
|
tagIds: [], |
|
|
|
|
|
checkboxs: [] |
|
|
}, |
|
|
}, |
|
|
onLoad () { |
|
|
onLoad () { |
|
|
|
|
|
this.getEventTagList() |
|
|
this.data.qqMapWX = new QQMapWX({ |
|
|
this.data.qqMapWX = new QQMapWX({ |
|
|
key: "CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ" |
|
|
key: "CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ" |
|
|
}) |
|
|
}) |
|
@ -42,6 +45,22 @@ Page({ |
|
|
addressContent: e.detail.value |
|
|
addressContent: e.detail.value |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
//获取事件标签列表
|
|
|
|
|
|
getEventTagList () { |
|
|
|
|
|
getEventTagList().then(res => { |
|
|
|
|
|
console.log(res.data) |
|
|
|
|
|
for (let i=0; i<res.data.length; i++) { |
|
|
|
|
|
this.data.checkboxs.push({ |
|
|
|
|
|
id: res.data[i].id, |
|
|
|
|
|
name: res.data[i].tagName, |
|
|
|
|
|
checked: false |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
checkboxs: this.data.checkboxs |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
// 获取经纬度
|
|
|
// 获取经纬度
|
|
|
getLocation () { |
|
|
getLocation () { |
|
|
return new Promise((resolve, reject) => { |
|
|
return new Promise((resolve, reject) => { |
|
@ -231,7 +250,8 @@ Page({ |
|
|
issueLongitude: this.data.longitude, |
|
|
issueLongitude: this.data.longitude, |
|
|
issueLatitude: this.data.latitude, |
|
|
issueLatitude: this.data.latitude, |
|
|
images: imagesList, |
|
|
images: imagesList, |
|
|
isConReview: this.data.isConReview |
|
|
isConReview: this.data.isConReview, |
|
|
|
|
|
tagIds: this.data.tagIds |
|
|
} |
|
|
} |
|
|
wx.showLoading({ |
|
|
wx.showLoading({ |
|
|
title: "加载中..." |
|
|
title: "加载中..." |
|
@ -298,6 +318,25 @@ Page({ |
|
|
focus: true |
|
|
focus: true |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
checkboxClick (e) { |
|
|
|
|
|
if (this.data.checkboxs[e.currentTarget.dataset.index].checked) { |
|
|
|
|
|
this.data.checkboxs[e.currentTarget.dataset.index].checked = false |
|
|
|
|
|
this.data.tagIds = [] //当前版本标签单选
|
|
|
|
|
|
} else { |
|
|
|
|
|
for(let i=0;i<this.data.checkboxs.length;i++) { |
|
|
|
|
|
this.data.checkboxs[i].checked = false |
|
|
|
|
|
} |
|
|
|
|
|
this.data.checkboxs[e.currentTarget.dataset.index].checked = true |
|
|
|
|
|
|
|
|
|
|
|
this.data.tagIds = [] //当前版本标签单选
|
|
|
|
|
|
this.data.tagIds.push(this.data.checkboxs[e.currentTarget.dataset.index].id) |
|
|
|
|
|
} |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
checkboxs: this.data.checkboxs |
|
|
|
|
|
}) |
|
|
|
|
|
console.log(this.data.tagIds) |
|
|
|
|
|
} |
|
|
// toOperationDesc(phrase) { //常用于点击事件
|
|
|
// toOperationDesc(phrase) { //常用于点击事件
|
|
|
// // console.log(phrase.currentTarget.dataset.phrase)
|
|
|
// // console.log(phrase.currentTarget.dataset.phrase)
|
|
|
// this.setData({
|
|
|
// this.setData({
|
|
|