Browse Source

no message

feature/v1.1
xpz2018 5 years ago
parent
commit
d92cd6a1e0
5 changed files with 172 additions and 14 deletions
  1. 2
      pages/process/order-info/index.wxml
  2. 43
      pages/process/payment/index.js
  3. 2
      pages/process/payment/index.json
  4. 135
      pages/process/payment/index.wxml
  5. 4
      pages/process/payment/index.wxss

2
pages/process/order-info/index.wxml

@ -30,7 +30,7 @@
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">车牌号码</view>
<view class="text-gray">{{form.plateNumber || '请输入车牌号码'}}</view>
<view class="text-gray">{{form.plateNumber || '- -'}}</view>
</view>
</van-cell>
<van-cell>

43
pages/process/payment/index.js

@ -1,6 +1,6 @@
// pages/process/payment/index.js
import Dialog from '../../../components/dialog/dialog'
import { getPeymentList, paymentOrder } from "../../../api/saas"
import { getPeymentList, paymentOrder, getFactoryOrderInfo } from "../../../api/saas"
const event = require('../../../utils/event')
const util = require('../../../utils/util')
const math = require('../../../utils/math') //导入模块
@ -11,6 +11,7 @@ Page({
* 页面的初始数据
*/
data: {
height: app.globalData.fragmentHeight,
safeBottom: app.globalData.safeBottom,
form: {
status: 4,
@ -24,7 +25,9 @@ Page({
ids: [],
payRemark: ''
},
requesting: false
requesting: false,
popup: false,
detail: null
},
/**
* 生命周期函数--监听页面加载
@ -38,7 +41,7 @@ Page({
this.amountList(result.data.records)
}).catch(err => {
wx.hideLoading()
this.setData({ safeBottom: app.globalData.safeBottom })
this.setData({ height: app.globalData.fragmentHeight, safeBottom: app.globalData.safeBottom })
util.showToast(err)
})
} else if(options.channel){
@ -62,9 +65,9 @@ Page({
this.data.params.bankCardNo = element.bankCardNo
}
}
this.setData({ safeBottom: app.globalData.safeBottom, orderList, amount, params: this.data.params })
this.setData({ height: app.globalData.fragmentHeight, safeBottom: app.globalData.safeBottom, orderList, amount, params: this.data.params })
} else {
this.setData({ safeBottom: app.globalData.safeBottom })
this.setData({ height: app.globalData.fragmentHeight, safeBottom: app.globalData.safeBottom })
}
},
onTypeChange: function({detail}){
@ -78,7 +81,6 @@ Page({
this.setData({ ['params.settleType']: e.currentTarget.dataset.name })
},
onChange: function(e){
console.log(e.detail)
var item = this.data.orderList[e.currentTarget.dataset.index]
item.checked = !e.detail
var amount = 0
@ -93,7 +95,14 @@ Page({
},
lookItem: function(e){
var item = this.data.orderList[e.currentTarget.dataset.index]
// wx.navigateTo({ url: `/pages/process/order-info/index?id=${item.id}` })
wx.showLoading({ title: '正在获取', mask: true })
getFactoryOrderInfo(item.id).then(result => {
this.setData({ popup: true, detail: result.data })
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
},
bindInput: function (e) {
this.data.params[e.target.id] = e.detail.value
@ -106,13 +115,13 @@ Page({
util.showToast('请选择要付款的订单')
return
}
Dialog.confirm({ title: '温馨提示', message: '确定要付款吗?' }).then(() => {
Dialog.confirm({ title: '温馨提示', message: '订单已经付款,在此进行确认?' }).then(() => {
wx.showLoading({ title: '正在获取', mask: true })
this.data.requesting = true
this.data.params.settleType = Number(this.data.params.settleType)
paymentOrder(this.data.params).then(result => {
wx.hideLoading()
util.showBackToast('订单已经付款')
util.showBackToast('订单已支付')
const channel = this.getOpenerEventChannel()
channel.emit('onOrderChange', { what: 12, desc: 'PaymentOrder' })
event.emit('OrderMessage', { what: 12, desc: 'PaymentOrder' })
@ -123,5 +132,21 @@ Page({
})
}).catch(err => {
})
},
onPopupClose: function(){
this.setData({ popup: false })
},
viewImage: function (e) {
var imgList = []
if(e.currentTarget.dataset.type == 0){
for (let index = 0; index < this.data.detail.totalWeighingPicture.length; index++) {
imgList.push(this.data.detail.totalWeighingPicture[index].url)
}
} else {
for (let index = 0; index < this.data.detail.emptyWeighingPicture.length; index++) {
imgList.push(this.data.detail.emptyWeighingPicture[index].url)
}
}
wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url })
}
})

2
pages/process/payment/index.json

@ -1,11 +1,13 @@
{
"usingComponents": {
"van-index-anchor": "/components/index-anchor/index",
"van-cell": "/components/cell/index",
"van-button": "/components/button/index",
"van-checkbox": "/components/checkbox/index",
"van-radio": "/components/radio/index",
"van-radio-group": "/components/radio-group/index",
"van-image": "/components/image/index",
"van-popup": "/components/popup/index",
"van-dialog": "/components/dialog/index"
}
}

135
pages/process/payment/index.wxml

@ -24,8 +24,8 @@
<text slot="title">
<text>银行卡转账</text>
<text wx:if="{{params.bankCardNo}}">({{params.bankCardNo}})</text>
</text>
<van-radio slot="right-icon" name="2" disabled="{{!params.bankCardNo}}"/>
</text>
<van-radio slot="right-icon" name="2" disabled="{{!params.bankCardNo}}" />
</van-cell>
<van-cell title="使用千鸟代付" clickable is-link link-type="navigateTo" url="/pages/htmls/auths/index"></van-cell>
</van-cell-group>
@ -50,7 +50,8 @@
</view>
<van-cell clickable is-link wx:for="{{ orderList }}" wx:key="index">
<view slot="title" class="flex" style=";justify-content: flex-start">
<van-checkbox value="{{ !item.checked }}" custom-class="checkbox" data-index="{{index}}" icon-size="36rpx" shape="square" bind:change="onChange"></van-checkbox>
<van-checkbox value="{{ !item.checked }}" custom-class="checkbox" data-index="{{index}}" icon-size="36rpx"
shape="square" bind:change="onChange"></van-checkbox>
<view style="flex:1;margin-left:16rpx" data-index="{{index}}" catchtap="lookItem">
<view class="flex flex-justify">
<view class="text-black text-lg">{{item.factoryCustomerName}} {{item.factoryCustomerMobile || ''}}</view>
@ -66,7 +67,133 @@
<view style="height:{{132 + safeBottom}}rpx;"></view>
<view class="cu-bar bg-white foot" style="height:{{132 + safeBottom}}rpx;padding:0rpx 32rpx {{safeBottom}}rpx 32rpx;" wx:if="{{orderList}}">
<van-button type="info" custom-style="height:88rpx;width:686rpx" disabled="{{amount==0}}" bind:click="paymentOrder">付款</van-button>
<van-button type="info" custom-style="height:88rpx;width:686rpx" disabled="{{amount==0}}" bind:click="paymentOrder">付款
</van-button>
</view>
<van-popup show="{{ popup }}" closeable position="bottom" z-index="66" custom-style="height: {{height * 0.85}}rpx" bind:close="onPopupClose">
<view class="text-sg text-bold" style="padding:30rpx;border-bottom: 2rpx solid #f3f3f3;height:100rpx">
<text>订单详情</text>
<text>({{detail.id}})</text>
</view>
<scroll-view scroll-y style="height: {{height * 0.85 - 100}}rpx;" wx:if="{{detail}}">
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">客户姓名</view>
<view class="text-gray">{{detail.factoryCustomerName}}</view>
</view>
</van-cell>
<van-cell wx:if="{{detail.plateNumber}}">
<view slot="title" class="flex flex-justify">
<view class="text-black">车牌号码</view>
<view class="text-gray">{{detail.plateNumber || '- -'}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">废纸品类</view>
<view class="text-gray">{{detail.productName}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">毛重(公斤)</view>
<view class="text-gray">{{detail.totalWeight}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">皮重(公斤)</view>
<view class="text-gray">{{detail.emptyWeight || '- -'}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">净重(公斤)</view>
<view class="text-gray">{{detail.netWeight || '- -'}}</view>
</view>
</van-cell>
<van-cell wx:if="{{detail.deductWeight}}">
<view slot="title" class="flex flex-justify">
<view class="text-black">扣重(公斤)</view>
<view class="text-gray">-{{detail.deductWeight}}</view>
</view>
</van-cell>
<van-cell wx:if="{{detail.deductPercent}}">
<view slot="title" class="flex flex-justify">
<view class="text-black">扣点(%)</view>
<view class="text-gray">{{detail.deductPercent}}</view>
</view>
</van-cell>
<van-cell wx:if="{{detail.inspectorName}}">
<view slot="title" class="flex flex-justify">
<view class="text-black">定价员</view>
<view class="text-gray">{{detail.inspectorName || '- -'}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">定价时间</view>
<view class="text-gray">{{detail.inspectionTime || ''}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="text-black">
<view>过毛重照片</view>
<view class="flex" style="margin-top:18rpx">
<van-image wx:for="{{detail.totalWeighingPicture}}" wx:key="index" use-loading-slot width="150" height="100"
custom-class="page-icon" data-url="{{item.url}}" fit="cover" data-type="0" src="{{item.url}}" bind:click="viewImage">
<view class="image-load" slot="loading">
<van-loading type="spinner" size="32" />
</view>
</van-image>
</view>
</view>
</van-cell>
<van-cell wx:if="{{detail.emptyWeighingPicture && detail.emptyWeighingPicture.length}}">
<view slot="title" class="text-black">
<view>过皮重照片</view>
<view class="flex" style="margin-top:18rpx">
<van-image wx:for="{{detail.emptyWeighingPicture}}" wx:key="index" use-loading-slot width="150" height="100"
custom-class="page-icon" data-url="{{item.url}}" fit="cover" data-type="1" src="{{item.url}}" bind:click="viewImage">
<view class="image-load" slot="loading">
<van-loading type="spinner" size="32" />
</view>
</van-image>
</view>
</view>
</van-cell>
<van-cell wx:if="{{detail.inspectionRemark}}">
<view slot="title" class="text-black">
<view>备注</view>
<view class="flex" style="margin-top:18rpx;border: 2rpx solid #f3f3f3;padding: 18rpx;">{{detail.inspectionRemark}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">单价(元/公斤)</view>
<view class="text-gray">{{formate.formateAmount(detail.settleUnitPrice)}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">结算金额(元)</view>
<view class="text-gray">{{formate.formateAmount(detail.settlePrice) || '- -'}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">下单时间</view>
<view class="text-gray">{{detail.createTime || ''}}</view>
</view>
</van-cell>
<van-cell>
<view slot="title" class="flex flex-justify">
<view class="text-black">订单编号</view>
<view class="text-gray">{{detail.id}}</view>
</view>
</van-cell>
</scroll-view>
</van-popup>
<van-dialog id="van-dialog" />

4
pages/process/payment/index.wxss

@ -3,6 +3,10 @@
padding-top: 6rpx;
}
.page-icon {
margin-right: 24rpx;
}
.lable{
padding: 32rpx 32rpx 24rpx 32rpx;
margin-top:18rpx;

Loading…
Cancel
Save