hwq 3 jaren geleden
bovenliggende
commit
3ebcc49f76

+ 9 - 0
api/hall.js

@@ -62,3 +62,12 @@ export function belong(data) {
 		data
 	});
 }
+
+//购买商品
+export function purchase(data) {
+	return request({
+		url: '/api/auction/purchase',
+		method: 'post',
+		data
+	});
+}

+ 26 - 0
api/order.js

@@ -144,3 +144,29 @@ export function computedOrderkey(data) {
 	});
 }
 
+// 统计订单金额
+export function adopt(data) {
+	return request({
+		url: '/api/auction/adopt',
+		method: 'post',
+		data
+	});
+}
+
+//买单订单列表
+export function user_auction_order(data) {
+	return request({
+		url: '/api/auction/user_auction_order',
+		method: 'get',
+		data
+	});
+}
+
+// 上传成功
+export function up_image(data) {
+	return request({
+		url: '/api/auction/up_image',
+		method: 'post',
+		data
+	});
+}

+ 17 - 0
api/wallet.js

@@ -88,6 +88,23 @@ export function setBankInfo(data) {
 	});
 }
 
+//保存收款信息
+export function auction(data) {
+	return request({
+		url: '/api/auction/pay',
+		method: 'post',
+		data
+	});
+}
+
+//获取收款信息
+export function pay_list(data) {
+	return request({
+		url: '/api/auction/pay_list',
+		method: 'get',
+		data
+	});
+}
 
 // 账户余额
 export function balance(data) {

+ 6 - 6
pages.json

@@ -620,12 +620,12 @@
 				// "selectedIconPath": "static/tabBar/tab-cart-current.png",
 				"text": "趣豆会馆"
 			},
-			{
-				"pagePath": "pages/order/order",
-				// "iconPath": "static/tabBar/tab-cart.png",
-				// "selectedIconPath": "static/tabBar/tab-cart-current.png",
-				"text": "订单"
-			},
+			// {
+			// 	"pagePath": "pages/order/order",
+			// 	// "iconPath": "static/tabBar/tab-cart.png",
+			// 	// "selectedIconPath": "static/tabBar/tab-cart-current.png",
+			// 	"text": "订单"
+			// },
 			{
 				"pagePath": "pages/money/money",
 				// "iconPath": "static/tabBar/tab-cart.png",

+ 7 - 7
pages/collection/bank.vue

@@ -19,7 +19,7 @@
 </template>
 
 <script>
-import { userEdit } from '@/api/set.js';
+import { auction } from '@/api/wallet.js';
 import { orderData,getUserInfo } from '@/api/user.js';
 import { mapState, mapMutations } from 'vuex';
 export default {
@@ -57,13 +57,13 @@ export default {
 			if (!obj.id) {
 				return this.$api.msg('请输入银行卡号');
 			}
-			userEdit({
-				bank_user_name: obj.name,
-				bank_name: obj.idName,
-				bank_code: obj.id
+			auction({
+				type:3,
+				name: obj.name,
+				bank: obj.idName,
+				payment: obj.id
 			}).then(e => {
 				obj.$api.msg('修改成功');
-				obj.getUserInfo();
 			});
 		},
 		// 更新用户信息
@@ -137,7 +137,7 @@ page,
 	text-align: center;
 	width: 560rpx;
 	height: 80rpx;
-	background: linear-gradient(0deg, #2e58ff, #32c6ff);
+	background: #FD3B39;
 	border-radius: 40rpx;
 	font-size: 30rpx;
 	font-family: PingFangSC;

+ 18 - 15
pages/collection/collection.vue

@@ -7,7 +7,7 @@
 					<view class="bank">银行卡</view>
 				</view>
 				<view class="gg" @click="nav('/pages/collection/bank')">
-					<view class="status" v-if="bankData.fullname != null">{{ bankData.fullname}}</view>
+					<view class="status" v-if="bankData.name != null">{{ bankData.name}}</view>
 					<view class="status" v-else>未添加</view>
 					<view class="img1"><text class="iconfont iconenter"></text></view>
 				</view>
@@ -18,12 +18,12 @@
 					<view class="bank">支付宝</view>
 				</view>
 				<view class="gg" @click="nav('/pages/collection/zfb')">
-					<view class="status" v-if="aliData.fullname != null">{{aliData.fullname}}</view>
+					<view class="status" v-if="aliData.name != null">{{aliData.name}}</view>
 					<view class="status" v-else>未添加</view>
 					<view class="img1"><text class="iconfont iconenter"></text></view>
 				</view>
 			</view>
-			<!-- <view class="collection-item">
+			<view class="collection-item">
 				<view class="left">
 					<view class="img">
 						<image src="../../static/user/wx.png" mode=""></image>
@@ -33,43 +33,46 @@
 					</view>
 				</view>
 				<view class="gg" @click="nav('/pages/collection/wx')">
-					<view class="status">
-						未添加
-					</view>
+					<view class="status" v-if="wx.name != null">{{wx.name}}</view>
+					<view class="status" v-else>未添加</view>
 					<view class="img1">
 						<text class="iconfont iconenter"></text>
 					</view>
 				</view>
-			</view> -->
+			</view>
 		</view>
 	</view>
 </template>
 
 <script>
 import { mapState, mapMutations } from 'vuex';
+import { pay_list } from '../../api/wallet.js'
 export default {
 	data() {
 		return {
-			aliData: {fullname:'',alino:''},
-			bankData: {fullname:'',bank:'',bankno:''},
+			aliData: {},
+			bankData: {},
+			wx:{},
 		};
 	},
 	computed: {
 		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
 	},
 	onShow() {
-		this.aliData.fullname = this.userInfo.alipay_name;
-		console.log(this.aliData.fullname);
-		this.aliData.alino = this.userInfo.alipay_code
-		this.bankData.fullname = this.userInfo.bank_user_name;
-		this.bankData.bank = this.userInfo.bank_name;
-		this.bankData.bankno = this.userInfo.bank_code;
+		this.loadDate();
 	},
 	methods: {
 		nav(url) {
 			uni.navigateTo({
 				url
 			});
+		},
+		loadDate() {
+			pay_list().then(({data}) =>{
+				this.wx = data.wx
+				this.aliData = data.zfb
+				this.bankData = data.bank
+			})
 		}
 	}
 };

+ 40 - 8
pages/collection/wx.vue

@@ -1,40 +1,72 @@
 <template>
 	<view class="content">
 		<view class="box">
+			<view class="wx">
+				<text>姓名</text>
+				<input type="text" v-model="name" value="" placeholder="请输入姓名" />
+			</view>
 			<view class="wx">
 				<text>微信号</text>
-				<input type="text" value="" placeholder="请输入微信号" />
+				<input type="text" v-model="code" value="" placeholder="请输入微信号" />
 			</view>
 			<view class="erweima">
 				<text>微信收款码</text>
-				<view class="img" @click="upload()">
+				<view class="img" @click="uploads()">
 					<image src="../../static/user/erweima.png" mode="" v-if="image == ''"></image>
 					<image :src="image" mode="" v-else></image>
 				</view>
 			</view>
 		</view>
-		<view class="button">
+		<view class="button" @click="confirm()">
 			确认
 		</view>
 	</view>
 </template>
 
 <script>
-	import { uploads } from '@/api/user.js'
+	import { upload } from '@/api/order.js'
+	import { auction } from '@/api/wallet.js';
 	export default {
 		data() {
 			return {
+				code:'',
+				name:'',
 				image:''
 			};
 		},
 		methods: {
-			upload(){
-				uploads({
+			uploads(){
+				upload({
 					filename: ''
 				}).then(data => {
 					this.image = data[0].url;
 				})
-			}
+			},
+			confirm() {
+				let obj = this;
+				if (!obj.name) {
+					return this.$api.msg('请输入提款人姓名');
+				}
+				if (!obj.code) {
+					return this.$api.msg('请输入微信账号');
+				}
+				if (!obj.image) {
+					return this.$api.msg('请上传微信二维码');
+				}
+				auction({
+					type:1,
+					name: obj.name,
+					payment: obj.code,
+					image: obj.image
+				})
+					.then(e => {
+						obj.$api.msg('修改成功');
+						obj.getUserInfo();
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
 		}
 	}
 </script>
@@ -93,7 +125,7 @@ page , .content{
 	margin: 0 auto;
 	width: 560rpx;
 	height: 80rpx;
-	background: linear-gradient(0deg, #2E58FF, #32C6FF);
+	background: #FD3B39;
 	border-radius: 40rpx;
 	font-size: 30rpx;
 	font-family: PingFangSC;

+ 6 - 5
pages/collection/zfb.vue

@@ -17,7 +17,7 @@
 <script>
 import { orderData, getUserInfo } from '@/api/user.js';
 import { mapState, mapMutations } from 'vuex';
-import { userEdit } from '@/api/set.js';
+import { auction } from '@/api/wallet.js';
 export default {
 	computed: {
 		...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
@@ -46,9 +46,10 @@ export default {
 			if (!obj.id) {
 				return this.$api.msg('请输入支付宝账号');
 			}
-			userEdit({
-				alipay_name: obj.name,
-				alipay_code: obj.id
+			auction({
+				type:2,
+				name: obj.name,
+				payment: obj.id
 			})
 				.then(e => {
 					obj.$api.msg('修改成功');
@@ -128,7 +129,7 @@ page,
 	text-align: center;
 	width: 560rpx;
 	height: 80rpx;
-	background: linear-gradient(0deg, #2e58ff, #32c6ff);
+	background: #FD3B39;
 	border-radius: 40rpx;
 	font-size: 30rpx;
 	font-family: PingFangSC;

+ 13 - 4
pages/hall/hallinfo.vue

@@ -11,11 +11,11 @@
 			</view>
 		</view>
 		<view class="search">
-			<view class="search-left">订单</view>
+			<view class="search-left" @click="nav('/pages/order/order')">订单</view>
 			<view class="search-right">
 				<view class="input-box flex">
-					<view class="input"><input type="text" placeholder="输入关键字" /></view>
-					<image class="search-inco" src="../../static/img/search.png" mode=""></image>
+					<view class="input"><input type="text" placeholder="搜索挂售商品" v-model="productname" /></view>
+					<image @click="search()" class="search-inco" src="../../static/img/search.png" mode=""></image>
 				</view>
 			</view>
 		</view>
@@ -39,6 +39,7 @@ import { auction_product } from '@/api/hall.js'
 export default {
 	data() {
 		return {
+			productname:'',//商品名称
 			name:'',//馆名字
 			peoplename:'',//馆长名字
 			firstList: [],
@@ -55,6 +56,13 @@ export default {
 		this.loadData();
 	},
 	methods: {
+		search() {
+			this.firstList = [];
+			this.page = 1;
+			this.limit = 10;
+			this.loadingType = 'more';
+			this.loadData()
+		},
 		loadData(){
 			const obj = this;
 			if (obj.loadingType == 'nomore' || obj.loadingType == 'loading') {
@@ -64,7 +72,8 @@ export default {
 			auction_product({
 				page: obj.page,
 				limit: obj.limit,
-				id: obj.id
+				id: obj.id,
+				name: obj.productname,
 			}).then(({data}) => {
 				obj.firstList = obj.firstList.concat(data);
 				if (data.length != obj.limit) {

+ 1 - 0
pages/hall/halllist.vue

@@ -184,6 +184,7 @@ export default {
 		appointment() {
 			subscribe({id: this.id}).then(({data}) =>{
 				this.$api.msg('预约成功')
+				window.location.reload();
 				console.log(data);
 				this.price = ''
 				this.id = ''

+ 120 - 78
pages/hall/hallpay.vue

@@ -4,9 +4,9 @@
 			<view class="top-main">
 				<view class="num">
-					<text>1299.00</text>
+					<text>{{ info.price }}</text>
 				</view>
-				<image class="top-image" src="../../static/img/copy.png" mode=""></image>
+				<!-- <image class="top-image" src="../../static/img/copy.png" mode=""></image> -->
 			</view>
 			<view class="downtime">
 				<uni-countdowns
@@ -22,97 +22,94 @@
 			</view>
 		</view>
 		<view class="product flex">
-			<image class="product-image" src="../../static/img/evening.png" mode=""></image>
+			<image class="product-image" :src="info.image" mode=""></image>
 			<view class="product-info">
-				<view class="title">趣豆商城挂售礼盒</view>
+				<view class="title">{{ info.name }}</view>
 				<view class="title buyId">
 					<text>卖家ID:</text>
-					123456
+					{{ info.user_id }}
 				</view>
 				<view class="title buyName">
 					<text>卖家昵称:</text>
-					李丹丹
+					{{ info.nickname }}
 				</view>
-				<view class="title buyPhone">
+				<!-- <view class="title buyPhone">
 					<text>卖家手机号:</text>
 					123456897
-				</view>
+				</view> -->
 			</view>
 		</view>
 		<view class="main">
 			<view class="main-tip">请向以下账号自行转账(任选一种方式)</view>
 			<view class="main-title flex">
-				<view class="mt-item" @click="change('0')" :class="{ current: tabCurrentIndex === 0 }">
-					<image class="mt-image" :src="tabCurrentIndex == 0 ? '../../static/img/aliD.png' : '../../static/img/ali.png'" mode=""></image>
-					<view class="mt-font" :class="{ current: tabCurrentIndex === 0 }">支付宝</view>
+				<view class="main-item">
+					<view class="mt-item" @click="change('0')" :class="{ current: tabCurrentIndex === 0 }" v-if="zfb != ''">
+						<image class="mt-image" :src="tabCurrentIndex == 0 ? '../../static/img/aliD.png' : '../../static/img/ali.png'" mode=""></image>
+						<view class="mt-font" :class="{ current: tabCurrentIndex === 0 }">支付宝</view>
+					</view>
 				</view>
-				<view class="mt-item" @click="change('1')" :class="{ current: tabCurrentIndex === 1 }">
-					<image class="mt-image1" :src="tabCurrentIndex == 1 ? '../../static/img/bankD.png' : '../../static/img/bank.png'" mode=""></image>
-					<view class="mt-font" :class="{ current: tabCurrentIndex === 1 }">银行卡</view>
+				<view class="main-item">
+					<view class="mt-item" @click="change('1')" :class="{ current: tabCurrentIndex === 1 }" v-if="bank != ''">
+						<image class="mt-image1" :src="tabCurrentIndex == 1 ? '../../static/img/bankD.png' : '../../static/img/bank.png'" mode=""></image>
+						<view class="mt-font" :class="{ current: tabCurrentIndex === 1 }">银行卡</view>
+					</view>
 				</view>
-				<view class="mt-item" @click="change('2')" :class="{ current: tabCurrentIndex === 2 }">
-					<image class="mt-image2" :src="tabCurrentIndex == 2 ? '../../static/img/yueD.png' : '../../static/img/yue.png'" mode=""></image>
-					<view class="mt-font" :class="{ current: tabCurrentIndex === 2 }">余额</view>
+				<view class="main-item">
+					<view class="mt-item" @click="change('2')" :class="{ current: tabCurrentIndex === 2 }" v-if="wx != ''">
+						<image class="mt-image2" :src="tabCurrentIndex == 2 ? '../../static/img/yueD.png' : '../../static/img/yue.png'" mode=""></image>
+						<view class="mt-font" :class="{ current: tabCurrentIndex === 2 }">微信</view>
+					</view>
 				</view>
 			</view>
-			<swiper class="swiper-box" :current="tabCurrentIndex" :duration="500" @change="changeTab" :style="{ height: tabCurrentIndex == 1 ? '450rpx' : '280rpx' }">
-				<swiper-item class="tab-content">
+			<swiper class="swiper-box" :current="tabCurrentIndex" :duration="500" @change="changeTab" :style="{ height: tabCurrentIndex == 2 ? '450rpx' : '280rpx' }">
+				<swiper-item class="tab-content" v-if="zfb != ''">
 					<view class="tc-item flex">
-						<view class="tcitem-name">支付宝号</view>
-						<view class="ali-name">152****4123</view>
+						<view class="tcitem-name">号</view>
+						<view class="ali-name">{{ zfb.payment }}</view>
 						<image class="tcitem-image" src="../../static/img/copy.png" mode=""></image>
 					</view>
 					<view class="tc-item flex">
 						<view class="tcitem-name">姓名</view>
-						<view class="ali-name">李丹丹</view>
-						<image class="tcitem-image" src="../../static/img/copy.png" mode=""></image>
-					</view>
-					<view class="tc-item flex">
-						<view class="tcitem-name">备注</view>
+						<view class="ali-name">{{ zfb.name }}</view>
 						<image class="tcitem-image" src="../../static/img/copy.png" mode=""></image>
 					</view>
 				</swiper-item>
-				<swiper-item class="tab-content">
+				<swiper-item class="tab-content" v-if="bank != ''">
 					<view class="tc-item flex">
 						<view class="tcitem-name">姓名</view>
-						<view class="ali-name">李丹丹</view>
+						<view class="ali-name">{{ bank.name }}</view>
 						<image class="tcitem-image" src="../../static/img/copy.png" mode=""></image>
 					</view>
 					<view class="tc-item flex">
 						<view class="tcitem-name">银行</view>
-						<view class="ali-name">中国建设银行</view>
+						<view class="ali-name">{{ bank.bank }}</view>
 						<image class="tcitem-image" src="../../static/img/copy.png" mode=""></image>
 					</view>
-					<view class="tc-item flex">
+					<!-- <view class="tc-item flex">
 						<view class="tcitem-name">开户行</view>
 						<view class="ali-name">椒江支行</view>
 						<image class="tcitem-image" src="../../static/img/copy.png" mode=""></image>
-					</view>
+					</view> -->
 					<view class="tc-item flex">
 						<view class="tcitem-name">账号</view>
-						<view class="ali-name">5123456798231564894561894</view>
+						<view class="ali-name">{{ bank.payment }}</view>
 						<image class="tcitem-image" src="../../static/img/copy.png" mode=""></image>
 					</view>
-					<view class="tc-item flex">
-						<view class="tcitem-name">说明</view>
-						<view class="ali-name" style="color: #fd5452">请使用本人银行卡,否则无效</view>
-						<image class="tcitem-image" src="" mode=""></image>
-					</view>
 				</swiper-item>
-				<swiper-item class="tab-content">
+				<swiper-item class="tab-content" v-if="wx != ''">
 					<view class="tc-item flex">
 						<view class="tcitem-name">账号</view>
-						<view class="ali-name">152****4123</view>
+						<view class="ali-name">{{ wx.payment }}</view>
 						<image class="tcitem-image" src="../../static/img/copy.png" mode=""></image>
 					</view>
 					<view class="tc-item flex">
 						<view class="tcitem-name">姓名</view>
-						<view class="ali-name">李丹丹</view>
+						<view class="ali-name">{{ wx.name }}</view>
 						<image class="tcitem-image" src="../../static/img/copy.png" mode=""></image>
 					</view>
-					<view class="tc-item flex">
-						<view class="tcitem-name">备注</view>
-						<image class="tcitem-image" src="../../static/img/copy.png" mode=""></image>
+					<view class="tc-item">
+						<view class="upload-title" style="color: #9d9d9d;">微信二维码</view>
+						<view class="upload-main"><image class="upload-image" :src="wx.image" mode=""></image></view>
 					</view>
 				</swiper-item>
 			</swiper>
@@ -120,28 +117,31 @@
 		<view class="upload">
 			<view class="upload-title">上传支付截图</view>
 			<view class="upload-main">
-				<image class="upload-image" src="../../static/img/add.png" mode=""></image>
+					<image class="upload-image" src="../../static/img/add.png" mode="" v-if="image == ''" @click="uploads()"></image>
+					<image class="upload-image" :src="image" mode="" @click="uploads()" v-else></image>
 				<view class="upload-font">点击上传支付截图</view>
 			</view>
 		</view>
+		<view class="contentBottomHeight"></view>
 		<view class="bottom flex">
 			<view class="bottom-item">
 				<image class="bi-image" src="../../static/img/call.png" mode=""></image>
-				<view class="bottom-font">联系卖家
-</view>
+				<view class="bottom-font">联系卖家</view>
 			</view>
 			<view class="shu"></view>
 			<view class="bottom-item">
 				<image class="bi-image" src="../../static/img/kf.png" mode=""></image>
 				<view class="bottom-font">联系客服</view>
 			</view>
-			<view class="btn" @click="nav('/pages/hall/hallpay')">立即购买</view>
+			<view class="btn" @click="buy()">立即购买</view>
 		</view>
 	</view>
 </template>
 
 <script>
 import uniCountdowns from '@/components/uni-countdown/uni-countdowns.vue';
+import { user_auction_order,upload,up_image } from '@/api/order.js';
+import { timeComputed } from '@/utils/rocessor.js';
 export default {
 	components: {
 		uniCountdowns
@@ -150,14 +150,43 @@ export default {
 		return {
 			// 倒计时
 			stopTime: {
-				stopTimeH: 1,
-				stopTimeM: 1,
-				stopTimeS: 1
+				stopTimeH: 0,
+				stopTimeM: 0,
+				stopTimeS: 0
 			},
-			tabCurrentIndex: 0
+			tabCurrentIndex: 0,
+			id: '',
+			info: '',
+			bank: '',
+			wx: '',
+			zfb: '',
+			image:'',
 		};
 	},
+	onLoad(option) {
+		this.id = option.ordid;
+		this.loadData();
+	},
 	methods: {
+		uploads(){
+			upload({
+				filename: ''
+			}).then(data => {
+				this.image = data[0].url;
+			})
+		},
+		loadData() {
+			user_auction_order({ type: 1, order_id: this.id }).then(({ data }) => {
+				let now_time = timeComputed(data.time);
+				this.stopTime.stopTimeH = now_time.hours;
+				this.stopTime.stopTimeM = now_time.minutes;
+				this.stopTime.stopTimeS = now_time.seconds;
+				this.info = data;
+				this.zfb = data.zfb;
+				this.wx = data.wx;
+				this.bank = data.bank;
+			});
+		},
 		open() {
 			this.$refs.popup.open();
 		},
@@ -178,6 +207,11 @@ export default {
 		},
 		change(num) {
 			this.tabCurrentIndex = num * 1;
+		},
+		buy() {
+			up_image({id:this.info.id,image: this.image}).then(({data}) => {
+				this.$api.msg(支付成功)
+			})
 		}
 	}
 };
@@ -269,13 +303,17 @@ export default {
 		color: #999999;
 	}
 	.main-title {
-		padding: 0 30rpx;
 		margin-top: 34rpx;
+		justify-content: flex-start;
 		.current {
-			background: #4166fc !important;
+			background: linear-gradient(143.2747deg, #ff6a00, #ee0979) !important;
 			color: #ffffff !important;
 		}
+		.main-item {
+			width: 33%;
+		}
 		.mt-item {
+			margin: 0 auto;
 			width: 160rpx;
 			height: 60rpx;
 			background: #f8f8f8;
@@ -331,35 +369,35 @@ export default {
 		}
 	}
 }
-.upload {
-	margin-top: 20rpx;
-	padding: 34rpx 30rpx 40rpx 30rpx;
-	background: #ffffff;
-	.upload-title {
+.upload-image {
+	width: 160rpx;
+	height: 160rpx;
+	border-radius: 10rpx;
+}
+.upload-title {
+	font-size: 30rpx;
+	font-family: PingFang SC;
+	font-weight: bold;
+	color: #333333;
+}
+.upload-main {
+	padding-top: 32rpx;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	flex-direction: column;
+	.upload-font {
+		margin-top: 24rpx;
 		font-size: 30rpx;
 		font-family: PingFang SC;
 		font-weight: bold;
 		color: #333333;
 	}
-	.upload-main {
-		padding-top: 32rpx;
-		display: flex;
-		justify-content: center;
-		align-items: center;
-		flex-direction: column;
-		.upload-image {
-			width: 160rpx;
-			height: 160rpx;
-			border-radius: 10rpx;
-		}
-		.upload-font {
-			margin-top: 24rpx;
-			font-size: 30rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			color: #333333;
-		}
-	}
+}
+.upload {
+	margin-top: 20rpx;
+	padding: 34rpx 30rpx 40rpx 30rpx;
+	background: #ffffff;
 }
 .bottom {
 	position: fixed;
@@ -399,7 +437,7 @@ export default {
 		background: #c0bfc0;
 	}
 	.btn {
-		margin-left: 40rpx;
+		margin-left: 20rpx;
 		width: 430rpx;
 		height: 80rpx;
 		background: #fd3b39;
@@ -412,4 +450,8 @@ export default {
 		line-height: 80rpx;
 	}
 }
+// 文章页底部高度撑开
+.contentBottomHeight {
+	height: 150rpx;
+}
 </style>

+ 12 - 2
pages/hall/porducthall.vue

@@ -92,7 +92,7 @@
 				<view class="bottom-font">联系</view>
 				<view class="bottom-num">客服</view>
 			</view>
-			<view class="btn" @click="nav('/pages/hall/hallpay')">立即购买</view>
+			<view class="btn" @click="buy()">立即购买</view>
 		</view>
 		<uni-popup ref="popupkf" type="center">
 			<view class="popup-box">
@@ -114,7 +114,7 @@
 </template>
 
 <script>
-import { details } from '@/api/hall.js'
+import { details,purchase } from '@/api/hall.js'
 export default {
 	data() {
 		return {
@@ -150,6 +150,16 @@ export default {
 			uni.navigateTo({
 				url
 			})
+		},
+		buy() {
+			purchase({product_id: this.id}).then(({ data }) =>{
+				uni.navigateTo({
+					url:'/pages/money/paySuccess?type=1'
+				})
+				console.log(data);
+			}).catch(e =>{
+				console.log(e);
+			})
 		}
 	}
 };

+ 7 - 2
pages/money/paySuccess.vue

@@ -3,7 +3,8 @@
 		<text class="success-icon iconfont iconroundcheck"></text>
 		<text class="tit">支付成功</text>
 		<view class="btn-group">
-			<navigator :url="'/pages/order/orderDetail?id='+orderId" open-type="redirect" class="mix-btn">查看订单</navigator>
+			<navigator v-if="type == '1' " :url="'/pages/order/order'" open-type="redirect" class="mix-btn">查看订单</navigator>
+			<navigator v-else :url="'/pages/order/orderDetail?id='+orderId" open-type="redirect" class="mix-btn">查看订单</navigator>
 			<navigator url="/pages/index/index" open-type="switchTab" class="mix-btn hollow">返回首页</navigator>
 		</view>
 	</view>
@@ -13,10 +14,14 @@
 	export default {
 		data() {
 			return {
-				orderId:''
+				orderId:'',
+				type:''
 			}
 		},
 		onLoad(opt) {
+			if(opt.type) {
+				this.type = opt.type
+			}
 			// 保存订单号
 			this.orderId = opt.orderid;
 		},

+ 726 - 765
pages/order/order.vue

@@ -3,109 +3,69 @@
 		<view class="order-title">
 			<text>我的订单</text>
 			<view class="roder-content">
-				<view class="left" :class="{current:currentIndex===index}" :key='index' v-for="(item,index) in maiList"
-					@click="navGo(index)">
-					{{item.title}}
-				</view>
+				<view class="left" :class="{ current: currentIndex === index }" :key="index" v-for="(item, index) in maiList" @click="navGo(index)">{{ item.title }}</view>
 				<!-- <view class="left">
 					我的卖单
 				</view> -->
 			</view>
 		</view>
-		<view class="navbar" v-show="currentIndex==0">
-			<view v-for="(item, index) in navList" :key="index" class="nav-item"
-				:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
+		<view class="navbar" v-show="currentIndex == 0">
+			<view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index, 0)">{{ item.text }}</view>
 		</view>
-		<view class="navbar" v-show="currentIndex==1">
-			<view v-for="(item, index) in navList1" :key="index" class="nav-item"
-				:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
+		<view class="navbar" v-show="currentIndex == 1">
+			<view v-for="(item, index) in navList1" :key="index" class="nav-item" :class="{ current: tabCurrentIndex1 === index }" @click="tabClick(index, 1)">
+				{{ item.text }}
+			</view>
 		</view>
 
-		<swiper :current="tabCurrentIndex" class="swiper-box-one" duration="300" @change="changeTab"
-			:style="{'height': height}">
-			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex"
-				:style="{'height': height}" v-if="currentIndex==0">
+		<swiper :current="currentAuto" class="swiper-box-one" duration="0" @change="changeTab">
+			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex" v-if="currentIndex == 0">
 				<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
 					<!-- 空白页 -->
 					<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
 
 					<!-- 订单列表 -->
-					<view @click="goToOrderDetail(item)" v-for="(item, index) in tabItem.orderList" :key="index"
-						class="order-item">
+					<view @click="goToOrderDetail(item)" v-for="(item, index) in tabItem.orderList" :key="index" class="order-item">
 						<view class="i-top b-b">
-							<text class="time">{{ item._add_time }}</text>
-							<text class="state" :style="{ color: item.stateTipColor }">{{ item._status._title }}</text>
-							<text v-if="item.status === 4" class="del-btn iconfont icondelete"
-								@click="deleteOrder(index)"></text>
+							<text class="time">{{ item.order_id }}</text>
+							<text class="state" :style="{ color: item.stateTipColor }">{{ item.stateTip }}</text>
+							<text v-if="item.status === 4" class="del-btn iconfont icondelete" @click="deleteOrder(index)"></text>
 						</view>
 
-						<scroll-view v-if="item.cartInfo.length > 1" class="goods-box" scroll-x>
-							<view v-for="(goodsItem, goodsIndex) in item.cartInfo" :key="goodsIndex" class="goods-item">
-								<image class="goods-img" :src="goodsItem.productInfo.image" mode="aspectFill"></image>
-							</view>
-						</scroll-view>
-						<!-- <view v-if="item.cartInfo.length === 1" class="goods-box-single" v-for="(goodsItem, goodsIndex) in item.cartInfo" :key="goodsIndex">
-							<image class="goods-img" :src="goodsItem.productInfo.image" mode="aspectFill"></image>
+						<view class="goods-box-single">
+							<image class="goods-img" :src="item.image" mode="aspectFill"></image>
 							<view class="right">
-								<text class="title clamp">{{ goodsItem.productInfo.store_name }}</text>
-								<text class="attr-box">{{ goodsItem.attrInfo ? goodsItem.attrInfo.suk : '' }} x {{ goodsItem.cart_num }}</text>
-								<text class="price">{{ moneyNum(goodsItem.productInfo.price)}}</text>
-							</view>
-						</view> -->
-						<view class="goods-box-single" v-for="(goodsItem, goodsIndex) in item.cartInfo"
-							:key="goodsIndex">
-							<image class="goods-img" :src="goodsItem.productInfo.image" mode="scaleToFill"></image>
-							<view class="right">
-								<view class="flex-start">
-									<text class="title clamp">{{ goodsItem.productInfo.store_name }}</text>
-									<text class="price">{{ goodsItem.productInfo.price|moneyNum }}</text>
-								</view>
-								<view class="row flex">
-									<text
-										class="row_title">{{ goodsItem.productInfo.attrInfo ? goodsItem.productInfo.attrInfo.suk : '' }}</text>
-									<text class="attr-box"> x {{ goodsItem.cart_num }}</text>
-								</view>
+								<text class="title clamp">{{ item.name }}</text>
+								<text class="attr-box">x1</text>
+								<text class="price">{{ moneyNum(item.price) }}</text>
 							</view>
 						</view>
 
 						<view class="price-box">
-							<text class="num">{{ item.cartInfo.length }}</text>
+							<text class="num">1</text>
 							件商品 邮费
-							<text class="price">{{ moneyNum(item.pay_postage)}}</text>
+							<text class="price">0</text>
 							实付款
-							<text class="price">{{ moneyNum(item.pay_price)}}</text>
-						</view>
-						<view class="action-box b-t" v-if="item.status != 5">
-							<button v-if="item._status._title == '未支付'" class="action-btn"
-								@click.stop="cancelOrder(item)">取消订单</button>
-							<button v-if="item._status._title == '未支付'" @click.stop="orderPay(item)"
-								class="action-btn recom">立即支付</button>
-							<button v-if="item._status._title == '待评价'" class="action-btn">评价</button>
-							<button v-if="item._status._title == '待收货'" @click.stop="orderTake(item, index)"
-								class="action-btn">确认收货</button>
-							<button v-if="item._status._title == '未发货'" class="action-btn"
-								@click.stop="orderRefund(item)">申请退款</button>
+							<text class="price">{{ moneyNum(item.price) }}</text>
 						</view>
+						<view class="action-box b-t" v-if="item.stateTip == '待支付'"><button @click.stop="orderPay(item)" class="action-btn recom">立即支付</button></view>
 					</view>
 
 					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
 				</scroll-view>
 			</swiper-item>
-			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex"
-				:style="{'height': height}" v-if="currentIndex==1">
+			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList1" :key="tabIndex" v-if="currentIndex == 1">
 				<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
 					<!-- 空白页 -->
 					<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
 
 					<!-- 订单列表 -->
-					<view @click="goToOrderDetail(item)" v-for="(item, index) in tabItem.orderList" :key="index"
-						class="order-item">
+					<view @click="goToOrderDetail(item)" v-for="(item, index) in tabItem.orderList" :key="index" class="order-item">
 						<view class="i-top b-b">
 							<text class="time">{{ item._add_time }}</text>
 							<text class="state" :style="{ color: item.stateTipColor }">{{ item._status._title }}</text>
-							<text v-if="item.status === 4" class="del-btn iconfont icondelete"
-								@click="deleteOrder(index)"></text>
+							<text v-if="item.status === 4" class="del-btn iconfont icondelete" @click="deleteOrder(index)"></text>
 						</view>
 
 						<scroll-view v-if="item.cartInfo.length > 1" class="goods-box" scroll-x>
@@ -121,18 +81,16 @@
 								<text class="price">{{ moneyNum(goodsItem.productInfo.price)}}</text>
 							</view>
 						</view> -->
-						<view class="goods-box-single" v-for="(goodsItem, goodsIndex) in item.cartInfo"
-							:key="goodsIndex">
+						<view class="goods-box-single" v-for="(goodsItem, goodsIndex) in item.cartInfo" :key="goodsIndex">
 							<image class="goods-img" :src="goodsItem.productInfo.image" mode="scaleToFill"></image>
 							<view class="right">
 								<view class="flex-start">
 									<text class="title clamp">{{ goodsItem.productInfo.store_name }}</text>
-									<text class="price">{{ goodsItem.productInfo.price|moneyNum }}</text>
+									<text class="price">{{ goodsItem.productInfo.price | moneyNum }}</text>
 								</view>
 								<view class="row flex">
-									<text
-										class="row_title">{{ goodsItem.productInfo.attrInfo ? goodsItem.productInfo.attrInfo.suk : '' }}</text>
-									<text class="attr-box"> x {{ goodsItem.cart_num }}</text>
+									<text class="row_title">{{ goodsItem.productInfo.attrInfo ? goodsItem.productInfo.attrInfo.suk : '' }}</text>
+									<text class="attr-box">x {{ goodsItem.cart_num }}</text>
 								</view>
 							</view>
 						</view>
@@ -141,20 +99,13 @@
 							<text class="num">{{ item.cartInfo.length }}</text>
 							件商品 邮费
-							<text class="price">{{ moneyNum(item.pay_postage)}}</text>
+							<text class="price">{{ moneyNum(item.pay_postage) }}</text>
 							实付款
-							<text class="price">{{ moneyNum(item.pay_price)}}</text>
+							<text class="price">{{ moneyNum(item.pay_price) }}</text>
 						</view>
-						<view class="action-box b-t" v-if="item.status != 5">
-							<button v-if="item._status._title == '未支付'" class="action-btn"
-								@click.stop="cancelOrder(item)">取消订单</button>
-							<button v-if="item._status._title == '未支付'" @click.stop="orderPay(item)"
-								class="action-btn recom">立即支付</button>
-							<button v-if="item._status._title == '待评价'" class="action-btn">评价</button>
-							<button v-if="item._status._title == '待收货'" @click.stop="orderTake(item, index)"
-								class="action-btn">确认收货</button>
-							<button v-if="item._status._title == '未发货'" class="action-btn"
-								@click.stop="orderRefund(item)">申请退款</button>
+						<view class="action-box b-t">
+							<button v-if="item.stateTip == '待支付'" @click.stop="orderPay(item)" class="action-btn recom">立即支付</button>
+							<!-- <button v-if="item._status._title == '待收货'" @click.stop="orderTake(item, index)" class="action-btn">确认收货</button> -->
 						</view>
 					</view>
 
@@ -162,784 +113,794 @@
 				</scroll-view>
 			</swiper-item>
 		</swiper>
-		<u-tabbar activeColor="#f42b4e" v-model="current" :list="tabbar" :mid-button="true"></u-tabbar>
+		<!-- <u-tabbar activeColor="#f42b4e" v-model="current" :list="tabbar" :mid-button="true"></u-tabbar> -->
 	</view>
 </template>
 
 <script>
-	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
-	import empty from '@/components/empty';
-	import {
-		orderList,
-		orderCancel,
-		orderDel,
-		orderTake
-	} from '@/api/order.js';
-	import {
-		tabbar
-	} from '@/utils/tabbar.js'
-	export default {
-		components: {
-			uniLoadMore,
-			empty
-		},
-		data() {
-			return {
-				height: '', //第一层swiper高度
-				tabbar: tabbar,
-				current: 1,
-				currentIndex: 0,
-				tabCurrentIndex: 0,
-				maiList: [{
-						title: '我的买单'
-					},
-					{
-						title: '我的卖单'
-					}
-				],
-				navList: [{
-						state: 0,
-						text: '全部',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
-					},
-					{
-						state: 1,
-						text: '待支付',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
-					},
-					{
-						state: 2,
-						text: '待放货',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
-					},
-					{
-						state: 3,
-						text: '待挂售',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
-					},
-					{
-						state: 4,
-						text: '提货订单',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
-					}
-				],
-				navList1: [{
-						state: 0,
-						text: '全部',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
-					},
-					{
-						state: 1,
-						text: '售卖中',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
-					},
-					{
-						state: 2,
-						text: '待支付',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
-					},
-					{
-						state: 3,
-						text: '待放货',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
-					},
-					{
-						state: 4,
-						text: '已完成',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
-					}
-				],
-
-			};
-		},
-
-		onLoad(options) {
-			/**
-			 * 修复app端点击除全部订单外的按钮进入时不加载数据的问题
-			 * 替换onLoad下代码即可
-			 */
-			this.tabCurrentIndex = +options.state;
-			// #ifndef MP
+import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+import empty from '@/components/empty';
+import { orderList, orderCancel, orderDel, orderTake, adopt, user_auction_order } from '@/api/order.js';
+import { tabbar } from '@/utils/tabbar.js';
+export default {
+	components: {
+		uniLoadMore,
+		empty
+	},
+	data() {
+		return {
+			height: '', //第一层swiper高度
+			tabbar: tabbar,
+			current: 1, //底部tabar选中的icon对象
+			currentIndex: 0, //当前选中的第一级0为我要买单,1我要卖单
+			tabCurrentIndex: 0, //当前选中的第二级别我要买单选中项
+			tabCurrentIndex1: 0, //当前选中的第二级别我要卖单选中项
+			maiList: [
+				{
+					title: '我的买单'
+				},
+				{
+					title: '我的卖单'
+				}
+			],
+			navList: [
+				{
+					state: 0,
+					text: '已过期',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				},
+				{
+					state: 1,
+					text: '待支付',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				},
+				{
+					state: 2,
+					text: '待审核',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				},
+				{
+					state: 3,
+					text: '已完成',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				}
+			],
+			navList1: [
+				{
+					state: 0,
+					text: '全部',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				},
+				{
+					state: 1,
+					text: '售卖中',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				},
+				{
+					state: 2,
+					text: '待支付',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				},
+				{
+					state: 3,
+					text: '待放货',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				},
+				{
+					state: 4,
+					text: '已完成',
+					loadingType: 'more',
+					orderList: [],
+					page: 1, //当前页数
+					limit: 10 //每次信息条数
+				}
+			]
+		};
+	},
+	computed: {
+		currentAuto() {
+			if (this.currentIndex == 0) {
+				return this.tabCurrentIndex;
+			}
+			if (this.currentIndex == 1) {
+				return this.tabCurrentIndex1;
+			}
+		}
+	},
+	onLoad(options) {
+		/**
+		 * 修复app端点击除全部订单外的按钮进入时不加载数据的问题
+		 * 替换onLoad下代码即可
+		 */
+		this.tabCurrentIndex = +options.state || 0;
+		// #ifndef MP
+		this.loadData();
+		// #endif
+		// #ifdef MP
+		if (options.state == 0) {
 			this.loadData();
-			// #endif
-			// #ifdef MP
-			if (options.state == 0) {
-				this.loadData();
+		}
+		// #endif
+	},
+	// #ifdef APP-PLUS || H5
+	onBackPress(e) {
+		uni.switchTab({
+			url: '/pages/user/user'
+		});
+		return true;
+	},
+	// #endif
+	filters: {
+		moneyNum(value) {
+			return +value;
+		}
+	},
+	// 页面加载完获取swiper高度
+	onReady(res) {
+		var obj = this;
+		uni.getSystemInfo({
+			success: resu => {
+				const query = uni.createSelectorQuery();
+				query.select('.swiper-box-one').boundingClientRect();
+				query.exec(function(res) {
+					console.log(res, 'ddddddddddddd');
+					obj.height = resu.windowHeight - res[0].top + 'px';
+					console.log('打印页面的剩余高度', obj.height);
+				});
+			},
+			fail: res => {}
+		});
+	},
+	methods: {
+		//顶部tab点击
+		tabClick(index, type) {
+			if (type == 0) {
+				this.tabCurrentIndex = index;
+			}
+			if (type == 1) {
+				this.tabCurrentIndex1 = index;
 			}
-			// #endif
 		},
-		// #ifdef APP-PLUS || H5
-		onBackPress(e) {
-			uni.switchTab({
-				url: '/pages/user/user',
+		navGo(index) {
+			this.currentIndex = index;
+			console.log(this.currentIndex, '点击');
+		},
+		// 转换金额为数字
+		moneyNum(value) {
+			return +value;
+		},
+		// 确认收货
+		orderTake(item, index) {
+			let obj = this;
+			uni.showModal({
+				title: '是否确认收货?',
+				success: () => {
+					orderTake({
+						uni: item.order_id
+					})
+						.then(e => {
+							obj.navList[obj.tabCurrentIndex].orderList.splice(index, 1);
+							uni.showToast({
+								title: '收货成功'
+							});
+						})
+						.catch(e => {
+							console.log(e);
+						});
+				}
 			});
-			return true;
 		},
-		// #endif
-		filters: {
-			moneyNum(value) {
-				return +value;
-			},
+		//跳转到订单详情
+		goToOrderDetail(e) {
+			uni.navigateTo({
+				url: '/pages/order/orderDetail?id=' + e.order_id
+			});
 		},
-		// 页面加载完获取swiper高度
-		onReady(res) {
-			var obj = this;
-			uni.getSystemInfo({
-				success: resu => {
-					const query = uni.createSelectorQuery();
-					query.select('.swiper-box-one').boundingClientRect();
-					query.exec(function(res) {
-						console.log(res, 'ddddddddddddd');
-						obj.height = resu.windowHeight - res[0].top + 'px';
-						console.log('打印页面的剩余高度', obj.height);
+		// 申请退款
+		orderRefund(e) {
+			uni.navigateTo({
+				url: '/pages/order/orderRefund?id=' + e.order_id
+			});
+		},
+		// 订单支付
+		orderPay(e) {
+			uni.navigateTo({
+				url: '/pages/hall/hallpay?ordid=' + e.order_id
+			});
+		},
+		//获取订单列表
+		loadData(source) {
+			//这里是将订单挂载到tab列表下
+			let index, navItem;
+			if (this.currentIndex == 0) {
+				index = this.tabCurrentIndex;
+				navItem = this.navList[index];
+			}
+			if (this.currentIndex == 1) {
+				index = this.tabCurrentIndex1;
+				navItem = this.navList1[index];
+			}
+
+			let state = navItem.state;
+			if (source === 'tabChange' && navItem.loaded === true) {
+				//tab切换只有第一次需要加载数据
+				return;
+			}
+			if (navItem.loadingType === 'loading') {
+				//防止重复加载
+				return;
+			}
+			if (navItem.loadingType === 'noMore') {
+				//防止重复加载
+				return;
+			}
+			// 修改当前对象状态为加载中
+			navItem.loadingType = 'loading';
+
+			user_auction_order({
+				type: state,
+				page: navItem.page,
+				limit: navItem.limit
+			})
+				.then(({ data }) => {
+					console.log(data);
+					let arr = data.map(e => {
+						let b = this.orderStateExp(e.status);
+						e.stateTip = b.stateTip;
+						e.stateTipColor = b.stateTipColor;
+						return e;
 					});
-				},
-				fail: res => {}
+					navItem.orderList = navItem.orderList.concat(arr);
+
+					// console.log(navItem.orderList);
+					navItem.page++;
+					if (navItem.limit == data.length) {
+						//判断是否还有数据, 有改为 more, 没有改为noMore
+						navItem.loadingType = 'more';
+						return;
+					} else {
+						//判断是否还有数据, 有改为 more, 没有改为noMore
+						navItem.loadingType = 'noMore';
+					}
+					uni.hideLoading();
+					this.$set(navItem, 'loaded', true);
+				})
+				.catch(e => {
+					console.log(e);
+				});
+		},
+
+		//swiper 切换
+		changeTab(e) {
+			if (this.currentIndex == 0) {
+				this.tabCurrentIndex = e.target.current;
+			}
+			if (this.currentIndex == 1) {
+				this.tabCurrentIndex1 = e.target.current;
+			}
+			this.loadData('tabChange');
+		},
+
+		//删除订单
+		deleteOrder(index) {
+			uni.showLoading({
+				title: '请稍后'
 			});
+			setTimeout(() => {
+				this.navList[this.tabCurrentIndex].orderList.splice(index, 1);
+				uni.hideLoading();
+			}, 600);
 		},
-		methods: {
-			navGo(index) {
-				this.currentIndex = index
-				console.log(this.currentIndex, '点击');
-			},
-			// 转换金额为数字
-			moneyNum(value) {
-				return +value;
-			},
-			// 确认收货
-			orderTake(item, index) {
-				let obj = this;
-				uni.showModal({
-					title: '是否确认收货?',
-					success: () => {
-						orderTake({
-								uni: item.order_id
-							})
+		//取消订单
+		cancelOrder(item) {
+			uni.showModal({
+				title: '订单取消',
+				content: '是否取消订单?',
+				success: e => {
+					if (e.confirm) {
+						uni.showLoading({
+							title: '请稍后'
+						});
+						orderCancel({
+							id: item.order_id
+						})
 							.then(e => {
-								obj.navList[obj.tabCurrentIndex].orderList.splice(index, 1);
 								uni.showToast({
-									title: '收货成功'
+									title: '取消成功',
+									duration: 2000,
+									position: 'top'
 								});
 							})
 							.catch(e => {
 								console.log(e);
 							});
-					}
-				});
-			},
-			//跳转到订单详情
-			goToOrderDetail(e) {
-				uni.navigateTo({
-					url: '/pages/order/orderDetail?id=' + e.order_id
-				});
-			},
-			// 申请退款
-			orderRefund(e) {
-				uni.navigateTo({
-					url: '/pages/order/orderRefund?id=' + e.order_id
-				});
-			},
-			// 订单支付
-			orderPay(e) {
-				uni.navigateTo({
-					url: '/pages/money/pay?type=1&ordid=' + e.order_id + '&money=' + e.pay_price
-				});
-			},
-			//获取订单列表
-			loadData(source) {
-				//这里是将订单挂载到tab列表下
-				let index = this.tabCurrentIndex;
-				let navItem = this.navList[index];
-				let state = navItem.state;
-				if (source === 'tabChange' && navItem.loaded === true) {
-					//tab切换只有第一次需要加载数据
-					return;
-				}
-				if (navItem.loadingType === 'loading') {
-					//防止重复加载
-					return;
-				}
-				if (navItem.loadingType === 'noMore') {
-					//防止重复加载
-					return;
-				}
-				// 修改当前对象状态为加载中
-				navItem.loadingType = 'loading';
-
-				orderList({
-						type: state,
-						page: navItem.page,
-						limit: navItem.limit
-					})
-					.then(({
-						data
-					}) => {
-						let arr = data.map(e => {
-							let b = this.orderStateExp(e.status);
-							e.stateTip = b.stateTip;
-							e.stateTipColor = b.stateTipColor;
-							return e;
-						});
-						navItem.orderList = navItem.orderList.concat(arr);
-
-
-						// console.log(navItem.orderList);
-						navItem.page++;
-						if (navItem.limit == data.length) {
-							//判断是否还有数据, 有改为 more, 没有改为noMore
-							navItem.loadingType = 'more';
-							return;
-						} else {
-							//判断是否还有数据, 有改为 more, 没有改为noMore
-							navItem.loadingType = 'noMore';
-
-						}
+						//取消订单后删除待付款中该项
+						let list = this.navList[this.tabCurrentIndex].orderList;
+						let index = list.findIndex(val => val.id === item.id);
+						index !== -1 && list.splice(index, 1);
 						uni.hideLoading();
-						this.$set(navItem, 'loaded', true);
-					})
-					.catch(e => {
-						console.log(e);
-					});
-			},
-
-			//swiper 切换
-			changeTab(e) {
-				this.tabCurrentIndex = e.target.current;
-				this.loadData('tabChange');
-			},
-
-			//删除订单
-			deleteOrder(index) {
-				uni.showLoading({
-					title: '请稍后'
-				});
-				setTimeout(() => {
-					this.navList[this.tabCurrentIndex].orderList.splice(index, 1);
-					uni.hideLoading();
-				}, 600);
-			},
-			//取消订单
-			cancelOrder(item) {
-				uni.showModal({
-					title: '订单取消',
-					content: '是否取消订单?',
-					success: e => {
-						if (e.confirm) {
-							uni.showLoading({
-								title: '请稍后'
-							});
-							orderCancel({
-									id: item.order_id
-								})
-								.then(e => {
-									uni.showToast({
-										title: '取消成功',
-										duration: 2000,
-										position: 'top'
-									});
-								})
-								.catch(e => {
-									console.log(e);
-								});
-							//取消订单后删除待付款中该项
-							let list = this.navList[this.tabCurrentIndex].orderList;
-							let index = list.findIndex(val => val.id === item.id);
-							index !== -1 && list.splice(index, 1);
-							uni.hideLoading();
-						}
 					}
-				});
-			},
-
-			//订单状态文字和颜色
-			orderStateExp(state) {
-				let stateTip = '',
-					stateTipColor = '#fa436a';
-				switch (+state) {
-					case 0:
-						stateTip = '待付款';
-						break;
-					case 1:
-						stateTip = '待发货';
-						break;
-					case 2:
-						stateTip = '待收货';
-						break;
-					case 3:
-						stateTip = '待评价';
-						break;
-					case 4:
-						stateTip = '已完成';
-						stateTipColor = '#4166FC';
-						break;
-					case 9:
-						stateTip = '订单已关闭';
-						stateTipColor = '#909399';
-						break;
-
-						//更多自定义
 				}
-				return {
-					stateTip,
-					stateTipColor
-				};
+			});
+		},
+
+		//订单状态文字和颜色
+		orderStateExp(state) {
+			let stateTip = '',
+				stateTipColor = '#fa436a';
+			switch (+state) {
+				case 0:
+					stateTip = '已过期';
+					break;
+				case 1:
+					stateTip = '待支付';
+					break;
+				case 2:
+					stateTip = '待审核';
+					break;
+				case 3:
+					stateTip = '已完成';
+					break;
+				case 9:
+					stateTip = '订单已关闭';
+					stateTipColor = '#909399';
+					break;
+
+				//更多自定义
 			}
+			return {
+				stateTip,
+				stateTipColor
+			};
 		}
-	};
+	}
+};
 </script>
 
 <style lang="scss">
-	page,
-	.content {
-		background: $page-color-base;
-		height: 100%;
-	}
-
-	.order-title {
-
-
-		width: 750rpx;
-		height: 262rpx;
-		// background: linear-gradient(-41deg, rgba(60, 237, 237, 0.99), #04B8FF, #375AFE);
-		background: url(../../static/img/order99.png) repeat-x 0;
+page,
+.content {
+	background: $page-color-base;
+	height: 100%;
+}
+
+.order-title {
+	width: 750rpx;
+	height: 135px;
+	// background: linear-gradient(-41deg, rgba(60, 237, 237, 0.99), #04B8FF, #375AFE);
+	background: url(../../static/img/order99.png) repeat-x 0;
+	display: flex;
+	flex-direction: column;
+	// padding: 50rpx 0;
+	text-align: center;
+
+	text {
+		margin: 30px 0;
+		font-size: 17px;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #ffffff;
+	}
+
+	.roder-content {
 		display: flex;
-		flex-direction: column;
-		// padding: 50rpx 0;
-		text-align: center;
-
-		text {
-			margin: 60rpx 0;
-			font-size: 34rpx;
+		justify-content: space-around;
+
+		.left {
+			width: 168px;
+			height: 40px;
+			line-height: 40px;
+			border: 1px solid #ffffff;
+			border-radius: 5px;
+			text-align: center;
+			font-size: 15px;
 			font-family: PingFang SC;
 			font-weight: bold;
-			color: #FFFFFF;
+			color: #ffffff;
+			background: #dc262b;
 		}
 
-		.roder-content {
-
-
-			display: flex;
-			justify-content: space-around;
-
-			.left {
-				width: 336rpx;
-				height: 81rpx;
-				line-height: 81rpx;
-				border: 2rpx solid #FFFFFF;
-				border-radius: 10rpx;
-				text-align: center;
-				font-size: 30rpx;
-				font-family: PingFang SC;
-				font-weight: bold;
-				color: #FFFFFF;
-				background: #DC262b;
-			}
-
-			.current {
-				color: #DC262B;
-				background: #FFFFFF;
-			}
+		.current {
+			color: #dc262b;
+			background: #ffffff;
 		}
 	}
+}
 
-	.swiper-box {
-		background: red;
-	}
+.swiper-box {
+	background: red;
+}
 
-	.list-scroll-content {
-		height: 100%;
-	}
+.list-scroll-content {
+	height: 100%;
+}
 
+.uni-swiper-item {
+	height: auto;
+}
 
-	.uni-swiper-item {
-		height: auto;
-	}
+.navbar {
+	display: flex;
+	height: 40px;
+	padding: 0 5px;
+	background: #fff;
+	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
+	position: relative;
+	z-index: 10;
 
-	.navbar {
+	.nav-item {
+		flex: 1;
 		display: flex;
-		height: 40px;
-		padding: 0 5px;
-		background: #fff;
-		box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
+		justify-content: center;
+		align-items: center;
+		height: 100%;
+		font-size: 15px;
+		color: $font-color-dark;
 		position: relative;
-		z-index: 10;
 
-		.nav-item {
-			flex: 1;
-			display: flex;
-			justify-content: center;
-			align-items: center;
-			height: 100%;
-			font-size: 15px;
-			color: $font-color-dark;
-			position: relative;
+		&.current {
+			color: $base-color;
 
-			&.current {
-				color: $base-color;
-
-				&:after {
-					content: '';
-					position: absolute;
-					left: 50%;
-					bottom: 0;
-					transform: translateX(-50%);
-					width: 44px;
-					height: 0;
-					border-bottom: 2px solid $base-color;
-				}
+			&:after {
+				content: '';
+				position: absolute;
+				left: 50%;
+				bottom: 0;
+				transform: translateX(-50%);
+				width: 44px;
+				height: 0;
+				border-bottom: 2px solid $base-color;
 			}
 		}
 	}
+}
 
-	.order-item {
+.order-item {
+	display: flex;
+	flex-direction: column;
+	background: #fff;
+	margin-top: 16rpx;
+
+	.i-top {
 		display: flex;
-		flex-direction: column;
-		padding-left: 30rpx;
-		background: #fff;
-		margin-top: 16rpx;
+		align-items: center;
+		height: 80rpx;
+		font-size: $font-base;
+		color: $font-color-dark;
+		position: relative;
+		padding: 0 30rpx;
+		
+		.time {
+			flex: 1;
+		}
 
-		.i-top {
-			display: flex;
-			align-items: center;
-			height: 80rpx;
-			padding-right: 30rpx;
-			font-size: $font-base;
-			color: $font-color-dark;
+		.state {
+			color: $base-color;
+		}
+
+		.del-btn {
+			padding: 10rpx 0 10rpx 36rpx;
+			font-size: $font-lg;
+			color: $font-color-light;
 			position: relative;
 
-			.time {
-				flex: 1;
+			&:after {
+				content: '';
+				width: 0;
+				height: 30rpx;
+				border-left: 1px solid $border-color-dark;
+				position: absolute;
+				left: 20rpx;
+				top: 50%;
+				transform: translateY(-50%);
 			}
+		}
+	}
 
-			.state {
-				color: $base-color;
-			}
+	/* 多条商品 */
+	.goods-box {
+		height: 160rpx;
+		padding: 20rpx 0;
+		white-space: nowrap;
 
-			.del-btn {
-				padding: 10rpx 0 10rpx 36rpx;
-				font-size: $font-lg;
-				color: $font-color-light;
-				position: relative;
-
-				&:after {
-					content: '';
-					width: 0;
-					height: 30rpx;
-					border-left: 1px solid $border-color-dark;
-					position: absolute;
-					left: 20rpx;
-					top: 50%;
-					transform: translateY(-50%);
-				}
-			}
+		.goods-item {
+			width: 120rpx;
+			height: 120rpx;
+			display: inline-block;
+			margin-right: 24rpx;
 		}
 
-		/* 多条商品 */
-		.goods-box {
-			height: 160rpx;
-			padding: 20rpx 0;
-			white-space: nowrap;
-
-			.goods-item {
-				width: 120rpx;
-				height: 120rpx;
-				display: inline-block;
-				margin-right: 24rpx;
-			}
+		.goods-img {
+			display: block;
+			width: 100%;
+			height: 100%;
+		}
+	}
 
-			.goods-img {
-				display: block;
-				width: 100%;
-				height: 100%;
-			}
+	/* 单条商品 */
+	.goods-box-single {
+		display: flex;
+		padding: 20rpx 30rpx;
+		background: #f7f7f7;
+		.goods-img {
+			display: block;
+			width: 120rpx;
+			height: 120rpx;
 		}
 
-		/* 单条商品 */
-		.goods-box-single {
+		.right {
+			flex: 1;
 			display: flex;
-			padding: 20rpx 0;
+			flex-direction: column;
+			padding: 0 0 0 24rpx;
+			overflow: hidden;
 
-			.goods-img {
-				display: block;
-				width: 120rpx;
-				height: 120rpx;
+			.row {
+				margin-top: 10rpx;
 			}
 
-			.right {
-				flex: 1;
-				display: flex;
-				flex-direction: column;
-				padding: 0 30rpx 0 24rpx;
-				overflow: hidden;
-
-				.row {
-					margin-top: 10rpx;
-				}
-
-				.row_title {
-					padding: 5rpx 10rpx;
-					background-color: #dddddd;
-					border-radius: 10rpx;
-					font-size: 22rpx;
-					color: #ffffff;
-				}
-
-				.title {
-					font-size: $font-base + 2rpx;
-					color: $font-color-dark;
-					line-height: 1;
-					width: 80%;
-				}
-
-				.attr-box {
-					display: flex;
-					justify-content: flex-end;
-					font-size: $font-sm + 2rpx;
-					color: $font-color-light;
-				}
-
-				.price {
-					display: inline;
-					font-size: $font-base + 2rpx;
-					color: $font-color-dark;
-
-					&:before {
-						content: '¥';
-						font-size: $font-sm;
-
-					}
-				}
+			.row_title {
+				padding: 5rpx 10rpx;
+				background-color: #dddddd;
+				border-radius: 10rpx;
+				font-size: 22rpx;
+				color: #ffffff;
 			}
-		}
-
-		.price-box {
-			display: flex;
-			justify-content: flex-end;
-			align-items: baseline;
-			padding: 20rpx 30rpx;
-			font-size: $font-sm + 2rpx;
-			color: $font-color-light;
 
-			.num {
-				margin: 0 8rpx;
+			.title {
+				font-size: $font-base + 2rpx;
 				color: $font-color-dark;
+				line-height: 1;
+				width: 80%;
+			}
+
+			.attr-box {
+				display: flex;
+				justify-content: flex-end;
+				font-size: $font-sm + 2rpx;
+				color: $font-color-light;
 			}
 
 			.price {
-				font-size: $font-lg;
+				display: inline;
+				font-size: $font-base + 2rpx;
 				color: $font-color-dark;
 
 				&:before {
 					content: '¥';
 					font-size: $font-sm;
-					margin: 0 2rpx 0 8rpx;
 				}
 			}
 		}
+	}
 
-		.action-box {
-			display: flex;
-			justify-content: flex-end;
-			align-items: center;
-			height: 100rpx;
-			position: relative;
-			padding-right: 30rpx;
+	.price-box {
+		display: flex;
+		justify-content: flex-end;
+		align-items: baseline;
+		padding: 20rpx 30rpx ;
+		font-size: $font-sm + 2rpx;
+		color: $font-color-light;
+
+		.num {
+			margin: 0 8rpx;
+			color: $font-color-dark;
 		}
 
-		.action-btn {
-			width: 160rpx;
-			height: 60rpx;
-			margin: 0;
-			margin-left: 24rpx;
-			padding: 0;
-			text-align: center;
-			line-height: 60rpx;
-			font-size: $font-sm + 2rpx;
+		.price {
+			font-size: $font-lg;
 			color: $font-color-dark;
-			background: #fff;
-			border-radius: 100px;
-
-			&:after {
-				border-radius: 100px;
-			}
-
-			&.recom {
-				color: $base-color;
-
-				&:after {
-					border-color: $base-color;
-				}
-			}
-
-			&.evaluate {
-				color: $color-yellow;
 
-				&:after {
-					border-color: $color-yellow;
-				}
+			&:before {
+				content: '¥';
+				font-size: $font-sm;
+				margin: 0 2rpx 0 8rpx;
 			}
 		}
 	}
 
-	/* load-more */
-	.uni-load-more {
+	.action-box {
+		padding: 0 30rpx;
 		display: flex;
-		flex-direction: row;
-		height: 80rpx;
+		justify-content: flex-end;
 		align-items: center;
-		justify-content: center;
-	}
-
-	.uni-load-more__text {
-		font-size: 28rpx;
-		color: #999;
-	}
-
-	.uni-load-more__img {
-		height: 24px;
-		width: 24px;
-		margin-right: 10px;
-	}
-
-	.uni-load-more__img>view {
-		position: absolute;
-	}
-
-	.uni-load-more__img>view view {
-		width: 6px;
-		height: 2px;
-		border-top-left-radius: 1px;
-		border-bottom-left-radius: 1px;
-		background: #999;
-		position: absolute;
-		opacity: 0.2;
-		transform-origin: 50%;
-		animation: load 1.56s ease infinite;
-	}
-
-	.uni-load-more__img>view view:nth-child(1) {
-		transform: rotate(90deg);
-		top: 2px;
-		left: 9px;
-	}
-
-	.uni-load-more__img>view view:nth-child(2) {
-		transform: rotate(180deg);
-		top: 11px;
-		right: 0;
-	}
-
-	.uni-load-more__img>view view:nth-child(3) {
-		transform: rotate(270deg);
-		bottom: 2px;
-		left: 9px;
-	}
-
-	.uni-load-more__img>view view:nth-child(4) {
-		top: 11px;
-		left: 0;
-	}
-
-	.load1,
-	.load2,
-	.load3 {
-		height: 24px;
-		width: 24px;
-	}
-
-	.load2 {
-		transform: rotate(30deg);
-	}
-
-	.load3 {
-		transform: rotate(60deg);
-	}
-
-	.load1 view:nth-child(1) {
-		animation-delay: 0s;
-	}
-
-	.load2 view:nth-child(1) {
-		animation-delay: 0.13s;
-	}
-
-	.load3 view:nth-child(1) {
-		animation-delay: 0.26s;
-	}
-
-	.load1 view:nth-child(2) {
-		animation-delay: 0.39s;
-	}
-
-	.load2 view:nth-child(2) {
-		animation-delay: 0.52s;
-	}
-
-	.load3 view:nth-child(2) {
-		animation-delay: 0.65s;
+		height: 100rpx;
+		position: relative;
 	}
 
-	.load1 view:nth-child(3) {
-		animation-delay: 0.78s;
-	}
+	.action-btn {
+		width: 160rpx;
+		height: 60rpx;
+		margin: 0;
+		margin-left: 24rpx;
+		padding: 0;
+		text-align: center;
+		line-height: 60rpx;
+		font-size: $font-sm + 2rpx;
+		color: $font-color-dark;
+		background: #fff;
+		border-radius: 100px;
+		border: 2rpx solid #FD3B39;
+		border-radius: 28px;
+		&:after {
+			border-radius: 100px;
+		}
 
-	.load2 view:nth-child(3) {
-		animation-delay: 0.91s;
-	}
+		&.recom {
+			color: $base-color;
 
-	.load3 view:nth-child(3) {
-		animation-delay: 1.04s;
-	}
+			&:after {
+				border-color: $base-color;
+			}
+		}
 
-	.load1 view:nth-child(4) {
-		animation-delay: 1.17s;
-	}
+		&.evaluate {
+			color: $color-yellow;
 
-	.load2 view:nth-child(4) {
-		animation-delay: 1.3s;
+			&:after {
+				border-color: $color-yellow;
+			}
+		}
 	}
-
-	.load3 view:nth-child(4) {
-		animation-delay: 1.43s;
+}
+
+/* load-more */
+.uni-load-more {
+	display: flex;
+	flex-direction: row;
+	height: 80rpx;
+	align-items: center;
+	justify-content: center;
+}
+
+.uni-load-more__text {
+	font-size: 28rpx;
+	color: #999;
+}
+
+.uni-load-more__img {
+	height: 24px;
+	width: 24px;
+	margin-right: 10px;
+}
+
+.uni-load-more__img > view {
+	position: absolute;
+}
+
+.uni-load-more__img > view view {
+	width: 6px;
+	height: 2px;
+	border-top-left-radius: 1px;
+	border-bottom-left-radius: 1px;
+	background: #999;
+	position: absolute;
+	opacity: 0.2;
+	transform-origin: 50%;
+	animation: load 1.56s ease infinite;
+}
+
+.uni-load-more__img > view view:nth-child(1) {
+	transform: rotate(90deg);
+	top: 2px;
+	left: 9px;
+}
+
+.uni-load-more__img > view view:nth-child(2) {
+	transform: rotate(180deg);
+	top: 11px;
+	right: 0;
+}
+
+.uni-load-more__img > view view:nth-child(3) {
+	transform: rotate(270deg);
+	bottom: 2px;
+	left: 9px;
+}
+
+.uni-load-more__img > view view:nth-child(4) {
+	top: 11px;
+	left: 0;
+}
+
+.load1,
+.load2,
+.load3 {
+	height: 24px;
+	width: 24px;
+}
+
+.load2 {
+	transform: rotate(30deg);
+}
+
+.load3 {
+	transform: rotate(60deg);
+}
+
+.load1 view:nth-child(1) {
+	animation-delay: 0s;
+}
+
+.load2 view:nth-child(1) {
+	animation-delay: 0.13s;
+}
+
+.load3 view:nth-child(1) {
+	animation-delay: 0.26s;
+}
+
+.load1 view:nth-child(2) {
+	animation-delay: 0.39s;
+}
+
+.load2 view:nth-child(2) {
+	animation-delay: 0.52s;
+}
+
+.load3 view:nth-child(2) {
+	animation-delay: 0.65s;
+}
+
+.load1 view:nth-child(3) {
+	animation-delay: 0.78s;
+}
+
+.load2 view:nth-child(3) {
+	animation-delay: 0.91s;
+}
+
+.load3 view:nth-child(3) {
+	animation-delay: 1.04s;
+}
+
+.load1 view:nth-child(4) {
+	animation-delay: 1.17s;
+}
+
+.load2 view:nth-child(4) {
+	animation-delay: 1.3s;
+}
+
+.load3 view:nth-child(4) {
+	animation-delay: 1.43s;
+}
+
+@-webkit-keyframes load {
+	0% {
+		opacity: 1;
+	}
+
+	100% {
+		opacity: 0.2;
 	}
+}
 
-	@-webkit-keyframes load {
-		0% {
-			opacity: 1;
-		}
-
-		100% {
-			opacity: 0.2;
-		}
-	}
+.swiper-box-one {
+	height: calc(100% - 175px);
+}
 </style>

+ 186 - 344
pages/set/userinfo.vue

@@ -1,371 +1,213 @@
 <template>
 	<view class="content">
-		<view class="tit">
-			上传微信收款码
+		<view class="row1">
+			<text class="tit">头像</text>
+			<view class="background-img" @click.stop="imgsub"><image class="background-img" v-model="userInfo.avatar" :src="userInfo.avatar" mode="aspectFill"></image></view>
 		</view>
-		<view class="up-wrap" @click="imgsub('upimg')">
-			<image :src="upimg" mode="" v-if="upimg"></image>
-			<image v-else src="../../static/img/add.png" mode=""></image>
+		<view class="row">
+			<text class="tit">昵称</text>
+			<input class="input" type="text" v-model="userInfo.nickname" placeholder-class="placeholder" />
 		</view>
-		<view class="tit">
-			基本信息
+		<view class="row">
+			<text class="tit">ID</text>
+			<input class="input" type="text"  disabled="true" v-model="userInfo.uid" placeholder-class="placeholder" />
 		</view>
-		<view class="base-info">
-			<view class="base-item" style="padding-bottom: 20rpx;">
-				<view class="item-name">头像</view>
-				<view class="avatar" @click="imgsub('avatar')">
-					<image :src="avatar || '../../static/error/missing-face.png'" mode="" ></image>
+		<view class="row">
+			<text class="tit">账户</text>
+			<input class="input" type="text"  disabled="true" v-model="userInfo.phone" placeholder-class="placeholder" />
+		</view>
+		<view class="add-btn" @click="confirm">提交</view>
+		<!-- <view class="out" @click="cancel">注销账户</view> -->
+		<uni-popup ref="popup" type="center">
+			<view class="psw-wrapper">
+				<view class="psw-title">请输入自己的账户</view>
+				<input type="text" v-model="password" class="psw-ipt" />
+				<view class="psw-btn">
+					<text @click.stop="qx">取消</text>
+					<text class="psw-qd" @click.stop="pswQd">确定</text>
 				</view>
 			</view>
-			<view class="base-item flex">
-				<view class="item-name">昵称</view>
-				<input type="text" value="" class="item-val" placeholder="输入您的昵称" v-model="nickname" />
-			</view>
-			<view class="base-item flex">
-				<view class="item-name">ID</view>
-				<input type="text" value="" class="item-val" placeholder="输入您的昵称" v-model="uid" disabled/>
-			</view>
-			<view class="base-item flex">
-				<view class="item-name">手机号</view>
-				<input type="text" value="" class="item-val" placeholder="输入您的手机号" v-model="phone" />
-			</view>
-			<view class="base-item flex">
-				<view class="item-name">姓名</view>
-				<input type="text" value="" class="item-val" placeholder="输入您的姓名" v-model="real_name" />
-			</view>
-			<view class="base-item flex">
-				<view class="item-name">微信号</view>
-				<input type="text" value="" class="item-val" placeholder="输入您的微信号" v-model="wx_no" />
-			</view>
-			<view class="base-item flex">
-				<view class="item-name">支付宝姓名</view>
-				<input type="text" value="" class="item-val" placeholder="输入您的支付宝姓名" v-model="alipay_name" />
-			</view>
-			<view class="base-item flex">
-				<view class="item-name">支付宝账号</view>
-				<input type="text" value="" class="item-val" placeholder="输入您的支付宝账号" v-model="alipay_no" />
-			</view>
-			<view class="base-item flex">
-				<view class="item-name">开户行</view>
-				<input type="text" value="" class="item-val" placeholder="输入您的开户行" v-model="account_Bank" />
-			</view>
-			<view class="base-item flex">
-				<view class="item-name">所属支行</view>
-				<input type="text" value="" class="item-val" placeholder="输入所属支行" v-model="bank_branch" />
-			</view>
-			<view class="base-item flex">
-				<view class="item-name">开户行姓名</view>
-				<input type="text" value="" class="item-val" placeholder="输入您的开户行姓名" v-model="bank_name" />
-			</view>
-			<view class="base-item flex">
-				<view class="item-name">银行卡账号</view>
-				<input type="text" value="" class="item-val" placeholder="输入您的银行卡账号" v-model="bank_card" />
-			</view>
-		</view>
-		<view class="btn" @click="subInfo">提交保存</view>
-		<view class="btn1" @click="toLogout">退出登录</view>
-		<view class="jg" style="height: 70rpx;">
-
-		</view>
+		</uni-popup>
 	</view>
 </template>
 
 <script>
-	import { mapState, mapMutations } from 'vuex';
-	import { getUserInfo } from '@/api/user.js';
-	import { edit } from '@/api/user.js';
-	import { upload } from '@/api/order.js';
-	  import { logout } from '@/api/set.js';
-	export default {
-		computed: {
-			...mapState('user',['userInfo'])
+import { mapState,mapMutations } from 'vuex';
+import { upload } from '@/api/order.js';
+import {userEdit,logout} from '@/api/set.js';
+export default {
+	data(){
+		return{
+			show:false,
+			password: '',
+		}
+	},
+	onLoad() {
+		console.log(this.userInfo)
+	},
+	computed: {
+		...mapState('user',['userInfo'])
+	},
+	methods: {
+		...mapMutations('user',['logout']),
+		imgsub() {
+			console.log('上传头像')
+			upload({
+				filename: ''
+			}).then(data => {
+				console.log("data",data);
+				this.userInfo.avatar = data[0].url;
+			})
 		},
-		data() {
-			return {
-				avatar: '',
-				upimg: '',
-				real_name: '',
-				nickname: '',
-				phone: '',
-				wx_no: '',
-				alipay_name: '',
-				alipay_no: '',
-				account_Bank: '',
-				bank_branch: '',
-				bank_card: '',
-				bank_name: '',
-				// birthday: '',
-				city: '',
-				card_id: '',//身份证
-				uid: '',
-				vip_name: ''
-			}
+		confirm() {
+			userEdit({ avatar: this.userInfo.avatar ,nickname: this.userInfo.nickname})
+				.then(e => {
+					this.$api.msg('修改成功');
+					setTimeout(()=> {
+						uni.switchTab({
+							url:'/pages/user/user'
+						});
+					}, 1000);
+					console.log(e);
+				})
+				.catch(e => {
+					console.log(e);
+				});
 		},
-		onLoad() {
-			let obj = this
-			obj.avatar = obj.userInfo.avatar || ''
-			obj.alipay_name = obj.userInfo.alipay_name || ''
-			obj.alipay_no = obj.userInfo.alipay_no || '',
-			obj.bank_branch = obj.userInfo.bank_branch || ''
-			obj.account_Bank = obj.userInfo.account_Bank || ''
-			obj.bank_card = obj.userInfo.bank_card || ''
-			obj.uid = obj.userInfo.uid
-			obj.bank_name = obj.userInfo.bank_name || ''
-			// obj.birthday = obj.userInfo.birthday || ''
-			// obj.card_id: obj.userInfo.card_id  || ''
-			obj.upimg = obj.userInfo.wx_qr || ''
-			obj.wx_no = obj.userInfo.wx_no || ''
-			obj.phone = obj.userInfo.phone || ''
-			obj.real_name = obj.userInfo.real_name || ''
-			obj.nickname = obj.userInfo.nickname || ''
-			console.log(obj.userInfo.vip_name,'obj.userInfo.vip_name')
-			// obj.vip_name = obj.userInfo.vip_name || '暂无'
+		toLogout(){
+			let obj = this;
+			uni.showModal({
+			    content: '确定要退出登录么',
+			    success: (e)=>{
+			    	if(e.confirm){
+						logout({}).then((e) => {
+							uni.navigateBack();
+						}).catch((e) => {
+							console.log(e);
+						})
+			    		obj.logout();
+			    	}
+			    }
+			});
 		},
-		methods: {
-			...mapMutations('user', ['setUserInfo', 'setOrderInfo','logout']),
-			//退出登录
-			toLogout() {
-				let obj = this;
-				uni.showModal({
-					content: '确定要退出登录么',
-					success: e => {
-						if (e.confirm) {
-							logout({}).then(e => {
-								obj.logout();
-								uni.switchTab({
-									url: '/pages/index/index'
-								})
-							})
-							.catch(e => {
-								console.log(e);
-							});
-						}
-					}
-				});
-			},
-			imgsub(text) {
-				console.log('imgsub');
-				upload({
-					filename: ''
-				}).then(data => {
-					// this.upimg = data[0].url;
-					this.$set(this,text,data[0].url)
-				});
-			},
-			getUserInfo() {
-				getUserInfo({})
-					.then(({ data }) => {
-						this.setUserInfo(data);
-					})
-					.catch(e => {
-						console.log(e);
-					});
-			},
-			bindDateChange(e) {
-				this.birthday = e.detail.value
-			},
-			subInfo() {
-				let obj = this
-				if(obj.upimg == '') {
-					obj.$api.msg('请上传收款码')
-					return
-				}
-				if(obj.avatar == '') {
-					obj.$api.msg('请上传头像')
-					return
-				}
-				if(obj.nickname == '') {
-					obj.$api.msg('请输入昵称')
-					return
-				}
-				if(obj.phone == '') {
-					obj.$api.msg('请输入手机号')
-					return
-				}
-				const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
-				if (!reg.test(obj.phone)) {
-					obj.$api.msg('请填写正确的手机号码');
-					return;
-				}
-				if(obj.real_name == '') {
-					obj.$api.msg('请输入姓名')
-					return
-				}
-				if(obj.wx_no == '') {
-					obj.$api.msg('请输入微信号')
-					return
-				}
-				if(obj.alipay_name == '') {
-					obj.$api.msg('请输入支付宝姓名')
-					return
-				}
-				if(obj.alipay_no == '') {
-					obj.$api.msg('请输入支付宝账号')
-					return
-				}
-				if(obj.account_Bank == '') {
-					obj.$api.msg('请输入开户行')
-					return
-				}
-				if(obj.bank_branch == '') {
-					obj.$api.msg('请输入所属支行')
-					return
-				}
-				if(obj.bank_name == '') {
-					obj.$api.msg('请输入开户姓名')
-					return
-				}
-				if(obj.bank_card == '') {
-					obj.$api.msg('请输入银行卡账号')
-					return
-				}
-				// if(obj.birthday == '') {
-				// 	obj.$api.msg('请输入出生日期')
-				// 	return
-				// }
-				
-				uni.showLoading({
-					title: '提交中...',
-					mask:true
-				})
-				edit({
-					avatar: obj.avatar,
-					alipay_name: obj.alipay_name,
-					alipay_no: obj.alipay_no,
-					account_Bank: obj.account_Bank,
-					bank_branch: obj.bank_branch,
-					bank_card: obj.bank_card,
-					bank_name: obj.bank_name,
-					// birthday: obj.birthday,
-					// card_id: obj.card_id,
-					wx_no: obj.wx_no,
-					phone: obj.phone,
-					real_name: obj.real_name,
-					nickname: obj.nickname,
-					wx_qr: obj.upimg
-					
-				}).then( res => {
-					obj.getUserInfo()
-					
-					obj.$api.msg('修改成功');
-					let pages = getCurrentPages();
-					let route = pages[pages.length - 2].route;
-					console.log(route,'route++++++++')
-					if(route == 'pages/money/withdrawal') {
-						setTimeout(()=> {
-							uni.navigateTo({
-								url:'/pages/money/withdrawal'
-							});
-						}, 1000);
-					}else {
-						setTimeout(()=> {
-							uni.switchTab({
-								url:'/pages/user/user'
-							});
-						}, 1000);
-					}
-					
-					
-				}).catch( err => {
-					console.log(err)
-				})
+		cancel(){
+			this.$refs.popup.open();
+		},
+		qx() {
+			this.password = '';
+			this.$refs.popup.close();
+		},
+		pswQd() {
+			if(this.password != this.userInfo.phone){
+				this.$refs.popup.close();
+				this.password = '';
+				this.$api.msg("请输入自己的账户")
+				return
 			}
+			this.$refs.popup.close();
+			this.password = '';
+			this.$api.msg("申请注销成功,请耐心等待审核")
 		}
 	}
+}
 </script>
 
-<style lang="scss" scoped>
-	.tit {
-		padding: 30rpx 25rpx;
-		font-size: 32rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #101010;
-	}
-
-	.up-wrap {
-		margin-left: 30rpx;
-		width: 225rpx;
-		height: 225rpx;
-		background: #FFFFFF;
-		border-radius: 10rpx;
-
-		image {
-			width: 225rpx;
-			height: 225rpx;
-			border-radius: 10rpx;
+<style lang="scss">
+	.row1 {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		position: relative;
+		padding: 0 30upx;
+		height: 110upx;
+		background: #fff;
+		margin-bottom: 20upx;
+		.tit {
+			flex-shrink: 0;
+			width: 120upx;
+			font-size: $font-lg;
+			color: $font-color-dark;
+		}
+		
+		.background-img {
+			width: 80rpx;
+			height: 80rpx;
+			border-radius: 50%;
+			background: #f2f2f2;
 		}
 	}
-
-	.base-info {
-		margin: auto;
-		width: 702rpx;
-		// height: 1106px;
-		background: #FFFFFF;
-		box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
-		border-radius: 20rpx;
-
-		.base-item {
-			border: 1px solid #eee;
-			line-height: 100rpx;
-			font-size: 30rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			color: #333333;
-			padding-left: 25rpx;
-			
-			.avatar {
-				margin: auto;
-				width: 200rpx;
-				height: 200rpx;
-				border-radius: 50%;
-				// background-color: #aaa;
-				image {
-					width: 200rpx;
-					height: 200rpx;
-					border-radius: 50%;
-				}
-			}
-			.item-name {
-				font-weight: bold;
-			}
-			.item-val {
-				display: block;
-				line-height: 100rpx;
-				height: 100rpx;
-				width: 478rpx;
-				font-size: 28rpx;
-				font-family: PingFang SC;
-				font-weight: 400;
-				color: #000;
-			}
+	.row {
+		display: flex;
+		align-items: center;
+		padding: 0 30upx;
+		height: 110upx;
+		background: #fff;
+	
+		.tit {
+			flex-shrink: 0;
+			width: 120upx;
+			font-size: $font-lg;
+			color: $font-color-dark;
+		}
+		.input {
+			flex: 1;
+			text-align: right;
+			font-size: $font-base;
+			color: $color-gray;
 		}
-
 	}
-
-	.btn {
-		margin: 70rpx auto 0;
-		width: 702rpx;
-		line-height: 84rpx;
-		background: linear-gradient(30deg, #FF4C4C, #FE6238);
-		border-radius: 10rpx;
-		font-size: 32rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
+	.add-btn {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		margin: 158rpx auto 30rpx;
+		width: 560rpx;
+		height: 80rpx;
+		background: #DC262B;
+		border-radius: 40px;
 		color: #FFFFFF;
-		text-align: center;
 	}
-	.btn1 {
-		margin: 30rpx auto 0;
-		width: 702rpx;
-		line-height: 84rpx;
-		color: #FF4C4C;
-		border: 1px solid #FF4C4C;
-		background-color: #fff;
-		border-radius: 10rpx;
-		font-size: 32rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		text-align: center;
+	.out {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		margin: 0 auto 30rpx;
+		width: 560rpx;
+		height: 80rpx;
+		border: 1px solid #32C6FF;
+		background: #FFFFFF;
+		border-radius: 40px;
+		color: #32C6FF;
+	}
+	.psw-wrapper {
+		width: 548rpx;
+		height: 344rpx;
+		background-color: #ffffff;
+		.psw-title {
+			width: 100%;
+			font-size: 35rpx;
+			padding: 43rpx 0 49rpx;
+			text-align: center;
+			font-weight: 800;
+		}
+		.psw-ipt {
+			display: block;
+			background-color: #dce3ed;
+			height: 90rpx;
+			width: 464rpx;
+			padding-left: 30rpx;
+			margin: 0 auto;
+			font-size: 80rpx;
+		}
+		.psw-btn text {
+			display: inline-block;
+			text-align: center;
+			width: 50%;
+			padding-top: 29rpx;
+			font-size: 35rpx;
+		}
+		.psw-qd {
+			color: #32C6FF;
+		}
 	}
 </style>

BIN
static/img/hinfo-bg.png


BIN
static/user/wx.png