Browse Source

no message

featrue/v4.1
xpz2018 5 years ago
parent
commit
f8298595a0
5 changed files with 27 additions and 25 deletions
  1. 6
      pages/article/point-index/index.wxml
  2. 2
      pages/article/price-index/index.wxml
  3. 1
      pages/home/index/index.js
  4. 24
      pages/index/index.js
  5. 19
      pages/login/index.js

6
pages/article/point-index/index.wxml

@ -1,7 +1,5 @@
<!--pages/main/index.wxml--> <!--pages/main/index.wxml-->
<!-- <scroll-view scroll-y style="height: {{height}}rpx;" lower-threshold="200" bindscrolltolower="fetchMomentList"> -->
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchMomentList"> <refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchMomentList">
<!----------------------------------------------------帖子列表---------------------------------------------------------------->
<view wx:if="{{userInfo && userInfo.isVIP}}"> <view wx:if="{{userInfo && userInfo.isVIP}}">
<wux-skeleton active wx:if="{{!momentList.length}}"> <wux-skeleton active wx:if="{{!momentList.length}}">
<view class="cu-card dynamic no-card" wx:for="{{4}}" wx:key="index"> <view class="cu-card dynamic no-card" wx:for="{{4}}" wx:key="index">
@ -40,7 +38,6 @@
</view> </view>
</view> </view>
<view class="bg-white list-empty" style="height: {{height}}rpx;" wx:else> <view class="bg-white list-empty" style="height: {{height}}rpx;" wx:else>
<!-- <image class="img-empty" src="/assets/image/list_empty.png"></image> -->
<view class="flex" style="margin-bottom:48rpx"> <view class="flex" style="margin-bottom:48rpx">
<text class="cuIcon-info text-blue" style="font-size:42rpx;"></text> <text class="cuIcon-info text-blue" style="font-size:42rpx;"></text>
<view style="width:540rpx;margin-left: 12rpx"> <view style="width:540rpx;margin-left: 12rpx">
@ -50,5 +47,4 @@
</view> </view>
<wux-button type="positive" size="join" bind:click="toVip">立即开通</wux-button> <wux-button type="positive" size="join" bind:click="toVip">立即开通</wux-button>
</view> </view>
</refresh-view>
<!-- </scroll-view> -->
</refresh-view>

2
pages/article/price-index/index.wxml

@ -4,7 +4,7 @@
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchMomentList"> <refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchMomentList">
<!----------------------------------------------------帖子列表----------------------------------------------------------------> <!----------------------------------------------------帖子列表---------------------------------------------------------------->
<wux-skeleton active wx:if="{{!momentList.length}}"> <wux-skeleton active wx:if="{{!momentList.length}}">
<view class="cu-card dynamic no-card" wx:for="{{4}}" wx:key="index">
<view class="cu-card dynamic no-card" wx:for="{{6}}" wx:key="index">
<view class="cu-item shadow" style="padding-left:30rpx"> <view class="cu-item shadow" style="padding-left:30rpx">
<view class="cu-list menu-avatar"> <view class="cu-list menu-avatar">
<view class="cu-item" style="justify-content: flex-start;"> <view class="cu-item" style="justify-content: flex-start;">

1
pages/home/index/index.js

@ -62,6 +62,7 @@ Component({
if(!util.isEmpty(result.data.avatarUrl)){ if(!util.isEmpty(result.data.avatarUrl)){
app.globalData.userInfo.avatarUrl = result.data.avatarUrl app.globalData.userInfo.avatarUrl = result.data.avatarUrl
} }
app.globalData.userInfo.isVIP = result.data.isVIP
app.globalData.userInfo.hasStore = result.data.hasStore app.globalData.userInfo.hasStore = result.data.hasStore
this.setData({ this.setData({
avatarUrl: app.globalData.userInfo.avatarUrl, avatarUrl: app.globalData.userInfo.avatarUrl,

24
pages/index/index.js

@ -1,5 +1,5 @@
import { config, getUserInfo} from "../api/user" import { config, getUserInfo} from "../api/user"
import { zconfig, loginToken, getPopupInfo } from "../api/ztb"
import { zconfig, loginToken, getBaseInfo, getPopupInfo } from "../api/ztb"
import { pconfig } from "../api/payment" import { pconfig } from "../api/payment"
import { mconfig } from "../api/moment" import { mconfig } from "../api/moment"
import { sconfig, getOrderExists } from "../api/saas" import { sconfig, getOrderExists } from "../api/saas"
@ -93,7 +93,6 @@ Page({
fetchUserInfo:function(){ fetchUserInfo:function(){
config.header = { 'Authorization': 'QNT ' + app.globalData.token } config.header = { 'Authorization': 'QNT ' + app.globalData.token }
getUserInfo().then(result => { getUserInfo().then(result => {
app.globalData.userInfo = result.data
this.toIndex() this.toIndex()
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()
@ -120,14 +119,19 @@ Page({
zconfig.header = { 'Authorization': 'QNT ' + result.data.token } zconfig.header = { 'Authorization': 'QNT ' + result.data.token }
pconfig.header = { 'Authorization': 'QNT ' + result.data.token } pconfig.header = { 'Authorization': 'QNT ' + result.data.token }
mconfig.header = { 'Authorization': 'QNT ' + result.data.token } mconfig.header = { 'Authorization': 'QNT ' + result.data.token }
// 登录流程完成;
if(!util.isEmpty(result.data.userToken)){
this.handleUserToken(result.data.userToken)
return
}
wx.hideLoading()
this.defaultIndex()
getBaseInfo().then(result => {
app.globalData.userInfo = result.data
// 登录流程完成;
if(!util.isEmpty(result.data.userToken)){
this.handleUserToken(result.data.userToken)
return
}
wx.hideLoading()
this.defaultIndex()
}).catch(err => {
wx.hideLoading()
this.defaultIndex()
})
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()
this.defaultIndex() this.defaultIndex()

19
pages/login/index.js

@ -1,7 +1,7 @@
//获取应用实例 //获取应用实例
import { $wuxCountDown } from '../../components/index' import { $wuxCountDown } from '../../components/index'
import { config, postCaptcha, loginCaptcha, loginPwd, wechatApplet, getUserInfo, loginWechat } from "../api/user"
import { zconfig, loginToken } from "../api/ztb"
import { config, postCaptcha, loginCaptcha, loginPwd, wechatApplet, loginWechat } from "../api/user"
import { zconfig, loginToken, getBaseInfo } from "../api/ztb"
import { pconfig } from "../api/payment" import { pconfig } from "../api/payment"
import { mconfig } from "../api/moment" import { mconfig } from "../api/moment"
import { sconfig, getOrderExists } from "../api/saas" import { sconfig, getOrderExists } from "../api/saas"
@ -56,13 +56,13 @@ Page({
} }
app.globalData.token = authorization app.globalData.token = authorization
config.header = { 'Authorization': 'QNT ' + authorization } config.header = { 'Authorization': 'QNT ' + authorization }
getUserInfo().then(result => {
app.globalData.userInfo = result.data
loginToken({loginToken: app.globalData.token}).then(result => {
zconfig.header = { 'Authorization': 'QNT ' + result.data.token }
pconfig.header = { 'Authorization': 'QNT ' + result.data.token }
mconfig.header = { 'Authorization': 'QNT ' + result.data.token }
// 登录流程完成;
loginToken({loginToken: app.globalData.token}).then(result => {
zconfig.header = { 'Authorization': 'QNT ' + result.data.token }
pconfig.header = { 'Authorization': 'QNT ' + result.data.token }
mconfig.header = { 'Authorization': 'QNT ' + result.data.token }
// 登录流程完成;
getBaseInfo().then(result => {
app.globalData.userInfo = result.data
if(!util.isEmpty(result.data.userToken)){ if(!util.isEmpty(result.data.userToken)){
this.handleUserToken(result.data.userToken) this.handleUserToken(result.data.userToken)
} else { } else {
@ -89,6 +89,7 @@ Page({
this.setData({ loging: false}) this.setData({ loging: false})
wx.navigateBack() wx.navigateBack()
}) })
}, },
handleUserToken: function(userToken){ handleUserToken: function(userToken){
storage.put('userToken', userToken) storage.put('userToken', userToken)

Loading…
Cancel
Save