tremble 2 лет назад
Родитель
Сommit
3be6cd6406
86 измененных файлов с 856 добавлено и 0 удалено
  1. 31 0
      miniProgram/.eslintrc.js
  2. 82 0
      miniProgram/app.js
  3. 15 0
      miniProgram/app.json
  4. 2 0
      miniProgram/app.wxss
  5. 111 0
      miniProgram/components/authorize/index.js
  6. 4 0
      miniProgram/components/authorize/index.json
  7. 39 0
      miniProgram/components/authorize/index.less
  8. 14 0
      miniProgram/components/authorize/index.wxml
  9. 32 0
      miniProgram/components/authorize/index.wxss
  10. 68 0
      miniProgram/pages/index/index.js
  11. 5 0
      miniProgram/pages/index/index.json
  12. 64 0
      miniProgram/pages/index/index.less
  13. 16 0
      miniProgram/pages/index/index.wxml
  14. 61 0
      miniProgram/pages/index/index.wxss
  15. 73 0
      miniProgram/pages/webview/index.js
  16. 3 0
      miniProgram/pages/webview/index.json
  17. 1 0
      miniProgram/pages/webview/index.less
  18. 2 0
      miniProgram/pages/webview/index.wxml
  19. 1 0
      miniProgram/pages/webview/index.wxss
  20. 52 0
      miniProgram/project.config.json
  21. 22 0
      miniProgram/project.private.config.json
  22. 7 0
      miniProgram/sitemap.json
  23. 6 0
      miniProgram/styles/common.less
  24. 6 0
      miniProgram/styles/common.wxss
  25. 48 0
      miniProgram/utils/http.js
  26. 17 0
      miniProgram/utils/mixins.js
  27. 50 0
      miniProgram/utils/mixins_core.js
  28. 24 0
      miniProgram/utils/util.js
  29. 0 0
      web/.env
  30. 0 0
      web/README.md
  31. 0 0
      web/index.html
  32. 0 0
      web/manage.js
  33. 0 0
      web/package.json
  34. 0 0
      web/public/program/Build/Build1.data.unityweb
  35. 0 0
      web/public/program/Build/Build1.framework.js.unityweb
  36. 0 0
      web/public/program/Build/Build1.loader.js
  37. 0 0
      web/public/program/Build/Build1.wasm.unityweb
  38. 0 0
      web/public/program/Build/BuildTest.data.unityweb
  39. 0 0
      web/public/program/Build/BuildTest.framework.js.unityweb
  40. 0 0
      web/public/program/Build/BuildTest.loader.js
  41. 0 0
      web/public/program/Build/BuildTest.wasm.unityweb
  42. 0 0
      web/public/program/README.txt
  43. 0 0
      web/public/program/ServiceWorker.js
  44. 0 0
      web/public/program/TemplateData/favicon.ico
  45. 0 0
      web/public/program/TemplateData/icons/unity-logo-dark.png
  46. 0 0
      web/public/program/TemplateData/icons/unity-logo-light.png
  47. 0 0
      web/public/program/TemplateData/progress-bar-empty-dark.png
  48. 0 0
      web/public/program/TemplateData/progress-bar-empty-light.png
  49. 0 0
      web/public/program/TemplateData/progress-bar-full-dark.png
  50. 0 0
      web/public/program/TemplateData/progress-bar-full-light.png
  51. 0 0
      web/public/program/TemplateData/style.css
  52. 0 0
      web/public/program/TemplateData/unity-logo-dark.png
  53. 0 0
      web/public/program/TemplateData/unity-logo-light.png
  54. 0 0
      web/public/program/index copy.html
  55. 0 0
      web/public/program/index.html
  56. 0 0
      web/public/program/manifest.webmanifest
  57. 0 0
      web/public/vite.svg
  58. 0 0
      web/src/App.vue
  59. 0 0
      web/src/api/http.js
  60. 0 0
      web/src/assets/style/SourceHanSerifCN-Bold.otf
  61. 0 0
      web/src/assets/style/SourceHanSerifCN-Regular.otf
  62. 0 0
      web/src/assets/style/global.scss
  63. 0 0
      web/src/assets/style/my-reset.css
  64. 0 0
      web/src/assets/style/reset.css
  65. 0 0
      web/src/components/Integral-detail.vue
  66. 0 0
      web/src/components/Integraltoast.vue
  67. 0 0
      web/src/components/Introduce.vue
  68. 0 0
      web/src/components/Vmenu.vue
  69. 0 0
      web/src/config.js
  70. 0 0
      web/src/main.js
  71. 0 0
      web/src/plugin/dialog/Alert.vue
  72. 0 0
      web/src/plugin/dialog/Confirm.vue
  73. 0 0
      web/src/plugin/dialog/Dialog-content.vue
  74. 0 0
      web/src/plugin/dialog/Dialog.vue
  75. 0 0
      web/src/plugin/dialog/Toast.vue
  76. 0 0
      web/src/plugin/dialog/dialog.scss
  77. 0 0
      web/src/plugin/dialog/index.js
  78. 0 0
      web/src/router/index.js
  79. 0 0
      web/src/utils/componentHelper.js
  80. 0 0
      web/src/utils/index.js
  81. 0 0
      web/src/utils/zindex.js
  82. 0 0
      web/src/views/Courtyard.vue
  83. 0 0
      web/src/views/Editing.vue
  84. 0 0
      web/src/views/Integral.vue
  85. 0 0
      web/vite.config.js
  86. 0 0
      web/yarn.lock

+ 31 - 0
miniProgram/.eslintrc.js

@@ -0,0 +1,31 @@
+/*
+ * Eslint config file
+ * Documentation: https://eslint.org/docs/user-guide/configuring/
+ * Install the Eslint extension before using this feature.
+ */
+module.exports = {
+  env: {
+    es6: true,
+    browser: true,
+    node: true,
+  },
+  ecmaFeatures: {
+    modules: true,
+  },
+  parserOptions: {
+    ecmaVersion: 2018,
+    sourceType: 'module',
+  },
+  globals: {
+    wx: true,
+    App: true,
+    Page: true,
+    getCurrentPages: true,
+    getApp: true,
+    Component: true,
+    requirePlugin: true,
+    requireMiniProgram: true,
+  },
+  // extends: 'eslint:recommended',
+  rules: {},
+}

+ 82 - 0
miniProgram/app.js

@@ -0,0 +1,82 @@
+require('./utils/mixins_core')
+import fetchutil from './utils/http'
+
+
+// app.ts
+App({
+  globalData: {
+    userInfo: '',
+    hasAvatar: ''
+  },
+
+  watch(key, method) {
+    var obj = this.globalData;
+
+    //加个前缀生成隐藏变量,防止死循环发生
+    let ori = obj[key]; //obj[key]这个不能放在Object.defineProperty里
+    if (ori) { //处理已经声明的变量,绑定处理
+      method(ori);
+    }
+    Object.defineProperty(obj, key, {
+      configurable: true,
+      enumerable: true,
+      set: function (value) {
+        this['_' + key] = value;
+        method(value);
+      },
+      get: function () {
+        // 在其他界面调用key值的时候,这里就会执行。
+        if (typeof this['_' + key] == 'undefined') {
+          if (ori) {
+            //这里读取数据的时候隐藏变量和 globalData设置不一样,所以要做同步处理
+            this['_' + key] = ori;
+            return ori;
+          } else {
+            return undefined;
+          }
+        } else {
+          return this['_' + key];
+        }
+      }
+    })
+  },
+  
+  login() {
+    wx.login({
+      success: res => {
+        fetchutil.get(`api/wx/login/${res.code}`, {}, {}).then((response) => {
+          wx.setStorageSync('token', response.data.token)
+          this.globalData.userInfo = {
+            ...this.globalData.userInfo,
+            ...response.data.wxUser
+          }
+          this.globalData.hasAvatar = response.data.wxUser.avatarUrl
+          console.log(response);
+        })
+      },
+    })
+
+  },
+
+
+
+  onLaunch() {
+
+    let token = wx.getStorageSync('token')
+
+    if (token) {
+      fetchutil.get(`api/wx/checkToken`, {}, {}).then((response) => {
+        if (!response.data) {
+          this.login()
+        }
+      }).catch(() => {
+        // @ts-ignore
+        this.login()
+      })
+    } else {
+      // @ts-ignore
+      this.login()
+    }
+
+  },
+})

+ 15 - 0
miniProgram/app.json

@@ -0,0 +1,15 @@
+{
+  "pages": [
+    "pages/index/index",
+    "pages/webview/index"
+  ],
+  "window": {
+    "backgroundTextStyle": "light",
+    "navigationBarBackgroundColor": "#fff",
+    "navigationBarTitleText": "Weixin",
+    "navigationBarTextStyle": "black",
+    "pageOrientation": "landscape"
+  },
+  "style": "v2",
+  "sitemapLocation": "sitemap.json"
+}

+ 2 - 0
miniProgram/app.wxss

@@ -0,0 +1,2 @@
+/**app.wxss**/
+@import './styles/common.wxss';

+ 111 - 0
miniProgram/components/authorize/index.js

@@ -0,0 +1,111 @@
+// components/authorize/index.ts
+import fetchutil from '../../utils/http'
+
+var {
+  CDN_URL,
+  API_BASE_URL
+} = require('../../utils/util')
+
+const app = getApp()
+
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    inputNickName: '',
+    avatarUrl: `${CDN_URL}images/default.png`,
+    CDN_URL
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    bindKeyInput(e) {
+      console.log(e.detail.value);
+      this.setData({
+        inputNickName: e.detail.value
+      })
+    },
+    onChooseAvatar(e) {
+      const {
+        avatarUrl
+      } = e.detail
+      this.setData({
+        avatarUrl,
+      })
+    },
+    onCancel() {
+      this.triggerEvent('onCancel')
+    },
+    onComfirm() {
+      this.updateUserInfo(() => {
+        this.triggerEvent('onComfirm')
+      })
+    },
+
+    onChooseAvatar(e) {
+      const {
+        avatarUrl
+      } = e.detail
+
+      console.log(e);
+      let loginSessionKey = wx.getStorageSync("token");
+
+      wx.uploadFile({
+        filePath: avatarUrl,
+        name: 'file',
+        url: API_BASE_URL + 'api/cms/wxUser/upload',
+        header: {
+          token: loginSessionKey
+        },
+        formData: {
+          type: 'img'
+        },
+        success: (res) => {
+
+          let respon = JSON.parse(res.data)
+          this.setData({
+            avatarUrl: API_BASE_URL + (API_BASE_URL.length > 10 ? 'api' : '') + respon.data.filePath
+          })
+
+        },
+        fail: function (res) {
+          console.log(res); //发送失败回调,可以在这里了解失败原因
+        }
+      })
+
+
+    },
+
+
+    updateUserInfo(cb = () => {}) {
+
+      if (!this.data.avatarUrl || !this.data.inputNickName.trim()) {
+        wx.showToast({
+          title: '请补充完整信息~',
+          icon: 'error'
+        })
+        return
+      }
+
+      fetchutil.post(`api/cms/wxUser/update`, {
+        "avatarUrl": this.data.avatarUrl,
+        "nickName": this.data.inputNickName,
+      }, {}).then((res) => {
+        app.globalData.userInfo = res.data;
+        cb()
+      }).catch(() => {})
+    },
+
+
+  }
+})

+ 4 - 0
miniProgram/components/authorize/index.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 39 - 0
miniProgram/components/authorize/index.less

@@ -0,0 +1,39 @@
+/* components/authorize/index.wxss */
+.authcon {
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+
+  .authbody {
+    .avatar-wrapper {
+      width: 80rpx;
+      height: 80rpx;
+      padding: 0;
+
+      >image {
+        width: 100%;
+        height: 100%;
+      }
+    }
+
+    >input {
+      background: #ffffff;
+      margin-top: 20rpx;
+      padding: 6rpx 20rpx;
+      border-radius: 8rpx;
+    }
+
+    .btn-area {
+      display: flex;
+      width: 100%;
+      justify-content: space-around;
+      text-align: center;
+      margin-top: 20rpx;
+
+      >image {
+        width: 46%;
+      }
+    }
+  }
+}

+ 14 - 0
miniProgram/components/authorize/index.wxml

@@ -0,0 +1,14 @@
+<!--components/authorize/index.wxml-->
+<view class="authcon">
+  <view class="authbody">
+    <button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
+      <image mode="aspectFit" class="avatar" src="{{avatarUrl}}"></image>
+    </button> 
+    <input type="nickname" bindinput="bindKeyInput" value="{{inputNickName}}" maxlength="20" placeholder="请输入昵称" class="nameinput" />
+
+    <view class="btn-area">
+      <image bindtap="onCancel" src="{{CDN_URL}}images/btn_cancel.png" mode="widthFix"/>
+      <image bindtap="onComfirm" src="{{CDN_URL}}images/btn_concert.png" mode="widthFix"/>
+    </view>
+  </view>
+</view>

+ 32 - 0
miniProgram/components/authorize/index.wxss

@@ -0,0 +1,32 @@
+/* components/authorize/index.wxss */
+.authcon {
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+}
+.authcon .authbody .avatar-wrapper {
+  width: 80rpx;
+  height: 80rpx;
+  padding: 0;
+}
+.authcon .authbody .avatar-wrapper > image {
+  width: 100%;
+  height: 100%;
+}
+.authcon .authbody > input {
+  background: #ffffff;
+  margin-top: 20rpx;
+  padding: 6rpx 20rpx;
+  border-radius: 8rpx;
+}
+.authcon .authbody .btn-area {
+  display: flex;
+  width: 100%;
+  justify-content: space-between;
+  text-align: center;
+  margin-top: 20rpx;
+}
+.authcon .authbody .btn-area > image {
+  width: 48%;
+}

+ 68 - 0
miniProgram/pages/index/index.js

@@ -0,0 +1,68 @@
+// index.js
+// 获取应用实例
+const app = getApp()
+import fetchutil from '../../utils/http'
+var mixins = require('../../utils/mixins')
+var {
+  CDN_URL
+} = require('../../utils/util')
+
+
+Page({
+  mixins: [mixins],
+  data: {
+    CDN_URL,
+    isShowVideo: false,
+    isShowAuthorize: false
+  },
+
+  onLoad() {
+  },
+
+  onShow(){
+    this.getUserInfo()
+  },
+  tapAuthclose() {
+    this.setData({
+      isShowAuthorize: false
+    })
+  },
+  tapAuthComfirm() {
+    this.setData({
+      isShowAuthorize: false,
+      isShowVideo: true
+    })
+  },
+
+  onSkipButtonTap() {
+    this.setData({
+      isShowVideo: false
+    })
+    wx.navigateTo({
+      url: '/pages/webview/index',
+    })
+  },
+  onStart() {
+    console.log(app.globalData.userInfo);
+    let {
+      userInfo
+    } = app.globalData
+    if (!userInfo.avatarUrl || !userInfo.nickName) {
+      this.setData({
+        isShowAuthorize: true
+      })
+    } else {
+      this.setData({
+        isShowVideo: true
+      })
+    }
+  },
+
+
+  getUserInfo() {
+    fetchutil.get(`api/cms/wxUser/getUserInfo`, {}, {}).then((res) => {
+      app.globalData.userInfo = res.data
+    }).catch(() => {})
+  },
+
+})

+ 5 - 0
miniProgram/pages/index/index.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "authorize":"/components/authorize"
+  }
+}

+ 64 - 0
miniProgram/pages/index/index.less

@@ -0,0 +1,64 @@
+/**index.wxss**/
+.home{
+  width: 100%;
+  height: 100%;
+  position: relative;
+  background-size: cover;
+  background-position: right bottom;
+  .left{
+    position: absolute;
+    width: 36%;
+    left: 10%;
+    top: 50%;
+    transform: translateY(-50%);
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    >image{
+      width: 100%;
+      &:last-of-type{
+        width: 72%;
+      }
+    }
+  }
+}
+
+.video{
+  position: fixed;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+  z-index: 999;
+  >video{
+    width: 100%;
+    height: 100%;
+  }
+  .jump{
+    position: absolute;
+    top: 10rpx;
+    right: 20rpx;
+    z-index: 1000;
+    color: #fff;
+  }
+}
+
+.auth{
+  position: fixed;
+  left: 0;
+  top: 110%;
+  width: 100%;
+  height: 100%;
+  z-index: 999;
+  background-color: rgba(0, 0, 0, 0.5);
+  backdrop-filter: blur(10px);
+  pointer-events: none;
+  opacity: 0;
+}
+
+.auth_show{
+  pointer-events: auto;
+  opacity: 1;
+  top: 0;
+}

+ 16 - 0
miniProgram/pages/index/index.wxml

@@ -0,0 +1,16 @@
+<!--index.wxml-->
+<view class="home" style="background-image:url({{CDN_URL}}images/bg.jpg)">
+  <view class="left">
+    <image src="{{CDN_URL}}images/title.png" mode="widthFix"/>
+    <image bindtap="onStart" src="{{CDN_URL}}images/btn_start.png" mode="widthFix"/>
+  </view>
+</view>
+
+<view class="video" wx:if="{{isShowVideo}}">
+  <video vslide-gesture="true" enable-play-gesture="true" controls autoplay="true" show-mute-btn="true" src="{{CDN_URL}}video/video.mp4" /> 
+  <view bindtap="onSkipButtonTap" class="jump">
+    跳过
+  </view>
+</view>
+
+<authorize  class="auth {{isShowAuthorize?'auth_show':''}}" bind:onCancel="tapAuthclose" bind:onComfirm="tapAuthComfirm"/>

+ 61 - 0
miniProgram/pages/index/index.wxss

@@ -0,0 +1,61 @@
+/**index.wxss**/
+.home {
+  width: 100%;
+  height: 100%;
+  position: relative;
+  background-size: cover;
+  background-position: right bottom;
+}
+.home .left {
+  position: absolute;
+  width: 36%;
+  left: 10%;
+  top: 50%;
+  transform: translateY(-50%);
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+}
+.home .left > image {
+  width: 100%;
+}
+.home .left > image:last-of-type {
+  width: 72%;
+}
+.video {
+  position: fixed;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+  z-index: 999;
+}
+.video > video {
+  width: 100%;
+  height: 100%;
+}
+.video .jump {
+  position: absolute;
+  top: 10rpx;
+  right: 20rpx;
+  z-index: 1000;
+  color: #fff;
+}
+.auth {
+  position: fixed;
+  left: 0;
+  top: 110%;
+  width: 100%;
+  height: 100%;
+  z-index: 999;
+  background-color: rgba(0, 0, 0, 0.5);
+  backdrop-filter: blur(10px);
+  pointer-events: none;
+  opacity: 0;
+}
+.auth_show {
+  pointer-events: auto;
+  opacity: 1;
+  top: 0;
+}

+ 73 - 0
miniProgram/pages/webview/index.js

@@ -0,0 +1,73 @@
+// pages/webview/index.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    url:''
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+
+  onShow() {
+    let token = wx.getStorageSync('token')
+
+    this.setData({
+      url: `http://192.168.20.11:5173/?token=${token}#/`
+    })
+
+  },
+
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
miniProgram/pages/webview/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 1 - 0
miniProgram/pages/webview/index.less

@@ -0,0 +1 @@
+/* pages/webview/index.wxss */

+ 2 - 0
miniProgram/pages/webview/index.wxml

@@ -0,0 +1,2 @@
+<web-view src="{{url}}"></web-view>
+  

+ 1 - 0
miniProgram/pages/webview/index.wxss

@@ -0,0 +1 @@
+/* pages/webview/index.wxss */

+ 52 - 0
miniProgram/project.config.json

@@ -0,0 +1,52 @@
+{
+  "description": "项目配置文件",
+  "packOptions": {
+    "ignore": [],
+    "include": []
+  },
+  "setting": {
+    "bundle": false,
+    "userConfirmedBundleSwitch": false,
+    "urlCheck": true,
+    "scopeDataCheck": false,
+    "coverView": true,
+    "es6": true,
+    "postcss": true,
+    "compileHotReLoad": false,
+    "lazyloadPlaceholderEnable": false,
+    "preloadBackgroundData": false,
+    "minified": true,
+    "autoAudits": false,
+    "newFeature": false,
+    "uglifyFileName": false,
+    "uploadWithSourceMap": true,
+    "useIsolateContext": true,
+    "nodeModules": false,
+    "enhance": true,
+    "useMultiFrameRuntime": true,
+    "useApiHook": true,
+    "useApiHostProcess": true,
+    "showShadowRootInWxmlPanel": true,
+    "packNpmManually": false,
+    "enableEngineNative": false,
+    "packNpmRelationList": [],
+    "minifyWXSS": true,
+    "showES6CompileOption": false,
+    "minifyWXML": true,
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    },
+    "condition": false
+  },
+  "compileType": "miniprogram",
+  "libVersion": "2.19.4",
+  "appid": "wxb4c0527aa20a6e9a",
+  "projectname": "miniprogram-92",
+  "condition": {},
+  "editorSetting": {
+    "tabIndent": "insertSpaces",
+    "tabSize": 2
+  }
+}

+ 22 - 0
miniProgram/project.private.config.json

@@ -0,0 +1,22 @@
+{
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+  "projectname": "miniProgram",
+  "setting": {
+    "compileHotReLoad": true,
+    "urlCheck": false
+  },
+  "libVersion": "2.31.1",
+  "condition": {
+    "miniprogram": {
+      "list": [
+        {
+          "name": "",
+          "pathName": "pages/webview/index",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        }
+      ]
+    }
+  }
+}

+ 7 - 0
miniProgram/sitemap.json

@@ -0,0 +1,7 @@
+{
+  "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
+  "rules": [{
+  "action": "allow",
+  "page": "*"
+  }]
+}

+ 6 - 0
miniProgram/styles/common.less

@@ -0,0 +1,6 @@
+/**app.wxss**/
+.container {
+  height: 100%;
+  width: 100%;
+  overflow: hidden;
+} 

+ 6 - 0
miniProgram/styles/common.wxss

@@ -0,0 +1,6 @@
+/**app.wxss**/
+.container,page {
+  height: 100%;
+  width: 100%;
+  overflow: hidden;
+}

+ 48 - 0
miniProgram/utils/http.js

@@ -0,0 +1,48 @@
+import { API_BASE_URL } from './util'
+
+const BASE_URL = `${API_BASE_URL}`;
+
+function request(url, options) {
+
+
+  return new Promise((resolve, reject) => {
+    let token = wx.getStorageSync('token')
+
+    wx.request(Object.assign({
+      url: url.indexOf('://') == -1 ? (BASE_URL + url) : url,
+      method: options.method,
+      data: options.data,
+      header: Object.assign({ token: token }, options.header),
+      success(res) {
+        if (res.data.code == 0 || res.data.code == 200 || res.data.errno === 0) {
+          resolve(res.data)
+        } else {
+          reject(res)
+        }
+      },
+      fail(err) {
+        console.log(err, '请求失败')
+        reject(err)
+      }
+    }, options))
+    setTimeout(() => reject('time out'), 5000)
+  })
+}
+
+function get(url, data, options = {}) {
+  options.method = 'GET'
+  options.data = data
+  return request(url, options)
+}
+
+function post(url, data = {}, options = {}) {
+  options.method = 'POST'
+  options.data = Object.assign({}, data)
+  return request(url, options)
+}
+
+export default {
+  request,
+  get,
+  post
+}

+ 17 - 0
miniProgram/utils/mixins.js

@@ -0,0 +1,17 @@
+import fetchutil from './http'
+
+import {formatTime,API_BASE_URL} from './util'
+
+
+module.exports = {
+  data: { 
+    someData: 'myMixin',
+    g_cdn:`https://culture.4dage.com/lvDao_v4`,
+    fetchutil,
+    API_BASE_URL,
+    formatTime
+  },
+  onShow() { 
+    console.log('Log from mixin!') 
+  }
+}

+ 50 - 0
miniProgram/utils/mixins_core.js

@@ -0,0 +1,50 @@
+// 保存原生的 Page 函数
+const originPage = Page
+
+Page = (options) => {
+  const mixins = options.mixins
+  // mixins 必须为数组
+  if (Array.isArray(mixins)) {
+    delete options.mixins
+    // mixins 注入并执行相应逻辑
+    merge(mixins, options)
+  }
+  // 释放原生 Page 函数
+  originPage(options)
+}
+
+// 定义小程序内置的属性/方法
+const originProperties = ['data', 'properties', 'options']
+const originMethods = ['onLoad', 'onReady', 'onShow', 'onHide', 'onUnload', 'onPullDownRefresh', 'onReachBottom', 'onShareAppMessage', 'onPageScroll', 'onTabItemTap']
+
+function merge(mixins, options) {
+  mixins.forEach((mixin) => {
+    if (Object.prototype.toString.call(mixin) !== '[object Object]') {
+      throw new Error('mixin 类型必须为对象!')
+    }
+    // 遍历 mixin 里面的所有属性
+    for (let [key, value] of Object.entries(mixin)) {
+      if (originProperties.includes(key)) {
+        // 内置对象属性混入
+        options[key] = {
+          ...value,
+          ...options[key]
+        }
+      } else if (originMethods.includes(key)) {
+        // 内置方法属性混入,优先执行混入的部分
+        const originFunc = options[key]
+        options[key] = function (...args) {
+
+          value.call(this, ...args)
+          return originFunc && originFunc.call(this, ...args)
+        }
+      } else {
+        // 自定义方法混入
+        options = {
+          ...mixin,
+          ...options
+        }
+      }
+    }
+  })
+}

+ 24 - 0
miniProgram/utils/util.js

@@ -0,0 +1,24 @@
+export const formatTime = (date) => {
+  const year = date.getFullYear()
+  const month = date.getMonth() + 1
+  const day = date.getDate()
+  const hour = date.getHours()
+  const minute = date.getMinutes()
+  const second = date.getSeconds()
+
+  return (
+    [year, month, day].map(formatNumber).join('-') +
+    ' ' +
+    [hour, minute].map(formatNumber).join(':')
+  )
+}
+
+const formatNumber = (n) => {
+  const s = n.toString()
+  return s[1] ? s : '0' + s
+}
+
+
+// export const API_BASE_URL = 'http://192.168.0.135:8015/'
+export const API_BASE_URL = 'http://192.168.20.55:8047/'
+export const CDN_URL = 'https://culture.4dage.com/hn_museum_game/'


README.md → web/README.md


index.html → web/index.html


manage.js → web/manage.js


package.json → web/package.json


public/program/Build/Build1.data.unityweb → web/public/program/Build/Build1.data.unityweb


public/program/Build/Build1.framework.js.unityweb → web/public/program/Build/Build1.framework.js.unityweb


public/program/Build/Build1.loader.js → web/public/program/Build/Build1.loader.js


public/program/Build/Build1.wasm.unityweb → web/public/program/Build/Build1.wasm.unityweb


public/program/Build/BuildTest.data.unityweb → web/public/program/Build/BuildTest.data.unityweb


public/program/Build/BuildTest.framework.js.unityweb → web/public/program/Build/BuildTest.framework.js.unityweb


public/program/Build/BuildTest.loader.js → web/public/program/Build/BuildTest.loader.js


public/program/Build/BuildTest.wasm.unityweb → web/public/program/Build/BuildTest.wasm.unityweb


public/program/README.txt → web/public/program/README.txt


public/program/ServiceWorker.js → web/public/program/ServiceWorker.js


public/program/TemplateData/favicon.ico → web/public/program/TemplateData/favicon.ico


public/program/TemplateData/icons/unity-logo-dark.png → web/public/program/TemplateData/icons/unity-logo-dark.png


public/program/TemplateData/icons/unity-logo-light.png → web/public/program/TemplateData/icons/unity-logo-light.png


public/program/TemplateData/progress-bar-empty-dark.png → web/public/program/TemplateData/progress-bar-empty-dark.png


public/program/TemplateData/progress-bar-empty-light.png → web/public/program/TemplateData/progress-bar-empty-light.png


public/program/TemplateData/progress-bar-full-dark.png → web/public/program/TemplateData/progress-bar-full-dark.png


public/program/TemplateData/progress-bar-full-light.png → web/public/program/TemplateData/progress-bar-full-light.png


public/program/TemplateData/style.css → web/public/program/TemplateData/style.css


public/program/TemplateData/unity-logo-dark.png → web/public/program/TemplateData/unity-logo-dark.png


public/program/TemplateData/unity-logo-light.png → web/public/program/TemplateData/unity-logo-light.png


public/program/index copy.html → web/public/program/index copy.html


public/program/index.html → web/public/program/index.html


public/program/manifest.webmanifest → web/public/program/manifest.webmanifest


public/vite.svg → web/public/vite.svg


src/App.vue → web/src/App.vue


src/api/http.js → web/src/api/http.js


src/assets/style/SourceHanSerifCN-Bold.otf → web/src/assets/style/SourceHanSerifCN-Bold.otf


src/assets/style/SourceHanSerifCN-Regular.otf → web/src/assets/style/SourceHanSerifCN-Regular.otf


src/assets/style/global.scss → web/src/assets/style/global.scss


src/assets/style/my-reset.css → web/src/assets/style/my-reset.css


src/assets/style/reset.css → web/src/assets/style/reset.css


src/components/Integral-detail.vue → web/src/components/Integral-detail.vue


src/components/Integraltoast.vue → web/src/components/Integraltoast.vue


src/components/Introduce.vue → web/src/components/Introduce.vue


src/components/Vmenu.vue → web/src/components/Vmenu.vue


src/config.js → web/src/config.js


src/main.js → web/src/main.js


src/plugin/dialog/Alert.vue → web/src/plugin/dialog/Alert.vue


src/plugin/dialog/Confirm.vue → web/src/plugin/dialog/Confirm.vue


src/plugin/dialog/Dialog-content.vue → web/src/plugin/dialog/Dialog-content.vue


src/plugin/dialog/Dialog.vue → web/src/plugin/dialog/Dialog.vue


src/plugin/dialog/Toast.vue → web/src/plugin/dialog/Toast.vue


src/plugin/dialog/dialog.scss → web/src/plugin/dialog/dialog.scss


src/plugin/dialog/index.js → web/src/plugin/dialog/index.js


src/router/index.js → web/src/router/index.js


src/utils/componentHelper.js → web/src/utils/componentHelper.js


src/utils/index.js → web/src/utils/index.js


src/utils/zindex.js → web/src/utils/zindex.js


src/views/Courtyard.vue → web/src/views/Courtyard.vue


src/views/Editing.vue → web/src/views/Editing.vue


src/views/Integral.vue → web/src/views/Integral.vue


vite.config.js → web/vite.config.js


yarn.lock → web/yarn.lock