Swanky 2 years ago
parent bc78ca8e7b
commit bd1da71c66
  1. 3
      common/helper.js
  2. 4
      manifest.json
  3. 10
      pages.json
  4. 6
      pages/blank/blank.vue
  5. 168
      pages/index/index.vue
  6. 97
      pages/mine/mine.vue
  7. 2
      pages/sjgl/sjgl.vue
  8. 50
      pages/workbench/workbench.vue

@ -163,5 +163,6 @@ export default {
tempToken: '', tempToken: '',
formatArea, formatArea,
formatLength, formatLength,
generateStyle generateStyle,
tempUserInfo: ''
} }

@ -2,8 +2,8 @@
"name" : "草原管理", "name" : "草原管理",
"appid" : "__UNI__BBBC950", "appid" : "__UNI__BBBC950",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.1",
"versionCode" : "100", "versionCode" : 101,
"transformPx" : false, "transformPx" : false,
"app-plus" : { "app-plus" : {
/* 5+App */ /* 5+App */

@ -101,6 +101,16 @@
"navigationBarBackgroundColor": "#01D393", "navigationBarBackgroundColor": "#01D393",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
},
{
"path" : "pages/mine/mine",
"style" :
{
"navigationBarTitleText" : "个人中心",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#01D393",
"navigationBarTextStyle": "white"
}
} }
], ],
"globalStyle": { "globalStyle": {

@ -1,6 +1,5 @@
<template> <template>
<view> <view>
1
</view> </view>
</template> </template>
@ -17,6 +16,11 @@
Authorization: `Bearer ${token}` Authorization: `Bearer ${token}`
}, },
success(resp) { success(resp) {
helper.tempUserInfo = resp.data.data;
uni.setStorage({
data: resp.data.data,
key: "tempUserInfo"
})
console.log('success', resp); console.log('success', resp);
if (resp?.data?.code !== 200) { if (resp?.data?.code !== 200) {
uni.reLaunch({ uni.reLaunch({

@ -1,7 +1,7 @@
<template> <template>
<view class="container" @click="showSearch(false)"> <view class="container" @click="showSearch(false)">
<view id="map" class="map" :prop="mapData" :change:prop="mapModule.updateMapData"></view> <view id="map" class="map" :prop="mapData" :change:prop="mapModule.updateMapData"></view>
<image-button @click="location" className="location" imgSrc="/static/dw.png"></image-button> <!-- <image-button @click="location" className="location" imgSrc="/static/dw.png"></image-button> -->
<view class="south"> <view class="south">
<image src="/static/south.png" class="south-img" /> <image src="/static/south.png" class="south-img" />
@ -17,12 +17,15 @@
<view class="btn-xzgj right-btn" @click="toggleXzgj"> <view class="btn-xzgj right-btn" @click="toggleXzgj">
<image :src="measureStatus==='xzgj'?'/static/xzgj-sel.png':'/static/xzgj.png'" class="btn-img"></image> <image :src="measureStatus==='xzgj'?'/static/xzgj-sel.png':'/static/xzgj.png'" class="btn-img"></image>
</view> </view>
<view class="btn-logout right-btn" @click="mapModule.clear"> <view class="btn-location right-btn" @click="location">
<image src="/static/dw.png" class="img-location" />
</view>
<view class="btn-clear right-btn" @click="mapModule.clear">
<image src="/static/clear.png" class="img-clear" /> <image src="/static/clear.png" class="img-clear" />
</view> </view>
<view class="btn-logout right-btn" @click="logout"> <!-- <view class="btn-logout right-btn" @click="logout">
<image src="/static/logout.png" class="img-logout" /> <image src="/static/logout.png" class="img-logout" />
</view> </view> -->
</view> </view>
<button class="btn-workbench" @click="toWorkBench"> <button class="btn-workbench" @click="toWorkBench">
<image src="/static/gzt.png" class="workbench-img" /> <image src="/static/gzt.png" class="workbench-img" />
@ -49,9 +52,9 @@
</view> </view>
<view class="popup-content" style="padding: 12px;"> <view class="popup-content" style="padding: 12px;">
<view class="detail-tab"> <view class="detail-tab">
<view v-if="detailGroups.length>1" v-for="groupItem in detailGroups"> <view v-if="detailGroups.length>1" v-for="groupItem in detailGroups"
style="margin-bottom: 8px;margin-right: 8px;">
<uni-tag :circle="true" @click="changeDetailTab(groupItem.tab)" :text="groupItem.tab" <uni-tag :circle="true" @click="changeDetailTab(groupItem.tab)" :text="groupItem.tab"
style="margin-right: 8px;"
:type="currentGroupTab===groupItem.tab?'success':''"></uni-tag> :type="currentGroupTab===groupItem.tab?'success':''"></uni-tag>
</view> </view>
</view> </view>
@ -171,8 +174,10 @@
uni.onLocationChange(res => { uni.onLocationChange(res => {
let { let {
longitude, longitude,
latitude latitude,
isFullAccuracy
} = res; } = res;
console.log(res)
// longitude = longitude + 0.01 * testIndex * (testIndex % 2 ? 1 : -1); // longitude = longitude + 0.01 * testIndex * (testIndex % 2 ? 1 : -1);
// latitude = latitude + 0.01 * testIndex * (testIndex % 2 ? 1 : -1); // latitude = latitude + 0.01 * testIndex * (testIndex % 2 ? 1 : -1);
// ++testIndex; // ++testIndex;
@ -182,10 +187,8 @@
this.xzgjPoints.push([longitude, latitude]); this.xzgjPoints.push([longitude, latitude]);
} }
console.log(this.xzgjPoints) console.log(this.xzgjPoints)
if (this.xzgjPoints.length >= 3) { this.mapData = {
this.mapData = { xzgjPoints: this.xzgjPoints
xzgjPoints: this.xzgjPoints
}
} }
}) })
}, },
@ -211,7 +214,8 @@
this.measureStatus = 'xzgj'; this.measureStatus = 'xzgj';
this.xzgjPoints = [] this.xzgjPoints = []
uni.startLocationUpdate({ uni.startLocationUpdate({
type: 'gcj02' // type: 'gcj02',
needFullAccuracy: true
}) })
this.mapData = { this.mapData = {
xzgj: true xzgj: true
@ -270,47 +274,6 @@
closeDetail() { closeDetail() {
this.$refs.popupDetail.close() this.$refs.popupDetail.close()
}, },
logout() {
const toLogin = (token) => {
uni.request({
url: `${helper.serverUrl}/user/logout`,
method: 'POST',
header: {
Authorization: `Bearer ${token}`
},
success() {
uni.reLaunch({
url: '/pages/login/login'
})
},
fail() {
uni.reLaunch({
url: '/pages/login/login'
})
}
})
}
uni.showModal({
content: '是否退出当前用户?',
title: '提示',
success(res) {
if (res.confirm) {
uni.getStorage({
key: 'token',
success(resp) {
uni.removeStorage({
key: 'token'
})
toLogin(resp.data);
},
fail() {
toLogin();
}
})
} else if (res.cancel) {}
}
})
},
showSearch(visible) { showSearch(visible) {
this.searchVisible = visible; this.searchVisible = visible;
}, },
@ -434,7 +397,8 @@
import { import {
Point, Point,
Polygon, Polygon,
Circle Circle,
LineString
} from 'ol/geom' } from 'ol/geom'
import { import {
fromExtent, fromExtent,
@ -576,26 +540,63 @@
} }
if (newValue.xzgjPoints) { if (newValue.xzgjPoints) {
this.clear(); this.clear();
const polygon = new Polygon([ if (newValue.xzgjPoints.length === 1) {
[...newValue.xzgjPoints, newValue.xzgjPoints[0]] const point = new Point(newValue.xzgjPoints[0]);
]); const feature = new Feature({
const feature = new Feature({ geometry: point
geometry: polygon })
}) const style = new Style({
const style = helper.generateStyle(feature, { image: new CircleStyle({
fillOpt: { fill: new Fill({
color: 'rgba(255, 255, 255, 0.4)', color: '#0ff'
}, }),
strokeOpt: { radius: 8
color: '#ffcc33', })
width: 2, })
} feature.setStyle(style);
}) vectorLayer.getSource().addFeature(feature)
feature.setStyle(style); map.getView().setCenter(newValue.xzgjPoints[0])
vectorLayer.getSource().addFeature(feature) } else if (newValue.xzgjPoints.length === 2) {
const geom = polygon.clone(); const line = new LineString(newValue.xzgjPoints);
geom.scale(0.5, 0.5) const feature = new Feature({
map.getView().fit(geom) geometry: line
})
const style = helper.generateStyle(feature, {
fillOpt: {
color: 'rgba(255, 255, 255, 0.4)',
},
strokeOpt: {
color: '#ffcc33',
width: 2,
}
})
feature.setStyle(style);
vectorLayer.getSource().addFeature(feature)
const geom = line.clone();
geom.scale(2, 2)
map.getView().fit(geom)
} else if (newValue.xzgjPoints.length >= 3) {
const polygon = new Polygon([
[...newValue.xzgjPoints, newValue.xzgjPoints[0]]
]);
const feature = new Feature({
geometry: polygon
})
const style = helper.generateStyle(feature, {
fillOpt: {
color: 'rgba(255, 255, 255, 0.4)',
},
strokeOpt: {
color: '#ffcc33',
width: 2,
}
})
feature.setStyle(style);
vectorLayer.getSource().addFeature(feature)
const geom = polygon.clone();
geom.scale(2, 2)
map.getView().fit(geom)
}
} }
} }
}, },
@ -683,6 +684,7 @@
overflow-x: auto; overflow-x: auto;
/* margin-bottom: 12px; */ /* margin-bottom: 12px; */
padding-bottom: 12px; padding-bottom: 12px;
flex-wrap: wrap;
} }
.popup-detail-title { .popup-detail-title {
@ -712,7 +714,8 @@
.img-clear, .img-clear,
.img-logout, .img-logout,
.img-message, .img-message,
.img-search { .img-search,
.img-location {
width: 30px; width: 30px;
height: 30px; height: 30px;
} }
@ -769,6 +772,18 @@
justify-content: center; justify-content: center;
} }
.btn-location {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom: 1px solid #ddd;
margin-top: 12px;
}
.btn-clear {
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
.btn-tcdj { .btn-tcdj {
border-top-left-radius: 10px; border-top-left-radius: 10px;
border-top-right-radius: 10px; border-top-right-radius: 10px;
@ -779,7 +794,6 @@
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
} }
.btn-xzgj { .btn-xzgj {
border-bottom-left-radius: 10px; border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px; border-bottom-right-radius: 10px;
@ -803,7 +817,7 @@
.south { .south {
position: absolute; position: absolute;
top: 160px; top: 100px;
left: 20px; left: 20px;
width: 48px; width: 48px;
height: 48px; height: 48px;

@ -0,0 +1,97 @@
<template>
<view class="container">
<view style="padding-left: 16px;color: rgba(0,0,0,0.5);font-size: 12px;margin-bottom: -10px;margin-top: 16px;">
账号信息</view>
<uni-card padding="0">
<uni-list :border="false">
<uni-list-item title="账号" :rightText="userInfo.userName"></uni-list-item>
<uni-list-item title="昵称" :rightText="userInfo.nickName"></uni-list-item>
<uni-list-item title="手机号" :rightText="userInfo.phonenumber"></uni-list-item>
</uni-list>
</uni-card>
<button class="submit" type="warn" @click="logout" :loading="submiting">退出登录</button>
</view>
</template>
<script>
import helper from '../../common/helper'
export default {
data() {
return {
userInfo: {},
submiting: false,
}
},
onLoad() {
console.log(1)
uni.getStorage({
key: 'tempUserInfo',
success: (resp) => {
console.log(resp)
this.userInfo = resp.data.user;
},
fail: (err) => {
console.log(err)
}
})
},
onShow() {},
methods: {
logout() {
const toLogin = (token) => {
uni.request({
url: `${helper.serverUrl}/user/logout`,
method: 'POST',
header: {
Authorization: `Bearer ${token}`
},
success() {
uni.reLaunch({
url: '/pages/login/login'
})
},
fail() {
uni.reLaunch({
url: '/pages/login/login'
})
}
})
}
uni.showModal({
content: '是否退出当前用户?',
title: '提示',
success(res) {
if (res.confirm) {
uni.getStorage({
key: 'token',
success(resp) {
uni.removeStorage({
key: 'token'
})
toLogin(resp.data);
},
fail() {
toLogin();
}
})
} else if (res.cancel) {}
}
})
},
}
}
</script>
<style scoped>
.container>>>.uni-list::after {
height: 0;
}
.submit {
border-radius: 47px;
width: 375rpx;
}
</style>

@ -12,7 +12,7 @@
<custom-attr label="上报内容" :value="item.reason"></custom-attr> <custom-attr label="上报内容" :value="item.reason"></custom-attr>
<custom-attr label="状态" :value="item.status"></custom-attr> <custom-attr label="状态" :value="item.status"></custom-attr>
</view> </view>
<view style="margin-top: 10px;"> <view style="margin-top: 10px;" v-if="item.status==='审核中'">
<uni-row> <uni-row>
<uni-col :span="12"> <uni-col :span="12">
<button style="color: #e64340;" @click="delItem(item.id)"> <button style="color: #e64340;" @click="delItem(item.id)">

@ -3,17 +3,22 @@
<image class="gzt-image" src="/static/gzt-bg.png"></image> <image class="gzt-image" src="/static/gzt-bg.png"></image>
<view class="content"> <view class="content">
<view class="header"> <view class="header">
<view class="fill" @click="backTo"> <view class="fill">
<i class="uni-btn-icon back"> </i> <uni-icons type="left" :size="27" color="@fff" style="padding-left: 12px;"
@click="backTo"></uni-icons>
</view> </view>
<view class="fill title">工作台</view> <view class="fill title">工作台</view>
<view class="fill"></view> <view class="fill" style="text-align: right;">
<uni-icons type="contact" :size="27" color="@fff" style="padding-right: 12px;"
@click="toMine()"></uni-icons>
</view>
</view> </view>
<view class="panel"> <view class="panel">
<view class="action"> <view class="action">
<view class="title2">草原核查数据</view> <view class="title2">草原核查数据</view>
<view class="flex" style="margin-top: 24px;"> <view class="flex" style="margin-top: 24px;">
<view class="action-btn fill flex" style="margin-right: 12px;justify-content: flex-start;" @click="toSjsb"> <view class="action-btn fill flex" style="margin-right: 12px;justify-content: flex-start;"
@click="toSjsb">
<image src="/static/sjsb.png" class="action-img"></image> <image src="/static/sjsb.png" class="action-img"></image>
<text class="action-text">数据上报</text> <text class="action-text">数据上报</text>
<image src="/static/jr.png" class="action-arrow"></image> <image src="/static/jr.png" class="action-arrow"></image>
@ -25,7 +30,8 @@
</view> </view>
</view> </view>
<view class="flex" style="margin-top: 12px;"> <view class="flex" style="margin-top: 12px;">
<view class="action-btn fill flex" style="align-items: center;justify-content: flex-start;" @click="toLssjgl"> <view class="action-btn fill flex" style="align-items: center;justify-content: flex-start;"
@click="toLssjgl">
<image src="/static/sjgl.png" class="action-img"></image> <image src="/static/sjgl.png" class="action-img"></image>
<text class="action-text">临时数据管理</text> <text class="action-text">临时数据管理</text>
<image src="/static/jr.png" class="action-arrow"></image> <image src="/static/jr.png" class="action-arrow"></image>
@ -34,6 +40,11 @@
</view> </view>
</view> </view>
</view> </view>
<uni-drawer ref="drawer" mode="right" :mask-click="false">
<scroll-view style="height: 100%;" scroll-y="true">
<button type="primary">关闭Drawer</button>
</scroll-view>
</uni-drawer>
</view> </view>
</template> </template>
@ -45,12 +56,17 @@
} }
}, },
methods: { methods: {
toMine() {
uni.navigateTo({
url: '/pages/mine/mine'
})
},
toSjsb() { toSjsb() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/sjsb/sjsb' url: '/pages/sjsb/sjsb'
}) })
}, },
toLssjgl(){ toLssjgl() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/lssjgl/lssjgl' url: '/pages/lssjgl/lssjgl'
}) })
@ -67,7 +83,7 @@
} }
</script> </script>
<style> <style scoped>
.action-text { .action-text {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
@ -79,6 +95,14 @@
margin-bottom: -14px; margin-bottom: -14px;
} }
.action-icon {
color: #fff;
font-size: 27px;
font-weight: bold;
padding-left: 12px;
}
.action-arrow { .action-arrow {
width: 12px; width: 12px;
height: 12px; height: 12px;
@ -118,22 +142,20 @@
display: flex; display: flex;
color: #fff; color: #fff;
z-index: 1; z-index: 1;
align-items: center;
} }
.title { .title {
text-align: center; text-align: center;
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
} padding-bottom: 4px;
.back {
font-size: 27px;
font-weight: bold;
padding-left: 12px;
} }
.fill { .fill {
flex: 1 flex: 1;
height: 28px;
line-height: 28px;
} }
.panel { .panel {

Loading…
Cancel
Save