Commit 66ef9fa2 authored by leiqingsong's avatar leiqingsong

修改app下载

parent c3f64ecc
...@@ -36,9 +36,22 @@ export function uploadImage(params, file) { ...@@ -36,9 +36,22 @@ export function uploadImage(params, file) {
* @param {*} version * @param {*} version
* @returns * @returns
*/ */
export function versionUpdate(version) { export function versionUpdate(params) {
return request({ return request({
url: `/account/version?version=${version}`, url: '/account/version',
method: "get" method: "get",
params
}); });
} }
/**
* 获取App下载路径
* @returns
*/
export function getAppDownUrl() {
return request({
url: '/account/download',
method: 'get'
})
}
...@@ -71,7 +71,8 @@ ...@@ -71,7 +71,8 @@
</div> </div>
<div v-if="title == '注册失败'" class="tip">{{ tip }}</div> <div v-if="title == '注册失败'" class="tip">{{ tip }}</div>
<div v-else class="tip"> <div v-else class="tip">
<a :href="tip">请点击下载App</a> <a :href="androidUrl">下载安卓版App</a> |
<a :href="iosUrl">下载IOS版App</a>
</div> </div>
<van-button @click="show = false">确定</van-button> <van-button @click="show = false">确定</van-button>
</div> </div>
...@@ -79,12 +80,14 @@ ...@@ -79,12 +80,14 @@
</div> </div>
</template> </template>
<script> <script>
import { smsCode } from "@/api/base"; import { smsCode, getAppDownUrl } from "@/api/base";
import { register } from "@/api/user"; import { register } from "@/api/user";
export default { export default {
name: "Register", name: "Register",
data() { data() {
return { return {
androidUrl: '',
iosUrl: '',
form: { form: {
userId: "", userId: "",
sms: "", sms: "",
...@@ -115,6 +118,19 @@ export default { ...@@ -115,6 +118,19 @@ export default {
} }
}, },
methods: { methods: {
getDownUrl() {
getAppDownUrl().then(res => {
if (res.code == 0) {
res.data.forEach(item => {
if (item.type == 1) {
this.iosUrl = item.url;
} else if (item.type == 2) {
this.androidUrl = item.url;
}
});
}
})
},
onClickHide() { onClickHide() {
this.show = false; this.show = false;
}, },
...@@ -177,7 +193,7 @@ export default { ...@@ -177,7 +193,7 @@ export default {
this.$toast.success("注册成功"); this.$toast.success("注册成功");
_this.show = true; _this.show = true;
_this.title = "注册成功"; _this.title = "注册成功";
_this.tip = "http://app.xitiansen.com/upload/xitiansen.apk"; this.getDownUrl();
} else { } else {
_this.title = "注册失败"; _this.title = "注册失败";
_this.show = true; _this.show = true;
......
...@@ -90,6 +90,7 @@ export default { ...@@ -90,6 +90,7 @@ export default {
}; };
}, },
mounted() { mounted() {
console.log('读取用户信息');
this.imageBaseUrl = process.env.VUE_APP_BASE_URL; this.imageBaseUrl = process.env.VUE_APP_BASE_URL;
this.getUser(); this.getUser();
this.getAppVersion(); this.getAppVersion();
...@@ -103,7 +104,11 @@ export default { ...@@ -103,7 +104,11 @@ export default {
} }
}, },
updateVersion() { updateVersion() {
versionUpdate(this.version.substr(2)).then(res => { const params = {
type: this.$bridgeToAppFun.userAgent === 'ios' ? 1 : 2,
version: this.version.substr(2)
}
versionUpdate(params).then(res => {
this.versionShow = true; this.versionShow = true;
if (res.code == 1) { if (res.code == 1) {
this.updateResult = res.message; this.updateResult = res.message;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment