diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 0000000..81f13f4 --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,16 @@ +{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ + // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 + "version": "0.0", + "configurations": [{ + "default" : + { + "launchtype" : "local" + }, + "mp-weixin" : + { + "launchtype" : "local" + }, + "type" : "uniCloud" + } + ] +} diff --git a/App.vue b/App.vue index 5f7948d..75112a1 100644 --- a/App.vue +++ b/App.vue @@ -16,6 +16,7 @@ } - diff --git a/main.js b/main.js index d3d6850..0d2e54c 100644 --- a/main.js +++ b/main.js @@ -1,25 +1,29 @@ -import App from './App' - -// #ifndef VUE3 -import Vue from 'vue' +import App from './App' + +// #ifndef VUE3 +import Vue from 'vue' Vue.config.productionTip = false App.mpType = 'app' const app = new Vue({ - ...App + ...App }) -app.$mount() -// #endif - -// #ifdef VUE3 -import { createSSRApp } from 'vue' -export function createApp() { - const app = createSSRApp(App) - return { - app - } +app.$mount() +// #endif + +// #ifdef VUE3 +import { + createSSRApp +} from 'vue' +export function createApp() { + const app = createSSRApp(App) + return { + app + } } -// #endif - -// main.js -import uView from "uview-ui"; -Vue.use(uView); \ No newline at end of file +// #endif + +// main.js +import uView from "uview-ui"; +Vue.use(uView); +import util from "@/utils/util"; +Vue.prototype.util = util; diff --git a/packageA/pages/generalList/generalList.vue b/packageA/pages/generalList/generalList.vue index 8183fd0..a17f51e 100644 --- a/packageA/pages/generalList/generalList.vue +++ b/packageA/pages/generalList/generalList.vue @@ -1,22 +1,97 @@ - - - - - diff --git a/packageA/pages/generalPatrol/generalPatrol.vue b/packageA/pages/generalPatrol/generalPatrol.vue index 31751a0..6f80ea1 100644 --- a/packageA/pages/generalPatrol/generalPatrol.vue +++ b/packageA/pages/generalPatrol/generalPatrol.vue @@ -3,15 +3,16 @@ - + - + 江苏省苏州市通园路66号 - 重新获取 + 重新获取 @@ -25,10 +26,10 @@ 选择位置 + :longitude="location.longitude" id="map"> - 确认选择 + 确认选择 @@ -44,15 +45,8 @@ contentshow: false, action: "", location: {}, - list: [{ - value: '1', - label: '江' - }, - { - value: '2', - label: '湖' - } - ], + plist: [], + list: [], form: { type: "", content: "", @@ -63,9 +57,19 @@ height: 300 } }, + onLoad() { + var that = this; + this.loadType({ + 'number': "general_type", + }, function(res) { + that.plist = res; + }); + }, onReady() { + this._mapContext = uni.createMapContext("map", this); let that = this; uni.getLocation({ + type: "gcj02", success(res) { that.location = res; } @@ -79,15 +83,66 @@ }, methods: { + loadType(data, call) { + let that = this; + this.util.request({ + api: '/api/admin/parameter/show', + data: data, + utilSuccess: function(res) { + call(res.detail) + }, + utilFail: function(res) { + this.util.alert(res); + } + }); + }, + toshowMap() { + this.showMap = true; + this.addMaker(); + }, submit() {}, confirmType(e) { + var that = this; this.form.type = e[0].value this.form.typeName = e[0].label + this.loadType({ + pid: e[0].value + }, function(res) { + that.list = res; + }) }, confirmContent(e) { this.form.content = e[0].value this.form.contentName = e[0].label }, + addMaker() { + let img = "../../../static/img/location.png" + const marker = { + id: 1, + iconPath: img, + width: 50, + height: 50, + label: { + width: 50, + height: 30, + borderWidth: 1, + borderRadius: 10, + bgColor: '#ffffff' + }, + latitude: this.location.latitude, + longitude: this.location.longitude + }; + this._mapContext.addMarkers({ + marker, + clear: true, + complete(res) { + console.log('addMarkers', res) + }, + fail(res) { + console.log('fail', res) + } + }); + } } } diff --git a/packageB/pages/dailyInspection/dailyInspection.vue b/packageB/pages/dailyInspection/dailyInspection.vue new file mode 100644 index 0000000..8183fd0 --- /dev/null +++ b/packageB/pages/dailyInspection/dailyInspection.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/pages.json b/pages.json index 8723b11..d1c0f11 100644 --- a/pages.json +++ b/pages.json @@ -3,12 +3,30 @@ "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" }, "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages + + { + "path": "pages/login/login", + "style": { + "navigationBarTitleText": "巡查登录", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + + }, { "path": "pages/index/index", "style": { "navigationBarTitleText": "巡查养护", "navigationStyle": "custom" } + }, { + "path": "pages/mine/mine", + "style": { + "navigationBarTitleText": "我的", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } + } ], "subPackages": [{ @@ -29,6 +47,16 @@ "navigationStyle": "custom" } + }] + }, { + "root": "packageB/pages", + "pages": [{ + "path": "dailyInspection/dailyInspection", + "style": { + "navigationBarTitleText": "日常监管巡查", + "enablePullDownRefresh": false + } + }] }], "globalStyle": { diff --git a/pages/index/index.vue b/pages/index/index.vue index 1d95a15..261f1d1 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,24 +1,47 @@