lhl 2 年之前
父節點
當前提交
9f8a37a0f9

+ 9 - 2
src/App.vue

@@ -16,7 +16,7 @@
 			// }
 			this.getIndex()
 			console.log('dd');
-			let userInfo = JSON.parse(window.sessionStorage.getItem('user'))
+			let userInfo = JSON.parse(window.localStorage.getItem('user'))
 			console.log(userInfo, 'userInfo');
 			if (userInfo && userInfo.id) {
 				this.setUserInfo(userInfo)
@@ -46,7 +46,14 @@
 		}
 	}
 </script>
-<style lang="scss" scoped>
+<style lang="scss">
+	.el-cascader-menu {
+	    height: 300px !important;
+	}
+	
+	.el-cascader-menu__wrap {
+	    height: 300px !important;
+	}
 	#app {
 		max-width: 1920px;
 		min-width: 1202px;

二進制
src/assets/img/sx.png


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

@@ -22,4 +22,13 @@ export function sj(arr) {
 	let n = 0
 	let result = parseInt(Math.random()*(m-n+1)+n,10)
 	return arr[result];
+}
+
+export function sjz(n,m) {
+	var min = Math.ceil(n); // 向上取整
+	  var max = Math.floor(m); // 向下取整
+	
+	 let result = Math.floor(Math.random() * (max - min + 1)) + min;
+	   console.log(n,m,result);
+	  return result
 }

+ 19 - 1
src/request/agent.js

@@ -10,6 +10,24 @@ export function getIndex(data) {
 	});
 }
 
+//获取验证码
+export function getSpace(data) {
+	return request({
+		url: '/api/index/space',
+		method: 'get',
+		data
+	});
+}
+
+//校验
+export function spaceCheck(data) {
+	return request({
+		url: '/api/index/space_check',
+		method: 'post',
+		params: data
+	});
+}
+ 
 //获取快递信息、
 export function getExpressDelivery(data) {
 	//index/getExpressDelivery
@@ -106,4 +124,4 @@ export function dataCount(data) {
 		method: 'get',
 		params:data
 	});
-}
+}

+ 3 - 1
src/request/request.js

@@ -22,7 +22,7 @@ service.interceptors.request.use(
 		// let each request carry token
 		// ['X-Token'] is a custom headers key
 		// please modify it according to the actual situation
-		config.headers['token'] = window.sessionStorage.getItem('token') || ''
+		config.headers['token'] = window.localStorage.getItem('token') || ''
 		// if(config.method=='get'){
 		// 	if(!config.params){
 		// 		config.params={};
@@ -58,6 +58,8 @@ service.interceptors.response.use(
 					let url = res.data.wxurl + '?url=' + encodeURIComponent(window.location.href);
 					window.location.href = url;
 			} else if (res.errcode === 401) {
+					window.localStorage.removeItem('token');
+					window.localStorage.removeItem('user');
 					router.push("/login");
 			} else {
 				// Toast({

+ 2 - 1
src/request/user.js

@@ -157,4 +157,5 @@ export function checkCode(data) {
 		method: 'post',
 		data
 	});
-}
+}
+

+ 2 - 1
src/router.js

@@ -203,7 +203,8 @@ let router = new Router({
 // 路由导航守卫
 router.beforeEach((to, from, next) => {
   if (to.path === '/login') return next()
-  const tokenStr = window.sessionStorage.getItem('token')
+  const tokenStr = window.localStorage.getItem('token')
+  console.log(tokenStr,'tokenStr');
   if (!tokenStr) return next('/login')
   next()
 })

+ 1 - 1
src/store.js

@@ -22,7 +22,7 @@ export default new Vuex.Store({
 	},
 	setUserInfo(state,payload) {
 		state.userInfo = payload
-		window.sessionStorage.setItem('user', JSON.stringify(payload))
+		window.localStorage.setItem('user', JSON.stringify(payload))
 	},
 	setBaseInfo(state,payload) {
 		state.baseInfo = payload

+ 1 - 1
src/views/Login.vue

@@ -171,7 +171,7 @@
 					that.$msg.success('登录成功')
 					console.log(res);
 					that.setUserInfo(res.data.userinfo)
-					window.sessionStorage.setItem('token', res.data.userinfo.token)
+					window.localStorage.setItem('token', res.data.userinfo.token)
 					
 					that.$router.push("/home")
 				})

+ 582 - 69
src/views/home/addOrder.vue

@@ -28,25 +28,28 @@
 
 					<div>浏览宝贝</div>
 					<div>
-						<el-input v-model="xdForm.lls" placeholder="" class="jige"></el-input> 秒 ~ <el-input
-							v-model="xdForm.lle" placeholder="" class="jige"></el-input> 秒
+						<el-input v-model="xdForm.lls" placeholder="" class="jige chang" type="number"></el-input> 秒 ~ <el-input
+							v-model="xdForm.lle" placeholder="" class="jige chang" type="number"></el-input> 秒
 					</div>
 					<div>浏览店铺</div>
 					<div>
-						浏览 <el-input v-model="xdForm.lds" placeholder="" class="jige"></el-input> 秒 ~ <el-input
-							v-model="xdForm.lde" placeholder="" class="jige"></el-input> 秒
+						浏览 <el-input v-model="xdForm.lds" placeholder="" class="jige chang" type="number"></el-input> 秒 ~ <el-input
+							v-model="xdForm.lde" placeholder="" class="jige chang" type="number"></el-input> 秒
 					</div>
 					<div>
-						货比 <el-input v-model="xdForm.hb" placeholder="" class="jige"></el-input> 家 浏览 <el-input
-							v-model="xdForm.hbs" placeholder="" class="jige"></el-input> ~ <el-input
-							v-model="xdForm.hbe" placeholder="" class="jige"></el-input>秒
+						货比 <el-input v-model="xdForm.hb" placeholder="" class="jige chang" type="number"></el-input> 家 
 					</div>
 					<div>
-						销量 <el-input v-model="xdForm.xl" placeholder="" class="jige"></el-input> 单以下不下单
+						浏览 <el-input
+							v-model="xdForm.hbs" placeholder="" class="jige chang" type="number" ></el-input> ~ <el-input
+							v-model="xdForm.hbe" placeholder="" class="jige chang" type="number"></el-input>秒
 					</div>
 					<div>
-						价格区间 <el-input v-model="xdForm.minPrice" placeholder="" class="jige"></el-input> ~ <el-input
-							v-model="xdForm.maxPrice" placeholder="" class="jige"></el-input>
+						销量 <el-input v-model="xdForm.xl" placeholder="" class="jige chang" type="number"></el-input> 单以下不下单
+					</div>
+					<div>
+						价格区间 <el-input v-model="xdForm.minPrice" placeholder="" class="jige chang" type="number"></el-input> ~ <el-input
+							v-model="xdForm.maxPrice" placeholder="" class="jige chang" type="number"></el-input>
 					</div>
 					<div class="tit">下单方案</div>
 					<div>
@@ -88,18 +91,19 @@
 										style="margin-left: 10px;" @click="sjPhone">随机</el-button></div>
 							</el-form-item>
 							<el-form-item label="省市区" :label-width="formLabelWidth">
-								<el-cascader size="large" :options="regionData" v-model="xdForm.area">
+								<el-cascader size="large" :options="regionData" :props="{value: 'label'}"
+									v-model="area">
 								</el-cascader>
-<!-- 
+								<!-- 
 								<el-cascader v-model="xdForm.area" :options="citys"
 									:props="{ expandTrigger: 'hover',value: 'value',label: 'value' }"
 									@change="handleChange"></el-cascader> -->
 							</el-form-item>
 							<el-form-item label="收货地址" :label-width="formLabelWidth">
-								<el-input v-model="baseInfo.address" type="text"></el-input>
+								<el-input v-model="xdForm.address" type="text"></el-input>
 							</el-form-item>
 							<el-form-item label="邮编" :label-width="formLabelWidth">
-								<el-input v-model="baseInfo.zip" type="text"></el-input>
+								<el-input v-model="xdForm.zip" type="text"></el-input>
 							</el-form-item>
 						</el-form>
 						<div class="dialog-footer flex" style="width: 80%;justify-content: flex-end;">
@@ -114,23 +118,39 @@
 						<el-scrollbar style="height:100%" wrap-style="overflow-x:hidden;">
 							<div class="flex tip-list">
 								<div class="tip" v-for="item in tipList">
-									{{item.title}}
+									{{item.tit}}
 								</div>
 							</div>
 						</el-scrollbar>
 					</div>
 				</div>
 			</div>
+			
 		</el-card>
 		<!-- 修改地址对话框 -->
-		<el-dialog title="人机校验" :visible.sync="dialogTableVisible" class="rjjy">
-			<div class="flex" style="justify-content: center;" v-if="dialogTableVisible">
+		<el-dialog title="拼多多安全验证" :visible.sync="dialogTableVisible" class="rjjy" @close="closeJy">
+			<!-- <div class="flex" style="justify-content: center;" v-if="dialogTableVisible">
 				<slide-verify :l="42" :r="10" :w="310" :h="155" slider-text="向右滑动" @success="onSuccess" @fail="onFail"
 					@refresh="onRefresh" :imgs="imgs"></slide-verify>
+			</div> -->
+			<div >
+				<div class="jy-wrap">
+					<el-image style="width: 262px; height:175px" class="jy-img" :src="jyimg" @click="jyClick"></el-image>
+					<div class="jy-hd" v-for="(item,index) in hdList" :style="{top: item.y ,left: item.x,width: hdw+ 'px',height: hdw + 'px'}">{{index+1}}</div>
+					<div class="suaxin hand" @click="refresh">
+						<img src="../../assets/img/sx.png" alt="" class="">
+					</div>
+				</div>
 			</div>
 		</el-dialog>
 		<el-dialog title="提示" :visible.sync="dialogVisible" width="30%">
-			<span>开通自动下单需支付{{baseInfo.auto_order}}元</span>
+			<span style="display: block; padding: 0 0 20px 20px;">开通自动下单需支付{{baseInfo.auto_order}}元</span>
+
+			<el-form v-if="userInfo.is_binding == 1">
+				<el-form-item label="动态口令" :label-width="formLabelWidth">
+					<el-input v-model="dtkl" type="number"></el-input>
+				</el-form-item>
+			</el-form>
 			<span slot="footer" class="dialog-footer">
 				<el-button @click="dialogVisible = false">取 消</el-button>
 				<el-button type="primary" @click="ktAuto">确 定</el-button>
@@ -146,7 +166,7 @@
 		<div class="mask" v-if="auto_order">
 			<!-- el-icon-loading -->
 			<i class="el-icon-loading mask-loading"></i>
-			<el-button @click="showStop = true" style="margin-top: 20px;">停止自动下单</el-button>
+			<el-button @click="showStop = true" style="margin-top: 20px;" type="primary">停止自动下单</el-button>
 		</div>
 	</div>
 </template>
@@ -164,7 +184,8 @@
 		createCode,
 		getUserList,
 		getIndex,
-
+		getSpace,
+		spaceCheck
 	} from '@/request/agent.js'
 	import {
 		getRechangeList,
@@ -172,11 +193,13 @@
 		getTokenList,
 		createOrder,
 		getUserInfo,
-		payAuto
+		payAuto,
+
 	} from '@/request/user.js'
 	import {
 		showTime,
-		sj
+		sj,
+		sjz
 	} from '@/assets/js/tools.js'
 	import city from '@/assets/js/cityData.js'
 	import {
@@ -190,11 +213,19 @@
 		name: 'Order',
 		data() {
 			return {
+				unique_code: '',
+				hdcount: 0,
+				hdw: 20,
+				hdList: [],
+				jyimg:'',
+				dtkl: '',
+				orderInfo: '',
+				area: ['浙江省','台州市','路桥区'],
 				regionData,
 				citys: city,
 				options: [{
-					value: '拼图',
-					label: '拼图'
+					value: '拼',
+					label: '拼'
 				}, {
 					value: '开团',
 					label: '开团'
@@ -205,21 +236,21 @@
 					// 有用数据
 					phone: '',
 					address: '',
-					minPrice: '',
-					maxPrice: '',
+					minPrice: '1',
+					maxPrice: '100',
 					consignee_name: '',
 					area: '',
 					zip: '',
 					// 虚假数据
-					lls: '',
-					lle: '',
-					lds: '',
-					lde: '',
-					hb: '',
-					hbs: '',
-					hbe: '',
-					xl: '',
-					xtype: '',
+					lls: '3',
+					lle: '5',
+					lds: '3',
+					lde: '5',
+					hb: '10',
+					hbs: '3',
+					hbe: '6',
+					xl: '300',
+					xtype: '拼团',
 					scxz: '店铺',
 					// 无效数据
 					thby: true,
@@ -255,12 +286,63 @@
 				maxPriceList: [],
 				tipList: [],
 				auto_order: false, //是否启动自动下单
+				pdarr: [{
+						id: 1,
+						tit: '账号正常开始任务'
+					},
+					{
+						id: 2,
+						tit: '模拟搜素翻页'
+					},
+					{
+						id: 3,
+						tit: '浏览宝贝'
+					},
+					{
+						id: 4,
+						tit: '浏览店铺'
+					},
+					{
+						id: 5,
+						tit: '选中商品'
+					},
+					{
+						id: 6,
+						tit: '收藏'
+					},
+					{
+						id: 7,
+						tit: '随机修改昵称'
+					},
+					{
+						id: 8,
+						tit: '正在选宝 sku,'
+					},
+					{
+						id: 9,
+						tit: '正在通信付款'
+					},
+					{
+						id: 10,
+						tit: '通信正常,正常付款'
+
+					},
+					{
+						id: 11,
+						tit: '付款成功商品名:'
+					},
+					{
+						id: 12,
+						tit: '完成订单'
+					}
+				]
 			}
 		},
 		computed: {
 			...mapState(['baseInfo', 'userInfo'])
 		},
 		created() {
+			console.log(this.regionData, 'ddd');
 			console.log();
 			this.getUserInfo()
 			this.getIndex()
@@ -271,6 +353,65 @@
 		},
 		methods: {
 			...mapMutations(['setBaseInfo', 'setUserInfo', 'jUserMoney']),
+			jyClick(event) {
+				let that = this
+				if(that.hdList.length < that.hdcount) {
+					let item = {
+						x: event.offsetX - that.hdw/2 + 'px',
+						jyx: event.offsetX,
+						y: event.offsetY - that.hdw /2 + 'px',
+						jyy: event.offsetY,
+					}
+					that.hdList.push(item)
+					if(that.hdList.length == that.hdcount) {
+						that.rjjy()
+					}
+				}
+			},
+			closeJy() {
+				this.hdList = []
+				this.hdcount = 0
+				this.jyimg = ''
+			},
+			rjjy() {
+				let that = this
+				let str = ''
+				that.hdList.forEach((item,index) => {
+					console.log(item);
+					str = str + item.jyx + ',' + item.jyy + ((index < that.hdcount-1) ? '|' : '' )
+				})
+				// console.log(str);
+				spaceCheck({
+					position: str,
+					unique_code: that.unique_code
+				}).then(res => {
+					that.$msg.success('校验成功')
+					that.token = this.ybToken
+					that.dialogTableVisible = false
+				}).catch(err => {
+					console.log(err,'daole');
+					this.closeJy()
+					getSpace().then(res => {
+						console.log(res);
+						that.hdcount = res.data.count
+						that.jyimg = res.data.url1
+						that.unique_code = res.data.unique_code
+						that.dialogTableVisible = true
+					})
+				})
+			},
+			refresh() {
+				let that = this
+				this.hdList = []
+				this.hdcount = 0
+				getSpace().then(res => {
+					console.log(res);
+					that.hdcount = res.data.count
+					that.jyimg = res.data.url1
+					that.unique_code = res.data.unique_code
+					that.dialogTableVisible = true
+				})
+			},
 			handleChange(e) {
 				console.log(e);
 			},
@@ -283,32 +424,176 @@
 					this.setUserInfo(res.data)
 				})
 			},
-			pd(arr, i = 0) {
+			pd(arr, i) {
 				let that = this
 				let len = arr.length - 1
+				console.log(i, '进入');
 				if (i <= len) {
-					if (i == 0) {
-						that.tipList.unshift(arr[i])
-						that.pd(arr, ++i)
-					} else {
-						setTimeout(() => {
-							that.tipList.unshift(arr[i])
-							if (arr[i].title.indexOf('支付金额:') != -1) {
-								// let price = zfInfo.title.replace(/支付金额:/,'')*1
-								that.jUserMoney(-1 * arr[i].title.replace(/支付金额:/, ''))
-							}
+					switch (i) {
+						// 账号正常
+						case 0:
+							that.tipList.unshift({
+								tit: '第' + that.token.count + '次下单【' + that.token.token + '-' + Date.now() + '】' +
+									arr[i].tit
+							})
+							that.pd(arr, ++i)
+							break;
+							// 翻页 
+						case 1:
+							setTimeout(() => {
+								that.tipList.unshift({
+									tit: '第' + that.token.count + '次下单【' + that.token.token + '-' + Date
+										.now() + '】' + arr[i].tit
+								})
+								that.pd(arr, ++i)
+							}, 1000)
+							break;
+							//浏览宝贝
+						case 2:
+							setTimeout(() => {
+								that.tipList.unshift({
+									tit: '第' + that.token.count + '次下单【' + that.token.token + '-' + Date
+										.now() + '】' + arr[i].tit
+								})
+								that.pd(arr, ++i)
+							}, 1000)
+							break;
+							// 浏览店铺
+						case 3:
+							setTimeout(() => {
+								that.tipList.unshift({
+									tit: '第' + that.token.count + '次下单【' + that.token.token + '-' + Date
+										.now() + '】' + '浏览店铺'
+								})
+							}, sjz(that.xdForm.lls, that.xdForm.lle) * 1000)
 							that.pd(arr, ++i)
-						}, arr[i - 1].time * 1000)
+							break;
+							//选择商品
+						case 4:
+							console.log(4, i)
+							setTimeout(() => {
+								that.tipList.unshift({
+									tit: '第' + that.token.count + '次下单【' + that.token.token + '-' + Date
+										.now() + '】' + arr[i].tit
+								})
+								that.pd(arr, ++i)
+							}, sjz(that.xdForm.lds, that.xdForm.lde) * 1000)
+							break;
+							//收藏店铺/商品
+						case 5:
+							setTimeout(() => {
+								that.tipList.unshift({
+									tit: '第' + that.token.count + '次下单【' + that.token.token + '-' + Date
+										.now() + '】' + arr[i].tit + that.xdForm.scxz
+								})
+								that.pd(arr, ++i)
+							}, sjz(that.xdForm.lds, that.xdForm.lde) * 1000)
+							break;
+							//随机修改昵
+						case 6:
+							setTimeout(() => {
+								if (this.xdForm.sjxg) {
+									that.tipList.unshift({
+										tit: '第' + that.token.count + '次下单【' + that.token.token + '-' +
+											Date
+											.now() + '】' + arr[i].tit
+									})
+								}
+								that.pd(arr, ++i)
+							}, 1000)
+							break;
+							//sku
+						case 7:
+							setTimeout(() => {
+								if (this.xdForm.sjxg) {
+									that.tipList.unshift({
+										tit: '第' + that.token.count + '次下单【' + that.token.token + '-' +
+											Date
+											.now() + '】' + arr[i].tit + that.xdForm.xtype
+									})
+								}
+								that.pd(arr, ++i)
+							}, 1000)
+							break;
+						case 8:
+							setTimeout(() => {
+								if (this.xdForm.sjxg) {
+									that.tipList.unshift({
+										tit: '第' + that.token.count + '次下单【' + that.token.token + '-' +
+											Date
+											.now() + '】' + arr[i].tit
+									})
+								}
+								that.pd(arr, ++i)
+							}, 2000)
+							break;
+						case 9:
+							setTimeout(() => {
+								if (this.xdForm.sjxg) {
+									that.tipList.unshift({
+										tit: '第' + that.token.count + '次下单【' + that.token.token + '-' +
+											Date
+											.now() + '】' + arr[i].tit
+									})
+								}
+								that.pd(arr, ++i)
+							}, 2000)
+							break;
+						case 10:
+							setTimeout(() => {
+
+								that.tipList.unshift({
+									tit: '第' + that.token.count + '次下单【' + that.token.token + '-' +
+										Date
+										.now() + '】' + arr[i].tit + that.orderInfo.goods_name + '  商品价格:' +
+										that.orderInfo.pay_price * 1 +
+										' 手续费:' + that.orderInfo.commission + ' 手续费率:' + that.baseInfo.commission +
+										'%'
+								})
+								console.log(that.orderInfo.pay_price * 1 + that.orderInfo.commission*1);
+								that.jUserMoney( -( that.orderInfo.pay_price * 1 + that.orderInfo.commission*1) )
+								that.pd(arr, ++i)
+							}, 2000)
+							break;
+						case 11:
+							setTimeout(() => {
+								if (this.xdForm.sjxg) {
+									that.tipList.unshift({
+										tit: '第' + that.token.count + '次下单【' + that.token.token + '-' +
+											Date
+											.now() + '】' + arr[i].tit
+									})
+								}
+								that.pd(arr, ++i)
+							}, 2000)
+							break;
+						default:
+							that.pd(arr, ++i)
+							break;
 					}
+
+					// if (i == 0) {
+					// 	that.tipList.unshift(arr[i])
+					// 	that.pd(arr, ++i)
+					// } else {
+					// 	setTimeout(() => {
+					// 		that.tipList.unshift(arr[i])
+					// 		if (arr[i].title.indexOf('支付金额:') != -1) {
+					// 			// let price = zfInfo.title.replace(/支付金额:/,'')*1
+					// 			that.jUserMoney(-1 * arr[i].title.replace(/支付金额:/, ''))
+					// 		}
+					// 		that.pd(arr, ++i)
+					// 	}, arr[i - 1].time * 1000)
+					// }
 				} else {
-					that.xdForm.phone = ''
-					that.xdForm.address = ''
+					// that.xdForm.phone = ''
+					// that.xdForm.consignee_name = ''
 					that.loading = false
 					if (that.auto_order) {
 						that.chooseNext()
 					} else {
-						that.xdForm.minPrice = ''
-						that.xdForm.maxPrice = ''
+						// that.xdForm.minPrice = ''
+						// that.xdForm.maxPrice = ''
 					}
 				}
 			},
@@ -317,7 +602,9 @@
 				if (that.userInfo.money * 1 < that.baseInfo.auto_order * 1) {
 					return that.$msg.error('您当前余额不足')
 				}
-				payAuto().then(res => {
+				payAuto({
+					code: that.dtkl
+				}).then(res => {
 					that.getUserInfo()
 					that.dialogVisible = false
 					that.auto_order = true
@@ -334,12 +621,73 @@
 					that.dialogVisible = true
 				} else {
 					//自动下单启动
+					if (that.xdForm.lls == '') {
+						return that.$msg.error('请输入浏览最小时间')
+					}
+					if (that.xdForm.lle == '') {
+						return that.$msg.error('请输入浏览最大时间')
+					}
+					if (that.xdForm.lle <= that.xdForm.lls) {
+						return that.$msg.error('浏览最大时间应大于最小时间')
+					}
+					
+					if (that.xdForm.lds == '') {
+						return that.$msg.error('请输入浏览店铺最小时间')
+					}
+					if (that.xdForm.lde == '') {
+						return that.$msg.error('请输入浏览店铺最大时间')
+					}
+					if (that.xdForm.lde <= that.xdForm.lds) {
+						return that.$msg.error('浏览店铺最大时间应大于最小时间')
+					}
+					
+					if (that.xdForm.hb == '') {
+						return that.$msg.error('请输入比货店铺数量')
+					}
+					if (that.xdForm.hbs == '') {
+						return that.$msg.error('请输入商品比较最小时间')
+					}
+					if (that.xdForm.hbe == '') {
+						return that.$msg.error('请输入商品比较最大时间')
+					}
+					
+					if (that.xdForm.xl == '') {
+						return that.$msg.error('请输入销量')
+					}
 					if (that.xdForm.minPrice == '') {
 						return that.$msg.error('请选择最低价格')
 					}
 					if (that.xdForm.maxPrice == '') {
 						return that.$msg.error('请选择最高价格')
 					}
+					
+					
+					if (that.xdForm.minPrice * 1 > that.xdForm.maxPrice * 1) {
+						return that.$msg.error('最高价格需大于最低价格')
+					}
+					if (that.xdForm.xtype == '') {
+						return that.$msg.error('请选择下单类型')
+					}
+					if (that.xdForm.consignee_name == '') {
+						return that.$msg.error('请输入收货人')
+					}
+					if (that.xdForm.phone == '') {
+						return that.$msg.error('请输入手机号码')
+					}
+					if (!/(^1[2|3|4|5|6|7|8|9][0-9]{9}$)/.test(that.xdForm.phone)) {
+						return that.$msg.error('请输入正确的手机号码')
+					}
+					if (that.area == '') {
+						return that.$msg.error('请选择省市区')
+					}
+					that.xdForm.area = that.area.join(',')
+					console.log(that.xdForm.area, 'that.xdForm.area');
+					if (that.xdForm.address == '') {
+						return that.$msg.error('请输入收货地址')
+					}
+					if (that.xdForm.zip == '') {
+						return that.$msg.error('请输入邮编')
+					}
 					that.auto_order = true
 					that.chooseNext()
 
@@ -352,12 +700,73 @@
 				that.token = that.tokenList.find(item => item.bl == false)
 				if (that.auto_order) {
 					if (that.token) {
+						if (that.xdForm.lls == '') {
+							return that.$msg.error('请输入浏览最小时间')
+						}
+						if (that.xdForm.lle == '') {
+							return that.$msg.error('请输入浏览最大时间')
+						}
+						if (that.xdForm.lle <= that.xdForm.lls) {
+							return that.$msg.error('浏览最大时间应大于最小时间')
+						}
+
+						if (that.xdForm.lds == '') {
+							return that.$msg.error('请输入浏览店铺最小时间')
+						}
+						if (that.xdForm.lde == '') {
+							return that.$msg.error('请输入浏览店铺最大时间')
+						}
+						if (that.xdForm.lde <= that.xdForm.lds) {
+							return that.$msg.error('浏览店铺最大时间应大于最小时间')
+						}
+
+						if (that.xdForm.hb == '') {
+							return that.$msg.error('请输入比货店铺数量')
+						}
+						if (that.xdForm.hbs == '') {
+							return that.$msg.error('请输入商品比较最小时间')
+						}
+						if (that.xdForm.hbe == '') {
+							return that.$msg.error('请输入商品比较最大时间')
+						}
+
+						if (that.xdForm.xl == '') {
+							return that.$msg.error('请输入销量')
+						}
 						if (that.xdForm.minPrice == '') {
 							return that.$msg.error('请选择最低价格')
 						}
 						if (that.xdForm.maxPrice == '') {
 							return that.$msg.error('请选择最高价格')
 						}
+
+
+						if (that.xdForm.minPrice * 1 > that.xdForm.maxPrice * 1) {
+							return that.$msg.error('最高价格需大于最低价格')
+						}
+						if (that.xdForm.xtype == '') {
+							return that.$msg.error('请选择下单类型')
+						}
+						if (that.xdForm.consignee_name == '') {
+							return that.$msg.error('请输入收货人')
+						}
+						if (that.xdForm.phone == '') {
+							return that.$msg.error('请输入手机号码')
+						}
+						if (!/(^1[2|3|4|5|6|7|8|9][0-9]{9}$)/.test(that.xdForm.phone)) {
+							return that.$msg.error('请输入正确的手机号码')
+						}
+						if (that.area == '') {
+							return that.$msg.error('请选择省市区')
+						}
+						that.xdForm.area = that.area.join(',')
+						console.log(that.xdForm.area, 'that.xdForm.area');
+						if (that.xdForm.address == '') {
+							return that.$msg.error('请输入收货地址')
+						}
+						if (that.xdForm.zip == '') {
+							return that.$msg.error('请输入邮编')
+						}
 						that.sjAddress()
 						that.sjPhone()
 						// that.$msg.success('开启自动下单,请勿进行操作')
@@ -372,8 +781,9 @@
 			},
 			createOrder() {
 				let that = this
+				console.log(that.xdForm.area);
 				if (that.loading) {
-					return
+					return this.$msg.error('正在下单中,请等待下单完成')
 				}
 				if (that.token.bl) {
 					if (that.auto_order) {
@@ -382,24 +792,77 @@
 						return this.$msg.error('该TOKEN,当天使用次数已满!')
 					}
 				}
+				if (that.xdForm.lls == '') {
+					return that.$msg.error('请输入浏览最小时间')
+				}
+				if (that.xdForm.lle == '') {
+					return that.$msg.error('请输入浏览最大时间')
+				}
+				if (that.xdForm.lle <= that.xdForm.lls) {
+					return that.$msg.error('浏览最大时间应大于最小时间')
+				}
+
+				if (that.xdForm.lds == '') {
+					return that.$msg.error('请输入浏览店铺最小时间')
+				}
+				if (that.xdForm.lde == '') {
+					return that.$msg.error('请输入浏览店铺最大时间')
+				}
+				if (that.xdForm.lde <= that.xdForm.lds) {
+					return that.$msg.error('浏览店铺最大时间应大于最小时间')
+				}
+
+				if (that.xdForm.hb == '') {
+					return that.$msg.error('请输入比货店铺数量')
+				}
+				if (that.xdForm.hbs == '') {
+					return that.$msg.error('请输入商品比较最小时间')
+				}
+				if (that.xdForm.hbe == '') {
+					return that.$msg.error('请输入商品比较最大时间')
+				}
+
+				if (that.xdForm.xl == '') {
+					return that.$msg.error('请输入销量')
+				}
 				if (that.xdForm.minPrice == '') {
 					return that.$msg.error('请选择最低价格')
 				}
 				if (that.xdForm.maxPrice == '') {
 					return that.$msg.error('请选择最高价格')
 				}
+
+
 				if (that.xdForm.minPrice * 1 > that.xdForm.maxPrice * 1) {
 					return that.$msg.error('最高价格需大于最低价格')
 				}
+				if (that.xdForm.xtype == '') {
+					return that.$msg.error('请选择下单类型')
+				}
+				if (that.xdForm.consignee_name == '') {
+					return that.$msg.error('请输入收货人')
+				}
 				if (that.xdForm.phone == '') {
 					return that.$msg.error('请输入手机号码')
 				}
 				if (!/(^1[2|3|4|5|6|7|8|9][0-9]{9}$)/.test(that.xdForm.phone)) {
 					return that.$msg.error('请输入正确的手机号码')
 				}
+				if (that.area == '') {
+					return that.$msg.error('请选择省市区')
+				}
+				that.xdForm.area = that.area.join(',')
+				console.log(that.xdForm.area, 'that.xdForm.area');
 				if (that.xdForm.address == '') {
 					return that.$msg.error('请输入收货地址')
 				}
+				if (that.xdForm.zip == '') {
+					return that.$msg.error('请输入邮编')
+				}
+
+
+
+
 				that.loading = true
 				createOrder({
 					min_price: that.xdForm.minPrice,
@@ -407,7 +870,7 @@
 					address: that.xdForm.address,
 					phone: that.xdForm.phone,
 					token: that.token.token,
-					consignee: that.xdForm.consignee_name,
+					consignee_name: that.xdForm.consignee_name,
 					area: that.xdForm.area,
 					zip: that.xdForm.zip,
 				}).then(res => {
@@ -418,12 +881,14 @@
 						that.token.bl = true
 					}
 					// 加载tip
-
-					that.pd(res.data, 0)
+					that.orderInfo = res.data
+					that.pd(that.pdarr, 0)
 
 				}).catch(err => {
 					console.log(err);
 					that.loading = false
+					that.auto_order = false
+					
 				})
 			},
 			getIndex() {
@@ -470,8 +935,6 @@
 			onSuccess() {
 				console.log('success');
 				this.token = this.ybToken
-				this.xdForm.minPrice = ''
-				this.xdForm.maxPrice = ''
 				this.dialogTableVisible = false
 			},
 			onFail() {
@@ -494,13 +957,24 @@
 			chooseToken(item) {
 				// console.log(item,'ddddd');
 				if (this.loading) {
+					return this.$msg.error('正在下单中,请等待下单完成')
+				}
+				if (item.id == this.token.id) {
 					return
 				}
 				if (item.bl) {
 					return this.$msg.error('该TOKEN,当天使用次数已满!')
 				}
+
 				this.ybToken = item
-				this.dialogTableVisible = true
+				getSpace().then(res => {
+					console.log(res);
+					this.hdcount = res.data.count
+					this.jyimg = res.data.url1
+					this.unique_code = res.data.unique_code
+					this.dialogTableVisible = true
+				})
+				// this.dialogTableVisible = true
 			},
 			handleAvatarSuccess(res, file) {
 				this.form.image = res.data.fullurl;
@@ -642,6 +1116,9 @@
 			.jige {
 				width: 50px;
 			}
+			.chang {
+				width: 100px;
+			}
 		}
 
 		.right-wrap {
@@ -661,7 +1138,8 @@
 			}
 
 			.right-btm {
-				flex-grow: 1;
+				// flex-grow: 1;
+				height: 288px;
 				padding-top: 20px;
 
 				.tip-list {
@@ -670,13 +1148,14 @@
 
 					.tip {
 						width: 80%;
-						height: 40px;
+						// height: 40px;
 						border-radius: 10px;
 						// background-color: #67c23a;
-						text-align: center;
+						// text-align: center;
 						margin: 5px 0;
-						line-height: 40px;
+						// line-height: 40px;
 						color: #000;
+						padding-bottom: 10px;
 					}
 				}
 			}
@@ -684,7 +1163,46 @@
 	}
 
 	.rjjy {
-		// width: 400px;
+		// width: 600px;
+		/deep/ .el-dialog {
+			width: 400px;
+		}
+		.jy-wrap {
+			width: 262px;
+			height: 175px;
+			margin: auto;
+			position: relative;
+			.jy-img {
+				position: relative;
+			}
+			.jy-hd {
+				position: absolute;
+				background-color: red;
+				border-radius: 50%;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				color: #fff;
+				font-size: 14px;
+			}
+			.suaxin {
+				background-color:rgba(0, 0, 0, 0.6);
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				width: 30px;
+				height: 30px;
+				position: absolute;
+				right: 10px;
+				bottom: 35px;
+				border-radius: 50%;
+				
+				img {
+					width:18px;
+					height: 18px;
+				}
+			}
+		}
 	}
 
 	.mask {
@@ -703,9 +1221,4 @@
 			color: #409eff;
 		}
 	}
-
-	/deep/ .el-cascader-menu__wrap {
-		height: 300px !important;
-		
-	}
 </style>

+ 5 - 0
src/views/home/orderList.vue

@@ -38,6 +38,8 @@
 						{{scope.row.status| showStatus}}
 					</template>
 				</el-table-column>
+				<el-table-column prop="consignee_name" label="收货人" width="200">
+				</el-table-column>
 				<el-table-column prop="consignee_phone" label="收货手机号" width="200">
 				</el-table-column>
 				<el-table-column prop="consignee_address" label="收货地址" width="350">
@@ -47,6 +49,9 @@
 				<el-table-column prop="commission" label="手续费(元)" width="150">
 				</el-table-column>
 				<el-table-column prop="compensation" label="赔付金额(元)" width="150">
+					<template slot-scope="scope">
+						{{scope.row.status == 5 ? scope.row.compensation: ''}}
+					</template>
 				</el-table-column>
 				<!-- <el-table-column prop="token" label="Token" width="350">
 				</el-table-column> -->

+ 61 - 47
src/views/home/statistics.vue

@@ -3,10 +3,10 @@
 		<!-- <breadcrumb :item-name="['订单管理', '订单列表']"></breadcrumb> -->
 		<el-card>
 			<div class="tj flex">
-				<div class="tj-item">
+				<!-- <div class="tj-item">
 					<div class="tit">手续费</div>
 					<div class="val">{{tj.commission||0}}</div>
-				</div>
+				</div> -->
 				<div class="tj-item">
 					<div class="tit">赔付金</div>
 					<div class="val">{{tj.compensation|| 0}}</div>
@@ -15,10 +15,10 @@
 					<div class="tit">订单数</div>
 					<div class="val">{{tj.order|| 0}}</div>
 				</div>
-				<div class="tj-item">
+				<!-- <div class="tj-item">
 					<div class="tit">异常订单</div>
 					<div class="val">{{tj.order_error||0}}</div>
-				</div>
+				</div> -->
 				<div class="tj-item">
 					<div class="tit">token数</div>
 					<div class="val">{{tj.tokon||0}}</div>
@@ -36,9 +36,9 @@
 					<div class="val">{{tj.withdraw_0 || 0}}</div>
 				</div>
 			</div>
-			
+			<input type="file" ref="fileInput" @change="readTxtFile" />
 		</el-card>
-		
+
 	</div>
 </template>
 
@@ -80,7 +80,7 @@
 		name: 'Order',
 		data() {
 			return {
-				showStop:false,
+				showStop: false,
 				dialogVisible: false,
 				xdForm: {
 					phone: '',
@@ -113,7 +113,7 @@
 				minPriceList: [],
 				maxPriceList: [],
 				tipList: [],
-				auto_order: false,//是否启动自动下单
+				auto_order: false, //是否启动自动下单
 				tj: {}
 			}
 		},
@@ -130,7 +130,19 @@
 			// console.log(this.imgs, 'imgs');
 		},
 		methods: {
-			...mapMutations(['setBaseInfo', 'setUserInfo','jUserMoney']),
+			...mapMutations(['setBaseInfo', 'setUserInfo', 'jUserMoney']),
+			readTxtFile() {
+				const input = this.$refs.fileInput
+				const file = input.files[0]
+
+				const reader = new FileReader()
+				reader.onload = (e) => {
+					let srt = e.target.result.replace(/\n\r/g,',').replace(/\r\n/g,',')
+					let arr = srt.split(',')
+					console.log(arr);
+				}
+				reader.readAsText(file)
+			},
 			dataCount() {
 				dataCount().then(res => {
 					console.log(res);
@@ -139,7 +151,7 @@
 			},
 			stopAuto() {
 				this.auto_order = false
-				this.showStop =false
+				this.showStop = false
 			},
 			getUserInfo() {
 				getUserInfo().then(res => {
@@ -156,20 +168,20 @@
 					} else {
 						setTimeout(() => {
 							that.tipList.unshift(arr[i])
-							if(arr[i].title.indexOf('支付金额:') != -1) {
+							if (arr[i].title.indexOf('支付金额:') != -1) {
 								// let price = zfInfo.title.replace(/支付金额:/,'')*1
-								that.jUserMoney(-1*arr[i].title.replace(/支付金额:/,''))
+								that.jUserMoney(-1 * arr[i].title.replace(/支付金额:/, ''))
 							}
 							that.pd(arr, ++i)
 						}, arr[i - 1].time * 1000)
 					}
-				}else {
+				} else {
 					that.xdForm.phone = ''
 					that.xdForm.address = ''
 					that.loading = false
-					if(that.auto_order) {
+					if (that.auto_order) {
 						that.chooseNext()
-					}else {
+					} else {
 						that.xdForm.minPrice = ''
 						that.xdForm.maxPrice = ''
 					}
@@ -182,43 +194,43 @@
 				}
 				payAuto().then(res => {
 					that.getUserInfo()
-						that.dialogVisible = false
-						that.auto_order = true
-						that.chooseNext()
+					that.dialogVisible = false
+					that.auto_order = true
+					that.chooseNext()
 					//自动下单启动
 				})
 			},
 			openZd() {
 				let that = this
-				if(that.loading) {
+				if (that.loading) {
 					return that.$msg.error('当前处于下单状态,请等待下单完成')
 				}
 				if (that.userInfo.auto_order == 0) {
 					that.dialogVisible = true
 				} else {
 					//自动下单启动
-					if(that.xdForm.minPrice == '') {
+					if (that.xdForm.minPrice == '') {
 						return that.$msg.error('请选择最低价格')
 					}
-					if(that.xdForm.maxPrice == '') {
+					if (that.xdForm.maxPrice == '') {
 						return that.$msg.error('请选择最高价格')
 					}
 					that.auto_order = true
 					that.chooseNext()
-					
-					
+
+
 				}
 			},
 			//选择下一个可用token
 			chooseNext() {
 				let that = this
-				that.token = that.tokenList.find(item => item.bl == false ) 
-				if(that.auto_order) {
-					if(that.token) {
-						if(that.xdForm.minPrice == '') {
+				that.token = that.tokenList.find(item => item.bl == false)
+				if (that.auto_order) {
+					if (that.token) {
+						if (that.xdForm.minPrice == '') {
 							return that.$msg.error('请选择最低价格')
 						}
-						if(that.xdForm.maxPrice == '') {
+						if (that.xdForm.maxPrice == '') {
 							return that.$msg.error('请选择最高价格')
 						}
 						that.sjAddress()
@@ -226,41 +238,41 @@
 						// that.$msg.success('开启自动下单,请勿进行操作')
 						// 启动
 						that.createOrder()
-					}else {
+					} else {
 						//停止
 						that.auto_order = false
 					}
-					
+
 				}
 			},
 			createOrder() {
 				let that = this
-				if(that.loading ) {
+				if (that.loading) {
 					return
 				}
-				if ( that.token.bl) {
-					if(that.auto_order) {
-						
-					}else {
+				if (that.token.bl) {
+					if (that.auto_order) {
+
+					} else {
 						return this.$msg.error('该TOKEN,当天使用次数已满!')
 					}
 				}
-				if(that.xdForm.minPrice == '') {
+				if (that.xdForm.minPrice == '') {
 					return that.$msg.error('请选择最低价格')
 				}
-				if(that.xdForm.maxPrice == '') {
+				if (that.xdForm.maxPrice == '') {
 					return that.$msg.error('请选择最高价格')
 				}
-				if(that.xdForm.minPrice*1 > that.xdForm.maxPrice*1) {
+				if (that.xdForm.minPrice * 1 > that.xdForm.maxPrice * 1) {
 					return that.$msg.error('最高价格需大于最低价格')
 				}
-				if(that.xdForm.phone == '') {
+				if (that.xdForm.phone == '') {
 					return that.$msg.error('请输入手机号码')
 				}
 				if (!/(^1[2|3|4|5|6|7|8|9][0-9]{9}$)/.test(that.xdForm.phone)) {
 					return that.$msg.error('请输入正确的手机号码')
 				}
-				if(that.xdForm.address == '') {
+				if (that.xdForm.address == '') {
 					return that.$msg.error('请输入收货地址')
 				}
 				that.loading = true
@@ -271,14 +283,14 @@
 					phone: that.xdForm.phone,
 					token: that.token.token
 				}).then(res => {
-					
+
 					//更新token
 					that.token.count++
-					if(that.token.count == 2) {
+					if (that.token.count == 2) {
 						that.token.bl = true
 					}
 					// 加载tip
-					
+
 					that.pd(res.data, 0)
 
 				}).catch(err => {
@@ -311,13 +323,13 @@
 			},
 			showTime,
 			sjPhone() {
-				if(this.loading) {
+				if (this.loading) {
 					return
 				}
 				this.xdForm.phone = sj(this.baseInfo.sys_phone)
 			},
 			sjAddress() {
-				if(this.loading) {
+				if (this.loading) {
 					return
 				}
 				this.xdForm.address = sj(this.baseInfo.system_address)
@@ -343,7 +355,7 @@
 			getTokenList() {
 				getTokenList().then(res => {
 					this.tokenList = res.data.map(item => {
-						item.count = item.count*1
+						item.count = item.count * 1
 						return item
 					})
 					// 获取第一次选择的token
@@ -353,7 +365,7 @@
 			},
 			chooseToken(item) {
 				// console.log(item,'ddddd');
-				if(this.loading) {
+				if (this.loading) {
 					return
 				}
 				if (item.bl) {
@@ -417,6 +429,7 @@
 	.tj {
 		width: 500px;
 		flex-wrap: wrap;
+
 		.tj-item {
 			width: 120px;
 			height: 120px;
@@ -427,6 +440,7 @@
 			justify-content: center;
 			align-items: center;
 			margin: 20px;
+
 			.val {
 				margin-top: 20px;
 				color: rgb(15, 131, 254);