Browse Source

no message

feature/v2.2
xpz2018 4 years ago
parent
commit
35a984968c
7 changed files with 12 additions and 38 deletions
  1. 10
      pages/home/customer-code/index.js
  2. 10
      pages/home/customer-code/index.json
  3. 4
      pages/home/customer-code/index.wxml
  4. 9
      pages/home/customer-code/index.wxss
  5. 2
      pages/home/customer-info/index.js
  6. 9
      pages/home/customer-info/index.wxss
  7. 6
      pages/home/customer-list/index.js

10
pages/home/customer-code/index.js

@ -1,6 +1,7 @@
// pages/home/customer-info/index.js // pages/home/customer-info/index.js
import Scene from '../../index/scene' import Scene from '../../index/scene'
const qrCode = require('../../../utils/weapp-qrcode.js');
const util = require('../../../utils/util')
const qrCode = require('../../../utils/weapp-qrcode.js')
const app = getApp() const app = getApp()
Scene({ Scene({
@ -8,13 +9,15 @@ Scene({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
name: '裕隆纸业有限公司',
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.showQrCode('?mark=ztb_saas&QrCodeRecordId=597399780326510592' + Math.ceil(Math.random() * 100) )
if(!util.isEmpty(options.id)){
this.showQrCode('?mark=ztb_saas&QrCodeRecordId=597399780326510592' + Math.ceil(Math.random() * 100) )
}
}, },
rpx2px: function(rpx) { rpx2px: function(rpx) {
return rpx / 750 * app.globalData.windowWidth return rpx / 750 * app.globalData.windowWidth
@ -28,7 +31,6 @@ Scene({
colorLight: "#FFFFFF", colorLight: "#FFFFFF",
correctLevel: qrCode.CorrectLevel.H correctLevel: qrCode.CorrectLevel.H
}) })
this.setData({ show: true })
}, },
previewImage: function(){ previewImage: function(){
wx.canvasToTempFilePath({ wx.canvasToTempFilePath({

10
pages/home/customer-code/index.json

@ -1,16 +1,6 @@
{ {
"usingComponents": { "usingComponents": {
"van-button": "/components/button/index", "van-button": "/components/button/index",
"van-cell": "/components/cell/index",
"van-field": "/components/field/index",
"van-loading": "/components/loading/index",
"van-image": "/components/image/index",
"van-icon": "/components/icon/index",
"van-action-sheet": "/components/action-sheet/index",
"van-notice-bar": "/components/notice-bar/index",
"van-picker": "/components/picker/index",
"van-popup": "/components/popup/index",
"van-dialog": "/components/dialog/index",
"notification": "/pages/message/notification/index" "notification": "/pages/message/notification/index"
} }
} }

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

@ -3,10 +3,10 @@
</cu-custom> </cu-custom>
<view class="flex flex-center flex-column" style="margin-top:48rpx"> <view class="flex flex-center flex-column" style="margin-top:48rpx">
<view class="bg-white" style="padding:32rpx">
<view class="bg-white" style="padding:32rpx" bindtap="previewImage">
<canvas style="width:600rpx; height:600rpx;" canvas-id="van-qrcode"></canvas> <canvas style="width:600rpx; height:600rpx;" canvas-id="van-qrcode"></canvas>
</view> </view>
<text class="text-xl" style="margin-top:96rpx;text-align:center">裕隆纸业有限公司</text>
<text class="text-xl" style="margin-top:96rpx;text-align:center">{{name}}</text>
</view> </view>
<notification id="qn-notification" /> <notification id="qn-notification" />

9
pages/home/customer-code/index.wxss

@ -1,8 +1 @@
/* pages/home/customer-info/index.wxss */
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
padding: 0px 15%;
}
/* pages/home/customer-info/index.wxss */

2
pages/home/customer-info/index.js

@ -40,7 +40,7 @@ Scene({
wx.showLoading({ title: '正在获取', mask: true }) wx.showLoading({ title: '正在获取', mask: true })
getCustomerInfo(options.id).then(result => { getCustomerInfo(options.id).then(result => {
wx.hideLoading() wx.hideLoading()
if(!util.isEmpty(options.userId)){
if(!util.isEmpty(options.userId) && options.userId != 'null'){
result.data.userId = options.userId result.data.userId = options.userId
} }
if(util.isEmpty(result.data.customerSettleType) || Number(result.data.customerSettleType) < 1){ if(util.isEmpty(result.data.customerSettleType) || Number(result.data.customerSettleType) < 1){

9
pages/home/customer-info/index.wxss

@ -1,8 +1 @@
/* pages/home/customer-info/index.wxss */
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
padding: 0px 15%;
}
/* pages/home/customer-info/index.wxss */

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

@ -192,11 +192,7 @@ Scene({
channel.emit('onCallback', { what: 130, detail: item }) channel.emit('onCallback', { what: 130, detail: item })
wx.navigateBack() wx.navigateBack()
} else { } else {
if(util.isEmpty(item.userId)){
wx.navigateTo({ url: `/pages/home/customer-info/index?id=${item.id}` })
} else {
wx.navigateTo({ url: `/pages/home/customer-info/index?id=${item.id}&userId=${item.userId}` })
}
wx.navigateTo({ url: `/pages/home/customer-info/index?id=${item.id}&userId=${item.userId}` })
} }
}, },
bindCustomer: function(e){ bindCustomer: function(e){

Loading…
Cancel
Save