update bug v1 20230628

master
hehang 2 years ago
parent 2c56905910
commit 45a157a1a8
  1. 4
      config.js
  2. 395
      pages/work/scenicSpot/scenicSpot.vue
  3. 18
      subPackWork/scenicAreaManagement/scenicAreaManagementEdit.vue
  4. 54
      subPackWork/scenicSpot/attractionsEditor.vue

@ -1,8 +1,8 @@
// 应用全局配置
module.exports = {
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
baseUrl: 'http://39.105.17.128:8096',
// baseUrl: 'http://localhost:8080',
// baseUrl: 'http://192.168.130.155:8080',
baseUrl: 'http://localhost:8080',
// 应用信息
appInfo: {
// 应用名称

@ -0,0 +1,395 @@
<template>
<view>
<view class="top">
<uni-search-bar class="search-bar" @confirm="search" :focus="true" v-model="searchValue" cancelButton="none" @clear="clear"></uni-search-bar>
<button class="no-margin-button" size="mini" @click="goSort">排序</button>
</view>
<view @touchstart="refreshStart" @touchmove="refreshMove" @touchend="refreshEnd">
<refresh ref="refresh" @isRefresh="isRefresh"></refresh>
<!-- list -->
<view>
<scroll-view class="scroll-body-design" scroll-y="true" @scrolltolower="lower1" scroll-with-animation>
<view style="width: 100%; height: 10rpx"></view>
<view class="card" v-for="(item, index) in list" v-if="list.length > 0" :key="index">
<view class="card-content">
<view class="images" v-if="item.imageUrl">
<image style="width: 180px; height: 180px; background-color: #eeeeee" :mode="'center'" :src="baseUrls + item.imageUrl.split(',')[0]"></image>
</view>
<view class="images" v-else>暂无图片</view>
<view class="introduce">
<view class="big-font">{{ item.resourceName || '/' }}</view>
<view class="small-font">所属景区{{ item.scenicArea || '/' }}</view>
<view class="small-font">开放时间{{ item.openTime || '/' }}</view>
</view>
</view>
<view class="small-btn">
<button class="mini-btn" type="default" @click="toEdit(item.id)" size="mini">编辑</button>
<button class="mini-btn" type="default" size="mini" @click="toRecommend(item)">{{item.ifRecommend=='0'?"推荐":"取消推荐"}}</button>
</view>
</view>
</scroll-view>
<!-- <view style="width: 100%;height: 100rpx;opacity:0;">底部占位盒子</view> -->
</view>
</view>
</view>
</template>
<script>
import util from '../util/util.js'
import refresh from '@/components/uni-list/refresh.vue';
import baseUrl from '@/config';
import {updateScenicSpotSortList} from '@/api/word/attractionsEditor.js';
import { getScenicSpotData } from '@/api/word/scenicSpot.js';
export default {
components: { refresh },
data() {
return {
currentPage: 'index',
toView: '',
list: [], //
baseUrls: '',
searchValue: '', //
pageNum: 1,
pageBottom: false //
};
},
created() {
this.baseUrls = baseUrl;
},
onLoad(e) {},
mounted() {
//
this.getScenicSpotData(null, 1, 10);
},
onShow() {},
onHide() {},
methods: {
goSort() {
uni.navigateTo({
url: 'sort'
});
},
toEdit(item){
uni.navigateTo({
url:'/pages/work/scenicSpot/attractionsEditor?id='+item
})
},
//
isRequest() {
return new Promise((resolve, reject) => {
this.pageNum++;
var that = this;
setTimeout(() => {
uni.hideLoading();
this.getScenicSpotData(this.searchValue, this.pageNum, 10);
// let newData = ['1','2','3']
// resolve(newData)
}, 500);
})
},
// util.throttle
lower1: util.throttle(function (e) {
if (this.pageBottom) {
return;
}
console.log(`加载${this.pageNum}`); //pageNum page
uni.showLoading({
title: '加载中',
mask: true
})
this.isRequest().then((res) => {
let tempList = this.list;
tempList[this.pageNum] = tempList[this.pageNum].concat(res);
this.list = tempList;
this.$forceUpdate(); //
});
}, 300),
// touch
refreshStart(e) {
this.$refs.refresh.refreshStart(e);
},
refreshMove(e) {
this.$refs.refresh.refreshMove(e);
},
refreshEnd(e) {
this.$refs.refresh.refreshEnd(e);
},
isRefresh() {
setTimeout(() => {
this.list = [];
this.pageBottom = false;
this.pageNum = 1;
this.getScenicSpotData(null, this.pageNum, 10);
uni.showToast({
icon: 'success',
title: '刷新成功'
});
this.$refs.refresh.endAfter(); //
}, 1000)
},
//
getScenicSpotData(resourceName, pageNum, pageSize) {
let data = {
resourceName: resourceName == null ? '' : resourceName,
pageNum: pageNum == null ? 1 : pageNum,
pageSize: pageSize == null ? 10 : pageSize
};
getScenicSpotData(data).then((res) => {
if (res.code === 200) {
res.rows.forEach((item) => {
this.list.push(item);
});
if (this.list.length === res.total) {
this.pageBottom = true;
}
}
});
},
toRecommend(item){
let ifrecommend = item.ifRecommend==0?"1":"0";
var query ={
id: item.id,
ifRecommend: ifrecommend
}
console.log(query)
updateScenicSpotSortList(query).then(res =>{
console.log(res)
if(res.code ==200){
if(query.ifRecommend==1){
uni.showToast({
title: '推荐成功'
});
}else{
uni.showToast({
title: '取消成功'
});
}
let _this = this;
this.list = [];
_this.isRequest()
}
})
},
//
goDetail(val) {
const id = val.id;
uni.navigateTo({
url: 'emergencyResourcesDetail?id=' + id
});
},
goDetails(val) {
uni.navigateTo({
url: 'emergencyResourcesList?code=' + val
});
},
search(res) {
console.log(res);
this.pageBottom = false;
this.pageNum = 1;
this.searchValue = res.value;
this.list = [];
this.getScenicSpotData(res.value, 1, 10);
},
clear(res) {
this.pageBottom = false;
this.pageNum = 1;
this.list = []
this.getScenicSpotData(null, 1, 10);
}
}
};
</script>
<style lang="scss" scoped>
::v-deep .uni-searchbar {
background: #fff;
}
.search-bar {
flex: 1;
}
.no-margin-button {
margin: 0;
}
.container999 {
width: 100vw;
font-size: 28rpx;
min-height: 100vh;
overflow: hidden;
color: #6b8082;
position: relative;
background-color: #f6f6f6;
}
.content {
width: 100%;
}
.card {
width: 100%;
height: 300rpx;
background-color: white;
margin: 0 auto 6rpx auto;
background: #ffffff;
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.1);
border-radius: 5px;
position: relative;
.card-content {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 32rpx;
.images {
width: 180rpx;
height: 180rpx;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
background-color: #eee;
}
.introduce {
flex: 1;
color: #000;
margin-left: 10px;
display: flex;
flex-direction: column;
justify-content: space-between;
overflow: hidden;
.big-font {
display: flex;
align-items: center;
margin-top: 8rpx;
.start {
display: inline-block;
border: solid 1px rgb(241, 150, 83);
border-radius: 20rpx;
color: rgb(241, 150, 83);
margin-left: 20rpx;
margin-top: 0;
padding: 2rpx 20rpx;
}
}
.small-font {
color: #909090;
margin-top: 14rpx;
}
}
.detail-button {
height: 64rpx;
font-size: 26rpx;
}
}
}
.noCard {
width: 100%;
height: 200rpx;
margin: auto;
background-color: white;
display: flex;
align-items: center;
justify-content: center;
color: #999999;
box-shadow: 0 0 10rpx 0 rgba(0, 0, 0, 0.1);
border-radius: 10rpx;
}
.nav {
position: fixed;
left: 0;
top: 9vh;
color: white;
width: 100%;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
font-size: 24rpx;
z-index: 996;
}
.searchInput999 {
width: 90%;
margin: 0 auto;
background: white;
border-radius: 30rpx;
display: flex;
align-items: center;
justify-content: center;
height: 56rpx;
}
.search999 {
width: 32rpx;
height: 32rpx;
}
.searchBox999 {
width: 56rpx;
height: 56rpx;
display: flex;
justify-content: center;
align-items: center;
}
.input999 {
color: #999;
width: 80%;
}
.small-btn {
float: right;
button {
margin-right: 25rpx;
}
}
.top {
display: flex;
align-items: center;
background: #fff;
padding: 0 20rpx 0 0;
width: 100%;
justify-content: space-between;
position: fixed;
top: 0;
z-index: 99;
.search-bar {
flex: 1;
position: unset;
}
}
.scroll-body-design {
height: 100vh;
margin-top: 55px;
}
</style>

@ -51,7 +51,7 @@
placeholder-class="form-input-placeholder" />
</evan-form-item>
<evan-form-item label="详细地址:">
<input v-model="info.resourceName" class="form-input" placeholder="请输入详细地址"
<input v-model="info.address" class="form-input" placeholder="请输入详细地址"
placeholder-class="form-input-placeholder" />
</evan-form-item>
</view>
@ -309,13 +309,21 @@
scenicManageDetail(id) {
scenicManageDetail(id).then((res) => {
if (res.code == 200) {
console.log(res.data)
this.info = res.data
this.startTime = res.data.openTime.split('-')[0]
this.endTime = res.data.openTime.split('-')[1]
if(res.data.openTime!=null){
this.startTime = res.data.openTime.split('-')[0]
this.endTime = res.data.openTime.split('-')[1]
}else{
this.startTime = ''
this.endTime = ''
}
this.selectMultiple.index = res.data.label.split(',');
this.form.selectIndex = res.data.label.split(',');
this.form.selectValue = res.data.labelValue.split(',');
this.index = res.data.grade
this.form.selectValue = res.data.labelValue;
console.log(this.form)
this.index = res.data.grade-1
let imgs = res.data.imageUrl;
if (imgs != null) {
this.imgList = imgs.split(',')

@ -38,7 +38,7 @@
<view class="v-card-item">
<view class="v-card-box">
<common-title :title="'资源描述'"></common-title>
<textarea class="area-text" v-model="info.resourceDescribe"
<textarea class="area-text" v-model="info.resourceDescribe"
auto-height />
</view>
</view>
@ -104,7 +104,7 @@
imgType: 'jpg,png,gif',
imgList: [],
hideRequiredAsterisk: false,
vModelValue: 3,
vModelValue: 1,
id: 0,
info: {
id: 24,
@ -117,7 +117,8 @@
resourceDescribe: '描述',
imageUrl: '',
mp3Url: '',
videoUrl: ''
videoUrl: '',
sort: ''
}
};
},
@ -251,15 +252,20 @@
let this_ = this;
this_.info.openTime = this_.startTime + "-" + this_.endTime
this_.info.imageUrl = this_.imgList.join(",");
this_.info.sort = this_.vModelValue;
this.$refs.form.validate((res) => {
if (res) {
console.log(this.info)
updateScenicSpotSortList(this.info).then(res => {
if (res.code == 200) {
uni.showToast({
title: '编辑成功'
});
}
setTimeout(() => {
uni.navigateTo({
url: '/pages/work/scenicSpot/scenicSpot'
})
}, 500)
})
}
@ -267,10 +273,12 @@
},
scenicSpotById(val) {
scenicSpotById(val).then(res => {
console.log(res)
this.info = res.data
this.startTime = res.data.openTime.split('-')[0]
this.endTime = res.data.openTime.split('-')[1]
this.info.ifRecommend = Number(res.data.ifRecommend)
this.vModelValue = res.data.sort
this.imgList = this.info.imageUrl.split(",");
})
},
@ -284,5 +292,41 @@
</script>
<style lang="scss" scoped>
.uni-input-placeholder {
font-size: 24rpx;
}
</style>
.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: #f3f3f3;
}
</style>

Loading…
Cancel
Save