Commit 59341c71 authored by xulili's avatar xulili

分享二维码和公司简介

parents a5a791f3 97ac2fd4
VUE_APP_BASE_URL = "http://8.131.244.76:81/"
\ No newline at end of file
......@@ -17,12 +17,12 @@ export function smsCode(params) {
}
/**
* 上传图片 后端还在修改 TODO
* 上传图片 后端还在修改
* @param {*} params files 文件
* @param {*} params userId 用户id
* @param {*} params 邀请码
*/
export function uploadImage(userId, file) {
export function uploadImage(params, file) {
return request({
url: "/ZX/uploadImage",
method: "post",
......
import request from "@/utils/request";
/**
* 获取专属客服
*/
export function getCustomer() {
return request({
url: "/customerService/service",
method: "get"
})
}
\ No newline at end of file
......@@ -51,3 +51,16 @@ export function setAvatar(params) {
params
});
}
/**
* 退出
* @param {*} token
* @returns
*/
export function logout(token) {
return request({
url: "/api/user/logout",
method: "post",
header: { "token": token}
})
}
......@@ -14,3 +14,8 @@ export function getAuthToken() {
});
});
}
// 退出
export function logoutToApp() {
jsBridge.callhandler("logout");
}
......@@ -12,7 +12,7 @@
<div class="panel-box">
<div class="panel-content">
<div class="title">客服二维码</div>
<img src="@/assets/images/logo.png" class="qrCode" alt="" />
<img :src="imageUrl" class="qrCode" alt="" />
<div class="save-code">
<p>保存二维码</p>
<p>打开微信扫一扫添加客服</p>
......@@ -24,17 +24,29 @@
</template>
<script>
// var userId = 13100911369
import { getCustomer } from "@/api/customer";
export default {
name: "customerService",
data() {
return {};
return {
imageUrl: ""
};
},
created() {
this.getCustomerData();
},
mounted() {},
methods: {
handleUrl(urlName) {
this.$router.push({ name: urlName });
},
getCustomerData() {
getCustomer().then(res => {
if (res.code === 0) {
this.imageUrl = process.env.VUE_APP_BASE_URL + res.data
}
})
}
}
};
......@@ -98,6 +110,7 @@ $white: #ffffff;
display: block;
}
.save-code {
text-align: center;
font-size: 14px;
font-weight: normal;
font-stretch: normal;
......
......@@ -2,7 +2,9 @@
<div class="modefy-avatar">
<img class="avatar" :src="avatar" alt />
<div class="btn">
<van-button type="primary" plain style="height:44px">确定</van-button>
<van-button type="primary" plain style="height:44px" @click="checkBtn"
>确定</van-button
>
<van-uploader
:max-count="1"
:before-delete="onDeleteAvatar"
......@@ -16,11 +18,13 @@
<script>
import { setAvatar } from "@/api/user";
import { uploadImage } from "@/api/base";
export default {
name: "ModefyAvatar",
data() {
return {
avatar: ""
avatar: "",
imageUrl: ""
};
},
mounted() {
......@@ -29,14 +33,30 @@ export default {
}
},
methods: {
checkBtn() {
const params = {
headImage: this.imageUrl,
userId: "18757121665"
};
setAvatar(params).then(res => {
if (res.code === 0) {
this.$toast.success("头像设置成功");
this.$router.go(-1);
}
});
},
onRead(file) {
this.avatar = file.content;
console.log("file", file);
const params = {
headImage: "",
userId: "18757121665"
inviteCode: "bbbbbb"
};
setAvatar(params).then();
const fd = new FormData();
fd.append("files", file.file);
uploadImage(params, fd).then(res => {
console.log(res);
this.imageUrl = res.zxUrl;
});
},
onDeleteAvatar(file, detail) {
return new Promise((resolve, reject) => {
......
......@@ -38,11 +38,6 @@ export default {
}
}
});
this.routes.forEach(el => {
console.log(
el.meta.title + " " + "http://8.131.244.76:81/front" + el.path
);
});
},
methods: {
to(path) {
......
......@@ -20,7 +20,7 @@
<van-cell is-link title="软件更新" value="版本v1.2" />
<van-cell is-link title="用户协议" @click="jumpToInstructions" />
</van-cell-group>
<van-button size="large" class="logout-btn">退出登录</van-button>
<van-button size="large" class="logout-btn" @click="logout" >退出登录</van-button>
<base-dialog
base-dialog-title="推荐人邀请码"
......@@ -44,6 +44,8 @@
</template>
<script>
import { logoutToApp } from "@/utils/bridgeToAppFun";
import { logout } from "@/api/user";
import { fillInviteCode } from "@/api/user";
import BaseDialog from "../components/BaseDialog.vue";
export default {
......@@ -58,6 +60,13 @@ export default {
};
},
methods: {
logout() {
const params = {
token: "qwedskdljlkjlklkjlkjlkjl"
}
logout(params).then()
logoutToApp()
},
jumpToInstructions() {
this.$router.push("/instructions");
},
......
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