Browse Source

no message

feature/v1.0
xpz2018 5 years ago
parent
commit
a482f0431c
7 changed files with 40 additions and 21 deletions
  1. 13
      api/user.js
  2. 6
      pages/login/index.js
  3. 10
      pages/process/order-info/index.js
  4. 10
      pages/process/order-info/index.wxml
  5. 2
      pages/process/order-list/index.js
  6. 16
      pages/process/order-price/index.js
  7. 4
      pages/process/order-price/index.wxml

13
api/user.js

@ -21,7 +21,11 @@ const updateUserInfo = (params) => mPost('/uec/user/update/user-info', params, c
const generateCode = (params) => mPost('/uec/generate/qrcode', params, config) const generateCode = (params) => mPost('/uec/generate/qrcode', params, config)
const verifyCode = (code, params) => mGet(`/uec/verify/qrcode${code}`, params, config) const verifyCode = (code, params) => mGet(`/uec/verify/qrcode${code}`, params, config)
const applyEmplyee = (params) => mPost(`/uec/apply/to/be/emplyee/of/enterprise-department`, params, config) const applyEmplyee = (params) => mPost(`/uec/apply/to/be/emplyee/of/enterprise-department`, params, config)
const getCheckList = (params) => mGet(`/uec/get/auditing-joining-enterprise-application-list`, params, config)
const getEmployeList = (params) => mGet(`/uec/get/passed-employees`, params, config)
const auditEmploye = (params) => mPost(`/uec/audit/employee-joining-application`, params, config)
const deleteEmploye = (params) => mPost(`/uec/remove/employees`, params, config)
const adminEmploye = (params) => mPost(`/uec/grant/admin-role/to/employees`, params, config)
// **************************************************************************************************************************************** // ****************************************************************************************************************************************
// /authorize/by-wechat-applet小程序登录 // /authorize/by-wechat-applet小程序登录
function loginWechat(form) { function loginWechat(form) {
@ -189,5 +193,10 @@ export {
modifyMobile, modifyMobile,
verifyCode, verifyCode,
generateCode, generateCode,
applyEmplyee
applyEmplyee,
getCheckList,
getEmployeList,
auditEmploye,
deleteEmploye,
adminEmploye
} }

6
pages/login/index.js

@ -23,8 +23,8 @@ Page({
loging: false, loging: false,
regist: false, regist: false,
metaData: null, metaData: null,
// code: null,
code: '?mark=cloudprint&QrCodeRecordId=552615937199706112'
code: null,
// code: '?mark=cloudprint&QrCodeRecordId=552615937199706112'
}, },
/************************************** 初始化登录流程 ********************************************/ /************************************** 初始化登录流程 ********************************************/
onLoad: function (options) { onLoad: function (options) {
@ -97,7 +97,7 @@ Page({
app.userInfo = result.data app.userInfo = result.data
app.globalData.token = authorization app.globalData.token = authorization
wx.hideLoading() wx.hideLoading()
if(app.userInfo.factoryId){
if(app.userInfo.enterpriseId){
storage.put('Authorization', app.globalData.token) storage.put('Authorization', app.globalData.token)
this.setData({ loging: false}) this.setData({ loging: false})
if(this.data.metaData && app.userInfo.factoryId != this.data.metaData.factoryId){ if(this.data.metaData && app.userInfo.factoryId != this.data.metaData.factoryId){

10
pages/process/order-info/index.js

@ -23,7 +23,6 @@ Page({
wx.showLoading({ title: '正在获取', mask: true }) wx.showLoading({ title: '正在获取', mask: true })
getFactoryOrderInfo(options.id).then(result => { getFactoryOrderInfo(options.id).then(result => {
wx.hideLoading() wx.hideLoading()
result.data.amount = math.times(math.minus(result.data.netWeight, result.data.deductWeight), result.data.settleUnitPrice)
if(result.data.status == 4){ if(result.data.status == 4){
this.data.title = '待付款' this.data.title = '待付款'
} else if(result.data.status == 5){ } else if(result.data.status == 5){
@ -34,6 +33,7 @@ Page({
wx.hideLoading() wx.hideLoading()
this.setData({ safeBottom: app.globalData.safeBottom }) this.setData({ safeBottom: app.globalData.safeBottom })
util.showToast(err) util.showToast(err)
console.log(err)
}) })
} }
}, },
@ -83,12 +83,12 @@ Page({
viewImage: function (e) { viewImage: function (e) {
var imgList = [] var imgList = []
if(e.currentTarget.dataset.type == 0){ if(e.currentTarget.dataset.type == 0){
for (let index = 0; index < this.data.form.preWeighingPicture.length; index++) {
imgList.push(this.data.this.data.form.preWeighingPicture[index].url)
for (let index = 0; index < this.data.form.totalWeighingPicture.length; index++) {
imgList.push(this.data.form.totalWeighingPicture[index].url)
} }
} else { } else {
for (let index = 0; index < this.data.form.aftWeighingPicture.length; index++) {
imgList.push(this.data.this.data.form.aftWeighingPicture[index].url)
for (let index = 0; index < this.data.form.emptyWeighingPicture.length; index++) {
imgList.push(this.data.form.emptyWeighingPicture[index].url)
} }
} }
wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url }) wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url })

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

@ -68,8 +68,8 @@
<view slot="title" class="text-black"> <view slot="title" class="text-black">
<view>过毛重照片</view> <view>过毛重照片</view>
<view class="flex" style="margin-top:18rpx"> <view class="flex" style="margin-top:18rpx">
<van-image wx:for="{{form.preWeighingPicture}}" wx:key="index" use-loading-slot width="100" height="100"
custom-class="page-icon" data-url="{{item.url}}" data-type="0" src="{{item.url}}" bind:click="viewImage">
<van-image wx:for="{{form.totalWeighingPicture}}" wx:key="index" use-loading-slot width="100" 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"> <view class="image-load" slot="loading">
<van-loading type="spinner" size="32" /> <van-loading type="spinner" size="32" />
</view> </view>
@ -81,8 +81,8 @@
<view slot="title" class="text-black"> <view slot="title" class="text-black">
<view>过皮重照片</view> <view>过皮重照片</view>
<view class="flex" style="margin-top:18rpx"> <view class="flex" style="margin-top:18rpx">
<van-image wx:for="{{form.aftWeighingPicture}}" wx:key="index" use-loading-slot width="100" height="100"
custom-class="page-icon" data-url="{{item.url}}" data-type="1" src="{{item.url}}" bind:click="viewImage">
<van-image wx:for="{{form.emptyWeighingPicture}}" wx:key="index" use-loading-slot width="100" 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"> <view class="image-load" slot="loading">
<van-loading type="spinner" size="32" /> <van-loading type="spinner" size="32" />
</view> </view>
@ -101,7 +101,7 @@
<van-cell> <van-cell>
<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">{{form.amount}}</view>
<view class="text-gray">{{form.settlePrice || ''}}</view>
</view> </view>
</van-cell> </van-cell>
<van-cell> <van-cell>

2
pages/process/order-list/index.js

@ -112,7 +112,7 @@ Page({
}, },
lookItem: function (e) { lookItem: function (e) {
var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index] var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index]
if(item.status == 3 || item.status == 4 || item.status == 5){
if(item.status == 2 || item.status == 3 || item.status == 4 || item.status == 5){
wx.navigateTo({ url: '/pages/process/order-info/index?id=' + item.id }) wx.navigateTo({ url: '/pages/process/order-info/index?id=' + item.id })
} }
}, },

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

@ -107,7 +107,17 @@ Page({
return return
} }
wx.showLoading({ title: '处理中', mask: true }) wx.showLoading({ title: '处理中', mask: true })
pricingOrder(this.data.form).then(result => {
var data = {id: this.data.form.id}
if(Number(this.data.form.deductWeight) > 0){
data.deductWeight = Number(this.data.form.deductWeight)
} else if(Number(this.data.form.deductPercent) > 0){
data.deductPercent = Number(this.data.form.deductPercent)
}
data.plateNumber = this.data.form.plateNumber
data.productId = this.data.form.productId
data.unitPrice = Number(this.data.form.unitPrice)
data.isWithoutTare = Number(this.data.form.isWithoutTare)
pricingOrder(data).then(result => {
wx.hideLoading() wx.hideLoading()
util.showBackToast('定价成功') util.showBackToast('定价成功')
event.emit('OrderMessage', { what: 12, desc: 'pricingOrder' }) event.emit('OrderMessage', { what: 12, desc: 'pricingOrder' })
@ -118,8 +128,8 @@ Page({
}, },
viewImage: function (e) { viewImage: function (e) {
var imgList = [] var imgList = []
for (let index = 0; index < this.data.form.preWeighingPicture.length; index++) {
imgList.push(this.data.this.data.form.preWeighingPicture[index].url)
for (let index = 0; index < this.data.form.totalWeighingPicture.length; index++) {
imgList.push(this.data.form.totalWeighingPicture[index].url)
} }
wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url }) wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url })
} }

4
pages/process/order-price/index.wxml

@ -76,8 +76,8 @@
<view slot="title"> <view slot="title">
<view class="text-black">过毛重照片</view> <view class="text-black">过毛重照片</view>
<view class="flex" style="margin-top:18rpx"> <view class="flex" style="margin-top:18rpx">
<van-image wx:for="{{form.preWeighingPicture}}" wx:key="index" use-loading-slot width="100" height="100"
custom-class="page-icon" data-url="{{item.url}}" src="{{item.url}}" bind:click="viewImage">
<van-image wx:for="{{form.totalWeighingPicture}}" wx:key="index" use-loading-slot width="100" height="100"
custom-class="page-icon" data-url="{{item.url}}" fit="cover" src="{{item.url}}" bind:click="viewImage">
<view class="image-load" slot="loading"> <view class="image-load" slot="loading">
<van-loading type="spinner" size="32" /> <van-loading type="spinner" size="32" />
</view> </view>

Loading…
Cancel
Save