Bladeren bron

2023-11-23

cmy 1 jaar geleden
bovenliggende
commit
19fc04f6a8
5 gewijzigde bestanden met toevoegingen van 327 en 2 verwijderingen
  1. 6 0
      pages.json
  2. 1 1
      pages/collection/bank.vue
  3. 274 0
      pages/collection/chain.vue
  4. 13 0
      pages/collection/collection.vue
  5. 33 1
      pages/order/hallorderDetail.vue

+ 6 - 0
pages.json

@@ -83,6 +83,12 @@
 				"style": {
 					"navigationBarTitleText": "添加微信"
 				}
+			},
+			{
+				"path": "chain",
+				"style": {
+					"navigationBarTitleText": "添加钱包地址"
+				}
 			}
 		]
 	   },

+ 1 - 1
pages/collection/bank.vue

@@ -35,7 +35,7 @@
 
 <script>
 import { auction, pay_list } from '@/api/wallet.js';
-import { orderData, getUserInfo } from '@/api/user.js';
+import {  getUserInfo } from '@/api/user.js';
 import { mapState, mapMutations } from 'vuex';
 import { verify } from '@/api/login.js';
 export default {

+ 274 - 0
pages/collection/chain.vue

@@ -0,0 +1,274 @@
+<template>
+	<view class="content">
+		<view class="box">
+
+			<view class="item top">
+				<text>地址</text>
+				<input type="text" v-model="payment" value="" placeholder="请输入地址" />
+			</view>
+			<view class="item ">
+				<text>姓名</text>
+				<input type="text" v-model="name" value="" placeholder="请输入姓名" />
+			</view>
+			<view class="item top">
+				<text>链名</text>
+				<input type="text" v-model="bank" value="" placeholder="请输入链名" />
+			</view>
+			<!-- <view class="item top">
+				<text>手机号</text>
+				<input type="text" v-model="phone" value="" placeholder="请输入手机号" />
+			</view> -->
+			<view class="erweima">
+				<text>收款码</text>
+				<view class="img" @click="uploads()">
+					<image src="../../static/user/erweima.png" mode="" v-if="image == ''"></image>
+					<image :src="image" mode="scaleToFill" v-else></image>
+				</view>
+			</view>
+		</view>
+		<view class="button" @click="confirm()">确认</view>
+	</view>
+</template>
+
+<script>
+	import {
+		auction,
+		pay_list
+	} from '@/api/wallet.js';
+	import {
+		upload
+	} from '@/api/order.js'
+	import {
+		getUserInfo
+	} from '@/api/user.js';
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
+	// import { verify } from '@/api/login.js';
+	export default {
+		computed: {
+			...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
+		},
+		data() {
+			return {
+				payment: '',
+				name: '',
+				bank: '',
+				phone: '',
+				image: '',
+				// countDown:0,//倒计时
+				// code:'',//验证码
+				// time:'',
+			};
+		},
+		// watch: {
+		// 	// 监听倒计时
+		// 	countDown(i) {
+		// 		if (i == 0) {
+		// 			clearInterval(this.time);
+		// 		}
+		// 	}
+		// },
+		onLoad() {
+			pay_list().then(({
+				data
+			}) => {
+				let item = data.chain;
+				if (item != '') {
+					this.name = item.name;
+					this.payment = item.payment;
+					this.phone = item.phone;
+					this.bank = item.bank;
+					this.image = item.image;
+				}
+			});
+		},
+		methods: {
+			...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
+			uploads() {
+				const that = this;
+				if (that.upFileLoding) {
+					return
+				}
+				that.upFileLoding = true;
+				setTimeout(() => {
+					that.upFileLoding = false;
+				}, 1000);
+				upload({
+					filename: '',
+					file_name: 'collection/chain/' + that.userInfo.uid
+				}).then(data => {
+					that.image = data[0].url;
+				}).catch((err) => {
+					console.log(err);
+				})
+			},
+			//发送验证码
+			// verification() {
+			// 	let obj = this;
+			// 	if (!this.userInfo.phone) {
+			// 		this.$api.msg('请绑定手机号');
+			// 		return;
+			// 	}
+			// 	// 判断是否在倒计时
+			// 	if (obj.countDown > 0) {
+			// 		return false;
+			// 	} else {
+			// 		obj.countDown = 60;
+			// 		obj.time = setInterval(() => {
+			// 			obj.countDown--;
+			// 		}, 1000);
+			// 		//调用验证码接口
+			// 		verify({
+			// 			phone: obj.userInfo.phone,
+			// 			type: ''
+			// 		})
+			// 			.then(({ data }) => {})
+			// 			.catch(err => {
+			// 				console.log(err);
+			// 			});
+			// 	}
+			// },
+			confirm() {
+				let obj = this;
+				if (!obj.payment) {
+					return this.$api.msg('请输入地址');
+				}
+				if (!obj.name) {
+					return this.$api.msg('请输入姓名');
+				}
+				if (!obj.bank) {
+					return this.$api.msg('请输入链');
+				}
+				if (!obj.image) {
+					return this.$api.msg('请上传二维码');
+				}
+				// if (!obj.phone) {
+				// 	return this.$api.msg('请输入手机号码');
+				// }
+				// if (!obj.code) {
+				// 	return this.$api.msg('请输入验证码');
+				// }
+				auction({
+					type: 4,
+					name: obj.name,
+					bank: obj.bank,
+					payment: obj.payment,
+					phone: obj.userInfo.phone,
+					image: obj.image,
+					// captcha:obj.code
+				}).then(e => {
+					obj.$api.msg('修改成功');
+					uni.redirectTo({
+						url: './collection',
+					});
+				});
+			}
+		}
+	};
+</script>
+
+<style lang="scss">
+	page,
+	.content {
+		height: 100%;
+		padding: 0;
+		margin: 0;
+	}
+
+	.top {
+		border-top: 1rpx solid #f3f3f3;
+		border-bottom: 1rpx solid #f3f3f3;
+	}
+
+	.erweima {
+		padding: 30rpx 0;
+		display: flex;
+
+		text {
+			margin: 0 30rpx;
+			width: 150rpx;
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: 400;
+			color: #333333;
+
+		}
+
+		.img {
+			width: 160rpx;
+			height: 160rpx;
+
+			image {
+				width: 100%;
+				height: 100%;
+			}
+		}
+	}
+
+	.box {
+		background: #ffffff;
+		margin: 20rpx 0 70rpx 0;
+
+		.item {
+			display: flex;
+			align-items: center;
+
+			text {
+				margin: 0 40rpx 0 25rpx;
+				width: 150rpx;
+				font-size: 30rpx;
+				font-family: PingFang SC;
+				font-weight: 400;
+				color: #333333;
+				line-height: 100rpx;
+			}
+
+			input {
+				width: 500rpx;
+				height: 100rpx;
+				display: inline-block;
+				font-size: 28rpx;
+				font-family: PingFang SC;
+				font-weight: 400;
+				color: #999999;
+				line-height: 100rpx;
+			}
+
+			.uni-input {
+				text-align: left;
+				width: 325rpx;
+				font-size: 28rpx !important;
+			}
+
+			.login_name {
+				color: #333333;
+			}
+
+			.code {
+				color: #ECC697;
+				font-size: 23rpx;
+				border-left: 1px solid #eeeeee;
+				width: 150rpx;
+				flex-shrink: 0;
+				text-align: center;
+			}
+		}
+	}
+
+	.button {
+		text-align: center;
+		width: 560rpx;
+		height: 80rpx;
+		// background: #fd3b39;
+		background: #ECC697;
+		border-radius: 40rpx;
+		font-size: 30rpx;
+		font-family: PingFangSC;
+		font-weight: 500;
+		color: #ffffff;
+		line-height: 80rpx;
+		margin: 0 auto;
+	}
+</style>

+ 13 - 0
pages/collection/collection.vue

@@ -40,6 +40,17 @@
 					</view>
 				</view>
 			</view>
+			<view class="collection-item" @click="nav('/pages/collection/chain')">
+				<view class="left">
+					<view class="img"><image src="../../static/icon/user_page.png" mode=""></image></view>
+					<view class="bank">钱包</view>
+				</view>
+				<view class="gg" >
+					<view class="status" v-if="chain.name != null">{{chain.name}}</view>
+					<view class="status" v-else>未添加</view>
+					<view class="img1"><text class="iconfont iconenter"></text></view>
+				</view>
+			</view>
 		</view>
 	</view>
 </template>
@@ -53,6 +64,7 @@ export default {
 			aliData: {},
 			bankData: {},
 			wx:{},
+			chain:{}
 		};
 	},
 	computed: {
@@ -72,6 +84,7 @@ export default {
 				this.wx = data.wx
 				this.aliData = data.zfb
 				this.bankData = data.bank
+				this.chain = data.chain;
 			})
 		}
 	}

+ 33 - 1
pages/order/hallorderDetail.vue

@@ -75,6 +75,12 @@
 							<view class="mt-font" :class="{ current: tabCurrentIndex === 2 }">微信</view>
 						</view>
 					</view>
+					<view class="main-item">
+						<view class="mt-item" @click="change('3')" :class="{ current: tabCurrentIndex === 3 }" v-if="chain != ''">
+							<image class="mt-image2" :src="tabCurrentIndex == 3 ? '../../static/img/yueD.png' : '../../static/img/yue.png'" mode=""></image>
+							<view class="mt-font" :class="{ current: tabCurrentIndex === 3 }">钱包</view>
+						</view>
+					</view>
 				</view>
 				<swiper
 					class="swiper-box"
@@ -143,6 +149,30 @@
 						</scroll-view>
 					</swiper-item>
 					<swiper-item class="tab-content" v-else></swiper-item>
+					<swiper-item class="tab-content" v-if="chain != ''">
+						<scroll-view scroll-y="true" style="height: 100%;">
+							<view class="tc-item flex">
+								<view class="tcitem-name">地址</view>
+								<view class="ali-name">{{ chain.payment }}</view>
+								<image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(chain.payment)"></image>
+							</view>
+							<view class="tc-item flex">
+								<view class="tcitem-name">姓名</view>
+								<view class="ali-name">{{ chain.name }}</view>
+								<image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(chain.name)"></image>
+							</view>
+							<view class="tc-item flex">
+								<view class="tcitem-name">链名</view>
+								<view class="ali-name">{{ chain.bank }}</view>
+								<image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(chain.bank)"></image>
+							</view>
+							<view class="tc-item">
+								<view class="upload-title" style="color: #9d9d9d;">钱包二维码</view>
+								<view class="upload-main" @click="lookimg(chain.image)"><image class="upload-image" :src="chain.image" mode="aspectFit"></image></view>
+							</view>
+						</scroll-view>
+					</swiper-item>
+					<swiper-item class="tab-content" v-else></swiper-item>
 				</swiper>
 			</view>
 			<view class="zf flex">
@@ -167,7 +197,8 @@ export default {
 			info: '',
 			bank: '',
 			wx: '',
-			zfb: ''
+			zfb: '',
+			chain:''
 		};
 	},
 	onLoad(opt) {
@@ -185,6 +216,7 @@ export default {
 				this.bank = data.bank;
 				this.wx = data.wx;
 				this.zfb = data.zfb;
+				this.chain = data.chain
 				uni.hideLoading();
 			});
 		},