Browse Source

no message

feature/v1.4
xpz2018 4 years ago
parent
commit
384b374753
10 changed files with 87 additions and 22 deletions
  1. 7
      pages/agent/appointment/index.js
  2. 1
      pages/agent/appointment/index.wxml
  3. 1
      pages/home/index/index.js
  4. 2
      pages/login/index.js
  5. 2
      pages/message/index/index.js
  6. 15
      pages/process/order-price/index.js
  7. 16
      pages/setting/authory/index.js
  8. 34
      pages/setting/authory/index.wxml
  9. 22
      pages/storage/pound-info/index.js
  10. 9
      pages/storage/pound-info/index.wxml

7
pages/agent/appointment/index.js

@ -1,5 +1,6 @@
// pages/process/order-check/index.js // pages/process/order-check/index.js
import Scene from '../../index/scene' import Scene from '../../index/scene'
import Dialog from '../../../components/dialog/dialog'
import { getVehicleList, getFactoryPriceDetail, getRelation, postRelation, getProxyOrderInfo, createProxyOrder } from "../../../api/ztb" import { getVehicleList, getFactoryPriceDetail, getRelation, postRelation, getProxyOrderInfo, createProxyOrder } from "../../../api/ztb"
const util = require('../../../utils/util') const util = require('../../../utils/util')
const math = require('../../../utils/math') const math = require('../../../utils/math')
@ -212,6 +213,12 @@ Scene({
this.setData({ vehicleList: this.data.vehicleList }) this.setData({ vehicleList: this.data.vehicleList })
}, },
submitForm: function (e) { submitForm: function (e) {
if(!app.userInfo.isAuth) {
Dialog.alert({ title: '温馨提示', message: '您暂未实名认证,请实名认证后提交订单。' }).then(() => {
wx.navigateTo({ url: '/pages/setting/authory/index' })
})
return
}
if (util.isEmpty(this.data.form.totalEstimatedWeight)) { if (util.isEmpty(this.data.form.totalEstimatedWeight)) {
util.showToast('请输入预估重量') util.showToast('请输入预估重量')
return return

1
pages/agent/appointment/index.wxml

@ -102,4 +102,5 @@
<van-dialog use-slot title="邀请码" show="{{ show }}" transition="fade" show-cancel-button bind:cancel="onClose" bind:confirm="onInput"> <van-dialog use-slot title="邀请码" show="{{ show }}" transition="fade" show-cancel-button bind:cancel="onClose" bind:confirm="onInput">
<input class="dialog-input" placeholder-style="color:#aaa;" maxlength="8" placeholder="填写业务人员邀请码(必填)" bindinput="bindInput" /> <input class="dialog-input" placeholder-style="color:#aaa;" maxlength="8" placeholder="填写业务人员邀请码(必填)" bindinput="bindInput" />
</van-dialog> </van-dialog>
<van-dialog id="van-dialog" />
<notification id="qn-notification"/> <notification id="qn-notification"/>

1
pages/home/index/index.js

@ -40,6 +40,7 @@ Component({
onEvent: function (message) { onEvent: function (message) {
if (message.what == 82) { if (message.what == 82) {
// 认证成功 // 认证成功
this.setUserInfo()
} }
}, },
setUserInfo: function(){ setUserInfo: function(){

2
pages/login/index.js

@ -129,7 +129,7 @@ Page({
return return
} }
headerFactoryId(app.userInfo.factoryId) headerFactoryId(app.userInfo.factoryId)
// wx.redirectTo({ url: '/pages/agent/select-list/index' })
// wx.redirectTo({ url: '/pages/setting/authory/index' })
wx.redirectTo({ url: '/pages/index/index' }) wx.redirectTo({ url: '/pages/index/index' })
} else { } else {
wx.redirectTo({ url: '/pages/client/index/index' }) wx.redirectTo({ url: '/pages/client/index/index' })

2
pages/message/index/index.js

@ -41,7 +41,7 @@ Component({
}, },
onEvent: function (message) { onEvent: function (message) {
if (message.what == 888) { if (message.what == 888) {
this.setData({ userInfo: app.accountInfo })
this.setData({ userInfo: app.userInfo })
} }
}, },
onRefreshList: function () { onRefreshList: function () {

15
pages/process/order-price/index.js

@ -35,13 +35,17 @@ Scene({
} }
this.setData({ safeBottom: app.globalData.safeBottom, columns: this.data.columns }) this.setData({ safeBottom: app.globalData.safeBottom, columns: this.data.columns })
}).catch(err => { }).catch(err => {
wx.hideLoading()
this.setData({ safeBottom: app.globalData.safeBottom }) this.setData({ safeBottom: app.globalData.safeBottom })
util.showToast(err) util.showToast(err)
}) })
getFactoryOrderInfo(options.id).then(result => { getFactoryOrderInfo(options.id).then(result => {
wx.hideLoading() wx.hideLoading()
result.data.sign = 1 result.data.sign = 1
for (let index = 0; index < 2; index++) {
if(util.isEmpty(result.data.totalWeighingPicture[index])){
result.data.totalWeighingPicture[index] = { url: 'error' }
}
}
this.setData({ form: result.data }) this.setData({ form: result.data })
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()
@ -163,8 +167,13 @@ Scene({
viewImage: function (e) { viewImage: function (e) {
var imgList = [] var imgList = []
for (let index = 0; index < this.data.form.totalWeighingPicture.length; index++) { for (let index = 0; index < this.data.form.totalWeighingPicture.length; index++) {
imgList.push(this.data.form.totalWeighingPicture[index].url)
var url = this.data.form.totalWeighingPicture[index].url
if(!util.isEmpty(url) && 'error' != url){
imgList.push(url)
}
}
if(imgList.length){
wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url })
} }
wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url })
} }
}) })

16
pages/setting/authory/index.js

@ -45,10 +45,18 @@ Scene({
}) })
}, },
submitForm: function(){ submitForm: function(){
if(util.isEmpty(this.data.form.realName)){
util.showToast('请输入真实姓名')
return
}
if(util.isEmpty(this.data.form.certificateNo)){
util.showToast('请输入身份证号码')
return
}
wx.showLoading({ title: '处理中', mask: true }) wx.showLoading({ title: '处理中', mask: true })
certificateIdentity(this.data.form).then(result => { certificateIdentity(this.data.form).then(result => {
wx.hideLoading() wx.hideLoading()
app.accountInfo.isAuth = 1
app.userInfo.isAuth = 1
event.emit('EventMessage', { what: 82, desc: 'Auth Success' }) event.emit('EventMessage', { what: 82, desc: 'Auth Success' })
Dialog.alert({ title: '温馨提示', message: '个人信息认证成功' }).then(() => { Dialog.alert({ title: '温馨提示', message: '个人信息认证成功' }).then(() => {
wx.navigateBack() wx.navigateBack()
@ -58,6 +66,12 @@ Scene({
util.showToast(error) util.showToast(error)
}) })
}, },
nextStep: function(){
this.setData({ step: 1 })
},
bindInput: function (e) {
this.data.form[e.currentTarget.id] = e.detail.value
},
/*******************************************************图片上传************************************************************/ /*******************************************************图片上传************************************************************/
chooseImage: function(e) { chooseImage: function(e) {
if (this.data.flag) { if (this.data.flag) {

34
pages/setting/authory/index.wxml

@ -4,7 +4,10 @@
</cu-custom> </cu-custom>
<view class="cu-bar bg-white" style="min-height:90rpx" wx:if="{{step == 0}}"> <view class="cu-bar bg-white" style="min-height:90rpx" wx:if="{{step == 0}}">
<view class="action" style="color:#333333"><text class="text-red" style="padding-top: 18px;font-size: 30px;">*</text>请拍摄/上传本人身份证(头像面)</view>
<view class="action" style="color:#333333">
<!-- <text class="text-red" style="padding-top: 20rpx;font-size: 40rpx;">*</text> -->
<text>请拍摄/上传本人身份证(头像面)</text>
</view>
</view> </view>
<view class="cu-form-group" wx:if="{{step == 0}}"> <view class="cu-form-group" wx:if="{{step == 0}}">
<view class="flex flex-justify" style="width:100%;"> <view class="flex flex-justify" style="width:100%;">
@ -20,7 +23,10 @@
</view> </view>
</view> </view>
<view class="cu-bar bg-white" style="min-height:90rpx" wx:if="{{step == 0}}"> <view class="cu-bar bg-white" style="min-height:90rpx" wx:if="{{step == 0}}">
<view class="action" style="color:#333333"><text class="text-red" style="padding-top: 18px;font-size: 30px;">*</text>请拍摄/上传本人身份证(国徽面)</view>
<view class="action" style="color:#333333">
<!-- <text class="text-red" style="padding-top: 20rpx;font-size: 40rpx;">*</text> -->
<text>请拍摄/上传本人身份证(国徽面)</text>
</view>
</view> </view>
<view class="cu-form-group" style="border-top: 0rpx solid #eee" wx:if="{{step == 0}}"> <view class="cu-form-group" style="border-top: 0rpx solid #eee" wx:if="{{step == 0}}">
<view class="flex flex-justify" style="width:100%;padding-bottom:30rpx"> <view class="flex flex-justify" style="width:100%;padding-bottom:30rpx">
@ -37,18 +43,26 @@
</view> </view>
</view> </view>
<view style="padding:0rpx 30rpx;margin-top:10rpx" wx:if="{{step == 1}}">
<view class="cu-form-group margin-top" style="min-height:120rpx;padding:0rpx;">
<text class="label" style="margin-left:12rpx;margin-right:24rpx">姓名:</text>
<input value="{{form.realName}}" disabled="{{true}}"></input>
<view style="padding:0rpx 32rpx;margin-top:24rpx" wx:if="{{step == 1}}">
<view class="cu-form-group margin-top" style="min-height:100rpx;padding:0rpx;">
<view class="label flex flex-center" style="margin-left:12rpx;margin-right:24rpx;width:200rpx;justify-content: flex-start">
<text class="text-red" style="padding-top: 20rpx;font-size: 40rpx;">*</text>
<text>姓名:</text>
</view>
<input id="realName" placeholder="请输入真实姓名" placeholder-style="color:#aaa" value="{{form.realName}}" bind:input="bindInput"/>
</view> </view>
<view class="cu-form-group" style="min-height:120rpx;padding:0rpx;border-bottom: 1px solid #eee">
<text class="label" style="margin-left:12rpx;margin-right:24rpx">身份证号码:</text>
<input value="{{form.certificateNo}}" disabled="{{true}}"></input>
<view class="cu-form-group" style="min-height:100rpx;padding:0rpx;border-bottom: 1px solid #eee">
<view class="label flex flex-center" style="margin-left:12rpx;margin-right:24rpx;width:200rpx;justify-content: flex-start">
<text class="text-red" style="padding-top: 20rpx;font-size: 40rpx;">*</text>
<text>身份证号码:</text>
</view>
<input id="certificateNo" placeholder="请输入身份证号码" placeholder-style="color:#aaa" value="{{form.certificateNo}}" bind:input="bindInput"/>
</view> </view>
</view> </view>
<view class="flex flex-direction" style="padding: 36rpx 32rpx" wx:if="{{step == 0}}">
<view style="padding: 36rpx 32rpx" wx:if="{{step == 0}}">
<van-button block bind:click="nextStep">手动输入</van-button>
<view style="margin-top:48rpx"></view>
<van-button block type="info" loading="{{loging}}" bind:click="submitImage">提交</van-button> <van-button block type="info" loading="{{loging}}" bind:click="submitImage">提交</van-button>
</view> </view>
<view class="flex flex-direction" style="padding: 36rpx 32rpx;margin-top:96rpx" wx:if="{{step == 1}}"> <view class="flex flex-direction" style="padding: 36rpx 32rpx;margin-top:96rpx" wx:if="{{step == 1}}">

22
pages/storage/pound-info/index.js

@ -25,16 +25,24 @@ Scene({
result.data.emptyWeighingPicture = [] result.data.emptyWeighingPicture = []
if(result.data.firstWeightImageUrl1){ if(result.data.firstWeightImageUrl1){
result.data.emptyWeighingPicture.push(result.data.firstWeightImageUrl1) result.data.emptyWeighingPicture.push(result.data.firstWeightImageUrl1)
} else {
result.data.emptyWeighingPicture.push('error')
} }
if(result.data.firstWeightImageUrl2){ if(result.data.firstWeightImageUrl2){
result.data.emptyWeighingPicture.push(result.data.firstWeightImageUrl2) result.data.emptyWeighingPicture.push(result.data.firstWeightImageUrl2)
} else {
result.data.emptyWeighingPicture.push('error')
} }
result.data.totalWeighingPicture = [] result.data.totalWeighingPicture = []
if(result.data.secondWeightImageUrl1){ if(result.data.secondWeightImageUrl1){
result.data.totalWeighingPicture.push(result.data.secondWeightImageUrl1) result.data.totalWeighingPicture.push(result.data.secondWeightImageUrl1)
} else if(Number(result.data.secondWeight) > 0){
result.data.totalWeighingPicture.push('error')
} }
if(result.data.secondWeightImageUrl2){ if(result.data.secondWeightImageUrl2){
result.data.totalWeighingPicture.push(result.data.secondWeightImageUrl2) result.data.totalWeighingPicture.push(result.data.secondWeightImageUrl2)
} else if(Number(result.data.secondWeight) > 0){
result.data.totalWeighingPicture.push('error')
} }
this.setData({ safeBottom: app.globalData.safeBottom, form: result.data }) this.setData({ safeBottom: app.globalData.safeBottom, form: result.data })
}).catch(err => { }).catch(err => {
@ -76,13 +84,21 @@ Scene({
var imgList = [] var imgList = []
if(e.currentTarget.dataset.type == 1){ if(e.currentTarget.dataset.type == 1){
for (let index = 0; index < this.data.form.totalWeighingPicture.length; index++) { for (let index = 0; index < this.data.form.totalWeighingPicture.length; index++) {
imgList.push(this.data.form.totalWeighingPicture[index])
var url = this.data.form.totalWeighingPicture[index]
if(!util.isEmpty(url) && 'error' != url){
imgList.push(url)
}
} }
} else { } else {
for (let index = 0; index < this.data.form.emptyWeighingPicture.length; index++) { for (let index = 0; index < this.data.form.emptyWeighingPicture.length; index++) {
imgList.push(this.data.form.emptyWeighingPicture[index])
var url = this.data.form.emptyWeighingPicture[index]
if(!util.isEmpty(url) && 'error' != url){
imgList.push(url)
}
} }
} }
wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url })
if(imgList.length){
wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url })
}
} }
}) })

9
pages/storage/pound-info/index.wxml

@ -21,7 +21,10 @@
<van-cell wx:if="{{form.secondWeight}}"> <van-cell wx:if="{{form.secondWeight}}">
<view slot="title" class="flex flex-justify"> <view slot="title" class="flex flex-justify">
<view class="text-black">第二次过磅(毛重)</view> <view class="text-black">第二次过磅(毛重)</view>
<view class="text-gray">重量(公斤):{{formate.maxWeight(form.firstWeight, form.secondWeight)}}</view>
<view class="text-gray flex flex-justify">
<text style="margin-right:16rpx">重量(公斤):{{formate.maxWeight(form.firstWeight, form.secondWeight)}}</text>
<van-button plain round type="info" size="small" bind:click="repeatForm">重新过磅</van-button>
</view>
</view> </view>
</van-cell> </van-cell>
<view class="bg-white flex flex-justify" style="padding:24rpx 32rpx" wx:if="{{form.totalWeighingPicture.length}}"> <view class="bg-white flex flex-justify" style="padding:24rpx 32rpx" wx:if="{{form.totalWeighingPicture.length}}">
@ -32,9 +35,9 @@
</view> </view>
</van-image> </van-image>
</view> </view>
<view class="bg-white flex justify-end" style="padding-right:32rpx" wx:if="{{form.secondWeight}}">
<!-- <view class="bg-white flex justify-end" style="padding-right:32rpx" wx:if="{{form.secondWeight}}">
<van-button plain type="info" size="small" bind:click="repeatForm">重新过磅</van-button> <van-button plain type="info" size="small" bind:click="repeatForm">重新过磅</van-button>
</view>
</view> -->
<van-cell wx:if="{{form.netWeight}}"> <van-cell wx:if="{{form.netWeight}}">
<view slot="title" class="flex flex-justify"> <view slot="title" class="flex flex-justify">

Loading…
Cancel
Save