Browse Source

接口联调,搜索也开发,部分弹窗补充

master
kola-web 7 days ago
parent
commit
e0b56dfa84
  1. 3
      src/api/request.ts
  2. 1
      src/app.ts
  3. 3
      src/components/popup/index.json
  4. 70
      src/components/popup/index.scss
  5. 48
      src/components/popup/index.wxml
  6. BIN
      src/images/icon96.png
  7. BIN
      src/images/icon97.png
  8. BIN
      src/images/icon98.png
  9. BIN
      src/images/icon99.png
  10. 4
      src/pages/login/index.ts
  11. 3
      src/pages/schedule/index.json
  12. 19
      src/pages/schedule/index.ts
  13. 8
      src/pages/schedule/index.wxml
  14. 9
      src/pages/search/index.json
  15. 89
      src/pages/search/index.scss
  16. 36
      src/pages/search/index.wxml

3
src/api/request.ts

@ -46,6 +46,9 @@ export const request = function (
resolve(res.data) resolve(res.data)
} else if (code === 0) { } else if (code === 0) {
resolve(data) resolve(data)
} else if (code === 40100) {
//登录过期
getApp().redirectToLogin()
} else if (showMsg) { } else if (showMsg) {
const msg = errPicker(res.data) const msg = errPicker(res.data)
if (loading) { if (loading) {

1
src/app.ts

@ -110,6 +110,7 @@ App<IAppOption>({
if (currentUrl && currentUrl !== 'pages/login/index') { if (currentUrl && currentUrl !== 'pages/login/index') {
this.globalData.loginRedirectUrl = currentUrl this.globalData.loginRedirectUrl = currentUrl
} }
if (currentUrl.includes('login/index')) return
wx.reLaunch({ wx.reLaunch({
url: '/pages/login/index', url: '/pages/login/index',

3
src/components/popup/index.json

@ -1,6 +1,7 @@
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"van-popup": "@vant/weapp/popup/index" "van-popup": "@vant/weapp/popup/index",
"van-icon": "@vant/weapp/icon/index"
} }
} }

70
src/components/popup/index.scss

@ -96,6 +96,76 @@
} }
} }
.popup4 {
padding: 32rpx;
background-color: #fff;
border-radius: 24rpx;
width: 688rpx;
box-sizing: border-box;
background: #ffffff;
border-radius: 24rpx 24rpx 24rpx 24rpx;
.cross {
position: absolute;
top: 32rpx;
right: 32rpx;
font-size: 40rpx;
color: rgba(203, 213, 225, 1);
}
.title {
font-size: 40rpx;
color: rgba(17, 24, 39, 1);
font-weight: bold;
padding-bottom: 32rpx;
}
.row {
margin-top: 32rpx;
display: flex;
.r-icon {
flex-shrink: 0;
margin-top: 4rpx;
width: 78rpx;
height: 78rpx;
}
.wrap {
padding-left: 24rpx;
.w-title {
font-size: 28rpx;
color: rgba(148, 163, 184, 1);
line-height: 32rpx;
}
.w-content {
margin-top: 16rpx;
font-size: 32rpx;
line-height: 42rpx;
color: rgba(17, 24, 39, 1);
font-weight: bold;
}
}
}
.row-wrap {
display: flex;
.row {
flex: 1;
}
}
.block {
margin-top: 32rpx;
padding: 24rpx;
border-radius: 24rpx;
background-color: rgba(247, 248, 250, 1);
.b-title {
font-size: 28rpx;
color: rgba(148, 163, 184, 1);
}
.b-content {
margin-top: 16rpx;
font-size: 32rpx;
color: rgba(17, 24, 39, 1);
line-height: 48rpx;
}
}
}
.close { .close {
margin: 32rpx auto 0; margin: 32rpx auto 0;
display: block; display: block;

48
src/components/popup/index.wxml

@ -30,6 +30,54 @@
<view class="btn" bind:tap="handleOk">复制</view> <view class="btn" bind:tap="handleOk">复制</view>
</view> </view>
</view> </view>
<view class="popup4" wx:if="{{type==='popup4'}}">
<van-icon class="cross" name="cross" bind:tap="handleCancel" />
<view class="container">
<view class="title">通识基础 创新思维</view>
</view>
<view class="row">
<image class="r-icon" src="/images/icon96.png"></image>
<view class="wrap">
<view class="w-title">授课老师</view>
<view class="w-content">丁蔚健</view>
</view>
</view>
<view class="row">
<image class="r-icon" src="/images/icon97.png"></image>
<view class="wrap">
<view class="w-title">授课地点</view>
<view class="w-content">西丽湖园区 日新楼北406</view>
</view>
</view>
<view class="row-wrap">
<view class="row">
<image class="r-icon" src="/images/icon98.png"></image>
<view class="wrap">
<view class="w-title">绩点</view>
<view class="w-content">2</view>
</view>
</view>
<view class="row">
<image class="r-icon" src="/images/icon99.png"></image>
<view class="wrap">
<view class="w-title">课时</view>
<view class="w-content">32</view>
</view>
</view>
</view>
<view class="block">
<view class="b-title">备注</view>
<view class="b-content">4-7周,11-13周,18周 星期五 1-4节 日新楼北406 1500061102</view>
</view>
<view class="block">
<view class="b-title">课程备注</view>
<view class="b-content">暂无课程备注</view>
</view>
<view class="block">
<view class="b-title">课程查询来源学号</view>
<view class="b-content">251000487</view>
</view>
</view>
<image <image
wx:if="{{params.close}}" wx:if="{{params.close}}"

BIN
src/images/icon96.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
src/images/icon97.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
src/images/icon98.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
src/images/icon99.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

4
src/pages/login/index.ts

@ -9,7 +9,9 @@ Page({
}, },
onLoad() { onLoad() {
app.waitLogin({ type: 0 }).then(() => {}) app.waitLogin({ type: 0 }).then(() => {
console.log(22222222)
})
}, },
/** /**

3
src/pages/schedule/index.json

@ -2,6 +2,7 @@
"navigationBarTitleText": "课表", "navigationBarTitleText": "课表",
"usingComponents": { "usingComponents": {
"van-icon": "@vant/weapp/icon/index", "van-icon": "@vant/weapp/icon/index",
"svg-icon": "/components/svg-icon/index" "svg-icon": "/components/svg-icon/index",
"popup": "/components/popup/index"
} }
} }

19
src/pages/schedule/index.ts

@ -2,6 +2,11 @@ const _app = getApp<IAppOption>()
Page({ Page({
data: { data: {
// 弹窗
popupShow: false,
popupType: 'popup4',
popupParams: {} as any,
todayIndex: 1, // 今天对应的索引(周二=1) todayIndex: 1, // 今天对应的索引(周二=1)
// 左侧9节课时间段 // 左侧9节课时间段
sectionList: [ sectionList: [
@ -118,6 +123,20 @@ Page({
], ],
}, },
onLoad() {}, onLoad() {},
// 弹窗确认
handlePopupOk() {
this.setData({
popupShow: false,
})
},
// 弹窗取消
handlePopupCancel() {
this.setData({
popupShow: false,
})
},
}) })
export {} export {}

8
src/pages/schedule/index.wxml

@ -103,3 +103,11 @@
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
<popup
show="{{popupShow}}"
type="{{popupType}}"
params="{{popupParams}}"
bind:ok="handlePopupOk"
bind:cancel="handlePopupCancel"
></popup>

9
src/pages/search/index.json

@ -1,5 +1,10 @@
{ {
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#F7F8FA", "navigationBarTitleText": "搜索",
"usingComponents": {} "usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"van-icon": "@vant/weapp/icon/index",
"pagination": "/components/pagination/index"
}
} }

89
src/pages/search/index.scss

@ -1,3 +1,88 @@
page { .page {
background-color: #f7f8fa; .header {
position: sticky;
top: 0;
left: 0;
padding: 32rpx;
background-color: #fff;
.search {
display: flex;
align-items: center;
.input-wrap {
flex: 1;
padding: 0 24rpx;
display: flex;
align-items: center;
background-color: rgba(247, 248, 250, 1);
border-radius: 68rpx;
.icon {
width: 48rpx;
height: 48rpx;
}
.input {
margin-left: 8rpx;
flex: 1;
font-size: 32rpx;
color: rgba(71, 85, 105, 1);
height: 80rpx;
}
.input-place {
color: rgba(148, 163, 184, 0.7);
}
}
.btn {
padding: 16rpx 0 16rpx 32rpx;
font-size: 32rpx;
color: rgba(74, 184, 253, 1);
}
}
.history {
margin-top: 48rpx;
.h-header {
display: flex;
align-items: center;
justify-content: space-between;
.title {
font-size: 36rpx;
color: rgba(17, 24, 39, 1);
font-weight: bold;
}
.clear {
padding: 10rpx;
width: 40rpx;
height: 40rpx;
}
}
.h-container {
margin-top: 32rpx;
display: flex;
flex-wrap: wrap;
gap: 20rpx 16rpx;
.tag {
padding: 4rpx 16rpx;
background-color: rgba(247, 248, 250, 1);
border-radius: 8rpx;
font-size: 24rpx;
line-height: 40rpx;
color: rgba(71, 85, 105, 1);
}
}
}
}
.tabs {
.van-tabs__line {
width: 42rpx !important;
}
.van-tab--active {
--tab-font-size: 32rpx;
}
}
.page0 {
min-height: 100vh;
background-color: rgba(247, 248, 250, 1);
}
.page1 {
min-height: 100vh;
background-color: rgba(247, 248, 250, 1);
}
} }

36
src/pages/search/index.wxml

@ -0,0 +1,36 @@
<view class="page">
<view class="header">
<view class="search">
<view class="input-wrap">
<image class="icon" src="/images/icon1.png"></image>
<input class="input" placeholder-class="place-input" type="text" placeholder="请搜索你想要的内容" />
</view>
<view class="btn">搜索</view>
</view>
<view class="history">
<view class="h-header">
<view class="title">历史记录</view>
<image class="clear" src="/images/icon94.png"></image>
</view>
<view class="h-container">
<view class="tag" wx:for="{{10}}" wx:key="index">暑假活动</view>
</view>
</view>
</view>
<van-tabs
class="tabs"
color="rgba(74, 184, 253, 1)"
title-inactive-color="rgba(71, 85, 105, 1)"
title-active-color="rgba(74, 184, 253, 1)"
active="{{ active }}"
bind:change="onChange"
sticky
>
<van-tab title="我发布的">
<view class="page0"></view>
</van-tab>
<van-tab title="智能体">
<view class="page1"></view>
</van-tab>
</van-tabs>
</view>
Loading…
Cancel
Save