Browse Source

no message

featrue/v4.5
xpz2018 4 years ago
parent
commit
60527c8118
24 changed files with 628 additions and 11 deletions
  1. 2
      app.js
  2. 1
      app.json
  3. 2
      colorui/main.wxss
  4. 135
      pages/agent/fragment/index.js
  5. 14
      pages/agent/fragment/index.json
  6. 41
      pages/agent/fragment/index.wxml
  7. 1
      pages/agent/fragment/index.wxss
  8. 163
      pages/article/fragment/index.js
  9. 14
      pages/article/fragment/index.json
  10. 96
      pages/article/fragment/index.wxml
  11. 39
      pages/article/fragment/index.wxss
  12. 18
      pages/article/information-item/index.js
  13. 9
      pages/article/information-item/index.json
  14. 18
      pages/article/information-item/index.wxml
  15. 23
      pages/article/information-item/index.wxss
  16. 17
      pages/home/city-select/index.js
  17. 6
      pages/home/city-select/index.json
  18. 10
      pages/home/city-select/index.wxml
  19. 1
      pages/home/city-select/index.wxss
  20. 10
      pages/index/index.js
  21. 3
      pages/index/index.json
  22. 5
      pages/index/index.wxml
  23. 9
      pages/index/index.wxs
  24. 2
      pages/mall/index/index.wxml

2
app.js

@ -51,7 +51,7 @@ App({
// 顶部操作栏高度 // 顶部操作栏高度
this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight + (this.globalData.isIos ? 4 : 0) this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight + (this.globalData.isIos ? 4 : 0)
let windowHeight = e.windowHeight * (750 / e.windowWidth) let windowHeight = e.windowHeight * (750 / e.windowWidth)
this.globalData.customHeight = this.globalData.CustomBar * (750 / e.windowWidth)
let safeBottom = e.windowHeight - e.safeArea.bottom let safeBottom = e.windowHeight - e.safeArea.bottom
if(safeBottom > e.windowHeight){ if(safeBottom > e.windowHeight){
safeBottom = 34 safeBottom = 34

1
app.json

@ -9,6 +9,7 @@
"pages/home/setting/index", "pages/home/setting/index",
"pages/home/authory/index", "pages/home/authory/index",
"pages/home/certificate/index", "pages/home/certificate/index",
"pages/home/city-select/index",
"pages/home/idcard/index", "pages/home/idcard/index",
"pages/home/info/index", "pages/home/info/index",
"pages/home/tab1/index", "pages/home/tab1/index",

2
colorui/main.wxss

@ -987,7 +987,7 @@ button.icon.lg {
.cu-custom .cu-bar { .cu-custom .cu-bar {
min-height: 0px; min-height: 0px;
padding-right: 220rpx;
padding-right: 212rpx;
z-index: 99; z-index: 99;
/* box-shadow: 0rpx 0rpx 0rpx; */ /* box-shadow: 0rpx 0rpx 0rpx; */
box-shadow: 0 -1rpx 2rpx rgba(0, 0, 0, 0.01) box-shadow: 0 -1rpx 2rpx rgba(0, 0, 0, 0.01)

135
pages/agent/fragment/index.js

@ -0,0 +1,135 @@
// pages/agent/index/index.js
import { getFactoryPrice, getFactoryCity, hasActivity } from "../../api/ztb"
const app = getApp()
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
/**
* 页面的初始数据
*/
data: {
height: app.globalData.safeFragmentHeight - 190,
CustomBar: app.globalData.CustomBar,
kg: app.globalData.kg,
loading: true,
requesting: false,
finished: false,
tabList: [],
tabIndex: 0,
cateList: [],
scrolled: false,
top: 0,
orderList: [],
form: {
cityId: '',
enableSalesAgent: 1,
pageNum: 1,
pageSize:15,
listType: 0
},
triggered: false,
firstShow: false,
hasActivity: false
},
lifetimes: {
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
attached: function () {
if(app.globalData.userInfo){
hasActivity().then(result => {
this.setData({ hasActivity: result.data })
})
}
}
},
methods: {
onRestart: function(){
if (!this.data.firstShow) {
this.setData({ height: app.globalData.safeFragmentHeight - 190, kg: app.globalData.kg })
this.fetchRegionList()
this.fetchPapersList()
}
this.data.firstShow = true
},
toAbility: function(){
wx.navigateTo({ url: '/pages/agent/ability/index' })
},
fetchRegionList: function () {
getFactoryCity().then(result => {
//成功回调
this.data.cateList = [{ cityId: '', cityName: '全部' }].concat(result.data)
for (let index = 0; index < this.data.cateList.length; index++) {
this.data.tabList.push(this.data.cateList[index].cityName)
}
this.setData({ tabList: this.data.tabList, scrolled: this.data.cateList.length >= 5 })
})
},
onTabChange: function ({ detail }) {
if (this.data.tabIndex == Number(detail.index)) {
return
}
this.data.tabIndex = Number(detail.index)
this.data.form.cityId = this.data.cateList[this.data.tabIndex].cityId
this.onRefreshList()
},
// 下拉刷新...
onRefreshList: function () {
if (this.data.requesting) {
return
}
this.setData({ orderList: [], tabIndex: this.data.tabIndex, ['form.pageNum']: 1, loading: true, finished: false })
this.fetchPapersList()
},
// 获取特价列表
fetchPapersList: function () {
if (this.data.requesting || this.data.finished) {
return
}
if (this.data.loading) {
this.data.requesting = true
} else {
this.setData({ requesting: true })
}
getFactoryPrice(this.data.form).then(result => {
if (result.data.records.length) {
var respList = result.data.records
let nowList = `orderList[${this.data.orderList.length}]`
var num = result.data.current
var finished = result.data.current >= result.data.pages
if (this.data.form.pageNum == 1) {
this.setData({
[nowList]: respList,
total: result.data.total,
['form.pageNum']: (num + 1),
top: 0,
finished,
requesting: false,
loading: false
})
} else {
this.setData({
[nowList]: respList,
total: result.data.total,
['form.pageNum']: (num + 1),
finished,
requesting: false,
loading: false
})
}
} else {
this.setData({ requesting: false, finished: true, loading: false, })
}
}).catch(err => {
//异常回调
this.setData({ requesting: false, finished: true, loading: false, })
})
},
goattentionIndex: function () {
wx.navigateTo({ url: '/pages/home/attentionPaperList/index' })
}
}
})

14
pages/agent/fragment/index.json

@ -0,0 +1,14 @@
{
"component": true,
"usingComponents": {
"wux-skeleton": "/components/skeleton/index",
"wux-skeleton-avatar": "/components/skeleton-avatar/index",
"wux-skeleton-paragraph": "/components/skeleton-paragraph/index",
"wux-button": "/components/button/index",
"refresh-view": "/components/refresher/index",
"wux-tabi": "/components/tabi/index",
"wux-image": "/components/image/index",
"wux-divider": "/components/divider/index",
"agent-item": "/pages/agent/agent-item/index"
}
}

41
pages/agent/fragment/index.wxml

@ -0,0 +1,41 @@
<!--pages/agent/index/index.wxml-->
<wxs module="formate" src="../../../pages/formate.wxs"></wxs>
<cu-custom bgColor="bg-white" isBack="{{false}}">
<view slot="content" style="color:black;font-size:36rpx">交易</view>
</cu-custom>
<view class="bg-white" style="height: 90rpx;">
<wux-tabi scroll="{{scrolled}}" tab-data="{{tabList}}" tab-index="{{tabIndex}}" bind:change="onTabChange"></wux-tabi>
</view>
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchPapersList">
<view class="bg-white list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}">
<view class="load-spinner text-gray" style="margin-bottom:24px" wx:if="{{loading}}" />
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image>
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view>
</view>
<view wx:else>
<view class="bg-white" wx:if="{{hasActivity}}" bindtap="toAbility">
<wux-image width="{{750}}" height="{{160}}" nuit="{{'rpx'}}" src="https://img.imgdb.cn/item/603f4f7e360785be54c19c1d.png" mode="aspectFill">
<view class="flex flex-center" slot="loading" style="height:146rpx;width:686rpx">
<text class="icon--refresher"></text>
</view>
</wux-image>
</view>
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex">
<view wx:for="{{pageItem}}" wx:key="index">
<view style="height:16rpx" wx:if="{{pageIndex != 0 || index != 0 }}"></view>
<agent-item item="{{item}}"></agent-item>
</view>
</view>
<!--加载更多的UI-->
<view wx:if="{{form.pageNum>1}}" style="padding:20rpx">
<wux-divider>
<view class="loadmore">
<text class="icon--refresher" wx:if="{{!finished}}"></text>
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text>
</view>
</wux-divider>
</view>
</view>
</refresh-view>

1
pages/agent/fragment/index.wxss

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

163
pages/article/fragment/index.js

@ -0,0 +1,163 @@
// pages/message/index.js
import { getFactoryPrice, getProductList, getMiniProxyList, getBannerList, getSuccessNotices } from "../../api/ztb"
const event = require('../../../utils/event')
const util = require('../../../utils/util')
const app = getApp()
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
/**
* 页面的初始数据
*/
data: {
height: app.globalData.safeFragmentHeight - 100,
kg: app.globalData.kg,
stickyTop: app.globalData.CustomBar,
firstShow: false,
banning: true,
bannerList: [],
noticeList: [],
iconList: [
{ icon: '/assets/image/ico_trade.png', badge: 0, name: '特价专区' },
{ icon: '/assets/image/ico_purchase.png', badge: 0, name: '采购商品' },
{ icon: '/assets/image/ico_agent.png', badge: 0, name: '我要代卖' },
{ icon: '/assets/image/ico_index.png', badge: 0, name: '价格指数' },
{ icon: '/assets/image/ico_price.png', badge: 0, name: '实时价格' },
{ icon: '/assets/image/ico_queue.png', badge: 0, name: '车辆排队' }
],
tabList: [ '代卖', '卖废纸', '买废纸' ],
tabIndex: 0,
loading: true,
requesting: false,
finished: false,
form: { pageNum: 1 },
orderList: [1, 2, 3, 5]
},
lifetimes: {
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
attached: function () {
event.on('EventMessage', this, this.onEvent)
},
detached: function () {
event.remove('EventMessage', this)
}
},
methods: {
onRestart: function () {
if(!this.data.firstShow){
this.setData({
height: app.globalData.safeFragmentHeight - 100,
kg: app.globalData.kg,
stickyTop: app.globalData.CustomBar,
StatusBar: app.globalData.StatusBar || 40,
customHeight: app.globalData.customHeight,
CustomBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 80),
firstShow: true
})
this.fetchAgentList()
}
this.data.firstShow = true
if(!this.data.bannerList.length){
getBannerList(1).then(result => {
this.setData({ bannerList: result.data })
}).catch(err => {
})
}
if(!this.data.noticeList.length){
this.fetchNoticeList()
}
},
onEvent: function (message) {
console.log('mall>>index>>onEvent', message)
if (message.what == 10 && app.globalData.isVIP == 1) {
// this.setData({ token: app.globalData.token })
// this.onRefreshList()
} else if(message.what == 1001){
this.setData({ kg: app.globalData.kg })
} else if(message.what == 888){
this.setData({ orderList: [], ['form.pageNum']: 1, loading: true, finished: false })
this.fetchAgentList()
}
},
chooseCity: function(){
var that = this
console.log('chooseCity>>>')
wx.navigateTo({
url: `/pages/home/city-select/index?type=1`,
events: {
onCallback: (data) => {
}
}
})
},
searchList: function(){
},
postList: function(){
},
tapBanner: function(e){
var item = this.data.bannerList[e.currentTarget.dataset.index]
if(item.redirectInfo.targetView == 'showH5'){
util.navigateTo('/pages/html/html/index?link=' + item.redirectInfo.params.id + '?title=' + item.title)
return
}
util.navigateTarget(item.redirectInfo)
},
onTabChange: function({detail}){
if(this.data.tabIndex == Number(detail.index)){
return
}
this.fetchAgentList()
},
fetchNoticeList: function(){
if (this.data.loopRequesting) {
return
}
this.data.loopRequesting = true
getSuccessNotices().then(result => {
this.data.loopRequesting = false
this.data.noticeList = []
if(result.data && result.data.length){
for (let index = 0; index < result.data.length; index++) {
this.data.noticeList.push(result.data[index].msg)
}
this.setData({noticeList: this.data.noticeList})
}
}).catch(err => {
this.data.loopRequesting = false
})
},
//*************************************************fetchAgentList************************************************//
// 获取特价列表
fetchAgentList: function () {
if (this.data.requesting || this.data.finished) {
return
}
if (this.data.loading) {
this.data.requesting = true
} else {
this.setData({ requesting: true })
}
getFactoryPrice(this.data.form).then(result => {
if (result.data.records.length) {
var respList = result.data.records
let nowList = `orderList[${this.data.orderList.length}]`
var num = result.data.current
var finished = result.data.current >= result.data.pages
this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false })
} else {
this.setData({ requesting: false, finished: true, loading: false })
}
}).catch(err => {
//异常回调
this.setData({ requesting: false, finished: true, loading: false })
})
}
}
})

14
pages/article/fragment/index.json

@ -0,0 +1,14 @@
{
"component": true,
"usingComponents": {
"wux-tabi": "/components/tabi/index",
"wux-skeleton": "/components/skeleton/index",
"wux-skeleton-avatar": "/components/skeleton-avatar/index",
"wux-skeleton-paragraph": "/components/skeleton-paragraph/index",
"wux-image": "/components/image/index",
"refresh-view": "/components/refresher/index",
"wux-sticky": "/components/sticky/index",
"wux-divider": "/components/divider/index",
"information-item": "/pages/article/information-item/index"
}
}

96
pages/article/fragment/index.wxml

@ -0,0 +1,96 @@
<!--pages/message/index.wxml-->
<wxs module="formate" src="../../../pages/formate.wxs"></wxs>
<view class="cu-custom top-bg" style="height:{{customHeight}}rpx;z-index: 1;">
<view class="cu-bar fixed " style="height:{{customHeight}}rpx;padding-top:{{StatusBar}}rpx;border-bottom:none">
<view class="flex flex-center" style="margin-left: 32rpx;width: 100%;">
<view class="flex flex-center" catchtap="chooseCity">
<text class="text-white text-lg">广州</text>
<text class="cuIcon-unfold text-white" style="font-size:16px;padding-top: 8rpx;margin-left: 8rpx;"></text>
</view>
<view class="bg-white flex flex-center" style="margin-left:24rpx;flex: 1;border-radius: 16rpx;height: 60rpx;" catchtap="searchList">
<text class="cuIcon-search text-gray" style="font-size:12px;margin-left: 24rpx;padding-top: 4rpx;"></text>
<text class="text-gray text-sm" style="flex: 1;margin-left: 8rpx">输入纸名/品名/纸厂/规格</text>
</view>
</view>
</view>
</view>
<view class="top-bg" style="height: 24rpx;"></view>
<scroll-view scroll-y class="mian-list" style="height: {{height}}rpx;" bind:scrolltolower="fetchAgentList">
<view wx:if="{{bannerList.length}}" style="height:270rpx;min-height: 270rpx;margin-top: 16rpx;">
<swiper class="screen-swiper" circular="{{true}}" indicator-dots="{{false}}" autoplay="true" interval="5000" duration="500">
<swiper-item wx:for="{{bannerList}}" wx:key="index" >
<wux-image width="{{702}}" height="{{270}}" wux-class="banner" nuit="{{'rpx'}}" src="{{item.picUrl}}" mode="aspectFill" data-index="{{index}}" bind:click="tapBanner">
<view class="flex flex-center" slot="loading" style="height:270rpx;width:702rpx">
<text class="icon--refresher"></text>
</view>
</wux-image>
</swiper-item>
</swiper>
</view>
<view class="flex" style="margin-top:16rpx">
<wux-image width="{{294}}" height="{{180}}" wux-class="banner" nuit="{{'rpx'}}" src="{{bannerList[0].picUrl}}" mode="aspectFill" bind:click="tapBanner">
</wux-image>
<wux-image width="{{180}}" height="{{180}}" wux-class="banner-left" nuit="{{'rpx'}}" src="{{bannerList[0].picUrl}}" mode="aspectFill" bind:click="tapBanner">
</wux-image>
<wux-image width="{{180}}" height="{{180}}" wux-class="banner-left" nuit="{{'rpx'}}" src="{{bannerList[0].picUrl}}" mode="aspectFill" bind:click="tapBanner">
</wux-image>
</view>
<view class="bg-white" style="margin-top:16rpx;border-radius: 24rpx;">
<view class="flex flex-justify" style="padding: 20rpx 24rpx;" bindtap="postList">
<view class="text-lg text-bold text-black">最新资讯</view>
<view class="flex flex-center">
<text class="text-gray">更多</text>
<text class="cuIcon-right text-gray" style="font-size:14px;margin-left: 4rpx;padding-top: 4rpx;"></text>
</view>
</view>
<view class="flex flex-justify" style="padding: 0rpx 24rpx 24rpx 24rpx;" bindtap="postList">
<view class="text-df text-black">【预测】8月26日湖南衡山新金龙纸业废纸</view>
<view class="text-gray">09-07</view>
</view>
<view class="flex flex-justify" style="padding: 0rpx 24rpx 24rpx 24rpx;" bindtap="postList">
<view class="text-df text-black">【预测】8月26日湖南衡山新金龙纸业废纸</view>
<view class="text-gray">09-07</view>
</view>
<view class="flex flex-justify" style="padding: 0rpx 24rpx 24rpx 24rpx;" bindtap="postList">
<view class="text-df text-black">【预测】8月26日湖南衡山新金龙纸业废纸</view>
<view class="text-gray">09-07</view>
</view>
</view>
<view class="bg-white" style="margin-top:16rpx;border-radius: 24rpx;">
<view class="flex flex-justify" style="padding: 20rpx 24rpx;" bindtap="postList">
<view class="text-lg text-bold text-black">价格比一比</view>
<view class="flex flex-center">
<text class="text-gray">更多</text>
<text class="cuIcon-right text-gray" style="font-size:14px;margin-left: 4rpx;padding-top: 4rpx;"></text>
</view>
</view>
<view class="bg-white" style="height:90rpx;border-bottom:2rpx solid #f3f3f3;border-top:2rpx solid #f3f3f3">
<wux-tabi tab-data="{{tabList}}" tab-index="{{tabIndex}}" padding="{{12}}" bind:change="onTabChange"></wux-tabi>
</view>
</view>
<wux-skeleton active wx:if="{{!orderList.length}}">
<view class="flex item-content" wx:for="{{4}}" wx:key="index">
<wux-skeleton-paragraph rounded rows="42" wux-class="case3-class" />
</view>
</wux-skeleton>
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{orderList}}" wx:key="pageIndex">
<view wx:for="{{pageItem}}" wx:key="index">
<view class="bg-white" style="padding: 0rpx 32rpx" wx:if="{{pageIndex != 0 || index != 0 }}">
<wux-divider show-text="{{ false }}"></wux-divider>
</view>
<information-item item="{{item}}"></information-item>
</view>
</view>
<!--加载更多的UI-->
<view wx:if="{{form.pageNum > 1}}" style="padding:20rpx">
<wux-divider>
<view class="loadmore">
<text class="icon--refresher" wx:if="{{!finished}}"></text>
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text>
</view>
</wux-divider>
</view>
</scroll-view>

39
pages/article/fragment/index.wxss

@ -0,0 +1,39 @@
.top-bg{
background-image: linear-gradient(127deg, rgba(0,122,255,0.67) 0%, rgba(13,100,227,0.95) 100%);
}
.mian-list{
background-color: #f9f9f9;
border-radius: 24rpx 24rpx 0 0;
margin-top: -24rpx;
padding: 0 24rpx;
}
.banner{
border-radius: 16rpx;
}
.banner-left{
margin-left: 24rpx;
border-radius: 16rpx;
}
.item-content {
background: rgba(255, 255, 255, 1);
padding:32rpx
}
.tui-swiper {
margin-left: 8rpx;
font-size: 26rpx;
height: 60rpx;
flex: 1;
}
.tui-news-item {
line-height: 28rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #555;
}

18
pages/article/information-item/index.js

@ -0,0 +1,18 @@
// pages/stock/index.js
const util = require('../../../utils/util')
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
properties: {
item: { type: Object, value: null },
mclick: { type: Boolean, value: true }
},
methods: {
lookItem: function(e){
util.navigateTo('/pakageInfo/pages/article/detail/index?id=' + this.data.item.id)
}
}
})

9
pages/article/information-item/index.json

@ -0,0 +1,9 @@
{
"component": true,
"usingComponents": {
"wux-image": "/components/image/index",
"sudoku-image": "/components/sudoku-image/index",
"fold-text": "/components/fold-text/index",
"wux-tag": "/components/tag/index"
}
}

18
pages/article/information-item/index.wxml

@ -0,0 +1,18 @@
<!--pages/main/index.wxml-->
<view class="bg-white flex flex-justify" style="padding:18rpx 24rpx">
<view style="flex: 2;">
<view class="text-df text-black">一级纸 东莞金洲</view>
<view class="text-gray text-xs" style="margin-top: 6rpx;">2021年9月14日 13:47:17</view>
</view>
<view style="flex: 1;">
<view class="flex flex-center">
<text class="text-lg text-red">2560</text>
<text class="cuIcon-refresharrow text-red" style="font-size:12px;margin-left: 4rpx;"></text>
</view>
<view class="text-gray text-sm" style="margin-top: 4rpx;text-align: center">当前价</view>
</view>
<view style="flex: 1;">
<view class="text-df text-green" style="text-align: center">+20</view>
<view class="text-gray text-sm" style="margin-top: 4rpx;text-align: center">较上次</view>
</view>
</view>

23
pages/article/information-item/index.wxss

@ -0,0 +1,23 @@
/* pages/main/index.wxss */
.image-load {
width: 50px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50rpx;
}
.bottomViewRightImg {
width: 290rpx;
height: 200rpx;
overflow: hidden;
}
.bottomViewRight {
width: 290rpx;
height: 200rpx !important;
overflow: hidden;
}
.imgZt{
display: flex;
justify-content: flex-start;
}

17
pages/home/city-select/index.js

@ -0,0 +1,17 @@
// pages/home/about/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
}
})

6
pages/home/city-select/index.json

@ -0,0 +1,6 @@
{
"usingComponents": {
"wux-cell-group": "/components/cell-group/index",
"wux-cell": "/components/cell/index"
}
}

10
pages/home/city-select/index.wxml

@ -0,0 +1,10 @@
<!--pages/home/about/index.wxml-->
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">关于纸通宝</view>
</cu-custom>
<view style="height:32rpx"></view>
<wux-cell-group>
<wux-cell title="纸通宝平台交易规则" is-link url="/pages/html/rules/index"></wux-cell>
<wux-cell title="商品交易风险提示书" is-link url="/pages/html/risk/index"> </wux-cell>
</wux-cell-group>

1
pages/home/city-select/index.wxss

@ -0,0 +1 @@
/* pages/home/about/index.wxss */

10
pages/index/index.js

@ -9,11 +9,13 @@ const app = getApp()
Page({ Page({
data: { data: {
TabList: [{ index: 0, value: 'article', badge: 0, name: '情报' },
{ index: 1, value: 'mall', badge: 0, name: '交易' },
{ index: 2, value: 'home', badge: 0, name: '我的' }
TabList: [
{ index: 0, value: 'article', badge: 0, name: '情报' },
{ index: 1, value: 'mall', badge: 0, name: '行情' },
{ index: 2, value: 'agent', badge: 0, name: '交易' },
{ index: 3, value: 'home', badge: 0, name: '我的' }
], ],
pageIndex: 1,
pageIndex: 0,
safeBottom: app.globalData.safeBottom, safeBottom: app.globalData.safeBottom,
inited: false, inited: false,
path: null, path: null,

3
pages/index/index.json

@ -1,7 +1,8 @@
{ {
"usingComponents": { "usingComponents": {
"mall": "/pages/mall/index/index", "mall": "/pages/mall/index/index",
"article": "/pages/article/newInfo/index",
"article": "/pages/article/fragment/index",
"agent": "/pages/agent/fragment/index",
"home": "/pages/home/index/index", "home": "/pages/home/index/index",
"wux-image": "/components/image/index", "wux-image": "/components/image/index",
"wux-popup": "/components/popup/index" "wux-popup": "/components/popup/index"

5
pages/index/index.wxml

@ -8,7 +8,10 @@
<mall id="{{TabList[1].value}}" /> <mall id="{{TabList[1].value}}" />
</swiper-item> </swiper-item>
<swiper-item catchtouchmove="stopTouchMove"> <swiper-item catchtouchmove="stopTouchMove">
<home id="{{TabList[2].value}}" />
<agent id="{{TabList[2].value}}" />
</swiper-item>
<swiper-item catchtouchmove="stopTouchMove">
<home id="{{TabList[3].value}}" />
</swiper-item> </swiper-item>
</swiper> </swiper>

9
pages/index/index.wxs

@ -9,12 +9,17 @@ function tabImage(tabIndex, index) {
return '/assets/image/icon_trans_blue.png' return '/assets/image/icon_trans_blue.png'
} }
return '/assets/image/icon_trans_gray.png' return '/assets/image/icon_trans_gray.png'
} else if (index == 2) {
} else if (index == 2) {
if(tabIndex == index){ if(tabIndex == index){
return '/assets/image/icon_self_blue.png' return '/assets/image/icon_self_blue.png'
} }
return '/assets/image/icon_self_gray.png' return '/assets/image/icon_self_gray.png'
}
} else if (index == 3) {
if(tabIndex == index){
return '/assets/image/icon_self_blue.png'
}
return '/assets/image/icon_self_gray.png'
}
return '' return ''
} }

2
pages/mall/index/index.wxml

@ -19,7 +19,7 @@
<view class="bg-white flex flex-center" style="height:60rpx;padding-right:16rpx;margin-top:16rpx"> <view class="bg-white flex flex-center" style="height:60rpx;padding-right:16rpx;margin-top:16rpx">
<image style="width:200rpx;height:60rpx;" src="/assets/image/ico_notice.png"></image> <image style="width:200rpx;height:60rpx;" src="/assets/image/ico_notice.png"></image>
<!-- <text class="cuIcon-notification text-yellow" style="font-size:36rpx;margin:0rpx 16rpx;"></text> --> <!-- <text class="cuIcon-notification text-yellow" style="font-size:36rpx;margin:0rpx 16rpx;"></text> -->
<swiper vertical="{{true}}" autoplay="{{true}}" circular="{{true}}" interval="5000" class="tui-swiper">
<swiper vertical="{{true}}" autoplay="{{true}}" circular="{{true}}" interval="3000" class="tui-swiper">
<swiper-item wx:for="{{noticeList}}" wx:key="index" class="flex flex-center" catchtouchmove="stopTouchMove" style="justify-content: flex-start"> <swiper-item wx:for="{{noticeList}}" wx:key="index" class="flex flex-center" catchtouchmove="stopTouchMove" style="justify-content: flex-start">
<view class="tui-news-item">{{item}}</view> <view class="tui-news-item">{{item}}</view>
</swiper-item> </swiper-item>

Loading…
Cancel
Save