diff --git a/H5/.env.production b/H5/.env.production index 91ae612228bf3a3a34d3906b2b250f54496b2582..9ecc096057411ce4edf8af5c1c0b542b494fc32b 100644 --- a/H5/.env.production +++ b/H5/.env.production @@ -1,5 +1,5 @@ # 生产环境 部署生产环境放开这个 -VUE_APP_BASE_URL = "http://app.xitiansen.com" +# VUE_APP_BASE_URL = "http://app.xitiansen.com" # 测试环境 部署测试环境放开这个 -# VUE_APP_BASE_URL = "http://8.131.244.76:81" \ No newline at end of file +VUE_APP_BASE_URL = "http://8.131.244.76:81" \ No newline at end of file diff --git a/H5/src/App.vue b/H5/src/App.vue index 493dc1d22c87374ce5846ea1e5735d5c1fc27030..2b6a56b75a82e3afc2997f781dee921143cd5c1e 100644 --- a/H5/src/App.vue +++ b/H5/src/App.vue @@ -28,7 +28,7 @@ export default { .getAuthToken() .then(res => { console.log("获å–到tokenæˆåŠŸ", res); - localStorage.setItem('token', res); + localStorage.setItem("token", res); this.saveUser(res); }) .catch(err => { diff --git a/H5/src/api/base.js b/H5/src/api/base.js index 7848ad399372adf6438a46f9299a0f446ab2d52d..ef2035b687e2f42a4a4803ace146612098f81db0 100644 --- a/H5/src/api/base.js +++ b/H5/src/api/base.js @@ -30,3 +30,15 @@ export function uploadImage(params, file) { data: file }); } + +/** + * 版本检查 + * @param {*} version + * @returns + */ +export function versionUpdate(version) { + return request({ + url: `/account/version?version=${version}`, + method: "get" + }); +} diff --git a/H5/src/router/index.js b/H5/src/router/index.js index 55e1876019d40ad7edc56133c1c4abd8ebd412c2..63e2c67cd7e31e85869bfb1fa416e0e592f06ad9 100644 --- a/H5/src/router/index.js +++ b/H5/src/router/index.js @@ -162,31 +162,4 @@ const router = new VueRouter({ routes }); -// router.beforeEach((to, from, next) => { -// console.log('to', to); -// const whiteList = [ -// "MyStatus", -// "Publish", -// "FastestProgress", -// "MonthAward", -// "Settings", -// "Grade", -// "AirDrop", -// "Invite", -// "AboutUs", -// "customerService", -// "Wallet" -// ]; -// const token = localStorage.getItem("token"); -// if (whiteList.indexOf(to.name) > -1) { -// if (token) { -// next() -// } else { -// console.log('未登录'); -// } -// } else { -// next() -// } -// }) - export default router; diff --git a/H5/src/utils/bridgeToAppFun.js b/H5/src/utils/bridgeToAppFun.js index ce0f597e8f7c20ae6a91d92b4dc05c91523e25e9..7891fb0fb5a4be81845dbce850737941b53e61bd 100644 --- a/H5/src/utils/bridgeToAppFun.js +++ b/H5/src/utils/bridgeToAppFun.js @@ -23,14 +23,14 @@ class bridgeToAppFun { // android let token = null; return new Promise((resolve, reject) => { - console.log('版本', window.android.getAppVersion()); - console.log('接收', window.android.getToken()); + console.log("版本", window.android.getAppVersion()); + console.log("接收", window.android.getToken()); token = window.android.getToken(); - console.log('token', token); - if(token) { + console.log("token", token); + if (token) { resolve(token); } else { - reject('没有token'); + reject("没有token"); } }); } else if (this.userAgent === "ios") { @@ -108,6 +108,20 @@ class bridgeToAppFun { }); } } + getAppVersion() { + let version = ""; + if (this.userAgent === "android") { + console.log("an"); + version = window.android.getAppVersion(); + } else { + jsBridge.callhandler("getAppVersion", null, response => { + if (response) { + version = response; + } + }); + } + return version; + } } export default bridgeToAppFun; diff --git a/H5/src/views/airDropPool.vue b/H5/src/views/airDropPool.vue index 788c2ab690d36b8d2dd8ca3afbbff4cf53d40d33..86b2ec48774bb254a8dbf43eedc591862c75a67c 100644 --- a/H5/src/views/airDropPool.vue +++ b/H5/src/views/airDropPool.vue @@ -32,7 +32,7 @@ > <p v-for="(item, index) in userPoolVos" - :key="index" + :key="index + 'down'" @click="openUserInfo(item)" > 用户{{ item.userId }}è¿›å…¥ç©ºæŠ•æ± @@ -89,9 +89,11 @@ export default { methods: { onCloseUser() { this.userInfoDialog = false; + this.canScroll = true; }, openUserInfo(item) { console.log(123); + this.canScroll = false; this.userInfoDialog = true; this.currentUser = item; this.currentUser.avatar = process.env.VUE_APP_BASE_URL + item.headImage; diff --git a/H5/src/views/canCashOut.vue b/H5/src/views/canCashOut.vue index b9b3f018ce28b661e7cd7cd6ed4071bfbf235c3d..bc700d57b42b3129ebb1e0718403e031cb84c916 100644 --- a/H5/src/views/canCashOut.vue +++ b/H5/src/views/canCashOut.vue @@ -41,8 +41,8 @@ export default { name: "CanCashOut", data() { return { - preNum: "125", - currentNum: "325", + preNum: "0", + currentNum: "0", rules: "æ现规则:", rulesMent: "1ã€ç»“算:所有è´ä¹°åŠæŽ¨å¹¿äº§ç”Ÿçš„佣金实时结算,月度肥料åŠè¿›æ¥å¥–æ¯æœˆ1å·ç»“算上个月收益,在APP我的收益页é¢å¯éšæ—¶æŸ¥è¯¢æ”¶ç›Šæƒ…况。", diff --git a/H5/src/views/invite.vue b/H5/src/views/invite.vue index a70cb300c79bd2537713804082f5dfcca60d2965..1d1b1dbd7f599fcc23f475ece12b316d8b4fc806 100644 --- a/H5/src/views/invite.vue +++ b/H5/src/views/invite.vue @@ -1,5 +1,10 @@ <template> - <div class="invite-code"> + <div + class="invite-code" + :style=" + `background-image: url(${imgSrc});background-size: 100% 100%;background-repeat: no-repeat;` + " + > <div class="nav"> <van-icon name="arrow-left" @@ -8,12 +13,13 @@ color="#ffffff" @click="handlerBack" /> - <img :src="imgSrc" alt="" class="imgCode" /> + <!-- <img :src="imgSrc" alt="" class="imgCode" /> --> </div> + <van-button type @click="onSave">ä¿å˜</van-button> </div> </template> <script> -import { inviteCode } from "@/api/invite"; +// import { inviteCode } from "@/api/invite"; export default { name: "Invite", data() { @@ -25,6 +31,10 @@ export default { this.inviteCode(); }, methods: { + onSave() { + const url = this.imgSrc; + this.$bridgeToAppFun.saveImage(url); + }, handlerBack() { try { this.$bridgeToAppFun.navigateBack(); @@ -34,16 +44,17 @@ export default { } }, inviteCode() { - const _this = this; - let loading = _this.$toast.loading({ - forbidClick: true, - message: "åŠ è½½ä¸..." - }); + // const _this = this; + // let loading = _this.$toast.loading({ + // forbidClick: true, + // message: "åŠ è½½ä¸..." + // }); const userId = JSON.parse(localStorage.getItem("user")).userId; - inviteCode(userId).then(res => { - if (loading) _this.$toast.clear(); - _this.imgSrc = _this.getUserPhoto(res); - }); + // inviteCode(userId).then(res => { + // if (loading) _this.$toast.clear(); + // _this.imgSrc = _this.getUserPhoto(res); + // }); + this.imgSrc = `${process.env.VUE_APP_BASE_URL}/shop-mall/api/user/registerByQrCode?height=150&userId=${userId}&width=150`; }, getUserPhoto(res) { let uInt8Array = new Uint8Array(res); @@ -64,9 +75,21 @@ export default { .invite-code { width: 100%; height: 100vh; - background: url("../assets/images/invite_1.png"); - background-repeat: no-repeat; - background-size: 100% 100%; + + .van-button { + position: absolute; + left: 50%; + bottom: 100px; + transform: translateX(-50%); + width: 160px; + height: 36px; + font-size: 18px; + color: #ffffff; + background-color: #88c678; + border: none; + border-radius: 4px; + } + .imgCode { position: absolute; width: 60px; diff --git a/H5/src/views/settings.vue b/H5/src/views/settings.vue index 018fc78041aa33ed736aa2b82b19fe630a5e1927..cee424e647480da8f2b989e1e779c2688e915d32 100644 --- a/H5/src/views/settings.vue +++ b/H5/src/views/settings.vue @@ -14,7 +14,12 @@ :value="inviteeCode" @click="fillInviterCode" /> - <van-cell is-link title="软件更新" value="版本v1.2" /> + <van-cell + is-link + title="软件更新" + :value="version" + @click="updateVersion" + /> <van-cell is-link title="用户åè®®" @click="jumpToInstructions" /> </van-cell-group> @@ -42,10 +47,22 @@ /> </div> </base-dialog> + + <base-dialog + base-dialog-title="版本更新" + :base-dialog-show="versionShow" + :base-dialog-btn="updateBtn" + @onClick="onUpdateVersion" + > + <div slot="content" class="update-content"> + <span class="update-tip">{{ updateResult }}</span> + </div> + </base-dialog> </div> </template> <script> +import { versionUpdate } from "@/api/base"; import { getUserInfo2 } from "@/api/user"; import { logout } from "@/api/user"; import { fillInviteCode } from "@/api/user"; @@ -55,6 +72,12 @@ export default { name: "Settings", data() { return { + downAppUrl: "", + needUpdate: false, + updateBtn: "å…³é—", + updateResult: "", + versionShow: false, + version: "", userName: "", imageBaseUrl: "", headImage: "", @@ -68,8 +91,33 @@ export default { mounted() { this.imageBaseUrl = process.env.VUE_APP_BASE_URL; this.getUser(); + this.getAppVersion(); }, methods: { + onUpdateVersion() { + if (this.needUpdate) { + location.href = this.downAppUrl; + } else { + this.versionShow = false; + } + }, + updateVersion() { + versionUpdate(this.version).then(res => { + this.versionShow = true; + if (res.data === "当å‰å·²æ˜¯æœ€æ–°ç‰ˆæœ¬ï¼") { + this.updateResult = res.data; + this.needUpdate = false; + } else { + this.downAppUrl = res.data; + this.updateResult = "最新版App下载地å€ï¼š" + res.data; + this.updateBtn = "下载最新版App"; + this.needUpdate = true; + } + }); + }, + getAppVersion() { + this.version = "版本" + this.$bridgeToAppFun.getAppVersion(); + }, getUser() { const params = { userId: JSON.parse(localStorage.getItem("user")).userId @@ -188,4 +236,15 @@ export default { background-color: #f9f9f9; border-radius: 20px; } +.update-content { + display: flex; + justify-content: center; + align-items: center; + width: 100%; +} +.update-tip { + width: 90%; + font-size: 18px; + word-break: break-all; +} </style>