lhl 1 year ago
parent
commit
96bd9189b7

+ 3 - 3
public/index.html

@@ -4,10 +4,10 @@
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
-	<meta name="keywords" content="鄂州市红十字会官方网站,鄂州市红十字会官方,鄂州市红十字会官网,鄂州红会官网,鄂州红会,鄂州市,鄂州,红十字会">
-	<meta name="description" content="鄂州市红十字会位于湖北省鄂州市鄂城区滨湖南路60号,电话:027-60229380。鄂州市红十字会是在市委、市政府领导下从事人道主义工作的社会救助团体,依照《中华人民共和国红十字会法》,秉承“人道、博爱、奉献”红十字精神,履行法定职责,充分发挥党和政府在人道领域的桥梁和纽带作用。">
+	<meta name="keywords" content="订单助手">
+	<meta name="description" content="订单助手">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title></title>
+    <title>订单助手</title>
   </head>
   <body>
     <noscript>

+ 24 - 0
src/assets/js/tools.js

@@ -31,4 +31,28 @@ export function sjz(n,m) {
 	 let result = Math.floor(Math.random() * (max - min + 1)) + min;
 	   console.log(n,m,result);
 	  return result
+}
+
+export function timeComputed(time) {
+	// 获取当前时间
+	const actTime = (new Date()).getTime();
+	// 获取到期时间
+	let stopTime = time - actTime;
+	let isend = false
+	// 判断是否小于0
+	if (stopTime < 0) {
+		stopTime = stopTime * -1
+		isend = true
+	}
+	let day = Math.floor(stopTime / 1000 / 60 / 60 / 24) //获取剩余天数
+	let hours = Math.floor((stopTime / 1000 / 60 / 60) % 24); //获取剩余小时数
+	let minutes = Math.floor((stopTime / 1000 / 60) % 60); //获取分钟
+	let seconds = Math.floor((stopTime / 1000) % 60); //获取秒数
+	return {
+		isend, 
+		hours, //倒计时小时数
+		minutes, //倒计时分钟数
+		seconds: seconds> 9?seconds: '0' + seconds, //倒计时秒数
+		day //倒计时天数
+	}
 }

+ 2 - 1
src/main.js

@@ -24,7 +24,8 @@ Vue.prototype.$QRCode = QRCode
 	 //页面跳转时,页面位置重置为顶部
       window.scrollTo(0,0);
 	  //修改页面title
-	  window.document.title = to.meta.title == undefined?'':to.meta.title
+	  window.document.title = to.meta.title == undefined?'订单助手':'订单助手'
+	  // to.meta.title
  })
 
 new Vue({

+ 8 - 0
src/request/user.js

@@ -215,4 +215,12 @@ export function tlement (data) {
     method: 'get',
     data
   })
+}
+
+export function getrecharge(data) {
+	return request({
+	  url: '/api/user/recharge',
+	  method: 'get',
+	  params:data
+	})
 }

+ 1 - 1
src/store.js

@@ -5,7 +5,7 @@ Vue.use(Vuex)
 
 export default new Vuex.Store({
   state: {
-	www: 'http://www.pingguozhushou.shop',
+	www: 'https://dingdanzhushou.xyz',
 	hasLogin:false,
 	userInfo: {},
 	baseInfo: {},//基础信息

+ 8 - 1
src/views/home/addOrder.vue

@@ -960,7 +960,14 @@
 			//选择下一个可用token
 			chooseNext() {
 				let that = this
-				that.token = that.tokenList.find(item => item.bl == false)
+				// if()
+				let token = that.tokenList.find(item => item.bl == false)
+				if(token && token.id) {
+					that.token = token
+				}else {
+					that.auto_order = false
+				}
+				
 				if (that.auto_order) {
 					if (that.token) {
 						if (that.xdForm.lls == '') {

+ 42 - 30
src/views/order/orderList.vue

@@ -105,7 +105,7 @@
 			</el-table>
 			<!-- 分页区域 -->
 			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-				:current-page="queryInfo.page" :page-sizes="[10, 20, 50, 100]" :page-size="queryInfo.pagesize"
+				:current-page="queryInfo.page" :page-sizes="[10, 20, 50, 100]" :page-size="queryInfo.limit"
 				layout="total, sizes, prev, pager, next, jumper" :total="total">
 			</el-pagination>
 		</el-card>
@@ -161,6 +161,7 @@
 		name: 'Order',
 		data() {
 			return {
+				today: new Date(new Date().setHours(0,0,0,0)-0*24*60*60*1000).getTime(),
 				newTime: new Date().getTime(),
 				yjloading: false,
 				logProgInfo: [],
@@ -181,10 +182,10 @@
 				total: 0,
 				dataloading: false,
 				sqtkitem: {},
+				num: 0,
 			}
 		},
 		created() {
-			// this.getList()
 
 		},
 		computed: {
@@ -280,7 +281,7 @@
 				if (item.loading || this.loading) {
 					return
 				}
-				
+
 				this.$confirm(tit, '提示', {
 					confirmButtonText: '确定',
 					cancelButtonText: '取消',
@@ -314,39 +315,47 @@
 				// 	this.$msg.success(res.msg)
 				// 	this.getList()
 				// })
-        console.log('ddd');
+				console.log('ddd');
 				let that = this
 				that.yjloading = true
 				if (i < arr.length) {
-          if(arr[i].status < 5) {
-            if (arr[i].loaded) {
-            	that.oneWork(arr, ++i)
-            } else {
-            	arr[i].loading = true
-            	setTimeout(() => {
-                
-            		batchOrder({
-            			id: arr[i].id,
-            			status: arr[i].status
-            		}).then(res => {
-            			arr[i].tag = res.msg
-            			arr[i].loading = false
-            			arr[i].loaded = true
-            			that.oneWork(arr, ++i)
-            		}).catch(err => {
-            			console.log(i);
-            			arr[i].loading = false
-            			that.yjloading = false
-            		})
-            	}, 2000)
-            }
-          }else {
-            that.oneWork(arr, ++i)
-          }
-					
+					if(arr[i].lasttime*1000 > this.today) {
+						++this.num
+					}
+					if (arr[i].status < 5 && arr[i].lasttime*1000 < this.today) {
+						if (arr[i].loaded) {
+							that.oneWork(arr, ++i)
+						} else {
+							arr[i].loading = true
+							setTimeout(() => {
 
+								batchOrder({
+									id: arr[i].id,
+									status: arr[i].status
+								}).then(res => {
+									arr[i].tag = res.msg
+									arr[i].loading = false
+									arr[i].loaded = true
+									that.oneWork(arr, ++i)
+								}).catch(err => {
+									console.log(i);
+									arr[i].loading = false
+									that.yjloading = false
+								})
+							}, 2000)
+						}
+					} else {
+						that.oneWork(arr, ++i)
+					}
 				} else {
 					that.yjloading = false
+					console.log(that.num);
+					if(that.num != that.list.length) {
+						that.num = 0
+						this.getList('yjcl')
+					}else {
+						that.$msg.success('一键处理完成')
+					}
 				}
 			},
 			handleSelectionChange(val) {
@@ -394,6 +403,9 @@
 						return item
 					})
 					that.dataloading = false
+					if (type == 'yjcl') {
+						that.oneWork(this.list)
+					}
 				}).catch(err => {
 					that.dataloading = false
 				})

+ 1 - 1
src/views/user/jssq.vue

@@ -14,7 +14,7 @@
 			<el-table :data="list" border style="width: 100%" max-height="620">
 				<el-table-column prop="id" label="id" width="50">
 				</el-table-column>
-				<el-table-column prop="expenses_sum" label="手续费" width="100">
+				<el-table-column prop="expenses_sum" label="物流费" width="100">
 				</el-table-column>
 				<el-table-column prop="commission_sum" label="手续费" width="100">
 				</el-table-column>

+ 91 - 34
src/views/user/rechangeList.vue

@@ -20,12 +20,12 @@
 						<el-image style="width: 100px; height:100px" :src="scope.row.image"></el-image>
 					</template>
 				</el-table-column> -->
-				<!-- <el-table-column prop="status" label="审核结果" width="150">
+				<el-table-column prop="status" label="审核结果" width="150">
 					<template slot-scope="scope">
 						<el-tag type="success" v-if="scope.row.status == 1">已通过</el-tag>
-						<el-tag type="info" v-if="scope.row.status == 0">审核</el-tag>
+						<el-tag type="info" v-if="scope.row.status == 0">审核</el-tag>
 					</template>
-				</el-table-column> -->
+				</el-table-column>
 				<el-table-column prop="status" label="创建时间">
 					<template slot-scope="scope">
 						{{showTime(scope.row.createtime) }}
@@ -39,39 +39,60 @@
 				layout="total, prev, pager, next, jumper" :total="total">
 			</el-pagination>
 		</el-card>
-		<!-- 修改地址对话框 -->
-		<el-dialog title="充值" :visible.sync="dialogTableVisible">
+		<!--  -->
+		<el-dialog title="充值" :visible.sync="czVisible" width="350px">
 			<el-form :model="form">
-				<!-- payimg -->
-				<el-form-item label="充值二维码" :label-width="formLabelWidth">
-					<vueQrCode :size=qrCodeSize :text="qrCodeText"> </vueQrCode>
-				</el-form-item>
-				<el-form-item label="TRC20地址" :label-width="formLabelWidth">
+				<el-form-item label="充值金额" :label-width="formLabelWidth">
 					<div class="flex">
-						<el-input v-model="qrCodeText" type="text" disabled></el-input>
-						<el-button @click="onCopy(qrCodeText)" style="margin-left: 20px;">复制地址</el-button>
+						<el-input v-model="form.recharge_num" type="text"></el-input>
 					</div>
 				</el-form-item>
-				<!-- <el-form-item label="充值凭证" :label-width="formLabelWidth">
-					<el-upload class="avatar-uploader" action="http://www.pingguozhushou.shop/api/common/upload"
-						:show-file-list="false" :headers="headers" :on-success="handleAvatarSuccess"
-						:before-upload="beforeAvatarUpload">
-						<img v-if="form.image" :src="form.image" class="avatar">
-						<i v-else class="el-icon-plus avatar-uploader-icon"></i>
-					</el-upload>
-				</el-form-item> -->
-				
 			</el-form>
-			<!-- <div class="t-r">
-				到账: {{((form.recharge_num*1 || 0)*(baseInfo.to_rmb*1)).toFixed(2)}}元
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="czVisible = false">取 消</el-button>
+				<el-button type="primary" @click="getInfo">确 定</el-button>
 			</div>
-			<div class="t-r">
-				当前余额: {{userInfo.money*1}}元
+		</el-dialog>
+		<!-- 修改地址对话框 -->
+		<el-dialog title="充值" :visible.sync="dialogTableVisible" width="500px">
+			<div class="biaoti">
+				温馨提示
 			</div>
-			<div slot="footer" class="dialog-footer">
+			<div class="tis" style="color: red;">
+				充值地址请以当前地址为准,如转错地址导致货币丢失,责任自负
+			</div>
+			<div class="biaoti">
+				钱包二维码
+			</div>
+			<div class="tis">
+				<vueQrCode :size=qrCodeSize :text="form.address"> </vueQrCode>
+				<div v-if="timer && time.isend == false" style="color: red;">充值剩余时间 : {{time.minutes + ':' + time.seconds }}</div>
+				<div v-if="timer && time.isend" style="color: red;">当前地址已过期</div>
+			</div>
+			
+			<div class="biaoti">
+				钱包地址
+			</div>
+			<div class="flex tis">
+				<el-input v-model="form.address" type="text" disabled></el-input>
+				<el-button @click="onCopy(form.address)" style="margin-left: 20px;">复制地址</el-button>
+			</div>
+			<div class="biaoti">
+				充值金额
+			</div>
+			<div class="tis">
+				<el-input v-model="form.recharge_num" type="text" disabled></el-input>
+			</div>
+			<div class="biaoti">
+				充值金额提示
+			</div>
+			<div style="color: red;">
+				请按照实际到账金额(扣除手续费之后的到账):{{form.recharge_num}}进行充值,错误到账金额不予到账!
+			</div>
+			<div class="dialog-footer">
 				<el-button @click="dialogTableVisible = false">取 消</el-button>
-				<el-button type="primary" @click="goBuy">确 定</el-button>
-			</div> -->
+				<el-button type="primary" @click="dialogTableVisible = false">确 定</el-button>
+			</div>
 		</el-dialog>
 	</div>
 </template>
@@ -91,10 +112,12 @@
 	import {
 		getRechangeList,
 		rechange,
-		getUserInfo
+		getUserInfo,
+		getrecharge
 	} from '@/request/user.js'
 	import {
-		showTime
+		showTime,
+		timeComputed
 	} from '@/assets/js/tools.js'
 	export default {
 		components: {
@@ -103,6 +126,7 @@
 		name: 'Order',
 		data() {
 			return {
+				czVisible: false,
 				qrCodeSize: 150,
 				qrCodeText: '',
 				loading: false,
@@ -120,7 +144,9 @@
 				list: [],
 				total: 0,
 				dataloading: false,
-				headers: {}
+				headers: {},
+				time: {},
+				timer: ''
 			}
 		},
 		created() {
@@ -130,26 +156,44 @@
 			this.headers['token'] = window.localStorage.getItem('token')
 		},
 		computed: {
-			...mapState(['baseInfo', 'www','userInfo']),
+			...mapState(['baseInfo', 'www', 'userInfo']),
 
 		},
 		methods: {
 			...mapMutations(['setBaseInfo', 'setUserInfo']),
 			showTime,
+			getInfo() {
+				getrecharge(this.form).then(res => {
+					console.log(res);
+					this.czVisible = false
+					this.dialogTableVisible = true
+					this.form = res.data
+					this.qrCodeText = res.data.address
+					if(this.timer) {
+						clearInterval(this.timer)
+					}
+					this.timer = setInterval(()=>{
+						this.time = timeComputed(res.data.endtime*1000)
+					},1000)
+					
+				})
+			},
 			onCopy(text) {
 				this.$copyText(text).then(
 					e => {
 						console.log('复制成功:', e);
+						this.$msg.success('复制成功')
 					},
 					e => {
 						console.log('复制失败:', e);
+						this.$msg.error('复制失败')
 					}
 				)
 			},
 			getIndex() {
 				getIndex().then(res => {
 					this.setBaseInfo(res.data)
-					this.qrCodeText = res.data.trc20
+					// this.qrCodeText = res.data.trc20
 				})
 			},
 			getUserInfo() {
@@ -179,7 +223,8 @@
 
 			},
 			openBuy() {
-				this.dialogTableVisible = true
+				// this.dialogTableVisible = true
+				this.czVisible = true
 			},
 			goBuy() {
 				let that = this
@@ -258,8 +303,20 @@
 		border: 1px dashed #d9d9d9;
 		border-radius: 10px;
 	}
+
 	.t-r {
 		text-align: right;
 		padding-top: 10px;
 	}
+	.biaoti {
+		font-size: 18px;
+		color: #000;
+		font-weight: bold;
+		padding: 20px 0;
+	}
+	.dialog-footer {
+		display: flex;
+		justify-content: flex-end;
+		// width: 500px;
+	}
 </style>

+ 127 - 54
src/views/user/setUserinfo.vue

@@ -54,13 +54,13 @@
 					<el-button type="text" v-else>已开通</el-button>
 				</div>
 			</div>
-      <div class="u-item flex" v-if="userInfo.agent_id != 1">
-      	<div class="base">账号有效时间</div>
-      	<div style="display: flex;flex-direction: column;align-items: flex-end;">
-      		<el-button type="text" @click="xfVisible = true">点击续费</el-button>
-          <div>到期时间:{{showTime(userInfo.order_create_endtime) }}</div>
-      	</div>
-      </div>
+			<div class="u-item flex" v-if="userInfo.agent_id != 1">
+				<div class="base">账号有效时间</div>
+				<div style="display: flex;flex-direction: column;align-items: flex-end;">
+					<el-button type="text" @click="xfVisible = true">点击续费</el-button>
+					<div>到期时间:{{showTime(userInfo.order_create_endtime) }}</div>
+				</div>
+			</div>
 		</div>
 		<!-- 		<el-card>
 			<div class="wrap">
@@ -96,20 +96,74 @@
 				</div>
 			</div>
 		</el-card> -->
-    <!-- 账号续费 -->
-    <el-dialog title="提示" :visible.sync="xfVisible" width="350px">
-    	<span style="display: block; padding: 0 0 20px 20px;">账号续费需支付{{baseInfo.code_price}}元</span>
-    
-    	<el-form v-if="userInfo.is_binding == 1">
-    		<el-form-item label="动态口令">
-    			<el-input v-model="dtkl" type="number"></el-input>
-    		</el-form-item>
-    	</el-form>
-    	<span slot="footer" class="dialog-footer" style="width: 300px;">
-    		<el-button @click="xfVisible = false">取 消</el-button>
-    		<el-button type="primary" @click="xfzh">确 定</el-button>
-    	</span>
-    </el-dialog>
+		<el-dialog title="充值" :visible.sync="czVisible" width="350px">
+			<el-form :model="form">
+				<el-form-item label="充值金额" :label-width="formLabelWidth">
+					<div class="flex">
+						<el-input v-model="czForm.recharge_num" type="text"></el-input>
+					</div>
+				</el-form-item>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="czVisible = false">取 消</el-button>
+				<el-button type="primary" @click="getInfo">确 定</el-button>
+			</div>
+		</el-dialog>
+		<el-dialog title="充值" :visible.sync="cztVisible" width="500px">
+			<div class="biaoti">
+				温馨提示
+			</div>
+			<div class="tis" style="color: red;">
+				充值地址请以当前地址为准,如转错地址导致货币丢失,责任自负
+			</div>
+			<div class="biaoti">
+				钱包二维码
+			</div>
+			<div class="tis">
+				<vueQrCode :size=qrCodeSize :text="czForm.address"> </vueQrCode>
+				<div v-if="timer && time.isend == false" style="color: red;">充值剩余时间 :
+					{{time.minutes + ':' + time.seconds }}</div>
+				<div v-if="timer && time.isend" style="color: red;">当前地址已过期</div>
+			</div>
+
+			<div class="biaoti">
+				钱包地址
+			</div>
+			<div class="flex tis">
+				<el-input v-model="czForm.address" type="text" disabled></el-input>
+				<el-button @click="onCopy(czForm.address)" style="margin-left: 20px;">复制地址</el-button>
+			</div>
+			<div class="biaoti">
+				充值金额
+			</div>
+			<div class="tis">
+				<el-input v-model="czForm.recharge_num" type="text" disabled></el-input>
+			</div>
+			<div class="biaoti">
+				充值金额提示
+			</div>
+			<div style="color: red;">
+				请按照实际到账金额(扣除手续费之后的到账):{{czForm.recharge_num}}进行充值,错误到账金额不予到账!
+			</div>
+			<div class="dialog-footer">
+				<el-button @click="cztVisible = false">取 消</el-button>
+				<el-button type="primary" @click="cztVisible = false">确 定</el-button>
+			</div>
+		</el-dialog>
+		<!-- 账号续费 -->
+		<el-dialog title="提示" :visible.sync="xfVisible" width="350px">
+			<span style="display: block; padding: 0 0 20px 20px;">账号续费需支付{{baseInfo.code_price}}元</span>
+
+			<el-form v-if="userInfo.is_binding == 1">
+				<el-form-item label="动态口令">
+					<el-input v-model="dtkl" type="number"></el-input>
+				</el-form-item>
+			</el-form>
+			<span slot="footer" class="dialog-footer" style="width: 300px;">
+				<el-button @click="xfVisible = false">取 消</el-button>
+				<el-button type="primary" @click="xfzh">确 定</el-button>
+			</span>
+		</el-dialog>
 		<!--  添加地址 -->
 		<el-dialog title="设置地址" :visible.sync="adVisible" @close="closeAd" width="600px">
 			<el-form :model="adForm" style="width: 500px;">
@@ -236,9 +290,8 @@
 			</div>
 		</el-dialog>
 		<!-- 充值 -->
-		<el-dialog title="充值" :visible.sync="czVisible" @close="closeCz" width="600px">
+		<!-- <el-dialog title="充值" :visible.sync="czVisible" @close="closeCz" width="600px">
 			<el-form :model="czForm">
-				<!-- payimg -->
 				<el-form-item label="充值二维码" :label-width="formLabelWidth">
 					<vueQrCode :size=qrCodeSize :text="qrCodeText"> </vueQrCode>
 				</el-form-item>
@@ -249,27 +302,17 @@
 					</div>
 
 				</el-form-item>
-				<!-- <el-form-item label="充值凭证" :label-width="formLabelWidth">
+				<el-form-item label="充值凭证" :label-width="formLabelWidth">
 					<el-upload class="avatar-uploader" action="http://www.pingguozhushou.shop/api/common/upload"
 						:show-file-list="false" :headers="headers" :on-success="handleCzSuccess"
 						:before-upload="beforeAvatarUpload">
 						<img v-if="czForm.image" :src="czForm.image" class="czimg">
 						<i v-else class="el-icon-plus avatar-uploader-icon"></i>
 					</el-upload>
-				</el-form-item> -->
+				</el-form-item>
 
 			</el-form>
-			<!-- <div class="t-r">
-				到账: {{((form.recharge_num*1 || 0)*(baseInfo.to_rmb*1)).toFixed(2)}}元
-			</div>
-			<div class="t-r">
-				当前余额: {{userInfo.money*1}}元
-			</div>
-			<div slot="footer" class="dialog-footer">
-				<el-button @click="closeCz">取 消</el-button>
-				<el-button type="primary" @click="goCz">确 定</el-button>
-			</div> -->
-		</el-dialog>
+		</el-dialog> -->
 	</div>
 </template>
 
@@ -295,9 +338,13 @@
 		payAuto,
 		repwd,
 		address,
-    xfZh
+		xfZh,
+		getrecharge
 	} from '@/request/user.js'
-  import { showTime } from '@/assets/js/tools.js'
+	import {
+		showTime,
+		timeComputed
+	} from '@/assets/js/tools.js'
 	export default {
 		name: 'Order',
 		components: {
@@ -305,8 +352,10 @@
 		},
 		data() {
 			return {
-        xfVisible: false,
-        
+				time: {},
+				timer: '',
+				xfVisible: false,
+				cztVisible: false,
 				dtkl: '',
 				xdVisible: false,
 				images: '',
@@ -321,7 +370,7 @@
 				czVisible: false,
 				czForm: {
 					recharge_num: '',
-					image: ''
+					// image: ''
 				},
 				txVisible: false,
 				txForm: {
@@ -396,19 +445,37 @@
 			// this.getga()
 		},
 		methods: {
-      showTime,
+			showTime,
 			...mapMutations(['setUserInfo', 'setBaseInfo']),
-      xfzh() {
-        let that = this
-        if(that.baseInfo.code_price*1 > that.userInfo.money*1) {
-          return that.$msg.error('您的账号余额不足,请充值后操作')
-        }
-        xfZh().then(res => {
-          that.$msg.success('续费成功')
-          that.getUserInfo()
-          that.xfVisible = false
-        })
-      },
+			getInfo() {
+				this.timer = null
+				this.time = {}
+				getrecharge(this.czForm).then(res => {
+					console.log(res);
+					this.czVisible = false
+					this.cztVisible = true
+					this.czForm = res.data
+					this.qrCodeText = res.data.address
+					if (this.timer) {
+						clearInterval(this.timer)
+					}
+					this.timer = setInterval(() => {
+						this.time = timeComputed(res.data.endtime * 1000)
+					}, 1000)
+
+				})
+			},
+			xfzh() {
+				let that = this
+				if (that.baseInfo.code_price * 1 > that.userInfo.money * 1) {
+					return that.$msg.error('您的账号余额不足,请充值后操作')
+				}
+				xfZh().then(res => {
+					that.$msg.success('续费成功')
+					that.getUserInfo()
+					that.xfVisible = false
+				})
+			},
 			closeAd() {
 				this.adVisible = false
 				this.adForm.address = ''
@@ -726,7 +793,7 @@
 	.dialog-footer {
 		display: flex;
 		justify-content: flex-end;
-		width: 500px;
+		// width: 500px;
 	}
 
 	.avatar-uploader-icon {
@@ -766,4 +833,10 @@
 		width: 178px;
 		height: 178px;
 	}
+	.biaoti {
+		font-size: 18px;
+		color: #000;
+		font-weight: bold;
+		padding: 20px 0;
+	}
 </style>