Merge pull request 'zhy' (#51) from zhy into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/51
This commit is contained in:
		
						commit
						a5a06003a5
					
				@ -40,4 +40,13 @@
 | 
			
		||||
* @return { String } 处理好的富文本
 | 
			
		||||
*/
 | 
			
		||||
unescapeHTML(temp){}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
* 上传文件(只能单文件上传)
 | 
			
		||||
* @param { String } url 服务器 url
 | 
			
		||||
* @param { String } filePath 要上传文件资源的路径
 | 
			
		||||
* @param { String } type 上传文件验证类型 默认: img 可选: video
 | 
			
		||||
* @return { object } promise 对象 resolve 为文件服务器地址 reject 为错误信息
 | 
			
		||||
*/
 | 
			
		||||
uploadFile({ url, filePath, type = 'img' } = {}) {}
 | 
			
		||||
```
 | 
			
		||||
@ -216,6 +216,19 @@ export default {
 | 
			
		||||
					page: page,
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			// 意见反馈列表 
 | 
			
		||||
			getFeedbackList({ page }) {
 | 
			
		||||
				return vm.$u.post('Feedback/feedbackList', {
 | 
			
		||||
					page: page,
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			// 意见反馈-写意见
 | 
			
		||||
			writeFeedback({ fb_content, fb_images }) {
 | 
			
		||||
				return vm.$u.post('Feedback/writeFeedback', {
 | 
			
		||||
					fb_content: fb_content,
 | 
			
		||||
					fb_images: fb_images,
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			// 订单列表
 | 
			
		||||
			getOrderList({ page, type }) {
 | 
			
		||||
				let params = { page: page };
 | 
			
		||||
@ -224,11 +237,11 @@ export default {
 | 
			
		||||
			},
 | 
			
		||||
			// 订单详情
 | 
			
		||||
			getOrderInfo({ order_id }) {
 | 
			
		||||
				return vm.$u.post('Goods/orderInfo', { order_id });
 | 
			
		||||
				return vm.$u.post('Goods/orderInfo', { order_id: order_id });
 | 
			
		||||
			},
 | 
			
		||||
			// 查询订单的评价信息
 | 
			
		||||
			getOrderEvaluateInfo({ id }) {
 | 
			
		||||
				return vm.$u.post('Order/getOrderEvaluateInfo', { id });
 | 
			
		||||
				return vm.$u.post('Order/getOrderEvaluateInfo', { id: id });
 | 
			
		||||
			},
 | 
			
		||||
			// 订单评价/修改评价
 | 
			
		||||
			updateOrderEvaluate({ id, content, scores_one, scores_two, scores_three, file }) {
 | 
			
		||||
@ -241,6 +254,15 @@ export default {
 | 
			
		||||
					file: file,
 | 
			
		||||
				 });
 | 
			
		||||
			},
 | 
			
		||||
			// 上传图片视频
 | 
			
		||||
			uploadfile({ file }) {
 | 
			
		||||
				const params = {
 | 
			
		||||
					file: file
 | 
			
		||||
				}
 | 
			
		||||
				console.log(params);
 | 
			
		||||
				
 | 
			
		||||
				return vm.$u.post('Upload/uploadfile', params);
 | 
			
		||||
			},
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -2,30 +2,32 @@
 | 
			
		||||
	<view class="order-item">
 | 
			
		||||
		<view class="order-title">
 | 
			
		||||
			<view class="store-info">
 | 
			
		||||
				<image src="@/pageE/static/mine/23.png"></image>
 | 
			
		||||
				<view class="store-name">胖胖的店</view>
 | 
			
		||||
				<image :src="order.extend_store.store_avatar"></image>
 | 
			
		||||
				<view class="store-name">{{ order.extend_store.store_name }}</view>
 | 
			
		||||
			</view>
 | 
			
		||||
			<view class="order-status">交易成功</view>
 | 
			
		||||
			<view class="order-status">{{ order.order_state | viewState }}</view>
 | 
			
		||||
		</view>
 | 
			
		||||
		<view class="goods-info" @click="toDetailsPage">
 | 
			
		||||
			<image src="@/pageE/static/mine/23.png"></image>
 | 
			
		||||
			<view class="goods-text">
 | 
			
		||||
				<view class="goods-name u-line-2">木糖少女小紫薯西装领连衣裙夏季新款女装夏收腰格子格纹裙子</view>
 | 
			
		||||
				<view class="goods-sku u-line-1" v-if="current !== 5 && current !== 6">XL;红色条纹XL;红色条纹XL;红色条纹</view>
 | 
			
		||||
				<view class="goods-time u-line-1" v-if="current == 1 || current == 4">距离结束:23:23:38</view>
 | 
			
		||||
				<view class="goods-price u-line-1" v-if="current == 5 || current == 6">总价:¥99.00,实付款¥99</view>
 | 
			
		||||
				<view class="goods-date" v-if="current == 5 || current == 6">
 | 
			
		||||
					<image src="@/pageE/static/mine/26.png"></image>
 | 
			
		||||
					<view>2020.05.17</view>
 | 
			
		||||
		<view class="goods-info">
 | 
			
		||||
			<view class="goods-item" @click="toDetailsPage" v-for="goods in order.extend_order_goods" :key="goods.goods_id">
 | 
			
		||||
				<image :src="goods.goods_image"></image>
 | 
			
		||||
				<view class="goods-text">
 | 
			
		||||
					<view class="goods-name u-line-2">{{ goods.goods_name }}</view>
 | 
			
		||||
					<view class="goods-sku u-line-1" v-if="order.order_state !== 20 && order.order_state !== 40">XL;红色条纹XL;红色条纹XL;红色条纹</view>
 | 
			
		||||
					<view class="goods-time u-line-1" v-if="order.order_state == 10 || order.order_state == 10">距离结束:23:23:38</view>
 | 
			
		||||
					<view class="goods-price u-line-1" v-if="order.order_state == 20 || order.order_state == 40">总价:¥99.00,实付款¥99</view>
 | 
			
		||||
					<view class="goods-date" v-if="order.order_state == 20 || order.order_state == 40">
 | 
			
		||||
						<image src="@/pageE/static/mine/26.png"></image>
 | 
			
		||||
						<view>2020.05.17</view>
 | 
			
		||||
					</view>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
		<view class="order-btn" v-if="[0, 2, 4].indexOf(current) < 0">
 | 
			
		||||
			<view class="logistics" v-if="current == 3" @click="toLogistics">查看物流</view>
 | 
			
		||||
			<view class="comment" v-if="current == 5" @click="toComment">立即评价</view>
 | 
			
		||||
			<view class="payment" v-if="current == 1">立即支付</view>
 | 
			
		||||
			<view class="service" v-if="current == 6">联系官方客服</view>
 | 
			
		||||
			<view class="submit" v-if="current == 6">提交官方审核</view>
 | 
			
		||||
		<view class="order-btn" v-if="[10, 30, 20, 40].indexOf(order.order_state) >= 0">
 | 
			
		||||
			<view class="logistics" v-if="order.order_state == 30" @click="toLogistics">查看物流</view>
 | 
			
		||||
			<view class="comment" v-if="order.order_state == 20" @click="toComment">立即评价</view>
 | 
			
		||||
			<view class="payment" v-if="order.order_state == 10">立即支付</view>
 | 
			
		||||
			<view class="service" v-if="order.order_state == 40">联系官方客服</view>
 | 
			
		||||
			<view class="submit" v-if="order.order_state == 40">提交官方审核</view>
 | 
			
		||||
		</view>
 | 
			
		||||
	</view>
 | 
			
		||||
</template>
 | 
			
		||||
@ -35,12 +37,40 @@ export default {
 | 
			
		||||
		return {}
 | 
			
		||||
	},
 | 
			
		||||
	props: {
 | 
			
		||||
		current: Number
 | 
			
		||||
		order: Object
 | 
			
		||||
	},
 | 
			
		||||
	filters: {
 | 
			
		||||
		viewState(value) {
 | 
			
		||||
			let state;
 | 
			
		||||
			switch (value) {
 | 
			
		||||
				case 10:
 | 
			
		||||
					state = '待支付';
 | 
			
		||||
					break;
 | 
			
		||||
				case 0:
 | 
			
		||||
					state = '已取消';
 | 
			
		||||
					break;
 | 
			
		||||
				case 30:
 | 
			
		||||
					state = '待收货';
 | 
			
		||||
					break;
 | 
			
		||||
				case -1:
 | 
			
		||||
					state = '试穿试送';
 | 
			
		||||
					break;
 | 
			
		||||
				case 20:
 | 
			
		||||
					state = '待评价';
 | 
			
		||||
					break;
 | 
			
		||||
				case 40:
 | 
			
		||||
					state = '售后';
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					break;
 | 
			
		||||
			}
 | 
			
		||||
			return state;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		toDetailsPage() {
 | 
			
		||||
			uni.navigateTo({
 | 
			
		||||
				url: '/pageE/order/Details?current=' + this.current
 | 
			
		||||
				url: '/pageE/order/Details?order.order_state=' + this.order.order_state
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		toLogistics() {
 | 
			
		||||
@ -87,49 +117,51 @@ export default {
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	.goods-info {
 | 
			
		||||
		display: flex;
 | 
			
		||||
		margin-bottom: 28rpx;
 | 
			
		||||
		> image {
 | 
			
		||||
			flex-shrink: 0;
 | 
			
		||||
			width: 180rpx;
 | 
			
		||||
			height: 160rpx;
 | 
			
		||||
			border-radius: 10rpx;
 | 
			
		||||
			margin-right: 30rpx;
 | 
			
		||||
		}
 | 
			
		||||
		.goods-text {
 | 
			
		||||
		.goods-item {
 | 
			
		||||
			display: flex;
 | 
			
		||||
			flex-direction: column;
 | 
			
		||||
			justify-content: space-between;
 | 
			
		||||
			.goods-name {
 | 
			
		||||
				font-size: 28rpx;
 | 
			
		||||
				color: rgba(51,51,51,1);
 | 
			
		||||
				line-height: 38rpx;
 | 
			
		||||
			margin-bottom: 28rpx;
 | 
			
		||||
			> image {
 | 
			
		||||
				flex-shrink: 0;
 | 
			
		||||
				width: 180rpx;
 | 
			
		||||
				height: 160rpx;
 | 
			
		||||
				border-radius: 10rpx;
 | 
			
		||||
				margin-right: 30rpx;
 | 
			
		||||
			}
 | 
			
		||||
			.goods-sku {
 | 
			
		||||
				max-width: 230rpx;
 | 
			
		||||
				background: rgba(236,236,236,1);
 | 
			
		||||
				border-radius: 6rpx;
 | 
			
		||||
				padding: 10rpx 15rpx;
 | 
			
		||||
				font-size: 24rpx;
 | 
			
		||||
				color: rgba(153,153,153,1);
 | 
			
		||||
			}
 | 
			
		||||
			.goods-time {
 | 
			
		||||
				font-size: 24rpx;
 | 
			
		||||
				color: rgba(255,49,49,1);
 | 
			
		||||
			}
 | 
			
		||||
			.goods-price {
 | 
			
		||||
				font-size: 24rpx;
 | 
			
		||||
				color: rgba(253,211,96,1);
 | 
			
		||||
			}
 | 
			
		||||
			.goods-date {
 | 
			
		||||
			.goods-text {
 | 
			
		||||
				display: flex;
 | 
			
		||||
				align-items: center;
 | 
			
		||||
				font-size: 24rpx;
 | 
			
		||||
				color: rgba(153,153,153,1);
 | 
			
		||||
				> image {
 | 
			
		||||
					width: 24rpx;
 | 
			
		||||
					height: 24rpx;
 | 
			
		||||
					margin-right: 21rpx;
 | 
			
		||||
				flex-direction: column;
 | 
			
		||||
				justify-content: space-between;
 | 
			
		||||
				.goods-name {
 | 
			
		||||
					font-size: 28rpx;
 | 
			
		||||
					color: rgba(51,51,51,1);
 | 
			
		||||
					line-height: 38rpx;
 | 
			
		||||
				}
 | 
			
		||||
				.goods-sku {
 | 
			
		||||
					max-width: 230rpx;
 | 
			
		||||
					background: rgba(236,236,236,1);
 | 
			
		||||
					border-radius: 6rpx;
 | 
			
		||||
					padding: 10rpx 15rpx;
 | 
			
		||||
					font-size: 24rpx;
 | 
			
		||||
					color: rgba(153,153,153,1);
 | 
			
		||||
				}
 | 
			
		||||
				.goods-time {
 | 
			
		||||
					font-size: 24rpx;
 | 
			
		||||
					color: rgba(255,49,49,1);
 | 
			
		||||
				}
 | 
			
		||||
				.goods-price {
 | 
			
		||||
					font-size: 24rpx;
 | 
			
		||||
					color: rgba(253,211,96,1);
 | 
			
		||||
				}
 | 
			
		||||
				.goods-date {
 | 
			
		||||
					display: flex;
 | 
			
		||||
					align-items: center;
 | 
			
		||||
					font-size: 24rpx;
 | 
			
		||||
					color: rgba(153,153,153,1);
 | 
			
		||||
					> image {
 | 
			
		||||
						width: 24rpx;
 | 
			
		||||
						height: 24rpx;
 | 
			
		||||
						margin-right: 21rpx;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@ -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) {
 | 
			
		||||
 | 
			
		||||
@ -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>
 | 
			
		||||
 | 
			
		||||
@ -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>
 | 
			
		||||
 | 
			
		||||
@ -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 => {
 | 
			
		||||
 | 
			
		||||
@ -20,7 +20,7 @@
 | 
			
		||||
			</view>
 | 
			
		||||
			<view class="bottom">
 | 
			
		||||
				<view @click="toOtherPage('/mine/GoodsCollection')">
 | 
			
		||||
					<view>{{ userInfo.member_fav_goods_num }}</view>
 | 
			
		||||
					<view>{{ userInfo.member_fav_goods_num || 0 }}</view>
 | 
			
		||||
					<view>商品收藏</view>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view @click="toOtherPage('/mine/StoreCollection')">
 | 
			
		||||
 | 
			
		||||
@ -9,5 +9,36 @@ const common = {
 | 
			
		||||
		temp = "" + temp;
 | 
			
		||||
		return temp.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'");
 | 
			
		||||
	},
 | 
			
		||||
	/**
 | 
			
		||||
	* 上传文件(只能单文件上传)
 | 
			
		||||
	* @param { String } url 服务器 url
 | 
			
		||||
	* @param { String } filePath 要上传文件资源的路径
 | 
			
		||||
	* @param { String } type 上传文件验证类型 默认: img 可选: video
 | 
			
		||||
	* @return { object } promise 对象 resolve 为文件服务器地址 reject 为错误信息
 | 
			
		||||
	*/
 | 
			
		||||
	uploadFile({ url, filePath, type = 'img' } = {}) {
 | 
			
		||||
		const token = uni.getStorageSync('token');
 | 
			
		||||
		const promise =  new Promise((resolve, reject) => {
 | 
			
		||||
			uni.uploadFile({
 | 
			
		||||
				url: url,
 | 
			
		||||
				header: { "authorization": 'Bearer' + " " + token },
 | 
			
		||||
				filePath: filePath,
 | 
			
		||||
				name: 'file',
 | 
			
		||||
				formData: { type: type },
 | 
			
		||||
				success: uploadFileRes => {
 | 
			
		||||
					const data = JSON.parse(uploadFileRes.data);
 | 
			
		||||
					if(data.errCode.code == 0) {
 | 
			
		||||
						resolve(data.errCode.url);
 | 
			
		||||
					} else {
 | 
			
		||||
						reject(data.errCode.msg);
 | 
			
		||||
					}
 | 
			
		||||
				},
 | 
			
		||||
				fail(){
 | 
			
		||||
					reject('上传失败');
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
		});
 | 
			
		||||
		return promise;
 | 
			
		||||
	},
 | 
			
		||||
}
 | 
			
		||||
export default common
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user