Browse Source

no message

feature/v1.6
xpz2018 4 years ago
parent
commit
d2624ff24c
5 changed files with 29 additions and 15 deletions
  1. 1
      pages/agent/appointment/index.json
  2. 16
      pages/agent/appointment/index.wxml
  3. 5
      pages/index/index.js
  4. 18
      pages/login/index.js
  5. 4
      pages/login/index.wxml

1
pages/agent/appointment/index.json

@ -1,6 +1,7 @@
{
"usingComponents": {
"van-cell": "/components/cell/index",
"van-field": "/components/field/index",
"van-button": "/components/button/index",
"van-dialog": "/components/dialog/index",
"van-loading": "/components/loading/index",

16
pages/agent/appointment/index.wxml

@ -18,8 +18,20 @@
<view style="height:24rpx;width:6rpx;background-image: linear-gradient(180deg, #007AFF 0%, #027BFF 15%, #5AABFF 45%, #CAF4FE 100%);"></view>
<view class="text-black text-sg text-bold" style="margin-left: 12rpx">纸品信息</view>
</view>
<van-cell clickable center is-link bind:click="chooseCustomer">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black">纸厂名称</view>
<view class="{{factoryDetail.name ? 'text-black' : 'text-gray'}}">{{factoryDetail.name}}</view>
</view>
</van-cell>
<van-cell id="cateName" clickable center is-link arrow-direction="down" bind:click="showPicker">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black">纸品品类</view>
<view class="{{cateName ? 'text-black' : 'text-gray'}}">{{cateName || '请选择品类'}}</view>
</view>
</van-cell>
<view class="cu-list menu no-card sm-border">
<view class="cu-item text-sg" style="text-align: right;border-top: 2rpx solid #f3f3f3">
<!-- <view class="cu-item text-sg" style="text-align: right;border-top: 2rpx solid #f3f3f3">
<view class="title">纸厂名称:</view>
<input value="{{factoryDetail.name}}" style="flex: 1"></input>
</view>
@ -34,7 +46,7 @@
</view>
</view>
<text class="cuIcon-right text-gray" wx:if="{{!flag}}" style="font-size:32rpx;padding-top:2rpx"></text>
</view>
</view> -->
<view class="cu-item">
<view class="text-sg" style="min-width:170rpx">预估单价(元/吨):</view>
<view class="text-sg text-black">

5
pages/index/index.js

@ -39,17 +39,18 @@ Scene({
updateManager.applyUpdate()
})
this.data.items = []
for (let mIndex = 0; m < app.userInfo.enterpriseInfos.length; mIndex++) {
for (let mIndex = 0; mIndex < app.userInfo.enterpriseInfos.length; mIndex++) {
const element = app.userInfo.enterpriseInfos[mIndex]
var enterprise = { text: element.enterpriseName }
var children = []
if(mIndex >= 1){
this.data.arrow = true
}
for (let nIndex = 0; n < element.factoryInfos.length; nIndex++) {
for (let nIndex = 0; nIndex < element.factoryInfos.length; nIndex++) {
const item = element.factoryInfos[nIndex]
if(item.factoryId == app.userInfo.factoryId){
this.data.mActiveIndex = mIndex
app.userInfo.factoryName = item.factoryName
if(element.isEnterprisePrimary){
app.userInfo.type = 'ADMIN'
} else {

18
pages/login/index.js

@ -26,8 +26,8 @@ Page({
loging: false,
regist: false,
metaData: null,
code: null
// code: '?mark=ztb_saas&QrCodeRecordId=589851945913683968'
// code: null
code: '?mark=ztb_saas&QrCodeRecordId=595295714456768512'
},
/************************************** 初始化登录流程 ********************************************/
onLoad: function (options) {
@ -102,6 +102,7 @@ Page({
if(enterpriseInfo.factoryInfos && enterpriseInfo.factoryInfos.length){
factoryId = enterpriseInfo.factoryInfos[enterpriseInfo.factoryInfos.length - 1].factoryId
}
app.userInfo.factoryId = factoryId
}
if(factoryId){
headerFactoryId(app.userInfo.factoryId)
@ -152,7 +153,7 @@ Page({
for (let n = 0; n < element.factoryInfos.length; n++) {
const item = element.factoryInfos[n]
if(applicationStatus == -1){
applicationStatus = item.applicationStatus
applicationStatus = item.type ? 1 : 0
}
}
}
@ -385,15 +386,14 @@ Page({
})
},
submitForm: function(){
if(!this.data.metaData){
util.showToast('您的申请已经提交,不要重复提交')
return
}
this.setData({loging: true})
if(this.data.metaData.qrPage == '/page/index/yaoqing'){
bindingAdmin(this.data.metaData).then(result => {
storage.put('Authorization', app.globalData.token)
app.userInfo.factoryId = this.data.metaData.factoryId
app.userInfo.factoryName = this.data.metaData.factoryName
this.data.metaData = null
this.setData({loging: false})
wx.redirectTo({ url: '/pages/index/index' })
this.fetchUserInfo(app.globalData.token)
}).catch(error => {
this.setData({loging: false})
util.showToast(error)

4
pages/login/index.wxml

@ -4,7 +4,7 @@
<image style="width:407rpx;height:160rpx" src="/assets/image/icon_logo.png"></image>
</view>
<view style="padding: 30rpx 80rpx;height:480rpx" wx:if="{{ metaData }}">
<view style="padding: 30rpx 80rpx;height:480rpx;width: 100%;" wx:if="{{ metaData }}">
<view class="text-xl">欢迎您使用纸通宝工厂版!</view>
<view class="text-df" style="padding:20rpx 0rpx" wx:if="{{metaData.qrPage == '/page/index/yaoqing'}}">
<text class="text-df">现邀请您成为<text class="text-bold text-blue">{{metaData.factoryName}}</text>的管理员</text>
@ -19,7 +19,7 @@
maxlength="20" placeholder="请输入您的姓名,以便于识别" bindinput="bindInput" disabled="{{loging}}" bindfocus="inputFocus"
wx:if="{{ metaData.qrPage == '/page/index/yaoqing' || metaData.qrPage == '/page/index/shenqing' }}"/>
</view>
<view style="padding: 30rpx 80rpx;height:480rpx" wx:elif="{{ regist }}">
<view style="padding: 30rpx 80rpx;height:480rpx;width: 100%;" wx:elif="{{ regist }}">
<view class="flex">
<image style="width:40rpx;height:40rpx" src="/assets/image/icon_phone.png"></image>
<text class="label" style="margin-left:24rpx">手机号码</text>

Loading…
Cancel
Save