封装请求的方法,完成简易的问题解答页面

This commit is contained in:
2024-02-27 17:23:33 +08:00
parent 66bc2262e4
commit 3205aa25c7
15 changed files with 312 additions and 15 deletions

View File

@@ -5,7 +5,21 @@ Page({
* 页面的初始数据
*/
data: {
x: 0,
y: 0,
questions: [{
question: "一、什么时候可以开发票?",
answer: "跟之前一样,每个季度一开"
},{
question: "二、一个季度开实际缴费数是吗?",
answer: "开实际消耗的电费数,未消耗的电费不能开。"
},{
question: "三、是否可以打钱分开充值电表?",
answer: "可以"
},{
question: "四、现在是多少钱一度电?",
answer: "每个月的电价在次月供电局发票开出来后测算。"
}]
},
/**

View File

@@ -1,5 +1,6 @@
{
"usingComponents": {
"navigator": "/components/navigator/index"
"navigator": "/components/navigator/index",
"scrollPageWrapper": "/components/scrollPageWrapper/index"
}
}

View File

@@ -1,2 +1,25 @@
<!--pages/questions/index.wxml-->
<navigator title="常见问题" canBack="{{true}}" />
<!-- pages/questions/index.wxml -->
<scrollPageWrapper>
<navigator title="常见问题" canBack="{{true}}" />
<view class="content">
<scroll-view type="list" scroll-y style="display: flex; flex-direction: column; flex: 1; width: 100%; overflow: auto;">
<view wx:for="{{questions}}" list-item>
<view class="question"> {{ item.question }} </view>
<view class="answer"> {{ item.answer }} </view>
</view>
</scroll-view>
</view>
<!-- <movable-area>
<movable-view x="{{x}}" y="{{y}}" direction="all">
<rich-text nodes="<div style='color:red;font-size:46px'>1234</div>"></rich-text>
</movable-view>
</movable-area> -->
<!-- <movable-area style="width: 500rpx; height: 500rpx;background-color: red;">
<movable-view x="{{x}}" y="{{y}}" direction="all">
<view style="width: 100rpx; height: 100rpx;background-color: blue;"> 1111 </view>
</movable-view>
</movable-area> -->
</scrollPageWrapper>

View File

@@ -1 +1,17 @@
/* pages/questions/index.wxss */
/* pages/questions/index.wxss */
.content {
flex: 1;
padding: 16rpx 24rpx 20rpx;
box-sizing: border-box;
display: flex;
}
.question {
font-weight: 600;
font-size: 36rpx;
}
.answer {
margin: 14rpx 0 32rpx;
font-size: 32rpx;
}