Browse Source

Merge branch 'master' of http://git.liuniu946.com/lhl/nzhbsr

cmy 2 years ago
parent
commit
dee19f5233
11 changed files with 621 additions and 29 deletions
  1. 16 0
      api/login.js
  2. 21 0
      api/wallet.js
  3. 13 0
      pages.json
  4. 252 4
      pages/transaction/cbdetail.vue
  5. 128 0
      pages/user/authrz.vue
  6. 33 0
      pages/user/help.vue
  7. 16 6
      pages/user/menu.vue
  8. 121 0
      pages/user/respwd.vue
  9. BIN
      static/img/add.png
  10. BIN
      static/img/flower.png
  11. 21 19
      utils/newRequest.js

+ 16 - 0
api/login.js

@@ -118,3 +118,19 @@ export function loginout(data) {
 		data
 	})
 }
+//oldpwd newpwd
+export function changepass(data) {
+	return request({
+		url: '/api/Index/sub_respwd',
+		method: 'get',
+		data
+	})
+}
+
+export function upauthrz(data) {
+	return request({
+		url: '/api/User/upauthrz',
+		method: 'get',
+		data
+	})
+}

+ 21 - 0
api/wallet.js

@@ -1,4 +1,7 @@
 import request from '@/utils/request'
+import {
+	upFilse
+} from '@/utils/request'
 
 // 资金列表
 export function usercoin(data) {
@@ -35,3 +38,21 @@ export function czpage(data) {
 		data
 	});
 }
+
+//上传图片
+export function upload(data) {
+	return upFilse({
+		url: '/api/User/recharge_img',
+		method: 'post',
+		data
+	});
+}
+
+// 充值
+export function paycoin(data) {
+	return request({
+		url: '/api/user/paycoin',
+		method: 'get',
+		data
+	});
+}

+ 13 - 0
pages.json

@@ -87,7 +87,20 @@
 			"style": {
 				"navigationBarTitleText": ""
 			}
+		},
+		{
+			"path": "pages/user/respwd",
+			"style": {
+				"navigationBarTitleText": "密碼"
+			}
+		},
+		{
+			"path": "pages/user/authrz",
+			"style": {
+				"navigationBarTitleText": ""
+			}
 		}
+		
 	],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 252 - 4
pages/transaction/cbdetail.vue

@@ -2,21 +2,85 @@
 	<view class="content">
 		<view class="vheight"></view>
 		<view class="top flex">
-			<image class="top-icon1" src="../../static/img/cb2.png" mode=""></image>
+			<image @click="navTo('/pages/transaction/cblist')" class="top-icon1" src="../../static/img/cb2.png" mode=""></image>
 			<image class="top-icon2" src="../../static/img/cb1.png" mode=""></image>
 		</view>
 		<view class="title">充幣</view>
+		<view class="type flex" @click="navTo('/pages/transaction/cblist')">
+			<view class="type-left">幣種</view>
+			<view class="type-right">
+				<view class="type-name">{{ info.title }}</view>
+				<image class="type-icon" src="../../static/icon/user-back.png" mode=""></image>
+			</view>
+		</view>
+		<view class="main">
+			<view class="main-title">充幣網絡</view>
+			<view class="main-list">{{ info.czline }}</view>
+			<view class="main-title" style="margin-top: 20rpx;">充幣地址</view>
+			<view class="erweima">
+				<tki-qrcode
+					:cid="cid"
+					ref="qrcode"
+					:val="info.czaddress"
+					:size="size"
+					:unit="unit"
+					:background="background"
+					:foreground="foreground"
+					:pdground="pdground"
+					:iconSize="iconSize"
+					:lv="lv"
+					:onval="onval"
+					:loadMake="loadMake"
+					:usingComponents="usingComponents"
+					@result="qrR"
+				/>
+			</view>
+			<view class="address">{{ info.czaddress }}</view>
+			<view class="btn" @click="copy(info.czaddress)">複製地址</view>
+		</view>
+		<view class="info">
+			<view class="info-item red">最小充值金額:0.00BTC,小於最小金額的充值將不會上賬且無法退回</view>
+			<view class="info-item">請選擇正確的充值通道網絡,否則資產將不可找回</view>
+			<view class="info-item">最小充值金額:0.00BTC,小於最小金額的充值將不會上賬且無法退回</view>
+			<view class="info-item">您的充值地址不會經常改變,可以重複充值;如有更改,我們會盡量通過網站公告或郵件通知您</view>
+			<view class="info-item">請務必確認電腦及瀏覽器安全,防止信息被篡改或洩露</view>
+		</view>
+		<view class="sr">
+			<view class="sr-title">轉賬金額</view>
+			<view class="sr-input"><input placeholder="請輸入轉賬金額" type="number" v-model="num" /></view>
+			<view class="sr-title" style="margin-top: 20rpx;">上傳轉賬憑證</view>
+			<view class="sr-image">
+				<image :src="image" mode="" class="upload-img" @click.stop="imgsub" v-if="image"></image>
+				<image src="../../static/img/add.png" class="upload-img" mode="" v-if="!image" @click.stop="imgsub"></image>
+			</view>
+			<view class="sr-btn" @click="submit()">提交</view>
+		</view>
 	</view>
 </template>
 
 <script>
-import { czpage } from '@/api/wallet.js';
+import { czpage, upload, paycoin } from '@/api/wallet.js';
 import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
 import uniCopy from '@/js_sdk/xb-copy/uni-copy.js';
 export default {
 	data() {
 		return {
-			id: ''
+			id: '',
+			info: '',
+			cid: 'cid',
+			size: 100,
+			unit: '150',
+			background: '#FFFFFF',
+			foreground: '#000000',
+			pdground: '#000000',
+			icon: '',
+			iconSize: 40,
+			lv: 3,
+			onval: true,
+			loadMake: true,
+			usingComponents: true,
+			num: '',
+			image: ''
 		};
 	},
 	onLoad(opt) {
@@ -29,7 +93,54 @@ export default {
 	methods: {
 		loadData() {
 			czpage({ id: this.id }).then(e => {
-				console.log(e);
+				this.info = e.data;
+			});
+		},
+		qrR(res) {
+			console.log(res, '123456');
+		},
+		navTo(url) {
+			uni.navigateTo({
+				url
+			});
+		},
+		imgsub() {
+			console.log(111);
+			upload({
+				filename: ''
+			}).then(data => {
+				console.log('data', data);
+				this.image = data[0].src;
+			});
+		},
+		copy(item) {
+			let obj = this;
+			let content = item; //需要复制的内容
+			content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
+			const result = uniCopy(content);
+			if (result === false) {
+				uni.showToast({
+					title: '不支持'
+				});
+			} else {
+				uni.showToast({
+					title: '複製成功',
+					icon: 'none'
+				});
+			}
+		},
+		submit() {
+			console.log(222);
+			if (this.num < 0) {
+				return this.$api.msg('充值金額不能為0');
+			}
+			if (!this.image) {
+				return this.$api.msg('請上傳轉款憑證');
+			}
+			paycoin({ cid: this.id, zznum: this.num, payimg: this.image, coinname: this.info.title }).then(e => {
+				this.num = '';
+				this.image = '';
+				return this.$api.msg('提交申請成功,請耐心等待審核');
 			});
 		}
 	}
@@ -57,4 +168,141 @@ page,
 		height: 48rpx;
 	}
 }
+.title {
+	padding: 20rpx 20rpx 0;
+	font-size: 52rpx;
+	font-weight: 500;
+}
+.type {
+	margin: 20rpx auto 0;
+	width: 690rpx;
+	background: #ffffff;
+	border-radius: 20rpx;
+	padding: 30rpx 20rpx;
+	.type-left {
+		font-size: 32rpx;
+		color: #000;
+	}
+	.type-right {
+		display: flex;
+		align-items: center;
+		.type-name {
+			font-size: 36rpx;
+			font-weight: bold;
+			color: #fcd535;
+			margin-right: 10rpx;
+		}
+		.type-icon {
+			width: 24rpx;
+			height: 24rpx;
+		}
+	}
+}
+.main {
+	margin: 20rpx auto 0;
+	width: 690rpx;
+	background: #ffffff;
+	border-radius: 20rpx;
+	padding: 30rpx 20rpx;
+	.main-title {
+		font-size: 32rpx;
+		color: #000;
+	}
+	.main-list {
+		margin-top: 20rpx;
+		width: 200rpx;
+		height: 70rpx;
+		line-height: 70rpx;
+		text-align: center;
+		border: 2px solid #fcd535;
+		border-radius: 10rpx;
+		font-size: 28rpx;
+		color: #fcd535;
+	}
+	.erweima {
+		margin-top: 40rpx;
+		width: 100%;
+		display: flex;
+		justify-content: center;
+	}
+	.address {
+		margin-top: 20rpx;
+		width: 100%;
+		text-align: center;
+		font-size: 24rpx;
+		color: #000;
+	}
+	.btn {
+		width: 200rpx;
+		height: 60rpx;
+		line-height: 60rpx;
+		text-align: center;
+		border-radius: 10rpx;
+		border: 2px solid #fcd535;
+		font-size: 28rpx;
+		color: #fcd535;
+		margin: 20rpx auto 0;
+	}
+}
+.info {
+	margin: 20rpx auto 0;
+	width: 690rpx;
+	background: #ffffff;
+	border-radius: 20rpx;
+	padding: 30rpx 20rpx;
+	.info-item {
+		font-size: 24rpx;
+		color: #000;
+		margin-bottom: 20rpx;
+	}
+	.red {
+		color: red;
+	}
+}
+.sr {
+	margin: 20rpx auto 0;
+	width: 690rpx;
+	background: #ffffff;
+	border-radius: 20rpx;
+	padding: 30rpx 20rpx;
+	.sr-title {
+		font-size: 32rpx;
+		color: #000;
+	}
+	.sr-input {
+		display: flex;
+		align-items: center;
+		width: 100%;
+		height: 80rpx;
+		line-height: 80rpx;
+		background: #f5f5f5;
+		border-radius: 20rpx;
+		padding: 0rpx 30rpx;
+		input {
+			font-size: 28rpx;
+			padding-left: 30rpx;
+			background: #f5f5f5;
+		}
+	}
+	.sr-image {
+		display: flex;
+		justify-content: center;
+		margin: 20rpx;
+		image {
+			width: 200rpx;
+			height: 200rpx;
+		}
+	}
+	.sr-btn {
+		width: 100%;
+		height: 80rpx;
+		line-height: 80rpx;
+		text-align: center;
+		border-radius: 10rpx;
+		margin: 20rpx auto 0;
+		background: linear-gradient(to left, #eeb80d, #ffe35b);
+		font-size: 28rpx;
+		color: #000;
+	}
+}
 </style>

+ 128 - 0
pages/user/authrz.vue

@@ -0,0 +1,128 @@
+<template>
+	<view class="content">
+		<view class="">
+			<view class="" style="padding: 50rpx 30rpx;font-size: 50rpx;">
+				實名認證
+			</view>
+			<view class=""
+				style="width: 720rpx;height: 80rpx;background-color: #fff;margin: auto;line-height: 80rpx;padding:0 10rpx;border-radius: 20rpx;font-size: 26rpx;">
+				完成實名認證後能夠獲得相應的權益
+			</view>
+			<view class=""
+				style="width: 720rpx;height: 80rpx;background-color: #fff;margin: auto;line-height: 80rpx;padding:0 10rpx;border-radius: 20rpx;font-size: 26rpx;">
+				高級實名
+			</view>
+		</view>
+		<view class="up-wrap">
+			<view class="up-tit">
+				上傳身份證正面
+			</view>
+			<view class="up-img" @click="upcardzm()">
+				<image src="" mode="heightFix" v-if="cardzm"></image>
+				<image src="../../static/img/flower.png" mode="heightFix" v-else></image>
+			</view>
+			<view class="up-tit">
+				上傳身份證背面
+			</view>
+			<view class="up-img"  @click="upcardzm()">
+				<image src="" mode="heightFix" v-if="cardfm"></image>
+				<image src="../../static/img/flower.png" mode="heightFix" v-else></image>
+			</view>
+			<view class="up-btn" @click="upauthrz()">
+				高級提交
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		upauthrz,
+		upimg
+	} from '@/api/login.js'
+	// import {  } from '@/api/wallet.js'
+	export default {
+		data() {
+			return {
+				cardzm: '',
+				cardfm: ''
+			}
+		},
+		onLoad() {
+
+		},
+		onShow() {
+
+		},
+		onReachBottom() {
+
+		},
+		onReady() {
+
+		},
+		methods: {
+			upcardzm() {
+				
+			},
+			upcardfm() {
+				
+			},
+			upauthrz() {
+				let obj = this
+				if(obj.cardzm == '') {
+					return obj.$api.msg('請上傳身份證正面')
+				}
+				if(obj.cardfm == '') {
+					return obj.$api.msg('請上傳身份證反面')
+				}
+				upauthrz({
+					cardzm: obj.cardzm,
+					cardfm: obj.cardfm
+				}).then(res => {
+					uni.showToast({
+						title: '提交成功',
+						duration: 2000,
+						position: 'top'
+					});
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.up-wrap {
+		width: 720rpx;
+		height: 860rpx;
+		border-radius: 20rpx;
+		background-color: #fff;
+		margin: 30rpx auto;
+		padding: 20rpx;
+		font-size: 32rpx;
+
+		.up-tit {
+			height: 80rpx;
+			line-height: 80rpx;
+		}
+		.up-img {
+			height: 240rpx;
+			margin-top: 20rpx ;
+			image {
+				height: 200rpx;
+				display: block;
+				margin: auto;
+			}
+		}
+		.up-btn {
+			margin: 20rpx auto 0;
+			width: 680rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: center;
+			color: #000;
+			font-size: 28rpx;
+			background:linear-gradient(to left,#eeb80d,#ffe35b);
+			border-radius: 20rpx;
+		}
+	}
+</style>

+ 33 - 0
pages/user/help.vue

@@ -0,0 +1,33 @@
+<template>
+	<view class="content">
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+
+			}
+		},
+		onLoad() {
+
+		},
+		onShow() {
+
+		},
+		onReachBottom() {
+
+		},
+		onReady() {
+
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss">
+</style>

+ 16 - 6
pages/user/menu.vue

@@ -18,21 +18,21 @@
 			</view>
 			<image src="../../static/icon/back.png" mode="" class="right-img"></image>
 		</view> -->
-		<view class="user-list flex">
+		<!-- <view class="user-list flex">
 			<image src="../../static/icon/mu2.png" mode="" class="left-img"></image>
 			<view class="">
 				幫助中心
 			</view>
 			<image src="../../static/icon/back.png" mode="" class="right-img"></image>
-		</view>
-		<view class="user-list flex">
+		</view> -->
+		<!-- <view class="user-list flex">
 			<image src="../../static/icon/mu3.png" mode="" class="left-img"></image>
 			<view class="">
 				通知
 			</view>
 			<image src="../../static/icon/back.png" mode="" class="right-img"></image>
-		</view>
-		<view class="user-list flex">
+		</view> -->
+		<view class="user-list flex" @click="navto('/pages/user/respwd')">
 			<image src="../../static/icon/mu4.png" mode="" class="left-img"></image>
 			<view class="">
 				修改密碼
@@ -46,7 +46,7 @@
 			</view>
 			<image src="../../static/icon/back.png" mode="" class="right-img"></image>
 		</view>
-		<view class="user-list flex">
+		<view class="user-list flex" @click="navto('/pages/user/authrz')">
 			<image src="../../static/icon/mu6.png" mode="" class="left-img"></image>
 			<view class="">
 				實名認證
@@ -92,6 +92,16 @@
 		},
 		methods: {
 			...mapMutations('user', ['login', 'setUserInfo', 'logout']),
+			navto(url) {
+				uni.navigateTo({
+					url,
+					fail() {
+						uni.switchTab({
+							url
+						})
+					}
+				})
+			},
 			getUser() {
 				let obj = this
 				getUser().then(res => {

+ 121 - 0
pages/user/respwd.vue

@@ -0,0 +1,121 @@
+<template>
+	<view class="content">
+		<view class="tip">
+			*為了您的資金安全,登錄密碼修改後24小時以內不允許提現。
+		</view>
+		<view class="tit">
+			舊密碼
+		</view>
+		<input type="password" class="shuru" placeholder="請翰入舊密碼" v-model="oldpwd">
+		<view class="tit">
+			新密碼
+		</view>
+		<input type="password" class="shuru" placeholder="請翰入新密碼" v-model="newpwd">
+		<view class="tit">
+			確認密碼
+		</view>
+		<input type="password" class="shuru" placeholder="請翰入確認密碼" v-model="renewpwd">
+		<view class="loginout" @click="changepass()">
+			提交
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		changepass
+	} from '@/api/login.js'
+	export default {
+		data() {
+			return {
+				//oldpwd newpwd
+				oldpwd: '',
+				newpwd: '',
+				renewpwd: ''
+			}
+		},
+		onLoad() {
+
+		},
+		onShow() {
+
+		},
+		onReachBottom() {
+
+		},
+		onReady() {
+
+		},
+		methods: {
+			changepass() {
+				let obj = this
+				if(obj.oldpwd == '') {
+					return obj.$api.msg('請翰入舊密碼')
+				}
+				if(obj.newpwd == '') {
+					return obj.$api.msg('請翰入新密碼')
+				}
+				if(obj.renewpwd == '') {
+					return obj.$api.msg('請翰入確認密碼')
+				}
+				if(obj.newpwd != obj.renewpwd) {
+					return obj.$api.msg('兩次密碼不一致')
+				}
+				changepass({
+					oldpwd: obj.oldpwd,
+					newpwd: obj.newpwd
+				}).then(res => {
+					uni.showToast({
+						title: '修改成功',
+						duration: 2000,
+						position: 'top'
+					});
+					setTimeout(()=> {
+						uni.switchTab({
+							url: '/pages/index/index'
+						})
+					},1500)
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		height: 100%;
+		background-color: #fff;
+	}
+
+	.tip {
+		color: red;
+		font-size: 26rpx;
+		padding: 30rpx;
+	}
+
+	.shuru {
+		display: block;
+		background-color: #f5f5f5;
+		width: 673rpx;
+		height: 95rpx;
+		margin: auto;
+		padding-left: 30rpx;
+		text-align: 95rpx;
+	}
+
+	.tit {
+		padding: 60rpx 48rpx 20rpx;
+	}
+	.loginout {
+		width: 675rpx;
+		height: 70rpx;
+		line-height: 70rpx;
+		text-align: center;
+		font-size: 26rpx;
+		color: #000;
+		background-color: #f4d03c;
+		margin: 50rpx auto;
+		border-radius: 20rpx;
+		font-weight: bold;
+	}
+</style>

BIN
static/img/add.png


BIN
static/img/flower.png


+ 21 - 19
utils/newRequest.js

@@ -43,26 +43,26 @@ let service = {
 	open: async function(data) {
 		return await new Promise(function(resolve, reject) {
 			let requestData = ''; //保存处理完成后请求数据
-			let url =''//保存链接地址
+			let url = '' //保存链接地址
 			//console.log(data);
 			// 请求前数据处理
 			requestData = service.request.success(data);
 			// #ifdef H5
-			
-			if(process.env.NODE_ENV === 'development'){
-				url= requestData.url;
-			    console.log('开发环境')
-			}else{
-				url=service.baseURL + requestData.url;
-			    console.log('生产环境')
+
+			if (process.env.NODE_ENV === 'development') {
+				url = requestData.url;
+				console.log('开发环境')
+			} else {
+				url = service.baseURL + requestData.url;
+				console.log('生产环境')
 			}
 			// #endif
 			// #ifndef H5
-			url=service.baseURL + requestData.url;
+			url = service.baseURL + requestData.url;
 			// #endif
 			// 数据复制用于请求
 			uni.request({
-				url:url,
+				url: url,
 				method: requestData.method || 'GET',
 				data: requestData.data,
 				header: data.header || service.header,
@@ -96,20 +96,20 @@ let service = {
 				service.request.error(e);
 			}
 			// #ifdef H5
-			if(process.env.NODE_ENV === 'development'){
-				url= requestData.url;
-			    console.log('开发环境')
-			}else{
-				url=service.baseURL + requestData.url;
-			    console.log('生产环境')
+			if (process.env.NODE_ENV === 'development') {
+				url = requestData.url;
+				console.log('开发环境')
+			} else {
+				url = service.baseURL + requestData.url;
+				console.log('生产环境')
 			}
 			// #endif
 			// #ifndef H5
-			url=service.baseURL + requestData.url;
+			url = service.baseURL + requestData.url;
 			// #endif
 			let config = {
 				// 上传图片的API
-				upload_img_url:url
+				upload_img_url: url
 			}
 
 			let Uploader = {
@@ -142,9 +142,11 @@ let service = {
 							filePath: path,
 							name: 'file',
 							header: {
-								"Authori-zation": 'Bearer ' + uni.getStorageSync('token')
+								"Authori-zation": 'Bearer ' + uni.getStorageSync(
+									'token')
 							},
 							success: (uploadFileRes) => {
+								console.log(uploadFileRes.data, "url");
 								if ("string" === typeof uploadFileRes.data) {
 									resolve(JSON.parse(uploadFileRes.data).data)
 								} else {