暂存我的页面修改

This commit is contained in:
2024-11-28 17:33:29 +08:00
parent 7bbe58a0d0
commit 520f44a25f
25 changed files with 469 additions and 26 deletions

87
pages/aid/detail/index.js Normal file
View File

@@ -0,0 +1,87 @@
import { getAidDetail } from "../../../service/system";
import { alertInfo } from "../../../utils/index";
import request from "../../../utils/request"
const { OK } = request;
// pages/aid/detail/index.js
Page({
/**
* 页面的初始数据
*/
data: {
detail: {},
id: "",
type: undefined,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const that = this;
const { type, id } = options;
this.setData({ type, id }, () => {
that.init();
})
},
async init() {
const { id, type } = this.data;
const { code, message, data = {} } = await getAidDetail(id);
if (code !== OK) {
alertInfo(message)
return;
}
this.setData({
detail: data
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,9 @@
{
"usingComponents": {
"aid": "/components/aid/index",
"navigator": "/components/navigator/index",
"mp-html": "/components/mp-html/index",
"van-field": "@vant/weapp/field/index"
},
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,42 @@
<!--pages/aid/detail/index.wxml-->
<navigator title="详情" canBack="{{true}}" />
<van-cell-group>
<van-field
value="{{detail.name}}"
label="名字"
readonly
autosize="{{true}}"
type="textarea"
border="{{ false }}"
/>
<van-field
value="{{detail.level}}"
label="职称"
readonly
autosize="{{true}}"
type="textarea"
border="{{ false }}"
/>
<van-field
value="{{detail.synopsis}}"
label="简介"
readonly
autosize="{{true}}"
type="textarea"
border="{{ false }}"
/>
<van-field
use-input-slot
label="详细"
readonly
border="{{ false }}"
>
</van-field>
<view style="margin-top: 20rpx; margin-left: 30rpx;">
<mp-html content="{{detail.detail}}" />
</view>
</van-cell-group>

View File

@@ -0,0 +1 @@
/* pages/aid/detail/index.wxss */