Browse Source

no message

feature/v2.2
xpz2018 4 years ago
parent
commit
1e92ebf7bd
9 changed files with 61 additions and 26 deletions
  1. 6
      api/saas.js
  2. 6
      pages/home/customer-list/index.js
  3. 4
      pages/home/customer-list/index.wxml
  4. 9
      pages/home/index/index.js
  5. 4
      pages/home/index/index.wxml
  6. 40
      pages/ztbvip/member/index.js
  7. 10
      pages/ztbvip/member/index.wxml
  8. 4
      pages/ztbvip/payment/index.js
  9. 4
      pages/ztbvip/payment/index.wxml

6
api/saas.js

@ -18,6 +18,7 @@ const getBaseInfo = () => mGet(`/ztb-factory/get/self-enterprise-profile-detail`
const getBankList = () => mGet(`/ztb-factory/get/bank-list`, null, sconfig)
const getStatisticsInfo = (params) => mGet(`/ztb-factory/get/my-workbench-statistics-info`, params, sconfig)
const bindingFactory = (params) => mPost(`/recycle-user-center/bind/factory-admin`, params, sconfig)
const getFactoryLicence = () => mGet(`/recycle-user-center/get/latest-factory-licence`, null, sconfig)
const getOrderList = (params) => mGet(`/ztb-factory/factory-customer/get/order-list`, params, sconfig)
const getReceiptList = (params) => mGet(`/ztb-factory/factory/get/order-receipt-proof-audit-list`, params, sconfig)
const getPeymentList = (params) => mGet(`/ztb-factory/get/order-pay-list`, params, sconfig)
@ -89,7 +90,7 @@ const getReceiptReport = (params) => mGet(`/ztb-factory/get/receipt-daily-report
const getSalesReport = (params) => mGet(`/ztb-factory/get/sales-daily-report`, params, sconfig)
const getGrossReport = (params) => mGet(`/ztb-factory/get/gross-profit-daily-report`, params, sconfig)
const getAgentReport = (params) => mGet(`/ztb-factory/get/agency-sales-daily-report`, params, sconfig)
const getMemberList = () => mGet(`/ztb-factory/get/agency-sales-daily-report`, null, sconfig)
const getMemberList = () => mGet(`/ztb-factory/get/expense-config-list`, null, sconfig)
const buyMemberInfo = (params) => mPost(`/ztb-factory/buy/member`, params, sconfig)
export {
@ -172,5 +173,6 @@ export {
savePlateNumber,
deleteEmploye,
getMemberList,
buyMemberInfo
buyMemberInfo,
getFactoryLicence
}

6
pages/home/customer-list/index.js

@ -41,11 +41,7 @@ Scene({
this.data.type = Number(options.type)
}
var height = app.globalData.fragmentHeight - 100
if(height > 1024){
this.data.indexHeight = 1024
} else {
this.data.indexHeight = height
}
this.data.indexHeight = height - 48
var titleHeight = this.px2rpx(app.globalData.CustomBar) + 116
var itemHeight = parseInt(this.data.indexHeight / 25)
this.setData({ height, itemHeight, indexHeight: this.data.indexHeight, titleHeight })

4
pages/home/customer-list/index.wxml

@ -40,12 +40,12 @@
<view slot="action" bind:tap="onChange" style="padding: 0rpx 8rpx" wx:if="{{form.name}}">取消</view>
</van-search>
<scroll-view class="scrollList" scroll-y scroll-into-view="{{scrollViewId}}" style="height:{{height}}rpx">
<view class="list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}">
<view class="list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}" bindtap="onRefreshList">
<view style="margin-bottom:24px" wx:if="{{loading}}">
<van-loading type="spinner" size="32" />
</view>
<image class="img-empty" src="/assets/image/list_empty.png" wx:else></image>
<view class="text-empty">{{loading? '正在加载' : '暂无数据'}}</view>
<view class="text-empty">{{loading? '正在加载' : '暂无数据,点击重新刷新'}}</view>
</view>
<!-- 查询结果 -->
<view wx:if="{{form.name}}">

9
pages/home/index/index.js

@ -1,6 +1,7 @@
// pages/stock/index.js
import Dialog from '../../../components/dialog/dialog'
import { finalizeToken } from "../../../api/user"
import { getFactoryLicence } from "../../../api/saas"
const util = require('../../../utils/util')
const event = require('../../../utils/event')
const storage = require('../../../utils/storage')
@ -58,6 +59,14 @@ Component({
} else if(!util.isEmpty(app.userInfo.realName)){
nickname = app.userInfo.realName.substring(0, 14)
}
getFactoryLicence().then(result => {
app.userInfo.expirationTime = result.data.expirationTime.substring(0, 10)
app.userInfo.isExpiration = result.data.isExpiration
this.setData({
['userInfo.expirationTime']: app.userInfo.expirationTime,
['userInfo.isExpiration']: result.data.isExpiration
})
})
this.setData({
avatarUrl: util.isEmpty(app.userInfo.avatarUrl) ? '/assets/image/ygImg.png' : app.userInfo.avatarUrl,
userInfo: app.userInfo,

4
pages/home/index/index.wxml

@ -11,7 +11,7 @@
<view class="flex flex-column flex-center" style="margin-left:24rpx;align-items:flex-start">
<view class="flex flex-center text-white">
<text class="text-xl text-bold" style="white-space: nowrap;margin-right:12rpx">{{factoryName || ''}}</text>
<van-tag round type="warning">授权已逾期</van-tag>
<van-tag round type="warning" wx:if="{{userInfo.isExpiration}}">授权已逾期</van-tag>
</view>
<view class="flex flex-center text-white">
<text class="text-white text-sg" style="font-size:14px">{{userName || ''}}({{ isAdmin ? '管理员' : '员工' }})</text>
@ -25,7 +25,7 @@
<view style="padding: 0rpx 28rpx;margin-top:4rpx">
<view class="bg-white" style="border-radius: 20rpx;padding-bottom: 12rpx">
<view class="flex flex-justify cell-vip" bindtap="toVip">
<view class="text-black text-sg text-bold">授权截止日期:2021-07-31</view>
<view class="text-black text-sg text-bold">授权截止日期:{{userInfo.expirationTime}}</view>
<view class="flex flex-center">
<text class="text-sg" style="white-space: nowrap">去续费</text>
<van-icon slot="right-icon" name="arrow"/>

40
pages/ztbvip/member/index.js

@ -1,7 +1,8 @@
// xtends//vip/index.js
import Scene from '../../index/scene'
import { getMemberList, buyMemberInfo } from "../../../api/saas"
import { getFactoryLicence, getMemberList, buyMemberInfo } from "../../../api/saas"
import util from '../../../utils/util'
const event = require('../../../utils/event.js')
const app = getApp()
Scene({
@ -10,7 +11,9 @@ Scene({
*/
data: {
factoryName: '',
memberList: [{"id":"49606500024333519","days":30,"bidPrice":1.00,"realPrice":1.00,"icon":null,"title":"天","sellStrategy":"common","iosId":"yitianhuiyuanqntest","iosBidPrice":1.00,"iosRealPrice":1.00},{"id":"481107395657994240","days":5,"bidPrice":1.00,"realPrice":0.01,"icon":null,"title":"天","sellStrategy":"twoForOneAtFirstTime","iosId":null,"iosBidPrice":0.00,"iosRealPrice":0.00},{"id":"483353095548571648","days":30,"bidPrice":2000.00,"realPrice":1000.00,"icon":null,"title":"天","sellStrategy":"twoForOneAtFirstTime","iosId":"ztb_vip_30_01","iosBidPrice":1998.00,"iosRealPrice":998.00},{"id":"483353355918381056","days":90,"bidPrice":4000.00,"realPrice":2000.00,"icon":null,"title":"天","sellStrategy":"common","iosId":"ztb_vip_90","iosBidPrice":3998.00,"iosRealPrice":1998.00},{"id":"483353702984454144","days":180,"bidPrice":6000.00,"realPrice":3000.00,"icon":null,"title":"天","sellStrategy":"common","iosId":"ztb_vip_180","iosBidPrice":5898.00,"iosRealPrice":2998.00},{"id":"483354024398163968","days":365,"bidPrice":10000.00,"realPrice":5000.00,"icon":null,"title":"天","sellStrategy":"common","iosId":"ztb_vip_365","iosBidPrice":9998.00,"iosRealPrice":4998.00},{"id":"496065000243335168","days":30,"bidPrice":1000.00,"realPrice":500.00,"icon":null,"title":"天(限时)","sellStrategy":"common","iosId":"ztb_vip_30_02","iosBidPrice":998.00,"iosRealPrice":488.00}],
expirationTime: null,
isExpiration: null,
memberList: [],
divIndexId: '49606500024333519',
},
/**
@ -18,15 +21,37 @@ Scene({
*/
onLoad: function (options) {
wx.showLoading({ title: '加载中', mask: true })
if(util.isEmpty(app.userInfo.expirationTime)){
getFactoryLicence().then(result => {
app.userInfo.expirationTime = result.expirationTime.substring(0, 10)
app.userInfo.isExpiration = result.isExpiration
this.setData({ expirationTime:app.userInfo.expirationTime, isExpiration: result.isExpiration })
})
}
getMemberList().then(res => {
var memberList = res.data.records
wx.hideLoading()
this.setData({ factoryName: app.userInfo.factoryName, memberList: res.data, divIndexId:res.data[0].id })
this.setData({ factoryName: app.userInfo.factoryName,
memberList, divIndexId: memberList[0].id,
expirationTime: app.userInfo.expirationTime,
isExpiration: app.userInfo.isExpiration
})
}).catch(err => {
wx.hideLoading()
this.setData({factoryName: app.userInfo.factoryName})
util.showToast(err)
})
})
event.on('EventMessage', this, this.onEvent)
},
onEvent: function(message){
if (message.what == 300) {
getFactoryLicence().then(result => {
app.userInfo.expirationTime = result.data.expirationTime.substring(0, 10)
app.userInfo.isExpiration = result.data.isExpiration
this.setData({ expirationTime: app.userInfo.expirationTime, isExpiration: result.data.isExpiration })
})
}
},
onGridTap:function(e){
var index = e.currentTarget.dataset.index
this.setData({ divIndexId: this.data.memberList[index].id })
@ -35,10 +60,13 @@ Scene({
wx.showLoading({ title: '处理中', mask: true })
buyMemberInfo({ memberExpenseId: this.data.divIndexId }).then(res => {
wx.hideLoading()
wx.navigateTo({ url: '/pages/ztbvip/payment/index?type=2&orderId=' + res.data.orderId })
wx.navigateTo({ url: '/pages/ztbvip/payment/index?type=2&orderId=' + res.data.tradeOrderId })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
}
},
onUnload: function(){
event.remove('EventMessage', this)
}
})

10
pages/ztbvip/member/index.wxml

@ -10,11 +10,11 @@
<view class="flex flex-column flex-center" style="flex:1;margin-left:18rpx;align-items:flex-start">
<view class="flex flex-center">
<text class="text-bold text-lg van-ellipsis" style="max-width: 240rpx;margin-right:12rpx">{{factoryName || ''}}</text>
<van-tag round type="warning">已逾期</van-tag>
<van-tag round type="warning" wx:if="{{isExpiration}}">已逾期</van-tag>
</view>
<view class="flex flex-center" style="font-size:28rpx;">
<!-- <text class="text-black">{{vipInfo.isVIP==1?'付费会员':'非会员'}}</text> -->
<text style="font-size:12px;color: #6f6f6f;">到期时间:2021年7月30日</text>
<text style="font-size:12px;color: #6f6f6f;">到期时间:{{expirationTime}}</text>
</view>
</view>
<view class="cu-btn vip-btn" bindtap="vipForm">立即续费</view>
@ -49,9 +49,9 @@
<view class="cu-tags" wx:if="{{item.sellStrategy == 'twoForOneAtFirstTime'}}">首月买一赠一</view>
<view class="{{item.id == divIndexId? 'openVip22':'openVip21'}}">
<view style="padding:32rpx 0rpx 48rpx 0rpx">
<text class="text-cut" style="font-size:36rpx;color:#333333">{{item.days}}{{item.title}}</text>
<text class="text-price" style="margin-top:18rpx;font-size:40rpx;color:#d0a45c">{{item.realPrice}}</text>
<text style="margin-top:18rpx;font-size:24rpx;color:#999999;text-decoration:line-through">原价:¥{{item.bidPrice}}</text>
<text class="text-cut" style="font-size:36rpx;color:#333333">{{item.durationTime}}天</text>
<text class="text-price" style="margin-top:18rpx;font-size:40rpx;color:#d0a45c">{{item.discountPrice}}</text>
<text style="margin-top:18rpx;font-size:24rpx;color:#999999;text-decoration:line-through">原价:¥{{item.standardPrice}}</text>
</view>
</view>
</view>

4
pages/ztbvip/payment/index.js

@ -1,6 +1,6 @@
// pages/ztbvip/payment/index.js
import Scene from '../../index/scene'
import { getTradeOrder, paymentFor } from "../../../api/saas"
import { getTradeOrder, paymentFor } from "../../../api/payment"
const util = require('../../../utils/util.js')
const event = require('../../../utils/event.js')
const app = getApp()
@ -60,7 +60,7 @@ Scene({
var that = this
data.success = function (res) {
util.showBackToast('支付成功')
event.emit('EventMessage', { what: 200, desc: 'Vip' })
event.emit('EventMessage', { what: 300, desc: 'Vip' })
}
data.fail = function (res) {
util.showToast('支付失败')

4
pages/ztbvip/payment/index.wxml

@ -4,12 +4,12 @@
</cu-custom>
<view wx:if="{{payment}}">
<view class="flex flex-column flex-center" style="padding:90rpx">
<view class="flex flex-column flex-center" style="padding:96rpx;margin-top: 48rpx;">
<text class="text-price text-red" style="font-size:80rpx">{{payment}}</text>
<text class="text-black text-sg" style="margin-top:12rpx">{{payText}}</text>
</view>
<view style="padding:96rpx 48rpx">
<van-button block type="info" custom-style="width:600rpx" loading="{{loging}}" bind:click="submitForm">立即支付</van-button>
<van-button block type="info" custom-style="width:560rpx" loading="{{loging}}" bind:click="submitForm">立即支付</van-button>
</view>
</view>
Loading…
Cancel
Save