2023-3-13
余额 我的收藏 我的云链
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
"name" : "汇融云链",
|
||||
"appid" : "__UNI__FB2C9C4",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0.9",
|
||||
"versionCode" : 1009,
|
||||
"versionName" : "1.0.1.0",
|
||||
"versionCode" : 1010,
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
|
||||
@@ -210,7 +210,8 @@
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"path": "pages/order/createOrder",
|
||||
"style": {
|
||||
"navigationBarTitleText": "创建订单"
|
||||
@@ -705,6 +706,8 @@
|
||||
"path": "user/collect",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的收藏",
|
||||
"enablePullDownRefresh": true,
|
||||
"onReachBottomDistance": 126, //距离底部多远时触发 单位px
|
||||
"app-plus": {
|
||||
"bounce": "none"
|
||||
}
|
||||
|
||||
@@ -8,9 +8,18 @@
|
||||
<view class="" style="display: flex;align-items: center;">
|
||||
<image class="portrait" mode="aspectFill" :src="userDetailInfo.icon" @click="toUserInfo">
|
||||
</image>
|
||||
<view class="user-name" style="margin-left: 10upx;color: #FFFFFF;" @click="toUserInfo">
|
||||
{{ userDetailInfo.nickname || userDetailInfo.username }}
|
||||
<view style="display: flex;flex-direction: column;">
|
||||
<view class="user-name" style="margin-left: 20upx;color: #FFFFFF;font-size: 28px;"
|
||||
@click="toUserInfo">
|
||||
{{ userDetailInfo.nickname }}
|
||||
</view>
|
||||
<view class="user-name"
|
||||
style="margin-left: 20upx;color: #FFFFFF;font-size: 18px;margin-top: 5px;"
|
||||
@click="toUserInfo">
|
||||
{{ userDetailInfo.phone }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="userDetailInfo.storeId" class="vip-card-box1"
|
||||
@click="toNav('../../pagesC/seller/index')">
|
||||
<view class="b-btn">卖家中心</view>
|
||||
@@ -19,7 +28,13 @@
|
||||
</template>
|
||||
<template v-else>
|
||||
<!-- #ifdef H5 || APP-PLUS -->
|
||||
<image class="portrait" mode="aspectFill" src="/static/missing-face.png" @click="toLogin">
|
||||
<view style="display: flex;flex-direction: row; align-items: center;" @click="toLogin">
|
||||
<image class="portrait" mode="aspectFill" src="/static/missing-face.png">
|
||||
<view class="user-name" style="margin-left: 20upx;color: #FFFFFF;font-size: 28px;">
|
||||
注册/登录
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</image>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
@@ -56,14 +71,25 @@
|
||||
<image class="arc" src="/static/arc.png"></image>
|
||||
|
||||
<view class="tj-sction">
|
||||
<view class="tj-item" @click="toNav('../../pagesU/user/deposit')">
|
||||
<!-- <view class="tj-item" @click="toNav('../../pagesU/user/deposit')">
|
||||
<text class="num">{{ userDetailInfo.blance || 0}}</text>
|
||||
<text>余额</text>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- <list-cell icon="icon-shoucang_xuanzhongzhuangtai" iconColor="#54b4ef" title="我的收藏"
|
||||
@eventClick="navTo('../../pagesU/user/collect')"></list-cell>
|
||||
-->
|
||||
<view class="tj-item" @click="toNav('../../pagesU/user/coupon')">
|
||||
<text class="num">{{ couponList.length || 0 }}</text>
|
||||
<text>优惠券</text>
|
||||
</view>
|
||||
|
||||
<view class="tj-item" @click="toNav('../../pagesU/user/collect')">
|
||||
<text class="num">{{ listCollect || 0}}</text>
|
||||
<!-- <image src="../../static/temp/antFill-gift.png" style="width:25px;height: 25px;margin-bottom: 8px;"></image> -->
|
||||
<text>收藏</text>
|
||||
</view>
|
||||
|
||||
<!-- <view class="tj-item" @click="toNav('/pages/integral/home/home')">
|
||||
<text class="num">{{ userDetailInfo.integration || 0 }}</text>
|
||||
<text>积分</text>
|
||||
@@ -111,8 +137,8 @@
|
||||
@eventClick="navTo('../../pagesU/user/profile')"></list-cell>
|
||||
<!--<list-cell icon="icon-share" iconColor="#9789f7" title="分享" tips="邀请好友赢10万大礼"></list-cell>
|
||||
<list-cell icon="icon-pinglun-copy" iconColor="#ee883b" title="晒单" tips="晒单抢红包"></list-cell>-->
|
||||
<list-cell icon="icon-shoucang_xuanzhongzhuangtai" iconColor="#54b4ef" title="我的收藏"
|
||||
@eventClick="navTo('../../pagesU/user/collect')"></list-cell>
|
||||
<!-- <list-cell icon="icon-shoucang_xuanzhongzhuangtai" iconColor="#54b4ef" title="我的收藏"
|
||||
@eventClick="navTo('../../pagesU/user/collect')"></list-cell> -->
|
||||
<!-- <list-cell
|
||||
icon="icon-share cgtt"
|
||||
iconColor="#0e68d7"
|
||||
@@ -192,7 +218,8 @@
|
||||
},
|
||||
|
||||
couponList: [],
|
||||
viewList: []
|
||||
viewList: [],
|
||||
listCollect: 0
|
||||
};
|
||||
},
|
||||
|
||||
@@ -266,6 +293,7 @@
|
||||
async getData() {
|
||||
this.getuserinfo();
|
||||
this.getHistory();
|
||||
this.getCollect();
|
||||
},
|
||||
// 获取用户信息
|
||||
async getuserinfo() {
|
||||
@@ -297,6 +325,32 @@
|
||||
this.viewList = data.result;
|
||||
}
|
||||
},
|
||||
// 获取收藏记录
|
||||
async getCollect() {
|
||||
let that = this
|
||||
if (this.hasLogin) {
|
||||
let params = {};
|
||||
let data = await Api.apiCall('get', Api.goods.listCollect, params);
|
||||
console.log("listCollect", data)
|
||||
console.log("listCollect", data.total)
|
||||
|
||||
this.listCollect = data.total
|
||||
// if (data.records){
|
||||
// let orderList = data.records.filter(item => {
|
||||
// //添加不同状态下订单的表现形式
|
||||
// if (item.type == 1) {
|
||||
// if (item.meno3 == null) {
|
||||
// item.meno3 = 0;
|
||||
// }
|
||||
// item.meno3 = '销量:' + item.meno3;
|
||||
// return item;
|
||||
// }
|
||||
// });
|
||||
// this.listCollect = orderList.length
|
||||
// }
|
||||
|
||||
}
|
||||
},
|
||||
upData() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
</label>
|
||||
</view>
|
||||
<view class="type-item" @click="changePayType(3)">
|
||||
<!-- <view class="type-item" @click="changePayType(3)">
|
||||
<text class="icon yticon icon-erjiye-yucunkuan"></text>
|
||||
<view class="con">
|
||||
<text class="tit">预存款支付</text>
|
||||
@@ -38,7 +38,7 @@
|
||||
<radio value="" color="#fa436a" :checked='payType == 3' />
|
||||
|
||||
</label>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<text class="mix-btn" @click="confirm">确认支付</text>
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
let data = await Api.apiCall('get', Api.order.orderList, params);
|
||||
console.log("data:------" + data)
|
||||
let goodsList = data.records;
|
||||
let goodsListJson = JSON.stringify(goodsList)
|
||||
// let goodsListJson = JSON.stringify(goodsList)
|
||||
// console.log("goodsList:" + goodsListJson)
|
||||
let orderList = goodsList.filter(item => {
|
||||
//添加不同状态下订单的表现形式
|
||||
|
||||
@@ -153,6 +153,17 @@
|
||||
}
|
||||
let data = await Api.apiCall('post', Api.index.simpleReg, params);
|
||||
|
||||
if(data.data.code==500){
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
title:data.data.data,
|
||||
duration: 2000
|
||||
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
|
||||
<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
|
||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
|
||||
<scroll-view class="list-scroll-content" scroll-y>
|
||||
<!-- 空白页 -->
|
||||
<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
|
||||
|
||||
@@ -30,11 +30,10 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<uni-load-more :status="tabItem.loadingType"></uni-load-more>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
<uni-load-more :status="loadingType"></uni-load-more>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -59,6 +58,7 @@
|
||||
return {
|
||||
tabCurrentIndex: 0,
|
||||
pageNum: 1,
|
||||
loadingType: 'more', //加载更多状态
|
||||
navList: [{
|
||||
type: 1,
|
||||
text: '收藏商品',
|
||||
@@ -105,10 +105,10 @@
|
||||
onPullDownRefresh() {
|
||||
|
||||
console.log("onPullDownRefresh")
|
||||
this.pageNum = this.pageNum + 1;
|
||||
this.pageNum = 1;
|
||||
// this.getNewProductList('refresh');
|
||||
|
||||
this.loadData();
|
||||
this.loadData('refresh');
|
||||
setTimeout(function() {
|
||||
uni.stopPullDownRefresh();
|
||||
}, 2000);
|
||||
@@ -123,31 +123,9 @@
|
||||
});
|
||||
},
|
||||
//获取订单列表
|
||||
async loadData(source) {
|
||||
async loadData(type = 'add', loading) {
|
||||
// console.log('=======================')
|
||||
|
||||
//这里是将订单挂载到tab列表下
|
||||
let index = this.tabCurrentIndex;
|
||||
let navItem = this.navList[index];
|
||||
let type = navItem.type;
|
||||
|
||||
if (source === 'tabChange' && navItem.loaded === true) {
|
||||
//tab切换只有第一次需要加载数据
|
||||
return;
|
||||
}
|
||||
if (navItem.loadingType === 'loading') {
|
||||
//防止重复加载
|
||||
return;
|
||||
}
|
||||
|
||||
navItem.loadingType = 'loading';
|
||||
|
||||
// if (!this.hasLogin) {
|
||||
// url = '/pages/public/login';
|
||||
// uni.navigateTo({
|
||||
// url
|
||||
// });
|
||||
// } else {
|
||||
//没有更多直接返回
|
||||
if (type === 'add') {
|
||||
if (this.loadingType === 'nomore') {
|
||||
@@ -157,10 +135,18 @@
|
||||
} else {
|
||||
this.loadingType = 'more';
|
||||
}
|
||||
//这里是将订单挂载到tab列表下
|
||||
let index = this.tabCurrentIndex;
|
||||
let navItem = this.navList[index];
|
||||
console.log(navItem);
|
||||
let status = navItem.type;
|
||||
|
||||
let params = {
|
||||
pageNum: this.pageNum,
|
||||
};
|
||||
|
||||
let data = await Api.apiCall('get', Api.goods.listCollect, params);
|
||||
console.log("data>>>>", data);
|
||||
|
||||
let orderList = data.records.filter(item => {
|
||||
//添加不同状态下订单的表现形式
|
||||
@@ -169,21 +155,96 @@
|
||||
item.meno3 = 0;
|
||||
}
|
||||
item.meno3 = '销量:' + item.meno3;
|
||||
return item;
|
||||
}
|
||||
});
|
||||
if (type === 'refresh') {
|
||||
navItem.orderList = [];
|
||||
}
|
||||
console.log("orderList.length======:" + orderList.length)
|
||||
navItem.orderList = navItem.orderList.concat(orderList);
|
||||
console.log("data.total======:" + data.total)
|
||||
console.log("length======:" + navItem.orderList.length)
|
||||
//判断是否还有下一页,有是more 没有是nomore(测试数据判断大于20就没有了)
|
||||
this.loadingType = navItem.orderList.length >= data.total ? 'nomore' : 'more';
|
||||
console.log("type======:" + type)
|
||||
console.log("loadingType======:" + this.loadingType)
|
||||
if (type === 'refresh') {
|
||||
if (loading == 1) {
|
||||
uni.hideLoading();
|
||||
} else {
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
}
|
||||
|
||||
item = Object.assign(item, this.orderStateExp(item.type));
|
||||
item.addTime = this.dateFormat(item.addTime);
|
||||
return item.type === type;
|
||||
});
|
||||
orderList.forEach(item => {
|
||||
navItem.orderList.push(item);
|
||||
});
|
||||
//loaded新字段用于表示数据加载完毕,如果为空可以显示空白页
|
||||
this.$set(navItem, 'loaded', true);
|
||||
|
||||
//判断是否还有数据, 有改为 more, 没有改为noMore
|
||||
navItem.loadingType = 'more';
|
||||
// //这里是将订单挂载到tab列表下
|
||||
// let index = this.tabCurrentIndex;
|
||||
// let navItem = this.navList[index];
|
||||
// let type = navItem.type;
|
||||
|
||||
// if (source === 'tabChange' && navItem.loaded === true) {
|
||||
// //tab切换只有第一次需要加载数据
|
||||
// return;
|
||||
// }
|
||||
// if (navItem.loadingType === 'loading') {
|
||||
// //防止重复加载
|
||||
// return;
|
||||
// }
|
||||
|
||||
// navItem.loadingType = 'loading';
|
||||
// //没有更多直接返回
|
||||
// if (type === 'add') {
|
||||
// if (this.loadingType === 'nomore') {
|
||||
// return;
|
||||
// }
|
||||
// this.loadingType = 'loading';
|
||||
// } else {
|
||||
// this.loadingType = 'more';
|
||||
// }
|
||||
// let params = {
|
||||
// pageNum: this.pageNum,
|
||||
// };
|
||||
|
||||
// console.log("params", params)
|
||||
// let data = await Api.apiCall('get', Api.goods.listCollect, params);
|
||||
|
||||
// let orderList = data.records.filter(item => {
|
||||
// //添加不同状态下订单的表现形式
|
||||
// if (item.type == 1) {
|
||||
// if (item.meno3 == null) {
|
||||
// item.meno3 = 0;
|
||||
// }
|
||||
// item.meno3 = '销量:' + item.meno3;
|
||||
// }
|
||||
|
||||
// item = Object.assign(item, this.orderStateExp(item.type));
|
||||
// item.addTime = this.dateFormat(item.addTime);
|
||||
// return item.type === type;
|
||||
// });
|
||||
// if (type === 'refresh') {
|
||||
// navItem.orderList = [];
|
||||
// }
|
||||
// navItem.orderList = navItem.orderList.concat(orderList);
|
||||
// // orderList.forEach(item => {
|
||||
// // navItem.orderList.push(item);
|
||||
// // });
|
||||
// //loaded新字段用于表示数据加载完毕,如果为空可以显示空白页
|
||||
// this.$set(navItem, 'loaded', true);
|
||||
|
||||
// //判断是否还有数据, 有改为 more, 没有改为noMore
|
||||
// // navItem.loadingType = 'more';
|
||||
// navItem.loadingType = navItem.orderList.length >= data.total ? 'nomore' : 'more';
|
||||
// console.log("type======:" + type)
|
||||
// console.log("loadingType======:" + navItem.loadingType)
|
||||
// if (type === 'refresh') {
|
||||
// if (loading == 1) {
|
||||
// uni.hideLoading();
|
||||
// } else {
|
||||
// uni.stopPullDownRefresh();
|
||||
// }
|
||||
// }
|
||||
|
||||
},
|
||||
|
||||
//swiper 切换
|
||||
|
||||
Reference in New Issue
Block a user