浏览代码

2024-4-24

cmy 10 月之前
父节点
当前提交
aa1208ba3f
共有 4 个文件被更改,包括 25 次插入119 次删除
  1. 18 113
      pages/index/order.vue
  2. 4 3
      pages/index/pledge.vue
  3. 2 2
      pages/user/set/set.vue
  4. 1 1
      store/index.js

+ 18 - 113
pages/index/order.vue

@@ -1,11 +1,11 @@
 <template>
 	<view class="all">
 		<view class="fixedBox">
-			<view class="navList flex">
+			<!-- <view class="navList flex">
 				<view v-for="(item, index) in navItem" :key="index" class="navItem"
 					:class="{ activeItem: tabIndex === index,tip:index == 0 }" @click="tabClick(index,1)">{{ item }}
 				</view>
-			</view>
+			</view> -->
 			<view class="navList flex navList2">
 				<view v-for="(item, index) in navList[tabIndex]" :key="index" class="navItem"
 					:class="{ activeItem: tabCurr === index}" @click="tabClick(index,2)">{{ item.name }}
@@ -37,31 +37,20 @@
 					<view class="" style="text-align: right;">
 						<image src="/static/image/img21.png" style="width: 40rpx;height: 31rpx;margin-bottom: 25rpx;" mode="widthFix">
 						</image>
-						<view class="tipBtn" v-if="status==5 && item.voucher" @click.stop="comfirOrder(item.id,item.voucher)">查看凭证</view>
+						<view class="tipBtn"  v-if="item.voucher">查看凭证</view>
 						<view class="tipBtn" v-if="status==3">上传凭证</view>
-						<view class="tipBtn" v-if="status==1" @click.stop="cancel(item.id)">取消</view>
 					</view>
 				</view>
 			</view>
 		</view>
 		<uni-load-more :status="loadingType"></uni-load-more>
-		<!-- 查看凭证弹窗 -->
-		<u-popup :show="popShow" @close="popShow = false" :round="10" @open="popShow = true" mode="center">
-			<view class="popBox">
-				<image :src="popShowImg" mode="aspectFit"></image>
-				<view class="popBtn" v-if="tabIndex == 0" @click="comirOrder">确认订单</view>
-				<view class="popBtn" v-if="tabIndex == 1" @click="popShow = false">关闭查看</view>
-			</view>
-		</u-popup>
 	</view>
 </template>
 
 <script>
 	import {
 		sellMy,
-		sellBuyMy,
-		cancelLog,
-		comfirLog
+		sellBuyMy
 	} from '@/api/game.js';
 	import {
 		mapState
@@ -81,22 +70,22 @@
 				tabIndex: 0, //当前选中的一级分类
 				navItem: ['卖币订单', '买币订单'],
 				tabCurr: 0, //当前选中的二级分类
-				status: 1, //当前选中状态
+				status: 0, //当前选中状态
 				navList: [
 					[ {
 						name: '挂出',
 						status: 1
-					},{
-						name: '待确认',
-						status: 5
-					},{
+					}, {
+						name: '待上传',
+						status: 3
+					}, {
 						name: '完成',
 						status: 2
 					},{
 						name: '结束',
 						status: 0
-					}],
-					[{
+					},],
+					[ {
 						name: '待上传',
 						status: 3
 					}, {
@@ -110,16 +99,10 @@
 				page: 1,
 				limit: 10,
 				loadingType: "more",
-				list: [],
-				popShow:false,
-				popShowImg:'',
-				popId:''
+				list: []
 			}
 		},
-		onShow() {
-			this.page = 1;
-			this.loadingType = "more";
-			this.list = []
+		onLoad() {
 			this.loadData()
 		},
 		onReachBottom() {
@@ -128,7 +111,7 @@
 		methods: {
 			navItemTo(item){
 				uni.navigateTo({
-					url:`/pages/index/orderDetail?id=${item.id}&tab=${this.tabIndex}`
+					url:`/pages/index/orderDetail?id=${item.id}`
 				})
 			},
 			loadData() {
@@ -138,22 +121,14 @@
 					return;
 				}
 				obj.loadingType = "loading";
-				console.log(obj.status,'obj.status');
-				console.log(obj.tabIndex,'obj.tabIndex');
-				console.log(obj.list,'obj.list');
+				console.log(obj.status);
 				if (this.tabIndex == 0) {
 					sellMy({
 						page: obj.page,
 						limit: obj.limit,
 						status:obj.status
 					}, obj.status).then(res => {
-						let ar = res.data.list.map((re)=>{
-							re.num = +re.num;
-							re.price = +re.price;
-							re.money = +(re.num*re.price).toFixed(8);
-							return re
-						})
-						obj.dataList(ar)
+						obj.dataList(res.data.list)
 					});
 				} else if (this.tabIndex == 1) {
 					sellBuyMy({
@@ -162,6 +137,7 @@
 						status:obj.status
 					}, obj.status).then(res => {
 						let ar = res.data.list.map((re)=>{
+							console.log(re,'re');
 							re.num = +re.num;
 							re.price = +re.price;
 							re.money = +(re.num*re.price).toFixed(8);
@@ -171,62 +147,6 @@
 					});
 				}
 			},
-			//取消挂出
-			cancel(id){
-				let obj = this;
-				cancelLog({
-					id:id
-				}).then(res => {
-					if(res.status == 200){
-						uni.showToast({
-							title: res.msg,
-							icon: 'none',
-						})
-						setTimeout(function () {
-							obj.page = 1;
-							obj.loadingType = "more";
-							obj.list = []
-							obj.loadData()
-						}, 1000);
-					}else{
-						uni.showToast({
-							title: res.msg,
-							icon: 'none',
-						})
-					}
-				});
-			},
-			//确认订单
-			comirOrder(){
-				const that = this;
-				comfirLog({
-					id:that.id,
-				}).then(res => {
-					if(res.status == 200){
-						uni.showToast({
-							title: res.msg,
-							icon: 'none',
-						})
-						setTimeout(()=>{
-							obj.page = 1;
-							obj.loadingType = "more";
-							obj.list = []
-							obj.loadData()
-						},1000)
-					}else{
-						uni.showToast({
-							title: res.msg,
-							icon: 'none',
-						})
-					}
-				});
-			},
-			//点击查看凭证
-			comfirOrder(id,img){
-				this.popShowImg = img
-				this.popId = id
-				this.popShow = true
-			},
 			dataList(ar) {
 				const obj = this;
 				if (ar.length > 0) {
@@ -238,6 +158,7 @@
 				} else {
 					obj.loadingType = "nomore";
 				}
+				console.log(obj.list,"list");
 			},
 			tabClick(index,type) {
 				if (type == 1) {
@@ -361,20 +282,4 @@
 			}
 		}
 	}
-	.popBox{
-		max-height: 70vh;
-		padding: 35rpx 35rpx;
-		image{
-			max-height: 60vh;
-		}
-		.popBtn{
-			background: linear-gradient(90deg, #0C5AFA, #1356FF);
-			border-radius: 7rpx;
-			padding: 15rpx 35rpx;
-			width: 60%;
-			margin: 35rpx auto;
-			text-align: center;
-			color: #fff;
-		}
-	}
 </style>

+ 4 - 3
pages/index/pledge.vue

@@ -1,11 +1,12 @@
 <template>
 	<view class="all">
-		<view class="navList flex">
+		<!-- <view class="navList flex">
 			<view v-for="(item, index) in navList" :key="index" class="navItem"
 				:class="{ activeItem: tabCurrentIndex === index,tip:index == 0 }" @click="tabClick(index)">{{ item }}
 			</view>
-		</view>
-		<view style="padding-top: 44px;" v-if="tabCurrentIndex == 0">
+		</view> -->
+		<!-- <view style="padding-top: 44px;" v-if="tabCurrentIndex == 0"> -->
+		<view style="padding-top: 0;" v-if="tabCurrentIndex == 0">
 			<view class="listBox">
 				<view class="titleTetx">数量</view>
 				<view class="flex listTpl">

+ 2 - 2
pages/user/set/set.vue

@@ -12,7 +12,7 @@
 					<uni-icons type="right" :color='iconColor'></uni-icons>
 				</view>
 			</view>
-			<view class="flex item" @click="navTo('/pages/user/set/team')">
+			<!-- <view class="flex item" @click="navTo('/pages/user/set/team')">
 				<view class="left flex-start">
 					<uni-icons type="staff" :size="iconSize" :color="listColor"></uni-icons>
 					<text class="title">
@@ -22,7 +22,7 @@
 				<view class="right">
 					<uni-icons type="right" :color='iconColor'></uni-icons>
 				</view>
-			</view>
+			</view> -->
 			<view class="flex item" @click="navTo('/pages/user/set/shareQrCode')">
 				<view class="left flex-start">
 					<uni-icons type="personadd" :size="iconSize" :color="listColor"></uni-icons>

+ 1 - 1
store/index.js

@@ -6,7 +6,7 @@ Vue.use(Vuex)
 
 const store = new Vuex.Store({
 	state: {
-		baseURL: 'https://polkep.xyz', //请求地址配置
+		baseURL: 'http://yzf.frp.qiniu1314.com', //请求地址配置
 		urlFile: '/index', //项目部署所在文件夹
 		loginInterceptor: false, //是否打开强制登录
 		// #ifdef H5 || MP-WEIXIN