Browse Source

no message

featrue/v4.5
xpz2018 4 years ago
parent
commit
e8da6a9799
8 changed files with 33 additions and 19 deletions
  1. 14
      app.js
  2. 3
      app.json
  3. 8
      libs/tdweapp-conf.js
  4. 1
      libs/tdweapp.js
  5. 2
      pages/index/index.wxml
  6. 10
      pages/moment/fragment/index.js
  7. 10
      pages/moment/fragment/index.wxml
  8. 4
      utils/util.js

14
app.js

@ -1,4 +1,5 @@
//app.js //app.js
const tdsdk = require('./libs/tdweapp.js');
App({ App({
//----------------------------------------------globalData-------------------------------------- //----------------------------------------------globalData--------------------------------------
evn: 0,//0:开发环境,1:测试环境,2:生产环境 evn: 0,//0:开发环境,1:测试环境,2:生产环境
@ -15,7 +16,11 @@ App({
isIos: false, isIos: false,
kg: 0 kg: 0
}, },
onShow: function() {
onLaunch: function(options) {
tdsdk.App.onLaunch(options)//包含sdk初始化,必须调用
},
onShow: function(options) {
tdsdk.App.onShow(options)
if (wx.canIUse('getUpdateManager')) { if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager() const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function (res) { updateManager.onCheckForUpdate(function (res) {
@ -84,10 +89,13 @@ App({
wx.onAppRoute(function (res) { wx.onAppRoute(function (res) {
let pages = getCurrentPages() let pages = getCurrentPages()
let page = pages[pages.length - 1] let page = pages[pages.length - 1]
if(page && page.route == 'pages/index/index' && !page.data.inited ){
if(page && page.route == 'pages/index/index' && !page.data.inited){
page.onResume() page.onResume()
} }
}) })
},
onHide: function(){
tdsdk.App.onHide()
} }
}) })

3
app.json

@ -25,7 +25,6 @@
"pages/shop/order/index", "pages/shop/order/index",
"pages/shop/bidding/index", "pages/shop/bidding/index",
"pages/shop/bill/index", "pages/shop/bill/index",
"pages/goods/ablility/index",
"pages/goods/index/index", "pages/goods/index/index",
"pages/goods/detail/index", "pages/goods/detail/index",
"pages/goods/create/index", "pages/goods/create/index",
@ -86,7 +85,7 @@
], ],
"permission": { "permission": {
"scope.userLocation": { "scope.userLocation": {
"desc": "您的位置信息将用于获取您所在城市的最新纸厂报价、行情、咨询、排队扣点等信息,纸通宝为您提供更好的服务。"
"desc": "您的位置信息将用于获取您所在城市的最新纸厂行情、报价等信息。"
} }
}, },
"window": { "window": {

8
libs/tdweapp-conf.js

@ -0,0 +1,8 @@
exports.config = {
appkey: '35E031ED55664D46B6D35742D7D73D2C',
appName: '纸通宝交易版',
versionName: '2.25.0',
versionCode: '322',
wxAppid: 'wx7a4a8415e6821108',
getLocation: true // 默认不获取用户位置
}

1
libs/tdweapp.js
File diff suppressed because it is too large
View File

2
pages/index/index.wxml

@ -3,7 +3,7 @@
<article id="{{TabList[0].value}}" city-name="{{cityName}}" bind:click="onAgentClick"/> <article id="{{TabList[0].value}}" city-name="{{cityName}}" bind:click="onAgentClick"/>
</swiper-item> </swiper-item>
<swiper-item catchtouchmove="stopTouchMove"> <swiper-item catchtouchmove="stopTouchMove">
<moment id="{{TabList[1].value}}" city-name="{{cityName}}" bind:picker="onPicker"/>
<moment id="{{TabList[1].value}}" height="{{fragment}}" city-name="{{cityName}}" bind:picker="onPicker"/>
</swiper-item> </swiper-item>
<swiper-item catchtouchmove="stopTouchMove"> <swiper-item catchtouchmove="stopTouchMove">
<agent id="{{TabList[2].value}}" city-list="{{cityList}}" bind:region="onRegionList" bind:picker="onPicker"/> <agent id="{{TabList[2].value}}" city-list="{{cityList}}" bind:region="onRegionList" bind:picker="onPicker"/>

10
pages/moment/fragment/index.js

@ -10,16 +10,14 @@ Component({
multipleSlots: true multipleSlots: true
}, },
properties:{ properties:{
cityName: { //这个是可以自定义最外层的view的样式
type: String,
value: ''
}
cityName: { type: String, value: '' },
height: { type: Number, value: 0 }
}, },
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
height: app.globalData.safeFragmentHeight - 270,
fragmentHeight: app.globalData.safeFragmentHeight - 270,
safeBottom: app.globalData.safeBottom, safeBottom: app.globalData.safeBottom,
kg: app.globalData.kg, kg: app.globalData.kg,
firstShow: false, firstShow: false,
@ -40,7 +38,7 @@ Component({
onRestart: function () { onRestart: function () {
if(!this.data.firstShow){ if(!this.data.firstShow){
this.setData({ this.setData({
height: app.globalData.safeFragmentHeight - 270,
fragmentHeight: this.data.height - 167 - app.globalData.customHeight,
StatusBar: app.globalData.StatusBar || 40, StatusBar: app.globalData.StatusBar || 40,
customHeight: app.globalData.customHeight, customHeight: app.globalData.customHeight,
safeBottom: app.globalData.safeBottom, safeBottom: app.globalData.safeBottom,

10
pages/moment/fragment/index.wxml

@ -31,18 +31,18 @@
<wux-tabi tab-data="{{tabList}}" tab-index="{{tabIndex}}" line-height="{{4}}" scroll="{{false}}" bind:change="onTabChange"></wux-tabi> <wux-tabi tab-data="{{tabList}}" tab-index="{{tabIndex}}" line-height="{{4}}" scroll="{{false}}" bind:change="onTabChange"></wux-tabi>
</view> </view>
<swiper current="{{tabIndex}}" duration="0" style="height:{{height}}rpx">
<swiper current="{{tabIndex}}" duration="0" style="height:{{fragmentHeight}}rpx">
<swiper-item catchtouchmove="stopTouchMove"> <swiper-item catchtouchmove="stopTouchMove">
<recommend id="recommend" height="{{height}}"/>
<recommend id="recommend" height="{{fragmentHeight}}"/>
</swiper-item> </swiper-item>
<swiper-item catchtouchmove="stopTouchMove"> <swiper-item catchtouchmove="stopTouchMove">
<attention id="attention" height="{{height}}"/>
<attention id="attention" height="{{fragmentHeight}}"/>
</swiper-item> </swiper-item>
<swiper-item catchtouchmove="stopTouchMove"> <swiper-item catchtouchmove="stopTouchMove">
<theall id="theall" height="{{height}}"/>
<theall id="theall" height="{{fragmentHeight}}"/>
</swiper-item> </swiper-item>
<swiper-item catchtouchmove="stopTouchMove"> <swiper-item catchtouchmove="stopTouchMove">
<information id="information" height="{{height}}"/>
<information id="information" height="{{fragmentHeight}}"/>
</swiper-item> </swiper-item>
</swiper> </swiper>

4
utils/util.js

@ -207,7 +207,7 @@ function navigateTarget(redirectInfo){
if(redirectInfo.targetView == 'showImage'){ if(redirectInfo.targetView == 'showImage'){
navigateTo('/pages/html/banner/index?src=' + redirectInfo.params.id) navigateTo('/pages/html/banner/index?src=' + redirectInfo.params.id)
} else if(redirectInfo.targetView == 'showBidList'){ } else if(redirectInfo.targetView == 'showBidList'){
navigateTo('/pages/goods/ablility/index')
navigateTo('/pages/mall/index/index')
} else if(redirectInfo.targetView == 'showProxyList'){ } else if(redirectInfo.targetView == 'showProxyList'){
navigateTo('/pages/agent/index/index') navigateTo('/pages/agent/index/index')
} else if(redirectInfo.targetView == 'showQNPrice'){ } else if(redirectInfo.targetView == 'showQNPrice'){
@ -227,7 +227,7 @@ function navigateTarget(redirectInfo){
} else if(redirectInfo.targetView == 'showPurchaseList'){ } else if(redirectInfo.targetView == 'showPurchaseList'){
navigateTo('/pages/purchase/ablility/index') navigateTo('/pages/purchase/ablility/index')
} else if(redirectInfo.targetView == 'showProductList'){ } else if(redirectInfo.targetView == 'showProductList'){
navigateTo('/pages/goods/ablility/index?type=1')
navigateTo('/pages/mall/index/index?type=1')
} else if(redirectInfo.targetView == 'logistics'){ } else if(redirectInfo.targetView == 'logistics'){
navigateTo('/pages/html/logistics/index') navigateTo('/pages/html/logistics/index')
} else if(redirectInfo.targetView == 'contract'){ } else if(redirectInfo.targetView == 'contract'){

Loading…
Cancel
Save