xingyy
Aiden 1 year ago
parent fa425e8b23
commit 46a6927de9

@ -3,7 +3,7 @@ import tabBar from "./util/tabbar";
export default { export default {
onLaunch: function() { onLaunch: function() {
uni.setStorageSync("token",'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJRCI6MCwiT3BlbklkIjoib01qYXY2eFFjQUttUW1ZUTFXV20zOXlCQUZ4byIsIk5pY2tOYW1lIjoiIiwiVGVsTnVtIjoiMTgyMDUwNTI2MjciLCJBdmF0YXIiOiIiLCJJRE51bSI6IiIsImV4cCI6MTY5NTQzNjEwMSwiaXNzIjoibWFsbCJ9.qYzFMtoOOBuawYDTl7iuwlTTz7Fakhr8657PjxWhQ8I') // uni.setStorageSync("token",'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJRCI6MCwiT3BlbklkIjoib01qYXY2eFFjQUttUW1ZUTFXV20zOXlCQUZ4byIsIk5pY2tOYW1lIjoiIiwiVGVsTnVtIjoiMTgyMDUwNTI2MjciLCJBdmF0YXIiOiIiLCJJRE51bSI6IiIsImV4cCI6MTY5NTQzNjEwMSwiaXNzIjoibWFsbCJ9.qYzFMtoOOBuawYDTl7iuwlTTz7Fakhr8657PjxWhQ8I')
uni.hideTabBar(); uni.hideTabBar();
uni.setStorageSync("tabBar", tabBar); uni.setStorageSync("tabBar", tabBar);
}, },
@ -28,5 +28,4 @@ export default {
.u-border-top { .u-border-top {
border: none !important; border: none !important;
} }
</style> </style>

@ -1,6 +1,8 @@
import login from "./login"; import login from "./login";
import deposit from "./deposit"; import deposit from "./deposit";
import mine from "./mine";
export default { export default {
login, login,
deposit, deposit,
mine,
}; };

@ -4,7 +4,7 @@
*/ */
export default { export default {
config: { config: {
baseUrl: "http://192.168.88.175:9021", baseUrl: "http://172.16.100.93:8017", //"http://172.16.100.93:8017", //"http://192.168.88.175:9021",
header: { header: {
"Content-Type": "application/json;charset=UTF-8", "Content-Type": "application/json;charset=UTF-8",
// 'Content-Type':'application/x-www-form-urlencoded' // 'Content-Type':'application/x-www-form-urlencoded'

@ -0,0 +1,34 @@
import http from "./interface";
const infoOrders = () => {
return http.request({
url: "/api/warehouse/static/info",
method: "POST",
});
};
const info = () => {
return http.request({
url: "/api/wxuser/info",
method: "POST",
});
};
// 更新信息
const update = (data) => {
return http.request({
url: "/api/wxuser/update",
method: "POST",
data,
});
};
const logout = () => {
return http.request({
url: "/api/wxuser/remove",
method: "POST",
});
};
export default {
infoOrders,
info,
update,
logout,
};

@ -83,7 +83,7 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
padding: 10rpx 30rpx 30rpx 30rpx; padding: 0 30rpx;
.order { .order {
width: 100%; width: 100%;

@ -7,7 +7,8 @@
open-type="getPhoneNumber" open-type="getPhoneNumber"
@getphonenumber="getPhoneNumber" @getphonenumber="getPhoneNumber"
color="transparent" color="transparent"
>点击登录</u-button> text="点击登录"
></u-button>
</view> </view>
<!-- <view class="btn"> <!-- <view class="btn">
<u-button v-if="isLogoutShow" @click="login" color="transparent"></u-button> <u-button v-if="isLogoutShow" @click="login" color="transparent"></u-button>
@ -21,51 +22,36 @@ export default {
return { return {
code: "", code: "",
openId: "", openId: "",
isShow: true, isShow: false,
isLogoutShow: true isNew: false
}; };
}, },
methods: { methods: {
async getPhoneNumber(e) { async getPhoneNumber(e) {
console.log(e);
if (e.detail.errMsg == "getPhoneNumber:ok") { if (e.detail.errMsg == "getPhoneNumber:ok") {
// //
let res = await this.$api.login.getTel({ code: e.detail.code }); let res = await this.$api.login.getTel({ code: e.detail.code });
if (res.status == 0) { if (res.status == 0) {
uni.setStorageSync("telNum", res.data.telNum); uni.setStorageSync("telNum", res.data.telNum);
uni.redirectTo({ console.log(1231111111, this.isNew);
if (this.isNew) {
uni.reLaunch({
url: "/pages/realName/realName" url: "/pages/realName/realName"
}); });
} else {
uni.reLaunch({
url: "/pages/home/index"
});
}
} else { } else {
this.$common.msgToast(res.msg); this.$common.msgToast(res.msg);
} }
} else { } else {
this.$common.msgToast("请不要拒绝哟~重新点击登录"); this.$common.msgToast("请不要拒绝哟~重新点击登录");
} }
}
// async login() {
// // code
// uni.login({
// provider: "weixin",
// success: async res => {
// console.log(res);
// this.code = res.code;
// let res1 = await this.$api.login.login({ code: res.code });
// if (res1.status == 0) {
// this.isShow = true;
// this.openId = res1.data.accountInfo.openId;
// uni.setStorageSync("token", res1.data.token);
// uni.redirectTo({
// url: "/pages/register/register"
// });
// } else {
// this.$common.msgToast(res1.msg);
// }
// }
// });
// }
}, },
onLoad() { //openId
async getOpenId() {
uni.login({ uni.login({
provider: "weixin", provider: "weixin",
success: async res => { success: async res => {
@ -73,21 +59,51 @@ export default {
this.code = res.code; this.code = res.code;
let res1 = await this.$api.login.login({ code: res.code }); let res1 = await this.$api.login.login({ code: res.code });
if (res1.status == 0) { if (res1.status == 0) {
if (res1.data.accountInfo.isNew) {
this.isShow = true; this.isShow = true;
this.openId = res1.data.accountInfo.openId; this.isNew = res1.data.accountInfo.isNew;
uni.setStorageSync("token", res1.data.token); uni.setStorageSync("token", res1.data.token);
// if (res1.data.accountInfo.isNew) {
// this.openId = res1.data.accountInfo.openId;
// uni.setStorageSync("token", res1.data.token);
// uni.reLaunch({
// url: "/pages/realName/realName"
// });
// } else {
// uni.setStorageSync("token", res1.data.token);
// uni.reLaunch({
// url: "/pages/home/index"
// });
// }
} else { } else {
uni.setStorageSync("token", res1.data.token); this.$common.msgToast(res1.msg);
uni.redirectTo({ }
}
});
},
// info401openId
async info() {
const res = await this.$api.mine.info();
if (res.status === 0) {
if (res.data.isNew) {
//
uni.reLaunch({
url: "/pages/realName/realName"
});
} else {
//
uni.reLaunch({
url: "/pages/home/index" url: "/pages/home/index"
}); });
} }
} else if (res.status === 401) {
this.getOpenId();
} else { } else {
this.$common.msgToast(res1.msg); this.$common.msgToast(res.msg);
} }
} }
}); },
onLoad() {
this.info();
} }
}; };
</script> </script>

@ -4,12 +4,12 @@
<div class="mine" :style="{background:'url('+'../../static/bbj1@3x.png'+')'}"> <div class="mine" :style="{background:'url('+'../../static/bbj1@3x.png'+')'}">
<div class="content1"> <div class="content1">
<div class="wrap1"> <div class="wrap1">
<div class="wrap1_1">203</div> <div class="wrap1_1">{{orderTotal}}</div>
<div class="wrap1_2">当前订单总量</div> <div class="wrap1_2">当前订单总量</div>
</div> </div>
<div class="wrap2"></div> <div class="wrap2"></div>
<div class="wrap3"> <div class="wrap3">
<div class="wrap3_1">19</div> <div class="wrap3_1">{{validContractDays}}</div>
<div class="wrap3_2">当前有效合同数</div> <div class="wrap3_2">当前有效合同数</div>
</div> </div>
</div> </div>
@ -20,13 +20,13 @@
</div> </div>
<div class="wrap1_2"> <div class="wrap1_2">
<div class="wrap1_2_1"> <div class="wrap1_2_1">
<div class="wrap1_2_1_1">某某某</div> <div class="wrap1_2_1_1">{{nickName}}</div>
<div class="wrap1_2_1_2">已实名</div> <div class="wrap1_2_1_2">已实名</div>
</div> </div>
<div class="wrap1_2_2">178273938123</div> <div class="wrap1_2_2">{{telNum}}</div>
</div> </div>
</div> </div>
<div class="wrap2"> <div class="wrap2" @click="goSet" >
<div class="wrap2_1"> <div class="wrap2_1">
<image src="../../static/zu609@3x.png"></image> <image src="../../static/zu609@3x.png"></image>
</div> </div>
@ -44,7 +44,44 @@ export default {
onLoad() { onLoad() {
uni.hideTabBar() uni.hideTabBar()
}, },
components: {tabbar} components: {tabbar},
data() {
return {
orderTotal:0,
validContractDays:0,
nickName:'',
telNum:''
}
},
onLoad(){
this.infoOrders()
this.info()
},
methods: {
async infoOrders(){
const res = await this.$api.mine.infoOrders()
if(res.status === 0){
this.orderTotal = res.data.totalCount
this.validContractDays = res.data.nowCount
}else{
this.$common.msgToast(res.msg);
}
},
async info(){
const res = await this.$api.mine.info()
if(res.status === 0){
this.nickName = res.data.user.nickName
this.telNum = res.data.user.telNum
}else{
this.$common.msgToast(res.msg);
}
},
goSet(){
uni.navigateTo({
url: '/pages/mine/set-up'
});
}
},
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

@ -2,71 +2,136 @@
<div class="set-up"> <div class="set-up">
<title-block title="设置"> <title-block title="设置">
<template #left> <template #left>
<div> <image style="width: 112rpx;height: 52rpx" src="https://cdns.fontree.cn/fonchain-main/prod/image/default/artwork/785cf885-c4c9-44b3-8155-4b39988c7ef8.png"></image></div> <div>
<image style="width: 112rpx;height: 52rpx"
src="https://cdns.fontree.cn/fonchain-main/prod/image/default/artwork/785cf885-c4c9-44b3-8155-4b39988c7ef8.png" @click="back">
</image>
</div>
</template> </template>
</title-block> </title-block>
<div class="content2"> <div class="content2">
<div class="wrap1"> <div class="wrap1">
<image src="../../static/06@3x.png"></image> <image :src="user.avatar ? user.avatar:'https://cdns.fontree.cn/fonchain-main/prod/image/407e7c22-eb62-411e-957b-b6c296fde530/artwork/814ac246-e1eb-49fe-beee-dd53aaf5d309.png'" mode="scaleToFill"></image>
</div> </div>
<div class="wrap2"> <div class="wrap2">
<div class="wrap2_1">恢复默认头像</div> <div class="wrap2_1" @click="backDafult"></div>
<div class="wrap2_2">更换头像</div> <u-upload :fileList="fileList" name="1" multiple :maxCount="1" @afterRead="changeAvatar">
<view style="width:348rpx;height:56rpx;margin-top:20rpx">
<u-button text="更换头像" shape="circle" class="size" color="#76C458"></u-button>
</view>
</u-upload>
</div> </div>
</div> </div>
<div class="content3"> <div class="content3">
<div class="wrap1"> <div class="wrap1">
<div class="wrap1_1"> <div class="wrap1_1">
<div class="wrap1_1_1">画作编号</div> <div class="wrap1_1_1">姓名</div>
<div class="wrap1_1_2"></div> <div class="wrap1_1_2">{{ user.nickName }}</div>
<div class="wrap1_1_3"> <div class="wrap1_1_3">
<input placeholder-style="color: #939393;font-size: 24rpx;" placeholder="画作编号" /> <view></view>
</div> </div>
<div class="wrap1_1_4"></div> <div class="wrap1_1_4"></div>
</div> </div>
<div class="wrap1_1"> <div class="wrap1_1">
<div class="wrap1_1_1">画作名称</div> <div class="wrap1_1_1">身份证号码</div>
<div class="wrap1_1_2"></div> <div class="wrap1_1_2">{{ user.iDNum }}</div>
<div class="wrap1_1_3"> <div class="wrap1_1_3">
<input placeholder-style="color: #939393;font-size: 24rpx;" placeholder="画作名称" /> <view></view>
</div> </div>
<div class="wrap1_1_4"></div> <div class="wrap1_1_4"></div>
</div> </div>
<div class="wrap1_1"> <div class="wrap1_1">
<div class="wrap1_1_1">画家名称</div> <div class="wrap1_1_1">手机号</div>
<div class="wrap1_1_2"></div> <div class="wrap1_1_2">{{ user.telNum }}</div>
<div class="wrap1_1_3">
<input placeholder-style="color: #939393;font-size: 24rpx;" placeholder="画家名称" />
</div>
<div class="wrap1_1_4">
</div>
</div>
<div class="wrap1_1">
<div class="wrap1_1_1">画作平尺数</div>
<div class="wrap1_1_2"></div>
<div class="wrap1_1_3"> <div class="wrap1_1_3">
<input placeholder-style="color: #939393;font-size: 24rpx;" placeholder="画作平尺数" /> <view></view>
</div> </div>
</div> </div>
</div> </div>
<div class="wrap2"></div> <div class="wrap2"></div>
</div> </div>
<div class="content4"> <div class="content4">
<div class="wrap1">注销账</div> <div class="wrap1" @click="logout"></div>
<div class="wrap2">退出登</div> <div class="wrap2" @click="quit">退</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import http from "@/http/api";
export default { export default {
name: "set-up", name: "set-up",
data() { data() {
return { return {
statusBarHeight:uni.getSystemInfoSync().statusBarHeight+10 user: {}
}
},
onLoad() {
this.info()
},
methods: {
async info() {
const res = await this.$api.mine.info()
if (res.status === 0) {
this.user = res.data.user
} else {
this.$common.msgToast(res.msg);
}
},
changeAvatar(file) {
console.log(file)
this.uploadFilePromise(file.file[0].url);
},
uploadFilePromise(url) {
return new Promise((resolve) => {
uni.uploadFile({
url: http.baseUrl + "/api/wxuser/uploadpic",
filePath: url,
name: "file",
success: (res) => {
res.data = JSON.parse(res.data);
resolve(res.data.data.path);
this.updateInfo({
avatar: res.data.data.path,
});
},
});
});
},
async updateInfo(data){
let res = await this.$api.mine.update(data);
if (res.status === 0) {
this.$common.msgToast('修改成功');
this.info();
} else {
this.$common.msgToast(res.msg);
}
},
backDafult() {
this.updateInfo({
avatar: "https://cdns.fontree.cn/fonchain-main/prod/image/407e7c22-eb62-411e-957b-b6c296fde530/artwork/814ac246-e1eb-49fe-beee-dd53aaf5d309.png",
});
},
quit(){
uni.clearStorageSync();
uni.navigateTo({
url: '/pages/login/login'
})
},
async logout(){
let res = await this.$api.mine.logout();
if (res.status === 0) {
this.$common.msgToast('注销成功');
this.quit();
} else {
this.$common.msgToast(res.msg);
} }
}, },
mounted(){ back(){
uni.navigateBack({
delta: 2
});
} }
},
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@ -80,12 +145,14 @@ export default {
background-size: cover; background-size: cover;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
.content4 { .content4 {
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
bottom: 104rpx; bottom: 104rpx;
position: absolute; position: absolute;
display: flex; display: flex;
.wrap2 { .wrap2 {
margin-left: 38rpx; margin-left: 38rpx;
color: #fff; color: #fff;
@ -98,6 +165,7 @@ left: 50%;
height: 56rpx; height: 56rpx;
background: #3E3E3E; background: #3E3E3E;
} }
.wrap1 { .wrap1 {
color: #fff; color: #fff;
display: flex; display: flex;
@ -110,17 +178,20 @@ left: 50%;
background: #ED6666; background: #ED6666;
} }
} }
.content2 { .content2 {
margin-top: 60rpx; margin-top: 60rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.wrap1 { .wrap1 {
image { image {
height: 154rpx; height: 154rpx;
width: 154rpx; width: 154rpx;
} }
} }
.wrap2 { .wrap2 {
margin-left: 42rpx; margin-left: 42rpx;
@ -136,6 +207,7 @@ left: 50%;
background: #76C458; background: #76C458;
border-radius: 40rpx; border-radius: 40rpx;
} }
.wrap2_1 { .wrap2_1 {
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -152,14 +224,17 @@ left: 50%;
.content3 { .content3 {
margin-top: 60rpx; margin-top: 60rpx;
.wrap1 { .wrap1 {
border: 1rpx dashed #DFE9F0; border: 1rpx dashed #DFE9F0;
background-color: #fff; background-color: #fff;
.wrap1_1 { .wrap1_1 {
position: relative; position: relative;
height: 114rpx; height: 114rpx;
display: flex; display: flex;
align-items: center; align-items: center;
.wrap1_1_4 { .wrap1_1_4 {
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
@ -169,13 +244,17 @@ left: 50%;
width: 636rpx; width: 636rpx;
border-bottom: 0.5px solid #626262; border-bottom: 0.5px solid #626262;
} }
.wrap1_1_2 { .wrap1_1_2 {
margin-right: 36rpx; margin-right: 36rpx;
width: 0; width: 0;
height: 66rpx; height: 66rpx;
border-left: 0.5px solid #626262; border-left: 0.5px solid #626262;
line-height: 66rpx;
width: 100%;
padding-left: 20rpx;
} }
.wrap1_1_1 { .wrap1_1_1 {
width: 210rpx; width: 210rpx;
padding-left: 32rpx; padding-left: 32rpx;

@ -7,7 +7,7 @@
<view class="head"> <view class="head">
<view style="display:flex; align-items: center;"> <view style="display:flex; align-items: center;">
<view class="title">注册手机号</view> <view class="title">注册手机号</view>
<view :style="{ fontSize: '18rpx' }">*实名认证失败</view> <!-- <view :style="{ fontSize: '18rpx' }">*实名认证失败</view> -->
<!-- <view>*实名认证成功</view> --> <!-- <view>*实名认证成功</view> -->
</view> </view>
<view style="color:#7FA770;font-size:24rpx;margin-left:36rpx">此实名仅用于注册该小程序</view> <view style="color:#7FA770;font-size:24rpx;margin-left:36rpx">此实名仅用于注册该小程序</view>
@ -59,6 +59,17 @@
<u-icon name="checkmark-circle" color="#fff"></u-icon> <u-icon name="checkmark-circle" color="#fff"></u-icon>
</view> </view>
</view> </view>
<view class="face">
<view class="faceTitle">法大大认证</view>
<view class="recognition" >
<view style="color: #fff;margin-right:10rpx">前往认证</view>
<u-icon name="arrow-right-double" color="#fff"></u-icon>
</view>
<!-- <view class="recognition">
<view style="color: #fff;margin-right:10rpx">认证成功</view>
<u-icon name="checkmark-circle" color="#fff"></u-icon>
</view> -->
</view>
<view class="agreement"> <view class="agreement">
<u-checkbox-group v-model="checked" iconPlacement="left" placement="row" inactiveColor="#76C458"> <u-checkbox-group v-model="checked" iconPlacement="left" placement="row" inactiveColor="#76C458">
<u-checkbox name="yes" shape="circle" activeColor="#76C458"></u-checkbox> <u-checkbox name="yes" shape="circle" activeColor="#76C458"></u-checkbox>
@ -90,12 +101,15 @@ export default {
}; };
}, },
onLoad(options) { onLoad(options) {
this.video = options.tempVideoPath; if(options.tempVideoPath){
this.isfinish = JSON.parse(options.isfinish)||false this.isfinish = JSON.parse(options.isfinish)||false
this.name = uni.getStorageSync("info").name this.video = options.tempVideoPath;
this.num = uni.getStorageSync("info").num this.uploadFilePromise(options.tempVideoPath,'video')
this.fileList = uni.getStorageSync("info").fileList }
this.fileList2 = uni.getStorageSync("info").fileList2 this.name = uni.getStorageSync("info").name||''
this.num = uni.getStorageSync("info").num||''
this.fileList = uni.getStorageSync("info").fileList||[]
this.fileList2 = uni.getStorageSync("info").fileList2||[]
uni.removeStorageSync("info") uni.removeStorageSync("info")
}, },
methods: { methods: {
@ -142,7 +156,7 @@ export default {
realIDImgB: this.fileList2[0]?.url realIDImgB: this.fileList2[0]?.url
}}) }})
if (res.status === 0) { if (res.status === 0) {
uni.navigateTo({ uni.switchTab({
url: '/pages/home/index' url: '/pages/home/index'
}); });
}else{ }else{
@ -203,15 +217,20 @@ export default {
fileListLen++ fileListLen++
} }
}, },
uploadFilePromise(url) { uploadFilePromise(url,type=null) {
console.log(url)
return new Promise((resolve) => { return new Promise((resolve) => {
uni.uploadFile({ uni.uploadFile({
url: http.baseUrl + "/api/wxuser/uploadpic", url: http.baseUrl + "/api/wxuser/uploadpic",
filePath: url, filePath: url,
name: "file", name: "file",
success: (res) => { success: (res) => {
console.log(9999999999999999999,res)
res.data = JSON.parse(res.data); res.data = JSON.parse(res.data);
resolve(res.data.data.path); resolve(res.data.data.path);
if(type ==='video'){
this.video = res.data.data.path
}
}, },
}); });
}); });

Loading…
Cancel
Save