Browse Source

2024-4-20

cmy 10 months ago
parent
commit
9a36bf8c1e
7 changed files with 466 additions and 494 deletions
  1. 31 1
      api/game.js
  2. 0 0
      libs/dayjs/dayjs.min.js
  3. 7 18
      pages/index/index.vue
  4. 95 89
      pages/index/order.vue
  5. 181 152
      pages/index/personal.vue
  6. 152 48
      pages/index/pledge.vue
  7. 0 186
      utils/util.js

+ 31 - 1
api/game.js

@@ -82,4 +82,34 @@ export  function getsell(data) {
 		method: 'get',
 		data
 	});
-}
+}
+
+// 挂出
+export  function sellPush(data) {
+	return request({
+		url: `/api/sell`,
+		method: 'post',
+		data
+	});
+}
+
+// 我的挂出列表
+export  function registerVerify(data) {
+	return request({
+		url: `/api/register/verify`,
+		method: 'get',
+		data
+	});
+}
+
+
+// 实名认证
+export  function real_check(data) {
+	return request({
+		url: `/api/user/real_check`,
+		method: 'post',
+		data
+	});
+}
+
+

File diff suppressed because it is too large
+ 0 - 0
libs/dayjs/dayjs.min.js


+ 7 - 18
pages/index/index.vue

@@ -132,8 +132,9 @@
 		getIndex
 	} from '@/api/index.js';
 	import {
-		getGameList,
-	} from "@/api/game.js";
+		saveUrl,
+		interceptor
+	} from '@/utils/loginUtils.js';
 	import {
 		mapState,
 		mapActions,
@@ -153,7 +154,7 @@
 				langList: "langList",
 				lang: "lang",
 			}),
-			...mapState('user', ['userInfo']),
+			...mapState('user', ['userInfo','hasLogin']),
 			label() {
 				const label = this.langList.find((item) => {
 					console.log(this.lang, item.value);
@@ -180,15 +181,16 @@
 			// #endif
 		},
 		onShow() {
-			this.getGameList();
 			this.loadData();
 		},
 		methods: {
-			...mapMutations('user', ['setUserInfo', 'login']),
 			...mapActions({
 				setLang: "setLang",
 			}),
 			openurl(url){
+				if(!this.hasLogin){
+					return 
+				}
 				uni.navigateTo({
 					url: url,
 					fail: (err) => {
@@ -219,19 +221,6 @@
 					})
 					.catch(e => {});
 			},
-			selectLang(value) {
-				this.setLang(this.langList[value.detail.value].value);
-			},
-
-			getGameList() {
-				getGameList().then((res) => {
-					this.gameList = res.data.list;
-
-					if (this.gameList.length > 2) {
-						this.gameList = this.gameList.slice(0, 2)
-					}
-				})
-			},
 			comfirm(text) {
 				console.log(text);
 				const result = this.uniCopy(text);

+ 95 - 89
pages/index/order.vue

@@ -2,12 +2,14 @@
 	<view class="all">
 		<view class="fixedBox">
 			<view class="navList flex">
-				<view v-for="(item, index) in navItem" :key="index" class="navItem" 
-				:class="{ activeItem: tabIndex === index,tip:index == 0 }" @click="tabClick(index,0,1)">{{ item }}</view>
+				<view v-for="(item, index) in navItem" :key="index" class="navItem"
+					:class="{ activeItem: tabIndex === index,tip:index == 0 }" @click="tabClick(index,0,1)">{{ item }}
+				</view>
 			</view>
 			<view class="navList flex navList2">
-				<view v-for="(item, index) in navList" :key="index" class="navItem" 
-				:class="{ activeItem: tabCurr === index}" @click="tabClick(index,item.status,2)">{{ item.name }}</view>
+				<view v-for="(item, index) in navList[tabIndex]" :key="index" class="navItem"
+					:class="{ activeItem: tabCurr === index}" @click="tabClick(index,item.status,2)">{{ item.name }}
+				</view>
 			</view>
 		</view>
 		<view class="listItemBox">
@@ -26,7 +28,8 @@
 						<view class="tipText">2023-04-25 14:20:30</view>
 					</view>
 					<view class="" style="text-align: right;">
-						<image src="/static/image/img21.png" style="width: 40rpx;margin-bottom: 25rpx;" mode="widthFix"></image>
+						<image src="/static/image/img21.png" style="width: 40rpx;margin-bottom: 25rpx;" mode="widthFix">
+						</image>
 						<view class="tipBtn">查看凭证</view>
 					</view>
 				</view>
@@ -37,7 +40,7 @@
 
 <script>
 	import {
-		getsell
+		registerVerify
 	} from '@/api/game.js';
 	import {
 		mapState
@@ -48,46 +51,62 @@
 		},
 		data() {
 			return {
-			tabIndex: 0,
-			navItem: ['卖币订单','买币订单'],
-			tabCurr:0,
-			status:0,//状态
-			navList: [{
-				name:'全部',
-				status:0
-			},{
-				name:'挂单中',
-				status:1
-			},{
-				name:'已售罄',
-				status:2
-			},{
-				name:'已下架',
-				status:3
-			}],
-			page:1,
-			loadingType: "more",
-			list:[{},{},{},{},{},{},{},{},{},{}]
-		}
+				tabIndex: 0,//当前选中的一级分类
+				navItem: ['卖币订单', '买币订单'],
+				tabCurr: 0,//当前选中的二级分类
+				status: 0, //当前选中状态
+				navList: [
+					[{
+						name: '全部',
+						status: 0
+					}, {
+						name: '挂单中',
+						status: 1
+					}, {
+						name: '已售罄',
+						status: 2
+					}, {
+						name: '已下架',
+						status: 3
+					}],
+					[{
+						name: '全部',
+						status: 0
+					}, {
+						name: '进行中',
+						status: 1
+					}, {
+						name: '已完成',
+						status: 2
+					}, {
+						name: '已取消',
+						status: 3
+					}]
+				],
+				page: 1,
+				limit:10,
+				loadingType: "more",
+				list: []
+			}
 		},
 		onLoad() {
-			// this.loadData()
+			this.loadData()
 		},
 		onReachBottom() {
 			this.loadData()
 		},
 		methods: {
-			loadData(){
+			loadData() {
 				let obj = this;
 				if (obj.loadingType == "nomore" ||
-					obj.loadingType == "loading"){
+					obj.loadingType == "loading") {
 					return;
 				}
 				obj.loadingType = "loading";
-				getList({
-					page:obj.page,
-					limit:10
-				},obj.status).then(res => {
+				registerVerify({
+					page: obj.page,
+					limit: 10
+				}, obj.status).then(res => {
 					if (res.length > 0) {
 						obj.list = obj.list.concat(res);
 						obj.page++;
@@ -99,50 +118,24 @@
 					}
 				});
 			},
-			tabClick(index,status,type) {
-				this.page = 1;
-				this.loadingType = "more";
-				this.list = []
-				if(type == 1){
+			tabClick(index, status, type) {
+				if (type == 1) {
+					if(index ==this.tabIndex ){
+						return
+					}
 					this.tabIndex = index;
 					this.tabCurr = 0
-					if(this.tabIndex == 0){
-						this.navList = [{
-							name:'全部',
-							status:0
-						},{
-							name:'挂单中',
-							status:1
-						},{
-							name:'已售罄',
-							status:2
-						},{
-							name:'已下架',
-							status:3
-						}]
-					}
-					if(this.tabIndex == 1){
-						this.navList = [{
-							name:'全部',
-							status:0
-						},{
-							name:'进行中',
-							status:1
-						},{
-							name:'已完成',
-							status:2
-						},{
-							name:'已取消',
-							status:3
-						}]
+				} else if(type==2) {
+					if(index ==this.tabCurr ){
+						return
 					}
-					this.loadData()
-				}else{
 					this.tabCurr = index
 					this.status = status
-					
-					this.loadData()
 				}
+				this.page = 1;
+				this.loadingType = "more";
+				this.list = []
+				this.loadData()
 			},
 		}
 	};
@@ -155,74 +148,87 @@
 		background-color: #051137;
 		padding-top: var(--status-bar-height);
 	}
-	.fixedBox{
+
+	.fixedBox {
 		position: fixed;
 		top: 44px;
 		left: 0;
 		width: 100%;
 		z-index: 9;
 	}
-	.navList{
-		padding: 30rpx 50rpx 20rpx 50rpx;
+
+	.navList {
+		padding: 20rpx 50rpx 20rpx 50rpx;
 		background: #1F2A4A;
-		.navItem{
+
+		.navItem {
 			color: #fff;
 			font-size: 30rpx;
 			text-align: center;
 			width: 50%;
-			&.activeItem{
+
+			&.activeItem {
 				color: #0C5AFA;
 				position: relative;
+
 				&:after {
 					content: '';
 					position: absolute;
-					left:36%;
+					left: 36%;
 					bottom: -20rpx;
 					width: 30%;
 					height: 8rpx;
-					 // transform: translateX(-50%);
+					// transform: translateX(-50%);
 					border-bottom: 4rpx solid #0C5AFA;
 					border-radius: 0rpx 20rpx 0rpx 0rpx;
 				}
 			}
-			&.tip{
+
+			&.tip {
 				border-right: 1rpx solid #333D5B;
 			}
 		}
 	}
-	.navList2{
+
+	.navList2 {
 		background: #051137;
-		padding: 30rpx 25rpx 20rpx 25rpx;
+		padding: 20rpx 25rpx 20rpx 25rpx;
 	}
-	.listItemBox{
+
+	.listItemBox {
 		padding-top: 88px;
-		.listItem{
+
+		.listItem {
 			padding: 34rpx 34rpx;
 			background: #1F2A4A;
 			margin-bottom: 25rpx;
-			.name{
+
+			.name {
 				font-family: PingFang SC;
 				font-weight: bold;
 				font-size: 30rpx;
 				color: #FFFFFF;
 				padding-left: 25rpx;
 			}
-			.itemTpl{
+
+			.itemTpl {
 				font-family: PingFang SC;
 				font-weight: bold;
 				font-size: 36rpx;
 				color: #0C5AFA;
 				padding-top: 25rpx;
 			}
-			.itemTip{
-				.tipText{
+
+			.itemTip {
+				.tipText {
 					font-family: PingFang SC;
 					font-weight: 500;
 					font-size: 26rpx;
 					color: #999999;
 					padding-top: 15rpx;
 				}
-				.tipBtn{
+
+				.tipBtn {
 					font-family: PingFang SC;
 					font-weight: bold;
 					font-size: 24rpx;

+ 181 - 152
pages/index/personal.vue

@@ -1,171 +1,200 @@
 <template>
-  <view class="body_content">
-	<view class="login_text">
-		<view class="login_input flex" style="padding-top: 45rpx;"> 
-			<view class="login_name">姓名</view>
-			<view class="login_name"><input class="uni-input" type="text" v-model="username" placeholder="请输入真实姓名" /></view>
-		</view>
-		<view class="login_input flex">
-			<view class="login_name"><text>身份证号</text></view>
-			<view class="login_name"><input class="uni-input" type="idcard" v-model="idCard" placeholder="请输入身份证号" /></view>
-		</view>
-		<view class="login_input flex">
+	<view class="body_content">
+		<view class="login_text">
+			<view class="login_input flex" style="padding-top: 45rpx;">
+				<view class="login_name">姓名</view>
+				<view class="login_name"><input class="uni-input" type="text" v-model="username"
+						placeholder="请输入真实姓名" /></view>
+			</view>
+			<view class="login_input flex">
+				<view class="login_name"><text>身份证号</text></view>
+				<view class="login_name"><input class="uni-input" type="idcard" v-model="idCard"
+						placeholder="请输入身份证号" /></view>
+			</view>
+			<!-- <view class="login_input flex">
 			<view class="login_name"><text>手机号</text></view>
 			<view class="login_name"><input class="uni-input" type="number" v-model="phone" placeholder="请输入手机号" /></view>
-		</view>
-		<view class="login_input flex">
+		</view> -->
+			<!-- <view class="login_input flex">
 			<view class="login_name"><text>验证码</text></view>
 			<view class="login_name flex_item">
 				<input style="width: 310rpx;" class="uni-input" type="number" v-model="vcode" placeholder="请输入验证码" />
 				<view class="" style="font-size: 26rpx;color: #0C5AFA;">获取验证码</view>
 			</view>
+		</view> -->
 		</view>
-	</view>
-	<view class="uploadText">身份证照片(正反两面)</view>
-	<view class="flex upLoadBox">
-		<view class="imageBox flex">
-			<image src="../../static/img/add.png" style="width: 180rpx;" mode="widthFix"></image>
-			<image src="../../static/img/add.png" style="width: 180rpx;" mode="widthFix"></image>
+		<view class="uploadText">身份证照片(正反两面)</view>
+		<view class="flex upLoadBox">
+			<view class="imageBox flex">
+				<image @click="upimg('front_pic')" :src="front_pic||`../../static/img/add.png`" style="width: 180rpx;"
+					mode="widthFix"></image>
+				<image @click="upimg('back_pic')" :src="back_pic||`../../static/img/add.png`" style="width: 180rpx;"
+					mode="widthFix"></image>
+			</view>
+		</view>
+		<view class="submission">
+			<button class="golden" type="golden" hover-class="none" @click="submission">提交认证</button>
 		</view>
-	</view>
-	<view class="submission">
-		<button class="golden" type="golden" hover-class="none" @click="submission">提交认证</button>
 	</view>
 	</view>
-  </view>
 </template>
 <script type="text/javascript">
-// import { show_us,attestation } from '@/api/user.js';
-export default {
-  data() {
-    return {
-	  username:'',
-	  idCard:'',
-	  phone:'',
-	  vcode:''
-    };
-  },
-  onLoad() {
-  	// this.uid = uni.getStorageSync('uid');
-  	// console.log(uni.getStorageSync('uid'),this.uid)
-   //  this.loadData();
-  },
-  methods: {
-    //获取数据
-    loadData() {
-      show_us({
-		  uid:this.uid
-	  })
-        .then(data => {
-		  let obj = this;
-          obj.list = data.data;
-		  if(data.data.card == null){
-			  obj.number = "";
-		  }else{
-			   obj.number = data.data.card;
-		  }
-		 if(data.data.email == null){
-			obj.mail = ""; 
-		 }else{
-			 obj.mail = data.data.email;
-		 }
-		 if( data.data.name == null){
-			 obj.username = '';
-		 }else{
-			 obj.username = data.data.name;
-		 }
-		  
-        })
-        .catch(err => {
-          console.log(err);
-        });
-    },
-	// 提交
-	submission() {
-		if (this.mail == '') {
-			this.$api.msg('请输入电子邮箱');
-			return;
-		}
-		if (this.username == '') {
-			this.$api.msg('请输入真实姓名');
-			return;
-		}
-		if (this.number == '') {
-			this.$api.msg('请输入身份证号');
-			return;
+	import {
+		real_check
+	} from '@/api/game.js';
+	import {
+		upload
+	} from '@/api/order.js';
+	export default {
+		data() {
+			return {
+				username: '',
+				idCard: '',
+				phone: '',
+				vcode: '',
+				front_pic: '',
+				back_pic: '',
+			};
+		},
+		onLoad() {
+			// this.uid = uni.getStorageSync('uid');
+			// console.log(uni.getStorageSync('uid'),this.uid)
+			//  this.loadData();
+		},
+		methods: {
+			upimg(img) {
+				const that = this;
+				upload().then((re) => {
+					that[img] = re[0].url;
+				}).catch((re) => {
+					console.log(re,'err');
+				})
+			},
+			//获取数据
+			// loadData() {
+			// 	real_check({
+			// 			name: this.username,
+			// 			id_card: this.idCard,
+			// 			front_pic: this.front_pic,
+			// 			back_pic: this.back_pic,
+			// 		})
+			// 		.then(data => {
+			// 			let obj = this;
+			// 			obj.list = data.data;
+			// 			if (data.data.card == null) {
+			// 				obj.number = "";
+			// 			} else {
+			// 				obj.number = data.data.card;
+			// 			}
+			// 			if (data.data.email == null) {
+			// 				obj.mail = "";
+			// 			} else {
+			// 				obj.mail = data.data.email;
+			// 			}
+			// 			if (data.data.name == null) {
+			// 				obj.username = '';
+			// 			} else {
+			// 				obj.username = data.data.name;
+			// 			}
+
+			// 		})
+			// 		.catch(err => {
+			// 			console.log(err);
+			// 		});
+			// },
+			// 提交
+			submission() {
+				if (this.username == '') {
+					this.$api.msg('请输入真实姓名');
+					return;
+				}
+				if (this.idCard == '') {
+					this.$api.msg('请输入身份证号');
+					return;
+				}
+				if (this.front_pic == ''||this.back_pic == '') {
+					this.$api.msg('请上传身份证正反面');
+					return;
+				}
+				real_check({
+						name: this.username,
+						id_card: this.idCard,
+						front_pic: this.front_pic,
+						back_pic: this.back_pic,
+					})
+					.then(function(e) {
+						uni.showToast({
+							title: e.msg,
+							duration: 1500,
+						});
+					})
+					.catch(function(e) {
+						console.log(e);
+					});
+			},
+			//下拉刷新
+			onPullDownRefresh() {
+				let obj = this;
+				//监听下拉刷新动作的执行方法,每次手动下拉刷新都会执行一次
+				setTimeout(function() {
+					obj.loadData();
+					uni.stopPullDownRefresh(); //停止下拉刷新动画
+				}, 1000);
+			}
 		}
-		attestation({
-			uid:this.uid,
-			email: this.mail,
-			name: this.username,
-			card: this.number,
-		})
-			.then(function(e) {
-				uni.showToast({
-					title: e.message,
-					duration: 1500,
-					mask: false,
-					icon: 'none'
-				});
-			})
-			.catch(function(e) {
-				console.log(e);
-			});
-	},
-	//下拉刷新
-	onPullDownRefresh() {
-		let obj = this;
-		//监听下拉刷新动作的执行方法,每次手动下拉刷新都会执行一次
-		setTimeout(function() {
-			obj.loadData();
-			uni.stopPullDownRefresh(); //停止下拉刷新动画
-		}, 1000);
-	}
-  }
-};
+	};
 </script>
 <style lang="scss">
-.login_text {
-	width: 100%;
-	// padding: 25rpx 0rpx;
-	font-size: 28rpx !important;
-	padding: 0rpx 25rpx;
-}
-.login_input {
-	border-bottom: 1px solid #464755;
-	padding: 35rpx;
-}
-.uploadText{
-	padding: 47rpx 40rpx;
-	color: #ffffff;
-	
-}
-.imageBox{
-	width: 100%;
-	padding: 50rpx 15%;
-}
-.uni-input{
-	width:450rpx;
-	text-align: left !important;
-	font-size: 26rpx;
-}
-.width {
-	width: 265rpx !important;
-}
-.code {
-	color: #EEC680;
-	font-size: 23rpx;
-	border-left: 1px solid #85858E;
-	padding-left: 25rpx;
-}
-.submission{
-	padding: 80rpx 25rpx;
-	.golden{
-		background: #0C5AFA;
+	.login_text {
+		width: 100%;
+		// padding: 25rpx 0rpx;
+		font-size: 28rpx !important;
+		padding: 0rpx 25rpx;
+	}
+
+	.login_input {
+		border-bottom: 1px solid #464755;
+		padding: 35rpx;
+	}
+
+	.uploadText {
+		padding: 47rpx 40rpx;
+		color: #ffffff;
+
+	}
+
+	.imageBox {
+		width: 100%;
+		padding: 50rpx 15%;
+	}
+
+	.uni-input {
+		width: 450rpx;
+		text-align: left !important;
+		font-size: 26rpx;
+	}
+
+	.width {
+		width: 265rpx !important;
+	}
+
+	.code {
+		color: #EEC680;
+		font-size: 23rpx;
+		border-left: 1px solid #85858E;
+		padding-left: 25rpx;
+	}
+
+	.submission {
+		padding: 80rpx 25rpx;
+
+		.golden {
+			background: #0C5AFA;
+			color: #ffffff;
+		}
+	}
+
+	.login_name {
 		color: #ffffff;
 	}
-}
-.login_name {
-	color: #ffffff;
-}
-</style>
+</style>

+ 152 - 48
pages/index/pledge.vue

@@ -1,19 +1,20 @@
 <template>
 	<view class="all">
 		<view class="navList flex">
-			<view v-for="(item, index) in navList" :key="index" class="navItem" 
-			:class="{ activeItem: tabCurrentIndex === index,tip:index == 0 }" @click="tabClick(index)">{{ item }}</view>
+			<view v-for="(item, index) in navList" :key="index" class="navItem"
+				:class="{ activeItem: tabCurrentIndex === index,tip:index == 0 }" @click="tabClick(index)">{{ item }}
+			</view>
 		</view>
 		<view style="padding-top: 44px;" v-if="tabCurrentIndex == 0">
 			<view class="listBox">
 				<view class="titleTetx">数量</view>
 				<view class="flex listTpl">
-					<input type="number" class="inputBox" v-model="number" placeholder="请输入数量"/>
+					<input type="number" class="inputBox" v-model="number" placeholder="请输入数量" />
 					<view class="flex_item">
 						<view class="listTip">USDT</view>
 						<view class="listAll">全部</view>
 					</view>
-					
+
 				</view>
 				<view class="flex tipBox">
 					<view class="tip1">可用余额2.12USDT</view>
@@ -22,7 +23,7 @@
 			</view>
 			<view class="listBox" style="padding-top: 0rpx;">
 				<view class="listTpl">
-					<input type="number" class="inputBox" v-model="price" placeholder="请输入单价"/>
+					<input type="number" class="inputBox" v-model="price" placeholder="请输入单价" />
 				</view>
 				<view class="flex tipBox">
 					<view class="tip1">单价不得大于参考汇率</view>
@@ -38,57 +39,140 @@
 				<view class="itemInfo flex">
 					<view class="flex_item">
 						<image src="/static/image/img20.png" style="width: 55rpx;" mode="widthFix"></image>
-						<view class="name">李丹丹</view>
+						<view class="name">{{item.real_name}}</view>
 					</view>
 					<image src="/static/image/img21.png" style="width: 40rpx;" mode="widthFix"></image>
 				</view>
-				<view class="itemTpl">7.11</view>
+				<view class="itemTpl">{{item.price}}</view>
 				<view class="itemTip flex">
 					<view class="tipBox">
-						<view class="tipText">数量:36212.00</view>
-						<view class="tipText">2023.06.10 12:03:02</view>
+						<view class="tipText">数量:{{item.num}}</view>
+						<view class="tipText">{{item.add_time|dateFormat}}</view>
 					</view>
 					<view class="tipBtn">买入</view>
 				</view>
 			</view>
+			<uni-load-more :status="loadingType"></uni-load-more>
 		</view>
 	</view>
 </template>
 
 <script>
 	import {
-		getsell
+		getsell,
+		sellPush
 	} from '@/api/game.js';
 	import {
 		mapState
 	} from 'vuex';
+	import dayjs from '@/libs/dayjs/dayjs.min.js';
 	export default {
 		computed: {
 			...mapState('user', ['hasLogin'])
 		},
+		filters: {
+			dateFormat: function(value) {
+				return dayjs(value * 1000).format('YYYY/MM/DD HH:mm');
+			}
+		},
 		data() {
 			return {
-			tabCurrentIndex: 1,
-			navList: ['卖出','买入'],
-			number:'',
-			price:'',
-			pages:1,
-			limit:10,
-			list:[{},{},{},{},{},{},{},{},{},{},{},{}]
-		}
+				tabCurrentIndex: 1,
+				navList: ['卖出', '买入'],
+				number: '',
+				price: '',
+				page: 1,
+				limit: 10,
+				list: [],
+				loadingType: 'more'
+			}
 		},
-		onNavigationBarButtonTap(res){
+		onNavigationBarButtonTap(res) {
 			uni.navigateTo({
-				url:'/pages/index/order'
+				url: '/pages/index/order'
 			})
 		},
-		onLoad() {
-			
+		onShow() {
+			this.init();
 		},
 		methods: {
+			// 挂出
+			submission() {
+				sellPush({
+						type: '',
+						num: this.number,
+						price: this.price,
+						phone: '',
+						trade_psw: '',
+						sell_type: '',
+
+					}).then(({
+						data
+					}) => {
+
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
+			init() {
+				this.page = 1;
+				this.list = [];
+				this.loadingType = 'more';
+				this.loadData();
+			},
 			tabClick(index) {
 				this.tabCurrentIndex = index;
 			},
+			async loadData(source) {
+				const that = this;
+				//这里是将订单挂载到tab列表下
+				let navItem = that;
+				if (source === 'tabChange' && navItem.loaded === true) {
+					//tab切换只有第一次需要加载数据
+					return;
+				}
+				if (navItem.loadingType === 'loading') {
+					//防止重复加载
+					return;
+				}
+				if (navItem.loadingType === 'noMore') {
+					//防止重复加载
+					return;
+				}
+				// 修改当前对象状态为加载中
+				navItem.loadingType = 'loading';
+
+				getsell({
+						page: navItem.page,
+						limit: navItem.limit
+					})
+					.then(({
+						data
+					}) => {
+						// 保存我的总金额
+						let arr = data.list.map(e => {
+							e.num = e.num * 1;
+							e.price = e.price * 1;
+							return e;
+						});
+						navItem.list = navItem.list.concat(arr);
+						if (navItem.limit == data.length) {
+							navItem.page++;
+							//判断是否还有数据, 有改为 more, 没有改为noMore
+							navItem.loadingType = 'more';
+							return;
+						} else {
+							//判断是否还有数据, 有改为 more, 没有改为noMore
+							navItem.loadingType = 'noMore';
+						}
+						uni.hideLoading();
+						that.$set(navItem, 'loaded', true);
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
 		}
 	};
 </script>
@@ -101,107 +185,127 @@
 		padding-top: var(--status-bar-height);
 		color: #fff;
 	}
-	.navList{
-		padding: 30rpx 50rpx 20rpx 50rpx;
+
+	.navList {
+		padding: 20rpx 50rpx;
 		background: #1F2A4A;
+		line-height: 1;
 		position: fixed;
 		top: 44px;
 		left: 0;
 		width: 100%;
 		z-index: 9;
-		.navItem{
+
+		.navItem {
 			color: #fff;
 			font-size: 30rpx;
 			text-align: center;
 			width: 50%;
-			&.activeItem{
+
+			&.activeItem {
 				color: #0C5AFA;
 				position: relative;
+
 				&:after {
 					content: '';
 					position: absolute;
-					left:36%;
+					left: 36%;
 					bottom: -20rpx;
 					width: 30%;
 					height: 8rpx;
-					 // transform: translateX(-50%);
+					// transform: translateX(-50%);
 					border-bottom: 4rpx solid #0C5AFA;
 					border-radius: 0rpx 20rpx 0rpx 0rpx;
 				}
 			}
-			&.tip{
+
+			&.tip {
 				border-right: 1rpx solid #333D5B;
 			}
 		}
 	}
-	.listBox{
+
+	.listBox {
 		padding: 62rpx 32rpx;
-		.titleTetx{
+
+		.titleTetx {
 			font-weight: bold;
 			font-size: 24rpx;
 			color: #FFFFFF;
 			padding-bottom: 25rpx;
 		}
-		.tipBox{
+
+		.tipBox {
 			padding-top: 15rpx;
 			font-size: 24rpx;
 		}
 	}
-	.listTpl{
+
+	.listTpl {
 		border-bottom: 1rpx solid #6A7288;
 		padding-bottom: 25rpx;
-		.inputBox{
+
+		.inputBox {
 			font-size: 35rpx;
 			color: #FFFFFF;
 		}
-		.listTip{
-			
-		}
-		.listAll{
+
+		.listTip {}
+
+		.listAll {
 			padding-left: 30rpx;
 			font-size: 24rpx;
 			color: #0C5AFA;
 		}
 	}
-	.submission{
+
+	.submission {
 		padding: 80rpx 25rpx;
 		padding-bottom: 25rpx;
-		.golden{
+
+		.golden {
 			background: #0C5AFA;
 			color: #ffffff;
 		}
 	}
-	.tips{
+
+	.tips {
 		text-align: center;
 	}
-	.listItemBox{
+
+	.listItemBox {
 		padding-top: 44px;
-		.listItem{
+
+		.listItem {
 			padding: 34rpx 34rpx;
 			border-bottom: 1rpx solid #6A7288;
-			.name{
+
+			.name {
 				font-family: PingFang SC;
 				font-weight: bold;
 				font-size: 30rpx;
 				color: #FFFFFF;
 				padding-left: 25rpx;
 			}
-			.itemTpl{
+
+			.itemTpl {
 				font-family: PingFang SC;
 				font-weight: bold;
 				font-size: 36rpx;
 				color: #0C5AFA;
 				padding-top: 25rpx;
 			}
-			.itemTip{
-				.tipText{
+
+			.itemTip {
+				.tipText {
 					font-family: PingFang SC;
 					font-weight: 500;
 					font-size: 24rpx;
 					color: #C1C1C1;
 					padding-top: 15rpx;
 				}
-				.tipBtn{
+
+				.tipBtn {
 					font-family: PingFang SC;
 					font-weight: bold;
 					font-size: 24rpx;

+ 0 - 186
utils/util.js

@@ -158,192 +158,6 @@ import {
  		return [strLength, arr, rows] //  [处理文字的总字节长度,每行显示内容的数组,行数]
  	},
 
- 	/**
- 	 * 获取分享海报
- 	 * @param array arr2 海报素材
- 	 * @param string store_name 素材文字
- 	 * @param string price 价格
- 	 * @param function successFn 回调函数
- 	 * 
- 	 * 
- 	 */
- 	PosterCanvas: function(arr2, store_name, price, successFn) {
- 		let that = this;
- 		uni.showLoading({
- 			title: '海报生成中',
- 			mask: true
- 		});
- 		const ctx = uni.createCanvasContext('myCanvas');
- 		ctx.clearRect(0, 0, 0, 0);
- 		/**
- 		 * 只能获取合法域名下的图片信息,本地调试无法获取
- 		 * 
- 		 */
- 		uni.getImageInfo({
- 			src: arr2[0],
- 			success: function(res) {
-				console.log(res,'getImageInfo')
- 				const WIDTH = res.width;
- 				const HEIGHT = res.height;
- 				ctx.drawImage(arr2[0], 0, 0, WIDTH, HEIGHT);
- 				ctx.drawImage(arr2[1], 0, 0, WIDTH, WIDTH);
- 				ctx.save();
- 				let r = 90;
- 				let d = r * 2;
- 				let cx = 40;
- 				let cy = 990;
- 				ctx.arc(cx + r, cy + r, r, 0, 2 * Math.PI);
- 				// ctx.clip();
- 				ctx.drawImage(arr2[2], cx, cy,d,d);
- 				ctx.restore();
- 				const CONTENT_ROW_LENGTH = 40;
- 				let [contentLeng, contentArray, contentRows] = that.textByteLength(store_name, CONTENT_ROW_LENGTH);
- 				if (contentRows > 2) {
- 					contentRows = 2;
- 					let textArray = contentArray.slice(0, 2);
- 					textArray[textArray.length - 1] += '……';
- 					contentArray = textArray;
- 				}
- 				ctx.setTextAlign('center');
- 				ctx.setFontSize(32);
- 				let contentHh = 32 * 1.3;
- 				for (let m = 0; m < contentArray.length; m++) {
- 					ctx.fillText(contentArray[m], WIDTH / 2, 820 + contentHh * m);
- 				}
- 				ctx.setTextAlign('center')
- 				ctx.setFontSize(48);
- 				ctx.setFillStyle('red');
- 				ctx.fillText('¥' + price, WIDTH / 2, 880 + contentHh);
- 				ctx.draw(true, function() {
- 					uni.canvasToTempFilePath({
- 						canvasId: 'myCanvas',
- 						fileType: 'png',
- 						destWidth: WIDTH,
- 						destHeight: HEIGHT,
- 						success: function(res) {
- 							uni.hideLoading();
- 							successFn && successFn(res.tempFilePath);
- 						}
- 					})
- 				});
- 			},
- 			fail: function(err) {
- 				uni.hideLoading();
- 				that.Tips({
- 					title: '无法获取图片信息'
- 				});
- 			}
- 		})
- 	},
- 	/*
- 	 * 单图上传
- 	 * @param object opt
- 	 * @param callable successCallback 成功执行方法 data 
- 	 * @param callable errorCallback 失败执行方法 
- 	 */
- 	uploadImageOne: function(opt, successCallback, errorCallback) {
- 		let that = this;
- 		if (typeof opt === 'string') {
- 			let url = opt;
- 			opt = {};
- 			opt.url = url;
- 		}
- 		let count = opt.count || 1,
- 			sizeType = opt.sizeType || ['compressed'],
- 			sourceType = opt.sourceType || ['album', 'camera'],
- 			is_load = opt.is_load || true,
- 			uploadUrl = opt.url || '',
- 			inputName = opt.name || 'pics';
- 		uni.chooseImage({
- 			count: count, //最多可以选择的图片总数  
- 			sizeType: sizeType, // 可以指定是原图还是压缩图,默认二者都有  
- 			sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有  
- 			success: function(res) {
-				console.log()
- 				//启动上传等待中...  
- 				uni.showLoading({
- 					title: '图片上传中',
- 				});
-				uni.uploadFile({
-					url: HTTP_REQUEST_URL + '/api/' + uploadUrl,
-					filePath: res.tempFilePaths[0],
-					name: inputName,
-					formData: {
-						'filename': inputName
-					},
-					header: {
-						// #ifdef MP
-						"Content-Type": "multipart/form-data",
-						// #endif
-						[TOKENNAME]: 'Bearer ' + store.state.app.token
-					},
-					success: function(res) {
-						uni.hideLoading();
-						if (res.statusCode == 403) {
-							that.Tips({
-								title: res.data
-							});
-						} else {
-							let data = res.data ? JSON.parse(res.data) : {};
-							if (data.status == 200) {
-								successCallback && successCallback(data)
-							} else {
-								errorCallback && errorCallback(data);
-								that.Tips({
-									title: data.msg
-								});
-							}
-						}
-					},
-					fail: function(res) {
-						uni.hideLoading();
-						that.Tips({
-							title: '上传图片失败'
-						});
-					}
-				})
- 				// pathToBase64(res.tempFilePaths[0])
- 				// 	.then(imgBase64 => {
- 				// 		console.log(imgBase64);
- 						
- 				// 	})
- 				// 	.catch(error => {
- 				// 		console.error(error)
- 				// 	})
- 			}
- 		})
- 	},
- 	/**
- 	 * 处理服务器扫码带进来的参数
- 	 * @param string param 扫码携带参数
- 	 * @param string k 整体分割符 默认为:&
- 	 * @param string p 单个分隔符 默认为:=
- 	 * @return object
- 	 * 
- 	 */
- 	// #ifdef MP
- 	getUrlParams: function(param, k, p) {
- 		if (typeof param != 'string') return {};
- 		k = k ? k : '&'; //整体参数分隔符
- 		p = p ? p : '='; //单个参数分隔符
- 		var value = {};
- 		if (param.indexOf(k) !== -1) {
- 			param = param.split(k);
- 			for (var val in param) {
- 				if (param[val].indexOf(p) !== -1) {
- 					var item = param[val].split(p);
- 					value[item[0]] = item[1];
- 				}
- 			}
- 		} else if (param.indexOf(p) !== -1) {
- 			var item = param.split(p);
- 			value[item[0]] = item[1];
- 		} else {
- 			return param;
- 		}
- 		return value;
- 	},
- 	// #endif
  	/*
  	 * 合并数组
  	 */

Some files were not shown because too many files changed in this diff