소스 검색

no message

zpj 2 년 전
부모
커밋
0b87349970
16개의 변경된 파일과 50개의 추가작업 그리고 268개의 파일을 삭제
  1. 2 2
      .env.dev.js
  2. 1 6
      .env.js
  3. 2 2
      .env.prod.js
  4. 4 5
      App.vue
  5. 0 127
      components/PreviewImage/index.vue
  6. 0 60
      components/en-utils/en-price/en-price.vue
  7. 1 1
      index.html
  8. 2 0
      main.js
  9. 5 5
      manifest.json
  10. 1 1
      package-lock.json
  11. 9 9
      package.json
  12. 4 35
      pages/index/index.vue
  13. 14 5
      pages/login/index.vue
  14. 0 5
      service/ajax.js
  15. 2 2
      service/router.js
  16. 3 3
      service/tools.js

+ 2 - 2
.env.dev.js

@@ -1,6 +1,6 @@
 const config = {
-	baseUrl: 'testapi.jhcs888.com',
-	socketUrl: 'testapi.jhcs888.com',
+	baseUrl: '',
+	socketUrl: '',
     appName:'开发环境'
 }
 module.exports = config;

+ 1 - 6
.env.js

@@ -1,6 +1,6 @@
 let nodeEnv = process.env.NODE_ENV;
 let ENV_CONFIG = null;
-console.log(nodeEnv)
+
 if (nodeEnv === 'development') {
     //开发环境
     ENV_CONFIG = require('.env.dev.js');
@@ -14,9 +14,4 @@ if (ENV_CONFIG !== null) {
     for (let key in ENV_CONFIG) {
         process.uniEnv[key] = ENV_CONFIG[key];
     }
-    // #ifdef H5
-    if (nodeEnv !== 'development') {
-        process.uniEnv.baseUrl = window.location.hostname;
-    }
-    //#endif
 }

+ 2 - 2
.env.prod.js

@@ -1,6 +1,6 @@
 const config = {
-    baseUrl: 'testapi.jhcs888.com',
-    socketUrl: 'testapi.jhcs888.com',
+    baseUrl: '',
+    socketUrl: '',
     appName:'正式环境'
 }
 module.exports = config;

+ 4 - 5
App.vue

@@ -1,13 +1,13 @@
 <script>
 export default {
   onLaunch: function () {
-    console.log("App Launch");
+    // console.log("App Launch");
   },
   onShow: function () {
-    console.log("App Show");
+    // console.log("App Show");
   },
   onHide: function () {
-    console.log("App Hide");
+    // console.log("App Hide");
   },
 };
 </script>
@@ -15,8 +15,7 @@ export default {
 <style>
 /*每个页面公共css */
 @import "./common/css/common";
-/* icon */
-@import "./common/font/iconfont";
+
 
 checkbox .wx-checkbox-input {
   border-radius: 50% !important;

+ 0 - 127
components/PreviewImage/index.vue

@@ -1,127 +0,0 @@
-<template>
-  <view>
-    <uni-popup ref="popup" type="center">
-      <view class="popup-container" @click="close">
-
-        <swiper
-          class="swiper"
-          :current="current"
-          :duration="500"
-          @change="swiperChange"
-          @click.stop
-        >
-
-          <swiper-item
-            class="imgs-item"
-            v-for="(item, index) in imgs"
-            :key="index"
-          >
-            <movable-area scale-area class="movable-data">
-            <movable-view
-                class="movable-item"
-                direction="all"
-                :inertia="true"
-                :scale="true"
-                scale-min="1"
-                scale-max="4"
-            >
-              <image :src="item.img" mode="aspectFit" class="img"  />
-            </movable-view>
-            </movable-area>
-          </swiper-item>
-
-        </swiper>
-
-        <view class="count">{{ count }}/{{ imgs.length }}</view>
-      </view>
-    </uni-popup>
-  </view>
-</template>
-
-<script>
-export default {
-  name: "PreviewImage",
-  props: {
-    imgs: {
-      type: Array,
-    },
-    current: {
-      type: Number,
-      default: 0,
-    },
-  },
-  data() {
-    return {
-      count: 1,
-    };
-  },
-
-  methods: {
-    swiperChange(e) {
-      this.count = e.detail.current + 1;
-    },
-    open(index) {
-      this.count = index + 1;
-      this.$refs.popup.open();
-    },
-    close() {
-      this.$refs.popup.close();
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.popup-container {
-  position: relative;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  width: 100vw;
-  height: 100vh;
-  background-color: rgba(0, 0, 0, 0.5);
-  color: #fff;
-
-  .count {
-    position: absolute;
-    bottom: 192px;
-    right: 10px;
-    width: 80px;
-    height: 30px;
-    color: #fff;
-    background-color: rgba(0, 0, 0, 0.5);
-    border-radius: 30px;
-    text-align: center;
-    line-height: 30px;
-  }
-}
-.swiper {
-  width: 100%;
-  height: 450px !important;
-}
-.imgs-item {
-  height: 100%;
-  .movable-data{
-    width: 100%;
-    height: 100%;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    .movable-item{
-      height: 100%;
-      width: 100%;
-      position:fixed;
-      overflow: hidden;
-      .img {
-        width: 100%;
-        height: 100%;
-        background-color: rgb(238, 238, 238);
-      }
-    }
-
-
-
-  }
-
-}
-</style>

+ 0 - 60
components/en-utils/en-price/en-price.vue

@@ -1,60 +0,0 @@
-<template>
-  <view>
-    <view class="item-price">
-      <text class="item-current-price">¥<text class="price-integer">{{ integer }}</text>.<text>{{ decimal }}</text></text>
-      <text class="item-original-price" v-show="originalPrice!==''">{{ originalPrice }}</text>
-    </view>
-  </view>
-</template>
-
-<script>
-export default {
-  name: "en-price",
-  props: {
-    'currentPrice': {
-      default: ''
-    },
-    'originalPrice': {
-      default: ''
-    }
-  },
-  data() {
-    return {
-      integer: 0,
-      decimal: 0,
-    }
-  },
-  mounted() {
-    if (this.currentPrice !== '') {
-      let currentPrice = this.currentPrice * 1
-      this.integer = Math.trunc(currentPrice)
-      currentPrice = (currentPrice.toFixed(2)) + ''
-      this.decimal = currentPrice.substring((currentPrice.length) - 2)
-    }
-  },
-  methods: {}
-}
-</script>
-
-<style scoped lang="scss">
-.item-price {
-  .item-current-price {
-    color: #ED301D;
-    font-size: 24rpx;
-    text{
-      color: #ED301D;
-      font-size: 24rpx;
-    }
-    .price-integer{
-      font-size: 40rpx;
-    }
-  }
-
-  .item-original-price {
-    margin-left: 12rpx;
-    color: #999999;
-    font-size: 24rpx;
-    text-decoration: line-through;
-  }
-}
-</style>

+ 1 - 1
index.html

@@ -17,7 +17,7 @@
     <!--app-html-->
   </div>
   <script type="module" src="/main.js"></script>
-  <script type="module" src="/static/js/jwxwork-1.0.0.js"></script>
+  <!-- <script type="module" src="/static/js/jwxwork-1.0.0.js"></script> -->
 </body>
 
 </html>

+ 2 - 0
main.js

@@ -6,6 +6,8 @@ import {
 	RouterMount
 } from './service/router.js' //路径换成自己的
 Vue.use(router)
+
+
 // #ifndef VUE3
 import Vue from 'vue'
 import store from './store'

+ 5 - 5
manifest.json

@@ -1,8 +1,8 @@
 {
-    "name" : "大连中山万汇",
-    "appid" : "__UNI__E870E93",
+    "name" : "学校",
+    "appid" : "__UNI__1578510",
     "description" : "",
-    "versionName" : "1.0.13",
+    "versionName" : "1.0.1",
     "versionCode" : 101,
     "transformPx" : false,
     /* 5+App特有相关 */
@@ -50,7 +50,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wxe041e2fba8e6599f",
+        "appid" : "wx3530a27aa802e153",
         "setting" : {
             "urlCheck" : false,
             "minified" : true
@@ -75,7 +75,7 @@
             "https" : false,
             "proxy" : {
                 "/api" : {
-                    "target" : "https://test-api.wealfavor.cn/",
+                    "target" : "",
                     "changeOrigin" : true,
                     "secure" : false,
                     "pathRewrite" : {

+ 1 - 1
package-lock.json

@@ -1,5 +1,5 @@
 {
-  "name": "wh-wap",
+  "name": "school_webUser",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {

+ 9 - 9
package.json

@@ -1,15 +1,15 @@
 {
   "dependencies": {
-    "js-base64": "^3.7.2",
-    "jweixin-module": "^1.2.0",
-    "uni-read-pages": "^1.0.5",
-    "uni-simple-router": "^2.0.7",
-    "uploading-oss": "^1.0.3",
-    "wecomjsdk": "^1.0.2"
+    "js-base64": "3.7.2",
+    "jweixin-module": "1.2.0",
+    "uni-read-pages": "1.0.5",
+    "uni-simple-router": "2.0.7",
+    "uploading-oss": "1.0.3",
+    "wecomjsdk": "1.0.2"
   },
   "devDependencies": {
-    "@types/html5plus": "^1.0.2",
-    "@types/uni-app": "^1.4.4",
-    "vue-waterfall-easy": "^2.4.4"
+    "@types/html5plus": "1.0.2",
+    "@types/uni-app": "1.4.4",
+    "vue-waterfall-easy": "2.4.4"
   }
 }

+ 4 - 35
pages/index/index.vue

@@ -1,15 +1,11 @@
 <template>
-	<view class="box-data" @click="chooseMessageFile">
-    测试环境开始
+	<view class="box-data">
+		首页
 	</view>
 
 </template>
 <script>
 
-
-	import tools from "@/service/tools";
-  import jWeixin from "wecomjsdk"
-  import wxJs from "jweixin-module"
   export default {
 		components: {
 
@@ -25,37 +21,10 @@
 		},
 
 		mounted() {
-      tools.wxInitialize(['chooseImage'])
-      tools.wxAgentInitialize(['chooseMessageFile','invoke'])
+      
 		},
 		methods: {
-      chooseMessageFile(){
-        console.log('chooseMessageFile:事件开始触发')
-        wxJs.chooseImage({
-          count: 1, // 默认9
-          sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
-          sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
-          defaultCameraMode: "batch", //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
-          isSaveToAlbum: 1, //整型值,0表示拍照时不保存到系统相册,1表示自动保存,默认值是1
-          success: function (res) {
-            let localIds = res.localIds; // 返回选定照片的本地ID列表,
-            console.log(localIds)
-            // andriod中localId可以作为img标签的src属性显示图片;
-            // iOS应当使用 getLocalImgData 获取图片base64数据,从而用于img标签的显示(在img标签内使用 wx.chooseImage 的 localid 显示可能会不成功)
-          }
-        });
-        // jWeixin.invoke('chooseMessageFile', {
-        //   count: 10,
-        //   type: 'image',
-        // }, function(res) {
-        //   console.log(res)
-        //   // 这里是回调函数
-        //   if (res.err_msg == "chooseMessageFile:ok"){
-        //     const tempFiles = res.tempFiles
-        //   }
-        // });
-      }
-
+			
 		},
 	}
 </script>

+ 14 - 5
pages/login/index.vue

@@ -7,10 +7,9 @@
   </view>
 </template>
 <script>
+  import tools from '@/service/tools.js';
+	
   export default {
-    components: {
-
-    },
     data() {
       return {
 
@@ -21,8 +20,18 @@
     },
     methods: {
       logIn() {
-        uni.redirectTo({
-          url: '/pages/index/index'
+        uni.login({
+        	provider:'weixin',
+			success:(res)=>{
+				if(res.errMsg === 'login:ok'){
+					console.log(res);
+				}else{
+					tools.error('失败')
+				}
+			},
+			fail:(res)=>{
+				tools.error('失败')
+			}
         })
       },
     },

+ 0 - 5
service/ajax.js

@@ -1,8 +1,5 @@
 import tools from "@/service/tools";
 let BASE_URL =''
-//#ifndef H5
-BASE_URL ='https://' + process.uniEnv.baseUrl;
-//#endif
 
 
 /**
@@ -32,8 +29,6 @@ export const request = (url, method, data, show = false) => {
       },
       success: (res) => {
         if (res.statusCode === 200) {
-          // console.log('应答信息-----------------------')
-          // console.log(res.data); // 控制台显示数据信息
           tools.hideLoading();
           if (res.data.code * 1 === 401) {
             uni.clearStorageSync()

+ 2 - 2
service/router.js

@@ -25,10 +25,10 @@ router.beforeEach((to, from, next) => {
     }else {
         userToken = uni.getStorageSync('token')
     }
-    console.log('userToken:'+userToken)
+    
 
     if(whiteList.indexOf(to.path)<0 && !userToken){
-        tools.wxLogin()
+        next('/pages/login/index')
     }else {
         next();
     }

+ 3 - 3
service/tools.js

@@ -1,9 +1,9 @@
-import wxJs from "jweixin-module"
-import jWeixin from "wecomjsdk"
+// import wxJs from "jweixin-module"
+// import jWeixin from "wecomjsdk"
 import {
     Base64
 } from '@/js_sdk/js-base64/base64';
-import {getWxJsSign} from "@/api/weChat";
+// import {getWxJsSign} from "@/api/weChat";
 
 let tools = {}
 /**