This commit is contained in:
2020-07-07 17:47:00 +08:00
parent 77083c0404
commit 5ede514a02
8 changed files with 230 additions and 90 deletions

View File

@@ -1,7 +1,7 @@
<template>
<view class="edit-info">
<view class="user-info">
<view class="info-avatar">
<view class="info-avatar" @click="changeAvatar">
<u-avatar :src="avatar" :size="120"></u-avatar>
<view class="avatar-text">更换头像</view>
</view>
@@ -67,6 +67,25 @@ export default {
this.getUserInfo();
},
methods: {
changeAvatar() {
const url = this.$u.http.config.baseUrl + '/Upload/uploadfile';
uni.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
sourceType: ['album'],
success: (res) => {
this.avatar = res.tempFilePaths[0];
common.uploadFile({
url: url,
filePath: res.tempFilePaths[0]
}).then(result => {
this.avatar = result;
}, error => {
this.$u.toast(error);
})
}
});
},
getUserInfo() {
this.$u.api.getMemberInfo().then(res => {
if (res.errCode == 0) {

View File

@@ -1,19 +1,19 @@
<template>
<view class="complaints">
<view class="complaints-box">
<view class="complaints-box" v-for="item in feedbackList" :key="item.fb_id">
<view class="suggestions">
<view class="text">您的满意是对我们最大的支持茫茫德铭阳光之中能够遇到亲也是我们的荣幸</view>
<view class="text">{{ item.fb_content }}</view>
<view class="image">
<image v-for="(url, index) in imgList" :key="index" :src="url"></image>
<image v-for="(url, index) in item.fb_images" :key="index" :src="url"></image>
</view>
</view>
<view class="reply">
<view class="reply-title">后台回复</view>
<view class="reply-content u-line-4">您的满意是对我们最大的支持茫茫德铭阳光之中能够遇到亲也是我们的荣幸您的评价是对我们付出最好的认可我们会不断前行不忘初衷给亲们提供更好的服务和产品!我把对您的谢意写在纸上被风吹走了;我把对您的谢意写在沙滩上被海浪卷走了;我只好把对您的谢意写在解释里这样才会永驻心间!感谢您对的支持!加油!加油! 祝您生活愉快工作顺利期待我们下次合作愉快! ! !</view>
<view class="reply-content u-line-4">{{ item.reply_content }}</view>
</view>
<view class="date">
<image src="../static/mine/26.png"></image>
<view>2020-05-14</view>
<view>{{ reply_time }}</view>
</view>
</view>
</view>
@@ -27,7 +27,9 @@ export default {
require('../static/mine/23.png'),
require('../static/mine/23.png'),
require('../static/mine/23.png')
]
],
feedbackList: [],
page: 1, // 默认1
}
},
onNavigationBarButtonTap() {
@@ -35,6 +37,18 @@ export default {
url: '/pageE/more/WriteComments'
});
},
onShow() {
this.getFeedbackList();
},
methods: {
getFeedbackList() {
this.$u.api.getFeedbackList({ page: this.page }).then(res => {
if(res.errCode == 0) {
this.feedbackList = res.data.feedbackList;
}
})
},
},
}
</script>
<style lang="scss" scoped>

View File

@@ -3,8 +3,7 @@
<view class="main-container">
<textarea auto-height placeholder="发表您的意见吧,我们会做得更好." maxlength="200" v-model="text" />
<u-upload
ref="uUpload"
@on-uploaded="onUploaded"
ref="uUpload"
:custom-btn="true"
:max-count="count"
:auto-upload="false"
@@ -21,6 +20,7 @@
export default {
data() {
return {
action: $u.http.baseUrl + 'Upload/uploadfile',
count: 4, // 最大图片数量
text: '',
imageList: []
@@ -28,11 +28,33 @@ export default {
},
methods: {
submit() {
this.$refs.uUpload.upload();
console.log(this.action);
console.log(this.imageList);
// this.$refs.uUpload.upload();
let promise = [];
this.imageList.forEach(url => {
// this.uploadImage(url);
})
Promise.all(promise).then(() => {
})
},
async uploadImage(file) {
this.$u.api.uploadfile({
file: file,
}).then(res => {
if(res.errCode == 0) {}
})
},
writeFeedback() {
this.$u.api.writeFeedback({
fb_content: this.text,
fb_images: '',
}).then(res => {
if(res.errCode == 0) {}
})
},
onUploaded(list) {
console.log(this.text, list)
}
},
}
</script>

View File

@@ -8,10 +8,11 @@
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom">
<view>
<view class="item-container" v-for="order in orderList" :key="order.order_id">
<OrderItem :current="index"></OrderItem>
<OrderItem :order="order"></OrderItem>
</view>
<u-loadmore :status="loadStatus[index]" bgColor="#ECECEC" margin-bottom="20" v-if="typeof orderList == Array ? (orderList.length >= 15) : (orderList >= 15)"></u-loadmore>
</view>
<u-empty text="暂无订单" mode="order" color="#000000" v-if="!orderList.length"></u-empty>
<u-loadmore :status="loadStatus[index]" bgColor="#ECECEC" margin-bottom="20" v-if="orderList.length >= 15"></u-loadmore>
</scroll-view>
</swiper-item>
</swiper>
@@ -37,7 +38,7 @@ export default {
}, {
name: '售后'
}],
orderList: 15,
orderList: [],
loadStatus: ['loadmore','loadmore','loadmore','loadmore','loadmore','loadmore','loadmore'],
page: 0,
current: 0,
@@ -52,19 +53,17 @@ export default {
watch: {
current() {
this.page = 0;
this.getOrderList();
this.getOrderList('again');
},
},
onLoad(option) {
if(option.current) {
this.current = Number(option.current);
this.swiperCurrent = this.current;
}
this.getOrderList();
const current = option.current ? Number(option.current) : 0;
this.current = current;
this.swiperCurrent = this.current;
this.setViewHeight();
},
methods: {
async getOrderList() {
async getOrderList(reload = '') {
let type;
// state_type 订单状态0:已取消 10:未付款 20:已付款 30:已发货 40:已收货
switch (this.current) {
@@ -94,15 +93,16 @@ export default {
page: this.page,
type: type,
})
this.timer = false;
this.timer = true;
if(res.errCode == 0) {
if(res.data.length) this.orderList = this.orderList.concat(res.data);
if(reload) this.orderList = res.data;
else this.orderList.push(...res.data);
}
return res.data.length;
},
reachBottom() {
return false;
if(!this.timer) return false;
this.timer = false;
this.loadStatus.splice(this.current, 1, "loading");
this.page++;
this.getOrderList.then(length => {