作者 乔蒙蒙

锐网

正在显示 59 个修改的文件 包含 2337 行增加117 行删除

要显示太多修改。

为保证性能只显示 59 of 59+ 个文件。

1 //app.js 1 //app.js
2 App({ 2 App({
3 - onLaunch: function () {  
4 - // 展示本地存储能力  
5 - var logs = wx.getStorageSync('logs') || []  
6 - logs.unshift(Date.now())  
7 - wx.setStorageSync('logs', logs) 3 + data: {
  4 + minscreenHeight: 0,
  5 + },
  6 + onLaunch: function () {
  7 + this.getHeight(1)
  8 + },
  9 + getHeight: function (n) {
  10 + var _this = this;
  11 + wx.getSystemInfo({
  12 + success: function (res) {
  13 + _this.data.minscreenHeight = res.windowHeight * n
  14 + }
  15 + })
  16 + },
  17 + goTop: function () {
  18 + wx.pageScrollTo({
  19 + scrollTop: 0,
  20 + duration: 100
  21 + })
  22 + },
  23 + /**
  24 +* 自定义post函数,返回Promise
  25 +* +-------------------
  26 +* @param {String} url 接口网址
  27 +* @param {arrayObject} data 要传的数组对象 like: {name: 'name', age: 32}
  28 +* +-------------------
  29 +* @return {Promise} promise 返回promise供后续操作
  30 +*/
  31 + post: function (url, data, headerParams) {
  32 + wx.showNavigationBarLoading()
  33 + wx.showLoading({
  34 + title: '加载中',
  35 + })
  36 + var promise = new Promise((resolve, reject) => {
  37 + let that = this;
  38 + let postData = data;
  39 + let baseUrl = 'http://ruiwechat.w.bronet.cn/';
  40 + //网络请求
  41 + let header = {
  42 + 'content-type': 'application/x-www-form-urlencoded'
  43 + }
  44 + header = Object.assign(header, headerParams)
  45 + wx.request({
  46 + url: baseUrl + url,
  47 + data: postData,
  48 + method: 'POST',
  49 + header: header,
  50 + success: function (res) {//返回取得的数据
  51 + if (res.data.code == '200') {
  52 + resolve(res.data.data);
  53 + } else if (res.data.code == '10001') {//用户未
  54 + // wx.showModal({
  55 + // title: '提示',
  56 + // content: res.data.msg,
  57 + // showCancel: false,
  58 + // success: function (res) {
  59 + // if (res.confirm) {
  60 + // wx.removeStorageSync('token');
  61 + // wx.navigateTo({
  62 + // url: '/pages/start/start',
  63 + // })
  64 + // }
  65 + // }
  66 + // })
  67 + } else if (res.data.code == '40000') {
  68 + wx.showModal({
  69 + title: '提示',
  70 + content: res.data.msg,
  71 + showCancel: false,
  72 + success: function (res) { }
  73 + })
  74 + } else if (res.data.code == '40005') {
8 75
9 - // 登录  
10 - wx.login({  
11 - success: res => {  
12 - // 发送 res.code 到后台换取 openId, sessionKey, unionId  
13 - }  
14 - })  
15 - // 获取用户信息  
16 - wx.getSetting({  
17 - success: res => {  
18 - if (res.authSetting['scope.userInfo']) {  
19 - // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框  
20 - wx.getUserInfo({  
21 - success: res => {  
22 - // 可以将 res 发送给后台解码出 unionId  
23 - this.globalData.userInfo = res.userInfo 76 + } else if (res.data.code == '40006') {
24 77
25 - // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回  
26 - // 所以此处加入 callback 以防止这种情况  
27 - if (this.userInfoReadyCallback) {  
28 - this.userInfoReadyCallback(res) 78 + } else {
  79 + wx.showModal({
  80 + title: '提示',
  81 + content: res.data.msg,
  82 + showCancel: false,
  83 + })
  84 + reject(res.data)
  85 + }
  86 + wx.hideLoading()
  87 + wx.hideNavigationBarLoading()
  88 + },
  89 + error: function (e) {
  90 + console.log(e)
  91 + reject('网络出错');
  92 + // wx.hideLoading()
  93 + wx.hideNavigationBarLoading()
29 } 94 }
30 - }  
31 }) 95 })
32 - }  
33 - }  
34 - }) 96 + });
  97 +
  98 + return promise;
35 }, 99 },
36 globalData: { 100 globalData: {
37 userInfo: null 101 userInfo: null
38 - } 102 + },
  103 +
  104 +
  105 +// 动画
  106 + //渐入,渐出实现
  107 + show: function (that, param, opacity) {
  108 + var animation = wx.createAnimation({
  109 + //持续时间800ms
  110 + duration: 800,
  111 + timingFunction: 'ease',
  112 + });
  113 + //var animation = this.animation
  114 + animation.opacity(opacity).step()
  115 + //将param转换为key
  116 + var json = '{"' + param + '":""}'
  117 + json = JSON.parse(json);
  118 + json[param] = animation.export()
  119 + //设置动画
  120 + that.setData(json)
  121 + },
  122 +
  123 + //滑动渐入渐出
  124 + slideupshow: function (that, param, px, opacity) {
  125 + var animation = wx.createAnimation({
  126 + duration: 1000,
  127 + timingFunction: 'ease',
  128 + });
  129 + animation.translateY(px).opacity(opacity).step()
  130 + //将param转换为key
  131 + var json = '{"' + param + '":""}'
  132 + json = JSON.parse(json);
  133 + json[param] = animation.export()
  134 + //设置动画
  135 + that.setData(json)
  136 + },
  137 +
  138 + //向右滑动渐入渐出
  139 + sliderightshow: function (that, param, px, opacity) {
  140 + var animation = wx.createAnimation({
  141 + duration: 1500,
  142 + timingFunction: 'ease',
  143 + });
  144 + animation.translateX(px).opacity(opacity).step()
  145 + //将param转换为key
  146 + var json = '{"' + param + '":""}'
  147 + json = JSON.parse(json);
  148 + json[param] = animation.export()
  149 + //设置动画
  150 + that.setData(json)
  151 + },
39 }) 152 })
1 { 1 {
2 - "pages":[  
3 - "pages/index/index",  
4 - "pages/logs/logs"  
5 - ],  
6 - "window":{  
7 - "backgroundTextStyle":"light",  
8 - "navigationBarBackgroundColor": "#fff",  
9 - "navigationBarTitleText": "WeChat",  
10 - "navigationBarTextStyle":"black"  
11 - } 2 + "pages": [
  3 + "pages/index/index",
  4 + "pages/about/about",
  5 + "pages/case/case",
  6 + "pages/caseDetail/caseDetail",
  7 + "pages/caseList/caseList",
  8 + "pages/application/application",
  9 + "pages/logs/logs"
  10 + ],
  11 + "window": {
  12 + "backgroundTextStyle": "light",
  13 + "navigationBarBackgroundColor": "#fff",
  14 + "navigationBarTitleText": "WeChat",
  15 + "navigationBarTextStyle": "black"
  16 + }
12 } 17 }
  18 +
1 /**app.wxss**/ 1 /**app.wxss**/
  2 +page {
  3 + width: 100%;
  4 + height: 100%;
  5 +}
2 .container { 6 .container {
3 height: 100%; 7 height: 100%;
  8 + width: 100%;
4 display: flex; 9 display: flex;
5 flex-direction: column; 10 flex-direction: column;
6 align-items: center; 11 align-items: center;
7 justify-content: space-between; 12 justify-content: space-between;
8 - padding: 200rpx 0;  
9 - box-sizing: border-box; 13 + /* padding: 200rpx 0; */
  14 + /* box-sizing: border-box; */
10 } 15 }
  16 +.drop_img {
  17 + width: 30rpx;
  18 + height: 27rpx;
  19 + cursor: pointer;
  20 + margin: 0 auto 40rpx;
  21 +}
  22 +.drop_img image {
  23 + width: 100%;
  24 + height: 100%;
  25 +}
  26 +
  27 +/* 客服 */
  28 +.chat_peo {
  29 + position: fixed;
  30 + width: 86rpx;
  31 + height: 86rpx;
  32 + bottom: 80rpx;
  33 + right: 24rpx;
  34 + z-index: 10;
  35 +}
  36 +button::after {
  37 + border: none;
  38 + opacity: 0;
  39 +}
  40 + .contacButton {
  41 + background: none;
  42 + border: none;
  43 + padding: 0;
  44 + display:inline-block;
  45 + width:100%;
  46 + height:100%;
  47 +}
  48 +.chat_peo image {
  49 + width: 100%;
  50 + height: 100%;
  51 +}
  52 +
  53 +/* 返回顶部 */
  54 +.return_top {
  55 + bottom: 187rpx;
  56 +}
  57 +
  58 +/* 去除滚动条 */
  59 +::-webkit-scrollbar {
  60 + width: 0;
  61 + height: 0;
  62 + color: transparent;
  63 +}
  64 +
  65 +
  66 +
  67 +
  68 +
  69 +
  70 +
  1 +// pages/about/about.js
  2 +const app = getApp();
  3 +Page({
  4 +
  5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + connectButton: [
  10 + { className: "", text: "在线客服", bindtap: "" }
  11 + ],
  12 + minscreenHeight: 0,
  13 + scrollTop: 0,
  14 + },
  15 + onPageScroll: function (e) { // 获取滚动条当前位置
  16 + console.log(111);
  17 + console.log(e.scrollTop);
  18 + console.log(minscreenHeight);
  19 + this.setData({
  20 + scrollTop: e.scrollTop
  21 + })
  22 + },
  23 + goTop: function () {
  24 + app.goTop()
  25 + },
  26 +
  27 + /**
  28 + * 生命周期函数--监听页面加载
  29 + */
  30 + onLoad: function (options) {
  31 +
  32 + },
  33 +
  34 +
  35 + /**
  36 + * 生命周期函数--监听页面初次渲染完成
  37 + */
  38 + onReady: function () {
  39 +
  40 + },
  41 +
  42 + /**
  43 + * 生命周期函数--监听页面显示
  44 + */
  45 + onShow: function () {
  46 +
  47 + },
  48 +
  49 + /**
  50 + * 生命周期函数--监听页面隐藏
  51 + */
  52 + onHide: function () {
  53 +
  54 + },
  55 +
  56 + /**
  57 + * 生命周期函数--监听页面卸载
  58 + */
  59 + onUnload: function () {
  60 +
  61 + },
  62 +
  63 + /**
  64 + * 页面相关事件处理函数--监听用户下拉动作
  65 + */
  66 + onPullDownRefresh: function () {
  67 +
  68 + },
  69 +
  70 + /**
  71 + * 页面上拉触底事件的处理函数
  72 + */
  73 + onReachBottom: function () {
  74 +
  75 + },
  76 +
  77 + /**
  78 + * 用户点击右上角分享
  79 + */
  80 + onShareAppMessage: function () {
  81 +
  82 + }
  83 +})
  1 +{
  2 + "navigationBarTitleText": "关于我们"
  3 +}
  1 +<!--pages/about/about.wxml-->
  2 +<view class='about_wrap'>
  3 + <view class='about_top'>
  4 + <image src='../images/about.png'></image>
  5 + </view>
  6 + <view class='about_content'>
  7 + <image src='../images/about_content.png' mode="widthFix"></image>
  8 + </view>
  9 + <view class='about_contact_way'>
  10 + <view class='about_title'>
  11 + <image src='../images/phone.png'></image>
  12 + <view>联系我们</view>
  13 + </view>
  14 + <view class='about_contact_box'>
  15 + <view class='about_contact_list'>
  16 + <view>全国服务热线:</view>
  17 + <view class='about_contact_right'>400-6262-686</view>
  18 + </view>
  19 + <view class='about_contact_list'>
  20 + <view>销售咨询:</view>
  21 + <view class='about_contact_right'>kefu@riwon.com.cn</view>
  22 + </view>
  23 + <view class='about_contact_list'>
  24 + <view>天津运营中心:</view>
  25 + <view class='about_contact_right'>天津市华苑产业园榕苑路1号</view>
  26 + </view>
  27 + <view class='about_contact_list'>
  28 + <view>北京运营中心:</view>
  29 + <view class='about_contact_right'>北京亦庄经济开发区东经海三路天骥智谷33号楼4层</view>
  30 + </view>
  31 + </view>
  32 + </view>
  33 + <view class='sub_apply_box'>
  34 + <view class='sub_apply_title'>
  35 + <image src='../images/apply.png'></image>
  36 + </view>
  37 + <view class='sub_apply_list'>
  38 + <view class='sub_apply_must'>*</view>
  39 + <view class='sub_apply_input'>
  40 + <view class='sub_input_left'>
  41 + <image src='../images/user.png' mode="widthFix"></image>
  42 + </view>
  43 + <input type='text' maxlength='10' placeholder="请输入您的姓名" />
  44 + <text>姓名请输入不超过10个字</text>
  45 + </view>
  46 + </view>
  47 + <view class='sub_apply_list'>
  48 + <view class='sub_apply_must'>*</view>
  49 + <view class='sub_apply_input'>
  50 + <view class='sub_input_left'>
  51 + <image src='../images/input_phone.png' mode="widthFix"></image>
  52 + </view>
  53 + <input type='number' maxlength='11' placeholder="请输入您的联系方式" />
  54 + </view>
  55 + </view>
  56 + <view class='sub_apply_list'>
  57 + <view class='sub_apply_must'>*</view>
  58 + <view class='sub_apply_input'>
  59 + <view class='sub_input_left'>
  60 + <image src='../images/company.png' mode="widthFix"></image>
  61 + </view>
  62 + <input type='text' placeholder="请输入您的所在行业" />
  63 + </view>
  64 + </view>
  65 + <view class='sub_btn'>
  66 + <image src='../images/sub_btn.png'></image>
  67 + </view>
  68 + </view>
  69 + <!-- 客服 -->
  70 + <view class='chat_peo'>
  71 + <button open-type="contact" class='contacButton'>
  72 + <image src='../images/chat_peo.png'></image>
  73 + </button>
  74 + </view>
  75 + <!-- 返回顶部 -->
  76 + <view class='chat_peo return_top' wx:if="{{scrollTop>minscreenHeight}}" bindtap="goTop">
  77 + <image src='../images/dingbu.png'></image>
  78 + </view>
  79 +</view>
  1 +/* pages/about/about.wxss */
  2 +.about_wrap {
  3 + width: 100%;
  4 + height: 100%;
  5 + overflow: auto;
  6 +}
  7 +.about_top {
  8 + width: 100%;
  9 + height: 469rpx;
  10 + display: flex;
  11 + justify-content: center;
  12 + align-items: center;
  13 +}
  14 +.about_top image {
  15 + width: 690rpx;
  16 + height: 400rpx;
  17 +}
  18 +.about_content {
  19 + width: 100%;
  20 + box-sizing: border-box;
  21 + padding: 0 31rpx;
  22 + margin-top:30rpx;
  23 +
  24 +}
  25 +.about_content image {
  26 + width: 100%;
  27 + height: 100%;
  28 +}
  29 +.about_content text {
  30 + font-size: 30rpx;
  31 + color: #4D4D4D;
  32 +}
  33 +.about_contact_way {
  34 + width:690rpx;
  35 + background:rgba(250,248,247,1);
  36 + border-radius:10rpx;
  37 + margin: 35rpx auto 100rpx;
  38 + box-sizing: border-box;
  39 + padding: 40rpx 30rpx;
  40 +}
  41 +.about_title {
  42 + width: 100%;
  43 + height: 44rpx;
  44 + display: flex;
  45 + justify-content: flex-start;
  46 + align-items: center;
  47 + font-size: 32rpx;
  48 + color: #F0830C;
  49 +}
  50 +.about_title image {
  51 + width: 44rpx;
  52 + height: 44rpx;
  53 + margin-right: 20rpx;
  54 + vertical-align: middle;
  55 +}
  56 +.about_contact_box {
  57 + font-size: 28rpx;
  58 + color: #4D4D4D;
  59 + line-height: 50rpx;
  60 + margin-top: 35rpx;
  61 +}
  62 +.about_contact_list {
  63 + display: flex;
  64 + justify-content: flex-start;
  65 +}
  66 +.about_contact_right {
  67 + flex: 1;
  68 +}
  69 +.sub_apply_box {
  70 + margin-bottom: 80rpx;
  71 + width: 100%;
  72 +}
  73 +.sub_apply_box .sub_apply_title {
  74 + width: 100%;
  75 + box-sizing: border-box;
  76 + padding: 0 30rpx;
  77 + height: 147rpx;
  78 +}
  79 +.sub_apply_title image {
  80 + width: 100%;
  81 + height: 100%;
  82 +}
  83 +.sub_apply_list {
  84 + width: 100%;
  85 + box-sizing: border-box;
  86 + padding: 0 30rpx;
  87 + margin-top: 40rpx;
  88 + display: flex;
  89 + justify-content: flex-start;
  90 + align-items: center;
  91 +}
  92 +.sub_apply_must {
  93 + font-size: 34rpx;
  94 + color: #E10202;
  95 + margin-right: 14rpx;
  96 +}
  97 +.sub_apply_input {
  98 + flex: 1;
  99 + height:90rpx;
  100 + background:rgba(245,244,242,1);
  101 + border-radius:10rpx;
  102 + display: flex;
  103 + justify-content: flex-start;
  104 + align-items: center;
  105 + position: relative;
  106 +}
  107 +.sub_apply_input.active {
  108 + border: 1px solid #E10202;
  109 +}
  110 +
  111 +.sub_apply_input .sub_input_left {
  112 + width: 40rpx;
  113 + height: 100%;
  114 + margin-left: 33rpx;
  115 + display: flex;
  116 + align-items: center;
  117 +}
  118 +.sub_input_left image {
  119 + width: 100%;
  120 +}
  121 +.sub_apply_input input {
  122 + flex: 1;
  123 + height: 100%;
  124 + padding-left: 15rpx;
  125 + color: #999999;
  126 + font-size: 30rpx;
  127 +}
  128 +.sub_apply_input text {
  129 + position: absolute;
  130 + font-size: 24rpx;
  131 + color: #E10202;
  132 + height: 40rpx;
  133 + bottom: -40rpx;
  134 + left: 96rpx;
  135 +}
  136 +.sub_btn {
  137 + width:320rpx;
  138 + height:90rpx;
  139 + border-radius:10rpx;
  140 + margin: 40rpx auto 0;
  141 +}
  142 +.sub_btn image {
  143 + width: 100%;
  144 + height: 100%;
  145 +}
  146 +
  147 +
  148 +
  149 +
  150 +
  151 +
  152 +
  153 +
  154 +
  1 +// pages/application/application.js
  2 +Page({
  3 +
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 + imgUrls: [
  9 + '../images/app_banner01.png',
  10 + '../images/app_banner01.png',
  11 + '../images/app_banner01.png',
  12 + ],
  13 + autoplay: true,
  14 + interval: 5000,
  15 + duration: 1000,
  16 + circular: true,
  17 + currentSwiper: 0,
  18 + },
  19 + changeIndicatorDots(e) {
  20 + this.setData({
  21 + indicatorDots: !this.data.indicatorDots
  22 + })
  23 + },
  24 + changeAutoplay(e) {
  25 + this.setData({
  26 + autoplay: !this.data.autoplay
  27 + })
  28 + },
  29 + intervalChange(e) {
  30 + this.setData({
  31 + interval: e.detail.value
  32 + })
  33 + },
  34 + durationChange(e) {
  35 + this.setData({
  36 + duration: e.detail.value
  37 + })
  38 + },
  39 + swiperChange: function (e) {
  40 + this.setData({
  41 + currentSwiper: e.detail.current
  42 + })
  43 + },
  44 +
  45 + /**
  46 + * 生命周期函数--监听页面加载
  47 + */
  48 + onLoad: function (options) {
  49 +
  50 + },
  51 + jumpFun: function (e) {
  52 + wx.navigateTo({
  53 + url: '../about/about'
  54 + })
  55 + },
  56 +
  57 + /**
  58 + * 生命周期函数--监听页面初次渲染完成
  59 + */
  60 + onReady: function () {
  61 +
  62 + },
  63 +
  64 + /**
  65 + * 生命周期函数--监听页面显示
  66 + */
  67 + onShow: function () {
  68 +
  69 + },
  70 +
  71 + /**
  72 + * 生命周期函数--监听页面隐藏
  73 + */
  74 + onHide: function () {
  75 +
  76 + },
  77 +
  78 + /**
  79 + * 生命周期函数--监听页面卸载
  80 + */
  81 + onUnload: function () {
  82 +
  83 + },
  84 +
  85 + /**
  86 + * 页面相关事件处理函数--监听用户下拉动作
  87 + */
  88 + onPullDownRefresh: function () {
  89 +
  90 + },
  91 +
  92 + /**
  93 + * 页面上拉触底事件的处理函数
  94 + */
  95 + onReachBottom: function () {
  96 + wx.navigateTo({
  97 + url: '../about/about'
  98 + })
  99 + },
  100 +
  101 + /**
  102 + * 用户点击右上角分享
  103 + */
  104 + onShareAppMessage: function () {
  105 +
  106 + }
  107 +})
  1 +{
  2 + "navigationBarTitleText": "政府案例"
  3 +}
  1 +<!--pages/application/application.wxml-->
  2 +<view class='app_lication_banner'>
  3 + <swiper
  4 + bindchange='swiperChange'
  5 + autoplay="{{autoplay}}"
  6 + interval="{{interval}}"
  7 + duration="{{duration}}"
  8 + circular="{{circular}}"
  9 + >
  10 + <block wx:for="{{imgUrls}}" wx:key>
  11 + <swiper-item>
  12 + <image src="{{item}}" class="slide-image" width="100%" height="100%" />
  13 + </swiper-item>
  14 + </block>
  15 + </swiper>
  16 + <view class="dots">
  17 + <block wx:for="{{imgUrls}}" wx:key="">
  18 + <view class="dot{{index == currentSwiper ? ' active' : ''}}"></view>
  19 + </block>
  20 + </view>
  21 +
  22 + <!-- 跳转下一页 -->
  23 + <view class='drop_img' bindtap="jumpFun">
  24 + <image src='../images/drop.png'></image>
  25 + </view>
  26 +
  27 + <!-- 客服 -->
  28 + <view class='chat_peo' bindtap="jumpFun">
  29 + <image src='../images/chat_peo.png'></image>
  30 + </view>
  31 +
  32 +</view>
  1 +/* pages/application/application.wxss */
  2 +.app_lication_banner {
  3 + width: 100%;
  4 + height: 100%;
  5 +}
  6 +swiper {
  7 + width: 100%;
  8 + height: 100%;
  9 +}
  10 +swiper image {
  11 + width: 100%;
  12 + height: 100%;
  13 +}
  14 +
  15 +.dots{
  16 +/* width: 156rpx; */
  17 +height: 36rpx;
  18 +display: flex;
  19 +flex-direction: row;
  20 +position: absolute;
  21 +left: 325rpx;
  22 +bottom: 100rpx;
  23 +}
  24 +/*未选中时的小圆点样式 */
  25 +.dot{
  26 +width: 16rpx;
  27 +height: 16rpx;
  28 +border-radius: 50%;
  29 +margin-right: 26rpx;
  30 +background-color:#CCCCCC;
  31 +}
  32 +/*选中以后的小圆点样式 */
  33 +.active{
  34 +width: 16rpx;
  35 +height: 16rpx;
  36 +border-radius:8rpx;
  37 +background-color: #FB7F47;
  38 +}
  39 +
  40 +/* 跳转下一页 */
  41 +.drop_img {
  42 + position: absolute;
  43 + bottom: 40rpx;
  44 + left: 50%;
  45 + margin-left: -15rpx;
  46 +}
  47 +
  48 +
  49 +
  50 +
  51 +
  52 +
  53 +
  54 +
  55 +
  56 +
  57 +
  58 +
  59 +
  60 +
  61 +
  62 +
  63 +
  1 +// pages/case/case.js
  2 +const app=getApp();
  3 +Page({
  4 +
  5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + imgUrls: [
  10 + // '../images/banner.png',
  11 + // '../images/banner.png',
  12 + // '../images/banner.png',
  13 + ],
  14 + currentSwiper: 0,
  15 + autoplay: true,
  16 + interval: 5000,
  17 + duration: 1000,
  18 + circular: true,
  19 +
  20 + },
  21 + changeIndicatorDots(e) {
  22 + this.setData({
  23 + indicatorDots: !this.data.indicatorDots
  24 + })
  25 + },
  26 + changeAutoplay(e) {
  27 + this.setData({
  28 + autoplay: !this.data.autoplay
  29 + })
  30 + },
  31 + intervalChange(e) {
  32 + this.setData({
  33 + interval: e.detail.value
  34 + })
  35 + },
  36 + swiperChange: function (e) {
  37 + this.setData({
  38 + currentSwiper: e.detail.current
  39 + })
  40 + },
  41 + durationChange(e) {
  42 + this.setData({
  43 + duration: e.detail.value
  44 + })
  45 + },
  46 + getlist(){
  47 + let url ='portal/Api/index';
  48 + app.post(url,{}).then((res)=>{
  49 + // console.log('res',res);
  50 + if (res.type){
  51 + this.setData({
  52 + imgUrls: res.banner
  53 + })
  54 + }
  55 +
  56 +
  57 + }).catch((err)=>{
  58 + console.log(err);
  59 + })
  60 + },
  61 + caseDetailFun(e) {
  62 + wx.navigateTo({
  63 + url: '../caseDetail/caseDetail?id=' + e.currentTarget.dataset.id
  64 + })
  65 + },
  66 + goFun(e) {
  67 + wx.navigateTo({
  68 + url: '../caseList/caseList?html=' + e.currentTarget.dataset.html
  69 + })
  70 + },
  71 +
  72 + /**
  73 + * 生命周期函数--监听页面加载
  74 + */
  75 + onLoad: function (options) {
  76 + this.getlist();
  77 + },
  78 +
  79 + /**
  80 + * 生命周期函数--监听页面初次渲染完成
  81 + */
  82 + onReady: function () {
  83 +
  84 + },
  85 +
  86 + /**
  87 + * 生命周期函数--监听页面显示
  88 + */
  89 + onShow: function () {
  90 +
  91 + },
  92 +
  93 + /**
  94 + * 生命周期函数--监听页面隐藏
  95 + */
  96 + onHide: function () {
  97 +
  98 + },
  99 +
  100 + /**
  101 + * 生命周期函数--监听页面卸载
  102 + */
  103 + onUnload: function () {
  104 +
  105 + },
  106 + jumpFun: function (e) {
  107 + wx.navigateTo({
  108 + url: '../application/application'
  109 + })
  110 + },
  111 +
  112 + /**
  113 + * 页面相关事件处理函数--监听用户下拉动作
  114 + */
  115 + onPullDownRefresh: function () {
  116 +
  117 + },
  118 +
  119 + /**
  120 + * 页面上拉触底事件的处理函数
  121 + */
  122 + onReachBottom: function () {
  123 + wx.navigateTo({
  124 + url: '../application/application'
  125 + })
  126 + },
  127 +
  128 + /**
  129 + * 用户点击右上角分享
  130 + */
  131 + onShareAppMessage: function () {
  132 +
  133 + }
  134 +})
  1 +{
  2 + "navigationBarTitleText": "锐网科技"
  3 +}
  1 +<!--pages/case/case.wxml-->
  2 +<view class='case_wrap'>
  3 + <!--banner -->
  4 + <view class='case_banner_box'>
  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.url}}" data-id='{{item.category_id}}' bindtap='caseDetailFun' class="slide-image" width="100%" height="100%" />
  14 + </swiper-item>
  15 + </block>
  16 + </swiper>
  17 + <view class="dots">
  18 + <block wx:for="{{imgUrls}}" wx:key="">
  19 + <view class="dot{{index == currentSwiper ? ' active' : ''}}"></view>
  20 + </block>
  21 + </view>
  22 + </view>
  23 +
  24 + <!--案例类型 -->
  25 + <view class='case_box'>
  26 + <view class='case_title'>
  27 + <view class='case_title_content'>
  28 + <view class='case_contnet_line'></view>
  29 + <view class='case_title_text'>案例类型</view>
  30 + </view>
  31 + </view>
  32 + <view class='case_content'>
  33 + <view class='case_list' data-html="政府案例" bindtap='goFun'>
  34 + <image src='../images/zhengfu.png'></image>
  35 + <view class='case_list_text'>政府</view>
  36 + </view>
  37 + <view class='case_list' data-html="地产案例" bindtap='goFun'>
  38 + <image src='../images/dichan.png'></image>
  39 + <view class='case_list_text'>地产</view>
  40 + </view>
  41 + <view class='case_list' data-html="制造案例" bindtap='goFun'>
  42 + <image src='../images/zhizao.png'></image>
  43 + <view class='case_list_text'>制造</view>
  44 + </view>
  45 + <view class='case_list' data-html="教育案例" bindtap='goFun'>
  46 + <image src='../images/jiaoyu.png'></image>
  47 + <view class='case_list_text'>教育</view>
  48 + </view>
  49 + <view class='case_list' data-html="金融案例" bindtap='goFun'>
  50 + <image src='../images/jinrong.png'></image>
  51 + <view class='case_list_text'>金融</view>
  52 + </view>
  53 + <view class='case_list' data-html="零售案例" bindtap='goFun'>
  54 + <image src='../images/lingshou.png'></image>
  55 + <view class='case_list_text'>零售</view>
  56 + </view>
  57 + </view>
  58 + <view class='drop_img' bindtap="jumpFun">
  59 + <image src='../images/drop.png'></image>
  60 + </view>
  61 + </view>
  62 + <!-- 客服 -->
  63 + <view class='chat_peo' >
  64 + <button open-type="contact" class='contacButton'>
  65 + <image src='../images/chat_peo.png'></image>
  66 + </button>
  67 + </view>
  68 +
  69 +</view>
  1 +/* pages/case/case.wxss */
  2 +
  3 +.case_wrap {
  4 + width: 100%;
  5 + height: 100%;
  6 + background: #F0EEED;
  7 + position: relative;
  8 +}
  9 +.case_wrap .case_banner_box {
  10 + width: 100%;
  11 + height: 540rpx;
  12 + background: #fff;
  13 + position: relative;
  14 +}
  15 +.case_wrap .case_banner_box swiper {
  16 + width: 100%;
  17 + height: 487rpx;
  18 +}
  19 +.case_wrap .case_banner_box image {
  20 + width: 100%;
  21 + height: 100%;
  22 +}
  23 +.dots{
  24 +/* width: 156rpx; */
  25 +/* height: 36rpx; */
  26 +display: flex;
  27 +flex-direction: row;
  28 +position: absolute;
  29 +left: 320rpx;
  30 +bottom: 20rpx;
  31 +/* margin-top: -18rpx; */
  32 +}
  33 +/*未选中时的小圆点样式 */
  34 +.dot{
  35 +width: 16rpx;
  36 +height: 16rpx;
  37 +border-radius: 50%;
  38 +margin-right: 26rpx;
  39 +background-color:#CCCCCC;
  40 +}
  41 +/*选中以后的小圆点样式 */
  42 +.active{
  43 +width: 16rpx;
  44 +height: 16rpx;
  45 +border-radius:8rpx;
  46 +background-color: #FB7F47;
  47 +}
  48 +
  49 +/*案例css */
  50 +.case_box {
  51 + width: 100%;
  52 + height: 647rpx;
  53 + background: #fff;
  54 + position: absolute;
  55 + bottom: 0;
  56 + left: 0;
  57 + display: flex;
  58 + flex-direction: column;
  59 +}
  60 +.case_title {
  61 + width: 100%;
  62 + height: 112rpx;
  63 + display: flex;
  64 + justify-content: center;
  65 + align-items: center;
  66 +}
  67 +.case_title .case_title_content {
  68 + width:276rpx;
  69 + height: 100%;
  70 + position: relative;
  71 +}
  72 +.case_title_content .case_contnet_line {
  73 + position: absolute;
  74 + width:100%;
  75 + height:1rpx;
  76 + background:linear-gradient(90deg,rgba(240,131,12,1),rgba(230,0,18,1));
  77 + opacity:0.5;
  78 + left: 0;
  79 + top: 50%;
  80 +}
  81 +.case_title_content .case_title_text {
  82 + width: 142rpx;
  83 + height: 100%;
  84 + display: flex;
  85 + justify-content: center;
  86 + align-items: center;
  87 + position: absolute;
  88 + top: 0;
  89 + left: 50%;
  90 + margin-left: -76rpx;
  91 + background-color: #fff;
  92 + color: #000000;
  93 + font-size: 30rpx;
  94 +}
  95 +.case_content {
  96 + display: flex;
  97 + flex-wrap: wrap;
  98 +}
  99 +.case_content .case_list {
  100 + width: 194rpx;
  101 + height: 194rpx;
  102 + display: flex;
  103 + justify-content: center;
  104 + align-items: center;
  105 + color: #333333;
  106 + font-weight: 500;
  107 + font-size: 26rpx;
  108 + position: relative;
  109 + margin: 0 28rpx 30rpx;
  110 + border-radius:10rpx;
  111 +}
  112 +.case_list image {
  113 + position: absolute;
  114 + left: 0;
  115 + top: 0;
  116 + width: 100%;
  117 + height: 100%;
  118 + /* z-index: 0; */
  119 +}
  120 +.case_list_text {
  121 + position: absolute;
  122 + /* top: 50%;
  123 + left: 50%; */
  124 +}
  125 +
  126 +
  127 +
  128 +
  129 +
  130 +
  131 +
  132 +
  133 +
  134 +
  135 +
  136 +
  137 +
  138 +
  139 +
  140 +
  141 +
  142 +
  143 +
  144 +
  145 +
  146 +
  147 +
  148 +
  1 +// pages/caseDetail/caseDetail.js
  2 +// var WxParse = require('../../wxParse/wxParse.js');
  3 +const app = getApp();
  4 +Page({
  5 +
  6 + /**
  7 + * 页面的初始数据
  8 + */
  9 + data: {
  10 + imgUrls: [
  11 + // '../images/detail01.png',
  12 + // '../images/detail01.png',
  13 + // '../images/detail01.png',
  14 + ],
  15 + currentSwiper: 0,
  16 + autoplay: true,
  17 + interval: 5000,
  18 + duration: 1000,
  19 + circular: true,
  20 + listStatus: 0,
  21 + data: {},
  22 + minscreenHeight: 0,
  23 + scrollTop: 0,
  24 + },
  25 + changeIndicatorDots(e) {
  26 + this.setData({
  27 + indicatorDots: !this.data.indicatorDots
  28 + })
  29 + },
  30 + changeAutoplay(e) {
  31 + this.setData({
  32 + autoplay: !this.data.autoplay
  33 + })
  34 + },
  35 + intervalChange(e) {
  36 + this.setData({
  37 + interval: e.detail.value
  38 + })
  39 + },
  40 + swiperChange: function (e) {
  41 + this.setData({
  42 + currentSwiper: e.detail.current
  43 + })
  44 + },
  45 + durationChange(e) {
  46 + this.setData({
  47 + duration: e.detail.value
  48 + })
  49 + },
  50 + toggleFun(e) {
  51 + this.setData({
  52 + listStatus: e.currentTarget.dataset.id
  53 + })
  54 + },
  55 + onPageScroll: function (e) { // 获取滚动条当前位置
  56 + this.setData({
  57 + scrollTop: e.scrollTop
  58 + })
  59 + },
  60 + goTop: function () {
  61 + app.goTop()
  62 + },
  63 +
  64 + /**
  65 + * 生命周期函数--监听页面加载
  66 + */
  67 + onLoad: function (options) {
  68 + // console.log(options);
  69 + // let url = '/portal/Api/category';
  70 + // let data = {
  71 + // categoryId: options.id,
  72 + // };
  73 + // app.post(url, data).then((res) => {
  74 + // // console.log('res', res);
  75 + // if (res.type) {
  76 + // this.setData({
  77 + // imgUrls: res.banner,
  78 + // data: res,
  79 + // });
  80 + // let article = res.content_1;
  81 + // WxParse.wxParse('article', 'html', article, this, 5);
  82 + // }
  83 +
  84 +
  85 + // }).catch((err) => {
  86 + // console.log(err);
  87 + // })
  88 + },
  89 +
  90 +
  91 + /**
  92 + * 生命周期函数--监听页面初次渲染完成
  93 + */
  94 + onReady: function () {
  95 +
  96 + },
  97 +
  98 + /**
  99 + * 生命周期函数--监听页面显示
  100 + */
  101 + onShow: function () {
  102 +
  103 + },
  104 +
  105 + /**
  106 + * 生命周期函数--监听页面隐藏
  107 + */
  108 + onHide: function () {
  109 +
  110 + },
  111 +
  112 + /**
  113 + * 生命周期函数--监听页面卸载
  114 + */
  115 + onUnload: function () {
  116 +
  117 + },
  118 +
  119 + /**
  120 + * 页面相关事件处理函数--监听用户下拉动作
  121 + */
  122 + onPullDownRefresh: function () {
  123 +
  124 + },
  125 +
  126 + /**
  127 + * 页面上拉触底事件的处理函数
  128 + */
  129 + onReachBottom: function () {
  130 +
  131 + },
  132 +
  133 + /**
  134 + * 用户点击右上角分享
  135 + */
  136 + onShareAppMessage: function () {
  137 +
  138 + }
  139 +})
  1 +{
  2 + "navigationBarTitleText": "案例详情"
  3 +}
  1 +<!--pages/caseDetail/caseDetail.wxml-->
  2 +<view class='case_detail_page'>
  3 + <view class='case_detail_top'>
  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.url}}" class="slide-image" width="100%" height="100%" />
  14 + </swiper-item>
  15 + </block>
  16 + </swiper>
  17 + <view class='dots_box'>
  18 + <view class="dots">
  19 + <block wx:for="{{imgUrls}}" wx:key="">
  20 + <view class="dot{{index == currentSwiper ? ' active' : ''}}"></view>
  21 + </block>
  22 + </view>
  23 + </view>
  24 + </view>
  25 + <view class='case_info'>
  26 + <view class='case_title'>某政府科技金融中心</view>
  27 + <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>
  32 + </view>
  33 + </view>
  34 + </view>
  35 + <view class='case_info_lists'>
  36 + <view class='case_info_title'>
  37 + <view data-id='0' class="info_title_list {{listStatus == 0 ? ' now' : ''}}" bindtap='toggleFun'>
  38 + 项目简介
  39 + <view class='line'></view>
  40 + </view>
  41 + <view data-id='1' class="info_title_list {{listStatus == 1 ? ' now' : ''}}" bindtap='toggleFun'>
  42 + 实施与应用
  43 + <view class='line'></view>
  44 + </view>
  45 + </view>
  46 + <view class='info_box'>
  47 + <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="../images/jianjie.png" mode='widthFix'></image>
  51 + </view>
  52 + <view class='info_list' wx:else>
  53 + <image src="../images/shishi.png" mode='widthFix'></image>
  54 + </view>
  55 + </view>
  56 + </view>
  57 + <!-- 客服 -->
  58 + <view class='chat_peo'>
  59 + <button open-type="contact" class='contacButton'>
  60 + <image src='../images/chat_peo.png'></image>
  61 + </button>
  62 + </view>
  63 + <!-- 返回顶部 -->
  64 + <view class='chat_peo return_top' wx:if="{{scrollTop>minscreenHeight}}" bindtap="goTop" >
  65 + <image src='../images/dingbu.png'></image>
  66 + </view>
  67 +</view>
  1 +/* pages/caseDetail/caseDetail.wxss */
  2 +/* @import "/wxParse/wxParse.wxss"; */
  3 +.case_detail_page {
  4 + /* height: 100%; */
  5 + background: #F0ECEA;
  6 +}
  7 +.case_detail_top {
  8 + width: 100%;
  9 + /* height: 662rpx; */
  10 + margin-bottom: 17rpx;
  11 +}
  12 +.case_detail_banner {
  13 + width: 100%;
  14 + height: 520rpx;
  15 +}
  16 +
  17 +.case_detail_banner swiper {
  18 + width: 100%;
  19 + height: 466rpx;
  20 +}
  21 +.case_detail_banner swiper image {
  22 + width: 100%;
  23 + height: 100%;
  24 +}
  25 +.dots_box {
  26 + width: 100%;
  27 + height:54rpx;
  28 + background:rgba(1,6,17,1);
  29 + position: relative;
  30 +}
  31 +.dots{
  32 +/* width: 156rpx; */
  33 +height: 36rpx;
  34 +display: flex;
  35 +flex-direction: row;
  36 +align-items: center;
  37 +position: absolute;
  38 +left: 320rpx;
  39 +top: 50%;
  40 +margin-top: -16rpx;
  41 +}
  42 +/*未选中时的小圆点样式 */
  43 +.dot{
  44 +width: 16rpx;
  45 +height: 16rpx;
  46 +border-radius: 50%;
  47 +margin-right: 26rpx;
  48 +background-color:#CCCCCC;
  49 +}
  50 +/*选中以后的小圆点样式 */
  51 +.active{
  52 +width: 16rpx;
  53 +height: 16rpx;
  54 +border-radius:8rpx;
  55 +background-color: #FB7F47;
  56 +}
  57 +
  58 +/* 简介 */
  59 +.case_info {
  60 + width: 100%;
  61 + /* height:142rpx; */
  62 + background:rgba(240,131,12,1);
  63 + box-sizing: border-box;
  64 + padding: 30rpx;
  65 +}
  66 +.case_info .case_title {
  67 + font-size: 32rpx;
  68 + color: #FFFFFF;
  69 + font-weight: bold;
  70 + margin-bottom: 19rpx;
  71 +}
  72 +.lable_list_box {
  73 + display: flex;
  74 + justify-content: flex-start;
  75 + flex-wrap: wrap;
  76 +}
  77 +.lable_list_box .lable_list {
  78 + padding: 6rpx 14rpx;
  79 + border:1rpx solid rgba(255,255,255,1);
  80 + border-radius:6rpx;
  81 + color: #FFFFFF;
  82 + font-size: 20rpx;
  83 + margin-right: 20rpx;
  84 +}
  85 +
  86 +/* 详情 */
  87 +.case_info_lists {
  88 + margin-top: 17rpx;
  89 + width: 100%;
  90 + background: #FFFFFF;
  91 +}
  92 +.case_info_lists .case_info_title {
  93 + width: 100%;
  94 + height: 109rpx;
  95 + border-bottom: 1rpx solid #EBEBEB;
  96 + box-sizing: border-box;
  97 + padding: 0 222rpx;
  98 + display: flex;
  99 + justify-content: space-around;
  100 + /* align-items: center; */
  101 +}
  102 +.info_title_list {
  103 + font-size: 30rpx;
  104 + color: #333333;
  105 + position: relative;
  106 + height: 100%;
  107 + line-height: 109rpx;
  108 +}
  109 +.info_title_list.now {
  110 + color: rgba(240,131,12,1);
  111 +}
  112 +.info_title_list.now .line {
  113 + width:40rpx;
  114 + height:6rpx;
  115 + background:rgba(240,131,12,1);
  116 + position: absolute;
  117 + left: 50%;
  118 + margin-left: -20rpx;
  119 + bottom: 0;
  120 +}
  121 +
  122 +.info_box {
  123 + width: 100%;
  124 + box-sizing: border-box;
  125 + padding: 0 30rpx 250rpx;
  126 +}
  127 +.info_box .info_list {
  128 + width: 100%;
  129 +}
  130 +.info_list image {
  131 + width: 100%;
  132 +}
  133 +
  134 +
  135 +
  136 +
  137 +
  138 +
  139 +
  140 +
  141 +
  142 +
  143 +
  144 +
  145 +
  146 +
  147 +
  148 +
  149 +
  1 +// pages/caseList/caseList.js
  2 +Page({
  3 +
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 +
  9 + },
  10 +
  11 + /**
  12 + * 生命周期函数--监听页面加载
  13 + */
  14 + onLoad: function (options) {
  15 + wx.setNavigationBarTitle({
  16 + title: options.html,
  17 + })
  18 + },
  19 +
  20 + /**
  21 + * 生命周期函数--监听页面初次渲染完成
  22 + */
  23 + onReady: function () {
  24 +
  25 + },
  26 +
  27 + /**
  28 + * 生命周期函数--监听页面显示
  29 + */
  30 + onShow: function () {
  31 +
  32 + },
  33 +
  34 + /**
  35 + * 生命周期函数--监听页面隐藏
  36 + */
  37 + onHide: function () {
  38 +
  39 + },
  40 +
  41 + /**
  42 + * 生命周期函数--监听页面卸载
  43 + */
  44 + onUnload: function () {
  45 +
  46 + },
  47 +
  48 + /**
  49 + * 页面相关事件处理函数--监听用户下拉动作
  50 + */
  51 + onPullDownRefresh: function () {
  52 +
  53 + },
  54 +
  55 + /**
  56 + * 页面上拉触底事件的处理函数
  57 + */
  58 + onReachBottom: function () {
  59 +
  60 + },
  61 +
  62 + /**
  63 + * 用户点击右上角分享
  64 + */
  65 + onShareAppMessage: function () {
  66 +
  67 + }
  68 +})
  1 +{
  2 + "navigationBarTitleText": "政府案例"
  3 +}
  1 +<!--pages/caseList/caseList.wxml-->
  2 +<view class='case_list_wrap'>
  3 + <view class='case_list_box'>
  4 + <view class='case_list'>
  5 + <view class='case_top'>
  6 + <view class='case_title'>某政府科技金融中心</view>
  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>
  12 + </view>
  13 + </view>
  14 + <view class='case_list_content'>
  15 + <image src='../images/case_list.png'></image>
  16 + </view>
  17 + <view class='case_bottom_list'>
  18 + <view class='case_bottom_banner'>
  19 + <image mode='widthFix' src='../images/case_bottom_list01.png'></image>
  20 + </view>
  21 + <view class='case_bottom_banner'>
  22 + <image mode='widthFix' src='../images/case_bottom_list01.png'></image>
  23 + </view>
  24 + <view class='case_bottom_banner'>
  25 + <image mode='widthFix' src='../images/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'>某政府科技金融中心</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='../images/case_list.png'></image>
  41 + </view>
  42 + <view class='case_bottom_list'>
  43 + <view class='case_bottom_banner'>
  44 + <image mode='widthFix' src='../images/case_bottom_list01.png'></image>
  45 + </view>
  46 + <view class='case_bottom_banner'>
  47 + <image mode='widthFix' src='../images/case_bottom_list01.png'></image>
  48 + </view>
  49 + <view class='case_bottom_banner'>
  50 + <image mode='widthFix' src='../images/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'>某政府科技金融中心</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='../images/case_list.png'></image>
  66 + </view>
  67 + <view class='case_bottom_list'>
  68 + <view class='case_bottom_banner'>
  69 + <image mode='widthFix' src='../images/case_bottom_list01.png'></image>
  70 + </view>
  71 + <view class='case_bottom_banner'>
  72 + <image mode='widthFix' src='../images/case_bottom_list01.png'></image>
  73 + </view>
  74 + <view class='case_bottom_banner'>
  75 + <image mode='widthFix' src='../images/case_bottom_list01.png'></image>
  76 + </view>
  77 + </view>
  78 + </view>
  79 + <view class='case_list'>
  80 + <view class='case_top'>
  81 + <view class='case_title'>某政府科技金融中心</view>
  82 + <view class='case_lable_box'>
  83 + <view class='case_lable_list'>政府</view>
  84 + <view class='case_lable_list'>工作效率</view>
  85 + <view class='case_lable_list'>业务分析</view>
  86 + <view class='case_lable_list'>快速报表</view>
  87 + </view>
  88 + </view>
  89 + <view class='case_list_content'>
  90 + <image src='../images/case_list.png'></image>
  91 + </view>
  92 + <view class='case_bottom_list'>
  93 + <view class='case_bottom_banner'>
  94 + <image mode='widthFix' src='../images/case_bottom_list01.png'></image>
  95 + </view>
  96 + <view class='case_bottom_banner'>
  97 + <image mode='widthFix' src='../images/case_bottom_list01.png'></image>
  98 + </view>
  99 + <view class='case_bottom_banner'>
  100 + <image mode='widthFix' src='../images/case_bottom_list01.png'></image>
  101 + </view>
  102 + </view>
  103 + </view>
  104 + <view class='case_list'>
  105 + <view class='case_top'>
  106 + <view class='case_title'>某政府科技金融中心</view>
  107 + <view class='case_lable_box'>
  108 + <view class='case_lable_list'>政府</view>
  109 + <view class='case_lable_list'>工作效率</view>
  110 + <view class='case_lable_list'>业务分析</view>
  111 + <view class='case_lable_list'>快速报表</view>
  112 + </view>
  113 + </view>
  114 + <view class='case_list_content'>
  115 + <image src='../images/case_list.png'></image>
  116 + </view>
  117 + <view class='case_bottom_list'>
  118 + <view class='case_bottom_banner'>
  119 + <image mode='widthFix' src='../images/case_bottom_list01.png'></image>
  120 + </view>
  121 + <view class='case_bottom_banner'>
  122 + <image mode='widthFix' src='../images/case_bottom_list01.png'></image>
  123 + </view>
  124 + <view class='case_bottom_banner'>
  125 + <image mode='widthFix' src='../images/case_bottom_list01.png'></image>
  126 + </view>
  127 + <view class='case_bottom_banner'>
  128 + <image mode='widthFix' src='../images/case_bottom_list01.png'></image>
  129 + </view>
  130 + <view class='case_bottom_banner'>
  131 + <image mode='widthFix' src='../images/case_bottom_list01.png'></image>
  132 + </view>
  133 + </view>
  134 + </view>
  135 + </view>
  136 + <!-- 客服 -->
  137 + <view class='chat_peo'>
  138 + <button open-type="contact" class='contacButton'>
  139 + <image src='../images/chat_peo.png'></image>
  140 + </button>
  141 + </view>
  142 + <!-- 返回顶部 -->
  143 + <view class='chat_peo return_top' >
  144 + <image src='../images/dingbu.png'></image>
  145 + </view>
  146 +</view>
  1 +/* pages/caseList/caseList.wxss */
  2 +.case_list_wrap {
  3 + width: 100%;
  4 + /* height: 100%; */
  5 + background: #F0EFED;
  6 +}
  7 +.case_list_box {
  8 + width: 100%;
  9 + height: 100%;
  10 + box-sizing: border-box;
  11 + padding: 20rpx 30rpx;
  12 +}
  13 +.case_list {
  14 + background: #fff;
  15 + width: 100%;
  16 + border-radius: 10rpx;
  17 + margin-bottom: 20rpx;
  18 +}
  19 +.case_top {
  20 + width: 100%;
  21 + height: 166rpx;
  22 + box-sizing: border-box;
  23 + padding: 40rpx 24rpx 0;
  24 +}
  25 +.case_title {
  26 + font-size: 32rpx;
  27 + color: #000000;
  28 + font-weight: bold;
  29 + margin-bottom: 19rpx;
  30 +}
  31 +.case_lable_box {
  32 + display: flex;
  33 + justify-content: flex-start;
  34 + flex-wrap: wrap;
  35 +}
  36 +.case_lable_list {
  37 + padding: 6rpx 14rpx;
  38 + border-radius: 6rpx;
  39 + border:1px solid rgba(240,131,12,1);
  40 + color: rgba(240,131,12,1);
  41 + font-size: 20rpx;
  42 + margin-right: 20rpx;
  43 +}
  44 +.case_list_content {
  45 + width: 100%;
  46 + box-sizing: border-box;
  47 + padding: 30rpx 15rpx 0;
  48 + height: 465rpx;
  49 +}
  50 +.case_list_content image {
  51 + width: 100%;
  52 + height: 100%;
  53 +}
  54 +.case_bottom_list {
  55 + height: 206rpx;
  56 + padding: 10rpx 0 50rpx 10rpx;
  57 + display: flex;
  58 + overflow-x: scroll;
  59 + box-sizing: border-box;
  60 +}
  61 +.case_bottom_banner {
  62 + width: 236rpx;
  63 + height: 156rpx;
  64 + display: flex;
  65 + justify-content: center;
  66 + align-items: center;
  67 +}
  68 +.case_bottom_banner image {
  69 + width: 236rpx;
  70 +}
  71 +
  72 +
  73 +
  74 +
  75 +
  76 +
  77 +
  78 +
  79 +
  80 +
  81 +
  82 +
  83 +
  84 +
  85 +
  86 +
  87 +
  88 +
  89 +
  90 +
@@ -3,52 +3,40 @@ @@ -3,52 +3,40 @@
3 const app = getApp() 3 const app = getApp()
4 4
5 Page({ 5 Page({
6 - data: {  
7 - motto: 'Hello World',  
8 - userInfo: {},  
9 - hasUserInfo: false,  
10 - canIUse: wx.canIUse('button.open-type.getUserInfo')  
11 - },  
12 - //事件处理函数  
13 - bindViewTap: function() {  
14 - wx.navigateTo({  
15 - url: '../logs/logs'  
16 - })  
17 - },  
18 - onLoad: function () {  
19 - if (app.globalData.userInfo) {  
20 - this.setData({  
21 - userInfo: app.globalData.userInfo,  
22 - hasUserInfo: true  
23 - })  
24 - } else if (this.data.canIUse){  
25 - // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回  
26 - // 所以此处加入 callback 以防止这种情况  
27 - app.userInfoReadyCallback = res => {  
28 - this.setData({  
29 - userInfo: res.userInfo,  
30 - hasUserInfo: true 6 + data: {
  7 +
  8 + },
  9 + //事件处理函数
  10 + bindViewTap: function () {
  11 +
  12 + },
  13 + onLoad: function () {
  14 + //首先获取小程序实例,访问app.js中的函数
  15 + //调用show函数,传参
  16 + //注意:查看上面show函数定义查看参数含义
  17 + //第一个参数是当前的页面对象,方便函数setData直接返回数据
  18 + //第二个参数是绑定的数据名,传参给setData,详细见上面
  19 + //第三个参数是上下滑动的px,因为class="init"定义初始该元素向下偏移了200px,所以这里使其上移200px
  20 + //第四个参数是需要修改为的透明度,这里是1,表示从初始的class="init"中定义的透明度0修改到1
  21 + app.slideupshow(this, 'slide_up1', 0, 1);
  22 + app.sliderightshow(this, 'slide_up2', 0, 1);
  23 + },
  24 + getUserInfo: function (e) {
  25 +
  26 + },
  27 + tapName: function (e) {
  28 + wx.navigateTo({
  29 + url: '../case/case'
31 }) 30 })
32 - }  
33 - } else {  
34 - // 在没有 open-type=getUserInfo 版本的兼容处理  
35 - wx.getUserInfo({  
36 - success: res => {  
37 - app.globalData.userInfo = res.userInfo  
38 - this.setData({  
39 - userInfo: res.userInfo,  
40 - hasUserInfo: true  
41 - })  
42 - }  
43 - })  
44 - }  
45 - },  
46 - getUserInfo: function(e) {  
47 - console.log(e)  
48 - app.globalData.userInfo = e.detail.userInfo  
49 - this.setData({  
50 - userInfo: e.detail.userInfo,  
51 - hasUserInfo: true  
52 - })  
53 - } 31 + },
  32 + /**
  33 + * 页面上拉触底事件的处理函数
  34 + */
  35 + onReachBottom: function () {
  36 + wx.navigateTo({
  37 + url: '../case/case'
  38 + })
  39 + },
  40 +
  41 +
54 }) 42 })
  1 +{
  2 + "navigationBarTitleText": "锐网科技案例集锦"
  3 +}
1 <!--index.wxml--> 1 <!--index.wxml-->
2 <view class="container"> 2 <view class="container">
3 - <view class="userinfo">  
4 - <button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>  
5 - <block wx:else>  
6 - <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" background-size="cover"></image>  
7 - <text class="userinfo-nickname">{{userInfo.nickName}}</text>  
8 - </block>  
9 - </view>  
10 - <view class="usermotto">  
11 - <text class="user-motto">{{motto}}</text>  
12 - <view>1q1111111s</view>  
13 - </view> 3 + <view class='imgPolytope'>
  4 + <image src='../images/shouye.png'></image>
  5 + </view>
  6 + <view class='index_title'>
  7 + <view class='title init' animation="{{slide_up1}}">数据分析及可视化</view>
  8 + <view class='content contentInit' animation="{{slide_up2}}">大数据探索商业价值的无限可能</view>
  9 + </view>
  10 + <view class='drop_img' bindtap="tapName">
  11 + <image src='../images/drop.png'></image>
  12 + </view>
  13 +
14 </view> 14 </view>
1 /**index.wxss**/ 1 /**index.wxss**/
2 -.userinfo {  
3 - display: flex;  
4 - flex-direction: column;  
5 - align-items: center; 2 +.container {
  3 + width: 100%;
  4 + height: 100%;
  5 + background:linear-gradient(rgba(249,243,239,1),rgba(237,215,204,1));
6 } 6 }
7 -  
8 -.userinfo-avatar {  
9 - width: 128rpx;  
10 - height: 128rpx;  
11 - margin: 20rpx;  
12 - border-radius: 50%; 7 +.imgPolytope {
  8 + width: 519rpx;
  9 + height: 577rpx;
  10 + margin: 190rpx 0 0;
13 } 11 }
14 -  
15 -.userinfo-nickname {  
16 - color: #aaa; 12 +.imgPolytope image {
  13 + width: 100%;
  14 + height: 100%;
  15 +}
  16 +.index_title .title {
  17 + color: #000;
  18 + font-size: 46rpx;
  19 + margin-bottom: 31rpx;
  20 +}
  21 +.content {
  22 + color: #F0830C;
  23 + font-size: 26rpx;
  24 +}
  25 +.init {
  26 + opacity: 0;
  27 + transform: translateY(1000px);
  28 +}
  29 +.contentInit {
  30 + opacity: 0;
  31 + transform: translateX(1000px);
17 } 32 }
18 33
19 -.usermotto {  
20 - margin-top: 200px;  
21 -}  
1 { 1 {
2 "description": "项目配置文件。", 2 "description": "项目配置文件。",
3 "setting": { 3 "setting": {
4 - "urlCheck": true, 4 + "urlCheck": false,
5 "es6": true, 5 "es6": true,
6 "postcss": true, 6 "postcss": true,
7 "minified": true, 7 "minified": true,
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 "compileType": "miniprogram", 10 "compileType": "miniprogram",
11 "libVersion": "1.6.6", 11 "libVersion": "1.6.6",
12 "appid": "wxd88427f7f68c3da4", 12 "appid": "wxd88427f7f68c3da4",
13 - "projectname": "ruiwang", 13 + "projectname": "rw",
14 "condition": { 14 "condition": {
15 "search": { 15 "search": {
16 "current": -1, 16 "current": -1,
  1 +/**
  2 + * html2Json 改造来自: https://github.com/Jxck/html2json
  3 + *
  4 + *
  5 + * author: Di (微信小程序开发工程师)
  6 + * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
  7 + * 垂直微信小程序开发交流社区
  8 + *
  9 + * github地址: https://github.com/icindy/wxParse
  10 + *
  11 + * for: 微信小程序富文本解析
  12 + * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
  13 + */
  14 +
  15 +var __placeImgeUrlHttps = "https";
  16 +var __emojisReg = '';
  17 +var __emojisBaseSrc = '';
  18 +var __emojis = {};
  19 +var wxDiscode = require('./wxDiscode.js');
  20 +var HTMLParser = require('./htmlparser.js');
  21 +// Empty Elements - HTML 5
  22 +var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");
  23 +// Block Elements - HTML 5
  24 +var block = makeMap("br,a,code,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video");
  25 +
  26 +// Inline Elements - HTML 5
  27 +var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
  28 +
  29 +// Elements that you can, intentionally, leave open
  30 +// (and which close themselves)
  31 +var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
  32 +
  33 +// Attributes that have their values filled in disabled="disabled"
  34 +var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
  35 +
  36 +// Special Elements (can contain anything)
  37 +var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block");
  38 +function makeMap(str) {
  39 + var obj = {}, items = str.split(",");
  40 + for (var i = 0; i < items.length; i++)
  41 + obj[items[i]] = true;
  42 + return obj;
  43 +}
  44 +
  45 +function q(v) {
  46 + return '"' + v + '"';
  47 +}
  48 +
  49 +function removeDOCTYPE(html) {
  50 + return html
  51 + .replace(/<\?xml.*\?>\n/, '')
  52 + .replace(/<.*!doctype.*\>\n/, '')
  53 + .replace(/<.*!DOCTYPE.*\>\n/, '');
  54 +}
  55 +
  56 +function trimHtml(html) {
  57 + return html
  58 + .replace(/\r?\n+/g, '')
  59 + .replace(/<!--.*?-->/ig, '')
  60 + .replace(/\/\*.*?\*\//ig, '')
  61 + .replace(/[ ]+</ig, '<')
  62 +}
  63 +
  64 +
  65 +function html2json(html, bindName) {
  66 + //处理字符串
  67 + html = removeDOCTYPE(html);
  68 + html = trimHtml(html);
  69 + html = wxDiscode.strDiscode(html);
  70 + //生成node节点
  71 + var bufArray = [];
  72 + var results = {
  73 + node: bindName,
  74 + nodes: [],
  75 + images:[],
  76 + imageUrls:[]
  77 + };
  78 + var index = 0;
  79 + HTMLParser(html, {
  80 + start: function (tag, attrs, unary) {
  81 + //debug(tag, attrs, unary);
  82 + // node for this element
  83 + var node = {
  84 + node: 'element',
  85 + tag: tag,
  86 + };
  87 +
  88 + if (bufArray.length === 0) {
  89 + node.index = index.toString()
  90 + index += 1
  91 + } else {
  92 + var parent = bufArray[0];
  93 + if (parent.nodes === undefined) {
  94 + parent.nodes = [];
  95 + }
  96 + node.index = parent.index + '.' + parent.nodes.length
  97 + }
  98 +
  99 + if (block[tag]) {
  100 + node.tagType = "block";
  101 + } else if (inline[tag]) {
  102 + node.tagType = "inline";
  103 + } else if (closeSelf[tag]) {
  104 + node.tagType = "closeSelf";
  105 + }
  106 +
  107 + if (attrs.length !== 0) {
  108 + node.attr = attrs.reduce(function (pre, attr) {
  109 + var name = attr.name;
  110 + var value = attr.value;
  111 + if (name == 'class') {
  112 + // console.dir(value);
  113 + // value = value.join("")
  114 + node.classStr = value;
  115 + }
  116 + // has multi attibutes
  117 + // make it array of attribute
  118 + if (name == 'style') {
  119 + // console.dir(value);
  120 + // value = value.join("")
  121 + node.styleStr = value;
  122 + }
  123 + if (value.match(/ /)) {
  124 + value = value.split(' ');
  125 + }
  126 +
  127 +
  128 + // if attr already exists
  129 + // merge it
  130 + if (pre[name]) {
  131 + if (Array.isArray(pre[name])) {
  132 + // already array, push to last
  133 + pre[name].push(value);
  134 + } else {
  135 + // single value, make it array
  136 + pre[name] = [pre[name], value];
  137 + }
  138 + } else {
  139 + // not exist, put it
  140 + pre[name] = value;
  141 + }
  142 +
  143 + return pre;
  144 + }, {});
  145 + }
  146 +
  147 + //对img添加额外数据
  148 + if (node.tag === 'img') {
  149 + node.imgIndex = results.images.length;
  150 + var imgUrl = node.attr.src;
  151 + if (imgUrl[0] == '') {
  152 + imgUrl.splice(0, 1);
  153 + }
  154 + imgUrl = wxDiscode.urlToHttpUrl(imgUrl, __placeImgeUrlHttps);
  155 + node.attr.src = imgUrl;
  156 + node.from = bindName;
  157 + results.images.push(node);
  158 + results.imageUrls.push(imgUrl);
  159 + }
  160 +
  161 + // 处理font标签样式属性
  162 + if (node.tag === 'font') {
  163 + var fontSize = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large'];
  164 + var styleAttrs = {
  165 + 'color': 'color',
  166 + 'face': 'font-family',
  167 + 'size': 'font-size'
  168 + };
  169 + if (!node.attr.style) node.attr.style = [];
  170 + if (!node.styleStr) node.styleStr = '';
  171 + for (var key in styleAttrs) {
  172 + if (node.attr[key]) {
  173 + var value = key === 'size' ? fontSize[node.attr[key]-1] : node.attr[key];
  174 + node.attr.style.push(styleAttrs[key]);
  175 + node.attr.style.push(value);
  176 + node.styleStr += styleAttrs[key] + ': ' + value + ';';
  177 + }
  178 + }
  179 + }
  180 +
  181 + //临时记录source资源
  182 + if(node.tag === 'source'){
  183 + results.source = node.attr.src;
  184 + }
  185 +
  186 + if (unary) {
  187 + // if this tag doesn't have end tag
  188 + // like <img src="hoge.png"/>
  189 + // add to parents
  190 + var parent = bufArray[0] || results;
  191 + if (parent.nodes === undefined) {
  192 + parent.nodes = [];
  193 + }
  194 + parent.nodes.push(node);
  195 + } else {
  196 + bufArray.unshift(node);
  197 + }
  198 + },
  199 + end: function (tag) {
  200 + //debug(tag);
  201 + // merge into parent tag
  202 + var node = bufArray.shift();
  203 + if (node.tag !== tag) console.error('invalid state: mismatch end tag');
  204 +
  205 + //当有缓存source资源时于于video补上src资源
  206 + if(node.tag === 'video' && results.source){
  207 + node.attr.src = results.source;
  208 + delete results.source;
  209 + }
  210 +
  211 + if (bufArray.length === 0) {
  212 + results.nodes.push(node);
  213 + } else {
  214 + var parent = bufArray[0];
  215 + if (parent.nodes === undefined) {
  216 + parent.nodes = [];
  217 + }
  218 + parent.nodes.push(node);
  219 + }
  220 + },
  221 + chars: function (text) {
  222 + //debug(text);
  223 + var node = {
  224 + node: 'text',
  225 + text: text,
  226 + textArray:transEmojiStr(text)
  227 + };
  228 +
  229 + if (bufArray.length === 0) {
  230 + node.index = index.toString()
  231 + index += 1
  232 + results.nodes.push(node);
  233 + } else {
  234 + var parent = bufArray[0];
  235 + if (parent.nodes === undefined) {
  236 + parent.nodes = [];
  237 + }
  238 + node.index = parent.index + '.' + parent.nodes.length
  239 + parent.nodes.push(node);
  240 + }
  241 + },
  242 + comment: function (text) {
  243 + //debug(text);
  244 + // var node = {
  245 + // node: 'comment',
  246 + // text: text,
  247 + // };
  248 + // var parent = bufArray[0];
  249 + // if (parent.nodes === undefined) {
  250 + // parent.nodes = [];
  251 + // }
  252 + // parent.nodes.push(node);
  253 + },
  254 + });
  255 + return results;
  256 +};
  257 +
  258 +function transEmojiStr(str){
  259 + // var eReg = new RegExp("["+__reg+' '+"]");
  260 +// str = str.replace(/\[([^\[\]]+)\]/g,':$1:')
  261 +
  262 + var emojiObjs = [];
  263 + //如果正则表达式为空
  264 + if(__emojisReg.length == 0 || !__emojis){
  265 + var emojiObj = {}
  266 + emojiObj.node = "text";
  267 + emojiObj.text = str;
  268 + array = [emojiObj];
  269 + return array;
  270 + }
  271 + //这个地方需要调整
  272 + str = str.replace(/\[([^\[\]]+)\]/g,':$1:')
  273 + var eReg = new RegExp("[:]");
  274 + var array = str.split(eReg);
  275 + for(var i = 0; i < array.length; i++){
  276 + var ele = array[i];
  277 + var emojiObj = {};
  278 + if(__emojis[ele]){
  279 + emojiObj.node = "element";
  280 + emojiObj.tag = "emoji";
  281 + emojiObj.text = __emojis[ele];
  282 + emojiObj.baseSrc= __emojisBaseSrc;
  283 + }else{
  284 + emojiObj.node = "text";
  285 + emojiObj.text = ele;
  286 + }
  287 + emojiObjs.push(emojiObj);
  288 + }
  289 +
  290 + return emojiObjs;
  291 +}
  292 +
  293 +function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){
  294 + __emojisReg = reg;
  295 + __emojisBaseSrc=baseSrc;
  296 + __emojis=emojis;
  297 +}
  298 +
  299 +module.exports = {
  300 + html2json: html2json,
  301 + emojisInit:emojisInit
  302 +};
  303 +
  1 +/**
  2 + *
  3 + * htmlParser改造自: https://github.com/blowsie/Pure-JavaScript-HTML5-Parser
  4 + *
  5 + * author: Di (微信小程序开发工程师)
  6 + * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
  7 + * 垂直微信小程序开发交流社区
  8 + *
  9 + * github地址: https://github.com/icindy/wxParse
  10 + *
  11 + * for: 微信小程序富文本解析
  12 + * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
  13 + */
  14 +// Regular Expressions for parsing tags and attributes
  15 +var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,
  16 + endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/,
  17 + attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
  18 +
  19 +// Empty Elements - HTML 5
  20 +var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");
  21 +
  22 +// Block Elements - HTML 5
  23 +var block = makeMap("a,address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video");
  24 +
  25 +// Inline Elements - HTML 5
  26 +var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
  27 +
  28 +// Elements that you can, intentionally, leave open
  29 +// (and which close themselves)
  30 +var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
  31 +
  32 +// Attributes that have their values filled in disabled="disabled"
  33 +var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");
  34 +
  35 +// Special Elements (can contain anything)
  36 +var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block");
  37 +
  38 +function HTMLParser(html, handler) {
  39 + var index, chars, match, stack = [], last = html;
  40 + stack.last = function () {
  41 + return this[this.length - 1];
  42 + };
  43 +
  44 + while (html) {
  45 + chars = true;
  46 +
  47 + // Make sure we're not in a script or style element
  48 + if (!stack.last() || !special[stack.last()]) {
  49 +
  50 + // Comment
  51 + if (html.indexOf("<!--") == 0) {
  52 + index = html.indexOf("-->");
  53 +
  54 + if (index >= 0) {
  55 + if (handler.comment)
  56 + handler.comment(html.substring(4, index));
  57 + html = html.substring(index + 3);
  58 + chars = false;
  59 + }
  60 +
  61 + // end tag
  62 + } else if (html.indexOf("</") == 0) {
  63 + match = html.match(endTag);
  64 +
  65 + if (match) {
  66 + html = html.substring(match[0].length);
  67 + match[0].replace(endTag, parseEndTag);
  68 + chars = false;
  69 + }
  70 +
  71 + // start tag
  72 + } else if (html.indexOf("<") == 0) {
  73 + match = html.match(startTag);
  74 +
  75 + if (match) {
  76 + html = html.substring(match[0].length);
  77 + match[0].replace(startTag, parseStartTag);
  78 + chars = false;
  79 + }
  80 + }
  81 +
  82 + if (chars) {
  83 + index = html.indexOf("<");
  84 + var text = ''
  85 + while (index === 0) {
  86 + text += "<";
  87 + html = html.substring(1);
  88 + index = html.indexOf("<");
  89 + }
  90 + text += index < 0 ? html : html.substring(0, index);
  91 + html = index < 0 ? "" : html.substring(index);
  92 +
  93 + if (handler.chars)
  94 + handler.chars(text);
  95 + }
  96 +
  97 + } else {
  98 +
  99 + html = html.replace(new RegExp("([\\s\\S]*?)<\/" + stack.last() + "[^>]*>"), function (all, text) {
  100 + text = text.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g, "$1$2");
  101 + if (handler.chars)
  102 + handler.chars(text);
  103 +
  104 + return "";
  105 + });
  106 +
  107 +
  108 + parseEndTag("", stack.last());
  109 + }
  110 +
  111 + if (html == last)
  112 + throw "Parse Error: " + html;
  113 + last = html;
  114 + }
  115 +
  116 + // Clean up any remaining tags
  117 + parseEndTag();
  118 +
  119 + function parseStartTag(tag, tagName, rest, unary) {
  120 + tagName = tagName.toLowerCase();
  121 +
  122 + if (block[tagName]) {
  123 + while (stack.last() && inline[stack.last()]) {
  124 + parseEndTag("", stack.last());
  125 + }
  126 + }
  127 +
  128 + if (closeSelf[tagName] && stack.last() == tagName) {
  129 + parseEndTag("", tagName);
  130 + }
  131 +
  132 + unary = empty[tagName] || !!unary;
  133 +
  134 + if (!unary)
  135 + stack.push(tagName);
  136 +
  137 + if (handler.start) {
  138 + var attrs = [];
  139 +
  140 + rest.replace(attr, function (match, name) {
  141 + var value = arguments[2] ? arguments[2] :
  142 + arguments[3] ? arguments[3] :
  143 + arguments[4] ? arguments[4] :
  144 + fillAttrs[name] ? name : "";
  145 +
  146 + attrs.push({
  147 + name: name,
  148 + value: value,
  149 + escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') //"
  150 + });
  151 + });
  152 +
  153 + if (handler.start) {
  154 + handler.start(tagName, attrs, unary);
  155 + }
  156 +
  157 + }
  158 + }
  159 +
  160 + function parseEndTag(tag, tagName) {
  161 + // If no tag name is provided, clean shop
  162 + if (!tagName)
  163 + var pos = 0;
  164 +
  165 + // Find the closest opened tag of the same type
  166 + else {
  167 + tagName = tagName.toLowerCase();
  168 + for (var pos = stack.length - 1; pos >= 0; pos--)
  169 + if (stack[pos] == tagName)
  170 + break;
  171 + }
  172 + if (pos >= 0) {
  173 + // Close all the open elements, up the stack
  174 + for (var i = stack.length - 1; i >= pos; i--)
  175 + if (handler.end)
  176 + handler.end(stack[i]);
  177 +
  178 + // Remove the open elements from the stack
  179 + stack.length = pos;
  180 + }
  181 + }
  182 +};
  183 +
  184 +
  185 +function makeMap(str) {
  186 + var obj = {}, items = str.split(",");
  187 + for (var i = 0; i < items.length; i++)
  188 + obj[items[i]] = true;
  189 + return obj;
  190 +}
  191 +
  192 +module.exports = HTMLParser;