Commit e27d5638 authored by 黄媛媛's avatar 黄媛媛

update

parent 16a377ee
......@@ -46,7 +46,8 @@ import PAGE_CONFIG from './config/pageConfig.js'
const { Provider } = WeAppRedux;
const store = createStore(reducer) // redux store
let md5 = require('utils/md5.js')
let netUrl = 'http://testapi.oytour.com/api/common/post';
App(
Provider(store)(
{
......@@ -85,7 +86,52 @@ App(
height: systemInfo.windowHeight
}
this.globalData.isPushBeCallPage = false
}
},
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9',
// 请求接口
$api: function (url, data) {
var promise = new Promise((resolve, reject) => {
wx.showLoading({
title: '加载中',
});
let timestamp = (new Date()).valueOf()
let sign = md5('cmd=' + url + '&' + 'msg=' + encodeURIComponent(data).toLowerCase() + '&' + 'timestamp=' + timestamp + '&' + 'token=' + "" + '&' + 'key=' + '')
wx.request({
url: netUrl,
method: 'POST',
data: {
cmd: url,
msg: data,
timestamp: timestamp,
token: "",
sign: sign
},
success(res) {
wx.hideLoading()
if (res.data.resultCode === 1) {
resolve(res.data.data);
} else if (res.data.resultCode === 10000 || res.data.resultCode === 10001) {
// wx.navigateTo({
// url: '/pages/login/login'
// })
wx.showToast({
title: res.data.message,
icon: 'none',
duration: 1000
})
} else {
wx.showToast({
title: res.data.message,
icon: 'none',
duration: 1000
})
reject(res.data)
}
}
})
})
return promise;
},
}
)
)
{
"pages": [
"pages/msg/index/index",
"pages/index/index",
"pages/msg/index/index",
"pages/welcome/welcome",
"pages/validateForm/validate/validate",
"pages/validateForm/validateEnd/validateEnd",
"pages/logs/logs",
"pages/me/index",
"pages/video/index"
"pages/video/index",
"pages/webview/webview"
],
"window": {
"backgroundTextStyle": "light",
......
......@@ -2,6 +2,7 @@
//index.js
//获取应用实例
const app = getApp()
var util = require('../../utils/util.js')
Page({
data: {
......@@ -13,7 +14,19 @@ Page({
vertical: false,
autoplay: false,
interval: 2000,
duration: 500
duration: 500,
loginState:true,
dataInfo:{},
todayMsg:{
ConfigId:0,
TCID:'',
// Date: util.YYMMDD(new Date()),
Date: '2019-11 - 02',
},
todayList:[],
contactState:true,
contactInfo:{},
},
//事件处理函数
bindViewTap: function() {
......@@ -22,35 +35,131 @@ Page({
// })
},
onLoad: function () {
if (app.globalData.userInfo) {
// if (app.globalData.userInfo) {
// this.setData({
// userInfo: app.globalData.userInfo,
// hasUserInfo: true
// })
// } else if (this.data.canIUse){
// // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// // 所以此处加入 callback 以防止这种情况
// app.userInfoReadyCallback = res => {
// this.setData({
// userInfo: res.userInfo,
// hasUserInfo: true
// })
// }
// } else {
// // 在没有 open-type=getUserInfo 版本的兼容处理
// wx.getUserInfo({
// success: res => {
// app.globalData.userInfo = res.userInfo
// this.setData({
// userInfo: res.userInfo,
// hasUserInfo: true
// })
// }
// })
// }
let that=this;
let userInfo = (wx.getStorageSync('userInfo'))
if (userInfo){
that.setData({
userInfo:userInfo,
loginState:false
})
}
that.getData();
},
closeState(e){
this.setData({
contactState:true,
})
},
noThing(e){
},
goWeb(e){
let info = e.currentTarget.dataset.item;
let name = info.Name;
wx.navigateTo({
url: '/pages/webview/webview?name='+name
})
},
getContact(e){
let info = e.currentTarget.dataset.item;
let type = e.currentTarget.dataset.type;
let contactInfo = this.data.contactInfo;
contactInfo.type = type;
if(type==1){
contactInfo.Name = info.Surname + info.Name;
contactInfo.MobilePhone = info.MobilePhone;
contactInfo.LdNum = info.LdNum;
contactInfo.LdPhoto = info.LdPhoto;
}
if (type == 2) {
contactInfo.Name = info.Surname + info.Name;
contactInfo.MobilePhone = info.MobilePhone;
contactInfo.DyNum = info.DyNum;
contactInfo.LdPhoto = info.DyPhoto;
}
if (type == 3) {
contactInfo.Name = info.Contact;
contactInfo.MobilePhone = info.ContactNumber;
contactInfo.DyNum =info.CustomerNum;
contactInfo.LdPhoto = info.CustomerPhoto;
}
this.setData({
contactState:false,
contactInfo: contactInfo,
})
},
getData(){
let userInfo = this.data.userInfo;
let msg={
ConfigId:0,
TCID:'7003',
OrderId: userInfo.OrderId ? userInfo.OrderId:'',
CityId: userInfo.DepartureCityId ? userInfo.DepartureCityId:''
};
app.$api('b2b_get_GetMXYTravelIndexInfo', msg).then(res => {
if (res.CityList.length>0){
res.CityList.forEach(item=>{
item.all = parseInt(item.Score);
item.grey = 5- parseInt(item.Score);
})
}
let todayMsg = this.data.todayMsg;
todayMsg.ConfigId = res.configId;
todayMsg.TCID = res.tcid;
this.setData({
userInfo: app.globalData.userInfo,
hasUserInfo: true
dataInfo:res,
todayMsg: todayMsg
})
} else if (this.data.canIUse){
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
app.userInfoReadyCallback = res => {
this.getToday();
}).catch(err => { })
},
getToday(){
let todayMsg = this.data.todayMsg;
app.$api('b2b_get_GetMXYToDayTourList', todayMsg).then(res => {
if (res.Status==1){
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
todayList: res.List
})
}
} else {
// 在没有 open-type=getUserInfo 版本的兼容处理
wx.getUserInfo({
success: res => {
app.globalData.userInfo = res.userInfo
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
})
}
})
}
}).catch(err => { })
},
goCard(){
wx.navigateTo({
url: '/pages/validateForm/validate/validate'
})
},
getUserInfo: function(e) {
console.log(e)
app.globalData.userInfo = e.detail.userInfo
this.setData({
userInfo: e.detail.userInfo,
......
This diff is collapsed.
......@@ -29,18 +29,22 @@
margin-top:150rpx;
}
.titleContent .qhd{
position: absolute;
border: 2rpx solid #FF3166;
color: #FF3166;
right: 30rpx;
top: 15rpx;
display: inline-block;
width:128rpx;
height:60rpx;
text-align: center;
line-height:60rpx;
border-radius:30rpx;
text-align: center;
font-size: 24rpx;
margin-top: 30rpx;
position: absolute;
right: 20rpx;
top: -8rpx;
}
.titleContent .qhd text{
width:128rpx;
height:60rpx;
display: inline-block;
border: 2rpx solid #FF3166;
color: #FF3166;
border-radius: 40rpx;
}
.Index .titleView {
font-size: 34rpx;
......@@ -57,10 +61,14 @@
.headView .scroll-header .scroll-view-item {
height: 390rpx;
width:604rpx;
border: 1px solid red;
display: inline-block;
position: relative;
margin-right: 30rpx;
overflow: hidden;
}
.headView .scroll-header .scroll-view-item .image{
max-width: 100%;
min-height:100%;
}
.headView .scroll-header .scroll-view-item:last-child{
margin-right: 0;
......@@ -174,6 +182,16 @@
align-items: center;
justify-content: center;
flex-direction: column;
overflow: hidden;
}
.XcView .scroll-header .scroll-view-item image{
min-height: 100%;
width: 100%;
position: absolute;
}
.XcView .scroll-header .scroll-view-item text{
position: relative;
z-index: 100;
}
.XcView .scroll-header .scroll-view-item:last-child{
margin-right: 0;
......@@ -233,4 +251,57 @@
background: #F5F5F5;
border-radius:20rpx;
}
.ContactTc{
position: fixed;
z-index: 100;
background:rgba(0,0,0,0.5);
width: 100%;
height:100%;
top: 0;
left: 0;
}
.ContactTc .contentView{
width:560rpx;
height:640rpx;
background:rgba(255,255,255,1);
border-radius:20rpx;
margin: 0 auto;
margin-top: 290rpx;
position: relative;
text-align: center;
}
.ContactTc .contentView .photo{
width:150rpx;
height:150rpx;
border-radius:50%;
top: -75rpx;
position: absolute;
left: 200rpx;
}
.ContactTc .contentView .lxView{
width:440rpx;
height:90rpx;
line-height:90rpx;
background:rgba(255,49,102,1);
border-radius:45rpx;
text-align: center;
display: inline-block;
font-size: 30rpx;
margin-top: 80rpx;
color:#fff;
position: relative;
}
.ContactTc .contentView .typeView{
width:60rpx;
height:32rpx;
line-height:32rpx;
background:rgba(255,49,102,0.3);
border-radius:16rpx;
color:#FF3166;
font-size: 20rpx;
text-align: center;
display: inline-block;
margin-left: 15rpx;
}
{
"usingComponents": {}
"usingComponents": {},
"navigationStyle": "custom"
}
\ No newline at end of file
{
"usingComponents": {}
"navigationStyle": "custom"
}
\ No newline at end of file
......@@ -3,11 +3,11 @@
<text class="h1">选择身份核对</text>
<text class="h3">尊敬的客人,为保障您能获取到真实的团队信息</text>
</view>
<view class="ci idcard {{chosenType==0?'active':''}}" bindtap="changeChosenType" data-type="0">
<view class="ci idcard {{chosenType==1?'active':''}}" bindtap="changeChosenType" data-type="1">
<text class="h2">身份证</text>
<text class="h6">ID CARD</text>
</view>
<view class="ci parpt {{chosenType==1?'active':''}}" bindtap="changeChosenType" data-type="1">
<view class="ci parpt {{chosenType==2?'active':''}}" bindtap="changeChosenType" data-type="2">
<text class="h2">护照</text>
<text class="h6">PASSPORT</text>
</view>
......
// pages/validateForm/validateEnd/validateEnd.js
let app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
type:0
type:0,
info:{
type:1,
TCID:'7003',
Number:'51010219540703436X',
},
},
/**
......@@ -13,8 +20,11 @@ Page({
*/
onLoad: function (options) {
if(options.type){
let info=this.data.info;
info.type = options.type;
this.setData({
type: options.type
type: options.type,
info: info
});
}
},
......@@ -31,6 +41,30 @@ Page({
*/
onShow: function () {
},
numberInput(e){
let val = e.detail.value;
let info = this.data.info;
info.Number = val;
this.setData({
info: info,
})
},
getInfo(){
let info = this.data.info;
console.log("info", info)
app.$api('b2b_get_GetMXYTravelOrderInfo', info).then(res => {
console.log("res", res);
if (res.IsOK==1){
let userInfo = res.Info
wx.setStorageSync('userInfo', userInfo)
wx.navigateTo({
url: '/pages/index/index'
})
}
}).catch(err => { })
},
/**
......
<view class="container">
<view class="ci idcard active" wx:if="{{type==0}}">
<view class="ci idcard active" wx:if="{{type==1}}">
<text class="h2">身份证</text>
<text class="h6">ID CARD</text>
</view>
......@@ -12,13 +12,13 @@
<text>{{type==0?'身份证':'护照'}}</text>
</view>
<view class="input-box">
<input type="idcard"></input>
<input type="idcard" bindinput="numberInput" value="{{info.Number}}"></input>
</view>
<view class="ul">
<!-- <view class="ul">
<view class="li">
<text>210723********0779</text>
</view>
</view>
</view> -->
</view>
</view>
<view class="btn bg"></view>
\ No newline at end of file
<view bindtap="getInfo" class="btn bg"></view>
\ No newline at end of file
......@@ -44,7 +44,7 @@ page{
background: url('http://imgfile.oytour.com/New/Upload/Cloud/2020-02/20200213050648312.png') no-repeat;
background-size: 100%;
}
.container .ci.parpt.active{
.container .parpt{
background: url('http://imgfile.oytour.com/New/Upload/Cloud/2020-02/20200213050856296.png') no-repeat;
background-size: 100%;
}
......
......@@ -23,7 +23,7 @@
}
},
"compileType": "miniprogram",
"libVersion": "2.0.4",
"libVersion": "2.10.1",
"appid": "wxcf0727a7c78b501e",
"projectname": "termina",
"debugOptions": {
......@@ -41,13 +41,50 @@
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"gamePlugin": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": [
{
"id": -1,
"name": "首页",
"pathName": "pages/index/index",
"query": "",
"scene": null
},
{
"id": 1,
"name": "身份验证1",
"pathName": "pages/validateForm/validate/validate",
"query": "",
"scene": null
},
{
"id": 2,
"name": "身份验证2",
"pathName": "pages/validateForm/validateEnd/validateEnd",
"query": "",
"scene": null
},
{
"id": -1,
"name": "baidu ",
"pathName": "pages/webview/webview",
"query": "",
"scene": null
}
]
}
}
}
\ No newline at end of file
......@@ -28,7 +28,17 @@ function formatNumber(n) {
n = n.toString()
return n[1] ? n : '0' + n
}
// 获取今天日期
const YYMMDD = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return [year, month, day].map(formatNumber).join('-')
}
/**
* 验证数据长度有效性
*/
......@@ -934,5 +944,6 @@ module.exports = {
generateBigEmojiImageFile,
generateImageNode,
getFormatFriendList,
dealMsg
dealMsg,
YYMMDD
}
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