feat: textPaint

This commit is contained in:
zhangyi
2025-03-17 17:50:44 +08:00
parent 277477dd9b
commit e4e9f6d527
11 changed files with 185 additions and 107 deletions
+6 -4
View File
@@ -1,5 +1,7 @@
{
"usingComponents": {
"navigation-bar": "/components/navigation-bar/navigation-bar"
}
}
"navigationBarTitleText": "首页",
"navigationBarBackgroundColor": "#d2e7d8",
"homeButton": true,
"backgroundColor": "#e8eddb",
"enablePullDownRefresh": false
}
+26 -54
View File
@@ -1,61 +1,33 @@
/**index.less**/
page {
height: 100vh;
display: flex;
flex-direction: column;
}
.scrollarea {
flex: 1;
overflow-y: hidden;
height: 100vh;
display: flex;
flex-direction: column;
}
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
color: #aaa;
width: 80%;
.scroll-view {
flex: 1;
overflow-y: hidden;
}
.userinfo-avatar {
overflow: hidden;
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
}
.card {
margin: 10px;
padding: 10px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: calc(33.33% - 20px);
/* Adjust width for three cards per row */
box-sizing: border-box;
/* Ensure padding and margin are included in the width */
display: inline-block;
/* Allow cards to sit next to each other */
vertical-align: top;
/* Align cards to the top */
.usermotto {
margin-top: 200px;
}
.avatar-wrapper {
padding: 0;
width: 56px !important;
border-radius: 8px;
margin-top: 40px;
margin-bottom: 40px;
}
.avatar {
display: block;
width: 56px;
height: 56px;
}
.nickname-wrapper {
display: flex;
width: 100%;
padding: 16px;
box-sizing: border-box;
border-top: .5px solid rgba(0, 0, 0, 0.1);
border-bottom: .5px solid rgba(0, 0, 0, 0.1);
color: black;
}
.nickname-label {
width: 105px;
}
.nickname-input {
flex: 1;
}
.card-title {
font-size: 18px;
font-weight: bold;
color: #333;
}
}
+24 -41
View File
@@ -1,43 +1,26 @@
// index.ts
import callCloud from '../../base/callCloud';
// 获取应用实例
Component({
data: {},
methods: {
test() {
console.log('1test');
this.getOpenId();
},
async getOpenId() {
const res = await callCloud('getOpenId');
console.log('res-----:', res);
// const areaIds = await callCloud('createArea');
// console.log('areaIds-----:', areaIds);
// const stationIds = await callCloud('createStation');
const reslut = await callCloud('createPDF');
console.log('reslut-----:', reslut);
// wx.cloud
// .callFunction({
// name: 'user',
// data: {
// type: 'getOpenId',
// },
// })
// .then((resp: Record<string, any>) => {
// console.log('resp-----:', resp);
// this.setData({
// haveGetOpenId: true,
// openId: resp.result.openid,
// });
// wx.hideLoading();
// })
// .catch((error: any) => {
// console.log('error:', error);
// wx.hideLoading();
// });
},
Page({
data: {
cards: [
{
key: 0,
title: '文本绘制',
url: '/demoPages/textPaint/textPaint',
},
{
key: 1,
title: '文本绘制',
url: '/demoPages/textPaint/textPaint',
},
{
key: 2,
title: '文本绘制',
url: '/demoPages/textPaint/textPaint',
},
{
key: 3,
title: '文本绘制',
url: '/demoPages/textPaint/textPaint',
},
],
},
});
+9 -3
View File
@@ -1,5 +1,11 @@
<!--index.wxml-->
<navigation-bar title="Weixin" back="{{false}}" color="black" background="#FFF"></navigation-bar>
<scroll-view class="scrollarea" scroll-y type="list">
<view bind:tap="test">测试点击</view>
<scroll-view class="scroll-view" scroll-y type="list">
<view
class="card"
x:for="{{cards}}"
wx:for-item="card"
bindtap="tabCard"
data-url="{{card.url}}">
<view class="card-title">{{card.title}}</view>
</view>
</scroll-view>