Commit a66e0558 authored by chaiwei's avatar chaiwei

提交代码

parent 8f7c0374
Pipeline #5762 canceled with stages
......@@ -5,13 +5,13 @@
## Build Setup
``` bash
# install dependencies
# install dependencies 安装项目依赖
yarn install
# serve with hot reload at localhost:8080
# serve with hot reload at localhost:8080 运行项目命令
yarn run dev
# build for production with minification
# build for production with minification 打包命令
yarn run build
# build for production and view the bundle analyzer report
......
......@@ -15,27 +15,27 @@ const spinner = ora('building for production...')
spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, function (err, stats) {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n\n')
webpack(webpackConfig, function(err, stats) {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n\n')
if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}
if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}
console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
})
})
console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
})
})
\ No newline at end of file
......@@ -3,26 +3,28 @@ const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: true,
isMobilePlatform: false,
appCode:'"HLS_APP"',
clearTable: true,
//domainUrl:"http://123.125.154.135:10004/core/",
//loginPath: "http://123.125.154.135:10004/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=",
//rootPath: "http://123.125.154.135:10004/core/r/api",
// basePath: "http://123.125.154.135:10004/core/r/api?sysName=dr_uat&apiName=",
//file_view:"http://123.125.154.135:10004/core/r/api/app/fileViewSvc?sysName=dr_dev&apiName=attment_view&attachment_id=",
//filePath: "http://123.125.154.135:10004/core/r/api?sysName=dr_uat&apiName=file_view&",
loginPath: '"http://hlsapp.hand-china.com/core/oauth/token?client_id=hQGCtxTItRa34PUOgxaD0r7oSPeuEaIB&client_secret=7ee8338c-4a06-44a1-87cc-afa63f8e1bc3&grant_type=password&username=app&password=" ',
loginPathRl: '"http://101.133.225.167:8096/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password="',
basePath: '"http://hlsapp.hand-china.com/core/r/api?sysName=HLS_APP&apiName="',
rootPath: '"http://hlsapp.hand-china.com/core/r/api"',
file_url: '"http://hlsapp.hand-china.com/file/"',
appId: '"com.hls.easy.car"',
currentVersion: '"1.0.0"',
wxCode:"'hlsWx'",
uploadSysName:"'HLS_APP'",
uploadApiName:"'attachment_upload'"
});
NODE_ENV: '"development"',
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: true,
isMobilePlatform: false,
appCode: '"HLS_APP"',
clearTable: true,
//domainUrl:"http://123.125.154.135:10004/core/",
//loginPath: "http://123.125.154.135:10004/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=",
//rootPath: "http://123.125.154.135:10004/core/r/api",
// basePath: "http://123.125.154.135:10004/core/r/api?sysName=dr_uat&apiName=",
//file_view:"http://123.125.154.135:10004/core/r/api/app/fileViewSvc?sysName=dr_dev&apiName=attment_view&attachment_id=",
//filePath: "http://123.125.154.135:10004/core/r/api?sysName=dr_uat&apiName=file_view&",
loginPath: '"http://hlsapp.hand-china.com/core/oauth/token?client_id=hQGCtxTItRa34PUOgxaD0r7oSPeuEaIB&client_secret=7ee8338c-4a06-44a1-87cc-afa63f8e1bc3&grant_type=password&username=app&password=" ',
loginPathRl: '"http://sign.hitachics.com/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password="',
basePath: '"http://sign.hitachics.com/core/r/api?sysName=HCL_UPLOAD_FILE&apiName="',
basePathRl: '"http://sign.hitachics.com/core/r/api?sysName=wxgzh_hitachics&apiName="',
rootPath: '"http://sign.hitachics.com/core/r/api"',
file_url: '"http://sign.hitachics.com/file/"',
domainUrl: "http://sign.hitachics.com",
appId: '"com.hls.easy.car"',
currentVersion: '"1.0.0"',
wxCode: "'hlsWx'",
uploadSysName: "'HLS_APP'",
uploadApiName: "'attachment_upload'"
});
\ No newline at end of file
'use strict'
module.exports = {
NODE_ENV: '"production"',
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: false,
isMobilePlatform: false,
appCode:'"HLS_APP"',
clearTable: true,
loginPath: '"http://hlsapp.hand-china.com/core/oauth/token?client_id=hQGCtxTItRa34PUOgxaD0r7oSPeuEaIB&client_secret=7ee8338c-4a06-44a1-87cc-afa63f8e1bc3&grant_type=password&username=app&password=" ',
loginPathRl: '"http://101.133.225.167:8096/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password="',
basePath: '"http://hlsapp.hand-china.com/core/r/api?sysName=HLS_APP&apiName="',
rootPath: '"http://hlsapp.hand-china.com/core/r/api"',
file_url: '"http://hlsapp.hand-china.com/file/"',
appId: '"com.hls.easy.car"',
currentVersion: '"1.0.0"',
wxCode:"'hlsWx'",
uploadSysName:"'HLS_APP'",
uploadApiName:"'attachment_upload'"
}
NODE_ENV: '"production"',
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: false,
isMobilePlatform: false,
appCode: '"HLS_APP"',
clearTable: true,
loginPath: '"http://sign.hitachics.com/core/oauth/token?client_id=hQGCtxTItRa34PUOgxaD0r7oSPeuEaIB&client_secret=7ee8338c-4a06-44a1-87cc-afa63f8e1bc3&grant_type=password&username=app&password=" ',
loginPathRl: '"http://sign.hitachics.com/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password="',
basePath: '"http://sign.hitachics.com/core/r/api?sysName=HCL_UPLOAD_FILE&apiName="',
basePathRl: '"http://sign.hitachics.com/core/r/api?sysName=wxgzh_hitachics&apiName="',
rootPath: '"http://sign.hitachics.com/core/r/api"',
file_url: '"http://sign.hitachics.com/file/"',
appId: '"com.hls.easy.car"',
currentVersion: '"1.0.0"',
wxCode: "'hlsWx'",
uploadSysName: "'HLS_APP'",
uploadApiName: "'attachment_upload'"
}
\ No newline at end of file
'use strict'
module.exports = {
NODE_ENV: '"production"',
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: true,
isMobilePlatform: false,
appCode:'"HLS_APP"',
clearTable: true,
loginPath: '"http://hlsapp.hand-china.com/core/oauth/token?client_id=hQGCtxTItRa34PUOgxaD0r7oSPeuEaIB&client_secret=7ee8338c-4a06-44a1-87cc-afa63f8e1bc3&grant_type=password&username=app&password=" ',
loginPathRl: '"http://101.133.225.167:8096/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password="',
basePath: '"http://hlsapp.hand-china.com/core/r/api?sysName=HLS_APP&apiName="',
rootPath: '"http://hlsapp.hand-china.com/core/r/api"',
file_url: '"http://hlsapp.hand-china.com/file/"',
appId: '"com.hls.easy.car"',
currentVersion: '"1.0.0"',
wxCode:"'hlsWx'",
uploadSysName:"'HLS_APP'",
uploadApiName:"'attachment_upload'"
}
NODE_ENV: '"production"',
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: true,
isMobilePlatform: false,
appCode: '"HLS_APP"',
clearTable: true,
loginPath: '"http://sign.hitachics.com/core/oauth/token?client_id=hQGCtxTItRa34PUOgxaD0r7oSPeuEaIB&client_secret=7ee8338c-4a06-44a1-87cc-afa63f8e1bc3&grant_type=password&username=app&password=" ',
loginPathRl: '"http://sign.hitachics.com/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password="',
basePath: '"http://sign.hitachics.com/core/r/api?sysName=HCL_UPLOAD_FILE&apiName="',
basePathRl: '"http://sign.hitachics.com/core/r/api?sysName=wxgzh_hitachics&apiName="',
rootPath: '"http://sign.hitachics.com/core/r/api"',
file_url: '"http://sign.hitachics.com/file/"',
appId: '"com.hls.easy.car"',
currentVersion: '"1.0.0"',
wxCode: "'hlsWx'",
uploadSysName: "'HLS_APP'",
uploadApiName: "'attachment_upload'"
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, width=device-width, viewport-fit=cover">
<meta name="format-detection" content="telephone=no">
<meta name="format-detection" content="email=no">
<!-- safari私有meta标签 允许全屏模式浏览 指定safari顶部状态栏样式(黑色) -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<!-- <script type="text/javascript" src="../../cordova.js"></script>-->
<script src="./static/signature-pad-min.js"></script>
<!-- <script src="./static/jquery-2-1-1.js"></script>-->
<script src="./static/jquery-touch-punch-min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/assets/f2/3.3.5/f2-all.min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/assets/lib/lodash-4.17.4.min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/assets/lib/jquery-3.2.1.min.js"></script>
<script src="https://gw.alipayobjects.com/os/rmsportal/NjNldKHIVQRozfbAOJUW.js"></script>
<title>车租易</title>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, width=device-width, viewport-fit=cover">
<meta name="format-detection" content="telephone=no">
<meta name="format-detection" content="email=no">
<!-- safari私有meta标签 允许全屏模式浏览 指定safari顶部状态栏样式(黑色) -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<!-- <script type="text/javascript" src="../../cordova.js"></script>-->
<script src="./static/signature-pad-min.js"></script>
<!-- <script src="./static/jquery-2-1-1.js"></script>-->
<script src="./static/jquery-touch-punch-min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/assets/f2/3.3.5/f2-all.min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/assets/lib/lodash-4.17.4.min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/assets/lib/jquery-3.2.1.min.js"></script>
<script src="https://gw.alipayobjects.com/os/rmsportal/NjNldKHIVQRozfbAOJUW.js"></script>
<title></title>
</head>
<body>
<div id="app-box"></div>
<!-- built files will be auto injected -->
<div id="app-box"></div>
<!-- built files will be auto injected -->
</body>
</html>
</html>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<div id="app">
<transition :name="transitionName">
<keep-alive>
<router-view v-if="$route.meta.keepAlive"/>
<router-view v-if="$route.meta.keepAlive" />
</keep-alive>
</transition>
<transition :name="transitionName">
......
......@@ -7,7 +7,7 @@ import router from './router/index'
import flexible from './common/ydui.flexible'
import components from './components/component'
import {componentInstall, appStyle} from 'hls-easy-ui'
import { componentInstall, appStyle } from 'hls-easy-ui'
/**
* 指令
*/
......@@ -16,11 +16,16 @@ import directives from './scripts/directives'
import filter from './scripts/filter'
import {
Picker,
Picker,
} from 'vux'
import './scripts/prototype'
import './scripts/vuePlatform'
import {
Toast
} from 'vux'
Vue.component('toast', Toast)
/**
......@@ -31,21 +36,23 @@ import hlsPopup from './scripts/hlsPopup'
/**
* http
*/
import {post, get} from './scripts/hlsHttp'
import { post, get } from './scripts/hlsHttp'
/** 全局函数hlsUtil**/
import hlsUtil from './scripts/hlsUtil'
if (process.env.CONFIG_ENV === 'uat') {
const VConsole = require('vconsole')
new VConsole() // eslint-disable-line
}
// if (process.env.CONFIG_ENV === 'uat') {
const VConsole = require('vconsole')
new VConsole() // eslint-disable-line
// }
Vue.use(directives)
Vue.use(filter)
//
import axios from 'axios'
Vue.prototype.$api = axios;
/**
* 组件
*/
......@@ -62,8 +69,8 @@ Vue.prototype.$devicePixelRatio = 2
Vue.prototype.$post = post
Vue.prototype.$get = get
let hlsHttp = {
get: get,
post: post,
get: get,
post: post,
}
Vue.prototype.hlsHttp = window.hlsHttp = hlsHttp
......@@ -75,11 +82,11 @@ Vue.prototype.hlsUtil = window.hlsUtil = hlsUtil
* 全局返回上一页面
* @param index
*/
let routeGo = function (index) {
if (!index) {
index = -1
}
this.$router.go(index)
let routeGo = function(index) {
if (!index) {
index = -1
}
this.$router.go(index)
}
Vue.prototype.$routeGo = routeGo
......@@ -87,24 +94,24 @@ Vue.prototype.$routeGo = routeGo
Vue.config.productionTip = false
vum.$vumPlatform.ready(function () {
vum.$vumPlatform.ready(function() {
})
/* eslint-disable no-new */
new Vue({
data () {
return {
pathList: [],
transitionName: null,
}
},
router,
watch: { // 监听路由变化
$route (to, from) {
document.body.scrollTop = 0
document.documentElement.scrollTop = 0
data() {
return {
pathList: [],
transitionName: null,
}
},
router,
watch: { // 监听路由变化
$route(to, from) {
document.body.scrollTop = 0
document.documentElement.scrollTop = 0
},
},
},
render: h => h(App),
}).$mount('#app-box')
render: h => h(App),
}).$mount('#app-box')
\ No newline at end of file
This diff is collapsed.
<template>
<h-view class="public-style electronic-contract-list" title="合同文本清单">
<h-content>
<div style="margin-top:20px">
<div class="contract-list-item" v-for="(item,index) in data " :key="index">
<img src="../../../assets/electronicContract/contract-list.png" alt />
<div class="contract-list-text">
<div>合同下载</div>
<p style="margin-top:3px">{{item.file_sign_name}}</p>
</div>
<button
style="float:right;margin-top:5px;background-color:#09bb07;color:#ffffff;width:50px;border-radius:3px"
@click="downloadContract(item.attachment_id)"
>下载</button>
</div>
</div>
<!-- <div class="footer" @click="createSign()">签约</div> -->
</h-content>
</h-view>
</template>
<script>
export default {
data() {
return {
isModalVisible: false,
con_list: [],
infoShow: {},
info: null,
searchCondition: {
input: null
},
data: []
};
},
components: {},
created() {
this.wxConfig();
if (this.$route.params.itemData) {
window.localStorage.SignDownloadData = JSON.stringify(
this.$route.params.itemData.sign_file_list
);
}
// console.log(JSON.parse(window.localStorage.unSignData));
this.data = JSON.parse(window.localStorage.SignDownloadData);
console.log("22222222222", this.data);
this.offsize = 1;
this.pagesize = 10;
this.index = [1, 0, 0];
},
mounted() {
// this._initLoad()
},
methods: {
// createSign() {
// let url = "http://sign.hitachics.com/core/r/api/app/fileViewSvc?attachment_id=13435&apiName=download&sysName=HCL_UPLOAD_FILE&access_token="+window.localStorage.access_token_rl
// // this.hlsPopup.showLoading("请稍等");
// window.open(url, "_self");
// },
// 合同下载
downloadContract(id) {
if (id) {
let url =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
id +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
// let url = "http://sign.hitachics.com/core/r/api/app/fileViewSvc?attachment_id=13435&apiName=download&sysName=HCL_UPLOAD_FILE&access_token="+window.localStorage.access_token_rl
window.open(url);
}else{
this.$vux.toast.text("合同id不存在,无法下载!", "middle");
}
},
// 调用微信接口的基础配置
wxConfig() {
let clientUrl = "";
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log("机型:android");
clientUrl = location.href;
}
if (isIOS) {
//这个是ios操作系统
console.log("机型:ios");
clientUrl = location.href.split("#")[0];
}
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage",
"hideOptionMenu"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function() {
wx.hideOptionMenu();
});
});
}
}
};
</script>
<style lang="less" rel="stylesheet">
.electronic-contract-list {
.content {
// overflow: hidden;
font-size: 14px;
.contract-list-item {
height: 60px;
margin: 10px 20px;
border: 1px solid #b2b2b2;
padding: 14px 10px 0 10px;
img {
}
.contract-list-text {
display: inline-block;
margin-left: 30px;
}
}
.footer {
width: 120px;
line-height: 30px;
background-color: #09bb07;
text-align: center;
color: #ffffff;
border-radius: 5px;
margin: 50px auto;
}
}
}
</style>
<template>
<h-view class="public-style electronic-contract-list" title="合同文本清单">
<h-content>
<div style="margin-top:20px">
<div class="contract-list-item" v-for="(item,index) in data" :key="index">
<img src="../../../assets/electronicContract/contract-list.png" alt />
<div class="contract-list-text">
<div>{{item.file_sign_name}}</div>
<p style="color:red;margin-top:3px"></p>
</div>
</div>
</div>
<div class="footer" @click="createSign()">签约</div>
</h-content>
</h-view>
</template>
<script>
export default {
data() {
return {
isModalVisible: false,
con_list: [],
infoShow: {},
info: null,
searchCondition: {
input: null
},
data: []
};
},
components: {},
created() {
this.wxConfig();
if(this.$route.params.itemData){
window.localStorage.unSignData = JSON.stringify(this.$route.params.itemData.un_sign_file_list);
}
// console.log(JSON.parse(window.localStorage.unSignData));
this.data = JSON.parse(window.localStorage.unSignData);
console.log("22222222222", this.data);
this.offsize = 1;
this.pagesize = 10;
this.index = [1, 0, 0];
},
mounted() {
// this._initLoad()
},
methods: {
createSign() {
let goUrl = this.data[0].sign_url
if (goUrl) {
//
this.hlsPopup.showLoading("请稍等");
window.open(goUrl, "_self");
// let url = window.open('http://www.baidu.com','_self');
// if(url == null){
// }
}
else{
this.$vux.toast.text('跳转链接不存在!', "middle");
}
// 打开模态框
},
load_count: function() {
let vm = this;
let url = process.env.basePath + "contract_count";
let param = {};
// hlsPopup.showLoadingWithoutBackdrop();
vm.$post(url, param).then(function(res) {
vm.info = res;
vm.changeData();
});
},
loadMore: function() {
let vm = this;
vm.offsize = vm.offsize + 1;
let url = process.env.basePath + "app_get_contract_selected";
let param = {
offsize: vm.offsize,
searchInput: vm.searchCondition.input
};
vm.$post(url, param).then(function(res) {
let returnData = [];
returnData = res.getContract_list;
if (returnData.length === 0) {
vm.$refs.scroll.update(true);
} else if (returnData.length > 0 && returnData.length < vm.pagesize) {
vum.forEach(returnData, function(data, index, array) {
vm.con_list.push(array[index]);
});
vm.$refs.scroll.update(true);
} else if (returnData.length === vm.pagesize) {
vum.forEach(returnData, function(data, index, array) {
vm.con_list.push(array[index]);
});
vm.$refs.scroll.update(false);
}
});
},
// goContractMainten: function (list) {
// this.$router.push({
// name: 'ContractSign',
// params: {
// contract_id: list.contract_id,
// cdd_list_id: list.cdd_list_id,
// },
// })
// },
// 调用微信接口的基础配置
wxConfig() {
let clientUrl = "";
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log("机型:android");
clientUrl = location.href;
}
if (isIOS) {
//这个是ios操作系统
console.log("机型:ios");
clientUrl = location.href.split("#")[0];
}
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage",
"hideOptionMenu"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function() {
wx.hideOptionMenu();
});
});
}
}
};
</script>
<style lang="less" rel="stylesheet">
.electronic-contract-list {
.content {
// overflow: hidden;
font-size: 14px;
.contract-list-item {
height: 60px;
margin: 10px 20px;
border: 1px solid #b2b2b2;
padding: 14px 10px 0 10px;
img {
}
.contract-list-text {
display: inline-block;
margin-left: 30px;
}
}
.footer {
width: 120px;
line-height: 30px;
background-color: #09bb07;
text-align: center;
color: #ffffff;
border-radius: 5px;
margin: 50px auto;
}
}
}
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<template>
<h-view class="public-style personalRegister" title="个人用户注册">
<h-content>
<list-item class="personalInf" style="padding:20px;height:100%">
<div style="height:40px;border-bottom:1px solid #d0d0d0">
<div
class="personalInf-text"
style=" width: 150px;line-height: 30px;text-align: center;border-radius: 5px;background-color: #ddd;"
>个人信息</div>
</div>
<item style="border-bottom:1px solid #d0d0d0">
<section slot="name">
<img
src="../../../assets/userRegister/people-name.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>姓名
</section>
<input
slot="content"
v-model="personName"
style="text-align: left;"
readonly
/>
</item>
<item style="border-bottom:1px solid #d0d0d0">
<section slot="name">
<img
src="../../../assets/userRegister/idCard.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>身份证号
</section>
<input
slot="content"
v-model="identificationNumber"
style="text-align: left;"
readonly
/>
</item>
<item style="border-bottom:1px solid #d0d0d0">
<section slot="name">
<img
src="../../../assets/userRegister/phone.png"
style="float:left;width:20px;height:20px;margin: 2px 5px 0 0;"
/>手机号码
</section>
<input
slot="content"
v-model="phoneNumber"
style="text-align: left;"
readonly
/>
</item>
<!-- <div style="margin: 40px 0 0 14px;">
<p>请上传身份证照片</p>
</div> -->
<div style="height:100px;margin-top:30px">
<div
style="border:1px solid #b2b2b2;width:140px;height:100%;margin:0 auto;border-radius:5px;position:relative;"
>
<img :src="cardUp" alt class="pic" @click="previewImage()" />
</div>
</div>
<p style="margin-top:10px;text-align:center;">正面</p>
<button
@click="logout()"
style="width:120px;height:30px;border-radius:15px;background-color:#09bb07;color:#FFFFFF;margin:70px 0 0 -60px;position:relative;left:50%;"
>注销</button>
</list-item>
</h-content>
</h-view>
</template>
<script>
import { getUrlParam } from "@/scripts/utils";
export default {
data() {
return {
cardUp: "../../../assets/userRegister/camear.png", //身份证正面url
identificationNumber: "",
phoneNumber: "",
personName: "",
attchmentId: "" //附件预览id
};
},
components: {},
activated: function() {},
updated: function() {},
methods: {
//预览图片
previewImage() {
let vm = this;
hlsPopup.showBigPicture({
imgUrl: vm.cardUp
});
},
logout() {
let vm = this;
let url = process.env.rootPath + "/accounts/outerAccounts/delete";
let param = {
openId: window.localStorage.openId
};
vm.hlsPopup.showLoading("请稍等");
vm.$post(url, param).then(function(res) {
vm.hlsPopup.hideLoading();
if (res.code == 0) {
vm.$vux.toast.text(res.message, "middle");
window.open(
"http://sign.hitachics.com/www/#/UserRegister",
"_self"
);
} else {
vm.$vux.toast.text(res.message, "middle");
}
// vm.$vux.toast.text(res.message, "middle");
});
},
// 调用微信接口的基础配置
wxConfig() {
let clientUrl = "";
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log("机型:android");
clientUrl = location.href;
}
if (isIOS) {
//这个是ios操作系统
console.log("机型:ios");
clientUrl = location.href.split("#")[0];
}
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage",
"hideOptionMenu"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function () {
wx.hideOptionMenu();
})
});
},
},
created() {
this.wxConfig();
var data = this.$route.params.userInfo;
this.personName = data.name;
this.cardUp =
process.env.rootPath +
"/app/fileViewSvc?attachment_id=" +
data.attachmentId +
"&apiName=download&sysName=HCL_UPLOAD_FILE&access_token=" +
window.localStorage.access_token_rl;
this.phoneNumber = data.mobile;
this.identificationNumber = data.idNo;
}
};
</script>
<style lang="less" type="text/less" scoped>
@import "../../../styles/vue-1px.less";
.personalRegister {
font-size: 14px;
.personalInfo {
width: 100%;
height: 100% !important;
}
.uppic {
height: 100%;
width: 100%;
margin: 0 auto;
opacity: 0;
z-index: 1000;
position: absolute;
}
.pic {
width: 100%;
height: 100%;
position: absolute;
}
}
// iPhoneX适配
@media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
.platform-ios {
#home {
}
}
}
// iPhoneX Max适配
@media (device-width: 414px) and (device-height: 896px) {
.platform-ios {
.platform-ios {
#home {
}
}
}
}
</style>
<template>
<div class="uploadCont">
<ul class="showImage">
<li @click="chooseImage">
<img src />
</li>
<li
@click="previewImage(saveImages.previewImageList[index])"
v-for="(item,index) in saveImages.previewThumbList"
:key="index"
>
<img :src="item" />
<button @click.stop @click="remove(index)"></button>
</li>
</ul>
</div>
</template>
<script>
export default {
data() {
return {
userCode: localStorage.userCode || "", //用户code
images: {
localId: [], //已选择的本地图片
serverId: [] //微信服务器返回的mediaId
},
saveImages: {
previewImageList: [], //预览大图数组,
previewThumbList: [], //预览缩略图数组
saveImageList: [] //预览大图数组//保存图片
},
uploadPath: "" //图片上传的路径:为空时,默认下载到当前项目的/mcupload路径下
};
},
methods: {
/**
* 选择图片
*/
chooseImage() {
let _this = this;
wx.chooseImage({
success: function(res) {
//res.localIds 是一个数组 保存了用户一次性选择的所有图片的信息
_this.images.localId = res.localIds; //把图片的路径保存在images[localId]中--图片本地的id信息,用于上传图片到微信浏览器时使用
//alert('已选择 ' + res.localIds.length + '张图片 ');
//===上传
let length = res.localIds.length;
if (length == 0) {
_this.$alert("请选择图片");
return;
}
var i = 0;
_this.images.serverId = [];
function upload() {
wx.uploadImage({
localId: _this.images.localId[i],
success: function(res) {
i++;
_this.images.serverId.push(res.serverId);
//下载刚刚上传的图片
JssdkService.getMediaByUser(
res.serverId,
_this.uploadPath,
_this.userCode,
function(res) {
// alert(res.substr(45));
var path = res.responseParam1.split("mecwish")[1];
var path_thumb = path.replace(
"/mcupload/",
"/mcupload/_thumb/"
);
if (path != null && path.length != 0) {
_this.saveImages.saveImageList.push(path);
_this.saveImages.previewImageList.push(
window.location.protocol +
"//" +
window.location.host +
"/mecwish" +
path
); //将图片上传的位置
_this.saveImages.previewThumbList.push(
window.location.protocol +
"//" +
window.location.host +
"/mecwish" +
path_thumb
); //将缩略图上传的位置
}
}
);
if (i < length) {
upload();
}
},
fail: function(res) {
alert(JSON.stringify(res));
}
});
_this.$emit("saveImages", _this.saveImages.saveImageList);
}
upload();
}
});
},
//预览图片
previewImage(currentImg) {
let _this = this;
wx.previewImage({
current: currentImg, //当前图片
urls: _this.saveImages.previewImageList
});
},
//删除图片,数据库里没删除
remove(index) {
this.$emit("removed", index);
this.saveImages.saveImageList.splice(index, 1);
this.saveImages.previewImageList.splice(index, 1);
this.saveImages.previewThumbList.splice(index, 1);
}
},
created() {
let _this = this;
let clientUrl = location.href;
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.error(function(res) {
this.$alert(res.errMsg);
});
});
}
};
</script>
<style scoped>
.uploadCont .showImage {
display: flex;
list-style: none;
flex-wrap: wrap;
margin: 7px 0 5px 10px;
}
.uploadCont .showImage li {
position: relative;
width: 28vw;
height: 28vw;
list-style: none;
/*background: #f00;*/
margin: 5px 2vw 7px 0;
}
.uploadCont .showImage .remove {
z-index: 11;
position: absolute;
top: -14px;
right: -20px;
font-size: 26px;
}
.uploadCont .showImage img {
width: 28vw;
height: 28vw;
}
</style>
\ No newline at end of file
<template>
<div>
<h1>图片上传</h1>
<img :src="imgURL" style="width: 90px;height: 90px" @click="addVipImage()" alt="点击上传图片"/>
</div>
</template>
<script>
export default {
data() {
return {
URL: "",
serverPrefix: "后台获取微信参数的接口地址?url=",
imgURL: "",
defaultUrl:"../../../assets/userRegister/people-name.png",
serverId:""
};
},
methods: {
wxConfig() {
let clientUrl = '';
// let ua = navigator.userAgent.toLowerCase();
let u = navigator.userAgent;
let isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log('机型:android');
clientUrl = location.href
}
if (isIOS) {
  //这个是ios操作系统
console.log('机型:ios');
clientUrl = encodeURIComponent(location.href.split('#')[0]);
}
// let clientUrl = encodeURIComponent(location.href);
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
});
},
addVipImage: function() {
console.log("11111111");
let self = this;
wx.chooseImage({
count: 1, //张数, 默认9
sizeType: ["compressed"], //建议压缩图
sourceType: ["album", "camera"], // 来源是相册、相机
success: function(res) {
self.imgURL = res.localIds[0];
self.uploadToWeixinServer(res.localIds[0]);
}
});
},
//预览图片
previewImage(currentImg) {
let _this = this;
wx.previewImage({
current: currentImg, //当前图片
urls: _this.saveImages.previewImageList
});
},
//删除图片,数据库里没删除
// remove(index) {
// this.$emit("removed", index);
// this.saveImages.saveImageList.splice(index, 1);
// this.saveImages.previewImageList.splice(index, 1);
// this.saveImages.previewThumbList.splice(index, 1);
// },
uploadToWeixinServer(localId) {
let self = this;
wx.uploadImage({
localId: localId,
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function(res) {
//res.serverId 返回图片的微信服务器端ID
console.log('上传图片后返回的信息',res)
self.serverId = res.serverId;
}
});
}
},
created() {
this.wxConfig();
}
};
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<h-view class="public-style userRegister" title="用户注册">
<h-content>
<list-item class="reg-content">
<div class="reg-entry">
<div
style="margin-right:10px"
:class="['item-entry',{'add-bg-color':isClick1}]"
@click="goPersonalPage()"
>
<img src="../../../assets/userRegister/people.png" v-show="isHighLight" />
<img src="../../../assets/userRegister/people-light.png" v-show="!isHighLight" />
<span class="text-entry">个人</span>
</div>
<div :class="['item-entry',{'add-bg-color':isClick2}]" @click="goCompanyPage()">
<img src="../../../assets/userRegister/company.png" v-show="isHighLight1" />
<img src="../../../assets/userRegister/company-light.png" v-show="!isHighLight1" />
<span class="text-entry">企业</span>
</div>
</div>
<div class="tips">
<p class="tips-item">
<img src="../../../assets/userRegister/tips.png" alt />
<span>温馨提示:</span>
</p>
<p class="tips-item">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您可选择用户类型进行用户信息注册及实名认证。</p>
</div>
</list-item>
<!-- <div @click="goJump()">测试跳转</div> -->
</h-content>
</h-view>
</template>
<script>
import { getUrlParam } from "@/scripts/utils";
export default {
data() {
return {
isClick1: false,
isClick2: false,
isHighLight: true,
isHighLight1: true,
isReadOnlyPersonal: true,
isReadOnlyCompany: false,
userInfo: null,
userInfo1: null,
ctitype: ""
};
},
components: {},
activated: function() {
// console.log(1111111111111111111111)
// if (window.localStorage.openId) {
// this.getUserInfo('1111');
// };
},
created() {
this.wxConfig();
if (window.localStorage.openId) {
this.getUserInfo();
}
},
updated: function() {},
methods: {
// 获取token
// getToken() {
// let vm = this;
// let url = process.env.loginPathRl + "admin";
// let param = {};
// return vm.hlsHttp.post(url, param).then(function(res) {
// window.localStorage.setItem("access_token_rl", res.access_token);
// });
// },
// 获取openId
// getOpenId(code) {
// let vm = this;
// let url = process.env.basePathRl + "getOpenId";
// let param = {
// apiKey: "handexinxi",
// code: code
// };
// vm.hlsHttp.post(url, param).then(function(res) {
// // console.log(1111111)
// // window.localStorage.openId = "oBdoRwI9gj9Brbe9iqlDCg5G2dDc";
// // window.localStorage.openId = "oBdoRwFp6UN_KzchaPIEPynR9poM"
// // if(window.localStorage.openId){
// // vm.getUserInfo();
// // }
// if (res.resultCode == "00") {
// window.localStorage.openId = res.result;
// if (window.localStorage.openId) {
// vm.getUserInfo();
// }
// } else {
// return;
// }
// });
// },
goPersonalPage() {
this.isClick1 = true;
this.isClick2 = false;
this.isHighLight = false;
this.isHighLight1 = true;
// console.log('hddhhshshshsh',this.isReadOnlyPersonal)
if (this.ctitype) {
if (this.ctitype == 1) {
if (this.isReadOnlyPersonal) {
this.$router.push({
name: "ReadonlyPersonalReg",
params: {
userInfo: this.userInfo
}
});
} else {
this.$router.push({
name: "PersonalRegister",
params: {
userInfo: this.userInfo
}
});
}
} else if (this.ctitype == null) {
this.$router.push({
name: "PersonalRegister",
params: {
userInfo: this.userInfo
}
});
} else {
return;
}
} else {
this.$router.push({
name: "PersonalRegister"
});
}
},
goCompanyPage() {
this.isClick2 = true;
this.isClick1 = false;
this.isHighLight1 = false;
this.isHighLight = true;
if (this.ctitype) {
if (this.ctitype == 2) {
if (this.isReadOnlyCompany) {
this.$router.push({
name: "ReadonlyCompanyReg",
params: {
userInfo: this.userInfo1
}
});
} else {
this.$router.push({
name: "CompanyRegister"
});
}
} else if (this.ctitype == null) {
this.$router.push({
name: "CompanyRegister"
});
} else {
return;
}
} else {
this.$router.push({
name: "CompanyRegister"
});
}
},
getUserInfo() {
let vm = this;
let url =
process.env.rootPath +
"/sign/info/hclc/query/by/openid?openId=" +
window.localStorage.openId;
vm.hlsPopup.showLoading("请稍等");
vm.$post(url).then(function(res) {
vm.hlsPopup.hideLoading();
if (res.rows) {
if (res.rows.length > 0) {
console.log(res.rows);
var results = res.rows[0];
vm.ctitype = results.ctitype;
if (results.ctitype == 1) {
vm.userInfo = results;
} else if (results.ctitype == 2) {
vm.userInfo1 = results;
}
if (results.ctitype == 1 && results.faceAuthStatus == "SUCCESS") {
vm.isReadOnlyPersonal = true;
} else if (
results.ctitype == 2 &&
results.faceAuthStatus == "SUCCESS" &&
results.orgAuthStatus == "SUCCESS"
) {
vm.isReadOnlyCompany = true;
} else {
return;
}
}
}
});
},
// 调用微信接口的基础配置
wxConfig() {
let clientUrl = "";
let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //g
let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid) {
//这个是安卓操作系统
console.log("机型:android");
clientUrl = location.href;
}
if (isIOS) {
//这个是ios操作系统
console.log("机型:ios");
clientUrl = location.href.split("#")[0];
}
// let url = $config.rootPath + '/js/sdk/getWxConfig?wxCode=' + $config.wxCode + '&clientUrl=' + clientUrl
let url = process.env.basePathRl + "getSignature";
let param = {
apiKey: "handexinxi",
url: clientUrl
};
hlsHttp.post(url, param).then(function(res) {
wx.config({
beta: true,
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.result.appId, // 必填,公众号的唯一标识
timestamp: res.result.timestamp, // 必填,生成签名的时间戳
nonceStr: res.result.nonceStr, // 必填,生成签名的随机串
signature: res.result.signature, // 必填,签名,见附录1
jsApiList: [
"chooseImage",
"previewImage",
"downloadImage",
"getLocalImgData",
"uploadImage",
"hideOptionMenu"
] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
wx.ready(function() {
wx.hideOptionMenu();
});
});
}
}
};
</script>
<style lang="less" type="text/less">
@import "../../../styles/vue-1px.less";
.userRegister {
.reg-content {
padding: 20px;
padding-top: 150px;
.reg-entry {
display: -webkit-flex;
display: flex;
.add-bg-color {
background-color: #999999;
color: #fffff !important;
}
.item-entry {
width: 50%;
border: 1px solid #ddd;
position: relative;
border-radius: 5px;
img {
width: 50px;
height: 50px;
margin: 10px;
}
.text-entry {
position: absolute;
top: 30px;
right: 30%;
}
}
}
.tips {
margin-top: 70px;
margin-left: 30px;
color: #999999;
font-size: 12px;
.tips-item {
line-height: 24px;
}
img {
width: 22px;
height: 22px;
margin-right: 15px;
}
}
}
}
// iPhoneX适配
@media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
.platform-ios {
#home {
}
}
}
// iPhoneX Max适配
@media (device-width: 414px) and (device-height: 896px) {
.platform-ios {
.platform-ios {
#home {
}
}
}
}
</style>
This diff is collapsed.
......@@ -418,7 +418,7 @@ export default {
hlsPopup.showSuccess('操作成功')
},
showError () {
hlsPopup.showError('操作失败')
// hlsPopup.showError('操作失败')
},
showConfirm () {
hlsPopup.showConfirm({
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment