封装请求的方法,完成简易的问题解答页面
This commit is contained in:
@@ -5,7 +5,7 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
input: ""
|
||||
},
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<!--pages/login/index.wxml-->
|
||||
<view class="content">
|
||||
|
||||
<input model:value="{{input}}" />
|
||||
{{input}}1
|
||||
</view>
|
@@ -5,7 +5,13 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
codes: [
|
||||
{ code: "2331242324", money: 510 },
|
||||
{ code: "4234234134", money: 10 },
|
||||
{ code: "2354245345", money: 50 },
|
||||
{ code: "5365457642", money: 150 },
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
/**
|
||||
|
@@ -1,3 +1,6 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
"usingComponents": {
|
||||
"navigator": "/components/navigator/index",
|
||||
"scrollPageWrapper": "/components/scrollPageWrapper/index"
|
||||
}
|
||||
}
|
@@ -1,2 +1,12 @@
|
||||
<!--pages/meterList/index.wxml-->
|
||||
<text>pages/meterList/index.wxml</text>
|
||||
<scrollPageWrapper>
|
||||
<navigator title="表计列表" />
|
||||
<view class="content">
|
||||
<scroll-view type="list" scroll-y style="display: flex; flex-direction: column; flex: 1; width: 100%; overflow: auto;">
|
||||
<view wx:for="{{codes}}" list-item class="listItem">
|
||||
<view class="code"> {{ item.code }} </view>
|
||||
<view class="money"> {{ item.money }} </view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</scrollPageWrapper>
|
@@ -1 +1,20 @@
|
||||
/* pages/meterList/index.wxss */
|
||||
/* pages/meterList/index.wxss */
|
||||
.content {
|
||||
flex: 1;
|
||||
padding: 16rpx 24rpx 20rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.listItem {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin: 12rpx 0;
|
||||
}
|
||||
|
||||
.money {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
}
|
@@ -5,7 +5,21 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
x: 0,
|
||||
y: 0,
|
||||
questions: [{
|
||||
question: "一、什么时候可以开发票?",
|
||||
answer: "跟之前一样,每个季度一开"
|
||||
},{
|
||||
question: "二、一个季度开实际缴费数是吗?",
|
||||
answer: "开实际消耗的电费数,未消耗的电费不能开。"
|
||||
},{
|
||||
question: "三、是否可以打钱分开充值电表?",
|
||||
answer: "可以"
|
||||
},{
|
||||
question: "四、现在是多少钱一度电?",
|
||||
answer: "每个月的电价在次月供电局发票开出来后测算。"
|
||||
}]
|
||||
},
|
||||
|
||||
/**
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigator": "/components/navigator/index"
|
||||
"navigator": "/components/navigator/index",
|
||||
"scrollPageWrapper": "/components/scrollPageWrapper/index"
|
||||
}
|
||||
}
|
@@ -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>
|
@@ -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;
|
||||
}
|
Reference in New Issue
Block a user