dev_hehang_v2
hehang 2 years ago
parent af25f1de42
commit 242eb87b0b
  1. 18
      api/word/attractionsEditor.js
  2. 18
      api/word/sort.js
  3. 216
      pages/work/reportMatter/reportMatter.vue
  4. 328
      pages/work/scenicSpot/attractionsEditor.vue
  5. 11
      pages/work/scenicSpot/scenicSpot.vue
  6. 149
      pages/work/scenicSpot/sort.vue

@ -1,18 +0,0 @@
import upload from '@/utils/upload'
import request from '@/utils/request'
// 查询景点详情
export function scenicSpotById(id){
return request({
url: '/scenicSpotManage/'+id,
method: 'get'
})
}
// 编辑景点信息
export function updateScenicSpotSortList(datas){
return request({
url: '/scenicSpotManage',
method: 'put',
params:datas
})
}

@ -1,18 +0,0 @@
import upload from '@/utils/upload'
import request from '@/utils/request'
// 查询景点列表信息
export function scenicSpotSortList(){
return request({
url: '/scenicSpotManage/scenicSpotSortList',
method: 'get'
})
}
// 排序
export function updateScenicSpotSortList(datas){
return request({
url: '/scenicSpotManage/updateScenicSpotSortList',
method: 'post',
data:datas
})
}

@ -11,29 +11,23 @@
@popupopened="onpopupopened"></uni-data-picker>
</evan-form-item>
<evan-form-item label="联系人:" prop="contactUser">
<input v-model="info.contactUser" class="form-input" placeholder="请输入联系人"
placeholder-class="form-input-placeholder" />
<input v-model="info.contactUser" class="form-input" placeholder="请输入联系人" placeholder-class="form-input-placeholder" />
</evan-form-item>
<evan-form-item label="联系人电话:" prop="phone">
<input v-model="info.phone" class="form-input" placeholder="请输入电话"
placeholder-class="form-input-placeholder" />
<input v-model="info.phone" class="form-input" placeholder="请输入电话" placeholder-class="form-input-placeholder" />
</evan-form-item>
<evan-form-item label="标题:" prop="title">
<input v-model="info.title" class="form-input" placeholder="请输入标题"
placeholder-class="form-input-placeholder" />
<input v-model="info.title" class="form-input" placeholder="请输入标题" placeholder-class="form-input-placeholder" />
</evan-form-item>
<evan-form-item label="事件位置:" prop="location">
<input v-show="false" v-model="info.location" class="form-input" disabled
placeholder="请选择坐标" placeholder-class="form-input-placeholder" />
<text
v-if="info.latitude != '' && info.longitude != ''">经度:{{ info.longitude }},纬度:{{ info.latitude }}</text>
<input v-show="false" v-model="info.location" class="form-input" disabled placeholder="请选择坐标" placeholder-class="form-input-placeholder" />
<text v-if="info.latitude != '' && info.longitude != ''">经度:{{ info.longitude }},纬度:{{ info.latitude }}</text>
<button class="set-position" size="mini" @click="getLocation">定位</button>
</evan-form-item>
</view>
<view class="body-item">
<evan-form-item label="描述:" prop="description">
<input v-model="info.description" class="form-input" placeholder="请输入描述"
placeholder-class="form-input-placeholder" />
<input v-model="info.description" class="form-input" placeholder="请输入描述" placeholder-class="form-input-placeholder" />
</evan-form-item>
</view>
<view class="body-item">
@ -60,63 +54,23 @@
getToken
} from '@/utils/auth.js'
import config from '@/config.js';
const baseUrl = config.baseUrl;
const baseUrl = config.baseUrl;
export default {
components: {
wUpload
},
data() {
return {
token: '',
imgShow: true,
requestUrl: baseUrl + '/common/upload',
imgType: 'jpg,png,gif',
imgList: [],
fileList: [],
hideRequiredAsterisk: false,
data() {
return {
token: '',
imgShow: true,
requestUrl: baseUrl + '/common/upload',
imgType: 'jpg,png,gif',
imgList: [],
fileList: [],
hideRequiredAsterisk: false,
classDataTree: [],
info: {
info: {
classificationDataCode: '',
contactUser: '',
phone: '',
title: '',
location: '',
longitude: '',
latitude: '',
description: '',
pictureUrlList: ''
},
rules: {
classificationDataCode: {
required: true,
message: '请选择警情分类'
},
contactUser: {
required: true,
message: '请输入联系人'
},
phone: {
required: true,
message: '请输入电话'
},
title: {
required: true,
message: '请输入标题'
},
location: {
required: true,
message: '请选择位置'
},
description: {
required: true,
message: '请输入描述'
}
}
};
},
onShow() {
uni.$off('event');
uni.$on('event', (value) => {
contactUser: '',
phone: '',
title: '',
@ -126,29 +80,29 @@
description: '',
pictureUrlList: ''
},
};
},
onShow() {
uni.$off('event');
uni.$on('event', (value) => {
// console.log(value); // some value
(this.info.longitude = value.longitude.toFixed(2)),
(this.info.longitude = value.longitude.toFixed(2)),
(this.info.latitude = value.latitude.toFixed(2)),
(this.info.location = value.longitude.toFixed(2) + ',' + value.latitude.toFixed(2));
})
})
this.token = getToken();
this.getWaringList();
// console.log(this.token)
},
mounted() {
this.$refs.form.setRules(this.rules);
},
mounted() {
this.$refs.form.setRules(this.rules);
},
methods: {
},
methods: {
//
updateImgList(val) {
console.log(val);
@ -167,33 +121,33 @@
},
onnodeclick(e) {
console.log('nodeclick', e);
},
onpopupopened(e) {
console.log('onpopupopened');
},
onpopupclosed(e) {
console.log('onpopupclosed');
},
onchange(e) {
console.log('onchange', e.detail.value);
},
inputclick(e) {
console.log('inputclick');
},
getLocation() {
uni.navigateTo({
url: 'map'
});
},
onnodeclick(e) {
console.log('nodeclick', e);
},
onpopupopened(e) {
console.log('onpopupopened');
},
onpopupclosed(e) {
console.log('onpopupclosed');
},
onchange(e) {
console.log('onchange', e.detail.value);
},
inputclick(e) {
console.log('inputclick');
},
getLocation() {
uni.navigateTo({
url: 'map'
});
},
save() {
let this_ = this
save() {
let this_ = this
this.info.pictureUrlList = this.imgList;
this.$refs.form.validate((res) => {
if (res) {
this.info.pictureUrlList = this.imgList;
this.$refs.form.validate((res) => {
if (res) {
//
eventReport(this.info).then(resp => {
if (resp.code == 200) {
@ -203,11 +157,11 @@
}
})
} else {
uni.showToast({
uni.showToast({
title: '验证失败'
});
}
});
});
}
});
},
//
getWaringList() {
@ -232,7 +186,9 @@
var sonObj = {
text: sonItem.classificationName,
value: sonItem.classificationCode
}
}
obj.children.push(sonObj);
});
}
@ -244,39 +200,39 @@
})
},
}
};
}
};
</script>
<style lang="scss" scoped>
.evan-form-show__button {
position: fixed;
bottom: 20rpx;
width: 94%;
transform: translateX(3%);
background-color: rgb(54, 127, 255);
color: #eee;
}
.evan-form-show__button {
position: fixed;
bottom: 20rpx;
width: 94%;
transform: translateX(3%);
background-color: rgb(54, 127, 255);
color: #eee;
}
.uni-input-placeholder {
font-size: 24rpx
.uni-input-placeholder {
font-size: 24rpx
}
.set-position {
position: absolute;
right: 20rpx;
}
.form-input {
width: 95%;
}
.tree-pick {
width: 95%;
}
.title-pic {
padding: 10px 21px;
color: #4d4d4d;
}
.set-position {
position: absolute;
right: 20rpx;
}
.form-input {
width: 95%;
}
.tree-pick {
width: 95%;
}
.title-pic {
padding: 10px 21px;
color: #4d4d4d;
}
</style>

@ -5,12 +5,10 @@
<evan-form ref="form" :hide-required-asterisk="hideRequiredAsterisk" :model="info">
<view class="body-item">
<evan-form-item label="资源名称:">
<input v-model="info.resourceName" class="form-input" placeholder="请输入资源名称"
placeholder-class="form-input-placeholder" />
<input v-model="info.resourceName" class="form-input" placeholder="请输入资源名称" placeholder-class="form-input-placeholder" />
</evan-form-item>
<evan-form-item label="是否推荐:">
<input v-model="info.ifRecommend" class="form-input" placeholder="请输入"
placeholder-class="form-input-placeholder" />
<uni-data-select v-model="info.ifRecommend" :localdata="range" @change="change"></uni-data-select>
</evan-form-item>
<evan-form-item label="景点排序:">
<uni-number-box v-model="vModelValue" @blur="blur" @focus="focus" @change="changeValue" />
@ -33,14 +31,20 @@
</view>
<view class="body-item">
<view class="title-pic">资源描述</view>
<textarea class="area-text" v-model="info.resourceDescribe" @blur="bindTextAreaBlur"
auto-height />
<textarea class="area-text" v-model="info.resourceDescribe" @blur="bindTextAreaBlur" auto-height />
</view>
<view class="body-item">
<view class="title-pic">图片</view>
<w-upload ref="wUpload" :token="token" :imgShow="imgShow" :requestUrl="requestUrl"
:imgType="imgType" @updateImgList="updateImgList" :imgList="imgList"
@imgSuccess="imgSuccess"></w-upload>
<w-upload
ref="wUpload"
:token="token"
:imgShow="imgShow"
:requestUrl="requestUrl"
:imgType="imgType"
@updateImgList="updateImgList"
:imgList="imgList"
@imgSuccess="imgSuccess"
></w-upload>
</view>
<view class="body-item">
<audio-upload :title="'语音讲解'" :url="info.mp3Url" @fileSuccess="fileSuccess"></audio-upload>
@ -54,16 +58,12 @@
</template>
<script>
import {
scenicSpotById,updateScenicSpotSortList
} from '@/api/word/attractionsEditor.js'
import audioUpload from '@/components/audio-unpload/audioUpload.vue';
import wUpload from '@/components/file-img-upload/w-upload.vue';
import {
getToken
} from '@/utils/auth.js';
import config from '@/config.js';
const baseUrl = config.baseUrl;
import audioUpload from '@/components/audio-unpload/audioUpload.vue';
import wUpload from '@/components/file-img-upload/w-upload.vue';
import { getToken } from '@/utils/auth.js';
import config from '@/config.js';
const baseUrl = config.baseUrl;
export default {
components: { audioUpload, wUpload },
@ -100,90 +100,54 @@ export default {
},
onShow() {
this.token = getToken();
export default {
components: {
audioUpload,
wUpload
},
data() {
return {
token: '',
imgShow: true,
requestUrl: baseUrl + '/common/upload',
imgType: 'jpg,png,gif',
imgList: [],
hideRequiredAsterisk: false,
vModelValue: 3,
id:0,
info: {
id: 24,
resourceCode: 751783303501053953,
resourceName: '达摩院',
openTime: '08:00-16:30',
scenicArea: '少林景区',
introduction: '简介',
resourceDescribe: '描述',
imageUrl: 'www.baidu.com',
mp3Url: 'www.baidu.com',
videoUrl: 'www.baidu.com'
}
};
},
onShow() {
this.token = getToken();
console.log(this.token);
},
onLoad(option){
console.log(option)
this.id = option.id
this.scenicSpotById(this.id);
},
mounted() {
this.$refs.form.setRules(this.rules);
//
var arr = [];
if (this.classDataTree && this.classDataTree.length > 0) {
this.classDataTree.forEach((item) => {
console.log(item);
var obj = {
text: item.classificationName,
value: item.classificationCode,
children: []
};
if (item.list && item.list.length > 0) {
item.list.forEach((sonItem) => {
var sonObj = {
text: sonItem.classificationName,
value: sonItem.classificationCode
};
console.log(this.token);
},
mounted() {
this.$refs.form.setRules(this.rules);
//
var arr = [];
if (this.classDataTree && this.classDataTree.length > 0) {
this.classDataTree.forEach((item) => {
console.log(item);
var obj = {
text: item.classificationName,
value: item.classificationCode,
children: []
};
if (item.list && item.list.length > 0) {
item.list.forEach((sonItem) => {
var sonObj = {
text: sonItem.classificationName,
value: sonItem.classificationCode
};
obj.children.push(sonObj);
});
}
arr.push(obj);
});
}
obj.children.push(sonObj);
});
}
arr.push(obj);
});
}
this.classDataTree = arr;
this.classDataTree = arr;
},
methods: {
//
updateImgList(val) {
console.log(val);
this.imgList.forEach((i, j) => {
if (j == val[0]) {
this.imgList.splice(j, 1);
this.$forceUpdate(); //
}
});
},
//
imgSuccess(val) {
console.log(val);
this.imgList.push(val);
this.$forceUpdate(); //
},
methods: {
//
updateImgList(val) {
console.log(val);
this.imgList.forEach((i, j) => {
if (j == val[0]) {
this.imgList.splice(j, 1);
this.$forceUpdate(); //
}
});
},
//
imgSuccess(val) {
console.log(val);
this.imgList.push(val);
this.$forceUpdate(); //
},
bindTimeChange: function (e) {
this.startTime = e.detail.value;
@ -218,114 +182,80 @@ export default {
url: 'map'
});
},
onnodeclick(e) {
console.log('nodeclick', e);
},
onpopupopened(e) {
console.log('onpopupopened');
},
onpopupclosed(e) {
console.log('onpopupclosed');
},
onchange(e) {
console.log('onchange', e.detail.value);
},
inputclick(e) {
console.log('inputclick');
},
getLocation() {
uni.navigateTo({
url: 'map'
});
},
changeValue(value) {
console.log('返回数值:', value);
},
blur(e) {
console.log('blur:', e);
},
focus(e) {
console.log('focus:', e);
},
save() {
let this_ = this;
this.info.pictureUrlList = this.imgList;
this.$refs.form.validate((res) => {
if (res) {
console.log(this.info)
updateScenicSpotSortList(this.info).then(res =>{
if(res.code ==200){
uni.showToast({
title: '编辑成功'
});
}
})
changeValue(value) {
console.log('返回数值:', value);
},
blur(e) {
console.log('blur:', e);
},
focus(e) {
console.log('focus:', e);
},
}
});
},
scenicSpotById() {
scenicSpotById(this.id).then(res => {
this.info = res.data
})
},
fileSuccess(val) {
if (val) {
console.log(val);
save() {
let this_ = this;
this.info.openTime = this.startTime+"-"+this.endTime
console.log(this.info.openTime)
this.info.pictureUrlList = this.imgList;
this.$refs.form.validate((res) => {
if (res) {
uni.showToast({
title: '验证通过'
});
}
});
},
fileSuccess(val) {
if (val) {
console.log(val);
}
}
};
}
};
</script>
<style lang="scss" scoped>
.evan-form-show__button {
position: fixed;
bottom: 20rpx;
width: 94%;
transform: translateX(3%);
background-color: rgb(54, 127, 255);
color: #eee;
}
.evan-form-show__button {
position: fixed;
bottom: 20rpx;
width: 94%;
transform: translateX(3%);
background-color: rgb(54, 127, 255);
color: #eee;
}
.uni-input-placeholder {
font-size: 24rpx;
}
.set-position {
position: absolute;
right: 20rpx;
}
.form-input {
width: 95%;
}
.tree-pick {
width: 95%;
}
.uni-input-placeholder {
font-size: 24rpx;
}
::v-deep .evan-form-item-container__label {
padding-left: 20rpx;
text-align-last: unset;
width: 22%;
}
.set-position {
position: absolute;
right: 20rpx;
}
.form-input {
width: 95%;
}
.tree-pick {
width: 95%;
}
::v-deep .evan-form-item-container__label {
padding-left: 20rpx;
text-align-last: unset;
width: 22%;
}
.title-pic {
padding: 10px 15px;
color: #4d4d4d;
}
.area-text {
height: auto;
width: 90%;
min-height: 50rpx;
margin: 0 5%;
padding: 10rpx;
border-radius: 10rpx;
background-color: #eee;
}
.title-pic {
padding: 10px 15px;
color: #4d4d4d;
}
.area-text {
height: auto;
width: 90%;
min-height: 50rpx;
margin: 0 5%;
padding: 10rpx;
border-radius: 10rpx;
background-color: #eee;
}
</style>

@ -74,11 +74,12 @@ export default {
});
},
toEdit(item){
uni.navigateTo({
url:'/pages/work/scenicSpot/attractionsEditor?id='+item
})
},
toEdit() {
uni.navigateTo({
url: 'attractionsEditor'
})
},
//
isRequest() {

@ -1,103 +1,80 @@
<template>
<view>
<HM-dragSorts class="sort-box" ref="dragSorts" :list="list" :autoScroll="true" :feedbackGenerator="true"
:listHeight="300" :rowHeight="55" @confirm="confirm"></HM-dragSorts>
<HM-dragSorts class="sort-box" ref="dragSorts" :list="list" :autoScroll="true" :feedbackGenerator="true" :listHeight="300" :rowHeight="55" @confirm="confirm"></HM-dragSorts>
</view>
</template>
<script>
import {
scenicSpotSortList,updateScenicSpotSortList
} from '@/api/word/sort.js'
export default {
data() {
return {
list: [],
datas: [
// {
// id: 25,
// resourceCode: 770931335345733632,
// resourceName: '',
// sort: null
// },
// {
// id: 24,
// resourceCode: 751783303501053953,
// resourceName: '',
// sort: 1
// },
// {
// id: 1,
// resourceCode: 751783303501053952,
// resourceName: '',
// sort: 1
// }
]
export default {
data() {
return {
list: [],
datas: [
{
id: 25,
resourceCode: 770931335345733632,
resourceName: '三黄寨',
sort: null
},
{
id: 24,
resourceCode: 751783303501053953,
resourceName: '达摩院',
sort: 1
},
{
id: 1,
resourceCode: 751783303501053952,
resourceName: '初祖庵',
sort: 1
}
]
};
},
mounted() {
var obj = {};
this.list = [];
this.datas.forEach((item) => {
obj = {
name: item.resourceName,
sort: item.sort,
id: item.id
};
},
onShow() {
this.scenicSpotSortList();
},
mounted() {
var obj = {};
this.list = [];
this.datas.forEach((item) => {
obj = {
name: item.resourceName,
sort: item.sort,
id: item.id
};
this.list.push(obj);
});
this.list.push(obj);
});
},
methods: {
change(e) {
console.log('=== change start ===');
console.log('被拖拽行: ', JSON.stringify(e.moveRow));
console.log('原始下标: ', e.index);
console.log('被拖拽到: ', e.moveTo);
console.log('=== change end ===');
},
methods: {
change(e) {
console.log('=== change start ===');
console.log('被拖拽行: ', JSON.stringify(e.moveRow));
console.log('原始下标: ', e.index);
console.log('被拖拽到: ', e.moveTo);
console.log('=== change end ===');
},
confirm(e) {
console.log('=== confirm start ===');
console.log('被拖拽行: ', JSON.stringify(e.moveRow));
console.log('原始下标: ', e.index);
console.log('被拖拽到: ', e.moveTo);
console.log('排序后的list: ', e.list);
// listlist
// listlistlistlist
console.log('=== confirm end ===');
this.updateScenicSpotSortList(e.list);
this.scenicSpotSortList();
},
scenicSpotSortList() {
scenicSpotSortList().then(res => {
this.datas = res.data;
})
},
updateScenicSpotSortList(query) {
updateScenicSpotSortList(query).then(res => {
if(res.code !=200){
uni.showToast({
title: '排序失败'
});
}
})
}
confirm(e) {
console.log('=== confirm start ===');
console.log('被拖拽行: ', JSON.stringify(e.moveRow));
console.log('原始下标: ', e.index);
console.log('被拖拽到: ', e.moveTo);
console.log('排序后的list: ', e.list);
// listlist
// listlistlistlist
console.log('=== confirm end ===');
}
};
}
};
</script>
<style lang="stylus">
// .sort-box{
::v-deep .HM-drag-sort {
height: fit-content !important;
.color {
::v-deep .HM-drag-sort{
height: fit-content !important;
.color{
height: fit-content !important;
}
}
}
// }
</style>
</style>

Loading…
Cancel
Save