Browse Source

第一个测试版本

featrue/v4.5
xpz2018 4 years ago
parent
commit
e18f741ea2
11 changed files with 74 additions and 9 deletions
  1. 7
      pages/agent/ability/index.js
  2. 1
      pages/agent/ability/index.json
  3. 16
      pages/agent/ability/index.wxml
  4. 3
      pages/agent/factory/index.js
  5. 3
      pages/agent/factory/index.wxml
  6. 4
      pages/agent/fragment/index.js
  7. 3
      pages/article/detail/index.js
  8. 3
      pages/article/detail/index.wxml
  9. 25
      pages/ztbvip/index.js
  10. 3
      pages/ztbvip/index.json
  11. 15
      pages/ztbvip/index.wxml

7
pages/agent/ability/index.js

@ -10,7 +10,7 @@ Page({
data: { data: {
height: app.globalData.fragmentHeight, height: app.globalData.fragmentHeight,
kg: app.globalData.kg, kg: app.globalData.kg,
hasActivity: false,
activity: 0,
loading: true, loading: true,
requesting: false, requesting: false,
finished: false, finished: false,
@ -30,12 +30,15 @@ Page({
this.fetchPapersList() this.fetchPapersList()
hasActivity().then(result => { hasActivity().then(result => {
wx.hideLoading() wx.hideLoading()
this.setData({ height: app.globalData.fragmentHeight, hasActivity: result.data })
this.setData({ height: app.globalData.fragmentHeight, activity: result.data ? 2 : 1 })
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()
this.setData({ height: app.globalData.fragmentHeight }) this.setData({ height: app.globalData.fragmentHeight })
}) })
}, },
onClose: function(){
wx.navigateBack()
},
// 下拉刷新... // 下拉刷新...
onRefreshList: function () { onRefreshList: function () {
if (this.data.requesting) { if (this.data.requesting) {

1
pages/agent/ability/index.json

@ -7,6 +7,7 @@
"refresh-view": "/components/refresher/index", "refresh-view": "/components/refresher/index",
"wux-image": "/components/image/index", "wux-image": "/components/image/index",
"wux-divider": "/components/divider/index", "wux-divider": "/components/divider/index",
"wux-popup": "/components/popup/index",
"ability-item": "/pages/agent/ability-item/index" "ability-item": "/pages/agent/ability-item/index"
} }
} }

16
pages/agent/ability/index.wxml

@ -26,4 +26,18 @@
</wux-divider> </wux-divider>
</view> </view>
</view> </view>
</refresh-view>
</refresh-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="{{ activity == 2 }}" mask="{{ true }}">
<view class="wux-close" bindtap="onClose">
<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'}}" bind:click="onClose" src="/assets/popup/no-zige.png" mode="aspectFit">
<view class="flex flex-center" slot="loading" style="height:654rpx;width:680rpx">
<text class="icon--refresher"></text>
</view>
</wux-image>
</view>
</wux-popup>

3
pages/agent/factory/index.js

@ -85,6 +85,9 @@ Page({
stopTouchMove: function (e) { stopTouchMove: function (e) {
return false return false
}, },
onClose: function(){
wx.navigateBack()
},
onImageClick: function(){ onImageClick: function(){
wx.navigateTo({ url: '/pages/ztbvip/index' }) wx.navigateTo({ url: '/pages/ztbvip/index' })
}, },

3
pages/agent/factory/index.wxml

@ -179,6 +179,9 @@
<wux-popup wux-class="wux-landscape" wux-content-class="wux-landscape__popup" wux-body-class="wux-landscape__popup-body" <wux-popup wux-class="wux-landscape" wux-content-class="wux-landscape__popup" wux-body-class="wux-landscape__popup-body"
hasHeader="{{ false }}" hasFooter="{{ false }}" visible="{{ visible }}" mask="{{ true }}"> hasHeader="{{ false }}" hasFooter="{{ false }}" visible="{{ visible }}" mask="{{ true }}">
<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"> <view class="wux-landscape__inner">
<wux-image width="{{604}}" height="{{806}}" nuit="{{'rpx'}}" src="/assets/popup/need-member.png" bind:click="onImageClick"> <wux-image width="{{604}}" height="{{806}}" nuit="{{'rpx'}}" src="/assets/popup/need-member.png" bind:click="onImageClick">
</wux-image> </wux-image>

4
pages/agent/fragment/index.js

@ -38,7 +38,7 @@ Component({
}, },
triggered: false, triggered: false,
firstShow: false, firstShow: false,
activity: 0
hasActivity: false
}, },
lifetimes: { lifetimes: {
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名 // 生命周期函数,可以为函数,或一个在methods段中定义的方法名
@ -57,7 +57,7 @@ Component({
if(!this.data.firstShow){ if(!this.data.firstShow){
if(app.globalData.userInfo){ if(app.globalData.userInfo){
hasActivity().then(result => { hasActivity().then(result => {
this.setData({ activity: result.data ? 2 : 1 })
this.setData({ hasActivity: result.data })
}) })
} }
this.fetchPapersList() this.fetchPapersList()

3
pages/article/detail/index.js

@ -58,6 +58,9 @@ Page({
}) })
} }
}, },
onClose: function(){
wx.navigateBack()
},
onImageClick: function(){ onImageClick: function(){
wx.navigateTo({ url: '/pages/ztbvip/index' }) wx.navigateTo({ url: '/pages/ztbvip/index' })
}, },

3
pages/article/detail/index.wxml

@ -168,6 +168,9 @@
<wux-popup wux-class="wux-landscape" wux-content-class="wux-landscape__popup" wux-body-class="wux-landscape__popup-body" <wux-popup wux-class="wux-landscape" wux-content-class="wux-landscape__popup" wux-body-class="wux-landscape__popup-body"
hasHeader="{{ false }}" hasFooter="{{ false }}" visible="{{ visible }}" mask="{{ true }}"> hasHeader="{{ false }}" hasFooter="{{ false }}" visible="{{ visible }}" mask="{{ true }}">
<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"> <view class="wux-landscape__inner">
<wux-image width="{{604}}" height="{{806}}" nuit="{{'rpx'}}" src="/assets/popup/need-member.png" bind:click="onImageClick"> <wux-image width="{{604}}" height="{{806}}" nuit="{{'rpx'}}" src="/assets/popup/need-member.png" bind:click="onImageClick">
<view class="flex flex-center" slot="loading" style="height:654rpx;width:680rpx"> <view class="flex flex-center" slot="loading" style="height:654rpx;width:680rpx">

25
pages/ztbvip/index.js

@ -1,6 +1,7 @@
import { getMemberExpenseList, getMemberInfo, buyMemberInfo } from "../../api/ztb" import { getMemberExpenseList, getMemberInfo, buyMemberInfo } from "../../api/ztb"
const util = require('../../utils/util') const util = require('../../utils/util')
const event = require('../../utils/event.js') const event = require('../../utils/event.js')
const tdsdk = require('../../libs/tdweapp.js')
const app = getApp() const app = getApp()
Page({ Page({
@ -14,7 +15,8 @@ Page({
iconList: [], iconList: [],
safeBottom: app.globalData.safeBottom, safeBottom: app.globalData.safeBottom,
divIndex:null, divIndex:null,
vipInfo: null
vipInfo: null,
visible: false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -24,9 +26,11 @@ Page({
getMemberExpenseList().then(res => { getMemberExpenseList().then(res => {
this.setData({ iconList: res.data, divIndex:res.data[0].id }) this.setData({ iconList: res.data, divIndex:res.data[0].id })
}).catch(err => { }) }).catch(err => { })
event.on('EventMessage', this, this.onEvent)
this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog') this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog')
}, },
onShow: function () { onShow: function () {
tdsdk.Page.onShow()
if(!app.globalData.userInfo){ if(!app.globalData.userInfo){
return return
} }
@ -47,6 +51,17 @@ Page({
wx.hideLoading() wx.hideLoading()
}) })
}, },
onEvent: function (message) {
if(message.what == 200){
this.setData({ visible: true })
}
},
onClose: function(){
this.setData({ visible: false })
},
onImageClick: function(){
wx.navigateBack()
},
toAuthor: function(){ toAuthor: function(){
if(this.data.userInfo && !this.data.userInfo.isAuth){ if(this.data.userInfo && !this.data.userInfo.isAuth){
util.navigateTo('/pages/home/idcard/index') util.navigateTo('/pages/home/idcard/index')
@ -84,10 +99,16 @@ Page({
} else { } else {
app.globalData.userInfo.isVIP = 1 app.globalData.userInfo.isVIP = 1
event.emit('EventMessage', { what: 200, desc: 'Vip' }) event.emit('EventMessage', { what: 200, desc: 'Vip' })
util.showBackToast('会员购买成功')
} }
}).catch((e) => { }).catch((e) => {
wx.hideLoading() wx.hideLoading()
}) })
},
onHide: function(){
tdsdk.Page.onHide()
},
onUnload: function(){
tdsdk.Page.onUnload()
event.remove('EventMessage', this)
} }
}) })

3
pages/ztbvip/index.json

@ -5,6 +5,7 @@
"wux-image": "/components/image/index", "wux-image": "/components/image/index",
"wux-dialog": "/components/dialog/index", "wux-dialog": "/components/dialog/index",
"wux-grids": "/components/grids/index", "wux-grids": "/components/grids/index",
"wux-grid": "/components/grid/index"
"wux-grid": "/components/grid/index",
"wux-popup": "/components/popup/index"
} }
} }

15
pages/ztbvip/index.wxml

@ -92,4 +92,17 @@
<button class="cu-btn bg-red round page-btn" bindtap="openVip">{{vipInfo.isVIP==1?'立即续费':'开通会员'}}</button> <button class="cu-btn bg-red round page-btn" bindtap="openVip">{{vipInfo.isVIP==1?'立即续费':'开通会员'}}</button>
</view> </view>
<wux-dialog id="wux-dialog" />
<wux-dialog id="wux-dialog" />
<wux-popup wux-class="wux-landscape" wux-content-class="wux-landscape__popup" wux-body-class="wux-landscape__popup-body"
hasHeader="{{ false }}" hasFooter="{{ false }}" visible="{{ visible }}" mask="{{ true }}" bind:close="onClose">
<view class="wux-close" bindtap="onClose">
<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'}}" bind:click="onImageClick" src="/assets/popup/payment-success.png" mode="aspectFit">
<view class="flex flex-center" slot="loading" style="height:654rpx;width:680rpx">
<text class="icon--refresher"></text>
</view>
</wux-image>
</view>
</wux-popup>
Loading…
Cancel
Save