Browse Source

no message

featrue/v4.5
xpz2018 4 years ago
parent
commit
02c4cea808
24 changed files with 126 additions and 436 deletions
  1. 2
      app.json
  2. 22
      pages/agent/address/index.js
  3. 24
      pages/agent/address/index.wxml
  4. 11
      pages/agent/edit/index.js
  5. 9
      pages/agent/edit/index.wxml
  6. 45
      pages/home/certificate/index.js
  7. 56
      pages/home/certificate/index.wxml
  8. 12
      pages/home/enterprise/enterprise.js
  9. 10
      pages/home/enterprise/enterprise.wxml
  10. 12
      pages/home/index/index.js
  11. 12
      pages/home/info/index.js
  12. 180
      pages/home/pauthory/index.js
  13. 6
      pages/home/pauthory/index.json
  14. 61
      pages/home/pauthory/index.wxml
  15. 48
      pages/home/pauthory/index.wxss
  16. 12
      pages/home/personal/personal.js
  17. 5
      pages/home/tab1/index.js
  18. 2
      pages/home/tab1/index.wxml
  19. 4
      pages/home/tab2/index.js
  20. 6
      pages/home/tab3/index.js
  21. 4
      pages/home/tab4/index.js
  22. 4
      pages/home/tab5/index.js
  23. 11
      pages/home/tab6/index.js
  24. 4
      pages/index/index.js

2
app.json

@ -99,7 +99,7 @@
],
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用获取最近的打包"
"desc": "你的位置信息将用获取最近的打包"
}
},
"window": {

22
pages/agent/address/index.js

@ -1,5 +1,5 @@
// pages/shop/apply/index.js
import { createAddress } from "../../api/ztb"
import { updateUserInfoZtb } from "../../api/ztb"
const util = require('../../../utils/util')
import regions from '../../../utils/region'
const app = getApp()
@ -12,14 +12,7 @@ Page({
safeBottom: app.globalData.safeBottom,
options: regions,
region: [],
form: {
receiver:'',
phone:'',
details:'',
locProvinceId: '',
locCityId: '',
districtId: ''
},
form: {},
requesting: false
},
/**
@ -44,7 +37,10 @@ Page({
}
},
submitForm: function(){
if(util.isEmpty(this.data.form.receiver)){
if(this.data.requesting){
return
}
if(util.isEmpty(this.data.form.packageFactoryName)){
util.showToast('请输入工厂全称')
return
}
@ -60,12 +56,14 @@ Page({
util.showToast('请输入发货人姓名')
return
}
this.data.requesting = true
wx.showLoading({ title: '处理中', mask: true })
createAddress(this.data.form).then(res => {
updateUserInfoZtb(this.data.form).then(res => {
wx.hideLoading()
util.showBackToast('新增地址成功')
}).catch(err => {
wx.hideLoading()
wx.hideLoading()
this.data.requesting = false
util.showToast(err)
})
}

24
pages/agent/address/index.wxml

@ -1,24 +1,32 @@
<!--pages/adress/create/index.wxml-->
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">货信息</view>
<view slot="content">货信息</view>
</cu-custom>
<view class="cu-form-group margin-top">
<view class="title">工厂全称:</view>
<input id="receiver" placeholder-style="color:#aaa" placeholder="请输入工厂全称" value="{{form.receiver}}" bindinput="bindinput"></input>
<view class="bg-white flex flex-justify">
<view style="padding: 32rpx;">
<view style="font-size: 48rpx;">请补充</view>
<view style="font-size: 56rpx;">您的工厂发货信息</view>
</view>
<image src="/assets/image/tabBj.png" style="width:210rpx;height:174rpx"></image>
</view>
<view class="cu-form-group">
<view class="title" style="min-width: 200rpx;">工厂全称:</view>
<input id="packageFactoryName" placeholder-style="color:#aaa" placeholder="请输入工厂全称" bindinput="bindInput"></input>
</view>
<view class="cu-form-group" data-index="1" style="border-top: 1px solid #f3f3f3" bindtap="showRegion">
<view class="flex text-sg">所在地区:
<view class="flex text-sg">
<view style="min-width: 200rpx;">所在地区:</view>
<view class="{{form.areaStr||'input-grey'}}">{{form.areaStr||'请选择所在地区'}}</view>
</view>
<text class="cuIcon-right text-gray"></text>
</view>
<view class="cu-form-group" style="border-top: 1rpx solid #f3f3f3">
<view class="title">详细地址:</view>
<input id="details" placeholder-style="color:#aaa" placeholder="请输入详细地址" value="{{form.details}}" bindinput="bindInput"></input>
<view class="title" style="min-width: 200rpx;">详细地址:</view>
<input id="companyAddress" placeholder-style="color:#aaa" placeholder="请输入详细地址" value="{{form.details}}" bindinput="bindInput"></input>
</view>
<view class="cu-form-group">
<view class="title">发货人姓名:</view>
<view class="title" style="min-width: 200rpx;">发货人姓名:</view>
<input id="phone" placeholder-style="color:#aaa" placeholder="请输入发货人姓名" value="{{form.phone}}" bindinput="bindInput"></input>
</view>

11
pages/agent/edit/index.js

@ -229,6 +229,17 @@ Page({
this.setData({ ['form.unitPrice']: this.data.form.unitPrice, ['form.publicSubsidies']: this.data.form.publicSubsidies, cateName: this.data.cateName })
}
},
editAddress: function(){
var that = this
var events = {}
events.onCallback = function(data){
if (data.what == 1030) {
// that.data.form.factoryCustomerId = data.detail.id
// that.setData({ ['form.factoryCustomerName']: data.detail.name })
}
}
wx.navigateTo({url: `/pages/agent/address/index`, events})
},
onEvent: function (message) {
if(message.what == 402){
// this.setData({ pageIndex: 0 })

9
pages/agent/edit/index.wxml

@ -56,6 +56,15 @@
</view>
<text class="cuIcon-right text-gray" wx:if="{{!flag}}" style="font-size:32rpx;padding-top:2rpx"></text>
</view>
<view class="cu-item" style="border-bottom: 0rpx solid #ddd" bindtap="editAddress">
<view class="flex flex-justify content cu-item arrow">
<view class="text-sg" style="min-width:170rpx">发货信息:</view>
<view class="flex" style="text-align:left">
<view class="text-sg {{form.deliveryTime?'text-blue':'input-grey'}}">{{form.deliveryTime||'请填写发货信息'}}</view>
</view>
</view>
<text class="cuIcon-right text-gray" style="font-size:32rpx;padding-top:2rpx"></text>
</view>
</view>
<view class="margin-top bg-white" style="margin-top: 16rpx;padding: 24rpx 30rpx;border-bottom: 2rpx solid #f3f3f3">

45
pages/home/certificate/index.js

@ -1,31 +1,40 @@
// pages/home/authory/index.js
import { getAuthSession, certificateImage } from "../../api/user"
import { certificateImage } from "../../api/user"
const util = require('../../../utils/util')
const event = require('../../../utils/event.js')
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
monthList: [{ text: '1000吨以下', value: 1 }, { text: '1000-2000吨', value: 2 }, { text: '2000吨以上', value: 3 }],
expriseList: [{ text: '1年以下', value: 1 }, { text: '1-5年', value: 2 }, { text: '5-10年', value: 3 }, { text: '10年以上', value: 4 }],
form: { identityAuthToken: null },
flag: false, // 是否不可以编辑, false:可编辑;true:不可编辑
imgList: [null, null]
disabled: true,
imgList: [null]
},
onLoad: function (options) {
event.on('EventMessage', this, this.onEvent)
wx.showLoading({ title: '加载中', mask: true })
getAuthSession().then(result => {
wx.hideLoading()
this.data.form.identityAuthToken = result.data.token
}).catch(error => {
wx.hideLoading()
})
},
onEvent: function (message) {
if (message.what == 82) {
wx.navigateBack()
bindForm: function (e) {
// var form_data = 'form.' + e.target.id
this.data.form[e.target.id] = e.detail.value
},
showPicker: function (e) {
this.pickerView = this.pickerView || this.selectComponent('#picker-view')
if(e.currentTarget.id == 'shipmentPerMonth'){
this.pickerView.showPicker(this.data.monthList, null, 1)
} else if(e.currentTarget.id == 'experienceTag'){
this.pickerView.showPicker(this.data.expriseList, null, 2)
}
},
onPickerChange: function ({detail}) {
if(detail.type == 1){
this.setData({ ['form.shipmentPerMonth']: detail.text })
} else if(detail.type == 2){
this.setData({ ['form.experienceTag']: detail.text })
}
},
submitForm: function () {
@ -70,8 +79,7 @@ Page({
let { data } = res // 编码后的数据
if(index == 0){
that.data.form.frontImg = {base64: data, type}
} else {
that.data.form.backImg = {base64: data, type}
}
}
})
@ -94,8 +102,5 @@ Page({
var index = e.currentTarget.dataset.index
this.data.imgList[index] = null;
this.setData({ imgList: this.data.imgList })
},
onUnload: function () {
event.remove('EventMessage', this)
}
})

56
pages/home/certificate/index.wxml

@ -4,7 +4,7 @@
</cu-custom>
<view class="cu-bar bg-white" style="min-height:90rpx">
<view class="action" style="color:#333333"><text class="text-red must">*</text>请拍摄/上传本人身份证(头像面)</view>
<view class="action" style="color:#333333"><text class="text-red must">*</text>请拍摄/上传营业执照</view>
</view>
<view class="cu-list menu no-card sm-border">
<view class="cu-item" style="width:100%;padding-bottom:30rpx">
@ -23,76 +23,46 @@
<view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:200rpx"><text class="text-red must">*</text>公司名称:</view>
<input maxlength="8" value="{{form.realName}}" class="inputs" placeholder="请输入公司名称" bindinput="bindForm"></input>
<input maxlength="8" value="{{form.realName}}" class="inputs" disabled="{{disabled}}" placeholder="请输入公司名称" bindinput="bindForm"></input>
</view>
</view>
<view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:200rpx"><text class="text-red must">*</text>信用代码:</view>
<input value="{{form.certificateNo}}" class="inputs" type="idcard" bindblur="inputBlur" placeholder="请输社会入统一信用代码" bindinput="bindForm"></input>
<input value="{{form.certificateNo}}" class="inputs" disabled="{{disabled}}" placeholder="请输社会入统一信用代码" bindinput="bindForm"></input>
</view>
</view>
<view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:200rpx">工厂占地面积:</view>
<input maxlength="8" value="{{form.realName}}" disabled="{{disabled}}" style="width:65%" placeholder="请输入工厂占地面积(㎡)" bindinput="bindForm"></input>
<input id="packageFactoryArea" maxlength="8" value="{{form.realName}}" style="width:65%" placeholder="请输入工厂占地面积(㎡)" bindinput="bindForm"></input>
</view>
</view>
<view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:200rpx">工厂人数:</view>
<input maxlength="8" value="{{form.realName}}" disabled="{{disabled}}" style="width:65%" placeholder="请输入工厂人数" bindinput="bindForm"></input>
<input id="numberOfEmployee" maxlength="8" value="{{form.realName}}" style="width:65%" placeholder="请输入工厂人数" bindinput="bindForm"></input>
</view>
</view>
<view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:200rpx">工厂设备数:</view>
<input maxlength="8" value="{{form.realName}}" disabled="{{disabled}}" style="width:65%" placeholder="请输入工厂设备数" bindinput="bindForm"></input>
<view style="min-width:200rpx">工厂打包机数:</view>
<input id="numberOfPackageMachine" maxlength="8" value="{{form.realName}}" style="width:65%" placeholder="请输入工厂打包机数" bindinput="bindForm"></input>
</view>
</view>
<view class="cu-item">
<view id="shipmentPerMonth" class="cu-item" bindtap="showPicker">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:200rpx">月出货量:</view>
<input maxlength="8" value="{{form.realName}}" disabled="{{disabled}}" style="width:65%" placeholder="请选择月出货量" bindinput="bindForm"></input>
<input maxlength="8" value="{{form.shipmentPerMonth}}" disabled style="width:65%" placeholder="请选择月出货量" bindinput="bindForm"></input>
</view>
<text class="cuIcon-right text-gray"></text>
</view>
<view class="cu-item">
<view id="experienceTag" class="cu-item" bindtap="showPicker">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:200rpx">从业经验:</view>
<input maxlength="8" value="{{form.realName}}" disabled="{{disabled}}" style="width:65%" placeholder="请选择从业年限" bindinput="bindForm"></input>
</view>
</view>
</view>
<view class="cu-bar bg-white margin-top" style="min-height:90rpx">
<view class="action" style="color:#333333"><text class="text-red must">*</text>请拍摄/上传本人身份证(国徽面)</view>
</view>
<view class="cu-list menu no-card sm-border">
<view class="cu-item" style="width:100%;padding-bottom:30rpx">
<view class="image-reader-item" bindtap="chooseImage" data-index="1" wx:if="{{!imgList[1]}}">
<!-- <text class="cuIcon-cameraadd md-icon" style="font-size:50rpx" wx:if="{{!flag}}"></text>
<text class="md-hint" wx:if="{{!flag}}">身份证背面</text> -->
<image style="width:100%;height:400rpx" mode="aspectFill" src="https://pic.downk.cc/item/5f34a45714195aa5942df939.png"></image>
</view>
<view class="image-reader-item" bindtap="viewImage" data-url="{{imgList[1]}}" wx:else>
<image style="width:100%;height: 400rpx" src="{{imgList[1]}}" mode="aspectFill"></image>
<view class="delete" catchtap="deleteImg" data-index="1" wx:if="{{!flag}}">
<text class="cuIcon-close {{pathList[1].status===-1?'text-red':'text-white'}}"></text>
</view>
<!-- <view class="md-load load-spinner text-white" wx:if="{{pathList[1].status===1}}"/> -->
</view>
</view>
<view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:200rpx">真实姓名:</view>
<input maxlength="8" value="{{form.realName}}" disabled="{{disabled}}" style="width:65%" placeholder="请输入真实姓名" bindinput="bindForm"></input>
</view>
</view>
<view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:200rpx">身份证号码:</view>
<input disabled="{{disabled}}" value="{{form.certificateNo}}" style="width:65%" type="idcard" bindblur="inputBlur" placeholder="请输入身份证号码" bindinput="bindForm"></input>
<input maxlength="8" value="{{form.experienceTag}}" disabled style="width:65%" placeholder="请选择从业年限" bindinput="bindForm"></input>
</view>
<text class="cuIcon-right text-gray"></text>
</view>
</view>

12
pages/home/enterprise/enterprise.js

@ -23,7 +23,7 @@ Page({
},
{
id: 2,
name: '打包'
name: '打包'
},
{
id: 3,
@ -56,7 +56,7 @@ Page({
},
{
value: '2',
text: '打包'
text: '打包'
},
{
value: '3',
@ -147,9 +147,9 @@ Page({
this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog')
var that = this
var placeholderName = ''
if (e1.currentTarget.dataset.tag == '打包名') {
if (e1.currentTarget.dataset.tag == '打包名') {
placeholderName = that.data.userInfo.packageFactoryName
} else if (e1.currentTarget.dataset.tag == '打包占地面积') {
} else if (e1.currentTarget.dataset.tag == '打包占地面积') {
placeholderName = that.data.userInfo.packageFactoryArea
} else if (e1.currentTarget.dataset.tag == '工厂人数') {
placeholderName = that.data.userInfo.numberOfEmployee
@ -169,12 +169,12 @@ Page({
util.showToast('请输入' + e1.currentTarget.dataset.tag)
return
} else
if (e1.currentTarget.dataset.tag == '打包名') {
if (e1.currentTarget.dataset.tag == '打包名') {
that.updateUserInfoFct({
packageFactoryName: response
})
} else
if (e1.currentTarget.dataset.tag == '打包占地面积') {
if (e1.currentTarget.dataset.tag == '打包占地面积') {
if (parseInt(response)>0 && parseInt(response)==Number(response)) {
that.updateUserInfoFct({
packageFactoryArea: response

10
pages/home/enterprise/enterprise.wxml

@ -30,13 +30,13 @@
<view slot="header" class="text-gray">公司地址</view>
<view slot="footer" style="width:500rpx">{{companyAddress}}</view>
</wux-cell>
<wux-cell wx:if="{{userType == 1}}" is-link data-cid='numberMoon' data-tag='打包名' bind:click="showDialog">
<wux-cell wx:if="{{userType == 1}}" is-link data-cid='numberMoon' data-tag='打包名' bind:click="showDialog">
<view slot="header" class="text-gray">工厂名</view>
<view slot="footer" class="{{userInfo.packageFactoryName? 'text-black':'text-gray'}}">{{userInfo.packageFactoryName || '点击修改打包名'}}</view>
<view slot="footer" class="{{userInfo.packageFactoryName? 'text-black':'text-gray'}}">{{userInfo.packageFactoryName || '点击修改打包名'}}</view>
</wux-cell>
<wux-cell wx:if="{{userType == 1}}" is-link data-cid='numberMoon' data-tag='打包占地面积' bind:click="showDialog">
<view slot="header" class="text-gray">打包占地面积</view>
<view slot="footer" class="{{userInfo.packageFactoryArea? 'text-black':'text-gray'}}">{{userInfo.packageFactoryArea || '点击修改打包占地面积'}}</view>
<wux-cell wx:if="{{userType == 1}}" is-link data-cid='numberMoon' data-tag='打包占地面积' bind:click="showDialog">
<view slot="header" class="text-gray">打包占地面积</view>
<view slot="footer" class="{{userInfo.packageFactoryArea? 'text-black':'text-gray'}}">{{userInfo.packageFactoryArea || '点击修改打包占地面积'}}</view>
</wux-cell>
<wux-cell wx:if="{{userType == 1}}" is-link data-cid='numberMoon' data-tag='工厂人数' bind:click="showDialog">
<view slot="header" class="text-gray">工厂人数</view>

12
pages/home/index/index.js

@ -166,19 +166,13 @@ Component({
},
toUserInfo: function () {
if (!app.globalData.userInfo) {
wx.navigateTo({
url: '/pages/login/index'
})
wx.navigateTo({ url: '/pages/login/index' })
return
}
if (app.globalData.userInfo.isAuth != 1) {
wx.navigateTo({
url: '/pages/home/idcard/index'
})
wx.navigateTo({ url: '/pages/home/idcard/index' })
} else {
wx.navigateTo({
url: '/pages/home/info/index'
})
wx.navigateTo({ url: '/pages/home/info/index' })
}
},
toAuthor: function () {

12
pages/home/info/index.js

@ -24,7 +24,7 @@ Page({
},
{
id: 2,
name: '打包'
name: '打包'
},
{
id: 3,
@ -57,7 +57,7 @@ Page({
},
{
value: '2',
text: '打包'
text: '打包'
},
{
value: '3',
@ -150,9 +150,9 @@ Page({
this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog')
var that = this
var placeholderName = ''
if (e1.currentTarget.dataset.tag == '打包名') {
if (e1.currentTarget.dataset.tag == '打包名') {
placeholderName = that.data.userInfo.packageFactoryName
} else if (e1.currentTarget.dataset.tag == '打包占地面积') {
} else if (e1.currentTarget.dataset.tag == '打包占地面积') {
placeholderName = that.data.userInfo.packageFactoryArea
} else if (e1.currentTarget.dataset.tag == '工厂人数') {
placeholderName = that.data.userInfo.numberOfEmployee
@ -175,7 +175,7 @@ Page({
util.showToast('请输入' + e1.currentTarget.dataset.tag)
return
} else
if (e1.currentTarget.dataset.tag == '打包名') {
if (e1.currentTarget.dataset.tag == '打包名') {
that.updateUserInfoFct({
packageFactoryName: response
})
@ -193,7 +193,7 @@ Page({
util.showToast(err)
})
} else
if (e1.currentTarget.dataset.tag == '打包占地面积') {
if (e1.currentTarget.dataset.tag == '打包占地面积') {
if (parseInt(response)>0 && parseInt(response)==Number(response)) {
that.updateUserInfoFct({
packageFactoryArea: response

180
pages/home/pauthory/index.js

@ -1,180 +0,0 @@
// pages/home/authory/index.js
import { personalAuth } from "../../api/saas"
const util = require('../../../utils/util')
const math = require('../../../utils/math')
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
form: {
authType: 0,
},
typeList: [{text: '身份证', value: 1}, {text: '身份证', value: 2}],
flag: false, // 是否不可以编辑, false:可编辑;true:不可编辑
imgList: [null, null],
loadingWidth: math.divide(690, 2) - 16,
pathList: new Array(),
taskArray: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.pickerView = this.pickerView || this.selectComponent('#picker-view')
},
showPicker: function (e) {
if (this.data.flag) {
return
}
this.pickerView.showPicker(this.data.typeList, null, 1)
},
onPickerChange: function (e) {
if (!e.detail) {
return
}
if (e.detail.type == 1) {
this.setData({ ['form.bankName']: e.detail.text, ['form.bankId']: Number(e.detail.value) })
}
},
bindForm: function (e) {
// var form_data = 'form.' + e.target.id
this.data.form[e.target.id] = e.detail.value
},
submitForm: function(){
if (util.isEmpty(this.data.form.userName)) {
util.showToast('请输入真实姓名')
return
}
if (util.isEmpty(this.data.form.idCard)) {
util.showToast('请输入身份证号码')
return
}
if (util.checkId(this.data.form.idCard).status == 0) {
util.showToast('身份证号码有误')
return
}
if (util.isEmpty(this.data.pathList[0]) || util.isEmpty(this.data.pathList[0].url)) {
util.showToast('请上传身份证正面照片')
return
}
this.data.form.cardFront = this.data.pathList[0].url
if (util.isEmpty(this.data.pathList[1]) || util.isEmpty(this.data.pathList[1].url)) {
util.showToast('请上传身份证背面照片')
return
}
this.data.form.cardReverse = this.data.pathList[1].url
// /front/customer/personalAuth 个人会员认证
wx.showLoading({ title: '处理中', mask: true })
personalAuth(this.data.form).then(res => {
wx.hideLoading()
app.globalData.userInfo.isAuth = 1
util.showBackToast('上传成功')
}).catch(error => {
wx.hideLoading()
util.showToast(error)
})
},
/*******************************************************图片上传************************************************************/
uploadImage: function (index, path) {
var _this = this
_this.setData({
['pathList[' + index + ']']: { status: 1, url: '' }
})
// /utils/uploadImage 统一上传图片接口
var task = wx.uploadFile({
url: app.httpUrl + '/saas-user/utils/uploadImage',
filePath: path,
name: 'image',
header: {
"Content-Type": "multipart/form-data",
appversion: app.version
},
success: function (result) {
var resp = JSON.parse(result.data)
if (resp.code === 0) {
_this.setData({
['pathList[' + index + '].status']: 8,
['pathList[' + index + '].url']: resp.data
})
if(_this.data.id > 0){
var _index = Number(index) + 1
_this.setData({
['form.fileUrl' + _index]: resp.msg
})
}
}
},
fail: function (res) {
_this.setData({
['pathList[' + index + '].status']: -1
})
},
complete: function (res) {
for (let i = 0; i < _this.data.taskArray.length; i++) {
if (_this.data.taskArray[i].path === path) {
_this.data.taskArray.splice(i, 1);
break
}
}
_this.setData({
taskArray: _this.data.taskArray
})
},
})
_this.data.taskArray.push({ path: path, task: task })
_this.setData({
taskArray: _this.data.taskArray
})
},
chooseImage(e) {
if (this.data.flag) {
return
}
var index = e.currentTarget.dataset.index
wx.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], //从相册选择
success: (res) => {
this.setData({ ['imgList[' + index + ']']: res.tempFilePaths[0] })
for (let i = 0; i < res.tempFilePaths.length; i++) {
this.uploadImage(index, res.tempFilePaths[i])
}
}
});
},
viewImage(e) {
var urlList = []
for (var i = 0; i < this.data.imgList.length; i++) {
if (!util.isEmpty(this.data.imgList[i])) {
urlList.push(this.data.imgList[i])
}
}
wx.previewImage({ urls: urlList, current: e.currentTarget.dataset.url });
},
deleteImg(e) {
var index = e.currentTarget.dataset.index
// 如果是正在上传的;
if (this.data.pathList[index] && this.data.pathList[index].status === 1) {
if (this.data.taskArray[index]) {
this.data.taskArray[index].abort() // 取消上传任务
}
this.data.taskArray.splice(index, 1);
}
this.data.imgList[index] = null;
if (this.data.pathList.length > index){
this.data.pathList.splice(index, 1);
}
this.setData({
imgList: this.data.imgList,
pathList: this.data.pathList,
taskArray: this.data.taskArray
})
}
})

6
pages/home/pauthory/index.json

@ -1,6 +0,0 @@
{
"usingComponents": {
"picker-view": "/components/picker-view/index",
"wux-button": "/components/button/index"
}
}

61
pages/home/pauthory/index.wxml

@ -1,61 +0,0 @@
<!--pages/home/authory/index.wxml-->
<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">实名认证</view>
</cu-custom>
<view class="cu-list menu no-card sm-border margin-top">
<view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:170rpx">姓名:</view>
<input id="userName" maxlength="8" style="width:65%" placeholder="请输入真实姓名" bindinput="bindForm"></input>
</view>
</view>
<!-- <view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx" bindtap="showPicker">
<view style="min-width:170rpx">证件类型:</view>
<input style="flex:1" disabled="true" bindblur="inputBlur" placeholder="请选择证件类型"></input>
<text class="cuIcon-right text-gray" style="font-size:18px"></text>
</view>
</view> -->
<view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:170rpx">身份证号码:</view>
<input id="idCard" maxlength="19" style="width:65%" type="idcard" bindblur="inputBlur" placeholder="请输入身份证号码" bindinput="bindForm"></input>
</view>
</view>
</view>
<view class="cu-bar bg-white margin-top" style="min-height:90rpx">
<view class="action" style="color:#333333">上传身份证</view>
<view class="action text-gray" style="font-size:12px">正反面共2张</view>
</view>
<view class="cu-form-group">
<view class="flex flex-justify" style="width:100%;padding-bottom:30rpx">
<view class="image-reader-item" bindtap="chooseImage" data-index="0" wx:if="{{!imgList[0]}}">
<text class="cuIcon-cameraadd md-icon" style="font-size:50rpx" wx:if="{{!flag}}"></text>
<text class="md-hint" wx:if="{{!flag}}">身份证正面</text>
</view>
<view class="image-reader-item" style="background-image:url({{imgList[0]}})" bindtap="viewImage" data-url="{{imgList[0]}}" wx:else >
<view class="delete" catchtap="deleteImg" data-index="0" wx:if="{{!flag}}">
<text class="cuIcon-close {{pathList[0].status===-1?'text-red':'text-white'}}"></text>
</view>
<view class="md-load load-spinner text-white" wx:if="{{pathList[0].status===1}}"/>
</view>
<view class="image-reader-item" bindtap="chooseImage" data-index="1" wx:if="{{!imgList[1]}}">
<text class="cuIcon-cameraadd md-icon" style="font-size:50rpx" wx:if="{{!flag}}"></text>
<text class="md-hint" wx:if="{{!flag}}">身份证背面</text>
</view>
<view class="image-reader-item" style="background-image:url({{imgList[1]}})" bindtap="viewImage" data-url="{{imgList[1]}}" wx:else>
<view class="delete" catchtap="deleteImg" data-index="1" wx:if="{{!flag}}">
<text class="cuIcon-close {{pathList[1].status===-1?'text-red':'text-white'}}"></text>
</view>
<view class="md-load load-spinner text-white" wx:if="{{pathList[1].status===1}}"/>
</view>
</view>
</view>
<view class="flex flex-direction" style="padding: 72rpx 32rpx">
<wux-button block type="positive" bind:click="submitForm">提交</wux-button>
</view>
<picker-view id="picker-view" bindcustomevent="onPickerChange"></picker-view>

48
pages/home/pauthory/index.wxss

@ -1,48 +0,0 @@
.image-reader-item {
position: relative;
width: 49%;
height: 128px;
background-color: #f8f8f8;
box-sizing: border-box;
list-style: none;
background-size: cover;
border-radius: 6rpx;
}
.image-reader-item .md-icon {
position: absolute;
top: 45%;
left: 50%;
transform: translate(-50%, -50%);
opacity: 0.5;
}
.image-reader-item .md-load {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.image-reader-item .md-hint {
position: absolute;
top: 50%;
left: 0;
width: 100%;
margin-top: 10px;
font-size: 12px;
color: #bababa;
text-align: center;
}
.image-reader-item .delete {
position: absolute;
top: 0px;
right: 0px;
opacity: 0.8;
border-top-right-radius: 6rpx;
border-bottom-left-radius: 8rpx;
padding: 6rpx 12rpx;
height: auto;
background-color: rgba(0, 0, 0, 0.5);
}

12
pages/home/personal/personal.js

@ -23,7 +23,7 @@ Page({
},
{
id: 2,
name: '打包'
name: '打包'
},
{
id: 3,
@ -56,7 +56,7 @@ Page({
},
{
value: '2',
text: '打包'
text: '打包'
},
{
value: '3',
@ -147,9 +147,9 @@ Page({
this.wuxDialog = this.wuxDialog || this.selectComponent('#wux-dialog')
var that = this
var placeholderName = ''
if (e1.currentTarget.dataset.tag == '打包名') {
if (e1.currentTarget.dataset.tag == '打包名') {
placeholderName = that.data.userInfo.packageFactoryName
} else if (e1.currentTarget.dataset.tag == '打包占地面积') {
} else if (e1.currentTarget.dataset.tag == '打包占地面积') {
placeholderName = that.data.userInfo.packageFactoryArea
} else if (e1.currentTarget.dataset.tag == '工厂人数') {
placeholderName = that.data.userInfo.numberOfEmployee
@ -169,12 +169,12 @@ Page({
util.showToast('请输入' + e1.currentTarget.dataset.tag)
return
} else
if (e1.currentTarget.dataset.tag == '打包名') {
if (e1.currentTarget.dataset.tag == '打包名') {
that.updateUserInfoFct({
packageFactoryName: response
})
} else
if (e1.currentTarget.dataset.tag == '打包占地面积') {
if (e1.currentTarget.dataset.tag == '打包占地面积') {
if (parseInt(response)>0 && parseInt(response)==Number(response)) {
that.updateUserInfoFct({
packageFactoryArea: response

5
pages/home/tab1/index.js

@ -30,7 +30,7 @@ Page({
this.data.firstCategoryId = ''
this.setData({ ['bidType']: tabIndex })
if (this.data.bidType == 1) {
this.data.identityTag = '打包'
this.data.identityTag = '打包'
this.submitForm()
}
if (this.data.bidType == 2) {
@ -46,6 +46,7 @@ Page({
this.setData({ requesting: true})
updateUserInfo({ identityTag: this.data.identityTag }).then(result => {
this.setData({ requesting: false})
app.globalData.userInfo.identityTag = this.data.identityTag
setTimeout(() => this.toNextTab(), 200)
}).catch(err => {
util.showToast(err)
@ -57,7 +58,7 @@ Page({
},
getUerInfoFct: function () {
getBaseInfo().then(res => {
if (res.data.identityTag == '打包') {
if (res.data.identityTag == '打包') {
this.setData({ bidType: 1 })
} else if (res.data.identityTag == '废品站') {
this.setData({ bidType: 2 })

2
pages/home/tab1/index.wxml

@ -25,7 +25,7 @@
<image style="width:48rpx;height:48rpx;" src="/assets/image/dbcicon.png"></image>
</view>
<view style="width:114rpx;height:50rpx;float:right">
<text>打包</text>
<text>打包</text>
</view>
</view>
<view class="btson2" style="color:{{bidType == 2 ? '#008AFF' : '#333'}};border-color:{{bidType == 2 ? '#008AFF' : '#D8D8D8'}};" data-index="2" bindtap="onTabChangeTop">

4
pages/home/tab2/index.js

@ -33,10 +33,10 @@ Page({
this.pickerView = this.pickerView || this.selectComponent('#picker-view')
},
toNextTab: function () {
wx.navigateTo({ url: '/pages/home/tab3/index' })
wx.redirectTo({ url: '/pages/home/tab3/index' })
},
toMyInfo: function () {
wx.redirectTo({ url: '/pages/index/index' })
wx.navigateBack()
},
showRegion: function () {
if (this.data.disabled) {

6
pages/home/tab3/index.js

@ -21,14 +21,12 @@ Page({
},
toNextTab: function () {
wx.navigateTo({
wx.redirectTo({
url: '/pages/home/tab4/index'
})
},
toMyInfo: function () {
wx.redirectTo({
url: '/pages/index/index'
})
wx.navigateBack()
},
/**

4
pages/home/tab4/index.js

@ -56,9 +56,7 @@ Page({
},
toMyInfo: function () {
wx.redirectTo({
url: '/pages/index/index'
})
wx.navigateBack()
},
/**

4
pages/home/tab5/index.js

@ -56,9 +56,7 @@ Page({
},
toMyInfo: function () {
wx.redirectTo({
url: '/pages/index/index'
})
wx.navigateBack()
},
/**

11
pages/home/tab6/index.js

@ -1,9 +1,6 @@
// pages/home/tab6/index.js
import {
updateUserInfo,
getBaseInfo
} from '../../api/ztb'
const storage = require('../../../utils/storage')
import { updateUserInfo, getBaseInfo } from '../../api/ztb'
Page({
/**
@ -21,9 +18,7 @@ Page({
},
toMyInfo: function () {
wx.redirectTo({
url: '/pages/index/index'
})
wx.navigateBack()
},
/**

4
pages/index/index.js

@ -70,7 +70,7 @@ Page({
getBaseInfo().then(result => {
app.globalData.userInfo = result.data
wx.hideLoading()
if(!app.globalData.userInfo.hasShowedLoginTag){
if(!app.globalData.userInfo.identityTag){
wx.navigateTo({ url: '/pages/home/tab1/index' })
}
this.defaultIndex()
@ -102,7 +102,7 @@ Page({
if (this.data.inited) {
this.onResume()
}
if(app.globalData.userInfo && !app.globalData.userInfo.hasShowedLoginTag){
if(app.globalData.userInfo && !app.globalData.userInfo.identityTag){
wx.navigateTo({ url: '/pages/home/tab1/index' })
}
},

Loading…
Cancel
Save