瀏覽代碼

我的页面暂存

xiaohaizhao 3 月之前
父節點
當前提交
c41e958159
共有 11 個文件被更改,包括 176 次插入17 次删除
  1. 12 6
      App.vue
  2. 0 1
      pages/index/home.vue
  3. 2 1
      pages/index/index.vue
  4. 109 0
      pages/index/my.vue
  5. 38 6
      pages/login/login.vue
  6. 15 3
      static/iconfont.css
  7. 二進制
      static/image/djd.png
  8. 二進制
      static/image/jxz.png
  9. 二進制
      static/image/user.png
  10. 二進制
      static/image/ywj.png
  11. 二進制
      static/image/其他.png

+ 12 - 6
App.vue

@@ -6,15 +6,14 @@ export default {
 		if (uni.getStorageSync('userMsg').token) {
 			{
 				$Http.basic({
-					"classname": "webmanage.site.site",
-					"method": "querySite_Parameter", //查询站点数据
-					content: {
-						nocache: true
+					"id": "2025082114391803",
+					"content": {
+						"phonenumber": uni.getStorageSync('userMsg').phonenumber
 					}
 				}).then(res => {
 					if (res.code == 1) {
-						uni.removeStorageSync('siteP');
-						uni.setStorageSync("siteP", res.data)
+						uni.removeStorageSync('userRecord');
+						uni.setStorageSync("userRecord", res.data)
 						$Http.isLoad = true;
 					} else {
 						$Http.isLoad = false;
@@ -40,4 +39,11 @@ export default {
 page {
 	background-color: #F7F7FF;
 }
+
+.navigator-hover {
+	background-color: rgba(0, 0, 0, 0.1) !important;
+	opacity: 0.7 !important;
+}
+
+
 </style>

+ 0 - 1
pages/index/home.vue

@@ -28,7 +28,6 @@
 				</view>
 			</view>
 		</view>
-
 	</view>
 
 </template>

+ 2 - 1
pages/index/index.vue

@@ -3,7 +3,7 @@
 		<home />
 	</view>
 	<view v-show="showPage != 'home'">
-		12
+		<my />
 	</view>
 	<up-tabbar :fixed="true" :value="showPage" @change="change1">
 		<up-tabbar-item text="服务" name="home">
@@ -27,6 +27,7 @@
 
 <script setup>
 import home from './home.vue';
+import my from './my.vue';
 import { ref, getCurrentInstance } from 'vue'
 const { $Http } = getCurrentInstance().proxy;
 

+ 109 - 0
pages/index/my.vue

@@ -0,0 +1,109 @@
+<template>
+	<view class="user" hover-class="navigator-hover">
+		<view class="profile-photo">
+			<up-image :show-loading="true" :src="user.profilePhoto" width="120rpx" height="120rpx" />
+		</view>
+		<view class="user-info">
+			<view class="user-name">{{ user.name }}</view>
+			<view class="user-phone">{{ user.phonenumber }}</view>
+		</view>
+		<view class="iconfont icon-shezhi" />
+	</view>
+</template>
+
+<script setup>
+import { ref, reactive, getCurrentInstance } from 'vue'
+const { $Http } = getCurrentInstance().proxy;
+import { onLoad } from '@dcloudio/uni-app';
+
+let user = reactive({
+	name: '',
+	phonenumber: '',
+	profilePhoto: "",
+});
+
+onLoad(() => {
+	getProperty()
+	getUserMsg()
+	const userInfo = uni.getStorageSync('userMsg')
+	user.name = userInfo.name
+	user.phonenumber = userInfo.phonenumber
+	user.profilePhoto = userInfo.profilePhoto || '/static/image/user.png'
+});
+
+//headportrait
+
+function getUserMsg() {
+	$Http.basic({
+		"classname": "common.usercenter.usercenter",
+		"method": "queryUserMsg",
+		"content": { "nocache": true }
+	}).then(res => {
+		console.log("res", res);
+		if (res.code == 1) {
+			user.name = res.data.name
+			user.phonenumber = res.data.phonenumber
+			user.profilePhoto = user.profilePhoto
+
+			let userMsg = uni.getStorageSync('userMsg')
+			userMsg.name = res.data.name
+			userMsg.phonenumber = res.data.phonenumber
+			userMsg.profilePhoto = res.data.profilePhoto || '/static/image/user.png'
+			uni.setStorageSync('userMsg', userMsg)
+
+		}
+	})
+}
+
+function getProperty() {
+	$Http.basic({
+		id: 2025082115363003,
+		content: {
+			sa_customersid: 1
+		}
+	}).then(res => {
+		console.log('个人资产', res);
+	})
+}
+</script>
+
+<style lang="less" scoped>
+.user {
+	display: flex;
+	align-items: center;
+	width: 100%;
+	height: 100%;
+	background-color: #fff;
+	box-sizing: border-box;
+	padding: 40rpx;
+
+	.profile-photo {
+		width: 120rpx;
+		height: 120rpx;
+		border-radius: 50%;
+		overflow: hidden;
+	}
+
+	.user-info {
+		flex: 1;
+		margin-left: 40rpx;
+		padding-top: 10rpx;
+
+		.user-name {
+			line-height: 42rpx;
+			font-family: Microsoft YaHei, Microsoft YaHei;
+			font-size: 32rpx;
+			color: #333333;
+		}
+
+		.user-phone {
+			line-height: 38rpx;
+			font-family: Microsoft YaHei, Microsoft YaHei;
+			font-size: 28rpx;
+			color: #999999;
+			margin-top: 20rpx;
+		}
+
+	}
+}
+</style>

+ 38 - 6
pages/login/login.vue

@@ -104,7 +104,6 @@ let countDown = null;
 const downTime = ref(0); // 倒计时初始值
 
 function getAuthCode() {
-    console
     if (downTime.value > 0) return;
     if (!validatephonenumber()) return;
     $Http.getpassword({ "phonenumber": phonenumber.value, "systemclient": "wechatsaletool" }).then(res => {
@@ -121,15 +120,35 @@ function getAuthCode() {
             const code = res.msg.split('手机验证码为:');
             if (code[1]) {
                 password.value = code[1].trim(); // 自动填充验证码
-
             } else {
                 focused.value = 'password'; // 聚焦输入框
             }
+        } else {
+            if (res.msg == '当前手机号未注册!') {
+                $Http.base({
+                    "id": "2025082114174203",
+                    "content": {
+                        "name": "用户" + phonenumber.value.slice(-4),
+                        "phonenumber": phonenumber.value
+                    }
+                }).then(res => {
+                    console.log("注册结果:", res);
+                    if (res.code == 1) {
+                        getAuthCode();
+                    } else {
+                        uni.showToast({
+                            title: res.msg,
+                            icon: 'none',
+                        });
+                    }
+                })
+            } else {
+                uni.showToast({
+                    title: res.msg,
+                    icon: 'none',
+                });
+            }
         }
-        uni.showToast({
-            title: res.msg,
-            icon: 'none',
-        });
     })
 }
 
@@ -201,6 +220,19 @@ function handleLogin(data) {
                 }
             })
 
+            $Http.basic({
+                "id": "2025082114391803",
+                "content": {
+                    "phonenumber": phonenumber.value
+                }
+            }).then(res => {
+                console.log('用户档案', res)
+                if (res.code == 1) {
+                    uni.removeStorageSync('userRecord');
+                    uni.setStorageSync("userRecord", res.data)
+                }
+            })
+
         } else {
             uni.showToast({
                 title: res.msg,

+ 15 - 3
static/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 4985326 */
-  src: url('//at.alicdn.com/t/c/font_4985326_41ua1apdsq9.woff2?t=1754295970513') format('woff2'),
-       url('//at.alicdn.com/t/c/font_4985326_41ua1apdsq9.woff?t=1754295970513') format('woff'),
-       url('//at.alicdn.com/t/c/font_4985326_41ua1apdsq9.ttf?t=1754295970513') format('truetype');
+  src: url('//at.alicdn.com/t/c/font_4985326_3lo8rjw0fz.woff2?t=1756171236226') format('woff2'),
+       url('//at.alicdn.com/t/c/font_4985326_3lo8rjw0fz.woff?t=1756171236226') format('woff'),
+       url('//at.alicdn.com/t/c/font_4985326_3lo8rjw0fz.ttf?t=1756171236226') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,18 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-dianhua2:before {
+  content: "\e706";
+}
+
+.icon-jiedan:before {
+  content: "\e705";
+}
+
+.icon-shezhi:before {
+  content: "\e704";
+}
+
 .icon-dianjizhankai:before {
   content: "\e70f";
 }

二進制
static/image/djd.png


二進制
static/image/jxz.png


二進制
static/image/user.png


二進制
static/image/ywj.png


二進制
static/image/其他.png