Browse Source

no message

feature/v2.1
xpz2018 4 years ago
parent
commit
264b59b3ab
4 changed files with 82 additions and 75 deletions
  1. 2
      components/textarea/index.wxml
  2. 9
      pages/agent/appointment/index.js
  3. 144
      pages/agent/appointment/index.wxml
  4. 2
      pages/login/index.js

2
components/textarea/index.wxml

@ -1,4 +1,4 @@
<view class="textarea {{ value ? 'text-black' : 'text-gray' }}" bindtap="onEdit" wx:if="{{!editing}}">{{value || placeholder }}</view> <view class="textarea {{ value ? 'text-black' : 'text-gray' }}" bindtap="onEdit" wx:if="{{!editing}}">{{value || placeholder }}</view>
<textarea wx:else maxlength="100" value="{{value}}" style="padding-top:16rpx" class="textarea" <textarea wx:else maxlength="100" value="{{value}}" style="padding-top:16rpx" class="textarea"
cursor-spacing="60" focus="{{editing}}" bindfocus="onEdit" bindblur="onBlur" show-confirm-bar="{{false}}"
cursor-spacing="60" focus="{{editing}}" bindblur="onBlur" show-confirm-bar="{{false}}"
bindinput="bindInput" placeholder-style="color:#aaa" placeholder="{{placeholder}}"></textarea> bindinput="bindInput" placeholder-style="color:#aaa" placeholder="{{placeholder}}"></textarea>

9
pages/agent/appointment/index.js

@ -9,7 +9,9 @@ Scene({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
height: app.globalData.fragmentHeight,
safeBottom: app.globalData.safeBottom, safeBottom: app.globalData.safeBottom,
keyboardHeight: 0,
form: { form: {
paperCategoryId: '', paperCategoryId: '',
unitPrice: '' unitPrice: ''
@ -36,17 +38,18 @@ Scene({
if(options.activityId){ if(options.activityId){
this.data.form.activityId = options.activityId this.data.form.activityId = options.activityId
} }
this.data.windowWidth = wx.getSystemInfoSync().windowWidth
if(options.id){ if(options.id){
this.data.form.paperCategoryId = options.categoryId this.data.form.paperCategoryId = options.categoryId
wx.showLoading({ title: '加载中', mask: true }) wx.showLoading({ title: '加载中', mask: true })
getVehicleList().then(result => { getVehicleList().then(result => {
this.data.plateList = result.data.records this.data.plateList = result.data.records
if(this.data.plateList.length <= 7){ if(this.data.plateList.length <= 7){
this.setData({ vateList: this.data.plateList })
this.setData({ vateList: this.data.plateList, height: app.globalData.fragmentHeight - app.globalData.safeBottom - 120 })
} else { } else {
this.data.vateList = this.data.plateList.slice(0, 7) this.data.vateList = this.data.plateList.slice(0, 7)
this.data.vateList.push({plateNumber: '查看更多', fold: 1}) this.data.vateList.push({plateNumber: '查看更多', fold: 1})
this.setData({ vateList: this.data.vateList })
this.setData({ vateList: this.data.vateList, height: app.globalData.fragmentHeight - app.globalData.safeBottom - 120})
} }
}).catch(err => { }).catch(err => {
}) })
@ -87,7 +90,7 @@ Scene({
if(util.isEmpty(result.data) || util.isEmpty(result.data.bizUserId)){ if(util.isEmpty(result.data) || util.isEmpty(result.data.bizUserId)){
this.dialog = this.dialog || this.selectComponent('#van-dialog') this.dialog = this.dialog || this.selectComponent('#van-dialog')
this.dialog.stopLoading() this.dialog.stopLoading()
this.setData({ show: true })
// this.setData({ show: true })
} }
wx.hideLoading() wx.hideLoading()
}).catch(err => { }).catch(err => {

144
pages/agent/appointment/index.wxml

@ -4,86 +4,88 @@
<view slot="content">代卖预约</view> <view slot="content">代卖预约</view>
</cu-custom> </cu-custom>
<view class="bg-white flex flex-center" style="height:90rpx">
<view class="text-df flex flex-center" style="flex:1">提交订单</view>
<text class="cuIcon-right text-black" style="font-size:36rpx;"></text>
<view class="text-df flex flex-center" style="flex:1">等待预约</view>
<text class="cuIcon-right text-black" style="font-size:36rpx;"></text>
<view class="text-df flex flex-center" style="flex:1">线下送货</view>
<text class="cuIcon-right text-black" style="font-size:36rpx;"></text>
<view class="text-df flex flex-center" style="flex:1">余额提现</view>
</view>
<scroll-view scroll-y="true" style="height:{{height}}rpx">
<view class="bg-white flex flex-center" style="height:90rpx">
<view class="text-df flex flex-center" style="flex:1">提交订单</view>
<text class="cuIcon-right text-black" style="font-size:36rpx;"></text>
<view class="text-df flex flex-center" style="flex:1">等待预约</view>
<text class="cuIcon-right text-black" style="font-size:36rpx;"></text>
<view class="text-df flex flex-center" style="flex:1">线下送货</view>
<text class="cuIcon-right text-black" style="font-size:36rpx;"></text>
<view class="text-df flex flex-center" style="flex:1">余额提现</view>
</view>
<view class="flex flex-center bg-white margin-top" style="justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3">
<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 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 class="flex flex-center bg-white margin-top" style="justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3">
<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> </view>
</van-cell>
<van-cell clickable center bind:click="chooseCustomer">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black">预估单价(元/吨)</view>
<view class="text-sg text-black">
<text>{{formate.formatePrice(form.unitPrice)}}</text>
<text class="text-sm" wx:if="{{form.publicSubsidies}}">(已含补贴{{formate.formatePrice(form.publicSubsidies)}}元/吨)</text>
<van-cell clickable center 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> </view>
</view>
</van-cell>
<van-field id="totalEstimatedWeight" type="digit" placeholder="请输入预估重量" clearable input-align="right" bind:change="onInput">
<view slot="label" class="flex text-black" style="width:200rpx">
<text>预估重量(吨)</text>
</view>
</van-field>
<van-cell id="deliveryTime" 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="{{form.deliveryTime ? 'text-black' : 'text-gray'}}">{{form.deliveryTime||'请选择货到时间'}}</view>
</view>
</van-cell>
</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>
<van-cell clickable center bind:click="chooseCustomer">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black">预估单价(元/吨)</view>
<view class="text-sg text-black">
<text>{{formate.formatePrice(form.unitPrice)}}</text>
<text class="text-sm" wx:if="{{form.publicSubsidies}}">(已含补贴{{formate.formatePrice(form.publicSubsidies)}}元/吨)</text>
</view>
</view>
</van-cell>
<van-field id="totalEstimatedWeight" type="digit" placeholder="请输入预估重量" clearable input-align="right" bind:change="onInput">
<view slot="label" class="flex text-black" style="width:200rpx">
<text>预估重量(吨)</text>
</view>
</van-field>
<van-cell id="deliveryTime" 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="{{form.deliveryTime ? 'text-black' : 'text-gray'}}">{{form.deliveryTime||'请选择货到时间'}}</view>
</view>
</van-cell>
<view class="flex flex-center bg-white" style="margin-top: 16rpx;justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3">
<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>
<view class="bg-white cu-list grid col-4 no-border" style="padding: 16rpx 24rpx 0rpx 24rpx" wx:if="{{vateList.length}}">
<view class="cu-item" wx:for="{{vateList}}" wx:key="index" style="padding: 0rpx 8rpx 8rpx 8rpx">
<van-button plain round size="small" data-index="{{index}}" custom-style="padding: 0;min-width: 160rpx;" bind:click="tagChange">{{item.plateNumber}}</van-button>
<view class="flex flex-center bg-white" style="margin-top: 16rpx;justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3">
<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>
<view class="bg-white cu-list grid col-4 no-border" style="padding: 16rpx 24rpx 0rpx 24rpx" wx:if="{{vateList.length}}">
<view class="cu-item" wx:for="{{vateList}}" wx:key="index" style="padding: 0rpx 8rpx 8rpx 8rpx">
<van-button plain round size="small" data-index="{{index}}" custom-style="padding: 0;min-width: 160rpx;" bind:click="tagChange">{{item.plateNumber}}</van-button>
</view>
</view> </view>
</view>
<van-cell clickable center wx:for="{{vehicleList}}" wx:key="index" data-index="{{index}}" bind:click="showKeyboard">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black text-sg">
<text class="text-sm" style="width: 14px;line-height: 14px;text-align: center;border-radius: 50%;border: 1px solid #999">{{index + 1}}</text>
<text style="margin-left: 8rpx">货车车牌:</text>
<van-cell clickable center wx:for="{{vehicleList}}" wx:key="index" data-index="{{index}}" bind:click="showKeyboard">
<view slot="title" class="flex flex-justify">
<view class="flex flex-center text-black text-sg">
<text class="text-sm" style="width: 14px;line-height: 14px;text-align: center;border-radius: 50%;border: 1px solid #999">{{index + 1}}</text>
<text style="margin-left: 8rpx">货车车牌:</text>
</view>
<view class="{{item.plateNumber ? 'text-black' : 'text-gray'}}" style="flex:1">{{item.plateNumber || '点击输入车牌号码'}}</view>
<text class="cuIcon-close text-gray" style="font-size:44rpx;" data-index="{{index}}" wx:if="{{vehicleList.length > 1}}" catchtap="deleteCate"></text>
</view> </view>
<view class="{{item.plateNumber ? 'text-black' : 'text-gray'}}" style="flex:1">{{item.plateNumber || '点击输入车牌号码'}}</view>
<text class="cuIcon-close text-gray" style="font-size:44rpx;" data-index="{{index}}" wx:if="{{vehicleList.length > 1}}" catchtap="deleteCate"></text>
</van-cell>
<view class="bg-white flex flex-center" style="height:90rpx;line-height:90rpx" bindtap="addCate">
<text class="cuIcon-roundadd text-blue" style="font-size: 16px;"></text>
<text class="text-blue text-sg" style="margin-left:8rpx">添加车辆</text>
</view> </view>
</van-cell>
<view class="bg-white flex flex-center" style="height:90rpx;line-height:90rpx" bindtap="addCate">
<text class="cuIcon-roundadd text-blue" style="font-size: 16px;"></text>
<text class="text-blue text-sg" style="margin-left:8rpx">添加车辆</text>
</view>
<view class="flex flex-center bg-white" style="margin-top: 16rpx;justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3">
<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>
<view class="bg-white" style="padding:24rpx 30rpx">
<van-textarea id="remark" bind:change="bindInput" placeholder="点击输入备注,最多100字"></van-textarea>
</view>
<view class="flex flex-center bg-white" style="margin-top: 16rpx;justify-content: flex-start;padding: 24rpx 32rpx;border-bottom:1rpx solid #f3f3f3">
<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>
<view class="bg-white" style="padding:24rpx 30rpx">
<van-textarea id="remark" bind:change="bindInput" placeholder="点击输入备注,最多100字"></van-textarea>
</view>
<view style="height:16rpx"></view>
<view style="height:16rpx"></view>
</scroll-view>
<submit-layout> <submit-layout>
<van-button type="info" loading="{{requesting}}" custom-style="height:88rpx;width:688rpx" bind:click="submitForm">提交订单</van-button> <van-button type="info" loading="{{requesting}}" custom-style="height:88rpx;width:688rpx" bind:click="submitForm">提交订单</van-button>
</submit-layout> </submit-layout>

2
pages/login/index.js

@ -37,6 +37,7 @@ Page({
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate() updateManager.applyUpdate()
}) })
app.globalData.keyboardHeight = storage.get('keyboardHeight') || 0
if(options.q){ if(options.q){
//扫二维码进入的, //扫二维码进入的,
let q = decodeURIComponent(options.q) let q = decodeURIComponent(options.q)
@ -271,6 +272,7 @@ Page({
}, },
inputFocus: function(e) { inputFocus: function(e) {
app.globalData.keyboardHeight = e.detail.height app.globalData.keyboardHeight = e.detail.height
storage.put('keyboardHeight', app.globalData.keyboardHeight)
}, },
bindInput: function (e) { bindInput: function (e) {
this.data.form[e.target.id] = e.detail.value this.data.form[e.target.id] = e.detail.value

Loading…
Cancel
Save