Przeglądaj źródła

初始化版本1.0

wzh 2 lat temu
rodzic
commit
c9db2e15fb

+ 0 - 52
README.md

@@ -1,52 +0,0 @@
-<p align="center">
-	<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-43e3941654fa3054c9684bf53d1b1d356a1.png">
-</p>
-<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v1.1.0</h1>
-<h4 align="center">基于UniApp开发的轻量级移动端框架</h4>
-<p align="center">
-	<a href="https://gitee.com/y_project/RuoYi-App/stargazers"><img src="https://gitee.com/y_project/RuoYi-App/badge/star.svg?theme=dark"></a>
-	<a href="https://gitee.com/y_project/RuoYi-App"><img src="https://img.shields.io/badge/RuoYi-v1.1.0-brightgreen.svg"></a>
-	<a href="https://gitee.com/y_project/RuoYi-App/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
-</p>
-
-## 平台简介
-
-RuoYi App 移动解决方案,采用uniapp框架,一份代码多终端适配,同时支持APP、小程序、H5!实现了与[RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue)、[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud)完美对接的移动解决方案!目前已经实现登录、我的、工作台、编辑资料、头像修改、密码修改、常见问题、关于我们等基础功能。
-
-* 配套后端代码仓库地址[RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue) 或 [RuoYi-Cloud](https://github.com/yangzongzhuan/RuoYi-Cloud) 版本。
-* 应用框架基于[uniapp](https://uniapp.dcloud.net.cn/),支持小程序、H5、Android和IOS。
-* 前端组件采用[uni-ui](https://github.com/dcloudio/uni-ui),全端兼容的高性能UI框架。
-* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)&nbsp;&nbsp;
-* 阿里云优惠券:[点我领取](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)&nbsp;&nbsp;
-
-
-## 技术文档
-
-- 官网网站:[http://ruoyi.vip](http://ruoyi.vip)
-- 文档地址:[http://doc.ruoyi.vip](http://doc.ruoyi.vip)
-- H5页体验:[http://h5.ruoyi.vip](http://h5.ruoyi.vip)
-- QQ交流群: ①133713780
-- 小程序体验
-
-<img src="https://oscimg.oschina.net/oscnet/up-26c76dc90b92acdbd9ac8cd5252f07c8ad9.jpg" alt="小程序演示"/>
- 
-
-## 演示图
-
-<table>
-    <tr>
-        <td><img src="https://oscimg.oschina.net/oscnet/up-3ea20e447ac621a161e395fb53ccc683d84.png"/></td>
-        <td><img src="https://oscimg.oschina.net/oscnet/up-a6f23cf9a371a30165e135eff6d9ae89a9d.png"/></td>
-		<td><img src="https://oscimg.oschina.net/oscnet/up-ff5f62016bf6624c1ff27eee57499dccd44.png"/></td>
-    </tr>
-	<tr>
-        <td><img src="https://oscimg.oschina.net/oscnet/up-b9a582fdb26ec69d407fabd044d2c8494df.png"/></td>
-        <td><img src="https://oscimg.oschina.net/oscnet/up-96427ee08fca29d77934cfc8d1b1a637cef.png"/></td>
-		<td><img src="https://oscimg.oschina.net/oscnet/up-5fdadc582d24cccd7727030d397b63185a3.png"/></td>
-    </tr>
-	<tr>
-        <td><img src="https://oscimg.oschina.net/oscnet/up-0a36797b6bcc50c36d40c3c782665b89efc.png"/></td>
-        <td><img src="https://oscimg.oschina.net/oscnet/up-d77995cc00687cedd00d5ac7d68a07ea276.png"/></td>
-		<td><img src="https://oscimg.oschina.net/oscnet/up-fa8f5ab20becf59b4b38c1b92a9989e7109.png"/></td>
-    </tr>
-</table>

+ 3 - 3
manifest.json

@@ -1,6 +1,6 @@
 {
-    "name" : "若依移动端",
-    "appid" : "__UNI__25A9D80",
+    "name" : "家用版",
+    "appid" : "__UNI__60E8019",
     "description" : "",
     "versionName" : "1.1.0",
     "versionCode" : "100",
@@ -60,7 +60,7 @@
             "port" : 9090,
             "https" : false
         },
-        "title" : "RuoYi-App",
+        "title" : "充电助理",
         "router" : {
             "mode" : "hash",
             "base" : "./"

+ 13 - 3
pages.json

@@ -105,7 +105,16 @@
       }
 
     }
-  ],
+      ,{
+            "path" : "pages/weitiandi/device/scan",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "扫码",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+    ],
   "tabBar": {
     "color": "#000000",
     "selectedColor": "#000000",
@@ -126,7 +135,8 @@
   },
   "globalStyle": {
     "navigationBarTextStyle": "black",
-    "navigationBarTitleText": "RuoYi",
-    "navigationBarBackgroundColor": "rgb(249,252,255)"
+    "navigationBarTitleText": "充电助手",
+    "navigationBarBackgroundColor": "rgb(249,252,255)",
+    "navigationStyle":"custom"
   }
 }

+ 43 - 16
pages/index.vue

@@ -17,7 +17,7 @@
         <image :src = "imgUrl+'/index/bluetooth.png'"/>
       </view>
 
-      <view class="item" @click="scan2">
+      <view class="item" @click="scan">
         <image :src = "imgUrl+'/index/scan.png'"/>
       </view>
     </view>
@@ -45,23 +45,50 @@
     },
     onLoad: function() {
     },
+    onShow(){
+      this.readScanResult();
+    },
     methods:{
+      readScanResult(){
+        let self = this;
+        uni.$on("scanResult", data => {
+          getDeviceInfoFromQrcode(data).then(res=>{
+            if(res.data != null){
+              let imei = res.data.imei;
+              let ccid = res.data.ccid;
+              uni.navigateTo({
+                url: '/pages/weitiandi/device/index?id='+imei+'&ccid='+ccid
+              });
+            }
+          });
+          uni.$off('scanResult');
+        })
+      },
       scan(){
-        uni.scanCode({
-          success: function (res) {
-            console.log('条码类型:' + res.scanType);
-            console.log('条码内容:' + res.result);
-            getDeviceInfoFromQrcode(res.result).then(res=>{
-              if(res.data != null){
-                let imei = res.data.imei;
-                let ccid = res.data.ccid;
-                uni.navigateTo({
-                  url: '/pages/weitiandi/device/index?id='+imei+'&ccid='+ccid
-                });
-              }
-            });
-          }
-        });
+        if(window.location.href.indexOf("localhost") != -1){
+          this.scan2();
+        }else{
+          uni.navigateTo({
+            url: '/pages/weitiandi/device/scan'
+          });
+        }
+
+
+        // uni.scanCode({
+        //   success: function (res) {
+        //     console.log('条码类型:' + res.scanType);
+        //     console.log('条码内容:' + res.result);
+        //     getDeviceInfoFromQrcode(res.result).then(res=>{
+        //       if(res.data != null){
+        //         let imei = res.data.imei;
+        //         let ccid = res.data.ccid;
+        //         uni.navigateTo({
+        //           url: '/pages/weitiandi/device/index?id='+imei+'&ccid='+ccid
+        //         });
+        //       }
+        //     });
+        //   }
+        // });
       },
       scan2(){
         getDeviceInfoFromQrcode("http://wetiandi.com/app/index.php?i=1&j=1&c=entry&m=wdl_shopping&do=wepay&sn=GD1B342399").then(res=>{

+ 2 - 2
pages/login.vue

@@ -14,7 +14,7 @@
 		</view>
 	</view>
 	<!-- 登录表单 -->
-    <view class="login-form-content" style="z-index: 9999;position: relative;"  v-show="isLogin">
+    <view class="login-form-content" style="z-index: 99;position: relative;"  v-show="isLogin">
       <view class="input-item flex align-center">
         <!-- <view class="iconfont icon-user icon"></view> -->
 	   <uni-row>
@@ -49,7 +49,7 @@
         <input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
         <view class="login-code"> <image :src="codeUrl" @click="getCode" class="login-code-img"></image></view  >
       </view> -->
-      <view class="action-btn" style="z-index: 9999;position: relative;">
+      <view class="action-btn" style="z-index: 99;position: relative;">
         <button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">立即登录</button>
       </view>
     </view>

+ 2 - 1
pages/weitiandi/device/index.vue

@@ -222,7 +222,7 @@ export default {
         if(port_first_status == 1){
           this.$modal.msg("请先将充电枪插入后再点击充电");
         }
-        if(port_first_status == 1){
+        if(port_first_status == 5){
           this.$modal.confirm("确认开始充电么?").then(res=>{
             this.startCharge();
           })
@@ -324,6 +324,7 @@ export default {
 
 .header {
   position: relative;
+  margin-top:4vw;
 }
 
 .header-status-desc {

+ 40 - 0
pages/weitiandi/device/scan.vue

@@ -0,0 +1,40 @@
+<template>
+	<view>
+    <mumu-get-qrcode @success='qrcodeSucess' @error="qrcodeError" ></mumu-get-qrcode>
+	</view>
+</template>
+
+<script>
+import mumuGetQrcode from '@/uni_modules/mumu-getQrcode/components/mumu-getQrcode/mumu-getQrcode.vue'
+
+	export default {
+    components: {
+      mumuGetQrcode
+    },
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+      qrcodeSucess(data) {
+        uni.$emit("scanResult",data);
+        uni.navigateBack({})
+      },
+      qrcodeError(err) {
+        console.log(err)
+        uni.showModal({
+          title: '摄像头授权失败',
+          content: '摄像头授权失败,请检测当前浏览器是否有摄像头权限。',
+          success: () => {
+            uni.navigateBack({})
+          }
+        })
+      },
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 1 - 0
pages/weitiandi/device/setting.vue

@@ -190,6 +190,7 @@ export default {
       let self = this;
       this.$modal.loading("保存中。。");
       setCurrent({deviceId: deviceId,ccid:this.ccid},currenValue).then(res => {
+        this.$modal.showToast("保存成功");
           setTimeout(function(){
             self.sendMainboardCmd();
           },1000)

+ 1 - 1
static/index.html

@@ -4,7 +4,7 @@
 		<meta charset="utf-8">
 		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
 		  <meta name="renderer" content="webkit">
-		<title><%= htmlWebpackPlugin.options.title %></title>
+		<title>充电助理</title>
     <link rel="shortcut icon" type="image/x-icon" href="<%= BASE_URL %>static/favicon.ico">
 		<script>
 			var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))

Plik diff jest za duży
+ 9 - 0
utils/eruda.js


+ 1 - 1
utils/request.js

@@ -21,7 +21,7 @@ const request = config => {
     config.url = url
   }
   return new Promise((resolve, reject) => {
-    uni.showLoading();
+    uni.showLoading({title:"正在加载"});
     uni.request({
         method: config.method || 'get',
         timeout: config.timeout ||  timeout,