This commit is contained in:
pengxiaolong
2025-05-15 22:24:39 +08:00
parent 838cfd9986
commit 595c5329a0
44 changed files with 5142 additions and 81 deletions

View File

@@ -12,18 +12,9 @@ const _sfc_main = {
onLoad() {
},
methods: {
// requestSomething() {
// wx.request({
// url: "http://192.168.0.218:8086/user/login", // 请求的 URL
// method: "POST", // 请求方式
// success: (res) => {
// uni.__f__('log','at pages/Home/Home.vue:37',"请求成功", res.data); // 处理成功的响应
// },
// fail: (err) => {
// uni.__f__('error','at pages/Home/Home.vue:40',"请求失败", err); // 处理失败的响应
// },
// });
// },
goAdvertisement() {
common_vendor.index.navigateTo({ url: "/pages/login/login" });
}
},
components: {
topNavigation,
@@ -46,7 +37,8 @@ if (!Math) {
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_assets._imports_0$1
a: common_assets._imports_0$1,
b: common_vendor.o$1((...args) => $options.goAdvertisement && $options.goAdvertisement(...args))
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-7ffebbf4"]]);

View File

@@ -1 +1 @@
<view class="page data-v-7ffebbf4"><image src="{{a}}" class="HomeBackground data-v-7ffebbf4"></image></view><view class="top-navigation-container data-v-7ffebbf4"><top-navigation class="data-v-7ffebbf4" u-i="7ffebbf4-0" bind:__l="__l"></top-navigation></view><view class="Advertisement data-v-7ffebbf4"><advertisement class="data-v-7ffebbf4" u-i="7ffebbf4-1" bind:__l="__l"></advertisement></view><view class="contentList data-v-7ffebbf4"><content-list class="data-v-7ffebbf4" u-i="7ffebbf4-2" bind:__l="__l"></content-list></view><view class="tabBar data-v-7ffebbf4"><tab-bar class="data-v-7ffebbf4" u-i="7ffebbf4-3" bind:__l="__l"></tab-bar></view>
<view class="page data-v-7ffebbf4"><image src="{{a}}" class="HomeBackground data-v-7ffebbf4"></image></view><view class="top-navigation-container data-v-7ffebbf4"><top-navigation class="data-v-7ffebbf4" u-i="7ffebbf4-0" bind:__l="__l"></top-navigation></view><view class="Advertisement data-v-7ffebbf4" bindtap="{{b}}"><advertisement class="data-v-7ffebbf4" u-i="7ffebbf4-1" bind:__l="__l"></advertisement></view><view class="contentList data-v-7ffebbf4"><content-list class="data-v-7ffebbf4" u-i="7ffebbf4-2" bind:__l="__l"></content-list></view><view class="tabBar data-v-7ffebbf4"><tab-bar class="data-v-7ffebbf4" u-i="7ffebbf4-3" bind:__l="__l"></tab-bar></view>

View File

@@ -29,7 +29,7 @@
}
.contentList.data-v-7ffebbf4 {
position: fixed;
top: 300rpx;
top: 400rpx;
left: 0;
width: 100%;
height: 1300rpx;

View File

@@ -1,20 +1,21 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
data() {
return {
title: "Hello"
};
},
onLoad() {
common_vendor.index.reLaunch({ url: "/pages/UserInformation/UserInformation" });
},
methods: {
openChat() {
const conversationID = "C2Cqwe";
common_vendor.index.navigateTo({
url: `/TUIKit/components/TUIChat/index?conversationID=${conversationID}`
});
}
// 方法定义
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.o$1((...args) => $options.openChat && $options.openChat(...args))
};
return {};
}
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

View File

@@ -1 +0,0 @@
<button bindtap="{{a}}">OpenChat</button>

View File

@@ -0,0 +1,2 @@
/* 样式定义 */

View File

@@ -0,0 +1,102 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const components_request = require("../../components/request.js");
const _sfc_main = {
data() {
return {
userinfo: "https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0",
name: "",
id: "",
info: {},
userSig: ""
};
},
onLoad(option) {
common_vendor.index.getStorage({
key: "userinfo",
success: (res) => {
this.id = res.data.id;
}
});
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
});
try {
const { code } = await common_vendor.index.login({
provider: "weixin",
onlyAuthorize: true
});
common_vendor.index.__f__("log", "at pages/UserInformation/UserInformation.vue:68", "code", code);
common_vendor.index.__f__("log", "at pages/UserInformation/UserInformation.vue:69", "code", this.name);
common_vendor.index.__f__("log", "at pages/UserInformation/UserInformation.vue:70", "code", this.userinfo);
common_vendor.index.__f__("log", "at pages/UserInformation/UserInformation.vue:71", "code", this.id);
common_vendor.index.__f__("log", "at pages/UserInformation/UserInformation.vue:72", "code", this.userSig);
const res = await components_request.request({
url: "/user/inputUserInfo",
method: "POST",
data: {
id: this.id,
headerIcon: this.userinfo,
nickName: this.name,
code,
usersig: this.userSig
},
userInfo: false
});
common_vendor.index.__f__("log", "at pages/UserInformation/UserInformation.vue:86", "res", res);
if (res.data.code === 200) {
common_vendor.index.showToast({
title: "登录成功",
icon: "success"
});
common_vendor.index.__f__("log", "at pages/UserInformation/UserInformation.vue:92", "登录成功", res.data);
common_vendor.index.setStorageSync("userinfo", res.data.info);
} else {
common_vendor.index.showToast({
title: "登录失败",
icon: "none"
});
}
} catch (err) {
common_vendor.index.__f__("error", "at pages/UserInformation/UserInformation.vue:115", "登录错误:", err);
common_vendor.index.showToast({
title: "请检查网络连接",
icon: "none"
});
} finally {
common_vendor.index.hideLoading();
}
}
}
};
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-35d730ef"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/UserInformation/UserInformation.js.map

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "用户信息",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="container data-v-35d730ef"><button class="login-btn data-v-35d730ef" open-type="chooseAvatar" bindchooseavatar="{{b}}"><image class="avatar data-v-35d730ef" src="{{a}}"></image></button><input type="nickname" class="weui-input data-v-35d730ef" placeholder="请输入昵称" bindblur="{{c}}"/><button class="weui-btn data-v-35d730ef" bindtap="{{d}}">登录</button></view>

View File

@@ -0,0 +1,33 @@
.container.data-v-35d730ef {
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-35d730ef {
width: 200rpx;
height: 200rpx;
border-radius: 50%;
padding: 0px;
margin-bottom: 60rpx;
}
.avatar.data-v-35d730ef {
width: 100%;
height: 100%;
border-radius: 50%;
}
.weui-input.data-v-35d730ef {
width: 80%;
text-align: center;
margin-bottom: 40rpx;
}
.weui-btn.data-v-35d730ef {
width: 40%;
margin-top: 20rpx;
background-color: #11cb2a00;
color: #fff;
}

View File

@@ -0,0 +1,87 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const components_request = require("../../components/request.js");
const components_debug_GenerateTestUserSig = require("../../components/debug/GenerateTestUserSig.js");
const _sfc_main = {
data() {
return {
userInfo: {},
info: {}
};
},
onLoad() {
common_vendor.index.getUserInfo({
provider: "weixin",
success: (res) => {
this.userInfo = res.userInfo;
}
});
},
methods: {
// 获取手机号
async getPhoneNumber(e) {
common_vendor.index.showLoading({
title: "登录中...",
mask: true
});
try {
const res = await components_request.request({
url: "/user/loginWithPhoneNumber",
method: "POST",
data: {
code: e.detail.code
},
userInfo: false
});
common_vendor.index.__f__("log", "at pages/login/login.vue:46", "登录结果:", 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({
SDKAPPID: sdkAppID,
SECRETKEY: this.info.data.chatInfo.appKey,
userID
});
common_vendor.index.setStorageSync("userSig", userSig);
common_vendor.index.setStorageSync("userinfo", this.info.data.info);
common_vendor.index.reLaunch({
url: "/pages/UserInformation/UserInformation"
});
} else {
common_vendor.index.setStorageSync("userinfo", this.info.data.info);
common_vendor.index.hideLoading();
common_vendor.index.navigateBack({
delta: 1
// 返回层级(默认值为 1
});
}
} else {
common_vendor.index.showToast({
title: "登录失败",
icon: "none"
});
}
} catch (err) {
common_vendor.index.__f__("error", "at pages/login/login.vue:87", "登录错误:", err);
common_vendor.index.showToast({
title: "请检查网络连接",
icon: "none"
});
} finally {
common_vendor.index.hideLoading();
}
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: $data.userInfo.avatarUrl,
b: common_vendor.t($data.userInfo.nickName),
c: common_vendor.o$1((...args) => $options.getPhoneNumber && $options.getPhoneNumber(...args))
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/login/login.js.map

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "登录",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="container"><image class="logo" src="{{a}}"></image><view class="nickname">{{b}}</view><button class="login-btn" open-type="getPhoneNumber" bindgetphonenumber="{{c}}"> 使用微信登录 </button></view>

View File

@@ -0,0 +1,35 @@
.container {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: linear-gradient(to bottom, #11cb2a6e, #2574fc6d);
}
.logo {
width: 200rpx;
height: 200rpx;
border-radius: 50%;
}
.nickname {
width: 300rpx;
height: 100rpx;
color: rgb(255, 255, 255);
border-radius: 0px;
padding: 20rpx 40rpx;
font-size: 30rpx;
text-align: center;
line-height: 100rpx;
}
.login-btn {
background-color: hsla(0, 0%, 100%, 0);
border: 1px solid #00ff0000;
color: #ffffff;
}
.tips {
color: #666;
font-size: 24rpx;
margin-top: 40rpx;
}