Browse Source

2024-4-20

cmy 10 months ago
parent
commit
fde76b2b69
39 changed files with 323 additions and 224 deletions
  1. 9 0
      api/game.js
  2. 0 8
      pages.json
  3. 35 30
      pages/index/pledge.vue
  4. 16 21
      pages/public/login.vue
  5. BIN
      static/img/dice1.png
  6. BIN
      static/img/dice2.png
  7. BIN
      static/img/dice3.png
  8. BIN
      static/img/dice4.png
  9. BIN
      static/img/dice5.png
  10. BIN
      static/img/dice6.png
  11. BIN
      static/img/in-ban.png
  12. BIN
      static/img/jhq.png
  13. BIN
      static/img/loginBg.png
  14. BIN
      static/img/money_pay_1.png
  15. BIN
      static/img/money_pay_2.png
  16. BIN
      static/img/money_pay_3.png
  17. BIN
      static/img/money_pay_4.png
  18. BIN
      static/img/zhiya2.png
  19. BIN
      static/img/zixun1.png
  20. BIN
      static/img/zixun2.png
  21. BIN
      static/img/zixun3.png
  22. BIN
      static/img/zixun4.png
  23. BIN
      static/img/zixun5.png
  24. BIN
      static/img/登录_slices/icon-code.png
  25. BIN
      static/img/登录_slices/icon-code@2x.png
  26. BIN
      static/img/登录_slices/icon-phone.png
  27. BIN
      static/img/登录_slices/icon-phone@2x.png
  28. BIN
      static/img/登录_slices/图层 528.png
  29. BIN
      static/img/登录_slices/图层 528@2x.png
  30. 19 0
      uni_modules/uni-load-more/changelog.md
  31. 5 0
      uni_modules/uni-load-more/components/uni-load-more/i18n/en.json
  32. 8 0
      uni_modules/uni-load-more/components/uni-load-more/i18n/index.js
  33. 5 0
      uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json
  34. 5 0
      uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json
  35. 112 0
      uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue
  36. 86 0
      uni_modules/uni-load-more/package.json
  37. 14 0
      uni_modules/uni-load-more/readme.md
  38. 7 159
      utils/loginUtils.js
  39. 2 6
      utils/request.js

+ 9 - 0
api/game.js

@@ -73,4 +73,13 @@ export  function gamechargePost(data) {
 		method: 'post',
 		data
 	});
+}
+
+// 挂出列表
+export  function getsell(data) {
+	return request({
+		url: `/api/sell`,
+		method: 'get',
+		data
+	});
 }

+ 0 - 8
pages.json

@@ -36,14 +36,6 @@
 				"navigationBarTextStyle": "white"
 			}
 		},
-		// 资讯
-		{
-			"path": "pages/index/information",
-			"style": {
-				"navigationBarTitleText": "News",
-				"navigationStyle": "custom"
-			}
-		},
 		{
 			"path": "pages/public/register",
 			"style": {

+ 35 - 30
pages/index/pledge.vue

@@ -60,7 +60,7 @@
 							<button v-if="item._status._title == '未发货'" class="action-btn" @click.stop="orderRefund(item)">申请退款</button>
 						</view>
 					</view>
-					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
+					<uni-load-more :status="tabItem.loadingType" color='#FFF'></uni-load-more>
 				</scroll-view>
 			</swiper-item>
 		</swiper>
@@ -68,6 +68,9 @@
 </template>
 
 <script>
+	import {
+		getsell
+	} from '@/api/game.js';
 	import {
 		mapState
 	} from 'vuex';
@@ -164,36 +167,38 @@
 				}
 				// 修改当前对象状态为加载中
 				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';
-						}
-						uni.hideLoading();
-						this.$set(navItem, 'loaded', true);
+				if(index==0){
+					getsell({
+						type: state,
+						page: navItem.page,
+						limit: navItem.limit
 					})
-					.catch(e => {
-						console.log(e);
-					});
+						.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';
+							}
+							uni.hideLoading();
+							this.$set(navItem, 'loaded', true);
+						})
+						.catch(e => {
+							console.log(e);
+						});
+				}
+				
 			},
 		}
 	};

+ 16 - 21
pages/public/login.vue

@@ -19,19 +19,14 @@
 				<view class="login_name"><input class="uni-input" type="password" v-model="passward" focus
 						:placeholder="$t('login.a3')" /></view>
 			</view>
-			<view><button type="green" class="uni-button uni-button-green" @click="toLogin">{{$t('login.a4')}}</button>
+			<view>
+				<button type="green" class="uni-button uni-button-green" @click="toLogin">{{$t('login.a4')}}</button>
 			</view>
 			<view><button type="green" class="uni-button uni-button-green uni-button-green-plain" plain="true"
 					hover-class="none" @click="register">{{$t('login.a7')}}</button></view>
 			<navigator url="./forget">
 				<view class="forget">{{$t('login.b2')}}</view>
 			</navigator>
-			<!-- #ifdef H5 -->
-			<view class="flex">
-				<button class="uni-button loadapp" @click="domApp('apk')">APK下载</button>
-				<button class="uni-button loadapp" @click="domApp('ios')">IOS下载</button>
-			</view>
-			<!-- #endif -->
 		</view>
 	</view>
 </template>
@@ -293,7 +288,7 @@
 		border: 1px solid #212121;
 		margin: 24rpx auto;
 		padding: 10rpx;
-		background-color: #212121;
+		// background-color: #212121;
 		color: #ffffff;
 
 		.loginIcon {
@@ -316,7 +311,7 @@
 		border: 1px solid #212121;
 		margin: 24rpx auto;
 		padding: 15rpx;
-		background-color: #212121;
+		// background-color: #212121;
 		color: #ffffff;
 		font-size: 32rpx;
 
@@ -341,7 +336,7 @@
 		width: 100%;
 		height: 100%;
 		background-size: 100%;
-		background-color: #051137;
+		// background-color: #051137;
 	}
 
 	.container_text {
@@ -359,8 +354,8 @@
 	.login_text {
 		margin: auto 10rpx;
 		position: relative;
-		padding: 100rpx 102rpx;
-		background-color: #000000;
+		padding: 100rpx 74rpx;
+		// background-color: #000000;
 		margin-top: -180rpx;
 		border-radius: 20rpx;
 
@@ -426,18 +421,18 @@
 		}
 
 		.uni-button-green {
-			color: #ffffff;
-			background-color: #feb041;
-			margin: 40rpx 10rpx;
-			border-radius: 50rpx;
+			color: #1257FE;
+			background-color: #FFF;
+			margin: 40rpx 0rpx;
+			border-radius: 10rpx;
 		}
 
 		.uni-button-green-plain {
-			border: 1px solid #feb041;
-			margin: 40rpx 10rpx;
-			border-radius: 50rpx;
-			color: #feb041;
-			background-color: #000000;
+			border: 1px solid #FFF;
+			margin: 40rpx 0rpx;
+			border-radius: 10rpx;
+			color: #FFF;
+			background-color: transparent;
 		}
 
 		.uni-button {

BIN
static/img/dice1.png


BIN
static/img/dice2.png


BIN
static/img/dice3.png


BIN
static/img/dice4.png


BIN
static/img/dice5.png


BIN
static/img/dice6.png


BIN
static/img/in-ban.png


BIN
static/img/jhq.png


BIN
static/img/loginBg.png


BIN
static/img/money_pay_1.png


BIN
static/img/money_pay_2.png


BIN
static/img/money_pay_3.png


BIN
static/img/money_pay_4.png


BIN
static/img/zhiya2.png


BIN
static/img/zixun1.png


BIN
static/img/zixun2.png


BIN
static/img/zixun3.png


BIN
static/img/zixun4.png


BIN
static/img/zixun5.png


BIN
static/img/登录_slices/icon-code.png


BIN
static/img/登录_slices/icon-code@2x.png


BIN
static/img/登录_slices/icon-phone.png


BIN
static/img/登录_slices/icon-phone@2x.png


BIN
static/img/登录_slices/图层 528.png


BIN
static/img/登录_slices/图层 528@2x.png


+ 19 - 0
uni_modules/uni-load-more/changelog.md

@@ -0,0 +1,19 @@
+## 1.3.3(2022-01-20)
+- 新增 showText属性 ,是否显示文本
+## 1.3.2(2022-01-19)
+- 修复 nvue 平台下不显示文本的bug
+## 1.3.1(2022-01-19)
+- 修复 微信小程序平台样式选择器报警告的问题
+## 1.3.0(2021-11-19)
+- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
+- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-load-more](https://uniapp.dcloud.io/component/uniui/uni-load-more)
+## 1.2.1(2021-08-24)
+- 新增 支持国际化
+## 1.2.0(2021-07-30)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 1.1.8(2021-05-12)
+- 新增 组件示例地址
+## 1.1.7(2021-03-30)
+- 修复 uni-load-more 在首页使用时,h5 平台报 'uni is not defined' 的 bug
+## 1.1.6(2021-02-05)
+- 调整为uni_modules目录规范

+ 5 - 0
uni_modules/uni-load-more/components/uni-load-more/i18n/en.json

@@ -0,0 +1,5 @@
+{
+	"uni-load-more.contentdown": "Pull up to show more",
+	"uni-load-more.contentrefresh": "loading...",
+	"uni-load-more.contentnomore": "No more data"
+}

+ 8 - 0
uni_modules/uni-load-more/components/uni-load-more/i18n/index.js

@@ -0,0 +1,8 @@
+import en from './en.json'
+import zhHans from './zh-Hans.json'
+import zhHant from './zh-Hant.json'
+export default {
+	en,
+	'zh-Hans': zhHans,
+	'zh-Hant': zhHant
+}

+ 5 - 0
uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json

@@ -0,0 +1,5 @@
+{
+	"uni-load-more.contentdown": "上拉显示更多",
+	"uni-load-more.contentrefresh": "正在加载...",
+	"uni-load-more.contentnomore": "没有更多数据了"
+}

+ 5 - 0
uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json

@@ -0,0 +1,5 @@
+{
+	"uni-load-more.contentdown": "上拉顯示更多",
+	"uni-load-more.contentrefresh": "正在加載...",
+	"uni-load-more.contentnomore": "沒有更多數據了"
+}

File diff suppressed because it is too large
+ 112 - 0
uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue


+ 86 - 0
uni_modules/uni-load-more/package.json

@@ -0,0 +1,86 @@
+{
+  "id": "uni-load-more",
+  "displayName": "uni-load-more 加载更多",
+  "version": "1.3.3",
+  "description": "LoadMore 组件,常用在列表里面,做滚动加载使用。",
+  "keywords": [
+    "uni-ui",
+    "uniui",
+    "加载更多",
+    "load-more"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+  "dcloudext": {
+    "category": [
+      "前端组件",
+      "通用组件"
+    ],
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+  },
+  "uni_modules": {
+    "dependencies": ["uni-scss"],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "y"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        },
+        "Vue": {
+            "vue2": "y",
+            "vue3": "y"
+        }
+      }
+    }
+  }
+}

+ 14 - 0
uni_modules/uni-load-more/readme.md

@@ -0,0 +1,14 @@
+
+
+### LoadMore 加载更多
+> **组件名:uni-load-more**
+> 代码块: `uLoadMore`
+
+
+用于列表中,做滚动加载使用,展示 loading 的各种状态。
+
+
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-load-more)
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 
+
+

+ 7 - 159
utils/loginUtils.js

@@ -1,12 +1,3 @@
-// import detectEthereumProvider from '@metamask/detect-provider'
-import {
-	login
-} from '@/api/login.js';
-import {
-	getUserInfo
-} from '@/api/user.js';
-import store from '../store'
-
 export function getActionPage() {
 	let pages = getCurrentPages();
 	return pages[pages.length - 1]
@@ -19,13 +10,10 @@ export function interceptor() {
 	let url = '/pages/public/login'
 	// #ifdef H5
 	// 判断是否为公众号调用微信授权登录
-	// let weichatBrowser = uni.getStorageSync('weichatBrowser');
-	// if (weichatBrowser) {
-	// 	url = '/pages/public/wxLogin';
-	// }
-	setPeovider();
-	return
-
+	let weichatBrowser = uni.getStorageSync('weichatBrowser');
+	if (weichatBrowser) {
+		url = '/pages/public/wxLogin';
+	}
 	// #endif
 	// #ifdef MP-WEIXIN
 	url = '/pages/public/wxLogin';
@@ -44,7 +32,7 @@ export function saveUrl() {
 }
 
 // 处理分享链接地址
-export function getPageUrl(showSpeard = false) {
+export function getPageUrl(showSpeard=false) {
 	let page = getActionPage();
 	let path = '/' + page.route;
 	let url = '';
@@ -57,9 +45,9 @@ export function getPageUrl(showSpeard = false) {
 			// 判断有无邀请人
 			if (a != 'speard') {
 				url += a + "=" + page.options[a] + "&"
-			} else {
+			}else{
 				// 判断是否需要存储邀请人
-				if (showSpeard) {
+				if(showSpeard){
 					url += a + "=" + page.options[a] + "&"
 				}
 			}
@@ -69,143 +57,3 @@ export function getPageUrl(showSpeard = false) {
 	// 返回处理邀请人后的邀请地址
 	return path
 }
-
-async function setPeovider() { // 检测提供者
-	uni.showLoading({
-		title: '检测授权中...',
-		mask: true
-	});
-	const provider = await detectEthereumProvider();
-	if (provider) {
-		startApp(provider); // Initialize your app
-	} else {
-		uni.showToast({
-			title: '请先安装MetaMask插件',
-			icon: 'none',
-			duration: 3500
-		});
-		return false;
-	}
-};
-// 检测插件
-async function startApp(provider) {
-	if (provider !== window.ethereum) {
-		uni.showToast({
-			title: '安装了多个钱包,加载失败',
-			icon: 'none',
-			duration: 3500
-		});
-		return false
-	} else {
-		uni.showLoading({
-			mask: true
-		});
-	}
-	const srcid = await ethereum.request({
-		method: 'eth_chainId'
-	});
-	if (srcid != '0x38') {
-		try {
-			const src = await ethereum.request({
-				method: 'wallet_switchEthereumChain',
-				params: [{
-					chainId: '0x38'
-				}],
-			});
-			console.log('233')
-			login_metamask()
-		} catch (switchError) {
-			if (switchError.code === 4902) {
-				try {
-					const src = await ethereum.request({
-						method: 'wallet_addEthereumChain',
-						params: [{
-							chainId: '0x38',
-							chainName: 'BSC',
-							rpcUrls: ['https://bsc-dataseed2.ninicoin.io'],
-						}, ],
-					});
-					login_metamask()
-					console.log(src, 'src');
-				} catch (addError) {
-					console.log(addError);
-				}
-			}
-		}
-	} else {
-		login_metamask()
-	}
-};
-async function login_metamask() {
-	eth_requestAccounts(); // 拿到账户对应的账号
-	ethereum.on('accountsChanged', (accounts) => { // 地址修改时收到通知
-		store.commit('user/logout');
-		console.log('234');
-		setPeovider(); // 重新登录
-	});
-	// 监听
-	// ethereum.on('chainChanged', (res)=>{
-	// 	console.log('235')
-	// 	store.commit('user/logout');
-	// 	setPeovider(); // 重新登录
-	// });
-	// ethereum.on('connect', (connectInfo) => { 
-	// 	// 当 MetaMask 提供者第一次能够向链 提交 RPC 请求时,它会发出此事件。
-	// 	uni.clearStorage();
-	// 	// Time to reload your interface with accounts[0]!
-	// 	loginDapp();
-	// });
-	ethereum.on('disconnect', (error) => { // 如果 MetaMask 提供者无法向任何链提        交 RPC 请求,它会发出此事件。
-		console.log(error);
-		// 这里可以打印一下error
-	});
-	// ethereum.on('message', (message) => { // MetaMask 提供者在收到一些应该通知消费者的消息时发出此事件。
-	// 	console.log(message.data.result.hash)
-	// })
-};
-async function eth_requestAccounts() {
-	// 链接到MetaMask
-	ethereum.request({
-		method: 'eth_requestAccounts'
-	}).then((account) => {
-		console.log(account, 'account');
-		// this.$store.commit('accounts/connect_wallet', account[0]);
-		// localStorage.setItem('accounts', account)
-		const PKR_LOGIN = 'PKR_LOGIN' + (new Date()).getTime();
-		ethereum.request({
-			"method": "personal_sign",
-			"params": [
-				PKR_LOGIN,
-				account[0]
-			]
-		}).then((res) => {
-			console.log(res, 'res');
-			console.log(res.length, 'reschangdu');
-			toLogin(res, account[0], PKR_LOGIN);
-		});
-	});
-};
-// 登录
-async function toLogin(sign, account, msg) {
-	const that = getApp();
-	login({
-			sign,
-			account,
-			msg: msg,
-			spread: uni.getStorageSync('spread') || '' //上级推广人
-		})
-		.then(function(e) {
-			uni.setStorageSync('token', e.data.token);
-			getUserInfo({}).then(e => {
-				console.log(store);
-				store.commit('user/login')
-				// 保存返回用户数据
-				// obj.setUserInfo();
-				store.commit('user/setUserInfo', e.data);
-				uni.hideLoading()
-			});
-		})
-		.catch(function(e) {
-			console.log(e);
-		});
-};

+ 2 - 6
utils/request.js

@@ -1,6 +1,5 @@
 import service from './newRequest.js'
 import store from '../store';
-
 import {
 	saveUrl,
 	interceptor
@@ -9,7 +8,6 @@ import {
 service.interceptors.response(
 	response => {
 		try {
-			const that = getApp();
 			let res = response.data;
 			// 解析字符串为数字
 			if (res.status !== 200) {
@@ -19,10 +17,8 @@ service.interceptors.response(
 					store.commit('user/logout');
 					// 判断是否开启强制登录
 					uni.showModal({
-						title: that.$t('enter.c4'),
-						content: that.$t('enter.b5'),
-						cancelText: that.$t('indexenter.取消'),
-						confirmText: that.$t('indexenter.确定'),
+						title: "登陆",
+						content: '您未登录!是否马上登录?',
 						success: (e) => {
 							// 判断是否点击确认按钮
 							if (e.confirm) {

Some files were not shown because too many files changed in this diff