|
|
@ -9,19 +9,19 @@ |
|
|
<swiper-item v-for="(tab, tabIndex) in tab_list" :key="tabIndex"> |
|
|
<swiper-item v-for="(tab, tabIndex) in tab_list" :key="tabIndex"> |
|
|
<scroll-view class="com" :scroll-y="true" :refresher-enabled="true" :refresher-triggered="isRefresher" |
|
|
<scroll-view class="com" :scroll-y="true" :refresher-enabled="true" :refresher-triggered="isRefresher" |
|
|
@scrolltolower="onScrolltolower" @refresherrefresh="onRefresherrefresh"> |
|
|
@scrolltolower="onScrolltolower" @refresherrefresh="onRefresherrefresh"> |
|
|
<view class="flex-direction justify-around list" @click="$url('/pages/order/order_details?order_id=1')"> |
|
|
|
|
|
|
|
|
<view class="flex-direction justify-around list" v-for="(item, index) in tab.list" :key="item.id" @tap="goDetails(tabIndex,index)"> |
|
|
<view class="lf-row-between"> |
|
|
<view class="lf-row-between"> |
|
|
<view class="left" style="position: relative;display: flex;"> |
|
|
<view class="left" style="position: relative;display: flex;"> |
|
|
<image src="../../static/logo.png" mode="aspectFill"></image> |
|
|
|
|
|
|
|
|
<image :src="item.product.picture" mode="aspectFill"></image> |
|
|
</view> |
|
|
</view> |
|
|
<view class="right"> |
|
|
<view class="right"> |
|
|
<view class="lf-line-2 title lf-font-28 lf-color-333" style="line-height: 40rpx;">南澳站·潮玩旅游胜地 身处亚热带风情/玩转南澳</view> |
|
|
|
|
|
|
|
|
<view class="lf-line-2 title lf-font-28 lf-color-333" style="line-height: 40rpx;">{{item.product.title}}</view> |
|
|
<view class="lf-flex tips lf-m-t-10"> |
|
|
<view class="lf-flex tips lf-m-t-10"> |
|
|
<text class="progress margin-right-xs lf-color-gray">数量</text> |
|
|
<text class="progress margin-right-xs lf-color-gray">数量</text> |
|
|
<text class="bought lf-color-gray">x 1</text> |
|
|
|
|
|
|
|
|
<text class="bought lf-color-gray">x {{item.num}}</text> |
|
|
</view> |
|
|
</view> |
|
|
<view class="lf-row-between price lf-m-t-16" style="padding-right: 6rpx;"> |
|
|
<view class="lf-row-between price lf-m-t-16" style="padding-right: 6rpx;"> |
|
|
<lf-price :price="599.00" style="margin-top: 10rpx;" /> |
|
|
|
|
|
|
|
|
<lf-price :price="item.price" style="margin-top: 10rpx;" /> |
|
|
<button class="lf-font-24 radius-order">立即付款</button> |
|
|
<button class="lf-font-24 radius-order">立即付款</button> |
|
|
|
|
|
|
|
|
<!-- <button class="cu-btn1 lf-color-green lf-border-green">立即使用</button> --> |
|
|
<!-- <button class="cu-btn1 lf-color-green lf-border-green">立即使用</button> --> |
|
|
@ -33,7 +33,7 @@ |
|
|
<view> |
|
|
<view> |
|
|
<view class="solid-top flex justify-between align-center text-center"> |
|
|
<view class="solid-top flex justify-between align-center text-center"> |
|
|
<view class="text-gray lf-font-28" style="padding: 20rpx;"> |
|
|
<view class="text-gray lf-font-28" style="padding: 20rpx;"> |
|
|
2021-7-6 23:24:46 |
|
|
|
|
|
|
|
|
{{timer(item.created_at*1000)}} |
|
|
</view> |
|
|
</view> |
|
|
<view class="lf-color-price" style="padding: 20rpx 24rpx 20rpx 20rpx;"> |
|
|
<view class="lf-color-price" style="padding: 20rpx 24rpx 20rpx 20rpx;"> |
|
|
请在10分钟内付款 |
|
|
请在10分钟内付款 |
|
|
@ -62,7 +62,7 @@ |
|
|
return { |
|
|
return { |
|
|
tab_list: [{ |
|
|
tab_list: [{ |
|
|
name: '全部', |
|
|
name: '全部', |
|
|
type: 'all', |
|
|
|
|
|
|
|
|
type: '', |
|
|
list: [], |
|
|
list: [], |
|
|
loadingClass: true, |
|
|
loadingClass: true, |
|
|
loadingText: '正在加载中', |
|
|
loadingText: '正在加载中', |
|
|
@ -70,7 +70,7 @@ |
|
|
isPage: true |
|
|
isPage: true |
|
|
}, { |
|
|
}, { |
|
|
name: '待付款', |
|
|
name: '待付款', |
|
|
type: 'unpaid', |
|
|
|
|
|
|
|
|
type: 0, |
|
|
list: [], |
|
|
list: [], |
|
|
loadingClass: true, |
|
|
loadingClass: true, |
|
|
loadingText: '正在加载中', |
|
|
loadingText: '正在加载中', |
|
|
@ -78,7 +78,7 @@ |
|
|
isPage: true |
|
|
isPage: true |
|
|
}, { |
|
|
}, { |
|
|
name: '已付款', |
|
|
name: '已付款', |
|
|
type: 'paid', |
|
|
|
|
|
|
|
|
type: 1, |
|
|
list: [], |
|
|
list: [], |
|
|
loadingClass: true, |
|
|
loadingClass: true, |
|
|
loadingText: '正在加载中', |
|
|
loadingText: '正在加载中', |
|
|
@ -87,7 +87,7 @@ |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: '已完成', |
|
|
name: '已完成', |
|
|
type: 'complete', |
|
|
|
|
|
|
|
|
type: 16, |
|
|
list: [], |
|
|
list: [], |
|
|
loadingClass: true, |
|
|
loadingClass: true, |
|
|
loadingText: '正在加载中', |
|
|
loadingText: '正在加载中', |
|
|
@ -96,7 +96,7 @@ |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: '售后', |
|
|
name: '售后', |
|
|
type: 'after_sales', |
|
|
|
|
|
|
|
|
type: 6, |
|
|
list: [], |
|
|
list: [], |
|
|
loadingClass: true, |
|
|
loadingClass: true, |
|
|
loadingText: '正在加载中', |
|
|
loadingText: '正在加载中', |
|
|
@ -107,15 +107,67 @@ |
|
|
current: 0, // tab下表 |
|
|
current: 0, // tab下表 |
|
|
pageSize: 10, |
|
|
pageSize: 10, |
|
|
windowHeight: 0, // 屏幕可用高度 |
|
|
windowHeight: 0, // 屏幕可用高度 |
|
|
|
|
|
showLogin: true, |
|
|
|
|
|
isRefresher: true |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad(e) { |
|
|
onLoad(e) { |
|
|
this.windowHeight = getApp().globalData.windowHeight; |
|
|
this.windowHeight = getApp().globalData.windowHeight; |
|
|
|
|
|
// this.verifyUserInfo() |
|
|
|
|
|
this.getUserOrder() |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
// 检查当前用户登录状态 |
|
|
|
|
|
verifyUserInfo(){ |
|
|
|
|
|
let userInfo = uni.getStorageSync('userinfo') || {}; |
|
|
|
|
|
if(!userInfo.id || !userInfo.nickname || !userInfo.avatar){ |
|
|
|
|
|
if(this.showLogin){ |
|
|
|
|
|
this.showLogin = false; |
|
|
|
|
|
this.$url('/pages/login/index?type=userinfo'); |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.showLogin = true; |
|
|
|
|
|
this.$url('/pages/index/index', {type: 'switch'}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
goDetails(tabIndex,index) { |
|
|
|
|
|
console.log(tabIndex,index) |
|
|
|
|
|
let item = this.tab_list[tabIndex].list[index] |
|
|
|
|
|
if (item.state == 1) { |
|
|
|
|
|
this.$routerGo('/pages/order/unpay-details?order_id=' + item.id) |
|
|
|
|
|
} else if(item.state == 4){ |
|
|
|
|
|
this.$routerGo('/pages/order/refund_detail?order_id=' + item.id) |
|
|
|
|
|
}else { |
|
|
|
|
|
this.$routerGo('/pages/order/order-details?order_id=' + item.id) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
//获取订单数据 |
|
|
//获取订单数据 |
|
|
getUserOrder() { |
|
|
|
|
|
console.log('获取数据') |
|
|
|
|
|
|
|
|
getUserOrder(options = {}) { |
|
|
|
|
|
let per_page = this.pageSize; |
|
|
|
|
|
let tab_item = this.tab_list[this.current]; |
|
|
|
|
|
this.$http(this.API.API_ORDERLIST, { |
|
|
|
|
|
status: this.tab_list[this.current].type, |
|
|
|
|
|
page: tab_item.page |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
let isPage = res.data.has_more_page; |
|
|
|
|
|
tab_item.isPage = isPage; |
|
|
|
|
|
if (!isPage) { |
|
|
|
|
|
tab_item.loadingClass = false; |
|
|
|
|
|
tab_item.loadingText = '没有更多数据啦~'; |
|
|
|
|
|
} |
|
|
|
|
|
if(options.type == 'pageRefresh'){ |
|
|
|
|
|
uni.stopPullDownRefresh(); |
|
|
|
|
|
}else if(options.type == 'scrollRefresh'){ |
|
|
|
|
|
this.isRefresher = false; |
|
|
|
|
|
} |
|
|
|
|
|
if (tab_item.page == 1) { |
|
|
|
|
|
tab_item.list = res.data.data; |
|
|
|
|
|
} else { |
|
|
|
|
|
tab_item.list.push(...res.data.data); |
|
|
|
|
|
} |
|
|
|
|
|
console.log(tab_item.list) |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 切换tab |
|
|
// 切换tab |
|
|
@ -131,34 +183,60 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 页面触底,加载下一页 |
|
|
// 页面触底,加载下一页 |
|
|
onScrolltolower() { |
|
|
|
|
|
|
|
|
onScrolltolower(){ |
|
|
let tab_item = this.tab_list[this.current]; |
|
|
let tab_item = this.tab_list[this.current]; |
|
|
if (tab_item.isPage) { |
|
|
|
|
|
|
|
|
if(tab_item.isPage){ |
|
|
tab_item.page = tab_item.page + 1; |
|
|
tab_item.page = tab_item.page + 1; |
|
|
this.getUserOrder(); |
|
|
this.getUserOrder(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// scroll-view 下拉刷新 |
|
|
// scroll-view 下拉刷新 |
|
|
onRefresherrefresh() { |
|
|
|
|
|
|
|
|
onRefresherrefresh(){ |
|
|
this.isRefresher = true; |
|
|
this.isRefresher = true; |
|
|
this.refreshFn({ |
|
|
|
|
|
type: 'scrollRefresh' |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
this.refreshFn({type: 'scrollRefresh'}); |
|
|
}, |
|
|
}, |
|
|
// 下拉刷新处理 |
|
|
// 下拉刷新处理 |
|
|
refreshFn(options) { |
|
|
|
|
|
|
|
|
refreshFn(options){ |
|
|
let tab_item = this.tab_list[this.current]; |
|
|
let tab_item = this.tab_list[this.current]; |
|
|
tab_item.page = 1; |
|
|
tab_item.page = 1; |
|
|
tab_item.isPage = true; |
|
|
tab_item.isPage = true; |
|
|
tab_item.loadingClass = true; |
|
|
tab_item.loadingClass = true; |
|
|
|
|
|
tab_item.list = [] |
|
|
tab_item.loadingText = '正在加载中'; |
|
|
tab_item.loadingText = '正在加载中'; |
|
|
this.getUserOrder(options); |
|
|
this.getUserOrder(options); |
|
|
|
|
|
}, |
|
|
|
|
|
timer(value, fmt) { |
|
|
|
|
|
if(!value) return; |
|
|
|
|
|
let newTime = new Date(value) |
|
|
|
|
|
if(!fmt){ |
|
|
|
|
|
fmt = 'yyyy-MM-dd hh:mm'; |
|
|
|
|
|
} |
|
|
|
|
|
if(/(y+)/.test(fmt)) { |
|
|
|
|
|
fmt = fmt.replace(RegExp.$1, (newTime.getFullYear() + '').substr(4 - RegExp.$1.length)); |
|
|
|
|
|
} |
|
|
|
|
|
let o = { |
|
|
|
|
|
'M+': newTime.getMonth() + 1, |
|
|
|
|
|
'd+': newTime.getDate(), |
|
|
|
|
|
'h+': newTime.getHours(), |
|
|
|
|
|
'm+': newTime.getMinutes(), |
|
|
|
|
|
's+': newTime.getSeconds() |
|
|
|
|
|
}; |
|
|
|
|
|
function padLeftZero(str) { |
|
|
|
|
|
return ('00'+str).substr(str.length); |
|
|
|
|
|
} |
|
|
|
|
|
// 遍历这个对象 |
|
|
|
|
|
for (let k in o) { |
|
|
|
|
|
if (new RegExp(`(${k})`).test(fmt)) { |
|
|
|
|
|
// console.log(`${k}`) |
|
|
|
|
|
let str = o[k] + ''; |
|
|
|
|
|
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return fmt; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onPullDownRefresh() { |
|
|
onPullDownRefresh() { |
|
|
this.refreshFn({ |
|
|
|
|
|
type: 'pageRefresh' |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
this.refreshFn({type: 'pageRefresh'}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
@ -199,6 +277,7 @@ |
|
|
// 商品列表 |
|
|
// 商品列表 |
|
|
.com { |
|
|
.com { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
|
|
|
height: 100%; |
|
|
overflow: hidden; |
|
|
overflow: hidden; |
|
|
|
|
|
|
|
|
.list { |
|
|
.list { |
|
|
|