Selaa lähdekoodia

upload

master
Soleilw 1 vuosi sitten
commit
1cae908d65
100 muutettua tiedostoa jossa 4485 lisäystä ja 0 poistoa
  1. 31
    0
      .eslintrc.js
  2. 159
    0
      api/index.js
  3. 50
    0
      api/models.js
  4. 18
    0
      api/url.js
  5. 60
    0
      app.js
  6. 71
    0
      app.json
  7. 41
    0
      app.wxss
  8. 146
    0
      components/form/form-cascader/form-cascader.js
  9. 4
    0
      components/form/form-cascader/form-cascader.json
  10. 25
    0
      components/form/form-cascader/form-cascader.wxml
  11. 21
    0
      components/form/form-cascader/form-cascader.wxss
  12. 43
    0
      components/form/form-date/form-date.js
  13. 4
    0
      components/form/form-date/form-date.json
  14. 25
    0
      components/form/form-date/form-date.wxml
  15. 51
    0
      components/form/form-date/form-date.wxss
  16. 31
    0
      components/form/form-footer/form-footer.js
  17. 4
    0
      components/form/form-footer/form-footer.json
  18. 12
    0
      components/form/form-footer/form-footer.wxml
  19. 23
    0
      components/form/form-footer/form-footer.wxss
  20. 43
    0
      components/form/form-input/form-input.js
  21. 4
    0
      components/form/form-input/form-input.json
  22. 9
    0
      components/form/form-input/form-input.wxml
  23. 28
    0
      components/form/form-input/form-input.wxss
  24. 413
    0
      components/form/form-picker/form-picker.js
  25. 4
    0
      components/form/form-picker/form-picker.json
  26. 38
    0
      components/form/form-picker/form-picker.wxml
  27. 50
    0
      components/form/form-picker/form-picker.wxss
  28. 71
    0
      components/form/form-radio/form-radio.js
  29. 4
    0
      components/form/form-radio/form-radio.json
  30. 15
    0
      components/form/form-radio/form-radio.wxml
  31. 35
    0
      components/form/form-radio/form-radio.wxss
  32. 156
    0
      components/form/form-rich/form-rich.js
  33. 5
    0
      components/form/form-rich/form-rich.json
  34. 44
    0
      components/form/form-rich/form-rich.wxml
  35. 153
    0
      components/form/form-rich/form-rich.wxss
  36. 57
    0
      components/form/form-textarea/form-textarea.js
  37. 4
    0
      components/form/form-textarea/form-textarea.json
  38. 12
    0
      components/form/form-textarea/form-textarea.wxml
  39. 32
    0
      components/form/form-textarea/form-textarea.wxss
  40. 137
    0
      components/form/form-upload-more/form-upload-more.js
  41. 4
    0
      components/form/form-upload-more/form-upload-more.json
  42. 25
    0
      components/form/form-upload-more/form-upload-more.wxml
  43. 91
    0
      components/form/form-upload-more/form-upload-more.wxss
  44. 104
    0
      components/form/form-upload/form-upload.js
  45. 4
    0
      components/form/form-upload/form-upload.json
  46. 11
    0
      components/form/form-upload/form-upload.wxml
  47. 39
    0
      components/form/form-upload/form-upload.wxss
  48. 48
    0
      components/views/view-flex/view-flex.js
  49. 4
    0
      components/views/view-flex/view-flex.json
  50. 25
    0
      components/views/view-flex/view-flex.wxml
  51. 1
    0
      components/views/view-flex/view-flex.wxss
  52. 159
    0
      components/views/view-sign/view-sign.js
  53. 5
    0
      components/views/view-sign/view-sign.json
  54. 8
    0
      components/views/view-sign/view-sign.wxml
  55. 107
    0
      components/views/view-sign/view-sign.wxss
  56. BIN
      icons/@2x/gzh.png
  57. BIN
      icons/@2x/nodata.png
  58. BIN
      icons/@2x/unLogin.png
  59. BIN
      icons/all.png
  60. BIN
      icons/apply.png
  61. BIN
      icons/bank.png
  62. BIN
      icons/daishenhe.png
  63. BIN
      icons/edit.png
  64. BIN
      icons/nodata.png
  65. BIN
      icons/right.png
  66. BIN
      icons/setting.png
  67. BIN
      icons/sfzfm.png
  68. BIN
      icons/sfzzm.png
  69. BIN
      icons/yifafang.png
  70. BIN
      icons/yigongshi.png
  71. BIN
      icons/yishenhe.png
  72. 13
    0
      package-lock.json
  73. 11
    0
      package.json
  74. 33
    0
      pages/home/guide/detail/index.js
  75. 4
    0
      pages/home/guide/detail/index.json
  76. 12
    0
      pages/home/guide/detail/index.wxml
  77. 21
    0
      pages/home/guide/detail/index.wxss
  78. 88
    0
      pages/home/index/index.js
  79. 4
    0
      pages/home/index/index.json
  80. 28
    0
      pages/home/index/index.wxml
  81. 53
    0
      pages/home/index/index.wxss
  82. 76
    0
      pages/home/publicity/detail/index.js
  83. 4
    0
      pages/home/publicity/detail/index.json
  84. 41
    0
      pages/home/publicity/detail/index.wxml
  85. 37
    0
      pages/home/publicity/detail/index.wxss
  86. 80
    0
      pages/home/publicity/index/index.js
  87. 6
    0
      pages/home/publicity/index/index.json
  88. 15
    0
      pages/home/publicity/index/index.wxml
  89. 31
    0
      pages/home/publicity/index/index.wxss
  90. 633
    0
      pages/info/index/index.js
  91. 6
    0
      pages/info/index/index.json
  92. 125
    0
      pages/info/index/index.wxml
  93. 129
    0
      pages/info/index/index.wxss
  94. 106
    0
      pages/info/sign/index.js
  95. 8
    0
      pages/info/sign/index.json
  96. 9
    0
      pages/info/sign/index.wxml
  97. 43
    0
      pages/info/sign/index.wxss
  98. 98
    0
      pages/login/index/index.js
  99. 3
    0
      pages/login/index/index.json
  100. 0
    0
      pages/login/index/index.wxml

+ 31
- 0
.eslintrc.js Näytä tiedosto

@@ -0,0 +1,31 @@
/*
* Eslint config file
* Documentation: https://eslint.org/docs/user-guide/configuring/
* Install the Eslint extension before using this feature.
*/
module.exports = {
env: {
es6: true,
browser: true,
node: true,
},
ecmaFeatures: {
modules: true,
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
globals: {
wx: true,
App: true,
Page: true,
getCurrentPages: true,
getApp: true,
Component: true,
requirePlugin: true,
requireMiniProgram: true,
},
// extends: 'eslint:recommended',
rules: {},
}

+ 159
- 0
api/index.js Näytä tiedosto

@@ -0,0 +1,159 @@
const toolHelper = require("../utils/toolHelper.js");
import {getApi} from '../utils/dataHelper'
const Base64 = require("../utils/base64");

let header = {
'Accept': 'application/json',
'Accept-charset': 'utf-8'
}

const CLIENTID = 'miniapp'
const CLIENTSECRET = 'miniapp_secret'



function queryData(data) {
var str = '';
for (var i in data) {
str += i + "=" + data[i] + '&';
}
if (str) {
str = '?' + str;
str = str.substr(0, str.length - 1);
}
return str;
}

const http = {};
http.get = function get(url, data, cb) {
console.log(getApi(), url, data)
if (url != '/blade-auth/token' && url != '/grants/wechat/consumerinfopublic/list' && url != '/grants/wechat/consumerinfopublic/detail') {
if (!wx.getStorageSync('token')) {
wx.showToast({
title: '请先登录',
icon: 'none'
})
return false
}
}

header.Authorization = `Basic ${Base64.Base64.encode(`${CLIENTID}:${CLIENTSECRET}`)}`;
header['content-type'] = 'application/x-www-form-urlencoded';
if (wx.getStorageSync('token')) {
header['Blade-Auth'] = `bearer ${wx.getStorageSync('token')}`
}
wx.showLoading({
title: '加载中',
})
wx.request({
url: getApi() + url + queryData(data),
method: 'get',
header: header,
success: function (res) {
console.log(res.data)
wx.hideToast();
let resData = res.data;
switch (res.data.code) {
case 200:
toolHelper.isFunction(cb) && cb(resData);
break;
case 401:
wx.showToast({
icon: "none",
title: '请重新登录'
});
setTimeout(() => {
wx.clearStorage()
wx.reLaunch({
url: '/pages/my/index/index',
})
})
break;
default:
wx.showToast({
icon: "none",
title: resData.msg
});
}
},
fail(res) {
wx.showToast({
title: '请求出错,请联系相关人员',
icon: 'none'
})
wx.hideLoading();
},
complete(res) {
wx.hideLoading();
}
})
}

http.post = function post(url, data, cb) {
console.log(getApi(), url, data)

if (url != '/blade-auth/token') {
if (!wx.getStorageSync('token')) {
wx.showToast({
title: '请先登录',
icon: 'none'
})
return false
}
header['content-type'] = 'application/json';
} else {
header['content-type'] = 'application/x-www-form-urlencoded';
}

header.Authorization = `Basic ${Base64.Base64.encode(`${CLIENTID}:${CLIENTSECRET}`)}`;
if (wx.getStorageSync('token')) {
header['Blade-Auth'] = `bearer ${wx.getStorageSync('token')}`
}
wx.request({
url: getApi() + url,
method: 'post',
data: data,
header: header,
formData: data,
success: function (res) {
let resData = res.data;
switch (res.data.code) {
case 200:
toolHelper.isFunction(cb) && cb(resData);
break;
case 401:
wx.showModal({
title: '错误信息',
content: resData.msg,
confirmText: '知道了',
showCancel: false,
success(res1) {
if (res1.confirm) {
wx.clearStorage()
wx.reLaunch({
url: '/pages/my/index/index',
})
}
}
})
break;
default:
wx.showToast({
icon: "none",
title: resData.msg
});
}
},
fail(err) {
wx.showToast({
title: '请求出错,请联系相关人员',
icon: 'none'
})
},
complete(res) {
}
});
}


module.exports = http;

+ 50
- 0
api/models.js Näytä tiedosto

@@ -0,0 +1,50 @@
import {
POSTMODEL,
GETMODEL
} from '../utils/reqHelper';
const url = require("./url.js");
const reqInterface = {};
const Base64 = require("../utils/base64");
import {getApi} from '../utils/dataHelper'


reqInterface.Login = POSTMODEL(url.BladeAuthToken); // 获取认证Token
reqInterface.GetBladeSystemDictDictionary = GETMODEL(url.BladeSystemDictDictionary); // 字典
reqInterface.PostConsumerinfoSubmit = POSTMODEL(url.ConsumerinfoSubmit); // 新增
reqInterface.GetGuide = GETMODEL(url.Guide); // 办事指南
reqInterface.GetConsumerinfopublicList = GETMODEL(url.ConsumerinfopublicList); // 公示列表
reqInterface.GetConsumerinfopublicDetail = GETMODEL(url.ConsumerinfopublicDetail); // 获取公示详情数据
reqInterface.GetConsumerinfoDetail = GETMODEL(url.ConsumerinfoDetail); // 申请资料详情
reqInterface.GetConsumerinfoCheckDetail = GETMODEL(url.ConsumerinfoCheckDetail); // 申请资料审核详情
reqInterface.PostConsumerinfoUpdate = POSTMODEL(url.ConsumerinfoUpdate); // 头像昵称
reqInterface.POSTConsumerinfoQuery = POSTMODEL(url.ConsumerinfoQuery); // 申请资料审核详情
reqInterface.GetQuotaGet = GETMODEL(url.QuotaGet); // 申请资料审核详情


reqInterface.PostImageUpload = function (uploadFile) {
const CLIENTID = 'miniapp'
const CLIENTSECRET = 'miniapp_secret'
return new Promise((resolve, reject) => {
wx.uploadFile({
url: getApi() + url.ConsumerinfoUpload,
header: {
'Authorization': `Basic ${Base64.Base64.encode(`${CLIENTID}:${CLIENTSECRET}`)}`,
'Blade-Auth': `bearer ${wx.getStorageSync('token')}`
},
filePath: uploadFile,
name: 'file',
success(res) {
resolve(JSON.parse(res.data));
},
fail(err) {
wx.showToast({
title: "上传错误",
icon: "none",
});
reject(err);
}
})
})
},

module.exports = reqInterface;

+ 18
- 0
api/url.js Näytä tiedosto

@@ -0,0 +1,18 @@
const grantsWechat = '/grants/wechat'
const url = {
'BladeSystemDictDictionary': '/blade-system/dict/dictionary', // 获取认证Token
'BladeAuthToken': '/blade-auth/token', // 获取认证Token
'Guide': grantsWechat + '/guide', // 办事指南
'ConsumerinfopublicList': grantsWechat + '/consumerinfopublic/list', // 公式列表
'ConsumerinfopublicDetail': grantsWechat + '/consumerinfopublic/detail', // 获取公式详情数据
'ConsumerinfoSubmit': grantsWechat + '/consumerinfo/submit', // 新增
'ConsumerinfoUpload': grantsWechat + '/consumerinfo/upload', // 图片上传
'ConsumerinfoDetail': grantsWechat + '/consumerinfo/detail', // 申请资料详情
'ConsumerinfoCheckDetail': grantsWechat + '/consumerinfo/checkDetail', // 申请资料详情
'ConsumerinfoUpdate': grantsWechat + '/consumer/update', // 更新微信客户信息
'ConsumerinfoQuery': grantsWechat + '/consumer/query', // 更新微信客户信息
'QuotaGet': grantsWechat + '/quota/get', // 获取名额
};

module.exports = url;

+ 60
- 0
app.js Näytä tiedosto

@@ -0,0 +1,60 @@
App({

onLaunch: function (options) {

// 版本更新
if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager()
if (updateManager) {
updateManager.onCheckForUpdate(function (res) {
if (res.hasUpdate) {
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
if (res.confirm) {
updateManager.applyUpdate()
} else if (res.cancel) {
//用户点击取消按钮的处理,如果需要强制更新,则给出二次弹窗,如果不需要,则这里的代码都可以删掉了
wx.showModal({
title: '温馨提示~',
content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问',
showCancel: false, //隐藏取消按钮
confirmText: "确定更新", //只保留确定更新按钮
success: function (res) {
if (res.confirm) {
//下载新版本,并重新应用
updateManager.applyUpdate()

}
}
})
}
}
})
})
updateManager.onUpdateFailed(function () {
wx.showModal({
title: '已经有新版本了哟~',
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
})
})
}
})
}

} else {
wx.showModal({
title: '提示',
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
})
};

},



})

+ 71
- 0
app.json Näytä tiedosto

@@ -0,0 +1,71 @@
{
"pages": [
"pages/my/index/index",
"pages/home/publicity/detail/index",
"pages/my/schedule/index",
"pages/home/publicity/index/index",
"pages/info/index/index",
"pages/info/sign/index",
"pages/home/guide/detail/index",
"pages/home/index/index",
"pages/setting/index/index",
"pages/login/index/index"
],
"tabBar": {
"selectedColor": "#1677ff",
"list": [{
"pagePath": "pages/home/index/index",
"text": "首页"
},
{
"pagePath": "pages/my/index/index",
"text": "个人中心"
}
]
},
"usingComponents": {
"wux-row": "./wux/row/index",
"wux-col": "./wux/col/index",
"wux-icon": "./wux/icon/index",
"wux-upload": "./wux/upload/index",
"wux-button": "./wux/button/index",
"wux-pagination": "./wux/pagination/index",
"wux-steps": "./wux/steps/index",
"wux-step": "./wux/step/index",
"form-input": "./components/form/form-input/form-input",
"form-radio": "./components/form/form-radio/form-radio",
"form-cascader": "./components/form/form-cascader/form-cascader",
"form-date": "./components/form/form-date/form-date",
"form-picker": "./components/form/form-picker/form-picker",
"form-upload": "./components/form/form-upload/form-upload",
"form-footer": "./components/form/form-footer/form-footer",
"form-textarea": "./components/form/form-textarea/form-textarea",
"form-rich": "./components/form/form-rich/form-rich",
"form-upload-more": "./components/form/form-upload-more/form-upload-more",
"view-flex": "./components/views/view-flex/view-flex"
},
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#ffffff",
"backgroundColor": "#ffffff",
"navigationBarTitleText": "就业信息系统",
"navigationBarTextStyle": "black"
},
"plugins": {
"ocr-plugin": {
"version": "3.1.5",
"provider": "wx4418e3e031e551be"
}
},
"rendererOptions": {
"skyline": {
"defaultDisplayBlock": true,
"disableABTest": true,
"sdkVersionBegin": "3.0.0",
"sdkVersionEnd": "15.255.255"
}
},
"componentFramework": "glass-easel",
"sitemapLocation": "sitemap.json",
"lazyCodeLoading": "requiredComponents"
}

+ 41
- 0
app.wxss Näytä tiedosto

@@ -0,0 +1,41 @@
/* page {
background-image: linear-gradient(to bottom, #d3fae0, #f2f4f7);
} */



.custom-border {
border-width: 0;
border-color: transparent !important;
background-color: transparent !important;
outline: none !important;
}
.custom-border::after{
border: none;
}

.primary {
color: #1677ff;
}

.primarybg {
background-color: #1677ff;
}

/* list */
.list {
padding: 20rpx;
}

.list-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 0;
}

.list-title {
width: 600rpx;
font-size: 28rpx;
line-height: 36rpx;
}

+ 146
- 0
components/form/form-cascader/form-cascader.js Näytä tiedosto

@@ -0,0 +1,146 @@
const reqInterface = require("../../../api/models");
const {
findidx,
hasValue
} = require("../../../utils/dataHelper");
Component({

properties: {
dict: Number,
label: String,
value: String,
position: {
type: String,
value: 'bottom'
},
requiredMark: {
type: Boolean,
value: true
},
activeMode: {
type: Boolean,
value: false
},
},

observers: {
'dict': function (val) {
let self = this;
reqInterface.GetDictDetail({
id: val
}).then(res => {
self.setData({
spinning: false,
cascaderOption: res.childs
})
}).catch(err => {
self.setData({
spinning: false,
})
})
},
'label': function (val) {
let self = this;
self.setData({
placeholder: '请选择' + val
})
},
'value': function (val) {
let self = this;
if (val) {
console.log(val)

self.setData({
placeholder: '',
child_value: val
})
}
},
},

data: {
cascaderOption: [],
cascaderOptionNames: {
label: 'name',
value: 'id',
children: 'childs'
},
child_value: '',
select_value: [],
show: false,
spinning: true
},

methods: {
openPopup() {
this.setData({
show: true
})
},
close() {
this.setData({
show: false,
select_value: []
})
},
comfirm() {
let self = this;
self.triggerEvent('getvalue', { val: self.data.select_value, label: self.data.child_value})
self.setData({
show: false,
select_value: [],
})
},
onChange(e) {
let self = this;
console.log(e)
self.data.child_value = e.detail.options.map(item => {
return item.name
}).join(',')
self.setData({
select_value: e.detail.value,
child_value: self.data.child_value
})
},
onLoadOptions(e) {
let self = this;
// self.setData({
// spinning: true
// })
reqInterface.GetDictDetail({
id: e.detail.value[e.detail.value.length - 1]
}).then(res => {
self.setData({
spinning: false,
})
if(e.detail.value.length == 1) {
let idx1 = findidx(self.data.cascaderOption, e.detail.value[0]);
self.data.cascaderOption[idx1].childs = res.childs;
self.setData({
cascaderOption: self.data.cascaderOption
})
} else if (e.detail.value.length == 2) {
let idx1 = findidx(self.data.cascaderOption, e.detail.value[0]);
let idx2 = findidx(self.data.cascaderOption[idx1].childs, e.detail.value[1]);
self.data.cascaderOption[idx1].childs[idx2].childs = res.childs;
self.setData({
cascaderOption: self.data.cascaderOption
})
} else if (e.detail.value.length == 3) {
let idx1 = findidx(self.data.cascaderOption, e.detail.value[0]);
let idx2 = findidx(self.data.cascaderOption[idx1].childs, e.detail.value[1]);
let idx3 = findidx(self.data.cascaderOption[idx1].childs[idx2].childs, e.detail.value[2]);
self.data.cascaderOption[idx1].childs[idx2].childs[idx3].childs = res.childs;
self.setData({
cascaderOption: self.data.cascaderOption
})
}
}).catch(err => {
self.setData({
spinning: false,
})
})
self.setData({ select_value: e.detail.value, cascaderOption: self.data.cascaderOption })
}
}
})

+ 4
- 0
components/form/form-cascader/form-cascader.json Näytä tiedosto

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

+ 25
- 0
components/form/form-cascader/form-cascader.wxml Näytä tiedosto

@@ -0,0 +1,25 @@
<wux-cell wx:if="{{activeMode}}" hover-class="none" wux-class="wux-cell-class-1">
<view class="view-input" bind:tap="openPopup">
<text wx:if="{{child_value}}">{{child_value}}</text>
<text wx:else style="color: #999999;">{{placeholder}}</text>
</view>
</wux-cell>


<wux-cell wx:else hover-class="none" wux-class="wux-cell-class">
<wux-input label="{{label}}" placeholder="{{placeholder}}" value="{{child_value}}" requiredMark="{{requiredMark}}" labelWrap controlled readOnly bind:tap="openPopup" />
</wux-cell>

<wux-popup position="{{position}}" visible="{{ show }}" title="{{placeholder}}">
<wux-wing-blank size="default">
<wux-cascader-view full controlled value="{{ select_value }}" options="{{ cascaderOption }}" bind:change="onChange" bind:load="onLoadOptions" defaultFieldNames="{{cascaderOptionNames}}" />
<wux-row gutter="10">
<wux-col span="4">
<wux-button block outline type="assertive" bind:tap="close">关闭</wux-button>
</wux-col>
<wux-col span="8">
<wux-button block type="balanced" bind:tap="comfirm">确定</wux-button>
</wux-col>
</wux-row>
</wux-wing-blank>
</wux-popup>

+ 21
- 0
components/form/form-cascader/form-cascader.wxss Näytä tiedosto

@@ -0,0 +1,21 @@
.wux-cell-class {
height: 112rpx !important;
font-size: 28rpx !important;
}

.wux-cell-class-1 {
height: 112rpx !important;
font-size: 28rpx !important;
border: none !important;
}

.view-input {
border: 1rpx solid #19be6b;
padding: 20rpx;
border-radius: 20rpx;
cursor: auto;
overflow: hidden;
text-overflow: clip;
white-space: nowrap;
}

+ 43
- 0
components/form/form-date/form-date.js Näytä tiedosto

@@ -0,0 +1,43 @@
// components/form/form-input/form-input.js
Component({
properties: {
label: String,
value: String,
requiredMark: {
type: Boolean,
value: true
},
activeMode: {
type: Boolean,
value: false
},
},

observers: {
'value': function (val) {
let self = this;
if(val) {
self.setData({
date: val
})
}
},
},

data: {
styleCss: 'padding: 38rpx 0; line-height: 36rpx font-size: 28rpx; border-bottom: 1rpx dashed #f0f0f0;',
date: '',
curDate: '',
},

methods: {
bindDateChange(e) {
let self = this;
self.setData({
date: e.detail.value
})
self.triggerEvent('getvalue', {val: e.detail.value})
}
}
})

+ 4
- 0
components/form/form-date/form-date.json Näytä tiedosto

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

+ 25
- 0
components/form/form-date/form-date.wxml Näytä tiedosto

@@ -0,0 +1,25 @@
<!-- <wux-date-picker mode="{{mode}}" value="{{ date_value }}" data-index="2" data-mode="date" bind:confirm="onConfirm">
<wux-cell wx:if="{{activeMode}}" hover-class="none" wux-class="wux-cell-class-1">
<view wx:if="{{activeMode}}" class="view-input">
<text wx:if="{{child_value}}">{{child_value}}</text>
<text wx:else style="color: #999999;">{{placeholder}}</text>
</view>
</wux-cell>
<wux-cell wx:else hover-class="none" wux-class="wux-cell-class">
<wux-input label="{{label}}" placeholder="{{placeholder}}" requiredMark="{{requiredMark}}" value="{{child_value}}" labelWrap controlled readOnly />
</wux-cell>
</wux-date-picker> -->


<picker mode="date" value="{{date}}" start="{{curDate}}" end="2099-09-01" bindchange="bindDateChange">
<view-flex wx:if="{{activeMode}}" justify="space-between" align="center">
<input class="view-input" placeholder="请在此选择您的出生日期" value="{{date}}" disabled/>
</view-flex>

<view-flex wx:else styleCss="{{styleCss}}" justify="space-between" align="center">
<view class="form-label">{{label}}</view>
<view-flex class="form-value" justify="flex-end">
<input style="width: 550rpx;text-align: right;" value="{{date}}" placeholder="请选择{{label}}" disabled />
</view-flex>
</view-flex>
</picker>

+ 51
- 0
components/form/form-date/form-date.wxss Näytä tiedosto

@@ -0,0 +1,51 @@
.wux-cell-class {
height: 112rpx !important;
font-size: 28rpx !important;
}

.wux-cell-class-1 {
height: 112rpx !important;
font-size: 28rpx !important;
border: none !important;
}

.view-input {
width: 100%;
border: 1rpx solid #19be6b;
padding: 20rpx;
border-radius: 20rpx;
cursor: auto;
height: 1.4rem;
min-height: 1.4rem;
overflow: hidden;
text-overflow: clip;
white-space: nowrap;
}


.form {
font-size: 28rpx;
}

.form-label {
width: 300rpx;
font-size: 28rpx;
line-height: 36rpx;
color: gray;
}

.form-value {
width: 450rpx;
font-size: 28rpx;

}
.form-label::before {
display: inline-block;
margin-right: 6rpx;
color: #ef473a;
font-size: 28rpx;
font-family: SimSun,sans-serif;
line-height: 1;
content: "*"
}

+ 31
- 0
components/form/form-footer/form-footer.js Näytä tiedosto

@@ -0,0 +1,31 @@
// components/form/form-footer/form-footer.js
Component({

/**
* 组件的属性列表
*/
properties: {
hasId: Number,
},

/**
* 组件的初始数据
*/
data: {

},

/**
* 组件的方法列表
*/
methods: {
saveData() {
let self = this;
self.triggerEvent("save")
},
delData() {
let self = this;
self.triggerEvent("del")
}
}
})

+ 4
- 0
components/form/form-footer/form-footer.json Näytä tiedosto

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

+ 12
- 0
components/form/form-footer/form-footer.wxml Näytä tiedosto

@@ -0,0 +1,12 @@
<view-flex class="footer" justify="space-between" align="center">
<view class="left" wx:if="{{hasId}}">
<view-flex bind:tap="delData" data-id="{{hasId}}" justify="center" align="center">
删除
</view-flex>
</view>
<view class="right" style="width: {{hasId ? '400rpx' : '100%'}};">
<view-flex bind:tap="saveData" data-id="{{hasId}}" justify="center" align="center">
保存
</view-flex>
</view>
</view-flex>

+ 23
- 0
components/form/form-footer/form-footer.wxss Näytä tiedosto

@@ -0,0 +1,23 @@
.footer {
position: fixed;
bottom: 0;
z-index: 99;
box-sizing: border-box;
width: 750rpx;
padding: 20rpx 20rpx;
}

.left {
width: 210rpx;
padding: 20rpx 20rpx;
border-radius: 50rpx;
background-color: gray;
color: #ffffff;
}

.right {
padding: 20rpx 20rpx;
border-radius: 50rpx;
background-color: #19be6b;
color: #ffffff;
}

+ 43
- 0
components/form/form-input/form-input.js Näytä tiedosto

@@ -0,0 +1,43 @@
// components/form/form-input/form-input.js
Component({
properties: {
label: String,
value: String,
type: String,
requiredMark: {
type: Boolean,
value: true
},
activeMode: {
type: Boolean,
value: true
},
},

observers: {
'value': function (val) {
let self = this;
if(val) {
self.setData({
inputValue: val
})
} else {
self.setData({
inputValue: ''
})
}
},
},
data: {
inputValue: '',
styleCss: 'line-height: 36rpx; font-size: 28rpx; border-bottom: 1rpx dashed #f0f0f0;'
},

methods: {
blurValue(e) {
let self = this;
self.triggerEvent('getvalue', {val: e.detail.value})
}
}
})

+ 4
- 0
components/form/form-input/form-input.json Näytä tiedosto

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

+ 9
- 0
components/form/form-input/form-input.wxml Näytä tiedosto

@@ -0,0 +1,9 @@
<view-flex styleCss="{{styleCss}}" justify="space-between" align="center">
<view class="form-label {{requiredMark ? 'mark-red': ''}}">{{label}}</view>
<view-flex wx:if="{{activeMode}}" class="form-value" justify="flex-end">
<input style="width: 550rpx;text-align:right; padding: 20rpx 0;height: 35rpx;" type="{{type}}" value="{{inputValue}}" placeholder="请输入{{label}}" bind:blur="blurValue" />
</view-flex>
<view-flex wx:else class="form-value" justify="flex-end">
<textarea style="width: 550rpx;text-align: right;padding: 26rpx 0;" value="{{inputValue}}" placeholder="请输入{{label}}" bind:blur="blurValue" bind:input="inputValue" auto-height />
</view-flex>
</view-flex>

+ 28
- 0
components/form/form-input/form-input.wxss Näytä tiedosto

@@ -0,0 +1,28 @@


.form {
font-size: 28rpx;
}

.form-label {
width: 300rpx;
font-size: 28rpx;
line-height: 36rpx;
color: gray;
}

.form-value {
width: 450rpx;
font-size: 28rpx;
}

.mark-red::before {
display: inline-block;
margin-right: 6rpx;
color: #ef473a;
font-size: 28rpx;
font-family: SimSun,sans-serif;
line-height: 1;
content: "*"
}

+ 413
- 0
components/form/form-picker/form-picker.js Näytä tiedosto

@@ -0,0 +1,413 @@
const reqInterface = require("../../../api/models");
const {
findidx,
isValidJson
} = require("../../../utils/dataHelper");
Component({

/**
* 组件的属性列表
*/
properties: {
label: {
type: String,
value: ''
},
dict: {
type: String,
value: ''
},
list: {
type: Array,
value: []
},
cols: {
type: Number,
value: 1
},
value: {
type: "any",
value: ""
},
transmitData: Array,
position: {
type: String,
value: 'bottom'
},
requiredMark: {
type: Boolean,
value: true
},
activeMode: {
type: Boolean,
value: false
},
},

observers: {
'cols': function (val) {
let self = this;
self.setData({
columns: val
})
},
list(val) {
let self = this;
if (val && val.length > 0) {
self.setData({
pickerList: val,
oneValue: val[0].dictKey
})
self.triggerEvent('getvalue', {
val: self.data.oneValue
})
}
},
'dict': async function (val) {
let self = this;
if (val) {
if (self.data.columns == 1) {
self.setData({
dictionary: val,
})
} else {
self.getData(val)
}
}
},
'label': function (val) {
let self = this;
self.setData({
placeholder: '请选择' + val
})
},
'value': function (val) {
let self = this;
// JSON.parse(val)有效
if ((val && isValidJson(JSON.parse(val))) || (val == 0 && isValidJson(JSON.parse(val)))) {
if (typeof (JSON.parse(val)) == 'string') {
self.setData({
pickerTxt: val ? JSON.parse(val) : '',
oneValue: val ? JSON.parse(val) : ''
})
self.triggerEvent('getvalue', {
val: self.data.oneValue
})
} else {
if (self.data.pickerList.length > 0) {
console.log(self.data.pickerList)
let idx = findidx(self.data.pickerList, val)
self.data.pickerTxt = (val || val == 0) ? self.data.pickerList[idx].dictValue : ''
self.setData({
index: idx,
pickerTxt: self.data.pickerTxt
})
} else {
if (self.data.dictionary) {
self.getReq(self.data.dictionary).then(res => {
self.setData({
pickerList: res
})
let idx = findidx(self.data.pickerList, val)
self.data.pickerTxt = (val || val == 0) ? self.data.pickerList[idx].dictValue : ''
self.setData({
index: idx,
pickerTxt: self.data.pickerTxt
})
})
}
}
}
} else if ((val && isValidJson(JSON.parse(val))) || (val == 0 && isValidJson(JSON.parse(val)))) {
if (typeof (JSON.parse(val)) == 'string') {
self.setData({
pickerTxt: val ? JSON.parse(val) : ''
})
} else {
self.data.pickerTxt = JSON.parse(val).map(item => item.dictValue ? item.dictValue + '/' : '').filter(part => part);
if (self.data.pickerTxt.length > 0) {
self.data.pickerTxt[self.data.pickerTxt.length - 1] = self.data.pickerTxt[self.data.pickerTxt.length - 1].slice(0, -1);
}
self.data.pickerTxt = self.data.pickerTxt.join('');
self.setData({
pickerTxt: self.data.pickerTxt
})
}
} else {
self.setData({
index: 0,
pickerTxt: ''
})
}
},
},

lifetimes: {
attached() {
let self = this;
if (self.data.dictionary) {
self.getReq(self.data.dictionary).then(res => {
self.setData({
pickerList: res,
oneValue: res[0].dictKey
})
})
}
}
},

/**
* 组件的初始数据
*/
data: {
styleCss: 'padding: 20rpx 0; line-height: 36rpx font-size: 28rpx; border-bottom: 1rpx dashed #f0f0f0;',
dictionary: '',
pickerList: [],
index: 0,
oneValue: 0,
pickerTxt: '',

// 多列, 最多四列吧
columns: 1,
totalArray: [],
firstArray: [],
secondArray: [],
thirdArray: [],
fourthArray: [],
multiIndex: [],
multiValue: []
},

methods: {
onePickerChange(e) {
let self = this;
console.log(e)
self.setData({
index: e.detail.value,
pickerTxt: self.data.pickerList[e.detail.value].dictValue,
oneValue: self.data.pickerList[e.detail.value].dictKey
})
self.triggerEvent('getvalue', {
val: self.data.oneValue
})
},

multiPickerChange(e) {
let self = this;
self.data.multiValue = [];
for (let i = 0; i < self.data.multiIndex.length; i++) {
self.data.multiValue.push(self.data.pickerList[i][self.data.multiIndex[i]] ? self.data.pickerList[i][self.data.multiIndex[i]].dictKey : 0)
}
self.data.pickerTxt = self.data.multiIndex.map((item, i) => {
let name = self.data.pickerList[i][self.data.multiIndex[i]] ? self.data.pickerList[i][self.data.multiIndex[i]].dictValue : '';
return name ? name + '/' : '';
}).filter(part => part);
if (self.data.pickerTxt.length > 0) {
self.data.pickerTxt[self.data.pickerTxt.length - 1] = self.data.pickerTxt[self.data.pickerTxt.length - 1].slice(0, -1);
}
self.data.pickerTxt = self.data.pickerTxt.join('')
self.setData({
multiValue: self.data.multiValue,
pickerTxt: self.data.pickerTxt
})
self.triggerEvent('getvalue', {
val: self.data.multiValue,
label: self.data.pickerTxt
})
},

// 列改变
bindMultiPickerColumnChange(e) {
let self = this;
// 第几列
let col = e.detail.column;
// 第几个下标
let idx = e.detail.value;
self.data.multiIndex[col] = idx;
self.setData({
multiIndex: self.data.multiIndex
})
if (col == 0 && self.data.columns == 2) {
self.data.multiIndex[1] = 0;
self.data.pickerList[1] = [];
self.setData({
secondArray: [],
multiIndex: self.data.multiIndex,
pickerList: self.data.pickerList
})
// 滑动第一列,请求数据
self.getReq(self.data.firstArray[idx].dictKey).then(res => {
self.setData({
secondArray: res,
})
self.data.pickerList[1] = self.data.secondArray;
self.setData({
pickerList: self.data.pickerList
})
})
}
// 四列
if (self.data.columns == 4) {
// 滑动第一列,请求数据
switch (col) {
case 0:
self.data.multiIndex[1] = 0;
self.data.pickerList[1] = [];
self.data.multiIndex[2] = 0;
self.data.pickerList[2] = [];
self.data.multiIndex[3] = 0;
self.data.pickerList[3] = [];
self.setData({
secondArray: [],
multiIndex: self.data.multiIndex,
pickerList: self.data.pickerList
})
self.getReq(self.data.firstArray[idx].dictKey).then(res => {
self.setData({
secondArray: res,
})
self.data.pickerList[1] = self.data.secondArray;
self.setData({
pickerList: self.data.pickerList,
})
})
break;
case 1:
self.getReq(self.data.secondArray[idx].dictKey).then(res => {
self.data.multiIndex[2] = 0;
self.data.pickerList[2] = [];
self.data.multiIndex[3] = 0;
self.data.pickerList[3] = [];
self.setData({
thirdArray: [],
multiIndex: self.data.multiIndex,
pickerList: self.data.pickerList
})
if (res) {
self.setData({
thirdArray: res,
})
self.data.pickerList[2] = self.data.thirdArray;
self.setData({
pickerList: self.data.pickerList,
})
} else {
self.setData({
thirdArray: [],
})
self.data.pickerList[2] = self.data.thirdArray;
self.setData({
pickerList: self.data.pickerList,
})
}
})
break;
case 2:
self.getReq(self.data.thirdArray[idx].dictKey).then(res => {
self.data.multiIndex[3] = 0;
self.data.pickerList[3] = [];
self.setData({
fourArray: [],
multiIndex: self.data.multiIndex,
pickerList: self.data.pickerList
})
if (res) {
self.setData({
fourArray: res,
})
self.data.pickerList[3] = self.data.fourArray;
self.setData({
pickerList: self.data.pickerList,
})
} else {
self.setData({
fourArray: [],
})
self.data.pickerList[3] = self.data.fourArray;
self.setData({
pickerList: self.data.pickerList,
})
}
})
break;
}
}
},

async getData(val) {
let self = this;
let res = null,
res2 = null,
res3 = null,
res4 = null;
res = await self.getReq(val)
if (self.data.columns == 2) {
self.setData({
firstArray: res
})
res2 = await self.getReq(res[0].dictKey)
self.setData({
secondArray: res2,
})
self.data.pickerList[0] = self.data.firstArray;
self.data.pickerList[1] = self.data.secondArray;
self.setData({
pickerList: self.data.pickerList,
multiIndex: [0, 0]
})
} else if (self.data.columns != 1) {
self.setData({
firstArray: res
})
res2 = await self.getReq(res[0].dictKey)
self.setData({
secondArray: res2 ? res2 : []
})
if (res2) {
res3 = await self.getReq(res2[0].dictKey)
self.setData({
thirdArray: res3 ? res3 : [],
})
} else {
self.setData({
thirdArray: [],
})
}
if (res3) {
res4 = await self.getReq(res3[0].dictKey)
self.setData({
fourthArray: res4 ? res4 : [],
})
} else {
self.setData({
fourthArray: [],
})
}

self.data.pickerList[0] = self.data.firstArray;
self.data.pickerList[1] = self.data.secondArray;
self.data.pickerList[2] = self.data.thirdArray;
self.data.pickerList[3] = self.data.fourthArray;
self.setData({
pickerList: self.data.pickerList,
multiIndex: [0, 0, 0, 0]
})

}
},

getReq(val) {
let self = this;
return new Promise((resolve, reject) => {
reqInterface.GetBladeSystemDictDictionary({
code: val
}).then(res => {
resolve(res)
}).catch(error => {
console.error("GetDictDetail请求错误:", error);
reject(error);
});
})
}
}
})

+ 4
- 0
components/form/form-picker/form-picker.json Näytä tiedosto

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

+ 38
- 0
components/form/form-picker/form-picker.wxml Näytä tiedosto

@@ -0,0 +1,38 @@
<block wx:if="{{columns == 1}}">
<picker bindchange="onePickerChange" value="{{index}}" range="{{pickerList}}" range-key="dictValue">
<view-flex styleCss="{{styleCss}}" justify="space-between" align="center">
<view class="form-label">{{label}}</view>
<view-flex class="form-value" justify="flex-end">
<input style="width: 550rpx;text-align: right;height: 35rpx;" value="{{pickerTxt}}" placeholder="请选择{{label}}" disabled />
</view-flex>
</view-flex>
</picker>
</block>

<!-- 多列 -->
<block wx:else>
<picker bindchange="multiPickerChange" bindcolumnchange="bindMultiPickerColumnChange" value="{{multiIndex}}" range="{{pickerList}}" range-key="name" mode="multiSelector">
<view-flex styleCss="{{styleCss}}" justify="space-between" align="center">
<view class="form-label">{{label}}</view>
<view-flex class="form-value" justify="flex-end">
<input style="width: 550rpx;text-align: right;" value="{{pickerTxt}}" placeholder="请选择{{label}}" disabled />
</view-flex>
</view-flex>
</picker>
</block>


<!-- <wux-popup position="{{position}}" visible="{{ show }}" title="{{placeholder}}">
<wux-wing-blank size="default">
<wux-picker-view options="{{ pickerColumns }}" value="{{select_value}}" bind:scrollChange="pickerScroll" defaultFieldNames="{{cascaderOptionNames}}" />
<wux-row gutter="10">
<wux-col span="4">
<wux-button block outline type="assertive" bind:tap="close">关闭</wux-button>
</wux-col>
<wux-col span="8">
<wux-button block type="balanced" bind:tap="comfirm">确定</wux-button>
</wux-col>
</wux-row>
</wux-wing-blank> -->

<!-- </wux-popup> -->

+ 50
- 0
components/form/form-picker/form-picker.wxss Näytä tiedosto

@@ -0,0 +1,50 @@
.wux-cell-class {
height: 112rpx !important;
font-size: 28rpx !important;
}

.wux-cell-class-1 {
height: 112rpx !important;
font-size: 28rpx !important;
border: none !important;
}

.view-input {
width: 100%;
border: 1rpx solid #19be6b;
padding: 20rpx;
border-radius: 20rpx;
cursor: auto;
height: 35rpx;
overflow: hidden;
text-overflow: clip;
white-space: nowrap;
}


.form {
font-size: 28rpx;
}

.form-label {
width: 240rpx;
font-size: 28rpx;
line-height: 36rpx;
color: gray;
}

.form-value {
width: 510rpx;
font-size: 28rpx;

}

.form-label::before {
display: inline-block;
margin-right: 6rpx;
color: #ef473a;
font-size: 28rpx;
font-family: SimSun, sans-serif;
line-height: 1;
content: "*"
}

+ 71
- 0
components/form/form-radio/form-radio.js Näytä tiedosto

@@ -0,0 +1,71 @@
// components/form/form-radio/form-radio.js
Component({

/**
* 组件的属性列表
*/
properties: {
label: {
type: String,
value: ''
},
list: {
type: Array,
value: []
},
value: {
type: Number,
value: 0
}
},

observers: {
list(val) {
if(val.length > 0) {
this.setData({
radioList: val
})
}
},
value(val) {
let self = this;
if(val) {
self.data.radioList.map((item, index) => {
if (val == item.id) {
item.check = 1;
} else {
item.check = 2;
}
})
self.setData({
radioList: self.data.radioList
})
}
}
},

data: {
styleCss: 'padding: 38rpx 0; line-height: 36rpx font-size: 28rpx; border-bottom: 1rpx dashed #f0f0f0;',
radioList: []
},

methods: {
choose(e) {
let self = this;
let idx = e.currentTarget.dataset.idx;
self.data.radioList.map((item, index) => {
if (index == idx) {
item.check = 1;
} else {
item.check = 2;
}
})
self.setData({
radioList: self.data.radioList
})
self.triggerEvent('getvalue', {
val: e.currentTarget.dataset.id
})
},
}
})

+ 4
- 0
components/form/form-radio/form-radio.json Näytä tiedosto

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

+ 15
- 0
components/form/form-radio/form-radio.wxml Näytä tiedosto

@@ -0,0 +1,15 @@
<view-flex styleCss="{{styleCss}}" justify="space-between" align="center">
<view class="form-label">{{label}}</view>
<view-flex class="form-value" justify="flex-end">
<block wx:for="{{radioList}}" wx:key="index">
<view-flex align="center" bind:tap="choose" data-id="{{item.id}}" data-idx="{{index}}">
<wux-wing-blank>
<view class="{{item.check == 1 ? 'active-check' : 'no-check'}}" style="width: 24rpx;height: 24rpx;"></view>
</wux-wing-blank>
<view style="color: {{item.check == 1 ? '#19be6b' : '#000000'}};">
{{item.name}}
</view>
</view-flex>
</block>
</view-flex>
</view-flex>

+ 35
- 0
components/form/form-radio/form-radio.wxss Näytä tiedosto

@@ -0,0 +1,35 @@
.form {
font-size: 28rpx;
}

.form-label {
width: 200rpx;
font-size: 28rpx;
line-height: 36rpx;
color: gray;
}

.form-value {
width: 550rpx;
}

.active-check {
background-color: #19be6b;
border-radius: 50%;border: 1rpx #19be6b solid;

}

.no-check {
border-radius: 50%;border: 1rpx gray solid;
}

.form-label::before {
display: inline-block;
margin-right: 6rpx;
color: #ef473a;
font-size: 28rpx;
font-family: SimSun,sans-serif;
line-height: 1;
content: "*"
}

+ 156
- 0
components/form/form-rich/form-rich.js Näytä tiedosto

@@ -0,0 +1,156 @@
// components/form/form-rich/form-rich.js
Component({

/**
* 组件的属性列表
*/
properties: {
label: String,
value: String,
},

observers: {
'value': function (val) {
let self = this;
if (val) {
self.setData({
descriptionStorage: val
})
self.createSelectorQuery().select('#editorContent').context(function (res) {
self.editorCtx = res.context;
self.editorCtx.setContents({ html: self.data.descriptionStorage })
}).exec()
}
},
},

lifetimes: {
attached() {
const platform = wx.getSystemInfoSync().platform
const isIOS = platform === 'ios'
this.setData({
isIOS
})
const self = this
this.updatePosition(0)
let keyboardHeight = 0
wx.onKeyboardHeightChange(res => {
if (res.height === keyboardHeight) return
const duration = res.height > 0 ? res.duration * 1000 : 0
keyboardHeight = res.height
setTimeout(() => {
wx.pageScrollTo({
scrollTop: 0,
success() {
self.updatePosition(keyboardHeight)
self.editorCtx.scrollIntoView()
}
})
}, duration)
})
}
},
data: {
styleCss: 'padding: 38rpx 0; line-height: 36rpx font-size: 28rpx;background-color: #ffffff;',
keyboardHeight: 0,
isIOS: false,
formats: {},
descriptionStorage: ''
},

/**
* 组件的方法列表
*/
methods: {
// 个人简介内容
onEditorContentReady() {
const self = this;
self.createSelectorQuery().select('#editorContent').context(function (res) {
self.editorCtx = res.context;
self.editorCtx.setContents({ html: self.data.descriptionStorage })
}).exec()
},
onEditorContentInput(e) {
var self = this;
self.setData({
descriptionStorage: e.detail.html.replace(/wx:nodeid="\d+"/g, '')
})
},

click() {
var self = this;
wx.showModal({
title: '清空描述内容',
content: '是否要清空描述内容',
confirmText: '清空',
showCancel: true,
success(res) {
if (res.confirm) {
self.setData({
descriptionStorage: ''
})
self.editorCtx.setContents({
html: self.data.descriptionStorage
})
self.triggerEvent('delValue')
}
}
})
},

send(e) {
var self = this;
if (self.data.descriptionStorage) {
self.triggerEvent('getValue', {
val: self.data.descriptionStorage
})
} else {
wx.showToast({
icon: 'none',
title: '未填写描述',
})
self.triggerEvent('getValue', {
val: ''
})
}
},


updatePosition(keyboardHeight) {
const toolbarHeight = 148;
const {
windowHeight,
platform
} = wx.getSystemInfoSync()
let editorHeight = keyboardHeight > 0 ? (windowHeight - keyboardHeight - toolbarHeight) : windowHeight
this.setData({
editorHeight,
keyboardHeight
})
},
calNavigationBarAndStatusBar() {
const systemInfo = wx.getSystemInfoSync()
const {
statusBarHeight,
platform
} = systemInfo
const isIOS = platform === 'ios'
const navigationBarHeight = isIOS ? 44 : 48
return statusBarHeight + navigationBarHeight
},
onStatusChange(e) {
const formats = e.detail
this.setData({
formats
})
},
format(e) {
let {
name,
value
} = e.target.dataset
console.log(name)
return this.editorCtx.format(name, value)
},
}
})

+ 5
- 0
components/form/form-rich/form-rich.json Näytä tiedosto

@@ -0,0 +1,5 @@
{
"component": true,
"navigationBarTitleText": "描述",
"usingComponents": {}
}

+ 44
- 0
components/form/form-rich/form-rich.wxml Näytä tiedosto

@@ -0,0 +1,44 @@
<view-flex styleCss="{{styleCss}}" justify="space-between" vertical="{{true}}">
<wux-wing-blank>
<view class="form-label">{{label}}</view>
</wux-wing-blank>
<wux-white-space size="large" />
<wux-wing-blank>
<view-flex class="form-value">
<editor id="editorContent" class="editor-content" placeholder="请在此输入{{label}}" show-img-resize="true" bind:statuschange="onStatusChange" bind:ready="onEditorContentReady" bind:input="onEditorContentInput" value="{{descriptionStorage}}">
</editor>
</view-flex>
</wux-wing-blank>
</view-flex>

<view-flex class="footer" justify="space-between" align="center">
<view class="left">
<view-flex bind:tap="click" justify="center" align="center">
清空
</view-flex>
</view>
<view class="right">
<view-flex bind:tap="send" justify="center" align="center">
保存
</view-flex>
</view>
</view-flex>
<!--

<view class="toolBar" catchtouchend="format" style="bottom: {{isIOS ? keyboardHeight : 0}}px">
<i class="iconfont icon-charutupian" catchtouchend="insertImage"></i>
<i class="iconfont icon-format-header-1 {{formats.header===1?'active':''}}" data-name="header1" data-value="1"></i>
<i class="iconfont icon-format-header-2 {{formats.header===2?'active':''}}" data-name="header" data-value="2"></i>
<i class="iconfont icon-format-header-3 {{formats.header===3?'active':''}}" data-name="header" data-value="3"></i>
<i class="iconfont icon-format-header-4 {{formats.header===4?'active':''}}" data-name="header" data-value="4"></i>
<i class="iconfont icon-zitixiahuaxian {{formats.underline?'active':''}}" data-name="underline"></i>
<i class="iconfont icon-zitijiacu {{formats.bold?'active':''}}" data-name="bold"></i>
<i class="iconfont icon-zitixieti {{formats.italic=='em'?'active':''}}" data-name="italic"></i>
<i class="iconfont icon-zuoduiqi {{formats.align=='left'?'active':''}}" data-name="align" data-value="left"></i>
<i class="iconfont icon-juzhongduiqi {{formats.align=='center'?'active':''}}" data-name="align" data-value="center"></i>
<i class="iconfont icon-youduiqi {{formats.align=='right'?'active':''}}" data-name="align" data-value="right"></i>
<i class="iconfont icon-zuoyouduiqi {{formats.align=='justify'?'active':''}}" data-name="align" data-value="justify"></i>
<i class="iconfont icon--checklist" data-name="list" data-value="check"></i>
<i class="iconfont icon-youxupailie {{formats.list === 'ordered' ? 'ql-active' : ''}}" data-name="list" data-value="ordered"></i>
<i class="iconfont icon-wuxupailie {{formats.list === 'bullet' ? 'ql-active' : ''}}" data-name="list" data-value="bullet"></i>
</view> -->

+ 153
- 0
components/form/form-rich/form-rich.wxss Näytä tiedosto

@@ -0,0 +1,153 @@
@import "../../../utils/iconfont.wxss";

.container {
height: 72vh;
font-size: 28rpx;
}

.editor-content {
display: block;
position: relative;
box-sizing: border-box;
-webkit-user-select: text;
user-select: text;
outline: 0;
overflow: hidden;
width: 100%;
height: 100%;
color: #000000;
}

.active {
color: #2a9f93;
}

.iconfont {
display: inline-block;
width: 10%;
height: 30px;
cursor: pointer;
font-size: 20px;
}



.toolBar {
box-sizing: border-box;
padding: 0 10px;
height: 12%;
width: 100%;
position: fixed;
left: 0;
right: 0;
bottom: 0;
display: flex;
flex-wrap: wrap;
align-items: center;
/* justify-content: space-between; */
border: 1px solid #ECECEC;
border-left: none;
border-right: none;
background-color: #fff;
}

.form {
font-size: 28rpx;
}

.form-label {
width: 300rpx;
font-size: 28rpx;
line-height: 36rpx;
color: gray;
}

.form-value {
width: 450rpx;
font-size: 28rpx;
}

.form-label::before {
display: inline-block;
margin-right: 6rpx;
color: #ef473a;
font-size: 28rpx;
font-family: SimSun,sans-serif;
line-height: 1;
content: "*"
}

.footer {
position: fixed;
bottom: 0;
z-index: 99;
box-sizing: border-box;
width: 750rpx;
padding: 20rpx 20rpx;
}

.left {
width: 210rpx;
padding: 20rpx 20rpx;
border-radius: 50rpx;
background-color: gray;
color: #ffffff;
}

.right {
width: 400rpx;
padding: 20rpx 20rpx;
border-radius: 50rpx;
background-color: forestgreen;
color: #ffffff;
}


/*
.container {
position: absolute;
top: 80rpx;
left: 0;
width: 100%;
}
.editor-title {
box-sizing: border-box;
width: 100%;
height: 100%;
font-size: 16px;
line-height: 1.5;
overflow: auto;
padding: 10px 10px 20px 10px;
border: 1px solid #ECECEC;
}
.ql-active {
color: #22C704;
}
.iconfont {
display: inline-block;
width: 30px;
height: 30px;
cursor: pointer;
font-size: 20px;
}
.toolbar {
box-sizing: border-box;
padding: 0 10px;
height: 50px;
width: 100%;
position: fixed;
left: 0;
right: 100%;
bottom: 0;
display: flex;
align-items: center;
justify-content: space-between;
border: 1px solid #ECECEC;
border-left: none;
border-right: none;
}
*/

+ 57
- 0
components/form/form-textarea/form-textarea.js Näytä tiedosto

@@ -0,0 +1,57 @@
// components/form/form-input/form-input.js
Component({
properties: {
label: String,
value: String,
type: String,
rows: {
type: Number,
value: 2
},
activeMode: {
type: Boolean,
value: false
},
},

observers: {
'label': function (val) {
let self = this;
self.setData({
placeholder: '请输入' + val
})
},
'value': function (val) {
let self = this;
if(val) {
self.setData({
inputValue: val
})
}
},
},

lifetimes: {
attached: function () {
},
},
data: {
styleCss: 'padding: 38rpx 0; line-height: 36rpx font-size: 28rpx',
inputValue: '',

placeholder: '请输入',
},

methods: {
blurValue(e) {
let self = this;
self.triggerEvent('getvalue', {val: e.detail.value})
},

inputValue(e) {
let self = this;
self.triggerEvent('getinput', {val: e.detail.value})
}
}
})

+ 4
- 0
components/form/form-textarea/form-textarea.json Näytä tiedosto

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

+ 12
- 0
components/form/form-textarea/form-textarea.wxml Näytä tiedosto

@@ -0,0 +1,12 @@
<textarea wx:if="{{activeMode}}" placeholder="请在此输入您的技能特长" value="{{value}}" bind:blur="blurValue" bind:focus="inputValue" style="width: 660rpx; border: 1rpx solid #19be6b;padding: 20rpx;border-radius: 20rpx;" />


<view-flex wx:else styleCss="{{styleCss}}" justify="space-between" vertical="{{true}}">
<view-flex justify="space-between">
<view class="form-label">{{label}}</view>
</view-flex>
<wux-white-space size="large" />
<view-flex class="form-value">
<textarea style="width: 710rpx;" value="{{inputValue}}" placeholder="请输入{{label}}" bind:blur="blurValue" bind:input="inputValue" />
</view-flex>
</view-flex>

+ 32
- 0
components/form/form-textarea/form-textarea.wxss Näytä tiedosto

@@ -0,0 +1,32 @@
.wux-cell-class {
height: 112rpx !important;
font-size: 28rpx !important;
}

.form {
font-size: 28rpx;
}

.form-label {
width: 300rpx;
font-size: 28rpx;
line-height: 36rpx;
color: gray;
}

.form-value {
width: 750rpx;
font-size: 28rpx;

}

.form-label::before {
display: inline-block;
margin-right: 6rpx;
color: #ef473a;
font-size: 28rpx;
font-family: SimSun,sans-serif;
line-height: 1;
content: "*"
}

+ 137
- 0
components/form/form-upload-more/form-upload-more.js Näytä tiedosto

@@ -0,0 +1,137 @@
const reqInterface = require("../../../api/models");
const Base64 = require("../../../utils/base64");
const {
imagePrefix, getApi
} = require("../../../utils/dataHelper");
Component({

/**
* 组件的属性列表
*/
properties: {
images: {
type: Array,
value: []
},
imagesPath: {
type: String,
value: ''
},
uploadTxt: String,
},

observers: {
'images': function (val) {
let self = this;
if (val) {
self.setData({
imageList: val
})
}
},
'imagesPath': function (val) {
let self = this;
if (val) {
self.data.imagePathList = val.split(",")
self.setData({
imagePathList: self.data.imagePathList
})
}
},

},

lifetimes: {
attached() {
this.setData({
'header.Blade-Auth': `bearer ${wx.getStorageSync('token')}`
})
this.setData({
api: getApi()
})
}
},

data: {
styleCss: 'padding: 20rpx 0; line-height: 36rpx font-size: 28rpx; border-bottom: 1rpx dashed #f0f0f0;',
api: '',
imageList: [],
imagePathList: [],
tempImageFiles: [],
header: {
'Authorization': `Basic ${Base64.Base64.encode('miniapp:miniapp_secret')}`,
'Blade-Auth': `bearer ${wx.getStorageSync('token')}`
}
},

/**
* 组件的方法列表
*/
methods: {
uploadFiles(e) {
let self = this;
wx.showActionSheet({
itemList: ['从相册中选择', '拍照'],
success(res) {
if (res.tapIndex == 0) {
self.chooseWxImage('album');
} else if (res.tapIndex == 1) {
self.chooseWxImage('camera');
}
},
fail(res) {
console.log(res.errMsg)
}
})
},

chooseWxImage(type) {
let self = this;
wx.chooseMedia({
mediaType: "image",
sizeType: ['original', 'compressed'],
sourceType: [type],
async success(res) {
self.setData({
tempImageFiles: res.tempFiles
})
for (let i = 0; i < self.data.tempImageFiles.length; i++) {
let res = await reqInterface.PostImageUpload(self.data.tempImageFiles[i].tempFilePath);
self.data.imageList.push(res.data.url)
self.data.imagePathList.push(res.data.path)
}
self.setData({
imageList: self.data.imageList,
imagePathList: self.data.imagePathList
})
self.triggerEvent('sumbitImageInfo', {
images: self.data.imageList,
imagesPath: self.data.imagePathList
})
}
})
},

delImage(e) {
let self = this;
self.data.imageList.splice(e.currentTarget.dataset.index, 1)
self.data.imagePathList.splice(e.currentTarget.dataset.index, 1)
self.setData({
imageList: self.data.imageList,
imagePathList: self.data.imagePathList
})
self.triggerEvent('sumbitImageInfo', {
images: self.data.imageList,
imagesPath: self.data.imagePathList
})

},

imgPreview(e) {
let self = this;
wx.previewImage({
urls: [e.currentTarget.dataset.href]
})
},
}
})

+ 4
- 0
components/form/form-upload-more/form-upload-more.json Näytä tiedosto

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

+ 25
- 0
components/form/form-upload-more/form-upload-more.wxml Näytä tiedosto

@@ -0,0 +1,25 @@
<view-flex styleCss="{{styleCss}}" justify="space-between" align="center">
<view class="form-label">
{{uploadTxt}}
</view>
</view-flex>

<view class="check-attachment-box">
<block wx:for="{{imageList}}" >
<view class="render-image-box">
<view class="check-attachment-image">
<button plain="true" style="border-style: none;">
<image class="attachment-img" mode="aspectFit" src="{{ item }}" data-href="{{item}}"></image>
</button>
</view>
<button class="img-btn-delete" data-index="{{index}}" bind:tap="delImage">删除</button>
</view>
</block>
<block >
<view class="check-attachment-add">
<button bind:tap="uploadFiles" plain="true" style="border-style: none;border: 1PX dashed #1677ff;background-color: #fafafa;">
+
</button>
</view>
</block>
</view>

+ 91
- 0
components/form/form-upload-more/form-upload-more.wxss Näytä tiedosto

@@ -0,0 +1,91 @@
.wux-cell-class {
border-bottom: none !important;
}

.check-attachment-box {
display: flex;
flex-wrap: wrap;
/* align-items: center; */
width: 710rpx;
margin-top: 20rpx;
}

.check-attachment-image {
width: 150rpx;
height: 200rpx;
margin-bottom: 8rpx;
}

.check-attachment-image button {
width: 150rpx;
height: 200rpx;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
}

.check-attachment-image image {
width: 100%;
height: 100%;
}
.render-image-box {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 16rpx;
margin-right: 16rpx;
}

.render-image-box button {
margin: 0 !important;
}

.img-btn-delete {
width: 144rpx !important;
height: 44rpx;
display: flex;
justify-content: center;
align-items: center;
padding: 0;
background-color: red;
color: #fff;
font-size: 24rpx;
}

.check-attachment-add {
width: 144rpx;
height: 192rpx;
margin-bottom: 8rpx;
}

.check-attachment-add button {
width: 144rpx;
height: 192rpx;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
}

.check-attachment-add image {
width: 100%;
height: 100%;
}

.form-label {
font-size: 28rpx;
line-height: 36rpx;
color: gray;
}

.form-label::before {
display: inline-block;
margin-right: 6rpx;
color: #ef473a;
font-size: 28rpx;
font-family: SimSun, sans-serif;
line-height: 1;
content: "*"
}

+ 104
- 0
components/form/form-upload/form-upload.js Näytä tiedosto

@@ -0,0 +1,104 @@
const reqInterface = require("../../../api/models");
const Base64 = require("../../../utils/base64");
const {
imagePrefix, getApi
} = require("../../../utils/dataHelper");

Component({

/**
* 组件的属性列表
*/
properties: {
image: {
type: String,
value: ''
},
uploadTxt: String,
},

observers: {
'image': function (val) {
let self = this;
if (val) {
self.setData({
imageUrl: val
})
}
}
},

lifetimes: {
attached() {
this.setData({
'header.Blade-Auth': `bearer ${wx.getStorageSync('token')}`
})
this.setData({
api: getApi()
})

}
},

data: {
styleCss: 'padding: 20rpx 0; line-height: 36rpx font-size: 28rpx; border-bottom: 1rpx dashed #f0f0f0;',
api: '',
imageUrl: '',
header: {
'Authorization': `Basic ${Base64.Base64.encode('miniapp:miniapp_secret')}`,
'Blade-Auth': `bearer ${wx.getStorageSync('token')}`
}
},

/**
* 组件的方法列表
*/
methods: {
uploadSuccess(e) {
let self = this;
let res = JSON.parse(e.detail.file.res.data);
if (res.data) {
self.setData({
image: res.data.url
})
} else {
if (res.code == 401) {
wx.showModal({
title: '错误信息',
content: '登录已过期',
confirmText: '重新登录',
showCancel: false,
success(res1) {
wx.removeStorageSync('token')
wx.reLaunch({
url: '/pages/my/index/index',
})
}
})
} else {
wx.showModal({
title: '错误信息',
content: '上传报错,请联系相关人员',
confirmText: '知道了',
showCancel: false,
success(res1) {

}
})
}
}
self.triggerEvent('sumbitImageInfo', res.data)
},


uploadFail(e) {
console.log(e)
},
preview(e) {
wx.previewImage({
current: e.currentTarget.dataset.src, // 当前显示图片的http链接
urls: [e.currentTarget.dataset.src] // 需要预览的图片http链接列表
})
},
}
})

+ 4
- 0
components/form/form-upload/form-upload.json Näytä tiedosto

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

+ 11
- 0
components/form/form-upload/form-upload.wxml Näytä tiedosto

@@ -0,0 +1,11 @@
<view-flex styleCss="{{styleCss}}" justify="space-between" align="center">
<view class="form-label">
{{uploadTxt}}
</view>
<view-flex class="form-value" justify="flex-end">
<wux-upload slot='footer' listType="picture-card" showUploadList="{{ false }}" url="{{api}}/grants/wechat/consumerinfo/upload" header="{{header}}" name="file" bind:success="uploadSuccess" bind:fail="uploadFail" bind:preview="onPreview" >
<image src="{{ imageUrl }}" wx:if="{{ imageUrl }}" mode="aspectFit" style="width:300rpx; height: 154rpx;" />
<text wx:else>{{uploadTxt}}</text>
</wux-upload>
</view-flex>
</view-flex>

+ 39
- 0
components/form/form-upload/form-upload.wxss Näytä tiedosto

@@ -0,0 +1,39 @@
.form {
font-size: 28rpx;
border-bottom: 1rpx dashed gray;
}

.form-label {
width: 240rpx;
font-size: 28rpx;
line-height: 36rpx;
color: gray;
}

.form-value {
width: 510rpx;
font-size: 28rpx;
color: gray;
}

.form-label::before {
display: inline-block;
margin-right: 6rpx;
color: #ef473a;
font-size: 28rpx;
font-family: SimSun, sans-serif;
line-height: 1;
content: "*"
}

.upload-content {
position: relative;
width: 266rpx;
height: 150rpx;
margin-bottom: 12rpx;
background-repeat: no-repeat;
/* 防止图片重复 */
background-position: center center;
/* 图片居中 */
background-size: 50% auto;
}

+ 48
- 0
components/views/view-flex/view-flex.js Näytä tiedosto

@@ -0,0 +1,48 @@
// components/views/view-flex/view-flex.js
Component({

/**
* 组件的属性列表
*/
properties: {
justify: {
type: String,
value: ''
},
align: {
type: String,
value: ''
},
vertical: {
type: Boolean,
value: false
},

height: {
type: Number,
value: ''
},
wrap: {
type: String,
value: 'nowrap'
},
styleCss: {
type: String,
value: ''
},
},

/**
* 组件的初始数据
*/
data: {

},

/**
* 组件的方法列表
*/
methods: {

}
})

+ 4
- 0
components/views/view-flex/view-flex.json Näytä tiedosto

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

+ 25
- 0
components/views/view-flex/view-flex.wxml Näytä tiedosto

@@ -0,0 +1,25 @@
<view wx:if="{{vertical}}" style="height: {{height}}rpx;display: flex; flex-direction: column; {{justify ? 'justify-content: ' + justify + ';' : '' }} {{align ? 'align-items: ' + align + '; ' : ''}} {{styleCss ? styleCss : ''}}">
<slot></slot>
</view>
<view wx:else style="display: flex; {{justify ? 'justify-content: ' + justify + ';' : '' }} {{align ? 'align-items: ' + align + '; ' : ''}} {{wrap ? 'flex-wrap: ' + wrap + '; ' : ''}} {{styleCss ? styleCss : ''}}">
<slot></slot>
</view>

<!-- justify -->
<!-- center
end
first baseline
flex-end
flex-start
last baseline
left
right
safe
space-around
space-between
space-evenly -->

<!-- align -->
<!-- center
flex-end
flex-start -->

+ 1
- 0
components/views/view-flex/view-flex.wxss Näytä tiedosto

@@ -0,0 +1 @@
/* components/views/view-flex/view-flex.wxss */

+ 159
- 0
components/views/view-sign/view-sign.js Näytä tiedosto

@@ -0,0 +1,159 @@
Component({
/**
* 组件的初始数据
*/
data: {
tempFilePath: '',
hideModal: false,
hasDraw: false,
canvasName: '#writeCanvas',
ctx: '',
canvasWidth: 0,
canvasHeight: 0,
startPoint: {
x: 0,
y: 0,
},
selectColor: 'black',
lineColor: '#1A1A1A', // 颜色
lineSize: 1, // 笔记倍数
radius: 4, //画圆的半径
},
// 初始化画布
ready() {
this.setData({
hideModal: false
})
let that = this
let query = wx.createSelectorQuery().in(this);
//获取自定义组件的SelectQuery对象
this.canvasCtx = wx.createCanvasContext('signature', that)
// 设置线的样式
this.canvasCtx.setLineCap("round");
this.canvasCtx.setLineJoin("round");
// 初始化颜色
this.canvasCtx.setStrokeStyle(that.data.selectColor);
// 初始化粗细
query.select('.modal-canvas').boundingClientRect(rect => {
this.setData({
canvasWidth: rect.width,
canvasHeight: rect.height,
});
}).exec();
},
// 方法列表
methods: {
scaleStart(event) {
if (event.type != 'touchstart') return false;
let currentPoint = {
x: event.touches[0].x,
y: event.touches[0].y
}
// this.data.ctx.moveTo(currentPoint.x, currentPoint.y)
this.drawCircle(currentPoint);
this.setData({
startPoint: currentPoint,
hasDraw: true, //签字了
});
},
mouseDown() {},
scaleEnd(e) {
this.setData({
isStart: true
})
},
scaleMove(event) {
if (event.type != "touchmove") return false;
let {
startPoint
} = this.data
let currentPoint = {
x: event.touches[0].x,
y: event.touches[0].y
}

this.drawLine(startPoint, currentPoint)
this.setData({
startPoint: currentPoint
})
},
drawCircle(point) { //这里负责点
let ctx = this.canvasCtx;
ctx.beginPath();
ctx.setFillStyle(this.data.lineColor)
//笔迹粗细由圆的大小决定
ctx.arc(point.x, point.y, this.data.radius, 0, 2 * Math.PI);
ctx.fill();
ctx.closePath();
ctx.draw(true)
},
drawLine(sourcePoint, targetPoint) {
let ctx = this.canvasCtx;
this.drawCircle(targetPoint);
ctx.beginPath();
ctx.setStrokeStyle(this.data.lineColor)
ctx.setLineWidth(this.data.radius * 2)
ctx.moveTo(sourcePoint.x, sourcePoint.y);
ctx.lineTo(targetPoint.x, targetPoint.y);
ctx.stroke();
ctx.closePath();
},
clearCanvas() {
//清空画布
let ctx = this.canvasCtx;
ctx.clearRect(0, 0, this.data.canvasWidth, this.data.canvasHeight);
ctx.fillStyle = 'rgba(0, 0, 0, .1)';
ctx.draw()
this.setData({
hasDraw: false //未签字
})
},
save(cb) {
let that = this
let {
hasDraw,
} = this.data
if (!hasDraw) {
wx.showToast({
title: '您还未签名!',
icon: 'none',
mask: true
})
return
} else {
let {
canvasHeight,
canvasWidth
} = that.data;
wx.canvasToTempFilePath({
x: 0,
y: 0,
width: canvasWidth,
height: canvasHeight,
destWidth: 200,
destHeight: 80,
canvasId: 'signature',
canvas: that.data.ctx,
fileType: "png",
success(res) {
console.log(res)
if (res.tempFilePath) {
// 文件转base64
wx.getFileSystemManager().readFile({
filePath: res.tempFilePath,
encoding: "binary",
success: (val) => {
cb && cb(val, res);
that.triggerEvent("saveToImageEvent", val.data);
},
});
}
},
fail(err) {
console.log(err);
}
}, that)
}
},
}
})

+ 5
- 0
components/views/view-sign/view-sign.json Näytä tiedosto

@@ -0,0 +1,5 @@
{
"component": true,
"usingComponents": {},
"pageOrientation": "landscape"
}

+ 8
- 0
components/views/view-sign/view-sign.wxml Näytä tiedosto

@@ -0,0 +1,8 @@
<view class="modal-content-area">
<view class="modal-content">
<view class="toast" wx:if="{{!hasDraw}}">
请在此使用正楷签名
</view>
<canvas canvas-id="signature" class="modal-canvas" disable-scroll="{{true}}" id="writeCanvas" bindtouchstart="scaleStart" bindtouchmove="scaleMove" bindtouchend="scaleEnd"></canvas>
</view>
</view>

+ 107
- 0
components/views/view-sign/view-sign.wxss Näytä tiedosto

@@ -0,0 +1,107 @@
.modal-content-area {
z-index: 5;
width: 100%;
height: 100%;
background: #F5F7FB;
position: fixed;
}
.modal-content {
width: 100%;
height: 100%;
background: #ffffff;
}
.modal-canvas {
width: 100vw;
height: 83vh;
background: #F5F7FB !important;
border: 1rpx solid rgba(0, 0, 0, 0.08);
border-radius: 4rpx;
z-index: 1;
}
.modal-bottom {
position: absolute;
bottom: 15rpx;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 100;
width: 100vw;
box-sizing: border-box;
padding: 0 32rpx;
}
.modal-btn {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 85rpx;
height: 30rpx;
background: rgba(103, 149, 255, 0.2);
}
.modal-clear {
font-size: 13rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #3670F5;
margin-right: 12rpx;
}
.modal-confirm {
background: #3670F5;
font-size: 13rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
}
.modal-btn:nth-child(1) {
border-right: 1rpx solid #ffffff;
}
.clear_signature {
/* position: absolute; */
top: 40rpx;
right: 15rpx;
display: flex;
align-items: center;
z-index: 1;
font-size: 13rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #3670F5;
/* background-color: #F5F7FB; */
z-index: 100;
}
.clear_signature>text {
height: 17rpx;
}
.clear_signature>image {
width: 15rpx;
height: 15rpx;
margin-right: 2rpx;
}
.toast {
position: absolute;
top: 40%;
left: 32%;
transform: rotate(-50%, -50%);
z-index: 100;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(58, 65, 85, 0.4);
}
.flex_btn {
display: flex;
align-items: center;
}

BIN
icons/@2x/gzh.png Näytä tiedosto


BIN
icons/@2x/nodata.png Näytä tiedosto


BIN
icons/@2x/unLogin.png Näytä tiedosto


BIN
icons/all.png Näytä tiedosto


BIN
icons/apply.png Näytä tiedosto


BIN
icons/bank.png Näytä tiedosto


BIN
icons/daishenhe.png Näytä tiedosto


BIN
icons/edit.png Näytä tiedosto


BIN
icons/nodata.png Näytä tiedosto


BIN
icons/right.png Näytä tiedosto


BIN
icons/setting.png Näytä tiedosto


BIN
icons/sfzfm.png Näytä tiedosto


BIN
icons/sfzzm.png Näytä tiedosto


BIN
icons/yifafang.png Näytä tiedosto


BIN
icons/yigongshi.png Näytä tiedosto


BIN
icons/yishenhe.png Näytä tiedosto


+ 13
- 0
package-lock.json Näytä tiedosto

@@ -0,0 +1,13 @@
{
"name": "jobinfosystem",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "jobinfosystem",
"version": "1.0.0",
"license": "ISC"
}
}
}

+ 11
- 0
package.json Näytä tiedosto

@@ -0,0 +1,11 @@
{
"name": "jobinfosystem",
"version": "1.0.0",
"description": "",
"main": ".eslintrc.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}

+ 33
- 0
pages/home/guide/detail/index.js Näytä tiedosto

@@ -0,0 +1,33 @@
const reqInterface = require("../../../../api/models");

Page({

/**
* 页面的初始数据
*/
data: {
title: '',
content: '',
total: 0,
},

onLoad(options) {
reqInterface.GetGuide().then(res => {
this.setData({
title: res.title,
content: res.content
})
})
reqInterface.GetQuotaGet().then(res => {
this.setData({
total: res.remaining
})
})
},

toApplyFor() {
wx.navigateTo({
url: '/pages/info/index/index',
})
}
})

+ 4
- 0
pages/home/guide/detail/index.json Näytä tiedosto

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "办事指南",
"usingComponents": {}
}

+ 12
- 0
pages/home/guide/detail/index.wxml Näytä tiedosto

@@ -0,0 +1,12 @@
<view style="text-align: center;margin: 10px; font-weight: 700;font-size: 40rpx;">{{title}}</view>
<view style="padding: 20rpx 20rpx 150rpx;">
<rich-text nodes="{{content}}" space="nbsp"></rich-text>
</view>
<view class="footer">
<view wx:if="{{total != 0}}" class="footer-button" bind:tap="toApplyFor">
我要申请 <text wx:if="{{total && total< 101}}">(名额剩余:{{total}})</text>
</view>
<view wx:if="{{total == 0}}" class="footer-button" style="background-color: gray;">
我要申请 <text>(名额剩余:0)</text>
</view>
</view>

+ 21
- 0
pages/home/guide/detail/index.wxss Näytä tiedosto

@@ -0,0 +1,21 @@
.footer {
box-sizing: border-box;
position: fixed;
bottom: 0;
z-index: 99;
box-sizing: border-box;
width: 750rpx;
padding: 20rpx 20rpx;
background-color: #ffffff;
}

.footer-button {
display: flex;
justify-content: center;
align-items: center;
padding: 20rpx 20rpx;
background-color: #1677ff;
color: #ffffff;
border-radius: 8rpx;
}

+ 88
- 0
pages/home/index/index.js Näytä tiedosto

@@ -0,0 +1,88 @@
const reqInterface = require("../../../api/models");
import {
toLink
} from '../../../utils/nav';
Page({

/**
* 页面的初始数据
*/
data: {
publicityList: [],
searchParams: {
current: 1,
size: 5
},
total: 0,
conut: 0
},

/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getPublicityList(this.data.searchParams);
},
onShow() {
if(wx.getStorageSync('token')) {
reqInterface.GetQuotaGet().then(res => {
this.setData({
conut: res.remaining
})
})
}
},
getPublicityList(val) {
reqInterface.GetConsumerinfopublicList(val).then(res => {
this.setData({
publicityList: res.records,
'searchParams.current': this.data.searchParams.current - 1,
total: parseInt(res.total / 5 + 1)
})
})
},
toUp() {
this.setData({
'searchParams.current': this.data.searchParams.current - 1
})
this.getPublicityList(this.data.searchParams);
},
toNext() {
this.setData({
'searchParams.current': this.data.searchParams.current + 1
})
this.getPublicityList(this.data.searchParams);
},
toApplyFor() {
if(wx.getStorageSync('token')) {
wx.navigateTo({
url: '/pages/home/guide/detail/index',
})
} else {
wx.showToast({
title: '请先登录',
icon: 'none'
})
}
},

getRefresh() {
let self = this;
self.setData({
searchParams: {
current: 1,
size: 5
}
})
self.getPublicityList(self.data.searchParams);
},

toMore() {
toLink('/pages/home/publicity/index/index')
},

toDetail(e) {
toLink('/pages/home/publicity/detail/index', {id: e.currentTarget.dataset.id})
},
})

+ 4
- 0
pages/home/index/index.json Näytä tiedosto

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "办事指南",
"usingComponents": {}
}

+ 28
- 0
pages/home/index/index.wxml Näytä tiedosto

@@ -0,0 +1,28 @@
<view class="container">
<view class="guide-box">
<view class="guide-title">办事指南</view>
<view class="guide-link" bind:tap="toApplyFor">
<text>我要申请</text>
<text wx:if="{{conut && conut < 101}}" style="font-size: 28rpx;padding-top: 16rpx;">名额剩余({{conut}})</text>
</view>
</view>
<view class="publicity-box">
<view class="publicity-header">
<view>信息公示</view>
<view style="font-size: 24rpx;color: gray;" bind:tap="toMore">更多</view>
</view>
<view class="publicity-list" wx:if="{{publicityList.length > 0}}">
<block wx:for="{{publicityList}}">
<view class="publicity-item" data-id="{{item.id}}" bind:tap="toDetail">
<view class="publicity-label">
<view class="publicity-name">{{item.title}}</view>
<view class="publicity-time">发布时间:{{item.releaseDate}}</view>
</view>
</view>
</block>
</view>
<view wx:else style="display: flex;align-items: center; justify-content: center;">
<image src="/icons/nodata.png" mode="aspectFit" style="width: 360rpx;height: 360rpx;"/>
</view>
</view>
</view>

+ 53
- 0
pages/home/index/index.wxss Näytä tiedosto

@@ -0,0 +1,53 @@
.guide-box {
padding: 0 32rpx;
}

.guide-title, .publicity-header {
padding: 20rpx 0;
font-weight: bold;
font-size: 32rpx;
display: flex;
justify-content: space-between;
align-items: center;
}

.guide-link {
display: flex;
flex-direction: column;
justify-content: center;
height: 400rpx;
background-color: #1677ff;
color: #ffffff;
font-size: 48rpx;
display: flex;
align-items: center;
justify-content: center;
}

.publicity-box {
padding: 20rpx 32rpx;
}

.publicity-label {
display: flex;
flex-direction: column;
}

.publicity-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx;
font-size: 28rpx;
margin-bottom: 6rpx;
background-color: #f0f0f0;
}

.publicity-name {
margin-bottom: 6rpx;
}

.publicity-time {
color: gray;
font-size: 24rpx;
}

+ 76
- 0
pages/home/publicity/detail/index.js Näytä tiedosto

@@ -0,0 +1,76 @@
const reqInterface = require("../../../../api/models");
Page({

/**
* 页面的初始数据
*/
data: {
title: '',
content: ''
},

/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let self = this;
reqInterface.GetConsumerinfopublicDetail({
id: options.id
}).then(res => {
self.setData({
title: res.title,
content: res.content,
list: res.consumerInfos
})
})
},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {

},

/**
* 生命周期函数--监听页面显示
*/
onShow() {

},

/**
* 生命周期函数--监听页面隐藏
*/
onHide() {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload() {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage() {

}
})

+ 4
- 0
pages/home/publicity/detail/index.json Näytä tiedosto

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "公示详情",
"usingComponents": {}
}

+ 41
- 0
pages/home/publicity/detail/index.wxml Näytä tiedosto

@@ -0,0 +1,41 @@
<view style="padding: 20rpx 32rpx;color: #000;">
<view style="text-align: center;margin: 10px;font-weight: 700;font-size: 40rpx;">{{title}}</view>
<rich-text nodes="{{content}}" space="nbsp"></rich-text>
<block wx:if="{{list.length > 0}}">
<view class="table">
<view class="thead">
<view class="th" style="width: 20vw;">姓名</view>
<view class="th" style="width: 30vw;">身份证号</view>
<view class="th" style="width: 40vw;">务工单位</view>
<view class="th" style="width: 10vw;">金额(元)</view>
</view>
<view class="tbody">
<view class="tr" wx:for="{{list}}" wx:key="{{index}}">
<view class="tb" style="width: 20vw;">{{item.name}}</view>
<view class="tb" style="width: 30vw;">{{item.pid}}</view>
<view class="tb" style="width: 40vw;">{{item.workName}}</view>
<view class="tb" style="width: 10vw;">{{item.approveAmount}}</view>
</view>
</view>
</view>
</block>

<!-- <block>
<view class="table">
<view class="thead">
<view class="th" style="width: 20vw;">姓名</view>
<view class="th" style="width: 30vw;">身份证号</view>
<view class="th" style="width: 40vw;">务工单位</view>
<view class="th" style="width: 10vw;">金额(元)</view>
</view>
<view class="tbody">
<view class="tr" >
<view class="tb" style="width: 20vw;">姓名姓姓名姓姓名姓姓名姓</view>
<view class="tb" style="width: 30vw;">460**************1</view>
<view class="tb" style="width: 40vw;">广东省中山市小榄镇哈哈哈哈哈哈哈哈哈哈</view>
<view class="tb" style="width: 10vw;">1000</view>
</view>
</view>
</view>
</block> -->
</view>

+ 37
- 0
pages/home/publicity/detail/index.wxss Näytä tiedosto

@@ -0,0 +1,37 @@
.table {
margin: 20rpx 0;
border: 1PX #000000 solid;
font-size: 20rpx;
}

.thead, .tr {
display: flex;
justify-content: space-between;
border-bottom: 1PX solid #000000;
}

.th {
display: flex;
align-items: center;
justify-content: center;
border-right: 1PX solid #000000;
padding: 20rpx 8rpx;
font-weight: bold;
}

.tb {
display: flex;
align-items: center;
justify-content: center;
border-right: 1PX solid #000000;
padding: 20rpx 8rpx;
}

.th:last-child, .tb:last-child {
border-right: none;
}

.tr:last-child {
border-bottom: none;
}


+ 80
- 0
pages/home/publicity/index/index.js Näytä tiedosto

@@ -0,0 +1,80 @@
const reqInterface = require("../../../../api/models");
import {
toLink
} from '../../../../utils/nav';
Page({

/**
* 页面的初始数据
*/
data: {
isRefreshing: false,
publicityList: [],
searchParams: {
current: 1,
size: 9
},
},

/**
* 生命周期函数--监听页面加载
*/
onShow(options) {
this.getPublicityList(this.data.searchParams);
},
getPublicityList(val) {
let self = this;
reqInterface.GetConsumerinfopublicList(val).then(res => {
if (!res.records || res.records.length == 0) {
wx.showToast({
title: '没有更多数据',
icon: 'none'
})
}
self.setData({
publicityList: res.records ? self.data.publicityList.concat(res.records) : self.data.publicityList.concat([]),
isRefreshing: false
})
}).catch(err => {
self.setData({
isRefreshing: false
})
})
},
// 加载更多
onLoadMore() {
let self = this;
let page = self.data.searchParams.current + 1; //获取当前页数并+1
self.setData({
'searchParams.current': page, //更新当前页数
})
self.getPublicityList(self.data.searchParams); //重新调用请求获取下一页数据
},

toDetail(e) {
toLink('/pages/home/publicity/detail/index', {
id: e.currentTarget.dataset.id
})
},

// 下拉刷新
onRefresherPulling(e) {
this.setData({
isRefreshing: true
});
},

onRefresherRefresh(e) {
this.getRefresh()
},

getRefresh() {
let self = this;
self.setData({
publicityList: [],
'searchParams.current': 1, //更新当前页数
'searchParams.size': 9, //更新当前页数
})
self.getPublicityList(this.data.searchParams);
},
})

+ 6
- 0
pages/home/publicity/index/index.json Näytä tiedosto

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "信息公示",
"usingComponents": {},
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark"
}

+ 15
- 0
pages/home/publicity/index/index.wxml Näytä tiedosto

@@ -0,0 +1,15 @@
<scroll-view scroll-y="true" style="height: 96vh;box-sizing: border-box;" bindscrolltolower="onLoadMore" refresher-enabled bindrefresherpulling="onRefresherPulling" bindrefresherrefresh="onRefresherRefresh" refresher-triggered="{{isRefreshing}}">
<view class="publicity-list" wx:if="{{publicityList.length > 0}}">
<block wx:for="{{publicityList}}">
<view class="publicity-item" data-id="{{item.id}}" bind:tap="toDetail">
<view class="publicity-label">
<view class="publicity-name">{{item.title}}</view>
<view class="publicity-time">发布时间:{{item.releaseDate}}</view>
</view>
</view>
</block>
</view>
<view wx:else style="display: flex;align-items: center; justify-content: center;">
<image src="/icons/nodata.png" mode="aspectFit" style="width: 360rpx;height: 360rpx;" />
</view>
</scroll-view>

+ 31
- 0
pages/home/publicity/index/index.wxss Näytä tiedosto

@@ -0,0 +1,31 @@
.publicity-box {
padding: 032rpx;
}

.publicity-list {
padding: 20rpx;
}

.publicity-label {
display: flex;
flex-direction: column;
}

.publicity-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx;
font-size: 28rpx;
margin-bottom: 20rpx;
background-color: #f0f0f0;
}

.publicity-name {
margin-bottom: 30rpx;
}

.publicity-time {
color: gray;
font-size: 26rpx;
}

+ 633
- 0
pages/info/index/index.js Näytä tiedosto

@@ -0,0 +1,633 @@
const reqInterface = require("../../../api/models");
const reg = require("../../../utils/regHelper");
import {
matchValue
} from '../../../utils/dataHelper'
Page({

/**
* 页面的初始数据
*/
data: {
id: '',
info: {
// 基本信息
name: '',
gender: '',
pid: '',
birthday: '',
phone: '',
degree: '',
homeAddress: '',
workName: '',
workAddress: '',
// 银行
bankNumber: '',
bankName: '',
bankBranch: '',
carAmount: '',
socialAmount: '',
workAmount: '',
askType: '',
// 照片
pidPath: '',
bookletPath: '',
personPath: '',
bankPath: '',
insuredPath: '',
jobPath: '',

// 签名
signPath: '',

status: 0
},
showInfo: {
gender: '',
degree: '',
askType: '',
pidFrontPhoto: '',
pidLaterPhoto: '',
bookletPhoto: '',
personPathPhoto: '',
bankPhoto: '',
insuredPhoto: '',
jobPhoto: [],
pidFrontPath: '',
pidLaterPath: '',
retire_age_man: 0,
retire_age_women: 0
},
steps: [{
text: '填写资料一'
},
{
text: '填写资料二'
},
{
text: '补充资料'
},
{
text: '签名'
}
],
active: 0,
curActive: 0,
},

onLoad(opt) {
if (opt.id) {
this.setData({
id: opt.id
})
}
if (opt.id || wx.getStorageSync('id')) {
this.getDetail()
}
},

/**
* 生命周期函数--监听页面显示
*/
onShow() {
let self = this;

// 获取退休年龄
reqInterface.GetBladeSystemDictDictionary({
code: 'retire_age'
}).then(res => {
self.setData({
'showInfo.retire_age_man': res[0].dictKey,
'showInfo.retire_age_women': res[1].dictKey
})
})
},

getDetail() {
let self = this;
reqInterface.GetConsumerinfoCheckDetail({
consumerInfoId: self.data.id ? self.data.id : wx.getStorageSync('id')
}).then(res => {
self.data.showInfo.jobPhoto = res.jobPath.split(",")
for (let i = 0; i < self.data.showInfo.jobPhoto.length; i++) {
self.data.showInfo.jobPhoto[i] = self.data.api + self.data.showInfo.jobPhoto[i];
}
self.setData({
info: res,
'info.status': 0,
'showInfo.pidFrontPhoto': res.pidPath ? self.data.api + res.pidPath.split(',')[0] : '',
'showInfo.pidLaterPhoto': res.pidPath ? self.data.api + res.pidPath.split(',')[1] : '',
'showInfo.bookletPhoto': res.bookletPath ? self.data.api + res.bookletPath : '',
'showInfo.personPathPhoto': res.personPath ? self.data.api + res.personPath : '',
'showInfo.bankPhoto': res.bankPath ? self.data.api + res.bankPath : '',
'showInfo.insuredPhoto': res.insuredPath ? self.data.api + res.insuredPath : '',
'showInfo.jobPhoto': self.data.showInfo.jobPhoto,
})

})
},

errorCheck() {
return new Promise((resolve, reject) => {
let self = this;
switch (self.data.curActive) {
case 0:
if (!self.data.showInfo.pidFrontPhoto) {
self.errorInfo('请上传身份证人像面');
reject(false)
return false;
}
if (!self.data.showInfo.pidLaterPhoto) {
self.errorInfo('请上传身份证国徽面');
reject(false)
return false;
}
if (!self.data.info.name) {
self.errorInfo('请填写姓名');
reject(false)
return false;
}
if (!self.data.info.gender) {
self.errorInfo('请选择性别');
reject(false)
return false;

}
if (!self.data.info.pid) {
self.errorInfo('请填写身份证号');
reject(false)
return false;
}
if (!self.data.info.phone) {
self.errorInfo('请填写联系电话');
reject(false)
return false;
}
if (!self.data.info.degree) {
self.errorInfo('请选择文化程度');
reject(false)
return false;
}
if (!self.data.info.homeAddress) {
self.errorInfo('请填写家庭住址');
reject(false)
return false;
}
if (!self.data.info.workName) {
self.errorInfo('请填写务工单位');
reject(false)
return false;
}
if (!self.data.info.workAddress) {
self.errorInfo('请填写单位地址');
reject(false)
return false;
}
break;
case 1:
if (!self.data.showInfo.bankPhoto) {
self.errorInfo('请上传银行卡照片');
reject(false)
return false;
}
if (!self.data.info.bankNumber) {
self.errorInfo('请填写银行卡号');
reject(false)
return false;
}
if (!self.data.info.bankName) {
self.errorInfo('请填写开户银行');
reject(false)
return false;
}
if (self.data.info.carAmount === '') {
self.errorInfo('请选择一次性交通补贴');
reject(false)
return false;
}
if (self.data.info.socialAmount === '') {
self.errorInfo('请选择个人社保补贴');
reject(false)
return false;
}
if (self.data.info.workAmount === '') {
self.errorInfo('请选择就业补贴');
reject(false)
return false;
}
if (!self.data.info.askType) {
self.errorInfo('请选择补贴对象');
reject(false)
return false;
}
break;
case 2:
if (!self.data.showInfo.bookletPhoto) {
self.errorInfo('请上传户口本户主页');
reject(false)
return false;
}
if (!self.data.showInfo.personPathPhoto) {
self.errorInfo('请上传户口本本人页');
reject(false)
return false;
}
if (!self.data.showInfo.insuredPhoto) {
self.errorInfo('请上传参保证明');
reject(false)
return false;
}
if (!self.data.showInfo.jobPhoto) {
self.errorInfo('请上传工作证明');
reject(false)
return false;
}
break;
}
resolve(true)
})
},

errorInfo(val) {
wx.showToast({
title: val,
icon: 'none'
})
},

toNext(e) {
let self = this;
self.errorCheck().then(() => {
switch (self.data.curActive) {
case 0:
reqInterface.PostConsumerinfoSubmit(self.data.info).then(res => {
if (!self.data.id) {
wx.setStorageSync('id', res.id)
}
self.setData({
'info.id': res.id,
id: res.id,
active: 1,
curActive: 1,
})
})
break;
case 1:
reqInterface.PostConsumerinfoSubmit(self.data.info).then(res => {
self.setData({
'info.id': res.id,
id: res.id,
active: 2,
curActive: 2,
})
})
break;
case 2:
reqInterface.PostConsumerinfoSubmit(self.data.info).then(res => {
self.setData({
'info.id': res.id,
id: res.id,
active: 3,
curActive: 3,
})
})
break;
}
})

},

toFront() {
let self = this;
// self.getDetail()
if (self.data.active == 1) {
self.setData({
active: 0,
curActive: 0,
})
}
if (self.data.active == 2) {
self.setData({
active: 1,
curActive: 1,
})
}
if (self.data.active == 3) {
self.setData({
active: 2,
curActive: 2,
})
}
},


async ocrCheckIdCardFront(e) {
let self = this;
// 计算年纪
const startdate = new Date(e.detail.birth.text);
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以加1,并补零
const day = String(now.getDate()).padStart(2, '0'); // 补零
const enddate = new Date(`${year}-${month}-${day}`);
const timeDifference = enddate.getTime() - startdate.getTime();
const age = Math.floor(timeDifference / (1000 * 60 * 60 * 24 * 365));
// 判断是否满足申请年龄
if (e.detail.gender.text == '男' && age > self.data.showInfo.retire_age_man) {
wx.showModal({
title: '无法申请',
content: '已超出申请年龄,无法申请',
confirmText: '退出申请',
showCancel: false,
success(res1) {
if (res1.confirm) {
wx.reLaunch({
url: '/pages/my/index/index',
})
}
}
})
} else if (e.detail.gender.text == '女' && age > self.data.showInfo.retire_age_women) {
wx.showModal({
title: '无法申请',
content: '已超出申请年龄,无法申请',
confirmText: '退出申请',
showCancel: false,
success(res1) {
if (res1.confirm) {
wx.reLaunch({
url: '/pages/my/index/index',
})
}
}
})
} else {
try {
self.setData({
'info.name': e.detail.name.text,
'info.gender': e.detail.gender.text == '男' ? 1 : 2,
'showInfo.gender': e.detail.gender.text,
'info.pid': e.detail.id.text,
'info.birthday': e.detail.birth.text,
'info.homeAddress': e.detail.address.text,
})
let res = await reqInterface.PostImageUpload(e.detail.image_path);
self.setData({
'showInfo.pidFrontPhoto': res.data.url,
'showInfo.pidFrontPath': res.data.path
})
if (self.data.showInfo.pidFrontPath) {
self.setData({
'info.pidPath': self.data.showInfo.pidFrontPath + ',' + self.data.showInfo.pidLaterPath
})
}
} catch {

}

}
},

async ocrCheckIdCardLater(e) {
try {
let self = this;
let res = await reqInterface.PostImageUpload(e.detail.image_path);
self.setData({
'showInfo.pidLaterPhoto': res.data.url,
'showInfo.pidLaterPath': res.data.path
})
if (self.data.showInfo.pidLaterPath) {
self.setData({
'info.pidPath': self.data.showInfo.pidFrontPath + ',' + self.data.showInfo.pidLaterPath
})
}
} catch {

}
},

nameValue(e) {
let self = this;
if (!e.detail.val) {
self.errorInfo('请填写姓名');
return false;
}
self.setData({
'info.name': e.detail.val
})
},

genderValue(e) {
let self = this;
self.setData({
'info.gender': e.detail.val
})
},

idNumberValue(e) {
let self = this;
console.log(e.detail.val)
reg.IDCard(e.detail.val).then(res => {
if (res) {
self.setData({
'info.pid': e.detail.val
})
}
}).catch(() => {
self.setData({
'info.pid': ''
})
})
},

// 联系电话
phoneValue(e) {
let self = this;
reg.phone(e.detail.val).then(res => {
if (res) {
self.setData({
'info.phone': e.detail.val
})
}
}).catch(err => {
self.setData({
'info.phone': ''
})
})
},

// 文化程度
degreeValue(e) {
let self = this;
self.setData({
'info.degree': e.detail.val
})
},

// 家庭住址
homeAddressValue(e) {
let self = this;
if (!e.detail.val) {
self.errorInfo('请填写家庭住址');
return false;
}
self.setData({
'info.homeAddress': e.detail.val
})

},
// 务工单位
workNameValue(e) {
let self = this;
if (!e.detail.val) {
self.errorInfo('请填写务工单位');
return false;
}
self.setData({
'info.workName': e.detail.val
})
},
// 单位地址
workAddressValue(e) {
let self = this;
if (!e.detail.val) {
self.errorInfo('请填写单位地址');
return false;
}
self.setData({
'info.workAddress': e.detail.val
})
},



// 银行卡识别
async ocrCheckBankCard(e) {
let self = this;
self.setData({
'info.bankNumber': e.detail.number.text,
})
let res = await reqInterface.PostImageUpload(e.detail.image_path);
self.setData({
'showInfo.bankPhoto': res.data.url,
'info.bankPath': res.data.path
})
},

// 银行卡号
bankNumberValue(e) {
let self = this;
if (!e.detail.val) {
self.errorInfo('请填写银行卡号');
return false;
}
self.setData({
'info.bankNumber': e.detail.val
})
},

// 开户银行
bankNameValue(e) {
let self = this;
if (!e.detail.val) {
self.errorInfo('请填写开户银行');
return false;
}
self.setData({
'info.bankName': e.detail.val
})
},
// 支行名称
bankBranchValue(e) {
let self = this;
self.setData({
'info.bankBranch': e.detail.val
})
},

// 一次性交通补贴
carAmountValue(e) {
let self = this;
self.setData({
'info.carAmount': e.detail.val
})
},

// 个人社保补贴
socialAmountValue(e) {
let self = this;
self.setData({
'info.socialAmount': e.detail.val
})
},
// 就业补贴
workAmountValue(e) {
let self = this;
self.setData({
'info.workAmount': e.detail.val
})
},

// 性质
askTypeValue(e) {
let self = this;
self.setData({
'info.askType': e.detail.val
})
},

// 户口本
bookletPhotoValue(data) {
let self = this;
self.setData({
'showInfo.bookletPhoto': data.detail.url,
'info.bookletPath': data.detail.path
})

},

// 户口本本人
personPathValue(data) {
let self = this;
self.setData({
'showInfo.personPathPhoto': data.detail.url,
'info.personPath': data.detail.path
})

},

// 参保证明
insuredPhotoValue(data) {
let self = this;
self.setData({
'showInfo.insuredPhoto': data.detail.url,
'info.insuredPath': data.detail.path
})

},

// 工作证明
jobPhotoValue(data) {
let self = this;
console.log(data)
self.data.info.jobPath = data.detail.imagesPath.join(",")
self.setData({
'showInfo.jobPhoto': data.detail.images,
'info.jobPath': self.data.info.jobPath
})
},

toSign(e) {
console.log(e)
wx.navigateTo({
url: '/pages/info/sign/index?id=' + e.currentTarget.dataset.id,
})
},

imageError(e) {
this.setData({
[e.currentTarget.dataset.imgkey]: e.currentTarget.dataset.errimage,
})
},
})

+ 6
- 0
pages/info/index/index.json Näytä tiedosto

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "填写申请资料",
"usingComponents": {
"ocr-navigator": "plugin://ocr-plugin/ocr-navigator"
}
}

+ 125
- 0
pages/info/index/index.wxml Näytä tiedosto

@@ -0,0 +1,125 @@
<view style="padding: 20rpx 0 150rpx;">
<view class="step-box">
<wux-steps current="{{ active }}">
<block wx:for="{{steps}}">
<wux-step title="{{item.text}}"></wux-step>
</block>
</wux-steps>
</view>

<scroll-view scroll-y="true" style="height: cale(100vh-200px);" show-scrollbar="{{false}}" enhanced>
<!-- 填写资料一 -->
<view hidden="{{curActive != 0}}">
<view class="id-box">
<view class="upload-box">
<view class="upload-content">
<ocr-navigator bind:onSuccess="ocrCheckIdCardFront" certificateType="idCard" opposite="{{false}}">
<image src="{{showInfo.pidFrontPhoto ? showInfo.pidFrontPhoto : '/icons/sfzfm.png'}}" mode="aspectFit" style="width: 320rpx;height: 156rpx;" binderror="imageError" data-errimage="/icons/sfzfm.png" data-imgkey="showInfo.pidFrontPhoto"/>
</ocr-navigator>
</view>
<view>
上传身份证人像面
</view>
</view>
<view class="upload-box">
<ocr-navigator bind:onSuccess="ocrCheckIdCardLater" certificateType="idCard">
<image src="{{showInfo.pidLaterPhoto ? showInfo.pidLaterPhoto : '/icons/sfzzm.png'}}" mode="aspectFit" style="width: 320rpx;height: 156rpx;" binderror="imageError" data-errimage="/icons/sfzzm.png" data-imgkey="showInfo.pidLaterPhoto"/>
</ocr-navigator>
<view>
上传身份证国徽面
</view>
</view>
</view>

<view class="info-box">
<form-input label="姓名" value="{{info.name}}" bind:getvalue="nameValue"></form-input>
<form-picker label="性别" value="{{info.gender}}" dict="sex" bind:getvalue="genderValue"></form-picker>
<form-input label="身份证号" value="{{info.pid}}" bind:getvalue="idNumberValue"></form-input>
<form-input label="联系电话" value="{{info.phone}}" bind:getvalue="phoneValue"></form-input>
</view>
<view class="notice">
* 请核对证件信息,以确保信息的准确性,减少审核次数。
</view>
<view class="info-box">
<form-picker label="文化程度" value="{{info.degree}}" dict="degree" bind:getvalue="degreeValue"></form-picker>
<form-input label="家庭住址" activeMode="{{false}}" value="{{info.homeAddress}}" bind:getvalue="homeAddressValue"></form-input>
<form-input label="务工单位" activeMode="{{false}}" value="{{info.workName}}" bind:getvalue="workNameValue"></form-input>
<form-input label="单位地址" activeMode="{{false}}" value="{{info.workAddress}}" bind:getvalue="workAddressValue"></form-input>
</view>
</view>


<!-- 填写资料二 -->
<view hidden="{{curActive != 1}}">
<view class="info-box">
<view class="bank-box">
<view class="bank-label">上传银行卡</view>
<view class="bank-upload-box">
<ocr-navigator bind:onSuccess="ocrCheckBankCard" certificateType="bankCard">
<image wx:if="{{showInfo.bankPhoto}}" src="{{showInfo.bankPhoto}}" mode="aspectFit" style="width: 320rpx;height: 156rpx;" />
<view wx:else class="bank-upload-content">
上传银行卡
</view>
</ocr-navigator>
</view>
</view>
<form-input label="银行卡号" type="number" value="{{info.bankNumber}}" bind:getvalue="bankNumberValue"></form-input>
<form-input label="开户银行" value="{{info.bankName}}" bind:getvalue="bankNameValue"></form-input>
<form-input label="支行名称" requiredMark="{{false}}" value="{{info.bankBranch}}" bind:getvalue="bankBranchValue"></form-input>
<form-picker label="一次性交通补贴" value="{{info.carAmount}}" dict="car_amount" bind:getvalue="carAmountValue"></form-picker>
<form-picker label="个人社保补贴" value="{{info.socialAmount}}" dict="social_amount" bind:getvalue="socialAmountValue"></form-picker>
<form-picker label="就业补贴" value="{{info.workAmount}}" dict="work_amount" bind:getvalue="workAmountValue"></form-picker>
<form-picker label="补贴对象" value="{{info.askType}}" dict="askType" bind:getvalue="askTypeValue"></form-picker>
</view>
</view>

<!-- 填写资料 -->
<view hidden="{{curActive != 2}}">
<view class="info-box">
<form-upload uploadTxt="户口本户主页" image="{{showInfo.bookletPhoto}}" bind:sumbitImageInfo="bookletPhotoValue"></form-upload>
<form-upload uploadTxt="户口本本人页" image="{{showInfo.personPathPhoto}}" bind:sumbitImageInfo="personPathValue"></form-upload>
<form-upload uploadTxt="参保证明" image="{{showInfo.insuredPhoto}}" bind:sumbitImageInfo="insuredPhotoValue"></form-upload>
<form-upload-more uploadTxt="工作证明(工资流水、劳动合同、工作证明三者之一)" images="{{showInfo.jobPhoto}}" imagesPath="{{info.jobPath}}" bind:sumbitImageInfo="jobPhotoValue"></form-upload-more>
</view>
</view>
</scroll-view>


</view>


<view class="footer" wx:if="{{active == 3}}">
<wux-row gutter="10">
<wux-col span="4">
<view class="front-button" bind:tap="toFront">
上一步
</view>
</wux-col>
<wux-col span="8">
<view class="next-button" bind:tap="toSign" data-id="{{id}}">
点击签名
</view>
</wux-col>
</wux-row>
</view>

<view class="footer" wx:else>
<wux-row gutter="10">
<wux-col span="4" wx:if="{{active != 0}}">
<view class="front-button" bind:tap="toFront">
上一步
</view>
</wux-col>
<wux-col span="{{active != 0 ? 8 : 12}}">
<view class="next-button" bind:tap="toNext">
下一步
</view>
</wux-col>
</wux-row>
</view>

<!-- <view class="footer">
<view class="footer-button" bind:tap="toNext">
下一步
</view>
</view> -->

+ 129
- 0
pages/info/index/index.wxss Näytä tiedosto

@@ -0,0 +1,129 @@
page {
background-color: #f0f0f0;
}

.step-box {
padding: 20rpx 0;
}

.id-box {
margin: 20rpx;
padding: 20rpx;
display: flex;
justify-content: space-between;
background-color: #ffffff;
font-size: 24rpx;
border-radius: 8rpx;
color: gray;
}

.upload-box {
display: flex;
flex-direction: column;
align-items: center;
width: 48%;
}

.upload-content {
position: relative;
width: 100%;
height: 150rpx;
margin-bottom: 12rpx;
background-repeat: no-repeat; /* 防止图片重复 */
background-position: center center; /* 图片居中 */
background-size: 80% auto;
}

.upload-image-bg {
background-repeat: no-repeat; /* 防止图片重复 */
background-position: center center; /* 图片居中 */
background-size: 68% auto;
}

.info-box {
margin: 20rpx;
padding: 20rpx;
border-radius: 8rpx;
background-color: #ffffff;
}

.footer {
box-sizing: border-box;
position: fixed;
bottom: 0;
z-index: 99;
box-sizing: border-box;
width: 750rpx;
padding: 30rpx 20rpx;
background-color: #ffffff;
}

.front-button {
display: flex;
justify-content: center;
align-items: center;
padding: 20rpx 20rpx;
background-color: gray;
color: #ffffff;
border-radius: 8rpx;
}

.next-button {
display: flex;
justify-content: center;
align-items: center;
padding: 20rpx 20rpx;
background-color: #1677ff;
color: #ffffff;
border-radius: 8rpx;
}

.notice {
text-align: right;
padding: 10rpx 20rpx;
color: red;
font-size: 24rpx;
}

.bank-box {
display: flex;
justify-content: space-between;
align-items: center;
}

.bank-label {
width: 200rpx;
font-size: 28rpx;
line-height: 36rpx;
color: gray;
}

.bank-upload-box {
display: flex;
justify-content: flex-end;
align-items: center;
}

.bank-upload-content {
display: flex;
justify-content: center;
align-items: center;
width: 266rpx;
height: 150rpx;
border: 1PX dashed #1677ff;
border-radius: 8rpx;
margin: 0 16rpx 16rpx 0;
background-color: #fafafa;
font-size: 28rpx;
color: gray;
}

.bank-label::before {
display: inline-block;
margin-right: 6rpx;
color: #ef473a;
font-size: 28rpx;
font-family: SimSun, sans-serif;
line-height: 1;
content: "*"
}

+ 106
- 0
pages/info/sign/index.js Näytä tiedosto

@@ -0,0 +1,106 @@
let success = require('../../../utils/successHelper');
const reqInterface = require("../../../api/models");
const reg = require("../../../utils/regHelper");
Page({

/**
* 页面的初始数据
*/
data: {
info: {
signPath: '',
id: ''
},
id: '',
pr: 0,
width: 0,
height: 0,
},

/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (options.id) {
this.setData({
id: options.id,
'info.id': options.id
});
}
let signaImage = this.selectComponent('.signaImage');
signaImage.ready()
},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {

},

/**
* 生命周期函数--监听页面显示
*/
onShow() {

},

toNext() {
let self = this;
let signaImage = this.selectComponent('.signaImage');
signaImage.save((res, url) => {
reqInterface.PostImageUpload(url.tempFilePath).then(res => {
self.setData({
'info.signPath': res.data.path
})
if (self.data.info.signPath) {
self.data.info.status = 1;
reqInterface.PostConsumerinfoSubmit(self.data.info).then(res => {
self.reset()
wx.showToast({
title: '申请成功',
icon: 'none',
success(res) {
setTimeout(() => {
if (wx.getStorageSync('id')) {
wx.removeStorageSync('id')
}
wx.reLaunch({
url: '/pages/my/index/index',
})
}, 2000)
}
})
})
} else {
wx.showToast({
title: '请进行签名',
icon: 'none'
})
return false;
}
})
})
},


toFront() {
let self = this;
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
wx.navigateBack({
delta: 1,
})
prevPage.setData({
active: 2,
curActive: 2,
})
self.reset()
},

// 重置
reset() {
let signaImage = this.selectComponent('.signaImage');
signaImage.clearCanvas()
},
})

+ 8
- 0
pages/info/sign/index.json Näytä tiedosto

@@ -0,0 +1,8 @@
{
"navigationStyle": "custom",
"pageOrientation": "landscape",
"resizable": true,
"usingComponents": {
"view-sign": "../../../components/views/view-sign/view-sign"
}
}

+ 9
- 0
pages/info/sign/index.wxml Näytä tiedosto

@@ -0,0 +1,9 @@
<!-- <view-sign h="{{1}}" class="signaImage" signwidth="{{width}}" signheight="{{height}}" signpr="{{pr}}"></view-sign> -->

<view-sign class="signaImage"></view-sign>

<view class="footer" >
<view class="footer-btn footer-btn-front" bind:tap="toFront">上一步</view>
<view class="footer-btn footer-btn-reset" bind:tap="reset">重签</view>
<view class="footer-btn footer-btn-save" bind:tap="toNext">保存</view>
</view>

+ 43
- 0
pages/info/sign/index.wxss Näytä tiedosto

@@ -0,0 +1,43 @@
.footer {
display: flex;
justify-content: space-around;
position: fixed;
bottom: 0;
z-index: 99;
box-sizing: border-box;
width: 750rpx;
padding: 20rpx 20rpx;
background-color: #ffffff;
}

.footer-btn {
width: 30%;
display: flex;
justify-content: center;
align-items: center;
padding: 6rpx 0;
border-radius: 8rpx;
background-color: rgba(103, 149, 255, 1);
color: #ffffff;
font-size: 24rpx;
}

.footer-btn-front {
background: gray;
font-size: 18rpx;
font-weight: 400;
color: #FFFFFF;
}

.footer-btn-save {
background: #3670F5;
font-size: 18rpx;
font-weight: 400;
color: #FFFFFF;
}

.footer-btn-reset {
font-size: 18rpx;
font-weight: 400;
color: #FFFFFF;
}

+ 98
- 0
pages/login/index/index.js Näytä tiedosto

@@ -0,0 +1,98 @@
const reqInterface = require('../../../api/models');

Page({

/**
* 页面的初始数据
*/
data: {
message: false,
modalContent: '本系统将会获取您的手机号和微信用户信息以用于联系以及显示头像和名称'
},

/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {

},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {

},

/**
* 生命周期函数--监听页面显示
*/
onShow() {

},

getUserProfile() {
let self = this;
wx.login({
success: (res) => {
console.log(res)
reqInterface.Login({
grantType: 'code',
code: res.code,
userType: 2
}).then(res => {
wx.setStorageSync('token', res.accessToken);
wx.reLaunch({
url: '/pages/home/index/index',
})
})
},
})
},


getMessage() {
let self = this;
wx.showModal({
title: '登录须知',
content: self.data.modalContent,
confirmText: '我已知晓',
showCancel: false
})
},

/**
* 生命周期函数--监听页面隐藏
*/
onHide() {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload() {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage() {

}
})

+ 3
- 0
pages/login/index/index.json Näytä tiedosto

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

+ 0
- 0
pages/login/index/index.wxml Näytä tiedosto


Some files were not shown because too many files changed in this diff

Loading…
Peruuta
Tallenna