Browse Source

Merge branch 'featrue/v.4.0' into featrue/v4.1

# Conflicts:
#	pages/index/index.js
#	pages/login/index.js
featrue/v4.1
xpz2018 5 years ago
parent
commit
15624beb24
8 changed files with 95 additions and 12 deletions
  1. 2
      app.js
  2. 4
      components/popup/index.wxss
  3. 27
      pages/index/index.js
  4. 4
      pages/index/index.json
  5. 33
      pages/index/index.wxml
  6. 27
      pages/index/index.wxss
  7. 1
      pages/login/index.js
  8. 9
      utils/request.js

2
app.js

@ -1,5 +1,5 @@
//app.js
App({
App({
//----------------------------------------------globalData--------------------------------------
release: 0,
httpUrl: 'https://api.qniao.cn',

4
components/popup/index.wxss

@ -1,8 +1,8 @@
.wux-popup {
position: fixed;
z-index: 1000;
width: 80%;
max-width: 600rpx
width: 100%;
max-width: 680rpx
}
.wux-popup-position.wux-popup-position--center .wux-popup {
top: 50%;

27
pages/index/index.js

@ -14,7 +14,9 @@ Page({
pageIndex: 1,
safeBottom: app.globalData.safeBottom,
inited: false,
path: null
path: null,
landInfo: null,
visible: false
},
/************************************** 初始化流程 ********************************************/
onLoad: function (options) {
@ -72,7 +74,7 @@ Page({
this.fetchUserInfo()
} else {
wx.hideLoading()
this.onResume()
this.toIndex()
}
}
})
@ -119,6 +121,13 @@ Page({
}
})
},
toIndex: function(){
this.onResume()
if(this.data.path){
wx.navigateTo({ url: this.data.path })
}
// 进行弹窗的dialog显示处理;
},
onResume: function(){
var pageView = this.selectComponent('#' + this.data.TabList[this.data.pageIndex].value)
if (pageView && this.data.inited) {
@ -146,5 +155,19 @@ Page({
},
stopTouchMove: function(e){
return false
},
// 弹出框的处理;
onClose: function(){
this.setData({ visible: false, landInfo: null })
},
onImageLoad: function(){
this.setData({ visible: true })
},
onImageClick: function(){
console.log(this.data.landInfo)
this.setData({ visible: false, landInfo: null })
},
toRule: function(){
console.log('toRule>>>')
}
})

4
pages/index/index.json

@ -2,6 +2,8 @@
"usingComponents": {
"mall": "/pages/mall/index/index",
"article": "/pages/article/index/index",
"home": "/pages/home/index/index"
"home": "/pages/home/index/index",
"wux-image": "/components/image/index",
"wux-popup": "/components/popup/index"
}
}

33
pages/index/index.wxml

@ -1,16 +1,39 @@
<wxs module="index" src="./index.wxs"></wxs>
<swiper current="{{pageIndex}}" duration="0" style="height:{{fragment}}rpx">
<swiper-item catchtouchmove="stopTouchMove"><article id="{{TabList[0].value}}"/></swiper-item>
<swiper-item catchtouchmove="stopTouchMove"><mall id="{{TabList[1].value}}"/></swiper-item>
<swiper-item catchtouchmove="stopTouchMove"><home id="{{TabList[2].value}}"/></swiper-item>
<swiper-item catchtouchmove="stopTouchMove">
<article id="{{TabList[0].value}}" />
</swiper-item>
<swiper-item catchtouchmove="stopTouchMove">
<mall id="{{TabList[1].value}}" />
</swiper-item>
<swiper-item catchtouchmove="stopTouchMove">
<home id="{{TabList[2].value}}" />
</swiper-item>
</swiper>
<view class="cu-bar tabbar bg-white shadow foot" style="height:{{100 + safeBottom}}rpx;padding-bottom:{{safeBottom}}rpx">
<view class="cu-bar tabbar bg-white shadow foot"
style="height:{{100 + safeBottom}}rpx;padding-bottom:{{safeBottom}}rpx">
<view wx:for="{{TabList}}" wx:key="index" class="action" bindtap="onNavChange" data-tab="{{item.index}}">
<view class="cuIcon-cu-image">
<image mode="aspectFill" src="{{index.tabImage(pageIndex, item.index)}}"></image>
</view>
<view class="{{pageIndex == item.index?'text-blue':'text-gray'}}">{{item.name}}</view>
</view>
</view>
</view>
<wux-popup wux-class="wux-landscape" wux-content-class="wux-landscape__popup" wux-body-class="wux-landscape__popup-body"
hasHeader="{{ false }}" hasFooter="{{ false }}" visible="{{ landInfo }}" mask="{{ true }}" bind:close="onClose">
<view class="wux-close" bindtap="onClose" wx:if="{{visible}}">
<text class="cuIcon-roundclose text-white" style="font-size:64rpx"></text>
</view>
<view class="wux-landscape__inner">
<wux-image width="{{654}}" height="{{680}}" nuit="{{'rpx'}}" src="{{'http://cdn.skyvow.cn/redpacket.png'}}"
bind:load="onImageLoad" bind:click="onImageClick">
<view class="flex flex-center" slot="loading" style="height:654rpx;width:680rpx">
<text class="icon--refresher"></text>
</view>
</wux-image>
<view class="text-df" style="color:#FFEF93;padding:12rpx 24rpx;margin-top:16rpx" catchtap="toRule" wx:if="{{visible}}">活动规则</view>
</view>
</wux-popup>

27
pages/index/index.wxss

@ -0,0 +1,27 @@
.wux-close {
width: 100%;
text-align: end;
display: inline-block;
padding-bottom: 24rpx;
}
.wux-landscape{
width: 100%;
max-width: 750rpx;
}
.wux-landscape__popup {
background-color: transparent!important
}
.wux-landscape__popup-body {
padding: 0!important
}
.wux-landscape__inner {
line-height: 1.5;
color: rgba(0,0,0,.65)
}
.wux-landscape__inner > image {
width: 100%;
max-width: 100%
}

1
pages/login/index.js

@ -34,6 +34,7 @@ Page({
this.wxLogin()
var check = wx.getStorageSync('AgreeCheck')
app.globalData.kg = wx.getStorageSync('ztb-kg')
this.checkLogin()
if (check) {
this.setData({check: true})
}

9
utils/request.js

@ -21,6 +21,12 @@ function fun(url, method, data, header) {
app.globalData.token = authorization
}
}
if(util.isEmpty(app.globalData.userToken)){
var userToken = wx.getStorageSync('userToken')
if (userToken) {
app.globalData.userToken = userToken
}
}
if(flag){
header = {
'X-APP-ID': app.xAppId,
@ -29,7 +35,8 @@ function fun(url, method, data, header) {
}
} else {
header = {
'user-token': app.globalData.userToken,
'X-APP-ID': app.xAppId,
'user-token': '' + app.globalData.userToken,
appversion: app.version
}
}

Loading…
Cancel
Save