正在显示
19 个修改的文件
包含
462 行增加
和
197 行删除
1 | //app.js | 1 | //app.js |
2 | + | ||
3 | + | ||
4 | + | ||
2 | App({ | 5 | App({ |
3 | data: { | 6 | data: { |
4 | minscreenHeight: 0, | 7 | minscreenHeight: 0, |
@@ -20,6 +23,7 @@ App({ | @@ -20,6 +23,7 @@ App({ | ||
20 | duration: 100 | 23 | duration: 100 |
21 | }) | 24 | }) |
22 | }, | 25 | }, |
26 | + | ||
23 | /** | 27 | /** |
24 | * 自定义post函数,返回Promise | 28 | * 自定义post函数,返回Promise |
25 | * +------------------- | 29 | * +------------------- |
@@ -14,14 +14,14 @@ page { | @@ -14,14 +14,14 @@ page { | ||
14 | /* box-sizing: border-box; */ | 14 | /* box-sizing: border-box; */ |
15 | } | 15 | } |
16 | .drop_img { | 16 | .drop_img { |
17 | - width: 30rpx; | ||
18 | - height: 27rpx; | 17 | + /* width: 30rpx; |
18 | + height: 27rpx; */ | ||
19 | cursor: pointer; | 19 | cursor: pointer; |
20 | margin: 0 auto 40rpx; | 20 | margin: 0 auto 40rpx; |
21 | } | 21 | } |
22 | .drop_img image { | 22 | .drop_img image { |
23 | - width: 100%; | ||
24 | - height: 100%; | 23 | + width: 46rpx; |
24 | + height: 22rpx; | ||
25 | } | 25 | } |
26 | 26 | ||
27 | /* 客服 */ | 27 | /* 客服 */ |
1 | // pages/about/about.js | 1 | // pages/about/about.js |
2 | +var WxParse = require('../../wxParse/wxParse.js'); | ||
2 | const app = getApp(); | 3 | const app = getApp(); |
3 | Page({ | 4 | Page({ |
4 | /** | 5 | /** |
@@ -10,26 +11,92 @@ Page({ | @@ -10,26 +11,92 @@ Page({ | ||
10 | ], | 11 | ], |
11 | minscreenHeight: 0, | 12 | minscreenHeight: 0, |
12 | scrollTop: 0, | 13 | scrollTop: 0, |
14 | + name: '', | ||
15 | + phone: "", | ||
16 | + company:'', | ||
17 | + content_img: "", | ||
13 | }, | 18 | }, |
14 | onPageScroll: function (e) { // 获取滚动条当前位置 | 19 | onPageScroll: function (e) { // 获取滚动条当前位置 |
15 | - console.log(111); | ||
16 | - console.log(e.scrollTop); | ||
17 | - console.log(minscreenHeight); | ||
18 | - this.setData({ | ||
19 | - scrollTop: e.scrollTop | ||
20 | - }) | 20 | + // console.log(e) |
21 | + this.setData({ | ||
22 | + scrollTop: e.scrollTop | ||
23 | + }) | ||
21 | }, | 24 | }, |
22 | goTop: function () { | 25 | goTop: function () { |
23 | - app.goTop() | 26 | + app.goTop() |
27 | + }, | ||
28 | + // 返回上一页 | ||
29 | + backFun: function () { | ||
30 | + wx.navigateBack({ | ||
31 | + changed: true | ||
32 | + }); | ||
24 | }, | 33 | }, |
25 | 34 | ||
26 | /** | 35 | /** |
27 | * 生命周期函数--监听页面加载 | 36 | * 生命周期函数--监听页面加载 |
28 | */ | 37 | */ |
29 | onLoad: function (options) { | 38 | onLoad: function (options) { |
39 | + let url = '/portal/Api/aboutUs'; | ||
40 | + app.post(url, {}).then((res) => { | ||
41 | + console.log('res', res); | ||
42 | + this.setData({ | ||
43 | + content_img: res.about, | ||
44 | + link: res.link, | ||
45 | + }); | ||
46 | + WxParse.wxParse('content_img', 'html', this.data.content_img, this, 5); | ||
47 | + WxParse.wxParse('link', 'html', this.data.link, this, 5); | ||
48 | + }).catch((err) => { | ||
49 | + console.log(err); | ||
50 | + }) | ||
51 | + }, | ||
52 | + // 姓名 | ||
53 | + nameFun: function(e) { | ||
54 | + let that = this; | ||
55 | + // console.log(e.detail.value) | ||
56 | + that.setData({ | ||
57 | + name: e.detail.value, | ||
58 | + }) | ||
59 | + }, | ||
60 | + // 手机号 | ||
61 | + phoneFun: function(e) { | ||
62 | + let that = this; | ||
63 | + // console.log(e.detail.value) | ||
64 | + that.setData({ | ||
65 | + phone: e.detail.value, | ||
66 | + }) | ||
67 | + }, | ||
68 | + // 行业 | ||
69 | + companyFun: function (e) { | ||
70 | + let that = this; | ||
71 | + // console.log(e.detail.value) | ||
72 | + that.setData({ | ||
73 | + company: e.detail.value, | ||
74 | + }) | ||
75 | + }, | ||
30 | 76 | ||
77 | + // 提交 | ||
78 | + subFun: function() { | ||
79 | + let url = '/portal/Api/form'; | ||
80 | + var that = this; | ||
81 | + let data = { | ||
82 | + name: that.name, | ||
83 | + mobile: that.phone, | ||
84 | + firm: that.company, | ||
85 | + }; | ||
86 | + app.post(url, data).then((res) => { | ||
87 | + // console.log('res', res); | ||
88 | + if(res.type == 1) { | ||
89 | + wx.showToast({ | ||
90 | + title: '成功', | ||
91 | + icon: 'succes', | ||
92 | + duration: 1000, | ||
93 | + mask: true | ||
94 | + }) | ||
95 | + } | ||
96 | + }).catch((err) => { | ||
97 | + console.log(err); | ||
98 | + }) | ||
31 | }, | 99 | }, |
32 | - | ||
33 | 100 | ||
34 | /** | 101 | /** |
35 | * 生命周期函数--监听页面初次渲染完成 | 102 | * 生命周期函数--监听页面初次渲染完成 |
@@ -4,7 +4,9 @@ | @@ -4,7 +4,9 @@ | ||
4 | <image src='http://pjq0ww1cj.bkt.clouddn.com/about.png'></image> | 4 | <image src='http://pjq0ww1cj.bkt.clouddn.com/about.png'></image> |
5 | </view> | 5 | </view> |
6 | <view class='about_content'> | 6 | <view class='about_content'> |
7 | - <image src='http://pjq0ww1cj.bkt.clouddn.com/about_content.png' mode="widthFix"></image> | 7 | + <import src="../../wxParse/wxParse.wxml"/> |
8 | + <template is="wxParse" data="{{wxParseData:content_img.nodes}}"/> | ||
9 | + <!-- <image src='http://pjq0ww1cj.bkt.clouddn.com/about_content.png' mode="widthFix"></image> --> | ||
8 | </view> | 10 | </view> |
9 | <view class='about_contact_way'> | 11 | <view class='about_contact_way'> |
10 | <view class='about_title'> | 12 | <view class='about_title'> |
@@ -12,7 +14,9 @@ | @@ -12,7 +14,9 @@ | ||
12 | <view>联系我们</view> | 14 | <view>联系我们</view> |
13 | </view> | 15 | </view> |
14 | <view class='about_contact_box'> | 16 | <view class='about_contact_box'> |
15 | - <view class='about_contact_list'> | 17 | + <import src="../../wxParse/wxParse.wxml"/> |
18 | + <template is="wxParse" data="{{wxParseData:link.nodes}}"/> | ||
19 | + <!-- <view class='about_contact_list'> | ||
16 | <view>全国服务热线:</view> | 20 | <view>全国服务热线:</view> |
17 | <view class='about_contact_right'>400-6262-686</view> | 21 | <view class='about_contact_right'>400-6262-686</view> |
18 | </view> | 22 | </view> |
@@ -27,9 +31,10 @@ | @@ -27,9 +31,10 @@ | ||
27 | <view class='about_contact_list'> | 31 | <view class='about_contact_list'> |
28 | <view>北京运营中心:</view> | 32 | <view>北京运营中心:</view> |
29 | <view class='about_contact_right'>北京亦庄经济开发区东经海三路天骥智谷33号楼4层</view> | 33 | <view class='about_contact_right'>北京亦庄经济开发区东经海三路天骥智谷33号楼4层</view> |
30 | - </view> | 34 | + </view> --> |
31 | </view> | 35 | </view> |
32 | </view> | 36 | </view> |
37 | + <!-- 申请 --> | ||
33 | <view class='sub_apply_box'> | 38 | <view class='sub_apply_box'> |
34 | <view class='sub_apply_title'> | 39 | <view class='sub_apply_title'> |
35 | <image src='http://pjq0ww1cj.bkt.clouddn.com/apply.png'></image> | 40 | <image src='http://pjq0ww1cj.bkt.clouddn.com/apply.png'></image> |
@@ -40,7 +45,7 @@ | @@ -40,7 +45,7 @@ | ||
40 | <view class='sub_input_left'> | 45 | <view class='sub_input_left'> |
41 | <image src='http://pjq0ww1cj.bkt.clouddn.com/user.png' mode="widthFix"></image> | 46 | <image src='http://pjq0ww1cj.bkt.clouddn.com/user.png' mode="widthFix"></image> |
42 | </view> | 47 | </view> |
43 | - <input type='text' maxlength='10' placeholder="请输入您的姓名" /> | 48 | + <input type='text' maxlength='10' bindchange="nameFun" placeholder="请输入您的姓名" /> |
44 | <text>姓名请输入不超过10个字</text> | 49 | <text>姓名请输入不超过10个字</text> |
45 | </view> | 50 | </view> |
46 | </view> | 51 | </view> |
@@ -50,19 +55,19 @@ | @@ -50,19 +55,19 @@ | ||
50 | <view class='sub_input_left'> | 55 | <view class='sub_input_left'> |
51 | <image src='http://pjq0ww1cj.bkt.clouddn.com/input_phone.png' mode="widthFix"></image> | 56 | <image src='http://pjq0ww1cj.bkt.clouddn.com/input_phone.png' mode="widthFix"></image> |
52 | </view> | 57 | </view> |
53 | - <input type='number' maxlength='11' placeholder="请输入您的联系方式" /> | 58 | + <input type='number' maxlength='11' bindchange="phoneFun" placeholder="请输入您的联系方式" /> |
54 | </view> | 59 | </view> |
55 | </view> | 60 | </view> |
56 | <view class='sub_apply_list'> | 61 | <view class='sub_apply_list'> |
57 | - <view class='sub_apply_must'>*</view> | ||
58 | - <view class='sub_apply_input'> | 62 | + <!-- <view class='sub_apply_must'>*</view> --> |
63 | + <view class='sub_apply_input' style='margin-left:30rpx;'> | ||
59 | <view class='sub_input_left'> | 64 | <view class='sub_input_left'> |
60 | <image src='http://pjq0ww1cj.bkt.clouddn.com/company.png' mode="widthFix"></image> | 65 | <image src='http://pjq0ww1cj.bkt.clouddn.com/company.png' mode="widthFix"></image> |
61 | </view> | 66 | </view> |
62 | - <input type='text' placeholder="请输入您的所在行业" /> | 67 | + <input type='text' bindchange="companyFun" placeholder="请输入您的所在行业" /> |
63 | </view> | 68 | </view> |
64 | </view> | 69 | </view> |
65 | - <view class='sub_btn'> | 70 | + <view class='sub_btn' bindtap='subFun'> |
66 | <image src='http://pjq0ww1cj.bkt.clouddn.com/sub_btn.png'></image> | 71 | <image src='http://pjq0ww1cj.bkt.clouddn.com/sub_btn.png'></image> |
67 | </view> | 72 | </view> |
68 | </view> | 73 | </view> |
@@ -73,7 +78,10 @@ | @@ -73,7 +78,10 @@ | ||
73 | </button> | 78 | </button> |
74 | </view> | 79 | </view> |
75 | <!-- 返回顶部 --> | 80 | <!-- 返回顶部 --> |
76 | - <view class='chat_peo return_top' wx:if="{{scrollTop>minscreenHeight}}" bindtap="goTop"> | 81 | + <view class='chat_peo return_top' wx:if="{{scrollTop>minscreenHeight}}" bindtap="goTop" > |
77 | <image src='http://pjq0ww1cj.bkt.clouddn.com/dingbu.png'></image> | 82 | <image src='http://pjq0ww1cj.bkt.clouddn.com/dingbu.png'></image> |
78 | </view> | 83 | </view> |
84 | + <view class='drop_img' bindtap="backFun"> | ||
85 | + <image src='http://pjq0ww1cj.bkt.clouddn.com/left.png'></image> | ||
86 | + </view> | ||
79 | </view> | 87 | </view> |
1 | /* pages/about/about.wxss */ | 1 | /* pages/about/about.wxss */ |
2 | +@import "../../wxParse/wxParse.wxss"; | ||
2 | .about_wrap { | 3 | .about_wrap { |
3 | width: 100%; | 4 | width: 100%; |
4 | height: 100%; | 5 | height: 100%; |
5 | - overflow: auto; | ||
6 | } | 6 | } |
7 | .about_top { | 7 | .about_top { |
8 | width: 100%; | 8 | width: 100%; |
@@ -146,8 +146,13 @@ | @@ -146,8 +146,13 @@ | ||
146 | 146 | ||
147 | 147 | ||
148 | 148 | ||
149 | - | ||
150 | - | 149 | +/* 返回上一页 */ |
150 | +.drop_img { | ||
151 | + position: fixed; | ||
152 | + left: 50%; | ||
153 | + bottom: 20rpx; | ||
154 | + margin: 0 0 0 -23rpx; | ||
155 | +} | ||
151 | 156 | ||
152 | 157 | ||
153 | 158 |
1 | // pages/application/application.js | 1 | // pages/application/application.js |
2 | +const app = getApp(); | ||
3 | +var touchDot = 0;//触摸时的原点 | ||
4 | +var time = 0;// 时间记录,用于滑动时且时间小于1s则执行左右滑动 | ||
5 | +var interval = "";// 记录/清理时间记录 | ||
2 | Page({ | 6 | Page({ |
3 | 7 | ||
4 | /** | 8 | /** |
5 | * 页面的初始数据 | 9 | * 页面的初始数据 |
6 | */ | 10 | */ |
7 | data: { | 11 | data: { |
8 | - imgUrls: [ | ||
9 | - 'http://pjq0ww1cj.bkt.clouddn.com/app_banner01.png', | ||
10 | - 'http://pjq0ww1cj.bkt.clouddn.com/app_banner01.png', | ||
11 | - 'http://pjq0ww1cj.bkt.clouddn.com/app_banner01.png', | ||
12 | - ], | 12 | + imgUrls: [], |
13 | connectButton: [ | 13 | connectButton: [ |
14 | { className: "", text: "在线客服", bindtap: "" } | 14 | { className: "", text: "在线客服", bindtap: "" } |
15 | ], | 15 | ], |
16 | autoplay: true, | 16 | autoplay: true, |
17 | - interval: 5000, | 17 | + interval: 2000, |
18 | duration: 1000, | 18 | duration: 1000, |
19 | circular: true, | 19 | circular: true, |
20 | currentSwiper: 0, | 20 | currentSwiper: 0, |
@@ -49,13 +49,59 @@ Page({ | @@ -49,13 +49,59 @@ Page({ | ||
49 | * 生命周期函数--监听页面加载 | 49 | * 生命周期函数--监听页面加载 |
50 | */ | 50 | */ |
51 | onLoad: function (options) { | 51 | onLoad: function (options) { |
52 | - | 52 | + let url = '/portal/Api/scene'; |
53 | + app.post(url, {}).then((res) => { | ||
54 | + // console.log('res', res); | ||
55 | + this.setData({ | ||
56 | + imgUrls: res.list | ||
57 | + }) | ||
58 | + }).catch((err) => { | ||
59 | + console.log(err); | ||
60 | + }) | ||
53 | }, | 61 | }, |
54 | jumpFun: function (e) { | 62 | jumpFun: function (e) { |
55 | wx.navigateTo({ | 63 | wx.navigateTo({ |
56 | url: '../about/about' | 64 | url: '../about/about' |
57 | }) | 65 | }) |
58 | }, | 66 | }, |
67 | + // 返回上一页 | ||
68 | + backFun: function () { | ||
69 | + wx.navigateBack({ | ||
70 | + changed: true | ||
71 | + }); | ||
72 | + }, | ||
73 | + // 触摸开始事件 | ||
74 | + touchStart: function (e) { | ||
75 | + touchDot = e.touches[0].pageX; // 获取触摸时的原点 | ||
76 | + // 使用js计时器记录时间 | ||
77 | + interval = setInterval(function () { | ||
78 | + time++; | ||
79 | + }, 100); | ||
80 | + }, | ||
81 | + // 触摸移动事件 | ||
82 | + touchMove: function (e) { | ||
83 | + var touchMove = e.touches[0].pageX; | ||
84 | + console.log("touchMove:" + touchMove + " touchDot:" + touchDot + " diff:" + (touchMove - touchDot)); | ||
85 | + // 向左滑动 | ||
86 | + if (touchMove - touchDot <= -40 && time < 10) { | ||
87 | + wx.navigateTo({ | ||
88 | + url: '../about/about' | ||
89 | + }) | ||
90 | + } | ||
91 | + // 向右滑动 | ||
92 | + if (touchMove - touchDot >= 40 && time < 10) { | ||
93 | + console.log('向右滑动'); | ||
94 | + // alert("已经是第一页了") | ||
95 | + wx.navigateBack({ | ||
96 | + changed: true | ||
97 | + }); | ||
98 | + } | ||
99 | + }, | ||
100 | + // 触摸结束事件 | ||
101 | + touchEnd: function (e) { | ||
102 | + clearInterval(interval); // 清除setInterval | ||
103 | + time = 0; | ||
104 | + }, | ||
59 | 105 | ||
60 | /** | 106 | /** |
61 | * 生命周期函数--监听页面初次渲染完成 | 107 | * 生命周期函数--监听页面初次渲染完成 |
@@ -96,9 +142,7 @@ Page({ | @@ -96,9 +142,7 @@ Page({ | ||
96 | * 页面上拉触底事件的处理函数 | 142 | * 页面上拉触底事件的处理函数 |
97 | */ | 143 | */ |
98 | onReachBottom: function () { | 144 | onReachBottom: function () { |
99 | - wx.navigateTo({ | ||
100 | - url: '../about/about' | ||
101 | - }) | 145 | + |
102 | }, | 146 | }, |
103 | 147 | ||
104 | /** | 148 | /** |
1 | <!--pages/application/application.wxml--> | 1 | <!--pages/application/application.wxml--> |
2 | -<view class='app_lication_banner'> | 2 | +<view class='app_lication_banner' bindtouchstart="touchStart" bindtouchmove="touchMove" bindtouchend="touchEnd" > |
3 | <swiper | 3 | <swiper |
4 | bindchange='swiperChange' | 4 | bindchange='swiperChange' |
5 | autoplay="{{autoplay}}" | 5 | autoplay="{{autoplay}}" |
@@ -7,25 +7,26 @@ | @@ -7,25 +7,26 @@ | ||
7 | duration="{{duration}}" | 7 | duration="{{duration}}" |
8 | circular="{{circular}}" | 8 | circular="{{circular}}" |
9 | > | 9 | > |
10 | - <block wx:for="{{imgUrls}}" wx:key> | ||
11 | - <swiper-item> | ||
12 | - <image src="{{item}}" class="slide-image" width="100%" height="100%" /> | 10 | + <block wx:for="{{imgUrls}}" wx:key="index"> |
11 | + <swiper-item catchtouchmove="stopTouchMove"> | ||
12 | + <image src="{{item.url}}" class="slide-image" width="100%" height="100%" /> | ||
13 | </swiper-item> | 13 | </swiper-item> |
14 | </block> | 14 | </block> |
15 | </swiper> | 15 | </swiper> |
16 | <view class="dots"> | 16 | <view class="dots"> |
17 | - <block wx:for="{{imgUrls}}" wx:key=""> | 17 | + <block wx:for="{{imgUrls}}" wx:key="index"> |
18 | <view class="dot{{index == currentSwiper ? ' active' : ''}}"></view> | 18 | <view class="dot{{index == currentSwiper ? ' active' : ''}}"></view> |
19 | </block> | 19 | </block> |
20 | </view> | 20 | </view> |
21 | 21 | ||
22 | <!-- 跳转下一页 --> | 22 | <!-- 跳转下一页 --> |
23 | - <view class='drop_img' bindtap="jumpFun"> | ||
24 | - <image src='http://pjq0ww1cj.bkt.clouddn.com/drop.png'></image> | 23 | + <view class='drop_img'> |
24 | + <image src='http://pjq0ww1cj.bkt.clouddn.com/left.png' bindtap='backFun' style='margin-right:200rpx;'></image> | ||
25 | + <image src='http://pjq0ww1cj.bkt.clouddn.com/right.png' bindtap="jumpFun"></image> | ||
25 | </view> | 26 | </view> |
26 | 27 | ||
27 | <!-- 客服 --> | 28 | <!-- 客服 --> |
28 | - <view class='chat_peo' bindtap="jumpFun"> | 29 | + <view class='chat_peo'> |
29 | <button open-type="contact" class='contacButton'> | 30 | <button open-type="contact" class='contacButton'> |
30 | <image src='http://pjq0ww1cj.bkt.clouddn.com/chat_peo.png'></image> | 31 | <image src='http://pjq0ww1cj.bkt.clouddn.com/chat_peo.png'></image> |
31 | </button> | 32 | </button> |
1 | // pages/case/case.js | 1 | // pages/case/case.js |
2 | const app=getApp(); | 2 | const app=getApp(); |
3 | +var touchDot = 0;//触摸时的原点 | ||
4 | +var time = 0;// 时间记录,用于滑动时且时间小于1s则执行左右滑动 | ||
5 | +var interval = "";// 记录/清理时间记录 | ||
3 | Page({ | 6 | Page({ |
4 | 7 | ||
5 | /** | 8 | /** |
@@ -68,7 +71,7 @@ Page({ | @@ -68,7 +71,7 @@ Page({ | ||
68 | }, | 71 | }, |
69 | goFun(e) { | 72 | goFun(e) { |
70 | wx.navigateTo({ | 73 | wx.navigateTo({ |
71 | - url: '../caseList/caseList?html=' + e.currentTarget.dataset.html | 74 | + url: '../caseList/caseList?html=' + e.currentTarget.dataset.html+ '&&id=' + e.currentTarget.dataset.id |
72 | }) | 75 | }) |
73 | }, | 76 | }, |
74 | 77 | ||
@@ -78,6 +81,43 @@ Page({ | @@ -78,6 +81,43 @@ Page({ | ||
78 | onLoad: function (options) { | 81 | onLoad: function (options) { |
79 | this.getlist(); | 82 | this.getlist(); |
80 | }, | 83 | }, |
84 | + // 触摸开始事件 | ||
85 | + touchStart: function (e) { | ||
86 | + touchDot = e.touches[0].pageX; // 获取触摸时的原点 | ||
87 | + // 使用js计时器记录时间 | ||
88 | + interval = setInterval(function () { | ||
89 | + time++; | ||
90 | + }, 100); | ||
91 | + }, | ||
92 | + // 触摸移动事件 | ||
93 | + touchMove: function (e) { | ||
94 | + var touchMove = e.touches[0].pageX; | ||
95 | + console.log("touchMove:" + touchMove + " touchDot:" + touchDot + " diff:" + (touchMove - touchDot)); | ||
96 | + // 向左滑动 | ||
97 | + if (touchMove - touchDot <= -40 && time < 10) { | ||
98 | + wx.navigateTo({ | ||
99 | + url: '../application/application' | ||
100 | + }); | ||
101 | + } | ||
102 | + // 向右滑动 | ||
103 | + if (touchMove - touchDot >= 40 && time < 10) { | ||
104 | + console.log('向右滑动'); | ||
105 | + // alert("已经是第一页了") | ||
106 | + wx.navigateBack({ | ||
107 | + changed: true | ||
108 | + }); | ||
109 | + } | ||
110 | + }, | ||
111 | + // 触摸结束事件 | ||
112 | + touchEnd: function (e) { | ||
113 | + clearInterval(interval); // 清除setInterval | ||
114 | + time = 0; | ||
115 | + }, | ||
116 | + backFun: function() { | ||
117 | + wx.navigateBack({ | ||
118 | + changed: true | ||
119 | + }); | ||
120 | + }, | ||
81 | 121 | ||
82 | /** | 122 | /** |
83 | * 生命周期函数--监听页面初次渲染完成 | 123 | * 生命周期函数--监听页面初次渲染完成 |
@@ -123,9 +163,7 @@ Page({ | @@ -123,9 +163,7 @@ Page({ | ||
123 | * 页面上拉触底事件的处理函数 | 163 | * 页面上拉触底事件的处理函数 |
124 | */ | 164 | */ |
125 | onReachBottom: function () { | 165 | onReachBottom: function () { |
126 | - wx.navigateTo({ | ||
127 | - url: '../application/application' | ||
128 | - }) | 166 | + |
129 | }, | 167 | }, |
130 | 168 | ||
131 | /** | 169 | /** |
1 | <!--pages/case/case.wxml--> | 1 | <!--pages/case/case.wxml--> |
2 | -<view class='case_wrap'> | 2 | +<view class='case_wrap' bindtouchstart="touchStart" bindtouchmove="touchMove" bindtouchend="touchEnd" > |
3 | <!--banner --> | 3 | <!--banner --> |
4 | <view class='case_banner_box'> | 4 | <view class='case_banner_box'> |
5 | <swiper bindchange='swiperChange' | 5 | <swiper bindchange='swiperChange' |
@@ -30,41 +30,42 @@ | @@ -30,41 +30,42 @@ | ||
30 | </view> | 30 | </view> |
31 | </view> | 31 | </view> |
32 | <view class='case_content'> | 32 | <view class='case_content'> |
33 | - <view class='case_list' data-html="政府案例" bindtap='goFun'> | 33 | + <view class='case_list' data-html="政府案例" data-id='1' bindtap='goFun'> |
34 | <image src='http://pjq0ww1cj.bkt.clouddn.com/zhengfu.png'></image> | 34 | <image src='http://pjq0ww1cj.bkt.clouddn.com/zhengfu.png'></image> |
35 | <view class='case_list_text'>政府</view> | 35 | <view class='case_list_text'>政府</view> |
36 | </view> | 36 | </view> |
37 | - <view class='case_list' data-html="地产案例" bindtap='goFun'> | 37 | + <view class='case_list' data-html="地产案例" data-id='3' bindtap='goFun'> |
38 | <image src='http://pjq0ww1cj.bkt.clouddn.com/dichan.png'></image> | 38 | <image src='http://pjq0ww1cj.bkt.clouddn.com/dichan.png'></image> |
39 | <view class='case_list_text'>地产</view> | 39 | <view class='case_list_text'>地产</view> |
40 | </view> | 40 | </view> |
41 | - <view class='case_list' data-html="制造案例" bindtap='goFun'> | 41 | + <view class='case_list' data-html="制造案例" data-id='2' bindtap='goFun'> |
42 | <image src='http://pjq0ww1cj.bkt.clouddn.com/zhizao.png'></image> | 42 | <image src='http://pjq0ww1cj.bkt.clouddn.com/zhizao.png'></image> |
43 | <view class='case_list_text'>制造</view> | 43 | <view class='case_list_text'>制造</view> |
44 | </view> | 44 | </view> |
45 | - <view class='case_list' data-html="教育案例" bindtap='goFun'> | 45 | + <view class='case_list' data-html="教育案例" data-id='5' bindtap='goFun'> |
46 | <image src='http://pjq0ww1cj.bkt.clouddn.com/jiaoyu.png'></image> | 46 | <image src='http://pjq0ww1cj.bkt.clouddn.com/jiaoyu.png'></image> |
47 | <view class='case_list_text'>教育</view> | 47 | <view class='case_list_text'>教育</view> |
48 | </view> | 48 | </view> |
49 | - <view class='case_list' data-html="金融案例" bindtap='goFun'> | 49 | + <view class='case_list' data-html="物流案例" data-id='4' bindtap='goFun'> |
50 | <image src='http://pjq0ww1cj.bkt.clouddn.com/jinrong.png'></image> | 50 | <image src='http://pjq0ww1cj.bkt.clouddn.com/jinrong.png'></image> |
51 | - <view class='case_list_text'>金融</view> | 51 | + <view class='case_list_text'>物流</view> |
52 | </view> | 52 | </view> |
53 | - <view class='case_list' data-html="零售案例" bindtap='goFun'> | 53 | + <view class='case_list' data-html="零售案例" data-id='6' bindtap='goFun'> |
54 | <image src='http://pjq0ww1cj.bkt.clouddn.com/lingshou.png'></image> | 54 | <image src='http://pjq0ww1cj.bkt.clouddn.com/lingshou.png'></image> |
55 | <view class='case_list_text'>零售</view> | 55 | <view class='case_list_text'>零售</view> |
56 | </view> | 56 | </view> |
57 | </view> | 57 | </view> |
58 | - <view class='drop_img' bindtap="jumpFun"> | ||
59 | - <image src='http://pjq0ww1cj.bkt.clouddn.com/drop.png'></image> | 58 | + <view class='drop_img'> |
59 | + <image src='http://pjq0ww1cj.bkt.clouddn.com/left.png' style='margin-right:200rpx;' bindtap='backFun'></image> | ||
60 | + <image src='http://pjq0ww1cj.bkt.clouddn.com/right.png' bindtap="jumpFun"></image> | ||
60 | </view> | 61 | </view> |
61 | </view> | 62 | </view> |
62 | <!-- 客服 --> | 63 | <!-- 客服 --> |
63 | <view class='chat_peo' > | 64 | <view class='chat_peo' > |
64 | <button open-type="contact" class='contacButton'> | 65 | <button open-type="contact" class='contacButton'> |
65 | - <button open-type="contact" class='contacButton'> | 66 | + <!-- <button open-type="contact" class='contacButton'> --> |
66 | <image src='http://pjq0ww1cj.bkt.clouddn.com/chat_peo.png'></image> | 67 | <image src='http://pjq0ww1cj.bkt.clouddn.com/chat_peo.png'></image> |
67 | - </button> | 68 | + <!-- </button> --> |
68 | </button> | 69 | </button> |
69 | </view> | 70 | </view> |
70 | 71 |
1 | // pages/caseDetail/caseDetail.js | 1 | // pages/caseDetail/caseDetail.js |
2 | -// var WxParse = require('../../wxParse/wxParse.js'); | 2 | +var WxParse = require('../../wxParse/wxParse.js'); |
3 | const app = getApp(); | 3 | const app = getApp(); |
4 | Page({ | 4 | Page({ |
5 | 5 | ||
@@ -7,23 +7,18 @@ Page({ | @@ -7,23 +7,18 @@ Page({ | ||
7 | * 页面的初始数据 | 7 | * 页面的初始数据 |
8 | */ | 8 | */ |
9 | data: { | 9 | data: { |
10 | - imgUrls: [ | ||
11 | - 'http://pjq0ww1cj.bkt.clouddn.com/detail01.png', | ||
12 | - 'http://pjq0ww1cj.bkt.clouddn.com/detail01.png', | ||
13 | - 'http://pjq0ww1cj.bkt.clouddn.com/detail01.png', | ||
14 | - ], | 10 | + imgUrls: [], |
15 | connectButton: [ | 11 | connectButton: [ |
16 | { className: "", text: "在线客服", bindtap: "" } | 12 | { className: "", text: "在线客服", bindtap: "" } |
17 | ], | 13 | ], |
18 | currentSwiper: 0, | 14 | currentSwiper: 0, |
19 | - autoplay: true, | ||
20 | - interval: 5000, | ||
21 | - duration: 1000, | ||
22 | - circular: true, | ||
23 | listStatus: 0, | 15 | listStatus: 0, |
24 | data: {}, | 16 | data: {}, |
25 | minscreenHeight: 0, | 17 | minscreenHeight: 0, |
26 | scrollTop: 0, | 18 | scrollTop: 0, |
19 | + isPlay: false, | ||
20 | + content_1: "", | ||
21 | + content_2: "", | ||
27 | }, | 22 | }, |
28 | changeIndicatorDots(e) { | 23 | changeIndicatorDots(e) { |
29 | this.setData({ | 24 | this.setData({ |
@@ -56,6 +51,7 @@ Page({ | @@ -56,6 +51,7 @@ Page({ | ||
56 | }) | 51 | }) |
57 | }, | 52 | }, |
58 | onPageScroll: function (e) { // 获取滚动条当前位置 | 53 | onPageScroll: function (e) { // 获取滚动条当前位置 |
54 | + // console.log(e) | ||
59 | this.setData({ | 55 | this.setData({ |
60 | scrollTop: e.scrollTop | 56 | scrollTop: e.scrollTop |
61 | }) | 57 | }) |
@@ -64,30 +60,52 @@ Page({ | @@ -64,30 +60,52 @@ Page({ | ||
64 | app.goTop() | 60 | app.goTop() |
65 | }, | 61 | }, |
66 | 62 | ||
63 | + //点击图片切换视频 | ||
64 | + play() { | ||
65 | + this.setData({ isPlay: !this.data.isPlay }); | ||
66 | + }, | ||
67 | + //视频暂停 | ||
68 | + clickStop() { | ||
69 | + this.setData({ isPlay: false }); | ||
70 | + }, | ||
71 | + swiperChange: function (e) { //切换轮播图 | ||
72 | + this.setData({ | ||
73 | + currentSwiper: e.detail.current | ||
74 | + }) | ||
75 | + }, | ||
76 | + | ||
67 | /** | 77 | /** |
68 | * 生命周期函数--监听页面加载 | 78 | * 生命周期函数--监听页面加载 |
69 | */ | 79 | */ |
70 | onLoad: function (options) { | 80 | onLoad: function (options) { |
71 | // console.log(options); | 81 | // console.log(options); |
72 | - // let url = '/portal/Api/category'; | ||
73 | - // let data = { | ||
74 | - // categoryId: options.id, | ||
75 | - // }; | ||
76 | - // app.post(url, data).then((res) => { | ||
77 | - // // console.log('res', res); | ||
78 | - // if (res.type) { | ||
79 | - // this.setData({ | ||
80 | - // imgUrls: res.banner, | ||
81 | - // data: res, | ||
82 | - // }); | ||
83 | - // let article = res.content_1; | ||
84 | - // WxParse.wxParse('article', 'html', article, this, 5); | ||
85 | - // } | ||
86 | - | ||
87 | - | ||
88 | - // }).catch((err) => { | ||
89 | - // console.log(err); | ||
90 | - // }) | 82 | + let url = '/portal/Api/category'; |
83 | + let data = { | ||
84 | + categoryId: options.id, | ||
85 | + }; | ||
86 | + app.post(url, data).then((res) => { | ||
87 | + // console.log('res', res); | ||
88 | + for (var index in res.image) { | ||
89 | + res.image[index].type = "image"; | ||
90 | + } | ||
91 | + if (res.video_type == true) { | ||
92 | + res.image.splice(0, 0, { | ||
93 | + url: res.video, | ||
94 | + type: "video", | ||
95 | + video_img: res.video_img, | ||
96 | + }); | ||
97 | + } | ||
98 | + this.setData({ | ||
99 | + imgUrls: res.image, | ||
100 | + data: res, | ||
101 | + content_1: res.content_1, | ||
102 | + content_2: res.content_2, | ||
103 | + }); | ||
104 | + WxParse.wxParse('content_1', 'html', this.data.content_1, this, 5); | ||
105 | + WxParse.wxParse('content_2', 'html', this.data.content_2, this, 5); | ||
106 | + }).catch((err) => { | ||
107 | + console.log(err); | ||
108 | + }) | ||
91 | }, | 109 | }, |
92 | 110 | ||
93 | 111 |
@@ -2,17 +2,36 @@ | @@ -2,17 +2,36 @@ | ||
2 | <view class='case_detail_page'> | 2 | <view class='case_detail_page'> |
3 | <view class='case_detail_top'> | 3 | <view class='case_detail_top'> |
4 | <view class='case_detail_banner'> | 4 | <view class='case_detail_banner'> |
5 | - <swiper bindchange='swiperChange' | ||
6 | - indicator-dots="{{indicatorDots}}" | ||
7 | - autoplay="{{autoplay}}" | ||
8 | - interval="{{interval}}" | ||
9 | - duration="{{duration}}" | ||
10 | - circular="{{circular}}"> | ||
11 | - <block wx:for="{{imgUrls}}" wx:key> | ||
12 | - <swiper-item> | ||
13 | - <image src="{{item}}" class="slide-image" width="100%" height="100%" /> | ||
14 | - </swiper-item> | ||
15 | - </block> | 5 | + <swiper autoplay="{{false}}" interval="2000" duration="500" circular="{{true}}" bindchange="swiperChange"> |
6 | + <block wx:for="{{imgUrls}}" wx:key="index"> | ||
7 | + <swiper-item> | ||
8 | + <!-- <navigator url="{{item.url}}" hover-class="navigator-hover"> --> | ||
9 | + <view class="index_top"> | ||
10 | + <block wx:if="{{item.type == 'video'}}" > | ||
11 | + <view wx:if="{{isPlay}}" class="video-box" catchtap="play"> | ||
12 | + <video src="{{item.url}}" wx:if="{{item.type == 'video'}}" class="slide-image" autoplay="{{true}}" | ||
13 | + controls="{{true}}" bindpause="clickStop"></video> | ||
14 | + </view> | ||
15 | + <view wx:else class="video-box {{item.video_img!==''?'position-re':''}}" catchtap="play"> | ||
16 | + <block wx:if="{{item.video_img !== ''}}"> | ||
17 | + <image src="{{item.video_img}}" | ||
18 | + class="slide-image fmImg" mode="aspectFill"> | ||
19 | + </image> | ||
20 | + <image src='http://pjq0ww1cj.bkt.clouddn.com/video_btn.png' class="video_btn {{item.video_img!==''?'position-ab':''}}"></image> | ||
21 | + <!-- <view class="iconfont icon-ziyuan "></view> --> | ||
22 | + </block> | ||
23 | + <block wx:else> | ||
24 | + <view class="iconfont icon-ziyuan"></view> | ||
25 | + </block> | ||
26 | + </view> | ||
27 | + </block> | ||
28 | + <block wx:else> | ||
29 | + <image src="{{item.url}}" wx:if="{{item.type == 'image'}}" class="slide-image banner" mode="aspectFill"/> | ||
30 | + </block> | ||
31 | + </view> | ||
32 | + <!-- </navigator> --> | ||
33 | + </swiper-item> | ||
34 | + </block> | ||
16 | </swiper> | 35 | </swiper> |
17 | <view class='dots_box'> | 36 | <view class='dots_box'> |
18 | <view class="dots"> | 37 | <view class="dots"> |
@@ -23,12 +42,9 @@ | @@ -23,12 +42,9 @@ | ||
23 | </view> | 42 | </view> |
24 | </view> | 43 | </view> |
25 | <view class='case_info'> | 44 | <view class='case_info'> |
26 | - <view class='case_title'>某政府科技金融中心</view> | 45 | + <view class='case_title'>{{data.title}}</view> |
27 | <view class='lable_list_box'> | 46 | <view class='lable_list_box'> |
28 | - <view class='lable_list'>政府</view> | ||
29 | - <view class='lable_list'>工作效率</view> | ||
30 | - <view class='lable_list'>业务分析</view> | ||
31 | - <view class='lable_list'>快速报表</view> | 47 | + <view class='lable_list' wx:for="{{data.label}}" wx:key="index">{{item.name}}</view> |
32 | </view> | 48 | </view> |
33 | </view> | 49 | </view> |
34 | </view> | 50 | </view> |
@@ -45,12 +61,14 @@ | @@ -45,12 +61,14 @@ | ||
45 | </view> | 61 | </view> |
46 | <view class='info_box'> | 62 | <view class='info_box'> |
47 | <view class='info_list' wx:if="{{listStatus==0}}"> | 63 | <view class='info_list' wx:if="{{listStatus==0}}"> |
48 | - <!-- <import src="/wxParse/wxParse.wxml"/> | ||
49 | - <template is="wxParse" data="{{wxParseData:article.nodes}}"/> --> | ||
50 | - <image src="http://pjq0ww1cj.bkt.clouddn.com/jianjie.png" mode='widthFix'></image> | 64 | + <import src="../../wxParse/wxParse.wxml"/> |
65 | + <template is="wxParse" data="{{wxParseData:content_1.nodes}}"/> | ||
66 | + <!-- <image src="http://pjq0ww1cj.bkt.clouddn.com/jianjie.png" mode='widthFix'></image> --> | ||
51 | </view> | 67 | </view> |
52 | <view class='info_list' wx:else> | 68 | <view class='info_list' wx:else> |
53 | - <image src="http://pjq0ww1cj.bkt.clouddn.com/shishi.png" mode='widthFix'></image> | 69 | + <import src="../../wxParse/wxParse.wxml"/> |
70 | + <template is="wxParse" data="{{wxParseData:content_2.nodes}}"/> | ||
71 | + <!-- <image src="http://pjq0ww1cj.bkt.clouddn.com/shishi.png" mode='widthFix'></image> --> | ||
54 | </view> | 72 | </view> |
55 | </view> | 73 | </view> |
56 | </view> | 74 | </view> |
1 | /* pages/caseDetail/caseDetail.wxss */ | 1 | /* pages/caseDetail/caseDetail.wxss */ |
2 | -/* @import "/wxParse/wxParse.wxss"; */ | 2 | +@import "../../wxParse/wxParse.wxss"; |
3 | .case_detail_page { | 3 | .case_detail_page { |
4 | /* height: 100%; */ | 4 | /* height: 100%; */ |
5 | background: #F0ECEA; | 5 | background: #F0ECEA; |
@@ -16,12 +16,57 @@ | @@ -16,12 +16,57 @@ | ||
16 | 16 | ||
17 | .case_detail_banner swiper { | 17 | .case_detail_banner swiper { |
18 | width: 100%; | 18 | width: 100%; |
19 | + display: block; | ||
19 | height: 466rpx; | 20 | height: 466rpx; |
20 | } | 21 | } |
21 | -.case_detail_banner swiper image { | 22 | +.case_detail_banner swiper image.banner { |
22 | width: 100%; | 23 | width: 100%; |
23 | height: 100%; | 24 | height: 100%; |
24 | } | 25 | } |
26 | +.index_top { | ||
27 | + width: 100%; | ||
28 | + height: 100%; | ||
29 | + overflow: hidden; | ||
30 | + display: flex; | ||
31 | +} | ||
32 | + | ||
33 | +.fmImg { | ||
34 | + width: 100%; | ||
35 | + height: 100%; | ||
36 | +} | ||
37 | + | ||
38 | +.index_top video { | ||
39 | + width: 100%; | ||
40 | + height: 100%; | ||
41 | +} | ||
42 | + | ||
43 | +.video-box { | ||
44 | + width: 100%; | ||
45 | + height: 100%; | ||
46 | + /* background: #000; */ | ||
47 | + display: flex; | ||
48 | + align-items: center; | ||
49 | + justify-content: center; | ||
50 | +} | ||
51 | +.video_btn { | ||
52 | + width: 78rpx; | ||
53 | + height: 78rpx; | ||
54 | + position: absolute; | ||
55 | + top: 50%; | ||
56 | + left: 50%; | ||
57 | + margin-left: -39rpx; | ||
58 | + margin-top: -39rpx; | ||
59 | +} | ||
60 | +.position-re { | ||
61 | + display: block; | ||
62 | + /* position: relative; */ | ||
63 | +} | ||
64 | +.position-ab { | ||
65 | + position: absolute; | ||
66 | + top: 46%; | ||
67 | + left: 47%; | ||
68 | +} | ||
69 | +/* 小圆点 */ | ||
25 | .dots_box { | 70 | .dots_box { |
26 | width: 100%; | 71 | width: 100%; |
27 | height:54rpx; | 72 | height:54rpx; |
@@ -126,6 +171,9 @@ background-color: #FB7F47; | @@ -126,6 +171,9 @@ background-color: #FB7F47; | ||
126 | } | 171 | } |
127 | .info_box .info_list { | 172 | .info_box .info_list { |
128 | width: 100%; | 173 | width: 100%; |
174 | + font-size: 30rpx; | ||
175 | + color: #4D4D4D; | ||
176 | + margin-top: 10rpx; | ||
129 | } | 177 | } |
130 | .info_list image { | 178 | .info_list image { |
131 | width: 100%; | 179 | width: 100%; |
1 | // pages/caseList/caseList.js | 1 | // pages/caseList/caseList.js |
2 | +const app=getApp(); | ||
2 | Page({ | 3 | Page({ |
3 | 4 | ||
4 | /** | 5 | /** |
@@ -8,19 +9,50 @@ Page({ | @@ -8,19 +9,50 @@ Page({ | ||
8 | connectButton: [ | 9 | connectButton: [ |
9 | { className: "", text: "在线客服", bindtap: "" } | 10 | { className: "", text: "在线客服", bindtap: "" } |
10 | ], | 11 | ], |
12 | + caseList: [], | ||
13 | + page: 1, | ||
14 | + typeId: null, | ||
11 | }, | 15 | }, |
12 | 16 | ||
13 | /** | 17 | /** |
14 | * 生命周期函数--监听页面加载 | 18 | * 生命周期函数--监听页面加载 |
15 | */ | 19 | */ |
16 | onLoad: function (options) { | 20 | onLoad: function (options) { |
17 | - wx.setNavigationBarTitle({ | ||
18 | - title: options.html, | 21 | + let that = this; |
22 | + wx.setNavigationBarTitle({ | ||
23 | + title: options.html, | ||
24 | + }); | ||
25 | + that.setData({ | ||
26 | + typeId: options.id | ||
27 | + }) | ||
28 | + that.getData(); | ||
29 | + }, | ||
30 | + getData() { | ||
31 | + let that = this; | ||
32 | + let url = '/portal/Api/listCategory'; | ||
33 | + console.log(that.data.page); | ||
34 | + console.log(that.data.typeId); | ||
35 | + let data = { | ||
36 | + typeId: that.data.typeId, | ||
37 | + page: that.data.page, | ||
38 | + }; | ||
39 | + app.post(url, data).then((res) => { | ||
40 | + console.log('res',res); | ||
41 | + let data = []; | ||
42 | + // data. | ||
43 | + that.setData({ | ||
44 | + caseList: that.data.caseList.concat(res.list) | ||
19 | }) | 45 | }) |
46 | + | ||
47 | + | ||
48 | + }).catch((err) => { | ||
49 | + console.log(err); | ||
50 | + }) | ||
20 | }, | 51 | }, |
21 | jumpFun(e) { | 52 | jumpFun(e) { |
53 | + // console.log(e.currentTarget.dataset.id); | ||
22 | wx.navigateTo({ | 54 | wx.navigateTo({ |
23 | - url: '../caseDetail/caseDetail' | 55 | + url: '../caseDetail/caseDetail?id=' + e.currentTarget.dataset.id |
24 | }) | 56 | }) |
25 | }, | 57 | }, |
26 | 58 | ||
@@ -63,7 +95,11 @@ Page({ | @@ -63,7 +95,11 @@ Page({ | ||
63 | * 页面上拉触底事件的处理函数 | 95 | * 页面上拉触底事件的处理函数 |
64 | */ | 96 | */ |
65 | onReachBottom: function () { | 97 | onReachBottom: function () { |
66 | - | 98 | + var that = this; |
99 | + that.setData({ | ||
100 | + page: that.data.page + 1 | ||
101 | + }) | ||
102 | + that.getData(); | ||
67 | }, | 103 | }, |
68 | 104 | ||
69 | /** | 105 | /** |
1 | <!--pages/caseList/caseList.wxml--> | 1 | <!--pages/caseList/caseList.wxml--> |
2 | <view class='case_list_wrap'> | 2 | <view class='case_list_wrap'> |
3 | <view class='case_list_box'> | 3 | <view class='case_list_box'> |
4 | - <view class='case_list'> | 4 | + <view class='case_list' wx:for="{{caseList}}" wx:key='index'> |
5 | <view class='case_top'> | 5 | <view class='case_top'> |
6 | - <view class='case_title' bindtap='jumpFun'>某政府科技金融中心</view> | 6 | + <view class='case_title' bindtap='jumpFun' data-id="{{item.id}}">{{item.title}}</view> |
7 | <view class='case_lable_box'> | 7 | <view class='case_lable_box'> |
8 | - <view class='case_lable_list'>政府</view> | ||
9 | - <view class='case_lable_list'>工作效率</view> | ||
10 | - <view class='case_lable_list'>业务分析</view> | ||
11 | - <view class='case_lable_list'>快速报表</view> | 8 | + <view class='case_lable_list' wx:for="{{item.label}}" wx:key='index'>{{item.name}}</view> |
12 | </view> | 9 | </view> |
13 | </view> | 10 | </view> |
14 | <view class='case_list_content'> | 11 | <view class='case_list_content'> |
15 | - <image src='http://pjq0ww1cj.bkt.clouddn.com/case_list.png'></image> | 12 | + <video wx:if="item.video_type == true" src='{{item.video}}'></video> |
13 | + <image wx:else src='http://pjq0ww1cj.bkt.clouddn.com/case_list.png'></image> | ||
16 | </view> | 14 | </view> |
17 | <view class='case_bottom_list'> | 15 | <view class='case_bottom_list'> |
18 | - <view class='case_bottom_banner'> | ||
19 | - <image mode='widthFix' src='http://pjq0ww1cj.bkt.clouddn.com/case_bottom_list01.png'></image> | ||
20 | - </view> | ||
21 | - <view class='case_bottom_banner'> | ||
22 | - <image mode='widthFix' src='http://pjq0ww1cj.bkt.clouddn.com/case_bottom_list01.png'></image> | ||
23 | - </view> | ||
24 | - <view class='case_bottom_banner'> | ||
25 | - <image mode='widthFix' src='http://pjq0ww1cj.bkt.clouddn.com/case_bottom_list01.png'></image> | ||
26 | - </view> | ||
27 | - </view> | ||
28 | - </view> | ||
29 | - <view class='case_list'> | ||
30 | - <view class='case_top'> | ||
31 | - <view class='case_title' bindtap='jumpFun'>某政府科技金融中心</view> | ||
32 | - <view class='case_lable_box'> | ||
33 | - <view class='case_lable_list'>政府</view> | ||
34 | - <view class='case_lable_list'>工作效率</view> | ||
35 | - <view class='case_lable_list'>业务分析</view> | ||
36 | - <view class='case_lable_list'>快速报表</view> | ||
37 | - </view> | ||
38 | - </view> | ||
39 | - <view class='case_list_content'> | ||
40 | - <image src='http://pjq0ww1cj.bkt.clouddn.com/case_list.png'></image> | ||
41 | - </view> | ||
42 | - <view class='case_bottom_list'> | ||
43 | - <view class='case_bottom_banner'> | ||
44 | - <image mode='widthFix' src='http://pjq0ww1cj.bkt.clouddn.com/case_bottom_list01.png'></image> | ||
45 | - </view> | ||
46 | - <view class='case_bottom_banner'> | ||
47 | - <image mode='widthFix' src='http://pjq0ww1cj.bkt.clouddn.com/case_bottom_list01.png'></image> | ||
48 | - </view> | ||
49 | - <view class='case_bottom_banner'> | ||
50 | - <image mode='widthFix' src='http://pjq0ww1cj.bkt.clouddn.com/case_bottom_list01.png'></image> | ||
51 | - </view> | ||
52 | - </view> | ||
53 | - </view> | ||
54 | - <view class='case_list'> | ||
55 | - <view class='case_top'> | ||
56 | - <view class='case_title' bindtap='jumpFun'>某政府科技金融中心</view> | ||
57 | - <view class='case_lable_box'> | ||
58 | - <view class='case_lable_list'>政府</view> | ||
59 | - <view class='case_lable_list'>工作效率</view> | ||
60 | - <view class='case_lable_list'>业务分析</view> | ||
61 | - <view class='case_lable_list'>快速报表</view> | ||
62 | - </view> | ||
63 | - </view> | ||
64 | - <view class='case_list_content'> | ||
65 | - <image src='http://pjq0ww1cj.bkt.clouddn.com/case_list.png'></image> | ||
66 | - </view> | ||
67 | - <view class='case_bottom_list'> | ||
68 | - <view class='case_bottom_banner'> | ||
69 | - <image mode='widthFix' src='http://pjq0ww1cj.bkt.clouddn.com/case_bottom_list01.png'></image> | ||
70 | - </view> | ||
71 | - <view class='case_bottom_banner'> | ||
72 | - <image mode='widthFix' src='http://pjq0ww1cj.bkt.clouddn.com/case_bottom_list01.png'></image> | ||
73 | - </view> | ||
74 | - <view class='case_bottom_banner'> | ||
75 | - <image mode='widthFix' src='http://pjq0ww1cj.bkt.clouddn.com/case_bottom_list01.png'></image> | ||
76 | - </view> | ||
77 | - <view class='case_bottom_banner'> | ||
78 | - <image mode='widthFix' src='http://pjq0ww1cj.bkt.clouddn.com/case_bottom_list01.png'></image> | ||
79 | - </view> | ||
80 | - <view class='case_bottom_banner'> | ||
81 | - <image mode='widthFix' src='http://pjq0ww1cj.bkt.clouddn.com/case_bottom_list01.png'></image> | ||
82 | - </view> | ||
83 | - <view class='case_bottom_banner'> | ||
84 | - <image mode='widthFix' src='http://pjq0ww1cj.bkt.clouddn.com/case_bottom_list01.png'></image> | 16 | + <view class='case_bottom_banner' wx:for="{{item.image}}" wx:key='index'> |
17 | + <image mode='widthFix' src='{{item.url}}'></image> | ||
85 | </view> | 18 | </view> |
86 | </view> | 19 | </view> |
87 | </view> | 20 | </view> |
1 | /* pages/caseList/caseList.wxss */ | 1 | /* pages/caseList/caseList.wxss */ |
2 | .case_list_wrap { | 2 | .case_list_wrap { |
3 | width: 100%; | 3 | width: 100%; |
4 | - /* height: 100%; */ | 4 | + min-height: 100%; |
5 | background: #F0EFED; | 5 | background: #F0EFED; |
6 | } | 6 | } |
7 | .case_list_box { | 7 | .case_list_box { |
@@ -51,11 +51,16 @@ | @@ -51,11 +51,16 @@ | ||
51 | width: 100%; | 51 | width: 100%; |
52 | height: 100%; | 52 | height: 100%; |
53 | } | 53 | } |
54 | +.case_list_content video { | ||
55 | + width: 100%; | ||
56 | + height: 100%; | ||
57 | +} | ||
54 | .case_bottom_list { | 58 | .case_bottom_list { |
55 | height: 206rpx; | 59 | height: 206rpx; |
56 | padding: 10rpx 0 50rpx 10rpx; | 60 | padding: 10rpx 0 50rpx 10rpx; |
57 | display: flex; | 61 | display: flex; |
58 | overflow-x: scroll; | 62 | overflow-x: scroll; |
63 | + overflow-y:hidden; | ||
59 | box-sizing: border-box; | 64 | box-sizing: border-box; |
60 | } | 65 | } |
61 | .case_bottom_banner { | 66 | .case_bottom_banner { |
1 | //index.js | 1 | //index.js |
2 | //获取应用实例 | 2 | //获取应用实例 |
3 | const app = getApp() | 3 | const app = getApp() |
4 | - | 4 | +var touchDot = 0;//触摸时的原点 |
5 | +var time = 0;// 时间记录,用于滑动时且时间小于1s则执行左右滑动 | ||
6 | +var interval = "";// 记录/清理时间记录 | ||
5 | Page({ | 7 | Page({ |
6 | data: { | 8 | data: { |
7 | 9 | ||
@@ -21,6 +23,39 @@ Page({ | @@ -21,6 +23,39 @@ Page({ | ||
21 | app.slideupshow(this, 'slide_up1', 0, 1); | 23 | app.slideupshow(this, 'slide_up1', 0, 1); |
22 | app.sliderightshow(this, 'slide_up2', 0, 1); | 24 | app.sliderightshow(this, 'slide_up2', 0, 1); |
23 | }, | 25 | }, |
26 | + // 触摸开始事件 | ||
27 | + touchStart: function (e) { | ||
28 | + touchDot = e.touches[0].pageX; // 获取触摸时的原点 | ||
29 | + // 使用js计时器记录时间 | ||
30 | + interval = setInterval(function () { | ||
31 | + time++; | ||
32 | + }, 100); | ||
33 | + }, | ||
34 | + // 触摸移动事件 | ||
35 | + touchMove: function (e) { | ||
36 | + var touchMove = e.touches[0].pageX; | ||
37 | + console.log("touchMove:" + touchMove + " touchDot:" + touchDot + " diff:" + (touchMove - touchDot)); | ||
38 | + // 向左滑动 | ||
39 | + console.log(time) | ||
40 | + if (touchMove - touchDot <= -40 && time < 10) { | ||
41 | + wx.navigateTo({ | ||
42 | + url: '../case/case' | ||
43 | + }); | ||
44 | + } | ||
45 | + // 向右滑动 | ||
46 | + if (touchMove - touchDot >= 40 && time < 10) { | ||
47 | + console.log('向右滑动'); | ||
48 | + // alert("已经是第一页了") | ||
49 | + // wx.switchTab({ | ||
50 | + // // url: '../case/case' | ||
51 | + // }); | ||
52 | + } | ||
53 | + }, | ||
54 | + // 触摸结束事件 | ||
55 | + touchEnd: function (e) { | ||
56 | + clearInterval(interval); // 清除setInterval | ||
57 | + time = 0; | ||
58 | + }, | ||
24 | getUserInfo: function (e) { | 59 | getUserInfo: function (e) { |
25 | 60 | ||
26 | }, | 61 | }, |
@@ -30,12 +65,16 @@ Page({ | @@ -30,12 +65,16 @@ Page({ | ||
30 | }) | 65 | }) |
31 | }, | 66 | }, |
32 | /** | 67 | /** |
68 | + * 生命周期函数--监听页面显示 | ||
69 | + */ | ||
70 | + onShow: function () { | ||
71 | + | ||
72 | + }, | ||
73 | + /** | ||
33 | * 页面上拉触底事件的处理函数 | 74 | * 页面上拉触底事件的处理函数 |
34 | */ | 75 | */ |
35 | onReachBottom: function () { | 76 | onReachBottom: function () { |
36 | - wx.navigateTo({ | ||
37 | - url: '../case/case' | ||
38 | - }) | 77 | + |
39 | }, | 78 | }, |
40 | 79 | ||
41 | 80 |
1 | <!--index.wxml--> | 1 | <!--index.wxml--> |
2 | -<view class="container"> | 2 | +<view class="container" bindtouchstart="touchStart" bindtouchmove="touchMove" bindtouchend="touchEnd" > |
3 | <view class='imgPolytope'> | 3 | <view class='imgPolytope'> |
4 | <image src='http://pjq0ww1cj.bkt.clouddn.com/shouye.png'></image> | 4 | <image src='http://pjq0ww1cj.bkt.clouddn.com/shouye.png'></image> |
5 | </view> | 5 | </view> |
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | <view class='content contentInit' animation="{{slide_up2}}">大数据探索商业价值的无限可能</view> | 8 | <view class='content contentInit' animation="{{slide_up2}}">大数据探索商业价值的无限可能</view> |
9 | </view> | 9 | </view> |
10 | <view class='drop_img' bindtap="tapName"> | 10 | <view class='drop_img' bindtap="tapName"> |
11 | - <image src='http://pjq0ww1cj.bkt.clouddn.com/drop.png'></image> | 11 | + <image src='http://pjq0ww1cj.bkt.clouddn.com/right.png'></image> |
12 | </view> | 12 | </view> |
13 | 13 | ||
14 | </view> | 14 | </view> |
-
请 注册 或 登录 后发表评论