Commit 82e1fb4a authored by huangyuanyuan's avatar huangyuanyuan

update

parent cce343bd
......@@ -75,6 +75,50 @@ App({
})
return promise;
},
//
$apiJavaNew: function (url, msg) {
let groupId=2;
let token = this.state.admin.token;
let secretKey = this.state.admin.secretKey;
var promise = new Promise((resolve, reject) => {
wx.showLoading({
title: '加载中',
});
let timestamp = (new Date()).valueOf()
let sign = md5('msg=' + encodeURIComponent(JSON.stringify(msg)).toLowerCase() + '&' + 'timestamp=' + timestamp + '&' + 'token=' + token + '&' + 'key=' + secretKey)
wx.request({
// url: 'https://efficient.oytour.com/'+ url, //线上
url: 'http://47.96.12.235:9001/' + url, //测试
method: 'POST',
data: {
msg: msg,
timestamp: timestamp,
token: token,
sign: sign,
groupId: groupId,
},
success(res) {
wx.hideLoading()
if (res.data.resultCode === 1) {
resolve(res.data.data);
} else if (res.data.resultCode === 10000 || res.data.resultCode === 10001) {
// wx.reLaunch({
// url: '/pages/login/login'
// })
} else {
wx.showToast({
title: res.data.message,
icon: 'none',
duration: 1000
})
reject(res.data)
}
}
})
})
return promise;
},
// 抽奖接口2
$apiJava: function (url, msg, groupId, uid, token, secretKey) {
......
......@@ -6,7 +6,8 @@ Page({
* 页面的初始数据
*/
data: {
homeTravelSpecialSale:[],
specialAirTicketItem:[],
},
/**
......@@ -14,6 +15,7 @@ Page({
*/
onLoad: function (options) {
this.GetInitData();
this.GetAllTicket();
},
/**
......@@ -28,16 +30,37 @@ Page({
*/
onShow: function () {
},
GetAllTicket() {
let Msg = {
airTicketType: 0,
pageIndex: 1,
pageSize: 2,
};
let that = this;
app.$apiJavaNew('/api/b2b/home/getHomeSpecialAirTicketList', Msg).then(res => {
console.log("特价机票", res);
that.setData({
specialAirTicketItem: res.pageData
})
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 1000
})
})
},
GetInitData(){
console.log("111");
app.$api('/api/b2b/home/getHomeInitData', {}).then(res => {
let that=this;
app.$apiJavaNew('/api/b2b/home/getHomeInitData', {}).then(res => {
console.log("首页数据",res);
// wx.showToast({
// title: '提交成功!',
// icon: 'none',
// duration: 1000
// })
that.setData({
homeTravelSpecialSale: res.homeTravelSpecialSale,
specialAirTicketItem: res.specialAirTicketItem,
})
}).catch(err => {
wx.showToast({
title: err.message,
......
......@@ -53,42 +53,28 @@
<text style="font-size:24rpx;color:#888888;float:right">查看更多</text>
</view>
<view class="cztm cztm1">
<view class="cztmList1">
<image src="http://imgfile.oytour.com/New/Upload/Cloud/2019-06/20190626102629935.png"></image>
<view class="cztmList1" wx:for="{{homeTravelSpecialSale}}" wx:key="{{index}}" wx:if="{{index==0}}">
<image src="{{item.imgCover[0].url}}"></image>
<view class="boxshadow">
<view style="font-size:30rpx;padding-top:29rpx">夏日协奏曲</view>
<view style="font-size:22rpx">13日11晚</view>
<view class="text1" style="font-size:30rpx;padding-top:29rpx">{{item.title}}</view>
<view style="font-size:22rpx">{{item.dayNum}}日{{item.nightNum}}晚</view>
</view>
</view>
<view class="cztmList">
<image src="http://imgfile.oytour.com/New/Upload/Cloud/2019-06/20190626102629935.png"></image>
<view class="cztmList" wx:for="{{homeTravelSpecialSale}}" wx:key="{{index}}" wx:if="{{index==1}}">
<image src="{{item.imgCover[0].url}}"></image>
<view class="boxshadow">
<view style="font-size:30rpx;padding-top:29rpx">夏日协奏曲</view>
<view style="font-size:22rpx">13日11晚</view>
<view class="text1" style="font-size:30rpx;padding-top:29rpx">{{item.title}}</view>
<view style="font-size:22rpx">{{item.dayNum}}日{{item.nightNum}}晚</view>
</view>
</view>
</view>
<view class="cztm cztm2">
<view class="cztmList">
<image src="http://imgfile.oytour.com/New/Upload/Cloud/2019-06/20190626102629935.png"></image>
<view class="cztmList" wx:for="{{homeTravelSpecialSale}}" wx:key="{{index}}" wx:if="{{index>1 && index<5}}">
<image src="{{item.imgCover[0].url}}"></image>
<view class="boxshadow">
<view style="font-size:30rpx;padding-top:29rpx">夏日协奏曲</view>
<view style="font-size:22rpx">13日11晚</view>
</view>
</view>
<view class="cztmList">
<image src="http://imgfile.oytour.com/New/Upload/Cloud/2019-06/20190626102629935.png"></image>
<view class="boxshadow">
<view style="font-size:30rpx;padding-top:29rpx">夏日协奏曲</view>
<view style="font-size:22rpx">13日11晚</view>
</view>
</view>
<view class="cztmList">
<image src="http://imgfile.oytour.com/New/Upload/Cloud/2019-06/20190626102629935.png"></image>
<view class="boxshadow">
<view style="font-size:30rpx;padding-top:29rpx">夏日协奏曲</view>
<view style="font-size:22rpx">13日11晚</view>
<view class="text1" style="font-size:30rpx;padding-top:29rpx">{{item.title}}</view>
<view style="font-size:22rpx">{{item.dayNum}}日{{item.nightNum}}晚</view>
</view>
</view>
</view>
......@@ -106,34 +92,11 @@
</view>
<view class="listRight">
<view class="icon">
<view>成都</view>
<view>
<view style="padding:0 4rpx">
<view style="position:relative;top:20rpx;">
<image style="width:22rpx;height:22rpx" src="../../images/home/icon1.png"></image>
</view>
<image style="width:86rpx;height:14rpx" src="../../images/home/icon2.png"></image>
</view>
</view>
<view>日本</view>
</view>
<view style="text-align:right;color:#EE4454;font-size:20rpx;">
¥888.00
</view>
</view>
</view>
<view class="tjTicket">
<view class="listLeft">
CZ3854
</view>
<view class="listRight">
<view class="icon">
<view>成都</view>
<view>就是佛牌骄</view>
<view>
<view style="padding:0 4rpx">
<view style="position:relative;top:20rpx;">
<image style="width:22rpx;height:22rpx" src="../../images/home/icon1.png"></image>
<image style="width:15rpx;height:22rpx" src="../../images/home/icon1.png"></image>
</view>
<image style="width:86rpx;height:14rpx" src="../../images/home/icon2.png"></image>
......
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