Commit caf2d5f0dac77309c35eb17d8ea84d0750bdeab8

Authored by 夏洋涛
1 parent c72c87c8
Exists in master

feat:意见反馈修改

src/views/GrowUp/MyAlbum.vue
@@ -2,10 +2,16 @@ @@ -2,10 +2,16 @@
2 <div id="MyAlbum"> 2 <div id="MyAlbum">
3 <div class="photo_box"> 3 <div class="photo_box">
4 <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="getUserAlbum"> 4 <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="getUserAlbum">
5 - <div class="day_box" v-for="(dayItem,dayIndex) in photoArr" :key="dayIndex">  
6 - <p class="day_time">{{dayItem.time}}</p>  
7 - <div class="item" v-for="(item,index) in dayItem.photos" :key="index" :style="'background-image:url('+item.img+')'" @click="handlePhoto(dayIndex,index)">  
8 - <div class="check_icon" :class="item.checked?'checked':''" v-if="controlStatus=='del'"> 5 + <div class="day_box" v-for="(dayItem, dayIndex) in photoArr" :key="dayIndex">
  6 + <p class="day_time">{{ dayItem.time }}</p>
  7 + <div
  8 + class="item"
  9 + v-for="(item, index) in dayItem.photos"
  10 + :key="index"
  11 + :style="'background-image:url(' + item.img + ')'"
  12 + @click="handlePhoto(dayIndex, index)"
  13 + >
  14 + <div class="check_icon" :class="item.checked ? 'checked' : ''" v-if="controlStatus == 'del'">
9 <van-icon class="icon" name="success" /> 15 <van-icon class="icon" name="success" />
10 </div> 16 </div>
11 </div> 17 </div>
@@ -13,22 +19,22 @@ @@ -13,22 +19,22 @@
13 </van-list> 19 </van-list>
14 </div> 20 </div>
15 <div class="control_panel"> 21 <div class="control_panel">
16 - <p class="control_btn" @click="controlStatus='control'" v-if="controlStatus=='default'">管理相册({{spaceSize}}/2G)</p>  
17 - <div class="control_box" v-if="controlStatus=='control'"> 22 + <p class="control_btn" @click="controlStatus = 'control'" v-if="controlStatus == 'default'">管理相册({{ spaceSize }}/2G)</p>
  23 + <div class="control_box" v-if="controlStatus == 'control'">
18 <van-uploader multiple :after-read="afterRead"> 24 <van-uploader multiple :after-read="afterRead">
19 <div class="btn add"> 25 <div class="btn add">
20 <van-icon class="icon" name="add-o" /> 26 <van-icon class="icon" name="add-o" />
21 <p class="text">添加</p> 27 <p class="text">添加</p>
22 </div> 28 </div>
23 </van-uploader> 29 </van-uploader>
24 - <div class="btn del" @click="controlStatus='del'"> 30 + <div class="btn del" @click="controlStatus = 'del'">
25 <van-icon class="icon" name="delete-o" /> 31 <van-icon class="icon" name="delete-o" />
26 <p class="text">删除</p> 32 <p class="text">删除</p>
27 </div> 33 </div>
28 - <van-button class="blue_btn" type="info" round color="#3074FF" @click="controlStatus='default'">完成</van-button> 34 + <van-button class="blue_btn" type="info" round color="#3074FF" @click="controlStatus = 'default'">完成</van-button>
29 </div> 35 </div>
30 - <p class="cancel_btn" @click="controlStatus='control'" v-if="controlStatus=='del'">取消</p>  
31 - <p class="del_btn" @click="handleDel" v-if="controlStatus=='del'">删除相片</p> 36 + <p class="cancel_btn" @click="controlStatus = 'control'" v-if="controlStatus == 'del'">取消</p>
  37 + <p class="del_btn" @click="handleDel" v-if="controlStatus == 'del'">删除相片</p>
32 </div> 38 </div>
33 <van-image-preview v-model="showPreview" :images="previewArr" :start-position="startPosition" @change="previewChange"> 39 <van-image-preview v-model="showPreview" :images="previewArr" :start-position="startPosition" @change="previewChange">
34 </van-image-preview> 40 </van-image-preview>
@@ -37,11 +43,11 @@ @@ -37,11 +43,11 @@
37 <script> 43 <script>
38 import Axios from 'axios' 44 import Axios from 'axios'
39 export default { 45 export default {
40 - data () { 46 + data() {
41 return { 47 return {
42 userInfo: '', 48 userInfo: '',
43 - photoArr: [],//照片数组  
44 - total: '',//照片总数 49 + photoArr: [], //照片数组
  50 + total: '', //照片总数
45 showPreview: false, 51 showPreview: false,
46 startPosition: 0, 52 startPosition: 0,
47 previewIndex: 0, 53 previewIndex: 0,
@@ -50,16 +56,16 @@ export default { @@ -50,16 +56,16 @@ export default {
50 pageNum: 1, 56 pageNum: 1,
51 loading: false, 57 loading: false,
52 finished: false, 58 finished: false,
53 - controlStatus: 'default',//默认状态:default 管理状态:control 删除状态:del  
54 - delIds: [],//需要删除的图片id数组  
55 - uploadImgList: [],//上传图片数组  
56 - spaceSize:[],//用户空间 59 + controlStatus: 'default', //默认状态:default 管理状态:control 删除状态:del
  60 + delIds: [], //需要删除的图片id数组
  61 + uploadImgList: [], //上传图片数组
  62 + spaceSize: [], //用户空间
57 } 63 }
58 }, 64 },
59 - mounted () {  
60 - var userInfo = localStorage.getItem('userInfo'); 65 + mounted() {
  66 + var userInfo = localStorage.getItem('userInfo')
61 if (userInfo) { 67 if (userInfo) {
62 - this.userInfo = JSON.parse(userInfo); 68 + this.userInfo = JSON.parse(userInfo)
63 } 69 }
64 70
65 // this.getUserAlbum()//获取当前用户相关的商户相册 71 // this.getUserAlbum()//获取当前用户相关的商户相册
@@ -67,50 +73,56 @@ export default { @@ -67,50 +73,56 @@ export default {
67 }, 73 },
68 methods: { 74 methods: {
69 //获取当前用户相关的商户相册 75 //获取当前用户相关的商户相册
70 - getUserAlbum () {  
71 - this.loading = true;  
72 - this.yxAxios.post(`${this.proxyUrl}/api/growth/photo/userAlbum`,{  
73 - "centerNo": this.userInfo.centerNo,  
74 - pageSize: this.pageSize,  
75 - pageNum: this.pageNum,  
76 - }).then((res) => {  
77 - console.log('相册详情:', res)  
78 - this.loading = false  
79 - if (res.data.code == 200) {  
80 - this.formatPhoto(res.data.rows)  
81 - this.total = res.data.total  
82 - if (this.pageSize * this.pageNum >= res.data.total) {  
83 - this.finished = true 76 + getUserAlbum() {
  77 + this.loading = true
  78 + this.yxAxios
  79 + .post(`${this.proxyUrl}/api/growth/photo/userAlbum`, {
  80 + centerNo: this.userInfo.centerNo,
  81 + pageSize: this.pageSize,
  82 + pageNum: this.pageNum,
  83 + })
  84 + .then((res) => {
  85 + console.log('相册详情:', res)
  86 + this.loading = false
  87 + if (res.data.code == 200) {
  88 + this.formatPhoto(res.data.rows)
  89 + this.total = res.data.total
  90 + if (this.pageSize * this.pageNum >= res.data.total) {
  91 + this.finished = true
  92 + } else {
  93 + this.pageNum++
  94 + }
84 } else { 95 } else {
85 - this.pageNum++ 96 + // this.$toast(res.data.message);
  97 + console.log(res.data.message)
86 } 98 }
87 - } else {  
88 - this.$toast(res.data.message);  
89 - }  
90 - }) 99 + })
91 }, 100 },
92 // 获取用户空间大小 101 // 获取用户空间大小
93 - getUserSpaceSize () {  
94 - this.yxAxios.post(`${this.proxyUrl}/api/growth/photo/getUserSpaceSize`,{  
95 - "centerNo": this.userInfo.centerNo,  
96 - }).then((res) => {  
97 - console.log('空间大小:', res)  
98 - if (res.data.code == 200) {  
99 - const sizeM = res.data.data/1024/1024;  
100 - if(sizeM/1024>1000){  
101 - this.spaceSize = (sizeM/1024).toFixed(2)+'G'  
102 - }else{  
103 - this.spaceSize = (sizeM).toFixed(2)+'M' 102 + getUserSpaceSize() {
  103 + this.yxAxios
  104 + .post(`${this.proxyUrl}/api/growth/photo/getUserSpaceSize`, {
  105 + centerNo: this.userInfo.centerNo,
  106 + })
  107 + .then((res) => {
  108 + console.log('空间大小:', res)
  109 + if (res.data.code == 200) {
  110 + const sizeM = res.data.data / 1024 / 1024
  111 + if (sizeM / 1024 > 1000) {
  112 + this.spaceSize = (sizeM / 1024).toFixed(2) + 'G'
  113 + } else {
  114 + this.spaceSize = sizeM.toFixed(2) + 'M'
  115 + }
  116 + console.log(this.spaceSize)
  117 + } else {
  118 + // this.$toast(res.data.message);
  119 + console.log(res.data.message)
104 } 120 }
105 - console.log(this.spaceSize)  
106 - } else {  
107 - this.$toast(res.data.message);  
108 - }  
109 - }) 121 + })
110 }, 122 },
111 // 处理照片数组 123 // 处理照片数组
112 - formatPhoto (data) {  
113 - let photoArr = this.photoArr; 124 + formatPhoto(data) {
  125 + let photoArr = this.photoArr
114 var weekArr = ['一', '二', '三', '四', '五', '六', '日'] 126 var weekArr = ['一', '二', '三', '四', '五', '六', '日']
115 for (let i in data) { 127 for (let i in data) {
116 let week = this.Moment(data[i].createTime).isoWeekday() 128 let week = this.Moment(data[i].createTime).isoWeekday()
@@ -119,14 +131,14 @@ export default { @@ -119,14 +131,14 @@ export default {
119 if (photoArr.length == 0) { 131 if (photoArr.length == 0) {
120 photoArr.push({ 132 photoArr.push({
121 time: data[i].time, 133 time: data[i].time,
122 - photos: [data[i]] 134 + photos: [data[i]],
123 }) 135 })
124 } else if (photoArr[photoArr.length - 1].time == data[i].time) { 136 } else if (photoArr[photoArr.length - 1].time == data[i].time) {
125 photoArr[photoArr.length - 1].photos.push(data[i]) 137 photoArr[photoArr.length - 1].photos.push(data[i])
126 } else { 138 } else {
127 photoArr.push({ 139 photoArr.push({
128 time: data[i].time, 140 time: data[i].time,
129 - photos: [data[i]] 141 + photos: [data[i]],
130 }) 142 })
131 } 143 }
132 } 144 }
@@ -134,11 +146,11 @@ export default { @@ -134,11 +146,11 @@ export default {
134 this.photoArr = photoArr 146 this.photoArr = photoArr
135 }, 147 },
136 // 预览图切换 148 // 预览图切换
137 - previewChange (index) { 149 + previewChange(index) {
138 this.previewIndex = index 150 this.previewIndex = index
139 }, 151 },
140 // 点击照片 152 // 点击照片
141 - handlePhoto (dayIndex, index) { 153 + handlePhoto(dayIndex, index) {
142 // 先判断状态,删除操作时为选择图片,默认状态为预览图片操作,操作状态不触发事件 154 // 先判断状态,删除操作时为选择图片,默认状态为预览图片操作,操作状态不触发事件
143 if (this.controlStatus == 'del') { 155 if (this.controlStatus == 'del') {
144 this.photoArr[dayIndex].photos[index].checked = !this.photoArr[dayIndex].photos[index].checked 156 this.photoArr[dayIndex].photos[index].checked = !this.photoArr[dayIndex].photos[index].checked
@@ -150,14 +162,14 @@ export default { @@ -150,14 +162,14 @@ export default {
150 this.previewArr = previewArr 162 this.previewArr = previewArr
151 this.startPosition = index 163 this.startPosition = index
152 this.previewIndex = index 164 this.previewIndex = index
153 - this.showPreview = true; 165 + this.showPreview = true
154 } 166 }
155 }, 167 },
156 168
157 // 点击删除照片 169 // 点击删除照片
158 - handleDel () { 170 + handleDel() {
159 // 计算需要删除的图片 171 // 计算需要删除的图片
160 - let delIds = []; 172 + let delIds = []
161 for (let i in this.photoArr) { 173 for (let i in this.photoArr) {
162 for (let j in this.photoArr[i].photos) { 174 for (let j in this.photoArr[i].photos) {
163 if (this.photoArr[i].photos[j].checked) { 175 if (this.photoArr[i].photos[j].checked) {
@@ -169,67 +181,68 @@ export default { @@ -169,67 +181,68 @@ export default {
169 if (this.delIds.length == 0) { 181 if (this.delIds.length == 0) {
170 this.$toast('请至少选择一张照片') 182 this.$toast('请至少选择一张照片')
171 } else { 183 } else {
172 - this.$dialog.confirm({  
173 - title: '警告',  
174 - message: '确认删除照片?',  
175 - }) 184 + this.$dialog
  185 + .confirm({
  186 + title: '警告',
  187 + message: '确认删除照片?',
  188 + })
176 .then(() => { 189 .then(() => {
177 this.delPhotoByIds() 190 this.delPhotoByIds()
178 }) 191 })
179 .catch(() => { 192 .catch(() => {
180 // on cancel 193 // on cancel
181 - }); 194 + })
182 } 195 }
183 }, 196 },
184 // 删除照片操作 197 // 删除照片操作
185 - delPhotoByIds () { 198 + delPhotoByIds() {
186 this.$toast.loading({ 199 this.$toast.loading({
187 message: '正在删除...', 200 message: '正在删除...',
188 duration: 0, 201 duration: 0,
189 - forbidClick: true 202 + forbidClick: true,
190 }) 203 })
191 this.http.removePersonPhoto(this.delIds.join(',')).then((res) => { 204 this.http.removePersonPhoto(this.delIds.join(',')).then((res) => {
192 this.$toast.clear() 205 this.$toast.clear()
193 if (res.code == 200) { 206 if (res.code == 200) {
194 - this.$toast('删除成功');  
195 - this.controlStatus = 'control';  
196 - this.pageReload()//删除成功后页面重新加载 207 + this.$toast('删除成功')
  208 + this.controlStatus = 'control'
  209 + this.pageReload() //删除成功后页面重新加载
197 } else { 210 } else {
198 - this.$toast(res.message); 211 + this.$toast(res.message)
199 } 212 }
200 }) 213 })
201 }, 214 },
202 // 页面数据重新加载 215 // 页面数据重新加载
203 - pageReload () {  
204 - this.pageNum = 1;  
205 - this.finished = false;  
206 - this.photoArr = []; 216 + pageReload() {
  217 + this.pageNum = 1
  218 + this.finished = false
  219 + this.photoArr = []
207 this.getUserAlbum() 220 this.getUserAlbum()
208 this.getUserSpaceSize() 221 this.getUserSpaceSize()
209 }, 222 },
210 // 读取到文件后 223 // 读取到文件后
211 - afterRead (file) { 224 + afterRead(file) {
212 if (Array.isArray(file)) { 225 if (Array.isArray(file)) {
213 this.fileUpload(file, 0) 226 this.fileUpload(file, 0)
214 } else { 227 } else {
215 this.fileUpload([file], 0) 228 this.fileUpload([file], 0)
216 -  
217 } 229 }
218 }, 230 },
219 // 上传照片到文件服务器 231 // 上传照片到文件服务器
220 - fileUpload (files, index) { 232 + fileUpload(files, index) {
221 this.$toast.loading({ 233 this.$toast.loading({
222 message: `上传中 ${index + 1}/${files.length}...`, 234 message: `上传中 ${index + 1}/${files.length}...`,
223 duration: 0, 235 duration: 0,
224 - forbidClick: true 236 + forbidClick: true,
225 }) 237 })
226 let size = files[index].file.size 238 let size = files[index].file.size
227 let params = new FormData() 239 let params = new FormData()
228 params.append('file', files[index].file, files[index].file.name) 240 params.append('file', files[index].file, files[index].file.name)
229 let config = { 241 let config = {
230 - headers: { //添加请求头  
231 - 'Content-Type': 'multipart/form-data'  
232 - } 242 + headers: {
  243 + //添加请求头
  244 + 'Content-Type': 'multipart/form-data',
  245 + },
233 } 246 }
234 Axios.post('https://market.myjxt.com:51311/file/fileUpload', params, config).then((res) => { 247 Axios.post('https://market.myjxt.com:51311/file/fileUpload', params, config).then((res) => {
235 this.$toast.clear() 248 this.$toast.clear()
@@ -247,27 +260,29 @@ export default { @@ -247,27 +260,29 @@ export default {
247 }) 260 })
248 }, 261 },
249 // 上传照片 262 // 上传照片
250 - uploadUserAlbum () { 263 + uploadUserAlbum() {
251 this.$toast.loading({ 264 this.$toast.loading({
252 message: `同步照片到我的相册...`, 265 message: `同步照片到我的相册...`,
253 duration: 0, 266 duration: 0,
254 - forbidClick: true 267 + forbidClick: true,
255 }) 268 })
256 - this.http.uploadUserAlbum({  
257 - "centerNo": this.userInfo.centerNo,  
258 - "imgList": this.uploadImgList  
259 - }).then((res) => {  
260 - this.$toast.clear()  
261 - if (res.code == 200) {  
262 - this.$toast('同步完成');  
263 - this.uploadImgList = [];  
264 - this.pageReload()//上传完成后页面重新加载  
265 - } else {  
266 - this.$toast(res.message);  
267 - }  
268 - })  
269 - }  
270 - } 269 + this.http
  270 + .uploadUserAlbum({
  271 + centerNo: this.userInfo.centerNo,
  272 + imgList: this.uploadImgList,
  273 + })
  274 + .then((res) => {
  275 + this.$toast.clear()
  276 + if (res.code == 200) {
  277 + this.$toast('同步完成')
  278 + this.uploadImgList = []
  279 + this.pageReload() //上传完成后页面重新加载
  280 + } else {
  281 + this.$toast(res.message)
  282 + }
  283 + })
  284 + },
  285 + },
271 } 286 }
272 </script> 287 </script>
273 <style lang="scss"> 288 <style lang="scss">
@@ -394,7 +409,9 @@ export default { @@ -394,7 +409,9 @@ export default {
394 <style lang="scss"> 409 <style lang="scss">
395 // 长辈版 410 // 长辈版
396 .elder { 411 .elder {
397 - #MyAlbum .control_panel .control_btn, #MyAlbum .control_panel .cancel_btn, #MyAlbum .control_panel .del_btn{ 412 + #MyAlbum .control_panel .control_btn,
  413 + #MyAlbum .control_panel .cancel_btn,
  414 + #MyAlbum .control_panel .del_btn {
398 font-size: 36px; 415 font-size: 36px;
399 } 416 }
400 } 417 }
src/views/Home/HomeYX.vue
@@ -45,13 +45,13 @@ @@ -45,13 +45,13 @@
45 </div> 45 </div>
46 <van-icon name="arrow" /> 46 <van-icon name="arrow" />
47 </div> 47 </div>
48 - <div class="item" @click="handleClearCache"> 48 + <!-- <div class="item" @click="handleClearCache">
49 <div class="left"> 49 <div class="left">
50 <van-icon class="icon" name="user-circle-o" /> 50 <van-icon class="icon" name="user-circle-o" />
51 <span>清除缓存</span> 51 <span>清除缓存</span>
52 </div> 52 </div>
53 <van-icon name="arrow" /> 53 <van-icon name="arrow" />
54 - </div> 54 + </div> -->
55 <div class="item" @click="handelElder"> 55 <div class="item" @click="handelElder">
56 <div class="left"> 56 <div class="left">
57 <van-icon class="icon" name="friends-o" /> 57 <van-icon class="icon" name="friends-o" />
src/views/Home/MyCollect.vue
@@ -39,7 +39,8 @@ export default { @@ -39,7 +39,8 @@ export default {
39 if (res.data.code == 200) { 39 if (res.data.code == 200) {
40 this.CollectList = res.data.rows 40 this.CollectList = res.data.rows
41 } else { 41 } else {
42 - this.$toast.fail(res.data.message) 42 + console.log(res.data.message)
  43 + // this.$toast.fail(res.data.message)
43 } 44 }
44 }) 45 })
45 }, 46 },
@@ -62,7 +63,10 @@ export default { @@ -62,7 +63,10 @@ export default {
62 } 63 }
63 }, 64 },
64 handleCourse(item) { 65 handleCourse(item) {
65 - this.$router.push({ name: 'ServiceAbroadDetail', query: { courseId: item.productId, publicName: localStorage.getItem('publicName') } }) 66 + this.$router.push({
  67 + name: 'ServiceAbroadDetail',
  68 + query: { courseId: item.productId, publicName: localStorage.getItem('publicName') },
  69 + })
66 }, 70 },
67 // 点击按钮取消收藏 71 // 点击按钮取消收藏
68 deleteCollect(index) { 72 deleteCollect(index) {
@@ -87,7 +91,8 @@ export default { @@ -87,7 +91,8 @@ export default {
87 this.$toast('取消收藏成功') 91 this.$toast('取消收藏成功')
88 this.getMyCollect() 92 this.getMyCollect()
89 } else { 93 } else {
90 - this.$toast.fail(res.data.message) 94 + console.log(res.data.message)
  95 + // this.$toast.fail(res.data.message)
91 } 96 }
92 }) 97 })
93 }, 98 },
@@ -147,7 +152,8 @@ export default { @@ -147,7 +152,8 @@ export default {
147 <style lang="scss"> 152 <style lang="scss">
148 // 长辈版 153 // 长辈版
149 .elder { 154 .elder {
150 - #MyCollect .collect_item .right .course_name,#MyCollect .collect_item .right .course_price{ 155 + #MyCollect .collect_item .right .course_name,
  156 + #MyCollect .collect_item .right .course_price {
151 font-size: 36px; 157 font-size: 36px;
152 } 158 }
153 } 159 }