Browse Source

宣传栏,调整Card组件

master
lqq 6 years ago
parent
commit
5d33b2eb65
  1. 4
      components/card/index.wxml
  2. 3
      components/card/index.wxss
  3. 0
      components/image-button/images/btn_bg_disable.png
  4. 4
      components/image-button/index.js
  5. 2
      components/image-button/index.wxml
  6. BIN
      images/billboard/3.png
  7. BIN
      images/common/btn_bg.png
  8. 2
      models/artice.js
  9. 2
      models/auth.js
  10. 12
      pages/article/index.js
  11. 2
      pages/article/index.wxml
  12. 7
      pages/billboards/index.js
  13. BIN
      pages/billboards/park/images/1.png
  14. BIN
      pages/billboards/park/images/2.png
  15. BIN
      pages/billboards/park/images/3.png
  16. BIN
      pages/billboards/park/images/4.png
  17. 8
      pages/billboards/park/index.wxml
  18. 23
      pages/billboards/park/park-list/index.js
  19. 3
      pages/billboards/park/park-list/index.wxml
  20. 3
      pages/billboards/policy/policy-list/index.js
  21. 5
      pages/home/index.js
  22. 2
      pages/home/index.json

4
components/card/index.wxml

@ -1,5 +1,5 @@
<!--components/card/index.wxml--> <!--components/card/index.wxml-->
<view class="card tag-class" bindtap="onTap"> <view class="card tag-class" bindtap="onTap">
<image class="card_logo" src="/images/temp_1.png"/> <image class="card_logo" src="{{image.length > 0 ? 'image' : '/images/temp_1.png'}}"/>
<view class="card_title">橡胶谷园区</view> <view class="card_title">{{title}}</view>
</view> </view>

3
components/card/index.wxss

@ -8,11 +8,12 @@
height: 106px; height: 106px;
} }
.card_title { .card_title {
padding: 0 10px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: 41px; min-height: 41px;
color: #373737; color: #373737;
font-size: 12px; font-size: 12px;
} }

0
images/common/btn_bg_disable.png → components/image-button/images/btn_bg_disable.png

Before

Width:  |  Height:  |  Size: 247 B

After

Width:  |  Height:  |  Size: 247 B

4
components/image-button/index.js

@ -5,6 +5,10 @@ Component({
*/ */
properties: { properties: {
title: String, title: String,
disable: {
type: Boolean,
value: false,
}
}, },
/** /**

2
components/image-button/index.wxml

@ -1,5 +1,5 @@
<!--components/image-botton/index.wxml--> <!--components/image-botton/index.wxml-->
<view class="image-button" bindtap="onTap"> <view class="image-button" bindtap="onTap">
<image class="image-btn-bg" src="images/btn_bg.png"></image> <image class="image-btn-bg" src="{{disable ? 'images/btn_bg_disable.png':'images/btn_bg.png'}}"></image>
{{title}} {{title}}
</view> </view>

BIN
images/billboard/3.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 12 KiB

BIN
images/common/btn_bg.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

2
models/artice.js

@ -37,7 +37,7 @@ class ArticeModel extends HTTP {
this.request(params) this.request(params)
} }
// 在线报名 // 在线报名
onlineSign(aId, type, success) { onlineSign(aId, success) {
let params = { let params = {
url: ArticeConst.artice_online_url, url: ArticeConst.artice_online_url,
success: success, success: success,

2
models/auth.js

@ -1,6 +1,6 @@
import { HTTP, Method, HTTPConst } from '../utils/http.js' import { HTTP, Method, HTTPConst } from '../utils/http.js'
const token_url = 'oas-admin/screen/user/ageAndSex' const token_url = ''
class AuthModel extends HTTP { class AuthModel extends HTTP {
constructor() { constructor() {

12
pages/article/index.js

@ -18,6 +18,7 @@ Page({
origin: '', origin: '',
unStar: '/images/common/star.png', unStar: '/images/common/star.png',
star: '/images/common/star_light.png', star: '/images/common/star_light.png',
disable: true,
}, },
onClickCollect () { onClickCollect () {
// 收藏功能 // 收藏功能
@ -50,7 +51,8 @@ Page({
date: date, date: date,
origin: data.source, origin: data.source,
isStar: data.isCollection ? true : false, isStar: data.isCollection ? true : false,
showBtn: data.typeFlag == 0 ? false : true showBtn: data.typeFlag >= 2 ? true : false,
disable: data.typeFlag == 3 ? true : false,
}) })
}) })
}, },
@ -71,6 +73,14 @@ Page({
onlineSignApi () { onlineSignApi () {
artice.onlineSign(this.data.aId, res => { artice.onlineSign(this.data.aId, res => {
console.log(res) console.log(res)
wx.showToast({
title: res.message,
icon: 'none'
})
this.setData({
disable: true
})
// this.fetchArticeApi()
}) })
}, },

2
pages/article/index.wxml

@ -12,6 +12,6 @@
<rich-text nodes="{{nodes}}"></rich-text> <rich-text nodes="{{nodes}}"></rich-text>
</view> </view>
<view class="page_footer" wx:if="{{showBtn}}"> <view class="page_footer" wx:if="{{showBtn}}">
<e-ibutton title="在线报名" bind:onTap="onlineSubmit"/> <e-ibutton title="在线报名" bind:onTap="onlineSubmit" disable="{{disable}}"/>
</view> </view>
</view> </view>

7
pages/billboards/index.js

@ -1,6 +1,6 @@
// pages/billboards/index.js // pages/billboards/index.js
import {AuthModel} from '../../models/auth.js' // import {AuthModel} from '../../models/auth.js'
let auth = new AuthModel() // let auth = new AuthModel()
Page({ Page({
@ -15,9 +15,6 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
auth.fetchAuthToken(res => {
console.log(res)
})
}, },
onClickItem (e) { onClickItem (e) {
const {index} = e.currentTarget.dataset const {index} = e.currentTarget.dataset

BIN
pages/billboards/park/images/1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
pages/billboards/park/images/2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
pages/billboards/park/images/3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
pages/billboards/park/images/4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

8
pages/billboards/park/index.wxml

@ -1,7 +1,7 @@
<!--pages/billboards/park/index.wxml--> <!--pages/billboards/park/index.wxml-->
<view class="container"> <view class="container">
<image bindtap="onClickItem" data-code="park-cbd" class="billboard_item" src="/images/billboard/1.png"></image> <image bindtap="onClickItem" data-code="park-cbd" class="billboard_item" src="images/1.png"></image>
<image bindtap="onClickItem" data-code="park-bhxq" class="billboard_item" src="/images/billboard/2.png"></image> <image bindtap="onClickItem" data-code="park-bhxq" class="billboard_item" src="images/2.png"></image>
<image bindtap="onClickItem" data-code="park-cxzy" class="billboard_item" src="/images/billboard/3.png"></image> <image bindtap="onClickItem" data-code="park-cxzy" class="billboard_item" src="images/3.png"></image>
<image bindtap="onClickItem" data-code="park-lswh" class="billboard_item" src="/images/billboard/3.png"></image> <image bindtap="onClickItem" data-code="park-lswh" class="billboard_item" src="images/4.png"></image>
</view> </view>

23
pages/billboards/park/park-list/index.js

@ -35,7 +35,30 @@ Page({
const page = this.data.curPage const page = this.data.curPage
billboard.fetchBailList(curCode, page, res => { billboard.fetchBailList(curCode, page, res => {
console.log(res) console.log(res)
const list = res.list
if (page == 1) {
this.setData({
list: list
})
} else {
if (list.length > 0) {
const list = [...this.data.list, ...list]
this.setData({
list: list
})
} else {
const page = this.data.currPage - 1
this.setData({
currPage: page
})
wx.showToast({
title: '已加载全部',
icon: 'none'
})
}
}
}) })
wx.stopPullDownRefresh()
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作

3
pages/billboards/park/park-list/index.wxml

@ -1,7 +1,8 @@
<!--pages/billboards/park/index.wxml--> <!--pages/billboards/park/index.wxml-->
<view class="container"> <view class="container">
<block wx:for="{{list}}" wx:key="park-list-{{index}}"> <block wx:for="{{list}}" wx:key="park-list-{{index}}">
<e-card cId="{{index}}" <e-card cId="{{item.id}}"
title="{{item.title}}"
tag-class="e_card" tag-class="e_card"
bind:clickCardItem="clickCardItem"/> bind:clickCardItem="clickCardItem"/>
</block> </block>

3
pages/billboards/policy/policy-list/index.js

@ -42,9 +42,8 @@ Page({
fetchPolicyArtice () { fetchPolicyArtice () {
policy.fetchPolicyArtice(this.data.curCode, res => { policy.fetchPolicyArtice(this.data.curCode, res => {
console.log(res) console.log(res)
const list = res.list
this.setData({ this.setData({
nodes: list[0].content nodes: res.data.content
}) })
}) })
} }

5
pages/home/index.js

@ -26,6 +26,11 @@ Page({
currPage: 1, currPage: 1,
}) })
this.fetchHomeList() this.fetchHomeList()
wx.vibrateShort({
success () {
console.log('震动')
}
})
}, },
/** /**

2
pages/home/index.json

@ -1,5 +1,7 @@
{ {
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"backgroundColor": "#f7f7f7",
"backgroundTextStyle": "dark",
"usingComponents": { "usingComponents": {
"e-swiper": "/components/swiper/index", "e-swiper": "/components/swiper/index",
"e-focus": "/components/focus/index", "e-focus": "/components/focus/index",

Loading…
Cancel
Save