Bläddra i källkod

2.3.7 21030102 线上版本
前端 3个地方:1. 新增反馈页面。2.mac校验。3.连接手柄才显示内容

slambb 5 år sedan
förälder
incheckning
5496a6a0bb

+ 6 - 1
common/config.js

@@ -1,7 +1,7 @@
 //设置游戏列表的更新时间,超过这个时间,不显示出来
 //"2020-07-14"
 //************* ios 注意此时间设置,目前设置2021-01-24,暂时用于处理游戏显示 *************
-const endTime = "2021-02-26"
+const endTime = "2021-03-01"
 
 
 //线上地址,腾讯云服务器
@@ -146,6 +146,11 @@ const URL = {
 	 * 版本更新信息
 	 */
 	APPVERSIONUPDATE:`${host}/app/version_update`,
+	
+	/**
+	 * 上传反馈信息
+	 */
+	UPLOADFEEDBACK:`${host}/manager/upload_feedback`,
 }
 
 

+ 28 - 23
components/side-bar/side-bar.vue

@@ -1,6 +1,6 @@
 <template>
 	<!-- @touchmove.stop.prevent="moveHandle" -->
-	<view class="content" >
+	<view class="content">
 		<view class="side-left" :data-position="pos" :prop="pos" :change:prop="side.sizeReady" @touchstart="side.touchstart"
 		 @touchmove="side.touchmove" @touchend="side.touchend" @change="change">
 			<!-- 侧边栏 bshow-->
@@ -13,10 +13,10 @@
 								<view class="blank-space"></view>
 								<view class="flex-sub text-center">
 									<view class="cu-avatar-group" style="position: relative; margin: 10rpx;">
-										<view class="cu-avatar round " style="width: 146rpx;height: 146rpx;"  :style="[{ backgroundImage:'url('+avatarUrl+')' }]"></view>
-									
+										<view class="cu-avatar round " style="width: 146rpx;height: 146rpx;" :style="[{ backgroundImage:'url('+avatarUrl+')' }]"></view>
+
 									</view>
-									
+
 									<!-- <view class="text-xsl">
 										<image class="avatar-img bg-black" mode="aspectFit" :src="avatarUrl"></image>
 									</view> -->
@@ -78,7 +78,7 @@
 			return {
 				sideList: sideBarData.getSideBarList,
 				bshow: false,
-				bOpen:false,
+				bOpen: false,
 				left: 0,
 				/**
 				 * 变量控制开关
@@ -130,6 +130,9 @@
 					case "ranking":
 						url = '/pages/game-page/game-ranking/game-ranking';
 						break;
+					case "feedback":
+						url = '/pages/login-page/feedback/feedback';
+						break;
 				}
 				uni.navigateTo({
 					url: url,
@@ -138,7 +141,7 @@
 					complete: () => {}
 				});
 			},
-			
+
 			/**
 			 * 退出登录
 			 */
@@ -153,7 +156,7 @@
 					}
 				});
 			},
-			
+
 			showModal() {
 				// console.log("showModal:",this.show);
 				this.bshow = true;
@@ -166,24 +169,24 @@
 				this.$store.state.bCanvasShow = true;
 				this.$emit("hideSideBar");
 			},
-			
+
 			change(e) {
 				// console.log("side change:", e);
-				
+
 				if (e.close) {
 					this.hideModal();
 					this.bOpen = false;
-				}else{
+				} else {
 					this.bOpen = true;
 					this.show = true;
 				}
 			},
-			closeSide(){
-				if(!this.bOpen)return;
+			closeSide() {
+				if (!this.bOpen) return;
 				// console.log("close side.");
 				this.show = false;
 			},
-			moveHandle(){}
+			moveHandle() {}
 		}
 	}
 </script>
@@ -258,7 +261,8 @@
 	.margin-view {
 		margin: 10px 114rpx 10px 70rpx;
 	}
-	.side-mask{
+
+	.side-mask {
 		display: flex;
 		position: fixed;
 		top: 0;
@@ -272,9 +276,10 @@
 		overflow-y: auto;
 		backface-visibility: hidden;
 		background: rgba(0, 0, 0, 0.6);
-		opacity:1;
+		opacity: 1;
 		pointer-events: auto;
 	}
+
 	.side-handle {
 		display: flex;
 		position: fixed;
@@ -286,14 +291,15 @@
 		outline: 0;
 		text-align: center;
 		backface-visibility: hidden;
-		opacity:1;
+		opacity: 1;
 		pointer-events: none;
 	}
-	.side-opacity{
-		opacity:1;
+
+	.side-opacity {
+		opacity: 1;
 	}
-	
-	.side-pointer{
+
+	.side-pointer {
 		pointer-events: auto;
 	}
 
@@ -322,11 +328,10 @@
 		transition-duration: 0.3s;
 		transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
 	}
-	
+
 	/* 开始设置一个x偏移值 */
-	#my-side-dialog{
+	#my-side-dialog {
 		transform: translateX(-500px);
 		-webkit-transform: translateX(-500px)
 	}
-	
 </style>

+ 9 - 2
components/side-bar/sideBar.js

@@ -36,13 +36,20 @@ export default {
 		name: '排行榜',
 		page_type: "ranking",
 	}
-	// ,
+	 ,
 	// {
 	// 	id: 5,
 	// 	type: 'image',
 	// 	url: '/static/qrscan.png',
 	// 	name: '扫一扫',
 	// 	page_type: "QRCode",
-	// }
+	// },
+	{
+		id: 6,
+		type: 'image',
+		url: '/static/feedback@2x.png',
+		name: '意见反馈',
+		page_type: "feedback",
+	}
 	]
 }

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "哔蹦",
     "appid" : "__UNI__2635DF5",
     "description" : "",
-    "versionName" : "2.3.5",
-    "versionCode" : 21022701,
+    "versionName" : "2.3.7",
+    "versionCode" : 21030102,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 9 - 0
pages.json

@@ -216,6 +216,15 @@
             }
             
         }
+        ,{
+            "path" : "pages/login-page/feedback/feedback",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 2 - 2
pages/game-page/game/game.vue

@@ -28,7 +28,7 @@
 		</view>
 
 		<scroll-view scroll-y="true" :style="{ height: scrollviewHigh + 'px' }" @scrolltolower="lower">
-			<view v-if="gameShow" class="game-item card-view" v-for="(item, index) in gameList" :key="index" :data-id="index">
+			<view v-if="cIndex != -1 && gameShow" class="game-item card-view" v-for="(item, index) in gameList" :key="index" :data-id="index">
 				<view @tap="onNavToWebviewGame(item)">
 					<view class="game-image-container">
 						<image mode="aspectFill" class="game-item-image" :src="item.gamePicture"></image>
@@ -65,7 +65,7 @@
 					</view>
 				</view>
 			</view>
-			<view v-if="!gameShow || gameList.length == 0" class="text-16px text-gray text-center margin">没有更多数据</view>
+			<view v-if="(cIndex == -1 && !gameShow) || gameList.length == 0" class="text-16px text-gray text-center margin">没有更多数据</view>
 			<view style="height: 17px;"></view>
 		</scroll-view>
 

+ 205 - 0
pages/login-page/feedback/feedback.vue

@@ -0,0 +1,205 @@
+<template>
+	<view>
+		<uni-nav-bar id="nav-bar" status-bar="true" @clickLeft="onBack" :title="pageTitle" color="#000000" fixed="true"
+		 :border="false">
+			<view slot="left">
+				<view class=" flex align-center margin-left">
+					<image class="p-left-arrow" src="../../../static/p-left-arrow.png"></image>
+				</view>
+			</view>
+
+		</uni-nav-bar>
+		<form @submit="onUploadFeedback" class="padding flex flex-direction">
+
+			<textarea name="problemDescription" :maxlength='500' class="feedback-textarea" placeholder="请输入你要反馈的问题"
+			 placeholder-class="feedback-placeholder"></textarea>
+			<view style="height: 20px;"></view>
+			<view class="feedback-upload-image">
+				<view class="cu-bar" style="color: #BEBEBE; font-size: 14px;">
+					<view class="action">
+						请提供问题的截图或照片
+					</view>
+					<view class="action">
+						{{imgList.length}}/4
+					</view>
+				</view>
+				<view style="height: 1px; background-color: #dadada; margin: 0px 15px 15px;"></view>
+				<view class="cu-form-group" style="background-color: #F6F6F6;">
+					<view class="grid col-4 grid-square flex-sub">
+						<view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]">
+							<image :src="imgList[index]" mode="aspectFill"></image>
+							<view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
+								<text class='cuIcon-close'></text>
+							</view>
+						</view>
+						<view class="solids" style="background-color: #EEEEEE; border-radius: 15rpx;" @tap="ChooseImage" v-if="imgList.length<4">
+							<text class='cuIcon-cameraadd'></text>
+						</view>
+					</view>
+				</view>
+			</view>
+
+			<view class="cu-form-group margin-top radius" style="background-color: #F6F6F6;">
+				<view class="feedback-title">用户名</view>
+				<input name="userName" style=" text-align: right;" placeholder="请输入用户名" placeholder-class="feedback-placeholder"
+				 :value="userName"></input>
+			</view>
+			<view class="cu-form-group margin-top radius" style="background-color: #F6F6F6;">
+				<view class="feedback-title">联系方式</view>
+				<input name="phoneNumber" type="number" style="text-align: right;" placeholder="请输入手机号" placeholder-class="feedback-placeholder"
+				 :value="phoneNumber"></input>
+			</view>
+			<view class="flex flex-direction margin-top">
+				<button form-type="submit" class="cu-btn make-bg-bPurple margin-tb-sm lg text-white">提交</button>
+			</view>
+
+			<input v-show="false" name="versionName" :value="version"></input>
+			<input v-show="false" name="versionCode" :value="versionCode"></input>
+
+		</form>
+	</view>
+</template>
+
+<script>
+	import reqUtil from '@/util/util-js/requstUtil.js';
+	import config from '@/common/config.js';
+
+	import {
+		mapState
+	} from 'vuex';
+
+	export default {
+		computed: mapState(['userName', 'phoneNumber', 'version', 'versionCode']),
+		data() {
+			return {
+				pageTitle: '意见反馈',
+				imgList: []
+			}
+		},
+		methods: {
+			onBack() {
+				uni.navigateBack({
+					delta: 1
+				})
+			},
+			ChooseImage() {
+				uni.chooseImage({
+					count: 4, //默认9
+					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+					sourceType: ['album'], //从相册选择
+					success: (res) => {
+						if (this.imgList.length != 0) {
+							this.imgList = this.imgList.concat(res.tempFilePaths)
+						} else {
+							this.imgList = res.tempFilePaths
+						}
+					}
+				});
+			},
+			ViewImage(e) {
+				uni.previewImage({
+					urls: this.imgList,
+					current: e.currentTarget.dataset.url
+				});
+			},
+			DelImg(e) {
+				uni.showModal({
+					title: '删除照片',
+					content: '确定要删除这张照片吗?',
+					cancelText: '不是',
+					confirmColor: '#ff0004',
+					confirmText: '是',
+					success: res => {
+						if (res.confirm) {
+							this.imgList.splice(e.currentTarget.dataset.index, 1)
+						}
+					}
+				})
+			},
+
+			onUploadFeedback(e) {
+				console.log(e.detail.value, this.imgList);
+				if(e.detail.value.problemDescription.length <= 10){
+					uni.showModal({
+						title:'提示',
+						content: "请填写不少于10个字的问题内容!",
+						showCancel: false
+					});
+					return;
+				}
+				if(this.imgList.length == 0){
+					uni.showModal({
+						title:'提示',
+						content: "至少选择一张反馈问题的截图照片!",
+						showCancel: false
+					});
+					return;
+				}
+				uni.showLoading({
+					title: '上传中...',
+					mask: true
+				});
+				
+				let files = this.imgList.map((value, index) => {
+					return {
+						name: 'images' + index,
+						uri: value
+					};
+				});
+				console.log("files:",files);
+				reqUtil.reqUploadFiles(config.URL.UPLOADFEEDBACK, e.detail.value, files)
+					.then(res => {
+						uni.hideLoading();
+						this.imgList = [];
+						console.log(res)
+						if(res.code ==0){
+							uni.showModal({
+								content: '成功',
+								showCancel: false
+							});
+						}else{
+							uni.showModal({
+								title:'上传失败',
+								content: res.msg,
+								showCancel: false
+							});
+						}
+					}, e => {
+						console.log(e);
+						uni.hideLoading();
+					});
+			}
+		}
+	}
+</script>
+
+<style>
+	page {
+		background-color: #FFFFFF;
+	}
+
+	.feedback-textarea {
+		/* border: solid 1px red; */
+		background-color: #F6F6F6;
+		width: 100%;
+		border-radius: 20rpx;
+		padding: 50rpx;
+	}
+
+	.feedback-placeholder {
+		color: #BEBEBE;
+		font-size: 14px;
+	}
+
+	.feedback-upload-image {
+		background-color: #F6F6F6;
+		width: 100%;
+		border-radius: 20rpx;
+		padding: 20rpx;
+	}
+
+	.feedback-title {
+		font-size: 14px;
+		color: #7B7B7B;
+	}
+</style>

+ 19 - 0
pages/personal-page/devices-hardware/devices-hardware.vue

@@ -184,6 +184,25 @@
 				//就判断一下是否
 				//测试
 				// mac="BB:34:24:22:77:88";
+				// mac="较è¾";
+				//判断mac地址是否是合理的格式
+				var tempMacRegExp = /[A-Fa-f0-9]{2}:[A-Fa-f0-9]{2}:[A-Fa-f0-9]{2}:[A-Fa-f0-9]{2}:[A-Fa-f0-9]{2}:[A-Fa-f0-9]{2}/;
+				if (!tempMacRegExp.test(mac))
+				{
+					uni.hideToast();
+					uni.showModal({
+						title: '验证信息',
+						content:'获取Mac地址失败,请重新连接。'
+					})
+					//关闭当前连接
+					_self.onOnlyCloseBLEConnection({
+						getSuccess: () => {
+							_self.currentItem = null;
+							_self.saveObj = null;
+						}
+					});
+				    return;
+				}
 
 				reqUtil.requestData(config.URL.BLEFINDHASBIND, {
 					mac: mac,

+ 2 - 2
pages/personal-page/personal/personal.vue

@@ -259,7 +259,7 @@
 						</view>
 
 						<!-- 游戏推荐 -->
-						<view class="card-view" v-if="versionCodeState&&versionCodeState.showGame && gameList.length !== 0">
+						<view class="card-view" v-if="cIndex != -1 && versionCodeState&&versionCodeState.showGame && gameList.length !== 0">
 							<view class="text-left padding margin-xs flex justify-between">
 								<text class="text-black text-15px margin-left">游戏推荐</text>
 								<view data-type="game" @tap="onNavToGameMore" class="flex text-center justify-center align-center margin-right">
@@ -292,7 +292,7 @@
 						
 						<!-- <keyboard-listener @keydown="onKeyDown"></keyboard-listener> -->
 						<!-- 视频推荐 -->
-						<view class="card-view" v-if="versionCodeState&&versionCodeState.showVideo && videoList.length !== 0">
+						<view class="card-view" v-if="cIndex != -1 && versionCodeState&&versionCodeState.showVideo && videoList.length !== 0">
 							<view class="text-left padding margin-xs flex justify-between">
 								<text class="text-black text-15px margin-left">视频推荐</text>
 								<view data-type="video" @tap="onNavToGameMore" class="flex text-center justify-center align-center margin-right">

BIN
static/feedback@2x.png


+ 34 - 1
util/util-js/requstUtil.js

@@ -61,7 +61,40 @@ function reqUpload(url, params,filePath) {
 	});
 }
 
+
+function reqUploadFiles(url, params,files) {
+	console.log("reqUploadFiles",files,params);
+	return new Promise((resolve, reject) => {
+		uni.uploadFile({
+			url: url, 
+			header:{
+				"token": uni.getStorageSync('token') ? `${uni.getStorageSync('token')}` : '',
+				"platform": uni.getStorageSync('platform') || uni.getStorageSync('platform') === 0 ? `${uni.getStorageSync('platform')}` : 2
+			},
+			files: files,
+			name: 'files',
+			formData: params,
+			method:"POST",
+			success: (uploadFileRes) => {
+				console.log(files,"上传数据后",uploadFileRes);
+				if (uploadFileRes.statusCode == 200) {
+					resolve(JSON.parse(uploadFileRes.data));
+				} else {
+					console.error("Error:", uploadFileRes)
+					reject("error")
+				}
+			},
+			fail: function(e) {
+				console.error("Failed:", e)
+				reject(e);
+			}
+		})
+		
+	});
+}
+
 export default {
 	requestData,
-	reqUpload
+	reqUpload,
+	reqUploadFiles
 }

+ 1 - 1
util/util-js/store.js

@@ -202,7 +202,7 @@ const store = new Vuex.Store({
 		platform: '', // 平台
 		appName: '',
 		version: '1.6.3', //软件版本
-		versionCode: '',
+		versionCode: '21030101',
 		showEndTime: config.endTime, //游戏显示时间字段,后台返回对应此时间之前的数据
 
 		//现在游戏显示在对应的平台