Commit bc1342f7 by 万亚飞

fix

parent a7e1d712
...@@ -23,7 +23,7 @@ class App extends React.Component { ...@@ -23,7 +23,7 @@ class App extends React.Component {
vc(); vc();
let newObj = this.analysisQuery(); let newObj = this.analysisQuery();
if (newObj && newObj.uid) { if (newObj && newObj.uid) {
storage.setSS('urlQuery', this.analysisQuery()); storage.setSS('appInfo', this.analysisQuery());
} }
} }
componentDidMount() {} componentDidMount() {}
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { ImagePicker } from 'antd-mobile'; import { ImagePicker, Modal } from 'antd-mobile';
import app from '../../../static/js/native'; import { isIOS } from '@/utils/tools';
import storage from '@/utils/storage.plugin';
import { PhotoSwipeGallery } from 'react-photoswipe'; import { PhotoSwipeGallery } from 'react-photoswipe';
import * as qiniu from 'qiniu-js'; import * as qiniu from 'qiniu-js';
import API from './api'; import API from './api';
import 'react-photoswipe/lib/photoswipe.css'; import '@/static/styles/photoswipe.css';
class UpLoad extends Component { class UpLoad extends Component {
state = { state = {
isOpen: false, isOpen: false,
maxSelectImageNumber: 1, //上传文件数 maxSelectImageNumber: 1, //上传文件数
// certificateFiles: [], // certificateFiles: [],
ViewImagesIndex: 0 ViewImagesIndex: 0,
appInfo: null
// viewImages: [] //查看大图list // viewImages: [] //查看大图list
}; };
componentDidMount() { componentDidMount() {
// appBridge({ this.setState({
// name: 'action_needLoad', appInfo: storage.getSS('appInfo')
// option: { });
// needLoad: false
// }
// });
} }
// 获取随机字符串 // 获取随机字符串
random_string(len = 32) { random_string(len = 32) {
...@@ -125,7 +124,19 @@ class UpLoad extends Component { ...@@ -125,7 +124,19 @@ class UpLoad extends Component {
return ( return (
<div className="photo-wrap"> <div className="photo-wrap">
<ImagePicker accept="image/png, image/jpeg, image/jpg" files={certificateFiles} onChange={this.certificateChange} onImageClick={this.onImageClickFun} selectable={certificateFiles.length < maxSelectImageNumber} /> <ImagePicker
onAddImageClick={e => {
if (this.state.appInfo.v <= '2.2.50' && isIOS) {
e.preventDefault();
Modal.alert('您的APP版本太低,升级后可使用上传图片功能');
}
}}
accept="image/png, image/jpeg, image/jpg"
files={certificateFiles}
onChange={this.certificateChange}
onImageClick={this.onImageClickFun}
selectable={certificateFiles.length < maxSelectImageNumber}
/>
<PhotoSwipeGallery items={viewImages} isOpen={isOpen} thumbnailContent={this.getThumbnailContent} options={{ closeOnScroll: false }} onClose={this.closePhoto} /> <PhotoSwipeGallery items={viewImages} isOpen={isOpen} thumbnailContent={this.getThumbnailContent} options={{ closeOnScroll: false }} onClose={this.closePhoto} />
</div> </div>
); );
......
...@@ -74,7 +74,6 @@ class Page extends Component { ...@@ -74,7 +74,6 @@ class Page extends Component {
} }
qiniuNext(res) { qiniuNext(res) {
// console.log("qiniuNext >>>>>>>") // console.log("qiniuNext >>>>>>>")
// console.log(res)
} }
qiniuError(err) { qiniuError(err) {
this.props.refresh({ this.props.refresh({
......
...@@ -39,7 +39,6 @@ class TrainItem extends Component { ...@@ -39,7 +39,6 @@ class TrainItem extends Component {
</span> </span>
<span <span
onClick={() => { onClick={() => {
console.log(this.props.history);
if (data.auditStatus == 1) return; if (data.auditStatus == 1) return;
if (iType === 3) { if (iType === 3) {
linkTo(`/new/user/train/${data.id}?modifyId=${data.modifyId}`); linkTo(`/new/user/train/${data.id}?modifyId=${data.modifyId}`);
......
...@@ -20,7 +20,7 @@ export default class Layout extends Component { ...@@ -20,7 +20,7 @@ export default class Layout extends Component {
vc(); vc();
let newObj = this.analysisQuery(); let newObj = this.analysisQuery();
if (newObj && newObj.uid) { if (newObj && newObj.uid) {
storage.setSS('urlQuery', this.analysisQuery()); storage.setSS('appInfo', this.analysisQuery());
} }
// ENV === 'development' && storage.setLS('uid', 13090225); // ENV === 'development' && storage.setLS('uid', 13090225);
} }
......
...@@ -6,14 +6,13 @@ import { Toast } from 'antd-mobile'; ...@@ -6,14 +6,13 @@ import { Toast } from 'antd-mobile';
import { getParameterByName } from '../utils/common'; import { getParameterByName } from '../utils/common';
export default function ajax(apiKey, options) { export default function ajax(apiKey, options) {
const userInfo = storage.getSS('urlQuery'); const userInfo = storage.getSS('appInfo');
const uinfo = userInfo const uinfo = userInfo
? { ? {
uid: userInfo.uid, uid: userInfo.uid,
accessToken: userInfo.accessToken accessToken: userInfo.accessToken
} }
: ''; : '';
// console.log(uid);
const option = Object.assign( const option = Object.assign(
{}, {},
{ {
......
...@@ -102,7 +102,7 @@ export default class DepositPay extends Component { ...@@ -102,7 +102,7 @@ export default class DepositPay extends Component {
} }
componentDidMount() { componentDidMount() {
const userInfo = storage.getSS('urlQuery'); const userInfo = storage.getSS('appInfo');
this.setState({ this.setState({
userInfo userInfo
}); });
......
...@@ -39,7 +39,6 @@ export default class DepositPay extends Component { ...@@ -39,7 +39,6 @@ export default class DepositPay extends Component {
fetchData = () => { fetchData = () => {
fetch('myDeposit', { fetch('myDeposit', {
success: result => { success: result => {
console.log(result);
let { cateDepositAmount, cateMeetRequired, qualityDepositAmount, qualityDepositDeficiency } = result.data; let { cateDepositAmount, cateMeetRequired, qualityDepositAmount, qualityDepositDeficiency } = result.data;
this.setState({ this.setState({
depositMoney: cateDepositAmount, //类目保证金 depositMoney: cateDepositAmount, //类目保证金
......
...@@ -13,7 +13,6 @@ import { getParameterByName } from '../../utils/common'; ...@@ -13,7 +13,6 @@ import { getParameterByName } from '../../utils/common';
import '@/static/styles/user/train-list.less'; import '@/static/styles/user/train-list.less';
function AddView(props) { function AddView(props) {
console.log(props);
return ( return (
<div className="bottom-operate"> <div className="bottom-operate">
<a <a
...@@ -147,7 +146,6 @@ class JobList extends Component { ...@@ -147,7 +146,6 @@ class JobList extends Component {
}; };
render() { render() {
const { authList, backList, honorList, delDialogObj, tabIndex } = this.state; const { authList, backList, honorList, delDialogObj, tabIndex } = this.state;
console.log(tabIndex);
// title="执业背景" // title="执业背景"
return ( return (
<div> <div>
......
...@@ -29,7 +29,6 @@ class Train extends Component { ...@@ -29,7 +29,6 @@ class Train extends Component {
}; };
//初始化图片 //初始化图片
initImgs(imgs) { initImgs(imgs) {
console.log('initImgs', imgs);
let viewArr = [], let viewArr = [],
creArr = []; creArr = [];
const _this = this; const _this = this;
...@@ -161,7 +160,7 @@ class Train extends Component { ...@@ -161,7 +160,7 @@ class Train extends Component {
fetch(subType, { fetch(subType, {
data: param, data: param,
success: res => { success: res => {
Toast.info(`${str}成功,请刷新列表页查看`); Toast.info(`${str}成功`);
fetch('fetchTrainList', { fetch('fetchTrainList', {
loading: false loading: false
}); });
......
...@@ -23,7 +23,7 @@ class TrainList extends Component { ...@@ -23,7 +23,7 @@ class TrainList extends Component {
document.title = '受训背景'; document.title = '受训背景';
app().downRefresh(true); app().downRefresh(true);
app().notRefresh(true); app().notRefresh(true);
const userInfo = storage.getSS('urlQuery'); const userInfo = storage.getSS('appInfo');
this.setState({ this.setState({
userInfo userInfo
}); });
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Toast, Modal } from 'antd-mobile'; import { Toast, Modal } from 'antd-mobile';
import Layout from '../../Components/static/Layout/Layout';
import { MATERIAL_ARR } from '../../static/js/constant'; import { MATERIAL_ARR } from '../../static/js/constant';
import { getParam, getImgNaturalDimensions, linkTo } from '../../utils/tools'; import { getParam, getImgNaturalDimensions, linkTo } from '../../utils/tools';
import UpLoad from '../../Components/common/Upload/Upload'; import UpLoad from '../../Components/common/Upload/Upload';
...@@ -64,7 +63,6 @@ class AddMaterial extends Component { ...@@ -64,7 +63,6 @@ class AddMaterial extends Component {
} }
initImgs = imgs => { initImgs = imgs => {
console.log('initImgs', imgs);
let viewArr = [], let viewArr = [],
creArr = []; creArr = [];
const _this = this; const _this = this;
...@@ -109,7 +107,6 @@ class AddMaterial extends Component { ...@@ -109,7 +107,6 @@ class AddMaterial extends Component {
} else { } else {
Toast.info('上传图片失败,请重试', 2); Toast.info('上传图片失败,请重试', 2);
} }
console.log(res);
}; };
delFile = () => { delFile = () => {
this.setState({ this.setState({
...@@ -160,7 +157,7 @@ class AddMaterial extends Component { ...@@ -160,7 +157,7 @@ class AddMaterial extends Component {
fetch(`${subType}${this.state.materialType}`, { fetch(`${subType}${this.state.materialType}`, {
data: param, data: param,
success: res => { success: res => {
Toast.info(`${str}成功,请刷新列表页查看`); Toast.info(`${str}成功`);
fetch('fetchJobList', { fetch('fetchJobList', {
loading: false loading: false
}); });
......
...@@ -179,16 +179,11 @@ export default function() { ...@@ -179,16 +179,11 @@ export default function() {
var ua = window.navigator.userAgent.toLowerCase(); var ua = window.navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == 'micromessenger') { if (ua.match(/MicroMessenger/i) == 'micromessenger') {
// console.log('微信')
return 'wx'; return 'wx';
} else { } else {
// console.log('非微信')
if (isiOS) { if (isiOS) {
console.log('iOS');
return 'iOS'; return 'iOS';
} else if (isAndroid) { } else if (isAndroid) {
console.log('isAndroid');
return 'Android'; return 'Android';
} else { } else {
console.log('非微信web', ua); console.log('非微信web', ua);
...@@ -204,7 +199,6 @@ export default function() { ...@@ -204,7 +199,6 @@ export default function() {
* connectWebViewJavascriptBridge * connectWebViewJavascriptBridge
* ***/ * ***/
function connectWebViewJavascriptBridge(callback) { function connectWebViewJavascriptBridge(callback) {
console.log('connectWebViewJavascriptBridge');
if (window.WebViewJavascriptBridge) { if (window.WebViewJavascriptBridge) {
callback(WebViewJavascriptBridge); callback(WebViewJavascriptBridge);
} else { } else {
...@@ -217,18 +211,11 @@ export default function() { ...@@ -217,18 +211,11 @@ export default function() {
); );
} }
} }
window.sendDataToOC = function(params) {}; window.sendDataToOC = function(params) {};
console.log('system', browser);
if (browser == 'iOS') { if (browser == 'iOS') {
console.log('isIos');
connectWebViewJavascriptBridge(function(bridge) { connectWebViewJavascriptBridge(function(bridge) {
bridge.init(function(message, responseCallback) {}); bridge.init(function(message, responseCallback) {});
bridge.registerHandler('javascriptHandler', function(data, responseCallback) {}); bridge.registerHandler('javascriptHandler', function(data, responseCallback) {});
console.log('isIos2222');
window.sendDataToOC = function(params) { window.sendDataToOC = function(params) {
bridge.callHandler('javascriptHandler', params, function(response) { bridge.callHandler('javascriptHandler', params, function(response) {
if (typeof response.uid == 'undefined') { if (typeof response.uid == 'undefined') {
...@@ -253,7 +240,6 @@ export default function() { ...@@ -253,7 +240,6 @@ export default function() {
function sendDataToExp(params) { function sendDataToExp(params) {
try { try {
if (browser == 'iOS') { if (browser == 'iOS') {
console.log('postMessage', params);
window.webkit.messageHandlers.MModel.postMessage(params); window.webkit.messageHandlers.MModel.postMessage(params);
} else { } else {
var a = ''; var a = '';
...@@ -281,37 +267,20 @@ export default function() { ...@@ -281,37 +267,20 @@ export default function() {
}; };
params.cmd.action_name = 'action_needLoad'; params.cmd.action_name = 'action_needLoad';
params.url = 'ydl_app'; params.url = 'ydl_app';
console.log('notRefresh,2.2.50');
sendDataToExp(params); sendDataToExp(params);
}; };
// 跳转到m站
native.openApp = function() {
console.log('openApp');
setTimeout(function() {
var parmas = {};
parmas.url = 'ydl-user://confide/home';
sendDataToOC(parmas);
}, 300);
};
native.goPage = function(url) { native.goPage = function(url) {
setTimeout(function() { setTimeout(function() {
var parmas = { var params = {
url: 'http', url: 'http',
cmd: { cmd: {
params: { url: url }, action_name: '',
action_name: '' params: { url: url }
} }
}; };
sendDataToExp(parmas); sendDataToExp(params);
}, 300); }, 300);
}; };
native.toPage = function(url) {
sendDataToExp(url);
};
native.setParams = function(action_name, params, _url) {
setParams(action_name, params, _url);
};
native.gotoOCChat = function(args) { native.gotoOCChat = function(args) {
const params = { const params = {
cmd: { cmd: {
...@@ -331,7 +300,6 @@ export default function() { ...@@ -331,7 +300,6 @@ export default function() {
url: _url url: _url
} }
}; };
console.log(data);
sendDataToExp(data); sendDataToExp(data);
}; };
return native; return native;
......
...@@ -637,7 +637,7 @@ textarea::placeholder { ...@@ -637,7 +637,7 @@ textarea::placeholder {
background: black; background: black;
} }
/*常用按钮*/ /*常用按钮*/
btn.active, .btn.active,
.btn:active { .btn:active {
background-image: none; background-image: none;
outline: 0; outline: 0;
...@@ -912,6 +912,9 @@ textarea::placeholder { ...@@ -912,6 +912,9 @@ textarea::placeholder {
.am-toast-notice-content .am-toast-text { .am-toast-notice-content .am-toast-text {
min-width: 100px; min-width: 100px;
} }
.am-modal-title {
line-height: 1.4;
}
.am-modal { .am-modal {
margin-bottom: 60px; margin-bottom: 60px;
} }
...@@ -927,11 +930,11 @@ textarea::placeholder { ...@@ -927,11 +930,11 @@ textarea::placeholder {
.am-button { .am-button {
height: 45px; height: 45px;
line-height: 45px; line-height: 45px;
} &[disabled] {
.am-button[disabled] { background-color: #ddd;
background-color: #ddd; &::before {
&::before { border: 1px solid #ddd !important;
border: 1px solid #ddd !important; }
} }
} }
......
...@@ -54,9 +54,14 @@ export function getImgNaturalDimensions(imgSrc, callback) { ...@@ -54,9 +54,14 @@ export function getImgNaturalDimensions(imgSrc, callback) {
} }
export function linkTo(url) { export function linkTo(url) {
location.href = url; location.href = url;
// alert(`${location.origin}${url}`); // history.pushState(null, 'hello', `${location.origin}${url}`);
// alert(`${location.origin}${url}`); // window.webkit.messageHandlers.MModel.postMessage({
// url: 'http',
// cmd: {
// action_name: '',
// params: { url: 'https://testh2.yidianling.com/new/user/train?uid=13089811&ts=1559025371&sign=39549b2a339e5a56bbb8a1d2bb594d67&accessToken=d86ec45b5fcf9cd1a10dfaa17b527d67MTkwNTIwv=2.3.00&uid=13089811&ts=1559025371&sign=fe3e41e54912f6e5d366b346eaccfd2d&accessToken=d86ec45b5fcf9cd1a10dfaa17b527d67MTkwNTIw' }
// }
// });
// app().goPage(`${location.origin}${url}`); // app().goPage(`${location.origin}${url}`);
// alert(`${location.origin}${url}`);
// app().gotoOCChat('壹点零', `${location.origin}${url}`); // app().gotoOCChat('壹点零', `${location.origin}${url}`);
} }
...@@ -65,7 +65,7 @@ export default function() { ...@@ -65,7 +65,7 @@ export default function() {
lastZ = z; // 赋值,为下一次计算做准备 lastZ = z; // 赋值,为下一次计算做准备
} }
} }
if (root.DeviceMotionEvent && !navigator.userAgent.match(/OS 8/)) { if (root.DeviceMotionEvent && !navigator.userAgent.match(/OS 8/) && location.hostname.match('test')) {
styleDom = document.createElement('style'); styleDom = document.createElement('style');
// styleDom.innerText = '#__vconsole{display:none}'; // styleDom.innerText = '#__vconsole{display:none}';
document.head.appendChild(styleDom); document.head.appendChild(styleDom);
......
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