登录
This commit is contained in:
46
unpackage/dist/dev/mp-weixin/pages/Mine/Mine.js
vendored
46
unpackage/dist/dev/mp-weixin/pages/Mine/Mine.js
vendored
@@ -1,23 +1,49 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const tabBar = () => "../../components/tabBar/tabBar.js";
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
userinfo: {}
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
common_vendor.index.getStorage({
|
||||
key: "userinfo",
|
||||
success: (res) => {
|
||||
this.userinfo = res.data;
|
||||
common_vendor.index.__f__("log", "at pages/Mine/Mine.vue:33", this.userinfo);
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 打开会话列表
|
||||
openConversationList() {
|
||||
common_vendor.index.navigateTo({ url: "/TUIKit/components/TUIConversation/index" });
|
||||
},
|
||||
// 打开联系人
|
||||
openContact() {
|
||||
common_vendor.index.navigateTo({ url: "/TUIKit/components/TUIContact/index" });
|
||||
goSetting() {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/Setting/Setting"
|
||||
});
|
||||
}
|
||||
},
|
||||
components: {
|
||||
tabBar
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_tabBar2 = common_vendor.resolveComponent("tabBar");
|
||||
_easycom_tabBar2();
|
||||
}
|
||||
const _easycom_tabBar = () => "../../components/tabBar/tabBar.js";
|
||||
if (!Math) {
|
||||
_easycom_tabBar();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.o$1((...args) => $options.openConversationList && $options.openConversationList(...args)),
|
||||
b: common_vendor.o$1((...args) => $options.openContact && $options.openContact(...args))
|
||||
a: $data.userinfo.headerIcon,
|
||||
b: common_vendor.t($data.userinfo.nickName),
|
||||
c: common_assets._imports_0$2,
|
||||
d: common_vendor.o$1((...args) => $options.goSetting && $options.goSetting(...args))
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-402ad917"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Mine/Mine.js.map
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "我的",
|
||||
"usingComponents": {}
|
||||
"usingComponents": {
|
||||
"tab-bar": "../../components/tabBar/tabBar"
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
<view><button bindtap="{{a}}">打开会话列表</button><button bindtap="{{b}}">打开联系人</button></view>
|
||||
<view class="container data-v-402ad917"><view class="PersonalInformation data-v-402ad917"><view class="header data-v-402ad917"><image src="{{a}}" mode="scaleToFill" class="headerIcon data-v-402ad917"/></view><view class="data-v-402ad917"><view class="name data-v-402ad917">{{b}}</view></view><view class="Settings data-v-402ad917" bindtap="{{d}}"><image class="SettingsIcon data-v-402ad917" src="{{c}}" mode="scaleToFill"/></view></view></view><view class="tabBar data-v-402ad917"><tab-bar class="data-v-402ad917" u-i="402ad917-0" bind:__l="__l"></tab-bar></view>
|
||||
@@ -0,0 +1,38 @@
|
||||
|
||||
.container.data-v-402ad917 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background: linear-gradient(to bottom, #11cb2a6e, #2574fc6d);
|
||||
}
|
||||
.PersonalInformation.data-v-402ad917 {
|
||||
margin-top: 200rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
.header.data-v-402ad917 {
|
||||
margin-left: 50rpx;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.headerIcon.data-v-402ad917 {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.name.data-v-402ad917 {
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
.Settings.data-v-402ad917 {
|
||||
margin-left: 370rpx;
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
.SettingsIcon.data-v-402ad917 {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
93
unpackage/dist/dev/mp-weixin/pages/Setting/Setting.js
vendored
Normal file
93
unpackage/dist/dev/mp-weixin/pages/Setting/Setting.js
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const components_request = require("../../components/request.js");
|
||||
const _sfc_main = {
|
||||
inject: ["$global"],
|
||||
data() {
|
||||
return {
|
||||
userinfo: "",
|
||||
name: "",
|
||||
id: "",
|
||||
info: {},
|
||||
userSig: ""
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
common_vendor.index.getStorage({
|
||||
key: "userinfo",
|
||||
success: (res) => {
|
||||
this.id = res.data.id;
|
||||
this.name = res.data.nickName;
|
||||
this.userinfo = res.data.headerIcon;
|
||||
}
|
||||
});
|
||||
common_vendor.index.getStorage({
|
||||
key: "userSig",
|
||||
success: (res) => {
|
||||
this.userSig = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 输入昵称
|
||||
inputName(e) {
|
||||
this.name = e.detail.value;
|
||||
},
|
||||
// 选择头像
|
||||
async Userinfo(e) {
|
||||
const { avatarUrl } = e.detail;
|
||||
this.userinfo = avatarUrl;
|
||||
},
|
||||
// 微信登录
|
||||
async wxLogin(e) {
|
||||
common_vendor.index.showLoading({
|
||||
title: "登录中...",
|
||||
mask: true
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/Setting/Setting.vue:62", "userinfo", this.userinfo);
|
||||
common_vendor.index.__f__("log", "at pages/Setting/Setting.vue:63", "name", this.name);
|
||||
common_vendor.index.__f__("log", "at pages/Setting/Setting.vue:64", "id", this.id);
|
||||
common_vendor.index.__f__("log", "at pages/Setting/Setting.vue:65", "userSig", this.userSig);
|
||||
const res = await components_request.request({
|
||||
url: "user/updateUserInfo",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: this.id,
|
||||
headerIcon: this.userinfo,
|
||||
nickName: this.name,
|
||||
usersig: this.userSig
|
||||
},
|
||||
userInfo: false
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/Setting/Setting.vue:78", "res", res);
|
||||
if (res.code === 200) {
|
||||
common_vendor.index.showToast({
|
||||
title: "修改成功",
|
||||
icon: "success"
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/Setting/Setting.vue:84", "修改成功", res.data);
|
||||
common_vendor.index.setStorageSync("userinfo", res.data.info);
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: "修改失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: $data.userinfo,
|
||||
b: common_vendor.o$1((...args) => $options.Userinfo && $options.Userinfo(...args)),
|
||||
c: common_vendor.o$1((...args) => $options.inputName && $options.inputName(...args)),
|
||||
d: common_vendor.o$1((...args) => $options.wxLogin && $options.wxLogin(...args))
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-3c55a289"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Setting/Setting.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/pages/Setting/Setting.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/pages/Setting/Setting.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "设置",
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/Setting/Setting.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/Setting/Setting.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="container data-v-3c55a289"><button class="login-btn data-v-3c55a289" open-type="chooseAvatar" bindchooseavatar="{{b}}"><image class="avatar data-v-3c55a289" src="{{a}}"></image></button><input type="nickname" class="weui-input data-v-3c55a289" placeholder="请输入昵称" bindblur="{{c}}"/><button class="weui-btn data-v-3c55a289" bindtap="{{d}}">修改</button></view>
|
||||
33
unpackage/dist/dev/mp-weixin/pages/Setting/Setting.wxss
vendored
Normal file
33
unpackage/dist/dev/mp-weixin/pages/Setting/Setting.wxss
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
.container.data-v-3c55a289 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: linear-gradient(to bottom, #11cb2a6e, #2574fc6d);
|
||||
}
|
||||
.login-btn.data-v-3c55a289 {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
border-radius: 50%;
|
||||
padding: 0px;
|
||||
margin-bottom: 60rpx;
|
||||
}
|
||||
.avatar.data-v-3c55a289 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.weui-input.data-v-3c55a289 {
|
||||
width: 80%;
|
||||
text-align: center;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
.weui-btn.data-v-3c55a289 {
|
||||
width: 40%;
|
||||
margin-top: 20rpx;
|
||||
background-color: #11cb2a00;
|
||||
color: #fff;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const components_request = require("../../components/request.js");
|
||||
const components_debug_GenerateTestUserSig = require("../../components/debug/GenerateTestUserSig.js");
|
||||
const components_TUILogin = require("../../components/TUILogin.js");
|
||||
const _sfc_main = {
|
||||
inject: ["$global"],
|
||||
data() {
|
||||
@@ -33,18 +34,19 @@ const _sfc_main = {
|
||||
},
|
||||
userInfo: false
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/login/login.vue:46", "登录结果:", res);
|
||||
common_vendor.index.__f__("log", "at pages/login/login.vue:47", "登录结果:", res);
|
||||
this.info = res;
|
||||
if (this.info.code === 200) {
|
||||
if (this.info.data.newAccount) {
|
||||
const sdkAppID = Number(this.info.data.chatInfo.appId);
|
||||
const userID = "administrator";
|
||||
const { userSig } = components_debug_GenerateTestUserSig.genTestUserSig({
|
||||
const { userSig: userSig2 } = components_debug_GenerateTestUserSig.genTestUserSig({
|
||||
SDKAPPID: sdkAppID,
|
||||
SECRETKEY: this.info.data.chatInfo.appKey,
|
||||
userID
|
||||
});
|
||||
common_vendor.index.setStorageSync("userSig", userSig);
|
||||
common_vendor.index.setStorageSync("chatInfo", this.info.data.chatInfo);
|
||||
common_vendor.index.setStorageSync("userSig", userSig2);
|
||||
common_vendor.index.setStorageSync("userinfo", this.info.data.info);
|
||||
common_vendor.index.reLaunch({
|
||||
url: "/pages/UserInformation/UserInformation"
|
||||
@@ -52,6 +54,7 @@ const _sfc_main = {
|
||||
} else {
|
||||
common_vendor.index.setStorageSync("userinfo", this.info.data.info);
|
||||
common_vendor.index.hideLoading();
|
||||
components_TUILogin.TUIlogin(this.info.data.chatInfo.appId, this.info.data.info.userChatId, userSig);
|
||||
common_vendor.index.reLaunch({
|
||||
url: this.$global.lastPage || "/pages/Home/Home"
|
||||
// 默认页
|
||||
|
||||
Reference in New Issue
Block a user