api
This commit is contained in:
parent
c6bea7a19a
commit
8dc45b57fd
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,3 @@
|
||||
.vscode
|
||||
node_modules
|
||||
/node_modules/*
|
||||
unpackage
|
@ -40,13 +40,4 @@
|
||||
* @return { String } 处理好的富文本
|
||||
*/
|
||||
unescapeHTML(temp){}
|
||||
|
||||
/**
|
||||
* php时间戳转为格式化日期
|
||||
* @param { String } timestamp 必填 php 返回的时间戳
|
||||
* @param { String } spacer 可选 日期间隔符,默认 '-'
|
||||
* @param { String } end 可选 年月日时分秒截止位置,默认 day,可传 second
|
||||
* @return { String } 格式化日期
|
||||
*/
|
||||
timestampToDate({timestamp, spacer = '-', end = 'day'} = {}) {}
|
||||
```
|
@ -103,6 +103,14 @@ export default {
|
||||
cart_id: cart_id,
|
||||
});
|
||||
},
|
||||
// 选择地区计算运费
|
||||
getFreight({ freight_hash, city_id, area_id }) {
|
||||
return vm.$u.post('Buy/change_addr', {
|
||||
freight_hash: freight_hash,
|
||||
city_id: city_id,
|
||||
area_id: area_id,
|
||||
});
|
||||
},
|
||||
// 商品详情
|
||||
getGoodsDetails({ id }) {
|
||||
return vm.$u.post('Goods/goodDetails', {
|
||||
|
@ -211,17 +211,36 @@ export default {
|
||||
return vm.$u.post('Setting/CertificateInfo');
|
||||
},
|
||||
// 用户浏览记录
|
||||
getBrowseList() {
|
||||
return vm.$u.post('Member/BrowseList');
|
||||
getBrowseList({ page }) {
|
||||
return vm.$u.post('Member/BrowseList', {
|
||||
page: page,
|
||||
});
|
||||
},
|
||||
// 订单列表
|
||||
getOrderList({ page }) {
|
||||
return vm.$u.post('Goods/orderList', { page });
|
||||
getOrderList({ page, type }) {
|
||||
let params = { page: page };
|
||||
if(type >= 0) Object.assign(params, {state_type: type})
|
||||
return vm.$u.post('Goods/orderList', params);
|
||||
},
|
||||
// 订单详情
|
||||
getOrderInfo({ order_id }) {
|
||||
return vm.$u.post('Goods/orderInfo', { order_id });
|
||||
},
|
||||
// 查询订单的评价信息
|
||||
getOrderEvaluateInfo({ id }) {
|
||||
return vm.$u.post('Order/getOrderEvaluateInfo', { id });
|
||||
},
|
||||
// 订单评价/修改评价
|
||||
updateOrderEvaluate({ id, content, scores_one, scores_two, scores_three, file }) {
|
||||
return vm.$u.post('Order/orderEvaluate', {
|
||||
id: id,
|
||||
content: content,
|
||||
scores_one: scores_one,
|
||||
scores_two: scores_two,
|
||||
scores_three: scores_three,
|
||||
file: file,
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
@ -4,10 +4,10 @@
|
||||
<image src="../static/image/2.png" class="address-icon"></image>
|
||||
<view class="address">
|
||||
<view class="user-info">
|
||||
<view>胖胖</view>
|
||||
<view>18220171014</view>
|
||||
<view>{{ addressInfo.address_realname }}</view>
|
||||
<view>{{ addressInfo.address_mob_phone }}</view>
|
||||
</view>
|
||||
<view class="address-text u-line-2">山东省泰安市泰山区东岳大街与克山路交汇口银山店四楼橙天影视南邻山东省泰安市泰山区东岳大街与克山路交汇口银山店四楼橙天影视南邻</view>
|
||||
<view class="address-text u-line-2">{{ addressInfo.area_info + addressInfo.address_detail }}</view>
|
||||
</view>
|
||||
<image src="../static/image/1.png" class="right"></image>
|
||||
</view>
|
||||
@ -75,6 +75,8 @@ export default {
|
||||
return {
|
||||
orderInfo: {},
|
||||
totalPrice: '0.00',
|
||||
addressInfo: {},
|
||||
freight: '',
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
@ -92,36 +94,24 @@ export default {
|
||||
onLoad(option) {
|
||||
console.log(JSON.parse(option.info));
|
||||
this.orderInfo = JSON.parse(option.info);
|
||||
// this.orderListInit();
|
||||
this.addressInfo = this.orderInfo.address_info;
|
||||
this.showTotalPrice();
|
||||
this.getFreight();
|
||||
},
|
||||
methods: {
|
||||
// orderListInit() {
|
||||
// this.orderList = this.orderInfo.store_list;
|
||||
// for (const key in this.orderList) {
|
||||
// if (this.orderList.hasOwnProperty(key)) {
|
||||
// const element = this.orderList[key];
|
||||
// let tempArray = Object.entries(this.orderInfo.store_cart_list);
|
||||
// tempArray.forEach(item => {
|
||||
// if (item[0])
|
||||
// })
|
||||
// let temp = this.orderInfo.store_cart_list.filters(store => {
|
||||
// return store.store_id == item.store_id
|
||||
// })
|
||||
// element
|
||||
// }
|
||||
// }
|
||||
// this.orderList.forEach(item => {
|
||||
// let temp = this.orderInfo.store_cart_list.filters(store => {
|
||||
// return store.store_id == item.store_id
|
||||
// })
|
||||
// Object.assign(item, { goods_list: temp });
|
||||
// })
|
||||
// console.log(this.orderList);
|
||||
|
||||
// },
|
||||
showTotalPrice() {
|
||||
|
||||
},
|
||||
getFreight() {
|
||||
this.$u.api.getFreight({
|
||||
freight_hash: this.orderInfo.freight_hash,
|
||||
city_id: this.addressInfo.city_id,
|
||||
area_id: this.addressInfo.area_id,
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
// this.freight = res.
|
||||
}
|
||||
})
|
||||
},
|
||||
settlement() {
|
||||
uni.navigateTo({
|
||||
@ -177,6 +167,7 @@ export default {
|
||||
}
|
||||
}
|
||||
.main {
|
||||
margin-bottom: 100rpx;
|
||||
> view {
|
||||
.goods-info {
|
||||
background-color: #ffffff;
|
||||
@ -220,6 +211,7 @@ export default {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.info {
|
||||
flex: 1;
|
||||
// width: 418rpx;
|
||||
height: 160rpx;
|
||||
display: flex;
|
||||
|
@ -2,7 +2,8 @@
|
||||
<view class="edit-info">
|
||||
<view class="user-info">
|
||||
<view class="info-avatar">
|
||||
<image :src="avatar"></image>
|
||||
<u-avatar :src="avatar" :size="120"></u-avatar>
|
||||
<view class="avatar-text">更换头像</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="title">昵称</view>
|
||||
@ -74,7 +75,6 @@ export default {
|
||||
userInfo.member_nickname,
|
||||
userInfo.member_mobile,
|
||||
userInfo.member_birthday,
|
||||
// common.timestampToDate({timestamp: userInfo.member_birthday}),
|
||||
userInfo.member_sex,
|
||||
userInfo.member_avatar,
|
||||
];
|
||||
@ -116,15 +116,16 @@ export default {
|
||||
padding-top: 1rpx;
|
||||
.user-info {
|
||||
.info-avatar {
|
||||
text-align: center;
|
||||
height: 160rpx;
|
||||
height: 202rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(255,255,255,1);
|
||||
> image {
|
||||
flex-shrink: 0;
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 50%;
|
||||
margin-top: 20rpx;
|
||||
.avatar-text {
|
||||
margin-top: 12rpx;
|
||||
font-size: 24rpx;
|
||||
color: rgba(255,120,15,1);
|
||||
}
|
||||
}
|
||||
.info-item {
|
||||
|
@ -3,37 +3,50 @@
|
||||
<view class="integral-top">
|
||||
<view>
|
||||
<view class="title">总积分</view>
|
||||
<view class="value">999</view>
|
||||
<view class="value">{{ memberInfo.member_points }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="title">经验值</view>
|
||||
<view class="value">999</view>
|
||||
<view class="value">{{ memberInfo.member_exppoints }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="title">预计进度</view>
|
||||
<view class="value">999</view>
|
||||
<view class="value">{{ memberInfo.next_grade_exppoints_diff }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y class="integral-botom">
|
||||
<scroll-view scroll-y class="integral-botom" :style="{ height: integralHeight }">
|
||||
<rich-text :nodes="nodes"></rich-text>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import common from '@/static/js/common.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
nodes: '<h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1>',
|
||||
integralHeight: 0
|
||||
memberInfo: {},
|
||||
integralHeight: 0,
|
||||
nodes: '',
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.setIntegralHeight();
|
||||
this.getMemberPointsStat();
|
||||
},
|
||||
methods: {
|
||||
setIntegralHeight() {
|
||||
// this.integralHeight =
|
||||
const res = uni.getSystemInfoSync();
|
||||
// console.log(res.windowHeight);
|
||||
this.integralHeight = res.windowHeight - 251 / 2 + 'px';
|
||||
},
|
||||
getMemberPointsStat() {
|
||||
this.$u.api.getMemberPointsStat().then((res)=>{
|
||||
if (res.errCode == 0) {
|
||||
this.memberInfo = res.data;
|
||||
this.nodes = common.unescapeHTML(this.memberInfo.points_rule);
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@ -65,9 +78,11 @@ export default {
|
||||
}
|
||||
}
|
||||
.integral-botom {
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
position: absolute;
|
||||
width: 750rpx;
|
||||
height: calc(100vh - 251rpx);
|
||||
width: 100%;
|
||||
// height: calc(100vh - 251rpx);
|
||||
background: rgba(255,255,255,1);
|
||||
border-radius: 20rpx 20rpx 0rpx 0rpx;
|
||||
top: 251rpx;
|
||||
|
@ -3,9 +3,9 @@
|
||||
<view>
|
||||
<u-tabs-swiper ref="tabs" :list="list" :is-scroll="false" active-color="#FF780F" :current="current" font-size="32" :show-bar="false" @change="tabsChange" height="88" ></u-tabs-swiper>
|
||||
</view>
|
||||
<swiper :current="swiperCurrent" @animationfinish="animationfinish">
|
||||
<swiper :current="swiperCurrent" @animationfinish="animationfinish" :style="{ height: swiperHeight }">
|
||||
<swiper-item class="swiper-item">
|
||||
<scroll-view scroll-y class="integral">
|
||||
<view class="integral">
|
||||
<view class="integral-top">
|
||||
<view>
|
||||
<view class="title">总积分</view>
|
||||
@ -17,17 +17,17 @@
|
||||
</view>
|
||||
<view>
|
||||
<view class="title">预计进度</view>
|
||||
<view class="value">999</view>
|
||||
<view class="value">{{ memberInfo.next_grade_exppoints_diff }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="integral-botom">
|
||||
<scroll-view scroll-y class="integral-botom" :style="{ height: richHeight }">
|
||||
<rich-text :nodes="nodes"></rich-text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
<swiper-item class="swiper-item">
|
||||
<scroll-view scroll-y class="coupon">
|
||||
<view v-for="(item, index) in 13" :key="index" class="coupon-item">
|
||||
<view v-for="(item, index) in couponList" :key="index" class="coupon-item">
|
||||
<img src="../static/mine/23.png" />
|
||||
<view class="coupon-main">
|
||||
<view class="coupon-title">萌店十元优惠券</view>
|
||||
@ -39,6 +39,7 @@
|
||||
</view>
|
||||
<view class="coupon-btn">兑换</view>
|
||||
</view>
|
||||
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList.length"></u-empty>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
<swiper-item class="swiper-item">
|
||||
@ -52,12 +53,14 @@
|
||||
{{ item.pl_addtime > 0 ? item.pl_addtime : '+' + 10.00 }}
|
||||
</view>
|
||||
</view>
|
||||
<u-empty text="暂无明细" mode="data" color="#000" v-if="!pointslogList.length"></u-empty>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import common from '@/static/js/common.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -68,16 +71,20 @@ export default {
|
||||
}, {
|
||||
name: '积分明细'
|
||||
}],
|
||||
richHeight: '',
|
||||
swiperHeight: '',
|
||||
current: 0,
|
||||
swiperCurrent: 0,
|
||||
nodes: '<h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1>',
|
||||
pointslogList: [],
|
||||
memberInfo: {}
|
||||
couponList: [],
|
||||
memberInfo: {},
|
||||
nodes: '',
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getMemberPointsStat();
|
||||
this.getPointslogList();
|
||||
this.setViewHeight();
|
||||
},
|
||||
methods: {
|
||||
tabsChange(index) {
|
||||
@ -92,6 +99,7 @@ export default {
|
||||
this.$u.api.getMemberPointsStat().then((res)=>{
|
||||
if (res.errCode == 0) {
|
||||
this.memberInfo = res.data;
|
||||
this.nodes = common.unescapeHTML(this.memberInfo.points_rule);
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -101,7 +109,14 @@ export default {
|
||||
this.pointslogList = res.data;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
setViewHeight() {
|
||||
const res = uni.getSystemInfoSync();
|
||||
// console.log(res.windowHeight);
|
||||
this.richHeight = res.windowHeight - (88 + 250) / 2 + 'px';
|
||||
// console.log(this.richHeight);
|
||||
this.swiperHeight = res.windowHeight - 88 / 2 + 'px';
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@ -111,18 +126,20 @@ export default {
|
||||
background-color: #ECECEC;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
> uni-swiper {
|
||||
flex: 1;
|
||||
}
|
||||
// > uni-swiper {
|
||||
// flex: 1;
|
||||
// height: calc()
|
||||
// }
|
||||
.swiper-item {
|
||||
padding-top: 10rpx;
|
||||
.integral {
|
||||
height: 100%;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
.integral-top {
|
||||
padding: 79rpx 88rpx;
|
||||
width: 750rpx;
|
||||
height: 271rpx;
|
||||
height: 270rpx;
|
||||
background: linear-gradient(0deg,rgba(246,211,119,1) 1%,rgba(240,154,105,1) 100%);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@ -142,12 +159,13 @@ export default {
|
||||
}
|
||||
}
|
||||
.integral-botom {
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
position: absolute;
|
||||
width: 750rpx;
|
||||
// height: 856rpx;
|
||||
width: 100%;
|
||||
background: rgba(255,255,255,1);
|
||||
border-radius: 20rpx 20rpx 0rpx 0rpx;
|
||||
top: 251rpx;
|
||||
top: 250rpx;
|
||||
z-index: 9;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="information">
|
||||
<view class="info-avatar">
|
||||
<image :src="userInfo.member_avatar"></image>
|
||||
<u-avatar :src="userInfo.member_avatar" :size="120"></u-avatar>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="title">昵称</view>
|
||||
@ -47,11 +47,6 @@ export default {
|
||||
onNavigationBarButtonTap() {
|
||||
this.toEditPage();
|
||||
},
|
||||
filters: {
|
||||
dateFormat(value) {
|
||||
return common.timestampToDate({ timestamp: value });
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getUserInfo() {
|
||||
this.$u.api.getMemberInfo().then(res => {
|
||||
@ -74,16 +69,11 @@ export default {
|
||||
background-color: #ECECEC;
|
||||
padding-top: 1rpx;
|
||||
.info-avatar {
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 160rpx;
|
||||
background: rgba(255,255,255,1);
|
||||
> image {
|
||||
flex-shrink: 0;
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 50%;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
.info-item {
|
||||
display: flex;
|
||||
|
@ -3,74 +3,14 @@
|
||||
<view>
|
||||
<u-tabs-swiper ref="tabs" :list="list" :is-scroll="false" active-color="#FF780F" :current="current" font-size="26" @change="tabsChange" height="88" :gutter="30"></u-tabs-swiper>
|
||||
</view>
|
||||
<swiper :current="swiperCurrent" @animationfinish="animationfinish">
|
||||
<swiper-item class="swiper-item">
|
||||
<swiper :current="swiperCurrent" @animationfinish="animationfinish" :style="{ height: swiperHeight }">
|
||||
<swiper-item class="swiper-item" v-for="(item, index) in list" :key="index">
|
||||
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom">
|
||||
<view>
|
||||
<view class="item-container" v-for="(item, index) in orderList" :key="index">
|
||||
<OrderItem :current="current"></OrderItem>
|
||||
<view class="item-container" v-for="order in orderList" :key="order.order_id">
|
||||
<OrderItem :current="index"></OrderItem>
|
||||
</view>
|
||||
<u-loadmore :status="loadStatus[5]" bgColor="#ECECEC" margin-bottom="20"></u-loadmore>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
<swiper-item class="swiper-item">
|
||||
<scroll-view scroll-y style="height: 100%;">
|
||||
<view>
|
||||
<view class="item-container" v-for="(item, index) in orderList" :key="index">
|
||||
<OrderItem :current="current"></OrderItem>
|
||||
</view>
|
||||
<u-loadmore :status="loadStatus[5]" bgColor="#ECECEC" margin-bottom="20"></u-loadmore>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
<swiper-item class="swiper-item">
|
||||
<scroll-view scroll-y style="height: 100%;">
|
||||
<view>
|
||||
<view class="item-container" v-for="(item, index) in orderList" :key="index">
|
||||
<OrderItem :current="current"></OrderItem>
|
||||
</view>
|
||||
<u-loadmore :status="loadStatus[5]" bgColor="#ECECEC" margin-bottom="20"></u-loadmore>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
<swiper-item class="swiper-item">
|
||||
<scroll-view scroll-y style="height: 100%;">
|
||||
<view>
|
||||
<view class="item-container" v-for="(item, index) in orderList" :key="index">
|
||||
<OrderItem :current="current"></OrderItem>
|
||||
</view>
|
||||
<u-loadmore :status="loadStatus[5]" bgColor="#ECECEC" margin-bottom="20"></u-loadmore>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
<swiper-item class="swiper-item">
|
||||
<scroll-view scroll-y style="height: 100%;">
|
||||
<view>
|
||||
<view class="item-container" v-for="(item, index) in orderList" :key="index">
|
||||
<OrderItem :current="current"></OrderItem>
|
||||
</view>
|
||||
<u-loadmore :status="loadStatus[5]" bgColor="#ECECEC" margin-bottom="20"></u-loadmore>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
<swiper-item class="swiper-item">
|
||||
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom">
|
||||
<view>
|
||||
<view class="item-container" v-for="(item, index) in orderList" :key="index">
|
||||
<OrderItem :current="current"></OrderItem>
|
||||
</view>
|
||||
<u-loadmore :status="loadStatus[5]" bgColor="#ECECEC" margin-bottom="20"></u-loadmore>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
<swiper-item class="swiper-item">
|
||||
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom">
|
||||
<view>
|
||||
<view class="item-container" v-for="(item, index) in orderList" :key="index">
|
||||
<OrderItem :current="current"></OrderItem>
|
||||
</view>
|
||||
<u-loadmore :status="loadStatus[6]" bgColor="#ECECEC" margin-bottom="20"></u-loadmore>
|
||||
<u-loadmore :status="loadStatus[index]" bgColor="#ECECEC" margin-bottom="20" v-if="typeof orderList == Array ? (orderList.length >= 15) : (orderList >= 15)"></u-loadmore>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
@ -97,44 +37,81 @@ export default {
|
||||
}, {
|
||||
name: '售后'
|
||||
}],
|
||||
orderList: 5,
|
||||
orderList: 15,
|
||||
loadStatus: ['loadmore','loadmore','loadmore','loadmore','loadmore','loadmore','loadmore'],
|
||||
page: 0,
|
||||
current: 0,
|
||||
swiperCurrent: 0,
|
||||
swiperHeight: '',
|
||||
timer: true,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
OrderItem
|
||||
},
|
||||
watch: {
|
||||
current() {
|
||||
this.page = 0;
|
||||
this.getOrderList();
|
||||
},
|
||||
},
|
||||
onLoad(option) {
|
||||
if(option.current) {
|
||||
this.current = Number(option.current);
|
||||
this.swiperCurrent = this.current;
|
||||
}
|
||||
this.getOrderList();
|
||||
this.setViewHeight();
|
||||
},
|
||||
methods: {
|
||||
getOrderList() {
|
||||
this.$u.api.getOrderList({
|
||||
page: this.page,
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
|
||||
async getOrderList() {
|
||||
let type;
|
||||
// state_type 订单状态:0:已取消 10:未付款 20:已付款 30:已发货 40:已收货
|
||||
switch (this.current) {
|
||||
case 1:
|
||||
type = 10; // 待支付
|
||||
break;
|
||||
case 2:
|
||||
type = 0; // 已取消
|
||||
break;
|
||||
case 3:
|
||||
type = 30; // 待收货
|
||||
break;
|
||||
case 4:
|
||||
type = -1; // 试穿试送
|
||||
break;
|
||||
case 5:
|
||||
type = 20; // 待评价
|
||||
break;
|
||||
case 6:
|
||||
type = 40; // 售后
|
||||
break;
|
||||
default:
|
||||
type = -1;
|
||||
break;
|
||||
}
|
||||
const res = await this.$u.api.getOrderList({
|
||||
page: this.page,
|
||||
type: type,
|
||||
})
|
||||
this.timer = false;
|
||||
if(res.errCode == 0) {
|
||||
if(res.data.length) this.orderList = this.orderList.concat(res.data);
|
||||
}
|
||||
return res.data.length;
|
||||
},
|
||||
reachBottom() {
|
||||
// console.log(this.page);
|
||||
if(this.page >= 3) return;
|
||||
// 修改当前的 loadStatus
|
||||
console.log(this.loadStatus);
|
||||
return false;
|
||||
if(!this.timer) return false;
|
||||
this.loadStatus.splice(this.current, 1, "loading");
|
||||
this.page++;
|
||||
setTimeout(() => {
|
||||
this.orderList += 5;
|
||||
this.getOrderList.then(length => {
|
||||
this.loadStatus.splice(this.current, 1, "nomore");
|
||||
}, 1200);
|
||||
if(length == 0) this.page--;
|
||||
}).catch(() => {
|
||||
this.loadStatus.splice(this.current, 1, "nomore");
|
||||
this.page--;
|
||||
})
|
||||
},
|
||||
tabsChange(index) {
|
||||
this.current = Number(index);
|
||||
@ -144,7 +121,11 @@ export default {
|
||||
let current = Number(e.detail.current);
|
||||
this.swiperCurrent = current;
|
||||
this.current = current;
|
||||
}
|
||||
},
|
||||
setViewHeight() {
|
||||
const sys = uni.getSystemInfoSync();
|
||||
this.swiperHeight = sys.windowHeight - 88 / 2 + 'px';
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -154,9 +135,9 @@ export default {
|
||||
background-color: #ECECEC;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
> uni-swiper {
|
||||
flex: 1;
|
||||
}
|
||||
// > uni-swiper {
|
||||
// flex: 1;
|
||||
// }
|
||||
.swiper-item {
|
||||
.item-container {
|
||||
padding: 20rpx 30rpx;
|
||||
|
@ -74,6 +74,7 @@ export default {
|
||||
return res.data.list;
|
||||
}
|
||||
},
|
||||
// 加载更多
|
||||
reachBottom() {
|
||||
// 修改当前的 loadStatus
|
||||
this.loadStatus = "loading";
|
||||
|
@ -1,21 +1,20 @@
|
||||
<template>
|
||||
<view class="mine-history">
|
||||
<view class="history-box">
|
||||
<view v-for="(item, index) in historyList" :key="index" class="history-item">
|
||||
<scroll-view scroll-y class="history-box" @scrolltolower="reachBottom">
|
||||
<view class="item-box">
|
||||
<view v-for="(item, index) in historyList.slice(0, 50)" :key="index" class="history-item">
|
||||
<view class="item-title">
|
||||
<image src="../static/mine/23.png"></image>
|
||||
<view>小米店铺</view>
|
||||
<image :src="item.store_avatar"></image>
|
||||
<view>{{ item.store_name }}</view>
|
||||
</view>
|
||||
<!-- <view class="item-image">
|
||||
<img src="../static/mine/23.png" />
|
||||
</view> -->
|
||||
<image src="../static/mine/23.png" class="item-image"></image>
|
||||
<image :src="item.goods_image" class="item-image"></image>
|
||||
<view class="item-info">
|
||||
<view class="info-name">{{ item }}</view>
|
||||
<image src="../static/mine/22.png"></image>
|
||||
<view class="info-name u-line-1">{{ item.goods_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore :status="loadStatus" bgColor="#ECECEC" margin-bottom="20" v-if="historyList.length > 9"></u-loadmore>
|
||||
</scroll-view>
|
||||
<u-empty text="暂无足迹" mode="list" color="#000" margin-top="240" v-if="!historyList.length"></u-empty>
|
||||
</view>
|
||||
</template>
|
||||
@ -24,18 +23,138 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
historyList: [1, 2, 3, 6]
|
||||
historyList: [
|
||||
{
|
||||
"goods_id": 13,
|
||||
"goodsbrowse_time": "2020-06-28 15:45:56",
|
||||
"goods_image": "http://deming.test/uploads/home/store/goods/1/1_2017092121142556524.jpg",//商品主图
|
||||
"goods_name": "变频风冷无霜 独立双循环 LED显示 对开门冰箱(白色)",//商品名称
|
||||
"store_id": 1,//店铺id
|
||||
"store_name": "官方自营店铺",//店铺名
|
||||
"store_avatar": "http://deming.test/uploads/home/store/1/1_2020062410413137159.png"//店铺头像
|
||||
},
|
||||
{
|
||||
"goods_id": 13,
|
||||
"goodsbrowse_time": "2020-06-28 15:45:56",
|
||||
"goods_image": "http://deming.test/uploads/home/store/goods/1/1_2017092121142556524.jpg",//商品主图
|
||||
"goods_name": "变频风冷无霜 独立双循环 LED显示 对开门冰箱(白色)",//商品名称
|
||||
"store_id": 1,//店铺id
|
||||
"store_name": "官方自营店铺",//店铺名
|
||||
"store_avatar": "http://deming.test/uploads/home/store/1/1_2020062410413137159.png"//店铺头像
|
||||
},
|
||||
{
|
||||
"goods_id": 13,
|
||||
"goodsbrowse_time": "2020-06-28 15:45:56",
|
||||
"goods_image": "http://deming.test/uploads/home/store/goods/1/1_2017092121142556524.jpg",//商品主图
|
||||
"goods_name": "变频风冷无霜 独立双循环 LED显示 对开门冰箱(白色)",//商品名称
|
||||
"store_id": 1,//店铺id
|
||||
"store_name": "官方自营店铺",//店铺名
|
||||
"store_avatar": "http://deming.test/uploads/home/store/1/1_2020062410413137159.png"//店铺头像
|
||||
},
|
||||
{
|
||||
"goods_id": 13,
|
||||
"goodsbrowse_time": "2020-06-28 15:45:56",
|
||||
"goods_image": "http://deming.test/uploads/home/store/goods/1/1_2017092121142556524.jpg",//商品主图
|
||||
"goods_name": "变频风冷无霜 独立双循环 LED显示 对开门冰箱(白色)",//商品名称
|
||||
"store_id": 1,//店铺id
|
||||
"store_name": "官方自营店铺",//店铺名
|
||||
"store_avatar": "http://deming.test/uploads/home/store/1/1_2020062410413137159.png"//店铺头像
|
||||
},
|
||||
{
|
||||
"goods_id": 13,
|
||||
"goodsbrowse_time": "2020-06-28 15:45:56",
|
||||
"goods_image": "http://deming.test/uploads/home/store/goods/1/1_2017092121142556524.jpg",//商品主图
|
||||
"goods_name": "变频风冷无霜 独立双循环 LED显示 对开门冰箱(白色)",//商品名称
|
||||
"store_id": 1,//店铺id
|
||||
"store_name": "官方自营店铺",//店铺名
|
||||
"store_avatar": "http://deming.test/uploads/home/store/1/1_2020062410413137159.png"//店铺头像
|
||||
},
|
||||
{
|
||||
"goods_id": 12,
|
||||
"goodsbrowse_time": "2020-06-28 15:44:41",
|
||||
"goods_image": "http://deming.test/uploads/home/store/goods/1/1_2017092121050988491.jpg",
|
||||
"goods_name": "扬子(YAIR) 小2匹 冷暖 自动清洗 定频空调柜机",
|
||||
"store_id": 1,
|
||||
"store_name": "官方自营店铺",
|
||||
"store_avatar": "http://deming.test/uploads/home/store/1/1_2020062410413137159.png"
|
||||
},
|
||||
{
|
||||
"goods_id": 11,
|
||||
"goodsbrowse_time": "2020-06-28 15:38:11",
|
||||
"goods_image": "http://deming.test/uploads/home/store/goods/1/1_2017092120564717575.jpg",
|
||||
"goods_name": "1.5匹 变频 智能 二级能效极速侠 空调挂机",
|
||||
"store_id": 1,
|
||||
"store_name": "官方自营店铺",
|
||||
"store_avatar": "http://deming.test/uploads/home/store/1/1_2020062410413137159.png"
|
||||
},
|
||||
{
|
||||
"goods_id": 9,
|
||||
"goodsbrowse_time": "2020-06-28 15:36:27",
|
||||
"goods_image": "http://deming.test/uploads/home/store/goods/1/1_2017092120480147477.jpg",
|
||||
"goods_name": "长虹(CHANGHONG)39M1 39英寸 窄边高清液晶电视(黑色)",
|
||||
"store_id": 1,
|
||||
"store_name": "官方自营店铺",
|
||||
"store_avatar": "http://deming.test/uploads/home/store/1/1_2020062410413137159.png"
|
||||
},
|
||||
{
|
||||
"goods_id": 8,
|
||||
"goodsbrowse_time": "2020-06-28 15:36:06",
|
||||
"goods_image": "http://deming.test/uploads/home/store/goods/1/1_2017092120445748551.jpg",
|
||||
"goods_name": "先锋(Pioneer)LED-39B700S 39英寸 高清 网络 智能 液晶电视",
|
||||
"store_id": 1,
|
||||
"store_name": "官方自营店铺",
|
||||
"store_avatar": "http://deming.test/uploads/home/store/1/1_2020062410413137159.png"
|
||||
},
|
||||
{
|
||||
"goods_id": 10,
|
||||
"goodsbrowse_time": "2020-06-24 16:14:29",
|
||||
"goods_image": "http://deming.test/uploads/home/store/goods/1/1_2017092120493430154.jpg",
|
||||
"goods_name": "39英寸64位24核安卓智能平板液晶电视(黑色)",
|
||||
"store_id": 1,
|
||||
"store_name": "官方自营店铺",
|
||||
"store_avatar": "http://deming.test/uploads/home/store/1/1_2020062410413137159.png"
|
||||
},
|
||||
{
|
||||
"goods_id": 28,
|
||||
"goodsbrowse_time": "2020-06-23 17:07:45",
|
||||
"goods_image": "http://deming.test/uploads/home/store/goods/1/1_2017092202022516767.jpg",
|
||||
"goods_name": "南极人(NanJiren)纯棉床单四件套全棉床上用品婚庆被套4件套",
|
||||
"store_id": 1,
|
||||
"store_name": "官方自营店铺",
|
||||
"store_avatar": "http://deming.test/uploads/home/store/1/1_2020062410413137159.png"
|
||||
}
|
||||
],
|
||||
page: 1, // 默认1
|
||||
loadStatus: 'loadmore',
|
||||
timer: true,
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getBrowseList();
|
||||
},
|
||||
methods: {
|
||||
getBrowseList () {
|
||||
this.$u.api.getBrowseList().then(res => {
|
||||
async getBrowseList () {
|
||||
const res = await this.$u.api.getBrowseList({ page: this.page });
|
||||
this.timer = false;
|
||||
if(res.errCode == 0) {
|
||||
this.historyList = res.data.storeInfo;
|
||||
}
|
||||
return res.data.storeInfo.length;
|
||||
},
|
||||
reachBottom() {
|
||||
if(!this.timer) return false;
|
||||
this.loadStatus = "loading";
|
||||
this.page++;
|
||||
this.getBrowseList({page: this.page}).then(length => {
|
||||
if(length == 0) {
|
||||
this.page--;
|
||||
this.status = 'nomore';
|
||||
} else {
|
||||
this.status = 'loading';
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loadStatus = "nomore";
|
||||
this.page--;
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -46,7 +165,9 @@ export default {
|
||||
min-height: calc(100vh - var(--window-top));
|
||||
background: #ECECEC;
|
||||
.history-box {
|
||||
height: calc(100vh - var(--window-top));
|
||||
padding: 20rpx 30rpx 0;
|
||||
.item-box {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
.history-item {
|
||||
@ -81,6 +202,8 @@ export default {
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.info-name {
|
||||
margin-right: 10rpx;
|
||||
flex: 1;
|
||||
font-size: 22rpx;
|
||||
color: rgba(51,51,51,1);
|
||||
}
|
||||
@ -91,5 +214,7 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -619,9 +619,16 @@
|
||||
"app-plus": {
|
||||
"titleSize": "36px",
|
||||
"titleNView": {
|
||||
"autoBackButton": false,
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"titleColor": "#333333",
|
||||
"buttons": [
|
||||
{
|
||||
"type":"none",
|
||||
"text":"取消",
|
||||
"float":"left",
|
||||
"fontSize":"14"
|
||||
},
|
||||
{
|
||||
"type":"none",
|
||||
"text":"\ue62d",
|
||||
|
@ -2,7 +2,7 @@
|
||||
<view class="mine">
|
||||
<view class="mine-top">
|
||||
<view class="top">
|
||||
<image :src="userInfo.member_avatar" class="avatar" @click="toOtherPage('/mine/MineInfo')" />
|
||||
<u-avatar :src="userInfo.member_avatar" :size="110"></u-avatar>
|
||||
<view class="user-info">
|
||||
<view class="info-left">
|
||||
<view class="user-nickname" @click="toOtherPage('/mine/MineInfo')">{{ userInfo.member_nickname }}</view>
|
||||
@ -166,15 +166,8 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 40rpx;
|
||||
.avatar {
|
||||
width: 110rpx;
|
||||
height: 110rpx;
|
||||
border-radius: 50%;
|
||||
border: 2rpx solid rgba(251,251,251,1);
|
||||
margin-right: 30rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.user-info {
|
||||
margin-left: 30rpx;
|
||||
display: flex;
|
||||
.info-left {
|
||||
margin-right: 15rpx;
|
||||
|
@ -9,26 +9,5 @@ const common = {
|
||||
temp = "" + temp;
|
||||
return temp.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'");
|
||||
},
|
||||
/**
|
||||
* php时间戳转为格式化日期
|
||||
* @param { String } timestamp 必填 php返回的时间戳
|
||||
* @param { String } spacer 可选 日期间隔符,默认 '-'
|
||||
* @param { String } end 可选 年月日时分秒截止位置,默认 day,可传 second
|
||||
* @return { String } 格式化日期
|
||||
*/
|
||||
timestampToDate({timestamp, spacer = '-', end = 'day'} = {}) {
|
||||
if(!timestamp) return '';
|
||||
const newDate = new Date(parseInt(timestamp) * 1000);
|
||||
// const year = newDate.getUTCFullYear();
|
||||
const year = newDate.getFullYear();
|
||||
const month = newDate.getMonth() + 1;
|
||||
const nowday = newDate.getDate();
|
||||
const hours = newDate.getHours();
|
||||
const minutes = newDate.getMinutes();
|
||||
const seconds = newDate.getSeconds();
|
||||
return end == 'day'
|
||||
? year + spacer + month + spacer + nowday
|
||||
: year + spacer + month + spacer + nowday + spacer + hours + spacer + minutes + spacer + seconds;
|
||||
}
|
||||
}
|
||||
export default common
|
Loading…
Reference in New Issue
Block a user