Browse Source

bug修改

郭宇琦 2 days ago
parent
commit
a27cbb47c7
3 changed files with 23 additions and 8 deletions
  1. 4 1
      common/http.js
  2. 4 6
      pages/batteryRecord/batteryRecord.vue
  3. 15 1
      pages/my/set.vue

+ 4 - 1
common/http.js

@@ -125,7 +125,10 @@ function postRequest(url, data, successCallBack, failCallBack) {
 				return
 			} else {
 				successCallBack(res);
-				// uni.showToast({ title: res.data.msg, icon: 'none' })
+				if(res.data.msg){
+					uni.showToast({ title: res.data.msg, icon: 'none' })
+				}
+				
 				return
 			}
 			if (_checkTokenValid(res)) {

+ 4 - 6
pages/batteryRecord/batteryRecord.vue

@@ -7,7 +7,6 @@
 					src="https://qiniu.bms16.com/Fqs6TrEmcdT7QNEdKWs9Hir2cacO" alt="">
 			</view>
 		</view>
-		
 		<view v-for="(item,index) of list" :key="index" class="batteryList">
 			<view class="header">
 				<view v-if="item.status == 1" class="h5">开始换电</view>
@@ -16,7 +15,7 @@
 				<view v-if="item.status == 4" class="h5">换电失败</view>
 				<view v-if="item.status == 5" class="h5">部分成功</view>
 				<view v-if="item.status == 0" class="h5">未知</view>
-				<view class="time">{{dayjsFn(item.ctime)}}</view>
+				<view class="time">{{item.ctime}}</view>
 			</view>
 			<view class="dl">
 				<view class="dt">换电单号</view>
@@ -46,8 +45,6 @@
 
 <script>
 	import dayjs from 'dayjs'
-	import duration from 'dayjs/plugin/duration'
-	dayjs.extend(duration);
 	var config_gyq = require('../../common/config_gyq.js');
 	var request = require('../../common/request');
 	var common = require('../../common/common.js');
@@ -65,7 +62,8 @@
 		},
 		methods: {
 			dayjsFn(time){
-				return dayjs(time).format('YYYY-MM-DD HH:mm:ss')
+				console.log(time)
+				return dayjs(time * 1000).format('YYYY-MM-DD HH:mm:ss')
 			},
 			srcFn(url){
 				uni.navigateTo({
@@ -94,7 +92,7 @@
 						item.btn_battery = item.btn_battery ? item.btn_battery.join(',') : []
 						item.bor_battery = item.bor_battery ? item.bor_battery.join(',') : []
 						
-						item.ctime = dayjs(item.ctime * 1000).format('YYYY-MM-DD hh:mm:ss')
+						item.ctime = dayjs(item.ctime * 1000).format('YYYY-MM-DD HH:mm:ss')
 					})
 				}
 

+ 15 - 1
pages/my/set.vue

@@ -9,8 +9,12 @@
 					<view v-if="item.textProp == 'registrationTime' && userInfo.ctime">
 						{{ formatTimestamp(userInfo.ctime) }}
 					</view>
+					<view v-if="item.textProp == 'version'">
+						{{"V " + app_version}}
+					</view>
 					<input class="inp" @input="handleInput" @blur="inpfn" maxlength="22"
 						v-if="item.textProp == 'nickname'" v-model="userInfo[item.textProp]" type="text" />
+						
 					<block v-else>
 						{{ userInfo[item.textProp] || '' }}
 					</block>
@@ -39,6 +43,7 @@
 				QINIU_URL,
 				defaultHeadImg,
 				userInfo: {},
+				app_version: '',
 				list: [{
 						title: '昵称',
 						url: '',
@@ -56,7 +61,8 @@
 					{
 						title: '关于我们',
 						url: '/pages/aboutMy/aboutMy',
-						textProp: 'version'
+						textProp: 'version',
+						hideArrow: true
 					},
 					{
 						title: '隐私协议',
@@ -69,6 +75,14 @@
 				]
 			}
 		},
+		onLoad() {
+			let getAppBaseInfo = uni.getAppBaseInfo()
+			this.setData({
+				// app_logo: appConfig.app_logo,
+				app_version: getAppBaseInfo.appVersion || '',
+				appName: getAppBaseInfo.appName || ''
+			})
+		},
 		onShow() {
 			const user_token = storage.getUserToken()
 			user_token && this.loadUserInfo()